This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 5/6] Add validity bits for psymtab high and low fields
- From: Tom Tromey <tom at tromey dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Tue, 05 Jun 2018 11:25:14 -0600
- Subject: Re: [RFA 5/6] Add validity bits for psymtab high and low fields
- References: <20180503223621.22544-1-tom@tromey.com> <20180503223621.22544-6-tom@tromey.com> <9b460d82-3c69-21dd-eb9e-1c4598e8e9a8@redhat.com>
>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
>> * dbxread.c (end_psymtab): Use texthigh_valid and textlow_valid.
Keith> Does this line not also qualify for texthigh_valid:
Keith> if (PSYMTAB_TEXTHIGH (pst) == 0 && last_function_name
Keith> && gdbarch_sofun_address_maybe_missing (gdbarch))
Keith> ?
This is a bit obscure, and I'm not totally sure it is correct. The idea
is that this only happens in a pathological case, which we want to
detect. There is a comment there:
/* Under Solaris, the N_SO symbols always have a value of 0,
instead of the usual address of the .o file. Therefore,
we have to do some tricks to fill in texthigh and textlow.
..
Also the final patch in this series changes this line to:
if (PSYMTAB_RAW_TEXTHIGH (pst) == 0 && last_function_name
&& gdbarch_sofun_address_maybe_missing (gdbarch))
Keith> There's also this line in dbx_read_symtab that might qualify (from case N_SCOPE):
Keith> valu = nlist.n_value + last_function_start;
Keith> if (PSYMTAB_TEXTHIGH (pst) == 0 || valu > PSYMTAB_TEXTHIGH (pst))
Keith> SET_PSYMTAB_TEXTHIGH (pst, valu);
Keith> break;
This also gets changed to use the RAW_ forms.
Keith> Also in this function, can textlow_not_set be replaced by
Keith> textlow_valid? [The same with the textlow_not_set parameter to
Keith> dbx_end_psymtab?]
I think it is a good idea, but there is one spot setting textlow_not_set
without invoking SET_PSYMTAB_TEXTLOW. From the N_SO case:
prev_textlow_not_set = textlow_not_set;
/* A zero value is probably an indication for the SunPRO 3.0
compiler. dbx_end_psymtab explicitly tests for zero, so
don't relocate it. */
if (nlist.n_value == 0
&& gdbarch_sofun_address_maybe_missing (gdbarch))
{
textlow_not_set = 1;
valu = 0;
}
else
textlow_not_set = 0;
I don't know anything about stabs, so my basic idea in this area was to
make the changes as minimal as possible.
Tom