Skip to content

Commit 8ce5b61

Browse files
Do not intercept 'delete' GDB commands
For eng/ide/gnatstudio#281
1 parent 82cbd32 commit 8ce5b61

File tree

1 file changed

+0
-85
lines changed

1 file changed

+0
-85
lines changed

dap/src/dap-clients.adb

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ with VSS.Regular_Expressions;
4141
with VSS.Stream_Element_Vectors.Conversions;
4242
with VSS.Strings; use VSS.Strings;
4343
with VSS.Strings.Conversions;
44-
with VSS.Strings.Cursors.Iterators.Characters;
4544
with VSS.Text_Streams.Memory_UTF8_Input;
4645
with VSS.Text_Streams.Memory_UTF8_Output;
4746

@@ -136,18 +135,6 @@ package body DAP.Clients is
136135
& "(?:\s+(.+)?)?$");
137136
-- to catch breakpoint command
138137

139-
Is_Delete_Pattern : constant VSS.Regular_Expressions.
140-
Regular_Expression := VSS.Regular_Expressions.To_Regular_Expression
141-
("^\s*(delete|del|d)(?:\s+(.+)?)?$");
142-
-- to catch delete breakpoint(s) command
143-
144-
Bp_Delete_Details_Idx : constant := 2;
145-
146-
Ids_Pattern : constant VSS.Regular_Expressions.
147-
Regular_Expression := VSS.Regular_Expressions.To_Regular_Expression
148-
("((\d+)\s*-\s*(\d+)|\d+)");
149-
-- to get all (breakpoints) ids or range
150-
151138
Is_Ignore_Pattern : constant VSS.Regular_Expressions.
152139
Regular_Expression := VSS.Regular_Expressions.To_Regular_Expression
153140
("^\s*(?:ignore)\s+(\d+)\s+(\d+)");
@@ -1659,10 +1646,8 @@ package body DAP.Clients is
16591646
VSS_Cmd : Virtual_String;
16601647
Details : Virtual_String;
16611648
Level : Integer;
1662-
Ids : Breakpoint_Identifier_Lists.List;
16631649

16641650
procedure Add_BP_For_Offset;
1665-
procedure Check_Delete_Command;
16661651
procedure Check_Ignore_Command;
16671652
function Value
16681653
(S : VSS.Strings.Virtual_String) return Integer;
@@ -1694,72 +1679,6 @@ package body DAP.Clients is
16941679
Condition => Details_Match.Captured (Bp_Condition_Idx));
16951680
end Add_BP_For_Offset;
16961681

1697-
--------------------------
1698-
-- Check_Delete_Command --
1699-
--------------------------
1700-
1701-
procedure Check_Delete_Command is
1702-
begin
1703-
-- Is the `delete` command
1704-
Matched := Is_Delete_Pattern.Match (VSS_Cmd);
1705-
1706-
if Matched.Has_Match then
1707-
if Self.Breakpoints = null then
1708-
null;
1709-
1710-
elsif Matched.Has_Capture (Bp_Delete_Details_Idx) then
1711-
-- Get breakpoint ids or ranges
1712-
Details := Matched.Captured (Bp_Delete_Details_Idx);
1713-
1714-
declare
1715-
From : VSS.Strings.Cursors.Iterators.Characters.
1716-
Character_Iterator := Details.Before_First_Character;
1717-
begin
1718-
while From.Forward loop
1719-
Details_Match := Ids_Pattern.Match (Details, From);
1720-
exit when not Details_Match.Has_Match;
1721-
1722-
if Details_Match.Has_Capture (2) then
1723-
-- Range match found:
1724-
-- 1: 1 .. 3 => '2-3'
1725-
-- 2: 1 .. 1 => '2'
1726-
-- 3: 3 .. 3 => '3'
1727-
1728-
for Index in
1729-
Value (Details_Match.Captured (1)) ..
1730-
Value (Details_Match.Captured (2))
1731-
loop
1732-
Ids.Append (Breakpoint_Identifier (Index));
1733-
end loop;
1734-
1735-
else
1736-
-- Id match found:
1737-
-- 1: 1 .. 1 => '4'
1738-
1739-
Ids.Append
1740-
(Breakpoint_Identifier
1741-
(Value (Details_Match.Captured (1))));
1742-
end if;
1743-
1744-
From.Set_At (Details_Match.Last_Marker (1));
1745-
end loop;
1746-
1747-
if not Ids.Is_Empty then
1748-
Self.Breakpoints.Remove_Breakpoints (Ids);
1749-
end if;
1750-
end;
1751-
1752-
else
1753-
-- `delete` command does not have ids,
1754-
-- remove all breakpoints.
1755-
Self.Breakpoints.Remove_All_Breakpoints;
1756-
end if;
1757-
1758-
-- Clear the command to signal that the command is processed
1759-
VSS_Cmd.Clear;
1760-
end if;
1761-
end Check_Delete_Command;
1762-
17631682
--------------------------
17641683
-- Check_Ignore_Command --
17651684
--------------------------
@@ -1945,10 +1864,6 @@ package body DAP.Clients is
19451864
VSS_Cmd.Clear;
19461865
end if;
19471866

1948-
if not VSS_Cmd.Is_Empty then -- Command is not processed yet
1949-
Check_Delete_Command;
1950-
end if;
1951-
19521867
if not VSS_Cmd.Is_Empty then -- Command is not processed yet
19531868
Check_Ignore_Command;
19541869
end if;

0 commit comments

Comments
 (0)