mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-18 00:09:18 +02:00
+ Disassembly window made public
This commit is contained in:
parent
b8416e8411
commit
beb0234acb
@ -233,6 +233,7 @@ const
|
|||||||
cmRedoAll = 2502;
|
cmRedoAll = 2502;
|
||||||
|
|
||||||
cmDebuggerStopped = 2600;
|
cmDebuggerStopped = 2600;
|
||||||
|
cmDisassemble = 2601;
|
||||||
|
|
||||||
cmSymBrowse = 2700;
|
cmSymBrowse = 2700;
|
||||||
cmSymGotoSource = 2701;
|
cmSymGotoSource = 2701;
|
||||||
@ -433,7 +434,10 @@ implementation
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 2001-08-05 02:01:47 peter
|
Revision 1.3 2001-11-07 00:28:52 pierre
|
||||||
|
+ Disassembly window made public
|
||||||
|
|
||||||
|
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
|
||||||
|
@ -68,7 +68,8 @@ type
|
|||||||
function GetPointerAt(addr : CORE_ADDR) : CORE_ADDR;
|
function GetPointerAt(addr : CORE_ADDR) : CORE_ADDR;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BreakpointType = (bt_function,bt_file_line,bt_watch,bt_awatch,bt_rwatch,bt_invalid);
|
BreakpointType = (bt_function,bt_file_line,bt_watch,
|
||||||
|
bt_awatch,bt_rwatch,bt_address,bt_invalid);
|
||||||
BreakpointState = (bs_enabled,bs_disabled,bs_deleted);
|
BreakpointState = (bs_enabled,bs_disabled,bs_deleted);
|
||||||
|
|
||||||
PBreakpointCollection=^TBreakpointCollection;
|
PBreakpointCollection=^TBreakpointCollection;
|
||||||
@ -88,6 +89,7 @@ type
|
|||||||
GDBIndex : longint;
|
GDBIndex : longint;
|
||||||
GDBState : BreakpointState;
|
GDBState : BreakpointState;
|
||||||
constructor Init_function(Const AFunc : String);
|
constructor Init_function(Const AFunc : String);
|
||||||
|
constructor Init_Address(Const AAddress : String);
|
||||||
constructor Init_Empty;
|
constructor Init_Empty;
|
||||||
constructor Init_file_line(AFile : String; ALine : longint);
|
constructor Init_file_line(AFile : String; ALine : longint);
|
||||||
constructor Init_type(atyp : BreakpointType;Const AnExpr : String);
|
constructor Init_type(atyp : BreakpointType;Const AnExpr : String);
|
||||||
@ -108,7 +110,7 @@ type
|
|||||||
function GetType(typ : BreakpointType;Const s : String) : PBreakpoint;
|
function GetType(typ : BreakpointType;Const s : String) : PBreakpoint;
|
||||||
function ToggleFileLine(FileName: String;LineNr : Longint) : boolean;
|
function ToggleFileLine(FileName: String;LineNr : Longint) : boolean;
|
||||||
procedure Update;
|
procedure Update;
|
||||||
procedure ShowBreakpoints(W : PSourceWindow);
|
procedure ShowBreakpoints(W : PFPWindow);
|
||||||
procedure ShowAllBreakpoints;
|
procedure ShowAllBreakpoints;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -338,7 +340,7 @@ type
|
|||||||
|
|
||||||
const
|
const
|
||||||
BreakpointTypeStr : Array[BreakpointType] of String[9]
|
BreakpointTypeStr : Array[BreakpointType] of String[9]
|
||||||
= ( 'function','file-line','watch','awatch','rwatch','invalid' );
|
= ( 'function','file-line','watch','awatch','rwatch','address','invalid');
|
||||||
BreakpointStateStr : Array[BreakpointState] of String[8]
|
BreakpointStateStr : Array[BreakpointState] of String[8]
|
||||||
= ( 'enabled','disabled','invalid' );
|
= ( 'enabled','disabled','invalid' );
|
||||||
|
|
||||||
@ -1074,7 +1076,8 @@ begin
|
|||||||
end
|
end
|
||||||
{ For watch we should get old and new value !! }
|
{ For watch we should get old and new value !! }
|
||||||
else if (Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive)) and
|
else if (Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive)) and
|
||||||
(PB^.typ<>bt_file_line) and (PB^.typ<>bt_function) then
|
(PB^.typ<>bt_file_line) and (PB^.typ<>bt_function) and
|
||||||
|
(PB^.typ<>bt_address) then
|
||||||
begin
|
begin
|
||||||
Command('p '+GetStr(PB^.Name));
|
Command('p '+GetStr(PB^.Name));
|
||||||
S:=GetPChar(GetOutput);
|
S:=GetPChar(GetOutput);
|
||||||
@ -1181,6 +1184,21 @@ begin
|
|||||||
CurrentValue:=nil;
|
CurrentValue:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
constructor TBreakpoint.Init_Address(Const AAddress : String);
|
||||||
|
begin
|
||||||
|
typ:=bt_address;
|
||||||
|
state:=bs_enabled;
|
||||||
|
GDBState:=bs_deleted;
|
||||||
|
Name:=NewStr(AAddress);
|
||||||
|
FileName:=nil;
|
||||||
|
Line:=0;
|
||||||
|
IgnoreCount:=0;
|
||||||
|
Commands:=nil;
|
||||||
|
Conditions:=nil;
|
||||||
|
OldValue:=nil;
|
||||||
|
CurrentValue:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TBreakpoint.Init_Empty;
|
constructor TBreakpoint.Init_Empty;
|
||||||
begin
|
begin
|
||||||
typ:=bt_function;
|
typ:=bt_function;
|
||||||
@ -1294,6 +1312,8 @@ begin
|
|||||||
Debugger^.Command('break '+NameAndExtOf(FileName^)+':'+IntToStr(Line))
|
Debugger^.Command('break '+NameAndExtOf(FileName^)+':'+IntToStr(Line))
|
||||||
else if (typ=bt_function) and assigned(name) then
|
else if (typ=bt_function) and assigned(name) then
|
||||||
Debugger^.Command('break '+name^)
|
Debugger^.Command('break '+name^)
|
||||||
|
else if (typ=bt_address) and assigned(name) then
|
||||||
|
Debugger^.Command('break *0x'+name^)
|
||||||
else if (typ=bt_watch) and assigned(name) then
|
else if (typ=bt_watch) and assigned(name) then
|
||||||
Debugger^.Command('watch '+name^)
|
Debugger^.Command('watch '+name^)
|
||||||
else if (typ=bt_awatch) and assigned(name) then
|
else if (typ=bt_awatch) and assigned(name) then
|
||||||
@ -1459,17 +1479,49 @@ begin
|
|||||||
GetGDB:=FirstThat(@IsNum);
|
GetGDB:=FirstThat(@IsNum);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBreakpointCollection.ShowBreakpoints(W : PSourceWindow);
|
procedure TBreakpointCollection.ShowBreakpoints(W : PFPWindow);
|
||||||
|
|
||||||
procedure SetInSource(P : PBreakpoint);{$ifndef FPC}far;{$endif}
|
procedure SetInSource(P : PBreakpoint);{$ifndef FPC}far;{$endif}
|
||||||
begin
|
begin
|
||||||
If assigned(P^.FileName) and
|
If assigned(P^.FileName) and
|
||||||
(GDBFileName(FExpand(P^.FileName^))=GDBFileName(FExpand(W^.Editor^.FileName))) then
|
(GDBFileName(FExpand(P^.FileName^))=GDBFileName(FExpand(PSourceWindow(W)^.Editor^.FileName))) then
|
||||||
W^.Editor^.SetLineFlagState(P^.Line-1,lfBreakpoint,P^.state=bs_enabled);
|
PSourceWindow(W)^.Editor^.SetLineFlagState(P^.Line-1,lfBreakpoint,P^.state=bs_enabled);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure SetInDisassembly(P : PBreakpoint);{$ifndef FPC}far;{$endif}
|
||||||
|
var
|
||||||
|
PDL : PDisasLine;
|
||||||
|
S : string;
|
||||||
|
ps,qs,i : longint;
|
||||||
|
begin
|
||||||
|
for i:=0 to PDisassemblyWindow(W)^.Editor^.GetLineCount-1 do
|
||||||
|
begin
|
||||||
|
PDL:=PDisasLine(PDisassemblyWindow(W)^.Editor^.GetLine(i));
|
||||||
|
if PDL^.Address=0 then
|
||||||
|
begin
|
||||||
|
if (P^.typ=bt_file_line) then
|
||||||
|
begin
|
||||||
|
S:=PDisassemblyWindow(W)^.Editor^.GetDisplayText(i);
|
||||||
|
ps:=pos(':',S);
|
||||||
|
qs:=pos(' ',copy(S,ps+1,High(S)));
|
||||||
|
if (GDBFileName(FExpand(P^.FileName^))=GDBFileName(FExpand(Copy(S,1,ps-1)))) and
|
||||||
|
(StrToInt(copy(S,ps+1,qs-1))=P^.line) then
|
||||||
|
PDisassemblyWindow(W)^.Editor^.SetLineFlagState(i,lfBreakpoint,P^.state=bs_enabled);
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
If (P^.typ=bt_address) and (PDL^.Address=HexToInt(P^.Name^)) then
|
||||||
|
PDisassemblyWindow(W)^.Editor^.SetLineFlagState(i,lfBreakpoint,P^.state=bs_enabled);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
ForEach(@SetInSource);
|
if W=PFPWindow(DisassemblyWindow) then
|
||||||
|
ForEach(@SetInDisassembly)
|
||||||
|
else
|
||||||
|
ForEach(@SetInSource);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBreakpointCollection.ShowAllBreakpoints;
|
procedure TBreakpointCollection.ShowAllBreakpoints;
|
||||||
@ -3565,13 +3617,15 @@ end;
|
|||||||
{ goto source/assembly mixture }
|
{ goto source/assembly mixture }
|
||||||
InitDisassemblyWindow;
|
InitDisassemblyWindow;
|
||||||
DisassemblyWindow^.LoadFunction('');
|
DisassemblyWindow^.LoadFunction('');
|
||||||
|
DisassemblyWindow^.SetCurAddress(Debugger^.frames[Focused]^.address);
|
||||||
DisassemblyWindow^.SelectInDebugSession;
|
DisassemblyWindow^.SelectInDebugSession;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFramesListBox.HandleEvent(var Event: TEvent);
|
procedure TFramesListBox.HandleEvent(var Event: TEvent);
|
||||||
begin
|
begin
|
||||||
if (Event.What=EvKeyDown) and (Event.CharCode='i') then
|
if ((Event.What=EvKeyDown) and (Event.CharCode='i')) or
|
||||||
|
((Event.What=EvCommand) and (Event.Command=cmDisassemble)) then
|
||||||
GotoAssembly;
|
GotoAssembly;
|
||||||
inherited HandleEvent(Event);
|
inherited HandleEvent(Event);
|
||||||
end;
|
end;
|
||||||
@ -3900,7 +3954,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.6 2001-10-14 14:16:06 peter
|
Revision 1.7 2001-11-07 00:28:52 pierre
|
||||||
|
+ Disassembly window made public
|
||||||
|
|
||||||
|
Revision 1.6 2001/10/14 14:16:06 peter
|
||||||
* fixed typo for linux
|
* fixed typo for linux
|
||||||
|
|
||||||
Revision 1.5 2001/10/11 11:39:35 pierre
|
Revision 1.5 2001/10/11 11:39:35 pierre
|
||||||
|
@ -472,6 +472,15 @@ begin
|
|||||||
NewStatusKey('~'#17+'ÄŮ~ Done', kbNoKey, 65535,
|
NewStatusKey('~'#17+'ÄŮ~ Done', kbNoKey, 65535,
|
||||||
NewStatusKey('~Esc~ Cancel', kbNoKey, 65535,
|
NewStatusKey('~Esc~ Cancel', kbNoKey, 65535,
|
||||||
nil)))))),
|
nil)))))),
|
||||||
|
NewStatusDef(hcStackWindow, hcStackWindow,
|
||||||
|
NewStatusKey(status_help, kbF1, cmHelp,
|
||||||
|
NewStatusKey(status_disassemble, kbAltI, cmDisassemble,
|
||||||
|
NewStatusKey('', kbAltF3, cmClose,
|
||||||
|
NewStatusKey('', kbF5, cmZoom,
|
||||||
|
NewStatusKey('', kbCtrlF5, cmResize,
|
||||||
|
NewStatusKey('', kbF6, cmNext,
|
||||||
|
NewStatusKey('', kbShiftF6, cmPrev,
|
||||||
|
nil))))))),
|
||||||
NewStatusDef(hcFirstCommand, hcLastCommand,
|
NewStatusDef(hcFirstCommand, hcLastCommand,
|
||||||
NewStatusKey(status_help, kbF1, cmHelp,
|
NewStatusKey(status_help, kbF1, cmHelp,
|
||||||
NewStatusKey('', kbF10, cmMenu,
|
NewStatusKey('', kbF10, cmMenu,
|
||||||
@ -524,7 +533,7 @@ begin
|
|||||||
NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
|
NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
|
||||||
StdStatusKeys(
|
StdStatusKeys(
|
||||||
nil)))))),
|
nil)))))),
|
||||||
nil))))))))));
|
nil)))))))))));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIDEApp.Idle;
|
procedure TIDEApp.Idle;
|
||||||
@ -1167,7 +1176,10 @@ end;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.6 2001-10-24 14:17:27 pierre
|
Revision 1.7 2001-11-07 00:28:53 pierre
|
||||||
|
+ Disassembly window made public
|
||||||
|
|
||||||
|
Revision 1.6 2001/10/24 14:17:27 pierre
|
||||||
* try to fix the Win2000 mouse problem
|
* try to fix the Win2000 mouse problem
|
||||||
|
|
||||||
Revision 1.5 2001/10/02 23:56:30 pierre
|
Revision 1.5 2001/10/02 23:56:30 pierre
|
||||||
|
118
ide/fpmrun.inc
118
ide/fpmrun.inc
@ -299,35 +299,68 @@ end;
|
|||||||
procedure TIDEApp.DoContToCursor;
|
procedure TIDEApp.DoContToCursor;
|
||||||
{$ifndef NODEBUG}
|
{$ifndef NODEBUG}
|
||||||
var
|
var
|
||||||
W : PSourceWindow;
|
W : PFPWindow;
|
||||||
FileName : string;
|
PDL : PDisasLine;
|
||||||
LineNr : longint;
|
S,FileName : string;
|
||||||
|
P,CurY,LineNr : longint;
|
||||||
{$endif}
|
{$endif}
|
||||||
begin
|
begin
|
||||||
{$ifndef NODEBUG}
|
{$ifndef NODEBUG}
|
||||||
if (DeskTop^.Current=nil) or
|
if (DeskTop^.Current=nil) or
|
||||||
(TypeOf(DeskTop^.Current^)<>TypeOf(TSourceWindow)) then
|
((TypeOf(DeskTop^.Current^)<>TypeOf(TSourceWindow)) and
|
||||||
|
(TypeOf(DeskTop^.Current^)<>TypeOf(TDisassemblyWindow))) then
|
||||||
Begin
|
Begin
|
||||||
ErrorBox(msg_impossibletoreachcursor,nil);
|
ErrorBox(msg_impossibletoreachcursor,nil);
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
W:=PSourceWindow(DeskTop^.Current);
|
If not assigned(Debugger) or Not Debugger^.HasExe then
|
||||||
|
begin
|
||||||
|
InitDebugger;
|
||||||
|
if not assigned(Debugger) then
|
||||||
|
begin
|
||||||
|
NoDebugger;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
W:=PFPWindow(DeskTop^.Current);
|
||||||
If assigned(W) then
|
If assigned(W) then
|
||||||
begin
|
begin
|
||||||
FileName:=W^.Editor^.FileName;
|
If TypeOf(W^)=TypeOf(TSourceWindow) then
|
||||||
LineNr:=W^.Editor^.CurPos.Y+1;
|
|
||||||
If not assigned(Debugger) or Not Debugger^.HasExe then
|
|
||||||
begin
|
begin
|
||||||
InitDebugger;
|
FileName:=PSourceWindow(W)^.Editor^.FileName;
|
||||||
if not assigned(Debugger) then
|
LineNr:=PSourceWindow(W)^.Editor^.CurPos.Y+1;
|
||||||
|
Debugger^.Command('tbreak '+GDBFileName(NameAndExtOf(FileName))+':'+IntToStr(LineNr));
|
||||||
|
Debugger^.Continue;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
CurY:=PDisassemblyWindow(W)^.Editor^.CurPos.Y;
|
||||||
|
if CurY<PDisassemblyWindow(W)^.Editor^.GetLineCount then
|
||||||
|
PDL:=PDisasLine(PDisassemblyWindow(W)^.Editor^.GetLine(CurY))
|
||||||
|
else
|
||||||
|
PDL:=nil;
|
||||||
|
if assigned(PDL) then
|
||||||
begin
|
begin
|
||||||
NoDebugger;
|
if PDL^.Address<>0 then
|
||||||
exit;
|
begin
|
||||||
|
Debugger^.Command('tbreak *0x'+IntToHex(PDL^.Address,8));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
S:=PDisassemblyWindow(W)^.Editor^.GetDisplayText(PDisassemblyWindow(W)^.Editor^.CurPos.Y);
|
||||||
|
p:=pos(':',S);
|
||||||
|
FileName:=Copy(S,1,p-1);
|
||||||
|
S:=Copy(S,p+1,high(S));
|
||||||
|
p:=pos(' ',S);
|
||||||
|
S:=Copy(S,1,p-1);
|
||||||
|
LineNr:=StrToInt(S);
|
||||||
|
Debugger^.Command('tbreak '+GDBFileName(NameAndExtOf(FileName))+':'+IntToStr(LineNr));
|
||||||
|
end;
|
||||||
|
Debugger^.Continue;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Debugger^.Command('tbreak '+GDBFileName(NameAndExtOf(FileName))+':'+IntToStr(LineNr));
|
|
||||||
Debugger^.Continue;
|
|
||||||
end;
|
end;
|
||||||
{$else NODEBUG}
|
{$else NODEBUG}
|
||||||
NoDebugger;
|
NoDebugger;
|
||||||
@ -355,27 +388,61 @@ procedure TIDEApp.DoToggleBreak;
|
|||||||
{$ifndef NODEBUG}
|
{$ifndef NODEBUG}
|
||||||
var
|
var
|
||||||
W : PSourceWindow;
|
W : PSourceWindow;
|
||||||
FileName : string;
|
WD : PDisassemblyWindow;
|
||||||
{ b : boolean;}
|
PDL : PDisasLine;
|
||||||
LineNr : longint;
|
PB : PBreakpoint;
|
||||||
|
S,FileName : string;
|
||||||
|
b : boolean;
|
||||||
|
CurY,P,LineNr : longint;
|
||||||
{$endif}
|
{$endif}
|
||||||
begin
|
begin
|
||||||
{$ifndef NODEBUG}
|
{$ifndef NODEBUG}
|
||||||
if (DeskTop^.Current=nil) or
|
if (DeskTop^.Current=nil) or
|
||||||
(TypeOf(DeskTop^.Current^)<>TypeOf(TSourceWindow)) then
|
(TypeOf(DeskTop^.Current^)<>TypeOf(TSourceWindow)) and
|
||||||
|
(TypeOf(DeskTop^.Current^)<>TypeOf(TDisassemblyWindow)) then
|
||||||
Begin
|
Begin
|
||||||
ErrorBox(msg_impossibletosetbreakpoint,nil);
|
ErrorBox(msg_impossibletosetbreakpoint,nil);
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
W:=PSourceWindow(DeskTop^.Current);
|
if assigned (DeskTop^.Current) and
|
||||||
If assigned(W) then
|
(TypeOf(DeskTop^.Current^)=TypeOf(TSourceWindow)) then
|
||||||
begin
|
begin
|
||||||
|
W:=PSourceWindow(DeskTop^.Current);
|
||||||
FileName:=W^.Editor^.FileName;
|
FileName:=W^.Editor^.FileName;
|
||||||
LineNr:=W^.Editor^.CurPos.Y+1;
|
LineNr:=W^.Editor^.CurPos.Y+1;
|
||||||
{ b:=}BreakpointsCollection^.ToggleFileLine(FileName,LineNr);
|
BreakpointsCollection^.ToggleFileLine(FileName,LineNr);
|
||||||
{W^.Editor^.SetLineBreakState(LineNr,b);
|
end
|
||||||
already done PM }
|
else if assigned (DeskTop^.Current) and
|
||||||
|
(TypeOf(DeskTop^.Current^)=TypeOf(TDisassemblyWindow)) then
|
||||||
|
begin
|
||||||
|
WD:=PDisassemblyWindow(DeskTop^.Current);
|
||||||
|
CurY:=WD^.Editor^.CurPos.Y;
|
||||||
|
if CurY<WD^.Editor^.GetLineCount then
|
||||||
|
PDL:=PDisasLine(WD^.Editor^.GetLine(CurY))
|
||||||
|
else
|
||||||
|
PDL:=nil;
|
||||||
|
if assigned(PDL) then
|
||||||
|
begin
|
||||||
|
if PDL^.Address<>0 then
|
||||||
|
begin
|
||||||
|
PB:=New(PBreakpoint,init_address(IntToHex(PDL^.Address,8)));
|
||||||
|
BreakpointsCollection^.Insert(PB);
|
||||||
|
WD^.Editor^.SetLineFlagState(CurY,lfBreakpoint,true);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
S:=WD^.Editor^.GetDisplayText(WD^.Editor^.CurPos.Y);
|
||||||
|
p:=pos(':',S);
|
||||||
|
FileName:=Copy(S,1,p-1);
|
||||||
|
S:=Copy(S,p+1,high(S));
|
||||||
|
p:=pos(' ',S);
|
||||||
|
S:=Copy(S,1,p-1);
|
||||||
|
LineNr:=StrToInt(S);
|
||||||
|
b:=BreakpointsCollection^.ToggleFileLine(FileName,LineNr);
|
||||||
|
WD^.Editor^.SetLineFlagState(CurY,lfBreakpoint,b);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
{$else NODEBUG}
|
{$else NODEBUG}
|
||||||
NoDebugger;
|
NoDebugger;
|
||||||
@ -384,7 +451,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2001-08-04 11:30:23 peter
|
Revision 1.2 2001-11-07 00:28:53 pierre
|
||||||
|
+ Disassembly window made public
|
||||||
|
|
||||||
|
Revision 1.1 2001/08/04 11:30:23 peter
|
||||||
* ide works now with both compiler versions
|
* ide works now with both compiler versions
|
||||||
|
|
||||||
Revision 1.1.2.13 2001/03/12 17:34:55 pierre
|
Revision 1.1.2.13 2001/03/12 17:34:55 pierre
|
||||||
|
@ -889,6 +889,7 @@ const
|
|||||||
status_msgtracksource = '~Space~ Track source';
|
status_msgtracksource = '~Space~ Track source';
|
||||||
status_close = '~Esc~ Close';
|
status_close = '~Esc~ Close';
|
||||||
status_calculatorpaste = '~Ctrl+Enter~ Transfer result';
|
status_calculatorpaste = '~Ctrl+Enter~ Transfer result';
|
||||||
|
status_disassemble = '~Alt+I~ Disassemble';
|
||||||
|
|
||||||
{ Menu hints }
|
{ Menu hints }
|
||||||
hint_systemmenu = 'System menu';
|
hint_systemmenu = 'System menu';
|
||||||
@ -1012,7 +1013,10 @@ const
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.4 2001-10-24 21:49:56 pierre
|
Revision 1.5 2001-11-07 00:28:53 pierre
|
||||||
|
+ Disassembly window made public
|
||||||
|
|
||||||
|
Revision 1.4 2001/10/24 21:49:56 pierre
|
||||||
+ FindProcedure implemented
|
+ FindProcedure implemented
|
||||||
|
|
||||||
Revision 1.3 2001/10/12 14:21:47 pierre
|
Revision 1.3 2001/10/12 14:21:47 pierre
|
||||||
|
@ -63,10 +63,12 @@ type
|
|||||||
function GetPalette: PPalette; virtual;
|
function GetPalette: PPalette; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
PFPWindow = ^TFPWindow;
|
||||||
TFPWindow = object(TWindow)
|
TFPWindow = object(TWindow)
|
||||||
AutoNumber: boolean;
|
AutoNumber: boolean;
|
||||||
procedure HandleEvent(var Event: TEvent); virtual;
|
procedure HandleEvent(var Event: TEvent); virtual;
|
||||||
procedure SetState(AState: Word; Enable: Boolean); virtual;
|
procedure SetState(AState: Word; Enable: Boolean); virtual;
|
||||||
|
procedure UpdateCommands; virtual;
|
||||||
constructor Load(var S: TStream);
|
constructor Load(var S: TStream);
|
||||||
procedure Store(var S: TStream);
|
procedure Store(var S: TStream);
|
||||||
procedure Update; virtual;
|
procedure Update; virtual;
|
||||||
@ -172,7 +174,6 @@ type
|
|||||||
procedure SetTitle(ATitle: string); virtual;
|
procedure SetTitle(ATitle: string); virtual;
|
||||||
procedure UpdateTitle; virtual;
|
procedure UpdateTitle; virtual;
|
||||||
procedure HandleEvent(var Event: TEvent); virtual;
|
procedure HandleEvent(var Event: TEvent); virtual;
|
||||||
procedure SetState(AState: Word; Enable: Boolean); virtual;
|
|
||||||
procedure Update; virtual;
|
procedure Update; virtual;
|
||||||
procedure UpdateCommands; virtual;
|
procedure UpdateCommands; virtual;
|
||||||
function GetPalette: PPalette; virtual;
|
function GetPalette: PPalette; virtual;
|
||||||
@ -211,7 +212,6 @@ type
|
|||||||
function GetPalette: PPalette;virtual;
|
function GetPalette: PPalette;virtual;
|
||||||
constructor Load(var S: TStream);
|
constructor Load(var S: TStream);
|
||||||
procedure Store(var S: TStream);
|
procedure Store(var S: TStream);
|
||||||
procedure SetState(AState: Word; Enable: Boolean); virtual;
|
|
||||||
procedure UpdateCommands; virtual;
|
procedure UpdateCommands; virtual;
|
||||||
destructor Done; virtual;
|
destructor Done; virtual;
|
||||||
end;
|
end;
|
||||||
@ -257,6 +257,7 @@ type
|
|||||||
procedure WriteSourceString(Const S : string;line : longint);
|
procedure WriteSourceString(Const S : string;line : longint);
|
||||||
procedure WriteDisassemblyString(Const S : string;address : cardinal);
|
procedure WriteDisassemblyString(Const S : string;address : cardinal);
|
||||||
procedure SetCurAddress(address : cardinal);
|
procedure SetCurAddress(address : cardinal);
|
||||||
|
procedure UpdateCommands; virtual;
|
||||||
function GetPalette: PPalette;virtual;
|
function GetPalette: PPalette;virtual;
|
||||||
destructor Done; virtual;
|
destructor Done; virtual;
|
||||||
end;
|
end;
|
||||||
@ -1498,7 +1499,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFPWindow.SetState(AState: Word; Enable: Boolean);
|
procedure TFPWindow.SetState(AState: Word; Enable: Boolean);
|
||||||
|
var OldState: word;
|
||||||
begin
|
begin
|
||||||
|
OldState:=State;
|
||||||
inherited SetState(AState,Enable);
|
inherited SetState(AState,Enable);
|
||||||
if AutoNumber then
|
if AutoNumber then
|
||||||
if (AState and (sfVisible+sfExposed))<>0 then
|
if (AState and (sfVisible+sfExposed))<>0 then
|
||||||
@ -1510,6 +1513,12 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
Number:=0;
|
Number:=0;
|
||||||
|
if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
|
||||||
|
UpdateCommands;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFPWindow.UpdateCommands;
|
||||||
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFPWindow.Update;
|
procedure TFPWindow.Update;
|
||||||
@ -1771,15 +1780,6 @@ begin
|
|||||||
inherited HandleEvent(Event);
|
inherited HandleEvent(Event);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceWindow.SetState(AState: Word; Enable: Boolean);
|
|
||||||
var OldState: word;
|
|
||||||
begin
|
|
||||||
OldState:=State;
|
|
||||||
inherited SetState(AState,Enable);
|
|
||||||
if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
|
|
||||||
UpdateCommands;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TSourceWindow.UpdateCommands;
|
procedure TSourceWindow.UpdateCommands;
|
||||||
var Active: boolean;
|
var Active: boolean;
|
||||||
begin
|
begin
|
||||||
@ -2070,20 +2070,11 @@ begin
|
|||||||
Editor^.Draw;
|
Editor^.Draw;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGDBWindow.SetState(AState: Word; Enable: Boolean);
|
|
||||||
var OldState: word;
|
|
||||||
begin
|
|
||||||
OldState:=State;
|
|
||||||
inherited SetState(AState,Enable);
|
|
||||||
if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
|
|
||||||
UpdateCommands;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TGDBWindow.UpdateCommands;
|
procedure TGDBWindow.UpdateCommands;
|
||||||
var Active: boolean;
|
var Active: boolean;
|
||||||
begin
|
begin
|
||||||
Active:=GetState(sfActive);
|
Active:=GetState(sfActive);
|
||||||
SetCmdState([cmSaveAs,cmHide],Active);
|
SetCmdState([cmSaveAs,cmHide,cmRun],Active);
|
||||||
SetCmdState(EditorCmds,Active);
|
SetCmdState(EditorCmds,Active);
|
||||||
SetCmdState(ToClipCmds+FromClipCmds+NulClipCmds+UndoCmd+RedoCmd,Active);
|
SetCmdState(ToClipCmds+FromClipCmds+NulClipCmds+UndoCmd+RedoCmd,Active);
|
||||||
Message(Application,evBroadcast,cmCommandSetChanged,nil);
|
Message(Application,evBroadcast,cmCommandSetChanged,nil);
|
||||||
@ -2100,7 +2091,7 @@ constructor TDisassemblyEditor.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
|
|||||||
begin
|
begin
|
||||||
Inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,AFileName);
|
Inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,AFileName);
|
||||||
GrowMode:=gfGrowHiX+gfGrowHiY;
|
GrowMode:=gfGrowHiX+gfGrowHiY;
|
||||||
SetFlags(efInsertMode+efSyntaxHighlight+efNoIndent+efExpandAllTabs+efHighlightRow);
|
SetFlags(efInsertMode+efSyntaxHighlight+efNoIndent+efExpandAllTabs{+efHighlightRow});
|
||||||
New(DisasLines,Init(500,1000));
|
New(DisasLines,Init(500,1000));
|
||||||
Core^.ChangeLinesTo(DisasLines);
|
Core^.ChangeLinesTo(DisasLines);
|
||||||
{ do not allow to write into that window }
|
{ do not allow to write into that window }
|
||||||
@ -2338,6 +2329,8 @@ begin
|
|||||||
StrDispose(p1);
|
StrDispose(p1);
|
||||||
Editor^.ReleaseSource;
|
Editor^.ReleaseSource;
|
||||||
Editor^.UpdateAttrs(0,attrForceFull);
|
Editor^.UpdateAttrs(0,attrForceFull);
|
||||||
|
If assigned(BreakpointsCollection) then
|
||||||
|
BreakpointsCollection^.ShowBreakpoints(@Self);
|
||||||
Unlock;
|
Unlock;
|
||||||
ReDraw;
|
ReDraw;
|
||||||
end;
|
end;
|
||||||
@ -2364,6 +2357,17 @@ begin
|
|||||||
Editor^.GetCurrentLine(address);
|
Editor^.GetCurrentLine(address);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TDisassemblyWindow.UpdateCommands;
|
||||||
|
var Active: boolean;
|
||||||
|
begin
|
||||||
|
Active:=GetState(sfActive);
|
||||||
|
SetCmdState(SourceCmds+CompileCmds,Active);
|
||||||
|
SetCmdState(EditorCmds,Active);
|
||||||
|
SetCmdState(ToClipCmds+FromClipCmds+NulClipCmds+UndoCmd+RedoCmd,false);
|
||||||
|
Message(Application,evBroadcast,cmCommandSetChanged,nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TDisassemblyWindow.GetPalette: PPalette;
|
function TDisassemblyWindow.GetPalette: PPalette;
|
||||||
const P: string[length(CSourceWindow)] = CSourceWindow;
|
const P: string[length(CSourceWindow)] = CSourceWindow;
|
||||||
begin
|
begin
|
||||||
@ -2477,7 +2481,11 @@ begin
|
|||||||
DontClear:=false;
|
DontClear:=false;
|
||||||
case Event.KeyCode of
|
case Event.KeyCode of
|
||||||
kbEnter :
|
kbEnter :
|
||||||
Message(@Self,evCommand,cmMsgGotoSource,nil);
|
begin
|
||||||
|
Message(@Self,evCommand,cmMsgGotoSource,nil);
|
||||||
|
ClearEvent(Event);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
else
|
else
|
||||||
DontClear:=true;
|
DontClear:=true;
|
||||||
end;
|
end;
|
||||||
@ -2496,7 +2504,11 @@ begin
|
|||||||
case Event.Command of
|
case Event.Command of
|
||||||
cmMsgGotoSource :
|
cmMsgGotoSource :
|
||||||
if Range>0 then
|
if Range>0 then
|
||||||
GotoSource;
|
begin
|
||||||
|
GotoSource;
|
||||||
|
ClearEvent(Event);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
cmMsgTrackSource :
|
cmMsgTrackSource :
|
||||||
if Range>0 then
|
if Range>0 then
|
||||||
TrackSource;
|
TrackSource;
|
||||||
@ -4187,7 +4199,10 @@ end;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.9 2001-10-11 23:45:28 pierre
|
Revision 1.10 2001-11-07 00:28:53 pierre
|
||||||
|
+ Disassembly window made public
|
||||||
|
|
||||||
|
Revision 1.9 2001/10/11 23:45:28 pierre
|
||||||
+ some preliminary code for graph use
|
+ some preliminary code for graph use
|
||||||
|
|
||||||
Revision 1.8 2001/10/11 11:36:30 pierre
|
Revision 1.8 2001/10/11 11:36:30 pierre
|
||||||
|
Loading…
Reference in New Issue
Block a user