-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gdbinit
52 lines (47 loc) · 1.44 KB
/
.gdbinit
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
set unwindonsignal on
define ds
set $code = findNativeCodeAtIc($arg0)
set $method = 0
set $block = 0
set $source = 0
if (((RawObject *) $code->compiledCode)->class == Handles.CompiledMethod->raw)
set $method = (RawCompiledMethod *) $code->compiledCode
set $source = (RawSourceCode *) asObject($method->sourceCode)
else
set $block = (RawCompiledBlock *) $code->compiledCode
set $method = (RawCompiledMethod *) asObject($block->method)
set $source = (RawSourceCode *) asObject($block->sourceCode)
end
set $class = (RawClass *) asObject($method->ownerClass)
set $selector = (RawString *) asObject($method->selector)
printClass $class
printf "#%s ", $selector->contents
if $block
printf "[] "
end
printSourceCode $source
printf "\n"
disassemble $code->insts, $code->insts + $code->size
end
define rawds
set $code = findNativeCodeAtIc($arg0)
disassemble $code->insts, $code->insts + $code->size
end
define printClass
set $class = (RawClass *) $arg0
if $class->class == Handles.MetaClass->raw
set $class = (RawClass *) asObject(((RawMetaClass *) $arg0)->instanceClass)
end
set $name = (RawString *) asObject($class->name)
printf "%s", $name->contents
if $arg0->class == Handles.MetaClass->raw
printf " class"
end
end
define printSourceCode
set $sName = (RawString *) asObject($arg0->sourceOrFileName)
printf "%s:%li:%li", $sName->contents, asCInt($arg0->line), asCInt($arg0->column)
end
define parentbp
p/x ((Value *) $arg0)[0]
end