Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2021-02

dwarf 2 warning CIE

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dimitrios Chr. Ioannidis

Hi,

  while I investigate some problems I'm having regarding avr debugging, I noticed that the dwarf 2 / 3 generation gives a warning when I call a procedure from another unit. Is it a bug or because it's a warning I can safely ignore it ?

Reading dwarf information with avr-embedded-objdump.exe --dwarf returns : "avr-embedded-objdump.exe: Warning: Invalid CIE pointer 0x00c80000 in FDE at 0x000014"

This is the debug frame section ( avr-embedded-objdump.exe --dwarf=frames dwarf_CIE_FDE_Bug.elf )

"dwarf_CIE_FDE_Bug.elf:     file format elf32-avr

Contents of the .debug_frame section:

00000000 0010 ffffffff CIE
  Version:               1
  Augmentation:          ""
  Code alignment factor: 1
  Data alignment factor: -4
  Return address column: 24

  DW_CFA_def_cfa: r32 ofs 2
  DW_CFA_offset_extended: r36 at cfa+0
  DW_CFA_nop

00000014 0000 00c80000 FDE cie=fd39e538 pc=0002..0002"

The test program :

==========CODE=========

program dwarf_CIE_FDE_Bug;
uses
   dwarf_CIE_FDE_Bug_used_unit;
begin
   dummy;
end.

==========CODE=========

==========CODE=========

unit dwarf_CIE_FDE_Bug_used_unit;
interface
procedure dummy;
implementation
procedure dummy;
begin
end;
end.

==========CODE=========

Compiled with : "ppcrossavr.exe -MObjFPC -Tembedded -Pavr -CpAVR5 -WpATMEGA328p -Xm -gw2 -O1 dwarf_CIE_FDE_Bug.pas"

I'm using fpc trunk on Windows 10 :

"Free Pascal Compiler version 3.3.1

Compiler date      : 2021/02/02
Compiler CPU target: avr"

regards,

Dimitrios Chr. Ioannidis

Reply by email

Christo Crause
to Dimitrios Chr. Ioannidis

On Tue, Feb 2, 2021 at 12:28 PM Dimitrios Chr. Ioannidis via fpc-devel <

Show quoted text 7 lines
wrote: Reading dwarf information with avr-embedded-objdump.exe --dwarf returns : "avr-embedded-objdump.exe: Warning: Invalid CIE pointer 0x00c80000 in FDE at 0x000014"

I get the same warning on Linux using avr-objdump (GNU objdump (GNU Binutils) 2.26.20160125), your test code and all of the dwarf debug options in the compiler. Not sure if this is really a problem when debugging with gdb, I've managed to debug across units before. Do you have a reproducible problematic debug situation that can be tested?

Reply by email

Dimitrios Chr. Ioannidis
to Christo Crause

Hi,

Christo Crause wrote 14 lines
On Tue, Feb 2, 2021 at 12:28 PM Dimitrios Chr. Ioannidis via fpc-devel wrote: > Reading dwarf information with avr-embedded-objdump.exe --dwarf > returns > : "avr-embedded-objdump.exe: Warning: Invalid CIE pointer 0x00c80000 > in > FDE at 0x000014" I get the same warning on Linux using avr-objdump (GNU objdump (GNU Binutils) 2.26.20160125), your test code and all of the dwarf debug options in the compiler.  Not sure if this is really a problem when debugging with gdb, I've managed to debug across units before. Do you have a reproducible problematic debug situation that can be tested?

 I checked with the dwarf 2.o specification and I read that "in FDE (Frame Description Entry) there is a CIE_pointer field which is a uword constant offset into the .debug_frame section that denotes the CIE that is associated with this FDE."

 AFAIU, both are used, among others of course, to provide virtual unwind information to debugger . But here there is a problem, IMO, the FDE has an CIE_id of fd39e538 but there is none CIE with that id. There is only one CIE with id ffffffff .

"dwarf_CIE_FDE_Bug.elf:     file format elf32-avr

Contents of the .debug_frame section:

00000000 0010 ffffffff CIE
  Version:               1
  Augmentation:          ""
  Code alignment factor: 1
  Data alignment factor: -4
  Return address column: 24

  DW_CFA_def_cfa: r32 ofs 2
  DW_CFA_offset_extended: r36 at cfa+0
  DW_CFA_nop

00000014 0000 00c80000 FDE cie=fd39e538 pc=0002..0002"

Of course I maybe be wrong and this is not a problem.

regards,

Dimitrios Chr. Ioannidis

Reply by email

Dimitrios Chr. Ioannidis
to Dimitrios Chr. Ioannidis

Hi,

Στις 2/2/2021 7:33 μ.μ., ο/η Dimitrios Chr. Ioannidis via fpc-devel έγραψε:

Show quoted text 28 lines
Hi, On 2021-02-02 18:47, Christo Crause wrote: > On Tue, Feb 2, 2021 at 12:28 PM Dimitrios Chr. Ioannidis via fpc-devel > wrote: > >> Reading dwarf information with avr-embedded-objdump.exe --dwarf >> returns >> : "avr-embedded-objdump.exe: Warning: Invalid CIE pointer 0x00c80000 >> in >> FDE at 0x000014" > > I get the same warning on Linux using avr-objdump (GNU objdump (GNU > Binutils) 2.26.20160125), your test code and all of the dwarf debug > options in the compiler.  Not sure if this is really a problem when > debugging with gdb, I've managed to debug across units before.  Do you > have a reproducible problematic debug situation that can be tested?  I checked with the dwarf 2.o specification and I read that "in FDE (Frame Description Entry) there is a CIE_pointer field which is a uword constant offset into the .debug_frame section that denotes the CIE that is associated with this FDE."  AFAIU, both are used, among others of course, to provide virtual unwind information to debugger . But here there is a problem, IMO, the FDE has an CIE_id of fd39e538 but there is none CIE with that id. There is only one CIE with id ffffffff .

Correction ! There is only one CIE with id 00000000 not ffffffff ( copy past error, sorry ).

Show quoted text 32 lines
"dwarf_CIE_FDE_Bug.elf:     file format elf32-avr Contents of the .debug_frame section: 00000000 0010 ffffffff CIE   Version:               1   Augmentation:          ""   Code alignment factor: 1   Data alignment factor: -4   Return address column: 24   DW_CFA_def_cfa: r32 ofs 2   DW_CFA_offset_extended: r36 at cfa+0   DW_CFA_nop 00000014 0000 00c80000 FDE cie=fd39e538 pc=0002..0002" Of course I maybe be wrong and this is not a problem. regards, -- Dimitrios Chr. Ioannidis _______________________________________________ fpc-devel maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Dimitrios Chr. Ioannidis
to Florian Klämpfl

Hi,

Στις 3/2/2021 10:06 μ.μ., ο/η Florian Klämpfl via fpc-devel έγραψε:

Show quoted text 9 lines
Am 02.02.21 um 11:24 schrieb Dimitrios Chr. Ioannidis via fpc-devel: > Hi, > >    while I investigate some problems I'm having regarding avr > debugging, I noticed that the dwarf 2 / 3 generation gives a warning > when I call a procedure from another unit. Is it a bug or because > it's a warning I can safely ignore it ? It was a bug, it should be fixed.

Just tested and the warning ( plus some debugging problems ) gone .

Thank you !

regards,

Dimitrios Chr. Ioannidis

Reply by email