Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Robert_S on April 21, 2010, 02:56:11 pm

Title: How to create COFF format debug symbols using Code::Blocks and GCC?
Post by: Robert_S on April 21, 2010, 02:56:11 pm
I'm using a Windows machine and I want to build a debug release of my program.
I'm using GCC as my compile and I originally had the -g switch enable in the Global compiler settings.

This produces debug symbols in the stab format which is unfortunately of no use to me.  I want to be able to create a COFF format symbol table in the exe file.

How do I do this?  I have tried uncheckin the -g switch and selecting the other options tab were I entered
"-gcoff", I also tried using just "gcoff".  The debug release no longer contains the .stab and .stabstr section but I cannot find any COFF debug symbols.  How do I go about achieving this?

I would also be like to create .pdb files too if this is possible?

Thank you,
               Robert.

 
Title: Re: How to create COFF format debug symbols using Code::Blocks and GCC?
Post by: stahta01 on April 21, 2010, 05:30:14 pm
Code::Blocks is an IDE that supports more than one Compiler!!

Please ask the support group for what ever compiler you use your Compiler Questions!

This is NOT a support site for any Compilers!

Tim S.
Title: Re: How to create COFF format debug symbols using Code::Blocks and GCC?
Post by: Robert_S on April 21, 2010, 10:06:27 pm
Okay will do, my sincere apologies.
Title: Re: How to create COFF format debug symbols using Code::Blocks and GCC?
Post by: dirk_1980 on May 11, 2010, 10:26:50 pm
@ stahta01
Yes C::B is an IDE but C::B has all the setup stuff to make a Hex-File but not for COFF-Files.

If i use a User Makefile you are right: nothing todo with C::B!
But if i use the C::B settings C::B has to work and this forum is the right place to ask.



I have the same problem with WIN-AVR. i cant make a COFF-File.

Dirk


Title: Re: How to create COFF format debug symbols using Code::Blocks and GCC?
Post by: stahta01 on May 11, 2010, 10:41:42 pm

Turn on full Compiler logging;
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F


The compiler/Linker creates the COFF not C::B.

Tim S.
Title: Re: How to create COFF format debug symbols using Code::Blocks and GCC?
Post by: oBFusCATed on May 11, 2010, 10:49:00 pm
...."-gcoff", I also tried using just "gcoff".  The debug release no longer contains the .stab and .stabstr section but I cannot find any COFF debug symbols.  How do I go about achieving this?....

Switch to compiler that produces .pdb/coff debugging info (Visual C++ for example). Gcc doesn't support this king of debugging symbols.
Title: Re: How to create COFF format debug symbols using Code::Blocks and GCC?
Post by: danselmi on May 11, 2010, 11:16:23 pm
For WinAVR: avr-objcopy and avr-objdump knows the target options "coff-avr" and "coff-ext-avr".
Try following as a post build step:
Code
avr-objcopy -O coff-avr -R .eeprom -R .eesafe $(TARGET_OUTPUT_FILE) $(TARGET_OUTPUT_FILE).coff
(I have not tested the generated coff file!)
Title: Re: How to create COFF format debug symbols using Code::Blocks and GCC?
Post by: dirk_1980 on May 11, 2010, 11:20:25 pm
Why can't you just say das the ELF-File is the debug File and not the AVR-Studio Burner ELF File?

Same name for 2 types of files.

EDIT:
@ danselmi
Were must i write your code in C::B to test it?
Title: Re: How to create COFF format debug symbols using Code::Blocks and GCC?
Post by: danselmi on May 12, 2010, 11:20:46 am
Project->Build options...   Pre/post build steps