* faked gdb fixed

This commit is contained in:
florian 1999-02-06 00:04:55 +00:00
parent 612c54b2f5
commit 1a384965a8

View File

@ -8,7 +8,73 @@ unit GDBCon;
interface
type
psyminfo=^tsyminfo;
tsyminfo=record
address : longint;
fname : pchar;
line : longint;
funcname : pchar;
end;
tframeentry = object
file_name : pchar;
function_name : pchar;
args : pchar;
line_number : longint;
address : longint;
constructor init;
destructor done;
procedure reset;
procedure clear;
end;
pframeentry=^tframeentry;
ppframeentry=^pframeentry;
tgdbbuffer=object
buf : pchar;
size,
idx : longint;
constructor Init;
destructor Done;
procedure Reset;
procedure Resize;
procedure Append(p:pchar);
end;
PGDBInterface=^TGDBInterface;
TGDBInterface=object
gdberrorbuf,
gdboutputbuf : tgdbbuffer;
got_error,
reset_command,
call_reset,
Debugger_started : boolean;
{ frames and frame info while recording a frame }
frames : ppframeentry;
frame_size,
frame_count : longint;
record_frames,
frame_begin_seen : boolean;
current_address,
current_line_number,
signal_start,
signal_end,
error_start,
error_end,
function_start,
function_end,
args_start,
args_end,
file_start,
file_end,
line_start,
line_end : longint;
{ breakpoint }
last_breakpoint_number,
last_breakpoint_address,
last_breakpoint_line : longint;
last_breakpoint_file : pchar;
invalid_breakpoint_line : boolean;
constructor Init;
destructor Done;
{ functions }
@ -46,8 +112,30 @@ type
end;
var
curr_gdb : pgdbinterface;
const
use_gdb_file : boolean = false;
var
gdb_file : text;
{ gdb does not allow \ in dir or filenames }
procedure UnixDir(var s : string);
implementation
uses
strings;
procedure UnixDir(var s : string);
var i : longint;
begin
for i:=1 to length(s) do
if s[i]='\' then s[i]:='/';
end;
constructor TGDBController.Init;
begin
inherited Init;
@ -172,12 +260,106 @@ procedure TGDBInterface.DoUserScreen;
begin
end;
{*****************************************************************************
TFrameEntry
*****************************************************************************}
constructor tframeentry.init;
begin
Reset;
end;
destructor tframeentry.done;
begin
Clear;
end;
procedure tframeentry.reset;
begin
file_name:=nil;
function_name:=nil;
args:=nil;
line_number:=0;
address:=0;
end;
procedure tframeentry.clear;
begin
if assigned(file_name) then
strdispose(file_name);
if assigned(function_name) then
strdispose(function_name);
if assigned(args) then
strdispose(args);
reset;
end;
{*****************************************************************************
tgdbbuffer
*****************************************************************************}
constructor tgdbbuffer.init;
begin
Size:=0;
Resize;
Reset;
end;
destructor tgdbbuffer.done;
begin
freemem(buf,size);
end;
procedure tgdbbuffer.reset;
begin
idx:=0;
Buf[0]:=#0;
end;
procedure tgdbbuffer.append(p:pchar);
var
len : longint;
begin
if not assigned(p) then
exit;
len:=Strlen(p);
if len+idx>size then
Resize;
Move(p^,buf[idx],len);
inc(idx,len);
buf[idx]:=#0;
end;
procedure tgdbbuffer.resize;
const
blocksize=2048;
var
nsize : longint;
np : pchar;
begin
nsize:=size+blocksize;
getmem(np,nsize);
move(buf^,np^,size);
freemem(buf,size);
buf:=np;
size:=nsize;
end;
end.
{
$Log$
Revision 1.2 1999-02-04 17:19:22 peter
Revision 1.3 1999-02-06 00:04:55 florian
* faked gdb fixed
Revision 1.2 1999/02/04 17:19:22 peter
* linux fixes
Revision 1.1 1999/02/02 16:38:05 peter