Author Topic: compiler/debug problem with adding flag option (no debugging symbols found)  (Read 6053 times)

Offline Tommi

  • Single posting newcomer
  • *
  • Posts: 5
Hello guys,

i've got a problem while trying to debug the program i wrote.

I can't use "watches", after long search i figured out that this is a cause of missing debug symbols.
So i searched how to fix this. Unfortunately i have no idea where and how to add this -g,
cause i use code blocks for the first time and the flag "produce debug symbols(-g)" is not listed in "Settings -> compiler -> compiler flags"

So i tried to add this flag by hand, not working, i add it in "other compiler options" and just receive the message:

Code
||=== Build: Debug in Complexe_rechnung (compiler: Borland C++ Compiler (5.5, 5.82)) ===|
||Error E2074: Value after -g or -j should be between 0 and 255 inclusive|
||Error E2075: Incorrect command line option: -g|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

I'm using Win7 64bit
Code::Blocks 16.01

Thanks for your help!

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Post a full re-build log.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Edit: I do NOT think Code::Blocks supports debugging with Borland Compiler.
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 Tommi

  • Single posting newcomer
  • *
  • Posts: 5
I guess u mean this log? Copyed out from "build log" after re-build, as explained in the FAQ

Code
-------------- Clean: Debug in Complexe_rechnung (compiler: Borland C++ Compiler (5.5, 5.82))---------------

Cleaned "Complexe_rechnung - Debug"

-------------- Build: Debug in Complexe_rechnung (compiler: Borland C++ Compiler (5.5, 5.82))---------------

bcc32.exe -q -w  -v    -ID:\Programme\Borland\BCC55\Include -oobj\Debug\input.obj -c input.c
input.c:
bcc32.exe -q -w  -v    -ID:\Programme\Borland\BCC55\Include -oobj\Debug\my_complex.obj -c my_complex.c
my_complex.c:
bcc32.exe -q -w  -v    -ID:\Programme\Borland\BCC55\Include -oobj\Debug\output.obj -c output.c
output.c:
bcc32.exe -q -w  -v    -ID:\Programme\Borland\BCC55\Include -oobj\Debug\testfile.obj -c testfile.c
testfile.c:
ilink32.exe -q -ap  -v  -LD:\Programme\Borland\BCC55\Lib -LD:\Programme\Borland\BCC55\Lib\PSDK c0x32 obj\Debug\input.obj obj\Debug\my_complex.obj obj\Debug\output.obj obj\Debug\testfile.obj,bin\Debug\Complexe_rechnung.exe,,cw32mt.lib import32.lib,,
Output file is bin\Debug\Complexe_rechnung.exe with size 71.00 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

Well, that would explain a lot, if Borland is non debug compatible.

EDIT:

This happen, if i add a -g in "Settings -> compiler -> other compiler options"

Code

-------------- Clean: Debug in Complexe_rechnung (compiler: Borland C++ Compiler (5.5, 5.82))---------------

Cleaned "Complexe_rechnung - Debug"

-------------- Build: Debug in Complexe_rechnung (compiler: Borland C++ Compiler (5.5, 5.82))---------------

bcc32.exe -q -w  -v  -g   -ID:\Programme\Borland\BCC55\Include -oobj\Debug\input.obj -c input.c
Error E2074: Value after -g or -j should be between 0 and 255 inclusive
Error E2075: Incorrect command line option: -g
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))

« Last Edit: March 12, 2017, 05:07:28 pm by Tommi »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
why do you use bcc and not gcc?

Offline Tommi

  • Single posting newcomer
  • *
  • Posts: 5
why do you use bcc and not gcc?

Thanks for the answer! Our Prof. want us to use Borland BCC ....

EDIT:

After a short look it seems that there is no command to creat such a "Symbol Table"? Am i right?
« Last Edit: March 12, 2017, 10:05:11 pm by Tommi »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255

Offline Tommi

  • Single posting newcomer
  • *
  • Posts: 5
Did you try -v (instead of -g) ?
http://docwiki.embarcadero.com/RADStudio/Berlin/en/C%2B%2B_Compiler_Debugging

Well, this option is listed as "debug on, inline expansion off", unfortunately i can't switch from "Release" to "Debug" without getting this error message:

Code
Error: Unresolved external '_strtod' referenced from D:\PROJEKTE\CODE_BLOCKS\COMPLEXE_RECHNUNG\OBJ\DEBUG\INPUT.OBJ

in fact string.h is included. In "Release" mode this error doesn't appear.

EDIT: Figured the undo of the checkbox out on my own.

EDIT 2:

With the -v the log show

Code
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.6.1
Starting the debuggee failed: No executable specified, use `target exec'.
Debugger finished with status 0
« Last Edit: March 13, 2017, 12:08:15 am by Tommi »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
I don't know, but is it possible to use gdb for debugging bcc applications?

You messed something up in the project settings... Easiest way would be to create a new project and copy the souces.

Is your application created? What is under Project->Properties->Build target->Debug->Output File name?

Offline Tommi

  • Single posting newcomer
  • *
  • Posts: 5
It could be possible, that something went wrong. I should creat a new project.
Anyway, i tested the -v option on another pc, with right settings. This option doesn't creat a symbol table, so debug is still not working with -v.

The output file name is "Complexe_rechnung.exe" like the project is called.
Seems the debug is not working with Borland. For simple projects i can still use "printf"  ;D

Thanks for helping anyway, guys :)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
It could be possible, that something went wrong. I should creat a new project.
Anyway, i tested the -v option on another pc, with right settings. This option doesn't creat a symbol table, so debug is still not working with -v.

The output file name is "Complexe_rechnung.exe" like the project is called.
Seems the debug is not working with Borland. For simple projects i can still use "printf"  ;D

Thanks for helping anyway, guys :)
For easy debugging of programs created with the borland compiler, you need the borland debugger and this is not supported by C::B