2013年7月30日

摘要: Finish And Until 'finish' lets the current function execute until it finishes. 'until makes gdb continue program execution until the given line is reached. Note: 'until' can only be executed if the program alreadyreturn Sometimes we want a function to terminate prematurely during 阅读全文
posted @ 2013-07-30 10:23 kwingmei 阅读(295) 评论(0) 推荐(0) 编辑
摘要: The Annoying C-Preprocessor Macrosgcc -gdwarf-2 -g3Breakpoint 1, main () at c_preprocessor_macros.c:1414 int state = STATE_BAD;(gdb) p STATE_BAD$1 = 1(gdb) info macro STATE_BADDefined at /home/choo/work/lin-club/gdb_-_customize_it/gdb_source_examples/c_preprocessor_macros.c:4#define STATE_BAD 1Brea. 阅读全文
posted @ 2013-07-30 10:04 kwingmei 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 主要便于调试使用, 如观测某个变量, 或某几个变量的表达式gdb allows creating gdb-scoped variables "on the fly":To see the list of defined convenience variables:To initialize a convenience variable only if it's not yet defined:init-if-undefine $foo=i*2 条件初始化Convenience variables are useful when writing gdb macros 阅读全文
posted @ 2013-07-30 10:01 kwingmei 阅读(253) 评论(0) 推荐(0) 编辑
摘要: Making gdb do more (debugging) for less (re-typing)gdb allows us to debug our code primitively. 调试我们的代码Yet, gdb supports a large number of knobs and levers, all of which are quite documented. 也可以说太仔细了, 我们不会去看而已are too lazy to read documentation... ...and even more so, for software we've been usi 阅读全文
posted @ 2013-07-30 09:55 kwingmei 阅读(212) 评论(0) 推荐(0) 编辑

导航