我试图调试android的Linux内核。我可以在Android设备上运行gdbserver64并使用主机上的gdb连接到它。但是,当我尝试调试时,我收到此错误:
(gdb) target remote localhost:2345
Remote debugging using localhost:2345
warning: while parsing target description (at line 11): Target description specified unknown architecture "aarch64"
warning: Could not load XML target description; ignoring
Remote register badly formatted:T051d:0000000000000000;1f:50f8ffff7f000000;20:641cf5b77f000000;thread:p57c.57c;core:5;
here: 00000000;1f:50f8ffff7f000000;20:641cf5b77f000000;thread:p57c.57c;core:5;
很明显主机gdb没有aarch64。有没有办法将架构添加到gdb?我似乎无法找到办法。
答案 0 :(得分:0)
有没有办法将架构添加到gdb?
是:使用ALLSRCS := $(wildcard *.c)
OTHERSRCS := testRWdata.c testddb.c testsuite.c driver.c DumpAFile.c testavl.c tester.c
SRCS := $(filter-out $(OTHERSRCS),$(ALLSRCS))
OBJS := $(addprefix obj/,$(SRCS:.c=.o))
PROGS = testRWdata testddb testsuite driver DumpAFile testavl tester
OTHER_LIBS =
OTHER_PRODUCT_DEPENDS = buffer.h dbinfo.h avl.h
TEST_OUT = nextdb.test.out
DATA_FILES = test.dfd test.input.test test.input.full test.input tstavl.input $(TEST_OUT)
HELP_FILES = README
OTHER_GARBAGE = test.asc test.dat test.wrk test.log test.dump
.PHONY: all clean
doall : $(PROGS)
obj/%.o: %.c | obj
$(COMPILE.c) $< -o $@
obj:
mkdir -p $@
testsuite: $(OBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) $@.c
-chmod a+x $@
配置它。
答案 1 :(得分:0)
我必须从 gdb source code 构建它:
cd gdb-10.1
./configure --target=aarch64-linux-android && make -j8 && sudo make install
aarch64-linux-android-gdb
set sysroot
target remote <android-ip-address>:<port-number>