diff options
author | Doug Evans <dje@google.com> | 2013-05-17 18:09:06 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2013-05-17 18:09:06 +0000 |
commit | 7d0c9981dc1753663969b47221164504e71676a6 (patch) | |
tree | 7b96437bee3ee6847a00c8cf6a8488cc901766ef /gdb/psymtab.c | |
parent | 8d324e832969c4334524c77df4f94fe54f45ad18 (diff) | |
download | gdb-7d0c9981dc1753663969b47221164504e71676a6.zip gdb-7d0c9981dc1753663969b47221164504e71676a6.tar.gz gdb-7d0c9981dc1753663969b47221164504e71676a6.tar.bz2 |
* NEWS: Mention new maintenance commands check-symtabs, and
expand-symtabs, and renamed check-psymtabs.
* psymtab.c (maintenance_check_psymtabs): Renamed from
maintenance_check_symtabs. Only process already-expanded symbol
tables.
(_initialize_psymtab): Update.
* symmisc.c (maintenance_check_symtabs): New function.
(maintenance_expand_name_matcher): New function
(maintenance_expand_file_matcher): New function
(maintenance_expand_symtabs): New function.
(_initialize_symmisc): Add "mt check-symtabs" and "mt expand-symtabs"
commands.
doc/
* gdb.texinfo (Maintenance Commands): Update doc for
"maint check-psymtabs". Add doc for "maint check-symtabs",
"maint expand-symtabs".
testsuite/
* gdb.base/maint.exp: Update test for "maint check-psymtabs".
Add tests for "maint check-symtabs", "maint expand-symtabs".
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r-- | gdb/psymtab.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 3a1b993..10bd844 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -2007,10 +2007,10 @@ maintenance_info_psymtabs (char *regexp, int from_tty) } } -/* Check consistency of psymtabs and symtabs. */ +/* Check consistency of currently expanded psymtabs vs symtabs. */ static void -maintenance_check_symtabs (char *ignore, int from_tty) +maintenance_check_psymtabs (char *ignore, int from_tty) { struct symbol *sym; struct partial_symbol **psym; @@ -2025,7 +2025,25 @@ maintenance_check_symtabs (char *ignore, int from_tty) { struct gdbarch *gdbarch = get_objfile_arch (objfile); - s = psymtab_to_symtab (objfile, ps); + /* We don't call psymtab_to_symtab here because that may cause symtab + expansion. When debugging a problem it helps if checkers leave + things unchanged. */ + s = ps->symtab; + + /* First do some checks that don't require the associated symtab. */ + if (ps->texthigh < ps->textlow) + { + printf_filtered ("Psymtab "); + puts_filtered (ps->filename); + printf_filtered (" covers bad range "); + fputs_filtered (paddress (gdbarch, ps->textlow), gdb_stdout); + printf_filtered (" - "); + fputs_filtered (paddress (gdbarch, ps->texthigh), gdb_stdout); + printf_filtered ("\n"); + continue; + } + + /* Now do checks requiring the associated symtab. */ if (s == NULL) continue; bv = BLOCKVECTOR (s); @@ -2063,20 +2081,8 @@ maintenance_check_symtabs (char *ignore, int from_tty) } psym++; } - if (ps->texthigh < ps->textlow) - { - printf_filtered ("Psymtab "); - puts_filtered (ps->filename); - printf_filtered (" covers bad range "); - fputs_filtered (paddress (gdbarch, ps->textlow), gdb_stdout); - printf_filtered (" - "); - fputs_filtered (paddress (gdbarch, ps->texthigh), gdb_stdout); - printf_filtered ("\n"); - continue; - } - if (ps->texthigh == 0) - continue; - if (ps->textlow < BLOCK_START (b) || ps->texthigh > BLOCK_END (b)) + if (ps->texthigh != 0 + && (ps->textlow < BLOCK_START (b) || ps->texthigh > BLOCK_END (b))) { printf_filtered ("Psymtab "); puts_filtered (ps->filename); @@ -2140,7 +2146,8 @@ This does not include information about individual partial symbols,\n\ just the symbol table structures themselves."), &maintenanceinfolist); - add_cmd ("check-symtabs", class_maintenance, maintenance_check_symtabs, - _("Check consistency of psymtabs and symtabs."), + add_cmd ("check-psymtabs", class_maintenance, maintenance_check_psymtabs, + _("\ +Check consistency of currently expanded psymtabs versus symtabs."), &maintenancelist); } |