debug under windows

CodeLite installation/troubleshooting forum
steph@cl
CodeLite Curious
Posts: 4
Joined: Fri Jul 23, 2010 4:34 pm
Genuine User: Yes
IDE Question: any
Contact:

debug under windows

Post by steph@cl »

Hello

Debugging under windows seems to work but sources are managed at all:
- current line is not shown
- source file is not changed when necessary

Same project under linux ubuntu works perfectly.

Is there anything I missed ? Is ther anything to do to make it work correctly ?

thanks
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: debug under windows

Post by eranif »

Please provide the information as described in this topic:

http://codelite.org/forum/viewtopic.php?f=3&t=804

Eran
Make sure you have read the HOW TO POST thread
steph@cl
CodeLite Curious
Posts: 4
Joined: Fri Jul 23, 2010 4:34 pm
Genuine User: Yes
IDE Question: any
Contact:

Re: debug under windows

Post by steph@cl »

codelite version = v2.6.0.4189
codellite = download binaries
OS = windows vista


1) debugger
no log needed
gdb 6.8.0.20080328

errorneous behaviour describe in previous post
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: debug under windows

Post by eranif »

steph@cl wrote:1) debugger
no log needed
It is needed...
Obvisouly, if it was a common error I could guess what the problem is, since you are the first person complaining about it - there is something wrong with your setup (I never encountered this problem before)


FYI: codelite is just an interface to gdb, I *need* the log to see whether is it a bug in codelite (fails to parse gdb's output) or maybe gdb instruct it incorrectly..

If you still I don't need the gdb log, then I am afraid I can't help you here

The log can be obtained by simply enabling the option 'Enable Debugger Full Log' on top of the 'Debug' output window
Eran
Make sure you have read the HOW TO POST thread
steph@cl
CodeLite Curious
Posts: 4
Joined: Fri Jul 23, 2010 4:34 pm
Genuine User: Yes
IDE Question: any
Contact:

Re: debug under windows

Post by steph@cl »

Hello,

Here is debug log:


Using gdbinit file: C:\Users\Steph\AppData\Local\Temp\codelite_gdbinit.txt
Current working dir: c:\temp\tst\tst
Launching gdb from : ./Debug
Starting debugger : gdb --command="C:\Users\Steph\AppData\Local\Temp\codelite_gdbinit.txt" --interpreter=mi "./tst"
DEBUG>>set new-console on
DEBUG>>set unwindonsignal on
DEBUG>>set width 0
DEBUG>>set height 0
DEBUG>>set print pretty on
DEBUG>>set print elements 200
DEBUG>>00000025-break-insert "\"c:/temp/tst/tst/main.c:5\""
DEBUG>>00000026-break-insert "\"c:/temp/tst/tst/main.c:8\""
DEBUG>>00000027-break-insert "\"c:/temp/tst/tst/main.c:13\""
Debug session started successfully!
DEBUG>>00000028-exec-run
DEBUG>>cygwin warning:
cygwin warning:
DEBUG>>MS-DOS style path detected: C:\Users\Steph\AppData\Local\Temp\codelite_gdbinit.txt
MS-DOS style path detected: C:\Users\Steph\AppData\Local\Temp\codelite_gdbinit.txt
DEBUG>>Preferred POSIX equivalent is: /cygdrive/c/Users/Steph/AppData/Local/Temp/codelite_gdbinit.txt
Preferred POSIX equivalent is: /cygdrive/c/Users/Steph/AppData/Local/Temp/codelite_gdbinit.txt
DEBUG>>CYGWIN environment variable option "nodosfilewarning" turns off this warning.
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
DEBUG>>Consult the user's guide for more details about POSIX paths:
Consult the user's guide for more details about POSIX paths:
DEBUG>>http://cygwin.com/cygwin-ug-net/using.h ... -pathnames
http://cygwin.com/cygwin-ug-net/using.h ... -pathnames
DEBUG>>~"GNU gdb 6.8.0.20080328-cvs (cygwin-special)\n"
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
DEBUG>>~"Copyright (C) 2008 Free Software Foundation, Inc.\n"
Copyright (C) 2008 Free Software Foundation, Inc.
DEBUG>>~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n"
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
DEBUG>>~"This is free software: you are free to change and redistribute it.\n"
This is free software: you are free to change and redistribute it.
DEBUG>>~"There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\n"
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
DEBUG>>~"and \"show warranty\" for details.\n"
and "show warranty" for details.
DEBUG>>~"This GDB was configured as \"i686-pc-cygwin\"...\n"
This GDB was configured as "i686-pc-cygwin"...
DEBUG>>&"set new-console on\n"
DEBUG>>^done
DEBUG>>&"set unwindonsignal on\n"
DEBUG>>^done
DEBUG>>&"set width 0\n"
DEBUG>>^done
DEBUG>>&"set height 0\n"
DEBUG>>^done
DEBUG>>&"set print pretty on\n"
DEBUG>>^done
DEBUG>>&"set print elements 200\n"
DEBUG>>^done
Debuggee process ID: 5376
DEBUG>>00000025^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00401146",func="main",file="c:/temp/tst/tst/main.c",fullname="/cygdrive/c/temp/tst/tst/main.c",line="5",times="0"}
Found the breakpoint ID!
Storing debugger breakpoint Id=1
Successfully set breakpoint 1 at: c:\temp\tst\tst\main.c:5
DEBUG>>00000026^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0040116a",func="main",file="c:/temp/tst/tst/main.c",fullname="/cygdrive/c/temp/tst/tst/main.c",line="8",times="0"}
Found the breakpoint ID!
Storing debugger breakpoint Id=2
Successfully set breakpoint 2 at: c:\temp\tst\tst\main.c:8
DEBUG>>00000027^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x004011a6",func="main",file="c:/temp/tst/tst/main.c",fullname="/cygdrive/c/temp/tst/tst/main.c",line="13",times="0"}
Found the breakpoint ID!
Storing debugger breakpoint Id=3
Successfully set breakpoint 3 at: c:\temp\tst\tst\main.c:13
DEBUG>>00000028^running
Continuing...
DEBUG>>~"[New thread 5376.0x514]\n"
[New thread 5376.0x514]
DEBUG>>~"[New thread 5376.0x14bc]\n"
[New thread 5376.0x14bc]
DEBUG>>~"[New thread 5376.0x1234]\n"
[New thread 5376.0x1234]
DEBUG>>00000028*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1",frame={addr="0x00401146",func="main",args=[],file="c:/temp/tst/tst/main.c",fullname="/cygdrive/c/temp/tst/tst/main.c",line="5"}
DEBUG>>00000029-file-list-exec-source-file
DEBUG>>00000030-break-list
DEBUG>>00000029^done,line="5",file="c:/temp/tst/tst/main.c",fullname="/cygdrive/c/temp/tst/tst/main.c",macro-info="0"
DEBUG>>00000031-stack-list-locals 2
DEBUG>>00000032-stack-list-arguments 2 0 0
DEBUG>>00000030^done,BreakpointTable={nr_rows="3",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00401146",func="main",file="c:/temp/tst/tst/main.c",fullname="/cygdrive/c/temp/tst/tst/main.c",line="5",times="1"},bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0040116a",func="main",file="c:/temp/tst/tst/main.c",fullname="/cygdrive/c/temp/tst/tst/main.c",line="8",times="0"},bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x004011a6",func="main",file="c:/temp/tst/tst/main.c",fullname="/cygdrive/c/temp/tst/tst/main.c",line="13",times="0"}]}
DEBUG>>00000031^done,locals=[]
DEBUG>>00000032^done,stack-args=[frame={level="0",args=[]}]



Hope it will help.
Regards
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: debug under windows

Post by eranif »

OK, now I can see the problem:

You are using cygwin's gdb which uses cygwin paths, for example:
DEBUG>>00000029-file-list-exec-source-file
DEBUG>>00000030-break-list
DEBUG>>00000029^done,line="5",file="c:/temp/tst/tst/main.c",fullname="/cygdrive/c/temp/tst/tst/main.c",macro-info="0"
codelite uses the attribute 'fullname' to locate the current path, while under MinGW it will contain the native path, it looks like that when using the cygwin's gdb it will contain the cygwin path (/cygdrive/c/...)


Can you use a native gdb and not one that was configured to work under cygwin, or is it a limitation that you cant workaround?

If you can't workaround that (i.e. you must use cygwin gdb) than I think that a solution should be developed for codelite - the first idea that comes to my head is to add a new option in the debugger settings to allow mapping between cygwin root and the system native root (C:\ --> /cygdrive/c) by using this, codelite could convert the paths when needed

EDIT:
another option that comes to mind: assuming that the output is consistent, we could add a flag to codelite that instruct him to extract the source location from the attribute 'file' and not from 'fullname'
Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: debug under windows

Post by eranif »

Attached is a patched codelite's debugger DLL.

- close codelite
- replace your current debugger dll with the one attached
- start codelite

Let me know if it fixes the problem

Eran
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
steph@cl
CodeLite Curious
Posts: 4
Joined: Fri Jul 23, 2010 4:34 pm
Genuine User: Yes
IDE Question: any
Contact:

Re: debug under windows

Post by steph@cl »

Hello,

:) changing cygwin toolchain (compiler/debugger) for mingw toolchain solve the problem


:) changing debugger.dll file solve the problem too


So now, I cleaned the mess with my toolchains ;) and one can use cygwin with codelite under windows :D

Thanks
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: debug under windows

Post by eranif »

steph@cl wrote::) changing debugger.dll file solve the problem too
Thanks for verifying that the debugger indeed fixes the problem with cygwin toolchain.

I will include it in the next release

Eran
Make sure you have read the HOW TO POST thread
brownhamer

Re: debug under windows

Post by brownhamer »

Unfortunately it does not solve the problem for me. The 'file' attribute from cygwin gdb contains the cygwin style filename as well.
Is there some option to use for cygwin gcc to fix this? Or could it be fixed in CodeLite?

If fixing this in CodeLite, I suggest to use 'cygpath -w %file%' instead of setting up links in CodeLite itself, as that would also work for symlinks and such.
Post Reply