Allow alternate directory for built-in symbols (#1230)
* allow an alternate directory for built-in symbol tables -- needed because macOS apps are a bundle (tree of directories) and resources are packaged somewhere within, not necessarily in the same directory as the executable. * use tabs * add parentheses
This commit is contained in:
parent
0d635d2817
commit
e5c4e2c51b
|
@ -61,6 +61,7 @@ AppMode_e g_nAppMode = MODE_LOGO;
|
||||||
std::string g_sStartDir; // NB. AppleWin.exe maybe relative to this! (GH#663)
|
std::string g_sStartDir; // NB. AppleWin.exe maybe relative to this! (GH#663)
|
||||||
std::string g_sProgramDir; // Directory of where AppleWin executable resides
|
std::string g_sProgramDir; // Directory of where AppleWin executable resides
|
||||||
std::string g_sCurrentDir; // Also Starting Dir. Debugger uses this when load/save
|
std::string g_sCurrentDir; // Also Starting Dir. Debugger uses this when load/save
|
||||||
|
std::string g_sBuiltinSymbolsDir; // Alternate directory for built-in debug symbols
|
||||||
|
|
||||||
bool g_bRestart = false;
|
bool g_bRestart = false;
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ extern AppMode_e g_nAppMode;
|
||||||
extern std::string g_sStartDir;
|
extern std::string g_sStartDir;
|
||||||
extern std::string g_sProgramDir;
|
extern std::string g_sProgramDir;
|
||||||
extern std::string g_sCurrentDir;
|
extern std::string g_sCurrentDir;
|
||||||
|
extern std::string g_sBuiltinSymbolsDir;
|
||||||
|
|
||||||
bool SetCurrentImageDir(const std::string& pszImageDir);
|
bool SetCurrentImageDir(const std::string& pszImageDir);
|
||||||
|
|
||||||
|
|
|
@ -749,8 +749,15 @@ Update_t CmdSymbolsLoad (int nArgs)
|
||||||
// Debugger will call us with 0 args on startup as a way to pre-load symbol tables
|
// Debugger will call us with 0 args on startup as a way to pre-load symbol tables
|
||||||
if (! nArgs)
|
if (! nArgs)
|
||||||
{
|
{
|
||||||
sFileName += g_sFileNameSymbols[ iSymbolTable ];
|
sFileName = g_sProgramDir + g_sFileNameSymbols[ iSymbolTable ];
|
||||||
nSymbols = ParseSymbolTable( sFileName, (SymbolTable_Index_e) iSymbolTable );
|
nSymbols = ParseSymbolTable( sFileName, (SymbolTable_Index_e) iSymbolTable );
|
||||||
|
|
||||||
|
// Try optional alternate location
|
||||||
|
if ((nSymbols == 0) && !g_sBuiltinSymbolsDir.empty())
|
||||||
|
{
|
||||||
|
sFileName = g_sBuiltinSymbolsDir + g_sFileNameSymbols[ iSymbolTable ];
|
||||||
|
nSymbols = ParseSymbolTable( sFileName, (SymbolTable_Index_e) iSymbolTable );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int iArg = 1;
|
int iArg = 1;
|
||||||
|
|
Loading…
Reference in New Issue