News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How to create COFF format debug symbols using Code::Blocks and GCC?

Started by Robert_S, April 21, 2010, 02:56:11 PM

Previous topic - Next topic

Robert_S

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.


stahta01

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Robert_S


dirk_1980

@ 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



stahta01


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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

Quote from: Robert_S on April 21, 2010, 02:56:11 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.
(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!]

danselmi

For WinAVR: avr-objcopy and avr-objdump knows the target options "coff-avr" and "coff-ext-avr".
Try following as a post build step:

avr-objcopy -O coff-avr -R .eeprom -R .eesafe $(TARGET_OUTPUT_FILE) $(TARGET_OUTPUT_FILE).coff

(I have not tested the generated coff file!)
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

dirk_1980

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?

danselmi

spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]