Hi Akashi,
I was playing around with this, and noted that if a module's debuginfo data is
not
loaded into a crash session with the "mod" command, branch instruction targets
that are within the module space are not translated. For example, note the
handful
of "bl" instructions with module address targets are empty:
crash> dis dm_create | grep bl
0xfdfffc003814 :bl 0xfe226ce0
0xfdfffc003828 :bl 0xfe143754
0xfdfffc003850 : bl 0xfe3c4f08
0xfdfffc00385c : bl 0xfe78241c
<_raw_spin_lock>
0xfdfffc003874 : bl 0xfe3c5d90
0xfdfffc00388c : bl 0xfe123044
0xfdfffc0038b0 : bl 0xfe10f9d0
<__mutex_init>
0xfdfffc0038c0 : bl 0xfe10f9d0
<__mutex_init>
0xfdfffc0038d4 : bl 0xfe10f9d0
<__mutex_init>
0xfdfffc003918 : bl 0xfe3968c4
0xfdfffc003948 : bl 0xfe3ab298
0xfdfffc003968 : bl 0xfe10a878
<__init_waitqueue_head>
0xfdfffc003994 : bl 0xfe10a878
<__init_waitqueue_head>
0xfdfffc0039a8 : bl 0xfe10a878
<__init_waitqueue_head>
0xfdfffc0039f8 : bl 0xfe3d1224
0xfdfffc003a00 : bl 0xfe3aab08
0xfdfffc003a1c : bl 0xfe3d1224
0xfdfffc003a34 : bl 0xfe0e3acc
<__alloc_workqueue_key>
0xfdfffc003a48 : bl 0xfe3a9a8c
0xfdfffc003a58 : bl 0xfe38ea84
0xfdfffc003a70 : bl 0xfdfffc00e418
0xfdfffc003a78 : bl 0xfe78241c
<_raw_spin_lock>
0xfdfffc003a88 : bl 0xfe3c4e54
0xfdfffc003aa4 : bl 0xfdfffc00d270
0xfdfffc003ad8 : bl 0xfe143860
0xfdfffc003ae0 : bl 0xfe228464
0xfdfffc003b08 : bl 0xfe3c4f08
0xfdfffc003b14 : bl 0xfe78241c
<_raw_spin_lock>
0xfdfffc003b2c : bl 0xfe3c5d90
0xfdfffc003b4c : bl 0xfdfffc001220
0xfdfffc003b54 : bl 0xfdfffc0012e0
0xfdfffc003b60 : bl 0xfe1c4828
crash>
With this patch:
--- a/arm64.c
+++ b/arm64.c
@@ -2977,6 +2977,16 @@ arm64_dis_filter(ulong vaddr, char *inbuf, unsigned
int output_radix)
sprintf(p1, "%s", buf1);
}
+ if (IS_MODULE_VADDR(vaddr)) {
+ p1 = [strlen(inbuf)-1];
+ strcpy(buf1, inbuf);
+ argc = parse_line(buf1, argv);
+ if (STREQ(argv[argc-2], "bl") &&
+ extract_hex(argv[argc-1], , NULLCHAR, TRUE))
+ sprintf(p1, " <%s>\n",
+ value_to_symstr(value, buf2, output_radix));
+ }
+
console("%s", inbuf);
return TRUE;
module addresses are translated without having to load the module's debuginfo:
crash> dis dm_create | grep bl
0xfdfffc003814 :bl 0xfe226ce0
0xfdfffc003828 :bl 0xfe143754
0xfdfffc003850 : bl 0xfe3c4f08
0xfdfffc00385c : bl 0xfe78241c
<_raw_spin_lock>
0xfdfffc003874 : bl 0xfe3c5d90
0xfdfffc00388c : bl 0xfe123044
0xfdfffc0038b0 : bl 0xfe10f9d0
<__mutex_init>
0xfdfffc0038c0 : bl 0xfe10f9d0
<__mutex_init>
0xfdfffc0038d4 : bl 0xfe10f9d0
<__mutex_init>
0xfdfffc003918 : bl 0xfe3968c4
0xfdfffc003948 : bl 0xfe3ab298
0xfdfffc003968 : bl 0xfe10a878
<__init_waitqueue_head>
0xfdfffc003994 : bl 0xfe10a878
<__init_waitqueue_head>
0xfdfffc0039a8 : bl 0xfe10a878
<__init_waitqueue_head>
0xfdfffc0039f8 : bl 0xfe3d1224
0xfdfffc003a00 : bl 0xfe3aab08
0xfdfffc003a1c : bl 0xfe3d1224
0xfdfffc003a34 : bl 0xfe0e3acc
<__alloc_workqueue_key>
0xfdfffc003a48 : bl