User forums > Help

debugging trouble

(1/2) > >>

hd:
Hi,

I can't debug in CodeBlocks. But after compiling the program I can
debug it from command line.

Session listings are as following:
(Could it be directory separators? '\\' versus '/')

--
Regards,
Hakki Dogusan


//
// gdb running at CodeBlocks
//

Compiling: done
Selecting target: debug
Starting debugger: done
No source file named ..\\..\\TIS_App.cpp.
error
error
Program received signal (SIGSEGV)
Segmentation fault
0x006588e6wxBaseArrayPtrVoid::Index(void const*, bool) const at ../../src/common/dynarray.cpp:421
Debugger finished with status 0


//
// gdb running at command prompt
//

C:\a_C\tis\build\cb>gdb tisd.exe
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) break TIS_App::OnInit()
Breakpoint 1 at 0x5060a0: file ../../TIS_App.cpp, line 90.
(gdb) run
Starting program: C:\a_C\tis\build\cb/tisd.exe

Breakpoint 1, TIS_App::OnInit() (this=0x2d161b8) at ../../TIS_App.cpp:91
91              SetVendorName(_T("DynaSet"));
Current language:  auto; currently c++
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x006588e6 in wxBaseArrayPtrVoid::Index(void const*, bool) const (
    this=0x2d28620, lItem=0x2e01f28, bFromEnd=false)
    at ../../src/common/dynarray.cpp:421
421     _WX_DEFINE_BASEARRAY(const void *, wxBaseArrayPtrVoid)
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x006588e6 in wxBaseArrayPtrVoid::Index(void const*, bool) const (
    this=0x2d28620, lItem=0x2e01f28, bFromEnd=false)
    at ../../src/common/dynarray.cpp:421
421     _WX_DEFINE_BASEARRAY(const void *, wxBaseArrayPtrVoid)
(gdb) cont
Continuing.

Program exited with code 030000000005.
(gdb) q

hd:
I changed void DebuggerGDB::SetBreakpoints() a little bit, now gdb can break..

...from
            if (bp->enabled)
               cmd << "break " << UnixFilename(pf->relativeFilename) << ":" << bp->line + 1;
...to
            if (bp->enabled)
            {
               // NOTE (hd#1#): cmd << "break " << UnixFilename(pf->relativeFilename) << ":" << bp->line + 1;
                    wxString out = UnixFilename(pf->relativeFilename);
                    ConvertToMakefileFriendly(out);
               cmd << "break " << out << ":" << bp->line + 1;
                }

mandrav:
Thanks, I 'll test it under different conditions and update the sources accordingly :)

Yiannis.

Anonymous:
Thanks Yiannis,

New problems... Sorry...

When gdb stops at break point, than "Next (F7)" or "StepIn (Shift-F7)" does not functioning;
they behave like "Continue".

I didn't look them in source yet...

--
Regards,
Hakki Dogusan

Anonymous:
And a similar question (to not spoil the master list :-) - can one debug the files, compiled by MSVC? Or only by MinGW?

Mike

Navigation

[0] Message Index

[#] Next page

Go to full version