[Crash-utility] [PATCH 1/2] dis: Make the starting address of a function special for hexadecimal targets too

Aaron Tomlin atomlin at redhat.com
Mon Jul 6 08:20:27 UTC 2015


If no count is not entered, and the target address is the starting address
of a function, disassemble the entire function.
However this is only true, if the given target is symbolic.

This patch simply removes that restriction when the target is a hexadecimal
address:

For example, each of the following commands will return the same result.

 - Where 0xffffffff80137e9d is assumed to be the address of the
   first instruction in do_fork()

  crash> dis 0xffffffff80137e9d
  crash> dis do_fork

Signed-off-by: Aaron Tomlin <atomlin at redhat.com>
---
 kernel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel.c b/kernel.c
index 4932282..628779c 100644
--- a/kernel.c
+++ b/kernel.c
@@ -1436,6 +1436,8 @@ cmd_dis(void)
 					req->addr);
 				unfiltered = TRUE;
 			}
+			if (!offset)
+				req->flags |= GNU_FUNCTION_ONLY;
                 } else if ((sp = symbol_search(args[optind]))) {
                         req->addr = sp->value;
 			req->flags |= GNU_FUNCTION_ONLY;
-- 
2.4.3




More information about the Crash-utility mailing list