private void OnVersionInformationReceived(Platform hostPlatform, int hostVersion, int clientVersion) { if (hostVersion != clientVersion) { string text = string.Format("Version mismatch, host version: {0}, client version: {1}\n", hostVersion, clientVersion); if (hostVersion > clientVersion) { text += "You need to update your remote debugger client.\n\n"; } else { text += "The game is not using the latest remote debugger code.\n\n"; } text += "Continue anyway?"; if (MessageBox.Show(this, text, "Version mismatch", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { // Bail! debugger.Disconnect(); return; } } SendBreakpointsToDebugger(); CheckFileDifferences(); debugger.EnableCppCallstack(GetCppCallStackMode()); }
private void OnVersionInformationReceived(Platform hostPlatform, int hostVersion, int clientVersion) { if (hostVersion != clientVersion) { string text = string.Format("Version mismatch, host version: {0}, client version: {1}\n", hostVersion, clientVersion); if (hostVersion > clientVersion) { text += "You need to update your remote debugger client.\n\n"; } else { text += "The game is not using the latest remote debugger code.\n\n"; } text += "Continue anyway?"; if (MessageBox.Show(this, text, "Version mismatch", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { // Bail! debugger.Disconnect(); return; } } if (hostPlatform == Platform.PS3) { string ps3BinPath = Settings.Default.Ps3BinPath; if (string.IsNullOrEmpty(ps3BinPath) || !File.Exists(ps3BinPath)) { ps3BinPath = null; // Try to find the PS3 bin folder automatically string ps3Root = Environment.GetEnvironmentVariable("SCE_PS3_ROOT"); if (ps3Root != null) { ps3BinPath = Path.Combine(ps3Root, "host-win32/sn/bin/ps3bin.exe"); if (!File.Exists(ps3BinPath)) { ps3BinPath = null; } } } if (string.IsNullOrEmpty(ps3BinPath)) { // As a last resort, ask the user to locate it string caption = "In order to resolve C++ callstacks on the PS3, we need access to ps3bin.exe.\n"; caption += "It is a part of the CELL SDK and should be located under <cell>/host-win32/sn/bin/ps3bin.exe.\n\n"; caption += "Do you want to locate it now?"; if (MessageBox.Show(this, caption, "Locate ps3bin.exe", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { using (OpenFileDialog fileDialog = new OpenFileDialog()) { fileDialog.CheckFileExists = true; fileDialog.Filter = "ps3bin.exe|ps3bin.exe"; if (fileDialog.ShowDialog(this) == DialogResult.OK && fileDialog.FileName.EndsWith("ps3bin.exe", StringComparison.OrdinalIgnoreCase)) { ps3BinPath = fileDialog.FileName; } } } } if (!string.IsNullOrEmpty(ps3BinPath)) { string selfPath = null; // Try to determine the executing self from the target manager API if (Ps3TmApi.Available && debugger.ConnectedIpAddress != null) { selfPath = Ps3TmApi.FindTargetSelf(debugger.ConnectedIpAddress); } // As a last resort, ask the user to locate it if (string.IsNullOrEmpty(selfPath)) { string caption = "In order to resolve C++ callstacks on the PS3, we need access to the compiled self file.\n\n"; caption += "Do you want to locate it now?"; if (MessageBox.Show(this, caption, "Locate self", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { using (OpenFileDialog fileDialog = new OpenFileDialog()) { fileDialog.CheckFileExists = true; fileDialog.Filter = "self files (*.self)|*.self"; if (fileDialog.ShowDialog(this) == DialogResult.OK) { selfPath = fileDialog.FileName; } } } } if (!string.IsNullOrEmpty(selfPath)) { debugger.SetSymbolsManager(new Ps3SymbolsManager(ps3BinPath, selfPath)); } Settings.Default.Ps3BinPath = ps3BinPath; // Save the path for next time } } SendBreakpointsToDebugger(); CheckFileDifferences(); debugger.EnableCppCallstack(GetCppCallStackMode()); }