public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix debug info after the fortran descriptor changes (PR debug/84131)
@ 2018-01-30 22:53 Jakub Jelinek
  2018-01-30 22:55 ` Steve Kargl
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2018-01-30 22:53 UTC (permalink / raw)
  To: fortran, gcc-patches

Hi!

DW_AT_data_location needs to be the data pointer, which is at offset 0,
but we were emitting a bogus +8 in that case (+4 for 32-bit targets).

With this patch, the change on -g -dA is:
-       .uleb128 0x4    # DW_AT_data_location
+       .uleb128 0x2    # DW_AT_data_location
        .byte   0x97    # DW_OP_push_object_address
-       .byte   0x23    # DW_OP_plus_uconst
-       .uleb128 0x8
        .byte   0x6     # DW_OP_deref
and gdb can debug the array in there again.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2018-01-30  Jakub Jelinek  <jakub@redhat.com>

	PR debug/84131
	* trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off
	to DATA_FIELD's offset rather than OFFSET_FIELD's offset.

--- gcc/fortran/trans-array.c.jj	2018-01-26 12:43:25.164922494 +0100
+++ gcc/fortran/trans-array.c	2018-01-30 19:34:01.844232363 +0100
@@ -511,7 +511,7 @@ gfc_get_descriptor_offsets_for_info (con
   tree type;
 
   type = TYPE_MAIN_VARIANT (desc_type);
-  field = gfc_advance_chain (TYPE_FIELDS (type), OFFSET_FIELD);
+  field = gfc_advance_chain (TYPE_FIELDS (type), DATA_FIELD);
   *data_off = byte_position (field);
   field = gfc_advance_chain (TYPE_FIELDS (type), DTYPE_FIELD);
   *dtype_off = byte_position (field);

	Jakub

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

* Re: [PATCH] Fix debug info after the fortran descriptor changes (PR debug/84131)
  2018-01-30 22:53 [PATCH] Fix debug info after the fortran descriptor changes (PR debug/84131) Jakub Jelinek
@ 2018-01-30 22:55 ` Steve Kargl
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Kargl @ 2018-01-30 22:55 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: fortran, gcc-patches

On Tue, Jan 30, 2018 at 11:53:40PM +0100, Jakub Jelinek wrote:
> 
> DW_AT_data_location needs to be the data pointer, which is at offset 0,
> but we were emitting a bogus +8 in that case (+4 for 32-bit targets).
> 
> With this patch, the change on -g -dA is:
> -       .uleb128 0x4    # DW_AT_data_location
> +       .uleb128 0x2    # DW_AT_data_location
>         .byte   0x97    # DW_OP_push_object_address
> -       .byte   0x23    # DW_OP_plus_uconst
> -       .uleb128 0x8
>         .byte   0x6     # DW_OP_deref
> and gdb can debug the array in there again.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 

Yes.  Thanks for looking at this!

-- 
Steve

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

end of thread, other threads:[~2018-01-30 22:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30 22:53 [PATCH] Fix debug info after the fortran descriptor changes (PR debug/84131) Jakub Jelinek
2018-01-30 22:55 ` Steve Kargl

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