forked from Imagelibrary/binutils-gdb
Warn if core file register section is larger than expected
When reading a core file register section which is larger than expected, emit a warning. Assume that a register section usually has exactly the size specified by the regset section iterator. In some special cases this assumption is wrong, or at least does not match the regset supply function's logic. Thus also add a way to suppress the warning in those cases, using a new flag REGSET_VARIABLE_SIZE. gdb/ChangeLog: * regset.h (struct regset): Add flags field. (REGSET_VARIABLE_SIZE): New value for a regset's flags field. * corelow.c (get_core_register_section): Add warning if the size exceeds the requested size and the regset does not have the REGSET_VARIABLE_SIZE flag set. * alphanbsd-tdep.c (alphanbsd_gregset): Add REGSET_VARIABLE_SIZE flag. * armbsd-tdep.c (armbsd_gregset): Likewise. * hppa-hpux-tdep.c (hppa_hpux_regset): Likewise. * hppaobsd-tdep.c (hppaobsd_gregset): Likewise. * m68kbsd-tdep.c (m68kbsd_gregset): Likewise. * mipsnbsd-tdep.c (mipsnbsd_gregset): Likewise.
This commit is contained in:
committed by
Ulrich Weigand
parent
dde9acd693
commit
f962539ad2
@@ -536,6 +536,11 @@ get_core_register_section (struct regcache *regcache,
|
||||
warning (_("Section `%s' in core file too small."), section_name);
|
||||
return;
|
||||
}
|
||||
if (size != min_size && !(regset->flags & REGSET_VARIABLE_SIZE))
|
||||
{
|
||||
warning (_("Unexpected size of section `%s' in core file."),
|
||||
section_name);
|
||||
}
|
||||
|
||||
contents = alloca (size);
|
||||
if (! bfd_get_section_contents (core_bfd, section, contents,
|
||||
|
||||
Reference in New Issue
Block a user