From 52948f01e4a11f5fcebdca112036f907ac69e7ad Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 3 May 2018 16:36:20 -0600 Subject: 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 * 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) : Update comment. : New fields. : Update. * xcoffread.c (scan_xcoff_symtab): Use text_low_valid. --- gdb/xcoffread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/xcoffread.c') diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 1aa2e523db2..7ca4b3ef3b2 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -2344,7 +2344,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader, 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); } -- cgit v1.2.1