Gdb打印到文件而不是标准输出 [英] Gdb print to file instead of stdout

查看:392
本文介绍了Gdb打印到文件而不是标准输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行gdb,想要检查其中一个不幸的上帝对象。它需要很多页面(我有一个24英寸的显示器横向翻转!)来查看整个事情。为了便于使用,我希望gdb将对象打印到文件而不是屏幕上,以便我可以打开它vi和轻松移动,所有的gdb的多功能性,必须有一种方法来做到这一点,对吗?

你需要

 (gdb)设置记录在



(gdb)日志文件my_god_object.log

您可以检查当前的日志配置。

 (gdb)显示记录


I am running gdb and want to examine one of those unfortunate god objects. It takes many pages (and I have a 24" monitor turned sideways!) to see the whole thing. For ease of use, I'd like gdb to print the object to a file instead of the screen so that I can open it in vi and move around with ease. With all gdb's versatility, there must be a way to do this, right?

解决方案

You need to enable logging.

(gdb) set logging on

You can tell it which file to use.

(gdb) set logging file my_god_object.log

And you can examine current logging configuration.

(gdb) show logging

这篇关于Gdb打印到文件而不是标准输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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