From d32873b717b84a585ce88c5f6a43641a75ce0dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Mon, 6 May 2024 17:23:18 +0200 Subject: [PATCH] Print address of main on bluescreens So we have at least some handle on the layout of the module/object's base address. Makes interpreting bare return addresses easier. --- src/PowderToy.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PowderToy.cpp b/src/PowderToy.cpp index f96409945..66ebd40a3 100644 --- a/src/PowderToy.cpp +++ b/src/PowderToy.cpp @@ -100,6 +100,8 @@ void TickClient() Client::Ref().Tick(); } +int main(int argc, char *argv[]); + static void BlueScreen(String detailMessage, std::optional> stackTrace) { auto &engine = ui::Engine::Ref(); @@ -119,7 +121,7 @@ static void BlueScreen(String detailMessage, std::optional> crashInfo << "Date: " << format::UnixtimeToDate(time(NULL), "%Y-%m-%dT%H:%M:%SZ", false).FromUtf8() << "\n"; if (stackTrace) { - crashInfo << "Stack trace:\n"; + crashInfo << "Stack trace; main is at 0x" << Format::Hex() << intptr_t(main) << ":\n"; for (auto &item : *stackTrace) { crashInfo << " - " << item << "\n";