+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.
+
2018-07-26 Tom Tromey <tom@tromey.com>
* dbxread.c (read_dbx_symtab, end_psymtab, read_ofile_symtab):
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;
/* 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 ());
}
}
/* 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 ())
/* 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);
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)
/* 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. */
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;
}
/* 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;
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. */
if (highval > pst->text_high ())
pst->set_text_high (highval);
- if (pst->text_low () == 0
+ if (!pst->text_low_valid
|| symbol.n_value < pst->text_low ())
pst->set_text_low (symbol.n_value);
}