Skip to content

Commit 57cf22b

Browse files
committed
debugging: list callers and callees
1 parent 81e1a91 commit 57cf22b

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

debugging.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,22 @@ Your Lisp can tell you all the places where a function is referenced
632632
or called, where a global variable is set, where a macro is expanded,
633633
and so on. For example, `slime-who-calls` (`C-c C-w C-c` or the Slime > Cross-Reference menu) will show you all the places where a function is called.
634634

635-
See our Emacs page for a complete list of commands.
635+
- `slime-who-references`: global variable references
636+
- `slime-who-bind`: global variable bindings
637+
- `slime-who-sets`: global variable setters
638+
- `slime-who-specializes`: methods specialized on a symbol
639+
- `slime-who-macroexpands`: places where a macro is expanded
640+
- `slime-list-callees`: lists all the functions that are called inside a given function body.
641+
- `slime-list-callers`: lists all the functions that call a given function.
642+
643+
Calling such a cross-reference function opens a new buffer with the
644+
list of results. You can navigate between references, and also
645+
recompile all the listed functions and macros with the usual shortcuts
646+
(`C-c C-k`). This is specially useful when you just changed a macro
647+
and you want to recompile all the functions that are using this macro.
648+
649+
See our Emacs page for a complete list of commands and their Slime shortcuts.
650+
636651

637652
## SLY stepper and SLY stickers
638653

emacs-ide.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ Reference: [https://slime.common-lisp.dev/doc/html/Compilation.html#Compilation]
371371
### Crossreferencing: find who's calling, referencing, setting a symbol
372372

373373
Slime has nice cross-referencing facilities. For example, you can ask
374-
what calls a particular function, what expands a macro, or where a global variable is being used.
374+
who calls a function, who expands a macro, or where a global variable is being used.
375375

376376
Results are presented in a new buffer, listing the places which reference a particular entity.
377377
From there, we can press Enter to go to the corresponding source line,
@@ -387,6 +387,8 @@ The bindings are the following (they are also shown in Slime's menu):
387387
- **C-c C-w b** (`slime-who-bind`) global variable bindings
388388
- **C-c C-w s** (`slime-who-sets`) global variable setters
389389
- **C-c C-w a** (`slime-who-specializes`) methods specialized on a symbol
390+
- **C-c >** (`slime-list-callees`) lists all the functions that are called inside a function body.
391+
- **C-c <** (`slime-list-callers`) lists all the functions that call a given function.
390392

391393
And when the `slime-asdf` contrib is enabled,
392394
**C-c C-w d** (`slime-who-depends-on`) lists dependent ASDF systems

0 commit comments

Comments
 (0)