diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-02-06 22:41:58 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2022-04-27 22:05:03 -0400 |
commit | 6395b62847e581acc3e8fa179444b824d17b3d68 (patch) | |
tree | e6ac20292c6824c192a09d04ce34cc6d3c0800f0 /gdb/block.h | |
parent | 086d03c91ec1487ed3cc96554d29b2120dd37b5b (diff) | |
download | binutils-6395b62847e581acc3e8fa179444b824d17b3d68.zip binutils-6395b62847e581acc3e8fa179444b824d17b3d68.tar.gz binutils-6395b62847e581acc3e8fa179444b824d17b3d68.tar.bz2 |
gdb: remove BLOCK_ENTRY_PC macro
Replace with equivalent method.
Change-Id: I0e033095e7358799930775e61028b48246971a7d
Diffstat (limited to 'gdb/block.h')
-rw-r--r-- | gdb/block.h | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/gdb/block.h b/gdb/block.h index 80b0616..d952430 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -171,6 +171,29 @@ struct block bool is_contiguous () const { return this->ranges ().size () <= 1; } + /* Return the "entry PC" of this block. + + The entry PC is the lowest (start) address for the block when all addresses + within the block are contiguous. If non-contiguous, then use the start + address for the first range in the block. + + At the moment, this almost matches what DWARF specifies as the entry + pc. (The missing bit is support for DW_AT_entry_pc which should be + preferred over range data and the low_pc.) + + Once support for DW_AT_entry_pc is added, I expect that an entry_pc + field will be added to one of these data structures. Once that's done, + the entry_pc field can be set from the dwarf reader (and other readers + too). ENTRY_PC can then be redefined to be less DWARF-centric. */ + + CORE_ADDR entry_pc () const + { + if (this->is_contiguous ()) + return this->start (); + else + return this->ranges ()[0].start (); + } + /* Addresses in the executable code that are in this block. */ CORE_ADDR m_start; @@ -219,24 +242,6 @@ struct global_block struct compunit_symtab *compunit_symtab; }; -/* Define the "entry pc" for a block BL to be the lowest (start) address - for the block when all addresses within the block are contiguous. If - non-contiguous, then use the start address for the first range in the - block. - - At the moment, this almost matches what DWARF specifies as the entry - pc. (The missing bit is support for DW_AT_entry_pc which should be - preferred over range data and the low_pc.) - - Once support for DW_AT_entry_pc is added, I expect that an entry_pc - field will be added to one of these data structures. Once that's done, - the entry_pc field can be set from the dwarf reader (and other readers - too). BLOCK_ENTRY_PC can then be redefined to be less DWARF-centric. */ - -#define BLOCK_ENTRY_PC(bl) (bl->is_contiguous () \ - ? bl->start () \ - : bl->ranges ()[0].start ()) - struct blockvector { /* Number of blocks in the list. */ |