small changes to gdb completions

- optin to request using dot
- dont request directly after validation of a completion
This commit is contained in:
Basile Burg 2022-06-18 05:27:40 +02:00
parent 064ca95343
commit 53fe7317b8
4 changed files with 22 additions and 10 deletions

View File

@ -2,11 +2,11 @@
## Enhancements
- GDB Commander, the `p` custom command and has now the same effect as the toolbar action _evaluate_.
- GDB Commander, it's possible to get completions when using the `p` command in the field at the bottom and using
- GDB Commander, the `p` custom command has now the same effect as the toolbar action _evaluate_.
- GDB Commander, it's possible to get completions when using the `p` command in the field at the bottom and with
the <key>CTRL</key> + <key>SPACE</key> shortcut or the <key>.</key> key.
- GDB Commander, added the _useCustomCommandsHistory_ option. If checked the history is used to auto-complete the field at the bottom.
This is the previous default but it's now deactivate for a better experience with the GDB completions.
This is the previous default but it's now deactivated for a better experience with the GDB completions.
## Bugs fixed

View File

@ -98,8 +98,9 @@ Note that if the option _queryInput_ is used then the input stream is not availa
![](img/options_gdb_commander.png)
- **asmSyntax**: Sets the assembler syntax used in the _Assembler_ tab. Intel or AT&T.
- **autoDemangle**: Sets if the GDB output is automatically filtered by [ddemangle](https://github.com/dlang/tools#d-tools). Mostly useful for the _Call stack_ page.
- **autoDemangle**: Sets if the D names are automatically demangled.
- **autoDisassemble**: Sets if the assembly output is automatically updated when the execution breaks.
- **autoDotCompletion**: Sets if the <key>.<key> has for effect to request GDB completions.
- **autoGetCallStack**: Sets if the call stack is automatically updated when the execution breaks.
- **autoGetRegisters**: Sets if the CPU view is automatically updated when the execution breaks.
- **autoGetThreads**: Sets if the thread list is automatically updated when the execution breaks.

View File

@ -332,6 +332,7 @@ inherited GdbWidget: TGdbWidget
end
end
inherited toolbar: TDexedToolBar
Height = 30
Width = 664
object btnStack: TDexedToolButton[0]
Left = 238

View File

@ -318,6 +318,7 @@ type
fMaxCallStackDepth: integer;
fGdbPath: TFilename;
fUseCustomCommandsHistory: boolean;
fAutoDotCompletion: boolean;
procedure setIgnoredSignals(value: TStringList);
procedure setCommandsHistory(value: TStringList);
procedure setCustomEvalHistory(value: TStringList);
@ -326,9 +327,9 @@ type
procedure cleanInvalidHistoryEntries;
published
property asmSyntax: TAsmSyntax read fAsmSyntax write fAsmSyntax;
property useCustomCommandsHistory: boolean read fUseCustomCommandsHistory write fUseCustomCommandsHistory;
property autoDisassemble: boolean read fAutoDisassemble write fAutoDisassemble;
property autoDemangle: boolean read fAutoDemangle write fAutoDemangle;
property autoDotCompletion: boolean read fAutoDotCompletion write fAutoDotCompletion;
property autoGetCallStack: boolean read fAutoGetCallStack write fAutoGetCallStack;
property autoGetRegisters: boolean read fAutoGetRegisters write fAutoGetRegisters;
property autoGetVariables: boolean read fAutoGetVariables write fAutoGetVariables;
@ -347,6 +348,7 @@ type
property showRawMiOutput: boolean read fShowRawMiOutput write fShowRawMiOutput;
property showOutput: boolean read fShowOutput write fShowOutput;
property stopAllThreadsOnBreak: boolean read fStopAllThreadsOnBreak write fStopAllThreadsOnBreak;
property useCustomCommandsHistory: boolean read fUseCustomCommandsHistory write fUseCustomCommandsHistory;
protected
procedure beforeSave; override;
procedure afterLoad; override;
@ -544,6 +546,7 @@ type
fLastEvalStuff: string;
fCommandProcessed: boolean;
fDebugeeOptions: TDebugeeOptions;
fSkipGdbCompletionValidation: boolean;
procedure updateCpuViewVisibility;
procedure continueDebugging;
procedure waitCommandProcessed;
@ -796,6 +799,8 @@ begin
fShortcuts.assign(src.fShortcuts);
fKeepRedirectedStreams := src.fKeepRedirectedStreams;
fCurrentEvalKind := src.fCurrentEvalKind;
fUseCustomCommandsHistory:= src.fUseCustomCommandsHistory;
fAutoDotCompletion:=src.fAutoDotCompletion;
end
else inherited;
end;
@ -3037,20 +3042,25 @@ end;
procedure TGdbWidget.Edit1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if ((shift = [ssCtrl]) and (Key = Byte(#32))) then
if (shift = [ssCtrl]) and (Key = 32) then
getCompletions();
end;
procedure TGdbWidget.Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if Key = byte(#13) then
sendCustomCommand()
else if Key = Byte(#190) then
getCompletions();
if Key = 13 then
begin
if not fSkipGdbCompletionValidation then
sendCustomCommand();
fSkipGdbCompletionValidation := false;
end
else if (Key = 190) and fOptions.autoDotCompletion then
getCompletions();
end;
procedure TGdbWidget.itemCompletetionClick(sender: TObject);
begin
fSkipGdbCompletionValidation := true;
Edit1.Text := (sender as TMenuItem).Caption;
end;