Skip to content

LLDB

Category

for example, print memory of length 16x4 bytes:

x/16 0xb0987654

Change frmae format

자동으로 출력되는 프레임 포맷:

settings show frame-format

기본값은 다음과 같다:

frame-format (format-string) = "frame #${frame.index}: ${ansi.fg.yellow}${frame.pc}${ansi.normal}{ ${module.file.basename}{\`${function.name-with-args}{${frame.no-debug}${function.pc-offset}}}}{ at ${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}{${function.is-optimized} [opt]}{${frame.is-artificial} [artificial]}\n"

수정하고 싶다면 다음과 같이 하면 된다.

settings set frame-format "frame #${frame.index}: ${ansi.fg.yellow}${frame.pc}${ansi.normal}{ ${module.file.basename}{\`${function.name-with-args}{${frame.no-debug}${function.pc-offset}}}}{ at ${ansi.fg.cyan}${line.file.fullpath}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}{${function.is-optimized} [opt]}{${frame.is-artificial} [artificial]}\n"

Disassembly - Intel syntax

settings set target.x86-disassembly-flavor intel

Current working directory

platform shell pwd

Change Current working directory

platform settings -w <NEW_PATH>

Save breakpoints

As Jim Ingham said above, you currently cannot save breakpoints in lldb. However, there is a work around. You can load lldb commands from a command file as follows:

lldb -S <path_to_command_file>

You can have this in your command file:

file <path_to_binary>
breakpoint set --file file0.cc --line 22
breakpoint set --file file1.cc --line 237

The above command file will load the binary and set the breakpoints when lldb starts.

See also

Favorite site