diff options
author | Hannes Domani <ssbssa@yahoo.de> | 2022-04-17 14:30:55 +0200 |
---|---|---|
committer | Hannes Domani <ssbssa@yahoo.de> | 2022-04-18 16:27:56 +0200 |
commit | 48852b4dc8299e550c15e9a8e6a1b7afd5a437bb (patch) | |
tree | b78f11276fded582c1d098d28dfd237ba699be7e | |
parent | f6201a399af51b8bdca6dbb7bac496519e966aac (diff) | |
download | binutils-gdb-48852b4dc8299e550c15e9a8e6a1b7afd5a437bb.tar.gz |
PDB: bitfields
-rw-r--r-- | gdb/windows-nat.c | 15 |
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); } } } |