Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Fix solib-svr4.c:enable_break fallback for powerpc64-linux function  descriptors
@ 2009-11-10 21:07 Joseph S. Myers
  2009-11-10 21:34 ` Joel Brobecker
  2009-11-12 14:58 ` Kevin Buettner
  0 siblings, 2 replies; 3+ messages in thread
From: Joseph S. Myers @ 2009-11-10 21:07 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix solib-svr4.c:enable_break fallback for powerpc64-linux  function  descriptors
  2009-11-10 21:07 Fix solib-svr4.c:enable_break fallback for powerpc64-linux function descriptors Joseph S. Myers
@ 2009-11-10 21:34 ` Joel Brobecker
  2009-11-12 14:58 ` Kevin Buettner
  1 sibling, 0 replies; 3+ messages in thread
From: Joel Brobecker @ 2009-11-10 21:34 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gdb-patches

> 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.

Looks good to me.

Thanks for the patch,
-- 
Joel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix solib-svr4.c:enable_break fallback for powerpc64-linux  function  descriptors
  2009-11-10 21:07 Fix solib-svr4.c:enable_break fallback for powerpc64-linux function descriptors Joseph S. Myers
  2009-11-10 21:34 ` Joel Brobecker
@ 2009-11-12 14:58 ` Kevin Buettner
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Buettner @ 2009-11-12 14:58 UTC (permalink / raw)
  To: gdb-patches

On Tue, 10 Nov 2009 21:07:03 +0000 (UTC)
"Joseph S. Myers" <joseph@codesourcery.com> wrote:

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

Okay.

Kevin


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-12 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-10 21:07 Fix solib-svr4.c:enable_break fallback for powerpc64-linux function descriptors Joseph S. Myers
2009-11-10 21:34 ` Joel Brobecker
2009-11-12 14:58 ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox