阻止GDB单步执行glibc函数 [英] Stop GDB from stepping through glibc functions

查看:89
本文介绍了阻止GDB单步执行glibc函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,标题很简短,想不出更好的方法了.

当我通过GDB运行程序以查找细分错误时,我得到数千行该垃圾的行:

 (gdb)步骤在fileops.c上_IO_new_file_xsputn(f = 0x76fa0b40< _IO_2_1_stdout_> ;, data = 0x7efff284,n = 7)1279 fileops.c:没有这样的文件或目录.(gdb)步骤Fileops.c中的1273(gdb)步骤Fileops.c中的1279(gdb)步骤Fileops.c中的1286(gdb)步骤Fileops.c中的1288(gdb)步骤Fileops.c中的1289(gdb)步骤Fileops.c中的1292(gdb)步骤Fileops.c中的1294(gdb)步骤Fileops.c中的1292 

...然后不停地继续.这使得调试非常困难而乏味,因为:

  • 我必须重复键入 step (或按 Enter ).
  • 我几乎看不到程序的输出,因为它隐藏在毫无意义的信息中.
  • 如果我反复按 Enter ,我经常会错过我要查找的Seg Fault.

如何告诉gdb退出打印这样的行?

fileops.c中的

  1273 

我可以使用一些配置文件或命令行选项吗?

解决方案

确定要逐步遍历 fileops.c 中的glibc代码吗?

如果您只想调试自己的代码,则应在进入并继续调试代码后,完成当前框架以退出 _IO_new_file_xsputn 函数./p>

Sorry for the nondescript title, couldn't think of anything better.

When I run my program through GDB to find a Segmentation Fault, I get thousands of lines of this garbage:

(gdb) step
_IO_new_file_xsputn (f=0x76fa0b40 <_IO_2_1_stdout_>, data=0x7efff284, n=7) at fileops.c
1279    fileops.c: No such file or directory.
(gdb) step
1273    in fileops.c
(gdb) step
1279    in fileops.c
(gdb) step
1286    in fileops.c
(gdb) step
1288    in fileops.c
(gdb) step
1289    in fileops.c
(gdb) step
1292    in fileops.c
(gdb) step
1294    in fileops.c
(gdb) step
1292    in fileops.c

...and on and on and on. It makes debugging very difficult and tedious because:

  • I must type step (or press Enter) repeatedly.
  • I can hardly ever even see the output of my program, as it's hidden in pointless information.
  • If I'm pressing Enter repeatedly, I often miss the Seg Fault I'm looking for.

How can I tell gdb to quit printing the lines like this?

1273     in fileops.c

Is there some config file or command-line option I can use?

解决方案

Are you sure you need to step through glibc code in fileops.c ?

If you want only to debug your own code you should finish current frame to go out of _IO_new_file_xsputn function after you have stepped into it and continue debugging your code.

这篇关于阻止GDB单步执行glibc函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆