Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Linux) Support breakpoint upon assertion failure. #372

Closed
wants to merge 3 commits into from

Conversation

roberth-k
Copy link

Add CATCH_PLATFORM_LINUX (based on presence of __LINUX__ or __linux__).
For this platform,

  • define a conditional check for debugger presence by having a temporary child PTRACE_ATTACH to its parent (failure should indicate a tracer (ie. debugger) is already present). Modified version of this.
  • based on that conditional, upon assertion failure
    • execute a Breakpoint Exception (x86) inline; or
    • raise SIGINT (other architectures; the breakpoint will occur somewhere inside raise()).

Add CATCH_PLATFORM_LINUX.
Naively raise int $3 or SIGINT when debugging (-b).
Create a child process and attempt to PTHREAD_ATTACH to parent. Failure will indicate a tracer (likely debugger) present.
@horenmar
Copy link
Member

I merged in #585, so I am closing this.

@horenmar horenmar closed this Jan 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants