Message ID | 201104191540.18889.ebotcazou@adacore.com |
---|---|
State | New |
Headers | show |
On 04/19/2011 06:40 AM, Eric Botcazou wrote: > - if (SUPPORTS_DISCRIMINATOR && discriminator != 0) > + if (SUPPORTS_DISCRIMINATOR > + && discriminator != 0 > + && (dwarf_version >= 4 || !dwarf_strict)) > fprintf (asm_out_file, " discriminator %d", discriminator); How is this not redundant with the existing /* The discriminator column was added in dwarf4. Simplify the below by simply removing it if we're not supposed to output it. */ if (dwarf_version < 4 && dwarf_strict) discriminator = 0; check near the top of the function? r~
> How is this not redundant with the existing > > /* The discriminator column was added in dwarf4. Simplify the below > by simply removing it if we're not supposed to output it. */ > if (dwarf_version < 4 && dwarf_strict) > discriminator = 0; > > check near the top of the function? Obviously I missed this recent change, sorry. So the question is: would the change be appropriate for the release branches, where we emit the directive unconditionally, i.e 4.5 and 4.6 branches, or would mine be safer for them? This directive apparently confuses (some versions of) the Wind River debugger.
On 04/20/2011 12:09 PM, Eric Botcazou wrote: >> How is this not redundant with the existing >> >> /* The discriminator column was added in dwarf4. Simplify the below >> by simply removing it if we're not supposed to output it. */ >> if (dwarf_version < 4 && dwarf_strict) >> discriminator = 0; >> >> check near the top of the function? > > Obviously I missed this recent change, sorry. So the question is: would the > change be appropriate for the release branches, where we emit the directive > unconditionally, i.e 4.5 and 4.6 branches, or would mine be safer for them? Let's try to keep the branches more similar than not. It's just as safe, since prior to mainline we ignore the discriminator when not emitting via gas directive. r~
Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 172693) +++ dwarf2out.c (working copy) @@ -22232,7 +22240,9 @@ dwarf2out_source_line (unsigned int line fprintf (asm_out_file, "\t.loc %d %d 0", file_num, line); if (is_stmt != table->is_stmt) fprintf (asm_out_file, " is_stmt %d", is_stmt ? 1 : 0); - if (SUPPORTS_DISCRIMINATOR && discriminator != 0) + if (SUPPORTS_DISCRIMINATOR + && discriminator != 0 + && (dwarf_version >= 4 || !dwarf_strict)) fprintf (asm_out_file, " discriminator %d", discriminator); fputc ('\n', asm_out_file); }