public void SetupGame(GameInformation game, Stream bootStream) { // Attempt to load symbols from game information bool debugInfoLoaded = false; if (bootStream != null) { debugInfoLoaded = this.LoadDebugData(DebugDataType.Symbols, bootStream); } // If nothing loaded, give the user a choice bool skipLoadInfo = debugInfoLoaded; DebugSetup setup = null; if (debugInfoLoaded == false) { setup = new DebugSetup(); if (setup.ShowDialog() == System.Windows.Forms.DialogResult.Cancel) { skipLoadInfo = true; } } if (skipLoadInfo == false) { bool result = false; if (setup.UseElfDebug == true) { IMediaFolder folder = game.Folder; IMediaFile file = folder.FindFile("BOOT.BIN"); using (Stream stream = file.OpenRead()) result = this.LoadDebugData(DebugDataType.Elf, stream); } else { Debug.Assert(false); } Debug.Assert(result == true); if (result == false) { throw new InvalidOperationException("Could not load debugging data - cannot continue."); } } }
public void SetupGame( GameInformation game, Stream bootStream ) { // Attempt to load symbols from game information bool debugInfoLoaded = false; if( bootStream != null ) debugInfoLoaded = this.LoadDebugData( DebugDataType.Symbols, bootStream ); // If nothing loaded, give the user a choice bool skipLoadInfo = debugInfoLoaded; DebugSetup setup = null; if( debugInfoLoaded == false ) { setup = new DebugSetup(); if( setup.ShowDialog() == System.Windows.Forms.DialogResult.Cancel ) skipLoadInfo = true; } if( skipLoadInfo == false ) { bool result = false; if( setup.UseElfDebug == true ) { IMediaFolder folder = game.Folder; IMediaFile file = folder.FindFile( "BOOT.BIN" ); using( Stream stream = file.OpenRead() ) result = this.LoadDebugData( DebugDataType.Elf, stream ); } else { Debug.Assert( false ); } Debug.Assert( result == true ); if( result == false ) throw new InvalidOperationException( "Could not load debugging data - cannot continue." ); } }