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]

[Ada] Fix GDB output for values returned on the secondary stack


These values are returned by reference so they need to be built as reference 
types to be correctly decoded by the debugger.

Tested on x86_64-suse-linux, applied on the mainline.


2015-06-01  Pierre-Marie de Rodat  <derodat@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity): Replace pointer types with
	references ones for functions that return references.


-- 
Eric Botcazou
Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c	(revision 223919)
+++ gcc-interface/decl.c	(working copy)
@@ -4198,7 +4198,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
 	       type the pointer type and make a note of that.  */
 	    if (Returns_By_Ref (gnat_entity))
 	      {
-		gnu_return_type = build_pointer_type (gnu_return_type);
+		gnu_return_type = build_reference_type (gnu_return_type);
 		return_by_direct_ref_p = true;
 	      }
 
@@ -4216,7 +4216,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
 	       the actual return type is the pointer type.  */
 	    else if (Requires_Transient_Scope (gnat_return_type))
 	      {
-		gnu_return_type = build_pointer_type (gnu_return_type);
+		gnu_return_type = build_reference_type (gnu_return_type);
 		return_unconstrained_p = true;
 	      }
 

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