From 4aad0dfce556cbd58b789830818cf311aff077e2 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Tue, 5 Jun 2012 01:17:55 +0000 Subject: [PATCH] * buildsym.c (make_blockvector): Add comment. --- gdb/ChangeLog | 4 ++++ gdb/buildsym.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5317e17f3eb..ac6de668694 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2012-06-04 Doug Evans + + * buildsym.c (make_blockvector): Add comment. + 2012-06-04 Pedro Alves * arch-utils.c (default_gdb_signal_from_target): Delete. diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 20fabb7fbc0..f1fb4be4f37 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -496,10 +496,13 @@ make_blockvector (struct objfile *objfile) = addrmap_create_fixed (pending_addrmap, &objfile->objfile_obstack); else BLOCKVECTOR_MAP (blockvector) = 0; - + /* Some compilers output blocks in the wrong order, but we depend on their being in the right order so we can binary search. Check the - order and moan about it. */ + order and moan about it. + Note: Remember that the first two blocks are the global and static + blocks. We could special case that fact and begin checking at block 2. + To avoid making that assumption we do not. */ if (BLOCKVECTOR_NBLOCKS (blockvector) > 1) { for (i = 1; i < BLOCKVECTOR_NBLOCKS (blockvector); i++) -- 2.30.2