[solved] How to debug Freeorion using msvc?

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

[solved] How to debug Freeorion using msvc?

#1 Post by Ophiuchus »

Hi,

I'm trying to unify the calculation of current production and future production (see http://www.freeorion.org/forum/viewtopi ... 660#p87660).

For that i tried to write an implementation using boost coroutine2. But that crashes and i don't have a clue how to debug/find out what goes wrong.

https://github.com/agrrr3/freeorion/tre ... coroutine2

how would you approach that? how do you start freeorion with a debugger from msvc?

any help greatly appreciated thanks :)
Last edited by Ophiuchus on Fri Jun 09, 2017 8:21 am, edited 1 time in total.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: How to debug Freeorion using msvc?

#2 Post by Geoff the Medio »

Ophiuchus wrote:how would you approach that? how do you start freeorion with a debugger from msvc?
It can run a program with the debugger already attached, but it's easier to run "freeorion" from a cmd.exe window and then attach the debugger to the running process using the GUI. Set a breakpoint, step through execution, look at the call stack, etc. Local and auto variable values are unreliable, though.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: How to debug Freeorion using msvc?

#3 Post by Ophiuchus »

Geoff the Medio wrote:
Ophiuchus wrote:how would you approach that? how do you start freeorion with a debugger from msvc?
It can run a program with the debugger already attached, but it's easier to run "freeorion" from a cmd.exe window and then attach the debugger to the running process using the GUI. Set a breakpoint, step through execution, look at the call stack, etc. Local and auto variable values are unreliable, though.
Thanks, attaching to a running freeoriond works fine :)
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Post Reply