[Lldb-commits] [PATCH] D123226: [lldb] use one shared ThreadPool and task groups

2022-04-06 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added inline comments.



Comment at: lldb/source/Core/Debugger.cpp:1969
+llvm::ThreadPool ::GetThreadPool() {
+  static llvm::ThreadPool threadpool(llvm::optimal_concurrency());
+  return threadpool;

clayborg wrote:
> aganea wrote:
> > Ideally this should be explicitly created on the stack & passed along on 
> > the callstack or in a context, like MLIR does: 
> > https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/IR/MLIRContext.h#L48
> We need one instance of the thread pool so we can't create on the stack. 
> 
> Static is not great because of the C++ global destructor chain could try and 
> use if "main" exits and we still have threads running. I would do something 
> like the "g_debugger_list_ptr" where you create a static variable in 
> Debugger.cpp:105 which is a pointer, and we initialize it inside of 
> Debugger::Initialize() like we do for "g_debugger_list_ptr". Then the thread 
> pool will not cause shutdown crashes when "main" exits before other threads.
> 
I meant having the `ThreadPool` in a context created by main() or the lib 
caller, before getting here in library/plugin code, and passed along. LLD does 
that too: https://github.com/llvm/llvm-project/blob/main/lld/ELF/Driver.cpp#L94 
- the statics in `Debugger.cpp` seems like a workaround for that. In any case, 
it's better than having the `static` here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123226/new/

https://reviews.llvm.org/D123226

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D123226: [lldb] use one shared ThreadPool and task groups

2022-04-06 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added inline comments.



Comment at: lldb/source/Core/Debugger.cpp:1969
+llvm::ThreadPool ::GetThreadPool() {
+  static llvm::ThreadPool threadpool(llvm::optimal_concurrency());
+  return threadpool;

Ideally this should be explicitly created on the stack & passed along on the 
callstack or in a context, like MLIR does: 
https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/IR/MLIRContext.h#L48



Comment at: lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp:127
 
-  pool.async(finalize_fn, ::function_basenames);
-  pool.async(finalize_fn, ::function_fullnames);
-  pool.async(finalize_fn, ::function_methods);
-  pool.async(finalize_fn, ::function_selectors);
-  pool.async(finalize_fn, ::objc_class_selectors);
-  pool.async(finalize_fn, ::globals);
-  pool.async(finalize_fn, ::types);
-  pool.async(finalize_fn, ::namespaces);
-  pool.wait();
+  pool.async(group, finalize_fn, ::function_basenames);
+  pool.async(group, finalize_fn, ::function_fullnames);

Like suggested in D123225, wouldn't it be better if we had 
`group.async(finalize_fn, ::function_basenames)`? Same for the waits: 
`group.wait();`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123226/new/

https://reviews.llvm.org/D123226

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D122943: [LLDB][NativePDB] Fix a crash when S_DEFRANGE_SUBFIELD_REGISTER descirbes a simple type

2022-04-04 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

There's a typo in the title, `s/descirbes/describes/`




Comment at: lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp:54
 struct FindMembersSize : public TypeVisitorCallbacks {
-  FindMembersSize(std::vector> _info,
+  FindMembersSize(llvm::SmallVector> 
_info,
   TpiStream )

labath wrote:
> I think `SmallVectorImpl` is still the official way to take SmallVector 
> references.
`ArrayRef` would be even better! :) ie. `llvm::ArrayRef> members_info;`



Comment at: 
lldb/test/Shell/SymbolFile/NativePDB/subfield_register_simple_type.s:27
+# CHECK:  LineEntry: [0x00401026-0x00401039): C:\src\a.cpp:3
+# CHECK-NEXT: Variable: id = {{.*}}, name = "x", type = "int64_t", valid 
ranges = [0x0040102f-0x00401036), location = DW_OP_reg0 EAX, DW_OP_piece 0x4, 
DW_OP_reg2 EDX, DW_OP_piece 0x4, decl =
+

nitpick: Is anything after (and including) ", valid ranges" necessary to cover 
this change?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122943/new/

https://reviews.llvm.org/D122943

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D119009: [Support] Ensure handlers are set up before printing the stacktrace

2022-02-07 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

In that case @werat can you get the caller application to call 
`llvm::InitLLVM`? That plus the snippet in 
https://reviews.llvm.org/D119009#3297591 should shield from crashes if the 
handler isn't installed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119009/new/

https://reviews.llvm.org/D119009

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D119009: [Support] Ensure handlers are set up before printing the stacktrace

2022-02-07 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

Could you please apply clang format just for the changed lines? You can do that 
usually through `git clang-format`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119009/new/

https://reviews.llvm.org/D119009

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D70830: [LLDB] Disable MSVC warning C4190

2021-05-06 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

Hello @mstorsjo! I've reverted the patch locally, I'm at this commit:

  F:\aganea\llvm-project>git log
  commit a3a8a1a15b524d91b5308db68e9d293b34cd88dd (HEAD -> main, origin/main)

Using:

  F:\aganea\llvm-project>cl
  Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29914 for x64

that is, Visual Studio 16.9.4 running a "x64 Native Tools Command Prompt for VS 
2019".

Building with:

  cmake "-DLLVM_LIT_ARGS=-sv -j 36" -GNinja 
-DLLVM_ENABLE_PROJECTS=llvm;clang;lld;lldb -DLLVM_ENABLE_LIBXML2=OFF 
-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON %ROOT%/llvm 
-DLLVM_OPTIMIZED_TABLEGEN=ON -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl 
-DCMAKE_LINKER=link

The invocation:

  [4/10] 
C:\PROGRA~2\MICROS~4\2019\PROFES~1\VC\Tools\MSVC\1428~1.299\bin\Hostx64\x64\cl.exe
  /nologo /TP -DGTEST_HAS_RTTI=0 
-DLLDB_PYTHON_RELATIVE_LIBDIR=\"Lib/site-packages\" -DUNICODE 
-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS 
-D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_HAS_EXCEPTIONS=0 
-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-Itools\lldb\source\Plugins\ScriptInterpreter\Python 
-IF:\aganea\llvm-project\lldb\source\Plugins\ScriptInterpreter\Python 
-Itools\lldb\source -IF:\aganea\llvm-project\lldb\include -Itools\lldb\include 
-Iinclude -IF:\aganea\llvm-project\llvm\include -I"C:\Program 
Files\Python39\include" -IF:\aganea\llvm-project\llvm\..\clang\include 
-Itools\lldb\..\clang\include -IF:\aganea\llvm-project\lldb\source\. /DWIN32 
/D_WINDOWS   /Zc:inline /Zc:__cplusplus /Zc:strictStrings /Oi /Zc:rvalueCast 
/bigobj /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 
-wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 
-wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 
-wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /Gw /MD 
/O2 /Ob2   -wd4018 -wd4068 -wd4150 -wd4201 -wd4251 -wd4521 -wd4530  /EHs-c- 
/GR- -UNDEBUG -std:c++14 /showIncludes 
/Fotools\lldb\source\Plugins\ScriptInterpreter\Python\CMakeFiles\lldbPluginScriptInterpreterPython.dir\ScriptInterpreterPython.cpp.obj
 
/Fdtools\lldb\source\Plugins\ScriptInterpreter\Python\CMakeFiles\lldbPluginScriptInterpreterPython.dir\lldbPluginScriptInterpreterPython.pdb
 /FS -c 
F:\aganea\llvm-project\lldb\source\Plugins\ScriptInterpreter\Python\ScriptInterpreterPython.cpp
  
F:\aganea\llvm-project\lldb\source\Plugins\ScriptInterpreter\Python\ScriptInterpreterPython.cpp(83):
 warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has C-linkage 
specified, but returns UDT 'llvm::Expected' which is incompatible with C
  
F:\aganea\llvm-project\lldb\source\Plugins\ScriptInterpreter\Python\PythonDataObjects.h(355):
 note: see declaration of 'llvm::Expected'


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70830/new/

https://reviews.llvm.org/D70830

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D99426: [SystemZ][z/OS][Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text

2021-04-02 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

In D99426#2666141 , 
@abhina.sreeskantharajan wrote:

> In D99426#2665361 , @aganea wrote:
>
>> I am still concerned by the fact that this patch doesn't fix the issue 
>> mentionned in https://reviews.llvm.org/D96363#2650460
>> Was the intention to fix that issue? Will the fix be done in a subsequent 
>> patch?
>
> I was fairly confident that if https://reviews.llvm.org/D96363 was the patch 
> that was causing the issue for you

That is the case! I've confirmed that `git checkout 
fdb640ea30d416368b76b68b106deda580c6aced~1 && ninja clang -C build` generates a 
`clang-cl.exe` that works with my above test case. `git revert 
fdb640ea30d416368b76b68b106deda580c6aced` locally over ToT fixes the issue.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99426/new/

https://reviews.llvm.org/D99426

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D99426: [Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text

2021-04-02 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

I am still concerned by the fact that this patch doesn't fix the issue 
mentionned in https://reviews.llvm.org/D96363#2650460
Was the intention to fix that issue? Will the fix be done in a subsequent patch?




Comment at: llvm/lib/Support/Windows/Path.inc:1087
+  if (Flags & OF_CRLF) {
+assert(Flags & OF_Text, "Flags set OF_CRLF without OF_Text");
 CrtOpenFlags |= _O_TEXT;

`s/,/ &&/`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99426/new/

https://reviews.llvm.org/D99426

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D89716: [LLDB][TestSuite] Improve skipIfWindowsAndNonEnglish in decorators.py

2020-10-19 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea created this revision.
aganea added reviewers: amccarth, ted, labath.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
aganea requested review of this revision.
Herald added a subscriber: JDevlieghere.

Improve rG79809f58b02419a5d1bfb6c9a59dbd13cd038c77 
 as 
suggested by @ted  :

//"`if lldbplatformutil.getPlatform() != "windows":` will check if the lldb 
platform is windows; this won’t be true if running embedded lldb tests on 
windows. Since we want to see if the host is windows, better to say `if 
sys.platform != "win32":`"//


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89716

Files:
  lldb/packages/Python/lldbsuite/test/decorators.py


Index: lldb/packages/Python/lldbsuite/test/decorators.py
===
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -597,7 +597,7 @@
 def skipIfWindowsAndNonEnglish(func):
 """Decorate the item to skip tests that should be skipped on non-English 
locales on Windows."""
 def is_Windows_NonEnglish(self):
-if lldbplatformutil.getPlatform() != "windows":
+if sys.platform != "win32":
 return None
 kernel = ctypes.windll.kernel32
 if locale.windows_locale[ kernel.GetUserDefaultUILanguage() ] == 
"en_US":


Index: lldb/packages/Python/lldbsuite/test/decorators.py
===
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -597,7 +597,7 @@
 def skipIfWindowsAndNonEnglish(func):
 """Decorate the item to skip tests that should be skipped on non-English locales on Windows."""
 def is_Windows_NonEnglish(self):
-if lldbplatformutil.getPlatform() != "windows":
+if sys.platform != "win32":
 return None
 kernel = ctypes.windll.kernel32
 if locale.windows_locale[ kernel.GetUserDefaultUILanguage() ] == "en_US":
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D88975: [LLDB] On Windows, fix tests

2020-10-08 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

I've commited one more fix here: https://reviews.llvm.org/rG97e7fbb343e2 - This 
didn't occur locally on my machine, but only on another machine. But in 
essence, the issue was the same, an accentuated Windows-1252 codepage character 
that was being decoded as UTF-8 by the Python runtime.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88975/new/

https://reviews.llvm.org/D88975

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D88975: [LLDB] On Windows, fix tests

2020-10-08 Thread Alexandre Ganea via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG79809f58b024: [LLDB] On Windows, fix tests (authored by 
aganea).

Changed prior to commit:
  https://reviews.llvm.org/D88975?vs=296809=296982#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88975/new/

https://reviews.llvm.org/D88975

Files:
  lldb/packages/Python/lldbsuite/test/decorators.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test_event/build_exception.py
  lldb/test/API/commands/target/basic/TestTargetCommand.py
  lldb/unittests/Utility/StatusTest.cpp

Index: lldb/unittests/Utility/StatusTest.cpp
===
--- lldb/unittests/Utility/StatusTest.cpp
+++ lldb/unittests/Utility/StatusTest.cpp
@@ -10,7 +10,7 @@
 #include "gtest/gtest.h"
 
 #ifdef _WIN32
-#include 
+#include 
 #endif
 
 using namespace lldb_private;
@@ -71,14 +71,26 @@
   EXPECT_FALSE(success.ToError());
   EXPECT_TRUE(success.Success());
 
+  WCHAR name[128]{};
+  ULONG nameLen = llvm::array_lengthof(name);
+  ULONG langs = 0;
+  GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, ,
+  reinterpret_cast(), );
+  // Skip the following tests on non-English, non-US, locales because the
+  // formatted messages will be different.
+  bool skip = wcscmp(L"en-US", name) != 0;
+
   auto s = Status(ERROR_ACCESS_DENIED, ErrorType::eErrorTypeWin32);
   EXPECT_TRUE(s.Fail());
-  EXPECT_STREQ("Access is denied. ", s.AsCString());
+  if (!skip)
+EXPECT_STREQ("Access is denied. ", s.AsCString());
 
   s.SetError(ERROR_IPSEC_IKE_TIMED_OUT, ErrorType::eErrorTypeWin32);
-  EXPECT_STREQ("Negotiation timed out ", s.AsCString());
+  if (!skip)
+EXPECT_STREQ("Negotiation timed out ", s.AsCString());
 
   s.SetError(16000, ErrorType::eErrorTypeWin32);
-  EXPECT_STREQ("unknown error", s.AsCString());
+  if (!skip)
+EXPECT_STREQ("unknown error", s.AsCString());
 }
 #endif
Index: lldb/test/API/commands/target/basic/TestTargetCommand.py
===
--- lldb/test/API/commands/target/basic/TestTargetCommand.py
+++ lldb/test/API/commands/target/basic/TestTargetCommand.py
@@ -350,6 +350,7 @@
 self.expect("target create a b", error=True,
 substrs=["'target create' takes exactly one executable path"])
 
+@skipIfWindowsAndNonEnglish
 @no_debug_info_test
 def test_target_create_nonexistent_core_file(self):
 self.expect("target create -c doesntexist", error=True,
@@ -365,6 +366,7 @@
 self.expect("target create -c '" + tf.name + "'", error=True,
 substrs=["Cannot open '", "': Permission denied"])
 
+@skipIfWindowsAndNonEnglish
 @no_debug_info_test
 def test_target_create_nonexistent_sym_file(self):
 self.expect("target create -s doesntexist doesntexisteither", error=True,
Index: lldb/packages/Python/lldbsuite/test_event/build_exception.py
===
--- lldb/packages/Python/lldbsuite/test_event/build_exception.py
+++ lldb/packages/Python/lldbsuite/test_event/build_exception.py
@@ -12,4 +12,4 @@
 @staticmethod
 def format_build_error(command, command_output):
 return "Error when building test subject.\n\nBuild Command:\n{}\n\nBuild Command Output:\n{}".format(
-command, command_output.decode("utf-8"))
+command, command_output.decode("utf-8", errors='ignore'))
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -52,6 +52,9 @@
 """Returns true if fpath is an executable."""
 if fpath == None:
 return False
+if sys.platform == 'win32':
+if not fpath.endswith(".exe"):
+fpath += ".exe"
 return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
 
 
Index: lldb/packages/Python/lldbsuite/test/decorators.py
===
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -3,6 +3,8 @@
 # System modules
 from distutils.version import LooseVersion
 from functools import wraps
+import ctypes
+import locale
 import os
 import platform
 import re
@@ -592,6 +594,17 @@
 """Decorate the item to skip tests that should be skipped on Windows."""
 return skipIfPlatform(["windows"])(func)
 
+def skipIfWindowsAndNonEnglish(func):
+"""Decorate the item to skip tests that should be skipped on non-English locales on Windows."""
+def is_Windows_NonEnglish(self):
+if lldbplatformutil.getPlatform() != "windows":
+return None
+kernel = ctypes.windll.kernel32
+

[Lldb-commits] [PATCH] D88975: [LLDB] On Windows, fix tests

2020-10-08 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea marked 2 inline comments as done.
aganea added a comment.

Thank you all for your time!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88975/new/

https://reviews.llvm.org/D88975

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D88975: [LLDB] On Windows, fix tests

2020-10-07 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

In D88975#2317494 , @amccarth wrote:

> It's interesting that I haven't encountered some of these errors.  There are 
> five _other_ lldb tests that do fail for me.  I have a fix in the works for 
> some of those.

Please see my failing tests (with VS2019 16.7.5):
F13201512: failing_lldb_vs2019.txt 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88975/new/

https://reviews.llvm.org/D88975

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D88975: [LLDB] On Windows, fix tests

2020-10-07 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea updated this revision to Diff 296809.
aganea marked an inline comment as done.
aganea added a comment.

As discussed above:

- Remove locale-specific messages.
- Skip relevant locale-sensitive TestTargetCommand tests.
- Only skip EXPECT calls in Utility/StatusTest.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88975/new/

https://reviews.llvm.org/D88975

Files:
  lldb/packages/Python/lldbsuite/test/decorators.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test_event/build_exception.py
  lldb/test/API/commands/target/basic/TestTargetCommand.py
  lldb/unittests/Utility/StatusTest.cpp

Index: lldb/unittests/Utility/StatusTest.cpp
===
--- lldb/unittests/Utility/StatusTest.cpp
+++ lldb/unittests/Utility/StatusTest.cpp
@@ -10,7 +10,7 @@
 #include "gtest/gtest.h"
 
 #ifdef _WIN32
-#include 
+#include 
 #endif
 
 using namespace lldb_private;
@@ -71,14 +71,26 @@
   EXPECT_FALSE(success.ToError());
   EXPECT_TRUE(success.Success());
 
+  WCHAR name[128]{};
+  ULONG langs = 0;
+  ULONG nameLen = sizeof(name) / sizeof(WCHAR);
+  GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, , (PZZWSTR),
+  );
+  // Skip the following tests on non-English, non-US, locales because the
+  // formatted messages will be different.
+  bool skip = wcscmp(L"en-US", name) != 0;
+
   auto s = Status(ERROR_ACCESS_DENIED, ErrorType::eErrorTypeWin32);
   EXPECT_TRUE(s.Fail());
-  EXPECT_STREQ("Access is denied. ", s.AsCString());
+  if (!skip)
+EXPECT_STREQ("Access is denied. ", s.AsCString());
 
   s.SetError(ERROR_IPSEC_IKE_TIMED_OUT, ErrorType::eErrorTypeWin32);
-  EXPECT_STREQ("Negotiation timed out ", s.AsCString());
+  if (!skip)
+EXPECT_STREQ("Negotiation timed out ", s.AsCString());
 
   s.SetError(16000, ErrorType::eErrorTypeWin32);
-  EXPECT_STREQ("unknown error", s.AsCString());
+  if (!skip)
+EXPECT_STREQ("unknown error", s.AsCString());
 }
 #endif
Index: lldb/test/API/commands/target/basic/TestTargetCommand.py
===
--- lldb/test/API/commands/target/basic/TestTargetCommand.py
+++ lldb/test/API/commands/target/basic/TestTargetCommand.py
@@ -350,6 +350,7 @@
 self.expect("target create a b", error=True,
 substrs=["'target create' takes exactly one executable path"])
 
+@skipIfWindowsAndNonEnglish
 @no_debug_info_test
 def test_target_create_nonexistent_core_file(self):
 self.expect("target create -c doesntexist", error=True,
@@ -365,6 +366,7 @@
 self.expect("target create -c '" + tf.name + "'", error=True,
 substrs=["Cannot open '", "': Permission denied"])
 
+@skipIfWindowsAndNonEnglish
 @no_debug_info_test
 def test_target_create_nonexistent_sym_file(self):
 self.expect("target create -s doesntexist doesntexisteither", error=True,
Index: lldb/packages/Python/lldbsuite/test_event/build_exception.py
===
--- lldb/packages/Python/lldbsuite/test_event/build_exception.py
+++ lldb/packages/Python/lldbsuite/test_event/build_exception.py
@@ -12,4 +12,4 @@
 @staticmethod
 def format_build_error(command, command_output):
 return "Error when building test subject.\n\nBuild Command:\n{}\n\nBuild Command Output:\n{}".format(
-command, command_output.decode("utf-8"))
+command, command_output.decode("utf-8", errors='ignore'))
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -52,6 +52,9 @@
 """Returns true if fpath is an executable."""
 if fpath == None:
 return False
+if sys.platform == 'win32':
+if not fpath.endswith(".exe"):
+fpath += ".exe"
 return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
 
 
Index: lldb/packages/Python/lldbsuite/test/decorators.py
===
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -3,6 +3,8 @@
 # System modules
 from distutils.version import LooseVersion
 from functools import wraps
+import ctypes
+import locale
 import os
 import platform
 import re
@@ -592,6 +594,17 @@
 """Decorate the item to skip tests that should be skipped on Windows."""
 return skipIfPlatform(["windows"])(func)
 
+def skipIfWindowsAndNonEnglish(func):
+"""Decorate the item to skip tests that should be skipped on non-English locales on Windows."""
+def is_Windows_NonEnglish(self):
+if lldbplatformutil.getPlatform() != "windows":
+return None
+kernel = ctypes.windll.kernel32
+if locale.windows_locale[ 

[Lldb-commits] [PATCH] D88975: [LLDB] On Windows, fix tests

2020-10-07 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

In D88975#2317566 , @labath wrote:

> I really want to avoid having language specific strings in the tests.

We all agree on that. I'll update the patch once it passes all tests on my 
machines.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88975/new/

https://reviews.llvm.org/D88975

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D88975: [LLDB] On Windows, fix tests

2020-10-07 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

In D88975#2317494 , @amccarth wrote:

> Maybe dotest.py could change its own Windows locale setting and the processes 
> it spawns would inherit that.  I don't know if that would work, but I don't 
> see a good alternative.

One problem is that some users might //not// have the English language pack 
installed. I only have `fr-CA` and `en-CA` installed but not `en-US`. There's 
absolutely no guarantee that there will be a `en-XX` package available. I'll do 
some more testing and upload a new diff, but I took a defensive approach, like 
for `StatusTest.cpp`, where the two tests below in `TestTargetCommand.py` would 
only run if `en-US` is the current locale. Maybe afterwards, in a subsequent 
patch, we could add more code to temporarily switch to `en-US` locale if it's 
available?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88975/new/

https://reviews.llvm.org/D88975

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D88975: [LLDB] On Windows, fix tests

2020-10-07 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea created this revision.
aganea added reviewers: amccarth, labath.
Herald added a reviewer: JDevlieghere.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
aganea requested review of this revision.

This patch fixes a few issues seen when running `ninja check-lldb` in a Release 
build:

- Some binaries couldn't be found (such as lldb-vscode.exe), because `.exe` 
wasn't appended to the file name.
- Many tests used to fail since the OS error messages are not emitted in 
English, because of our installed French locale.
- Also, because of our codepage being Windows-1252, python failed to decode the 
messages.

After this patch, all tests pass with VS2017.
When building with VS2019 or Clang 10, the following tests still //do not 
pass//:

  lldb-api :: python_api/lldbutil/iter/TestLLDBIterator.py
  lldb-shell :: SymbolFile/PDB/enums-layout.test
  lldb-shell :: SymbolFile/PDB/typedefs.test
  lldb-unit :: 
tools/lldb-server/tests/./LLDBServerTests.exe/StandardStartupTest.TestStopReplyContainsThreadPcs

For the first three tests above, this has to do with the debug info not being 
emitted as expected. I'm not sure about the last one.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88975

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test_event/build_exception.py
  lldb/test/API/commands/target/basic/TestTargetCommand.py
  lldb/unittests/Utility/StatusTest.cpp


Index: lldb/unittests/Utility/StatusTest.cpp
===
--- lldb/unittests/Utility/StatusTest.cpp
+++ lldb/unittests/Utility/StatusTest.cpp
@@ -10,7 +10,7 @@
 #include "gtest/gtest.h"
 
 #ifdef _WIN32
-#include 
+#include 
 #endif
 
 using namespace lldb_private;
@@ -71,6 +71,14 @@
   EXPECT_FALSE(success.ToError());
   EXPECT_TRUE(success.Success());
 
+  WCHAR name[128]{};
+  GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SNAME, (LPWSTR),
+  sizeof(name) / sizeof(WCHAR));
+  // Skip the following tests on non-English, non-US, locales because the
+  // formatted messages will be different.
+  if (wcscmp(L"en-US", name) != 0)
+return;
+
   auto s = Status(ERROR_ACCESS_DENIED, ErrorType::eErrorTypeWin32);
   EXPECT_TRUE(s.Fail());
   EXPECT_STREQ("Access is denied. ", s.AsCString());
Index: lldb/test/API/commands/target/basic/TestTargetCommand.py
===
--- lldb/test/API/commands/target/basic/TestTargetCommand.py
+++ lldb/test/API/commands/target/basic/TestTargetCommand.py
@@ -353,7 +353,7 @@
 @no_debug_info_test
 def test_target_create_nonexistent_core_file(self):
 self.expect("target create -c doesntexist", error=True,
-patterns=["Cannot open 'doesntexist'", ": (No such file or 
directory|The system cannot find the file specified)"])
+patterns=["Cannot open 'doesntexist'", ": (No such file or 
directory|The system cannot find the file specified|Le fichier 
sp\udce9cifi\udce9 est introuvable)"])
 
 # Write only files don't seem to be supported on Windows.
 @skipIfWindows
@@ -368,7 +368,7 @@
 @no_debug_info_test
 def test_target_create_nonexistent_sym_file(self):
 self.expect("target create -s doesntexist doesntexisteither", 
error=True,
-patterns=["Cannot open '", ": (No such file or 
directory|The system cannot find the file specified)"])
+patterns=["Cannot open '", ": (No such file or 
directory|The system cannot find the file specified|Le fichier 
sp\udce9cifi\udce9 est introuvable)"])
 
 @skipIfWindows
 @no_debug_info_test
Index: lldb/packages/Python/lldbsuite/test_event/build_exception.py
===
--- lldb/packages/Python/lldbsuite/test_event/build_exception.py
+++ lldb/packages/Python/lldbsuite/test_event/build_exception.py
@@ -12,4 +12,4 @@
 @staticmethod
 def format_build_error(command, command_output):
 return "Error when building test subject.\n\nBuild 
Command:\n{}\n\nBuild Command Output:\n{}".format(
-command, command_output.decode("utf-8"))
+command, command_output.decode("utf-8", errors='ignore'))
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -52,6 +52,9 @@
 """Returns true if fpath is an executable."""
 if fpath == None:
 return False
+if sys.platform == 'win32':
+if not fpath.endswith(".exe"):
+fpath += ".exe"
 return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
 
 


Index: lldb/unittests/Utility/StatusTest.cpp
===
--- lldb/unittests/Utility/StatusTest.cpp
+++ lldb/unittests/Utility/StatusTest.cpp
@@ -10,7 

[Lldb-commits] [PATCH] D87765: [llvm][lldb] Add optimal ThreadPool concurrency

2020-09-22 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

@dmantipov Do you have commit access (which I can encourage you ask here 
 if you're 
planning further changes) or should I commit this for you?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87765/new/

https://reviews.llvm.org/D87765

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D87765: [llvm][lldb] Add optimal ThreadPool concurrency

2020-09-17 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea accepted this revision.
aganea added a comment.
This revision is now accepted and ready to land.

Side-note: @dmantipov Could you please use `git diff -U9` when creating 
patches? This allows reviewers to quickly browse through other parts of the 
file(s) in Phabricator. That would fix the "Context not available." message.

The patch looks like a quick win on the short term. A better fix would create 
threads on-the-go as work is being pushed on the queue. An even better fix 
would be a system-wide thread pool for all LLVM apps. But that would require 
more effort, especially on testing & maintenance.

LGTM.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87765/new/

https://reviews.llvm.org/D87765

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D85993: [lldb] Set the access property on member function decls

2020-08-14 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

LGTM.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85993/new/

https://reviews.llvm.org/D85993

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D79447: [Debug][CodeView] Emit fully qualified names for globals

2020-05-15 Thread Alexandre Ganea via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
aganea marked 4 inline comments as done.
Closed by commit rG76c5f277f25e: Re-land [Debug][CodeView] Emit fully qualified 
names for globals (authored by aganea).

Changed prior to commit:
  https://reviews.llvm.org/D79447?vs=263450=264248#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79447/new/

https://reviews.llvm.org/D79447

Files:
  lldb/test/Shell/SymbolFile/PDB/variables.test
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
  llvm/test/DebugInfo/COFF/global-constants.ll
  llvm/test/DebugInfo/COFF/global_visibility.ll
  llvm/test/DebugInfo/COFF/globals.ll
  llvm/test/DebugInfo/COFF/types-array-unsized.ll

Index: llvm/test/DebugInfo/COFF/types-array-unsized.ll
===
--- llvm/test/DebugInfo/COFF/types-array-unsized.ll
+++ llvm/test/DebugInfo/COFF/types-array-unsized.ll
@@ -4,7 +4,7 @@
 ; We should emit two array types: one used to describe the static data member,
 ; and the other used by the S_GDATA32 for the definition.
 
-; C++ source:
+; // Build with: clang-cl a.cpp /c /Z7 /clang:-S /clang:-emit-llvm
 ; struct Foo {
 ;   static const char str[];
 ; };
@@ -12,13 +12,6 @@
 ; Foo f; // FIXME: only needed to force emit 'Foo'
 
 ; CHECK:  CodeViewTypes [
-; CHECK:Array ([[ARRAY_COMPLETE:0x.*]]) {
-; CHECK-NEXT: TypeLeafKind: LF_ARRAY (0x1503)
-; CHECK-NEXT: ElementType: const char ({{.*}})
-; CHECK-NEXT: IndexType: unsigned __int64 (0x23)
-; CHECK-NEXT: SizeOf: 5
-; CHECK-NEXT: Name: 
-; CHECK-NEXT:   }
 ; CHECK:Array ([[ARRAY_FWD:0x.*]]) {
 ; CHECK-NEXT: TypeLeafKind: LF_ARRAY (0x1503)
 ; CHECK-NEXT: ElementType: const char ({{.*}})
@@ -26,7 +19,7 @@
 ; CHECK-NEXT: SizeOf: 0
 ; CHECK-NEXT: Name: 
 ; CHECK-NEXT:   }
-; CHECK:FieldList (0x1004) {
+; CHECK:FieldList (0x1003) {
 ; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
 ; CHECK-NEXT: StaticDataMember {
 ; CHECK-NEXT:   TypeLeafKind: LF_STMEMBER (0x150E)
@@ -35,39 +28,47 @@
 ; CHECK-NEXT:   Name: str
 ; CHECK-NEXT: }
 ; CHECK-NEXT:   }
+; CHECK:Array ([[ARRAY_COMPLETE:0x.*]]) {
+; CHECK-NEXT: TypeLeafKind: LF_ARRAY (0x1503)
+; CHECK-NEXT: ElementType: const char ({{.*}})
+; CHECK-NEXT: IndexType: unsigned __int64 (0x23)
+; CHECK-NEXT: SizeOf: 5
+; CHECK-NEXT: Name: 
+; CHECK-NEXT:   }
 ; CHECK:  ]
 
 ; CHECK:  GlobalData {
 ; CHECK-NEXT:   Kind: S_GDATA32 (0x110D)
 ; CHECK-NEXT:   DataOffset: ?str@Foo@@2QBDB+0x0
 ; CHECK-NEXT:   Type: [[ARRAY_COMPLETE]]
-; CHECK-NEXT:   DisplayName: str
+; CHECK-NEXT:   DisplayName: Foo::str
 ; CHECK-NEXT:   LinkageName: ?str@Foo@@2QBDB
 ; CHECK-NEXT: }
 
-; ModuleID = 't.cpp'
-source_filename = "t.cpp"
-target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-pc-windows-msvc19.0.24215"
+; ModuleID = 'a.cpp'
+source_filename = "a.cpp"
+target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-windows-msvc19.25.28614"
 
 %struct.Foo = type { i8 }
 
-@"\01?str@Foo@@2QBDB" = constant [5 x i8] c"asdf\00", align 1, !dbg !0
-@"\01?f@@3UFoo@@A" = global %struct.Foo zeroinitializer, align 1, !dbg !6
+@"?str@Foo@@2QBDB" = dso_local constant [5 x i8] c"asdf\00", align 1, !dbg !0
+@"?f@@3UFoo@@A" = dso_local global %struct.Foo zeroinitializer, align 1, !dbg !6
 
 !llvm.dbg.cu = !{!2}
-!llvm.module.flags = !{!19, !20, !21, !22}
-!llvm.ident = !{!23}
+!llvm.linker.options = !{!19, !20}
+!llvm.module.flags = !{!21, !22, !23, !24}
+!llvm.ident = !{!25}
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
-!1 = distinct !DIGlobalVariable(name: "str", linkageName: "\01?str@Foo@@2QBDB", scope: !2, file: !3, line: 4, type: !16, isLocal: false, isDefinition: true, declaration: !10)
-!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 6.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
-!3 = !DIFile(filename: "t.cpp", directory: "C:\5Csrc\5Cllvm-project\5Cbuild", checksumkind: CSK_MD5, checksum: "15aa843c5a80301928caf03e71f87a54")
+!1 = distinct !DIGlobalVariable(name: "str", linkageName: "?str@Foo@@2QBDB", scope: !2, file: !3, line: 4, type: !16, isLocal: false, isDefinition: true, declaration: !10)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 11.0.0 (https://github.com/llvm/llvm-project.git 202f144bffd0be254a829924195e1b8ebabcbb79)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)
+!3 = !DIFile(filename: "a.cpp", directory: "F:\\llvm-project\\__test", checksumkind: CSK_MD5, checksum: "c2b2d28fd8aaa040c4141cea420d0648")
 !4 = !{}
 !5 = !{!0, !6}
 

[Lldb-commits] [PATCH] D79447: [Debug][CodeView] Emit fully qualified names for globals

2020-05-12 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea reopened this revision.
aganea added a comment.
This revision is now accepted and ready to land.

Could you please take another look? Thank you in advance!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79447/new/

https://reviews.llvm.org/D79447



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D79447: [Debug][CodeView] Emit fully qualified names for globals

2020-05-12 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea updated this revision to Diff 263450.
aganea added a comment.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Reopening because I had to revert.

- Fix lldb's variables.test
- Fix type lowering, as described here: D79512 
- Added assert in `emitDebugInfoForUDTs` to ensure no lowering can occur during 
UDT emission, as suggested by @rnk


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79447/new/

https://reviews.llvm.org/D79447

Files:
  lldb/test/Shell/SymbolFile/PDB/variables.test
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
  llvm/test/DebugInfo/COFF/global-constants.ll
  llvm/test/DebugInfo/COFF/global_visibility.ll
  llvm/test/DebugInfo/COFF/globals.ll
  llvm/test/DebugInfo/COFF/types-array-unsized.ll

Index: llvm/test/DebugInfo/COFF/types-array-unsized.ll
===
--- llvm/test/DebugInfo/COFF/types-array-unsized.ll
+++ llvm/test/DebugInfo/COFF/types-array-unsized.ll
@@ -4,7 +4,7 @@
 ; We should emit two array types: one used to describe the static data member,
 ; and the other used by the S_GDATA32 for the definition.
 
-; C++ source:
+; // Build with: clang-cl a.cpp /c /Z7 /clang:-S /clang:-emit-llvm
 ; struct Foo {
 ;   static const char str[];
 ; };
@@ -12,13 +12,6 @@
 ; Foo f; // FIXME: only needed to force emit 'Foo'
 
 ; CHECK:  CodeViewTypes [
-; CHECK:Array ([[ARRAY_COMPLETE:0x.*]]) {
-; CHECK-NEXT: TypeLeafKind: LF_ARRAY (0x1503)
-; CHECK-NEXT: ElementType: const char ({{.*}})
-; CHECK-NEXT: IndexType: unsigned __int64 (0x23)
-; CHECK-NEXT: SizeOf: 5
-; CHECK-NEXT: Name: 
-; CHECK-NEXT:   }
 ; CHECK:Array ([[ARRAY_FWD:0x.*]]) {
 ; CHECK-NEXT: TypeLeafKind: LF_ARRAY (0x1503)
 ; CHECK-NEXT: ElementType: const char ({{.*}})
@@ -26,7 +19,7 @@
 ; CHECK-NEXT: SizeOf: 0
 ; CHECK-NEXT: Name: 
 ; CHECK-NEXT:   }
-; CHECK:FieldList (0x1004) {
+; CHECK:FieldList (0x1003) {
 ; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
 ; CHECK-NEXT: StaticDataMember {
 ; CHECK-NEXT:   TypeLeafKind: LF_STMEMBER (0x150E)
@@ -35,39 +28,47 @@
 ; CHECK-NEXT:   Name: str
 ; CHECK-NEXT: }
 ; CHECK-NEXT:   }
+; CHECK:Array ([[ARRAY_COMPLETE:0x.*]]) {
+; CHECK-NEXT: TypeLeafKind: LF_ARRAY (0x1503)
+; CHECK-NEXT: ElementType: const char ({{.*}})
+; CHECK-NEXT: IndexType: unsigned __int64 (0x23)
+; CHECK-NEXT: SizeOf: 5
+; CHECK-NEXT: Name: 
+; CHECK-NEXT:   }
 ; CHECK:  ]
 
 ; CHECK:  GlobalData {
 ; CHECK-NEXT:   Kind: S_GDATA32 (0x110D)
 ; CHECK-NEXT:   DataOffset: ?str@Foo@@2QBDB+0x0
 ; CHECK-NEXT:   Type: [[ARRAY_COMPLETE]]
-; CHECK-NEXT:   DisplayName: str
+; CHECK-NEXT:   DisplayName: Foo::str
 ; CHECK-NEXT:   LinkageName: ?str@Foo@@2QBDB
 ; CHECK-NEXT: }
 
-; ModuleID = 't.cpp'
-source_filename = "t.cpp"
-target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-pc-windows-msvc19.0.24215"
+; ModuleID = 'a.cpp'
+source_filename = "a.cpp"
+target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-windows-msvc19.25.28614"
 
 %struct.Foo = type { i8 }
 
-@"\01?str@Foo@@2QBDB" = constant [5 x i8] c"asdf\00", align 1, !dbg !0
-@"\01?f@@3UFoo@@A" = global %struct.Foo zeroinitializer, align 1, !dbg !6
+@"?str@Foo@@2QBDB" = dso_local constant [5 x i8] c"asdf\00", align 1, !dbg !0
+@"?f@@3UFoo@@A" = dso_local global %struct.Foo zeroinitializer, align 1, !dbg !6
 
 !llvm.dbg.cu = !{!2}
-!llvm.module.flags = !{!19, !20, !21, !22}
-!llvm.ident = !{!23}
+!llvm.linker.options = !{!19, !20}
+!llvm.module.flags = !{!21, !22, !23, !24}
+!llvm.ident = !{!25}
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
-!1 = distinct !DIGlobalVariable(name: "str", linkageName: "\01?str@Foo@@2QBDB", scope: !2, file: !3, line: 4, type: !16, isLocal: false, isDefinition: true, declaration: !10)
-!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 6.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
-!3 = !DIFile(filename: "t.cpp", directory: "C:\5Csrc\5Cllvm-project\5Cbuild", checksumkind: CSK_MD5, checksum: "15aa843c5a80301928caf03e71f87a54")
+!1 = distinct !DIGlobalVariable(name: "str", linkageName: "?str@Foo@@2QBDB", scope: !2, file: !3, line: 4, type: !16, isLocal: false, isDefinition: true, declaration: !10)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 11.0.0 (https://github.com/llvm/llvm-project.git 202f144bffd0be254a829924195e1b8ebabcbb79)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)
+!3 = !DIFile(filename: "a.cpp", directory: "F:\\llvm-project\\__test", 

[Lldb-commits] [PATCH] D70277: [Signal] Allow llvm clients to opt into one-shot SIGPIPE handling

2019-12-04 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added inline comments.



Comment at: llvm/lib/Support/Unix/Signals.inc:369
 
-  // Send a special return code that drivers can check for, from 
sysexits.h.
   if (Sig == SIGPIPE)
+if (auto OldOneShotPipeFunction =

@vsk Question question: `SIGPIPE` isn't in the `IntSigs` array anymore (you've 
removed it at L209), so the above `std::find` will fail when `Sig == SIGPIPE` 
and this code will never be executed. Most likely this isn't the intended 
behavior, or I am missing something?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70277/new/

https://reviews.llvm.org/D70277



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D70830: [LLDB] Disable MSVC warning C4190

2019-12-03 Thread Alexandre Ganea via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1cc0ba4cbdc5: [LLDB] Disable MSVC warning C4190: 
LLDBSwigPythonBreakpointCallbackFunction… (authored by aganea).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70830/new/

https://reviews.llvm.org/D70830

Files:
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp


Index: lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
===
--- lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
+++ lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
@@ -62,6 +62,14 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
 
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
 extern "C" llvm::Expected LLDBSwigPythonBreakpointCallbackFunction(
 const char *python_function_name, const char *session_dictionary_name,
 const lldb::StackFrameSP _frame,
@@ -70,6 +78,10 @@
   return false;
 }
 
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
 #pragma clang diagnostic pop
 
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(
Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -77,11 +77,23 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
 
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
 extern "C" llvm::Expected LLDBSwigPythonBreakpointCallbackFunction(
 const char *python_function_name, const char *session_dictionary_name,
 const lldb::StackFrameSP _frame,
 const lldb::BreakpointLocationSP _bp_loc, StructuredDataImpl 
*args_impl);
 
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
 #pragma clang diagnostic pop
 
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(


Index: lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
===
--- lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
+++ lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
@@ -62,6 +62,14 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
 
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
 extern "C" llvm::Expected LLDBSwigPythonBreakpointCallbackFunction(
 const char *python_function_name, const char *session_dictionary_name,
 const lldb::StackFrameSP _frame,
@@ -70,6 +78,10 @@
   return false;
 }
 
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
 #pragma clang diagnostic pop
 
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(
Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -77,11 +77,23 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
 
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
 extern "C" llvm::Expected LLDBSwigPythonBreakpointCallbackFunction(
 const char *python_function_name, const char *session_dictionary_name,
 const lldb::StackFrameSP _frame,
 const lldb::BreakpointLocationSP _bp_loc, StructuredDataImpl *args_impl);
 
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
 #pragma clang diagnostic pop
 
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D70442: [LLDB] Force message formatting to English

2019-11-28 Thread Alexandre Ganea via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbdad3ec75ab3: [LLDB] On Windows, force error message 
formatting to English (authored by aganea).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70442/new/

https://reviews.llvm.org/D70442

Files:
  lldb/source/Utility/Status.cpp


Index: lldb/source/Utility/Status.cpp
===
--- lldb/source/Utility/Status.cpp
+++ lldb/source/Utility/Status.cpp
@@ -100,14 +100,23 @@
   char *buffer = nullptr;
   std::string message;
   // Retrieve win32 system error.
+  // First, attempt to load a en-US message
   if (::FormatMessageA(
   FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
   FORMAT_MESSAGE_MAX_WIDTH_MASK,
-  NULL, error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+  NULL, error_code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
   (LPSTR), 0, NULL)) {
 message.assign(buffer);
 ::LocalFree(buffer);
   }
+  // If the previous didn't work, use the default OS language
+  else if (::FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+FORMAT_MESSAGE_FROM_SYSTEM |
+FORMAT_MESSAGE_MAX_WIDTH_MASK,
+NULL, error_code, 0, (LPSTR), 0, NULL)) {
+message.assign(buffer);
+::LocalFree(buffer);
+  }
   return message;
 }
 #endif


Index: lldb/source/Utility/Status.cpp
===
--- lldb/source/Utility/Status.cpp
+++ lldb/source/Utility/Status.cpp
@@ -100,14 +100,23 @@
   char *buffer = nullptr;
   std::string message;
   // Retrieve win32 system error.
+  // First, attempt to load a en-US message
   if (::FormatMessageA(
   FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
   FORMAT_MESSAGE_MAX_WIDTH_MASK,
-  NULL, error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+  NULL, error_code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
   (LPSTR), 0, NULL)) {
 message.assign(buffer);
 ::LocalFree(buffer);
   }
+  // If the previous didn't work, use the default OS language
+  else if (::FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+FORMAT_MESSAGE_FROM_SYSTEM |
+FORMAT_MESSAGE_MAX_WIDTH_MASK,
+NULL, error_code, 0, (LPSTR), 0, NULL)) {
+message.assign(buffer);
+::LocalFree(buffer);
+  }
   return message;
 }
 #endif
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D70830: [LLDB] Disable MSVC warning C4190

2019-11-28 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea updated this revision to Diff 231455.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70830/new/

https://reviews.llvm.org/D70830

Files:
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp


Index: lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
===
--- lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
+++ lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
@@ -62,6 +62,14 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
 
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
 extern "C" llvm::Expected LLDBSwigPythonBreakpointCallbackFunction(
 const char *python_function_name, const char *session_dictionary_name,
 const lldb::StackFrameSP _frame,
@@ -70,6 +78,10 @@
   return false;
 }
 
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
 #pragma clang diagnostic pop
 
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(
Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -77,11 +77,23 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
 
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
 extern "C" llvm::Expected LLDBSwigPythonBreakpointCallbackFunction(
 const char *python_function_name, const char *session_dictionary_name,
 const lldb::StackFrameSP _frame,
 const lldb::BreakpointLocationSP _bp_loc, StructuredDataImpl 
*args_impl);
 
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
 #pragma clang diagnostic pop
 
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(


Index: lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
===
--- lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
+++ lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
@@ -62,6 +62,14 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
 
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
 extern "C" llvm::Expected LLDBSwigPythonBreakpointCallbackFunction(
 const char *python_function_name, const char *session_dictionary_name,
 const lldb::StackFrameSP _frame,
@@ -70,6 +78,10 @@
   return false;
 }
 
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
 #pragma clang diagnostic pop
 
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(
Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -77,11 +77,23 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
 
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
 extern "C" llvm::Expected LLDBSwigPythonBreakpointCallbackFunction(
 const char *python_function_name, const char *session_dictionary_name,
 const lldb::StackFrameSP _frame,
 const lldb::BreakpointLocationSP _bp_loc, StructuredDataImpl *args_impl);
 
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
 #pragma clang diagnostic pop
 
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D70448: [LLDB] Fix wrong argument in CommandObjectThreadStepWithTypeAndScope

2019-11-28 Thread Alexandre Ganea via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb4dfc5508f92: [LLDB] Fix wrong argument in 
CommandObjectThreadStepWithTypeAndScope (authored by aganea).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70448/new/

https://reviews.llvm.org/D70448

Files:
  lldb/source/Commands/CommandObjectThread.cpp


Index: lldb/source/Commands/CommandObjectThread.cpp
===
--- lldb/source/Commands/CommandObjectThread.cpp
+++ lldb/source/Commands/CommandObjectThread.cpp
@@ -526,7 +526,7 @@
 eCommandProcessMustBeLaunched |
 eCommandProcessMustBePaused),
 m_step_type(step_type), m_step_scope(step_scope), m_options(),
-m_class_options("scripted step", 'C') {
+m_class_options("scripted step") {
 CommandArgumentEntry arg;
 CommandArgumentData thread_id_arg;
 


Index: lldb/source/Commands/CommandObjectThread.cpp
===
--- lldb/source/Commands/CommandObjectThread.cpp
+++ lldb/source/Commands/CommandObjectThread.cpp
@@ -526,7 +526,7 @@
 eCommandProcessMustBeLaunched |
 eCommandProcessMustBePaused),
 m_step_type(step_type), m_step_scope(step_scope), m_options(),
-m_class_options("scripted step", 'C') {
+m_class_options("scripted step") {
 CommandArgumentEntry arg;
 CommandArgumentData thread_id_arg;
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D70830: [LLDB] Disable MSVC warning C4190

2019-11-28 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea created this revision.
aganea added reviewers: JDevlieghere, lawrence_danna.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Before this patch, when compiling with MSVC 15.9.17 (latest), we would see:

  
F:\llvm-project\lldb\source\Plugins\ScriptInterpreter\Python\ScriptInterpreterPython.cpp(83):
 warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has C-linkage 
specified, but returns UDT 'llvm::Expected' which is incompatible with C


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70830

Files:
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp


Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -77,11 +77,23 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
 
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
 extern "C" llvm::Expected LLDBSwigPythonBreakpointCallbackFunction(
 const char *python_function_name, const char *session_dictionary_name,
 const lldb::StackFrameSP _frame,
 const lldb::BreakpointLocationSP _bp_loc, StructuredDataImpl 
*args_impl);
 
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
 #pragma clang diagnostic pop
 
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(


Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -77,11 +77,23 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
 
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
 extern "C" llvm::Expected LLDBSwigPythonBreakpointCallbackFunction(
 const char *python_function_name, const char *session_dictionary_name,
 const lldb::StackFrameSP _frame,
 const lldb::BreakpointLocationSP _bp_loc, StructuredDataImpl *args_impl);
 
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
 #pragma clang diagnostic pop
 
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D70448: [LLDB] Fix wrong argument in CommandObjectThreadStepWithTypeAndScope

2019-11-21 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added a comment.

This is a trivial change, unless you have any objections, I'll go forward with 
this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70448/new/

https://reviews.llvm.org/D70448



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D70448: [LLDB] Fix wrong argument in CommandObjectThreadStepWithTypeAndScope

2019-11-19 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea updated this revision to Diff 230097.
aganea marked an inline comment as done.
aganea added a comment.

Omit default arguments.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70448/new/

https://reviews.llvm.org/D70448

Files:
  lldb/source/Commands/CommandObjectThread.cpp


Index: lldb/source/Commands/CommandObjectThread.cpp
===
--- lldb/source/Commands/CommandObjectThread.cpp
+++ lldb/source/Commands/CommandObjectThread.cpp
@@ -526,7 +526,7 @@
 eCommandProcessMustBeLaunched |
 eCommandProcessMustBePaused),
 m_step_type(step_type), m_step_scope(step_scope), m_options(),
-m_class_options("scripted step", 'C') {
+m_class_options("scripted step") {
 CommandArgumentEntry arg;
 CommandArgumentData thread_id_arg;
 


Index: lldb/source/Commands/CommandObjectThread.cpp
===
--- lldb/source/Commands/CommandObjectThread.cpp
+++ lldb/source/Commands/CommandObjectThread.cpp
@@ -526,7 +526,7 @@
 eCommandProcessMustBeLaunched |
 eCommandProcessMustBePaused),
 m_step_type(step_type), m_step_scope(step_scope), m_options(),
-m_class_options("scripted step", 'C') {
+m_class_options("scripted step") {
 CommandArgumentEntry arg;
 CommandArgumentData thread_id_arg;
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D70448: [LLDB] Fix wrong argument in CommandObjectThreadStepWithTypeAndScope

2019-11-19 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea created this revision.
aganea added a reviewer: jingham.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This fixes a warning on MSVC:

  F:\llvm-project\lldb\source\Commands\CommandObjectThread.cpp(529): warning 
C4305: 'argument': truncation from 'char' to 'bool'

Previously, `'C'` was passed into the wrong parameter, as `is_class` was 
introduced in D68671 :

  OptionGroupPythonClassWithDict(const char *class_use,
 bool is_class = true,
 int class_option = 'C',


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70448

Files:
  lldb/source/Commands/CommandObjectThread.cpp


Index: lldb/source/Commands/CommandObjectThread.cpp
===
--- lldb/source/Commands/CommandObjectThread.cpp
+++ lldb/source/Commands/CommandObjectThread.cpp
@@ -526,7 +526,7 @@
 eCommandProcessMustBeLaunched |
 eCommandProcessMustBePaused),
 m_step_type(step_type), m_step_scope(step_scope), m_options(),
-m_class_options("scripted step", 'C') {
+m_class_options("scripted step", true, 'C') {
 CommandArgumentEntry arg;
 CommandArgumentData thread_id_arg;
 


Index: lldb/source/Commands/CommandObjectThread.cpp
===
--- lldb/source/Commands/CommandObjectThread.cpp
+++ lldb/source/Commands/CommandObjectThread.cpp
@@ -526,7 +526,7 @@
 eCommandProcessMustBeLaunched |
 eCommandProcessMustBePaused),
 m_step_type(step_type), m_step_scope(step_scope), m_options(),
-m_class_options("scripted step", 'C') {
+m_class_options("scripted step", true, 'C') {
 CommandArgumentEntry arg;
 CommandArgumentData thread_id_arg;
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D70442: [LLDB] Force message formatting to English

2019-11-19 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea created this revision.
aganea added reviewers: asmith, aleksandr.urakov.
aganea added a project: LLDB.
Herald added a subscriber: lldb-commits.

This is a follow-up on D53092 , and fixes the 
test below on non-English locales (below, on a French locale):

  [ RUN  ] StatusTest.ErrorWin32
  F:\llvm-project\lldb\unittests\Utility\StatusTest.cpp(67): error:   
Expected: "Access is denied. "
  To be equal to: s.AsCString()
Which is: "Acc\xE8s refus\xE9. "
  F:\llvm-project\lldb\unittests\Utility\StatusTest.cpp(70): error:   
Expected: "Negotiation timed out "
  To be equal to: s.AsCString()
Which is: "Le d\xE9lai d\x92" "attente a expir\xE9 pour la 
n\xE9gociation "
  [  FAILED  ] StatusTest.ErrorWin32 (2 ms)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70442

Files:
  lldb/source/Utility/Status.cpp


Index: lldb/source/Utility/Status.cpp
===
--- lldb/source/Utility/Status.cpp
+++ lldb/source/Utility/Status.cpp
@@ -100,14 +100,23 @@
   char *buffer = nullptr;
   std::string message;
   // Retrieve win32 system error.
+  // First, attempt to load a en-US message
   if (::FormatMessageA(
   FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
   FORMAT_MESSAGE_MAX_WIDTH_MASK,
-  NULL, error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+  NULL, error_code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
   (LPSTR), 0, NULL)) {
 message.assign(buffer);
 ::LocalFree(buffer);
   }
+  // If the previous didn't work, use the default OS language
+  else if (::FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+FORMAT_MESSAGE_FROM_SYSTEM |
+FORMAT_MESSAGE_MAX_WIDTH_MASK,
+NULL, error_code, 0, (LPSTR), 0, NULL)) {
+message.assign(buffer);
+::LocalFree(buffer);
+  }
   return message;
 }
 #endif


Index: lldb/source/Utility/Status.cpp
===
--- lldb/source/Utility/Status.cpp
+++ lldb/source/Utility/Status.cpp
@@ -100,14 +100,23 @@
   char *buffer = nullptr;
   std::string message;
   // Retrieve win32 system error.
+  // First, attempt to load a en-US message
   if (::FormatMessageA(
   FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
   FORMAT_MESSAGE_MAX_WIDTH_MASK,
-  NULL, error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+  NULL, error_code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
   (LPSTR), 0, NULL)) {
 message.assign(buffer);
 ::LocalFree(buffer);
   }
+  // If the previous didn't work, use the default OS language
+  else if (::FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+FORMAT_MESSAGE_FROM_SYSTEM |
+FORMAT_MESSAGE_MAX_WIDTH_MASK,
+NULL, error_code, 0, (LPSTR), 0, NULL)) {
+message.assign(buffer);
+::LocalFree(buffer);
+  }
   return message;
 }
 #endif
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D62785: Fix compilation following r362280

2019-06-02 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea abandoned this revision.
aganea added a comment.

Will be fixed by D62772 


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62785/new/

https://reviews.llvm.org/D62785



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D62772: [COFF, ARM64] Fix CodeView API change for getRegisterNames

2019-06-02 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added inline comments.



Comment at: 
source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp:29
+  llvm::codeview::CPUType cpu_type;
+  if (arch_type == llvm::Triple::ArchType::aarch64) {
+cpu_type = llvm::codeview::CPUType::ARM64;

Shouldn’t ArchType::aarch64_be and ArchType::aarch64_32 enums be handled here 
as well?



Comment at: 
source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp:32
+  } else {
+cpu_type = llvm::codeview::CPUType::X64;
+  }

Intel80386 for consistency?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62772/new/

https://reviews.llvm.org/D62772



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D62785: Fix compilation following r362280

2019-06-01 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea created this revision.
aganea added reviewers: TomTan, labath, tstellar.
aganea added a project: LLDB.
aganea edited reviewers, added: stella.stamenova; removed: tstellar.

Repository:
  rLLDB LLDB

https://reviews.llvm.org/D62785

Files:
  source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp


Index: source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
===
--- source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
+++ source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
@@ -23,10 +23,16 @@
 using namespace lldb_private;
 using namespace lldb_private::postfix;
 
-static uint32_t ResolveLLDBRegisterNum(llvm::StringRef reg_name, 
llvm::Triple::ArchType arch_type) {
+static uint32_t ResolveLLDBRegisterNum(llvm::StringRef reg_name,
+   llvm::Triple::ArchType arch_type) {
+  bool isARM64 = arch_type == llvm::Triple::aarch64 ||
+ arch_type == llvm::Triple::aarch64_32 ||
+ arch_type == llvm::Triple::aarch64_be;
   // lookup register name to get lldb register number
   llvm::ArrayRef> register_names =
-  llvm::codeview::getRegisterNames();
+  llvm::codeview::getRegisterNames(
+  isARM64 ? llvm::codeview::CPUType::ARM64
+  : llvm::codeview::CPUType::Intel8086);
   auto it = llvm::find_if(
   register_names,
   [_name](const llvm::EnumEntry _entry) {


Index: source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
===
--- source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
+++ source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
@@ -23,10 +23,16 @@
 using namespace lldb_private;
 using namespace lldb_private::postfix;
 
-static uint32_t ResolveLLDBRegisterNum(llvm::StringRef reg_name, llvm::Triple::ArchType arch_type) {
+static uint32_t ResolveLLDBRegisterNum(llvm::StringRef reg_name,
+   llvm::Triple::ArchType arch_type) {
+  bool isARM64 = arch_type == llvm::Triple::aarch64 ||
+ arch_type == llvm::Triple::aarch64_32 ||
+ arch_type == llvm::Triple::aarch64_be;
   // lookup register name to get lldb register number
   llvm::ArrayRef> register_names =
-  llvm::codeview::getRegisterNames();
+  llvm::codeview::getRegisterNames(
+  isARM64 ? llvm::codeview::CPUType::ARM64
+  : llvm::codeview::CPUType::Intel8086);
   auto it = llvm::find_if(
   register_names,
   [_name](const llvm::EnumEntry _entry) {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D62021: Fix LLDB warnings when compiling with Clang 8.0

2019-05-21 Thread Alexandre Ganea via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
aganea marked an inline comment as done.
Closed by commit rL361295: Fix LLDB warnings when compiling with Clang 8.0 
(authored by aganea, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D62021?vs=199867=200569#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62021/new/

https://reviews.llvm.org/D62021

Files:
  lldb/trunk/source/Host/common/GetOptInc.cpp
  lldb/trunk/source/Host/common/MainLoop.cpp
  lldb/trunk/source/Host/common/Socket.cpp
  lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp
  lldb/trunk/source/Host/windows/Windows.cpp
  lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
  lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
  
lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp

Index: lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
===
--- lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
+++ lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
@@ -66,92 +66,128 @@
  {dwarf_rax_x86_64, dwarf_rax_x86_64, LLDB_INVALID_REGNUM,
   LLDB_INVALID_REGNUM, lldb_rax_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(rbx, nullptr),
  {dwarf_rbx_x86_64, dwarf_rbx_x86_64, LLDB_INVALID_REGNUM,
   LLDB_INVALID_REGNUM, lldb_rbx_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(rcx, nullptr),
  {dwarf_rcx_x86_64, dwarf_rcx_x86_64, LLDB_REGNUM_GENERIC_ARG1,
   LLDB_INVALID_REGNUM, lldb_rcx_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(rdx, nullptr),
  {dwarf_rdx_x86_64, dwarf_rdx_x86_64, LLDB_REGNUM_GENERIC_ARG2,
   LLDB_INVALID_REGNUM, lldb_rdx_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(rdi, nullptr),
  {dwarf_rdi_x86_64, dwarf_rdi_x86_64, LLDB_INVALID_REGNUM,
   LLDB_INVALID_REGNUM, lldb_rdi_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(rsi, nullptr),
  {dwarf_rsi_x86_64, dwarf_rsi_x86_64, LLDB_INVALID_REGNUM,
   LLDB_INVALID_REGNUM, lldb_rsi_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(rbp, "fp"),
  {dwarf_rbp_x86_64, dwarf_rbp_x86_64, LLDB_REGNUM_GENERIC_FP,
   LLDB_INVALID_REGNUM, lldb_rbp_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(rsp, "sp"),
  {dwarf_rsp_x86_64, dwarf_rsp_x86_64, LLDB_REGNUM_GENERIC_SP,
   LLDB_INVALID_REGNUM, lldb_rsp_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(r8, nullptr),
  {dwarf_r8_x86_64, dwarf_r8_x86_64, LLDB_REGNUM_GENERIC_ARG3,
   LLDB_INVALID_REGNUM, lldb_r8_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(r9, nullptr),
  {dwarf_r9_x86_64, dwarf_r9_x86_64, LLDB_REGNUM_GENERIC_ARG4,
   LLDB_INVALID_REGNUM, lldb_r9_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(r10, nullptr),
  {dwarf_r10_x86_64, dwarf_r10_x86_64, LLDB_REGNUM_GENERIC_ARG5,
   LLDB_INVALID_REGNUM, lldb_r10_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(r11, nullptr),
  {dwarf_r11_x86_64, dwarf_r11_x86_64, LLDB_REGNUM_GENERIC_ARG6,
   LLDB_INVALID_REGNUM, lldb_r11_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(r12, nullptr),
  {dwarf_r12_x86_64, dwarf_r12_x86_64, LLDB_INVALID_REGNUM,
   LLDB_INVALID_REGNUM, lldb_r12_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(r13, nullptr),
  {dwarf_r13_x86_64, dwarf_r13_x86_64, LLDB_INVALID_REGNUM,
   LLDB_INVALID_REGNUM, lldb_r13_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(r14, nullptr),
  {dwarf_r14_x86_64, dwarf_r14_x86_64, LLDB_INVALID_REGNUM,
   LLDB_INVALID_REGNUM, lldb_r14_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(r15, nullptr),
  {dwarf_r15_x86_64, dwarf_r15_x86_64, LLDB_INVALID_REGNUM,
   LLDB_INVALID_REGNUM, lldb_r15_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR(rip, "pc"),
  {dwarf_rip_x86_64, dwarf_rip_x86_64, LLDB_REGNUM_GENERIC_PC,
   LLDB_INVALID_REGNUM, lldb_rip_x86_64},
  nullptr,
- nullptr},
+ nullptr,
+ nullptr,
+ 0},
 {DEFINE_GPR_BIN(eflags, "flags"),
  

[Lldb-commits] [PATCH] D62021: Fix LLDB warnings when compiling with Clang 8.0

2019-05-17 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea marked 2 inline comments as done.
aganea added inline comments.



Comment at: source/Host/windows/ProcessLauncherWindows.cpp:35-37
+  reinterpret_cast(const_cast(warg.c_str())),
+  reinterpret_cast(
+  const_cast(warg.c_str() + warg.size() + 1)));

labath wrote:
> I don't believe the const_cast here is needed. You should be able to just 
> reinterpret_cast to `const char *`..
You're right - fixed.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62021/new/

https://reviews.llvm.org/D62021



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D62021: Fix LLDB warnings when compiling with Clang 8.0

2019-05-16 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea created this revision.
aganea added reviewers: JDevlieghere, aleksandr.urakov, asmith, mgorny.
aganea added a project: LLDB.
Herald added subscribers: lldb-commits, abidh, aprantl.

Ditto. Please see warnings list:

  [2660/3259] Building CXX object 
tools\lldb\source\Host\CMakeFiles\lldbHost.dir\common\GetOptInc.cpp.obj
  F:\svn\lldb\source\Host\common\GetOptInc.cpp(100,17): warning: cast from 
'char *const *' to 'char **' drops const qualifier [-Wcast-qual]
((char **)nargv)[pos] = nargv[cstart];
  ^
  F:\svn\lldb\source\Host\common\GetOptInc.cpp(102,17): warning: cast from 
'char *const *' to 'char **' drops const qualifier [-Wcast-qual]
((char **)nargv)[cstart] = swap;
  ^
  2 warnings generated.
  [2677/3259] Building CXX object 
tools\lldb\source\Host\CMakeFiles\lldbHost.dir\common\MainLoop.cpp.obj
  F:\svn\lldb\source\Host\common\MainLoop.cpp(64,13): warning: unused function 
'SignalHandler' [-Wunused-function]
  static void SignalHandler(int signo, siginfo_t *info, void *) {
  ^
  1 warning generated.
  [2694/3259] Building CXX object 
tools\lldb\source\Host\CMakeFiles\lldbHost.dir\common\Socket.cpp.obj
  F:\svn\lldb\source\Host\common\Socket.cpp(398,17): warning: format specifies 
type 'int' but the argument has type 'lldb_private::NativeSocket' (aka 
'unsigned long long') [-Wformat]
  m_socket);
  ^~~~
  1 warning generated.
  [2704/3259] Building CXX object 
tools\lldb\source\Host\CMakeFiles\lldbHost.dir\windows\Windows.cpp.obj
  F:\svn\lldb\source\Host\windows\Windows.cpp(87,19): warning: cast from 'const 
char *' to 'char *' drops const qualifier [-Wcast-qual]
return ((char *)s);
^
  1 warning generated.
  [2706/3259] Building CXX object 
tools\lldb\source\Host\CMakeFiles\lldbHost.dir\windows\ProcessLauncherWindows.cpp.obj
  F:\svn\lldb\source\Host\windows\ProcessLauncherWindows.cpp(33,43): warning: 
cast from 'const wchar_t *' to 'char *' drops const qualifier [-Wcast-qual]
buffer.insert(buffer.end(), (char *)warg.c_str(),
^
  F:\svn\lldb\source\Host\windows\ProcessLauncherWindows.cpp(34,29): warning: 
cast from 'const wchar_t *' to 'char *' drops const qualifier [-Wcast-qual]
  (char *)(warg.c_str() + warg.size() + 1));
  ^
  2 warnings generated.
  [2944/3259] Building CXX object 
tools\lldb\source\Plugins\Process\Windows\Common...eFiles\lldbPluginProcessWindowsCommon.dir\x64\RegisterContextWindows_x64.cpp.obj
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(69,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
   nullptr},
  ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(74,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
   nullptr},
  ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(79,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
   nullptr},
  ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(84,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
   nullptr},
  ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(89,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
   nullptr},
  ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(94,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
   nullptr},
  ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(99,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
   nullptr},
  ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(104,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
   nullptr},
  ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(109,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
   nullptr},
  ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(114,13):
 warning: missing field 'dynamic_size_dwarf_expr_bytes' initializer 
[-Wmissing-field-initializers]
   nullptr},
  ^
  
F:\svn\lldb\source\Plugins\Process\Windows\Common\x64\RegisterContextWindows_x64.cpp(119,13):
 warning: 

[Lldb-commits] [PATCH] D60018: [codeview] Remove Type member from CVRecord

2019-04-02 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea accepted this revision.
aganea added a comment.
This revision is now accepted and ready to land.

LGTM. With a few minor comments:




Comment at: llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h:122
   ~FieldListDeserializer() override {
-CVType FieldList;
-FieldList.Type = TypeLeafKind::LF_FIELDLIST;
+RecordPrefix Pre;
+Pre.RecordLen = 2;

`RecordPrefix Pre(TypeLeafKind::LF_FIELDLIST);` like the other places? And 
above.



Comment at: llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp:40
+  static CVSymbol Tombstone(
+  ArrayRef(DenseMapInfo::getTombstoneKey(), 1));
   return Tombstone;

rnk wrote:
> aganea wrote:
> > I suppose you've chosen 1 because that's a invalid record size? Comment 
> > maybe?
> Actually, the reason I did this was to avoid ambiguity between the `T* begin, 
> T* end` ctor and the `T* base, size_t count` ctor. If I use zero, it's 
> ambiguous. Implicit null strikes again. :)
Oh I see. Why not `static CVSymbol 
Tombstone(DenseMapInfo>::getTombstoneKey());` then?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60018/new/

https://reviews.llvm.org/D60018



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D60018: [codeview] Remove Type member from CVRecord

2019-04-01 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea marked an inline comment as done.
aganea added inline comments.



Comment at: llvm/include/llvm/DebugInfo/CodeView/CVRecord.h:29
+/// Carrying the size separately instead of trusting the size stored in the
+/// record prefix provides some extra safety and flexibility.
 template  class CVRecord {

aganea wrote:
> To add to what you said in a comment above, do you think that if we could add 
> `assert(Data.size() == ((RecordPrefix *)RecordData.data())->RecordPrefix + 
> 2)` at relevant places below; and then after a while we could simply switch 
> to `RecordPrefix *`, once issues are ironed out?
I didn't mean now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60018/new/

https://reviews.llvm.org/D60018



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D60018: [codeview] Remove Type member from CVRecord

2019-04-01 Thread Alexandre Ganea via Phabricator via lldb-commits
aganea added inline comments.



Comment at: llvm/include/llvm/DebugInfo/CodeView/CVRecord.h:29
+/// Carrying the size separately instead of trusting the size stored in the
+/// record prefix provides some extra safety and flexibility.
 template  class CVRecord {

To add to what you said in a comment above, do you think that if we could add 
`assert(Data.size() == ((RecordPrefix *)RecordData.data())->RecordPrefix + 2)` 
at relevant places below; and then after a while we could simply switch to 
`RecordPrefix *`, once issues are ironed out?



Comment at: llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h:56
+RecordPrefix *Prefix = reinterpret_cast([0]);
+Prefix->RecordLen = 0;
+Prefix->RecordKind = uint16_t(Sym.Kind);

rnk wrote:
> aganea wrote:
> > Should be 2.
> I could say 2, but this is the seralizer, so really it just gets overwritten. 
> Do you think I should leave it uninitialized, 2, -1, 0?
I'd say "2" because you want as much as possible to keep data coherent in time. 
Regardless of what comes after. I think the code should be correct before being 
optimal. If someone looks for `RecordPrefix` and then tries to understand how 
it works, it'd be nice if the code displays the same, correct, behavior 
everywhere.

But then, you can argue that `RecordPrefix.RecordLen` is simply a constrait, 
tied to the amount data that comes after. And maybe the calculation logic for 
that `.RecordLen` field should be hidden inside the `RecordPrefix` class. In 
that case, to avoid screwing the init order, ideally you could simply say:
```
RecordPrefix Prefix{uint16_t(Sym.Kind)};
CVSymbol Result();
```
...and let `RecordPrefix` (or `CVSymbol`) handle sizing?



Comment at: llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h:125
+Pre.RecordKind = uint16_t(TypeLeafKind::LF_FIELDLIST);
+CVType FieldList(, sizeof(Pre));
 consumeError(Mapping.Mapping.visitTypeEnd(FieldList));

Applying what I said above would give:
```
RecordPrefix Pre{uint16_t(TypeLeafKind::LF_FIELDLIST)};
CVType FieldList();
```



Comment at: llvm/lib/DebugInfo/CodeView/SimpleTypeSerializer.cpp:37
 
+  CVType CVT(ArrayRef(ScratchBuffer.data(), sizeof(RecordPrefix)));
   cantFail(Mapping.visitTypeBegin(CVT));

Here it is the same thing: `writeRecordPrefix()` writes a `.RecordLen = 0`, but 
it could very well write 2 to be coherent, then you would be able to //trust// 
the `RecordPrefix *`.



Comment at: llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp:40
+  static CVSymbol Tombstone(
+  ArrayRef(DenseMapInfo::getTombstoneKey(), 1));
   return Tombstone;

I suppose you've chosen 1 because that's a invalid record size? Comment maybe?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60018/new/

https://reviews.llvm.org/D60018



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits