[Lldb-commits] [PATCH] D93939: [elf-core] Improve reading memory from core file

2021-02-04 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

cool


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

https://reviews.llvm.org/D93939

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


[Lldb-commits] [lldb] aa56b30 - [lldb] Make TestLocalVariables.py compatible with the new pass manager

2021-02-04 Thread Pavel Labath via lldb-commits

Author: Pavel Labath
Date: 2021-02-04T11:27:08+01:00
New Revision: aa56b30014d96700b2fc945be11866789f341d38

URL: 
https://github.com/llvm/llvm-project/commit/aa56b30014d96700b2fc945be11866789f341d38
DIFF: 
https://github.com/llvm/llvm-project/commit/aa56b30014d96700b2fc945be11866789f341d38.diff

LOG: [lldb] Make TestLocalVariables.py compatible with the new pass manager

The new PM is more aggressive at inlining, which breaks assumptions in
the test => slap some __attribute__((noinlines)) to prevent that.

Added: 


Modified: 
lldb/test/API/lang/c/local_variables/main.c

Removed: 




diff  --git a/lldb/test/API/lang/c/local_variables/main.c 
b/lldb/test/API/lang/c/local_variables/main.c
index 2ab579a71a75..4654443625fc 100644
--- a/lldb/test/API/lang/c/local_variables/main.c
+++ b/lldb/test/API/lang/c/local_variables/main.c
@@ -1,12 +1,8 @@
 #include 
 
-void bar(unsigned i)
-{
-  printf("%d\n", i);
-}
+void __attribute__((noinline)) bar(unsigned i) { printf("%d\n", i); }
 
-void foo(unsigned j)
-{
+void __attribute__((noinline)) foo(unsigned j) {
   unsigned i = j;
   bar(i);
   i = 10;



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


Re: [Lldb-commits] [lldb] 0bca9a7 - Fix lldb-vscode builds on Windows targeting POSIX

2021-02-04 Thread Martin Storsjö via lldb-commits

On Thu, 28 Jan 2021, Walter Erquinigo via lldb-commits wrote:



Author: Walter Erquinigo
Date: 2021-01-28T09:36:13-08:00
New Revision: 0bca9a7ce2eeaa9f1d732ffbc17769560a2b236e

URL: 
https://github.com/llvm/llvm-project/commit/0bca9a7ce2eeaa9f1d732ffbc17769560a2b236e
DIFF: 
https://github.com/llvm/llvm-project/commit/0bca9a7ce2eeaa9f1d732ffbc17769560a2b236e.diff

LOG: Fix lldb-vscode builds on Windows targeting POSIX

@stella.stamenova found out that lldb-vscode's Win32 macros were failing
when building on windows targetings POSIX platforms.

I'm changing these macros for LLVM_ON_UNIX, which should be more
accurate.


Just for the record, the reason for things failing wasn't so much that 
LLVM_ON_UNIX is more accurate than the macros that the code tried to use 
before. Before, the code tried to check the define "WIN32" in some files, 
and "_WIN32" in others (and one case even used the macro "WIN_32").


"_WIN32" is the correct one to check, it's predefined by the compilers 
when targeting windows. Most build tools don't normally define "WIN32" 
without a leading underscore (although e.g. some visual studio project 
file templates include it in the list of user-defined macros). So that's 
why things broke before.


Btw, the checks like "#if LLVM_ON_UNIX" are a bit incorrect too, they 
should be "#ifdef LLVM_ON_UNIX", as the macro is entirely undefined for 
non-unix platforms.


These commits should be backported to the 12.x release branch too, because 
building lldb for windows (or in particular, lldb-vscode) is broken there 
right now.


// Martin

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


[Lldb-commits] [PATCH] D95683: [lldb] Fix fallout caused by D89156 on 11.0.1 for MacOS

2021-02-04 Thread Andi via Phabricator via lldb-commits
Abpostelnicu added a comment.

The failure is wrong.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95683

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


[Lldb-commits] [PATCH] D95802: [lldb] [Process/FreeBSDRemote] Introduce mips64 support

2021-02-04 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

The software single stepping code looks very similar to the linux version. Have 
you considered merging the two implementations? The code looks generic enough 
to be placed into the base class, if needed...


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

https://reviews.llvm.org/D95802

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


[Lldb-commits] [PATCH] D95802: [lldb] [Process/FreeBSDRemote] Introduce mips64 support

2021-02-04 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

Same way I did x86 watchpoints? I suppose I could try that.


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

https://reviews.llvm.org/D95802

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


[Lldb-commits] [PATCH] D95802: [lldb] [Process/FreeBSDRemote] Introduce mips64 support

2021-02-04 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.

Merging is a good idea as NetBSD might duplicate these code chunks too.


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

https://reviews.llvm.org/D95802

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


[Lldb-commits] [PATCH] D95802: [lldb] [Process/FreeBSDRemote] Introduce mips64 support

2021-02-04 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D95802#2541796 , @mgorny wrote:

> Same way I did x86 watchpoints? I suppose I could try that.

Possibly. Depends on the implementation, I guess. I was thinking we could just 
shove this into the NativeProcessProtocol class. Though, now I see that would 
complicate layering as that class is in Host. However, there's no hard reason 
why that class has to be in Host (it's pretty different than the rest of host 
functionality), so we could also solve that by moving it some place else


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

https://reviews.llvm.org/D95802

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


[Lldb-commits] [PATCH] D93939: [elf-core] Improve reading memory from core file

2021-02-04 Thread Djordje Todorovic via Phabricator via lldb-commits
djtodoro added a comment.

@labath Thanks for the review! I'll land this tomorrow.


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

https://reviews.llvm.org/D93939

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


Re: [Lldb-commits] [lldb] 0bca9a7 - Fix lldb-vscode builds on Windows targeting POSIX

2021-02-04 Thread Walter via lldb-commits
This is great to know. Til. I'll change all of those macros to _WIN32 for
consistency then

Il Gio 4 Feb 2021, 3:25 AM Martin Storsjö  ha scritto:

> On Thu, 28 Jan 2021, Walter Erquinigo via lldb-commits wrote:
>
> >
> > Author: Walter Erquinigo
> > Date: 2021-01-28T09:36:13-08:00
> > New Revision: 0bca9a7ce2eeaa9f1d732ffbc17769560a2b236e
> >
> > URL:
> https://github.com/llvm/llvm-project/commit/0bca9a7ce2eeaa9f1d732ffbc17769560a2b236e
> > DIFF:
> https://github.com/llvm/llvm-project/commit/0bca9a7ce2eeaa9f1d732ffbc17769560a2b236e.diff
> >
> > LOG: Fix lldb-vscode builds on Windows targeting POSIX
> >
> > @stella.stamenova found out that lldb-vscode's Win32 macros were failing
> > when building on windows targetings POSIX platforms.
> >
> > I'm changing these macros for LLVM_ON_UNIX, which should be more
> > accurate.
>
> Just for the record, the reason for things failing wasn't so much that
> LLVM_ON_UNIX is more accurate than the macros that the code tried to use
> before. Before, the code tried to check the define "WIN32" in some files,
> and "_WIN32" in others (and one case even used the macro "WIN_32").
>
> "_WIN32" is the correct one to check, it's predefined by the compilers
> when targeting windows. Most build tools don't normally define "WIN32"
> without a leading underscore (although e.g. some visual studio project
> file templates include it in the list of user-defined macros). So that's
> why things broke before.
>
> Btw, the checks like "#if LLVM_ON_UNIX" are a bit incorrect too, they
> should be "#ifdef LLVM_ON_UNIX", as the macro is entirely undefined for
> non-unix platforms.
>
> These commits should be backported to the 12.x release branch too, because
> building lldb for windows (or in particular, lldb-vscode) is broken there
> right now.
>
> // Martin
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D95995: [lldb] Simplify the logic to detect compiler flag support

2021-02-04 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

This seems to improve things


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

https://reviews.llvm.org/D95995

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


[Lldb-commits] [PATCH] D95261: [lldb/test] Reduce API test tools configuration boilerplate

2021-02-04 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 321412.
labath added a comment.

Add back dsymutil in one more place


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95261

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/test/API/CMakeLists.txt
  lldb/test/API/lit.cfg.py
  lldb/test/API/lit.site.cfg.py.in
  lldb/utils/lldb-dotest/CMakeLists.txt
  lldb/utils/lldb-dotest/lldb-dotest.in

Index: lldb/utils/lldb-dotest/lldb-dotest.in
===
--- lldb/utils/lldb-dotest/lldb-dotest.in
+++ lldb/utils/lldb-dotest/lldb-dotest.in
@@ -8,13 +8,12 @@
 executable = '@LLDB_TEST_EXECUTABLE_CONFIGURED@'
 compiler = '@LLDB_TEST_COMPILER_CONFIGURED@'
 dsymutil = '@LLDB_TEST_DSYMUTIL_CONFIGURED@'
-filecheck = '@LLDB_TEST_FILECHECK_CONFIGURED@'
-yaml2obj = '@LLDB_TEST_YAML2OBJ_CONFIGURED@'
 server = '@LLDB_TEST_SERVER_CONFIGURED@'
 lldb_build_dir = '@LLDB_TEST_BUILD_DIRECTORY_CONFIGURED@'
 lldb_build_intel_pt = "@LLDB_BUILD_INTEL_PT@"
 lldb_framework_dir = "@LLDB_FRAMEWORK_DIR_CONFIGURED@"
 lldb_libs_dir = "@LLDB_LIBS_DIR_CONFIGURED@"
+llvm_tools_dir = "@LLVM_TOOLS_DIR_CONFIGURED@"
 
 if __name__ == '__main__':
 wrapper_args = sys.argv[1:]
@@ -27,9 +26,8 @@
 cmd.extend(['--executable', executable])
 cmd.extend(['--compiler', compiler])
 cmd.extend(['--dsymutil', dsymutil])
-cmd.extend(['--yaml2obj', yaml2obj])
-cmd.extend(['--filecheck', filecheck])
 cmd.extend(['--lldb-libs-dir', lldb_libs_dir])
+cmd.extend(['--llvm-tools-dir', llvm_tools_dir])
 if server:
 cmd.extend(['--server', server])
 if lldb_framework_dir:
Index: lldb/utils/lldb-dotest/CMakeLists.txt
===
--- lldb/utils/lldb-dotest/CMakeLists.txt
+++ lldb/utils/lldb-dotest/CMakeLists.txt
@@ -26,8 +26,6 @@
 string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
 string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_COMPILER_CONFIGURED "${LLDB_TEST_COMPILER}")
 string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_FILECHECK_CONFIGURED "${LLDB_TEST_FILECHECK}")
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_YAML2OBJ_CONFIGURED "${LLDB_TEST_YAML2OBJ}")
 string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_SERVER_CONFIGURED "${LLDB_TEST_SERVER}")
 
 # Remaining ones must be paths to the provided LLVM build-tree.
@@ -40,10 +38,9 @@
   string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
   string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_COMPILER_CONFIGURED "${LLDB_TEST_COMPILER}")
   string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_FILECHECK_CONFIGURED "${LLDB_TEST_FILECHECK}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_YAML2OBJ_CONFIGURED "${LLDB_TEST_YAML2OBJ}")
   string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_SERVER_CONFIGURED "${LLDB_TEST_SERVER}")
   string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_LIBS_DIR_CONFIGURED "${LLDB_LIBS_DIR}")
+  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLVM_TOOLS_DIR_CONFIGURED "${LLVM_TOOLS_BINARY_DIR}")
 else()
   # Single-configuration generator like Ninja.
   string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_DOTEST_ARGS_CONFIGURED "${LLDB_DOTEST_ARGS}")
@@ -53,10 +50,9 @@
   string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
   string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_COMPILER_CONFIGURED "${LLDB_TEST_COMPILER}")
   string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_FILECHECK_CONFIGURED "${LLDB_TEST_FILECHECK}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_YAML2OBJ_CONFIGURED "${LLDB_TEST_YAML2OBJ}")
   string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_SERVER_CONFIGURED "${LLDB_TEST_SERVER}")
   string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_LIBS_DIR_CONFIGURED "${LLDB_LIBS_DIR}")
+  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLVM_TOOLS_DIR_CONFIGURED "${LLVM_TOOLS_BINARY_DIR}")
 endif()
 
 configure_file(
@@ -74,10 +70,9 @@
 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_COMPILER_CONFI

[Lldb-commits] [PATCH] D96034: [lldb/cmake] Reduce duplication in generation lldb-dotest

2021-02-04 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: JDevlieghere, stella.stamenova.
Herald added a subscriber: mgorny.
labath requested review of this revision.
Herald added a project: LLDB.

Use indirection to avoid duplicated long lists of variables.

Depends on D95261 .


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96034

Files:
  lldb/utils/lldb-dotest/CMakeLists.txt

Index: lldb/utils/lldb-dotest/CMakeLists.txt
===
--- lldb/utils/lldb-dotest/CMakeLists.txt
+++ lldb/utils/lldb-dotest/CMakeLists.txt
@@ -10,6 +10,20 @@
   LLDB_BUILD_INTEL_PT
 )
 
+set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}")
+set(vars
+  LLDB_DOTEST_ARGS
+  LLDB_SOURCE_DIR
+  LLDB_FRAMEWORK_DIR
+  LLDB_TEST_BUILD_DIRECTORY
+  LLDB_TEST_EXECUTABLE
+  LLDB_TEST_COMPILER
+  LLDB_TEST_DSYMUTIL
+  LLDB_TEST_SERVER
+  LLDB_LIBS_DIR
+  LLVM_TOOLS_DIR
+  )
+
 # Generate lldb-dotest Python driver script for each build mode.
 if(LLDB_BUILT_STANDALONE)
   set(config_types ".")
@@ -19,40 +33,21 @@
   foreach(config_type ${config_types})
 # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our actual configuration names.
 string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR})
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_DOTEST_ARGS_CONFIGURED "${LLDB_DOTEST_ARGS}")
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_SOURCE_DIR_CONFIGURED "${LLDB_SOURCE_DIR}")
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_FRAMEWORK_DIR_CONFIGURED "${LLDB_FRAMEWORK_DIR}")
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_BUILD_DIRECTORY_CONFIGURED "${LLDB_TEST_BUILD_DIRECTORY}")
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_COMPILER_CONFIGURED "${LLDB_TEST_COMPILER}")
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_SERVER_CONFIGURED "${LLDB_TEST_SERVER}")
+foreach(var ${vars})
+  string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} "${var}_CONFIGURED" "${${var}}")
+endforeach()
 
 # Remaining ones must be paths to the provided LLVM build-tree.
 if(${config_type} IN_LIST LLVM_CONFIGURATION_TYPES)
   # Multi-configuration generator like Xcode (with a matching config).
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_DOTEST_ARGS_CONFIGURED "${LLDB_DOTEST_ARGS}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_SOURCE_DIR_CONFIGURED "${LLDB_SOURCE_DIR}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_FRAMEWORK_DIR_CONFIGURED "${LLDB_FRAMEWORK_DIR}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_BUILD_DIRECTORY_CONFIGURED "${LLDB_TEST_BUILD_DIRECTORY}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_COMPILER_CONFIGURED "${LLDB_TEST_COMPILER}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_SERVER_CONFIGURED "${LLDB_TEST_SERVER}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_LIBS_DIR_CONFIGURED "${LLDB_LIBS_DIR}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLVM_TOOLS_DIR_CONFIGURED "${LLVM_TOOLS_BINARY_DIR}")
+  foreach(var ${vars})
+string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} "${var}_CONFIGURED" "${${var}}")
+  endforeach()
 else()
   # Single-configuration generator like Ninja.
-  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_DOTEST_ARGS_CONFIGURED "${LLDB_DOTEST_ARGS}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_SOURCE_DIR_CONFIGURED "${LLDB_SOURCE_DIR}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_FRAMEWORK_DIR_CONFIGURED "${LLDB_FRAMEWORK_DIR}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_BUILD_DIRECTORY_CONFIGURED "${LLDB_TEST_BUILD_DIRECTORY}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_EXECUTABLE_CONFIGURED "${LLDB_TEST_EXECUTABLE}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_COMPILER_CONFIGURED "${LLDB_TEST_COMPILER}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_SERVER_CONFIGURED "${LLDB_TEST_SERVER}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_LIBS_DIR_CONFIGURED "${LLDB_LIBS_DIR}")
-

[Lldb-commits] [PATCH] D95802: [lldb] [Process/FreeBSDRemote] Introduce mips64 support

2021-02-04 Thread Michał Górny via Phabricator via lldb-commits
mgorny updated this revision to Diff 321446.
mgorny edited the summary of this revision.
mgorny added a comment.

@labath, how does this look like? I've managed to make it into a mixin class 
without any virtual inheritance.


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

https://reviews.llvm.org/D95802

Files:
  lldb/include/lldb/Host/common/NativeProcessProtocol.h
  lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
  lldb/source/Plugins/Process/FreeBSDRemote/CMakeLists.txt
  lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
  lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.h
  
lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_mips64.cpp
  
lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_mips64.h
  lldb/source/Plugins/Process/FreeBSDRemote/NativeThreadFreeBSD.cpp
  lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
  lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
  lldb/source/Plugins/Process/Utility/CMakeLists.txt
  lldb/source/Plugins/Process/Utility/NativeProcessSoftwareSingleStep.cpp
  lldb/source/Plugins/Process/Utility/NativeProcessSoftwareSingleStep.h
  lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp

Index: lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
===
--- lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
+++ lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
@@ -17,13 +17,15 @@
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h"
+#include "Plugins/Process/Utility/RegisterContextFreeBSD_mips64.h"
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h"
 #include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
 #include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
 #include "Plugins/Process/Utility/lldb-arm-register-enums.h"
 #include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
+#include "Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h"
+#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -398,3 +400,61 @@
 }
 
 #endif // defined(__aarch64__)
+
+#if defined(__mips64__)
+
+#define EXPECT_GPR_MIPS64(lldb_reg, fbsd_regno)\
+  EXPECT_THAT(GetRegParams(reg_ctx, gpr_##lldb_reg##_mips64),  \
+  ::testing::Pair(offsetof(reg, r_regs[fbsd_regno]),   \
+  sizeof(reg::r_regs[fbsd_regno])))
+
+TEST(RegisterContextFreeBSDTest, mips64) {
+  ArchSpec arch{"mips64-unknown-freebsd"};
+  RegisterContextFreeBSD_mips64 reg_ctx{arch};
+
+  // we can not use aliases from  because macros defined
+  // there are not namespaced and collide a lot, e.g. 'A1'
+
+  EXPECT_GPR_MIPS64(zero, 0);
+  EXPECT_GPR_MIPS64(r1, 1);
+  EXPECT_GPR_MIPS64(r2, 2);
+  EXPECT_GPR_MIPS64(r3, 3);
+  EXPECT_GPR_MIPS64(r4, 4);
+  EXPECT_GPR_MIPS64(r5, 5);
+  EXPECT_GPR_MIPS64(r6, 6);
+  EXPECT_GPR_MIPS64(r7, 7);
+  EXPECT_GPR_MIPS64(r8, 8);
+  EXPECT_GPR_MIPS64(r9, 9);
+  EXPECT_GPR_MIPS64(r10, 10);
+  EXPECT_GPR_MIPS64(r11, 11);
+  EXPECT_GPR_MIPS64(r12, 12);
+  EXPECT_GPR_MIPS64(r13, 13);
+  EXPECT_GPR_MIPS64(r14, 14);
+  EXPECT_GPR_MIPS64(r15, 15);
+  EXPECT_GPR_MIPS64(r16, 16);
+  EXPECT_GPR_MIPS64(r17, 17);
+  EXPECT_GPR_MIPS64(r18, 18);
+  EXPECT_GPR_MIPS64(r19, 19);
+  EXPECT_GPR_MIPS64(r20, 20);
+  EXPECT_GPR_MIPS64(r21, 21);
+  EXPECT_GPR_MIPS64(r22, 22);
+  EXPECT_GPR_MIPS64(r23, 23);
+  EXPECT_GPR_MIPS64(r24, 24);
+  EXPECT_GPR_MIPS64(r25, 25);
+  EXPECT_GPR_MIPS64(r26, 26);
+  EXPECT_GPR_MIPS64(r27, 27);
+  EXPECT_GPR_MIPS64(gp, 28);
+  EXPECT_GPR_MIPS64(sp, 29);
+  EXPECT_GPR_MIPS64(r30, 30);
+  EXPECT_GPR_MIPS64(ra, 31);
+  EXPECT_GPR_MIPS64(sr, 32);
+  EXPECT_GPR_MIPS64(mullo, 33);
+  EXPECT_GPR_MIPS64(mulhi, 34);
+  EXPECT_GPR_MIPS64(badvaddr, 35);
+  EXPECT_GPR_MIPS64(cause, 36);
+  EXPECT_GPR_MIPS64(pc, 37);
+  EXPECT_GPR_MIPS64(ic, 38);
+  EXPECT_GPR_MIPS64(dummy, 39);
+}
+
+#endif // defined(__mips64__)
Index: lldb/source/Plugins/Process/Utility/NativeProcessSoftwareSingleStep.h
===
--- /dev/null
+++ lldb/source/Plugins/Process/Utility/NativeProcessSoftwareSingleStep.h
@@ -0,0 +1,31 @@
+//===-- NativeProcessSoftwareSingleStep.h ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef lldb_NativeProcessSoftwareSingleStep_h
+#define lldb_NativeProcessSoftwareSingleStep_h
+
+#include "lldb/Host/common/NativeProcessProtoc

[Lldb-commits] [PATCH] D95261: [lldb/test] Reduce API test tools configuration boilerplate

2021-02-04 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

I think you missed one `LLVM_TOOLS_DIR_CONFIGURED` but other than that this 
LGTM.




Comment at: lldb/utils/lldb-dotest/CMakeLists.txt:29
 string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} 
LLDB_TEST_DSYMUTIL_CONFIGURED "${LLDB_TEST_DSYMUTIL}")
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} 
LLDB_TEST_FILECHECK_CONFIGURED "${LLDB_TEST_FILECHECK}")
-string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} 
LLDB_TEST_YAML2OBJ_CONFIGURED "${LLDB_TEST_YAML2OBJ}")
 string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} 
LLDB_TEST_SERVER_CONFIGURED "${LLDB_TEST_SERVER}")
 

Do you need to add `LLVM_TOOLS_DIR_CONFIGURED` here too? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95261

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


[Lldb-commits] [PATCH] D95992: Print the "no plugin" warning only when there is no plugin

2021-02-04 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

The feature itself is already being tested by 
`lldb/test/Shell/Process/UnsupportedLanguage.test`. In order to test this 
change we would have to force TypeSystemClang to fail to initialize somehow. 
The only way to do this would be to pass in an invalid arch, but if we do that 
we won't get to the point where this warning would be printed. (The bugfix is 
intended for Swift plugin, which does fail to initialize more easily).


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

https://reviews.llvm.org/D95992

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


[Lldb-commits] [lldb] 727bd89 - [lldb] Simplify the logic to detect compiler flag support

2021-02-04 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2021-02-04T08:52:56-08:00
New Revision: 727bd89b605b39659c793f338ce1e18dafc3581e

URL: 
https://github.com/llvm/llvm-project/commit/727bd89b605b39659c793f338ce1e18dafc3581e
DIFF: 
https://github.com/llvm/llvm-project/commit/727bd89b605b39659c793f338ce1e18dafc3581e.diff

LOG: [lldb] Simplify the logic to detect compiler flag support

This patch effectively does the following 3 things:

 - Centralize the logic to figure out if a compiler flag is supported.
 - Stop sanity checking whether the compiler works at all. While useful,
   that's not the decorator's responsibility.
 - Invoke the compiler with xcrun on Darwin so we know where to find the
   sysroot.

On my macOS Big Sur system, the clang invocation couldn't find libSystem
and would fail the sanity check in the decorator. This meant that the
test suite would always try to run the ASan/UBSan/TSan tests, regardless
of whether compiler-rt was built.

Differential revision: https://reviews.llvm.org/D95995

Added: 


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

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/decorators.py 
b/lldb/packages/Python/lldbsuite/test/decorators.py
index ff445fa0b926..6d781defdea4 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -86,6 +86,20 @@ def _match_decorator_property(expected, actual):
 else:
 return expected == actual
 
+
+def _compiler_supports(compiler, flag):
+"""Test whether the compiler supports the given flag."""
+if platform.system() == 'Darwin':
+compiler = "xcrun " + compiler
+f = tempfile.NamedTemporaryFile()
+try:
+cmd = "echo 'int main() {}' | %s %s -x c -o %s -" % (compiler, flag, 
f.name)
+subprocess.check_call(cmd, shell=True)
+except subprocess.CalledProcessError:
+return False
+return True
+
+
 def expectedFailure(func):
 return unittest2.expectedFailure(func)
 
@@ -729,12 +743,7 @@ def is_compiler_clang_with_thread_sanitizer(self):
 # rdar://28659145 - TSAN tests don't look like they're supported on 
i386
 if self.getArchitecture() == 'i386' and platform.system() == 'Darwin':
 return "TSAN tests not compatible with i386 targets"
-f = tempfile.NamedTemporaryFile()
-cmd = "echo 'int main() {}' | %s -x c -o %s -" % (compiler_path, 
f.name)
-if os.popen(cmd).close() is not None:
-return None  # The compiler cannot compile at all, let's *not* 
skip the test
-cmd = "echo 'int main() {}' | %s -fsanitize=thread -x c -o %s -" % 
(compiler_path, f.name)
-if os.popen(cmd).close() is not None:
+if not _compiler_supports(compiler_path, '-fsanitize=thread'):
 return "Compiler cannot compile with -fsanitize=thread"
 return None
 return skipTestIfFn(is_compiler_clang_with_thread_sanitizer)(func)
@@ -755,8 +764,7 @@ def is_compiler_clang_with_ubsan(self):
 outputf = tempfile.NamedTemporaryFile()
 
 # Try to compile with ubsan turned on.
-cmd = '%s -fsanitize=undefined %s -o %s' % (self.getCompiler(), 
inputf.name, outputf.name)
-if os.popen(cmd).close() is not None:
+if not _compiler_supports(self.getCompiler(), '-fsanitize=undefined'):
 return "Compiler cannot compile with -fsanitize=undefined"
 
 # Check that we actually see ubsan instrumentation in the binary.
@@ -804,16 +812,9 @@ def is_compiler_with_address_sanitizer(self):
 if is_running_under_asan():
 return "Address sanitizer tests are disabled when runing under 
ASAN"
 
-compiler_path = self.getCompiler()
-compiler = os.path.basename(compiler_path)
-f = tempfile.NamedTemporaryFile()
 if lldbplatformutil.getPlatform() == 'windows':
 return "ASAN tests not compatible with 'windows'"
-cmd = "echo 'int main() {}' | %s -x c -o %s -" % (compiler_path, 
f.name)
-if os.popen(cmd).close() is not None:
-return None  # The compiler cannot compile at all, let's *not* 
skip the test
-cmd = "echo 'int main() {}' | %s -fsanitize=address -x c -o %s -" % 
(compiler_path, f.name)
-if os.popen(cmd).close() is not None:
+if not _compiler_supports(self.getCompiler(), '-fsanitize=address'):
 return "Compiler cannot compile with -fsanitize=address"
 return None
 return skipTestIfFn(is_compiler_with_address_sanitizer)(func)



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


[Lldb-commits] [PATCH] D95995: [lldb] Simplify the logic to detect compiler flag support

2021-02-04 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG727bd89b605b: [lldb] Simplify the logic to detect compiler 
flag support (authored by JDevlieghere).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95995

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
@@ -86,6 +86,20 @@
 else:
 return expected == actual
 
+
+def _compiler_supports(compiler, flag):
+"""Test whether the compiler supports the given flag."""
+if platform.system() == 'Darwin':
+compiler = "xcrun " + compiler
+f = tempfile.NamedTemporaryFile()
+try:
+cmd = "echo 'int main() {}' | %s %s -x c -o %s -" % (compiler, flag, 
f.name)
+subprocess.check_call(cmd, shell=True)
+except subprocess.CalledProcessError:
+return False
+return True
+
+
 def expectedFailure(func):
 return unittest2.expectedFailure(func)
 
@@ -729,12 +743,7 @@
 # rdar://28659145 - TSAN tests don't look like they're supported on 
i386
 if self.getArchitecture() == 'i386' and platform.system() == 'Darwin':
 return "TSAN tests not compatible with i386 targets"
-f = tempfile.NamedTemporaryFile()
-cmd = "echo 'int main() {}' | %s -x c -o %s -" % (compiler_path, 
f.name)
-if os.popen(cmd).close() is not None:
-return None  # The compiler cannot compile at all, let's *not* 
skip the test
-cmd = "echo 'int main() {}' | %s -fsanitize=thread -x c -o %s -" % 
(compiler_path, f.name)
-if os.popen(cmd).close() is not None:
+if not _compiler_supports(compiler_path, '-fsanitize=thread'):
 return "Compiler cannot compile with -fsanitize=thread"
 return None
 return skipTestIfFn(is_compiler_clang_with_thread_sanitizer)(func)
@@ -755,8 +764,7 @@
 outputf = tempfile.NamedTemporaryFile()
 
 # Try to compile with ubsan turned on.
-cmd = '%s -fsanitize=undefined %s -o %s' % (self.getCompiler(), 
inputf.name, outputf.name)
-if os.popen(cmd).close() is not None:
+if not _compiler_supports(self.getCompiler(), '-fsanitize=undefined'):
 return "Compiler cannot compile with -fsanitize=undefined"
 
 # Check that we actually see ubsan instrumentation in the binary.
@@ -804,16 +812,9 @@
 if is_running_under_asan():
 return "Address sanitizer tests are disabled when runing under 
ASAN"
 
-compiler_path = self.getCompiler()
-compiler = os.path.basename(compiler_path)
-f = tempfile.NamedTemporaryFile()
 if lldbplatformutil.getPlatform() == 'windows':
 return "ASAN tests not compatible with 'windows'"
-cmd = "echo 'int main() {}' | %s -x c -o %s -" % (compiler_path, 
f.name)
-if os.popen(cmd).close() is not None:
-return None  # The compiler cannot compile at all, let's *not* 
skip the test
-cmd = "echo 'int main() {}' | %s -fsanitize=address -x c -o %s -" % 
(compiler_path, f.name)
-if os.popen(cmd).close() is not None:
+if not _compiler_supports(self.getCompiler(), '-fsanitize=address'):
 return "Compiler cannot compile with -fsanitize=address"
 return None
 return skipTestIfFn(is_compiler_with_address_sanitizer)(func)


Index: lldb/packages/Python/lldbsuite/test/decorators.py
===
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -86,6 +86,20 @@
 else:
 return expected == actual
 
+
+def _compiler_supports(compiler, flag):
+"""Test whether the compiler supports the given flag."""
+if platform.system() == 'Darwin':
+compiler = "xcrun " + compiler
+f = tempfile.NamedTemporaryFile()
+try:
+cmd = "echo 'int main() {}' | %s %s -x c -o %s -" % (compiler, flag, f.name)
+subprocess.check_call(cmd, shell=True)
+except subprocess.CalledProcessError:
+return False
+return True
+
+
 def expectedFailure(func):
 return unittest2.expectedFailure(func)
 
@@ -729,12 +743,7 @@
 # rdar://28659145 - TSAN tests don't look like they're supported on i386
 if self.getArchitecture() == 'i386' and platform.system() == 'Darwin':
 return "TSAN tests not compatible with i386 targets"
-f = tempfile.NamedTemporaryFile()
-cmd = "echo 'int main() {}' | %s -x c -o %s -" % (compiler_path, f.name)
-if os.popen(cmd).close() is not None:
-return None  # The compiler cannot compile at all, let's *not* skip the test
-  

[Lldb-commits] [PATCH] D96034: [lldb/cmake] Reduce duplication in generation lldb-dotest

2021-02-04 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

Yay!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96034

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


[Lldb-commits] [PATCH] D96060: [lldb-vscode] correctly use Windows macros

2021-02-04 Thread walter erquinigo via Phabricator via lldb-commits
wallace created this revision.
wallace added reviewers: mstorsjo, stella.stamenova.
wallace requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

@mstorsjo found a mistake that I made when trying to fix some Windows
compilation errors encountered by @stella.stamenova.

I was incorrectly using the LLVM_ON_UNIX macro. In any case, proper use
of

  #if defined(_WIN32)

should be the actual fix.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96060

Files:
  lldb/tools/lldb-vscode/FifoFiles.cpp
  lldb/tools/lldb-vscode/IOStream.cpp
  lldb/tools/lldb-vscode/IOStream.h
  lldb/tools/lldb-vscode/RunInTerminal.cpp
  lldb/tools/lldb-vscode/VSCode.cpp
  lldb/tools/lldb-vscode/lldb-vscode.cpp

Index: lldb/tools/lldb-vscode/lldb-vscode.cpp
===
--- lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -16,7 +16,7 @@
 #include 
 #include 
 #include 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 // We need to #define NOMINMAX in order to skip `min()` and `max()` macro
 // definitions that conflict with other system headers.
 // We also need to #undef GetObject (which is defined to GetObjectW) because
@@ -55,7 +55,7 @@
 #include "JSONUtils.h"
 #include "LLDBUtils.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 #ifndef PATH_MAX
 #define PATH_MAX MAX_PATH
 #endif
@@ -132,7 +132,7 @@
   *g_vsc.log << "error: accept (" << strerror(errno) << ")"
  << std::endl;
 }
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 closesocket(sockfd);
 #else
 close(sockfd);
@@ -3003,7 +3003,7 @@
 // emitted to the debug adaptor.
 void LaunchRunInTerminalTarget(llvm::opt::Arg &target_arg,
llvm::StringRef comm_file, char *argv[]) {
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   llvm::errs() << "runInTerminal is only supported on POSIX systems\n";
   exit(EXIT_FAILURE);
 #else
@@ -3085,7 +3085,7 @@
 }
   }
 
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
   if (input_args.hasArg(OPT_wait_for_debugger)) {
 printf("Paused waiting for debugger to attach (pid = %i)...\n", getpid());
 pause();
Index: lldb/tools/lldb-vscode/VSCode.cpp
===
--- lldb/tools/lldb-vscode/VSCode.cpp
+++ lldb/tools/lldb-vscode/VSCode.cpp
@@ -14,7 +14,7 @@
 #include "VSCode.h"
 #include "llvm/Support/FormatVariadic.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 #define NOMINMAX
 #include 
 #include 
@@ -41,7 +41,7 @@
   stop_at_entry(false), is_attach(false),
   reverse_request_seq(0), waiting_for_run_in_terminal(false) {
   const char *log_file_path = getenv("LLDBVSCODE_LOG");
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   // Windows opens stdout and stdin in text mode which converts \n to 13,10
   // while the value is just 10 on Darwin/Linux. Setting the file mode to binary
   // fixes this.
Index: lldb/tools/lldb-vscode/RunInTerminal.cpp
===
--- lldb/tools/lldb-vscode/RunInTerminal.cpp
+++ lldb/tools/lldb-vscode/RunInTerminal.cpp
@@ -8,7 +8,7 @@
 
 #include "RunInTerminal.h"
 
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
 #include 
 #include 
 #include 
Index: lldb/tools/lldb-vscode/IOStream.h
===
--- lldb/tools/lldb-vscode/IOStream.h
+++ lldb/tools/lldb-vscode/IOStream.h
@@ -11,7 +11,7 @@
 
 #include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 // We need to #define NOMINMAX in order to skip `min()` and `max()` macro
 // definitions that conflict with other system headers.
 // We also need to #undef GetObject (which is defined to GetObjectW) because
Index: lldb/tools/lldb-vscode/IOStream.cpp
===
--- lldb/tools/lldb-vscode/IOStream.cpp
+++ lldb/tools/lldb-vscode/IOStream.cpp
@@ -8,7 +8,7 @@
 
 #include "IOStream.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32) 
 #include 
 #else
 #include 
@@ -33,7 +33,7 @@
 return;
 
   if (m_is_socket)
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 ::closesocket(m_socket);
 #else
 ::close(m_socket);
@@ -108,7 +108,7 @@
 }
 if (bytes_read < 0) {
   int reason = 0;
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   if (descriptor.m_is_socket)
 reason = WSAGetLastError();
   else
Index: lldb/tools/lldb-vscode/FifoFiles.cpp
===
--- lldb/tools/lldb-vscode/FifoFiles.cpp
+++ lldb/tools/lldb-vscode/FifoFiles.cpp
@@ -8,7 +8,7 @@
 
 #include "FifoFiles.h"
 
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
 #include 
 #include 
 #include 
@@ -30,13 +30,13 @@
 FifoFile::FifoFile(StringRef path) : m_path(path) {}
 
 FifoFile::~FifoFile() {
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
   unlink(m_path.c_str());
 #endif
 }
 
 Expected> CreateFifoFile(StringRef path) {
-#

[Lldb-commits] [PATCH] D96060: [lldb-vscode] correctly use Windows macros

2021-02-04 Thread Nathan Lanza via Phabricator via lldb-commits
lanza accepted this revision.
lanza added a comment.
This revision is now accepted and ready to land.
Herald added a subscriber: JDevlieghere.

LGTM, I had to do this to fix it locally and can confirm it works.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96060

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


[Lldb-commits] [lldb] 36496cc - [lldb-vscode] correctly use Windows macros

2021-02-04 Thread Walter Erquinigo via lldb-commits

Author: Walter Erquinigo
Date: 2021-02-04T11:03:33-08:00
New Revision: 36496cc2992d6fa26e6024971efcfc7d15f69888

URL: 
https://github.com/llvm/llvm-project/commit/36496cc2992d6fa26e6024971efcfc7d15f69888
DIFF: 
https://github.com/llvm/llvm-project/commit/36496cc2992d6fa26e6024971efcfc7d15f69888.diff

LOG: [lldb-vscode] correctly use Windows macros

@mstorsjo found a mistake that I made when trying to fix some Windows
compilation errors encountered by @stella.stamenova.

I was incorrectly using the LLVM_ON_UNIX macro. In any case, proper use
of

  #if defined(_WIN32)

should be the actual fix.

Differential Revision: https://reviews.llvm.org/D96060

Added: 


Modified: 
lldb/tools/lldb-vscode/FifoFiles.cpp
lldb/tools/lldb-vscode/IOStream.cpp
lldb/tools/lldb-vscode/IOStream.h
lldb/tools/lldb-vscode/RunInTerminal.cpp
lldb/tools/lldb-vscode/VSCode.cpp
lldb/tools/lldb-vscode/lldb-vscode.cpp

Removed: 




diff  --git a/lldb/tools/lldb-vscode/FifoFiles.cpp 
b/lldb/tools/lldb-vscode/FifoFiles.cpp
index d56f88085abd..e37f2020d8f1 100644
--- a/lldb/tools/lldb-vscode/FifoFiles.cpp
+++ b/lldb/tools/lldb-vscode/FifoFiles.cpp
@@ -8,7 +8,7 @@
 
 #include "FifoFiles.h"
 
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
 #include 
 #include 
 #include 
@@ -30,13 +30,13 @@ namespace lldb_vscode {
 FifoFile::FifoFile(StringRef path) : m_path(path) {}
 
 FifoFile::~FifoFile() {
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
   unlink(m_path.c_str());
 #endif
 }
 
 Expected> CreateFifoFile(StringRef path) {
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   return createStringError(inconvertibleErrorCode(), "Unimplemented");
 #else
   if (int err = mkfifo(path.data(), 0600))

diff  --git a/lldb/tools/lldb-vscode/IOStream.cpp 
b/lldb/tools/lldb-vscode/IOStream.cpp
index fdbfb554aedb..cd22d906c14c 100644
--- a/lldb/tools/lldb-vscode/IOStream.cpp
+++ b/lldb/tools/lldb-vscode/IOStream.cpp
@@ -8,7 +8,7 @@
 
 #include "IOStream.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32) 
 #include 
 #else
 #include 
@@ -33,7 +33,7 @@ StreamDescriptor::~StreamDescriptor() {
 return;
 
   if (m_is_socket)
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 ::closesocket(m_socket);
 #else
 ::close(m_socket);
@@ -108,7 +108,7 @@ bool InputStream::read_full(std::ofstream *log, size_t 
length,
 }
 if (bytes_read < 0) {
   int reason = 0;
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   if (descriptor.m_is_socket)
 reason = WSAGetLastError();
   else

diff  --git a/lldb/tools/lldb-vscode/IOStream.h 
b/lldb/tools/lldb-vscode/IOStream.h
index 1ec7ac3ed0f9..0eb9b6fefb0d 100644
--- a/lldb/tools/lldb-vscode/IOStream.h
+++ b/lldb/tools/lldb-vscode/IOStream.h
@@ -11,7 +11,7 @@
 
 #include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 // We need to #define NOMINMAX in order to skip `min()` and `max()` macro
 // definitions that conflict with other system headers.
 // We also need to #undef GetObject (which is defined to GetObjectW) because

diff  --git a/lldb/tools/lldb-vscode/RunInTerminal.cpp 
b/lldb/tools/lldb-vscode/RunInTerminal.cpp
index 29edf5ca381d..2126563d9e96 100644
--- a/lldb/tools/lldb-vscode/RunInTerminal.cpp
+++ b/lldb/tools/lldb-vscode/RunInTerminal.cpp
@@ -8,7 +8,7 @@
 
 #include "RunInTerminal.h"
 
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
 #include 
 #include 
 #include 

diff  --git a/lldb/tools/lldb-vscode/VSCode.cpp 
b/lldb/tools/lldb-vscode/VSCode.cpp
index 4d0e281c1b8d..e9fdc17f4147 100644
--- a/lldb/tools/lldb-vscode/VSCode.cpp
+++ b/lldb/tools/lldb-vscode/VSCode.cpp
@@ -14,7 +14,7 @@
 #include "VSCode.h"
 #include "llvm/Support/FormatVariadic.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 #define NOMINMAX
 #include 
 #include 
@@ -41,7 +41,7 @@ VSCode::VSCode()
   stop_at_entry(false), is_attach(false),
   reverse_request_seq(0), waiting_for_run_in_terminal(false) {
   const char *log_file_path = getenv("LLDBVSCODE_LOG");
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   // Windows opens stdout and stdin in text mode which converts \n to 13,10
   // while the value is just 10 on Darwin/Linux. Setting the file mode to 
binary
   // fixes this.

diff  --git a/lldb/tools/lldb-vscode/lldb-vscode.cpp 
b/lldb/tools/lldb-vscode/lldb-vscode.cpp
index b7f39cbb1cb5..9469690cd7db 100644
--- a/lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ b/lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -16,7 +16,7 @@
 #include 
 #include 
 #include 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 // We need to #define NOMINMAX in order to skip `min()` and `max()` macro
 // definitions that conflict with other system headers.
 // We also need to #undef GetObject (which is defined to GetObjectW) because
@@ -55,7 +55,7 @@
 #include "JSONUtils.h"
 #include "LLDBUtils.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 #ifndef PATH_MAX
 #define PATH_MAX MAX_PATH
 #endif
@@ -132,7 +132,7 @@ SOCKET AcceptConnection(int portno) {
 

[Lldb-commits] [PATCH] D96060: [lldb-vscode] correctly use Windows macros

2021-02-04 Thread walter erquinigo 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 rG36496cc2992d: [lldb-vscode] correctly use Windows macros 
(authored by wallace).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96060

Files:
  lldb/tools/lldb-vscode/FifoFiles.cpp
  lldb/tools/lldb-vscode/IOStream.cpp
  lldb/tools/lldb-vscode/IOStream.h
  lldb/tools/lldb-vscode/RunInTerminal.cpp
  lldb/tools/lldb-vscode/VSCode.cpp
  lldb/tools/lldb-vscode/lldb-vscode.cpp

Index: lldb/tools/lldb-vscode/lldb-vscode.cpp
===
--- lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -16,7 +16,7 @@
 #include 
 #include 
 #include 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 // We need to #define NOMINMAX in order to skip `min()` and `max()` macro
 // definitions that conflict with other system headers.
 // We also need to #undef GetObject (which is defined to GetObjectW) because
@@ -55,7 +55,7 @@
 #include "JSONUtils.h"
 #include "LLDBUtils.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 #ifndef PATH_MAX
 #define PATH_MAX MAX_PATH
 #endif
@@ -132,7 +132,7 @@
   *g_vsc.log << "error: accept (" << strerror(errno) << ")"
  << std::endl;
 }
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 closesocket(sockfd);
 #else
 close(sockfd);
@@ -3003,7 +3003,7 @@
 // emitted to the debug adaptor.
 void LaunchRunInTerminalTarget(llvm::opt::Arg &target_arg,
llvm::StringRef comm_file, char *argv[]) {
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   llvm::errs() << "runInTerminal is only supported on POSIX systems\n";
   exit(EXIT_FAILURE);
 #else
@@ -3085,7 +3085,7 @@
 }
   }
 
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
   if (input_args.hasArg(OPT_wait_for_debugger)) {
 printf("Paused waiting for debugger to attach (pid = %i)...\n", getpid());
 pause();
Index: lldb/tools/lldb-vscode/VSCode.cpp
===
--- lldb/tools/lldb-vscode/VSCode.cpp
+++ lldb/tools/lldb-vscode/VSCode.cpp
@@ -14,7 +14,7 @@
 #include "VSCode.h"
 #include "llvm/Support/FormatVariadic.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 #define NOMINMAX
 #include 
 #include 
@@ -41,7 +41,7 @@
   stop_at_entry(false), is_attach(false),
   reverse_request_seq(0), waiting_for_run_in_terminal(false) {
   const char *log_file_path = getenv("LLDBVSCODE_LOG");
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   // Windows opens stdout and stdin in text mode which converts \n to 13,10
   // while the value is just 10 on Darwin/Linux. Setting the file mode to binary
   // fixes this.
Index: lldb/tools/lldb-vscode/RunInTerminal.cpp
===
--- lldb/tools/lldb-vscode/RunInTerminal.cpp
+++ lldb/tools/lldb-vscode/RunInTerminal.cpp
@@ -8,7 +8,7 @@
 
 #include "RunInTerminal.h"
 
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
 #include 
 #include 
 #include 
Index: lldb/tools/lldb-vscode/IOStream.h
===
--- lldb/tools/lldb-vscode/IOStream.h
+++ lldb/tools/lldb-vscode/IOStream.h
@@ -11,7 +11,7 @@
 
 #include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 // We need to #define NOMINMAX in order to skip `min()` and `max()` macro
 // definitions that conflict with other system headers.
 // We also need to #undef GetObject (which is defined to GetObjectW) because
Index: lldb/tools/lldb-vscode/IOStream.cpp
===
--- lldb/tools/lldb-vscode/IOStream.cpp
+++ lldb/tools/lldb-vscode/IOStream.cpp
@@ -8,7 +8,7 @@
 
 #include "IOStream.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32) 
 #include 
 #else
 #include 
@@ -33,7 +33,7 @@
 return;
 
   if (m_is_socket)
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 ::closesocket(m_socket);
 #else
 ::close(m_socket);
@@ -108,7 +108,7 @@
 }
 if (bytes_read < 0) {
   int reason = 0;
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   if (descriptor.m_is_socket)
 reason = WSAGetLastError();
   else
Index: lldb/tools/lldb-vscode/FifoFiles.cpp
===
--- lldb/tools/lldb-vscode/FifoFiles.cpp
+++ lldb/tools/lldb-vscode/FifoFiles.cpp
@@ -8,7 +8,7 @@
 
 #include "FifoFiles.h"
 
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
 #include 
 #include 
 #include 
@@ -30,13 +30,13 @@
 FifoFile::FifoFile(StringRef path) : m_path(path) {}
 
 FifoFile::~FifoFile() {
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
   unlink(m_path.c_str());
 #endif
 }
 
 Expected> CreateFifoFile(StringRef path) {
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   return createStringError(inconvertibleErrorCode(), "Unimplemented");
 #else
   if (int err = mkfifo(path.data(),

[Lldb-commits] [PATCH] D95992: Print the "no plugin" warning only when there is no plugin

2021-02-04 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

Perfect, then this LGTM.


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

https://reviews.llvm.org/D95992

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


[Lldb-commits] [PATCH] D95992: Print the "no plugin" warning only when there is no plugin

2021-02-04 Thread Adrian Prantl via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG644ef580735c: Print the "no plugin" warning only 
when there is no plugin (authored by aprantl).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95992

Files:
  lldb/source/Target/Process.cpp


Index: lldb/source/Target/Process.cpp
===
--- lldb/source/Target/Process.cpp
+++ lldb/source/Target/Process.cpp
@@ -5684,9 +5684,9 @@
   LanguageType language = sc.GetLanguage();
   if (language == eLanguageTypeUnknown)
 return;
-  auto type_system_or_err = sc.module_sp->GetTypeSystemForLanguage(language);
-  if (auto err = type_system_or_err.takeError()) {
-llvm::consumeError(std::move(err));
+  LanguageSet plugins =
+  PluginManager::GetAllTypeSystemSupportedLanguagesForTypes();
+  if (!plugins[language]) {
 PrintWarning(Process::Warnings::eWarningsUnsupportedLanguage,
  sc.module_sp.get(),
  "This version of LLDB has no plugin for the %s language. "


Index: lldb/source/Target/Process.cpp
===
--- lldb/source/Target/Process.cpp
+++ lldb/source/Target/Process.cpp
@@ -5684,9 +5684,9 @@
   LanguageType language = sc.GetLanguage();
   if (language == eLanguageTypeUnknown)
 return;
-  auto type_system_or_err = sc.module_sp->GetTypeSystemForLanguage(language);
-  if (auto err = type_system_or_err.takeError()) {
-llvm::consumeError(std::move(err));
+  LanguageSet plugins =
+  PluginManager::GetAllTypeSystemSupportedLanguagesForTypes();
+  if (!plugins[language]) {
 PrintWarning(Process::Warnings::eWarningsUnsupportedLanguage,
  sc.module_sp.get(),
  "This version of LLDB has no plugin for the %s language. "
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 644ef58 - Print the "no plugin" warning only when there is no plugin

2021-02-04 Thread Adrian Prantl via lldb-commits

Author: Adrian Prantl
Date: 2021-02-04T11:06:10-08:00
New Revision: 644ef580735c9fe4808de89c86a3e476ef1c4fad

URL: 
https://github.com/llvm/llvm-project/commit/644ef580735c9fe4808de89c86a3e476ef1c4fad
DIFF: 
https://github.com/llvm/llvm-project/commit/644ef580735c9fe4808de89c86a3e476ef1c4fad.diff

LOG: Print the "no plugin" warning only when there is no plugin

... and not when the typesystem failed to initialize.

rdar://72562341

Differential Revision: https://reviews.llvm.org/D95992

Added: 


Modified: 
lldb/source/Target/Process.cpp

Removed: 




diff  --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 518a6934059e..a645f1be5b3c 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -5684,9 +5684,9 @@ void Process::PrintWarningUnsupportedLanguage(const 
SymbolContext &sc) {
   LanguageType language = sc.GetLanguage();
   if (language == eLanguageTypeUnknown)
 return;
-  auto type_system_or_err = sc.module_sp->GetTypeSystemForLanguage(language);
-  if (auto err = type_system_or_err.takeError()) {
-llvm::consumeError(std::move(err));
+  LanguageSet plugins =
+  PluginManager::GetAllTypeSystemSupportedLanguagesForTypes();
+  if (!plugins[language]) {
 PrintWarning(Process::Warnings::eWarningsUnsupportedLanguage,
  sc.module_sp.get(),
  "This version of LLDB has no plugin for the %s language. "



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


[Lldb-commits] [PATCH] D96060: [lldb-vscode] correctly use Windows macros

2021-02-04 Thread Martin Storsjö via Phabricator via lldb-commits
mstorsjo added a comment.

The change looks ok to me. In my environments, the main branch does build 
correctly, but this should be good for consistency in any case. (The 12.x 
release branch does need a cherrypick though - but it'd be good to settle this 
first.)

I can test build it in a couple hours, I'll mark it as formally approved after 
doing that.




Comment at: lldb/tools/lldb-vscode/IOStream.cpp:11
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32) 
 #include 

There seems to be trailing whitespace here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96060

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


[Lldb-commits] [PATCH] D96060: [lldb-vscode] correctly use Windows macros

2021-02-04 Thread Martin Storsjö via Phabricator via lldb-commits
mstorsjo added a comment.

In D96060#2542890 , @mstorsjo wrote:

> I can test build it in a couple hours

It still built fine for me now - thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96060

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


[Lldb-commits] [PATCH] D93951: [vscode] Improve runInTerminal and support linux

2021-02-04 Thread Martin Storsjö via Phabricator via lldb-commits
mstorsjo added inline comments.



Comment at: lldb/tools/lldb-vscode/FifoFiles.cpp:9
+
+#if !defined(WIN32)
+#include 

stella.stamenova wrote:
> Also, this is no good. It works if you are targeting windows on windows, but 
> not if you are targeting something else and building on windows. There are a 
> few different ways this is done in LLVM/clang and they are generally not 
> based on defined(WIN32). Here are a couple of examples:
> 
> From llvm\lib\Support\Path.cpp:
> 
> ```
> #if !defined(_MSC_VER) && !defined(__MINGW32__)
> ```
> 
> From clang\lib\Driver\Driver.cpp:
> 
> ```
> #if LLVM_ON_UNIX
> ```
> 
> From llvm\lib\Support\ErrorHandling.cpp:
> 
> ```
> #if defined(HAVE_UNISTD_H)
> ```
> 
> I suggest browsing through the code and finding the most appropriate way to 
> manage your includes. In the mean time, this is breaking our internal builds 
> that run on Windows but do not target Windows.
@stella.stamenova `defined(WIN32)` shouldn't be used (as that isn't predefined 
by the compiler), but `defined(_WIN32)` should be just fine (and is used a lot 
within LLDB already, 176 occurrances). If cross compiling on windows, targeting 
another os, neither of them should be defined, so it should be just fine, no?

Or is this a case of cygwin, where the lines are blurred even more?

Does the current main branch work fine for you?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93951

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


Re: [Lldb-commits] [PATCH] D96060: [lldb-vscode] correctly use Windows macros

2021-02-04 Thread Walter via lldb-commits
I don't feel knowledgeable enough to backport the commit, so if you can do
it, it would be great :)

Il giorno gio 4 feb 2021 alle ore 13:04 Martin Storsjö via Phabricator <
revi...@reviews.llvm.org> ha scritto:

> mstorsjo added a comment.
>
> In D96060#2542890 , @mstorsjo
> wrote:
>
> > I can test build it in a couple hours
>
> It still built fine for me now - thanks!
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D96060/new/
>
> https://reviews.llvm.org/D96060
>
>

-- 
- Walter Erquínigo Pezo
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D96095: [lldb] Use assertIn/NotIn over assertTrue/False (NFC)

2021-02-04 Thread Dave Lee via Phabricator via lldb-commits
kastiglione created this revision.
kastiglione added reviewers: JDevlieghere, teemperor.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

For improved failure messages, use `assertIn` over `assertTrue`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96095

Files:
  lldb/test/API/commands/expression/dont_allow_jit/TestAllowJIT.py
  lldb/test/API/commands/frame/var/TestFrameVar.py
  
lldb/test/API/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py
  lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py
  lldb/test/API/functionalities/history/TestHistoryRecall.py
  
lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py
  lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
  lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py
  lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py
  lldb/test/API/functionalities/source-map/TestTargetSourceMap.py
  lldb/test/API/functionalities/stats_api/TestStatisticsAPI.py
  lldb/test/API/functionalities/step_scripted/TestStepScripted.py
  
lldb/test/API/functionalities/tail_call_frames/cross_dso/TestCrossDSOTailCalls.py
  
lldb/test/API/functionalities/tail_call_frames/cross_object/TestCrossObjectTailCalls.py
  
lldb/test/API/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
  lldb/test/API/functionalities/tsan/basic/TestTsanBasic.py
  lldb/test/API/functionalities/ubsan/basic/TestUbsanBasic.py
  lldb/test/API/lang/c/vla/TestVLA.py
  lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py
  lldb/test/API/lang/cpp/class_static/TestStaticVariables.py
  lldb/test/API/lang/cpp/class_types/TestClassTypes.py
  lldb/test/API/lang/objc/direct-dispatch-step/TestObjCDirectDispatchStepping.py
  lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py
  lldb/test/API/lang/objc/objc-checker/TestObjCCheckers.py
  lldb/test/API/macosx/macCatalyst/TestMacCatalyst.py
  
lldb/test/API/macosx/macCatalystAppMacOSFramework/TestMacCatalystAppWithMacOSFramework.py
  lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
  lldb/test/API/tools/lldb-server/TestGdbRemoteAuxvSupport.py
  lldb/test/API/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py
  lldb/test/API/tools/lldb-server/TestGdbRemoteHostInfo.py
  lldb/test/API/tools/lldb-server/TestGdbRemote_vCont.py
  lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
  lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py
  lldb/test/API/tools/lldb-vscode/console/TestVSCode_console.py
  lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py
  lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py
  lldb/test/API/tools/lldb-vscode/variables/TestVSCode_variables.py

Index: lldb/test/API/tools/lldb-vscode/variables/TestVSCode_variables.py
===
--- lldb/test/API/tools/lldb-vscode/variables/TestVSCode_variables.py
+++ lldb/test/API/tools/lldb-vscode/variables/TestVSCode_variables.py
@@ -69,8 +69,8 @@
 def verify_variables(self, verify_dict, variables, varref_dict=None):
 for variable in variables:
 name = variable['name']
-self.assertTrue(name in verify_dict,
-'variable "%s" in verify dictionary' % (name))
+self.assertIn(name, verify_dict,
+  'variable "%s" in verify dictionary' % (name))
 self.verify_values(verify_dict[name], variable, varref_dict)
 
 @skipIfWindows
Index: lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py
===
--- lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py
+++ lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py
@@ -31,7 +31,7 @@
 self.assertEqual(program_basename, program_module['name'])
 self.assertIn('path', program_module, 'make sure path is in module')
 self.assertEqual(program, program_module['path'])
-self.assertTrue('symbolFilePath' not in program_module, 'Make sure a.out.stripped has no debug info')
+self.assertNotIn('symbolFilePath', program_module, 'Make sure a.out.stripped has no debug info')
 symbols_path = self.getBuildArtifact(symbol_basename)
 self.vscode.request_evaluate('`%s' % ('target symbols add -s "%s" "%s"' % (program, symbols_path)))
 
Index: lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py
===
--- lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py
+++ lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py
@@ -33,8 +33,8 @@
 self.ass

[Lldb-commits] [PATCH] D96096: [lldb] Emit type annotation in SWIG generated Python code.

2021-02-04 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: labath, lanza, LLDB.
Herald added a subscriber: mgorny.
JDevlieghere requested review of this revision.

The Python code generated by SWIG is compatible with both Python 2 and Python 
3. The -py3 option enables Python 2 incompatible features such as function 
annotations and abstract base classes.

Given that this only affects the generated code (and as such doesn't cause 
merge conflicts downstream) we're happy to enable it


https://reviews.llvm.org/D96096

Files:
  lldb/bindings/python/CMakeLists.txt


Index: lldb/bindings/python/CMakeLists.txt
===
--- lldb/bindings/python/CMakeLists.txt
+++ lldb/bindings/python/CMakeLists.txt
@@ -10,6 +10,7 @@
   -c++
   -shadow
   -python
+  -py3
   -threads
   -outdir ${CMAKE_CURRENT_BINARY_DIR}
   -o ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp


Index: lldb/bindings/python/CMakeLists.txt
===
--- lldb/bindings/python/CMakeLists.txt
+++ lldb/bindings/python/CMakeLists.txt
@@ -10,6 +10,7 @@
   -c++
   -shadow
   -python
+  -py3
   -threads
   -outdir ${CMAKE_CURRENT_BINARY_DIR}
   -o ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D96095: [lldb] Use assertIn/NotIn over assertTrue/False (NFC)

2021-02-04 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96095

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


[Lldb-commits] [PATCH] D95710: [lldb/Commands] Add command options for ScriptedProcess to ProcessLaunch

2021-02-04 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib updated this revision to Diff 321647.
mib marked 2 inline comments as done.
mib edited the summary of this revision.
mib added a comment.

Address @jingham and @vsk comments.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95710

Files:
  lldb/include/lldb/Host/ProcessLaunchInfo.h
  lldb/source/Commands/CommandObjectPlatform.cpp
  lldb/source/Commands/CommandObjectProcess.cpp
  lldb/source/Commands/CommandOptionsProcessLaunch.cpp
  lldb/source/Commands/CommandOptionsProcessLaunch.h
  lldb/source/Host/common/ProcessLaunchInfo.cpp

Index: lldb/source/Host/common/ProcessLaunchInfo.cpp
===
--- lldb/source/Host/common/ProcessLaunchInfo.cpp
+++ lldb/source/Host/common/ProcessLaunchInfo.cpp
@@ -32,7 +32,8 @@
 : ProcessInfo(), m_working_dir(), m_plugin_name(), m_flags(0),
   m_file_actions(), m_pty(new PseudoTerminal), m_resume_count(0),
   m_monitor_callback(nullptr), m_monitor_callback_baton(nullptr),
-  m_monitor_signals(false), m_listener_sp(), m_hijack_listener_sp() {}
+  m_monitor_signals(false), m_listener_sp(), m_hijack_listener_sp(),
+  m_scripted_process_class_name(), m_scripted_process_dictionary_sp() {}
 
 ProcessLaunchInfo::ProcessLaunchInfo(const FileSpec &stdin_file_spec,
  const FileSpec &stdout_file_spec,
@@ -42,7 +43,8 @@
 : ProcessInfo(), m_working_dir(), m_plugin_name(), m_flags(launch_flags),
   m_file_actions(), m_pty(new PseudoTerminal), m_resume_count(0),
   m_monitor_callback(nullptr), m_monitor_callback_baton(nullptr),
-  m_monitor_signals(false), m_listener_sp(), m_hijack_listener_sp() {
+  m_monitor_signals(false), m_listener_sp(), m_hijack_listener_sp(),
+  m_scripted_process_class_name(), m_scripted_process_dictionary_sp() {
   if (stdin_file_spec) {
 FileAction file_action;
 const bool read = true;
@@ -171,6 +173,8 @@
   m_resume_count = 0;
   m_listener_sp.reset();
   m_hijack_listener_sp.reset();
+  m_scripted_process_class_name = "";
+  m_scripted_process_dictionary_sp.reset();
 }
 
 void ProcessLaunchInfo::SetMonitorProcessCallback(
Index: lldb/source/Commands/CommandOptionsProcessLaunch.h
===
--- lldb/source/Commands/CommandOptionsProcessLaunch.h
+++ lldb/source/Commands/CommandOptionsProcessLaunch.h
@@ -1,4 +1,4 @@
-//===-- CommandOptionsProcessLaunch.h -===//
+//===-- CommandOptionsProcessLaunch.h ---*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -16,9 +16,9 @@
 
 // CommandOptionsProcessLaunch
 
-class CommandOptionsProcessLaunch : public lldb_private::Options {
+class CommandOptionsProcessLaunch : public lldb_private::OptionGroup {
 public:
-  CommandOptionsProcessLaunch() : lldb_private::Options() {
+  CommandOptionsProcessLaunch() : lldb_private::OptionGroup() {
 // Keep default values of all options in one place: OptionParsingStarting
 // ()
 OptionParsingStarting(nullptr);
Index: lldb/source/Commands/CommandOptionsProcessLaunch.cpp
===
--- lldb/source/Commands/CommandOptionsProcessLaunch.cpp
+++ lldb/source/Commands/CommandOptionsProcessLaunch.cpp
@@ -30,7 +30,7 @@
 uint32_t option_idx, llvm::StringRef option_arg,
 ExecutionContext *execution_context) {
   Status error;
-  const int short_option = m_getopt_table[option_idx].val;
+  const int short_option = g_process_launch_options[option_idx].short_option;
 
   switch (short_option) {
   case 's': // Stop at program entry point
Index: lldb/source/Commands/CommandObjectProcess.cpp
===
--- lldb/source/Commands/CommandObjectProcess.cpp
+++ lldb/source/Commands/CommandObjectProcess.cpp
@@ -17,6 +17,7 @@
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
 #include "lldb/Interpreter/OptionArgParser.h"
+#include "lldb/Interpreter/OptionGroupPythonClassWithDict.h"
 #include "lldb/Interpreter/Options.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Process.h"
@@ -108,7 +109,12 @@
 interpreter, "process launch",
 "Launch the executable in the debugger.", nullptr,
 eCommandRequiresTarget, "restart"),
-m_options() {
+m_options(), m_class_options("scripted process"), m_all_options() {
+m_all_options.Append(&m_options);
+m_all_options.Append(&m_class_options, LLDB_OPT_SET_1 | LLDB_OPT_SET_2,
+ LLDB_OPT_SET_1);
+m_all_options.Finalize();
+
 CommandArgumentEntry arg;
 CommandArgumentData run_args_arg;
 
@@ -135,7 +141,7 @@
 request, nullptr);
   }
 

[Lldb-commits] [PATCH] D96096: [lldb] Emit type annotation in SWIG generated Python code.

2021-02-04 Thread Dave Lee via Phabricator via lldb-commits
kastiglione added a comment.

This will be nice!


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

https://reviews.llvm.org/D96096

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


[Lldb-commits] [PATCH] D96096: [lldb] Emit type annotation in SWIG generated Python code.

2021-02-04 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.

cool


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

https://reviews.llvm.org/D96096

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