mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 20:49:49 +02:00
+ some cross gdb enhancements
This commit is contained in:
parent
01af531efb
commit
98dd48ed75
@ -359,6 +359,9 @@ const
|
||||
BreakpointStateStr : Array[BreakpointState] of String[8]
|
||||
= ( 'enabled','disabled','invalid' );
|
||||
|
||||
{$ifdef CrossGDB}
|
||||
RemoteMachine : string = '';
|
||||
{$endif CrossGDB}
|
||||
DebuggeeTTY : string = '';
|
||||
var
|
||||
Debugger : PDebugController;
|
||||
@ -777,6 +780,10 @@ var
|
||||
{$endif Unix}
|
||||
begin
|
||||
ResetBreakpointsValues;
|
||||
{$ifdef CrossGDB}
|
||||
NoSwitch:=true;
|
||||
Command('target remote '+RemoteMachine);
|
||||
{$else CrossGDB}
|
||||
{$ifdef win32}
|
||||
{ Run the debugge in another console }
|
||||
if DebuggeeTTY<>'' then
|
||||
@ -817,12 +824,19 @@ begin
|
||||
NoSwitch := false;
|
||||
end;
|
||||
{$endif Unix}
|
||||
{$endif CrossGDB}
|
||||
{ Switch to user screen to get correct handles }
|
||||
UserScreen;
|
||||
{ Don't try to print GDB messages while in User Screen mode }
|
||||
If assigned(GDBWindow) then
|
||||
GDBWindow^.Editor^.Lock;
|
||||
{$ifndef CrossGDB}
|
||||
inherited Run;
|
||||
{$else CrossGDB}
|
||||
inc(init_count);
|
||||
{ pass the stop in start code }
|
||||
Command('continue');
|
||||
{$endif CrossGDB}
|
||||
DebuggerScreen;
|
||||
If assigned(GDBWindow) then
|
||||
GDBWindow^.Editor^.UnLock;
|
||||
@ -3376,13 +3390,13 @@ end;
|
||||
SetColor(rs.pc,OldReg.pc);
|
||||
WriteStr(1,8,'pc '+HexStr(longint(rs.pc),8),color);
|
||||
SetColor(rs.ps and $1,OldReg.ps and $1);
|
||||
WriteStr(20,8,'c'+chr(byte((rs.ps and $1)<>0)+48),color);
|
||||
WriteStr(22,8,' c'+chr(byte((rs.ps and $1)<>0)+48),color);
|
||||
SetColor(rs.ps and $2,OldReg.ps and $2);
|
||||
WriteStr(18,8,'v'+chr(byte((rs.ps and $2)<>0)+48),color);
|
||||
WriteStr(19,8,' v'+chr(byte((rs.ps and $2)<>0)+48),color);
|
||||
SetColor(rs.ps and $4,OldReg.ps and $4);
|
||||
WriteStr(16,8,'z'+chr(byte((rs.ps and $4)<>0)+48),color);
|
||||
WriteStr(16,8,' z'+chr(byte((rs.ps and $4)<>0)+48),color);
|
||||
SetColor(rs.ps and $8,OldReg.ps and $8);
|
||||
WriteStr(14,8,'x'+chr(byte((rs.ps and $8)<>0)+48),color);
|
||||
WriteStr(14,8, 'x'+chr(byte((rs.ps and $8)<>0)+48),color);
|
||||
{$endif i386}
|
||||
end
|
||||
else
|
||||
@ -3960,6 +3974,20 @@ end;
|
||||
Init/Final
|
||||
****************************************************************************}
|
||||
|
||||
|
||||
function GetGDBTargetShortName : string;
|
||||
begin
|
||||
{$ifdef CROSSGDB}
|
||||
GetGDBTargetShortName:='linux';
|
||||
{$else not CROSSGDB}
|
||||
{$ifdef COMPILER_1_0}
|
||||
GetGDBTargetShortName:=source_os.shortname
|
||||
{$else}
|
||||
GetGDBTargetShortName:=source_info.shortname
|
||||
{$endif}
|
||||
{$endif not CROSSGDB}
|
||||
end;
|
||||
|
||||
procedure InitDebugger;
|
||||
{$ifdef DEBUG}
|
||||
var s : string;
|
||||
@ -3997,11 +4025,11 @@ begin
|
||||
{$endif}
|
||||
|
||||
NeedRecompileExe:=false;
|
||||
if TargetSwitches^.GetCurrSelParam<>{$ifdef COMPILER_1_0}source_os{$else}source_info{$endif}.shortname then
|
||||
if TargetSwitches^.GetCurrSelParam<>GetGDBTargetShortName then
|
||||
begin
|
||||
ClearFormatParams;
|
||||
AddFormatParamStr(TargetSwitches^.GetCurrSelParam);
|
||||
AddFormatParamStr({$ifdef COMPILER_1_0}source_os{$else}source_info{$endif}.shortname);
|
||||
AddFormatParamStr(GetGDBTargetShortName);
|
||||
cm:=ConfirmBox(msg_cantdebugchangetargetto,@FormatParams,true);
|
||||
if cm=cmCancel then
|
||||
Exit;
|
||||
@ -4010,7 +4038,7 @@ begin
|
||||
{ force recompilation }
|
||||
PrevMainFile:='';
|
||||
NeedRecompileExe:=true;
|
||||
TargetSwitches^.SetCurrSelParam({$ifdef COMPILER_1_0}source_os{$else}source_info{$endif}.shortname);
|
||||
TargetSwitches^.SetCurrSelParam(GetGDBTargetShortName);
|
||||
If DebugInfoSwitches^.GetCurrSelParam='-' then
|
||||
DebugInfoSwitches^.SetCurrSelParam('l');
|
||||
IDEApp.UpdateTarget;
|
||||
@ -4222,7 +4250,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.33 2002-09-21 22:23:49 pierre
|
||||
Revision 1.34 2002-11-21 00:37:56 pierre
|
||||
+ some cross gdb enhancements
|
||||
|
||||
Revision 1.33 2002/09/21 22:23:49 pierre
|
||||
* restore text mode on reset for Dos apps
|
||||
|
||||
Revision 1.32 2002/09/17 21:58:45 pierre
|
||||
|
@ -69,6 +69,7 @@ const
|
||||
ieOpenFileCount = 'OpenFileCount'; *)
|
||||
ieRunParameters = 'Parameters';
|
||||
ieDebuggeeRedir = 'DebugRedirection';
|
||||
ieRemoteMachine = 'RemoteMachine';
|
||||
iePrimaryFile = 'PrimaryFile';
|
||||
ieCompileMode = 'CompileMode';
|
||||
iePalette = 'Palette';
|
||||
@ -351,6 +352,9 @@ begin
|
||||
SetRunParameters(INIFile^.GetEntry(secRun,ieRunParameters,GetRunParameters));
|
||||
{$ifndef GABOR}
|
||||
DebuggeeTTY := INIFile^.GetEntry(secRun,ieDebuggeeRedir,DebuggeeTTY);
|
||||
{$ifdef CrossGDB}
|
||||
RemoteMachine :=INIFile^.GetEntry(secRun,ieRemoteMachine,RemoteMachine);
|
||||
{$endif CrossGDB}
|
||||
{$endif}
|
||||
{ Compile }
|
||||
S:=INIFile^.GetEntry(secCompile,ieCompileMode,'');
|
||||
@ -541,6 +545,9 @@ begin
|
||||
{$ifndef GABOR}
|
||||
{ If DebuggeeTTY<>'' then }
|
||||
INIFile^.SetEntry(secRun,ieDebuggeeRedir,DebuggeeTTY);
|
||||
{$ifdef CrossGDB}
|
||||
INIFile^.SetEntry(secRun,ieRemoteMachine,RemoteMachine);
|
||||
{$endif CrossGDB}
|
||||
{$endif}
|
||||
{ Compile }
|
||||
INIFile^.SetEntry(secCompile,iePrimaryFile,PrimaryFile);
|
||||
@ -624,7 +631,10 @@ end;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.8 2002-10-23 18:01:50 hajny
|
||||
Revision 1.9 2002-11-21 00:37:56 pierre
|
||||
+ some cross gdb enhancements
|
||||
|
||||
Revision 1.8 2002/10/23 18:01:50 hajny
|
||||
* mistyping fixed
|
||||
|
||||
Revision 1.7 2002/10/18 17:58:48 hajny
|
||||
|
@ -441,16 +441,23 @@ var R,R2,R3: TRect;
|
||||
D: PCenterDialog;
|
||||
RB,RB2 : PRadioButtons;
|
||||
CBStrip: PCheckBoxes;
|
||||
{$ifdef CrossGDB}
|
||||
IL: PInputLine;
|
||||
{$else not CrossGDB}
|
||||
{$ifdef win32}
|
||||
CB2: PCheckBoxes;
|
||||
{$endif win32}
|
||||
{$ifdef Unix}
|
||||
IL: PInputLine;
|
||||
{$endif Unix}
|
||||
{$endif not CrossGDB}
|
||||
IL2: PInputLine;
|
||||
L,I: longint;
|
||||
Items: PSItem;
|
||||
const
|
||||
{$ifdef CrossGDB}
|
||||
OtherFieldLines = 3;
|
||||
{$else not CrossGDB}
|
||||
{$ifdef win32}
|
||||
OtherFieldLines = 3;
|
||||
{$else not win32}
|
||||
@ -460,6 +467,7 @@ const
|
||||
OtherFieldLines = 0;
|
||||
{$endif Unix}
|
||||
{$endif win32}
|
||||
{$endif not CrossGDB}
|
||||
begin
|
||||
R.Assign(0,0,60,2+DebugInfoSwitches^.ItemCount+1+2
|
||||
+ProfileInfoSwitches^.ItemCount+2+2+1+OtherFieldLines);
|
||||
@ -509,6 +517,14 @@ begin
|
||||
Insert(New(PHistory, Init(R3, IL2, hidCompilerArgs)));
|
||||
R2.Move(0,-1);
|
||||
Insert(New(PLabel, Init(R2,label_debugger_compilerargs, IL2)));
|
||||
{$ifdef CrossGDB}
|
||||
R2.Move(0,4);
|
||||
New(IL, Init(R2, 255));
|
||||
IL^.Data^:=RemoteMachine;
|
||||
Insert(IL);
|
||||
R2.Move(0,-1);
|
||||
Insert(New(PLabel, Init(R2,label_debugger_remote_machine, IL)));
|
||||
{$else not CrossGDB}
|
||||
{$ifdef win32}
|
||||
R2.Move(0,4);
|
||||
New(CB2,Init(R2,NewSItem(label_debugger_useanotherconsole, nil)));
|
||||
@ -529,6 +545,7 @@ begin
|
||||
R2.Move(0,-1);
|
||||
Insert(New(PLabel, Init(R2,label_debugger_useanothertty, IL)));
|
||||
{$endif win32}
|
||||
{$endif CrossGDB}
|
||||
end;
|
||||
InsertButtons(D);
|
||||
RB^.Select;
|
||||
@ -538,6 +555,9 @@ begin
|
||||
ProfileInfoSwitches^.SetCurrSel(RB2^.Value);
|
||||
OtherLinkerSwitches^.SetBooleanItem(0,CBStrip^.Mark(0));
|
||||
CustomArg[SwitchesMode]:=IL2^.Data^;
|
||||
{$ifdef CrossGDB}
|
||||
RemoteMachine:=IL^.Data^;
|
||||
{$else not CrossGDB}
|
||||
{$ifdef win32}
|
||||
if CB2^.value<>0 then
|
||||
DebuggeeTTY:='on'
|
||||
@ -547,6 +567,7 @@ begin
|
||||
{$ifdef Unix}
|
||||
DebuggeeTTY:=IL^.Data^;
|
||||
{$endif Unix}
|
||||
{$endif CrossGDB}
|
||||
end;
|
||||
Dispose(D, Done);
|
||||
end;
|
||||
@ -1285,7 +1306,10 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.8 2002-09-07 15:40:44 peter
|
||||
Revision 1.9 2002-11-21 00:37:56 pierre
|
||||
+ some cross gdb enhancements
|
||||
|
||||
Revision 1.8 2002/09/07 15:40:44 peter
|
||||
* old logs removed and tabs fixed
|
||||
|
||||
Revision 1.7 2002/09/04 08:52:46 pierre
|
||||
|
@ -497,6 +497,7 @@ const
|
||||
label_debugger_useanotherconsole = '~U~se another console';
|
||||
label_debugger_redirection = 'Debuggee ~R~edirection';
|
||||
label_debugger_useanothertty = '~U~se Another tty for Debuggee';
|
||||
label_debugger_remote_machine = '~R~emote machine name:port';
|
||||
|
||||
dialog_helpfiles = 'Install Help Files';
|
||||
label_helpfiles_helpfiles = '~H~elp files';
|
||||
@ -813,6 +814,7 @@ const
|
||||
opt_librarydirectories = '~L~ibrary directories';
|
||||
opt_objectdirectories = '~O~bject directories';
|
||||
opt_exeppudirectories = '~E~XE & PPU directories';
|
||||
opt_cross_tools_directory = '~C~ross tools directory';
|
||||
{ Library options }
|
||||
opt_librariesdefault = '~T~arget default';
|
||||
opt_dynamiclibraries = 'Link to ~D~ynamic libraries';
|
||||
@ -1037,7 +1039,10 @@ const
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.13 2002-09-07 15:40:44 peter
|
||||
Revision 1.14 2002-11-21 00:37:56 pierre
|
||||
+ some cross gdb enhancements
|
||||
|
||||
Revision 1.13 2002/09/07 15:40:44 peter
|
||||
* old logs removed and tabs fixed
|
||||
|
||||
Revision 1.12 2002/09/02 10:18:10 pierre
|
||||
|
@ -1001,6 +1001,7 @@ begin
|
||||
AddStringItem(opt_librarydirectories,'l',idNone,true,true);
|
||||
AddStringItem(opt_objectdirectories,'o',idNone,true,true);
|
||||
AddStringItem(opt_exeppudirectories,'E',idNone,true,true);
|
||||
AddStringItem(opt_cross_tools_directory,'D',idNone,true,true);
|
||||
end;
|
||||
|
||||
New(LibLinkerSwitches,InitSelect('X'));
|
||||
@ -1238,7 +1239,10 @@ end;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.10 2002-09-07 15:40:45 peter
|
||||
Revision 1.11 2002-11-21 00:37:56 pierre
|
||||
+ some cross gdb enhancements
|
||||
|
||||
Revision 1.10 2002/09/07 15:40:45 peter
|
||||
* old logs removed and tabs fixed
|
||||
|
||||
Revision 1.9 2002/06/01 20:08:42 marco
|
||||
|
Loading…
Reference in New Issue
Block a user