mirror of https://gitlab.com/basile.b/dexed.git
change field allowing to set what is debugged to an enumeration
This commit is contained in:
parent
8a412cd983
commit
5f206595d3
|
@ -330,7 +330,6 @@ inherited GdbWidget: TGdbWidget
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
inherited toolbar: TDexedToolBar
|
inherited toolbar: TDexedToolBar
|
||||||
Height = 30
|
|
||||||
Width = 664
|
Width = 664
|
||||||
object btnStack: TDexedToolButton[0]
|
object btnStack: TDexedToolButton[0]
|
||||||
Left = 238
|
Left = 238
|
||||||
|
|
|
@ -17,6 +17,8 @@ type
|
||||||
|
|
||||||
TAsmSyntax = (intel, att);
|
TAsmSyntax = (intel, att);
|
||||||
|
|
||||||
|
TDebugTargetKind = (dtkProject, dtkRunnable);
|
||||||
|
|
||||||
{$IFDEF CPU64}
|
{$IFDEF CPU64}
|
||||||
TCpuRegister = (rax, rbx, rcx, rdx, rsi, rdi, rbp, rsp, r8, r9, r10, r11, r12, r13,
|
TCpuRegister = (rax, rbx, rcx, rdx, rsi, rdi, rbp, rsp, r8, r9, r10, r11, r12, r13,
|
||||||
r14, r15, rip);
|
r14, r15, rip);
|
||||||
|
@ -500,7 +502,7 @@ type
|
||||||
fGdbState: TGdbState;
|
fGdbState: TGdbState;
|
||||||
fSubj: TDebugObserverSubject;
|
fSubj: TDebugObserverSubject;
|
||||||
fDoc: TDexedMemo;
|
fDoc: TDexedMemo;
|
||||||
fDbgRunnable: boolean;
|
fDebugTargetKind: TDebugTargetKind;
|
||||||
fCatchCustomEval: boolean;
|
fCatchCustomEval: boolean;
|
||||||
fCatchCustomEvalAsString: boolean;
|
fCatchCustomEvalAsString: boolean;
|
||||||
fCaughtCustomEvalAstring: string;
|
fCaughtCustomEvalAstring: string;
|
||||||
|
@ -1830,14 +1832,14 @@ end;
|
||||||
|
|
||||||
procedure TGdbWidget.mnuSelProjClick(Sender: TObject);
|
procedure TGdbWidget.mnuSelProjClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
fDbgRunnable := false;
|
fDebugTargetKind := dtkProject;
|
||||||
mnuSelRunnable.Checked:=false;
|
mnuSelRunnable.Checked:=false;
|
||||||
updateDebugeeOptionsEditor;
|
updateDebugeeOptionsEditor;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGdbWidget.mnuSelRunnableClick(Sender: TObject);
|
procedure TGdbWidget.mnuSelRunnableClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
fDbgRunnable := true;
|
fDebugTargetKind := dtkRunnable;
|
||||||
mnuSelProj.Checked:=false;
|
mnuSelProj.Checked:=false;
|
||||||
updateDebugeeOptionsEditor;
|
updateDebugeeOptionsEditor;
|
||||||
end;
|
end;
|
||||||
|
@ -1886,57 +1888,57 @@ const
|
||||||
asmFlavorStr: array[TAsmSyntax] of string = ('intel','att');
|
asmFlavorStr: array[TAsmSyntax] of string = ('intel','att');
|
||||||
begin
|
begin
|
||||||
clearDisplays;
|
clearDisplays;
|
||||||
if not fDbgRunnable and (fProj = nil) then
|
if (fDebugTargetKind = dtkProject) and (fProj = nil) then
|
||||||
begin
|
begin
|
||||||
dlgOkInfo('No project to debug', 'GDB commander');
|
dlgOkInfo('No project to debug', 'GDB commander');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if fDbgRunnable and fDoc.isNil then
|
if (fDebugTargetKind = dtkRunnable) and fDoc.isNil then
|
||||||
begin
|
begin
|
||||||
dlgOkInfo('No runnable to debug', 'GDB commander');
|
dlgOkInfo('No runnable to debug', 'GDB commander');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if not fDbgRunnable and (fProj.binaryKind <> executable) then
|
if (fDebugTargetKind = dtkProject) and (fProj.binaryKind <> executable) then
|
||||||
begin
|
begin
|
||||||
dlgOkInfo('The project cannot be debugged because it does not output an executable', 'GDB commander');
|
dlgOkInfo('The project cannot be debugged because it does not output an executable', 'GDB commander');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if not fDbgRunnable then
|
case fDebugTargetKind of
|
||||||
fExe := fProj.outputFilename
|
dtkProject: fExe := fProj.outputFilename;
|
||||||
else
|
dtkRunnable: fExe := fDoc.fileName.stripFileExt + exeExt;
|
||||||
fExe := fDoc.fileName.stripFileExt + exeExt;
|
end;
|
||||||
//
|
|
||||||
if (fExe = '/') or not fExe.fileExists then
|
if (fExe = '/') or not fExe.fileExists then
|
||||||
begin
|
begin
|
||||||
if fDbgRunnable then
|
if (fDebugTargetKind = dtkRunnable) then
|
||||||
dlgOkInfo('Either the runnable is not compiled or it cannot be found' +
|
dlgOkInfo('Either the runnable is not compiled or it cannot be found' +
|
||||||
LineEnding + 'Note that the runnable option "outputFolder" is not supported by this widget.' +
|
LineEnding + 'Note that the runnable option "outputFolder" is not supported by this widget.' +
|
||||||
LineEnding + LineEnding + 'Expected target: ' + fExe, 'GDB commander')
|
LineEnding + LineEnding + 'Expected target: ' + fExe, 'GDB commander')
|
||||||
else
|
else
|
||||||
dlgOkInfo('The project binary is missing, cannot debug.' +
|
dlgOkInfo('The binary to debug is missing, debugging aborted.' +
|
||||||
LineEnding + LineEnding + 'Expected target: ' + fExe, 'GDB commander');
|
LineEnding + LineEnding + 'Expected target: ' + fExe, 'GDB commander');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
//
|
|
||||||
fOutputName := fExe + '.inferiorout';
|
fOutputName := fExe + '.inferiorout';
|
||||||
fInputName := fExe + '.inferiorin';
|
fInputName := fExe + '.inferiorin';
|
||||||
FreeAndNil(fInput);
|
FreeAndNil(fInput);
|
||||||
FreeAndNil(fOutput);
|
FreeAndNil(fOutput);
|
||||||
//
|
|
||||||
gdb := exeFullName('gdb');
|
gdb := exeFullName('gdb');
|
||||||
if not gdb.fileExists then
|
if not gdb.fileExists then
|
||||||
begin
|
begin
|
||||||
dlgOkInfo('Cannot debug, GDB is missing', 'GDB commander');
|
dlgOkInfo('Cannot debug, GDB is missing', 'GDB commander');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
//
|
|
||||||
if fInputName.fileExists then
|
if fInputName.fileExists then
|
||||||
deletefile(fInputName);
|
deletefile(fInputName);
|
||||||
fInput:= TFileStream.Create(fInputName, fmCreate or fmShareExclusive);
|
fInput:= TFileStream.Create(fInputName, fmCreate or fmShareExclusive);
|
||||||
subjDebugStart(fSubj, self as IDebugger);
|
subjDebugStart(fSubj, self as IDebugger);
|
||||||
case fDbgRunnable of
|
case fDebugTargetKind of
|
||||||
true: o := fDebugeeOptions.projectByFile[fDoc.fileName];
|
dtkRunnable: o := fDebugeeOptions.projectByFile[fDoc.fileName];
|
||||||
false:o := fDebugeeOptions.projectByFile[fProj.fileName];
|
dtkProject: o := fDebugeeOptions.projectByFile[fProj.fileName];
|
||||||
end;
|
end;
|
||||||
fLastFunction := '';
|
fLastFunction := '';
|
||||||
// gdb process
|
// gdb process
|
||||||
|
@ -2047,15 +2049,9 @@ var
|
||||||
begin
|
begin
|
||||||
dbgeeOptsEd.ItemIndex:=-1;
|
dbgeeOptsEd.ItemIndex:=-1;
|
||||||
dbgeeOptsEd.TIObject := nil;
|
dbgeeOptsEd.TIObject := nil;
|
||||||
if not fDbgRunnable then
|
case fDebugTargetKind of
|
||||||
begin
|
dtkProject : if fProj <> nil then nme := fProj.filename;
|
||||||
if fProj <> nil then
|
dtkRunnable : if fDoc.isNotNil then nme := fDoc.filename;
|
||||||
nme := fProj.filename;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
if fDoc.isNotNil then
|
|
||||||
nme := fDoc.filename;
|
|
||||||
end;
|
end;
|
||||||
if nme.fileExists then
|
if nme.fileExists then
|
||||||
begin
|
begin
|
||||||
|
|
Loading…
Reference in New Issue