When using "dis -lr xxx+0x1", it is not correctly shown, for example:
  crash> dis -lr rb_next+0x1
  /kernel/lib/rbtree.c: 445
  0xffffffff8133ff60 <rb_next>:   push   %rbp

However, dis -lr rb+next+0x4 is correctly shown,
  crash> dis -lr rb_next+0x4
  /kernel/lib/rbtree.c: 445
  0xffffffff8133ff60 <rb_next>:   push   %rbp
  /kernel/lib/rbtree.c: 448
  0xffffffff8133ff61 <rb_next+0x1>:       mov    (%rdi),%rdx
  /kernel/lib/rbtree.c: 445
  0xffffffff8133ff64 <rb_next+0x4>:       mov    %rsp,%rbp

The reverse mode only disassembled (target - function_start) bytes, which
was insufficient to reach the target instruction.

Signed-off-by: neilfsun <[email protected]>
Signed-off-by: Feng Sun <[email protected]>
---
 kernel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel.c b/kernel.c
index bb148d0..93ea7a6 100644
--- a/kernel.c
+++ b/kernel.c
@@ -2120,7 +2120,7 @@ cmd_dis(void)
 
                if (reverse)
                        sprintf(buf5, "x/%ldi 0x%lx",
-                               (target - req->addr) ? target - req->addr : 1, 
+                               req->addr2 - req->addr,
                                req->addr);
                else
                        sprintf(buf5, "x/%ldi 0x%lx",
-- 
2.50.1
--
Crash-utility mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

Reply via email to