Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 如何在开放源码中的多个文件中使用gdb_C_Trie - Fatal编程技术网

C 如何在开放源码中的多个文件中使用gdb

C 如何在开放源码中的多个文件中使用gdb,c,trie,C,Trie,我试图通过gdb trietool来理解trietool的源代码。但gdb总是失败 步骤如下: (1) ./configure CFLAGS=-g (2) 制造 然后是cd/mnt/hgfs/code/libdatrie-0.2.5/tools,ls-lrt 和gdb trietool-0.2,它将报告如下错误 /mnt/hgfs/code/libdatrie-0.2.5/tools/trietool-0.2": not in executable format: 并且gdb trietool

我试图通过gdb trietool来理解trietool的源代码。但gdb总是失败

步骤如下: (1) ./configure CFLAGS=-g (2) 制造

然后是
cd/mnt/hgfs/code/libdatrie-0.2.5/tools,ls-lrt
gdb trietool-0.2
,它将报告如下错误

/mnt/hgfs/code/libdatrie-0.2.5/tools/trietool-0.2": not in executable format:
并且
gdb trietool-0.2.o
,它是正常的,然后键入命令b../datrie/trie.c:289,它报告

(gdb) b ../datrie/trie.c:289
No source file named ../datrie/trie.c.
但事实上,datrie dir中有trie.c文件

如何解决这个问题,让gdb工作?我错过了什么

为什么gdb-0.2不正常

milan@milan:/mnt/hgfs/code/libdatrie-0.2.5/tools$ file trietool-0.2
trietool-0.2: Bourne-Again shell script text executable

/mnt/hgfs/code/libdatrie-0.2.5/tools$ file trietool.o
trietool.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped

如果libdatrie是一个库(.a或.so),那么您需要为它编写一个示例测试程序。不过,我不太擅长对象分析。我在库包中看到了trietool.c。使用库编译它,并使用GDB附加生成的二进制文件以进行调试。这意味着什么?如何使用库编译它?我使用默认的makefile编译它。trietool-0.2似乎是一个shell脚本,而不是二进制文件。