[v8windbg] Skip undefined types in Torque structs

The test cctest/test-v8windbg recently started failing because the
v8windbg debugger extension is unable to read the "flags" field on a
SharedFunctionInfo instance. This occurs because one of the bitfields
within "flags" has type OSRCodeCacheStateOfSFI, which is only declared
using an "opaque enum declaration":

  enum OSRCodeCacheStateOfSFI : uint8_t;

When WinDbg fails in its attempt to look up that type, v8windbg responds
by failing to construct anything at all for "flags". However, the other
17 bitfields in "flags" can be represented successfully, so a more
useful behavior is to just skip the one failed entry.

Change-Id: I40630548d21499e49f0214da28260318a38d9360
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3653096
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#80615}
This commit is contained in:
Seth Brenith 2022-05-17 14:59:56 -07:00 committed by V8 LUCI CQ
parent 0f4731c825
commit 3a558456a9

View File

@ -277,13 +277,17 @@ HRESULT GetModelForStruct(const uint64_t address,
for (const StructField& field : fields) {
WRL::ComPtr<IModelObject> field_model;
if (field.num_bits == 0) {
RETURN_IF_FAIL(GetModelForBasicField(
address + field.offset, field.type_name, field.uncompressed_type_name,
sp_ctx, &field_model));
if (FAILED(GetModelForBasicField(address + field.offset, field.type_name,
field.uncompressed_type_name, sp_ctx,
&field_model))) {
continue;
}
} else {
RETURN_IF_FAIL(GetModelForBitField(address + field.offset, field.num_bits,
field.shift_bits, field.type_name,
sp_ctx, &field_model));
if (FAILED(GetModelForBitField(address + field.offset, field.num_bits,
field.shift_bits, field.type_name, sp_ctx,
&field_model))) {
continue;
}
}
RETURN_IF_FAIL(
sp_value->SetKey(reinterpret_cast<const wchar_t*>(field.name.c_str()),