Generate debug symbols on compilation

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
mback2k
Enthusiast
Enthusiast
Posts: 257
Joined: Sun Dec 02, 2007 12:11 pm
Location: Germany

Generate debug symbols on compilation

Post by mback2k »

It would be great if the compiler could generate debug symbol information files. That way we could use debuggers like WinDbg to debug an application after compilation. For example a system service could be debugged that way.
User avatar
mback2k
Enthusiast
Enthusiast
Posts: 257
Joined: Sun Dec 02, 2007 12:11 pm
Location: Germany

Re: Generate debug symbols on compilation

Post by mback2k »

Flat Assembler is able to generate .fas files which contain debug symbols using the -s parameter. It would be great if the PureBasic Compiler and IDE allowed us to set that parameter.

In addition it would be nice to have the original procedure names instead of _ProcedureX, etc.

That would make it possible to get all the information required for external debugging from the .fas file.

And the biggest thing would be to have the .fas files of the PB libraries to include PB procedures in the debugging.
User avatar
mback2k
Enthusiast
Enthusiast
Posts: 257
Joined: Sun Dec 02, 2007 12:11 pm
Location: Germany

Re: Generate debug symbols on compilation

Post by mback2k »

I would like to point out that even though we found a way to export functions from an executable using the approach described in this topic, having the requested functionality built into PureBasic would make it a lot easier to debug programs with external debugging tools.

The method described only allows the debugger to see the user-defined procedures, without any variable context or information regarding PureBasic procedures.

If this is something the PureBasic team does not want to built into the PB compiler and/or IDE, it would be great to have an API which would allow custom tools to access the parsed PureBasic and/or ASM code before compilation. As you can see from the referenced Python script, it's very hard to parse PureBasic code, especially since compiler-directives, etc. need to be evaluated. The python script does not work once a compiler-directive causes a function to be never called.

Thanks in advance!
User avatar
mback2k
Enthusiast
Enthusiast
Posts: 257
Joined: Sun Dec 02, 2007 12:11 pm
Location: Germany

Re: Generate debug symbols on compilation

Post by mback2k »

mback2k wrote:Flat Assembler is able to generate .fas files which contain debug symbols using the -s parameter. It would be great if the PureBasic Compiler and IDE allowed us to set that parameter.
FYI-- I created this thin wrapper around FAsm.exe in order to create and copy the .fas file to %TEMP%.
Post Reply