forked from Imagelibrary/binutils-gdb
Add validity bits for psymtab high and low fields
Right now some psymtab code checks whether a psymtab's textlow or texthigh fields are valid by comparing against 0. I imagine this is mildly wrong in the current environment, but once psymtabs are relocated dynamically, it will no longer be correct, because it will be much more normal to see a psymtab with a textlow of zero -- this will just mean it appears at the start of the text section. This patch introduces validity bits to handle this situation more nicely, and changes users of the code to follow. gdb/ChangeLog 2018-07-26 Tom Tromey <tromey@redhat.com> * dbxread.c (end_psymtab): Use text_high_valid and text_low_valid. * mdebugread.c (parse_partial_symbols): Use text_low_valid. (psymtab_to_symtab_1): Use text_high_valid and text_low_valid. * psympriv.h (struct partial_symtab) <m_text_low, m_text_high>: Update comment. <text_low_valid, text_high_valid>: New fields. <set_text_low, set_text_high>: Update. * xcoffread.c (scan_xcoff_symtab): Use text_low_valid.
This commit is contained in:
@@ -2736,7 +2736,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
|
||||
/* Kludge for Irix 5.2 zero fh->adr. */
|
||||
if (!relocatable
|
||||
&& (pst->text_low () == 0
|
||||
&& (!pst->text_low_valid
|
||||
|| procaddr < pst->text_low ()))
|
||||
pst->set_text_low (procaddr);
|
||||
if (high > pst->text_high ())
|
||||
@@ -3512,7 +3512,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
|
||||
/* Kludge for Irix 5.2 zero fh->adr. */
|
||||
if (!relocatable
|
||||
&& (pst->text_low () == 0
|
||||
&& (!pst->text_low_valid
|
||||
|| procaddr < pst->text_low ()))
|
||||
pst->set_text_low (procaddr);
|
||||
|
||||
@@ -3711,7 +3711,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
||||
other cases. */
|
||||
save_pst = fdr_to_pst[f_idx].pst;
|
||||
if (save_pst != NULL
|
||||
&& save_pst->text_low () != 0
|
||||
&& save_pst->text_low_valid
|
||||
&& !(objfile->flags & OBJF_REORDERED))
|
||||
{
|
||||
ALL_OBJFILE_PSYMTABS (objfile, pst)
|
||||
@@ -3922,7 +3922,7 @@ psymtab_to_symtab_1 (struct objfile *objfile,
|
||||
/* Do nothing if this is a dummy psymtab. */
|
||||
|
||||
if (pst->n_global_syms == 0 && pst->n_static_syms == 0
|
||||
&& pst->text_low () == 0 && pst->text_high () == 0)
|
||||
&& !pst->text_low_valid && !pst->text_high_valid)
|
||||
return;
|
||||
|
||||
/* Now read the symbols for this symtab. */
|
||||
|
||||
Reference in New Issue
Block a user