This is the mail archive of the gcc@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: Var-tracking generates broken DW_AT_frame_base on s390


> There most certainly is a problem.  For example, the following trivial
> program:
> 
> void g (char *);
> void f (void)
> {
>    char buf[101];
> 
>    g (buf);
> }
>
> The debug info for variable buf is:
> 
>         .uleb128 0x3    # (DIE (0x3c) DW_TAG_variable)
>         .ascii "buf\0"  # DW_AT_name
>         .byte   0x1     # DW_AT_decl_file
>         .byte   0x5     # DW_AT_decl_line
>         .4byte  0x4c    # DW_AT_type
>         .byte   0x3     # DW_AT_location
>         .byte   0x91    # DW_OP_fbreg
>         .sleb128 96
> 
> Note the DW_OP_fbreg 96 output.  This means that this piece of
> code assumes the frame base is the value of %r15 inside the
> function.
> 
> However, the DW_AT_frame_base is as follows:
>         .uleb128 0x2    # (DIE (0x25) DW_TAG_subprogram)
>         .4byte  .LLST0  # DW_AT_frame_base
> 
> .LLST0:
>         .4byte  .LVL0-.Ltext0   # Location list begin address (*.LLST0)
>         .4byte  .LVL1-.Ltext0   # Location list end address (*.LLST0)
>         .2byte  0x2     # Location expression size
>         .byte   0x7f    # DW_OP_breg15
>         .sleb128 0
>         .4byte  .LVL1-.Ltext0   # Location list begin address (*.LLST0)
>         .4byte  .LFE2-.Ltext0   # Location list end address (*.LLST0)
>         .2byte  0x3     # Location expression size
>         .byte   0x7f    # DW_OP_breg15
>         .sleb128 200
>         .4byte  0x0     # Location list terminator begin (*.LLST0)
>         .4byte  0x0     # Location list terminator end (*.LLST0)

I see. The combination of location list for frame base and
the location expr (orig debug info) for a variable makes the problem.

Josef


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