summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Domani <ssbssa@yahoo.de>2022-04-17 14:30:55 +0200
committerHannes Domani <ssbssa@yahoo.de>2022-04-18 16:27:56 +0200
commit48852b4dc8299e550c15e9a8e6a1b7afd5a437bb (patch)
treeb78f11276fded582c1d098d28dfd237ba699be7e
parentf6201a399af51b8bdca6dbb7bac496519e966aac (diff)
downloadbinutils-gdb-48852b4dc8299e550c15e9a8e6a1b7afd5a437bb.tar.gz
PDB: bitfields
-rw-r--r--gdb/windows-nat.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index fefdee0b6ea..b9b909c0377 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -3578,7 +3578,6 @@ static type *get_pdb_type_cached (pdb_line_info *pli, DWORD type_index)
+ children * sizeof (ULONG)));
members->Count = children;
members->Start = 0;
- // TODO: bitfields
if (pli->fSymGetTypeInfo (pli->p, pli->addr, type_index,
TI_FINDCHILDREN, members.get ()))
{
@@ -3610,7 +3609,19 @@ static type *get_pdb_type_cached (pdb_line_info *pli, DWORD type_index)
t->field (i).set_type (get_pdb_type (pli, tid));
t->field (i).set_name (wchar_to_objfile
(pli, nameW));
- t->field (i).set_loc_bitpos (ofs * 8);
+ DWORD bitofs = 0;
+ DWORD bitpos;
+ if (pli->fSymGetTypeInfo
+ (pli->p, pli->addr, members->ChildId[i],
+ TI_GET_BITPOSITION, &bitpos)
+ && pli->fSymGetTypeInfo
+ (pli->p, pli->addr, members->ChildId[i],
+ TI_GET_LENGTH, &length))
+ {
+ bitofs = bitpos;
+ FIELD_BITSIZE (t->field (i)) = length;
+ }
+ t->field (i).set_loc_bitpos (ofs * 8 + bitofs);
}
}
}