From: Peter Feiner Subject: [kvm-unit-tests v3 0/4] Debugging aids Date: Thu, 3 Mar 2016 12:48:32 -0800 Message-ID: <1457038116-3448-1-git-send-email-pfeiner@google.com> References: <1456867658-10937-1-git-send-email-pfeiner@google.com> Cc: pfeiner@google.com To: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com Return-path: Received: from mail-pa0-f48.google.com ([209.85.220.48]:34035 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751938AbcCCUsl (ORCPT ); Thu, 3 Mar 2016 15:48:41 -0500 Received: by mail-pa0-f48.google.com with SMTP id fy10so20986099pac.1 for ; Thu, 03 Mar 2016 12:48:40 -0800 (PST) In-Reply-To: <1456867658-10937-1-git-send-email-pfeiner@google.com> Sender: kvm-owner@vger.kernel.org List-ID: Some aids for debugging: stack dumping, register dumping, and printing failing assertion conditions. I _have_ compiled on ppc64 and arm64 :-) v3: * Renamed functions to match standard backtrace functions * Added asm-generic stack walker that uses __builtin_return_address. * Moved offset out of libcflat and into pretty printer * Made pretty printer more robust w.r.t. errors: now it just continues printing. v2: * Fixed a bunch tests on x86 that broke with -fno-omit-frame-pointer. * Only use -fno-omit-frame-pointer on x86. I suspect arm & ppc will have similar problems that I fixed for x86. Peter Feiner (4): lib: backtrace printing x86: lib: debug dump on unhandled exceptions lib: dump stack on failed assert() scripts: pretty print stack traces Makefile | 3 +- arm/Makefile.common | 1 + lib/arm/asm/stack.h | 1 + lib/arm64/asm/stack.h | 1 + lib/asm-generic/stack.c | 53 +++++++++++++++++++++++++ lib/asm-generic/stack.h | 14 +++++++ lib/libcflat.h | 9 ++++- lib/powerpc/asm/stack.h | 1 + lib/ppc64/asm/stack.h | 1 + lib/printf.c | 42 ++++++++++++++++++++ lib/x86/asm/stack.c | 25 ++++++++++++ lib/x86/asm/stack.h | 12 ++++++ lib/x86/desc.c | 69 +++++++++++++++++++++++++++++--- powerpc/Makefile.common | 1 + run_tests.sh | 10 ++++- scripts/pretty_print_stacks.py | 89 ++++++++++++++++++++++++++++++++++++++++++ x86/Makefile.common | 4 ++ 17 files changed, 325 insertions(+), 11 deletions(-) create mode 100644 lib/arm/asm/stack.h create mode 100644 lib/arm64/asm/stack.h create mode 100644 lib/asm-generic/stack.c create mode 100644 lib/asm-generic/stack.h create mode 100644 lib/powerpc/asm/stack.h create mode 100644 lib/ppc64/asm/stack.h create mode 100644 lib/x86/asm/stack.c create mode 100644 lib/x86/asm/stack.h create mode 100755 scripts/pretty_print_stacks.py -- 2.7.0.rc3.207.g0ac5344