Page 1 of 1

Source Level Disassembler for PureBasic?

Posted: Wed Oct 21, 2015 9:54 pm
by ElementE
Is there a source level disassembler that works with PureBasic?

I would like to examine the actual x86 or x64 generated code that corresponds to the original PB source.

Re: Source Level Disassembler for PureBasic?

Posted: Wed Oct 21, 2015 10:06 pm
by Thorium
ElementE wrote:Is there a source level disassembler that works with PureBasic?

I would like to examine the actual x86 or x64 generated code that corresponds to the original PB source.
Actualy PB generates asm code. You can keep the commented (comments are the PB source lines) asm file by launching the PB compiler with the parameter /COMMENTED.

Re: Source Level Disassembler for PureBasic?

Posted: Wed Oct 21, 2015 10:48 pm
by ElementE
Actualy PB generates asm code. You can keep the commented (comments are the PB source lines) asm file by launching the PB compiler with the parameter /COMMENTED.
Thanks Thorium.

PureBasic seems to have already built into it everything that a programmer needs.

jas

Posted: Thu Nov 26, 2015 6:04 pm
by jas
For assembly programming a better debugger or a way to send debug info to another debugger would be nice.

Re: jas

Posted: Fri Nov 27, 2015 1:03 pm
by Thorium
jas wrote:For assembly programming a better debugger or a way to send debug info to another debugger would be nice.
I use OllyDbg or x64dbg to debug assembly code.
Just put a "!int 3" befor your code, to trigger a breakpoint in the debugger. Then i single step through the code.

Re: Source Level Disassembler for PureBasic?

Posted: Fri Nov 27, 2015 5:22 pm
by ker2x
You can use Bochs (x86 emulator), i love it !

When you're using Bochs with the internal debugger, you can trigger the debugger via a facility called magic breakpoints. To trigger a breakpoint, you can insert xchg bx, bx (in GAS syntax, xchgw %bx, %bx) anywhere in the code and Bochs will trap into the debugger as soon as it executes it. On real hardware this has no effect as it merely replaces the BX register with itself.
You should put the following line in your Bochs configuration file to have it listen to magic breakpoints: magic_break: enabled=1
You'll also debug the OS :)

jas

Posted: Sun Dec 13, 2015 2:32 am
by jas
Thorium wrote:
jas wrote:For assembly programming a better debugger or a way to send debug info to another debugger would be nice.
I use OllyDbg or x64dbg to debug assembly code.
Just put a "!int 3" befor your code, to trigger a breakpoint in the debugger. Then i single step through the code.

Exactly my point. Having to halt a program then use another debugger is required to see the actual disassembly and the full register set. It reminds me of how I had to program personal computers back in the 1980s before source-level assembly debuggers.