[Crash-utility] [PATCH v2 2/3] crash_taget: fetch_registers support

HAGIO KAZUHITO(萩尾 一仁) k-hagio-ab at nec.com
Wed Dec 23 01:18:17 UTC 2020


-----Original Message-----
> Provides API for crash_target to fetch registers of given
> CPU. It will allow gdb to perform such commands as "bt",
> "frame", "info locals".
> 
> Highlevel API is crash_get_cpu_reg (). It calls machine
> (architecture) specific function: machdep->get_cpu_reg().
> Input arguments such as register number and register size
> come from gdb arch information. So, get_cpu_regs()
> implementations in crash must understand it.
> 
> Signed-off-by: Alexey Makhalov <amakhalov at vmware.com>

I've not debugged this yet, but with this patch, the crash cannot
start the session.  Do you have any clue?

$ make 
TARGET: X86_64
 CRASH: 7.2.9++
   GDB: 10.1
...
gcc -c -g -DX86_64  -DGDB_10_1 -g -O2 vmware_guestdump.c -Wall -O2 -Wstrict-prototypes -Wmissing-prototypes -fstack-protector -Wformat-security
gcc -c -g -DX86_64  -DGDB_10_1 -g -O2 xen_dom0.c -Wall -O2 -Wstrict-prototypes -Wmissing-prototypes -fstack-protector -Wformat-security
gcc -c -g -DX86_64  -DGDB_10_1 -g -O2 kaslr_helper.c -Wall -O2 -Wstrict-prototypes -Wmissing-prototypes -fstack-protector -Wformat-security
ar -rs crashlib.a main.o tools.o global_data.o memory.o filesys.o help.o task.o build_data.o kernel.o test.o gdb_interface.o net.o dev.o bpf.o printk.o alpha.o x86.o ppc.o ia64.o s390.o s390x.o s390dbf.o ppc64.o x86_64.o arm.o arm64.o mips.o sparc64.o extensions.o remote.o va_server.o va_server_v1.o symbols.o cmdline.o lkcd_common.o lkcd_v1.o lkcd_v2_v3.o lkcd_v5.o lkcd_v7.o lkcd_v8.o lkcd_fix_mem.o s390_dump.o netdump.o diskdump.o makedumpfile.o xendump.o lkcd_x86_trace.o unwind_v1.o unwind_v2.o unwind_v3.o unwind_x86_32_64.o unwind_arm.o xen_hyper.o xen_hyper_command.o xen_hyper_global_data.o xen_hyper_dump_tables.o kvmdump.o qemu.o qemu-load.o sadump.o ipcs.o ramdump.o vmware_vmss.o vmware_guestdump.o xen_dom0.o kaslr_helper.o
ar: creating crashlib.a
  CXXLD  gdb
make[3]: Nothing to be done for `all-target'.

$ crash vmlinux-3.10.0-693.el7.x86_64 vmcore

crash 7.2.9++
Copyright (C) 2002-2020  Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
Copyright (C) 1999-2006  Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited
Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011  NEC Corporation
Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.
Copyright (c) 2015, 2020 VMware, Inc.
This program is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions.  Enter "help copying" to see the conditions.
This program has absolutely no warranty.  Enter "help warranty" for details.

GNU gdb (GDB) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from vmlinux-3.10.0-693.el7.x86_64...
thread.c:95: internal-error: thread_info* inferior_thread(): Assertion `current_thread_ != nullptr' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)


Thanks,
Kazu





More information about the Crash-utility mailing list