0

In lldb, I wanted to create an alias for call printCallStack(). I got an error that did not explain much:

(lldb) command alias pcs call printCallStack()
error: Unable to create requested alias.

How to do it correctly?

Vass
  • 431
  • 2
  • 4

1 Answers1

0

Seems like that did not work because call is itself an alias.

If I use expr instead, it works:

(lldb) command alias pcs expr printCallStack()
# or, add '--' for extra coolness :)
(lldb) command alias pcs expr -- printCallStack()
Vass
  • 431
  • 2
  • 4
  • Yes, that was on purpose. It seemed like allowing aliases of aliases would lead to instability in your commands, and wouldn't really add that much value. Similarly you can't use a shortened command name in an alias, since the addition of another command could change the meaning of the shortened name. – Jim Ingham Nov 17 '20 at 18:27
  • @JimIngham Sure, this makes sense. What bothers me is that the error message does not tell me that this is going on. It leaves me in the dark w.r.t. fixing the problem. – Vass Nov 19 '20 at 13:14
  • Please file a bug with the llvm bug reporter, bugs.llvm.org, and somebody can look into improving the error message (or give it a whack yourself if you are feeling adventurous...) – Jim Ingham Nov 19 '20 at 18:01