Don't show offset comment if ahi is used (#6435)

This commit is contained in:
Khairul Azhar Kasmiran 2026-05-30 20:50:59 +08:00 committed by GitHub
parent ef3205846b
commit b784b167e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 8 deletions

View file

@ -4172,7 +4172,7 @@ static void ds_print_ptr(RzDisasmState *ds, int len, int idx) {
if (!strcmp(ds->show_cmtoff, "true")) {
ds_begin_comment(ds);
ds_comment(ds, true, "; 0x%" PFMT64x, refaddr);
} else if (!refaddr_printed && strcmp(ds->show_cmtoff, "false")) {
} else if (!refaddr_printed && strcmp(ds->show_cmtoff, "false") && (!ds->hint || !ds->hint->immbase)) {
char addrstr[32] = { 0 };
snprintf(addrstr, sizeof(addrstr), "0x%" PFMT64x, refaddr);
if (!ds->opstr || !strstr(ds->opstr, addrstr)) {

View file

@ -345,8 +345,8 @@ pd 1
EOF
EXPECT=<<EOF
0x00000000 cmp eax, 0xffffffff ; -1
0x00000000 cmp eax, -1 ; 0xffffffff ; -1
0x00000000 cmp eax, 4294967295 ; 0xffffffff ; -1
0x00000000 cmp eax, -1 ; -1
0x00000000 cmp eax, 4294967295 ; -1
EOF
RUN
@ -372,8 +372,8 @@ pd 1
EOF
EXPECT=<<EOF
0x00000000 cmp eax, 0xffffffff ; -1
0x00000000 cmp eax, -1 ; 0xffffffff ; -1
0x00000000 cmp eax, 4294967295 ; 0xffffffff ; -1
0x00000000 cmp eax, -1 ; -1
0x00000000 cmp eax, 4294967295 ; -1
0x00000000 cmp rax, 0xffffffffffffffff
0x00000000 cmp rax, -1

View file

@ -25,6 +25,7 @@ af-
e io.0xff=0
e analysis.nonull=16
aF
ahi du @ 0x10020
pd 10
afb
echo -- 6 --
@ -98,7 +99,7 @@ WARNING: Failed to read chunk of size 0x101 at 0x10020 from io.
-- 5 --
WARNING: Failed to read chunk of size 0x101 at 0x10020 from io.
/ entry0();
| 0x00010020 b32a mov bl, 0x2a ; '*'
| 0x00010020 b32a mov bl, 42 ; '*'
| 0x00010022 31c0 xor eax, eax
| 0x00010024 40 inc eax
| 0x00010025 cd80 int 0x80
@ -112,7 +113,7 @@ WARNING: Failed to read chunk of size 0x101 at 0x10020 from io.
-- 6 --
WARNING: Failed to read chunk of size 0x101 at 0x10020 from io.
/ entry0();
| 0x00010020 b32a mov bl, 0x2a ; '*'
| 0x00010020 b32a mov bl, 42 ; '*'
| 0x00010022 31c0 xor eax, eax
| 0x00010024 40 inc eax
| 0x00010025 cd80 int 0x80
@ -130,7 +131,7 @@ WARNING: Failed to read chunk of size 0x101 at 0x10020 from io.
0x00010020 0x00010027 00:0000 7
-- 9 --
/ entry0();
| 0x00010020 b32a mov bl, 0x2a ; '*'
| 0x00010020 b32a mov bl, 42 ; '*'
| 0x00010022 31c0 xor eax, eax
| 0x00010024 40 inc eax
\ 0x00010025 cd80 int 0x80