public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: kvm@vger.kernel.org
Cc: pfeiner@google.com, pbonzini@redhat.com, rkrcmar@redhat.com
Subject: [kvm-unit-tests PATCH v2 5/8] pretty_print_stacks: addr2line may need a cross prefix
Date: Tue, 19 Apr 2016 18:19:29 +0200	[thread overview]
Message-ID: <1461082772-31121-6-git-send-email-drjones@redhat.com> (raw)
In-Reply-To: <1461082772-31121-1-git-send-email-drjones@redhat.com>

Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Peter Feiner <pfeiner@google.com>
---
 configure                      | 2 ++
 scripts/pretty_print_stacks.py | 9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index ba6c55b3bc5b3..ca0ef83b942e5 100755
--- a/configure
+++ b/configure
@@ -7,6 +7,7 @@ ld=ld
 objcopy=objcopy
 objdump=objdump
 ar=ar
+addr2line=addr2line
 arch=`uname -m | sed -e 's/i.86/i386/;s/arm.*/arm/;s/ppc64.*/ppc64/'`
 host=$arch
 cross_prefix=
@@ -154,6 +155,7 @@ LD=$cross_prefix$ld
 OBJCOPY=$cross_prefix$objcopy
 OBJDUMP=$cross_prefix$objdump
 AR=$cross_prefix$ar
+ADDR2LINE=$cross_prefix$addr2line
 API=$api
 TEST_DIR=$testdir
 FIRMWARE=$firmware
diff --git a/scripts/pretty_print_stacks.py b/scripts/pretty_print_stacks.py
index bd30a7376a6d8..11042a7953e11 100755
--- a/scripts/pretty_print_stacks.py
+++ b/scripts/pretty_print_stacks.py
@@ -5,6 +5,8 @@ import subprocess
 import sys
 import traceback
 
+config = {}
+
 # Subvert output buffering.
 def puts(string):
     sys.stdout.write(string)
@@ -25,7 +27,7 @@ def pretty_print_stack(binary, line):
     # Output like this:
     #        0x004002be: start64 at path/to/kvm-unit-tests/x86/cstart64.S:208
     #         (inlined by) test_ept_violation at path/to/kvm-unit-tests/x86/vmx_tests.c:1719 (discriminator 1)
-    cmd = ['addr2line', '-e', binary, '-i', '-f', '--pretty', '--address']
+    cmd = [config.get('ADDR2LINE', 'addr2line'), '-e', binary, '-i', '-f', '--pretty', '--address']
     cmd.extend(addrs)
 
     p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
@@ -60,6 +62,11 @@ def main():
 
     binary = sys.argv[1].replace(".flat", ".elf")
 
+    with open("config.mak") as config_file:
+        for line in config_file:
+            name, val = line.partition("=")[::2]
+            config[name.strip()] = val.strip()
+
     try:
         while True:
             # Subvert input buffering.
-- 
2.4.11


  parent reply	other threads:[~2016-04-19 16:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 16:19 [kvm-unit-tests PATCH v2 0/8] arm: fix building by adding a feature Andrew Jones
2016-04-19 16:19 ` [kvm-unit-tests PATCH v2 1/8] x86: change exit to abort again Andrew Jones
2016-04-19 16:19 ` [kvm-unit-tests PATCH v2 2/8] x86: trivial: there's no dump_stack.o Andrew Jones
2016-04-19 16:19 ` [kvm-unit-tests PATCH v2 3/8] pretty_print_stacks: keep the 'STACK:' line Andrew Jones
2016-04-19 16:19 ` [kvm-unit-tests PATCH v2 4/8] pretty_print_stacks: use elf file for the kernel Andrew Jones
2016-04-19 16:19 ` Andrew Jones [this message]
2016-04-19 16:19 ` [kvm-unit-tests PATCH v2 6/8] stack: share api prototypes Andrew Jones
2016-04-19 16:19 ` [kvm-unit-tests PATCH v2 7/8] stack: copy common asm/stack.h bits to all arches Andrew Jones
2016-04-19 16:19 ` [kvm-unit-tests PATCH v2 8/8] arm: stack: add dump_stack support Andrew Jones
2016-04-19 16:37   ` Peter Feiner
2016-04-25 15:31 ` [kvm-unit-tests PATCH v2 0/8] arm: fix building by adding a feature Radim Krčmář

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461082772-31121-6-git-send-email-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=pfeiner@google.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox