Advanced Question Drawing on a texture in VC

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
OK. so on the settings

debugsetting1_zpscig5obzq.jpg



But then I click on Endurance.dll but nothing happens
debug6_zpsmgnu4cnj.jpg
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,616
Reaction score
2,336
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Can't read anything on those images.
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Are any breakpoints triggered when you set them in your module (the best in some initialization functions/methods, so it can be tested easily)?

You said earlier something about disassembly being shown instead. If debugging symbols are indeed generated, are you linking your module against some static library which is an external dependency?
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
Can't read anything on those images.
Just click on the magnifying glass in the top right corner of the image to zoom in. Things should be more readable then.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,616
Reaction score
2,336
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Just click on the magnifying glass in the top right corner of the image to zoom in. Things should be more readable then.

Was only available for one image, but I managed to make the other picture visible via that one, thank you.

---------- Post added at 07:04 PM ---------- Previous post was at 07:03 PM ----------

I can't really help with a screen shot because I use a German VS, but: Do you have parameter /ZI set in Debug configuration?
 

grid4dante

New member
Joined
Mar 22, 2011
Messages
34
Reaction score
0
Points
0
Location
Midwest City
While testing a new piece of the cargo management system, every time I exit orbiter I get a "orbiter.exe has stopped working" error. The new system works as intended at it's current stage, and it's not doing the "Critical Error: Check Orbiter.log" message at all.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
yes i have that.

I did notice when i click it pulled testvc.pbd not loaded
debug7_zpsfcum7xqb.jpg


---------- Post added 05-14-16 at 05:57 AM ---------- Previous post was 05-13-16 at 03:20 PM ----------

Any ideas on why the pdb isn't loading.

---------- Post added at 07:20 AM ---------- Previous post was at 05:57 AM ----------

ok. I got it to display the issue. not sure how to fix though? I change the name to match the dll name and it loaded the symbols.

Code:
DLLCLBK VESSEL *ovcInit(OBJHANDLE hvessel, int flightmodel)
{
	return new TESTVC(hvessel, flightmodel);
}

DLLCLBK void ovcExit(VESSEL *vessel)
{
	if (vessel) delete (TESTVC*)vessel;//this is the issue
}

debug8_zpsehhtklny.jpg
 
Last edited:

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,403
Reaction score
581
Points
153
Location
Vienna
ok. I got it to display the issue. not sure how to fix though?

Click the line (inside the callstack window) above the one shown in the screenshot. It should show you which delete-call inside the destructor is the culprit.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,616
Reaction score
2,336
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Right direction, wrong interpretation: Further up the call stack, you have a second line of your own code, inside your destructor, trying to delete a resource.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Thanks.
So here are the 2 lines in the Call stack:
HTML:
>	ENDURANCEVC.dll!TESTVC::`scalar deleting destructor'(unsigned int)	C++
 	ENDURANCEVC.dll!ovcExit(VESSEL * vessel) Line 17	C++

So if I double click this line "ENDURANCEVC.dll!TESTVC::`scalar deleting destructor'(unsigned int) C++"I get source unavailable.

If I open the dissambly
I get:
60763B9B call TESTVC::`scalar deleting destructor' (6075129Eh)
60763BA0 mov dword ptr [ebp-0E0h],eax


So how do I fix it?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Thanks.
I do have this in the h:
Code:
class TESTVC : public VESSEL2 {
public:
	TESTVC(OBJHANDLE hVessel, int flightmodel);
	~TESTVC();
in the cpp:
Code:
// --------------------------------------------------------------
// Destructor
// --------------------------------------------------------------
TESTVC::~TESTVC() {
	delete viewController;
	delete mfdController;
	

}
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,616
Reaction score
2,336
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Are viewController and mfdController always containing a pointer to some instance created by new?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Thanks. Not sure what you mean though.

Code:
TESTVC::TESTVC(OBJHANDLE hObj, int fmodel)
: VESSEL2(hObj, fmodel)
{
	viewController = new Station::Controller(this);
	mfdController = new ClassicMfd(4,
		g_Param.hFont[0], g_Param.col[0], g_Param.hBrush[0], g_Param.hBrush[1],
		&MFD_BUTTONS_FN_DIM, MFD_BUTTONS_FN_RECT, &MFD_BUTTONS_SYS_DIM, MFD_BUTTONS_SYS_RECT);

Code:
	mfdController->HandleLoadMesh(meshi_VC, meshhg_VC);
Code:
bool TESTVC::clbkLoadVC(int id) { // ID is the Preset Camera Position
	SURFHANDLE const tex3 = oapiGetTextureHandle(meshhg_VC, 4);


	viewController->HandleLoadVC(id);
	mfdController->HandleLoadVC(id);	
	oapiVCRegisterArea(AID_FUELSTATUS, _R(0, 0, 486, 302), PANEL_REDRAW_ALWAYS, PANEL_MOUSE_IGNORE, PANEL_MAP_BACKGROUND, tex3);
	static VCHUDSPEC hud_pilot = { 2, 38, { 0, -16.023, 7.459 }, 0.338 };
	oapiVCRegisterHUD(&hud_pilot);
	return HandleLoadVC(id);
}
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Ok. If I don't go to the vc The endurancevc.dll is NOT in the call stack. But not running the debugger. I get this error on closing:
 

Attachments

  • debug9.jpg
    debug9.jpg
    34.7 KB · Views: 8
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
I rebooted and ran debugger. Now I get this errors. In the call stack the Endurancevc.dll does show up. the only ones is the ntdll.dll and msvcr120.dll.
 

Attachments

  • debug10.jpg
    debug10.jpg
    129.5 KB · Views: 6
  • debug11.jpg
    debug11.jpg
    220.7 KB · Views: 6

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,616
Reaction score
2,336
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
I rebooted and ran debugger. Now I get this errors. In the call stack the Endurancevc.dll does show up. the only ones is the ntdll.dll and msvcr120.dll.

Yes - did you already read what heap corruption means?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Well I looked it up.

http://www.informit.com/articles/article.aspx?p=1081496&seqNum=2

---------- Post added at 02:52 PM ---------- Previous post was at 07:18 AM ----------

At a lost. Not sure why I get that heap corruption error.

---------- Post added at 07:39 PM ---------- Previous post was at 02:52 PM ----------

I saw this:
http://orbiter-forum.com/showthread.php?p=370317

I added this to my code and ran the debugger. The only thing in the call stack was ntdll.dll and msvcr120d.dll

Code:
DLLCLBK void InitModule(HINSTANCE hModule)
{
	
#ifdef _DEBUG
	// NOTE: _CRTDBG_CHECK_ALWAYS_DF is too slow
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF |
		_CRTDBG_CHECK_CRT_DF |
		_CRTDBG_LEAK_CHECK_DF);
#endif

IS it how I am compiling? meaning setting or a code issue?
 
Top