[Lldb-commits] [PATCH] D74136: [LLDB] WIP: Follow DW_AT_decl_file when setting breakpoint

2020-06-18 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk updated this revision to Diff 271631.
kwk added a comment.

- Remove old logic that was no longer needed since my search filter now 
adaptively adds eSymbolContextCompUnit and not always returns it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74136

Files:
  lldb/include/lldb/Core/SearchFilter.h
  lldb/include/lldb/Target/Target.h
  lldb/source/Breakpoint/BreakpointResolverName.cpp
  lldb/source/Core/SearchFilter.cpp
  lldb/source/Target/Target.cpp
  lldb/test/Shell/Breakpoint/Inputs/search-support-files-func.cpp
  lldb/test/Shell/Breakpoint/Inputs/search-support-files.cpp
  lldb/test/Shell/Breakpoint/Inputs/search-support-files.h
  lldb/test/Shell/Breakpoint/search-support-files.test

Index: lldb/test/Shell/Breakpoint/search-support-files.test
===
--- /dev/null
+++ lldb/test/Shell/Breakpoint/search-support-files.test
@@ -0,0 +1,123 @@
+# In these tests we will set breakpoints on a function by name with the
+# target.inline-breakpoint-strategy setting alternating between set "always" and
+# "headers".
+
+# RUN: %build %p/Inputs/search-support-files.cpp -o %t.out
+# RUN: %lldb -b -s %s %t.out | FileCheck %s 
+
+
+#Set breakpoint by function name.
+
+
+settings set target.inline-breakpoint-strategy always
+breakpoint set -n function_in_header
+# CHECK: (lldb) breakpoint set -n function_in_header
+# CHECK-NEXT: Breakpoint 1: where = {{.*}}.out`function_in_header(){{.*}} at search-support-files.h
+
+settings set target.inline-breakpoint-strategy headers
+breakpoint set -n function_in_header
+# CHECK: (lldb) breakpoint set -n function_in_header
+# CHECK-NEXT: Breakpoint 2: where = {{.*}}.out`function_in_header(){{.*}} at search-support-files.h
+
+
+
+settings set target.inline-breakpoint-strategy always
+breakpoint set -n main
+# CHECK: (lldb) breakpoint set -n main
+# CHECK-NEXT: Breakpoint 3: where = {{.*}}.out`main{{.*}} at search-support-files.cpp
+
+settings set target.inline-breakpoint-strategy headers
+breakpoint set -n main
+# CHECK: (lldb) breakpoint set -n main
+# CHECK-NEXT: Breakpoint 4: where = {{.*}}.out`main{{.*}} at search-support-files.cpp
+
+
+
+settings set target.inline-breakpoint-strategy always
+breakpoint set -n func
+# CHECK: (lldb) breakpoint set -n func
+# CHECK-NEXT: Breakpoint 5: where = {{.*}}.out`func{{.*}} at search-support-files-func.cpp
+
+settings set target.inline-breakpoint-strategy headers
+breakpoint set -n func
+# CHECK: (lldb) breakpoint set -n func
+# CHECK-NEXT: Breakpoint 6: where = {{.*}}.out`func{{.*}} at search-support-files-func.cpp
+
+
+
+#   Set breakpoint by function name and filename (here: the compilation unit).
+
+
+
+settings set target.inline-breakpoint-strategy always
+breakpoint set -n function_in_header -f search-support-files.cpp
+# CHECK: (lldb) breakpoint set -n function_in_header -f search-support-files.cpp
+# CHECK-NEXT: Breakpoint 7: no locations (pending).
+
+settings set target.inline-breakpoint-strategy headers
+breakpoint set -n function_in_header -f search-support-files.cpp
+# CHECK: (lldb) breakpoint set -n function_in_header -f search-support-files.cpp
+# CHECK-NEXT: Breakpoint 8: no locations (pending).
+
+
+
+#   Set breakpoint by function name and source filename (the file in which the
+#   function is defined).
+#
+#   NOTE: This test is the really interesting one as it shows that we can
+# search by source files that are themselves no compilation units.
+
+
+
+settings set target.inline-breakpoint-strategy always
+breakpoint set -n function_in_header -f search-support-files.h
+# CHECK: (lldb) breakpoint set -n function_in_header -f search-support-files.h
+# CHECK-NEXT: Breakpoint 9: where = {{.*}}.out`function_in_header(){{.*}} at search-support-files.h
+
+settings set target.inline-breakpoint-strategy headers
+breakpoint set -n function_in_header -f search-support-files.h
+# CHECK: (lldb) breakpoint set -n function_in_header -f search-support-files.h
+# CHECK-NEXT: Breakpoint 10: where = {{.*}}.out`function_in_header(){{.*}} at search-support-files.h
+
+
+settings set target.inline-breakpoint-strategy always
+breakpoint set -n func -f search-support-files-func.cpp
+# CHECK: (lldb) breakpoint set -n func -f search-support-files-func.cpp
+# CHECK-NEXT: Breakpoint 11: where = {{.*}}.out`func(){{.*}} at search-support-files-func.cpp
+
+settings set target.inline-breakpoint-strategy headers
+breakpoint set -n func -f search-support-files-func.cpp
+# CHECK: (lldb) breakpoint set -n func -f search-support-files-func.cpp
+# CHECK-NEXT: Breakpoint 12: no locations (pending).
+
+
+
+#   Set breakpoint by function name and source filename. This time the file
+#   doesn't exist or is not the file in which the function is declared or
+#   defined. This is to prove that we haven't widen the search space too much.
+#   When we search for a function in a file that doesn't exist, we sho

[Lldb-commits] [PATCH] D78801: [LLDB] Add class WasmProcess for WebAssembly debugging

2020-06-18 Thread Paolo Severini via Phabricator via lldb-commits
paolosev added a comment.



> What about replacing ProcessReadMemory(addr_t addr, ...) with 
> ProcessReadMemory(Address addr, ...), or even banning the use of lldb::addr_t 
> on everywhere except in the bowels of Process subclasses and as an 
> interchange for getting addresses as text from users.  You might want to 
> store lldb::addr_t's for Symbol values for space concerns, but presumably the 
> Symbol File would know the relevant address space, so it would fix that up 
> and always hand out Addresses.
> 
> This would be a pretty big but mostly formal change.  It would seem more 
> natural, Address is our abstraction for addresses in a process.  Instead we 
> have this odd mix of API's that take lldb::addr_t and some that take Address.

Before all, I really apologize for the huge delay of this reply to your last 
comments. I had to focus on different tasks in the last couple of weeks and I 
needed to find some time to understand how `Process::ReadMemory` (and 
`WriteMemory`) could be modified to work with `Address` objects and not with 
`addr_t`.
It is certainly possible, but a problem, IMHO, is that class `Address` can be 
several things:

- An offset in a section in a file
- An offset in a loaded section
- An absolute address in memory

If we modify ReadMemory to be:

  Process::ReadMemory(const Address& address, void *buf, size_t size, Status 
&error)

then there we need to convert this Address into a concrete `addr_t`, to 
actually read from the MemoryCache (MemoryCache::Read) or from the debuggee 
(ReadMemoryFromInferior).
But how do we do this conversion? If we are dealing with a file we should use 
`lldb::addr_t Address::GetFileAddress()`. Otherwise we should call 
`lldb::addr_t Address::GetLoadAddress(Target *target)` I don't know if we have 
enough information in Process::ReadMemory() to always be able to correctly 
differentiate between the two cases. And in the latter case we should rely on 
Process::GetTarget() returning the valid target to pass to 
Address::GetLoadAddress.

The question then is: should `Address` know if it needs to be interpreted as a 
file address or load address?  Should we have an `AddressType` field in Address?
We already have this enum that maybe we could reuse:

  enum AddressType {
eAddressTypeInvalid = 0,
eAddressTypeFile, /// Address is an address as found in an object or symbol 
file
eAddressTypeLoad, /// Address is an address as in the current target 
inferior process
eAddressTypeHost  /// Address is an address in the process that is running 
code
  };

Process::ReadMemory is called by many places in the LLDB code. In some of them, 
like `Value::GetValueAsData`, `DWARFExpression::Evaluate`, 
`ValueObject::GetPointeeData`, it should be fairly simple to construct the 
Address to read from. (And that should solve the problems for Wasm).
But in other places it is not so clear what we should do. Some code works with 
absolute addresses and does not need Sections (see table below). In these 
cases, we could rely on the Address constructor that accepts just an absolute 
addr_t as argument, and sets `m_section_wp` as null:

  Address(lldb::addr_t abs_addr);

The existence of this constructor already makes most of the LLDB compile even 
after changing function ReadMemory to use an Address as argument, in class 
Process and in Process-derived classes. But then class `Address` would be in 
many cases just a wrapper over an `addr_t`.  It seems to me that would go 
against the idea of using just Address as our abstraction for all addresses in 
a process.

This table describes where Process::ReadMemory is called and how the addresses 
we pass to ReadMemory originate:

| ABI\AArch64\ABIMacOSX_arm64.cpp  | 
LoadValueFromConsecutiveGPRRegisters| 
addr_t from reg_ctx 
|
| ABI\AArch64\ABISysV_arm64.cpp| 
LoadValueFromConsecutiveGPRRegisters| 
addr_t from RegisterContext 
|
| ABI\ARM\ABISysV_arm.cpp  | 
GetReturnValuePassedInMemory| 
addr_t from RegisterContext 
|
| ABI\PowerPC\ABISysV_ppc64.cpp| 
GetStructValueObject| 
addr_t from Register
|
| Commands\CommandObjectMemory.cpp | 
CommandObjectMemoryFind::ProcessMemoryIterator:: operator[] | 
addr_t from m_base_data_address 
|
| DynamicLoader\MacOSX-DYLD\DynamicLoaderMacOSXDYLD.cpp| 
DoInitialImageFetch   

[Lldb-commits] [PATCH] D81980: Repair support for launching iphone/tv/watch simulator binaries through platform

2020-06-18 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment.

Generally this looks really nice!




Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:135
+   ifeq "$(TRIPLE_ENV)" ""
+   CODESIGN := codesign
+   endif

If I've read this correctly, this means we'll only sign when `TRIPLE_OS == 
"macosx" && TRIPLE_ENV == ""`. Is that what we want, or should we be signing 
everything?



Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:143
+   ifeq "$(TRIPLE_VERSION)" ""
+   TRIPLE_VERSION := $(shell echo $(notdir $(SDKROOT)) | 
grep -E -o -e '[0-9]+\.[0-9]')
+   endif

Can we just write `xcrun --sdk $(SDK_NAME) --show-sdk-version`?

If not, is the "-e" option to grep redundant, since there's only one pattern to 
match?


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

https://reviews.llvm.org/D81980



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


[Lldb-commits] [lldb] 50939c0 - Add SveBFloat16 to type switch.

2020-06-18 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-06-18T12:39:03-07:00
New Revision: 50939c0a67619b77d085bfafb2cedda413d57b7a

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

LOG: Add SveBFloat16 to type switch.

Added: 


Modified: 
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Removed: 




diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 4348d1817297..d63754d127e3 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -4852,6 +4852,7 @@ lldb::Encoding 
TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
 case clang::BuiltinType::SveUint64x3:
 case clang::BuiltinType::SveUint64x4:
 case clang::BuiltinType::SveFloat16:
+case clang::BuiltinType::SveBFloat16:
 case clang::BuiltinType::SveFloat16x2:
 case clang::BuiltinType::SveFloat16x3:
 case clang::BuiltinType::SveFloat16x4:



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


[Lldb-commits] [PATCH] D82121: Set appropriate host defines for building under emscripten

2020-06-18 Thread Derek Schuff via Phabricator via lldb-commits
dschuff created this revision.
Herald added subscribers: llvm-commits, lldb-commits, aheejin, krytarowski.
Herald added projects: LLDB, LLVM.

Emscripten has emulations for several headers found on Linux,
including spwan.h and endian.h


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82121

Files:
  lldb/include/lldb/Host/HostInfo.h
  lldb/source/Host/common/Host.cpp
  llvm/include/llvm/Support/SwapByteOrder.h


Index: llvm/include/llvm/Support/SwapByteOrder.h
===
--- llvm/include/llvm/Support/SwapByteOrder.h
+++ llvm/include/llvm/Support/SwapByteOrder.h
@@ -21,7 +21,8 @@
 #include 
 #endif
 
-#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
+#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) ||
\
+defined(__EMSCRIPTEN__)
 #include 
 #elif defined(_AIX)
 #include 
Index: lldb/source/Host/common/Host.cpp
===
--- lldb/source/Host/common/Host.cpp
+++ lldb/source/Host/common/Host.cpp
@@ -28,7 +28,7 @@
 
 #if defined(__linux__) || defined(__FreeBSD__) ||  
\
 defined(__FreeBSD_kernel__) || defined(__APPLE__) ||   
\
-defined(__NetBSD__) || defined(__OpenBSD__)
+defined(__NetBSD__) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__)
 #if !defined(__ANDROID__)
 #include 
 #endif
Index: lldb/include/lldb/Host/HostInfo.h
===
--- lldb/include/lldb/Host/HostInfo.h
+++ lldb/include/lldb/Host/HostInfo.h
@@ -35,7 +35,7 @@
 #if defined(_WIN32)
 #include "lldb/Host/windows/HostInfoWindows.h"
 #define HOST_INFO_TYPE HostInfoWindows
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__EMSCRIPTEN__)
 #if defined(__ANDROID__)
 #include "lldb/Host/android/HostInfoAndroid.h"
 #define HOST_INFO_TYPE HostInfoAndroid


Index: llvm/include/llvm/Support/SwapByteOrder.h
===
--- llvm/include/llvm/Support/SwapByteOrder.h
+++ llvm/include/llvm/Support/SwapByteOrder.h
@@ -21,7 +21,8 @@
 #include 
 #endif
 
-#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
+#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) ||\
+defined(__EMSCRIPTEN__)
 #include 
 #elif defined(_AIX)
 #include 
Index: lldb/source/Host/common/Host.cpp
===
--- lldb/source/Host/common/Host.cpp
+++ lldb/source/Host/common/Host.cpp
@@ -28,7 +28,7 @@
 
 #if defined(__linux__) || defined(__FreeBSD__) ||  \
 defined(__FreeBSD_kernel__) || defined(__APPLE__) ||   \
-defined(__NetBSD__) || defined(__OpenBSD__)
+defined(__NetBSD__) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__)
 #if !defined(__ANDROID__)
 #include 
 #endif
Index: lldb/include/lldb/Host/HostInfo.h
===
--- lldb/include/lldb/Host/HostInfo.h
+++ lldb/include/lldb/Host/HostInfo.h
@@ -35,7 +35,7 @@
 #if defined(_WIN32)
 #include "lldb/Host/windows/HostInfoWindows.h"
 #define HOST_INFO_TYPE HostInfoWindows
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__EMSCRIPTEN__)
 #if defined(__ANDROID__)
 #include "lldb/Host/android/HostInfoAndroid.h"
 #define HOST_INFO_TYPE HostInfoAndroid
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D82121: Set appropriate host defines for building under emscripten

2020-06-18 Thread Derek Schuff via Phabricator via lldb-commits
dschuff added a reviewer: JDevlieghere.
dschuff added a comment.

Just taking a guess on a reviewer...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82121



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


[Lldb-commits] [PATCH] D82121: Set appropriate host defines for building under emscripten

2020-06-18 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.

Looks plausible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82121



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


[Lldb-commits] [PATCH] D81980: Repair support for launching iphone/tv/watch simulator binaries through platform

2020-06-18 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 271878.
aprantl added a comment.

Actually update the patch and not the diff from my previous patch.


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

https://reviews.llvm.org/D81980

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
  lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h
  lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h
  lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h
  
lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm
  lldb/test/API/functionalities/fat_archives/Makefile
  lldb/test/API/lang/objcxx/class-name-clash/Makefile
  lldb/test/API/macosx/find-app-in-bundle/Makefile
  lldb/test/API/macosx/find-app-in-bundle/TestFindAppInBundle.py
  lldb/test/API/macosx/find-dsym/bundle-with-dot-in-filename/Makefile
  
lldb/test/API/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py
  lldb/test/API/macosx/find-dsym/deep-bundle/Makefile
  lldb/test/API/macosx/find-dsym/deep-bundle/TestDeepBundle.py
  lldb/test/API/macosx/simulator/Makefile
  lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
  lldb/test/API/macosx/simulator/hello.c
  lldb/test/API/macosx/universal/Makefile

Index: lldb/test/API/macosx/universal/Makefile
===
--- lldb/test/API/macosx/universal/Makefile
+++ lldb/test/API/macosx/universal/Makefile
@@ -8,13 +8,13 @@
 	lipo -create -o testit $^
 
 testit.x86_64h: testit.x86_64h.o
-	$(CC) -arch x86_64h -o testit.x86_64h $<
+	$(CC) -isysroot $(SDKROOT) -arch x86_64h -o testit.x86_64h $<
 
 testit.x86_64: testit.x86_64.o
-	$(CC) -arch x86_64 -o testit.x86_64 $<
+	$(CC) -isysroot $(SDKROOT) -arch x86_64 -o testit.x86_64 $<
 
 testit.x86_64h.o: main.c
-	$(CC) -g -O0 -arch x86_64h -c -o testit.x86_64h.o $<
+	$(CC) -isysroot $(SDKROOT) -g -O0 -arch x86_64h -c -o testit.x86_64h.o $<
 
 testit.x86_64.o: main.c
-	$(CC) -g -O0 -arch x86_64 -c -o testit.x86_64.o $<
+	$(CC) -isysroot $(SDKROOT) -g -O0 -arch x86_64 -c -o testit.x86_64.o $<
Index: lldb/test/API/macosx/simulator/hello.c
===
--- /dev/null
+++ lldb/test/API/macosx/simulator/hello.c
@@ -0,0 +1,5 @@
+void puts(char *);
+int main(int argc, char **argv) {
+  puts("break here\n");
+  return 0;
+}
Index: lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
===
--- /dev/null
+++ lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
@@ -0,0 +1,46 @@
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+import lldbsuite.test.lldbutil as lldbutil
+import json
+import unittest2
+
+
+class TestSimulatorPlatformLaunching(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+NO_DEBUG_INFO_TESTCASE = True
+
+def run_with(self, arch, platform, os, env):
+self.build(dictionary={'TRIPLE': arch+'-apple-'+os+'-'+env, 'ARCH': arch})
+lldbutil.run_to_source_breakpoint(self, "break here",
+  lldb.SBFileSpec("hello.c"))
+self.expect('image list -b -t',
+patterns=['a\.out '+arch+'-apple-'+os+'.*-'+env])
+
+@skipUnlessDarwin
+@skipIfDarwinEmbedded
+@apple_simulator_test('iphone')
+def test_ios(self):
+"""Test running an iOS simulator binary"""
+self.run_with(arch=self.getArchitecture(),
+  os='ios', env='simulator',
+  platform='iphonesimulator')
+
+@skipUnlessDarwin
+@skipIfDarwinEmbedded
+@apple_simulator_test('appletv')
+def test_tvos(self):
+"""Test running an tvOS simulator binary"""
+self.run_with(arch=self.getArchitecture(),
+  os='tvos', env='simulator',
+  platform='appletvsimulator')
+
+@skipUnlessDarwin
+@skipIfDarwinEmbedded
+@apple_simulator_test('watch')
+def test_watchos(self):
+"""Test running a 32-bit watchOS simulator binary"""
+self.run_with(arch='i386',
+  os='watchos', env='simulator',
+  platform='watchsimulator')
Index: lldb/test/API/macosx/simulator/Makefile
===
--- /dev/null
+++ lldb/test/API/macosx/simulator/Makefile
@@ -0,0 +1,3 @@
+C_SOURCES := hello.c
+
+include Makefile.rules
Index: lldb/test/API/macosx/find-dsym/deep-bundle/TestDeepBun

[Lldb-commits] [PATCH] D81980: Repair support for launching iphone/tv/watch simulator binaries through platform

2020-06-18 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl marked an inline comment as done.
aprantl added inline comments.



Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:135
+   ifeq "$(TRIPLE_ENV)" ""
+   CODESIGN := codesign
+   endif

vsk wrote:
> If I've read this correctly, this means we'll only sign when `TRIPLE_OS == 
> "macosx" && TRIPLE_ENV == ""`. Is that what we want, or should we be signing 
> everything?
This is preserving the old behavior, and IIUC code signing on macOS is just 
slowing things down with no advantage.



Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:143
+   ifeq "$(TRIPLE_VERSION)" ""
+   TRIPLE_VERSION := $(shell echo $(notdir $(SDKROOT)) | 
grep -E -o -e '[0-9]+\.[0-9]')
+   endif

vsk wrote:
> Can we just write `xcrun --sdk $(SDK_NAME) --show-sdk-version`?
> 
> If not, is the "-e" option to grep redundant, since there's only one pattern 
> to match?
Yes, that's nicer!


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

https://reviews.llvm.org/D81980



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


[Lldb-commits] [PATCH] D81980: Repair support for launching iphone/tv/watch simulator binaries through platform

2020-06-18 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 271877.
aprantl marked an inline comment as done.
aprantl added a comment.

Simplify version detection.


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

https://reviews.llvm.org/D81980

Files:
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules


Index: lldb/packages/Python/lldbsuite/test/make/Makefile.rules
===
--- lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -140,7 +140,10 @@
SDKROOT := $(shell xcrun --sdk $(SDK_NAME) 
--show-sdk-path)
endif
ifeq "$(TRIPLE_VERSION)" ""
-   TRIPLE_VERSION := $(shell echo $(notdir $(SDKROOT)) | 
grep -E -o -e '[0-9]+\.[0-9]')
+   ifeq "$(SDK_NAME)" ""
+   $(error "SDK_NAME is empty")
+   endif
+   TRIPLE_VERSION := $(shell xcrun --sdk $(SDK_NAME) 
--show-sdk-version)
endif
ifeq "$(TRIPLE_ENV)" "simulator"
ARCH_CFLAGS := 
-m$(TRIPLE_OS)-simulator-version-min=$(TRIPLE_VERSION)


Index: lldb/packages/Python/lldbsuite/test/make/Makefile.rules
===
--- lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -140,7 +140,10 @@
 			SDKROOT := $(shell xcrun --sdk $(SDK_NAME) --show-sdk-path)
 		endif
 		ifeq "$(TRIPLE_VERSION)" ""
-			TRIPLE_VERSION := $(shell echo $(notdir $(SDKROOT)) | grep -E -o -e '[0-9]+\.[0-9]')
+			ifeq "$(SDK_NAME)" ""
+   $(error "SDK_NAME is empty")
+			endif
+			TRIPLE_VERSION := $(shell xcrun --sdk $(SDK_NAME) --show-sdk-version)
 		endif
 		ifeq "$(TRIPLE_ENV)" "simulator"
 			ARCH_CFLAGS := -m$(TRIPLE_OS)-simulator-version-min=$(TRIPLE_VERSION)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] c1709e5 - Set appropriate host defines for building under emscripten

2020-06-18 Thread Derek Schuff via lldb-commits

Author: Derek Schuff
Date: 2020-06-18T17:00:53-07:00
New Revision: c1709e5d90e613917d616a7866ee52cfac311de6

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

LOG: Set appropriate host defines for building under emscripten

Emscripten has emulations for several headers found on Linux,
including spwan.h and endian.h

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

Added: 


Modified: 
lldb/include/lldb/Host/HostInfo.h
lldb/source/Host/common/Host.cpp
llvm/include/llvm/Support/SwapByteOrder.h

Removed: 




diff  --git a/lldb/include/lldb/Host/HostInfo.h 
b/lldb/include/lldb/Host/HostInfo.h
index a9b10aed47c2..b7010d69d88e 100644
--- a/lldb/include/lldb/Host/HostInfo.h
+++ b/lldb/include/lldb/Host/HostInfo.h
@@ -35,7 +35,7 @@
 #if defined(_WIN32)
 #include "lldb/Host/windows/HostInfoWindows.h"
 #define HOST_INFO_TYPE HostInfoWindows
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__EMSCRIPTEN__)
 #if defined(__ANDROID__)
 #include "lldb/Host/android/HostInfoAndroid.h"
 #define HOST_INFO_TYPE HostInfoAndroid

diff  --git a/lldb/source/Host/common/Host.cpp 
b/lldb/source/Host/common/Host.cpp
index a5705c92afec..4128fa19c142 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -28,7 +28,7 @@
 
 #if defined(__linux__) || defined(__FreeBSD__) ||  
\
 defined(__FreeBSD_kernel__) || defined(__APPLE__) ||   
\
-defined(__NetBSD__) || defined(__OpenBSD__)
+defined(__NetBSD__) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__)
 #if !defined(__ANDROID__)
 #include 
 #endif

diff  --git a/llvm/include/llvm/Support/SwapByteOrder.h 
b/llvm/include/llvm/Support/SwapByteOrder.h
index a9f43735328f..500df2355307 100644
--- a/llvm/include/llvm/Support/SwapByteOrder.h
+++ b/llvm/include/llvm/Support/SwapByteOrder.h
@@ -21,7 +21,8 @@
 #include 
 #endif
 
-#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
+#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) ||
\
+defined(__EMSCRIPTEN__)
 #include 
 #elif defined(_AIX)
 #include 



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


[Lldb-commits] [PATCH] D82121: Set appropriate host defines for building under emscripten

2020-06-18 Thread Derek Schuff via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc1709e5d90e6: Set appropriate host defines for building 
under emscripten (authored by dschuff).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82121

Files:
  lldb/include/lldb/Host/HostInfo.h
  lldb/source/Host/common/Host.cpp
  llvm/include/llvm/Support/SwapByteOrder.h


Index: llvm/include/llvm/Support/SwapByteOrder.h
===
--- llvm/include/llvm/Support/SwapByteOrder.h
+++ llvm/include/llvm/Support/SwapByteOrder.h
@@ -21,7 +21,8 @@
 #include 
 #endif
 
-#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
+#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) ||
\
+defined(__EMSCRIPTEN__)
 #include 
 #elif defined(_AIX)
 #include 
Index: lldb/source/Host/common/Host.cpp
===
--- lldb/source/Host/common/Host.cpp
+++ lldb/source/Host/common/Host.cpp
@@ -28,7 +28,7 @@
 
 #if defined(__linux__) || defined(__FreeBSD__) ||  
\
 defined(__FreeBSD_kernel__) || defined(__APPLE__) ||   
\
-defined(__NetBSD__) || defined(__OpenBSD__)
+defined(__NetBSD__) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__)
 #if !defined(__ANDROID__)
 #include 
 #endif
Index: lldb/include/lldb/Host/HostInfo.h
===
--- lldb/include/lldb/Host/HostInfo.h
+++ lldb/include/lldb/Host/HostInfo.h
@@ -35,7 +35,7 @@
 #if defined(_WIN32)
 #include "lldb/Host/windows/HostInfoWindows.h"
 #define HOST_INFO_TYPE HostInfoWindows
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__EMSCRIPTEN__)
 #if defined(__ANDROID__)
 #include "lldb/Host/android/HostInfoAndroid.h"
 #define HOST_INFO_TYPE HostInfoAndroid


Index: llvm/include/llvm/Support/SwapByteOrder.h
===
--- llvm/include/llvm/Support/SwapByteOrder.h
+++ llvm/include/llvm/Support/SwapByteOrder.h
@@ -21,7 +21,8 @@
 #include 
 #endif
 
-#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
+#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) ||\
+defined(__EMSCRIPTEN__)
 #include 
 #elif defined(_AIX)
 #include 
Index: lldb/source/Host/common/Host.cpp
===
--- lldb/source/Host/common/Host.cpp
+++ lldb/source/Host/common/Host.cpp
@@ -28,7 +28,7 @@
 
 #if defined(__linux__) || defined(__FreeBSD__) ||  \
 defined(__FreeBSD_kernel__) || defined(__APPLE__) ||   \
-defined(__NetBSD__) || defined(__OpenBSD__)
+defined(__NetBSD__) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__)
 #if !defined(__ANDROID__)
 #include 
 #endif
Index: lldb/include/lldb/Host/HostInfo.h
===
--- lldb/include/lldb/Host/HostInfo.h
+++ lldb/include/lldb/Host/HostInfo.h
@@ -35,7 +35,7 @@
 #if defined(_WIN32)
 #include "lldb/Host/windows/HostInfoWindows.h"
 #define HOST_INFO_TYPE HostInfoWindows
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__EMSCRIPTEN__)
 #if defined(__ANDROID__)
 #include "lldb/Host/android/HostInfoAndroid.h"
 #define HOST_INFO_TYPE HostInfoAndroid
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D81980: Repair support for launching iphone/tv/watch simulator binaries through platform

2020-06-18 Thread Vedant Kumar via Phabricator via lldb-commits
vsk accepted this revision.
vsk added inline comments.
This revision is now accepted and ready to land.



Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:135
+   ifeq "$(TRIPLE_ENV)" ""
+   CODESIGN := codesign
+   endif

aprantl wrote:
> vsk wrote:
> > If I've read this correctly, this means we'll only sign when `TRIPLE_OS == 
> > "macosx" && TRIPLE_ENV == ""`. Is that what we want, or should we be 
> > signing everything?
> This is preserving the old behavior, and IIUC code signing on macOS is just 
> slowing things down with no advantage.
Oh I see. We actually need this change to make sure things for watch/tv get 
signed. Earlier, I misread `ifneq "$(TRIPLE_OS)" "macosx"` as `ifeq 
"$(TRIPLE_OS)" "macosx"`.


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

https://reviews.llvm.org/D81980



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