Page 1 of 1

how can i debug cafu ?

Posted: 2012-08-22, 17:47
by zengqh
thanks for the 611 source release.
is there any way to debug the cafu engine ?

i want to see how the code works, i was used to debug with visual studio...

it will be grateful for any suggestion!

Re: how can i debug cafu ?

Posted: 2012-08-23, 04:59
by zengqh


Re: how can i debug cafu ?

Posted: 2012-08-23, 10:09
by Carsten
Hi zengqh,
zengqh wrote:i have just found that the scons can be converted to visual studio project.
Can you please tell how you did this?

I never use Visual Studio other than from the command line or via SCons, but I'd be interested in how this works as well.

About debugging, you should also be able to do this with the executables generated directly by SCons as well: Just open the .exe binary in your favorite debugger. (I use WinDbg under Windows, which also works very well as a just-in-time debugger.)

Re: how can i debug cafu ?

Posted: 2012-08-23, 12:03
by zengqh
http://www.scons.org/wiki/IDEIntegratio ... 22cd161bf4

after i try the below, i found that
it just can compile it in visual studio, but it can't debug... :shock:

thanks, i will try windbg.

Re: how can i debug cafu ?

Posted: 2012-08-24, 23:35
by Carsten
Thanks!
i found that
it just can compile it in visual studio, but it can't debug... :shock:
As I said above, I have no first hand experience with Visual Studio, but I'm still surprised. I would expect that you can open any executable with the VS debugger that comes with the proper debug symbols (the Cafu debug builds do).

That is, I was thinking that the VS debugger is, in this regard, similar to WinDbg and any other debugger, and that you can use it also when the project was not strictly build with the VS IDE... but alas, I'm speculating here.

Re: how can i debug cafu ?

Posted: 2013-07-13, 06:03
by deamonpog
Carsten wrote:Hi zengqh,
zengqh wrote:i have just found that the scons can be converted to visual studio project.
Can you please tell how you did this?

I never use Visual Studio other than from the command line or via SCons, but I'd be interested in how this works as well.

About debugging, you should also be able to do this with the executables generated directly by SCons as well: Just open the .exe binary in your favorite debugger. (I use WinDbg under Windows, which also works very well as a just-in-time debugger.)
I just tried WinDbg, it always say
ERROR: Symbol file could not be found.
any help?

Re: how can i debug cafu ?

Posted: 2013-07-13, 21:33
by Carsten
Hi deamonpog,
deamonpog wrote: I just tried WinDbg, it always say
ERROR: Symbol file could not be found.
any help?
I don't feel particularly qualified to give advice about WinDbg, because there is much of it that I don't understand well enough myself. (So if in doubt, you may want to refer to WinDbg-specific resources, or user groups etc.)

That said, I don't think that this error is fatal, as the missing symbol file is probably referring to Windows libraries that (as application developers) we normally don't need to debug into anyway.

You should, despite the error, be able to see debug information such as function and variable names when you use WinDbg for debugging Cafu (in debug build), using it either as just-in-time debugger, or when you open or attach to the Cafu.exe executable via the menu. :up:

Re: how can i debug cafu ?

Posted: 2013-07-13, 21:58
by deamonpog
Ah maybe that is the case. Thanks. Anyway i found that its easier to use VS 2010 than WinDbg for me since i am used to it.
I used that "Makefile Project" template when creating the project as suggested in http://www.scons.org/wiki/IDEIntegratio ... Windows.29 and gave the Cafu.exe as the output file in project settings so that Debug->Start Debugging (Shortcut : F5) will start debugging.

Re: how can i debug cafu ?

Posted: 2013-07-15, 14:28
by Carsten
deamonpog wrote:I used that "Makefile Project" template when creating the project as suggested in http://www.scons.org/wiki/IDEIntegratio ... Windows.29 and gave the Cafu.exe as the output file in project settings so that Debug->Start Debugging (Shortcut : F5) will start debugging.
It's good to hear that this works, thanks for sharing it! :up: