GT-2718, Issue#30 corrected PDB DIA SDK error handling, VS post-build

syntax and documentation
This commit is contained in:
ghidra1 2019-03-29 16:40:15 -04:00
parent 1d74d2eacb
commit 9edd697171
5 changed files with 12 additions and 13 deletions

View File

@ -75,9 +75,9 @@ of Visual Studio and DIA SDK.</li>
<p>First, check to see if you already have the <i>msdia140.dll</i> library installed on your system. <p>First, check to see if you already have the <i>msdia140.dll</i> library installed on your system.
It is generally installed installed with Microsoft Visual Studio 2017 when C/C++ development support It is generally installed installed with Microsoft Visual Studio 2017 when C/C++ development support
is included. is included (<DISTRO> may be Community, Professional, or other VS 2017 distribution package name).
<pre> <pre>
C:\\Program Files (x86)\Microsoft Visual Studio\2017\DIA SDK\bin\amd64\msdia140.dll C:\Program Files (x86)\Microsoft Visual Studio\2017\<DISTRO>\DIA SDK\bin\amd64\msdia140.dll
</pre> </pre>
<p>This file is commonly located here, although it may be installed in other locations as well. Any 64-bit <p>This file is commonly located here, although it may be installed in other locations as well. Any 64-bit
copy may be registered provided it is the correct version. There is no need to register more than copy may be registered provided it is the correct version. There is no need to register more than
@ -86,8 +86,8 @@ one.
<h3>Register 'msdia140.dll' in the Windows registry</h3> <h3>Register 'msdia140.dll' in the Windows registry</h3>
<p>Please register 64-bit <i>msdia140.dll</i> even if you already had a copy of it on your computer <p>Please register 64-bit <i>msdia140.dll</i> even if you already had a copy of it on your computer
since it is not registered by the Visual Studio installation process. You will need administrative rights/privileges in order to register the DLL in the Windows since it is not registered by the Visual Studio installation process. You will need administrative
registry. rights/privileges in order to register the DLL in the Windows registry.
<blockquote> <blockquote>
<ol> <ol>
<li>Start a command prompt as an administrator:</li> <li>Start a command prompt as an administrator:</li>

View File

@ -576,6 +576,9 @@ public class PdbParserNEW {
} }
catch (Exception e) { catch (Exception e) {
if (!isXML) { if (!isXML) {
if (hasErrors()) {
throw new PdbException(getErrorAndWarningMessages());
}
throw new PdbException("PDB Execution failure of " + PDB_EXE + ".\n" + throw new PdbException("PDB Execution failure of " + PDB_EXE + ".\n" +
"This was likely caused by severe execution failure which can occur if executed\n" + "This was likely caused by severe execution failure which can occur if executed\n" +
"on an unsupported platform. It may be neccessary to rebuild the PDB executable\n" + "on an unsupported platform. It may be neccessary to rebuild the PDB executable\n" +

View File

@ -1,6 +1,5 @@
/* ### /* ###
* IP: GHIDRA * IP: GHIDRA
* REVIEWED: YES
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -26,9 +25,7 @@ void warning( const char * msg )
void fatal( const char * msg ) void fatal( const char * msg )
{ {
fprintf( stderr, "ERROR:\n" ); fprintf( stderr, "ERROR: %s\n", msg );
fprintf( stderr, msg );
fprintf( stderr, "\n" );
exit( -1 ); exit( -1 );
} }

View File

@ -46,9 +46,8 @@ int init(const char * szFilename, const char * szSignature, const char * szAge)
if (hr < 0) { if (hr < 0) {
switch (hr) { switch (hr) {
case REGDB_E_CLASSNOTREG: case REGDB_E_CLASSNOTREG:
fatal("Unable to locate the DIA SDK. It is required to load PDB files.\n\n" \ fatal("Unable to locate the DIA SDK. It is required to load PDB files.\n" \
"* Open {Ghidra install root}/docs/README_PDB.html\n" "* See docs/README_PDB.html for DLL registration instructions.\n");
" and follow the instructions therein.\n");
break; break;
default: default:
char msg[256]; char msg[256];

View File

@ -72,7 +72,7 @@
<PostBuildEvent> <PostBuildEvent>
<Command> <Command>
rem copy /y /v /b "$(VSInstallDir)DIA SDK\bin\amd64\msdia*.dll" "$(OutDir)" rem copy /y /v /b "$(VSInstallDir)DIA SDK\bin\amd64\msdia*.dll" "$(OutDir)"
set OS_DIR="$(SolutionDir)..\..\os" set OS_DIR=$(SolutionDir)..\..\os
if exist "%OS_DIR%\win64" ( if exist "%OS_DIR%\win64" (
mkdir "%OS_DIR%" mkdir "%OS_DIR%"
mkdir "%OS_DIR%\win64" mkdir "%OS_DIR%\win64"
@ -104,7 +104,7 @@ if exist "%OS_DIR%\win64" (
<PostBuildEvent> <PostBuildEvent>
<Command> <Command>
rem copy /y /v /b "$(VSInstallDir)DIA SDK\bin\amd64\msdia*.dll" "$(OutDir)" rem copy /y /v /b "$(VSInstallDir)DIA SDK\bin\amd64\msdia*.dll" "$(OutDir)"
set OS_DIR="$(SolutionDir)..\..\os" set OS_DIR=$(SolutionDir)..\..\os
if exist "%OS_DIR%\win64" ( if exist "%OS_DIR%\win64" (
mkdir "%OS_DIR%" mkdir "%OS_DIR%"
mkdir "%OS_DIR%\win64" mkdir "%OS_DIR%\win64"