C++ Logo

std-proposals

Advanced search

Re: [std-proposals] #include <debug>

From: Jeremy Rifkin <rifkin.jer_at_[hidden]>
Date: Thu, 28 Nov 2024 12:41:15 -0600
> Here's a paper describing the beginnings of a new header file called
<debug> which would standardise debugging across all C++ compilers:

Hi Fredrick,
In case you aren't aware, C++26 is adding a <debugging> header
already. This header adds utilities for instrumenting code to help in
debugging: std::breakpoint, std::breakpoint_if_debugging, and
std::is_debugger_present. The functions you have proposed don't help
with making code more debuggable and seem too niche and not powerful
enough to help with anything debugging related at all. More context on
the motivation for these functions you are proposing would be helpful.
The is_executable_memory and is_readonly_memory functions are closest
to something I could imagine being useful, i.e. a standard library
function for checking permissions of a page, but, they're too
specialized.

Jeremy

On Wed, Nov 27, 2024 at 4:11 PM Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> Here's a paper describing the beginnings of a new header file called
> <debug> which would standardise debugging across all C++ compilers:
>
> http://www.virjacode.com/papers/stddebug.htm
>
> So far it has stuff for vtables, constructors, destructors. I can
> think of other stuff to put in it like:
>
> * is_immediate_jump : Checks the machine code pointed to by a function
> pointer to see if the first instruction is a jump, and if so, returns
> the address of the jump destination.
>
> * size_of_function : Returns the size in bytes of the machine code of
> a function (not sure if the object file containing the function's
> machine code always has the function's total size in bytes)
>
> * is_executable_memory : Returns true if code can be executed at the
> specified address
>
> * is_readonly_memory : Return true if the specified span<byte> points
> to memory which is either partially or fully readonly.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-11-28 18:41:27