|
|
1.1 root 1: #ifndef _MY_BREAK_H
2: #define _MY_BREAK_H
3:
4: #include <linux/sched.h>
5:
6: #define BREAK_NOW my_break_now(__PRETTY_FUNCTION__);
7:
8: #define get_esp() ({int a_sp; __asm__ ("mov %%esp,%0":"=r"(a_sp)); a_sp;})
9:
10: struct wait_queue * my_break_wait=NULL;
11:
12: static void my_break_cont(void)
13: { wake_up(&my_break_wait);
14: }
15:
16: static void my_break_now(char * s)
17: { unsigned call_pc;
18: unsigned call_sp;
19: call_pc=(typeof(call_pc))__builtin_return_address(0);
20: call_sp=(typeof(call_sp))get_esp();
21: printk ("BREAK : procces %i (current=0x%x) stopped at 0x%x in %s\n",
22: current->pid,(unsigned)current,call_pc,s);
23: printk ("BREAK : sp = 0x%x\n",call_sp);
24: printk ("BREAK : for continue call *0x%x()\n",
25: (unsigned)&my_break_cont);
26: sleep_on(&my_break_wait);
27: printk ("BREAK : continuing\n");
28: }
29:
30: #endif /* _MY_BREAK_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.