请教:调试的时候能把能退回上一步

cao30332 2010-06-14 05:34:01
有时候调试的时候监视一个变量,想退回上一语句或者退回上一个断点,不知道有没有办法,特此请教。
...全文
4945 22 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
aaa1111sss 2010-06-18
  • 打赏
  • 举报
回复
佩服 这才知道gdb可以退回调试
qiushuitian 2010-06-17
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 do_fork 的回复:]

这个也可以
C/C++ code
(gdb) apropos reverse
rc -- Continue program being debugged but run it in reverse
reverse-continue -- Continue program being debugged but run it in reverse
reverse-finish -- Execut……
[/Quote]
高手,佩服一下
philipzeng 2010-06-17
  • 打赏
  • 举报
回复
mark之。
louyong0571 2010-06-17
  • 打赏
  • 举报
回复
真长见识
ForestDB 2010-06-15
  • 打赏
  • 举报
回复
看牛牛。
2010-06-15
  • 打赏
  • 举报
回复
我是来膜拜 do_fork 的~
woebird 2010-06-15
  • 打赏
  • 举报
回复
学习中。。。。
yzx714 2010-06-14
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 do_fork 的回复:]

这个也可以
C/C++ code
(gdb) apropos reverse
rc -- Continue program being debugged but run it in reverse
reverse-continue -- Continue program being debugged but run it in reverse
reverse-finish -- Execut……
[/Quote]惭愧啊,没认真读过GDB的文档,幸好do_fork指正,不然又误导楼主了…………
liutengfeigo 2010-06-14
  • 打赏
  • 举报
回复
英语不行的话真的不可以深入C++了。。。~!
恶补英语
do_fork 2010-06-14
  • 打赏
  • 举报
回复 1
这个也可以
(gdb) apropos reverse
rc -- Continue program being debugged but run it in reverse
reverse-continue -- Continue program being debugged but run it in reverse
reverse-finish -- Execute backward until just before selected stack frame is called
reverse-next -- Step program backward
reverse-nexti -- Step backward one instruction
reverse-search -- Search backward for regular expression (see regex(3)) from last line listed
reverse-step -- Step program backward until it reaches the beginning of another source line
reverse-stepi -- Step backward exactly one instruction
rn -- Step program backward
set exec-direction -- Set direction of execution
set remote reverse-continue-packet -- Set use of remote protocol `bc' (reverse-continue) packet
set remote reverse-step-packet -- Set use of remote protocol `bs' (reverse-step) packet
set tui active-border-mode -- Set the attribute mode to use for the active TUI window border
set tui border-mode -- Set the attribute mode to use for the TUI window borders
show exec-direction -- Show direction of execution (forward/reverse)
show remote reverse-continue-packet -- Show current use of remote protocol `bc' (reverse-continue) packet
show remote reverse-step-packet -- Show current use of remote protocol `bs' (reverse-step) packet
show tui active-border-mode -- Show the attribute mode to use for the active TUI window border
show tui border-mode -- Show the attribute mode to use for the TUI window borders


gdb至少5年前就支持调试执行时的回滚了
do_fork 2010-06-14
  • 打赏
  • 举报
回复

(gdb) help bookmark
Set a bookmark in the program's execution history.
A bookmark represents a point in the execution history
that can be returned to at a later point in the debug session.



(gdb) apropos bookmark
bookmark -- Set a bookmark in the program's execution history
delete bookmark -- Delete a bookmark from the bookmark list
goto-bookmark -- Go to an earlier-bookmarked point in the program's execution history
info bookmarks -- Status of user-settable bookmarks
starcat 2010-06-14
  • 打赏
  • 举报
回复
zeta debugger里倒是有一个step back
但是这个独立调试器我死活都玩不来,附带的帮助文档也很有限
cao30332 2010-06-14
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 lthyxy 的回复:]
执行代码时居然不可以退回去。。。
[/Quote]
有时候挺麻烦的 数据量大的话还得一个个敲键盘输入。
liutengfeigo 2010-06-14
  • 打赏
  • 举报
回复

执行代码时居然不可以退回去。。。
「已注销」 2010-06-14
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 lvshaoqing 的回复:]

引用 1 楼 loaden 的回复:
不可以的,重新调试,再运行到你鼠标处。


你太让人失望了。
[/Quote]
说说你的好办法?
cdb和gdb我都不知道怎么退回上一个断点,还请指教下。
cao30332 2010-06-14
  • 打赏
  • 举报
回复
vs2008调试的时候左边的黄色箭头能往回拉,但是有提示可能出错。
yzx714 2010-06-14
  • 打赏
  • 举报
回复
我怕难,至少GDB目前没有这个功能
arong1234 2010-06-14
  • 打赏
  • 举报
回复
有特殊的工具可以的,微软似乎有内部工具可以做到,也有其他团体研究这个可以回退的工具,不过这种工具似乎外面不是很多
cswuyg 2010-06-14
  • 打赏
  • 举报
回复
指令都执行了,退不了。
lvshaoqing 2010-06-14
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 loaden 的回复:]
不可以的,重新调试,再运行到你鼠标处。
[/Quote]

你太让人失望了。
加载更多回复(2)

33,321

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 新手乐园
社区管理员
  • 新手乐园社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧