summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-28 13:25:40 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-28 13:25:40 +0000
commit7a948e40c6765ac9540bbc1efcb615117598f67f (patch)
treeb251f5c0c9d8c810c58b813fb87863aafc3a10b1
parent8e86e0cceecc15b7f793347acc86266df2879c69 (diff)
downloadgcc-7a948e40c6765ac9540bbc1efcb615117598f67f.tar.gz
Backport from mainline
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@250663 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/dwarf2asm.c4
-rw-r--r--gcc/dwarf2out.c9
3 files changed, 22 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9e175941725..efa626e31e7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2017-07-28 David Edelsohn <dje.gcc@gmail.com>
+
+ Backport from mainline
+ 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-28 Bin Cheng <bin.cheng@arm.com>
Backport from mainline r250496
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
index 3f420405038..8e3e86f224c 100644
--- a/gcc/dwarf2asm.c
+++ b/gcc/dwarf2asm.c
@@ -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);
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index f78aaa9e515..276990b1794 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -27076,6 +27076,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;
@@ -27086,6 +27087,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)
{
@@ -27096,7 +27103,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);
}