public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* question on dwarf2 debug-frame.
@ 2009-09-23 18:00 IainS
  2009-09-23 20:28 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: IainS @ 2009-09-23 18:00 UTC (permalink / raw)
  To: GCC Development

Hello,

I have this scenario:
  using  "dwarfdump --debug-frame" in a very simple object generated  
with current trunk.
I am trying to figure out (with the dwarf3 spec) wether the problem  
is in the tool (dwarfdump), or what we're emitting.
Can anyone more knowledgeable comment?

Iain.

----------------------------------------------------------------------
  File: simplistic.o { mach32-i386 }
----------------------------------------------------------------------

.debug_frame contents:

0x00000000: CIE
         length: 0x00000010
         CIE_id: 0xffffffff
        version: 0x01
   augmentation: ""
     code_align: 1
     data_align: -4
    ra_register: 0x08
   Initial Inst: DW_CFA_def_cfa (4, 4)
                 DW_CFA_offset (8, 0)
                 DW_CFA_nop
                 DW_CFA_nop
                 Init State: CFA( R4+4  )   R8=+0


0x00000014: FDE
         length: 0x00000028
    CIE_pointer: 0x00000000
     start_addr: 0x00000000
     range_size: 0x00000012
   Instructions: 0x00000000: CFA( R4+4  )   R8=+0
                 DW_CFA_advance_loc4 (1)
                 DW_CFA_def_cfa_offset (8)
                 DW_CFA_offset (5, -8)
                 0x00000001: CFA( R4+8  )   R5=-8   R8=+0
                 DW_CFA_advance_loc4 (2)
                 DW_CFA_def_cfa_register (5)
                 0x00000003: CFA( R5+8  )   R5=-8   R8=+0
                 DW_CFA_advance_loc4 (14)
                 DW_CFA_restore (5)
Assertion failed: (reg_state_pos != cie->initial_state.regs.end()),  
function ParseInstructions, file /SourceCache/dwarf_utilities/ 
dwarf_utilities-49/source/DWARFDebugFrame.cpp, line 353.
Abort trap

====
the -save-temps -dA output for this is:

	.section __DWARF,__debug_frame,regular,debug
Lframe0:
	.set L$set$0,LECIE0-LSCIE0
	.long L$set$0	# Length of Common Information Entry
LSCIE0:
	.long	0xffffffff	# CIE Identifier Tag
	.byte	0x1	# CIE Version
	.ascii "\0"	# CIE Augmentation
	.byte	0x1	# uleb128 0x1; CIE Code Alignment Factor
	.byte	0x7c	# sleb128 -4; CIE Data Alignment Factor
	.byte	0x8	# CIE RA Column
	.byte	0xc	# DW_CFA_def_cfa
	.byte	0x4	# uleb128 0x4
	.byte	0x4	# uleb128 0x4
	.byte	0x88	# DW_CFA_offset, column 0x8
	.byte	0x1	# uleb128 0x1
	.align 2
LECIE0:
LSFDE0:
	.set L$set$1,LEFDE0-LASFDE0
	.long L$set$1	# FDE Length
LASFDE0:
	.set L$set$2,Lframe0-Lsection__debug_frame
	.long L$set$2	# FDE CIE offset
	.long	LFB0	# FDE initial location
	.set L$set$3,LFE0-LFB0
	.long L$set$3	# FDE address range
	.byte	0x4	# DW_CFA_advance_loc4
	.set L$set$4,LCFI0-LFB0
	.long L$set$4
	.byte	0xe	# DW_CFA_def_cfa_offset
	.byte	0x8	# uleb128 0x8
	.byte	0x85	# DW_CFA_offset, column 0x5
	.byte	0x2	# uleb128 0x2
	.byte	0x4	# DW_CFA_advance_loc4
	.set L$set$5,LCFI1-LCFI0
	.long L$set$5
	.byte	0xd	# DW_CFA_def_cfa_register
	.byte	0x5	# uleb128 0x5
	.byte	0x4	# DW_CFA_advance_loc4
	.set L$set$6,LCFI3-LCFI1
	.long L$set$6
	.byte	0xc5	# DW_CFA_restore, column 0x5
	.byte	0xc	# DW_CFA_def_cfa
	.byte	0x4	# uleb128 0x4
	.byte	0x4	# uleb128 0x4
	.align 2
LEFDE0:

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

* Re: question on dwarf2 debug-frame.
  2009-09-23 18:00 question on dwarf2 debug-frame IainS
@ 2009-09-23 20:28 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2009-09-23 20:28 UTC (permalink / raw)
  To: IainS; +Cc: GCC Development

On 09/23/2009 11:00 AM, IainS wrote:
> DW_CFA_restore (5)
> Assertion failed: (reg_state_pos != cie->initial_state.regs.end()),
> function ParseInstructions, file
> /SourceCache/dwarf_utilities/dwarf_utilities-49/source/DWARFDebugFrame.cpp,
> line 353.
> Abort trap

There could be some confusion in DW_CFA_restore vs DW_CFA_same_value, 
though I don't know on whose side it is.  Certainly the existing 
consumers that I know treat a DW_CFA_restore for a register not 
mentioned by the CIE the same as "same_value".


r~

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

end of thread, other threads:[~2009-09-23 20:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-23 18:00 question on dwarf2 debug-frame IainS
2009-09-23 20:28 ` Richard Henderson

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).