(lldb) Print unsigned long long in hex

You can use format letters. Link to GDB docs (works for LLDB too): https://sourceware.org/gdb/current/onlinedocs/gdb/Output-Formats.html#Output-Formats

(lldb) p a
(unsigned long long) $0 = 10
(lldb) p/x a
(unsigned long long) $1 = 0x000000000000000a

After reading the rest of the document, I found out it is possible to do something like this:

// ObjC code
typedef int A;

then,

(lldb) type format add --format hex A

This gave me the idea to typedef unsigned long long BigInt :

// ObjC code
typedef unsigned long long BigInt;

then,

(lldb) type format add --format hex BigInt

Works like a charm.


type format add expects the type name as a single word -- you need to quote the argument if it is multiple words. e.g.

   2    {
   3      unsigned long long a = 10;
-> 4      a += 5;
   5      return a;
   6    }
(lldb) type form add -f h "unsigned long long"
(lldb) p a
(unsigned long long) $0 = 0x000000000000000a
(lldb)