Hello, Testing reveals that the test failed on some platforms: (gdb) b world Breakpoint 1 at 0x4005c4 Upon investigating it, it turns out that we were accessing the value of the attribute using: high = DW_ADDR (attr_high); This is not correct, since DW_ADDR assumes the attribute's form is an address, whereas the test was using a data form, which means we should have been using DW_UNSND. On some platforms, DW_ADDR happens to work, but that's only pure luck related to the two components being stored within the same union. But on ppc-linux, the attribute value was stored in the DW_UNSND component, and reading it back using DW_ADDR returned zero/garbage. In addition to revealing a bug in my patch, this revealed a slightly more general issue, which is the assumption that address attributes are always encoded using address forms. So, I amended my patch to read addresses in a way that takes the attribute's form into account. Apart from increasing the number of edits, all mostly mechanical, I find that it simplified the handling for DW_AT_high_pc quite a bit, thanks to the introduction of a function getting the attribute value. Changes compared to the previous version: 1. The introduction of attr_value_as_address, to be used in place of DW_ADDR when dealing with address attributes. I left a few uses of this macro in the situations where we actually know that the form is an address form. 2. Instead of duplicating everywhere the conditions for non-address forms in the handling of DW_AT_high_pc attributes, I used the attr_form_is_constant function instead. It's not stricly the same, but I think it is closer to the DWARF reference. 3. Some very minor modifications of the assembly files in our testcase to make it compilable on a larger number of targets: Removing some of the extra parameters for the .section pseudo-op, as well as using .2byte instead of .value. 4. In our testcase, I also adjusted the DW_AT_low_pc attributes to be encoded using DW_FORM_data4, to be consistent with the DW_AT_high_pc attributes, as well as to test reading of that attribute in constant form. gdb/ChangeLog: * dwarf2read.c (attr_value_as_address): New function. (dwarf2_find_base_address, read_call_site_scope): Use attr_value_as_address in place of DW_ADDR. (dwarf2_get_pc_bounds): Use attr_value_as_address to get the low and high addresses. Slight rework of the handling of the high pc being a constant form, and limit it to DWARF verson 4 or higher. (dwarf2_record_block_ranges): Likewise. (read_partial_die): Likewise. (new_symbol_full): Use attr_value_as_address in place of DW_ADDR. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S: New file. * gdb.dwarf2/dw2-abs-hi-pc-hello.c: New file. * gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S: New file. * gdb.dwarf2/dw2-abs-hi-pc-world.c: New file. * gdb.dwarf2/dw2-abs-hi-pc.c: New file. * gdb.dwarf2/dw2-abs-hi-pc.exp: New file. Tested on x86_64-linux. The testcase was also testing on ppc-linux, where it was failing prior to the second iteration of this patch. OK to commit? Thanks, -- Joel