mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-22 04:05:39 +00:00
Merge remote-tracking branch
'origin/GP-3825_d-millar_Cygwin_line_endings--SQUASHED' (Closes #5755)
This commit is contained in:
commit
ce560dc23d
@ -47,18 +47,35 @@ public class GdbInJvmDebuggerModelFactory implements DebuggerModelFactory {
|
||||
public final Property<Boolean> useExistingOption =
|
||||
Property.fromAccessors(boolean.class, this::isUseExisting, this::setUseExisting);
|
||||
|
||||
// TODO: newLine option?
|
||||
private boolean useCrlf = System.lineSeparator().equals("\r\n");;
|
||||
@FactoryOption("Use DOS line endings (unchecked for UNIX and Cygwin))")
|
||||
public final Property<Boolean> crlfNewLineOption =
|
||||
Property.fromAccessors(Boolean.class, this::isUseCrlf, this::setUseCrlf);
|
||||
|
||||
@Override
|
||||
public CompletableFuture<? extends DebuggerObjectModel> build() {
|
||||
List<String> gdbCmdLine = ShellUtils.parseArgs(gdbCmd);
|
||||
GdbModelImpl model = new GdbModelImpl(PtyFactory.local());
|
||||
if (useCrlf) {
|
||||
model.setDosNewLine();
|
||||
}
|
||||
else {
|
||||
model.setUnixNewLine();
|
||||
}
|
||||
return model
|
||||
.startGDB(existing ? null : gdbCmdLine.get(0),
|
||||
gdbCmdLine.subList(1, gdbCmdLine.size()).toArray(String[]::new))
|
||||
.thenApply(__ -> model);
|
||||
}
|
||||
|
||||
public boolean isUseCrlf() {
|
||||
return useCrlf;
|
||||
}
|
||||
|
||||
public void setUseCrlf(boolean useCrlf) {
|
||||
this.useCrlf = useCrlf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority(Program program) {
|
||||
if (!GdbCompatibility.INSTANCE.isCompatible(gdbCmd)) {
|
||||
|
Loading…
Reference in New Issue
Block a user