From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: Michael Snyder <msnyder@cygnus.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Further extend "maint info sections" cmd with ALLOBJ
Date: Fri, 21 Dec 2001 04:32:00 -0000 [thread overview]
Message-ID: <4.2.0.58.20011221115947.01848210@ics.u-strasbg.fr> (raw)
In-Reply-To: <4.2.0.58.20011221115135.00acb908@ics.u-strasbg.fr>
At 11:53 21/12/2001 , Pierre Muller a écrit:
>At 23:30 20/12/2001 , Michael Snyder a écrit:
>
> >As a further extension, the "maint info sections" command
> >will now accept an argument "ALLOBJ" to iterate over all
> >known object files (which includes shared libraries.
> >You can now do (for instance):
> >
> > (gdb) maint info sect .bss ALLOBJ
> >
> >to see info on the .bss sections of all loaded object files.
>
>Great job!
>
> Just a little remark, I would have expected that I get the same output
>for the main executable in
>
>"maint info sect"
>and
>"maint info sect ALLOBJ"
>but when I tried it out on a freshly compiled GDB,
>the seciond command didn't should
>the .stab and .stabstr sections that were shown for the first command.
>
>This is intentional?
The problem might be quite general :
maint info sect NEVER_LOAD
gives the same output than
maint info sect HAS_CONTENT
Debugging a little more lead me to find out that
the reason of that bug is simply that
NEVER_LOAD contains LOAD,
ans strstr function returns thus true for strstr(string, "LOAD")
if string is "NEVER_LOAD"
I don't know the best way to solve this
especially as someone could ask for both
LOAD and NEVER_LOAD flags at the same time.
(maybe adding a space a start of args and looking for ' LOAD' with a leading space).
Anyhow the current code also accepts thingss like NOCODE for CODE section
which is quite strange...)
To come back to the problem about .stab section,
the problem is related to the fact that
ALL_OBJFILE_OSECTIONS
is defined as
#define ALL_OBJFILE_OSECTIONS(objfile, osect) \
for (osect = objfile->sections; osect < objfile->sections_end; osect++)
whereas the case without ALLOBJ is handled by a call to
bfd_map_over_sections () function which does iterate in a different way:
for (sect = abfd->sections; sect != NULL; i++, sect = sect->next)
Wouldn't it be better to use the same bfd_map_over_sections ()
function in the ALLOBJ case?
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
next prev parent reply other threads:[~2001-12-21 12:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-20 14:35 Michael Snyder
2001-12-21 2:55 ` Pierre Muller
2001-12-21 4:32 ` Pierre Muller [this message]
2001-12-21 8:58 ` Michael Snyder
2001-12-21 9:36 ` Michael Snyder
2001-12-21 8:51 ` Michael Snyder
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=4.2.0.58.20011221115947.01848210@ics.u-strasbg.fr \
--to=muller@cerbere.u-strasbg.fr \
--cc=gdb-patches@sources.redhat.com \
--cc=msnyder@cygnus.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