vmap_pmem_nocache()
[akaros.git] / kern / arch / x86 / kdebug.h
index 291d8c4..2a733c1 100644 (file)
 
 #include <stdio.h>
 
+// Debug information about a particular instruction pointer
+typedef struct eipdebuginfo {
+       const char *eip_file;           // Source code filename for EIP
+       int eip_line;                           // Source code linenumber for EIP
+
+       const char *eip_fn_name;        // Name of function containing EIP
+                                                               //  - Note: not null terminated!
+       int eip_fn_namelen;                     // Length of function name
+       uintptr_t eip_fn_addr;          // Address of start of function
+       int eip_fn_narg;                        // Number of function arguments
+} eipdebuginfo_t;
+
+int debuginfo_eip(uintptr_t eip, eipdebuginfo_t *NONNULL info);
+void *debug_get_fn_addr(char *fn_name);
+
 /* Returns a PC/EIP in the function that called us, preferably near the call
  * site.  Returns 0 when we can't jump back any farther. */
 static inline uintptr_t get_caller_pc(void)
 {
-       uint32_t *ebp = (uint32_t*)read_ebp();
+       unsigned long *ebp = (unsigned long*)read_bp();
        if (!ebp)
                return 0;
        /* this is part of the way back into the call() instruction's bytes