From 7336948874d13372e7db33864fecfcdff1a55569 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Mon, 7 Oct 1996 17:58:56 +0000 Subject: * buildsym.c (finish_block): Change innerblock_anon_complaint to print the addresses as part of the complaint. Add a complaint for cases where the block end address is smaller than the block start address, in case any such conditions slip through our fixup mechanism. * symmisc.c (dump_symtab): Only print blockvector for primary symtabs, to avoid massive duplication of output due to secondary symtabs that point to same blockvector. Also do some minor formatting tweaks. --- gdb/ChangeLog | 11 +++++++++++ gdb/buildsym.c | 31 +++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0a8cf3f..40e65a6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +Sun Oct 6 15:48:09 1996 Fred Fish + + * buildsym.c (finish_block): Change innerblock_anon_complaint to + print the addresses as part of the complaint. Add a complaint for + cases where the block end address is smaller than the block start + address, in case any such conditions slip through our fixup mechanism. + * symmisc.c (dump_symtab): Only print blockvector for primary + symtabs, to avoid massive duplication of output due to secondary + symtabs that point to same blockvector. Also do some minor + formatting tweaks. + Mon Oct 7 10:42:32 1996 Per Bothner Replace header_files global by per-objfile field. diff --git a/gdb/buildsym.c b/gdb/buildsym.c index e0b30f0..1605ee5 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -60,11 +60,17 @@ make_blockvector PARAMS ((struct objfile *)); /* Complaints about the symbols we have encountered. */ +struct complaint block_end_complaint = + {"block end address less than block start address in %s (patched it)", 0, 0}; + +struct complaint anon_block_end_complaint = + {"block end address 0x%lx less than block start address 0x%lx (patched it)", 0, 0}; + struct complaint innerblock_complaint = {"inner block not inside outer block in %s", 0, 0}; struct complaint innerblock_anon_complaint = - {"inner block not inside outer block", 0, 0}; + {"inner block (0x%lx-0x%lx) not inside outer block (0x%lx-0x%lx)", 0, 0}; struct complaint blockvector_complaint = {"block at 0x%lx out of order", 0, 0}; @@ -320,6 +326,25 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) } *listhead = NULL; +#if 1 + /* Check to be sure that the blocks have an end address that is + greater than starting address */ + + if (BLOCK_END (block) < BLOCK_START (block)) + { + if (symbol) + { + complain (&block_end_complaint, SYMBOL_SOURCE_NAME (symbol)); + } + else + { + complain (&anon_block_end_complaint, BLOCK_END (block), BLOCK_START (block)); + } + /* Better than nothing */ + BLOCK_END (block) = BLOCK_START (block); + } +#endif + /* Install this block as the superblock of all blocks made since the start of this scope that don't have superblocks yet. */ @@ -343,7 +368,9 @@ finish_block (symbol, listhead, old_blocks, start, end, objfile) } else { - complain (&innerblock_anon_complaint); + complain (&innerblock_anon_complaint, BLOCK_START (pblock->block), + BLOCK_END (pblock->block), BLOCK_START (block), + BLOCK_END (block)); } BLOCK_START (pblock->block) = BLOCK_START (block); BLOCK_END (pblock->block) = BLOCK_END (block); -- cgit v1.1