Dump patches
The following changes since commit 281f327487c9c9b1599f93c589a408bbf4a651b8:
Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.12-pull-request' into staging (2017-12-22 00:11:36 +0000)
are available in the Git repository at:
https://github.com/elmarco/qemu.git tags/dump-pull-request
for you to fetch changes up to c3b1642b9b6b3ba4314d6be3be509d396372cfd5:
dump-guest-memory.py: fix "You can't do that without a process to debug" (2018-01-02 14:49:54 +0100)
----------------------------------------------------------------
----------------------------------------------------------------
Marc-André Lureau (2):
dump: fix note_name_equal()
dump-guest-memory.py: fix "You can't do that without a process to
debug"
scripts/dump-guest-memory.py | 3 +-- dump.c | 7 +------ hw/misc/vmcoreinfo.c | 3 +++ 3 files changed, 5 insertions(+), 8 deletions(-)
Signature · 1 line
2.15.1.355.g36791d7216
[Qemu-devel] [PULL 1/2] dump: fix note_name_equal()
Use the function argument "name" instead of hardcoded "VMCOREINFO". All callers use "VMCOREINFO" as argument, so this isn't an exposed bug, thankfully.
Simplify a little bit the code while touching this.
--- dump.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
dump.c +1 -6
@@ -788,12 +788,7 @@ static bool note_name_equal(DumpState *s,get_note_sizes (s, note, &head_size, &name_size,NULL ); head_size =ROUND_UP (head_size,4 ); -if (name_size != len || -memcmp (note + head_size,"VMCOREINFO" , len)) { -return false; - } - -return true; +return name_size == len &&memcmp (note + head_size, name, len) ==0 ; }/* write common header, sub header and elf note to vmcore */
Signature · 1 line
2.15.1.355.g36791d7216
[Qemu-devel] [PULL 2/2] dump-guest-memory.py: fix "You can't do that without a process to debug"
In reply to Marc-André LureauIf the script is run with a core (no running process), it produces an error:
(gdb) dump-guest-memory /tmp/vmcore X86_64
guest RAM blocks:target_start target_end host_addr message count
---------------- ---------------- ---------------- ------- -----
0000000000000000 00000000000a0000 00007f7935800000 added 1 00000000000a0000 00000000000b0000 00007f7934200000 added 2 00000000000c0000 00000000000ca000 00007f79358c0000 added 3 00000000000ca000 00000000000cd000 00007f79358ca000 joined 3 00000000000cd000 00000000000e8000 00007f79358cd000 joined 3 00000000000e8000 00000000000f0000 00007f79358e8000 joined 3 00000000000f0000 0000000000100000 00007f79358f0000 joined 3 0000000000100000 0000000080000000 00007f7935900000 joined 3 00000000fd000000 00000000fe000000 00007f7934200000 added 4 00000000fffc0000 0000000100000000 00007f7935600000 added 5
Python Exception <class 'gdb.error'> You can't do that without a process to debug.:
Error occurred in Python command: You can't do that without a process to debug.
Replace the object_resolve_path_type() function call with a local volatile variable.
--- scripts/dump-guest-memory.py | 3 +-- hw/misc/vmcoreinfo.c | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-)
scripts/dump-guest-memory.py +1 -2
@@ -546,8 +546,7 @@ shape and this command should mostly work.""" return None def add_vmcoreinfo(self): - vmci = '(VMCoreInfoState *)' + \ - 'object_resolve_path_type("", "vmcoreinfo", 0)' + vmci = 'vmcoreinfo_realize::vmcoreinfo_state' if not gdb.parse_and_eval("%s" % vmci) \ or not gdb.parse_and_eval("(%s)->has_vmcoreinfo" % vmci): return
hw/misc/vmcoreinfo.c +3 -0
@@ -35,6 +35,8 @@ static void vmcoreinfo_realize(DeviceState *dev, Error **errp) {VMCoreInfoState *s =VMCOREINFO (dev);FWCfgState *fw_cfg =fw_cfg_find (); +/* for gdb script dump-guest-memory.py */ + static VMCoreInfoState * volatile vmcoreinfo_state G_GNUC_UNUSED;/* Given that this function is executing, there is at least one VMCOREINFO * device. Check if there are several.
@@ -56,6 +58,7 @@ static void vmcoreinfo_realize(DeviceState *dev, Error **errp) &s->vmcoreinfo, sizeof(s->vmcoreinfo), false);qemu_register_reset (vmcoreinfo_reset, dev); + vmcoreinfo_state = s; }static const VMStateDescription vmstate_vmcoreinfo = {
Signature · 1 line
2.15.1.355.g36791d7216
Peter Maydell
AppliedQuoted 21 lines · Marc-André Lureau
The following changes since commit
281f327487c9c9b1599f93c589a408bbf4a651b8:Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.12-pull-request' into staging (2017-12-22 00:11:36 +0000)
are available in the Git repository at:
https://github.com/elmarco/qemu.git tags/dump-pull-request
for you to fetch changes up to
c3b1642b9b6b3ba4314d6be3be509d396372cfd5:
dump-guest-memory.py: fix "You can't do that without a process to debug" (2018-01-02 14:49:54 +0100)----------------------------------------------------------------
----------------------------------------------------------------
Marc-André Lureau (2):
dump: fixnote_name_equal()
dump-guest-memory.py: fix "You can't do that without a process to
debug"
Quoted 4 lines
scripts/dump-guest-memory.py | 3 +-- dump.c | 7 +------ hw/misc/vmcoreinfo.c | 3 +++ 3 files changed, 5 insertions(+), 8 deletions(-)
Applied, thanks.
-- PMM