Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)

Peter Eisentraut <peter_e@gmx.net>

From: Peter Eisentraut <peter_e@gmx.net>
To: Magnus Hagander <magnus@hagander.net>
Cc: Craig Ringer <craig@postnewspapers.com.au>, pgsql-hackers@postgresql.org
Date: 2011-07-10T20:23:58Z
Lists: pgsql-hackers
On tor, 2010-12-16 at 15:16 +0100, Magnus Hagander wrote:
> Found another problem in it: when running with an older version of
> dbghelp.dll (which I was), it simply didn't work. We need to grab the
> version of dbghelp.dll at runtime and pick which things we're going to
> dump based on that.
> 
> The attached version of the patch does that. Can you please test that
> it still generates the full dump on your system, which supposedly has
> a much more modern version of dbghelp.dll than mine?

I was going through the GetLastError() calls to unify the printf
formats, as discussed, and I stumbled across this:

+               write_stderr("could not write crash dump to %s: error code %08x\n",
+                            dumpPath, GetLastError());

Is there a reason why this uses that particular format, unlike all other
call sites?