[Lazarus] Single-stepping assembler

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Sat Sep 3 15:26:25 CEST 2011


Martin wrote:
> On 31/08/2011 09:51, Mark Morgan Lloyd wrote:
>> Should this work from the assembler window? The buttons appear to step 
>> to the next source line and manually setting a breakpoint by typing in 
>> an address appears to work on some architectures (PPC) but not others 
>> (SPARC).
>>
> 
> Yes the button should do single step (whatever gdb belives a single 
> instruction step to be), if supported by gdb.
> You can also assign keys (like alt-f8 alt-f7); or make the default f7/f8 
> focus sensitive (so they single-inst-step if the asm win has focus).
> 
> If it does not work for you, please open the "Debug output" window from 
> "view" / "debug windows" and check what command is sent to gdb.

I've been looking at this on various platforms. I can't easily test 
Windows due to an apparent build problem, but on Linux and Solaris:

x86 (gtk2 and Qt): "Step into" (-> -exec-step-instruction) OK. "Step 
Over" (-> -exec-next-instruction") OK. Intel-format assembler, formatted OK.

ARM (gtk2, emulated by Qemu, not susceptible to alignment errors): 
Debugger access is erratic, works best if debug windows displayed before 
program run. "Step into" (-> -exec-step-instruction) OK. "Step Over" (-> 
-exec-next-instruction") OK. Assembler window shows tabs as \t.

PPC (gtk2): "Step into" (-> -exec-step-instruction) OK. "Step Over" (-> 
-exec-next-instruction") runs to termination or until it finds an 
explicit breakpoint. Assembler formatted OK.

SPARC (gtk2): "Step into" (-> -exec-step-instruction) appears to step 
over the next instruction if it's a call, however this appears to be an 
artifact of the way calls work (i.e. with a mandatory nop appended). 
"Step Over" (-> -exec-next-instruction") OK provided that the above is 
taken into consideration. Assembler window shows tabs as \t.

SPARC Solaris: as above.


Reliability in some cases might be improved by restarting Lazarus after 
a debugging session, particularly if the target program hasn't run to 
completion.

I think that the PPC problem is real, but if so it might be a gdb rather 
than a Lazarus issue. Single-stepping SPARC assembler requires a good 
understanding of the way calls work.

All 0.9.30.1 built with bigide using 2.4.4; Linux (Debian "Lenny" or 
"Squeeze") using X over SSH.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list