Command like 'frame' in gdb
by Shev Yan
Hi list members,
Is there any command like 'frame' and 'local' of gdb ? I want to switch to a stack and show the local variables.
Thanks,
Shev
13 years, 8 months
[ANNOUNCE] crash version 5.1.3 is available
by Dave Anderson
- Implemented support for using vmlinux files that have been compressed
with either gzip or bzip2. For examples:
# crash vmlinux.gz vmcore
# crash vmlinuz.bz2
The uncompressed file will be temporarily stored either in /var/tmp
or in the directory specified in a TMPDIR shell environment variable.
The compressed filename must at least begin with "vmlinux" so as to
avoid any attempt to uncompress a vmcore file. Gzip'd vmlinux files
are preferable since the uncompress operation is less time-consuming.
(anderson(a)redhat.com)
- Prevent an unnecessary warning message that was introduced in version
5.1.0 that indicates "WARNING: cannot read .debug_frame data from
<namelist>" when running against vmlinux executables that have a
separate ".debug" debuginfo file, such as RHEL3 vmlinux kernels.
With the patch, the message is only printed if CRASHDEBUG(1).
(anderson(a)redhat.com)
- Fix for the x86_64 "bt" command if the shutdown NMI is issued to a
32-bit task that has executed a "sysenter" instruction and the RSP
still contains the zero value loaded from the MSR_IA32_SYSENTER_ESP
register. Without the patch, the backtrace issues a warning message
indicating "WARNING: possibly bogus exception frame", and is unable
to make a transition from the NMI exception stack.
(anderson(a)redhat.com)
- Fixes for the gdb-7.0 sources to address gcc-4.6 compile failures.
Without the patch, gcc-4.6 generates "error: variable '<variable>'
set but not used [-Werror=unused-but-set-variable]" fatal errors when
the (default) -Werror flag is used. Previous gcc versions considered
local variables were simply set to some value to be "used", but that
is no longer the case.
(anderson(a)redhat.com)
- Fixes for the top-level crash sources to address gcc-4.6 compiler
warnings or errors. Without the patch, building with gcc-4.6 would
generate numerous "error: variable '<variable>' set but not used
[-Werror=unused-but-set-variable]" errors or warnings, depending upon
whether "make warn" or "make Warn" was used.
(anderson(a)redhat.com)
- Removed -Wp,-D_FORTIFY_SOURCE=2 from the WARNING_OPTIONS string due
to a memmove() oddity seen when using it in conjunction with -O2
with gcc-4.6.
(anderson(a)redhat.com)
- Implemented three new options for the "search" command. This patch
adds the -c option to search for character strings, the -w option to
search for unsigned hexadecimal integer values, and -h to search for
unsigned hexadecimal short values. The integer and short values are
searched on integer and short alignments respectively. The -w option
is only meaningful on 64-bit systems, to be used in order to search
both the upper and lower 32-bits of each 64-bit long for the 32-bit
value. Strings are searched across contiguous page boundaries, where
the page boundaries being crossed are relevant to the memory type
being searched, i.e., kernel virtual, user virtual, or physical
memory.
(bob.montgomery(a)hp.com)
- Restrict the new "search -p" option to physical memory pages that
have an mem_map page structure assigned to them.
(anderson(a)redhat.com, bob.montgomery(a)hp.com)
- Hardwire the declaration of the user_regs_struct in x86_64.c for
kernels whose debuginfo data does not contain it.
(wency(a)cn.fujitsu.com)
- Fix for compiler warnings when building makedumpfile.c and memory.c
with "make warn" on 32-bit systems.
(anderson(a)redhat.com)
- Fix to more correctly determine the KVM I/O hole size and location.
The I/O hole size to this point in time is either 1GB or 512MB, but
its setting is hardwired into the Qemu code that was used to create
the dumpfile. The dumpfile is a "savevm" file that is designed to be
used for guest migration, and since inter-version save/load is not
supported, the I/O hole information does not have to encoded into the
dumpfile. Without the patch, the I/O hole for dumpfiles created by
older Qemu version was not being set to 1GB, so if the KVM guest was
configured with more than 3GB of memory, the crash session would
typically display numerous "read error" messages during session
initialization.
(anderson(a)redhat.com)
- Fix for the x86 "bt" command on RHEL6 kernels that contain a backport
of upstream commit a00e817f42663941ea0aa5f85a9d1c4f8b212839, which
moved x86 irq-exit functions to a special .kprobes.text section.
Without this patch, "bt" would show nonsensical backtraces that begin
and end with the "ia32_sysenter_target" function, and would dump an
invalid kernel-entry exception frame.
(anderson(a)redhat.com)
- Fix for the x86 "bt" command to fix a possible failure to backtrace
a non-active "swapper" task. Without the patch, the backtrace would
fail with the error message "bt: cannot resolve stack trace".
(anderson(a)redhat.com)
- Fix for the x86 "bt" command to prevent the display of a stale
interrupt exception frame left on the stack of a non-active task.
(anderson(a)redhat.com)
Download from: http://people.redhat.com/anderson
13 years, 8 months
[PATCH] debuginfo does not pick user_regs_struct on x86_64
by Wen Congyang
On RHEL6(x86_64), debuginfo does not pick user_regs_struct on x86_64.
# gdb /usr/lib/debug/lib/modules/2.6.32-71.el6.x86_64/vmlinux
GNU gdb (GDB) Red Hat Enterprise Linux (7.1-29.el6)
Copyright (C) 2010 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/lib/debug/lib/modules/2.6.32-71.el6.x86_64/vmlinux...done.
(gdb) ptype struct user_regs_struct
No struct type named user_regs_struct.
---
x86_64.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/x86_64.c b/x86_64.c
index a782334..853a1aa 100644
--- a/x86_64.c
+++ b/x86_64.c
@@ -332,6 +332,31 @@ x86_64_init(int when)
MEMBER_OFFSET_INIT(user_regs_struct_ss,
"user_regs_struct", "ss");
STRUCT_SIZE_INIT(user_regs_struct, "user_regs_struct");
+ if (!VALID_STRUCT(user_regs_struct)) {
+ /* Use this hardwired version -- sometimes the
+ * debuginfo doesn't pick this up even though
+ * it exists in the kernel; it shouldn't change.
+ */
+ struct x86_64_user_regs_struct {
+ unsigned long long r15, r14, r13, r12, bp, bx;
+ unsigned long long r11, r10, r9, r8, ax, cx, dx;
+ unsigned long long si, di, orig_ax, ip, cs;
+ unsigned long long flags, sp, ss, fs_base;
+ unsigned long long gs_base, ds, es, fs, gs;
+ };
+ ASSIGN_SIZE(user_regs_struct) =
+ sizeof(struct x86_64_user_regs_struct);
+ ASSIGN_OFFSET(user_regs_struct_rip) =
+ offsetof(struct x86_64_user_regs_struct, ip);
+ ASSIGN_OFFSET(user_regs_struct_rsp) =
+ offsetof(struct x86_64_user_regs_struct, sp);
+ ASSIGN_OFFSET(user_regs_struct_eflags) =
+ offsetof(struct x86_64_user_regs_struct, flags);
+ ASSIGN_OFFSET(user_regs_struct_cs) =
+ offsetof(struct x86_64_user_regs_struct, cs);
+ ASSIGN_OFFSET(user_regs_struct_ss) =
+ offsetof(struct x86_64_user_regs_struct, ss);
+ }
machdep->vmalloc_start = x86_64_vmalloc_start;
vt->vmalloc_start = machdep->vmalloc_start();
machdep->init_kernel_pgd();
--
1.7.1
13 years, 9 months
Crash physical search on live session not recommended :-)
by Bob Montgomery
While testing my search patch, I kicked off an unconstrained physical
search on a live session and hung the machine so thoroughly that it
required a visit to the machine room to physically unplug it to get the
remote console back up. Coincidence? Or should physical address search
on a live session be constrained somehow for safety?
Bob Montgomery
13 years, 9 months