zoukankan      html  css  js  c++  java
  • gdb使用初步

    首先,你的程序在经由gcc/g++编译的时候,要带上-g选项。比如:g++ test.cpp -g -o test
    然后,执行:gdb test
    进入gdb界面之后,输入start并回车,则调试开始。(如果被调试的程序需要参数,则在start后面带参数)
    以下是常用命令:

    help:     display help. you can use 'help data', 'help running' for more help
    start:     start running and suspend
    run:        start running
    n:           next
    s:           step into
    c:           continue
    b:           set breakpoint
    cl:          clear breakpoint
    info breakpoints:   list all breakpoints
    p:           print value
    disp:     keep watch on value
    undisp: no longer keep watch on value
    where:   show stach trace
    thread:   switch thread
    ctrl+c:     suspend debug running
    list:         display source code
  • 相关阅读:
    day11课堂小结 函数作用域
    猜年龄函数版day10作业
    函数day10课堂小结
    day07作业
    文件处理day09
    编码day08
    默写
    day07课堂小结
    day06作业
    const与define应用上该怎么取舍
  • 原文地址:https://www.cnblogs.com/hehe520/p/6330456.html
Copyright © 2011-2022 走看看