* watches display enhanced and crashes removed

This commit is contained in:
pierre 2001-08-07 22:58:10 +00:00
parent 13f5fb2b3e
commit 1479205e69

View File

@ -2209,7 +2209,8 @@ procedure TWatch.Get_new_value;
var p, q : pchar; var p, q : pchar;
i, j, curframe, startframe : longint; i, j, curframe, startframe : longint;
s,s2 : string; s,s2 : string;
loop_higher, found, last_removed : boolean; loop_higher, found : boolean;
last_removed : char;
function GetValue(var s : string) : boolean; function GetValue(var s : string) : boolean;
begin begin
@ -2308,17 +2309,19 @@ procedure TWatch.Get_new_value;
i:=0; i:=0;
if (i>0) and (q[i-1]=#10) then if (i>0) and (q[i-1]=#10) then
begin begin
while (i>1) and ((q[i-2]=' ') or (q[i-2]=#9)) do
dec(i);
last_removed:=q[i-1];
q[i-1]:=#0; q[i-1]:=#0;
last_removed:=true;
end end
else else
last_removed:=false; last_removed:=#0;
if assigned(q) then if assigned(q) then
current_value:=strnew(q) current_value:=strnew(q)
else else
current_value:=strnew(''); current_value:=strnew('');
if last_removed then if last_removed<>#0 then
q[i-1]:=#10; q[i-1]:=last_removed;
strdispose(p); strdispose(p);
GDBRunCount:=Debugger^.RunCount; GDBRunCount:=Debugger^.RunCount;
end; end;
@ -2353,16 +2356,18 @@ destructor TWatch.Done;
procedure TWatchesCollection.Update; procedure TWatchesCollection.Update;
var var
W,W1 : integer; W,W1 : integer;
procedure GetMax(P : PWatch); procedure GetMax(P : PWatch);
begin begin
if assigned(P^.Current_value) then if assigned(P^.Current_value) then
begin W1:=StrLen(P^.Current_value)+3+Length(GetStr(P^.expr))
W1:=StrLen(P^.Current_value)+2+Length(GetStr(P^.expr)); else
if W1>W then W1:=2+Length(GetStr(P^.expr));
W:=W1; if W1>W then
end; W:=W1;
end; end;
begin
begin
W:=0; W:=0;
ForEach(@GetMax); ForEach(@GetMax);
MaxW:=W; MaxW:=W;
@ -2431,11 +2436,16 @@ begin
GetIndentedText:='' GetIndentedText:=''
else if Indent<ValOffset then else if Indent<ValOffset then
begin begin
if not assigned(PW^.current_value) then S:=GetStr(PW^.Expr);
S:=' '+GetStr(PW^.Expr)+' <Unknown value>' if Indent=0 then
S:=' '+S
else else
S:=' '+GetStr(PW^.Expr)+' '+GetPChar(PW^.Current_value); S:=Copy(S,Indent,High(S));
GetIndentedText:=Copy(S,Indent,MaxLen); if not assigned(PW^.current_value) then
S:=S+' <Unknown value>'
else
S:=S+' '+GetPChar(PW^.Current_value);
GetIndentedText:=Copy(S,1,MaxLen);
end end
else else
begin begin
@ -3866,7 +3876,10 @@ end.
{ {
$Log$ $Log$
Revision 1.2 2001-08-05 02:01:47 peter Revision 1.3 2001-08-07 22:58:10 pierre
* watches display enhanced and crashes removed
Revision 1.2 2001/08/05 02:01:47 peter
* FVISION define to compile with fvision units * FVISION define to compile with fvision units
Revision 1.1 2001/08/04 11:30:23 peter Revision 1.1 2001/08/04 11:30:23 peter