Re: [PATCH] Add Windows support for backtrace_functions (MSVC only) - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Date
Msg-id 7379da2a-10e1-4fb2-bd77-212daf4b00b8@app.fastmail.com
Whole thread Raw
In response to Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)  (Bryan Green <dbryan.green@gmail.com>)
Responses Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
List pgsql-hackers
On Mon, Oct 27, 2025, at 2:58 PM, Bryan Green wrote:
>     Thanks for even glancing at this.  I did not add any regression 
> tests because the output goes to the server log and not the client.
>

Since Michael said WIN32-specific tests and mentioned log pattern, he is
referring to TAP tests. You can add src/test/modules/test_backtrace that
exercises this code path.

I didn't test your patch but I'm wondering if we could add an abstraction here.
I mean invent pg_backtrace() and pg_backtrace_symbols() that maps to the
current functions (Unix-like). On Windows these functions are mapped to
win32_backtrace() (that encapsulates CaptureStackBackTrace()) and a new
win32_backtrace_symbols() (that encapsulates the rest of the code). There
Windows-specific functions should be added to src/port -- my suggestion is
win32backtrace.c. Besides that you have to adjust backtrace_symbols in both
configure.ac and meson.build so it runs the code path inside
HAVE_BACKTRACE_SYMBOLS.


-- 
Euler Taveira
EDB   https://www.enterprisedb.com/



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions
Next
From: Jim Jones
Date:
Subject: Re: display hot standby state in psql prompt