[PATCH] libstdc++: detect DLLs on windows with

2024-05-16 Thread Björn Schäpers
From: Björn Schäpers libstdc++-v3/Changelog * acinclude.m4 (GLIBCXX_ENABLE_BACKTACE): Add check for tlhelp32.h, matching libbacktrace. * configure: Regenerate. * config.h.in: Regenerate. Signed-off-by: Björn Schäpers --- libstdc++-v3/acinclude.m4 | 4

Re: [PATCH 5/4] libbacktrace: improve getting debug information for loaded dlls

2024-05-02 Thread Björn Schäpers
Am 28.04.2024 um 20:16 schrieb Ian Lance Taylor: On Thu, Apr 25, 2024 at 1:15 PM Björn Schäpers wrote: Attached is the combined version of the two patches, only implementing the variant with the tlhelp32 API. Tested on x86 and x86_64 windows. Kind regards, Björn. A friendly ping

Re: [PATCH] Fix overwriting files with fs::copy_file on windows

2024-04-25 Thread Björn Schäpers
Am 24.03.2024 um 22:34 schrieb Björn Schäpers: From: Björn Schäpers This fixes i.e. https://github.com/msys2/MSYS2-packages/issues/1937 I don't know if I picked the right way to do it. When acceptable I think the declaration should be moved into ops-common.h, since then we could use stat_type

Re: [PATCH 5/4] libbacktrace: improve getting debug information for loaded dlls

2024-04-25 Thread Björn Schäpers
Am 15.03.2024 um 21:40 schrieb Björn Schäpers: Am 25.01.2024 um 23:04 schrieb Ian Lance Taylor: On Thu, Jan 25, 2024 at 11:53 AM Björn Schäpers wrote: Am 23.01.2024 um 23:37 schrieb Ian Lance Taylor: On Thu, Jan 4, 2024 at 2:33 PM Björn Schäpers wrote: Am 03.01.2024 um 00:12 schrieb

[PATCH] Fix overwriting files with fs::copy_file on windows

2024-03-24 Thread Björn Schäpers
From: Björn Schäpers This fixes i.e. https://github.com/msys2/MSYS2-packages/issues/1937 I don't know if I picked the right way to do it. When acceptable I think the declaration should be moved into ops-common.h, since then we could use stat_type and also use that in the commonly used function

Re: [PATCH 6/4] libbacktrace: Add loaded dlls after initialize

2024-03-15 Thread Björn Schäpers
Am 10.01.2024 um 13:34 schrieb Eli Zaretskii: Date: Tue, 9 Jan 2024 21:02:44 +0100 Cc: i...@google.com, gcc-patches@gcc.gnu.org, g...@gcc.gnu.org From: Björn Schäpers Am 07.01.2024 um 18:03 schrieb Eli Zaretskii: In that case, you an call either GetModuleHandeExA or GetModuleHandeExW

Re: [PATCH 5/4] libbacktrace: improve getting debug information for loaded dlls

2024-03-15 Thread Björn Schäpers
Am 25.01.2024 um 23:04 schrieb Ian Lance Taylor: On Thu, Jan 25, 2024 at 11:53 AM Björn Schäpers wrote: Am 23.01.2024 um 23:37 schrieb Ian Lance Taylor: On Thu, Jan 4, 2024 at 2:33 PM Björn Schäpers wrote: Am 03.01.2024 um 00:12 schrieb Björn Schäpers: Am 30.11.2023 um 20:53 schrieb Ian

Re: [PATCH 5/4] libbacktrace: improve getting debug information for loaded dlls

2024-01-25 Thread Björn Schäpers
Am 23.01.2024 um 23:37 schrieb Ian Lance Taylor: On Thu, Jan 4, 2024 at 2:33 PM Björn Schäpers wrote: Am 03.01.2024 um 00:12 schrieb Björn Schäpers: Am 30.11.2023 um 20:53 schrieb Ian Lance Taylor: On Fri, Jan 20, 2023 at 2:55 AM Björn Schäpers wrote: From: Björn Schäpers Fixes https

Re: [PATCH 4/4] libbacktrace: get debug information for loaded dlls

2024-01-23 Thread Björn Schäpers
Am 03.01.2024 um 00:12 schrieb Björn Schäpers: Am 30.11.2023 um 20:53 schrieb Ian Lance Taylor: On Fri, Jan 20, 2023 at 2:55 AM Björn Schäpers wrote: From: Björn Schäpers Fixes https://github.com/ianlancetaylor/libbacktrace/issues/53, except that libraries loaded after

Re: [PATCH 6/4] libbacktrace: Add loaded dlls after initialize

2024-01-09 Thread Björn Schäpers
Am 07.01.2024 um 18:03 schrieb Eli Zaretskii: Date: Sun, 7 Jan 2024 17:07:06 +0100 Cc: i...@google.com, gcc-patches@gcc.gnu.org, g...@gcc.gnu.org From: Björn Schäpers That was about GetModuleHandle, not about GetModuleHandleEx. For the latter, all Windows versions that support it also

Re: [PATCH 6/4] libbacktrace: Add loaded dlls after initialize

2024-01-07 Thread Björn Schäpers
Am 07.01.2024 um 15:46 schrieb Eli Zaretskii: [I re-added the other addressees, as I don' think you meant to make this discussion private between the two of us.] Yeah, that was a mistake. Date: Sun, 7 Jan 2024 12:58:29 +0100 From: Björn Schäpers Am 07.01.2024 um 07:50 schrieb Eli

Re: [PATCH 6/4] libbacktrace: Add loaded dlls after initialize

2024-01-06 Thread Björn Schäpers
Am 04.01.2024 um 23:33 schrieb Björn Schäpers: Am 03.01.2024 um 00:12 schrieb Björn Schäpers: Am 30.11.2023 um 20:53 schrieb Ian Lance Taylor: On Fri, Jan 20, 2023 at 2:55 AM Björn Schäpers wrote: From: Björn Schäpers Fixes https://github.com/ianlancetaylor/libbacktrace/issues/53, except

[PATCH 5/4] libbacktrace: improve getting debug information for loaded dlls

2024-01-04 Thread Björn Schäpers
Am 03.01.2024 um 00:12 schrieb Björn Schäpers: Am 30.11.2023 um 20:53 schrieb Ian Lance Taylor: On Fri, Jan 20, 2023 at 2:55 AM Björn Schäpers wrote: From: Björn Schäpers Fixes https://github.com/ianlancetaylor/libbacktrace/issues/53, except that libraries loaded after

Re: [PATCH 4/4] libbacktrace: get debug information for loaded dlls

2024-01-02 Thread Björn Schäpers
Am 30.11.2023 um 20:53 schrieb Ian Lance Taylor: On Fri, Jan 20, 2023 at 2:55 AM Björn Schäpers wrote: From: Björn Schäpers Fixes https://github.com/ianlancetaylor/libbacktrace/issues/53, except that libraries loaded after the backtrace_initialize are not handled. But as far as I can see

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-11-21 Thread Björn Schäpers
: gcc-patches@gcc.gnu.org, g...@gcc.gnu.org From: Björn Schäpers +#ifndef NOMINMAX +#define NOMINMAX +#endif Why is this part needed? Otherwise, LGTM, thanks. (But I'm don't have the approval rights, so please wait for Ian to chime in.)

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-11-20 Thread Björn Schäpers
Set the base_address of the module, to find the debug information on moved applications. Signed-off-by: Björn Schäpers --- libbacktrace/pecoff.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/libbacktrace/pecoff.c b/libbacktrace/pecoff.c index 56af4828

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-11-20 Thread Björn Schäpers
Hi, this is what I'm using with GCC 12 and 13 on my windows machines, rebased onto the current HEAD. Kind regards, Björn. Am 06.02.2023 um 01:22 schrieb Ian Lance Taylor: On Sun, Feb 5, 2023 at 1:21 AM Björn Schäpers wrote: Am 24.01.2023 um 19:32 schrieb Ian Lance Taylor: On Tue, Jan 24

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-02-05 Thread Björn Schäpers
Am 24.01.2023 um 19:32 schrieb Ian Lance Taylor: On Tue, Jan 24, 2023 at 10:12 AM Eli Zaretskii via Gcc-patches wrote: From: Ian Lance Taylor Date: Tue, 24 Jan 2023 09:58:10 -0800 Cc: g...@hazardy.de, gcc-patches@gcc.gnu.org, g...@gcc.gnu.org I'd rather that the patch look like the

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-24 Thread Björn Schäpers
Am 24.01.2023 um 17:52 schrieb Eli Zaretskii: From: Ian Lance Taylor Date: Tue, 24 Jan 2023 06:35:21 -0800 Cc: g...@hazardy.de, gcc-patches@gcc.gnu.org, g...@gcc.gnu.org On Windows it seems that MAX_PATH is not a true limit, as an extended length path may be up to 32767 bytes. The limit of

Re: [PATCH 1/4] libbacktrace: change all pc related variables to uintptr_t

2023-01-23 Thread Björn Schäpers
Am 20.01.2023 um 23:25 schrieb Ian Lance Taylor: On Fri, Jan 20, 2023 at 2:54 AM Björn Schäpers wrote: From: Björn Schäpers It's the right thing to do, since the PC shouldn't go out of the uintptr_t domain, and in backtrace_pcinfo the pc is uintptr_t. This is a preparation for a following

[PATCH 4/4] libbacktrace: get debug information for loaded dlls

2023-01-20 Thread Björn Schäpers
From: Björn Schäpers Fixes https://github.com/ianlancetaylor/libbacktrace/issues/53, except that libraries loaded after the backtrace_initialize are not handled. But as far as I can see that's the same for elf. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- * pecoff.c (coff_

[PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-20 Thread Björn Schäpers
From: Björn Schäpers This is actually needed so that libstdc++'s implementation to be able to work on windows. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- * configure.ac: Add a check for windows.h. * configure, config.h.in: Regenerate. * fileline.c:

[PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Björn Schäpers
From: Björn Schäpers Any underflow which might happen, will be countered by an overflow in dwarf.c. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- Fixes https://github.com/ianlancetaylor/libbacktrace/issues/89 and https://github.com/ianlancetaylor/libbacktrace/issues

[PATCH 1/4] libbacktrace: change all pc related variables to uintptr_t

2023-01-20 Thread Björn Schäpers
From: Björn Schäpers It's the right thing to do, since the PC shouldn't go out of the uintptr_t domain, and in backtrace_pcinfo the pc is uintptr_t. This is a preparation for a following patch. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- * dwarf.c: changed variables hold

[PATCH] libstdc++: Deliver names of C functions in

2022-12-13 Thread Björn Schäpers
From: Björn Schäpers One could add (), these are not part of __name. One could also try to check upfront if __cxa_demangle should be called at all. -- >8 -- Tested on i686-w64-mingw32. __cxa_demangle is only to demangle C++ names, for all C functions, extern "C" functions, and i

[PATCH] libstdc++: Deliver names of C functions in

2022-12-12 Thread Björn Schäpers
From: Björn Schäpers One could add (), these are not part of __name. One could also try to check upfront if __cxa_demangle should be called at all. -- >8 -- Tested on i686-w64-mingw32. __cxa_demangle is only to demangle C++ names, for all C functions, extern "C" functions, and i

[PATCH] libstdc++: Deliver names of C functions in

2022-12-12 Thread Björn Schäpers
From: Björn Schäpers One could add (), these are not part of __name. One could also try to check upfront if __cxa_demangle should be called at all. -- >8 -- Tested on i686-w64-mingw32. __cxa_demangle is only to demangle C++ names, for all C functions, extern "C" functions, and i

[PATCH] libstdc++: enable on windows

2022-12-12 Thread Björn Schäpers
From: Björn Schäpers libstdc++-v3/Changelog * acinclude.m4: Add check for windows.h. * acinclude.m4: Add pecoff as FORMAT_FILE. * config.h.in: Regenerate. * configure: Regenerate. * src/libbacktrace/Makefile.am: Regenerate. * src/libbacktrace

[PATCH 2/4] libbacktrace: detect executable path on windows

2022-12-06 Thread Björn Schäpers
From: Björn Schäpers This is actually needed so that libstdc++'s implementation to be able to work on windows. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- * configure.ac: Add a check for windows.h. * configure, config.h.in: Regenerate. * fileline.c:

[PATCH 3/4] libbacktrace: work with aslr on windows

2022-12-06 Thread Björn Schäpers
From: Björn Schäpers Any underflow which might happen, will be countered by an overflow in dwarf.c. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- Fixes https://github.com/ianlancetaylor/libbacktrace/issues/89 and https://github.com/ianlancetaylor/libbacktrace/issues

[PATCH 4/4] libbacktrace: get debug information for loaded dlls

2022-12-06 Thread Björn Schäpers
From: Björn Schäpers Fixes https://github.com/ianlancetaylor/libbacktrace/issues/53, except that libraries loaded after the backtrace_initialize are not handled. But as far as I can see that's the same for elf. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- * pecoff.c (coff_

[PATCH 1/4] libbacktrace: change all pc related variables to uintptr_t

2022-12-06 Thread Björn Schäpers
From: Björn Schäpers It's the right thing to do, since the PC shouldn't go out of the uintptr_t domain, and in backtrace_pcinfo the pc is uintptr_t. This is a preparation for a following patch. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- * dwarf.c: changed variables hold

Re: [PATCH] libstdc++: Add error handler for

2022-11-30 Thread Björn Schäpers
to be tested. Björn. Am 30.11.2022 um 07:04 schrieb François Dumont: Good catch, then we also need this patch. I still need to test it thought, just to make sure it compiles. Unless you have a nice way to force call to the error callback ? François On 29/11/22 22:41, Björn Schäpers wrote: From

Fwd: [PATCH] libstdc++: Add error handler for

2022-11-29 Thread Björn Schäpers
Weitergeleitete Nachricht Betreff: [PATCH] libstdc++: Add error handler for Datum: Tue, 29 Nov 2022 22:41:07 +0100 Von: Björn Schäpers An: gcc-patc...@gc.gnu.org, libstd...@gcc.gnu.org From: Björn Schäpers Not providing an error handler results in a nullpointer