From: "Joseph S. Myers" <joseph@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Fix solib-svr4.c:enable_break fallback for powerpc64-linux function descriptors
Date: Tue, 10 Nov 2009 21:07:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.64.0911102106140.4797@digraph.polyomino.org.uk> (raw)
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,
+ ¤t_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,
+ ¤t_target);
+ create_solib_event_breakpoint (target_gdbarch, sym_addr);
return 1;
}
}
--
Joseph S. Myers
joseph@codesourcery.com
next reply other threads:[~2009-11-10 21:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 21:07 Joseph S. Myers [this message]
2009-11-10 21:34 ` Joel Brobecker
2009-11-12 14:58 ` Kevin Buettner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0911102106140.4797@digraph.polyomino.org.uk \
--to=joseph@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox