frame variable outputs nothing

Hi

I set a breakpoint and launch an application via lldb, and want to inspect the arguments of the method when the breakpoint triggers, however nothing shows:

(lldb) thread backtrace

  • thread #20: tid = 0x1352c6, 0x00000001001eb510 Application`Blitz::sharpen(QImage&, int), name = ‘VolumeTabSlotFilter’, stop reason = breakpoint 2.1
  • frame #0: 0x00000001001eb510 ApplicationBlitz::sharpen(QImage&, int) frame #1: 0x00000001001dca79 ApplicationFilter::sharpen(QImage) + 25
    frame #2: 0x000000010007bbd1 ApplicationVolumeTab::slotFilter_sharpen() + 145 frame #3: 0x0000000102dcb80f QtCoreQMetaObject::activate(QObject*, int, int, void**) + 2591
    frame #4: 0x0000000100080615 ApplicationVolumeTabSlotFilter::run() + 309 frame #5: 0x0000000102b963e3 QtCoreQThreadPrivate::start(void*) + 339
    frame #6: 0x00007fff8f80f268 libsystem_pthread.dylib_pthread_body + 131 frame #7: 0x00007fff8f80f1e5 libsystem_pthread.dylib_pthread_start + 176
    frame #8: 0x00007fff8f80d41d libsystem_pthread.dylib`thread_start + 13
    (lldb) frame variable
    (lldb)

What am I doing wrong? I’ve tried googling for a solution but have not found anything.

Regards,
Mikkel Eide Eriksen

Hi

I set a breakpoint and launch an application via lldb, and want to inspect
the arguments of the method when the breakpoint triggers, however nothing
shows:

(lldb) thread backtrace
* thread #20: tid = 0x1352c6, 0x00000001001eb510
Application`Blitz::sharpen(QImage&, int), name = 'VolumeTabSlotFilter',

Here you have only types, but not values, seems that you don't have
debug symbols, no?

I unfortunately do not have source access or debug symbols. Can I use the method signature to determine the arguments?

I unfortunately do not have source access or debug symbols. Can I use the
method signature to determine the arguments?

You could try do it manually, and you could start from [1] (or what ever
your arch is).

[1] http://en.wikipedia.org/wiki/X86_calling_conventions

So if I understand the calling conventions correctly (MacOS X 10.10.2 on Intel Core 2 Duo) the three arguments are in order ($0 = pointer to Blitz class, $1 = QImage &img, $2 = int radius):

(lldb) p $rdi
(unsigned long) $0 = 4470045704
(lldb) p $rsi
(unsigned long) $1 = 4470045672
(lldb) p $rdx
(unsigned long) $2 = 3

How do I inspect the member variables of the QImage?

So if I understand the calling conventions correctly (MacOS X 10.10.2 on
Intel Core 2 Duo) the three arguments are in order ($0 = pointer to Blitz
class, $1 = QImage &img, $2 = int radius):

(lldb) p $rdi
(unsigned long) $0 = 4470045704
(lldb) p $rsi
(unsigned long) $1 = 4470045672
(lldb) p $rdx
(unsigned long) $2 = 3

Looks correct.

How do I inspect the member variables of the QImage?

I guess that your binary is linked with qt. So it will be better to just
install debugging symbols for qt and this must helps.

Note we have generic argument function register names as aliases that will work on all architectures:

(lldb) p $arg1
(lldb) p $arg2
(lldb) p $arg3

The problem is this will only be valid on the first instruction as the function prologue will quickly move the arguments around, so if you want to look at arguments you must stop at the entry point, or follow the disassembly to see where the function put the arguments.

Also note that setting breakpoints will always try to skip the function prologue so you will need to tell the breakpoint to _not_ skip the prologue:

(lldb) breakpoint set --name "Blitz::sharpen(QImage&, int)" --skip-prologue=0

Or using the "b" regex command:

(lldb) b &Blitz::sharpen(QImage&, int)