Author Topic: newbie question  (Read 7032 times)

Offline Gabriel

  • Single posting newcomer
  • *
  • Posts: 4
newbie question
« on: January 24, 2010, 05:24:07 pm »
Hello:

I'm newbie to code::blocks, and I'm just trying to debug an old C++ program (console application) that I've made with borland 5.5 and debugged with TD55 (but without IDE). So I specified the correct executables (bcc32 and td32) of version 5.5 for compiler/debugger settings.
Building succeed, but when choosing Debug --> Start, I get: Invalid switch: -nx
Although I didn't specified such a switch.

could you help?

thanks
Gabriel

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: newbie question
« Reply #1 on: January 24, 2010, 05:48:55 pm »
C::B only supports gdb and (partly) cdb as debugger, sorry.

Offline Gabriel

  • Single posting newcomer
  • *
  • Posts: 4
Re: newbie question
« Reply #2 on: January 24, 2010, 09:26:31 pm »
Ok, but does gdb works with BC55?

thanks

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: newbie question
« Reply #3 on: January 24, 2010, 09:44:44 pm »
Ok, but does gdb works with BC55?
Most likely not, it's a completely different compiler. Borland used to have an own debugger IMHO. At least back in the Turbo C++ days.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Gabriel

  • Single posting newcomer
  • *
  • Posts: 4
Re: newbie question
« Reply #4 on: February 03, 2010, 04:09:55 pm »
I've downloaded the last version 7.0 of gdb, (from http://ftp.gnu.org/gnu/gdb/), unzipped it, but I didn't found any executable file (*.exe).

there is 7138 files, 209 folders, occupying 118MB, but no exe files. Am I missing something??

Thank you


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: newbie question
« Reply #5 on: February 03, 2010, 06:01:31 pm »
there is 7138 files, 209 folders, occupying 118MB, but no exe files. Am I missing something??
Instead of downloading the sources try to download the binary at http://sourceforge.net/projects/mingw/:
http://sourceforge.net/projects/mingw/files/GNU%20Source-Level%20Debugger/GDB-7.0.1/gdb-7.0.1-mingw32-bin.tar.gz/download
(Except you want to compile the debugger ourself, of course...)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Gabriel

  • Single posting newcomer
  • *
  • Posts: 4
Re: newbie question
« Reply #6 on: February 08, 2010, 09:40:42 pm »
Thanks for reply!
I've downloaded gdb.exe, now it's OK

But I still have some questions:
1- when choosing the compiler by: settings --> compiler and debugger, then selecting a new compiler, this choice is not accepted until pressing "Set as default".
2- choosing Borland C++ compiler (5.5,5.82), and specifying gdb for debugger in "Toolchain executables", clicking Debug --> Start, gives:

Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: E:\my_data\prog\code blocks\test2\test2\
Adding source dir: E:\my_data\prog\code blocks\test2\test2\
Adding file: bin\Debug\test2.exe
Starting debugger:
done
Setting breakpoints
Hello world!
Microsoft (R) Windows Debugger Version 6.11.0001.404 X86
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: bin/Debug/test2.exe
Symbol search path is: E:/my_data/prog/CODEBL~1/test2/test2/
Executable search path is:
ModLoad: 00400000 00409000   test2.exe
ModLoad: 7c900000 7c9af000   ntdll.dll
ModLoad: 7c800000 7c8f6000   D:\WINDOWS\system32\kernel32.dll
ModLoad: 10200000 10323000   D:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\MSVCR90D.dll
ModLoad: 10480000 10557000   D:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\MSVCP90D.dll
(f68.17ac): Break instruction exception - code 80000003 (first chance)
eax=00251eb4 ebx=7ffd8000 ecx=00000005 edx=00000020 esi=00251f48 edi=00251eb4
eip=7c90120e esp=0012fb20 ebp=0012fc94 iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
ntdll!DbgBreakPoint:
7c90120e cc              int     3
*** WARNING: Unable to verify checksum for test2.exe
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for D:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\MSVCR90D.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for D:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\MSVCP90D.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for D:\WINDOWS\system32\kernel32.dll -
Debugger finished with status 0


The program is simply:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}





3- choosing Microsoft Visual C++ 2005/2008, and cdb as debugger, build is OK, but debud --> Start gives:
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: E:\my_data\prog\code blocks\test2\test2\
Adding source dir: E:\my_data\prog\code blocks\test2\test2\
Adding file: bin\Debug\test2.exe
Starting debugger:
done
Setting breakpoints
Hello world!
Microsoft (R) Windows Debugger Version 6.11.0001.404 X86
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: bin/Debug/test2.exe
Symbol search path is: E:/my_data/prog/CODEBL~1/test2/test2/
Executable search path is:
ModLoad: 00400000 00409000   test2.exe
ModLoad: 7c900000 7c9af000   ntdll.dll
ModLoad: 7c800000 7c8f6000   D:\WINDOWS\system32\kernel32.dll
ModLoad: 10200000 10323000   D:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\MSVCR90D.dll
ModLoad: 10480000 10557000   D:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\MSVCP90D.dll
(f48.ea8): Break instruction exception - code 80000003 (first chance)
eax=00251eb4 ebx=7ffde000 ecx=00000005 edx=00000020 esi=00251f48 edi=00251eb4
eip=7c90120e esp=0012fb20 ebp=0012fc94 iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
ntdll!DbgBreakPoint:
7c90120e cc              int     3
*** WARNING: Unable to verify checksum for test2.exe
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for D:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\MSVCR90D.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for D:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\MSVCP90D.dll -
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for D:\WINDOWS\system32\kernel32.dll -
Debugger finished with status 0


Could you help?

thank you