Commit 43ff4547 by Geert Bosch Committed by Geert Bosch

adadecode.c, [...]: New files.

	* adadecode.c, adadecode.h, aux-io.c, s-traces.adb, s-traces.ads,
	s-tratas.adb, s-tratas.ads, sinput-d.adb, sinput-d.ads,
	switch-b.adb, switch-b.ads, switch-c.adb, switch-c.ads,
	switch-m.adb, switch-m.ads : New files.

From-SVN: r50466
parent 4ec59de2
2002-03-07 Geert Bosch <bosch@gnat.com>
* adadecode.c, adadecode.h, aux-io.c, s-traces.adb, s-traces.ads,
s-tratas.adb, s-tratas.ads, sinput-d.adb, sinput-d.ads,
switch-b.adb, switch-b.ads, switch-c.adb, switch-c.ads,
switch-m.adb, switch-m.ads : New files.
2002-03-07 Geert Bosch <bosch@gnat.com>
* 41intnam.ads, 42intnam.ads, 4aintnam.ads, 4cintnam.ads,
4dintnam.ads, 4gintnam.ads, 4hintnam.ads, 4lintnam.ads,
4mintnam.ads, 4pintnam.ads, 4rintnam.ads, 4sintnam.ads,
......
/****************************************************************************
* *
* GNAT COMPILER COMPONENTS *
* *
* G N A T D E C O *
* *
* $Revision$
* *
* C Header File *
* *
* Copyright (C) 2001-2002, Free Software Foundation, Inc. *
* *
* 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- *
* ware Foundation; either version 2, or (at your option) any later ver- *
* sion. GNAT is distributed in the hope that it will be useful, but WITH- *
* OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
* for more details. You should have received a copy of the GNU General *
* Public License distributed with GNAT; see file COPYING. If not, write *
* to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
* MA 02111-1307, USA. *
* *
* As a special exception, if you link this file with other files to *
* produce an executable, this file does not by itself cause the resulting *
* executable to be covered by the GNU General Public License. This except- *
* ion does not however invalidate any other reasons why the executable *
* file might be covered by the GNU Public License. *
* *
* GNAT was originally developed by the GNAT team at New York University. *
* It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). *
* *
****************************************************************************/
/* This function will return the Ada name from the encoded form.
The Ada coding is done in exp_dbug.ads and this is the inverse function.
see exp_dbug.ads for full encoding rules, a short description is added
below. Right now only objects and routines are handled. There is no support
for Ada types.
CODED_NAME is the encoded entity name.
ADA_NAME is a pointer to a buffer, it will receive the Ada name. A safe
size for this buffer is: strlen (coded_name) * 2 + 60. (60 is for the
verbose information).
VERBOSE is nonzero if more information about the entity is to be
added at the end of the Ada name and surrounded by ( and ). */
extern void __gnat_decode PARAMS ((const char *, char *, int));
/* ada_demangle is added for COMPATIBILITY ONLY. It has the name of the
function used in the binutils and GDB. Always consider using __gnat_decode
instead of ada_demangle. Caller must free the pointer returned. */
extern char *ada_demangle PARAMS ((const char *));
/****************************************************************************
* *
* GNAT RUN-TIME COMPONENTS *
* *
* A - T R A N S *
* *
* C Implementation File *
* *
* $Revision$
* *
* Copyright (C) 1992-2001 Free Software Foundation, Inc. *
* *
* 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- *
* ware Foundation; either version 2, or (at your option) any later ver- *
* sion. GNAT is distributed in the hope that it will be useful, but WITH- *
* OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
* for more details. You should have received a copy of the GNU General *
* Public License distributed with GNAT; see file COPYING. If not, write *
* to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
* MA 02111-1307, USA. *
* *
* As a special exception, if you link this file with other files to *
* produce an executable, this file does not by itself cause the resulting *
* executable to be covered by the GNU General Public License. This except- *
* ion does not however invalidate any other reasons why the executable *
* file might be covered by the GNU Public License. *
* *
* GNAT was originally developed by the GNAT team at New York University. *
* It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). *
* *
****************************************************************************/
#include <stdio.h>
#ifdef IN_RTS
#include "tconfig.h"
#include "tsystem.h"
#else
#include "config.h"
#include "system.h"
#endif
/* Function wrappers are needed to access the values from Ada which are
defined as C macros. */
FILE *c_stdin PARAMS ((void));
FILE *c_stdout PARAMS ((void));
FILE *c_stderr PARAMS ((void));
int seek_set_function PARAMS ((void));
int seek_end_function PARAMS ((void));
void *null_function PARAMS ((void));
int c_fileno PARAMS ((FILE *));
FILE *
c_stdin ()
{
return stdin;
}
FILE *
c_stdout ()
{
return stdout;
}
FILE *
c_stderr ()
{
return stderr;
}
#ifndef SEEK_SET /* Symbolic constants for the "fseek" function: */
#define SEEK_SET 0 /* Set file pointer to offset */
#define SEEK_CUR 1 /* Set file pointer to its current value plus offset */
#define SEEK_END 2 /* Set file pointer to the size of the file plus offset */
#endif
int
seek_set_function ()
{
return SEEK_SET;
}
int
seek_end_function ()
{
return SEEK_END;
}
void *null_function ()
{
return NULL;
}
int
c_fileno (s)
FILE *s;
{
return fileno (s);
}
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T R A C E S --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- GNARL 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
package body System.Traces is
pragma Warnings (Off); -- kill warnings on unreferenced formals
---------------------
-- Send_Trace_Info --
---------------------
procedure Send_Trace_Info (Id : Trace_T) is
begin
null;
end Send_Trace_Info;
---------------------
-- Send_Trace_Info --
---------------------
procedure Send_Trace_Info (Id : Trace_T; Timeout : Duration) is
begin
null;
end Send_Trace_Info;
end System.Traces;
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T R A C E S --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- GNARL 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
-- This package implements functions for traces when tasking is not involved
-- Warning : NO dependencies to tasking should be created here
-- This package, and all its children are used to implement debug
-- informations
-- A new primitive, Send_Trace_Info (Id : Trace_T; 'data') is introduced.
-- Trace_T is an event identifier, 'data' are the informations to pass
-- with the event. Thid procedure is used from within the Runtime to send
-- debug informations.
-- This primitive is overloaded in System.Traces.Tasking and this package.
-- Send_Trace_Info calls Send_Trace, in System.Traces.Send, which is trarget
-- dependent, to send the debug informations to a debugger, stream ..
-- To add a new event, just add them to the Trace_T type, and write the
-- corresponding Send_Trace_Info procedure. It may be required for some
-- target to modify Send_Trace (eg. VxWorks).
-- To add a new target, just adapt System.Traces.Send to your own purpose.
package System.Traces is
type Trace_T is
(
-- Events handled.
-- Messages
--
M_Accept_Complete,
M_Select_Else,
M_RDV_Complete,
M_Call_Complete,
M_Delay,
-- Errors
--
E_Missed,
E_Timeout,
E_Kill,
-- Waiting events
--
W_Call,
W_Accept,
W_Select,
W_Completion,
W_Delay,
WU_Delay,
WT_Call,
WT_Select,
WT_Completion,
-- Protected objects events
--
PO_Call,
POT_Call,
PO_Run,
PO_Lock,
PO_Unlock,
PO_Done,
-- Task handling events
--
T_Create,
T_Activate,
T_Abort,
T_Terminate);
-- Send_Trace_Info procedures
-- They are overloaded, depending on the parameters passed with
-- the event, e.g. Time information, Task name, Accept name ...
procedure Send_Trace_Info (Id : Trace_T);
procedure Send_Trace_Info (Id : Trace_T; Timeout : Duration);
end System.Traces;
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T R A C E S . T A S K I N G --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- GNARL 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
package body System.Traces.Tasking is
pragma Warnings (Off); -- kill warnings on unreferenced formals
---------------------
-- Send_Trace_Info --
---------------------
procedure Send_Trace_Info (Id : Trace_T; Task_Name2 : ST.Task_ID) is
begin
null;
end Send_Trace_Info;
procedure Send_Trace_Info
(Id : Trace_T;
Task_Name2 : ST.Task_ID;
Entry_Number : ST.Entry_Index)
is
begin
null;
end Send_Trace_Info;
procedure Send_Trace_Info
(Id : Trace_T;
Task_Name : ST.Task_ID;
Task_Name2 : ST.Task_ID;
Entry_Number : ST.Entry_Index)
is
begin
null;
end Send_Trace_Info;
procedure Send_Trace_Info
(Id : Trace_T;
Task_Name : ST.Task_ID;
Task_Name2 : ST.Task_ID)
is
begin
null;
end Send_Trace_Info;
procedure Send_Trace_Info
(Id : Trace_T;
Entry_Number : ST.Entry_Index)
is
begin
null;
end Send_Trace_Info;
procedure Send_Trace_Info
(Id : Trace_T;
Acceptor : ST.Task_ID;
Entry_Number : ST.Entry_Index;
Timeout : Duration)
is
begin
null;
end Send_Trace_Info;
procedure Send_Trace_Info
(Id : Trace_T;
Entry_Number : ST.Entry_Index;
Timeout : Duration)
is
begin
null;
end Send_Trace_Info;
procedure Send_Trace_Info
(Id : Trace_T;
Task_Name : ST.Task_ID;
Number : Integer)
is
begin
null;
end Send_Trace_Info;
procedure Send_Trace_Info
(Id : Trace_T;
Task_Name : ST.Task_ID;
Number : Integer;
Timeout : Duration)
is
begin
null;
end Send_Trace_Info;
end System.Traces.Tasking;
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T R A C E S . T A S K I N G --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- GNARL 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
-- This package provides all procedures used to implement debug traces
-- in the case tasking is involved.
-- See System.Traces for an overview of the various files involved in Tracing
-- If tasking is not involved, refer to System.Traces.General
with System.Tasking;
package System.Traces.Tasking is
package ST renames System.Tasking;
-- Send_Trace_Info procedures
-- They are overloaded, depending on the parameters passed with the event
procedure Send_Trace_Info
(Id : Trace_T;
Task_Name2 : ST.Task_ID);
procedure Send_Trace_Info
(Id : Trace_T;
Task_Name2 : ST.Task_ID;
Entry_Number : ST.Entry_Index);
procedure Send_Trace_Info
(Id : Trace_T;
Task_Name : ST.Task_ID;
Task_Name2 : ST.Task_ID;
Entry_Number : ST.Entry_Index);
procedure Send_Trace_Info
(Id : Trace_T;
Task_Name : ST.Task_ID;
Task_Name2 : ST.Task_ID);
procedure Send_Trace_Info
(Id : Trace_T;
Entry_Number : ST.Entry_Index);
procedure Send_Trace_Info
(Id : Trace_T;
Acceptor : ST.Task_ID;
Entry_Number : ST.Entry_Index;
Timeout : Duration);
procedure Send_Trace_Info
(Id : Trace_T;
Entry_Number : ST.Entry_Index;
Timeout : Duration);
procedure Send_Trace_Info
(Id : Trace_T;
Task_Name : ST.Task_ID;
Number : Integer);
procedure Send_Trace_Info
(Id : Trace_T;
Task_Name : ST.Task_ID;
Number : Integer;
Timeout : Duration);
end System.Traces.Tasking;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S I N P U T . D --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 2001, Free Software Foundation, Inc. --
-- --
-- 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
with Osint; use Osint;
with Osint.C; use Osint.C;
package body Sinput.D is
Dfile : Source_File_Index;
-- Index of currently active debug source file
------------------------
-- Close_Debug_Source --
------------------------
procedure Close_Debug_Source is
S : Source_File_Record renames Source_File.Table (Dfile);
Src : Source_Buffer_Ptr;
begin
Trim_Lines_Table (Dfile);
Close_Debug_File;
-- Now we need to read the file that we wrote and store it
-- in memory for subsequent access.
Read_Source_File
(S.Debug_Source_Name, S.Source_First, S.Source_Last, Src);
S.Source_Text := Src;
end Close_Debug_Source;
-------------------------
-- Create_Debug_Source --
-------------------------
procedure Create_Debug_Source
(Source : Source_File_Index;
Loc : out Source_Ptr)
is
begin
Loc := Source_File.Table (Source_File.Last).Source_Last + 1;
Source_File.Increment_Last;
Dfile := Source_File.Last;
declare
S : Source_File_Record renames Source_File.Table (Dfile);
begin
S := Source_File.Table (Source);
S.Debug_Source_Name := Create_Debug_File (S.File_Name);
S.Source_First := Loc;
S.Source_Last := Loc;
S.Lines_Table := null;
S.Last_Source_Line := 1;
-- Allocate lines table, guess that it needs to be three times
-- bigger than the original source (in number of lines).
Alloc_Line_Tables
(S, Int (Source_File.Table (Source).Last_Source_Line * 3));
S.Lines_Table (1) := Loc;
end;
end Create_Debug_Source;
----------------------
-- Write_Debug_Line --
----------------------
procedure Write_Debug_Line (Str : String; Loc : in out Source_Ptr) is
S : Source_File_Record renames Source_File.Table (Dfile);
begin
-- Ignore write request if null line at start of file
if Str'Length = 0 and then Loc = S.Source_First then
return;
-- Here we write the line, and update the source record entry
else
Write_Debug_Info (Str (Str'First .. Str'Last - 1));
Add_Line_Tables_Entry (S, Loc);
Loc := Loc - 1 + Source_Ptr (Str'Length + Debug_File_Eol_Length);
S.Source_Last := Loc;
end if;
end Write_Debug_Line;
end Sinput.D;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S I N P U T . D --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 2001, Free Software Foundation, Inc. --
-- --
-- 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
-- This child package contains the routines used to write debug source
-- files. These routines are not in Sinput.L, because they are used only
-- by the compiler, while Sinput.L is also used by gnatmake.
package Sinput.D is
------------------------------------------------
-- Subprograms for Writing Debug Source Files --
------------------------------------------------
procedure Create_Debug_Source
(Source : Source_File_Index;
Loc : out Source_Ptr);
-- Given a source file, creates a new source file table entry to be used
-- for the debug source file output (Debug_Generated_Code switch set).
-- Loc is set to the initial Sloc value for the first line. This call
-- also creates the debug source output file (using Create_Debug_File).
procedure Write_Debug_Line (Str : String; Loc : in out Source_Ptr);
-- This procedure is called to write a line to the debug source file
-- previously created by Create_Debug_Source using Write_Debug_Info.
-- Str is the source line to be written to the file (it does not include
-- an end of line character). On entry Loc is the Sloc value previously
-- returned by Create_Debug_Source or Write_Debug_Line, and on exit,
-- Sloc is updated to point to the start of the next line to be written,
-- taking into account the length of the ternminator that was written by
-- Write_Debug_Info.
procedure Close_Debug_Source;
-- This procedure completes the source table entry for the debug file
-- previously created by Create_Debug_Source, and written using the
-- Write_Debug_Line procedure. It then calls Close_Debug_File to
-- complete the writing of the file itself.
end Sinput.D;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S W I T C H - B --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
-- This package scans binder switches. Note that the body of Usage must be
-- coordinated with the switches that are recognized by this package.
-- The Usage package also acts as the official documentation for the
-- switches that are recognized. In addition, package Debug documents
-- the otherwise undocumented debug switches that are also recognized.
package Switch.B is
procedure Scan_Binder_Switches (Switch_Chars : String);
-- Procedures to scan out binder switches stored in the given string.
-- The first character is known to be a valid switch character, and there
-- are no blanks or other switch terminator characters in the string, so
-- the entire string should consist of valid switch characters, except that
-- an optional terminating NUL character is allowed. A bad switch causes
-- a fatal error exit and control does not return. The call also sets
-- Usage_Requested to True if a ? switch is encountered.
end Switch.B;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S W I T C H - C --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
-- This package scans front end switches. Note that the body of Usage must be
-- coordinated with the switches that are recognized by this package.
-- The Usage package also acts as the official documentation for the
-- switches that are recognized. In addition, package Debug documents
-- the otherwise undocumented debug switches that are also recognized.
package Switch.C is
procedure Scan_Front_End_Switches (Switch_Chars : String);
-- Procedures to scan out front end switches stored in the given string.
-- The first character is known to be a valid switch character, and there
-- are no blanks or other switch terminator characters in the string, so
-- the entire string should consist of valid switch characters, except that
-- an optional terminating NUL character is allowed. A bad switch causes
-- a fatal error exit and control does not return. The call also sets
-- Usage_Requested to True if a ? switch is encountered.
end Switch.C;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S W I T C H - M --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
-- This package scans make switches. Note that the body of Usage must be
-- coordinated with the switches that are recognized by this package.
-- The Usage package also acts as the official documentation for the
-- switches that are recognized. In addition, package Debug documents
-- the otherwise undocumented debug switches that are also recognized.
with GNAT.OS_Lib; use GNAT.OS_Lib;
package Switch.M is
procedure Scan_Make_Switches (Switch_Chars : String);
-- Procedures to scan out binder switches stored in the given string.
-- The first character is known to be a valid switch character, and there
-- are no blanks or other switch terminator characters in the string, so
-- the entire string should consist of valid switch characters, except that
-- an optional terminating NUL character is allowed. A bad switch causes
-- a fatal error exit and control does not return. The call also sets
-- Usage_Requested to True if a ? switch is encountered.
procedure Normalize_Compiler_Switches
(Switch_Chars : String;
Switches : in out Argument_List_Access;
Last : out Natural);
-- Takes a compiler switch which potentially is equivalent to more
-- that one simple switches and returns the equivalent list of simple
-- switches that are stored in an ALI file. Switches will be extended
-- if initially null or too short. Last indicates the index in Switches
-- of the last simple switch. Last is equal to zero, if it has been
-- determined that Switch_Chars is ill-formed or does not contain any
-- switch that should be stored in an ALI file. Otherwise, the list of
-- simple switches is Switches (Switches'First .. Last).
--
-- Example: if Switch_Chars is equal to "-gnatAwue", then the list of
-- simple switches will have 3 components: -gnatA, -gnatwu, -gnatwe.
--
-- The String_Access components of Switches should not be deallocated:
-- they are shallow copies of components in a table in the body.
function Normalize_Compiler_Switches
(Switch_Chars : String)
return Argument_List;
-- Similar to the previous procedure. The return value is the list of
-- simple switches. It may be an empty array if it has been determined
-- that Switch_Chars is ill-formed or does not contain any switch that
-- should be stored in an ALI file. The String_Access components of the
-- returned value should not be deallocated.
end Switch.M;
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