-----BEGIN PGP SIGNATURE-----

iQIcBAABAgAGBQJaS45eAAoJENro4Ql1lpzlsAAP/2juCPXAzC64AE8wTe8N87e2
 LRe/N10akx3VcgXPrF9KrgFba4PDNvX57GI4UdPJAH6fK26Trwf1KfnteNS2WoXa
 fBcngKaLWCwTzcxCPhfllozFuUeVdy4ptRtQhs3MpnAihZxnMliy2Rk0LYF0bmL3
 qA7192mqNF+ClrLr1tqV4/+SZILPS5Hb/JwpmYTqiOSbrC/RprqGOttBTAm3lmXR
 zrb3H9MPzbZAz2mXdz2WEqVWfvJkU51Kx0IH/zOj3OL1LNRutiVgL6FATLgzhbFE
 9bhrJRXRW/xTl47R3HHEUQUs8lqobmPFchqHd87MylU9HtKS+j+9F0Vs/k72kwT3
 cDrUNqW28OpSHWUPK9IaWbA5ro8DiqmLwXMCWPkZtGPxZojWFixnPPBRkaK+R/1S
 OKHSLXC2262iOKT0H+ia9S39q1+ASb5aOKx3pvUqb6PIf8+Qm7avgnKVUADPHRY8
 Txzo79SeselewTP08JqPUgdi74+drfSpuJdOayaSqB1nfakEIQDXlWx1cdvSIA6t
 fQPXdjXvQ7aB9x9knqQdLEg56XVdrvHzB5gDEYMRgMzULR/yCTEkRfIjR4d45A6X
 /O4tpvNLZ1VG3ULXyDB2vwuHPPpAYpTe2WxIrdACIvAOHE42WY3AuApBq+ysFAxL
 5J6DBuW+2Oz+6wZXZEdX
 =NqXd
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/elmarco/tags/dump-pull-request' into staging

# gpg: Signature made Tue 02 Jan 2018 13:51:26 GMT
# gpg:                using RSA key 0xDAE8E10975969CE5
# 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.py: fix "You can't do that without a process to debug"
  dump: fix note_name_equal()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2018-01-08 21:02:07 +00:00
commit 4bd797af6f
3 changed files with 5 additions and 8 deletions

7
dump.c
View File

@ -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 */

View File

@ -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 = {

View File

@ -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