From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: tromey@redhat.com, Pedro Alves <pedro@codesourcery.com>,
gdb-patches@sourceware.org
Subject: Re: [patch] Fix a crash when displaying variables from shared library.
Date: Fri, 06 Mar 2009 18:31:00 -0000 [thread overview]
Message-ID: <8ac60eac0903061031n82e758cp1b56bf374a3de838@mail.gmail.com> (raw)
In-Reply-To: <20090306174822.GJ3744@adacore.com>
[-- Attachment #1: Type: text/plain, Size: 903 bytes --]
On Fri, Mar 6, 2009 at 9:48 AM, Joel Brobecker <brobecker@adacore.com> wrote:
> (On a side note - I think that "solib_address" is a bad name.
> Independently of this change, we should think about changing it
> to "solib_name_from_address" one of these days).
Attached patch does that.
I didn't touch similarly mis-named xcoff_solib_address, because I can't
see any use of that symbol. Perhaps it should be deleted?
If it's a debug-only helper, I can rename it and add a comment to that
effect.
Thanks,
--
Paul Pluzhnikov
2009-03-06 Paul Pluzhnikov <ppluzhnikov@google.com>
Rename solib_address to solib_name_from_address.
* breakpoint.c (insert_bp_location, disable_breakpoints_in_shlibs)
(disable_breakpoints_in_unloaded_shlib): Update.
* printcmd.c (display_uses_solib_p): Likewise.
* stack.c (print_frame): Likewise.
* solib.c: Rename.
* solib.h: Rename.
[-- Attachment #2: gdb-rename-solib-20090306.txt --]
[-- Type: text/plain, Size: 4358 bytes --]
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.381
diff -u -p -u -r1.381 breakpoint.c
--- breakpoint.c 5 Mar 2009 22:37:10 -0000 1.381
+++ breakpoint.c 6 Mar 2009 18:23:46 -0000
@@ -1160,7 +1160,7 @@ Note: automatically using hardware break
if (val)
{
/* Can't set the breakpoint. */
- if (solib_address (bpt->address))
+ if (solib_name_from_address (bpt->address))
{
/* See also: disable_breakpoints_in_shlibs. */
val = 0;
@@ -1629,7 +1629,7 @@ remove_breakpoint (struct bp_location *b
/* In some cases, we might not be able to remove a breakpoint
in a shared library that has already been removed, but we
have not yet processed the shlib unload event. */
- if (val && solib_address (b->address))
+ if (val && solib_name_from_address (b->address))
val = 0;
if (val)
@@ -4439,7 +4439,7 @@ disable_breakpoints_in_shlibs (void)
#ifdef PC_SOLIB
&& PC_SOLIB (loc->address)
#else
- && solib_address (loc->address)
+ && solib_name_from_address (loc->address)
#endif
)
{
@@ -4475,7 +4475,7 @@ disable_breakpoints_in_unloaded_shlib (s
#ifdef PC_SOLIB
char *so_name = PC_SOLIB (loc->address);
#else
- char *so_name = solib_address (loc->address);
+ char *so_name = solib_name_from_address (loc->address);
#endif
if (so_name && !strcmp (so_name, solib->so_name))
{
Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.145
diff -u -p -u -r1.145 printcmd.c
--- printcmd.c 5 Mar 2009 23:45:14 -0000 1.145
+++ printcmd.c 6 Mar 2009 18:23:46 -0000
@@ -1767,7 +1767,7 @@ display_uses_solib_p (const struct displ
struct expression *const exp = d->exp;
if (d->block != NULL
- && solib_address (d->block->startaddr) == solib->so_name)
+ && solib_name_from_address (d->block->startaddr) == solib->so_name)
return 1;
for (i = 0; i < exp->nelts; )
@@ -1783,7 +1783,7 @@ display_uses_solib_p (const struct displ
SYMBOL_OBJ_SECTION (symbol);
if (block != NULL
- && solib_address (block->startaddr) == solib->so_name)
+ && solib_name_from_address (block->startaddr) == solib->so_name)
return 1;
if (section && section->objfile == solib->objfile)
Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.112
diff -u -p -u -r1.112 solib.c
--- solib.c 5 Mar 2009 23:45:14 -0000 1.112
+++ solib.c 6 Mar 2009 18:23:46 -0000
@@ -838,11 +838,12 @@ info_sharedlibrary_command (char *ignore
GLOBAL FUNCTION
- solib_address -- check to see if an address is in a shared lib
+ solib_name_from_address -- if an address is in a shared lib, return
+ its name.
SYNOPSIS
- char * solib_address (CORE_ADDR address)
+ char * solib_name_from_address (CORE_ADDR address)
DESCRIPTION
@@ -856,7 +857,7 @@ info_sharedlibrary_command (char *ignore
*/
char *
-solib_address (CORE_ADDR address)
+solib_name_from_address (CORE_ADDR address)
{
struct so_list *so = 0; /* link map state variable */
Index: solib.h
===================================================================
RCS file: /cvs/src/src/gdb/solib.h,v
retrieving revision 1.21
diff -u -p -u -r1.21 solib.h
--- solib.h 3 Jan 2009 05:57:53 -0000 1.21
+++ solib.h 6 Mar 2009 18:23:46 -0000
@@ -45,7 +45,7 @@ extern void solib_create_inferior_hook (
/* If ADDR lies in a shared library, return its name. */
-extern char *solib_address (CORE_ADDR);
+extern char *solib_name_from_address (CORE_ADDR);
/* Return 1 if PC lies in the dynamic symbol resolution code of the
run time loader. */
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.185
diff -u -p -u -r1.185 stack.c
--- stack.c 11 Feb 2009 16:07:28 -0000 1.185
+++ stack.c 6 Mar 2009 18:23:46 -0000
@@ -730,7 +730,7 @@ print_frame (struct frame_info *frame, i
#ifdef PC_SOLIB
char *lib = PC_SOLIB (get_frame_pc (frame));
#else
- char *lib = solib_address (get_frame_pc (frame));
+ char *lib = solib_name_from_address (get_frame_pc (frame));
#endif
if (lib)
{
next prev parent reply other threads:[~2009-03-06 18:31 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-05 3:03 Paul Pluzhnikov
2009-02-06 21:38 ` Tom Tromey
2009-02-07 2:37 ` Paul Pluzhnikov
2009-02-11 1:46 ` Tom Tromey
2009-02-19 1:00 ` Paul Pluzhnikov
2009-02-19 7:52 ` Paul Pluzhnikov
2009-02-23 1:47 ` Joel Brobecker
2009-02-23 18:36 ` Paul Pluzhnikov
2009-03-03 2:31 ` Paul Pluzhnikov
2009-03-04 0:51 ` Tom Tromey
2009-03-04 19:26 ` Paul Pluzhnikov
2009-03-05 20:04 ` Joel Brobecker
2009-03-05 23:46 ` Paul Pluzhnikov
2009-03-06 3:06 ` Paul Pluzhnikov
2009-03-06 3:18 ` Paul Pluzhnikov
2009-03-06 17:48 ` Joel Brobecker
2009-03-06 18:31 ` Paul Pluzhnikov [this message]
2009-03-06 18:47 ` Joel Brobecker
2009-03-06 18:52 ` Paul Pluzhnikov
2009-03-06 22:06 ` Paul Pluzhnikov
2009-03-09 18:33 ` Joel Brobecker
2009-03-10 2:05 ` Paul Pluzhnikov
2009-03-10 14:31 ` Daniel Jacobowitz
2009-03-12 2:45 ` Paul Pluzhnikov
2009-03-20 20:32 ` Joel Brobecker
2009-03-20 20:53 ` Paul Pluzhnikov
2009-03-23 17:31 ` Joel Brobecker
2009-03-18 2:50 ` Pedro Alves
2009-03-18 3:24 ` [patch] Fix a crash when displaying variables from shared ?library Joel Brobecker
2009-03-18 4:06 ` Paul Pluzhnikov
2009-03-18 4:19 ` Pedro Alves
2009-03-18 6:54 ` Paul Pluzhnikov
2009-03-18 17:32 ` Pedro Alves
2009-02-06 21:53 ` [patch] Fix a crash when displaying variables from shared library Pedro Alves
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=8ac60eac0903061031n82e758cp1b56bf374a3de838@mail.gmail.com \
--to=ppluzhnikov@google.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
--cc=tromey@redhat.com \
/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