debug into the wxWidget source problem.

54 views
Skip to first unread message

asm23

unread,
Dec 13, 2008, 8:45:48 AM12/13/08
to wx-u...@lists.wxwidgets.org
Hi, I'm new here, and I meet a problem when I'm trying to trace into
wxWidget source file.I'm using windows Xp and code::blocks with mingw,
and I downloaded the wxWidget and compiled myself.

Then I create a project with wizard which support debugging with
wxWidgets source.then try "step into" the source, the debugger reported
that "Cannot open file: D:\window.cpp" .

Actually I installed wxWidget in "D:\wxWidgets-2.8.9", the debugger
can't find the true path of the source code.


so, I think something is wrong. I trying to install wxPack, it came the
same problem.

Any suggestion or hints? I have struggle with this problem for several
day.It seems that there is no option in code::blocks.

see a more detailed snapshot in my post here:

http://wxforum.shadonet.com/viewtopic.php?p=95234#95234

Iulian-Nicu Șerbănoiu

unread,
Dec 14, 2008, 8:13:24 AM12/14/08
to wx-u...@lists.wxwidgets.org
Hi,

I don't have a windows box to test for the moment but have you read this: http://sources.redhat.com/gdb/current/onlinedocs/gdb_9.html#SEC63 ?

Another question for you: Have you *compiled* the wxWidgets sources in "D:\wxWidgets-2.8.9" directory or have you moved them after compiling them in some other places? If you just moved the "already compiled source tree" to that location you might want to compile the "wx source tree" from the location you are using when compiling you wx dependant application.

I will test also on windows when I will have the time (and windows itself).

Another question: Why would you be interested to step through the wxWidgets code?

Regards,

Iulian

_______________________________________________
wx-users mailing list
wx-u...@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wx-users

asm23

unread,
Dec 14, 2008, 10:29:04 AM12/14/08
to wx-u...@lists.wxwidgets.org
Iulian-Nicu Șerbănoiu wrote:
> Hi,
>
> I don't have a windows box to test for the moment but have you read
> this: http://sources.redhat.com/gdb/current/onlinedocs/gdb_9.html#SEC63 ?
>
> Another question for you: Have you *compiled* the wxWidgets sources in
> "D:\wxWidgets-2.8.9" directory or have you moved them after compiling
> them in some other places?
Thanks for your reply. I'd appreciate your message.
In fact, I tried installing wxPack ( This package will install all
compiled librarys) or compiling wxWidget myself. But none of these
methods can solve my problem.


If you just moved the "already compiled
> source tree" to that location you might want to compile the "wx source
> tree" from the location you are using when compiling you wx dependant
> application.

I haven't move or change the source code. There is a trick: when GDB
complain that she can't find the wxWidgets sourc file in a folder like
"d:/", I can manually copy these files from "D:\wxWidgets-2.8.9\src\msw"
to this folder, then, GDB could happily worked.


>
> I will test also on windows when I will have the time (and windows itself).

Thanks, If you have time, you can test it. You can just use the wizard
to generate a simple wxWidgets project, and linked with "the debug
version of wxWidget library".

>
> Another question: Why would you be interested to step through the
> wxWidgets code?
>

That's because I'm interest in the "Message routing and dispatching of
wxWidgets", it's very important and I just know a little from my
experience from MFC. Both MFC and wxWidgets have some similarities on
this topic.


asm23

unread,
Dec 14, 2008, 9:22:38 PM12/14/08
to wx-u...@lists.wxwidgets.org
Iulian-Nicu Șerbănoiu wrote:
> There is a "hack" you could try:
>
> After obtaining the executable you view the executable for "window.cpp"
> string and see what is the prefix to it (that comes from the debug
> sections found in the executable).
>
> It can be something like: "D:\wxWidgets-2.8.9\src\msw\window.cpp",
> "..\..\src\msw\window.cpp".
>
> My guess is that it should be something with some relative path:
> "..\..\src\msw\window.cpp"
>
> In this case go to: Project->Properties->Debugger(Tab) and add the
> search directories for the debugger in order to fit that relative path.
>
> If it's not the case ... *please* offer more details about the string(s)
> associated with "window.cpp" in the executable (any viewer is enough).
>
> If the debugger should add some paths that can be described by the (wx)
> variable from the code::blocks environment then you should report a bug
> to the code::blocks team.

Thanks for your suggestion. It really low down my stress.

I enable the "Debugger log", and see that GDB try to search a relative
path "..\..\src\msw\window.cpp", So, I follow your advice and add a
debugger search path "\$(#wx)\samples\access" or a absolute path like"
D:\wxWidgets-2.8.9\samples\aui " to get the right path of window.cpp.

But that still doesn't work, If my project folder is "D:\test\test6"
then GDB complaints that "Cannot open file: D:\src\msw\window.cpp"

The only workable method is:

Move my project folder to the "D:\wxWidgets-2.8.9\samples\", Then GDB
will work happily to find the window.cpp.

Iulian-Nicu Șerbănoiu

unread,
Dec 14, 2008, 11:04:39 AM12/14/08
to wx-u...@lists.wxwidgets.org
There is a "hack" you could try:

After obtaining the executable you view the executable for "window.cpp" string and see what is the prefix to it (that comes from the debug sections found in the executable).

It can be something like: "D:\wxWidgets-2.8.9\src\msw\window.cpp", "..\..\src\msw\window.cpp".

My guess is that it should be something with some relative path: "..\..\src\msw\window.cpp"

In this case go to: Project->Properties->Debugger(Tab) and add the search directories for the debugger in order to fit that relative path.

If it's not the case ... *please* offer more details about the string(s) associated with "window.cpp" in the executable (any viewer is enough).

If the debugger should add some paths that can be described by the (wx) variable from the code::blocks environment then you should report a bug to the code::blocks team.

HTH,

Iulian

asm23

unread,
Dec 15, 2008, 2:35:30 AM12/15/08
to wx-u...@lists.wxwidgets.org
Iulian-Nicu Șerbănoiu wrote:
> Yes, I tested myself and it seems to be a problem no matter what I do.
>
> BUT, since the file is opended in Code::Blocks and the only thing that
> is taken from the debugger output is the file name and the line number I
> guess we're dealing with a problem of Code::Blocks.
>
> Have you tried with the source from SVN? The downloadable binary may
> have bugs comparing to the latest SVN sources.
Thanks for testing.

The problem happened in the latest nightly build SVN build 5322. I'm not
sure how to report this problem to the code::blocks develop teams.
Because when I asked for help on this problem, no one replied to my post
on that forums.


> If this doesn't work a good exercise to get into wxWidgets would be to
> see where the bug comes from :) (since C::B is written in wxWidgests).
>
> Regards,
>
> Iulian


Iulian-Nicu Șerbănoiu

unread,
Dec 15, 2008, 1:20:24 AM12/15/08
to wx-u...@lists.wxwidgets.org
Yes, I tested myself and it seems to be a problem no matter what I do.

BUT, since the file is opended in Code::Blocks and the only thing that is taken from the debugger output is the file name and the line number I guess we're dealing with a problem of Code::Blocks.

Have you tried with the source from SVN? The downloadable binary may have bugs comparing to the latest SVN sources.
If this doesn't work a good exercise to get into wxWidgets would be to see where the bug comes from :) (since C::B is written in wxWidgests).

Regards,

Iulian

Reply all
Reply to author
Forward
0 new messages