[PATCH] Patch 2 of 2 for aarch64 ILP32 support in gdb
Steve Ellcey
sellcey@caviumnetworks.com
Tue Jan 31 23:16:00 GMT 2017
On Sun, 2017-01-29 at 22:40 +0000, Yao Qi wrote:
> This changes the word size and address size, which is used to determine
> the inferior is arm or aarch64 by checking "bits_per_word == 32" in
> multi-arch debugging.  You can find some instances of such check in
> aarch64-linux-nat.c.  If the bits_per_word is 32 in ILP32, GDB thinks
> the inferior is an ARM one, rather than an AArch64 ILP32 one. which is
> wrong.  We need to tweak the condition above to correctly identify the
> ARM inferior.
>Â
> Do you compare the ILP32 gdb test result with normal aarch64 one?
OK, I fixed up arch64-linux-nat.c and didn't find any other places were
the bits_per_word was being checked and I fixed the TRUE/true
FALSE/false constants. Â If I run gdb without any changes or with this
patch but debugging 64 bit code I get around 500 failures. Â The number
doesn't seem to be constant, I have gotten anywhere from 488 to 503
failures testing the same code. Â My last run had:
# of expected passes            30428
# of unexpected failures        503
# of expected failures          53
# of unknown successes          2
# of known failures             64
# of untested testcases         66
# of unresolved testcases       6
# of unsupported tests          293
Many of the failures seem to be thread related and I see a lot of
messages about timeouts and 'program is no longer running'. Â When
I run gdb on 32 bit programs with:
RUNTESTFLAGS="--target_board=unix/-mabi=ilp32"
I get 700+ failures. Â My last run had:
# of expected passes            29482
# of unexpected failures        740
# of expected failures          30
# of unknown successes          2
# of known failures             65
# of untested testcases         79
# of unresolved testcases       4
# of unsupported tests          288
So there are more failures in ILP32 mode but there seem to be enough
passes that I think it still makes sense to check in the patch to get
some gdb functionality working.
Here is the latest patch.
Steve Ellcey
sellcey@cavium.com
gdb ChangeLog:
2017-01-31  Andrew Pinski  <apinski@cavium.com>
    Steve Ellcey  <sellcey@cavium.com>
    Yao Qi  <yao.qi@linaro.org>
* aarch64-linux-nat.c (IS_ARM32): New macro.
(fetch_gregs_from_thread): Use IS_ARM32 macro.
(store_gregs_to_thread): Ditto.
(fetch_fpregs_from_thread): Ditto.
(store_fpregs_to_thread): Ditto.
(ps_get_thread_area): Ditto.
(aarch64_linux_siginfo_fixup): Ditto.
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Set link
map offsets to 32 or 64 bits.
* aarch64-tdep.c (aarch64_ilp32_register_type): New function.
(aarch64_gdbarch_init): Setup ILP32 support.
Make sure the gdbarches have compatible ilp32 flags.
Set long and ptr sizes correctly for ilp32.
* aarch64-tdep.h (gdbarch_tdep) <ilp32>: New field.
gdbserver ChangeLog:
2017-01-31  Andrew Pinski  <apinski@cavium.com>
    Steve Ellcey  <sellcey@cavium.com>
* linux-aarch64-low.c (aarch64_linux_read_description): Use
machine instead of is_elf64 to determine architecture.  Give an
error when using 32 bit gdbserver on 64 bit program.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdb.patch
Type: text/x-patch
Size: 8110 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170131/3924b962/attachment.bin>
More information about the Binutils
mailing list