Forum > Operating Systems

Lazarus for RISC OS

<< < (34/37) > >>

micken:
A quite important note is that the compiler only allows one argument, the source file. I have -va -xd hardcoded right now. This can be changed when I fully grasp the syntax string for arguments.

Also true for executables made with the compiler. You can access it with argv[argc-1].

micken:

--- Code: ---264K switest.aif,ff8
1000K switest,e1f

--- End code ---
elf version is quite big :) But it is probably because compiler is built with DEBUG=1.

AIF files can be debugged, even though the riscos debugger is quite limited. Below is breakpoint set to inside write, (I THINK!) you can see the address in R0 which is the only argument to OS_Write0, print string in r0. You can see the string in the memory dump. It actually can be useful when hunting memory issues.. hint hint.

If interested the offending part is at 0x31c94 in the aif file..
so:
in a taskwindow:
load ppcarm 8000
breakset 31c94
go 8000
it will stop at break point , you can type "continue" answer Y to question , and it will run to next time breakpoint is met.

A quick look in disassembly (aif file) I can find that R0 and R2 are interesting.

I think that looking at the address after the call to Os_Alloc is more interesting.. If the returned pointer is bad , that means that my allocator failed...



Another useful command is *memory
syntax is
memory <address in hex (not 0x)> -- gives you the dump from mmumapped address
memory p <address in hex (not 0x)> -- the same from physical address




--- Code: ---*breakset 11a14
*go 8000HelloasmxStopped at break point set at &00011A14
Register dump (stored at &2000D5D0) is:
R0  = 0004A684 R1  = 0004A684 R2  = 0000002B R3  = 00000000
R4  = 00000001 R5  = 0004A684 R6  = 0000002B R7  = 0004B00C
R8  = 00000000 R9  = 00000000 R10 = 00000067 R11 = 0011BE54
R12 = 0011BE58 R13 = 0011BDF0 R14 = 000341B0 R15 = 00011A14
Mode USR32 flags set: Nzcvqjggggeaift        PSR = 80000010
Debug*
*memory 0004A684

Address  :     7 6 5 4     B A 9 8     F E D C     3 2 1 0     7 6 5 4     B A 9 8     F E D C     3 2 1 0 :            ASCII Data
0004A684 :    6C6C6548    7266206F    66206D6F    722F6370    6F637369    53203A73    74204957    21747365 : Hello from fpc/riscos: SWI test!
0004A6A4 :    7465720A    3A6E7275    000A340A    00000000    00000000    00000000    00000000    00000000 : .return:.4......................
0004A6C4 :    00000000    00000000    00000000    00000000    00000000    00000000    00000000    00000000 : ................................
0004A6E4 :    00000000    00000000    00000000    00000000    00000000    00000000    00000000    00000000 : ................................
0004A704 :    00000000    00000000    00000000    00000000    00000000    00000000    00000000    00000000 : ................................
0004A724 :    00000000    00000000    00000000    00000000    00000000    00000000    00000000    00000000 : ................................
0004A744 :    00000000    00000000    00000000    00000000    00000000    00000000    00000000    00000000 : ................................
0004A764 :    00000000    00000000    00000000    00000000    00000000    00000000    00000000    00000000 : ................................
*

--- End code ---

StefanRISCOS:

--- Quote from: micken on August 14, 2023, 05:54:40 pm ---You can see it in Tasks window (PascalWimp) and the source code.

--- End quote ---

Awesome!  :D

TRon:

--- Quote from: micken on August 15, 2023, 09:59:52 am ---...
AIF files can be debugged, even though the riscos debugger is quite limited.
...

--- End quote ---
Very Interesting as that for sure will help. Thank you for sharing. Any way to invoke the debugger programmatically ?


--- Quote ---Another useful command is *memory

--- End quote ---
Again thank you for sharing.

But.. what a convoluted way to display some continuous stream of bytes/data. I am used to big vs little endian but to me and imho this makes no sense whatsoever. You could opt for making a memory dump yourself though (but then some basics such as memory allocation, pointer handling and character outputting needs to work properly).

On the other hand, it is at least better than having nothing at all  :)

micken:
Try *help memory

It has some options for how it displays memory.

I like the command. It is possible to have that kernel module loaded without much other stuff.
Extremely useful when porting riscos to new platforms.

The debugger module might have swis ,can have a look.
https://www.riscosopen.org/wiki/documentation/show/Debugger

No useful swis.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version