pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/SuboptimalEng/cpp-tutorials/tree/main/021-lldb-debugging

rel="stylesheet" href="https://github.githubassets.com/assets/repository-3aa75d4cd2374bb7.css" /> cpp-tutorials/021-lldb-debugging at main · SuboptimalEng/cpp-tutorials · GitHub
Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Video Overview

  • Intro to debugging C++ with LLDB

Note

  • This video is similar to 001-gdb-lldb-debugging
  • Wanted to remake the video since that video is old
  • And I made it just as I was starting to learn C++

LLDB Commands

# start/re-run executable
run

# lldb settings
# assembly (vim ~/.lldbinit)
disassemble --pc

# breakpoint
b main
b add
br list  # list breakpoints
br del 1 # delete bp 1


# step through code/assembly
n  # next line
s  # step into
ni # next instruction
si # step into instruction

# print variables
p a
p 1
p 1 + 1

# reading registers
register read
register read rax
p $rax              # shortcut

# examine memory
# Format: x/[count][format][size] address
# Formats: x (hex), d (decimal), c (char), i (instruction)
# Sizes: b (byte), h (half-word), w (word/4b), g (giant/8b)
x $rbp
x/d $rbp-0x4
x/4wx $rsp    # hex words
x/4wd $rsp    # decimal
x/8xb $rsp    # bytes

# misc
help p
quit

Titles

  • How to Debug C++ with LLDB | C++ Tutorial for Beginners
  • LLDB Assembly Debugging Basics: Step, Inspect, and Understand Memory
  • Mastering LLDB: p, x, and Stepping Through Assembly (Beginner Guide)
  • From C++ to Assembly in LLDB: Registers, Memory, and Step-by-Step Debugging

References

  • ChatGPT and Gemini
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy