From 86b23474cfdca5efeb495c5732cd95171825f459 Mon Sep 17 00:00:00 2001 From: "Marco Antonio J. Costa" Date: Fri, 31 Jul 2026 14:23:21 -0300 Subject: [PATCH] rename the crash reporter off its Chromium origins Nothing Chromium-derived is left in either file - the stack tracer that came from base/debug_util was the last of it - so the copyright header credited Google for code it did not write and pointed at a LICENSE file this repository does not have. Rename to what the files actually are. While in there: say what the exception code's customer bit does and does not guarantee, and note next to it how to stop a debugger breaking on every assertion, which is what someone will be looking for when they grep that number. Co-Authored-By: Claude Opus 5 --- sgp/CMakeLists.txt | 2 +- sgp/DEBUG.cpp | 2 +- sgp/{debug_win_util.cpp => crash_report.cpp} | 8 +------- sgp/{debug_util.h => crash_report.h} | 18 +++++++++--------- sgp/crash_telemetry.cpp | 4 ++-- sgp/sgp.cpp | 2 +- 6 files changed, 15 insertions(+), 21 deletions(-) rename sgp/{debug_win_util.cpp => crash_report.cpp} (96%) rename sgp/{debug_util.h => crash_report.h} (79%) diff --git a/sgp/CMakeLists.txt b/sgp/CMakeLists.txt index f7a91c16f..730aba769 100644 --- a/sgp/CMakeLists.txt +++ b/sgp/CMakeLists.txt @@ -5,7 +5,7 @@ set(sgpSrc "${CMAKE_CURRENT_SOURCE_DIR}/crash_telemetry.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/Cursor Control.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/DEBUG.cpp" -"${CMAKE_CURRENT_SOURCE_DIR}/debug_win_util.cpp" +"${CMAKE_CURRENT_SOURCE_DIR}/crash_report.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/DirectDraw Calls.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/DirectX Common.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/English.cpp" diff --git a/sgp/DEBUG.cpp b/sgp/DEBUG.cpp index 5a71dc8c4..bb18ee10f 100644 --- a/sgp/DEBUG.cpp +++ b/sgp/DEBUG.cpp @@ -47,7 +47,7 @@ #include "GameVersion.h" #include "Text.h" -#include "debug_util.h" +#include "crash_report.h" BOOLEAN gfRecordToFile = FALSE; BOOLEAN gfRecordToDebugger = TRUE; diff --git a/sgp/debug_win_util.cpp b/sgp/crash_report.cpp similarity index 96% rename from sgp/debug_win_util.cpp rename to sgp/crash_report.cpp index 711b2d78a..929af5970 100644 --- a/sgp/debug_win_util.cpp +++ b/sgp/crash_report.cpp @@ -1,12 +1,6 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - - #if defined(_MSC_VER) -#include "debug_util.h" +#include "crash_report.h" #include diff --git a/sgp/debug_util.h b/sgp/crash_report.h similarity index 79% rename from sgp/debug_util.h rename to sgp/crash_report.h index 9eed9ed66..70a81463e 100644 --- a/sgp/debug_util.h +++ b/sgp/crash_report.h @@ -1,18 +1,18 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - // Crash reporting: capture a fault (or an assertion) as a report file, and hand // the pending reports to the telemetry uploader at startup. -#ifndef BASE_DEBUG_UTIL_H_ -#define BASE_DEBUG_UTIL_H_ +#ifndef SGP_CRASH_REPORT_H_ +#define SGP_CRASH_REPORT_H_ struct _EXCEPTION_POINTERS; // Assertion failures raise this software exception so they get the same crash -// report as a real fault. Bit 29 set marks it customer-defined, so it can never -// collide with a system code; the top two bits mark it an error. +// report as a real fault. Bit 29 set marks it customer-defined, which keeps it out +// of the system's own codes; the top two bits mark it an error. Other user-mode +// producers set that bit too (MSVC's C++ exception is 0xE06D7363), so it is the +// whole value that makes this code ours, not the bit alone. +// A debugger sees this first-chance on every assert; `sxi e1a55e27` in WinDbg +// (Debug > Exceptions in Visual Studio) stops it breaking. #define SGP_EXCEPTION_ASSERT 0xE1A55E27 namespace sgp @@ -49,4 +49,4 @@ namespace sgp void processCrashTelemetry(const wchar_t* url); } -#endif // BASE_DEBUG_UTIL_H_ +#endif // SGP_CRASH_REPORT_H_ diff --git a/sgp/crash_telemetry.cpp b/sgp/crash_telemetry.cpp index 21ff87494..f9bdf76a2 100644 --- a/sgp/crash_telemetry.cpp +++ b/sgp/crash_telemetry.cpp @@ -1,14 +1,14 @@ // Crash telemetry: upload the crash_report_*.txt files the crash handler left // behind, on the next launch. // -// Deliberately a separate translation unit from debug_win_util.cpp. Everything in +// Deliberately a separate translation unit from crash_report.cpp. Everything in // there runs inside a faulting thread and may not allocate; everything here runs at // startup with a healthy heap and is ordinary code. Keeping the two apart keeps the // no-heap rule easy to see and easy to hold. #if defined(_MSC_VER) -#include "debug_util.h" +#include "crash_report.h" #include #include diff --git a/sgp/sgp.cpp b/sgp/sgp.cpp index 539d6bfb4..27d07da94 100644 --- a/sgp/sgp.cpp +++ b/sgp/sgp.cpp @@ -629,7 +629,7 @@ static vfs::String getGameID() return _id; } -#include "debug_util.h" +#include "crash_report.h" #include "GameVersion.h" // czVersionString, stamped into crash reports #include