On 07/15/2011 08:42 AM, Jakub Jelinek wrote: > The newly added opcodes: > DW_MACINFO_GNU_define_indirect 0xe0 > This opcode has two arguments, one is uleb128 lineno and the > other is offset size long byte offset into .debug_str. Except > for the encoding of the string it is similar to DW_MACINFO_define. > DW_MACINFO_GNU_undef_indirect 0xe1 > This opcode has two arguments, one is uleb128 lineno and the > other is offset size long byte offset into .debug_str. Except > for the encoding of the string it is similar to DW_MACINFO_undef. > DW_MACINFO_GNU_transparent_include 0xe2 > This opcode has a single argument, a offset size long byte offset into > .debug_macinfo. It instructs the debug info consumer that > this opcode during reading should be replaced with the sequence > of .debug_macinfo opcodes from the mentioned offset, up to > a terminating 0 opcode (not including that 0). > DW_MACINFO_GNU_define_opcode 0xe3 > This is an opcode for future extensibility through which > a debugger could skip unknown opcodes. It has 3 arguments: > 1 byte opcode number, uleb128 count of arguments and > a count bytes long array, with a DW_FORM_* code how the > argument is encoded.
I do like the new opcodes. Elsewhere you described transparent_include as also saving state about defined opcodes around the include. Do you want to either describe that or drop it? > + case DW_MACINFO_define: > + case DW_MACINFO_undef: > +#ifdef OBJECT_FORMAT_ELF > + if (!dwarf_strict > + && HAVE_COMDAT_GROUP > + && VEC_length (macinfo_entry, files) != 1 > + && i > 0 > + && i + 1 < length > + && VEC_index (macinfo_entry, macinfo_table, i - 1)->code == 0) > + { > + char linebuf[sizeof (HOST_WIDE_INT) * 3 + 1]; > + unsigned char checksum[16]; > + struct md5_ctx ctx; I'd like to see this broken out into some functions, and avoid as much code as possible within ifdefs. Perhaps some_function (...) { #ifndef OBJECT_FORMAT_ELF return; #endif // everything else } I think it also doesn't help review that there are no comments at all, and a preponderance of description-less variable names like "ref" and "ref2". r~