summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp
diff options
context:
space:
mode:
authorHafiz Abid Qadeer <hafiz_abid@mentor.com>2017-01-05 13:23:47 +0000
committerHafiz Abid Qadeer <hafiz_abid@mentor.com>2017-01-05 13:23:47 +0000
commit5e9bfc671bf24e58b239dd993149b66aada7cf4c (patch)
tree683e2fb290de778c83b01830c2fadcf6fe1936fe /lldb/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp
parent763f1c453b59970c76c93f919b1514ab5c533c70 (diff)
downloadbcm5719-llvm-5e9bfc671bf24e58b239dd993149b66aada7cf4c.tar.gz
bcm5719-llvm-5e9bfc671bf24e58b239dd993149b66aada7cf4c.zip
[lldb-mi] Fix implementation for a few mi commands
Summary: Some of the mi commands implemented in lldb-mi are incomplete/not confirming to the spec. - `gdb-show` and `gdb-set` doesn't support getting/setting `disassembly-flavor` - `environment-cd` should also change the working directory for inferior - debugger CLI output should be printed as console-stream-output record, rather than being dumped directly to stdout - `target-select` should provide inner error message in mi response Related bug report: - https://llvm.org/bugs/show_bug.cgi?id=28026 - https://llvm.org/bugs/show_bug.cgi?id=28718 - https://llvm.org/bugs/show_bug.cgi?id=30265 Reviewers: ki.stfu, abidh Subscribers: abidh, ki.stfu, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D24711 llvm-svn: 291104
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp
index 6a2079f2ce7..0215b428925 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/main.cpp
@@ -9,11 +9,25 @@
#include <cstdio>
+#ifdef _WIN32
+ #include <direct.h>
+ #define getcwd _getcwd // suppress "deprecation" warning
+#else
+ #include <unistd.h>
+#endif
+
int
main(int argc, char const *argv[])
{
- int a = 10;
+ int a = 10;
+
+ char buf[512];
+ char *ans = getcwd(buf, sizeof(buf));
+ if (ans) {
+ printf("cwd: %s\n", ans);
+ }
printf("argc=%d\n", argc); // BP_printf
+
return 0;
}
OpenPOWER on IntegriCloud