..:: AsmBB ::..: How to debug asmbb?
<img src="https://board.asm32.info/images/title.svg" alt="Title img">
<h1>AsmBB is ultrafast web forum, written entirely in assembly language. This site is the official support development forum and demo/test installation.</h1>
tag:board.asm32.info,2018-03-06:Thread3052020-03-12T15:26:01Zjohnfound on How to debug asmbb?tag:board.asm32.info,2018-03-06:Post160292020-03-12T15:26:01Z
<blockquote><header>ganuonglachanh</header><p>insert 'int 3' to anywhere you want to debugger to stop <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/rofl.gif" alt="rofl" />
</p></blockquote>
<p>Not <code>"int 3"</code> but <code>"int3"</code> - the difference is that <code>int3</code> is a special one byte command especially for breakpoints. ;)
</p>
johnfoundganuonglachanh on How to debug asmbb?tag:board.asm32.info,2018-03-06:Post160262020-03-12T14:17:46Z
<p>Thanks johnfound
</p>
<p>I made some progress, I can't debug engine because I forget to copy both <strong>ld-musl-i386.so</strong> and <strong>libsqlite3.so</strong> to the www dir.
</p>
<p>Step by step:
</p>
<p>1. run rwasa server
</p>
<p>2. run ./engine
</p>
<p>3. run edb and attach to engine process, pause the process
</p>
<p>4. set a break point to function need to debug, resume the process
</p>
<p>5. read the code (so different from Fresh IDE fasm code and compiled ASM code!! <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/tongue.gif" alt=":-P" /> )
</p>
<p>Do we have some asm command to auto stop the debugger ? Found it:
</p>
<p>insert 'int 3' to anywhere you want to debugger to stop <img class="inline" src="/templates/Urban+Sunrise/_images/emoticons/rofl.gif" alt="rofl" />
</p>
ganuonglachanh johnfound on How to debug asmbb?tag:board.asm32.info,2018-03-06:Post160232020-03-12T11:48:42Z
<blockquote><header>ganuonglachanh</header><p>Hi johnfound
</p>
<p>My dev setup is Fresh IDE in Linux with WINE, edb debugger installed, asmbb run via docker (should I change to rwasa for debugging?).
</p>
<p>I tried debug the <strong>engine</strong> file but it's not possible
</p>
<p>Can you make a tutorial to debug asmbb sourcecode? (step by step for begginer)
</p>
<p>Thank you!
</p></blockquote>
<p>Now, at first, debugging AsmBB in docker is pretty problematic IMHO. It is better to install local server and run directly.
</p>
<p>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.
</p>
<p>The option is <code>options.DebugMode</code> that is set at the line 24 of <code>engine.asm</code> file. Unfortunately the debug macros are not well documented, but look for <code>OutputValue</code>, <code>DebugMsg</code>, OutputRegister` in the source.
</p>
<p>Anyway, I will try to write a little bit wider manual about debugging AsmBB when I have more spare time.</p>
johnfoundganuonglachanh on How to debug asmbb?tag:board.asm32.info,2018-03-06:Post160222020-03-12T10:09:46Z
<p>Hi johnfound
</p>
<p>My dev setup is Fresh IDE in Linux with WINE, edb debugger installed, asmbb run via docker (should I change to rwasa for debugging?).
</p>
<p>I tried debug the <strong>engine</strong> file but it's not possible
</p>
<p>Can you make a tutorial to debug asmbb sourcecode? (step by step for begginer)
</p>
<p>Thank you!</p>
ganuonglachanh