嵌入式开发者社区

标题: GDB调试 [打印本页]

作者: TL_user    时间: 2017-8-15 16:05
标题: GDB调试
使用GDB调试时,l(list)命令下,代码只从第5行开始列出,前四行不能列出。执行c(continue)命令,程序出现报错:
linux系统调试端:[Inferior 1 (process 1905) exited with code 01]
AM4379目标板端:
Child exited with status 1
GDBserver exiting
完整信息如下:

Host端:
(gdb) target remote 192.168.1.102:1234
Remote debugging using 192.168.1.102:1234
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x498c0c80 in ?? ()
(gdb) l
5        #include <string.h>
6        #include <unistd.h>
7       
8        //using namespace std;
9        //unsigned char           * g_pRgbBuffer;
10        //#define FILENAME        "./test"
11       
12        int main()
13        {
14            int                     iCameraCounts = 1;
(gdb) l
15            int                     iStatus=-1;
16            tSdkCameraDevInfo       tCameraEnumList;
17            int                     hCamera;
18            tSdkCameraCapbility     tCapability;
19            tSdkFrameHead           sFrameInfo;
20            BYTE*                                pbyBuffer;
21            tSdkImageResolution     sImageSize;
22       
23            printf("Number of Cameras is %d \n",iCameraCounts);
24           // CameraSdkInit(1);//相机SDK初始化,在调用任何SDK其他接口前,
(gdb) b20
Undefined command: "b20".  Try "help".
(gdb) b 20
Breakpoint 1 at 0x87d0: file ../helloworld/main.cpp, line 20.
(gdb) c
Continuing.
[Inferior 1 (process 1901) exited with code 01]
(gdb) c
The program is not being run.
(gdb) target remote 192.168.1.102:1234
Remote debugging using 192.168.1.102:1234
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x498c0c80 in ?? ()
(gdb) c
Continuing.
[Inferior 1 (process 1905) exited with code 01]
(gdb)

目标板端Target:
Listening on port 1234
Remote debugging from host 192.168.1.103

Child exited with status 1
GDBserver exiting
root@am437x-evm:~#


谢谢各位前辈

作者: tree    时间: 2017-8-17 12:06
您好!  请先用我司文档的测试代码看是否有问题。
作者: TL_user    时间: 2017-8-17 16:17
tree 发表于 2017-8-17 12:06
您好!  请先用我司文档的测试代码看是否有问题。

使用例程可以正常运行




欢迎光临 嵌入式开发者社区 (https://51ele.net/) Powered by Discuz! X3.4