-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate SIGTRAP to client during diversion
Changes DiversionSession to propagate a SIGTRAP received by the target process to the client, as a signal, when it was not produced by a debugger breakpoint, a singlestep operation or a watchpoint.
- Loading branch information
1 parent
79ac37a
commit 4f99ff0
Showing
5 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* -*- Mode: C; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */ | ||
|
||
#include "util.h" | ||
|
||
static __attribute__((noinline)) void breakpoint(void) { | ||
int break_here = 1; | ||
(void)break_here; | ||
} | ||
|
||
static __attribute__((noinline)) int hardware_breakpoint(void) { | ||
asm("int3;"); | ||
return 10; | ||
} | ||
|
||
int main(void) { | ||
breakpoint(); | ||
hardware_breakpoint(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from util import * | ||
import re, sys | ||
|
||
send_gdb('b breakpoint') | ||
expect_gdb('Breakpoint 1') | ||
|
||
send_gdb('c') | ||
expect_gdb('Breakpoint 1') | ||
|
||
send_gdb('p hardware_breakpoint()') | ||
expect_gdb('Program received signal SIGTRAP') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source `dirname $0`/util.sh | ||
record $TESTNAME | ||
debug_test |