-
Notifications
You must be signed in to change notification settings - Fork 0
/
gdb-section-init.c
34 lines (33 loc) · 1.01 KB
/
gdb-section-init.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//#include "symcat.h"
//#include "gdb/section-scripts.h"
/*
// ELF
asm(
".pushsection \".debug_gdb_scripts\", \"MS\",@progbits,1\n"
".byte 4\n"
".ascii \"gdb.inlined-script\\n\"\n"
".ascii \"class test_cmd (gdb.Command):\\n\"\n"
".ascii \" def __init__ (self):\\n\"\n"
".ascii \" super (test_cmd, self).__init__ ("
"\\\"test-cmd\\\", gdb.COMMAND_OBSCURE)\\n\"\n"
".ascii \" def invoke (self, arg, from_tty):\\n\"\n"
".ascii \" print (\\\"test-cmd output, arg = %s\\\" % arg)\\n\"\n"
".ascii \"test_cmd ()\\n\"\n"
".byte 0\n"
".popsection\n"
);
*/
asm(
".pushsection \".gdb_scripts\", \"MS\",1\n"
".byte 4\n"
".ascii \"gdb.inlined-script\\n\"\n"
".ascii \"class test_cmd (gdb.Command):\\n\"\n"
".ascii \" def __init__ (self):\\n\"\n"
".ascii \" super (test_cmd, self).__init__ ("
"\\\"test-cmd\\\", gdb.COMMAND_OBSCURE)\\n\"\n"
".ascii \" def invoke (self, arg, from_tty):\\n\"\n"
".ascii \" print (\\\"test-cmd output, arg = %s\\\" % arg)\\n\"\n"
".ascii \"test_cmd ()\\n\"\n"
".byte 0\n"
".popsection\n"
);