Linux: Fixed rare crashes when opening debugger (when loading a DBG file)

This commit is contained in:
Sour 2018-06-09 18:02:49 -04:00
parent 39f2a1e2ff
commit 7f7d7ab1b3
2 changed files with 6 additions and 4 deletions

View File

@ -498,7 +498,7 @@ namespace Mesen.GUI.Debugger
public string GetLineComment(int lineNumber)
{
if(_code.SymbolProvider != null && _code._config.ShowSourceAsComments) {
if(_code.SymbolProvider != null && _code._config?.ShowSourceAsComments == true) {
AddressTypeInfo addressInfo = _code.GetAddressInfo(lineNumber);
if(addressInfo.Type == AddressType.PrgRom) {
return _code.SymbolProvider.GetSourceCodeLine(addressInfo.Address);

View File

@ -178,6 +178,11 @@ namespace Mesen.GUI.Debugger
{
base.OnShown(e);
ctrlDebuggerCode.Visible = true;
ctrlDebuggerCodeSplit.Visible = true;
ctrlSourceViewer.Visible = true;
ctrlSourceViewerSplit.Visible = true;
ctrlDebuggerCode.CodeViewerActions.OnSetNextStatement += ctrlDebuggerCode_OnSetNextStatement;
ctrlDebuggerCode.CodeViewerActions.OnShowInSplitView += ctrlDebuggerCode_OnShowInSplitView;
ctrlDebuggerCode.CodeViewerActions.OnSwitchView += ctrlDebuggerCode_OnSwitchView;
@ -186,9 +191,6 @@ namespace Mesen.GUI.Debugger
ctrlDebuggerCodeSplit.CodeViewerActions.OnShowInSplitView += ctrlDebuggerCode_OnShowInSplitView;
ctrlDebuggerCodeSplit.CodeViewerActions.OnSwitchView += ctrlDebuggerCode_OnSwitchView;
ctrlSourceViewer.Visible = true;
ctrlSourceViewerSplit.Visible = true;
ctrlSourceViewer.CodeViewerActions.OnSetNextStatement += ctrlDebuggerCode_OnSetNextStatement;
ctrlSourceViewer.CodeViewerActions.OnShowInSplitView += ctrlDebuggerCode_OnShowInSplitView;
ctrlSourceViewer.CodeViewerActions.OnSwitchView += ctrlDebuggerCode_OnSwitchView;