You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by en...@apache.org on 2022/05/17 13:35:10 UTC

[netbeans] 01/02: Quote arguments.

This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit d299087e12d12c975145a12d23b372e239f7d9a9
Author: Martin Entlicher <ma...@oracle.com>
AuthorDate: Mon May 16 13:19:29 2022 +0200

    Quote arguments.
---
 .../src/org/netbeans/modules/cpplite/debugger/CPPFrame.java       | 4 ++--
 .../org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java    | 8 ++++----
 .../src/org/netbeans/modules/cpplite/debugger/CPPVariable.java    | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPFrame.java b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPFrame.java
index c7315f5fdc..2c36d6d5d5 100644
--- a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPFrame.java
+++ b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPFrame.java
@@ -158,7 +158,7 @@ public final class CPPFrame implements DVFrame {
                 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();
@@ -257,7 +257,7 @@ public final class CPPFrame implements DVFrame {
             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();
diff --git a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
index bda4bce1a3..bb41a6fec1 100644
--- a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
+++ b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPLiteDebugger.java
@@ -398,12 +398,12 @@ public final class CPPLiteDebugger {
         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;
         }
@@ -434,7 +434,7 @@ public final class CPPLiteDebugger {
     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;
         }
diff --git a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPVariable.java b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPVariable.java
index ec1ef374a7..2b6683d230 100644
--- a/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPVariable.java
+++ b/cpplite/cpplite.debugger/src/org/netbeans/modules/cpplite/debugger/CPPVariable.java
@@ -121,7 +121,7 @@ public final class CPPVariable implements NIVariable {
     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;
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists