嵌入式开发者社区
标题:
GDB 调试问题
[打印本页]
作者:
TL_user
时间:
2017-7-30 16:46
标题:
GDB 调试问题
使用GDB+GDBServer调试嵌入式程序时 ,出现如下:
[Inferior 1 (process 1891) exited with code 01]
请问是什么原因?
谢谢前辈
作者:
human
时间:
2017-7-31 08:49
把完整信息发来看看
作者:
TL_user
时间:
2017-7-31 10:19
human 发表于 2017-7-31 08:49
把完整信息发来看看
(gdb) target remote 192.168.1.102:1234
`/home/tl/Desktop/linux-arm/Qt/project/helloworld1/helloworld-build-Desktop-Debug/helloworld' has changed; re-reading symbols.
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 CameraSdkInit(1);//相机SDK初始化,在调用任何SDK其他接口前,
24 //必须先调用该接口进行初始化。该函数在整个进程运行
(gdb) l
25 //期间只需要调用一次。
26 CameraEnumerateDevice(&tCameraEnumList,&iCameraCounts);
27 //枚举设备,并建立设备列表。在调用CameraInit
28 //之前,必须调用该函数来获得设备的信息。
29 printf("Number of Cameras is %d \n",iCameraCounts);
30 printf("hello world!\n");
31 return 0;
32 }
(gdb) l
Line number 33 out of range; ../helloworld/main.cpp has 32 lines.
(gdb) b 6
Breakpoint 2 at 0x8838: file ../helloworld/main.cpp, line 6.
(gdb) c
Continuing.
[Inferior 1 (process 1891) exited with code 01]
(gdb)
作者:
TL_user
时间:
2017-7-31 10:29
human 发表于 2017-7-31 08:49
把完整信息发来看看
源代码:
#include <stdio.h>
#include <iostream>
#include <CameraApi.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
using namespace std;
unsigned char * g_pRgbBuffer;
#define FILENAME "./test"
int main()
{
int iCameraCounts = 1;
int iStatus=-1;
tSdkCameraDevInfo tCameraEnumList;
int hCamera;
tSdkCameraCapbility tCapability;
tSdkFrameHead sFrameInfo;
BYTE* pbyBuffer;
tSdkImageResolution sImageSize;
CameraSdkInit(1);//相机SDK初始化,在调用任何SDK其他接口前,
//必须先调用该接口进行初始化。该函数在整个进程运行
//期间只需要调用一次。
CameraEnumerateDevice(&tCameraEnumList,&iCameraCounts);
//枚举设备,并建立设备列表。在调用CameraInit
//之前,必须调用该函数来获得设备的信息。
printf("Number of Cameras is %d \n",iCameraCounts);
printf("hello world!\n");
return 0;
}
作者:
Jackindata
时间:
2017-7-31 15:54
试试把断点设到 main 函数内部,在第 6 行设断点什么意思呢?程序不会执行那里。
作者:
TL_user
时间:
2017-8-15 15:52
将断点设置在程序内部,调试时也出现类似错误:
Host:[Inferior 1 (process 1901) exited with code 01]
Target:Child exited with status 1
是什么原因?如何解决?
谢谢各位前辈
欢迎光临 嵌入式开发者社区 (https://www.51ele.net/)
Powered by Discuz! X3.4