Skip to content

Commit

Permalink
Quote arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
entlicher committed May 17, 2022
1 parent 0011e80 commit d299087
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static Map<String, NIVariable> retrieveVariables(CPPFrame frame, CPPVariable par
record = frame.thread.getDebugger().sendAndGet("-stack-list-variables --thread " + frame.thread.getId() + " --frame " + frame.level + " --no-frame-filters 2");
} else {
// from to
record = frame.thread.getDebugger().sendAndGet("-var-list-children --thread " + frame.thread.getId() + " --frame " + frame.level + " --all-values " + parentVar.getUniqueName());
record = frame.thread.getDebugger().sendAndGet("-var-list-children --thread " + frame.thread.getId() + " --frame " + frame.level + " --all-values " + "\"" + parentVar.getUniqueName() + "\"");
}
} catch (InterruptedException ex) {
return Collections.emptyMap();
Expand Down Expand Up @@ -257,7 +257,7 @@ public CompletableFuture<NIVariable> evaluateAsync(String expression, String res
result.complete(value);
return result;
}
thread.getDebugger().send(new Command("-var-create --thread " + thread.getId() + " --frame " + level + " - * " + expression) {
thread.getDebugger().send(new Command("-var-create --thread " + thread.getId() + " --frame " + level + " - * \"" + expression + "\"") {
@Override
protected void onDone(MIRecord record) {
MITList results = record.results();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,12 @@ public String readMemory(String address, long offset, int length) {
MIRecord memory;
String offsetArg;
if (offset != 0) {
offsetArg = "-o " + offset + " ";
offsetArg = "-o " + offset + " \"";
} else {
offsetArg = "";
offsetArg = "\"";
}
try {
memory = sendAndGet("-data-read-memory-bytes " + offsetArg + address + " " + length);
memory = sendAndGet("-data-read-memory-bytes " + offsetArg + address + "\" " + length);
} catch (InterruptedException ex) {
return null;
}
Expand Down Expand Up @@ -434,7 +434,7 @@ public String getVersion() {
public List<Location> listLocations(String filePath) {
MIRecord lines;
try {
lines = sendAndGet("-symbol-list-lines " + filePath);
lines = sendAndGet("-symbol-list-lines \"" + filePath + "\"");
} catch (InterruptedException ex) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public NIVariable[] getChildren(int from, int to) {
public String getExpressionPath() {
MIRecord pathRecord;
try {
pathRecord = frame.getThread().getDebugger().sendAndGet("-var-info-path-expression " + uniqueName);
pathRecord = frame.getThread().getDebugger().sendAndGet("-var-info-path-expression \"" + uniqueName + "\"");
} catch (InterruptedException ex) {
return null;
}
Expand Down

0 comments on commit d299087

Please sign in to comment.