summary refs log tree commit diff stats
path: root/scripts
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-03-22 13:15:52 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-03-22 13:15:52 +0000
commit99728ba3ec9b8795ff7191ea75a2a8c0329c29a5 (patch)
treefe64d29fb86b50ba92001990609b5d803d71d2f8 /scripts
parentb2ce07de4e0fdc6119f7f59c13c4db7534a7920b (diff)
parent4b17bc933fc26f7a4a306a43597f4d97e3c2dc38 (diff)
downloadfocaccia-qemu-99728ba3ec9b8795ff7191ea75a2a8c0329c29a5.tar.gz
focaccia-qemu-99728ba3ec9b8795ff7191ea75a2a8c0329c29a5.zip
Merge remote-tracking branch 'remotes/elmarco/tags/dump-pull-request' into staging
Pull request

# gpg: Signature made Wed 21 Mar 2018 14:37:05 GMT
# gpg:                using RSA key DAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>"
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>"
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* remotes/elmarco/tags/dump-pull-request:
  dump-guest-memory: more descriptive lookup_type failure
  dump.c: allow fd_write_vmcore to return errno on failure

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/dump-guest-memory.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py
index 51acfcd0c0..276eebf0c2 100644
--- a/scripts/dump-guest-memory.py
+++ b/scripts/dump-guest-memory.py
@@ -16,7 +16,12 @@ the COPYING file in the top-level directory.
 import ctypes
 import struct
 
-UINTPTR_T = gdb.lookup_type("uintptr_t")
+try:
+    UINTPTR_T = gdb.lookup_type("uintptr_t")
+except Exception as inst:
+    raise gdb.GdbError("Symbols must be loaded prior to sourcing dump-guest-memory.\n"
+                       "Symbols may be loaded by 'attach'ing a QEMU process id or by "
+                       "'load'ing a QEMU binary.")
 
 TARGET_PAGE_SIZE = 0x1000
 TARGET_PAGE_MASK = 0xFFFFFFFFFFFFF000