Reputation: 2606
I have a pointer to a string
void *s = "now is the time for all"
and I wish to print it as an integer of 32-bit size:
gdb) p /x *((int *)s)
What is the equivalence in lldb
parlance?
Upvotes: 0
Views: 138
Reputation: 27203
Exactly that, except you can't put a space between the p
and the /x
.
lldb's command syntax is not the same as lldb's (for more details see:
http://lldb.llvm.org/tutorial.html
) but p
(among others) was added (as an alias to the lldb expr
command) for people more familiar with gdb's commands. However, to get the /x
part working through lldb's command parser it has to be directly postpended to the actual command name so it isn't confused with arguments and options. So:
(lldb) p/x *((int *) text_to_use)
(int) $1 = 0x8f06c8c0
There's also a cheat sheet for lldb <-> gdb commands here:
http://lldb.llvm.org/lldb-gdb.html
which you might find handy.
Upvotes: 2