Author Topic: How to create COFF format debug symbols using Code::Blocks and GCC?  (Read 8562 times)

Offline Robert_S

  • Multiple posting newcomer
  • *
  • Posts: 11
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.

 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: How to create COFF format debug symbols using Code::Blocks and GCC?
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Robert_S

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to create COFF format debug symbols using Code::Blocks and GCC?
« Reply #2 on: April 21, 2010, 10:06:27 pm »
Okay will do, my sincere apologies.

Offline dirk_1980

  • Multiple posting newcomer
  • *
  • Posts: 25
@ 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



Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post

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.
« Last Edit: May 11, 2010, 11:20:42 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
...."-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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
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!)

Offline dirk_1980

  • Multiple posting newcomer
  • *
  • Posts: 25
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?
« Last Edit: May 11, 2010, 11:23:02 pm by dirk_1980 »

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Project->Build options...   Pre/post build steps