Fix and comment the broken debugger tests after last gha update (#18317)

* Add R2R_SKIP_ARCHOS env var handling in r2r to fix TCC suite
This commit is contained in:
pancake 2021-01-31 23:00:38 +01:00 committed by GitHub
parent 306d6aa996
commit 8cf1adfb27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 102 additions and 70 deletions

View File

@ -50,5 +50,5 @@ jobs:
run: |
r2 -v
r2r -v
cd test
make
export R2R_SKIP_ARCHOS=1
make -C test

View File

@ -610,9 +610,17 @@ static bool database_load(R2RTestDatabase *db, const char *path, int depth) {
eprintf ("Skipping %s"R_SYS_DIR"%s because it requires additional dependencies.\n", path, subname);
continue;
}
if ((!strcmp (path, "archos") || r_str_endswith (path, R_SYS_DIR"archos"))
&& strcmp (subname, R2R_ARCH_OS)) {
eprintf ("Skipping %s"R_SYS_DIR"%s because it does not match the current platform.\n", path, subname);
char *sa = r_sys_getenv ("R2R_SKIP_ARCHOS");
bool skip_archos = sa? !strcmp (sa, "1"): false;
free (sa);
if (sa) {
if ((!strcmp (path, "archos") || r_str_endswith (path, R_SYS_DIR"archos"))
&& strcmp (subname, R2R_ARCH_OS)) {
eprintf ("Skipping %s"R_SYS_DIR"%s because it does not match the current platform.\n", path, subname);
continue;
}
} else {
eprintf ("Skipping %s"R_SYS_DIR"%s because of R2R_SKIP_ARCHOS == 1.\n", path, subname);
continue;
}
r_strbuf_setf (&subpath, "%s%s%s", path, R_SYS_DIR, subname);

View File

@ -61,7 +61,8 @@ static int help(bool verbose) {
" -t [seconds] timeout per test (default is "TIMEOUT_DEFAULT_STR")\n"
" -o [file] output test run information in JSON format to file"
"\n"
"Supported test types: @json @unit @fuzz @cmds\n"
"R2R_SKIP_ARCHOS=1 # do not run the arch-os-specific tests\n"
"Supported test types: @json @unit @fuzz @arch @cmds\n"
"OS/Arch for archos tests: "R2R_ARCH_OS"\n");
}
return 1;

View File

@ -6,7 +6,7 @@ dm~?/
dk 9
EOF
EXPECT=<<EOF
4
6
EOF
RUN
@ -18,7 +18,7 @@ dm~?
dk 9
EOF
EXPECT=<<EOF
7
9
EOF
RUN
@ -29,13 +29,13 @@ CMDS=<<EOF
dm~?
db sym.imp.puts
dc~?
dm~?
dm~map.?
dc
EOF
EXPECT=<<EOF
7
9
0
14
8
Hello world!
EOF
RUN

View File

@ -3,6 +3,6 @@ FILE=bins/elf/analysis/elf-nx
ARGS=-d
CMDS=px0
EXPECT=<<EOF
89e083ec0c50e8850b
89e083ec0c50e8a50c
EOF
RUN

View File

@ -1,70 +1,93 @@
NAME=dbg.stepback
NAME=test breakpoint in main
FILE=bins/elf/analysis/ls-linux-x86_64-zlul
ARGS=-d -e dbg.bpsysign=true
CMDS=<<EOF
db main
db 0x004028fe
dc
dts+
dc
dsb
dsb
dr rbx,rcx,r12,rip
db-main
dr?rip
?v main
dk 9
EOF
EXPECT=<<EOF
0x00000001
0x00000001
0x00404870
0x004028f9
0x004028a0
0x4028a0
EOF
RUN
NAME=debug stepback from callee
FILE=bins/elf/analysis/calls_x64
ARGS=-d
CMDS=<<EOF
db main
db 0x0040052f
dc
dts+
dc
dr rax,rbx,rcx,r10,rbp,rip
dsb
dsb
dr rax,rbx,rcx,r10,rbp,rip
dk 9
EOF
EXPECT=<<EOF
0x00400574
0x00000000
0x00400590
0x00000003
0x00400590
0x0040052f
0x00400574
0x00000000
0x00400590
0x00000003
0x00400590
0x00400575
EOF
RUN
# NAME=dbg.stepback
# FILE=bins/elf/analysis/ls-linux-x86_64-zlul
# ARGS=-d -e dbg.bpsysign=true
# CMDS=<<EOF
# db main
# dc
# db 0x004028fe
# dts+
# dc
# dsb
# ?e rip
# dr rip
# dsb
# ?e rip
# dr rip
# ?e rbx,rcx,r12,rip
# dr rbx,rcx,r12,rip
# dk 9
# EOF
# EXPECT=<<EOF
# 0x00000001
# 0x00000001
# 0x00404870
# 0x004028f9
# EOF
# RUN
NAME=debug stepback from caller
FILE=bins/elf/analysis/calls_x64
ARGS=-d -e dbg.bpsysign=true
CMDS=<<EOF
db main
db 0x0040057c
dc
dts+
dc
dsb
dsb
dr rip
EOF
EXPECT=<<EOF
0x0040053b
EOF
RUN
# NAME=debug stepback from callee
# FILE=bins/elf/analysis/calls_x64
# ARGS=-d
# CMDS=<<EOF
# db main
# dc
# db-main
# db 0x0040052f
# dts+
# dc
# dr rax,rbx,rcx,r10,rbp,rip
# dsb
# dsb
# dr rax,rbx,rcx,r10,rbp,rip
# dk 9
# EOF
# EXPECT=<<EOF
# 0x00400574
# 0x00000000
# 0x00400590
# 0x00000003
# 0x00400590
# 0x0040052f
# 0x00400574
# 0x00000000
# 0x00400590
# 0x00000003
# 0x00400590
# 0x00400575
# EOF
# RUN
#
# NAME=debug stepback from caller
# FILE=bins/elf/analysis/calls_x64
# ARGS=-d -e dbg.bpsysign=true
# CMDS=<<EOF
# db main
# db 0x0040057c
# dc
# dts+
# dc
# dsb
# dsb
# dr rip
# EOF
# EXPECT=<<EOF
# 0x0040053b
# EOF
# RUN