Commit 32310747 by Arnaud Charlet

exp_dbug.ads: Update documentation to reflect simpler encoding for protected operations.

	* exp_dbug.ads: Update documentation to reflect simpler encoding for
	protected operations.

	* exp_ch9.adb (Build_Selected_Name): Do not include "PT" suffix in
	generated name, it complicates decoding in gdb and hinders debugging
	of protected operations.
	(Build_Barrier_Function_Specification): Set the Needs_Debug_Info
	flag for the protected entry barrier function.
	(Build_Protected_Entry_Specification): Set the Needs_Debug_Info
	flag for the protected entry function.

From-SVN: r90907
parent ffe9aba8
...@@ -187,13 +187,12 @@ package body Exp_Ch9 is ...@@ -187,13 +187,12 @@ package body Exp_Ch9 is
Append_Char : Character := ' ') return Name_Id; Append_Char : Character := ' ') return Name_Id;
-- Build a name in the form of Prefix__Selector, with an optional -- Build a name in the form of Prefix__Selector, with an optional
-- character appended. This is used for internal subprograms generated -- character appended. This is used for internal subprograms generated
-- for operations of protected types, including barrier functions. In -- for operations of protected types, including barrier functions.
-- order to simplify the work of the debugger, the prefix includes the -- For the subprograms generated for entry bodies and entry barriers,
-- characters PT. For the subprograms generated for entry bodies and -- the generated name includes a sequence number that makes names
-- entry barriers, the generated name includes a sequence number that -- unique in the presence of entry overloading. This is necessary
-- makes names unique in the presence of entry overloading. This is -- because entry body procedures and barrier functions all have the
-- necessary because entry body procedures and barrier functions all -- same signature.
-- have the same signature.
procedure Build_Simple_Entry_Call procedure Build_Simple_Entry_Call
(N : Node_Id; (N : Node_Id;
...@@ -799,6 +798,7 @@ package body Exp_Ch9 is ...@@ -799,6 +798,7 @@ package body Exp_Ch9 is
Loc : Source_Ptr) return Node_Id Loc : Source_Ptr) return Node_Id
is is
begin begin
Set_Needs_Debug_Info (Def_Id);
return Make_Function_Specification (Loc, return Make_Function_Specification (Loc,
Defining_Unit_Name => Def_Id, Defining_Unit_Name => Def_Id,
Parameter_Specifications => New_List ( Parameter_Specifications => New_List (
...@@ -1395,6 +1395,7 @@ package body Exp_Ch9 is ...@@ -1395,6 +1395,7 @@ package body Exp_Ch9 is
P : Entity_Id; P : Entity_Id;
begin begin
Set_Needs_Debug_Info (Def_Id);
P := Make_Defining_Identifier (Loc, Name_uP); P := Make_Defining_Identifier (Loc, Name_uP);
if Present (Ent_Id) then if Present (Ent_Id) then
...@@ -1911,12 +1912,10 @@ package body Exp_Ch9 is ...@@ -1911,12 +1912,10 @@ package body Exp_Ch9 is
Name_Len := Name_Len - 1; Name_Len := Name_Len - 1;
end if; end if;
Name_Buffer (Name_Len + 1) := 'P'; Name_Buffer (Name_Len + 1) := '_';
Name_Buffer (Name_Len + 2) := 'T'; Name_Buffer (Name_Len + 2) := '_';
Name_Buffer (Name_Len + 3) := '_';
Name_Buffer (Name_Len + 4) := '_';
Name_Len := Name_Len + 4; Name_Len := Name_Len + 2;
for J in 1 .. Select_Len loop for J in 1 .. Select_Len loop
Name_Len := Name_Len + 1; Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := Select_Buffer (J); Name_Buffer (Name_Len) := Select_Buffer (J);
......
...@@ -354,8 +354,8 @@ package Exp_Dbug is ...@@ -354,8 +354,8 @@ package Exp_Dbug is
-- calls from other operations on the same object. The locking operation -- calls from other operations on the same object. The locking operation
-- simply acquires the lock, and then calls the non-locking version. -- simply acquires the lock, and then calls the non-locking version.
-- The names of all of these have a prefix constructed from the name of -- The names of all of these have a prefix constructed from the name of
-- the type, the string "PT", and a suffix which is P or N, depending on -- the type, and a suffix which is P or N, depending on whether this is
-- whether this is the protected/non-locking version of the operation. -- the protected/non-locking version of the operation.
-- Operations generated for protected entries follow the same encoding. -- Operations generated for protected entries follow the same encoding.
-- Each entry results in two suprograms: a procedure that holds the -- Each entry results in two suprograms: a procedure that holds the
...@@ -376,14 +376,14 @@ package Exp_Dbug is ...@@ -376,14 +376,14 @@ package Exp_Dbug is
-- the following operations are created: -- the following operations are created:
-- lockPT_getN -- lock_getN
-- lockPT_getP, -- lock_getP,
-- lockPT_setN -- lock_setN
-- lockPT_setP -- lock_setP
-- lockPT_update1sE -- lock_update1sE
-- lockPT_udpate2sB -- lock_udpate2sB
---------------------------------------------------- ----------------------------------------------------
-- Conversion between Entities and External Names -- -- Conversion between Entities and External Names --
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment