Skip to content

Commit

Permalink
moo
Browse files Browse the repository at this point in the history
  • Loading branch information
404salad committed Oct 7, 2024
1 parent 9db19d3 commit 878c252
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions content/Debugging C++ Programs with GDB.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ You will see the `(gdb)` prompt.
- Type `run` to execute your program.
- Use `break` followed by a line number or function name to set breakpoints.
- Type `n` to step through the code line by line.
- Type `s` to step into a function.

## Step 4: Visualize Code with `layout split`

Expand All @@ -39,6 +40,12 @@ One helpful feature is the split layout, which displays both the source code and
layout split
```

or to skip the assembly view

```bash
layout src
```

## Step 5: Inspecting Variables

Use the `print` and `display` commands in GDB to inspect variables and expressions during debugging.
Expand Down
4 changes: 4 additions & 0 deletions dist/articles/Debugging C++ Programs with GDB.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ <h2>Step 3: Basic GDB Commands</h2>
<li>Type <code>run</code> to execute your program.</li>
<li>Use <code>break</code> followed by a line number or function name to set breakpoints.</li>
<li>Type <code>n</code> to step through the code line by line.</li>
<li>Type <code>s</code> to step into a function.</li>
</ul>
<h2>Step 4: Visualize Code with <code>layout split</code></h2>
<p>One helpful feature is the split layout, which displays both the source code and GDB commands simultaneously.</p>
<pre><code class="language-bash">layout split
</code></pre>
<p>or to skip the assembly view</p>
<pre><code class="language-bash">layout src
</code></pre>
<h2>Step 5: Inspecting Variables</h2>
<p>Use the <code>print</code> and <code>display</code> commands in GDB to inspect variables and expressions during debugging.</p>
<p>For example:</p>
Expand Down

0 comments on commit 878c252

Please sign in to comment.