ianlancetaylor / libbacktrace

A C library that may be linked into a C/C++ program to produce symbolic backtraces
Other
944 stars 220 forks source link

libbacktrace: Guess executable name using _pgmptr on windows #112

Closed anarazel closed 1 year ago

anarazel commented 1 year ago

I had written a version using GetModuleFileNameA() when I noticed the reference to _pgmptr in its documentation. That's even easier.

It's noisy to renumber the passes in fileline_initialize(), but without doing so, the windows code can't be tested with wine. On wine /proc/self/exe can be opened, but points to the wine binary.

See also #111

ianlancetaylor commented 1 year ago

Thanks. I've committed this change to the main GCC repo and mirrored it back here.

anarazel commented 1 year ago

Thanks!