c语言gdb调试问题 无法定位 5C

图片说明

6个回答

编译的使用gcc使用-g参数编译,并且要对有symbol的so进行调试,通过file命令可以知道这个文件是否有symbol,file命令最后有一个striped就是没有symbol

qq_36291682
shadowPK小明 谢谢回答
一年多之前 回复

系统库是不带debug符号的,所以出现:no debugging symbols found
只能通过调用位置进行判断了。

看上去是取消线程引起的问题,看看是不是资源冲突,释放了已经释放的指针啥的?

qq_36291682
shadowPK小明 谢谢回答
一年多之前 回复

问题补充:Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux.so.2
Core was generated by `ck_qzj 211 60002 0GDaWz02GD0LyWl00yWVlB06Gj0HGjWFjB04'.
Program terminated with signal 6, Aborted.
#0 0x009d3430 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.209.el6_9.2.i686
(gdb) bt
#0 0x009d3430 in __kernel_vsyscall ()
#1 0x00164781 in raise () from /lib/libc.so.6
#2 0x0016605a in abort () from /lib/libc.so.6
#3 0x001a4645 in __libc_message () from /lib/libc.so.6
#4 0x001a4774 in __libc_fatal () from /lib/libc.so.6
#5 0x00bc63aa in pthread_cancel_init () from /lib/libpthread.so.0
#6 0x00bc2744 in pthread_cancel () from /lib/libpthread.so.0
#7 0x0805176b in f_pthread_cancel (threadid=3317513072) at ck_qzj_data.c:1220
#8 0x0804a127 in f_thread_timer (pvParam=0x0) at ck_qzj.c:429
#9 0x00bbdbc9 in start_thread () from /lib/libpthread.so.0
#10 0x0021d04e in clone () from /lib/libc.so.6

qq_36291682
shadowPK小明 谢谢回答
一年多之前 回复

堆栈信息不是已经有了?ck_qzj_data.c:的1220行

qq_36291682
shadowPK小明 谢谢回答
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
gdb的调试问题
想在liux下单步调试程序,但是不会使用gdb,rn有谁知道那里有这方面的资料啊,请告诉一下我撒,谢谢rn
GDB调试问题
IBM AIX 环境下:rnait5602:/opt/ai_fs02/crm/data/shuxb/work/products/unibss30/unibssGw/acc/accmgr/src$>gdb bargaintranferzjrnGNU gdb 6.0rnCopyright 2003 Free Software Foundation, Inc.rnGDB is free software, covered by the GNU General Public License, and you arernwelcome to change it and/or distribute copies of it under certain conditions.rnType "show copying" to see the conditions.rnThere is absolutely no warranty for GDB. Type "show warranty" for details.rnThis GDB was configured as "powerpc-ibm-aix5.1.0.0"...rn(gdb) rrnStarting program: /opt/ai_fs02/crm/data/shuxb/work/products/unibss30/unibssGw/acc/accmgr/src/bargaintranferzj rnWarning:rnCannot insert breakpoint -1.rnError accessing memory address 0x228a4c30: I/O errorrnrn调试bargaintranferzj程序, rnbargaintranferzj 该程序链接的是so动态库。 不知道什么原因,我并没有设置断点, 为什么一直提示无法插入断点呢?rn是不是要指定动态库路径呢?rnrn
gdb调试问题
我是一个linux编程的初学者,为学习使用gdb我做了如下测试rn我写了一个程序叫greetings,其结构如下:rn-rw-r--r-- 1 b010048_ bachelor 94 Sep 14 21:59 greeting1.crn-rw-r--r-- 1 b010048_ bachelor 27 Sep 14 21:50 greeting1.hrn-rw-r--r-- 1 b010048_ bachelor 348 Sep 14 22:18 greeting2.crn-rw-r--r-- 1 b010048_ bachelor 27 Sep 14 21:50 greeting2.hrn-rwxr-xr-x 1 b010048_ bachelor 14504 Sep 14 22:18 greetingsrn-rw-r--r-- 1 b010048_ bachelor 115 Sep 14 21:49 greetings.crn-rw-r--r-- 1 b010048_ bachelor 231 Sep 14 22:14 Makefilernrngreetings.c 很简单,如下rn#include"greeting1.h"rn#include"greeting2.h"rnrnrnint main()rnrn greeting1("l like unix");rn greeting2("i like unix");rnrnrngreeting1.c 和greeting2.c分别定义函数greeting1和greeting2,greeting1只是简单的把字符窜打印出来,greeting2则将其倒序打印rnMakefile 文件如下rngreetings:greetings.o greeting1.o greeting2.orn gcc -o $@ $^rngreetings.o:greetings.c greeting1.h greeting2.hrn gcc -c $
gdb下调试问题
我看了一个手册,我想观察一个变量的变化情况,用watch 加变量观察结果no symbol "a" in current context;rn程序如下:rn#includernfloat aver(float a[10]);rnint main()rnrn float a[10];rn int i,average;rn printf("input 10 nums\n");rn for(i=0;i<10;i++)rn scanf("%f",&a[i]);rn average=aver(a);rn printf("%5.2f",average);rnrnfloat aver(float a[10])rnrn int i;rn float average,sum=a[0];rn for(i=1;i<10;i++)rn sum=sum+a[i];rn average=sum/10;rn return(average);rn rn
C语言调试问题
最近才刚刚碰到这样的情况,昨天连续两次瞬间郁闷。。。因为平时单步调试代码需要跳进函数内部!结果弹出框框Please enter the path for CHKSTK.ASM.不解~~~!!!求指教。。。。。。。。。很急
C语言简单程序调试问题
这是源码:nn#includen#include nnint main()nn double x,y,z,i;n for(x = 1;x<100000;x++) n n y = sqrt(x+100); n z = sqrt(x+268); n if((y*y == x+100)&&(z*z == x+268))n n printf("%lf\n",x);n n n return 0; n nn不知道问题出在哪里?麻烦解答一下。n另,为什么知道设定的数值范围是1-10万,这个是不一定的?n再另,表示对for里面的不太理解nnPS,题目:一个整数,它加上100后是一个完全平方数,n 再加上168又是一个完全平方数,请问该数是多少?
c语言调试问题
为什么我把学号stuCount改为char的数组类型就没错,用int类型就说rn测试.exe 中的 0x772e15de 处有未经处理的异常: 0xC0000005: 读取位置 0xcccccccc 时发生访问冲突rnrn#include rn#include rn#include rnrn#define STUDENT_NUM 52 //学生人数rn#define COMMAND_LEN 6 //命令字符数rnrntypedef struct studentMessagernrn int stuCount; //学号rn char name[12]; //姓名rn int grade; //年级rn int classNum; //班级rn char phoneNum[12]; //手机号码rn char address[20]; //住址rnrn//成绩rn int Marktotal; //总成绩rn float average; //平均分rn int MarkCh; //语文rn int MarkMath; //数学rn int MarkEn; //英语rn int rankNum; //排名 rnstuM;rnrnint file(void)rnrnrn int k = 2011011551;rn stuM student[STUDENT_NUM];rn int i,j;rnrn FILE * fp = fopen("E:\\c_test.dat","a+");//读文件中的字符rn for(i = 0;i < STUDENT_NUM;i++)rn rn fscanf(fp,"%d %s %d %d %s %s %d %f %d %d %d %d",student[i].stuCount,student[i].name,&student[i].grade,&student[i].classNum,student[i].phoneNum,student[i].address,&student[i].Marktotal,&student[i].average,&student[i].MarkCh,&student[i].MarkMath,&student[i].MarkEn,&student[i].rankNum);//用定义的数组类型接收读取到的字符rn if(feof(fp))// 代表着字符串的结束rn break;rn rn rn for(j = 0;j < i;j++)rn rn printf("%3d ",j + 1);rn printf("%d %-8s %d %d %s %-6s %4d %2.2f %3d %3d %3d %3d\n",student[j].stuCount,student[j].name,student[j].grade,student[j].classNum,student[j].phoneNum,student[j].address,student[j].Marktotal,student[j].average,student[j].MarkCh,student[j].MarkMath,student[j].MarkEn,student[j].rankNum);rn rnrn fseek(fp,0L,SEEK_END);rnrn for(;k < 2011011600;k++)rn fprintf(fp,"%d\n",k);rnrn getch();rn return 0;rnrnint main(void)rnrn file();rnrn getch();rn return 0;rn
gdb调试问题记录
记录一下gdb调试程序过程中遇到的一些问题,方便以后查找。 1. cannot exec file
请教高手:gdb调试问题
1。如何在gdb调试状态下跳过一行不执行? 因为有时候操作失误,后来又不想执行后面的代码了(特别是后面的代码会退出)rnrn2。如何设置让一个函数总是返回固定的值而不要真实的去执行其中的代码?rnrn3。在调试时发现不断有线程产生和退出(速度非常快),gdb不断上报如下的信息:rn [new thread 0x2bdfbba0 (LWP 26991)]rn [Thread 0x2bdfbba0 (LWP 26991) exited]rn 请教如何能够进入该线程并查看是什么地方或函数产生的?因为有的线程是用clone产生的,所以即使用bt也只能查看到该rn 线程函数而无法知道产生它的上一个函数rnrn rn
redhat9.0 gdb远程调试问题
我想在同一个系统下练习GDB远程调试rn开两个终端rn一个终端中运行[root@localhost root]# gdbserver 127.0.0.1:1234 frn Process f created; pid = 5829rnrn同一系统下另一个终端gdb中运行(gdb) target remote 127.0.0.1:1234rn Remote debugging using 127.0.0.1:1234rn 0x40000be0 in ?? ()rn (gdb)rn第一个终端也提示了Remote debugging from host 127.0.0.1rn但在第二个终端中不能运行调试命令,(f那个要调试的程序没有问题),这是怎么回事?
请教gdb调试问题
使用gdb调试,出现"utils.c:1058: internal-error: virtual memory exhausted: can't allocate 20003770rnbytes.",请教这是什么问题引起的?rnrnGNU gdb 6.0rnCopyright 2003 Free Software Foundation, Inc.rnGDB is free software, covered by the GNU General Public License, and you arernwelcome to change it and/or distribute copies of it under certain conditions.rnType "show copying" to see the conditions.rnThere is absolutely no warranty for GDB. Type "show warranty" for details.rnThis GDB was configured as "powerpc-ibm-aix5.1.0.0"...rnCore was generated by `gamesrv'.rnProgram terminated with signal 11, Segmentation fault.rnutils.c:1058: internal-error: virtual memory exhausted: can't allocate 20003770rnbytes.rnA problem internal to GDB has been detected,rnfurther debugging may prove unreliable.rnQuit this debugging session? (y or n)rn......
求助:gdb调试问题
求助:gdb调试问题 rn源代码中有一源文件为:program.crnmakefile文件中,有一编译项为:gcc -g -o program program.crn然后,用gdb调试:rn[root@linux program]# gdb programrnGNU gdb Red Hat Linux (5.2.1-4)......rn(gdb) b mainrnBreak point 1 at Ox80489d2rn(gdb) rrnStart program:/usr/programrnBreak point 1 at Ox080489d2 in main()rn(gdb) nrnSingle stepping until exit from function main,rnwhich has no line number information.....rn.....rn(gdb) nrnSingle stepping until exit from _libc_start _main,rnwhicl has no line number information...rnProgram exited normallyrnrn为什么会这样呢?编译时有 “-g”选项啊,为什么gdb调试没有信息呢?rn求助,谢谢!rnrn
gdb调试问题,高人指教!!!!!
请问如何用gdb调试带命令行参数的汇编程序rn如:rn./readtest1 cpuid.txtrnrn如果用查看pid的方法,由于readtest运行的很快。没等输入完成就已经运行完了。readtest1是汇编程序. 不知怎么做,才能调试,还有如何才汇编内加入暂停,谢谢大家了
gdb 远程调试问题
在sparc板上做开发,上位机是win7,与上位机通过两个COM口(COM1、COM4)相连,grmon通过COM4把程序下载到下位机,然后让sparc-elf-gdb通过COM1口来调试程序。请问,这个设想可否实现?
code blocks下gdb调试问题
我是在code blocks下进行单步调试的,但是调试了几行,就停止了。rn用各种方法step into,step out都不行。rn停止的地方是个su的库函数, requestdoc(0); (注:su是seismic unix 是个地震处理开源的工具)rn这是code blocks的提示rn[color=#99CC00][i][size=10px]At /home/seismic/SU/wj_personal/our_data/multi_layer/multi_layer/multi_layer.c:361rnProgram exited with code 01.rnDebugger finished with status 0rn[/size]rn[/i][/color]rn另外,还有一个问题,就是step into一个子函数中,子函数有一个循环。rn每次F7单步时,都会进入1000次的循环,但是我不想进去。step out 就直接跳出子函数了。rn
GDB 远程调试问题
我用GDB远程调试,目标板启动gdbserver,PC端用GDB 的target remote 192.168.1.5:1234连接时总是出现:rnRemote comunication error:Connection reset by peer.rn目标板出现:Child exited with status 127rnrn请问这是为什么.rn大家帮帮忙..rn谢谢!
gdb调试问题总结
1,怎么在gdb开启的时候加入调试命令,如断点、设置运行参数     gdb有个-x参数,后面接一下存储gdb调试命令的文本文件,所以可以实现写个文本文件,把一开始必要的断点和调试环境以及运行参数设置写进去,然后用-x参数读入即可:    command.txt break main set print pretty run train --solver=models/bvlc_r
go语言程序-gdb调试问题
    以前经常用gdb调试C/C++程序,当学习golang的时候,发现golang的程序也是支持gdb调试的,然而还是遇到一些问题。比如说调试etcd程序就遇到如下问题: 【问题1】 info goroutines,提示找不到Undefined info command: &quot;goroutines&quot;.  Try &quot;help info&quot;. 解决方法:启动gdb后,运行目标程序之前(输入r之前)...
【求助】gdb调试问题
写了个小示例程序,有以下几个文件:hello.h hello.cpp compute.h compute.cpp rnrn用gdb调试时,使用list只可以列出hello.cpp的代码,怎么才能列出compute.cpp的代码啊? rnrn谢谢了啊
gdb多线程调试问题
当断点中断某线程运行,通过info threads命令发现,所有线程都暂停了。rn怎么样才能不影响别的线程运行,而只令当前线程停留在断点处?
C语言指针代码调试问题
![这是一段C的指针代码,但GCC提示说P没有声明是什么个情况,我前面已经声明了char **p](https://img-ask.csdn.net/upload/201609/03/1472867641_550821.png)
一个C语言的函数调试问题!
我写的这个函数调试不过去,谁能帮我改一下。肯定给分rnrn#include rn#include rnrntypedef unsigned char UCHAR;rntypedef int INT;rnrnrnUCHAR *bcd2str(UCHAR *in, int bcdlen, UCHAR *out, INT *outlen)rnrn int i, realinlen;rn int idx;rnrn realinlen = (int)((bcdlen+1)/2);rn idx = 0;rn for(i = 0; i < realinlen; i++) rn out[idx++] = ((in[i] & 0xF0) >> 4) + '0';rn if( idx >= bcdlen ) break;rn out[idx++] = (in[i] & 0x0F) + '0';rn rn out[idx] = '\0';rn *outlen = idx;rn return out;rnrnrnrnint bcd2int(UCHAR *in, INT bcdlen, INT *out)rnrn UCHAR buf[64];rn INT len;rnrn if( bcd2str(in, bcdlen, buf, &len) != NULL ) rn *out = atoi(buf);rn rn else rn *out = 0;rn rn return (*out);rnrnrnmain(void)rnrn UCHAR strBcd[20];rn INT * strnum;rn int strlen;rn int num;rn int i=0;rn memset(strnum,0,20);rn strBcd[0]=0x0;rn strBcd[0]=0x0;rn strBcd[0]=0x0;rn strBcd[0]=0x15;rn strBcd[0]=0x0;rn printf("strBcd:[%s]\n",strBcd);rn bcd2int(strBcd,strlen,strnum);rn printf("strint:[%s]\n",strnum);rn num = atoi(strlen);rn printf("num:[%d]",num); rn
学习笔记-C语言调试问题--初始化
昨天测试分类代码,原本准确率很高的代码,结果测试的时候却发现没几个分类准确的。断点调试,遇到一个很诡异的问题,调用函数的时候,在函数体内部加断点与不加断点的分类结果不同。反复确认之后,发现确实存在这种问题。以为是输入参数的问题,我使用的值传递,也许是这里不小心出现了问题,于是各种修改代码,尝试各种函数返回方式,结果是越来越槽。大半个下午的时间都耗在上面,仍是没有解决问题。今天早上,重新检查,还是这...
C语言GDB 远程调试技术
1、在远程主机启动命令(在远程主机上执行) gdbserver 172.16.200.13:10000  ./goahead  -v   $PWD/webs/dist  172.16.200.13:80 2、本地主机启动命令(在X86平台上执行) arm-linux-gdb   ./goahead 命令执行后,将会进入gdb的命令操作 输入&quot;target remote   172.16.200.1...
C语言 使用gcc、gdb
gcc命令 预处理阶段$ gcc -E hello.c -o hello.i 编译阶段$ gcc -S hello.i -o hello.s 汇编阶段$ gcc -c hello.s -o hello.o 链接阶段$ gcc hello.o -o hello -g 生成调试信息,GNU调试器可以利用该信息。gcc编译器使用该选项进行编译时,将调试信息加入目标文件当中,这样GDB...
【C语言】gdb调试器入门
前言    作为一名计算机系的学生,接触编程也有两年时间了,一个比较深的感受:光会码代码是远远不够的,调试代码的能力十分重要!     经常有同学说,这个我知道思路,代码也打出来了,为什么跑出来的结果总是不如我所愿!打代码1小时,调试1天这种事常常发生。     当然,这并不是我们打代码的能力不够,再好的程序员也会因为各种原因打出有bug的程序,debug是家常便饭。
c语言GDB学习文档
DB是GNU开源组织发布的一个强大的UNIX下的程序调试工具。或许,各位比较喜欢那种图形界面方式的,像VC、BCB等IDE的调试,但如果你是在UNIX平台下做软件,你会发现GDB这个调试工具有比VC、BCB的图形化调试器更强大的功能。所谓“寸有所长,尺有所短”就是这个道理。
急!急!WINDOWS 下 gdb 调试问题
我在网上下了NES模拟器源码,经过GCC(已经加了可调试选项 -g)编译后,想用GDB调试rnrn现在问题是我把所有的可调试库链接生成了NES.EXE文件,然后在GDB中rnrn"file NES.EXE" 最后控制台打出"no debuging symbols found"rnrn然后用"list"没有显示 rnrn本人初用GCC,请大虾指点一二 有没有什么办法让我从"MAIN"一步步跟踪的rnrn万分感谢!
read函数及gdb 调试问题
[code=C/C++]rn/*write.c*/rn#include rn#include rn#include rn#include rn#include rn#include rn#include rn#define MAXSIZErnrnint main(void)rnrn int i,fd,size,len;rn char *buf="Hello! I'm writing to this file!";rn char buf_r[10];rn len = strlen(buf);rnrn /*首先调用open(),并指定相应的权限*/rn if((fd = open("/tmp/hello.c", O_CREAT | O_TRUNC | O_RDWR,0666))<0)rn perror("open:");rn exit(1);rn rn elsern printf("open file:hello.c %d\n",fd);rnrn /*调用write(),将buf中的内容写入到打开的文件中*/rn if((size = write(fd,buf,len))<0)rn perror("write:");rn exit(1);rn rn elsern printf("write:%s\n",buf);rnrn /*调用lsseek(),将文件指针移到文件起始,并读出文件中的10个字节*/rn lseek(fd,0,SEEK_SET);rn if((size = read(fd,buf_r,10))<0)rn perror("read:");rn exit(1);rn rn elsern printf("read from file:%s\n",buf_r);rnrn if(close(fd)<0)rn perror("close:");rn exit(1);rn rn elsern printf("close hello.c\n");rnrnrn[/code]rn[root@localhost io]# gcc -g write.c -o writern[root@localhost io]# ./writernopen file:hello.c 3rnwrite:Hello! I'm writing to this file!rnread from file:Hello! I'mrnclose hello.crn这个结果看起来很对,但多次运行./write后却会出现:rnread from file:Hello! I'm⿭?rnfread from file:Hello! I'm翭?rn等等I'm后面有不可辨识字符的情况rnrn并且我用gdb调试直接r的结果却是:rnrn[root@localhost io]# gdb writernGNU gdb Red Hat Linux (6.1post-1.20040607.62rh)rnCopyright 2004 Free Software Foundation, Inc.rnGDB is free software, covered by the GNU General Public License, and you arernwelcome to change it and/or distribute copies of it under certain conditions.rnType "show copying" to see the conditions.rnThere is absolutely no warranty for GDB. Type "show warranty" for details.rnThis GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".rnrn(gdb) rrnStarting program: /root/io/writernopen file:hello.c 7rnwrite:Hello! I'm writing to this file!rnread from file:Hello! I'm????rnclose hello.crnrnProgram exited with code 016.rnrn--->fd值与原来运行不符rnrn以下为单步调试结果:rn[root@localhost io]# gdb writernGNU gdb Red Hat Linux (6.1post-1.20040607.62rh)rnCopyright 2004 Free Software Foundation, Inc.rnGDB is free software, covered by the GNU General Public License, and you arernwelcome to change it and/or distribute copies of it under certain conditions.rnType "show copying" to see the conditions.rnThere is absolutely no warranty for GDB. Type "show warranty" for details.rnThis GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".rnrn(gdb) lrn5 #include rn6 #include rn7 #include rn8 #include rn9 #define MAXSIZErn10rn11 int main(void)rn12 rn13 int i,fd,size,len;rn14 char *buf="Hello! I'm writing to this file!";rn(gdb) b 13rnBreakpoint 1 at 0x8048524: file write.c, line 13.rn(gdb) rrnStarting program: /root/io/writernrnBreakpoint 1, main () at write.c:14rn14 char *buf="Hello! I'm writing to this file!";rn(gdb) nrn16 len = strlen(buf);rn(gdb) p lenrn$1 = 0rn(gdb) nrn19 if((fd = open("/tmp/hello.c", O_CREAT | O_TRUNC | O_RDWR,0666))<0)rn(gdb) p fdrn$2 = 134518756rn(gdb) nrn24 printf("open file:hello.c %d\n",fd);rn(gdb) p fdrn$3 = 7rn(gdb) nrnopen file:hello.c 7rn27 if((size = write(fd,buf,len))<0)rn(gdb) p sizern$4 = 3006452rn(gdb) nrn32 printf("write:%s\n",buf);rn(gdb) p bufrn$5 = 0x8048754 "Hello! I'm writing to this file!"rn(gdb) nrnwrite:Hello! I'm writing to this file!rn35 lseek(fd,0,SEEK_SET);rn(gdb) nrn36 if((size = read(fd,buf_r,10))<0)rn(gdb) p sizern$6 = 32rn(gdb) nrn41 printf("read from file:%s\n",buf_r);rn(gdb) p buf_rrn$7 = "Hello! I'm"rn(gdb) nrnread from file:Hello! I'm
GDB调试问题,多共享库调试
一个项目下面有很多共享库,在我GDB 文件后,共享库没加载 。我通过CD命令切换到源代码目录后无法调试rn怎么处理呢?rn rnGDB LOAD命令也不行 搞求不懂rnrn还有,昨天都好好的,今天我通过 gdp -p 命令挂载我的项目后,提示rnerror while reading shared library symbols :rn//xxx.so : 没有那个文件或目录rnrnrn我通过cd 命令 也提示 working directory rn(canonically /)rnrn什么意思哦? 这两个问题是啥原因 怎么解决?
简单的GDB调试问题,已疯!
刚学习gdb调试,我有个工程里面有十几个文件。rn我当前目录停在我的源码目录(里面就20多个文件)后,输入:rn1.gdbrn2.gdb XX/XX/apprn显示加载符合成功rn3.这步我想在某个文件的某行或者某个函数加个断电,我输入:rnlist ./XX.cpp:230 结果显示文件不存在(这个文件就在当前目录下)rn之后我想打完./ 打俩个TAB来显示当前目录下文件结果跳出:rn Display all 17034 possibilities? (y or n) ....................rn我想用直接break ./XX.cpp:230 设置断点也出现同样问题。rn真蒙圈了..... 到底是咋回事?!怎么定位到某个文件?!
Fedora Core 3 下gdb调试问题
test.c源程序如下:rnrn#include rnvoid my_print(char *string);rnvoid my_print2(char *string);rnrnmain()rnrn char my_string[] = "hello there";rn my_print(my_string);rn my_print2(my_string);rnrnrnrnvoid my_print(char* string)rnrn printf("The string is %s\n", string);rnrnrnvoid my_print2(char* string)rnrn char * string2;rn int size, i;rnrn size = strlen(string);rn string2 = (char*)malloc(size+1);rn for(i = 0; i < size; i++)rn rn string2[size-i] = string[i];rn rn string2[size + 1] = '\0';rn printf("The string printed backward is %s\n", string2);rnrnrnrn在debug时总不成功,过程如下:rn////////////////////////////////////////////////////////////////rnrn[root@localhost rockey]# gcc -g -o test test.crn[root@localhost rockey]# gdb testrnGNU gdb Red Hat Linux (6.1post-1.20040607.41rh)rnCopyright 2004 Free Software Foundation, Inc.rnGDB is free software, covered by the GNU General Public License, and you arernwelcome to change it and/or distribute copies of it under certain conditions.rnType "show copying" to see the conditions.rnThere is absolutely no warranty for GDB. Type "show warranty" for details.rnThis GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_dbrnlibrary "/lib/tls/libthread_db.so.1".rnrn(gdb) lrn1 #include rn2 void my_print(char *string);rn3 void my_print2(char *string);rn4rn5 main()rn6 rn7 char my_string[] = "hello there";rn8 my_print(my_string);rn9 my_print2(my_string);rn10rn(gdb)rn11 rn12rn13 void my_print(char* string)rn14 rn15 printf("The string is %s\n", string);rn16 rn17rn18 void my_print2(char* string)rn19 rn20 char * string2;rn(gdb)rn21 int size, i;rn22rn23 size = strlen(string);rn24 string2 = (char*)malloc(size+1);rn25 for(i = 0; i < size; i++)rn26 rn27 string2[size-i] = string[i];rn28 rn29 string2[size + 1] = '\0';rn30 printf("The string printed backward is %s\n", string2);rn(gdb)rn31rn32 rn(gdb) break 27rnBreakpoint 1 at 0x804847c: file test.c, line 27.rn(gdb) rrnStarting program: /usr/rockey/testrnThe string is hello therernrnBreakpoint 1, my_print2 (string=0xfeee0db0 "hello there") at test.c:27rn27 string2[size-i] = string[i];rn(gdb) watch string2[size-i]rnHardware watchpoint 2: string2[size - i]rn(gdb) nextrnwarning: Could not remove hardware watchpoint 2.rnWarning:rnCould not insert hardware watchpoint 2.rnCould not insert hardware breakpoints:rnYou may have requested too many hardware breakpoints/watchpoints.rnrnrn//////////////////////////////////////////////rn到这个地方就出现错误,请问是怎么回事呢?rn
GDB的调试问题大侠来下阿
gdb下的一些功能有时候有有时候没有到底怎么回事呢?比如:rn[Magic@localhost luanma]$ gdb wrnGNU gdb Fedora (6.8-1.fc9)rnCopyright (C) 2008 Free Software Foundation, Inc.rnLicense GPLv3+: GNU GPL version 3 or later rnThis is free software: you are free to change and redistribute it.rnThere is NO WARRANTY, to the extent permitted by law. Type "show copying"rnand "show warranty" for details.rnThis GDB was configured as "i386-redhat-linux-gnu"...rn(no debugging symbols found)rn(gdb) break mainrnBreakpoint 1 at 0x8048462rn(gdb) runrnStarting program: /home/luanma/w rn(no debugging symbols found)/////////有时候有有时候没有的rn(no debugging symbols found)rn(no debugging symbols found)rnrnBreakpoint 1, 0x08048462 in main ()rnMissing separate debuginfos, use: debuginfo-install glibc.i686rn(gdb) listrnNo symbol table is loaded. Use the "file" command.有时候可以用的有时候不能用就这样rn(gdb) break w.c:5rnNo symbol table is loaded. Use the "file" command.rn(gdb) rnrn有时候确又是好的怎么办?rn
gdb调试问题No executable file specified.
我在makefile文件中加入了-g但还是出现No executable file specified.求解!rnmakefile 内容如下rnrnmyprogram :main.o dib.orn g++ -g -o myprogram main.o dib.ornmain.o :main.cpp main.h dib.hrn g++ -g -c main.cpprndib.o : dib.cpp dib.h bmp.h main.hrn g++ -g -c dib.cpprnclean :rn rm myprogram main.o dib.orn
gdb调试问题,关于list命令的
小弟在调试一个C语言的可执行文件。出现以下问题。我在使用list命令时不显示出程序的源码,这是怎么回事啊,出错的信息如下,请高手指点。rnrn# gdb testrnGNU gdb Red Hat Linux (5.3post-0.20021129.18rh)rnCopyright 2003 Free Software Foundation, Inc.rnGDB is free software, covered by the GNU General Public License, and you arernwelcome to change it and/or distribute copies of it under certain conditions.rnType "show copying" to see the conditions.rnThere is absolutely no warranty for GDB. Type "show warranty" for details.rnThis GDB was configured as "i386-redhat-linux-gnu"...rn(gdb) runrnStarting program: /root/testrnThe string is hello therernThe string printed backward isrnrnProgram exited with code 040.rn(gdb) listrn1 ../sysdeps/i386/elf/start.S: 没有那个文件或目录.rnin ../sysdeps/i386/elf/start.Srn(gdb) listrn1 in ../sysdeps/i386/elf/start.Srn(gdb) listrn1 in ../sysdeps/i386/elf/start.Srn(gdb) listrn1 in ../sysdeps/i386/elf/start.Srn(gdb)rn
定位子串 (C语言)
题目描述 将子串在母串中第一次出现的位置找出来。 图1:在母串中第pos个位置定位子串的算法 图2:从母串中第pos个位置获得长度为len的子串 输入描述 若干对字符串,每对字符串占一行并用一个空格分开。前一个字符串为母串,后者为子串。字符串只包含英文字母的大小写。每个字符串不超过98个字符。 输出描述 输出子串在母串中首次出现的位置,如果母串中不包含子串则输出0。每个整数占一行。 输入样例 AC...
【C语言】【unix c】GDB调试工具的使用
【C语言】【unix c】GDB调试工具的使用
gdb崩溃定位
崩溃定位: gdb xxx.exe core corexxxx bt
c调试问题
输入年龄如:1988,08,08rn在16-35岁之间的合格,年龄截止日期2002,03,30rn代码如下:rn#include "stdio.h"rnmain()rnint a,b,c;rn printf("shu ru ge shi wei : 1988,08,08\n");rn printf("qing an gui ding chu sheng ri qi:\n");rn scanf("%d,%d,%d",&a,&b,&c);rnif((a<1967||a>1986)||(a>1967&&a<1986&&b<1&&b>12)||(a>1967&&a<1986&&c<1&&c>31))rn printf("shu ru you wu!a\n");rn if(a==1967||a==1986)rn if (a==1967)rn if(b<3)printf("shu ru you wu!b\n");rn if(b==3&&c<30) rn printf("shu ru you wu!c\n");rn else printf("nin de zi liao lu ru zhong...\na");rn if (a==1986)rn if(b>3) printf("shu ru you wu!d\n"); rn if(b==3&&c>30) printf("shu ru you wu!e\n");rn else printf("nin de zi liao lu ru zhong...\na");rnrnrn请求帮助,谢谢
【C语言】文件定位读取
文件定位读取 文件顺序读取 位置指针按字节位置顺序移动。 文件随机读取 读写完上一个字符(字节)后,并不一定要读写其后续的字符(字节),而可以读写文件中任意位置上所需要的字符(字节)。
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数