This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 0/4] Fix dw2-ifort-parameter.exp on 64-bit big-endian systems
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Fri, 07 Mar 2014 18:11:00 +0100
- Subject: [PATCH 0/4] Fix dw2-ifort-parameter.exp on 64-bit big-endian systems
- Authentication-results: sourceware.org; auth=none
I've encountered two problems with dw2-ifort-parameter.exp:
* On PPC64, 'func' and 'main' are function descriptors and don't point
to the actual code. Thus the usage of these symbols in
dw2-ifort-parameter-debug.S is broken.
* On s390x, the test case fails like this:
Breakpoint 1, 0x00000000800005d2 in func (param=<error reading
variable: Cannot access memory at address 0x0>)
(gdb) p/x param
Cannot access memory at address 0x0
This is because the DWARF pointer size is hard-coded to 4, which leads
to DW_OP_deref retrieving the topmost (!) four bytes of the value's
address and using it as the location of a formal parameter. From
reading the DWARF standard it could be argued that DW_OP_deref
shouldn't actually use the DWARF pointer size, but the architecture's
address size. However, using the DWARF pointer size is
long-established practice in gcc and gdb.
The last patch in the series fixes the first problem. The third patch
fixes the second problem, as a "side effect" of migrating the DWARF code
to Dwarf::assemble. The first two patches are not really required for
the fix, but just enable the continued use of prepare_for_testing.