Skip to content

Commit bbf94fb

Browse files
authored
Merge pull request #30690 from gottesmm/pr-874efcfcb9ba823ae1ca62b5ca75a30132bd2e19
2 parents f3b3c39 + 0036570 commit bbf94fb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/DebuggingTheCompiler.rst

+11
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,17 @@ we know to ignore swift_getGenericMetadata 84 times, i.e.::
359359

360360
(lldb) br set -i 84 -n GlobalARCOpts::run
361361

362+
A final trick is that one can use the -R option to stop at a relative assembly
363+
address in lldb. Specifically, lldb resolves the breakpoint normally and then
364+
just adds the argument -R to the address. So for instance, if I want to stop at
365+
the address at +38 in the function with the name 'foo', I would write::
366+
367+
(lldb) br set -R 38 -n foo
368+
369+
Then lldb would add 38 to the offset of foo and break there. This is really
370+
useful in contexts where one wants to set a breakpoint at an assembly address
371+
that is stable across multiple different invocations of lldb.
372+
362373
LLDB Scripts
363374
~~~~~~~~~~~~
364375

0 commit comments

Comments
 (0)