+ Evaluate window

git-svn-id: trunk@5504 -
This commit is contained in:
daniel 2006-11-26 23:47:23 +00:00
parent 836dbad1b2
commit 4e2c9ffa9c
7 changed files with 112 additions and 3 deletions

1
.gitattributes vendored
View File

@ -1247,6 +1247,7 @@ ide/fpcygwin.pas svneol=native#text/plain
ide/fpdebug.pas svneol=native#text/plain
ide/fpdesk.pas svneol=native#text/plain
ide/fpdpansi.pas svneol=native#text/plain
ide/fpevalw.pas svneol=native#text/x-pascal
ide/fphelp.pas svneol=native#text/plain
ide/fpide.pas svneol=native#text/plain
ide/fpini.pas svneol=native#text/plain

View File

@ -2527,6 +2527,7 @@ buildfp:
$(MAKE) fpc_all
$(MAKE) postgdbinfo
gdb:
$(MAKE) -C ../packages/base/gdbint
$(MAKE) buildfp
nogdb:
$(MAKE) buildfp NOGDB=1

View File

@ -141,6 +141,7 @@ buildfp:
$(MAKE) postgdbinfo
gdb:
$(MAKE) -C ../packages/base/gdbint
$(MAKE) buildfp
nogdb:

View File

@ -209,9 +209,9 @@ type
procedure Force_new_value;
destructor done;virtual;
expr : pstring;
last_value,current_value : pchar;
private
GDBRunCount : longint;
last_value,current_value : pchar;
end;
PWatchesCollection = ^TWatchesCollection;

89
ide/fpevalw.pas Normal file
View File

@ -0,0 +1,89 @@
unit fpevalw;
{****************************************************************************}
interface
{****************************************************************************}
uses fpdebug,dialogs,views,objects,fpconst,drivers;
type Pevaluate_dialog=^Tevaluate_dialog;
Tevaluate_dialog=object(Tdialog)
watch:Pwatch;
expr_input,expr_output:Pinputline;
constructor init(var bounds:Trect);
procedure evaluate;
procedure handleevent(var event:Tevent);virtual;
destructor done;
end;
{****************************************************************************}
implementation
{****************************************************************************}
constructor Tevaluate_dialog.init(var bounds:Trect);
var r:Trect;
l:Plabel;
b:Pbutton;
begin
inherited init(bounds,'Evaluate expression');
options:=options or ofcentered;
{watch is auto initialized to nil.}
r.assign(2,3,size.x-20,4);
new(expr_input,init(r,255));
insert(expr_input);
r.assign(2,2,size.x-20,3);
new(l,init(r,'E~x~pression:',expr_input));
insert(l);
r.assign(2,6,size.x-20,7);
new(expr_output,init(r,255));
insert(expr_output);
r.assign(2,5,size.x-20,6);
new(l,init(r,'~R~esult:',expr_output));
insert(l);
r.assign(size.x-14,3,size.x-3,5);
new(b,init(r,'~E~valuate',cmEvaluate,bfDefault));
insert(b);
r.assign(size.x-14,6,size.x-3,8);
new(b,init(r,'Help',cmHelp,bfNormal));
insert(b);
expr_input^.select;
end;
procedure Tevaluate_dialog.evaluate;
begin
if watch<>nil then
dispose(watch,done);
new(watch,init(expr_input^.data^));
expr_output^.data^:=strpas(watch^.current_value);
expr_output^.drawview;
end;
procedure Tevaluate_dialog.handleevent(var event:Tevent);
begin
inherited handleevent(event);
if event.what=evCommand then
case event.command of
cmEvaluate:
evaluate;
end;
end;
destructor Tevaluate_dialog.done;
begin
if watch<>nil then
dispose(watch,done);
end;
end.

View File

@ -21,7 +21,7 @@ uses
Objects,Drivers,Views,App,Gadgets,MsgBox,Tabs,
WEditor,WCEdit,
Comphook,Browcol,
WHTMLScn,
WHTMLScn,fpevalw,
FPViews,FPSymbol,fpstring;
type
@ -92,6 +92,7 @@ type
procedure DoShowBreakpointList;
procedure DoShowWatches;
procedure DoAddWatch;
procedure do_evaluate;
procedure DoShowRegisters;
procedure DoShowFPU;
procedure DoShowVector;
@ -404,6 +405,7 @@ begin
NewItem(menu_debug_watches,'', kbNoKey, cmWatches, hcWatchesWindow,
NewItem(menu_debug_breakpoint,menu_key_debug_breakpoint, kbCtrlF8, cmToggleBreakpoint, hcToggleBreakpoint,
NewItem(menu_debug_breakpointlist,'', kbNoKey, cmBreakpointList, hcBreakpointList,
NewItem('~E~valuate...','Ctrl+F4', kbCtrlF4, cmEvaluate, hcEvaluate,
NewItem(menu_debug_callstack,menu_key_debug_callstack, kbCtrlF3, cmStack, hcStackWindow,
NewLine(
NewItem(menu_debug_disassemble,'', kbNoKey, cmDisassemble, hcStackWindow,
@ -416,7 +418,7 @@ begin
{$ifdef SUPPORT_REMOTE}
)
{$endif SUPPORT_REMOTE}
)))))))))))))))),
))))))))))))))))),
NewSubMenu(menu_tools, hcToolsMenu, NewMenu(
NewItem(menu_tools_messages,menu_key_tools_messages, kbF11, cmToolsMessages, hcToolsMessages,
NewItem(menu_tools_msgnext,menu_key_tools_msgnext, kbAltF8, cmToolsMsgNext, hcToolsMsgNext,
@ -765,6 +767,7 @@ begin
cmRegisters : DoShowRegisters;
cmFPURegisters : DoShowFPU;
cmVectorRegisters : DoShowVector;
cmEvaluate : do_evaluate;
{ -- Options menu -- }
cmSwitchesMode : SetSwitchesMode;
cmCompiler : DoCompilerSwitch;

View File

@ -254,5 +254,19 @@ begin
else
dispose(P,Done);
end;
procedure TIDEapp.do_evaluate;
var d:Pevaluate_dialog;
r:Trect;
begin
desktop^.getextent(r);
r.b.x:=r.b.x*3 div 4;
r.b.y:=12;
new(d,init(r));
desktop^.execview(d);
dispose(d,done);
end;
{$endif NODEBUG}