Skip to content

Commit

Permalink
Fix: gcview checks output of DbgEng commands correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
krk committed Oct 20, 2015
1 parent f7265f6 commit 52c0e10
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions cosos/Extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ HRESULT EXT_CLASS::Initialize()
DebugControl->GetWindbgExtensionApis64(&ExtensionApis);

#if _DEBUG
dprintf("COSOS v0.2.1 (%s) - Cousin of Son of Strike (DEBUG build) loaded.\n", __TIMESTAMP__);
dprintf("COSOS v0.2.2 (%s) - Cousin of Son of Strike (DEBUG build) loaded.\n", __TIMESTAMP__);
#else
dprintf("COSOS v0.2.1 (%s) - Cousin of Son of Strike loaded.\n", __TIMESTAMP__);
dprintf("COSOS v0.2.2 (%s) - Cousin of Son of Strike loaded.\n", __TIMESTAMP__);
#endif

DebugControl->Release();
Expand Down Expand Up @@ -165,10 +165,15 @@ EXT_COMMAND(gcview,
auto addressCommandParser = AddressCommandParser(executor, logger);
auto addressCommandOutput = addressCommandParser.execute();

if (addressCommandOutput.has_ranges())
if (!addressCommandOutput.has_ranges())
{
dprintf("Cannot get addresses.\n");

DebugClient->SetOutputCallbacks(nullptr);

DebugControl->Release();
DebugClient->Release();

return;
}

Expand All @@ -182,10 +187,15 @@ EXT_COMMAND(gcview,
auto eeheapParser = EEHeapCommandParser(executor, logger);
auto eeheapOutput = eeheapParser.execute();

if (eeheapOutput.has_ranges())
if (!eeheapOutput.has_ranges())
{
dprintf("Cannot get eeheap information.\n");

DebugClient->SetOutputCallbacks(nullptr);

DebugControl->Release();
DebugClient->Release();

return;
}

Expand Down

0 comments on commit 52c0e10

Please sign in to comment.