false);
}
-/* Record whether the range START to END_INCLUSIVE fully covers the range
- of BLOCK. If not then we will need to use an addrmap for the address
- to block lookup, record this fact for later. */
-
-void
-buildsym_compunit::record_block_range (struct block *block,
- CORE_ADDR start,
- CORE_ADDR end_inclusive)
-{
- /* If this is any different from the range recorded in the block's
- own BLOCK_START and BLOCK_END, then note that the address map has
- become interesting. */
- if (start != block->start ()
- || end_inclusive + 1 != block->end ())
- m_pending_addrmap_interesting = true;
-}
-
std::unique_ptr<struct blockvector>
buildsym_compunit::make_blockvector ()
{
std::unique_ptr<struct blockvector> blockvector;
int i;
- /* Count the length of the list of blocks. */
+ /* Count the length of the list of blocks. Also, if any blocks are
+ non-contiguous then we need to make use of the addrmap for mapping
+ addresses to blocks (PENDING_ADDRMAP_INTERESTING is set to true). If
+ all the blocks are contiguous then we can avoid creating the addrmap,
+ and perform block look up using the blockvector. */
+ bool pending_addrmap_interesting = false;
for (next = m_pending_blocks, i = 0; next; next = next->next, i++)
{
+ if (!next->block->is_contiguous ())
+ pending_addrmap_interesting = true;
}
blockvector = std::make_unique<struct blockvector> (i);
/* If we needed an address map for this symtab, record it in the
blockvector. */
- if (m_pending_addrmap_interesting)
+ if (pending_addrmap_interesting)
{
struct addrmap_mutable pending_addrmap;
int num_blocks = blockvector->num_blocks ();
- /* If M_PENDING_ADDRMAP_INTERESTING is true then we must have seen
+ /* If PENDING_ADDRMAP_INTERESTING is true then we must have seen
an interesting block. If we see one block, then we should at a
minimum have a global block, and a static block. */
gdb_assert (num_blocks > 1);
const struct dynamic_prop *static_link,
CORE_ADDR start, CORE_ADDR end);
- void record_block_range (struct block *block,
- CORE_ADDR start, CORE_ADDR end_inclusive);
-
/* Start recording information about source code that comes from a source
file. This sets the current subfile, creating it if necessary.
struct subfile *m_current_subfile = nullptr;
- /* If there are gaps in the address range of any block associated with
- this buildsym_compunit, then we need to create an address map, this
- flag is set true to indicate the addrmap must be created. If this
- remains false, then no addrmap will be created. */
- bool m_pending_addrmap_interesting = false;
-
/* An obstack used for allocating pending blocks. */
auto_obstack m_pending_block_obstack;
}
}
-/* Helper function for dwarf2_record_block_ranges. This function records
- the address range for a single BLOCK. LOW and HIGH are the block's
- range, these addresses are inclusive, so LOW is the first address in
- the range, and HIGH is the last address inside the range. UNREL_HIGH
- is the unrelocated, exclusive version of HIGH, that is, UNREL_HIGH is
- the first address outside the range of BLOCK. */
+/* Nothing for now. A later patch changes this. */
static void
dwarf2_record_single_block_range (struct dwarf2_cu *cu, struct block *block,
CORE_ADDR low, CORE_ADDR high,
unrelocated_addr unrel_high)
{
- cu->get_builder ()->record_block_range (block, low, high);
+ /* Nothing for now, a later patch adds code here. */
}
/* Record the address ranges for BLOCK, offset by BASEADDR, as given