This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix solib-svr4.c:enable_break fallback for powerpc64-linux function descriptors


The fallback code at the end of solib-svr4.c:enable_break, looking
through lists of symbol names to find one at which to set a
breakpoint, failed to call gdbarch_convert_from_func_ptr_addr on the
resulting addresses, so causing breakpoints on 64-bit Power GNU/Linux
to be set on the function descriptors in the .opd section instead of
on the actual code, if for any reason the previous code to find the
dynamic linker breakpoint function failed and so this fallback code
was reached.  This patch fixes this in the obvious way, adding the
missing calls.  Tested with cross to powerpc64-linux-gnu.  OK to
commit?

2009-11-10  Joseph Myers  <joseph@codesourcery.com>

	* solib-svr4.c (enable_break): Call
	gdbarch_convert_from_func_ptr_addr on results of looking up
	fallback symbol names.

Index: gdb/solib-svr4.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-svr4.c,v
retrieving revision 1.106
diff -u -p -r1.106 solib-svr4.c
--- gdb/solib-svr4.c	19 Oct 2009 09:51:42 -0000	1.106
+++ gdb/solib-svr4.c	10 Nov 2009 21:04:42 -0000
@@ -1436,8 +1436,11 @@ enable_break (struct svr4_info *info)
       msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile);
       if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0))
 	{
-	  create_solib_event_breakpoint (target_gdbarch,
-					 SYMBOL_VALUE_ADDRESS (msymbol));
+	  sym_addr = SYMBOL_VALUE_ADDRESS (msymbol);
+	  sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
+							 sym_addr,
+							 &current_target);
+	  create_solib_event_breakpoint (target_gdbarch, sym_addr);
 	  return 1;
 	}
     }
@@ -1447,8 +1450,11 @@ enable_break (struct svr4_info *info)
       msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile);
       if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0))
 	{
-	  create_solib_event_breakpoint (target_gdbarch,
-					 SYMBOL_VALUE_ADDRESS (msymbol));
+	  sym_addr = SYMBOL_VALUE_ADDRESS (msymbol);
+	  sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
+							 sym_addr,
+							 &current_target);
+	  create_solib_event_breakpoint (target_gdbarch, sym_addr);
 	  return 1;
 	}
     }

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]