This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 08/10] dwz -m support


>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> It does not work for macscp.exp:
Jan> +UNSUPPORTED: gdb.base/macscp.exp: Skipping test because debug information does not include macro information.

Jan> There is needed at least the patch below but then is still some mismatch
Jan> between main and .dwz file.

Thanks, and sorry about that.  Here is the fix I am checking in.

Your patch was correct but we also need to handle
DW_MACRO_GNU_define_indirect and DW_MACRO_GNU_undef_indirect specially
when the current section comes from the .dwz file.  In this case
these refer to the .dwz file, not the main file.

Tom

2012-07-20  Jan Kratochvil <jan.kratochvil@redhat.com>
	    Tom Tromey  <tromey@redhat.com>

	* dwarf2read.c (dwarf_decode_macros)
	<DW_MACRO_GNU_define_indirect_alt, DW_MACRO_GNU_undef_indirect_alt,
	DW_MACRO_GNU_transparent_include_alt>: New cases.
	(dwarf_decode_macro_bytes) <DW_MACRO_GNU_define_indirect,
	DW_MACRO_GNU_undef_indirect>: Examine 'section_is_dwz'.

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 8868540..75d257d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -17540,7 +17540,8 @@ dwarf_decode_macro_bytes (bfd *abfd, gdb_byte *mac_ptr, gdb_byte *mac_end,
 		mac_ptr += offset_size;
 
 		if (macinfo_type == DW_MACRO_GNU_define_indirect_alt
-		    || macinfo_type == DW_MACRO_GNU_undef_indirect_alt)
+		    || macinfo_type == DW_MACRO_GNU_undef_indirect_alt
+		    || section_is_dwz)
 		  {
 		    struct dwz_file *dwz = dwarf2_get_dwz_file ();
 
@@ -17863,6 +17864,8 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
 
 	case DW_MACRO_GNU_define_indirect:
 	case DW_MACRO_GNU_undef_indirect:
+	case DW_MACRO_GNU_define_indirect_alt:
+	case DW_MACRO_GNU_undef_indirect_alt:
 	  {
 	    unsigned int bytes_read;
 
@@ -17873,6 +17876,7 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
 	  break;
 
 	case DW_MACRO_GNU_transparent_include:
+	case DW_MACRO_GNU_transparent_include_alt:
 	  /* Note that, according to the spec, a transparent include
 	     chain cannot call DW_MACRO_GNU_start_file.  So, we can just
 	     skip this opcode.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]