diff options
author | jistone <jistone> | 2007-02-06 22:55:59 +0000 |
---|---|---|
committer | jistone <jistone> | 2007-02-06 22:55:59 +0000 |
commit | 88b3808b6ce58165aa4c526eafca3dc08daf8f88 (patch) | |
tree | ebbc6c1deee029efbb2134a4d2361b2653e9f9fe /testsuite/systemtap.base | |
parent | f902d9596b3f7ee135d180ec0bae01c05d9a97bd (diff) | |
download | systemtap-steved-88b3808b6ce58165aa4c526eafca3dc08daf8f88.tar.gz systemtap-steved-88b3808b6ce58165aa4c526eafca3dc08daf8f88.tar.xz systemtap-steved-88b3808b6ce58165aa4c526eafca3dc08daf8f88.zip |
2007-02-06 Josh Stone <joshua.i.stone@intel.com>
runtime/
* loc2c-runtime.h (kread): Let it work with const types.
testsuite/
* systemtap.base/deref.stp: Test kread with const sources.
Diffstat (limited to 'testsuite/systemtap.base')
-rw-r--r-- | testsuite/systemtap.base/deref.stp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/deref.stp b/testsuite/systemtap.base/deref.stp index d2399589..b003d657 100644 --- a/testsuite/systemtap.base/deref.stp +++ b/testsuite/systemtap.base/deref.stp @@ -14,6 +14,12 @@ probe end(1) { log_test("kread u64", kread_u64()) log_test("kread ptr", kread_ptr()) + log_test("kread const u8", kread_const_u8()) + log_test("kread const u16", kread_const_u16()) + log_test("kread const u32", kread_const_u32()) + log_test("kread const u64", kread_const_u64()) + log_test("kread const ptr", kread_const_ptr()) + log_test("kwrite u8", kwrite_u8()) log_test("kwrite u16", kwrite_u16()) log_test("kwrite u32", kwrite_u32()) @@ -58,6 +64,36 @@ function kread_ptr:long() %{ CATCH_DEREF_FAULT(); %} +function kread_const_u8:long() %{ + const uint8_t local = 0x42; + THIS->__retvalue = (local == kread(&local)); + CATCH_DEREF_FAULT(); +%} + +function kread_const_u16:long() %{ + const uint16_t local = 0xBEEF; + THIS->__retvalue = (local == kread(&local)); + CATCH_DEREF_FAULT(); +%} + +function kread_const_u32:long() %{ + const uint32_t local = 0xDEADBEEF; + THIS->__retvalue = (local == kread(&local)); + CATCH_DEREF_FAULT(); +%} + +function kread_const_u64:long() %{ + const uint64_t local = 0xDEADBEEFBAADF00DLL; + THIS->__retvalue = (local == kread(&local)); + CATCH_DEREF_FAULT(); +%} + +function kread_const_ptr:long() %{ + const struct task_struct *local = current; + THIS->__retvalue = (local == kread(&local)); + CATCH_DEREF_FAULT(); +%} + // NB: kwrite uses system macros with inline asm, with this comment: // // Tell gcc we read from memory instead of writing: this is because we do not |