Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2020-11-21 Thread François Dumont via Gcc-patches
Maybe this last patch that has been out for a while. Here it is again rebased as some symbols have been added since my last proposal. François On 14/10/20 6:10 pm, François Dumont wrote: After further testing this version was bugged because ld considered that __create_backtrace/__render_back

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2020-10-14 Thread François Dumont via Gcc-patches
After further testing this version was bugged because ld considered that __create_backtrace/__render_backtrace symbols existed several times in the different linked .o. I tried making those inline but it failed, __render_backtrace was not substituted anymore, only __create_backtrace was. The

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2020-10-08 Thread François Dumont via Gcc-patches
I eventually consider your last remark about using weak symbols to inject libbacktrace calls when _GLIBCXX_DEBUG_BACKTRACE is defined.     libstdc++: [_GLIBCXX_DEBUG] Integrate libbacktrace   Add _GLIBCXX_DEBUG_BACKTRACE macro to ask for a backtrace on _GLIBCXX_DEBUG     assertions using

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2019-06-13 Thread François Dumont
Here is a new proposal which I think take into account all your remarks. I discovered the great "%.*s" printf format so I was able to do some cleanup on the function name without any allocation. I also agree that counting the '>' or '<' is not reliable so I remove this and limit the cleanup t

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2019-06-07 Thread François Dumont
I forgot to comment on the chosen behavior of _GLIBCXX_DEBUG_BACKTRACE. So, if the user define it, it means that he has install libbacktrace on its system. However we silently ignore it if libbacktrace is eventually not supported. I think it is the simplest thing to do. I am not convinced by t

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2019-06-06 Thread Jonathan Wakely
On 06/06/19 22:33 +0200, François Dumont wrote: Here is what I come up with. Regarding allocation in print_function I would also prefer to avoid it. But this patch also aim at creating a backtrace_state object in case of UB so the alloc is perhaps not so important. I can't use string_view as

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2019-06-06 Thread François Dumont
Here is what I come up with. Regarding allocation in print_function I would also prefer to avoid it. But this patch also aim at creating a backtrace_state object in case of UB so the alloc is perhaps not so important. I can't use string_view as I need to modify it to display only a part of it

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2019-05-29 Thread Jonathan Wakely
On 23/05/19 07:39 +0200, François Dumont wrote: Hi     So here what I come up with.     _GLIBCXX_DEBUG_BACKTRACE controls the feature. If the user define it and there is a detectable issue with libbacktrace then I generate a compilation error. I want to avoid users defining it but having no

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2019-05-29 Thread Jonathan Wakely
On 23/05/19 07:39 +0200, François Dumont wrote: Hi     So here what I come up with.     _GLIBCXX_DEBUG_BACKTRACE controls the feature. If the user define it and there is a detectable issue with libbacktrace then I generate a compilation error. I want to avoid users defining it but having no

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2019-05-29 Thread Jonathan Wakely
On 29/05/19 19:45 +0200, François Dumont wrote: On 5/29/19 12:06 AM, Jonathan Wakely wrote: On 23/05/19 07:39 +0200, François Dumont wrote: Hi     So here what I come up with.     _GLIBCXX_DEBUG_BACKTRACE controls the feature. If the user define Thanks for making this opt-in. it and there

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2019-05-29 Thread François Dumont
On 5/29/19 12:06 AM, Jonathan Wakely wrote: On 23/05/19 07:39 +0200, François Dumont wrote: Hi     So here what I come up with.     _GLIBCXX_DEBUG_BACKTRACE controls the feature. If the user define Thanks for making this opt-in. it and there is a detectable issue with libbacktrace then I g

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2019-05-28 Thread Jonathan Wakely
On 23/05/19 07:39 +0200, François Dumont wrote: Hi     So here what I come up with.     _GLIBCXX_DEBUG_BACKTRACE controls the feature. If the user define Thanks for making this opt-in. it and there is a detectable issue with libbacktrace then I generate a compilation error. I want to avoid

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2019-05-22 Thread François Dumont
Hi     So here what I come up with.     _GLIBCXX_DEBUG_BACKTRACE controls the feature. If the user define it and there is a detectable issue with libbacktrace then I generate a compilation error. I want to avoid users defining it but having no backtrace in the end in the debug assertion.   

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2018-12-23 Thread François Dumont
On 12/21/18 10:03 PM, Jonathan Wakely wrote: On 21/12/18 22:47 +0200, Ville Voutilainen wrote: On Fri, 21 Dec 2018 at 22:35, Jonathan Wakely wrote: >    I also explcitely define BACKTRACE_SUPPORTED to 0 to make sure >libstdc++ has no libbacktrace dependency after usual build. I'm concerned

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2018-12-21 Thread Jonathan Wakely
On 21/12/18 22:47 +0200, Ville Voutilainen wrote: On Fri, 21 Dec 2018 at 22:35, Jonathan Wakely wrote: >I also explcitely define BACKTRACE_SUPPORTED to 0 to make sure >libstdc++ has no libbacktrace dependency after usual build. I'm concerned about the requirement to link to libbacktrace

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2018-12-21 Thread Ville Voutilainen
On Fri, 21 Dec 2018 at 22:35, Jonathan Wakely wrote: > >I also explcitely define BACKTRACE_SUPPORTED to 0 to make sure > >libstdc++ has no libbacktrace dependency after usual build. > I'm concerned about the requirement to link to libbacktrace > explicitly (which will break existing makefiles

Re: libbacktrace integration for _GLIBCXX_DEBUG mode

2018-12-21 Thread Jonathan Wakely
On 11/12/18 00:08 +0100, François Dumont wrote: Hi     Here is the integration of libbacktrace to provide the backtrace on _GLIBCXX_DEBUG assertions.     I decided to integrate it without impacting the build scripts. Users just need to install libbacktrace and once done _GLIBCXX_DEBUG will

libbacktrace integration for _GLIBCXX_DEBUG mode

2018-12-10 Thread François Dumont
Hi     Here is the integration of libbacktrace to provide the backtrace on _GLIBCXX_DEBUG assertions.     I decided to integrate it without impacting the build scripts. Users just need to install libbacktrace and once done _GLIBCXX_DEBUG will look for it and start using it if supported. The