1
{ $Id: fpd.lpr 42802 2013-09-15 10:59:04Z martin $ }
3
---------------------------------------------------------------------------
4
fpd - FP standalone windows debugger
5
---------------------------------------------------------------------------
7
fpwd is a concept Free Pascal Windows Debugger. It is mainly used to thest
8
the windebugger classes, but it may grow someday to a fully functional
9
debugger written in pascal.
11
---------------------------------------------------------------------------
13
@created(Mon Apr 10th WET 2006)
14
@lastmod($Date: 2013-09-15 12:59:04 +0200 (So, 15 Sep 2013) $)
15
@author(Marc Weustink <marc@@dommelstein.nl>)
17
***************************************************************************
19
* This source is free software; you can redistribute it and/or modify *
20
* it under the terms of the GNU General Public License as published by *
21
* the Free Software Foundation; either version 2 of the License, or *
22
* (at your option) any later version. *
24
* This code is distributed in the hope that it will be useful, but *
25
* WITHOUT ANY WARRANTY; without even the implied warranty of *
26
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
27
* General Public License for more details. *
29
* A copy of the GNU General Public License is available on the World *
30
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
31
* obtain it by writing to the Free Software Foundation, *
32
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
34
***************************************************************************
47
FpDbgClasses, FpDbgWinExtra, FpDbgPETypes, FpDbgDwarfConst, FpDbgDwarf;
49
function CtrlCHandler(CtrlType: Cardinal): BOOL; stdcall;
54
CTRL_BREAK_EVENT: begin
55
if GState <> dsRun then Exit;
56
if GMainProcess = nil then Exit;
57
GMainProcess.Interrupt;
61
CTRL_CLOSE_EVENT: begin
62
if (GState in [dsRun, dsPause]) and (GMainProcess <> nil)
63
then TerminateProcess(GMainProcess.Handle, 0);
72
Write('FPDebugger on ', {$I %FPCTARGETOS%}, ' for ', {$I %FPCTARGETCPU%});
73
WriteLn(' (', {$I %DATE%}, ' ', {$I %TIME%}, ' FPC: ', {$I %FPCVERSION%}, ')' );
74
WriteLn('Copyright (c) 2006-2009 by Marc Weustink');
75
WriteLN('starting....');
79
GFileName := ParamStr(1);
80
WriteLN('Using file: ', GFileName);
83
SetConsoleCtrlHandler(@CtrlCHandler, True);
89
if Last = '' then Continue;
91
until GState = dsQuit;
92
SetConsoleCtrlHandler(@CtrlCHandler, False);