* block.c (find_block_in_blockvector): Make explicit the fact that we
ignore GLOBAL_BLOCK.
This commit is contained in:
parent
4cd182151a
commit
6ac9ef80f5
@ -1,3 +1,8 @@
|
|||||||
|
2012-06-18 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
|
* block.c (find_block_in_blockvector): Make explicit the fact that we
|
||||||
|
ignore GLOBAL_BLOCK.
|
||||||
|
|
||||||
2012-06-18 Tom Tromey <tromey@redhat.com>
|
2012-06-18 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* c-exp.y (operator): Remove trailing space after "delete" and
|
* c-exp.y (operator): Remove trailing space after "delete" and
|
||||||
|
11
gdb/block.c
11
gdb/block.c
@ -118,8 +118,13 @@ find_block_in_blockvector (struct blockvector *bl, CORE_ADDR pc)
|
|||||||
return addrmap_find (BLOCKVECTOR_MAP (bl), pc);
|
return addrmap_find (BLOCKVECTOR_MAP (bl), pc);
|
||||||
|
|
||||||
/* Otherwise, use binary search to find the last block that starts
|
/* Otherwise, use binary search to find the last block that starts
|
||||||
before PC. */
|
before PC.
|
||||||
bot = 0;
|
Note: GLOBAL_BLOCK is block 0, STATIC_BLOCK is block 1.
|
||||||
|
They both have the same START,END values.
|
||||||
|
Historically this code would choose STATIC_BLOCK over GLOBAL_BLOCK but the
|
||||||
|
fact that this choice was made was subtle, now we make it explicit. */
|
||||||
|
gdb_assert (BLOCKVECTOR_NBLOCKS (bl) >= 2);
|
||||||
|
bot = STATIC_BLOCK;
|
||||||
top = BLOCKVECTOR_NBLOCKS (bl);
|
top = BLOCKVECTOR_NBLOCKS (bl);
|
||||||
|
|
||||||
while (top - bot > 1)
|
while (top - bot > 1)
|
||||||
@ -134,7 +139,7 @@ find_block_in_blockvector (struct blockvector *bl, CORE_ADDR pc)
|
|||||||
|
|
||||||
/* Now search backward for a block that ends after PC. */
|
/* Now search backward for a block that ends after PC. */
|
||||||
|
|
||||||
while (bot >= 0)
|
while (bot >= STATIC_BLOCK)
|
||||||
{
|
{
|
||||||
b = BLOCKVECTOR_BLOCK (bl, bot);
|
b = BLOCKVECTOR_BLOCK (bl, bot);
|
||||||
if (BLOCK_END (b) > pc)
|
if (BLOCK_END (b) > pc)
|
||||||
|
Loading…
Reference in New Issue
Block a user