+/* Accessor for ranges field within block BL. */
+
+#define BLOCK_RANGES(bl) (bl)->ranges
+
+/* Number of ranges within a block. */
+
+#define BLOCK_NRANGES(bl) (bl)->ranges->nranges
+
+/* Access range array for block BL. */
+
+#define BLOCK_RANGE(bl) (bl)->ranges->range
+
+/* Are all addresses within a block contiguous? */
+
+#define BLOCK_CONTIGUOUS_P(bl) (BLOCK_RANGES (bl) == nullptr \
+ || BLOCK_NRANGES (bl) <= 1)
+
+/* Obtain the start address of the Nth range for block BL. */
+
+#define BLOCK_RANGE_START(bl,n) (BLOCK_RANGE (bl)[n].startaddr)
+
+/* Obtain the end address of the Nth range for block BL. */
+
+#define BLOCK_RANGE_END(bl,n) (BLOCK_RANGE (bl)[n].endaddr)
+
+/* 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) (BLOCK_CONTIGUOUS_P (bl) \
+ ? BLOCK_START (bl) \
+ : BLOCK_RANGE_START (bl,0))
+