zoukankan      html  css  js  c++  java
  • GDB获取帮助信息

    用help 功能,你可以获得GDB 的命令信息。

    help
    h 你可以用help(缩写h)不带参数来显示一个命令分类的简短列表。

    (gdb) help
    List of classes of commands:
    
    aliases -- Aliases of other commands
    breakpoints -- Making program stop at certain points
    data -- Examining data
    files -- Specifying and examining files
    internals -- Maintenance commands
    obscure -- Obscure features
    running -- Running the program
    stack -- Examining the stack
    status -- Status inquiries
    support -- Support facilities
    tracepoints -- Tracing of program execution without stopping the program
    user-defined -- User-defined commands
    
    Type "help" followed by a class name for a list of commands in that class.
    Type "help all" for the list of all commands.
    Type "help" followed by command name for full documentation.
    Type "apropos word" to search for commands related to "word".
    Command name abbreviations are allowed if unambiguous.
    (gdb) 

    help class
    用help 分类作为参数,你可以得到这个分类里命令列表。比如,下面是status 分类的帮
    助显示:

    (gdb) help status
    Status inquiries.
    
    List of commands:
    
    info -- Generic command for showing things about the program being debugged
    info address -- Describe where symbol SYM is stored
    info all-registers -- List of all registers and their contents
    info args -- Argument variables of current stack frame
    info auto-load -- Print current status of auto-loaded files
    info auto-load gdb-scripts -- Print the list of automatically loaded sequences of commands
    info auto-load libthread-db -- Print the list of loaded inferior specific libthread_db
    info auto-load local-gdbinit -- Print whether current directory .gdbinit file has been loaded
    info auto-load python-scripts -- Print the list of automatically loaded Python scripts
    info auto-load-scripts -- Print the list of automatically loaded Python scripts
    info auxv -- Display the inferior's auxiliary vector
    info bookmarks -- Status of user-settable bookmarks
    info breakpoints -- Status of specified breakpoints (all user-settable breakpoints if no argument)
    info checkpoints -- IDs of currently known checkpoints
    info classes -- All Objective-C classes
    info common -- Print out the values contained in a Fortran COMMON block
    info copying -- Conditions for redistributing copies of GDB
    info dcache -- Print information on the dcache performance
    info display -- Expressions to display when program stops
    info extensions -- All filename extensions associated with a source language
    info files -- Names of targets and files being debugged
    info float -- Print the status of the floating point unit
    info frame -- All about selected stack frame
    info frame-filter -- List all registered Python frame-filters
    info functions -- All function names
    info handle -- What debugger does when program gets various signals
    ---Type <return> to continue, or q <return> to quit---

    help command

    用命令名作参数,GDB 会显示一段如何使用这个命令的信息。

    apropos args
    apropos 命令会在命令和文档里文档搜索这个args 指定的正则表达式。这个命令会打印
    所有符合的结果。例如:

    (gdb) apropos tbreak
    tbreak -- Set a temporary breakpoint

    complete args
    complete args 命令列出所有可能的补全结果。用args 指定你想要的命令的开头字母。例
    如:

    (gdb) complete i
    if
    ignore
    ignore-errors
    inferior
    info
    init-if-undefined
    interpreter-exec
    interrupt
    (gdb) 

    更进一步的,你可以用GDB 命令info 和show 来查询你程序的状态或者GDB 本身的状态。

    这两个命令都支持多个主题的查询;

    info 和show 下的列表列出了所有的子命令。

    info 这个命令(缩写i)可以描述程序的状态。例如,你可以用info args 显示传递给函
    数的参数,用info registers 来列出
    寄存器数据,用info breakpoints 列出你设置的断点。你可以用help info 来取得info 的
    所有子命令。
    set 你可以用set 命令把一个表达式的值来设置一个环境变量。例如,你可以用set prompt
    $来设置GDB 提示符。
    show 和info 不同,show 描述的GDB 本身的状态。你可以用set 命令改变大多数你可以
    用show 显示的内容。例如,你可以用set
    radix 来设置显示的数值进制系统,或者用show radix 来显示数值进制。
    你可以用不带参数的show 命令来显示所有可以设置的参数和它们的值;你也可以用
    info set。这两个命令是一样的。
    还有其余3 种show 子命令,这3 中命令缺乏对应的set 命令:
    show version
    显示当前GDB 的版本。你应该在GDB bug 报告中包含版本信息。如果你的机器上有多个版本的GDB,你可能需要知道哪个版本是你正在运行的;随着GDB 的发展,新的命令会引入,而一些旧的将废弃。同时,许多系统供应商移植了不同版本的

    GDB,在GNU/Linux 发行版也存在着多种版本的GDB.版本号和你启动时显示一样。

  • 相关阅读:
    第三百六十九天 how can I 坚持
    第三百六十八天 how can I 坚持
    第三百六十四、五、六、七天 how can I 坚持
    POJ 1663:Number Steps
    POJ 2676:Sudoku 数独
    POJ 2488:A Knight's Journey 深搜入门之走马观花
    POJ 3050:Hopscotch
    51nod 1419:最小公倍数挑战
    POJ 1011:Sticks 经典搜索
    POJ 2362:Square 觉得这才算深度搜索
  • 原文地址:https://www.cnblogs.com/BinBinStory/p/7248135.html
Copyright © 2011-2022 走看看