diff options
Diffstat (limited to 'tapset/context.stp')
-rw-r--r-- | tapset/context.stp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tapset/context.stp b/tapset/context.stp index dc560316..10c52226 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -136,6 +136,22 @@ function probemod:string () %{ /* pure */ } %} +function registers_valid:long () %{ /* pure */ + THIS->__retvalue = (CONTEXT->regs != NULL); +%} + +function user_mode:long () %{ /* pure */ /* currently a user-mode address? */ + if (CONTEXT->regs) { +#if defined(__i386__) || defined(__x86_64__) + THIS->__retvalue = (uint64_t) user_mode_vm (CONTEXT->regs); +#else + THIS->__retvalue = (uint64_t) user_mode (CONTEXT->regs); +#endif + } else { + THIS->__retvalue = 0; + } +%} + function is_return:long () %{ /* pure */ if (CONTEXT->pi) THIS->__retvalue = 1; |