Add simple Debug_Trace code for printing statements while debugging

This commit is contained in:
R. Tyler Croy 2011-02-13 12:11:22 -08:00
parent 32fff8bf41
commit cb33969847
2 changed files with 12 additions and 0 deletions

View File

@ -64,11 +64,21 @@ package body Epoll is
return Created_Hub;
end Create;
procedure Validate_Hub (H : in Hub) is
begin
Debug_Trace (H, "Entering Validate_Hub");
if H.Epoll_Fd < 0 then
raise Hub_Invalid;
end if;
end Validate_Hub;
procedure Debug_Trace (H : in Hub; Line : in String) is
begin
if not H.Debug then
return;
end if;
end Debug_Trace;
end Epoll;

View File

@ -38,10 +38,12 @@ package Epoll is
type Hub is tagged record
Epoll_Fd : C.int := -1;
Should_Continue : Boolean := True;
Debug : Boolean := False;
Callbacks : Callback_Registry.Vector;
end record;
procedure Validate_Hub (H: in Hub);
procedure Debug_Trace (H: in Hub; Line : in String);
subtype EPOLL_CTL_OPS is C.unsigned;
EPOLL_CTL_ADD : constant EPOLL_CTL_OPS := 1;