【问题标题】:gdb logging not workinggdb 日志记录不起作用
【发布时间】:2018-08-24 08:31:22
【问题描述】:

我正在尝试使用gdb 调试程序。问题是没有出现日志文件。我是否需要以特定方式退出 gdb-session 或可能出现什么问题?

gdb 开始并显示日志设置会给出:

gdb python3
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...(no debugging symbols found)...done.
(gdb) show logging
Future logs will be written to gdb.txt.
Logs will be appended to the log file.
Output will be logged and displayed.
(gdb) 

【问题讨论】:

    标签: python-3.x debugging logging gdb


    【解决方案1】:

    问题是没有出现日志文件

    您没有启用日志记录,请使用set logging on 启用它:

    (gdb) set logging on
    Copying output to gdb.txt.
    (gdb) show logging
    Currently logging to "gdb.txt".
    Logs will be appended to the log file.
    Output will be logged and displayed.
    

    【讨论】:

    • 谢谢。我只是假设“未来的日志将被写入 gdb.txt”意味着会被记录。
    猜你喜欢
    • 2021-11-19
    • 2011-12-27
    • 2013-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多