aboutsummaryrefslogtreecommitdiff
path: root/ld/pdb.h
diff options
context:
space:
mode:
authorMark Harmstone <mark@harmstone.com>2024-08-26 13:58:56 +0100
committerMark Harmstone <mark@harmstone.com>2024-08-26 16:12:52 +0100
commit91555eddd48726592478fc3fbe4a4dbce31384bf (patch)
tree6ba3974eae808ed8e174c00bbd21ef4058508261 /ld/pdb.h
parenta733b2c90463231d9fb8b143e168403d96efe54f (diff)
downloadgdb-91555eddd48726592478fc3fbe4a4dbce31384bf.zip
gdb-91555eddd48726592478fc3fbe4a4dbce31384bf.tar.gz
gdb-91555eddd48726592478fc3fbe4a4dbce31384bf.tar.bz2
ld/PDB: handle pointers to members
If the CV_PTR_MODE_PMEM or CV_PTR_MODE_PMFUNC flags were set in an LF_POINTER entry's attributes, there's a few extra bytes on the end that we weren't accounting for. Change handle_type so that we remap the containing_class field if it's present, and add a test for this.
Diffstat (limited to 'ld/pdb.h')
-rw-r--r--ld/pdb.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ld/pdb.h b/ld/pdb.h
index b98d386..a9b518a 100644
--- a/ld/pdb.h
+++ b/ld/pdb.h
@@ -303,6 +303,11 @@ struct lf_modifier
uint16_t padding;
} ATTRIBUTE_PACKED;
+/* enum CV_ptrmode_e in cvinfo.h, shifted by 5 for the lfPointerAttr bitfield */
+#define CV_PTR_MODE_MASK 0xe0
+#define CV_PTR_MODE_PMEM 0x40
+#define CV_PTR_MODE_PMFUNC 0x60
+
/* lfPointer in cvinfo.h */
struct lf_pointer
{
@@ -310,6 +315,10 @@ struct lf_pointer
uint16_t kind;
uint32_t base_type;
uint32_t attributes;
+ /* following only if CV_PTR_MODE_PMEM or CV_PTR_MODE_PMFUNC in attributes */
+ uint32_t containing_class;
+ uint16_t ptr_to_mem_type;
+ uint16_t padding;
} ATTRIBUTE_PACKED;
/* lfArgList in cvinfo.h (used for both LF_ARGLIST and LF_SUBSTR_LIST) */