逐行调试 [英] Specially debugging line by line

查看:137
本文介绍了逐行调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Pascal写的脚本。我会以这种方式调试它:在每一行停止,转储内存中所有变量的值并转到下一行。是否可以使用gdb或其他一些Linux开源工具?

解决方案

使用选项 -g 编译文件:

  fpc / gpc -g file.pas 

为此文件运行 gdb

  gdb文件

设置所有必需的变量:

 显示first_var 
显示second_var
...

开始调试:

 开始

s 可以继续下一行。


I have a script written in Pascal. I would to debug it in this way: stop at every line, dump values of all variables in memory and go to the next line. Is it possible to do it with gdb or some other open-source tool for Linux?

解决方案

Compile file with option -g:

fpc/gpc -g file.pas

Run gdb for this file:

gdb file

Set all of needed variables:

display first_var
display second_var
...

Start debugging:

start

By pressing s you can continue to the next line.

这篇关于逐行调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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