#97, add option to set the disassembly flavor

This commit is contained in:
Basile Burg 2016-11-28 05:15:16 +01:00
parent 450375e6e9
commit 555ed94e56
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
1 changed files with 8 additions and 0 deletions

View File

@ -14,6 +14,8 @@ uses
type type
TAsmSyntax = (intel, att);
{$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);
@ -277,10 +279,12 @@ type
fShowOutput: boolean; fShowOutput: boolean;
fShowRawMiOutput: boolean; fShowRawMiOutput: boolean;
fShortcuts: TCEDebugShortcuts; fShortcuts: TCEDebugShortcuts;
fAsmSyntax: TAsmSyntax;
procedure setIgnoredSignals(value: TStringList); procedure setIgnoredSignals(value: TStringList);
procedure setCommandsHistory(value: TStringList); procedure setCommandsHistory(value: TStringList);
procedure setShortcuts(value: TCEDebugShortcuts); procedure setShortcuts(value: TCEDebugShortcuts);
published published
property asmSyntax: TAsmSyntax read fAsmSyntax write fAsmSyntax;
property autoDisassemble: boolean read fAutoDisassemble write fAutoDisassemble; property autoDisassemble: boolean read fAutoDisassemble write fAutoDisassemble;
property autoDemangle: boolean read fAutoDemangle write fAutoDemangle; property autoDemangle: boolean read fAutoDemangle write fAutoDemangle;
property autoGetCallStack: boolean read fAutoGetCallStack write fAutoGetCallStack; property autoGetCallStack: boolean read fAutoGetCallStack write fAutoGetCallStack;
@ -581,6 +585,7 @@ begin
if source is TCEDebugOptionsBase then if source is TCEDebugOptionsBase then
begin begin
src := TCEDebugOptionsBase(source); src := TCEDebugOptionsBase(source);
fAsmSyntax:=src.fAsmSyntax;
fAutoDemangle:=src.fAutoDemangle; fAutoDemangle:=src.fAutoDemangle;
fAutoDisassemble:=src.fAutoDisassemble; fAutoDisassemble:=src.fAutoDisassemble;
fAutoGetThreads:=src.fAutoGetThreads; fAutoGetThreads:=src.fAutoGetThreads;
@ -1394,6 +1399,8 @@ var
gdb: string; gdb: string;
i: integer; i: integer;
b: TPersistentBreakPoint; b: TPersistentBreakPoint;
const
asmFlavorStr: array[TAsmSyntax] of string = ('intel','att');
begin begin
clearDisplays; clearDisplays;
if not fDbgRunnable and (fProj = nil) then if not fDbgRunnable and (fProj = nil) then
@ -1464,6 +1471,7 @@ begin
end; end;
fGdb.Input.Write(str[1], str.length); fGdb.Input.Write(str[1], str.length);
end; end;
gdbCommand('set disassembly-flavor ' + asmFlavorStr[fOptions.asmSyntax]);
// break on druntime exceptions + any throw' // break on druntime exceptions + any throw'
gdbCommand('break onAssertError'); gdbCommand('break onAssertError');
gdbCommand('break onAssertErrorMsg'); gdbCommand('break onAssertErrorMsg');