Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: courage on June 11, 2007, 12:02:32 pm

Title: Debugging asm files
Post by: courage on June 11, 2007, 12:02:32 pm
Hello all:

I need some suggestions for debugging inline assembler.
I use GCC and GDB.
GDB seems not to debug machine-level code writing in C language,
so I need to use gcc with parameter "-S" to output *.s files,
then use "as -a -gstabs -o an_output_object.o a_source_file.s" to compile and create object files
and put these object files instead of the old files that gcc compiled in Code::Blocks,
finally I use gcc to link.

After I do these steps above manually,
I just can use GDB to debug the asm codes step by step.
Are there some beautiful and automatic methods to handle with Code::Blocks?
I tried to add some commends in Tools menu item,
but the macros is not enough to solve this problem well.

Besides, I wonder if Code::Blocks will support to compile asm files in the future?
I have glanced at two old threads:
http://forums.codeblocks.org/index.php/topic,971.0.html
http://forums.codeblocks.org/index.php/topic,4783.0.html
And edit the File Types & Categories to add *.s file type as sources.
But when I compile the file or buld it, Code::Blocks shows "Nothing to be done.". :shock:


Title: Re: Debugging asm files
Post by: mandrav on June 11, 2007, 01:10:21 pm
Quote
I need some suggestions for debugging inline assembler.

Run your program through the debugger and when the execution reaches the function containing the inline assembly, click "Debug->Debugging windows->Disasssembly". This will dump the disassembly listing in a new window. Now you can step through asm instructions by using "Debug->Next instruction" (Alt-F7) instead of "Debug->Next line" (F7).

Quote
Besides, I wonder if Code::Blocks will support to compile asm files in the future?

It's your lucky day ;).
This is the subject of a current ongoing devs-only discussion on how to handle this.
Just be patient for a few days.
Title: Re: Debugging asm files
Post by: mariocup on June 11, 2007, 01:28:32 pm
Hi Mandrav,

can I find information about that in a codeblocks forum or does exist an internal discussion for devs-only?

Bye,

Mario
Title: Re: Debugging asm files
Post by: courage on June 12, 2007, 02:32:15 am
Run your program through the debugger and when the execution reaches the function containing the inline assembly, click "Debug->Debugging windows->Disasssembly". This will dump the disassembly listing in a new window. Now you can step through asm instructions by using "Debug->Next instruction" (Alt-F7) instead of "Debug->Next line" (F7).

Hi mandrav:

Thanks for answering my stupid question! Really thanks!  :D
Title: Re: Debugging asm files
Post by: mandrav on June 12, 2007, 03:55:44 pm
can I find information about that in a codeblocks forum or does exist an internal discussion for devs-only?

Unfortunately nothing to share yet. Still discussing it.