News MSVS 2013 Expr. - Possible to debug via Attach to process!

Enjo

Mostly harmless
Addon Developer
Tutorial Publisher
Donator
Joined
Nov 25, 2007
Messages
1,665
Reaction score
13
Points
38
Location
Germany
Website
www.enderspace.de
Preferred Pronouns
Can't you smell my T levels?
Regarding my rant about instability of Orbiter and what can be done about it, I'd like to address this paragraph:
Even without modifications of the Orbiter API, like in the above example, some simpler testing framework could be achieved, if only Orbiter was built with Free compilers, like MinGW, instead of MS-VC. Both MinGW and a full version of MS-VC allow for attaching their debuggers to an external process (Orbiter.exe), which allows you to find out which at least which DLL has caused the crash. The problem is, that you can’t debug code with MinGW which is not compiled by it, and a full version of MS-VC, that allows it, costs 600€. Who wants to waste so much money?
Well, that's not valid anymore, because since MSVS 2013, MS added the Attach to Process option also in the Express (Freeware/Registerware) version! Maybe it's a good time to write an article what we all can do now for to improve the stability of our addons.
It's also worth noting, that using only the mentioned debugging tool, you can also profile your code, by looping it and pausing its execution. If the cursor stops usually at the same branch of code, then statistically this is your bottleneck and you should investigate deeper there until you remove the bottleneck. Afterwards repeat the experiment. The method is described in detail here. I used it to speed up TransX' Auto-Min feature with great success.
 
Last edited:

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
Is there any difference/advantage between attaching to a process to debug and starting Orbiter directly with the debugger?
 
Last edited:

Enjo

Mostly harmless
Addon Developer
Tutorial Publisher
Donator
Joined
Nov 25, 2007
Messages
1,665
Reaction score
13
Points
38
Location
Germany
Website
www.enderspace.de
Preferred Pronouns
Can't you smell my T levels?
As far as I know, debugging Orbiter.exe directly through debugger isn't possible, because you normally need to have some source attached to the directly debugged process.
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Wait, wasn't attaching debugger to process already possible in VC++ 2005, 2008, 2010 Express? I have that feature available in all 3 of them. :shrug:
 

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
As far as I know, debugging Orbiter.exe directly through debugger isn't possible, because you normally need to have some source attached to the directly debugged process.
It works for me, you just set it as the "Command" for Local Windows Debugger.

When debugging, you can't access anything that you don't have symbol files for, but it does allow you to debug your addon quite nicely.
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
VC++ 2005 Express
|
VC++ 2008 Express
|
VC++ 2010 Express
|
VS 2012 Express
VC2005ExprAttach.jpg | VC2008ExprAttach.jpg | VC2010ExprAttach.jpg | VS2012ExprAttach.jpg
 

Enjo

Mostly harmless
Addon Developer
Tutorial Publisher
Donator
Joined
Nov 25, 2007
Messages
1,665
Reaction score
13
Points
38
Location
Germany
Website
www.enderspace.de
Preferred Pronouns
Can't you smell my T levels?
Hit me :facepalm:
I couldn't have checked it myself because I've been using outdated Windows for the latest express versions.
 
Last edited:
Top