ChinaUnix.net
相关文章推荐:

gdb 跳出函数

跳出循环: until NUM 执行到一个比当前行号大的行,或者也可以指定在当前frame(我理解成函数)中的某一行 跳出函数: finish 执行,直到选定的frame执行结束,然后打印返回值,将其放入历史值中,停止 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/44068/showart_697930.html

by jiushen - Linux文档专区 - 2008-05-21 21:11:01 阅读(2497) 回复(0)

相关讨论

比方说我用单步step命令进入了一个函数func1 然后想直接跳出这个函数,继续调试主程序,应该怎样做? 目前是重复next命令直到这个函数结束 可是有些函数比较长,就比较麻烦了

by kuaizaifeng - C/C++ - 2006-10-26 20:38:39 阅读(30930) 回复(4)

gdb调试程序.如果遇到循环.我该怎样跳出呢 如果用s跟踪到了一个函数里面.我想跳出去.继续执行刚刚的函数.该怎样做呢. 请指教.谢谢~~

by power0811 - C/C++ - 2014-07-22 11:10:39 阅读(15786) 回复(9)

本帖最后由 hongyunqi 于 2010-07-24 10:23 编辑 工作中遇到的问题,希望有人能帮忙解答 三个类的定义抽象出来是这样的[code]class B1 { public: virtual void func1(); } class B2 { public: virtual void func2(); } class D: public B1, public B2 { public: void func1(); void func2(); } int main() { B2 *dd = new D(); dd->func2(); }[/code]类D多重继承自两个类B1和B2,那么D的对象正常情况下应该有两个...

by hongyunqi - C/C++ - 2010-07-24 20:05:39 阅读(3102) 回复(1)

本帖最后由 tianhailong 于 2012-09-03 17:27 编辑 我是用gdb调试程序,想在字符串上设置条件断点, 例如: b parser_custom_info if string == "

" b parser_custom_info if strcmp(string, "
") == 0 回报:warning: failed to reevaluate condition for breakpoint 4: No symbol "strncmp" in current context 这样的错误,而且也不会停在我指定的位置, 比如说停在,string 为“

by tianhailong - C/C++ - 2012-09-04 10:49:06 阅读(3051) 回复(5)

[root@localhost update_server]#gdb update GNU gdb (gdb) Red Hat Enterprise Linux (7.0.1-32.el5_6.2) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details...

by bzadhere - C/C++ - 2011-07-20 12:22:26 阅读(3122) 回复(3)

程序有时候会Core掉,但是那个偶尔函数栈会乱掉,很莫名其妙的调用来调用去... 请问这种问题怎么一般怎么搞? 怎么快速的定位到问题?

by egmkang - C/C++ - 2010-11-27 18:36:57 阅读(4280) 回复(8)

我使用gdb调试, 假设有一个函数: int func() { cout<<"hello"; return 1; } 运行如下的命令: (gdb)print func() 这样,只是打印出了函数的返回值, 但是函数内部的hello却没有打印出来, 请问如何能够调用一个函数,并且打印这个函数内部执行的输出语句呢? 谢谢回答!!!

by vaqeteart - C/C++ - 2010-03-02 18:02:52 阅读(1897) 回复(2)

本帖最后由 hitcser01 于 2013-09-24 07:37 编辑 [code]main(){ foo_init() time_init() bar_init() }[/code]调试的时候从main()第一行开始一直就是next,但是当运行到time_init()时竟然自动进入了time_init()内部,保证没有在time_init()内部设置断点,就是自动进入的。 自动进入time_init()后查看堆栈信息:(没有time_init() ?)[code](gdb) info stack #0 main () at main.c:83 [/code]finish也提示:"finis...

by hitcser01 - C/C++ - 2013-09-24 07:36:28 阅读(1214) 回复(0)

[code]root@c-dev:/cdev# vi stack.c[/code][code]int add (int x, int y) { int a =0; a = x; a += y; return a; } int main (int argc, char *argv[]) { int x, y, result; x = 0x12; y = 0x34; result = add(x, y); return 0; }[/code]如题,请教各位大神,怎样在gdb中获得add()函数的返回地址?在不反编译的情况下?请指点,谢谢。

by superwujc - C/C++ - 2013-09-17 19:26:55 阅读(2943) 回复(2)

代码如下非常简单[code]#include using namespace std; class A{ private: int i; public: A(){ i=20; i=40; } ~A(){ } }; int main(){ A* a=new A(); delete a; }[/code]我在 A* a=new A(); 这行设置了一个断点 执行 run step 进入的不是构造函数的代码, 而是 new 操作符 malloc 之类的一些底层代码 请问各位大侠 我如何 step 进入 构造函...

gdb

by longmm1988 - C/C++ - 2011-12-07 16:41:39 阅读(2628) 回复(3)