User forums > Using Code::Blocks

Debugging asm files

(1/1)

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.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:


mandrav:

--- Quote ---I need some suggestions for debugging inline assembler.
--- End quote ---

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?
--- End quote ---

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.

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

--- End quote ---

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?

--- End quote ---

Unfortunately nothing to share yet. Still discussing it.

Navigation

[0] Message Index

Go to full version