[lldb-dev] frame variable outputs nothing

Greg Clayton gclayton at apple.com
Mon Mar 23 11:02:07 PDT 2015


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)



> On Mar 22, 2015, at 9:16 AM, Mikkel Eriksen <mikkel.eriksen at gmail.com> wrote:
> 
> 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?
> 
> On Sun, Mar 22, 2015 at 5:04 PM, Azat Khuzhin <a3at.mail at gmail.com> wrote:
> On Sun, Mar 22, 2015 at 04:55:02PM +0100, Mikkel Eriksen wrote:
> > 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
> 
> >
> > On Sun, Mar 22, 2015 at 4:49 PM, Azat Khuzhin <a3at.mail at gmail.com> wrote:
> >
> > > On Sun, Mar 22, 2015 at 04:02:18PM +0100, Mikkel Eriksen wrote:
> > > > 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?
> > >
> > > > stop reason = breakpoint 2.1
> > > >   * frame #0: 0x00000001001eb510 Application`Blitz::sharpen(QImage&, int)
> > > >     frame #1: 0x00000001001dca79 Application`Filter::sharpen(QImage) + 25
> > > >     frame #2:
> > > > 0x000000010007bbd1 Application`VolumeTab::slotFilter_sharpen() + 145
> > > >     frame #3: 0x0000000102dcb80f QtCore`QMetaObject::activate(QObject*,
> > > > int, int, void**) + 2591
> > > >     frame #4: 0x0000000100080615 Application`VolumeTabSlotFilter::run() +
> > > > 309
> > > >     frame #5: 0x0000000102b963e3 QtCore`QThreadPrivate::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.
> > >
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev





More information about the lldb-dev mailing list