dwarf2asm.c (dw2_asm_output_nstring): Encode double quote character for AIX.
authorDavid Edelsohn <dje.gcc@gmail.com>
Tue, 25 Jul 2017 13:11:37 +0000 (13:11 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Tue, 25 Jul 2017 13:11:37 +0000 (09:11 -0400)
        * dwarf2asm.c (dw2_asm_output_nstring): Encode double quote
        character for AIX.
        * dwarf2out.c (output_macinfo): Copy debug_line_section_label
        to dl_section_ref.  On AIX, append an expression to subtract
        the size of the section length to dl_section_ref.

From-SVN: r250516

gcc/ChangeLog
gcc/dwarf2asm.c
gcc/dwarf2out.c

index 2a756bee60f69243a0cc27192ccf409c58797198..5a623bd6ddc611024644c25df4bda826e959e0cd 100644 (file)
@@ -1,3 +1,11 @@
+2017-07-25  David Edelsohn  <dje.gcc@gmail.com>
+
+       * dwarf2asm.c (dw2_asm_output_nstring): Encode double quote
+       character for AIX.
+       * dwarf2out.c (output_macinfo): Copy debug_line_section_label
+       to dl_section_ref.  On AIX, append an expression to subtract
+       the size of the section length to dl_section_ref.
+
 2017-07-25  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * configure.ac: If any of the config.* scripts fail, exit 1.
index 3f420405038738fba3913ee96e1b38fb9c3e53f0..8e3e86f224c1e02d481a0b4992eaad0b408efe04 100644 (file)
@@ -345,7 +345,9 @@ dw2_asm_output_nstring (const char *str, size_t orig_len,
       for (i = 0; i < len; i++)
        {
          int c = str[i];
-         if (c == '\"' || c == '\\')
+         if (c == '\"')
+           fputc (XCOFF_DEBUGGING_INFO ? '\"' : '\\', asm_out_file);
+         else if (c == '\\')
            fputc ('\\', asm_out_file);
          if (ISPRINT (c))
            fputc (c, asm_out_file);
index 201045075a1255cf723f3c0858acec1b20383a66..5231683ee9e2b01354d2256d40feaf70c8d1a5c1 100644 (file)
@@ -26975,6 +26975,7 @@ output_macinfo (void)
   macinfo_entry *ref;
   vec<macinfo_entry, va_gc> *files = NULL;
   macinfo_hash_type *macinfo_htab = NULL;
+  char dl_section_ref[MAX_ARTIFICIAL_LABEL_BYTES];
 
   if (! length)
     return;
@@ -26985,6 +26986,12 @@ output_macinfo (void)
              && (int) DW_MACINFO_start_file == (int) DW_MACRO_start_file
              && (int) DW_MACINFO_end_file == (int) DW_MACRO_end_file);
 
+  /* AIX Assembler inserts the length, so adjust the reference to match the
+     offset expected by debuggers.  */
+  strcpy (dl_section_ref, debug_line_section_label);
+  if (XCOFF_DEBUGGING_INFO)
+    strcat (dl_section_ref, DWARF_INITIAL_LENGTH_SIZE_STR);
+
   /* For .debug_macro emit the section header.  */
   if (!dwarf_strict || dwarf_version >= 5)
     {
@@ -26995,7 +27002,7 @@ output_macinfo (void)
       else
        dw2_asm_output_data (1, 2, "Flags: 32-bit, lineptr present");
       dw2_asm_output_offset (DWARF_OFFSET_SIZE,
-                             (!dwarf_split_debug_info ? debug_line_section_label
+                             (!dwarf_split_debug_info ? dl_section_ref
                               : debug_skeleton_line_section_label),
                              debug_line_section, NULL);
     }