From 7f9783c8f59af51fbeb0aaf1d2f63e0a7347f8cc Mon Sep 17 00:00:00 2001 From: Serdar Kocdemir Date: Wed, 31 Jul 2024 16:30:27 +0100 Subject: [PATCH] Add error messages for unhandled extensions Print missing structure information before calling abort. Reviewed-by: Aaron Ruby Acked-by: Yonggang Luo Acked-by: Adam Jackson Part-of: --- src/gfxstream/codegen/scripts/cereal/marshaling.py | 4 +++- src/gfxstream/codegen/scripts/cereal/reservedmarshaling.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gfxstream/codegen/scripts/cereal/marshaling.py b/src/gfxstream/codegen/scripts/cereal/marshaling.py index c5fd350e45a..8fc67ddd6b9 100644 --- a/src/gfxstream/codegen/scripts/cereal/marshaling.py +++ b/src/gfxstream/codegen/scripts/cereal/marshaling.py @@ -936,7 +936,9 @@ class VulkanMarshaling(VulkanWrapperGenerator): cgen.stmt("(void)pNext_placeholder") def fatalDefault(cgen): - cgen.line("// fatal; the switch is only taken if the extension struct is known"); + cgen.line("// fatal; the switch is only taken if the extension struct is known") + if self.variant != "guest": + cgen.stmt("fprintf(stderr, \" %s, Unhandled Vulkan structure type %s [%d], aborting.\\n\", __func__, string_VkStructureType(VkStructureType(structType)), structType)") cgen.stmt("abort()") pass diff --git a/src/gfxstream/codegen/scripts/cereal/reservedmarshaling.py b/src/gfxstream/codegen/scripts/cereal/reservedmarshaling.py index 9a75198fb9e..053462661a5 100644 --- a/src/gfxstream/codegen/scripts/cereal/reservedmarshaling.py +++ b/src/gfxstream/codegen/scripts/cereal/reservedmarshaling.py @@ -1013,7 +1013,9 @@ class VulkanReservedMarshaling(VulkanWrapperGenerator): cgen.stmt("(void)pNext_placeholder") def fatalDefault(cgen): - cgen.line("// fatal; the switch is only taken if the extension struct is known"); + cgen.line("// fatal; the switch is only taken if the extension struct is known") + if self.variant != "guest": + cgen.stmt("fprintf(stderr, \" %s, Unhandled Vulkan structure type %s [%d], aborting.\\n\", __func__, string_VkStructureType(VkStructureType(structType)), structType)") cgen.stmt("abort()") pass