AsmBB

Power
Login Register

How to debug asmbb?

#16022 (ツ) ganuonglachanh
Created 12.03.2020, read: 261 times

Hi johnfound

My dev setup is Fresh IDE in Linux with WINE, edb debugger installed, asmbb run via docker (should I change to rwasa for debugging?).

I tried debug the engine file but it's not possible

Can you make a tutorial to debug asmbb sourcecode? (step by step for begginer)

Thank you!

#16023 (ツ) johnfound
Created 12.03.2020, read: 258 times
ganuonglachanh

Hi johnfound

My dev setup is Fresh IDE in Linux with WINE, edb debugger installed, asmbb run via docker (should I change to rwasa for debugging?).

I tried debug the engine file but it's not possible

Can you make a tutorial to debug asmbb sourcecode? (step by step for begginer)

Thank you!

Now, at first, debugging AsmBB in docker is pretty problematic IMHO. It is better to install local server and run directly.

I am using EDB rarely and debugging mainly by including debug prints to the console here and there. There is a library in FreshLib that allows easy switching on/off this debug print.

The option is options.DebugMode that is set at the line 24 of engine.asm file. Unfortunately the debug macros are not well documented, but look for OutputValue, DebugMsg, OutputRegister` in the source.

Anyway, I will try to write a little bit wider manual about debugging AsmBB when I have more spare time.

#16026 (ツ) ganuonglachanh
Last edited: 12.03.2020 by ganuonglachanh , read: 254 times

Thanks johnfound

I made some progress, I can't debug engine because I forget to copy both ld-musl-i386.so and libsqlite3.so to the www dir.

Step by step:

1. run rwasa server

2. run ./engine

3. run edb and attach to engine process, pause the process

4. set a break point to function need to debug, resume the process

5. read the code (so different from Fresh IDE fasm code and compiled ASM code!! :-P )

Do we have some asm command to auto stop the debugger ? Found it:

insert 'int 3' to anywhere you want to debugger to stop rofl

#16029 (ツ) johnfound
Last edited: 12.03.2020 by johnfound, read: 250 times
ganuonglachanh

insert 'int 3' to anywhere you want to debugger to stop rofl

Not "int 3" but "int3" - the difference is that int3 is a special one byte command especially for breakpoints. ;)

AsmBB v2.8 (check-in: 6348f13102432a47); SQLite v3.31.1 (check-in: 3bfa9cc97da10598);
©2016..2020 John Found; Licensed under EUPL. Powered by Assembly language Created with Fresh IDE