This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] "maint print psymbols" with large section tables
- To: eliz at is dot elta dot co dot il
- Subject: Re: [RFA] "maint print psymbols" with large section tables
- From: Michael Elizabeth Chastain <chastain at cygnus dot com>
- Date: Thu, 1 Mar 2001 10:12:52 -0800
- Cc: gdb-patches at sourceware dot cygnus dot com
Eli Zaretskii writes:
> I don't like removing features, unless we know for a fact that no one
> uses them. In my experience, many times a feature is requested
> shortly after it is removed ;-)
I don't like removing features, either. That's why I'm not removing any
features. The new output has all the information content of the old
output.
> Is it possible that someone would want to see the zero entries as
> well? If so, I think we should at least leave behind some option that
> could be used to see all the entries, albeit in a different format
> (one per line).
I print the index on each line:
! fprintf_filtered (outfile, "%5d ", i);
! print_address_numeric (offset, 1, outfile);
! fprintf_filtered (outfile, "\n");
See the attached output. Note that the current output will be hard to
use when gdb is fixed to handle 900+ sections.
> Also, if this patch is accepted, please update the docs of "maint print
> psymbols" in gdb.texinfo. It should at least say that zero entries are
> skipped.
The documentation says:
If you use @samp{maint print psymbols} instead, the dump shows
information about symbols that @value{GDBN} only knows partially---that
is, symbols defined in files that @value{GDBN} has skimmed, but not yet
read completely.
It doesn't describe the format of the section offset table now, so I
don't think it needs to be changed.
Michael
===
The first two examples are from Linux native.
[1] Here is gdb printing a section offset table:
Read from object file /lib/libm.so.6 (0x8465c08)
Relocate symbols by 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x4005c000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
[2] Here is gdb + sparse table printing patch:
Read from object file /lib/libm.so.6 (0x8466400)
Section offset table
0 0x4005c000
1 0x4005c000
2 0x4005c000
3 0x4005c000
4 0x4005c000
5 0x4005c000
6 0x4005c000
7 0x4005c000
8 0x4005c000
9 0x4005c000
10 0x4005c000
11 0x4005c000
12 0x4005c000
13 0x4005c000
14 0x4005c000
15 0x4005c000
16 0x4005c000
17 0x4005c000
18 0x4005c000
19 0x4005c000
20 0x4005c000
21 0x4005c000
A Solaris native gdb has 945 sections. Right now, gdb uses a
64-element table (which leads to incorrect results, PR gdb/29).
When I patch gdb to use a larger table, or a dynamically-sized table,
the single-line format becomes unusable.