aboutsummaryrefslogtreecommitdiff
path: root/gdb/psympriv.h
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/psympriv.h
parent4ae976d1df96aee0ecd97ea1235efc4490562932 (diff)
downloadfsf-binutils-gdb-52948f01e4a11f5fcebdca112036f907ac69e7ad.zip
fsf-binutils-gdb-52948f01e4a11f5fcebdca112036f907ac69e7ad.tar.gz
fsf-binutils-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/psympriv.h')
-rw-r--r--gdb/psympriv.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index 7116a1a..b3bda82 100644
--- a/gdb/psympriv.h
+++ b/gdb/psympriv.h
@@ -114,12 +114,14 @@ struct partial_symtab
void set_text_low (CORE_ADDR addr)
{
m_text_low = addr;
+ text_low_valid = 1;
}
/* Set the hight text address of this partial_symtab. */
void set_text_high (CORE_ADDR addr)
{
m_text_high = addr;
+ text_high_valid = 1;
}
@@ -144,7 +146,9 @@ struct partial_symtab
/* Range of text addresses covered by this file; texthigh is the
beginning of the next section. Do not use if PSYMTABS_ADDRMAP_SUPPORTED
is set. Do not refer directly to these fields. Instead, use the
- accessors. */
+ accessors. The validity of these fields is determined by the
+ text_low_valid and text_high_valid fields; these are located later
+ in this structure for better packing. */
CORE_ADDR m_text_low;
CORE_ADDR m_text_high;
@@ -230,6 +234,11 @@ struct partial_symtab
ENUM_BITFIELD (psymtab_search_status) searched_flag : 2;
+ /* Validity of the m_text_low and m_text_high fields. */
+
+ unsigned int text_low_valid : 1;
+ unsigned int text_high_valid : 1;
+
/* Pointer to compunit eventually allocated for this source file, 0 if
!readin or if we haven't looked for the symtab after it was readin. */