Author Topic: Debugging asm files  (Read 5844 times)

Offline courage

  • Multiple posting newcomer
  • *
  • Posts: 48
Debugging asm files
« 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:



Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Debugging asm files
« Reply #1 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.
Be patient!
This bug will be fixed soon...

mariocup

  • Guest
Re: Debugging asm files
« Reply #2 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

Offline courage

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: Debugging asm files
« Reply #3 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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Debugging asm files
« Reply #4 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.
Be patient!
This bug will be fixed soon...