Skip to content

Commit

Permalink
err
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Sep 30, 2024
1 parent 7cfda97 commit 162f314
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 8 deletions.
6 changes: 4 additions & 2 deletions binr/r2r/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,8 @@ R_API bool r2r_subprocess_wait(R2RSubprocess *proc, ut64 timeout_ms) {
char buf[4096];
ssize_t sz = read (proc->stdout_fd, buf, sizeof (buf));
if (sz < 0) {
r_sys_perror ("sp-wait read");
r_sys_perror ("sp-wait read 1");
stdout_eof = true;
} else if (sz == 0) {
stdout_eof = true;
} else {
Expand All @@ -721,7 +722,8 @@ R_API bool r2r_subprocess_wait(R2RSubprocess *proc, ut64 timeout_ms) {
char buf[4096];
ssize_t sz = read (proc->stderr_fd, buf, sizeof (buf));
if (sz < 0) {
r_sys_perror ("sp-wait read");
r_sys_perror ("sp-wait read 2");
stderr_eof = true;
continue;
}
if (sz == 0) {
Expand Down
2 changes: 1 addition & 1 deletion libr/arch/arch.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2022-2023 - pancake, condret */
/* radare - LGPL - Copyright 2022-2024 - pancake, condret */

#include <r_arch.h>
#include <config.h>
Expand Down
1 change: 1 addition & 0 deletions test/db/anal/sparc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ RUN
NAME=afb sparc
FILE=bins/elf/elf-Linux-SparcV8-bash
CMDS=<<EOF
e asm.var.summary=0
s sym.zwrite
af
afb
Expand Down
16 changes: 13 additions & 3 deletions test/db/anal/x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -1479,9 +1479,7 @@ pdf
EOF
EXPECT=<<EOF
/ 76: fcn.00012740 (int64_t arg1, int64_t arg2);
| ; arg int64_t arg1 @ rdi
| ; arg int64_t arg2 @ rsi
| ; var int64_t var_8h @ rbp-0x8
| `- args(rdi, rsi) vars(1:sp[0x10..0x10])
| 0x00012740 push rbp
| 0x00012741 mov rbp, rsp
| 0x00012744 sub rsp, 0x1030
Expand Down Expand Up @@ -1876,7 +1874,10 @@ s sym.fastcaslled
afc fastcall
afc
afva
e asm.var.summary=0
pdf
e asm.var.summary=4
pd 1
EOF
EXPECT=<<EOF
fastcall
Expand Down Expand Up @@ -1911,12 +1912,17 @@ fastcall
| 0x08048451 90 nop
| 0x08048452 c9 leave
\ 0x08048453 c20800 ret 8
; CALL XREF from main @ 0x80484c7(x)
/ 59: sym.fastcaslled (int32_t arg1, int32_t arg2, int32_t arg_8h, int32_t arg_ch);
| `- args(ecx, edx, sp[0x4..0x8]) vars(4:sp[0x10..0x24])
| 0x0804841b 55 push ebp
EOF
RUN

NAME=afva for cdecl/stdcall with no esp vars
FILE=bins/elf/analysis/fast
CMDS=<<EOF
e asm.var.summary=0
e asm.cmt.calls=false
aa
s sym.nonfastcaslled
Expand Down Expand Up @@ -1971,6 +1977,7 @@ RUN
NAME=anal vars crash 2
FILE=-
CMDS=<<EOF
e asm.var.summary=0
e asm.bits=64
e asm.arch = x86
e anal.arch = x86
Expand Down Expand Up @@ -3755,6 +3762,7 @@ RUN
NAME=Microsoft x64 CC Args/Vars
FILE=bins/pe/testx64.exe
CMDS=<<EOF
e asm.var.summary=0
e asm.comments=0
e anal.vars.stackname=true
s 0x140001080
Expand Down Expand Up @@ -3849,6 +3857,7 @@ RUN
NAME=lea pseudo improvements (pseudo disabled)
FILE=-
CMDS=<<EOF
e asm.var.summary=0
e asm.arch=x86
e asm.bits=64
e asm.comments=false
Expand Down Expand Up @@ -3890,6 +3899,7 @@ RUN
NAME=lea pseudo improvements (pseudo enabled)
FILE=-
CMDS=<<EOF
e asm.var.summary=0
e asm.arch=x86
e asm.bits=64
e asm.comments=false
Expand Down
4 changes: 2 additions & 2 deletions test/db/formats/elf/elf-relro
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ EXPECT=<<EOF
0x00007524 45ca8ce2 add ip, ip, 0x45000
0x00007528 f0f5bce5 ldr pc, [ip, 0x5f0]!
/ 552: sym.Curl_close (int32_t arg1);
| ; arg int32_t arg1 @ r0
| `- args(r0)
| 0x0001de5c 70402de9 push {r4, r5, r6, lr}
| 0x0001de60 0010a0e3 mov r1, 0
| 0x0001de64 086090e5 ldr r6, [r0, 8] ; arg1
Expand Down Expand Up @@ -530,7 +530,7 @@ EXPECT=<<EOF
0x00017524 45ca8ce2 add ip, ip, 0x45000
0x00017528 f0f5bce5 ldr pc, [ip, 0x5f0]!
/ 552: sym.Curl_close (int32_t arg1);
| ; arg int32_t arg1 @ r0
| `- args(r0)
| 0x0002de5c 70402de9 push {r4, r5, r6, lr}
| 0x0002de60 0010a0e3 mov r1, 0
| 0x0002de64 086090e5 ldr r6, [r0, 8] ; arg1
Expand Down
2 changes: 2 additions & 0 deletions test/db/formats/elf/random
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ NAME=random39855 relocs
FILE=bins/elf/random_39855/random_39855.oo
CMDS=<<EOF
s sym.func_9
e asm.var.summary=0
e emu.str=true
af
pd 20
Expand Down Expand Up @@ -80,6 +81,7 @@ RUN
NAME=random39855 relocs bin
FILE=bins/elf/random_39855/random_39855
CMDS=<<EOF
e asm.var.summary=0
e emu.str=true
s sym.func_9
af
Expand Down
3 changes: 3 additions & 0 deletions test/db/formats/elf/riscv
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ RUN
NAME=ELF: riscv64: main analysis (1)
FILE=bins/elf/analysis/guess-number-riscv64
CMDS=<<EOF
e asm.var.summary=0
e anal.vars.stackname=true
e asm.cmt.calls=false
s sym.main
Expand Down Expand Up @@ -536,6 +537,7 @@ RUN
NAME=ELF: riscv64: main analysis (2)
FILE=bins/elf/analysis/guess-number-riscv64
CMDS=<<EOF
e asm.var.summary=0
s sym.main
af
pdf
Expand Down Expand Up @@ -657,6 +659,7 @@ NAME=ELF: riscv64: full analysis
FILE=bins/elf/analysis/guess-number-riscv64
ARGS=-e asm.cmt.calls=false -b64
CMDS=<<EOF
e asm.var.summary=0
aeim
e asm.bits=64
e asm.arch=riscv
Expand Down

0 comments on commit 162f314

Please sign in to comment.