[PATCH] DWARF: Call set_indirect_string on DW_MACINFO_start_file

H.J. Lu hongjiu.lu@intel.com
Wed Aug 22 19:36:00 GMT 2018


Since -gsplit-dwarf -g3 will output filename as indirect string, call
set_indirect_string on DW_MACINFO_start_file for -gsplit-dwarf -g3.

OK for trunk?

H.J.
--
	PR debug/79342
	* dwarf2out.c (save_macinfo_strings): Call set_indirect_string
	on DW_MACINFO_start_file for -gsplit-dwarf -g3
---
 gcc/dwarf2out.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index edf1ac35896..6ae0a4d66b4 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -28280,6 +28280,12 @@ save_macinfo_strings (void)
                 && (debug_str_section->common.flags & SECTION_MERGE) != 0)
               set_indirect_string (find_AT_string (ref->info));
             break;
+	  case DW_MACINFO_start_file:
+	    /* -gsplit-dwarf -g3 will also output filename as indirect
+	       string.  */
+	    if (!dwarf_split_debug_info)
+	      break;
+	    /* Fall through. */
 	  case DW_MACRO_define_strp:
 	  case DW_MACRO_undef_strp:
             set_indirect_string (find_AT_string (ref->info));
-- 
2.17.1



More information about the Gcc-patches mailing list