Commit 7853d934 by Javier Miranda Committed by Arnaud Charlet

exp_dbug.adb (Get_Encoded_Name): Modified to continue providing its functionality when...

2007-04-20  Javier Miranda  <miranda@adacore.com>
	    Nicolas Setton  <setton@adacore.com>

	* exp_dbug.adb (Get_Encoded_Name): Modified to continue providing its
	functionality when the backend is generating code.
	Otherwise any serious error
	reported by the backend calling the frontend routine Error_Msg
	changes the Compilation_Mode to Check_Semantics, disables the
	functionality of this routine and causes the generation of
	spureous additional errors.

	* exp_dbug.ads (Pointers to Unconstrained Arrays): Document the
	debugging information now generated by the compiler for fat-pointer
	types.
	Document the contents of DW_AT_producer in the GNAT Vendor extensions to
	DWARF2/3.
	Document GNAT Vendor extensions to DWARF 2/3 and the "-gdwarf+" switch.

From-SVN: r125402
parent 3e038221
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1996-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1996-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -28,7 +28,6 @@ with Alloc; use Alloc; ...@@ -28,7 +28,6 @@ with Alloc; use Alloc;
with Atree; use Atree; with Atree; use Atree;
with Debug; use Debug; with Debug; use Debug;
with Einfo; use Einfo; with Einfo; use Einfo;
with Namet; use Namet;
with Nlists; use Nlists; with Nlists; use Nlists;
with Nmake; use Nmake; with Nmake; use Nmake;
with Opt; use Opt; with Opt; use Opt;
...@@ -492,12 +491,22 @@ package body Exp_Dbug is ...@@ -492,12 +491,22 @@ package body Exp_Dbug is
Has_Suffix : Boolean; Has_Suffix : Boolean;
begin begin
-- If not generating code, there is no need to create encoded -- If not generating code, there is no need to create encoded names, and
-- names, and problems when the back-end is called to annotate -- problems when the back-end is called to annotate types without full
-- types without full code generation. See comments at beginning -- code generation. See comments in Get_External_Name_With_Suffix for
-- of Get_External_Name_With_Suffix for additional details. -- additional details.
if Operating_Mode /= Generate_Code then -- However we do create encoded names if the back end is active, even
-- if Operating_Mode got reset. Otherwise any serious error reported
-- by the backend calling Error_Msg changes the Compilation_Mode to
-- Check_Semantics, which disables the functionality of this routine,
-- causing the generation of spurious additional errors.
-- Couldn't we just test Original_Operating_Mode here? ???
if Operating_Mode /= Generate_Code
and then not Generating_Code
then
return; return;
end if; end if;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1996-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1996-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
-- debugger. In accordance with the Dwarf 2.2 specification, certain -- debugger. In accordance with the Dwarf 2.2 specification, certain
-- type names are encoded to provide information to the debugger. -- type names are encoded to provide information to the debugger.
with Namet; use Namet;
with Types; use Types; with Types; use Types;
with Uintp; use Uintp; with Uintp; use Uintp;
...@@ -44,11 +45,11 @@ package Exp_Dbug is ...@@ -44,11 +45,11 @@ package Exp_Dbug is
-- are the enclosing scopes (not including Standard at the start). -- are the enclosing scopes (not including Standard at the start).
-- The encoding of the name follows this basic qualified naming scheme, -- The encoding of the name follows this basic qualified naming scheme,
-- where the encoding of individual entity names is as described in -- where the encoding of individual entity names is as described in Namet
-- Namet (i.e. in particular names present in the original source are -- (i.e. in particular names present in the original source are folded to
-- folded to all lower case, with upper half and wide characters encoded -- all lower case, with upper half and wide characters encoded as described
-- as described in Namet). Upper case letters are used only for entities -- in Namet). Upper case letters are used only for entities generated by
-- generated by the compiler. -- the compiler.
-- There are two cases, global entities, and local entities. In more formal -- There are two cases, global entities, and local entities. In more formal
-- terms, local entities are those which have a dynamic enclosing scope, -- terms, local entities are those which have a dynamic enclosing scope,
...@@ -1247,10 +1248,19 @@ package Exp_Dbug is ...@@ -1247,10 +1248,19 @@ package Exp_Dbug is
-- The bounds may be any integral type. In the case of an enumeration -- The bounds may be any integral type. In the case of an enumeration
-- type, Enum_Rep values are used. -- type, Enum_Rep values are used.
-- The debugging information will sometimes reference an anonymous fat -- For a given unconstrained array type, the compiler will generate one
-- pointer type. Such types are given the name xxx___XUP, where xxx is -- fat-pointer type whose name is "arr___XUP", where "arr" is the name
-- the name of the designated type. If the debugger is asked to output -- of the array type, and use it to represent the array type itself in
-- such a type name, the appropriate form is "access xxx". -- the debugging information.
-- For each pointer to this unconstrained array type, the compiler will
-- generate a typedef that points to the above "arr___XUP" fat-pointer
-- type. As a consequence, when it comes to fat-pointer types:
-- 1. The type name is given by the typedef
-- 2. If the debugger is asked to output the type, the appropriate
-- form is "access arr", except if the type name is "arr___XUP"
-- for which it is the array definition.
-- Thin Pointers -- Thin Pointers
...@@ -1501,4 +1511,41 @@ package Exp_Dbug is ...@@ -1501,4 +1511,41 @@ package Exp_Dbug is
-- are missing and deal as best as it can with the limited information -- are missing and deal as best as it can with the limited information
-- available. -- available.
---------------------------------
-- GNAT Extensions to DWARF2/3 --
---------------------------------
-- If the compiler switch "-gdwarf+" is specified, GNAT Vendor extensions
-- to DWARF2/3 are generated, with the following variations from the above
-- specification.
-- Change in the contents of the DW_AT_name attribute.
-- The operators are represented in their natural form. (Ie, the addition
-- operator is written as "+" instead of "Oadd").
-- The component separation string is "." instead of "__"
-- Introduction of DW_AT_GNAT_encoding, encoded with value 0x2301.
-- Any debugging information entry representing a program entity, named
-- or implicit, may have a DW_AT_GNAT_encoding attribute. The value of
-- this attribute is a string representing the suffix internally added
-- by GNAT for various purposes, mainly for representing debug
-- information compatible with other formats.
-- If a debugging information entry has multiple encodings, all of them
-- will be listed in DW_AT_GNAT_encoding. The separator for this list
-- is ':'.
-- Introduction of DW_AT_GNAT_descriptive_type, encoded with value 0x2302
-- Any debugging information entry representing a type may have a
-- DW_AT_GNAT_descriptive_type attribute whose value is a reference,
-- pointing to a debugging information entry representing another type
-- associated to the type.
-- Modification of the contents of the DW_AT_producer string.
-- When emitting full GNAT Vendor extensions to DWARF2/3, "-gdwarf+"
-- is appended to the DW_AT_producer string.
--
-- When emitting only DW_AT_GNAT_descriptive_type, "-gdwarf+-" is
-- appended to the DW_AT_producer string.
end Exp_Dbug; end Exp_Dbug;
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