aboutsummaryrefslogtreecommitdiffstats
path: root/src/ghdldrv
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-12-20 08:07:05 +0100
committerTristan Gingold <tgingold@free.fr>2016-12-20 21:23:30 +0100
commit7345e9733aff6a749ee1332d7c1ab8a1d9e6a909 (patch)
tree1809aad0bb698fd53f4f5d490891f6662c21a419 /src/ghdldrv
parent823e1deb863542192253bf2434e1d2c719e50b42 (diff)
downloadghdl-7345e9733aff6a749ee1332d7c1ab8a1d9e6a909.tar.gz
ghdl-7345e9733aff6a749ee1332d7c1ab8a1d9e6a909.tar.bz2
ghdl-7345e9733aff6a749ee1332d7c1ab8a1d9e6a909.zip
Add target in bug-box, add --bug-box internal command.
Diffstat (limited to 'src/ghdldrv')
-rw-r--r--src/ghdldrv/ghdllocal.adb32
-rw-r--r--src/ghdldrv/ghdlmain.adb8
-rw-r--r--src/ghdldrv/ghdlmain.ads2
3 files changed, 41 insertions, 1 deletions
diff --git a/src/ghdldrv/ghdllocal.adb b/src/ghdldrv/ghdllocal.adb
index 3a6910317..229108e5a 100644
--- a/src/ghdldrv/ghdllocal.adb
+++ b/src/ghdldrv/ghdllocal.adb
@@ -1065,6 +1065,37 @@ package body Ghdllocal is
Disp_Vhdl.Disp_Vhdl (Std_Package.Std_Standard_Unit);
end Perform_Action;
+ -- Command --bug-box.
+ type Command_Bug_Box is new Command_Type with null record;
+ function Decode_Command (Cmd : Command_Bug_Box; Name : String)
+ return Boolean;
+ function Get_Short_Help (Cmd : Command_Bug_Box) return String;
+ procedure Perform_Action (Cmd : in out Command_Bug_Box;
+ Args : Argument_List);
+
+ function Decode_Command (Cmd : Command_Bug_Box; Name : String)
+ return Boolean
+ is
+ pragma Unreferenced (Cmd);
+ begin
+ return Name = "--bug-box";
+ end Decode_Command;
+
+ function Get_Short_Help (Cmd : Command_Bug_Box) return String
+ is
+ pragma Unreferenced (Cmd);
+ begin
+ return "!--bug-box Crash and emit a bug-box";
+ end Get_Short_Help;
+
+ procedure Perform_Action (Cmd : in out Command_Bug_Box;
+ Args : Argument_List)
+ is
+ pragma Unreferenced (Cmd, Args);
+ begin
+ raise Program_Error;
+ end Perform_Action;
+
procedure Load_All_Libraries_And_Files
is
use Files_Map;
@@ -1508,5 +1539,6 @@ package body Ghdllocal is
Register_Command (new Command_Remove);
Register_Command (new Command_Copy);
Register_Command (new Command_Disp_Standard);
+ Register_Command (new Command_Bug_Box);
end Register_Commands;
end Ghdllocal;
diff --git a/src/ghdldrv/ghdlmain.adb b/src/ghdldrv/ghdlmain.adb
index 2f1d37e8d..abe7dc045 100644
--- a/src/ghdldrv/ghdlmain.adb
+++ b/src/ghdldrv/ghdlmain.adb
@@ -129,7 +129,13 @@ package body Ghdlmain is
Put_Line ("COMMAND is one of:");
C := First_Cmd;
while C /= null loop
- Put_Line (Get_Short_Help (C.all));
+ declare
+ S : constant String := Get_Short_Help (C.all);
+ begin
+ if S'Length > 1 and then S (S'First) /= '!' then
+ Put_Line (S);
+ end if;
+ end;
C := C.Next;
end loop;
New_Line;
diff --git a/src/ghdldrv/ghdlmain.ads b/src/ghdldrv/ghdlmain.ads
index 9b13486c8..c79530934 100644
--- a/src/ghdldrv/ghdlmain.ads
+++ b/src/ghdldrv/ghdlmain.ads
@@ -47,6 +47,8 @@ package Ghdlmain is
Res : out Option_Res);
-- Get a one-line help for the command.
+ -- If the first character is '!', the string is not displayed by --help
+ -- (for internal commands).
function Get_Short_Help (Cmd : Command_Type) return String
is abstract;