2 lines
3.2 KiB
JavaScript
2 lines
3.2 KiB
JavaScript
import{_ as e,c as a,o,a4 as t}from"./chunks/framework.DtvhUNIn.js";const g=JSON.parse('{"title":"GDB 初探索(编程可阅览)","description":"","frontmatter":{},"headers":[],"relativePath":"技术资源汇总(杭电支持版)/3.编程思维体系构建/3.4.7.1GDB初探索(编程可阅览).md","filePath":"技术资源汇总(杭电支持版)/3.编程思维体系构建/3.4.7.1GDB初探索(编程可阅览).md"}'),r={name:"技术资源汇总(杭电支持版)/3.编程思维体系构建/3.4.7.1GDB初探索(编程可阅览).md"},c=t('<h1 id="gdb-初探索-编程可阅览" tabindex="-1">GDB 初探索(编程可阅览) <a class="header-anchor" href="#gdb-初探索-编程可阅览" aria-label="Permalink to "GDB 初探索(编程可阅览)""></a></h1><p>请在开始进行 C 语言编程之后查阅使用</p><p><img src="https://cdn.xyxsw.site/boxcnHXggg6eLy86vFmb4shOksh.png" alt=""></p><h2 id="gdb-是什么" tabindex="-1">GDB 是什么? <a class="header-anchor" href="#gdb-是什么" aria-label="Permalink to "GDB 是什么?""></a></h2><p>调试器,简单来说就是当你代码跑不通时候修正错误用的</p><p><a href="https://sourceware.org/gdb/mascot/" target="_blank" rel="noreferrer">GDB's Mascot?</a></p><p>可搭配插件 gef pwndbg pwngdb peda</p><h2 id="基本操作" tabindex="-1">基本操作 <a class="header-anchor" href="#基本操作" aria-label="Permalink to "基本操作""></a></h2><p><a href="https://www.bilibili.com/video/BV1EK411g7Li/" target="_blank" rel="noreferrer">GDB 快速入门教程</a></p><h3 id="gdb-使用表" tabindex="-1"><strong>GDB 使用表</strong> <a class="header-anchor" href="#gdb-使用表" aria-label="Permalink to "**GDB 使用表**""></a></h3><p><code>run (r)</code>运行程序</p><p><code>b</code>打断点,可以在函数和位置打断点</p><p><code>info b</code>查看打断点的位置</p><p><code>n</code>下一步,跳过函数的</p><p><code>list</code>查看源代码</p><p><code>-p</code>走 PID 路线</p><p><code>edit [file:]function</code> 看现在停下的函数位置</p><p><code>step</code> 进入任何函数</p><p><code>p</code>打印变量</p><p><code>shell</code>输入命令</p><p><code>set logging on</code>记录日志</p><p><code>watchpoint</code>观察变量是否变化的观察点</p><p><code>watch</code>设置观察点位置,watch*(地址)</p><p><code>layout split</code>开启 TUI 模式</p><p><code>whatis</code>查看变量类型</p><p><code>ptype</code>查看详细信息</p><h4 id="tui" tabindex="-1"><strong>TUI</strong> <a class="header-anchor" href="#tui" aria-label="Permalink to "**TUI**""></a></h4><p><code>ctrl + x + a</code>开启</p><p><code>ctrl + p + n</code>往前</p><p><code>ctrl + l</code>重新整理页面</p><h2 id="官方手册" tabindex="-1">官方手册 <a class="header-anchor" href="#官方手册" aria-label="Permalink to "官方手册""></a></h2><p><a href="https://sourceware.org/gdb/current/onlinedocs/gdb" target="_blank" rel="noreferrer">GDB User Manual</a></p><p>有非常多高级用法,可以在必要的时候进行查阅,受益无穷</p>',33),d=[c];function p(n,s,i,l,h,_){return o(),a("div",null,d)}const u=e(r,[["render",p]]);export{g as __pageData,u as default};
|