mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-09 23:12:57 +01:00
* bug with Toggle Break fixed, hopefully
+ search for local vars in parent procs avoiding
wrong results (see test.pas source)
This commit is contained in:
parent
1dbd0d4a64
commit
919bed76f0
@ -877,9 +877,8 @@ begin
|
|||||||
{ d:test.pas:12 does not work !! }
|
{ d:test.pas:12 does not work !! }
|
||||||
{ I do not know how to solve this if
|
{ I do not know how to solve this if
|
||||||
if (Length(AFile)>1) and (AFile[2]=':') then
|
if (Length(AFile)>1) and (AFile[2]=':') then
|
||||||
AFile:=Copy(AFile,3,255);
|
AFile:=Copy(AFile,3,255); }
|
||||||
Only use base name for now !! PM }
|
FileName:=NewStr(GDBFileName(AFile));
|
||||||
FileName:=NewStr(GDBFileName(NameAndExtOf(AFile)));
|
|
||||||
Name:=nil;
|
Name:=nil;
|
||||||
Line:=ALine;
|
Line:=ALine;
|
||||||
IgnoreCount:=0;
|
IgnoreCount:=0;
|
||||||
@ -1091,7 +1090,8 @@ procedure TBreakpointCollection.ShowBreakpoints(W : PSourceWindow);
|
|||||||
|
|
||||||
procedure SetInSource(P : PBreakpoint);{$ifndef FPC}far;{$endif}
|
procedure SetInSource(P : PBreakpoint);{$ifndef FPC}far;{$endif}
|
||||||
begin
|
begin
|
||||||
If assigned(P^.FileName) and (P^.FileName^=NameAndExtOf(W^.Editor^.FileName)) then
|
If assigned(P^.FileName) and
|
||||||
|
(GDBFileName(FExpand(P^.FileName^))=GDBFileName(FExpand(W^.Editor^.FileName))) then
|
||||||
W^.Editor^.SetLineBreakState(P^.Line,P^.state=bs_enabled);
|
W^.Editor^.SetLineBreakState(P^.Line,P^.state=bs_enabled);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1845,22 +1845,73 @@ procedure TWatch.rename(s : string);
|
|||||||
|
|
||||||
procedure TWatch.Get_new_value;
|
procedure TWatch.Get_new_value;
|
||||||
var p, q : pchar;
|
var p, q : pchar;
|
||||||
i : longint;
|
i, j, curframe, startframe : longint;
|
||||||
last_removed : boolean;
|
error : integer;
|
||||||
|
c : char;
|
||||||
|
s,s2 : string;
|
||||||
|
loop_higher, found, last_removed : boolean;
|
||||||
|
|
||||||
|
function GetValue(var s : string) : boolean;
|
||||||
|
begin
|
||||||
|
Debugger^.command('p '+s);
|
||||||
|
if not Debugger^.Error then
|
||||||
|
begin
|
||||||
|
s:=StrPas(Debugger^.GetOutput);
|
||||||
|
GetValue:=true;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
s:=StrPas(Debugger^.GetError);
|
||||||
|
GetValue:=false;
|
||||||
|
{ do not open a messagebox for such errors }
|
||||||
|
Debugger^.got_error:=false;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If not assigned(Debugger) then
|
If not assigned(Debugger) then
|
||||||
exit;
|
exit;
|
||||||
if assigned(last_value) then
|
if assigned(last_value) then
|
||||||
strdispose(last_value);
|
strdispose(last_value);
|
||||||
last_value:=current_value;
|
last_value:=current_value;
|
||||||
Debugger^.Command('p '+GetStr(expr));
|
s:=GetStr(expr);
|
||||||
if Debugger^.Error then
|
found:=GetValue(s);
|
||||||
p:=StrNew(Debugger^.GetError)
|
Debugger^.got_error:=false;
|
||||||
else
|
loop_higher:=not found;
|
||||||
p:=StrNew(Debugger^.GetOutput);
|
curframe:=Debugger^.get_current_frame;
|
||||||
{ do not open a messagebox for such errors }
|
startframe:=curframe;
|
||||||
|
while loop_higher do
|
||||||
|
begin
|
||||||
|
s:='parent_ebp';
|
||||||
|
if GetValue(s) then
|
||||||
|
begin
|
||||||
|
repeat
|
||||||
|
inc(curframe);
|
||||||
|
if not Debugger^.set_current_frame(curframe) then
|
||||||
|
loop_higher:=false;
|
||||||
|
s2:='/x $ebp';
|
||||||
|
getValue(s2);
|
||||||
|
j:=pos('=',s2);
|
||||||
|
if j>0 then
|
||||||
|
s2:=copy(s2,j+1,length(s2));
|
||||||
|
while s2[1] in [' ',TAB] do
|
||||||
|
delete(s2,1,1);
|
||||||
|
if pos(s2,s)>0 then
|
||||||
|
loop_higher :=false;
|
||||||
|
until not loop_higher;
|
||||||
|
{ try again at that level }
|
||||||
|
s:=GetStr(expr);
|
||||||
|
loop_higher:=not GetValue(s);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
loop_higher:=false;
|
||||||
|
end;
|
||||||
|
s:=GetStr(expr);
|
||||||
|
if GetValue(s) then
|
||||||
|
p:=StrNew(Debugger^.GetOutput)
|
||||||
|
else
|
||||||
|
p:=StrNew(Debugger^.GetError);
|
||||||
Debugger^.got_error:=false;
|
Debugger^.got_error:=false;
|
||||||
|
|
||||||
{ We should try here to find the expr in parent
|
{ We should try here to find the expr in parent
|
||||||
procedure if there are
|
procedure if there are
|
||||||
I will implement this as I added a
|
I will implement this as I added a
|
||||||
@ -1869,6 +1920,8 @@ procedure TWatch.Get_new_value;
|
|||||||
{ But there are some pitfalls like
|
{ But there are some pitfalls like
|
||||||
locals redefined in other sublocals that call the function }
|
locals redefined in other sublocals that call the function }
|
||||||
|
|
||||||
|
Debugger^.set_current_frame(startframe);
|
||||||
|
|
||||||
q:=nil;
|
q:=nil;
|
||||||
if assigned(p) and (p[0]='$') then
|
if assigned(p) and (p[0]='$') then
|
||||||
q:=StrPos(p,'=');
|
q:=StrPos(p,'=');
|
||||||
@ -3145,7 +3198,12 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.49 2000-02-04 23:18:05 pierre
|
Revision 1.50 2000-02-05 01:27:58 pierre
|
||||||
|
* bug with Toggle Break fixed, hopefully
|
||||||
|
+ search for local vars in parent procs avoiding
|
||||||
|
wrong results (see test.pas source)
|
||||||
|
|
||||||
|
Revision 1.49 2000/02/04 23:18:05 pierre
|
||||||
* no pushstatus in DoneDebugger because its called after App.done
|
* no pushstatus in DoneDebugger because its called after App.done
|
||||||
|
|
||||||
Revision 1.48 2000/02/04 14:34:46 pierre
|
Revision 1.48 2000/02/04 14:34:46 pierre
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user