[Lldb-commits] [PATCH] D68864: [LLDB] [lldb-server] Use llvm::InitLLVM for doing unicode conversion of arguments for windows

Martin Storsjö via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 11 03:52:33 PDT 2019


mstorsjo created this revision.
mstorsjo added reviewers: amccarth, labath, aleksandr.urakov.
Herald added a project: LLDB.

This should allow lldb-server to operate on files with non-ascii pathnames.

I tried looking around in lldb/tools, and this seemed like the only other tool (other than the main lldb driver itself) that would be used (implicitly) by an end user (which could be working in non-ascii paths).

This does the same as for D68770 <https://reviews.llvm.org/D68770> (where the main driver earlier was using custom code in the driver to convert unicode to utf8), while lldb-server didn't have any unicode handling at all before (where the main arguments would be given in the native local codepage, while the rest of llvm internals expect utf8).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68864

Files:
  lldb/tools/lldb-server/lldb-server.cpp


Index: lldb/tools/lldb-server/lldb-server.cpp
===================================================================
--- lldb/tools/lldb-server/lldb-server.cpp
+++ lldb/tools/lldb-server/lldb-server.cpp
@@ -12,6 +12,7 @@
 
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/Signals.h"
@@ -48,6 +49,7 @@
 
 // main
 int main(int argc, char *argv[]) {
+  llvm::InitLLVM IL(argc, argv);
   llvm::StringRef ToolName = argv[0];
   llvm::sys::PrintStackTraceOnErrorSignal(ToolName);
   llvm::PrettyStackTraceProgram X(argc, argv);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68864.224559.patch
Type: text/x-patch
Size: 682 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191011/3a2f262e/attachment-0001.bin>


More information about the lldb-commits mailing list