1
-----------------------------------------------------------------------
2
-----------------------------------------------------------------------
4
with Ada.Strings; use Ada.Strings;
5
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
6
with GNAT.Expect; use GNAT.Expect;
8
with GNAT.Expect.TTY; use GNAT.Expect.TTY;
10
with GNAT.OS_Lib; use GNAT.OS_Lib;
11
with GNATCOLL.Arg_Lists; use GNATCOLL.Arg_Lists;
12
with GNATCOLL.Utils; use GNATCOLL.Utils;
16
with Glib.Object; use Glib.Object;
17
with Gtk.Main; use Gtk.Main;
18
with Gtk.Window; use Gtk.Window;
19
with Gtkada.Dialogs; use Gtkada.Dialogs;
20
with Gtkada.Types; use Gtkada.Types;
22
with Config; use Config;
24
with GVD.Canvas; use GVD.Canvas;
25
with GVD.Code_Editors; use GVD.Code_Editors;
26
with GVD.Process; use GVD.Process;
27
with GVD.Source_Editor; use GVD.Source_Editor;
28
with GVD.Scripts; use GVD.Scripts;
29
with GVD.Types; use GVD.Types;
30
with GPS.Kernel.Remote; use GPS.Kernel.Remote;
31
with GPS.Intl; use GPS.Intl;
32
with Items; use Items;
33
with Language; use Language;
34
with Language.Debugger; use Language.Debugger;
35
with Process_Proxies; use Process_Proxies;
36
with Remote; use Remote;
37
with String_Utils; use String_Utils;
38
with Traces; use Traces;
40
package body Debugger is
42
use String_History, Language_Lists;
44
Me : constant Debug_Handle := Create ("Debugger");
46
Debug_Timeout : constant Guint32 := 100;
47
-- Timeout in millisecond to check input from the underlying debugger
48
-- when handling asynchronous commands.
50
package Debugger_Timeout is new Gtk.Main.Timeout (Visual_Debugger);
56
function Output_Available (Process : Visual_Debugger) return Boolean;
57
-- Called when waiting output from the debugger.
58
-- This procedure is activated to handle asynchronous commands.
59
-- All it does is read all the available data and call the filters
60
-- that were set for the debugger, until a prompt is found.
62
procedure Send_Internal_Pre
63
(Debugger : access Debugger_Root'Class;
65
Empty_Buffer : Boolean := True;
67
-- Internal procedure used by Send. This takes care of sending the
68
-- command to the debugger, but doesn't parse or even read the output.
69
-- The command is displayed in the command window and added to the
70
-- history if necessary
72
procedure Send_Internal_Post
73
(Debugger : access Debugger_Root'Class;
75
-- Internal procedure used by Send. This takes care of processing the
76
-- output of the debugger, but it doesn't read it.
77
-- This should be called only if we are currently waiting for the next
78
-- prompt, ie processing the output
79
-- Note that this function will do nothing if Mode is Internal.
85
procedure Queue_Command
86
(Debugger : access Debugger_Root'Class;
88
Empty_Buffer : Boolean;
90
-- Queue a given command to be executed after the next call to Wait.
92
function Process_Command
93
(Debugger : access Debugger_Root'Class) return Boolean;
94
-- Call the first command queued for Debugger.
95
-- Return False if no command are in the queue, True otherwise.
97
-----------------------
98
-- Connect_To_Target --
99
-----------------------
101
procedure Connect_To_Target
102
(Debugger : access Debugger_Root;
105
Mode : GVD.Types.Command_Type := GVD.Types.Hidden)
107
pragma Unreferenced (Debugger, Target, Protocol, Mode);
110
end Connect_To_Target;
116
procedure Free (Bt : in out Backtrace_Array) is
118
for J in Bt'Range loop
119
Free (Bt (J).Program_Counter);
120
Free (Bt (J).Subprogram);
121
Free (Bt (J).Source_Location);
130
(Debugger : access Debugger_Root'Class;
131
Entity : String) return Items.Generic_Type_Access
133
Result : Generic_Type_Access;
134
Type_Str : constant String := Type_Of (Debugger, Entity);
135
Index : Natural := Type_Str'First;
138
if Type_Str'Length /= 0 then
140
(Language_Debugger_Access (Get_Language (Debugger)),
141
Type_Str, Entity, Index, Result);
151
procedure Parse_Value
152
(Debugger : access Debugger_Root'Class;
154
Value : in out Items.Generic_Type_Access;
155
Format : Value_Format := Default_Format;
156
Value_Found : out Boolean)
158
Type_Str : constant String := Value_Of (Debugger, Entity, Format);
159
Index : Natural := Type_Str'First;
160
Repeat_Num : Positive;
163
Reset_Recursive (Value);
164
Value_Found := Type_Str'Length /= 0;
168
(Language_Debugger_Access (Get_Language (Debugger)),
169
Type_Str, Index, Value, Repeat_Num);
177
procedure Set_Language
178
(Debugger : access Debugger_Root;
179
The_Language : access Language.Language_Root'Class)
181
C : Language_Lists.Cursor := First (Debugger.Languages);
183
while Has_Element (C) loop
184
if Element (C) = The_Language then
185
Debugger.The_Language := C;
191
Append (Debugger.Languages, Language_Access (The_Language));
192
Debugger.The_Language := Last (Debugger.Languages);
199
function Get_Language
200
(Debugger : access Debugger_Root;
201
Lang : String := "") return Language.Language_Access
203
C : Language_Lists.Cursor;
206
if Has_Element (Debugger.The_Language) then
207
return Element (Debugger.The_Language);
213
C := First (Debugger.Languages);
214
while Has_Element (C) loop
215
if Equal (Get_Name (Element (C)), Lang, Case_Sensitive => False) then
223
---------------------
224
-- Detect_Language --
225
---------------------
227
procedure Detect_Language (Debugger : access Debugger_Root) is
228
pragma Unreferenced (Debugger);
238
(Debugger : access Debugger_Root) return Process_Proxy_Access is
240
return Debugger.Process;
247
procedure General_Spawn
248
(Debugger : access Debugger_Root'Class;
249
Kernel : access GPS.Kernel.Kernel_Handle_Record'Class;
250
Arguments : GNAT.OS_Lib.Argument_List;
251
Debugger_Name : String;
252
Proxy : Process_Proxies.Process_Proxy_Access)
254
Descriptor : Process_Descriptor_Access;
256
CL : Arg_List := Create (Debugger_Name);
259
for J in Arguments'Range loop
260
Append_Argument (CL, Arguments (J).all, One_Arg);
263
-- Start the external debugger.
264
-- Note that there is no limitation on the buffer size, since we can
265
-- not control the length of what gdb will return...
267
Debugger.Process := Proxy;
268
Debugger.Kernel := Kernel_Handle (Kernel);
270
GPS.Kernel.Remote.Spawn
271
(Kernel => Debugger.Kernel,
273
Server => Debug_Server,
278
or else Get_Pid (Descriptor.all) = GNAT.Expect.Invalid_Pid
283
Set_Descriptor (Debugger.Process, Descriptor);
284
Set_Is_Started (Debugger, False);
287
---------------------
288
-- Found_File_Name --
289
---------------------
291
procedure Found_File_Name
292
(Debugger : access Debugger_Root;
294
Name_First : out Natural;
295
Name_Last : out Positive;
296
First, Last : out Natural;
298
Addr_First : out Natural;
299
Addr_Last : out Natural)
301
pragma Unreferenced (Debugger, Str);
312
----------------------
313
-- Found_Frame_Info --
314
----------------------
316
procedure Found_Frame_Info
317
(Debugger : access Debugger_Root;
319
First, Last : out Natural;
320
Message : out Frame_Info_Type)
322
pragma Unreferenced (Debugger, Str);
326
Message := Location_Not_Found;
327
end Found_Frame_Info;
334
(Debugger : access Debugger_Root;
335
Entity : String) return String
337
pragma Unreferenced (Debugger);
342
---------------------
343
-- Lines_With_Code --
344
---------------------
346
procedure Lines_With_Code
347
(Debugger : access Debugger_Root;
348
File : GNATCOLL.VFS.Virtual_File;
349
Result : out Boolean;
350
Lines : out Line_Array)
352
pragma Unreferenced (Debugger, File, Lines);
357
-----------------------
358
-- Source_Files_List --
359
-----------------------
361
function Source_Files_List
362
(Debugger : access Debugger_Root) return GNAT.Strings.String_List
364
pragma Unreferenced (Debugger);
365
A : GNAT.Strings.String_List (1 .. 0);
368
end Source_Files_List;
370
----------------------
371
-- Output_Available --
372
----------------------
374
function Output_Available (Process : Visual_Debugger) return Boolean is
375
Debugger : constant Debugger_Access := Process.Debugger;
379
-- Get everything that is available (and transparently call the
380
-- output filters set for Pid).
381
-- Nothing should be done if we are already processing a command
382
-- (ie somewhere we are blocked on a Wait call for this Debugger),
383
-- since otherwise that Wait won't see the output and will lose some
384
-- output. We don't have to do that anyway, since the other Wait will
385
-- indirectly call the output filter.
387
if Debugger = null then
388
Timeout_Remove (Process.Timeout_Id);
389
Process.Timeout_Id := 0;
393
if Wait_Prompt (Debugger, Timeout => 1) then
394
Debugger.Continuation_Line := False;
395
Timeout_Remove (Process.Timeout_Id);
396
Process.Timeout_Id := 0;
397
Mode := Get_Command_Mode (Get_Process (Debugger));
399
-- Put back the standard cursor
401
if Mode >= Visible then
402
Set_Busy (Process, False);
405
Set_Command_In_Process (Get_Process (Debugger), False);
406
Unregister_Dialog (Process);
408
-- Do the postprocessing here instead of calling Send_Internal_Post
409
-- since we need to handle post processing slightly differently
412
Current_Command : constant String := Get_Command (Process);
414
pragma Unreferenced (Result);
417
Free (Process.Current_Command);
419
if Process_Command (Debugger) then
420
-- ??? register if needed for some of the hooks
425
Final_Post_Process (Process, Mode);
427
if Is_Load_Command (Debugger, Current_Command) then
428
Run_Debugger_Hook (Process, Debugger_Executable_Changed_Hook);
430
elsif Is_Context_Command (Debugger, Current_Command) then
431
Run_Debugger_Hook (Process, Debugger_Context_Changed_Hook);
432
elsif Is_Execution_Command (Debugger, Current_Command) then
433
Run_Debugger_Hook (Process, Debugger_Process_Stopped_Hook);
438
Force => Is_Break_Command (Debugger, Current_Command));
440
-- In case a command has been queued while handling the signals
441
-- and breakpoints above.
443
Result := Process_Command (Debugger);
454
-- Will close the debugger in GVD.Process when getting this
455
-- exception the next time.
457
Traces.Trace (Exception_Handle, E);
459
if Process.Timeout_Id > 0 then
460
Timeout_Remove (Process.Timeout_Id);
462
Process.Timeout_Id := 0;
464
if Debugger /= null and then Get_Process (Debugger) /= null then
465
Set_Command_In_Process (Get_Process (Debugger), False);
468
Set_Busy (Process, False);
469
Free (Process.Current_Command);
470
Unregister_Dialog (Process);
472
end Output_Available;
474
-----------------------
475
-- Send_Internal_Pre --
476
-----------------------
478
procedure Send_Internal_Pre
479
(Debugger : access Debugger_Root'Class;
481
Empty_Buffer : Boolean := True;
485
Process : Visual_Debugger;
488
Set_Command_Mode (Get_Process (Debugger), Mode);
490
if not Is_Started (Debugger)
491
and then Is_Execution_Command (Debugger, Cmd)
493
Set_Is_Started (Debugger, True);
496
Process := GVD.Process.Convert (Debugger);
497
if Process /= null then
498
if not Command_In_Process (Get_Process (Debugger)) then
499
-- If we are already processing a command, this means we set a
500
-- Force_Send parameter to True in the call to Send. Most notably,
501
-- this is used when sending additional input to the debugger (for
502
-- instance answering a gdb question), and we do not want to
503
-- change the current command in this case.
505
if Process.Current_Command /= null then
506
Assert (Me, Process.Current_Command = null,
507
"Memory leak, still has cmd="
508
& Process.Current_Command.all
509
& " while sending " & Cmd,
510
Raise_Exception => True);
513
Process.Current_Command := new String'(Cmd);
516
Set_Command_In_Process (Get_Process (Debugger));
519
and then Is_Execution_Command (Debugger, Cmd)
521
Unhighlight_Current_Line
522
(Get_Source (Process.Editor_Text), GObject (Process));
525
if Mode >= Visible then
529
-- Display the command in the output window if necessary
531
if Mode = Visible then
532
Output_Text (Process, Cmd & ASCII.LF, True);
536
Set_Command_In_Process (Get_Process (Debugger));
539
-- Append the command to the history if necessary
541
if Index_Non_Blank (Cmd) /= 0
542
and then Mode /= Internal
543
and then Process /= null
546
Data.Command := new String'
547
(Cmd (Index_Non_Blank (Cmd) .. Index_Non_Blank (Cmd, Backward)));
548
Append (Process.Command_History, Data);
551
-- Send the command to the debugger
553
Send (Get_Process (Debugger), Cmd, Empty_Buffer);
554
end Send_Internal_Pre;
556
------------------------
557
-- Send_Internal_Post --
558
------------------------
560
procedure Send_Internal_Post
561
(Debugger : access Debugger_Root'Class;
564
Process : Visual_Debugger;
566
pragma Unreferenced (Result);
567
Is_Context, Is_Exec, Is_Break : Boolean;
570
-- See also Output_Available for similar handling.
571
Set_Command_In_Process (Get_Process (Debugger), False);
573
Process := GVD.Process.Convert (Debugger);
575
if Process /= null then
576
Is_Context := Is_Context_Command
577
(Debugger, Process.Current_Command.all);
578
Is_Exec := Is_Execution_Command
579
(Debugger, Process.Current_Command.all);
580
Is_Break := Is_Break_Command
581
(Debugger, Process.Current_Command.all);
583
Free (Process.Current_Command);
586
if Mode /= Internal and then Process_Command (Debugger) then
587
-- ??? register if needed for hooks before returning
591
if Process /= null then
592
Final_Post_Process (Process, Mode);
594
if Mode /= Internal then
595
-- Postprocessing (e.g handling of auto-update).
598
Run_Debugger_Hook (Process, Debugger_Context_Changed_Hook);
600
Run_Debugger_Hook (Process, Debugger_Process_Stopped_Hook);
603
Update_Breakpoints (Process, Force => Is_Break);
606
if Mode >= Visible then
607
Set_Busy (Process, False);
610
Unregister_Dialog (Process);
612
-- In case a command has been queued while handling the signals
613
-- and breakpoints above.
615
if Mode /= Internal then
616
Result := Process_Command (Debugger);
619
end Send_Internal_Post;
626
(Debugger : access Debugger_Root;
628
Empty_Buffer : Boolean := True;
629
Wait_For_Prompt : Boolean := True;
630
Force_Send : Boolean := False;
631
Mode : Command_Type := Hidden)
633
Process : Visual_Debugger;
634
Button : Message_Dialog_Buttons;
635
pragma Unreferenced (Button);
636
Last : Positive := Cmd'First;
640
-- When there are multiple commands separated by ASCII.LF, Force_Send
641
-- applies to the command set as a whole. If the debugger is processing
642
-- a command, we send none of them, otherwise we send them all without
643
-- queuing any of them. Chaining of commands through ASCII.LF seems to
644
-- only occur in a few limited cases anyway (Set_Breakpoint_Command for
648
and then Command_In_Process (Get_Process (Debugger))
650
-- Will be processed by the same Send later on
651
Queue_Command (Debugger, Cmd, Empty_Buffer, Mode);
655
-- Each command is separated with a ASCII.LF and is handled separately
659
Skip_To_Char (Cmd, Last, ASCII.LF);
661
-- Used to have the following text:
662
-- if Mode not in Invisible_Command
663
-- and then Wait_For_Prompt
664
-- and then Command_In_Process (Get_Process (Debugger))
665
-- However, this fails sometimes with gdb: when "cont" terminates the
666
-- program, gdb is emitting a "tty" command while cont is still
667
-- being processed, and therefore the if was changed to the below to
668
-- queue the tty command.
669
-- ??? In fact, I (Manu) am not sure how this was working before: if
670
-- we are waiting for a prompt, we should not be queuing the command
671
-- still this would return to the caller before we saw the prompt.
674
(Debugger, Cmd (First .. Last - 1), Empty_Buffer, Mode);
677
when Invisible_Command =>
678
if Last > Cmd'Last and then Wait_For_Prompt then
679
-- Only wait for the prompt on the last command when
680
-- there are multiple commands separated by ASCII.LF
681
Wait_Prompt (Debugger_Access (Debugger));
682
Debugger.Continuation_Line := False;
683
Send_Internal_Post (Debugger, Mode);
686
when Visible_Command =>
687
if Wait_For_Prompt then
688
if not Async_Commands then
689
-- Synchronous handling of commands, simple case
691
Wait_Prompt (Debugger_Access (Debugger));
692
Debugger.Continuation_Line := False;
693
Send_Internal_Post (Debugger, Mode);
696
-- Asynchronous handling of commands, install a
697
-- callback on the debugger's output file descriptor.
699
Process := GVD.Process.Convert (Debugger);
700
pragma Assert (Process.Timeout_Id = 0);
702
Process.Timeout_Id := Debugger_Timeout.Add
703
(Debug_Timeout, Output_Available'Access, Process);
707
if Mode >= Visible then
708
-- Clear the current output received from the debugger
709
-- to avoid confusing the prompt detection, since
710
-- we're sending input in the middle of a command,
711
-- which is delicate.
713
Process_Proxies.Empty_Buffer (Get_Process (Debugger));
714
Process := GVD.Process.Convert (Debugger);
715
Set_Busy (Process, False);
720
exit when Last > Cmd'Last;
727
Process := GVD.Process.Convert (Debugger);
728
Free (Process.Current_Command);
730
if Process.Exiting then
734
Trace (Me, "underlying debugger died unexpectedly in 'send'");
737
(Expect_Out (Get_Process (Debugger)) & ASCII.LF &
738
(-"The underlying debugger died unexpectedly. Closing it"),
739
Error, Button_OK, Button_OK);
740
Set_Command_In_Process (Get_Process (Debugger), False);
741
Set_Busy (Process, False);
742
Unregister_Dialog (Process);
743
Close_Debugger (Process);
751
(Debugger : access Debugger_Root;
753
Mode : Invisible_Command := Hidden) return String
755
Process : Visual_Debugger;
760
if Command_In_Process (Get_Process (Debugger)) then
761
-- Should never happen, but it's safer to return immediately in case
762
-- we're compiling without assertions, rather than hanging.
764
pragma Assert (False);
768
Send_Internal_Pre (Debugger, Cmd, Mode => Mode);
769
Wait_Prompt (Debugger_Access (Debugger));
770
Debugger.Continuation_Line := False;
774
Glib.Convert.Locale_To_UTF8 (Expect_Out (Get_Process (Debugger)));
776
Send_Internal_Post (Debugger, Mode);
778
-- Strip CRs in remote mode, as we can't know in advance if the debug
779
-- server outputs CR/LF or just LF, and the consequences or removing
780
-- CRs in the latter case are better than not removing them in the
782
if Need_To_Strip_CR or else not Is_Local (Debug_Server) then
783
Strip_CR (S, Last, CR_Found);
784
return S (S'First .. Last);
792
Trace (Me, "underlying debugger died unexpectedly in 'send_full'");
793
Set_Command_In_Process (Get_Process (Debugger), False);
795
Process := GVD.Process.Convert (Debugger);
796
if Process /= null then
797
Free (Process.Current_Command);
798
Set_Busy (Process, False);
799
Unregister_Dialog (Process);
800
Close_Debugger (Process);
806
---------------------
807
-- List_Exceptions --
808
---------------------
810
function List_Exceptions
811
(Debugger : access Debugger_Root) return Exception_Array
813
pragma Unreferenced (Debugger);
815
Arr : Exception_Array (1 .. 0);
824
function Get_Type_Info
825
(Debugger : access Debugger_Root;
827
Default : String) return String
829
pragma Unreferenced (Debugger, Entity);
839
(Debugger : access Debugger_Root; File_Name : String) return String
841
pragma Unreferenced (Debugger);
850
function Is_Started (Debugger : access Debugger_Root) return Boolean is
852
return Debugger.Is_Started;
859
procedure Set_Is_Started
860
(Debugger : access Debugger_Root;
861
Is_Started : Boolean) is
863
Debugger.Is_Started := Is_Started;
865
(GVD.Process.Convert (Debugger), Debugger_Process_Terminated_Hook);
872
procedure Set_Variable
873
(Debugger : access Debugger_Root;
877
S : constant String :=
878
Set_Variable (Language_Debugger_Access (Get_Language (Debugger)),
882
-- We need to send the command in hidden mode (synchronously)
883
-- because right after this call, Set_Value will typically request
884
-- the new value of the variable, before we got the debugger's
885
-- prompt asynchronously.
887
Send (Debugger, S, Mode => Hidden);
891
-----------------------
892
-- Wait_User_Command --
893
-----------------------
895
procedure Wait_User_Command (Debugger : access Debugger_Root) is
896
Current_Process : Process_Proxy_Access;
898
pragma Unreferenced (Tmp);
900
Num_Events : Positive;
901
Max_Events : constant := 30;
902
-- Limit the number of events to process in one iteration
905
-- Wait until the command has been processed
907
Current_Process := Get_Process (Debugger);
909
-- Make sure that Current_Process is not null before calling
910
-- Command_In_Process : this can happen when GVD is exiting.
912
while Current_Process /= null
913
and then Command_In_Process (Current_Process)
917
while Gtk.Main.Events_Pending
918
and then Num_Events <= Max_Events
920
Tmp := Gtk.Main.Main_Iteration;
921
Num_Events := Num_Events + 1;
924
Current_Process := Get_Process (Debugger);
926
end Wait_User_Command;
932
procedure Free (Info : in out Thread_Information_Array) is
934
for J in Info'Range loop
935
Free (Info (J).Information);
943
procedure Queue_Command
944
(Debugger : access Debugger_Root'Class;
946
Empty_Buffer : Boolean;
949
Tmp : Command_Access := Debugger.Command_Queue;
950
Command : Command_Access;
953
Command := new Command_Record'
954
(Cmd => new String'(Cmd),
955
Empty_Buffer => Empty_Buffer,
960
Debugger.Command_Queue := Command;
962
while Tmp.Next /= null loop
970
---------------------
971
-- Process_Command --
972
---------------------
974
procedure Free is new
975
Ada.Unchecked_Deallocation (Command_Record, Command_Access);
977
function Process_Command
978
(Debugger : access Debugger_Root'Class) return Boolean
980
Command : Command_Access := Debugger.Command_Queue;
981
Process : Visual_Debugger;
985
if Command = null then
989
Debugger.Command_Queue := Command.Next;
991
First := Command.Cmd'First;
992
Skip_Blanks (Command.Cmd.all, First);
994
if Looking_At (Command.Cmd.all, First, "graph") then
995
Process := GVD.Process.Convert (Debugger);
996
if Process /= null then
997
Process_Graph_Cmd (Process, Command.Cmd.all);
1002
(Debugger, Command.Cmd.all, Command.Empty_Buffer,
1003
Mode => Command.Mode);
1009
end Process_Command;
1015
procedure Clear_Queue (Debugger : access Debugger_Root'Class) is
1016
Command : Command_Access := Debugger.Command_Queue;
1018
while Command /= null loop
1019
Debugger.Command_Queue := Command.Next;
1027
--------------------
1028
-- Open_Processes --
1029
--------------------
1031
procedure Open_Processes (Debugger : access Debugger_Root) is
1033
Open_Processes (Debugger.Handle, Debugger.Kernel);
1040
procedure Next_Process
1041
(Debugger : access Debugger_Root;
1042
Info : out GVD.Proc_Utils.Process_Info;
1043
Success : out Boolean) is
1045
Next_Process (Debugger.Handle, Info, Success);
1048
---------------------
1049
-- Close_Processes --
1050
---------------------
1052
procedure Close_Processes (Debugger : access Debugger_Root) is
1054
Close_Processes (Debugger.Handle);
1055
end Close_Processes;
1061
function Support_TTY (Debugger : access Debugger_Root) return Boolean is
1062
pragma Unreferenced (Debugger);
1071
procedure Set_TTY (Debugger : access Debugger_Root; TTY : String) is
1072
pragma Unreferenced (Debugger, TTY);
1074
raise Unknown_Command;
1077
-----------------------
1078
-- Continuation_Line --
1079
-----------------------
1081
function Continuation_Line
1082
(Debugger : access Debugger_Root) return Boolean is
1084
return Debugger.Continuation_Line;
1085
end Continuation_Line;
1087
-------------------------------
1088
-- Separate_Execution_Window --
1089
-------------------------------
1091
function Separate_Execution_Window
1092
(Debugger : access Debugger_Root) return Boolean is
1094
return Debugger.Execution_Window;
1095
end Separate_Execution_Window;
1101
procedure Close (Debugger : access Debugger_Root) is
1102
Result : Expect_Match;
1103
C : Language_Lists.Cursor := First (Debugger.Languages);
1104
Lang : Language.Language_Access;
1106
while Has_Element (C) loop
1107
Lang := Element (C);
1108
Language.Free (Lang);
1111
Clear (Debugger.Languages);
1113
if Get_Process (Debugger) /= null
1114
and then Get_Descriptor (Get_Process (Debugger)) /= null
1117
-- Ensure that the debugger is terminated before closing the pipes
1118
-- and trying to kill it abruptly.
1121
Wait (Get_Process (Debugger), Result, ".+", Timeout => 200);
1123
when Process_Died =>
1124
-- This is somewhat expected... RIP.
1127
Close (Get_Descriptor (Get_Process (Debugger)).all);
1129
when Process_Died =>
1134
Free (Debugger.Process);
1135
Free (Debugger.Remote_Target);
1136
Free (Debugger.Remote_Protocol);
1138
-- ??? Shouldn't we free Command_Queue
1146
(Debugger : access Debugger_Root'Class)
1147
return GPS.Kernel.Kernel_Handle is
1149
return Debugger.Kernel;
1152
------------------------------
1153
-- Set_Breakpoint_Condition --
1154
------------------------------
1156
procedure Set_Breakpoint_Condition
1157
(Debugger : access Debugger_Root;
1158
Num : GVD.Types.Breakpoint_Identifier;
1160
Mode : GVD.Types.Command_Type := GVD.Types.Hidden)
1164
end Set_Breakpoint_Condition;
1166
----------------------
1167
-- Set_Scope_Action --
1168
----------------------
1170
procedure Set_Breakpoint_Command
1171
(Debugger : access Debugger_Root;
1172
Num : GVD.Types.Breakpoint_Identifier;
1174
Mode : GVD.Types.Command_Type := GVD.Types.Hidden)
1178
end Set_Breakpoint_Command;
1180
----------------------
1181
-- Set_Scope_Action --
1182
----------------------
1184
procedure Set_Breakpoint_Ignore_Count
1185
(Debugger : access Debugger_Root;
1186
Num : GVD.Types.Breakpoint_Identifier;
1188
Mode : GVD.Types.Command_Type := GVD.Types.Hidden)
1192
end Set_Breakpoint_Ignore_Count;
1194
----------------------
1195
-- Set_Scope_Action --
1196
----------------------
1198
procedure Set_Scope_Action
1199
(Debugger : access Debugger_Root;
1200
Scope : GVD.Types.Scope_Type := GVD.Types.No_Scope;
1201
Action : GVD.Types.Action_Type := GVD.Types.No_Action;
1202
Num : GVD.Types.Breakpoint_Identifier := 0;
1203
Mode : GVD.Types.Command_Type := GVD.Types.Hidden)
1205
pragma Unreferenced (Scope, Action, Num, Mode);
1208
end Set_Scope_Action;
1214
procedure Task_Switch
1215
(Debugger : access Debugger_Root;
1217
Mode : GVD.Types.Command_Type := GVD.Types.Hidden)
1219
pragma Unreferenced (Task_Num, Mode);
1228
procedure Thread_Switch
1229
(Debugger : access Debugger_Root;
1231
Mode : GVD.Types.Command_Type := GVD.Types.Hidden)
1233
pragma Unreferenced (Thread, Mode);
1243
(Debugger : access Debugger_Root;
1245
Mode : GVD.Types.Command_Type := GVD.Types.Hidden)
1247
pragma Unreferenced (PD, Mode);
1256
procedure Info_Tasks
1257
(Debugger : access Debugger_Root;
1258
Info : out Thread_Information_Array;
1261
pragma Unreferenced (Info, Debugger);
1270
procedure Info_Threads
1271
(Debugger : access Debugger_Root;
1272
Info : out Thread_Information_Array;
1275
pragma Unreferenced (Info, Debugger);
1285
(Debugger : access Debugger_Root;
1286
Info : out PD_Information_Array;
1289
pragma Unreferenced (Info, Debugger);
1294
-------------------------
1295
-- Set_VxWorks_Version --
1296
-------------------------
1298
procedure Set_VxWorks_Version
1299
(Debugger : access Debugger_Root; Force : Boolean := False)
1301
pragma Unreferenced (Force);
1304
end Set_VxWorks_Version;
1306
---------------------
1307
-- VxWorks_Version --
1308
---------------------
1310
function VxWorks_Version
1311
(Debugger : access Debugger_Root)
1312
return GVD.Types.VxWorks_Version_Type
1314
pragma Unreferenced (Debugger);
1317
end VxWorks_Version;