From c41822609367e5cf39f1f610005be2131a7f1885 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Tue, 31 Jan 2006 18:08:24 +0100 Subject: [PATCH] widl: Changes to output for better debugability. Write the offset and the absolute address for referenced types. Write the current offset out when writing a pointer type. --- tools/widl/typegen.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 438a21174d1..8b6e0814828 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -842,9 +842,10 @@ static size_t write_struct_tfs(FILE *file, const type_t *type, /* total size */ print_file(file, 2, "NdrShort(0x%x), /* %u */\n", total_size, total_size); *typestring_offset += 4; - print_file(file, 2, "NdrShort(0x%x), /* %d */\n", + print_file(file, 2, "NdrShort(0x%x), /* offset = %d (%u) */\n", array_offset - *typestring_offset, - array_offset - *typestring_offset); + array_offset - *typestring_offset, + array_offset); *typestring_offset += 2; print_file(file, 2, "FC_END,\n"); *typestring_offset += 1; @@ -876,9 +877,10 @@ static size_t write_struct_tfs(FILE *file, const type_t *type, /* total size */ print_file(file, 2, "NdrShort(0x%x), /* %u */\n", total_size, total_size); *typestring_offset += 4; - print_file(file, 2, "NdrShort(0x%x), /* %d */\n", + print_file(file, 2, "NdrShort(0x%x), /* offset = %d (%u) */\n", array_offset - *typestring_offset, - array_offset - *typestring_offset); + array_offset - *typestring_offset, + array_offset); *typestring_offset += 2; print_file(file, 2, "FC_END,\n"); *typestring_offset += 1; @@ -992,6 +994,8 @@ static size_t write_typeformatstring_var(FILE *file, int indent, pointer_type = get_attrv(var->attrs, ATTR_POINTERTYPE); if (!pointer_type) pointer_type = RPC_FC_RP; + if (file) + fprintf(file, "/* %2u */\n", *typeformat_offset); print_file(file, indent, "0x%x, 0x00, /* %s */\n", pointer_type, pointer_type == RPC_FC_FP ? "FC_FP" : (pointer_type == RPC_FC_UP ? "FC_UP" : "FC_RP"));