Show address of Main in stack traces

This beats main because that expands to SDL_main and leaves everyone confused.
This commit is contained in:
Tamás Bálint Misius 2024-10-05 22:14:13 +02:00
parent 07fa908102
commit 0c048a9d6e
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -100,8 +100,6 @@ void TickClient()
Client::Ref().Tick();
}
int main(int argc, char *argv[]);
static void BlueScreen(String detailMessage, std::optional<std::vector<String>> stackTrace)
{
auto &engine = ui::Engine::Ref();
@ -121,7 +119,7 @@ static void BlueScreen(String detailMessage, std::optional<std::vector<String>>
crashInfo << "Date: " << format::UnixtimeToDate(time(NULL), "%Y-%m-%dT%H:%M:%SZ", false).FromUtf8() << "\n";
if (stackTrace)
{
crashInfo << "Stack trace; main is at 0x" << Format::Hex() << intptr_t(main) << ":\n";
crashInfo << "Stack trace; Main is at 0x" << Format::Hex() << intptr_t(Main) << ":\n";
for (auto &item : *stackTrace)
{
crashInfo << " - " << item << "\n";