-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support watchpoints (-W option) for global variables. This time it can only handle integer types. Signed-off-by: Namhyung Kim <namhyung@gmail.com>
- Loading branch information
Showing
13 changed files
with
346 additions
and
18 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
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
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,27 @@ | ||
#include <stdlib.h> | ||
|
||
volatile int mydata; | ||
|
||
void bar(int n) | ||
{ | ||
if (n) | ||
mydata = -1; | ||
} | ||
|
||
void foo(int n) | ||
{ | ||
mydata = 1; | ||
bar(n); | ||
mydata = 2; | ||
} | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
int n = 0; | ||
|
||
if (argc > 1) | ||
n = atoi(argv[1]); | ||
|
||
foo(n); | ||
return 0; | ||
} |
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,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import re | ||
|
||
from runtest import TestBase | ||
|
||
class TestCase(TestBase): | ||
def __init__(self): | ||
TestBase.__init__(self, 'watch-global', result=""" | ||
# DURATION TID FUNCTION | ||
[243156] | __monstartup() { | ||
[243156] | /* watch:var (mydata=0) */ | ||
2.803 us [243156] | } /* __monstartup */ | ||
0.621 us [243156] | __cxa_atexit(); | ||
[243156] | main() { | ||
[243156] | foo() { | ||
[243156] | /* watch:var (mydata=1) */ | ||
0.117 us [243156] | bar(); | ||
[243156] | /* watch:var (mydata=2) */ | ||
0.643 us [243156] | } /* foo */ | ||
0.938 us [243156] | } /* main */ | ||
""") | ||
|
||
def setup(self): | ||
self.option = '-W var:mydata' |
Oops, something went wrong.