Date: Thu, 21 Nov 2024 11:37:02 +0000
On Wed, Nov 20, 2024 at 11:19 PM Thiago Macieira wrote:
>
> Debugging is a toolchain issue. As we've discussed before, there are tools to
> achieve this when debugging that don't require a language change and thus have
> a much, much lower barrier of acceptance.
If debugging were a toolchain issue and nothing to do with the C++
Standard, then we wouldn't have NDEBUG.
I think the Standard could really do with a header called <debug>
which has a few functions like:
template<class T> requires is_polymorphic_v< remove_cvref_t<T> >
consteval size_t get_vptr_offset(void);
template<class T> requires is_polymorphic_v< remove_cvref_t<T> >
void const *get_vtable_pointer(T&&);
type_info const &get_typeinfo_of_polymorphic_object(void *p, size_t offset);
Having functions like this could standardise debugging across a range
of compilers.
> Mucking with code that the author didn't want you to muck is not something we
> should encourage either.
And I probably shouldn't have a spurious oil filter on my 2012 Honda
Civic. Whatever.
>
> Debugging is a toolchain issue. As we've discussed before, there are tools to
> achieve this when debugging that don't require a language change and thus have
> a much, much lower barrier of acceptance.
If debugging were a toolchain issue and nothing to do with the C++
Standard, then we wouldn't have NDEBUG.
I think the Standard could really do with a header called <debug>
which has a few functions like:
template<class T> requires is_polymorphic_v< remove_cvref_t<T> >
consteval size_t get_vptr_offset(void);
template<class T> requires is_polymorphic_v< remove_cvref_t<T> >
void const *get_vtable_pointer(T&&);
type_info const &get_typeinfo_of_polymorphic_object(void *p, size_t offset);
Having functions like this could standardise debugging across a range
of compilers.
> Mucking with code that the author didn't want you to muck is not something we
> should encourage either.
And I probably shouldn't have a spurious oil filter on my 2012 Honda
Civic. Whatever.
Received on 2024-11-21 11:37:14