[Lazarus] Single-stepping assembler
Mark Morgan Lloyd
markMLl.lazarus at telemetry.co.uk
Tue Sep 13 15:08:06 CEST 2011
Mark Morgan Lloyd wrote:
> Both SPARC and ARM now expand \t in the assembler window. I've still got
> a problem on ARM (i.e. Lazarus running on ARM, not a cross-compiler)
> where trying to display the assembler window when at a breakpoint causes
> the program to run, things are fine if the window is open before the
> program is started.
More details as below. Starting with the assembler window not displayed,
and running to a breakpoint in the source window:
<< TCmdLineDebugger.ReadLn "(gdb) "
>> TCmdLineDebugger.SendCmdLn "-stack-list-frames 0 2"
<< TCmdLineDebugger.ReadLn
"^done,stack=[frame={level="0",addr="0x00083be0",func="MOONPHASE_init",file="moonphase.pas",fullname="/usr/local/src/heavywethers/trunk/moonphase.pas",line="1002"},frame={level="1",addr="0x00037d90",fu"
.(269)..
"n",file="HeavyWethers.lpr",fullname="/usr/local/src/heavywethers/trunk/HeavyWethers.lpr",line="40"}]"
<< TCmdLineDebugger.ReadLn "(gdb) "
Exec done
Leaving Queue with count: 0 Recurse-Count=0 State=Pause
Executing (Recurse-Count=0) queued= 0 CmdPrior=1 CmdMinRunLvl=-1 :
"TGDBMIDebuggerCommandLocals:" State=Pause PauseWaitState=0
>> TCmdLineDebugger.SendCmdLn "-stack-list-arguments 1 0 0"
<< TCmdLineDebugger.ReadLn "^done,stack-args=[frame={level="0",args=[]}]"
<< TCmdLineDebugger.ReadLn "(gdb) "
>> TCmdLineDebugger.SendCmdLn "-stack-list-locals 1"
<< TCmdLineDebugger.ReadLn "^done,locals=[]"
<< TCmdLineDebugger.ReadLn "(gdb) "
Exec done
Leaving Queue with count: 0 Recurse-Count=0 State=Pause
########### Now sitting on breakpoint in source window.
########### View -> Debug windows -> Assembler
########### Program runs without stopping.
########### At program's login dialogue tell it to abort.
INFO: TDBGDisassembler.FindRange: Address not found 539616
wanted-before=5 wanted-after=22 in map with count=0
Executing (Recurse-Count=0) queued= 0 CmdPrior=30 CmdMinRunLvl=-1 :
"TGDBMIDebuggerCommandDisassembe: FromAddr=539616 ToAddr=539616
LinesBefore=5 LinesAfter=22" State=Pause PauseWaitState=0
>> TCmdLineDebugger.SendCmdLn "-data-disassemble -s 539575 -e 539576
-- 0"
<< TCmdLineDebugger.ReadLn ""
[WARNING] TGDBMIDebugger: ExecuteCommand "-data-disassemble -s
539575 -e 539576 -- 0" failed.
INFO: TDBGDisassembler.Clear: map had count=0
Canceling: "TGDBMIDebuggerCommandDisassembe: FromAddr=539616
ToAddr=539616 LinesBefore=5 LinesAfter=22"
(lazarus:1183): Gtk-CRITICAL **: gtk_text_view_scroll_to_iter: assertion
`yalign >= 0.0 && yalign <= 1.0' failed
########### Now have IDE "Debugger error ...
########### The GDB process is no longer running" box.
###########
########### The GDB command:
########### "-data-disassemble -s 539575 -e 539576 -- 0"
########### did not return any result.
r32281 2.4.4 gdb 7.0.1-debian
Restarting IDE, displaying assembler window and running to breakpoint
(marked below with > at start of line):
moonphase.pas:1001 Assert(test_jDayToSecs);
00083BB4 84fcffeb bl 0x82dcc
<TEST_JDAYTOSECS>
00083BB8 000050e3 cmp r0, #0
00083BBC 0700001a bne 0x83be0
<MOONPHASE_init+332>
00083BC0 0b30a0e1 mov r3, r11
00083BC4 032ca0e3 mov r2, #768 ; 0x300
00083BC8 e92082e3 orr r2, r2, #233 ; 0xe9
00083BCC f8009fe5 ldr r0, [pc, #248] ;
0x83ccc <MOONPHASE_init+568>
00083BD0 0010a0e1 mov r1, r0
00083BD4 f4409fe5 ldr r4, [pc, #244] ;
0x83cd0 <MOONPHASE_init+572>
00083BD8 0400a0e1 mov r0, r4
00083BDC acd2feeb bl 0x38694 <fpc_assert>
moonphase.pas:1002 Assert(test_jYear);
> 00083BE0 b1fcffeb bl 0x82eac <TEST_JYEAR>
00083BE4 000050e3 cmp r0, #0
00083BE8 0700001a bne 0x83c0c
<MOONPHASE_init+376>
00083BEC 0b30a0e1 mov r3, r11
00083BF0 032ca0e3 mov r2, #768 ; 0x300
00083BF4 ea2082e3 orr r2, r2, #234 ; 0xea
00083BF8 cc009fe5 ldr r0, [pc, #204] ;
0x83ccc <MOONPHASE_init+568>
00083BFC 0010a0e1 mov r1, r0
00083C00 c8409fe5 ldr r4, [pc, #200] ;
0x83cd0 <MOONPHASE_init+572>
00083C04 0400a0e1 mov r0, r4
00083C08 a1d2feeb bl 0x38694 <fpc_assert>
moonphase.pas:1008 Assert(test_Phase);
I've saved that file in case you want a copy by e.g. direct mail.
--
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