aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2018-09-18 14:05:47 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2018-09-18 14:05:47 -0700
commit9f235e09e4d3dc6820e2d667200fe09b3e73b623 (patch)
tree214114ebdbd1344fe82b10e61c58a28158d21141 /gdb/fbsd-tdep.c
parentExpect optional "arch=" when executing "-stack-list-frames" on gdb.arch/amd64... (diff)
downloadbinutils-gdb-9f235e09e4d3dc6820e2d667200fe09b3e73b623.tar.gz
binutils-gdb-9f235e09e4d3dc6820e2d667200fe09b3e73b623.tar.bz2
binutils-gdb-9f235e09e4d3dc6820e2d667200fe09b3e73b623.zip
Use KF_PATH to verify the size of a struct kinfo_file.
fbsd_core_vnode_path needs to use the offset of the kf_path member of struct kinfo_file as the minimum size of a struct kinfo_file object. However, it was using KVE_PATH instead due to a copy and paste bug. While here, fix another copy and paste bug in the error message for a truncated kinfo_file object. gdb/ChangeLog: * fbsd-tdep.c (fbsd_core_vnode_path): Use KF_PATH instead of KVE_PATH.
Diffstat (limited to 'gdb/fbsd-tdep.c')
-rw-r--r--gdb/fbsd-tdep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
index ed430871693..48544b5370f 100644
--- a/gdb/fbsd-tdep.c
+++ b/gdb/fbsd-tdep.c
@@ -781,13 +781,13 @@ fbsd_core_vnode_path (struct gdbarch *gdbarch, int fd)
/* Skip over the structure size. */
descdata += 4;
- while (descdata + KVE_PATH < descend)
+ while (descdata + KF_PATH < descend)
{
ULONGEST structsize;
structsize = bfd_get_32 (core_bfd, descdata + KF_STRUCTSIZE);
- if (structsize < KVE_PATH)
- error (_("malformed core note - vmmap entry too small"));
+ if (structsize < KF_PATH)
+ error (_("malformed core note - file structure too small"));
if (bfd_get_32 (core_bfd, descdata + KF_TYPE) == KINFO_FILE_TYPE_VNODE
&& bfd_get_signed_32 (core_bfd, descdata + KF_FD) == fd)