zoukankan      html  css  js  c++  java
  • GDB常用命令与Visual Studio对比

    GDB常用命令与Visual Studio对比

    命令名称GDBVisual Studio
    运行程序 runs [args] F5:Start Debugging (开始调试)
    启动程序 start [atgs] F10:Step over (逐过程)
    暂停 Ctrl+C Ctrl-Alt+Break:Break All (全部中断)
    继续运行 continue(cont, c) F5:Continue (继续)
    step over next F10:Step over (逐过程)
    step into step F11:Step into (逐语句)
    step out finish F11:Step into ; Shift+F11:Step out
    断点 break file:lineno 右击Breakpoint/Insert Breakpoint (断点/插入断点)
    跟踪点 watch file:lineno 右击Breakpoint/Insert Tracepoint (断点/插入跟踪点)
    观察点 watch expr Debug/New Bkpt/New Dat Bkpt (调试/新建断点/新建数据断点)
    栈跟踪 backtrace(bt), where Call Stack (条用堆栈)
    输出表达式 print expr Immediate Window (及时窗口)
    显示表达式 display expr Watch 监视窗口
    设置环境 set var var=expr Variables 变量窗口
    设置环境变量 set env var[=val] Properties/Debugging/Environment (属性/调试/环境)
    显示机器代码 disassemble 右击Go to Disassembly (转到反汇编)
    在机器代码中执行step-over nexti F10:Step over
    在机器代码中执行step-into stepi F11:Step into

    其他常用调试命令


    命令名称GDBVisual Studio
    命令名称 GDB Visual Studio
    条件断点 conditon bnum 右击Breakpoint/Condition
    事件断点 handle, signal Debug/Exceptions…(调试异常)
    异常断点 catch, throw  
    函数断点 break function Debug/New Bkpt/Break at function
    临时断点 tbreak  
    列出所有断点 info breakpoints F9:Debug/Toggle Brkp,断点窗口
    将命令连接到断点 command bnum 右击Brkp/When hit(断点/命中条件)
    输出到命令行 printf 右击Brkp/When hit(断点/命中条件)
    查找函数 info function expr Debug/New Brkp/Break at function
    调用函数 call expr  
    修改函数返回值 return expr Immediate Window
    输出类型 whatis arg 右击Go to Declaration(转到声明)
    输出类型描述 ptype arg 右击Go to Definition(转到定义)
    输出内存内容 x arg  
    选择帧栈 info fram, fram arg
  • 相关阅读:
    关于CQRS(老外经典好文)
    关于Autofac的使用陷阱
    文件写入文件分布式系统(asp.net C#)
    NET Framework 4.5.2
    asp.net开源
    关于委托:异常{ 无法将 匿名方法 转换为类型“System.Delegate”,因为它不是委托类型 }
    sql SELECT时的with(nolock)选项说明
    树形结构的数据库表Schema设计
    C#操作符??和?:
    Byte[]和BASE64之间的转换
  • 原文地址:https://www.cnblogs.com/cqx6388/p/14479446.html
Copyright © 2011-2022 走看看