Dave,
Since our last discussion [1], a further change to the "consolidation"
patch has been made. The assumption now is that the text address generated
by gdb is _always_ in base 16 form. Hence the if clause to check buf2 is
prefixed with 0x has been removed as indicated in the hunk below:
- if (STRNEQ(buf2, "0x"))
- extract_hex(buf2, &curaddr, ':', TRUE);
+ extract_hex(buf2, &curaddr, ':', TRUE);
Please let me know if this assumption is valid.
With optimisation level 2 (default) the following warning is displayed:
$ make warn
TARGET: X86_64
CRASH: 7.1.2
GDB: 7.6
cc -c -g -DX86_64 -DGDB_7_6 build_data.c -Wall -O2 -Wstrict-prototypes
-Wmissing-prototypes -fstack-protector -Wformat-security
cc -c -g -DX86_64 -DGDB_7_6 kernel.c -Wall -O2 -Wstrict-prototypes -Wmissing-prototypes
-fstack-protector -Wformat-security
kernel.c: In function ‘cmd_dis’:
kernel.c:1663:8: warning: ‘target’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
if (curaddr != target)
^
Note that this is not seen when optimisation is disabled. To work around
this (what I suspect is a false positive), where target is declared it is
now initialised to zero even though its value is not considered if forward
or reverse is not set.
[1]:
https://www.redhat.com/archives/crash-utility/2015-August/msg00025.html
Aaron Tomlin (2):
dis: Consolidate cmd_dis
dis: Introduce the -f option
help.c | 2 +
kernel.c | 287 +++++++++++++++++++++++----------------------------------------
2 files changed, 106 insertions(+), 183 deletions(-)
--
2.4.3