-
Notifications
You must be signed in to change notification settings - Fork 0
Measurer RLI
jgevargi edited this page Aug 5, 2015
·
5 revisions
(set_target 1590)
(measure (callstack))
Response : M{type:0,data=CG{(main (foo (bar (print)) print) (bar (print))))}}
To do this, we must create a hook which requires an event (aka trigger) and an action (a lazy expression). The event will be a reach on "main", (reach "main" 0)
, and the action will be lazy expression, '(store 1 (measure (var "A")))
.
note: Lazy expressions are denoted as follows: '<expr>
(hook (reach "main" 0 0) '(store 1 (measure (var "A"))))
(load 1)
Response : M{type:1,data="37"}
(quit)
Function | Arguments | Return | Description |
---|---|---|---|
detach | - | VOID | Detaches measurer from target. |
quit | - | VOID | Terminates measurer. |
set_target | STRING pid | VOID | Attaches measurer to a process by pid. |
Function | Arguments | Return | Description |
---|---|---|---|
callstack | - | FEATURE | Returns a the callstack feature. |
load | INT store_id | MEASUREMENT | Loads measurements in a store. |
measure | FEATURE f | MEASUREMENT | Measures a specific feature of target. |
measure_callstack | - | MEASUREMENT | Measures callstack of target. |
mem | STRING address, STRING format | FEATURE | Creates a feature for a specific memory address to be interpreted with a specific format. |
store | INT store_id, MEASUREMENT m | VOID | Stores a measurement away in a store. |
var | STRING var_name | FEATURE | Creates a feature for a specific target variable, by source code variable name. |
Function | Arguments | Return | Description |
---|---|---|---|
delay | INT delay, INT repeat | EVENT | Creates a timed event to delay for a specified time. |
disable | INT hook_id | VOID | Disables a hook. |
enable | INT hook_id | VOID | Enables a hook. |
hook | EVENT e, Expression a | INT | Creates a hook that associates an expression to evaluate when an event happens. |
kill | INT hook_id | VOID | Kill a hook. |
reach | STRING source_file, INT source_line, INT repeat | EVENT | Creates an event upon target reaching a specified code location, by source file and line number. |
reach_func | STRING func_name, INT repeat | EVENT | Creates an event upon target reaching a specified function, by source funciton name. |
Function | Arguments | Return | Description |
---|---|---|---|
eq | INT, INT | INT | Evaluates the equivalence of the arguments. |
if | INT, Anything, Anything | Anything | |
seq | Expression, ... | VOID | Evaluates arguments in sequence. |
Function | Arguments | Return | Description |
---|---|---|---|
gdb | STRING command | VOID | Executes a GDB command. |
Anything | VOID | Prints Anything to the screen. | |
print_context | - | VOID | Prints a bunch of info about the measurer's state. |
(hook <Event *e*> <Expression *a*>) -> <INT *hook_id*>
Creates a hook that associates an expression to evaluate when an event happens.
Examples:
(hook (reach "foo" 0) '(print "I'm at foo!"))