printf ("DW_OP_GNU_parameter_ref: <0x%s>",
dwarf_vmatoa ("x", cu_offset + uvalue));
break;
+ case DW_OP_addrx:
+ READ_ULEB (uvalue, data, end);
+ printf ("DW_OP_addrx <0x%s>", dwarf_vmatoa ("x", uvalue));
+ break;
case DW_OP_GNU_addr_index:
READ_ULEB (uvalue, data, end);
printf ("DW_OP_GNU_addr_index <0x%s>", dwarf_vmatoa ("x", uvalue));
uvalue = check_uvalue (block_start, uvalue, end);
- if (do_loc)
- data = block_start + uvalue;
- else
- data = display_block (block_start, uvalue, end, delimiter);
+ data = block_start + uvalue;
+ if (!do_loc)
+ {
+ unsigned char op;
+
+ SAFE_BYTE_GET (op, block_start, sizeof (op), end);
+ if (op != DW_OP_addrx)
+ data = display_block (block_start, uvalue, end, delimiter);
+ }
break;
case DW_FORM_block1:
}
}
+# Test objdump -Wi on a file containing dwarf-5 encodings information.
+
+if { ![is_elf_format] } then {
+ unsupported "objdump DW_OP_* test"
+} elseif { ![binutils_assemble $srcdir/$subdir/dw5-op.S tmpdir/dw5-op.${obj}] } then {
+ fail "objdump DW_OP_* test"
+} else {
+ if [is_remote host] {
+ set op_testfile [remote_download host tmpdir/dw5-op.${obj}]
+ } else {
+ set op_testfile tmpdir/dw5-op.${obj}
+ }
+
+ set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -Wi $op_testfile" "" "/dev/null" "objdump.out"]
+
+ if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
+ fail "objdump -Wi (reason: unexpected output)"
+ send_log $got
+ send_log "\n"
+ }
+
+ set got [remote_exec host "tail -n +4 objdump.out" "" "/dev/null" "objdump.out"]
+ set output [remote_upload host objdump.out]
+
+ if ![file size $output] then {
+ # If the output file is empty, then this target does not
+ # generate dwarf2 output. This is not a failure.
+ verbose "No output from 'objdump -Wi'"
+ untested "objdump -Wi"
+ return
+ }
+
+ if { [regexp_diff objdump.out $srcdir/$subdir/dw5-op.W] } then {
+ fail "objdump -Wi for DW_OP_*"
+ } else {
+ pass "objdump -Wi for DW_OP_*"
+ }
+
+ file_on_host delete $output
+}
+
proc test_build_id_debuglink {} {
global srcdir
global subdir
global OBJDUMP
global OBJDUMPFLAGS
global exe
-
+
set test "objdump -S"
if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog${exe} executable debug] != "" } {
readelf_test {--decompress --hex-dump .debug_loc} $tempfile readelf.z
}
+set hpux ""
+
# Skip the next test for the RISCV architectures because they
# do not support .ULEB128 pseudo-ops with non-constant values.
if ![istarget "riscv*-*-*"] then {
- set hpux ""
if [istarget "hppa*64*-*-hpux*"] {
set hpux "--defsym HPUX=1"
}
readelf_test {--debug-dump=macro -wN} $tempfile pr26112.r
}
}
+
+# Check dwarf-5 support for DW_OP_addrx.
+if {![binutils_assemble_flags $srcdir/$subdir/dw5-op.S tmpdir/dw5-op.o $hpux]} then {
+ unsupported "readelf -wi dw5-op (failed to assemble)"
+} else {
+
+# Download it.
+if ![is_remote host] {
+ set tempfile tmpdir/dw5-op.o
+} else {
+ set tempfile [remote_download host tmpdir/dw5-op.o]
+}
+
+# First, determine the size, so specific output matchers can be used.
+readelf_find_size $tempfile 2
+
+# Make sure that readelf can decode the contents.
+readelf_test -wi $tempfile dw5-op.W
+}