C++ Logo

sg15

Advanced search

Re: [SG15] breakpoint and is_debugger_present proposals.

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Wed, 5 Jan 2022 11:53:09 +0000
On Wed, 5 Jan 2022 at 11:04, Daniel Ruoso <daniel_at_[hidden]> wrote:

> On Tue, Jan 4, 2022, 21:20 Jonathan Wakely via SG15 <sg15_at_[hidden]>
> wrote:
>
>> It looks like the only implementation experience for linux is Unreal
>> Engine 4, assuming that does actually work for linux.
>> https://github.com/scottt/debugbreak is a much better reference
>> implementation
>>
>
> I think this is a crucial point.
>
> It's not clear to me what a breakpoint outside of a debugger would do.
> Would it send itself a sigstop?
>

SIGTRAP, which terminates with a core dump by default. That's why you
*usually* want the conditional breakpoint that checks whether the process
is being traced. When the process is being traced (which is POSIX speak for
controlled by a debugger or similar program) the SIGTRAP will be
intercepted by the tracer, and won't kill the tracee (unless the tracer
passes it on to the tracee).


> Having a fully fleshed out implementation for the major compilers and
> operating systems would probably be a requirement for this to be evaluated
> in a more informed way.
>
> Daniel
>

Received on 2022-01-05 05:53:23