News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Debugging asm files

Started by courage, June 11, 2007, 12:02:32 PM

Previous topic - Next topic

courage

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.next.codeblocks.org/index.php/topic,971.0.html
http://forums.next.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:



mandrav

QuoteI 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).

QuoteBesides, 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.
Be patient!
This bug will be fixed soon...

mariocup

Hi Mandrav,

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

Bye,

Mario

courage

Quote from: mandrav on June 11, 2007, 01:10:21 PM
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

mandrav

Quote from: mariocup on June 11, 2007, 01:28:32 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.
Be patient!
This bug will be fixed soon...