Skip to content

Commit ea76896

Browse files
committed
Fix bug in 'as command' not showing the right syscall ##analysis
1 parent 19c8568 commit ea76896

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

libr/core/cmd_anal.inc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,10 +2329,7 @@ R_API char *cmd_syscall_dostr(RCore *core, st64 n, ut64 addr) {
23292329
char str[64], snstr[32];
23302330
st64 N = n;
23312331
int defVector = r_syscall_get_swi (core->anal->syscall);
2332-
if (defVector > 0) {
2333-
n = -1;
2334-
}
2335-
if (n == -1 || defVector > 0) {
2332+
if (n == -1) {
23362333
n = (int)r_debug_reg_get (core->dbg, "oeax");
23372334
if (!n || n == -1) {
23382335
n = r_debug_reg_get (core->dbg, "SN");

test/db/anal/syscalls

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,25 @@ EXPECT=<<EOF
1717
EOF
1818
EXPECT_ERR=
1919
RUN
20+
21+
NAME=as <num> honors user argument
22+
FILE=-
23+
CMDS=<<EOF
24+
-a x86
25+
-b 64
26+
-e asm.os=linux
27+
as 0
28+
as 1
29+
as 2
30+
as 4
31+
as write
32+
EOF
33+
EXPECT=<<EOF
34+
0 = read (0, 0x00000000, 0)
35+
1 = write (0, 0x00000000, 0)
36+
2 = open (0x00000000, 0x00000000, 0x00000000)
37+
4 = stat (0x00000000, 0x00000000)
38+
1 = write (0, 0x00000000, 0)
39+
EOF
40+
EXPECT_ERR=
41+
RUN

0 commit comments

Comments
 (0)