GDB commander, cadd option to keep IO streams

This commit is contained in:
Basile Burg 2017-02-03 10:24:47 +01:00
parent d4c068d483
commit 786aae6921
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
2 changed files with 18 additions and 16 deletions

View File

@ -203,9 +203,9 @@ inherited CEGdbWidget: TCEGdbWidget
Hint = 'edit the command line and the environment of the debuger target'
Top = 0
Width = 517
ActivePage = TabSheet5
ActivePage = TabSheet1
Align = alTop
TabIndex = 2
TabIndex = 0
TabOrder = 3
object TabSheet1: TTabSheet
Caption = 'Call stack'

View File

@ -280,6 +280,7 @@ type
fShowRawMiOutput: boolean;
fShortcuts: TCEDebugShortcuts;
fAsmSyntax: TAsmSyntax;
fKeepRedirectedStreams: boolean;
fStopAllThreadsOnBreak: boolean;
procedure setIgnoredSignals(value: TStringList);
procedure setCommandsHistory(value: TStringList);
@ -294,6 +295,7 @@ type
property autoGetThreads: boolean read fAutoGetThreads write fAutoGetThreads;
property commandsHistory: TStringList read fCommandsHistory write setCommandsHistory;
property ignoredSignals: TStringList read fIgnoredSignals write setIgnoredSignals;
property keepRedirectedStreams: boolean read fKeepRedirectedStreams write fKeepRedirectedStreams default false;
property shortcuts: TCEDebugShortcuts read fShortcuts write setShortcuts;
property showGdbOutput: boolean read fShowGdbOutput write fShowGdbOutput;
property showRawMiOutput: boolean read fShowRawMiOutput write fShowRawMiOutput;
@ -480,6 +482,7 @@ type
procedure storeObserversBreakpoints;
procedure updateDebugeeOptionsEditor;
procedure synchronizeBreakpointsFromDoc;
procedure deleteRedirectedIO;
// GDB output processors
procedure gdboutQuiet(sender: TObject);
procedure gdboutJsonize(sender: TObject);
@ -653,6 +656,7 @@ begin
fIgnoredSignals.Assign(src.fIgnoredSignals);
fCommandsHistory.Assign(src.fCommandsHistory);
fShortcuts.assign(src.fShortcuts);
fKeepRedirectedStreams := src.fKeepRedirectedStreams;
end
else inherited;
end;
@ -1329,13 +1333,6 @@ begin
exit;
fProj := nil;
updateDebugeeOptionsEditor;
if not fDbgRunnable then
begin
if fOutputName.fileExists then
deleteFile(fOutputName);
if fInputName.fileExists then
deleteFile(fInputName);
end;
end;
procedure TCEGdbWidget.projFocused(project: ICECommonProject);
@ -1375,13 +1372,6 @@ begin
exit;
fDoc := nil;
updateDebugeeOptionsEditor;
if fDbgRunnable then
begin
if fOutputName.fileExists then
deleteFile(fOutputName);
if fInputName.fileExists then
deleteFile(fInputName);
end;
end;
{$ENDREGION}
@ -1802,6 +1792,16 @@ begin
end
else fBreakPoints.clearFile(fDoc.fileName);
end;
procedure TCEGdbWidget.deleteRedirectedIO;
begin
if fOptions.keepRedirectedStreams then
exit;
if fOutputName.fileExists then
deleteFile(fOutputName);
if fInputName.fileExists then
deleteFile(fInputName);
end;
{$ENDREGION}
{$REGION GDB output processors -------------------------------------------------}
@ -2183,6 +2183,7 @@ begin
fMsg.message('debugging terminated: ' + reason, nil, amcMisc, amkInf);
setState(gsNone);
subjDebugStop(fSubj);
deleteRedirectedIO;
end;
end;
@ -2537,6 +2538,7 @@ begin
gdbCommand('kill', @gdboutJsonize);
subjDebugStop(fSubj);
setState(gsNone);
deleteRedirectedIO;
end;
procedure TCEGdbWidget.btnWatchClick(Sender: TObject);