Call arbitrary functions from the monitor
[akaros.git] / kern / include / kdebug.h
1 #ifndef ROS_KERN_KDEBUG_H
2 #define ROS_KERN_KDEBUG_H
3
4 #include <ros/common.h>
5
6 // Debug information about a particular instruction pointer
7 typedef struct Eipdebuginfo {
8         const char *NTS eip_file;               // Source code filename for EIP
9         int eip_line;                           // Source code linenumber for EIP
10
11         const char *NT COUNT(eip_fn_namelen) eip_fn_name;       // Name of function containing EIP
12                                                                 //  - Note: not null terminated!
13         int eip_fn_namelen;                     // Length of function name
14         uintptr_t eip_fn_addr;          // Address of start of function
15         int eip_fn_narg;                        // Number of function arguments
16 } eipdebuginfo_t;
17
18 int debuginfo_eip(uintptr_t eip, eipdebuginfo_t *NONNULL info);
19 void *debug_get_fn_addr(char *fn_name);
20
21 #endif