This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Force DW_CFA_def_cfa after DW_CFA_def_cfa_expression if no longer indirect


On Fri, Apr 23, 2010 at 04:52:38PM -0700, Roland McGrath wrote:
> > Not sure how to test it in the testsuite though, regexp on no
> > DW_CFA_def_cfa_register would be too fragile.
> 
> What's putatively invalid is:
> 
> #!/bin/awk -f
> $1 !~ /DW_CFA_[a-z0-9_]+:?/ { ok=0; badsince="(initial) " NR ": " $0; next }
> $1 == "DW_CFA_def_cfa_expression" { ok=0; badsince=NR ": " $0; next}
> $1 == "DW_CFA_def_cfa:" { ok=NR ": " $0; next }
> $1 ~ /DW_CFA_def_cfa_[a-z0-9_]+:/ && !ok {
>   print "*** \t\t" NR ": " $0; print "*** bad since\t" badsince
>   bad=1
> }
> END { exit bad }
> 
> so you can match that fairly robustly (on "readelf --debug-dump=frames"
> output).

That's not something we can do in the testsuite (rely on readelf, run awk,
...).  All that is available (except for writing something in tcl) is just
a regex on the assembly output in this case (perhaps with -dA and
-gno-dwarf2-cfi-asm).

BTW, the problem is not just DW_CFA_def_cfa_[a-z0-9_]+ following
immediately DW_CFA_def_cfa_expression, but also
DW_CFA_def_cfa_expression
...
DW_CFA_remember_state
...
DW_CFA_restore_state
DW_CFA_def_cfa_[a-z0-9_]+

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]