忽略来自gdb(终端)中包含/库文件的调试消息 [英] ignore debugging message from include/library files in gdb (terminal)

查看:92
本文介绍了忽略来自gdb(终端)中包含/库文件的调试消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在gdb中调试一个C ++程序并逐步完成代码。在各个点上,调试器将开始逐步浏览库/包含文件中的代码,这些代码非常繁琐且对我无用。无论如何抑制或跳出这些信息。我只关注跟踪与当前.cpp文件相关的跟踪。

解决方案


在各个点上,调试器将开始逐步浏览库/包含文件中的代码,非常繁琐而且对我没有任何帮助。


您可能试图浏览代码如下所示:

  std :: vector< int> v = ... 

foo(v [i]); //想进入foo,但步骤将进入
// std :: vector :: operator [](size_t)。

很久以前,人们已经认识到需要跨越无趣的访问器函数( bug )但是没有人在GDB中实现这一点。



最好的办法是在发现自己不感兴趣的函数时使用 finish 命令,并且 step

您也可以让GDB在使用 skip 命令时忽略某些函数。 文档


I'm debugging a C++ program in gdb and stepping through the code. At various points the debugger will start stepping through the code in libraries/included files which is very tedious and not helpful for me. Is there anyway to suppress or 'jump' out of this information. I'm only concerned of following the trace as pertains to the current .cpp file.

解决方案

At various points the debugger will start stepping through the code in libraries/included files which is very tedious and not helpful for me.

You are probably trying to step through code that looks something like this:

std::vector<int> v = ...

foo(v[i]);  // Want to step into foo, but step will get into
            // std::vector::operator[](size_t) instead.

The need to step over uninteresting "accessor" functions has been recognized long time ago (bug) but nobody implemented this in GDB yet.

Your best bet is to use the finish command when you find yourself in uninteresting function, and step again.

You can also ask GDB to ignore certain functions while stepping with the skip command. Documentation.

这篇关于忽略来自gdb(终端)中包含/库文件的调试消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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