aboutsummaryrefslogtreecommitdiff
path: root/gdb/dbxread.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-03 16:36:20 -0600
committerTom Tromey <tom@tromey.com>2018-07-26 09:18:31 -0600
commit52948f01e4a11f5fcebdca112036f907ac69e7ad (patch)
tree08a69f99c3f028772c5f52690094d3d3c0f2ee47 /gdb/dbxread.c
parent4ae976d1df96aee0ecd97ea1235efc4490562932 (diff)
downloadgdb-52948f01e4a11f5fcebdca112036f907ac69e7ad.zip
gdb-52948f01e4a11f5fcebdca112036f907ac69e7ad.tar.gz
gdb-52948f01e4a11f5fcebdca112036f907ac69e7ad.tar.bz2
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.
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r--gdb/dbxread.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index d5d4e08..5409a72 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -2002,7 +2002,7 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
a reliable texthigh by taking the address plus size of the
last function in the file. */
- if (pst->text_high () == 0 && last_function_name
+ if (!pst->text_high_valid && last_function_name
&& gdbarch_sofun_address_maybe_missing (gdbarch))
{
int n;
@@ -2047,13 +2047,11 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
/* If we know our own starting text address, then walk through all other
psymtabs for this objfile, and if any didn't know their ending text
address, set it to our starting address. Take care to not set our
- own ending address to our starting address, nor to set addresses on
- `dependency' files that have both textlow and texthigh zero. */
+ own ending address to our starting address. */
ALL_OBJFILE_PSYMTABS (objfile, p1)
{
- if (p1->text_high () == 0 && p1->text_low () != 0
- && p1 != pst)
+ if (!p1->text_high_valid && p1->text_low_valid && p1 != pst)
p1->set_text_high (pst->text_low ());
}
}