[Lldb-commits] [lldb] b0c0a14 - [lldb][Docs] Add equivalents of GDB's "skip" to command map (#120740)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Jan 6 01:17:29 PST 2025
Author: David Spickett
Date: 2025-01-06T09:17:25Z
New Revision: b0c0a148dbad9f4d9a2e855deec05669269d30c7
URL: https://github.com/llvm/llvm-project/commit/b0c0a148dbad9f4d9a2e855deec05669269d30c7
DIFF: https://github.com/llvm/llvm-project/commit/b0c0a148dbad9f4d9a2e855deec05669269d30c7.diff
LOG: [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.
Added:
Modified:
lldb/docs/use/map.rst
Removed:
################################################################################
diff --git a/lldb/docs/use/map.rst b/lldb/docs/use/map.rst
index fe9c3f53022fad..ed285b2d1f6e90 100644
--- a/lldb/docs/use/map.rst
+++ b/lldb/docs/use/map.rst
@@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
More information about the lldb-commits
mailing list