diff options
author | Yao Qi <yao.qi@linaro.org> | 2015-07-07 16:58:19 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2015-07-07 16:58:19 +0100 |
commit | 607685ecee1015d6c37e0d800d40453dc0aadc8c (patch) | |
tree | 97a761af48d3545f57eff64f5fa57be9fb2c0e37 /gdb/config | |
parent | f1b6788884b2e95105475c95b7f22f6ceba2271e (diff) | |
download | gdb-607685ecee1015d6c37e0d800d40453dc0aadc8c.zip gdb-607685ecee1015d6c37e0d800d40453dc0aadc8c.tar.gz gdb-607685ecee1015d6c37e0d800d40453dc0aadc8c.tar.bz2 |
Native debug arm program by aarch64 GDB
This patch is to let aarch64 GDB debug 32-bit arm program natively. In
each function for fetching and storing registers, GDB will check
gdbarch_bfd_arch_info (gdbarch)->bits_per_word, if it is 32, call
the corresponding aarch32 functions in aarch32-linux-nat.c, otherwise
fall back to aarch64 code to fetch and store registers.
aarch64_linux_read_description has to return the right target description,
but we don't have gdbarch available there, so GDB fetches auxv and gets
AT_PHENT, in order to determine whether the target is 32-bit or 64-bit.
I learned this trick from solib-svr4.c.
gdb:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* aarch32-linux-nat.h (VFP_REGS_SIZE): New macro, moved from
arm-linux-nat.c.
* aarch64-linux-nat.c: Include aarch32-linux-nat.h and
elf/external.h.
(fetch_gregs_from_thread): Call aarch32_gp_regcache_supply
if target is 32-bit.
(store_gregs_to_thread): Call aarch32_gp_regcache_collect
if target is 32-bit.
(fetch_fpregs_from_thread): Call aarch32_vfp_regcache_supply
if target is 32-bit.
(store_fpregs_to_thread): Call aarch32_vfp_regcache_collect
if target is 32-bit.
(tdesc_arm_with_vfpv3, tdesc_arm_with_neon): Declare.
(aarch64_linux_read_description): Return the right target
description.
* arm-linux-nat.c (VFP_REGS_SIZE): Moved to aarch32-linux-nat.h.
* config/aarch64/linux.mh (NATDEPFILES): Add aarch32-linux-nat.o.
* configure.tgt (aarch64*-*-linux*): Add arm-tdep.o and
arm-linux-tdep.o
Diffstat (limited to 'gdb/config')
-rw-r--r-- | gdb/config/aarch64/linux.mh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/config/aarch64/linux.mh b/gdb/config/aarch64/linux.mh index 6a8aa7d..cbe322f 100644 --- a/gdb/config/aarch64/linux.mh +++ b/gdb/config/aarch64/linux.mh @@ -19,7 +19,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. NAT_FILE= config/nm-linux.h -NATDEPFILES= inf-ptrace.o fork-child.o aarch64-linux-nat.o \ +NATDEPFILES= inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \ proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \ linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \ linux-personality.o linux-namespaces.o |