public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Missing debug info for object of class-wide interface type
@ 2012-03-19 16:30 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2012-03-19 16:30 UTC (permalink / raw)
  To: gcc-patches; +Cc: Gary Dismukes

[-- Attachment #1: Type: text/plain, Size: 792 bytes --]

For an object of a class-wide interface type, the object declaration is
rewritten as a renaming with a new entity, and debug info was not being
generated for the renaming, preventing printing of the object's value
in gdb. The entity of the renaming is now marked as needing debug info.

Tested on x86_64-pc-linux-gnu, committed on trunk

2012-03-19  Gary Dismukes  <dismukes@adacore.com>

	* exp_ch3.adb (Expand_N_Object_Declaration): In
	the case of an object of a class-wide interface type, where the
	declaration is rewritten as a renaming, call Set_Debug_Info_Needed
	on the renaming entity so that Materialize_Entity will be
	set. Also, change existing call (for other than interface cases)
	to call Set_Debug_Info_Needed rather than Set_Needs_Debug_Info
	(as specified for that flag).


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 1423 bytes --]

Index: exp_ch3.adb
===================================================================
--- exp_ch3.adb	(revision 185520)
+++ exp_ch3.adb	(working copy)
@@ -4820,6 +4820,17 @@
                       Subtype_Mark        => New_Occurrence_Of (Typ, Loc),
                       Name => Convert_Tag_To_Interface (Typ, Tag_Comp)));
 
+                  --  If the original entity comes from source, then mark the
+                  --  new entity as needing debug information, even though it's
+                  --  defined by a generated renaming that does not come from
+                  --  source, so that Materialize_Entity will be set on the
+                  --  entity when Debug_Renaming_Declaration is called during
+                  --  analysis.
+
+                  if Comes_From_Source (Def_Id) then
+                     Set_Debug_Info_Needed (Defining_Identifier (N));
+                  end if;
+
                   Analyze (N, Suppress => All_Checks);
 
                   --  Replace internal identifier of rewritten node by the
@@ -5065,7 +5076,7 @@
             --  renaming that does not come from source.
 
             if Comes_From_Source (Defining_Identifier (N)) then
-               Set_Needs_Debug_Info (Defining_Identifier (N));
+               Set_Debug_Info_Needed (Defining_Identifier (N));
             end if;
 
             --  Now call the routine to generate debug info for the renaming

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-19 16:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-19 16:30 [Ada] Missing debug info for object of class-wide interface type Arnaud Charlet

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