[lldb][Docs] Add equivalents of GDB's "skip" to command map (#120740)

https://sourceware.org/gdb/current/onlinedocs/gdb.html/Skipping-Over-Functions-and-Files.html

We can't emulate all the features of that command but we can skip a
function by name with some extra steps.

As far as I know this only matches function name unlike GDB that can
filter on file and line and so on:
```
target.process.thread.step-avoid-regexp -- A regular expression defining functions step-in won't stop in.
```
It's likely it's got some corner cases that don't work, maybe inlining,
but it doesn't seem worth going into it here.

I don't think we can chain lldb interpreter commands, so I have shown
the steps separately.

I have also mentioned `thread step-in` and its alias `sif`. Which were
new to me too.
This commit is contained in:
David Spickett
2025-01-06 09:17:25 +00:00
committed by GitHub
parent efd929efa5
commit b0c0a148db

View File

@@ -235,6 +235,38 @@ Do a source level single step in the currently selected thread
(lldb) step
(lldb) s
Ignore a function when doing a source level single step in
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: shell
(gdb) skip abc
Function abc will be skipped when stepping.
.. code-block:: shell
(lldb) settings show target.process.thread.step-avoid-regexp
target.process.thread.step-avoid-regexp (regex) = ^std::
(lldb) settings set target.process.thread.step-avoid-regexp ^std::|^abc
You can ignore a function once using:
.. code-block:: shell
(lldb) thread step-in -r ^abc
Or you can do the opposite, only step into functions matching a certain name:
.. code-block:: shell
# Step in if abc is a substring of the function name.
(lldb) sif abc
# Which is equivalent to:
(lldb) thread step-in -t abc
``thread step-in`` has more options which cover some of ``skip``'s other
features. See ``help thread step-in`` for details.
Do a source level single step over in the currently selected thread
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~