[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Announce] Second Alpha release of a Lua debugger
- From: Rici Lake <lua@...>
- Date: Mon, 16 Apr 2007 12:32:24 -0500
Steve Heller wrote:
On Mon, 16 Apr 2007 11:55:22 -0500, Rici Lake <lua@ricilake.net>
wrote:
Steve Heller wrote:
--- Rici Lake <lua@ricilake.net> wrote:
Steve Heller wrote:
Unfortunately, I still can't get it to set the
breakpoint. The file name shows up as this in ldb:
By the way, if you're in the debugger at a point where it's
showing you (part of) the filename that you want to set a
breakpoint in, you can omit the filename from the breakpoint
command. Just type:
b 18
and it will set a breakpoint at line 18 of the current file.
You can navigate up and down in the callframe stack (with the
'up' and 'down' commands) to get to a place where the filename
is correct, if you have multiple files in the project and
the one you want is in the backtrace.
To actually see the full current filename, you can use the
command:
,,print(here.source)
That will print the filename with a leading @; ignore the @ (it's
part of the Lua debug information, to signal that the source is
a filename). I feel that line needs a bit of explanation, so here
goes:
You could normally just use this:
==here.source
But that will also truncate strings (I hate it when debuggers fill
the screen with unexpectedly long values). So to get the full
string you have to execute the Lua print() function. The doubled
prefix (',,'; '==') tells ldb to evaluate the chunk/expression in
its own context, which is a slightly augmented global environment.
In particular, it's augmented with the 'here' pseudotable, which
contains the Lua debug information for the current context.
This is described in 'help context', 'help magic' and 'help here'
Hope that helps.