Skip to content

Commit 3a0b306

Browse files
DavidSpickettpaulhuggett
authored andcommitted
[lldb][Docs] Add equivalents of GDB's "skip" to command map (llvm#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.
1 parent 8524581 commit 3a0b306

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lldb/docs/use/map.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,38 @@ Do a source level single step in the currently selected thread
235235
(lldb) step
236236
(lldb) s
237237
238+
Ignore a function when doing a source level single step in
239+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240+
241+
.. code-block:: shell
242+
243+
(gdb) skip abc
244+
Function abc will be skipped when stepping.
245+
246+
.. code-block:: shell
247+
248+
(lldb) settings show target.process.thread.step-avoid-regexp
249+
target.process.thread.step-avoid-regexp (regex) = ^std::
250+
(lldb) settings set target.process.thread.step-avoid-regexp ^std::|^abc
251+
252+
You can ignore a function once using:
253+
254+
.. code-block:: shell
255+
256+
(lldb) thread step-in -r ^abc
257+
258+
Or you can do the opposite, only step into functions matching a certain name:
259+
260+
.. code-block:: shell
261+
262+
# Step in if abc is a substring of the function name.
263+
(lldb) sif abc
264+
# Which is equivalent to:
265+
(lldb) thread step-in -t abc
266+
267+
``thread step-in`` has more options which cover some of ``skip``'s other
268+
features. See ``help thread step-in`` for details.
269+
238270
Do a source level single step over in the currently selected thread
239271
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240272

0 commit comments

Comments
 (0)