public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC 4.6.1 emits discriminators in DWARF2 mode
@ 2011-10-20 14:48 Anitha Boyapati
  2011-10-20 15:25 ` Paulo J. Matos
  2011-10-21  6:20 ` Eric Botcazou
  0 siblings, 2 replies; 4+ messages in thread
From: Anitha Boyapati @ 2011-10-20 14:48 UTC (permalink / raw)
  To: gcc

Hi,

I have recently switched to using GCC 4.6.1 (from 4.5.1) for AVR
target which supports only DWARF2 format. Now I notice a change in
.debug_line section format in 4.6.1.  A quick look at the assembly
shows that '.loc' directives are emitted with discriminators.


Firstly, aren't discriminators introduced in DWARF 4? Little more
digging shows that the following fix is missing in 4.6.1 release. It
breaks the current dwarf2 parsers/readers. I think it is worth filing
a bug.

http://gcc.gnu.org/viewcvs/trunk/gcc/dwarf2out.c?r1=171846&r2=171852&diff_format=h

Secondly, in gcc4.5.1, the directive (.loc) is not emitted and still
we are able to map line numbers to address. Please help me understand
how introducing .loc directive affects debug_line format in gcc 4.6.1.

Thanks
--
 Anitha

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC 4.6.1 emits discriminators in DWARF2 mode
  2011-10-20 14:48 GCC 4.6.1 emits discriminators in DWARF2 mode Anitha Boyapati
@ 2011-10-20 15:25 ` Paulo J. Matos
  2011-10-20 17:44   ` Anitha Boyapati
  2011-10-21  6:20 ` Eric Botcazou
  1 sibling, 1 reply; 4+ messages in thread
From: Paulo J. Matos @ 2011-10-20 15:25 UTC (permalink / raw)
  To: gcc

On 20/10/11 15:06, Anitha Boyapati wrote:
>
> Firstly, aren't discriminators introduced in DWARF 4? Little more
> digging shows that the following fix is missing in 4.6.1 release. It
> breaks the current dwarf2 parsers/readers. I think it is worth filing
> a bug.
>

Anitha, if you only want dwarf2 produced, with no extensions you should 
use on the command line -gdwarf-2 -gstrict-dwarf. That should block any 
extensions to dwarf2.

-- 
PMatos

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC 4.6.1 emits discriminators in DWARF2 mode
  2011-10-20 15:25 ` Paulo J. Matos
@ 2011-10-20 17:44   ` Anitha Boyapati
  0 siblings, 0 replies; 4+ messages in thread
From: Anitha Boyapati @ 2011-10-20 17:44 UTC (permalink / raw)
  To: gcc; +Cc: Paulo J. Matos

On 20 October 2011 20:27, Paulo J. Matos <paulo@matos-sorge.com> wrote:
> On 20/10/11 15:06, Anitha Boyapati wrote:
>>
>> Firstly, aren't discriminators introduced in DWARF 4? Little more
>> digging shows that the following fix is missing in 4.6.1 release. It
>> breaks the current dwarf2 parsers/readers. I think it is worth filing
>> a bug.
>>
>
> Anitha, if you only want dwarf2 produced, with no extensions you should use
> on the command line -gdwarf-2 -gstrict-dwarf. That should block any
> extensions to dwarf2.

I did try that already. Inspite of giving -gstrict-dwarf2, it
generates .loc info with discriminators.
For e.g,

$ avr-gcc  test.c -gstrict-dwarf -S  -mmcu=atxmega128a1 -g -gdwarf-2

.LFB0:
    .file 1 "test.c"
    .loc 1 3 0
    push r28
...
.L5:
    .loc 1 9 0
    std Y+3,__zero_reg__
    std Y+4,__zero_reg__
    rjmp .L3
.L4:
    .loc 1 9 0 is_stmt 0 discriminator 2
    ldd r24,Y+3
 ...


(Note that the gcc version is 4.6.1) A look at gcc-4_6_branch log says
that the fix is not backported when it got fixed in trunk (link given
in previous mail)




-- 
 Anitha

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC 4.6.1 emits discriminators in DWARF2 mode
  2011-10-20 14:48 GCC 4.6.1 emits discriminators in DWARF2 mode Anitha Boyapati
  2011-10-20 15:25 ` Paulo J. Matos
@ 2011-10-21  6:20 ` Eric Botcazou
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Botcazou @ 2011-10-21  6:20 UTC (permalink / raw)
  To: Anitha Boyapati; +Cc: gcc

> Firstly, aren't discriminators introduced in DWARF 4? Little more
> digging shows that the following fix is missing in 4.6.1 release. It
> breaks the current dwarf2 parsers/readers. I think it is worth filing
> a bug.
>
> http://gcc.gnu.org/viewcvs/trunk/gcc/dwarf2out.c?r1=171846&r2=171852&diff_f
>ormat=h

Yes, this is a real nuisance for some DWARF consumers.  You need to ask a RM 
about backporting the fix.

> Secondly, in gcc4.5.1, the directive (.loc) is not emitted and still
> we are able to map line numbers to address. Please help me understand
> how introducing .loc directive affects debug_line format in gcc 4.6.1.

.loc directives are processed by the assembler, which then builds .debug_line.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-20 21:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-20 14:48 GCC 4.6.1 emits discriminators in DWARF2 mode Anitha Boyapati
2011-10-20 15:25 ` Paulo J. Matos
2011-10-20 17:44   ` Anitha Boyapati
2011-10-21  6:20 ` Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).