mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
549 lines
25 KiB
Plaintext
549 lines
25 KiB
Plaintext
NAME=dwarf5crash
|
||
FILE=bins/elf/dwarf/dwarf5-crash
|
||
CMDS=<<EOF
|
||
CL
|
||
EOF
|
||
EXPECT=<<EOF
|
||
file: ../../../src/libgcc/config/i386/crtfastmath.c
|
||
line: 84
|
||
colu: 1
|
||
addr: 0x00001050
|
||
file: ../../../src/libgcc/config/i386/crtfastmath.c
|
||
line: 94
|
||
colu: 3
|
||
addr: 0x00001054
|
||
file: ../../../src/libgcc/config/i386/crtfastmath.c
|
||
line: 95
|
||
colu: 3
|
||
addr: 0x00001059
|
||
file: ../../../src/libgcc/config/i386/crtfastmath.c
|
||
line: 96
|
||
colu: 3
|
||
addr: 0x00001061
|
||
file: ../../../src/libgcc/config/i386/crtfastmath.c
|
||
line: 98
|
||
colu: 1
|
||
addr: 0x00001066
|
||
file: ../../../src/libgcc/config/i386/crtfastmath.c
|
||
line: 98
|
||
colu: 1
|
||
addr: 0x00001067
|
||
EOF
|
||
RUN
|
||
|
||
NAME="ansi injection via dwarf"
|
||
FILE=bins/elf/dwarf_test_func_patched
|
||
ARGS=-AA
|
||
CMDS=<<EOF
|
||
CL
|
||
xc
|
||
EOF
|
||
EXPECT=<<EOF
|
||
file: /_test.c
|
||
line: 6
|
||
colu: 1
|
||
addr: 0x00001165
|
||
file: /_test.c
|
||
line: 11
|
||
colu: 1
|
||
addr: 0x00001184
|
||
file: /_test.c
|
||
line: 11
|
||
colu: 1
|
||
addr: 0x00001186
|
||
file: /_test.c
|
||
line: 5
|
||
colu: 5
|
||
addr: 0x00001159
|
||
file: /_test.c
|
||
line: 8
|
||
colu: 12
|
||
addr: 0x00001168
|
||
file: /_test.c
|
||
line: 4
|
||
colu: 28
|
||
addr: 0x00001149
|
||
file: /_test.c
|
||
line: 9
|
||
colu: 5
|
||
addr: 0x00001170
|
||
file: /_test.c
|
||
line: 10
|
||
colu: 12
|
||
addr: 0x0000117f
|
||
- offset - 6061 6263 6465 6667 6869 6A6B 6C6D 6E6F 0123456789ABCDEF comment
|
||
0x00001060 f30f 1efa 31ed 4989 d15e 4889 e248 83e4 ....1.I..^H..H.. ; rip ; [16] -r-x section size 294 named .text ; arg3
|
||
0x00001070 f050 5445 31c0 31c9 488d 3de9 0000 00ff .PTE1.1.H.=.....
|
||
0x00001080 1553 2f00 00f4 662e 0f1f 8400 0000 0000 .S/...f.........
|
||
0x00001090 488d 3d79 2f00 0048 8d05 722f 0000 4839 H.=y/..H..r/..H9 ; sym.deregister_tm_clones
|
||
0x000010a0 f874 1548 8b05 362f 0000 4885 c074 09ff .t.H..6/..H..t..
|
||
0x000010b0 e00f 1f80 0000 0000 c30f 1f80 0000 0000 ................
|
||
0x000010c0 488d 3d49 2f00 0048 8d35 422f 0000 4829 H.=I/..H.5B/..H) ; sym.register_tm_clones
|
||
0x000010d0 fe48 89f0 48c1 ee3f 48c1 f803 4801 c648 .H..H..?H...H..H
|
||
0x000010e0 d1fe 7414 488b 0505 2f00 0048 85c0 7408 ..t.H.../..H..t.
|
||
0x000010f0 ffe0 660f 1f44 0000 c30f 1f80 0000 0000 ..f..D..........
|
||
0x00001100 f30f 1efa 803d 052f 0000 0075 2b55 4883 .....=./...u+UH. ; sym.__do_global_dtors_aux
|
||
0x00001110 3de2 2e00 0000 4889 e574 0c48 8b3d e62e =.....H..t.H.=..
|
||
0x00001120 0000 e819 ffff ffe8 64ff ffff c605 dd2e ........d.......
|
||
0x00001130 0000 015d c30f 1f00 c30f 1f80 0000 0000 ...]............
|
||
0x00001140 f30f 1efa e977 ffff fff3 0f1e fa55 4889 .....w.......UH. ; sym.frame_dummy ; dbg._func ; void _func(char * msg);
|
||
0x00001150 e548 83ec 1048 897d f848 8b45 f848 89c7 .H...H.}.H.E.H.. ; arg1 ; const char *s
|
||
EOF
|
||
RUN
|
||
|
||
NAME="open companion file for macho dwarf"
|
||
FILE=bins/mach0/dwarf/a.out
|
||
CMDS=<<EOF
|
||
CL
|
||
EOF
|
||
EXPECT=<<EOF
|
||
file: /Users/pancake/hello.c
|
||
line: 2
|
||
colu: 0
|
||
addr: 0x100003f64
|
||
file: /Users/pancake/hello.c
|
||
line: 5
|
||
colu: 2
|
||
addr: 0x100003f80
|
||
file: /Users/pancake/hello.c
|
||
line: 0
|
||
colu: 0
|
||
addr: 0x100003f78
|
||
file: /Users/pancake/hello.c
|
||
line: 0
|
||
colu: 0
|
||
addr: 0x100003f6c
|
||
file: /Users/pancake/hello.c
|
||
line: 3
|
||
colu: 2
|
||
addr: 0x100003f74
|
||
file: /Users/pancake/hello.c
|
||
line: 6
|
||
colu: 1
|
||
addr: 0x100003f90
|
||
file: /Users/pancake/hello.c
|
||
line: 6
|
||
colu: 1
|
||
addr: 0x100003f88
|
||
EOF
|
||
RUN
|
||
|
||
NAME="pdf dwarf invalid main for analysis not found (aa)"
|
||
FILE=bins/src/dwarftest
|
||
CMDS=<<EOF
|
||
e asm.dwarf=true
|
||
e anal.nopskip=true # if set to true it fucks the test
|
||
aa
|
||
pd 1 @main
|
||
EOF
|
||
EXPECT=<<EOF
|
||
; DATA XREF from entry0 @ 0x40045d(r)
|
||
/ 44: int main (int argc, char **argv, char **envp);
|
||
| ; var int64_t var_4h @ rbp-0x4
|
||
| 0x0040052d 55 push rbp ; dwarftest.c:4
|
||
EOF
|
||
RUN
|
||
|
||
NAME="Mach-O dSYM lines (armv7)"
|
||
FILE=bins/mach0/TestRTTI-armv7-dSYM
|
||
CMDS=<<EOF
|
||
CL 0x0000a24e
|
||
EOF
|
||
EXPECT=<<EOF
|
||
file: /Users/ftamagni/src/TestRTTI/TestRTTI//TestRTTI.cpp
|
||
line: 18
|
||
colu: 0
|
||
addr: 0x0000a24e
|
||
EOF
|
||
RUN
|
||
|
||
NAME="Mach-O dSYM symbols (armv7)"
|
||
FILE=bins/mach0/TestRTTI-armv7-dSYM
|
||
CMDS=<<EOF
|
||
is~main[1]
|
||
EOF
|
||
EXPECT=<<EOF
|
||
0x00006376
|
||
EOF
|
||
RUN
|
||
|
||
NAME="function info integration c++"
|
||
FILE=bins/elf/dwarf3_many_comp_units.elf
|
||
CMDS=<<EOF
|
||
e asm.dwarf=false
|
||
aaa
|
||
pd 13 @ main
|
||
EOF
|
||
EXPECT=<<EOF
|
||
;-- main:
|
||
; DATA XREF from entry0 @ 0x10c1(r)
|
||
/ 139: int dbg.main (int argc, char **argv, char **envp);
|
||
| ; var Mammal *m @ rbp-0x18
|
||
| ; var Bird *b @ rbp-0x20
|
||
| ; var int output @ rbp-0x24
|
||
| 0x0000123b f30f1efa endbr64 ; int main();
|
||
| 0x0000123f 55 push rbp
|
||
| 0x00001240 4889e5 mov rbp, rsp
|
||
| 0x00001243 53 push rbx
|
||
| 0x00001244 4883ec28 sub rsp, 0x28
|
||
| 0x00001248 bf08000000 mov edi, 8
|
||
| 0x0000124d e81efeffff call sym.imp.operator_new_unsigned_long_
|
||
| 0x00001252 4889c3 mov rbx, rax
|
||
| 0x00001255 4889df mov rdi, rbx ; int64_t arg1
|
||
| 0x00001258 e827010000 call dbg.Bird::Bird()
|
||
| 0x0000125d 48895de0 mov qword [b], rbx
|
||
| 0x00001261 bf08000000 mov edi, 8
|
||
| 0x00001266 e805feffff call sym.imp.operator_new_unsigned_long_
|
||
EOF
|
||
RUN
|
||
|
||
|
||
NAME="function info integration 1 rust"
|
||
FILE=bins/elf/dwarf_rust_bubble
|
||
CMDS=<<EOF
|
||
e asm.dwarf=false
|
||
aaa
|
||
pd 75 @ dbg.main
|
||
EOF
|
||
EXPECT=<<EOF
|
||
;-- rust::main::h523dcf5432fcfd88:
|
||
; DATA XREF from main @ 0x5b0d(r)
|
||
/ 940: int dbg.main (int argc, char **argv);
|
||
| ; var int64_t var_8h @ rsp+0x8
|
||
| ; var int64_t var_10h @ rsp+0x10
|
||
| ; var int64_t var_18h @ rsp+0x18
|
||
| ; var int64_t var_20h @ rsp+0x20
|
||
| ; var int64_t var_28h @ rsp+0x28
|
||
| ; var int64_t var_30h @ rsp+0x30
|
||
| ; var int64_t var_38h @ rsp+0x38
|
||
| ; var int64_t var_40h @ rsp+0x40
|
||
| ; var int64_t var_48h @ rsp+0x48
|
||
| ; var int64_t var_50h @ rsp+0x50
|
||
| ; var int64_t var_58h @ rsp+0x58
|
||
| ; var int64_t var_60h @ rsp+0x60
|
||
| ; var int64_t var_68h @ rsp+0x68
|
||
| ; var int64_t var_70h @ rsp+0x70
|
||
| ; var int64_t var_78h @ rsp+0x78
|
||
| ; var i32[11] numbers @ rsp+0x80
|
||
| ; var int64_t var_84h @ rsp+0x84
|
||
| ; var int64_t var_88h @ rsp+0x88
|
||
| ; var int64_t var_8ch @ rsp+0x8c
|
||
| ; var int64_t var_90h @ rsp+0x90
|
||
| ; var int64_t var_94h @ rsp+0x94
|
||
| ; var int64_t var_98h @ rsp+0x98
|
||
| ; var int64_t var_9ch @ rsp+0x9c
|
||
| ; var int64_t var_a0h @ rsp+0xa0
|
||
| ; var int64_t var_a4h @ rsp+0xa4
|
||
| ; var int64_t var_a8h @ rsp+0xa8
|
||
| ; var int64_t var_d8h @ rsp+0xd8
|
||
| ; var int64_t var_e0h @ rsp+0xe0
|
||
| ; var int64_t var_e8h @ rsp+0xe8
|
||
| ; var int64_t var_f0h @ rsp+0xf0
|
||
| ; var int64_t var_120h @ rsp+0x120
|
||
| ; var int64_t var_128h @ rsp+0x128
|
||
| ; var int64_t var_130h @ rsp+0x130
|
||
| ; var &str[6] strings @ rsp+0x138
|
||
| ; var int64_t var_140h @ rsp+0x140
|
||
| ; var int64_t var_148h @ rsp+0x148
|
||
| ; var int64_t var_150h @ rsp+0x150
|
||
| ; var int64_t var_158h @ rsp+0x158
|
||
| ; var int64_t var_160h @ rsp+0x160
|
||
| ; var int64_t var_168h @ rsp+0x168
|
||
| ; var int64_t var_170h @ rsp+0x170
|
||
| ; var int64_t var_178h @ rsp+0x178
|
||
| ; var int64_t var_180h @ rsp+0x180
|
||
| ; var int64_t var_188h @ rsp+0x188
|
||
| ; var int64_t var_1b8h @ rsp+0x1b8
|
||
| ; var int64_t var_1c0h @ rsp+0x1c0
|
||
| ; var int64_t var_1c8h @ rsp+0x1c8
|
||
| ; var int64_t var_1d0h @ rsp+0x1d0
|
||
| ; var int64_t var_200h @ rsp+0x200
|
||
| ; var int64_t var_208h @ rsp+0x208
|
||
| ; var int64_t var_210h @ rsp+0x210
|
||
| ; var int64_t var_218h @ rsp+0x218
|
||
| ; var int64_t var_220h @ rsp+0x220
|
||
| ; var int64_t var_228h @ rsp+0x228
|
||
| ; var &str[6] *arg0 @ rsp+0x230
|
||
| 0x00005750 4881ec3802.. sub rsp, 0x238 ; void main();
|
||
| 0x00005757 c784248000.. mov dword [numbers], 8
|
||
| 0x00005762 c784248400.. mov dword [var_84h], 7
|
||
| 0x0000576d c784248800.. mov dword [var_88h], 1
|
||
| 0x00005778 c784248c00.. mov dword [var_8ch], 2
|
||
| 0x00005783 c784249000.. mov dword [var_90h], 9
|
||
| 0x0000578e c784249400.. mov dword [var_94h], 3
|
||
| 0x00005799 c784249800.. mov dword [var_98h], 4
|
||
| 0x000057a4 c784249c00.. mov dword [var_9ch], 5
|
||
| 0x000057af c78424a000.. mov dword [var_a0h], 0
|
||
| 0x000057ba c78424a400.. mov dword [var_a4h], 6
|
||
| 0x000057c5 488b05842b.. mov rax, qword [0x00038350] ; [0x38350:8]=0x38330
|
||
| 0x000057cc 488d8c2480.. lea rcx, [numbers]
|
||
| 0x000057d4 48898c24e8.. mov qword [var_e8h], rcx
|
||
| 0x000057dc 488b8c24e8.. mov rcx, qword [var_e8h]
|
||
| 0x000057e4 48898c2418.. mov qword [var_218h], rcx
|
||
| 0x000057ec 4889cf mov rdi, rcx ; int64_t arg1
|
||
| 0x000057ef 488d35da0f.. lea rsi, [sym.core::array::__impl_core::fmt::Debug_for__T_____::fmt::h894a83bd2e78b654] ; 0x67d0 ; "H\x83\xecHH\x89|$8H\x89t$@\xb8\n" ; int64_t arg2
|
||
| 0x000057f6 4889442478 mov qword [var_78h], rax
|
||
| 0x000057fb e8501b0000 call sym core::fmt::ArgumentV1::new::h4b3dd9450748c5fc ; dbg.new<[i32; 10]>
|
||
| 0x00005800 4889442470 mov qword [var_70h], rax
|
||
| 0x00005805 4889542468 mov qword [var_68h], rdx
|
||
| 0x0000580a 488b442470 mov rax, qword [var_70h]
|
||
| 0x0000580f 48898424d8.. mov qword [var_d8h], rax
|
||
| 0x00005817 488b4c2468 mov rcx, qword [var_68h]
|
||
| 0x0000581c 48898c24e0.. mov qword [var_e0h], rcx
|
||
| 0x00005824 488d9424d8.. lea rdx, [var_d8h]
|
||
| 0x0000582c 488dbc24a8.. lea rdi, [var_a8h] ; int64_t arg1
|
||
| 0x00005834 488b742478 mov rsi, qword [var_78h] ; int64_t arg2
|
||
| 0x00005839 41b802000000 mov r8d, 2
|
||
| 0x0000583f 4889542460 mov qword [var_60h], rdx
|
||
| 0x00005844 4c89c2 mov rdx, r8 ; int64_t arg3
|
||
| 0x00005847 488b4c2460 mov rcx, qword [var_60h] ; int64_t arg4
|
||
| 0x0000584c 41b801000000 mov r8d, 1 ; int64_t arg5
|
||
| 0x00005852 e8591b0000 call sym core::fmt::Arguments::new_v1::h2673b5bf555c0288 ; dbg.new_v1
|
||
| 0x00005857 488dbc24a8.. lea rdi, [var_a8h]
|
||
| 0x0000585f ff15b3430300 call qword [dbg._print] ; [0x39c18:8]=0xa2d0 dbg._print
|
||
| 0x00005865 488d842480.. lea rax, [numbers]
|
||
| 0x0000586d 4889c7 mov rdi, rax ; int64_t arg1
|
||
| 0x00005870 be0a000000 mov esi, 0xa ; int64_t arg2
|
||
| 0x00005875 e8f6f9ffff call sym rust::bubble_sort::h0777bc845caabc60 ; dbg.bubble_sort<i32>
|
||
| 0x0000587a 488b05f72a.. mov rax, qword [0x00038378] ; [0x38378:8]=0x38358
|
||
| 0x00005881 488d8c2480.. lea rcx, [numbers]
|
||
| 0x00005889 48898c2430.. mov qword [var_130h], rcx
|
||
| 0x00005891 488b8c2430.. mov rcx, qword [var_130h]
|
||
| 0x00005899 48898c2420.. mov qword [var_220h], rcx
|
||
| 0x000058a1 4889cf mov rdi, rcx ; int64_t arg1
|
||
| 0x000058a4 488d35250f.. lea rsi, [sym.core::array::__impl_core::fmt::Debug_for__T_____::fmt::h894a83bd2e78b654] ; 0x67d0 ; "H\x83\xecHH\x89|$8H\x89t$@\xb8\n" ; int64_t arg2
|
||
| 0x000058ab 4889442458 mov qword [var_58h], rax
|
||
| 0x000058b0 e89b1a0000 call sym core::fmt::ArgumentV1::new::h4b3dd9450748c5fc ; dbg.new<[i32; 10]>
|
||
| 0x000058b5 4889442450 mov qword [var_50h], rax
|
||
| 0x000058ba 4889542448 mov qword [var_48h], rdx
|
||
| 0x000058bf 488b442450 mov rax, qword [var_50h]
|
||
| 0x000058c4 4889842420.. mov qword [var_120h], rax
|
||
| 0x000058cc 488b4c2448 mov rcx, qword [var_48h]
|
||
| 0x000058d1 48898c2428.. mov qword [var_128h], rcx
|
||
| 0x000058d9 488d942420.. lea rdx, [var_120h]
|
||
| 0x000058e1 488dbc24f0.. lea rdi, [var_f0h] ; int64_t arg1
|
||
| 0x000058e9 488b742458 mov rsi, qword [var_58h] ; int64_t arg2
|
||
| 0x000058ee 41b802000000 mov r8d, 2
|
||
| 0x000058f4 4889542440 mov qword [var_40h], rdx
|
||
| 0x000058f9 4c89c2 mov rdx, r8 ; int64_t arg3
|
||
| 0x000058fc 488b4c2440 mov rcx, qword [var_40h] ; int64_t arg4
|
||
| 0x00005901 41b801000000 mov r8d, 1 ; int64_t arg5
|
||
| 0x00005907 e8a41a0000 call sym core::fmt::Arguments::new_v1::h2673b5bf555c0288 ; dbg.new_v1
|
||
| 0x0000590c 488dbc24f0.. lea rdi, [var_f0h]
|
||
| 0x00005914 ff15fe420300 call qword [dbg._print] ; [0x39c18:8]=0xa2d0 dbg._print
|
||
| 0x0000591a 488d052b47.. lea rax, [0x0002a04c] ; "dealempty/usr/src/rustc-1.43.0/src/libcore/slice/mod.rscalled `Option::unwrap()` on a `None` valuesrc/libstd/env.rsfailed to ge"
|
||
| 0x00005921 488d0d2147.. lea rcx, [0x0002a049] ; "cardealempty/usr/src/rustc-1.43.0/src/libcore/slice/mod.rscalled `Option::unwrap()` on a `None` valuesrc/libstd/env.rsfailed to"
|
||
| 0x00005928 488d151747.. lea rdx, [0x0002a046] ; "artcardealempty/usr/src/rustc-1.43.0/src/libcore/slice/mod.rscalled `Option::unwrap()` on a `None` valuesrc/libstd/env.rsfailed"
|
||
| 0x0000592f 488d350b47.. lea rsi, [0x0002a041] ; "beachartcardealempty/usr/src/rustc-1.43.0/src/libcore/slice/mod.rscalled `Option::unwrap()` on a `None` valuesrc/libstd/env.rsf"
|
||
| 0x00005936 488d3d1347.. lea rdi, [0x0002a050] ; "empty/usr/src/rustc-1.43.0/src/libcore/slice/mod.rscalled `Option::unwrap()` on a `None` valuesrc/libstd/env.rsfailed to get en"
|
||
| 0x0000593d 4889bc2438.. mov qword [strings], rdi
|
||
| 0x00005945 48c7842440.. mov qword [var_140h], 5
|
||
| 0x00005951 4889b42448.. mov qword [var_148h], rsi
|
||
EOF
|
||
RUN
|
||
|
||
|
||
NAME="function info integration 2 rust"
|
||
FILE=bins/elf/dwarf_rust_bubble
|
||
CMDS=<<EOF
|
||
e asm.dwarf=false
|
||
aaa
|
||
pd 40 @ dbg.bubble_sort_i32_
|
||
EOF
|
||
EXPECT=<<EOF
|
||
;-- rust::bubble_sort::h0777bc845caabc60:
|
||
;-- dbg.bubble_sort_i32_:
|
||
; CALL XREF from rust::main::h523dcf5432fcfd88 @ 0x5875(x) ; dbg.main
|
||
/ 614: dbg.bubble_sort<i32> (int64_t arg1, int64_t arg2);
|
||
| ; arg int64_t arg1 @ rdi
|
||
| ; arg int64_t arg2 @ rsi
|
||
| ; var int64_t var_fh @ rsp+0xf
|
||
| ; var int64_t var_10h @ rsp+0x10
|
||
| ; var int64_t var_18h @ rsp+0x18
|
||
| ; var int64_t var_20h @ rsp+0x20
|
||
| ; var int64_t var_28h @ rsp+0x28
|
||
| ; var int64_t var_30h @ rsp+0x30
|
||
| ; var int64_t var_38h @ rsp+0x38
|
||
| ; var int64_t var_40h @ rsp+0x40
|
||
| ; var int64_t var_48h @ rsp+0x48
|
||
| ; var usize n @ rsp+0x50
|
||
| ; var bool swapped @ rsp+0x5f
|
||
| ; var int64_t var_60h @ rsp+0x60
|
||
| ; var int64_t var_68h @ rsp+0x68
|
||
| ; var Range<usize> iter @ rsp+0x70
|
||
| ; var int64_t var_78h @ rsp+0x78
|
||
| ; var int64_t var_80h @ rsp+0x80
|
||
| ; var int64_t var_88h @ rsp+0x88
|
||
| ; var &mut [i32] values @ rsp+0x90
|
||
| ; var int64_t var_98h @ rsp+0x98
|
||
| ; var usize val @ rsp+0xa0
|
||
| ; var usize __next @ rsp+0xa8
|
||
| ; var usize i @ rsp+0xb0
|
||
| 0x00005270 4881ecb800.. sub rsp, 0xb8 ; void bubble_sort<i32>(&mut [i32] values);
|
||
| 0x00005277 4889bc2490.. mov qword [values], rdi ; arg1
|
||
| 0x0000527f 4889b42498.. mov qword [var_98h], rsi ; arg2
|
||
| 0x00005287 48897c2448 mov qword [var_48h], rdi ; arg1
|
||
| 0x0000528c 4889742440 mov qword [var_40h], rsi ; arg2
|
||
| 0x00005291 e8ea090000 call sym core::slice::_<impl [T]>::len::hbaf7153778228b73 ; dbg.len<i32>
|
||
| 0x00005296 4889442450 mov qword [n], rax
|
||
| 0x0000529b c644245f01 mov byte [swapped], 1
|
||
| ; CODE XREF from rust::bubble_sort::h0777bc845caabc60 @ 0x5441(x)
|
||
| 0x000052a0 f644245f01 test byte [swapped], 1
|
||
| ,=< 0x000052a5 7508 jne 0x52af
|
||
| | 0x000052a7 4881c4b800.. add rsp, 0xb8
|
||
| | 0x000052ae c3 ret
|
||
| | ; CODE XREF from rust::bubble_sort::h0777bc845caabc60 @ 0x52a5(x)
|
||
| `-> 0x000052af c644245f00 mov byte [swapped], 0
|
||
| 0x000052b4 488b442450 mov rax, qword [n]
|
||
| 0x000052b9 48c7442460.. mov qword [var_60h], 1
|
||
| 0x000052c2 4889442468 mov qword [var_68h], rax
|
||
| 0x000052c7 488b7c2460 mov rdi, qword [var_60h] ; int64_t arg1
|
||
| 0x000052cc 488b742468 mov rsi, qword [var_68h] ; int64_t arg2
|
||
| 0x000052d1 e83a140000 call sym _<I as core::iter::traits::collect::IntoIterator>::into_iter::h12f1e7995fb38cf5 ; dbg.into_iter<core::ops::range::Range<usize>>
|
||
| 0x000052d6 4889442438 mov qword [var_38h], rax
|
||
| 0x000052db 4889542430 mov qword [var_30h], rdx
|
||
| 0x000052e0 488b442438 mov rax, qword [var_38h]
|
||
| 0x000052e5 4889442470 mov qword [iter], rax
|
||
| 0x000052ea 488b4c2430 mov rcx, qword [var_30h]
|
||
| 0x000052ef 48894c2478 mov qword [var_78h], rcx
|
||
| ; CODE XREF from rust::bubble_sort::h0777bc845caabc60 @ 0x5432(x)
|
||
| 0x000052f4 488d7c2470 lea rdi, [iter] ; int64_t arg1
|
||
| 0x000052f9 e812130000 call sym core::iter::range::_<impl core::iter::traits::iterator::Iterator for core::ops::range::Range<A>>::next::h707e8283b20ce50a ; dbg.next<usize>
|
||
| 0x000052fe 4889942488.. mov qword [var_88h], rdx
|
||
| 0x00005306 4889842480.. mov qword [var_80h], rax
|
||
| 0x0000530e 488b842480.. mov rax, qword [var_80h]
|
||
| 0x00005316 4885c0 test rax, rax
|
||
| ,=< 0x00005319 7404 je 0x531f
|
||
| ,==< 0x0000531b eb00 jmp 0x531d
|
||
| || ; CODE XREF from rust::bubble_sort::h0777bc845caabc60 @ 0x531b(x)
|
||
| ,`--> 0x0000531d eb23 jmp 0x5342
|
||
| | | ; CODE XREF from rust::bubble_sort::h0777bc845caabc60 @ 0x5319(x)
|
||
| | `-> 0x0000531f 488b442450 mov rax, qword [n]
|
||
| | 0x00005324 482d01000000 sub rax, 1
|
||
| | 0x0000532a 0f92c1 setb cl
|
||
| | 0x0000532d f6c101 test cl, 1
|
||
| | 0x00005330 4889442428 mov qword [var_28h], rax
|
||
| | ,=< 0x00005335 0f857f010000 jne 0x54ba
|
||
EOF
|
||
RUN
|
||
|
||
NAME="big endian variable info"
|
||
FILE=bins/elf/ppc64_sudoku_dwarf
|
||
CMDS=<<EOF
|
||
e asm.dwarf=false
|
||
aaa
|
||
pdf @ dbg.init
|
||
EOF
|
||
EXPECT=<<EOF
|
||
;-- method.Grid.init__:
|
||
;-- Grid::init():
|
||
; CALL XREF from dbg.main @ 0x10001ae8(x)
|
||
/ 64: dbg.init (Grid * const this);
|
||
| ; arg Grid * const this @ r3
|
||
| 0x100012bc 39030144 addi r8, r3, 0x144 ; arg1 [0m; void init(Grid * const this);
|
||
| 0x100012c0 38e30168 addi r7, r3, 0x168 ; arg1
|
||
| 0x100012c4 39400000 li r10, 0
|
||
| ; CODE XREF from Grid::init() @ 0x100012e8(x)
|
||
| .-> 0x100012c8 3928febc addi r9, r8, -0x144
|
||
| : 0x100012cc 38c00009 li r6, 9
|
||
| : 0x100012d0 7cc903a6 mtctr r6
|
||
| : ; CODE XREF from Grid::init() @ 0x100012dc(x)
|
||
| .--> 0x100012d4 91490000 stw r10, 0(r9)
|
||
| :: 0x100012d8 39290024 addi r9, r9, 0x24
|
||
| `==< 0x100012dc 4200fff8 bdnz 0x100012d4
|
||
| : 0x100012e0 39080004 addi r8, r8, 4
|
||
| : 0x100012e4 7c283840 cmpld r8, r7
|
||
| `=< 0x100012e8 4082ffe0 bne 0x100012c8
|
||
| 0x100012ec 39200000 li r9, 0
|
||
| 0x100012f0 91230144 stw r9, 0x144(r3) ; arg1
|
||
| 0x100012f4 91230148 stw r9, 0x148(r3) ; arg1
|
||
\ 0x100012f8 4e800020 blr
|
||
EOF
|
||
RUN
|
||
|
||
NAME="function info integration ada"
|
||
FILE=bins/elf/ada_test_dwarf
|
||
CMDS=<<EOF
|
||
e asm.dwarf=false
|
||
aaa
|
||
pdf @ dbg.main
|
||
EOF
|
||
EXPECT=<<EOF
|
||
;-- main:
|
||
; DATA XREF from entry0 @ 0x2271(r)
|
||
/ 101: int dbg.main (int argc, char **argv, char **envp);
|
||
| ; arg int argc @ rdi
|
||
| ; arg char **argv @ rsi
|
||
| ; arg char **envp @ rdx
|
||
| ; var ada_main__main__seh___PAD seh @ rbp-0x8
|
||
| ; var system__address volatile ensure_reference @ rbp-0x10
|
||
| ; var int64_t var_14h @ rbp-0x14
|
||
| ; var char **var_20h @ rbp-0x20
|
||
| ; var char **var_28h @ rbp-0x28
|
||
| 0x00002742 55 push rbp ; integer main(integer const argc,void * const argv,void * const envp);
|
||
| 0x00002743 4889e5 mov rbp, rsp
|
||
| 0x00002746 4883ec30 sub rsp, 0x30
|
||
| 0x0000274a 897dec mov dword [var_14h], edi ; argc
|
||
| 0x0000274d 488975e0 mov qword [var_20h], rsi ; argv
|
||
| 0x00002751 488955d8 mov qword [var_28h], rdx ; envp
|
||
| 0x00002755 488d05dc08.. lea rax, obj.__gnat_ada_main_program_name ; 0x3038 ; "_ada_ada_test"
|
||
| 0x0000275c 488945f0 mov qword [ensure_reference], rax
|
||
| 0x00002760 8b45ec mov eax, dword [var_14h]
|
||
| 0x00002763 8905572a0000 mov dword [obj.gnat_argc], eax ; [0x51c0:4]=0
|
||
| 0x00002769 488b45e0 mov rax, qword [var_20h]
|
||
| 0x0000276d 488905b429.. mov qword [obj.gnat_argv], rax ; [0x5128:8]=0
|
||
| 0x00002774 488b45d8 mov rax, qword [var_28h]
|
||
| 0x00002778 4889051129.. mov qword [obj.gnat_envp], rax ; [0x5090:8]=0
|
||
| 0x0000277f 488d45f8 lea rax, [seh.F]
|
||
| 0x00002783 4889c7 mov rdi, rax
|
||
| 0x00002786 e875f9ffff call sym.imp.__gnat_initialize
|
||
| 0x0000278b e8e8fcffff call dbg.adainit
|
||
| 0x00002790 e847000000 call dbg._ada_ada_test
|
||
| 0x00002795 e8b6fcffff call dbg.adafinal
|
||
| 0x0000279a e8d1f8ffff call sym.imp.__gnat_finalize
|
||
| 0x0000279f 8b054b290000 mov eax, dword [obj.gnat_exit_status] ; [0x50f0:4]=0
|
||
| 0x000027a5 c9 leave
|
||
\ 0x000027a6 c3 ret
|
||
EOF
|
||
RUN
|
||
|
||
NAME="function info integration freepascal"
|
||
FILE=bins/efi/freepascal_test_dwarf
|
||
CMDS=<<EOF
|
||
e asm.dwarf=false
|
||
aaa
|
||
pd 20 @ dbg.palya
|
||
EOF
|
||
EXPECT=<<EOF
|
||
;-- unit p(mozgkigyo palya(smallint,smallint)):
|
||
; CALL XREFS from dbg.$main @ 0x405237(x), 0x40542d(x), 0x405ba3(x), 0x406e29(x)
|
||
/ 439: dbg.palya() ();
|
||
| ; var SmallInt mag @ rbp-0x8
|
||
| ; var SmallInt szel @ rbp-0x10
|
||
| ; var SmallInt i @ rbp-0x14
|
||
| ; var int64_t var_20h @ rbp-0x20
|
||
| ; var int64_t var_28h @ rbp-0x28
|
||
| 0x00401980 55 push rbp ; void palya(SmallInt mag,SmallInt szel);
|
||
| 0x00401981 4889e5 mov rbp, rsp
|
||
| 0x00401984 488d6424d0 lea rsp, [rsp - 0x30]
|
||
| 0x00401989 48895dd8 mov qword [var_28h], rbx
|
||
| 0x0040198d 4c8965e0 mov qword [var_20h], r12
|
||
| 0x00401991 66897df8 mov word [mag], di
|
||
| 0x00401995 668975f0 mov word [szel], si
|
||
| 0x00401999 b801000000 mov eax, 1
|
||
| 0x0040199e bf01000000 mov edi, 1 ; int64_t arg2
|
||
| 0x004019a3 89c6 mov esi, eax ; int64_t arg_8h
|
||
| 0x004019a5 e8b6a10200 call sym unit crt gotoxy(tcrtcoord,tcrtcoord) ; sym.unit_crt_gotoxy_tcrtcoord_tcrtcoord_
|
||
| 0x004019aa 66448b65f0 mov r12w, word [szel]
|
||
| 0x004019af 66c745ec0100 mov word [i], 1
|
||
| 0x004019b5 66443b65ec cmp r12w, word [i]
|
||
| ,=< 0x004019ba 7c45 jl 0x401a01
|
||
| | 0x004019bc 66816dec0100 sub word [i], 1
|
||
| | 0x004019c2 66666690 nop
|
||
| | 0x004019c6 6690 nop
|
||
| | ; CODE XREF from unit p$mozgkigyo palya(smallint,smallint) @ 0x4019ff(x)
|
||
| | 0x004019c8 668145ec0100 add word [i], 1
|
||
| | 0x004019ce e82d280200 call sym fpc_get_output() ; sym.fpc_get_output__
|
||
EOF
|
||
RUN
|