防止GDB进入功能(或文件) [英] Preventing GDB from stepping into a function (or file)

查看:120
本文介绍了防止GDB进入功能(或文件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  void foo(int num){ ...} 

void main(){
Baz baz;
foo(baz.get());

当我在 main() code>,我想进入 foo(),但我想要 baz.get ()



GDB文档说如果函数有行号信息,step命令只会输入一个函数,所以如果我可以删除它,我会很高兴来自我的可执行文件的 baz.get()的行号信息。但理想情况下,我可以告诉GDB从不会进入Baz类的任何功能。



有人知道如何做到这一点吗?

解决方案

从GDB 7.4开始,可以使用 skip



运行 info skip ,或查看手册了解详情: https://sourceware.org/gdb/onlinedocs/gdb/Skipping-Over-Functions-and-Files.html

I have some C++ code like this that I'm stepping through with GDB:

void foo(int num) { ... }

void main() {
  Baz baz;
  foo (baz.get());
}

When I'm in main(), I want to step into foo(), but I want to step over baz.get().

The GDB docs say that "the step command only enters a function if there is line number information for the function", so I'd be happy if I could remove the line number information for baz.get() from my executable. But ideally, I'd be able to tell GDB "never step into any function in the Baz class".

Does anyone know how to do this?

解决方案

Starting with GDB 7.4, skip can be used.

Run info skip, or check out the manual for details: https://sourceware.org/gdb/onlinedocs/gdb/Skipping-Over-Functions-and-Files.html

这篇关于防止GDB进入功能(或文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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