[Lldb-commits] [lldb] ea2af72 - [lldb] Refactored TestCallOverriddenMethod.py to general virtual function test

2020-02-10 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-02-10T09:40:40+01:00
New Revision: ea2af727a5c38906e3d1321de51aaa126b4efc69

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

LOG: [lldb] Refactored TestCallOverriddenMethod.py to general virtual function 
test

This actually tests all the different situations in which we can call virtual
functions. This removes also all skipIfs as the first skipIf for Linux is
apparently fixed and the second skipIf was just failing due to the constructor
call (which should be its own test and not be tested here).

Added: 
lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-functions/Makefile

lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-functions/TestCppVirtualFunctions.py
lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-functions/main.cpp

Modified: 


Removed: 
lldb/packages/Python/lldbsuite/test/lang/cpp/overriden-methods/Makefile

lldb/packages/Python/lldbsuite/test/lang/cpp/overriden-methods/TestCallOverriddenMethod.py
lldb/packages/Python/lldbsuite/test/lang/cpp/overriden-methods/main.cpp



diff  --git 
a/lldb/packages/Python/lldbsuite/test/lang/cpp/overriden-methods/TestCallOverriddenMethod.py
 
b/lldb/packages/Python/lldbsuite/test/lang/cpp/overriden-methods/TestCallOverriddenMethod.py
deleted file mode 100644
index 05287f4df691..
--- 
a/lldb/packages/Python/lldbsuite/test/lang/cpp/overriden-methods/TestCallOverriddenMethod.py
+++ /dev/null
@@ -1,82 +0,0 @@
-"""
-Test calling an overriden method.
-
-Note:
-  This verifies that LLDB is correctly building the method overrides table.
-  If this table is not built correctly then calls to overridden methods in
-  derived classes may generate references to non-existant vtable entries,
-  as the compiler treats the overridden method as a totally new virtual
-  method definition.
-  
-
-"""
-
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-class ExprCommandCallOverriddenMethod(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-def setUp(self):
-# Call super's setUp().
-TestBase.setUp(self)
-# Find the line number to break for main.c.
-self.line = line_number('main.cpp', '// Set breakpoint here')
-
-def test_call_on_base(self):
-"""Test calls to overridden methods in derived classes."""
-self.build()
-
-# Set breakpoint in main and run exe
-self.runCmd("file " + self.getBuildArtifact("a.out"),
-CURRENT_EXECUTABLE_SET)
-lldbutil.run_break_set_by_file_and_line(
-self, "main.cpp", self.line, num_expected_locations=-1, 
loc_exact=True)
-
-self.runCmd("run", RUN_SUCCEEDED)
-
-# Test call to method in base class (this should always work as the 
base
-# class method is never an override).
-self.expect_expr("b->foo()", result_type="int", result_value="2")
-
-# Test calling the base class.
-self.expect_expr("realbase.foo()", result_type="int", result_value="1")
-
-@skipIfLinux # Returns wrong result code on some platforms.
-def test_call_on_derived(self):
-"""Test calls to overridden methods in derived classes."""
-self.build()
-
-# Set breakpoint in main and run exe
-self.runCmd("file " + self.getBuildArtifact("a.out"),
-CURRENT_EXECUTABLE_SET)
-lldbutil.run_break_set_by_file_and_line(
-self, "main.cpp", self.line, num_expected_locations=-1, 
loc_exact=True)
-
-self.runCmd("run", RUN_SUCCEEDED)
-
-# Test call to overridden method in derived class (this will fail if 
the
-# overrides table is not correctly set up, as Derived::foo will be 
assigned
-# a vtable entry that does not exist in the compiled program).
-self.expect_expr("d.foo()", result_type="int", result_value="2")
-
-@skipIf(oslist=["linux"], archs=["aarch64"])
-@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr43707")
-def test_call_on_temporary(self):
-"""Test calls to overridden methods in derived classes."""
-self.build()
-
-# Set breakpoint in main and run exe
-self.runCmd("file " + self.getBuildArtifact("a.out"),
-CURRENT_EXECUTABLE_SET)
-lldbutil.run_break_set_by_file_and_line(
-self, "main.cpp", self.line, num_expected_locations=-1, 
loc_exact=True)
-
-self.runCmd("run", RUN_SUCCEEDED)
-
-# Test with locally constructed instances.
-self.expect_expr("Base().foo()", result_type="int", result_value="1")
-self.expect_expr("Derived().foo()", result_type="int", 
result_value="2")

diff  --git 
a/lldb/packages/Python/lldb

[Lldb-commits] [lldb] d2e0fee - [lldb] [doc] Change sample commands prefix from > to $

2020-02-10 Thread Jan Kratochvil via lldb-commits

Author: Jan Kratochvil
Date: 2020-02-10T09:50:37+01:00
New Revision: d2e0fee77bc82a54bcc11ce778ce12f068f9e326

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

LOG: [lldb] [doc] Change sample commands prefix from > to $

Remove all beginning > from the sample commands as my accidental
copy-paste (multiple times...) will discard ./bin/llvm-lit which is
difficult to rebuild (I have to rm -rf and cmake it all again).

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

Added: 


Modified: 
lldb/docs/resources/test.rst

Removed: 




diff  --git a/lldb/docs/resources/test.rst b/lldb/docs/resources/test.rst
index 63faf83ed597..26b6a73ec5d4 100644
--- a/lldb/docs/resources/test.rst
+++ b/lldb/docs/resources/test.rst
@@ -51,8 +51,8 @@ built with a custom version of clang, do:
 
 ::
 
-   > cmake -DLLDB_TEST_USER_ARGS="-A i386 -C /path/to/custom/clang" -G Ninja
-   > ninja check-lldb
+   $ cmake -DLLDB_TEST_USER_ARGS="-A i386 -C /path/to/custom/clang" -G Ninja
+   $ ninja check-lldb
 
 Note that multiple ``-A`` and ``-C`` flags can be specified to
 ``LLDB_TEST_USER_ARGS``.
@@ -82,7 +82,7 @@ run as part of a test suite.
 
 ::
 
-   > ./bin/llvm-lit -sv tools/lldb/test --filter 
+   $ ./bin/llvm-lit -sv tools/lldb/test --filter 
 
 
 Because lit automatically scans a directory for tests, it's also possible to
@@ -90,7 +90,7 @@ pass a subdirectory to run a specific subset of the tests.
 
 ::
 
-   > ./bin/llvm-lit -sv 
tools/lldb/test/Shell/Commands/CommandScriptImmediateOutput
+   $ ./bin/llvm-lit -sv 
tools/lldb/test/Shell/Commands/CommandScriptImmediateOutput
 
 
 For the SB API tests it is possible to forward arguments to ``dotest.py`` by
@@ -98,7 +98,7 @@ passing ``--param`` to lit and setting a value for 
``dotest-args``.
 
 ::
 
-   > ./bin/llvm-lit -sv tools/lldb/test --param dotest-args='-C gcc'
+   $ ./bin/llvm-lit -sv tools/lldb/test --param dotest-args='-C gcc'
 
 
 Below is an overview of running individual test in the unit and API test suites
@@ -119,12 +119,12 @@ For example, to run the test cases defined in 
TestInferiorCrashing.py, run:
 
 ::
 
-   > ./bin/lldb-dotest -p TestInferiorCrashing.py
+   $ ./bin/lldb-dotest -p TestInferiorCrashing.py
 
 ::
 
-   > cd $lldb/test
-   > python dotest.py --executable  -p TestInferiorCrashing.py 
../packages/Python/lldbsuite/test
+   $ cd $lldb/test
+   $ python dotest.py --executable  -p TestInferiorCrashing.py 
../packages/Python/lldbsuite/test
 
 If the test is not specified by name (e.g. if you leave the ``-p`` argument
 off),  all tests in that directory will be executed:
@@ -132,17 +132,17 @@ off),  all tests in that directory will be executed:
 
 ::
 
-   > ./bin/lldb-dotest functionalities/data-formatter
+   $ ./bin/lldb-dotest functionalities/data-formatter
 
 ::
 
-   > python dotest.py --executable  
functionalities/data-formatter
+   $ python dotest.py --executable  
functionalities/data-formatter
 
 Many more options that are available. To see a list of all of them, run:
 
 ::
 
-   > python dotest.py -h
+   $ python dotest.py -h
 
 
 Running a Specific Test or Set of Tests: Unit Tests
@@ -154,14 +154,14 @@ To run them, just run the test binary, for example, to 
run all the Host tests:
 
 ::
 
-   > ./tools/lldb/unittests/Host/HostTests
+   $ ./tools/lldb/unittests/Host/HostTests
 
 
 To run a specific test, pass a filter, for example:
 
 ::
 
-   > ./tools/lldb/unittests/Host/HostTests 
--gtest_filter=SocketTest.DomainListenConnectAccept
+   $ ./tools/lldb/unittests/Host/HostTests 
--gtest_filter=SocketTest.DomainListenConnectAccept
 
 
 Running the Test Suite Remotely



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


[Lldb-commits] [PATCH] D74296: [lldb] [doc] Sample commands prefix from > to $

2020-02-10 Thread Jan Kratochvil via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd2e0fee77bc8: [lldb] [doc] Change sample commands prefix 
from > to $ (authored by jankratochvil).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74296

Files:
  lldb/docs/resources/test.rst


Index: lldb/docs/resources/test.rst
===
--- lldb/docs/resources/test.rst
+++ lldb/docs/resources/test.rst
@@ -51,8 +51,8 @@
 
 ::
 
-   > cmake -DLLDB_TEST_USER_ARGS="-A i386 -C /path/to/custom/clang" -G Ninja
-   > ninja check-lldb
+   $ cmake -DLLDB_TEST_USER_ARGS="-A i386 -C /path/to/custom/clang" -G Ninja
+   $ ninja check-lldb
 
 Note that multiple ``-A`` and ``-C`` flags can be specified to
 ``LLDB_TEST_USER_ARGS``.
@@ -82,7 +82,7 @@
 
 ::
 
-   > ./bin/llvm-lit -sv tools/lldb/test --filter 
+   $ ./bin/llvm-lit -sv tools/lldb/test --filter 
 
 
 Because lit automatically scans a directory for tests, it's also possible to
@@ -90,7 +90,7 @@
 
 ::
 
-   > ./bin/llvm-lit -sv 
tools/lldb/test/Shell/Commands/CommandScriptImmediateOutput
+   $ ./bin/llvm-lit -sv 
tools/lldb/test/Shell/Commands/CommandScriptImmediateOutput
 
 
 For the SB API tests it is possible to forward arguments to ``dotest.py`` by
@@ -98,7 +98,7 @@
 
 ::
 
-   > ./bin/llvm-lit -sv tools/lldb/test --param dotest-args='-C gcc'
+   $ ./bin/llvm-lit -sv tools/lldb/test --param dotest-args='-C gcc'
 
 
 Below is an overview of running individual test in the unit and API test suites
@@ -119,12 +119,12 @@
 
 ::
 
-   > ./bin/lldb-dotest -p TestInferiorCrashing.py
+   $ ./bin/lldb-dotest -p TestInferiorCrashing.py
 
 ::
 
-   > cd $lldb/test
-   > python dotest.py --executable  -p TestInferiorCrashing.py 
../packages/Python/lldbsuite/test
+   $ cd $lldb/test
+   $ python dotest.py --executable  -p TestInferiorCrashing.py 
../packages/Python/lldbsuite/test
 
 If the test is not specified by name (e.g. if you leave the ``-p`` argument
 off),  all tests in that directory will be executed:
@@ -132,17 +132,17 @@
 
 ::
 
-   > ./bin/lldb-dotest functionalities/data-formatter
+   $ ./bin/lldb-dotest functionalities/data-formatter
 
 ::
 
-   > python dotest.py --executable  
functionalities/data-formatter
+   $ python dotest.py --executable  
functionalities/data-formatter
 
 Many more options that are available. To see a list of all of them, run:
 
 ::
 
-   > python dotest.py -h
+   $ python dotest.py -h
 
 
 Running a Specific Test or Set of Tests: Unit Tests
@@ -154,14 +154,14 @@
 
 ::
 
-   > ./tools/lldb/unittests/Host/HostTests
+   $ ./tools/lldb/unittests/Host/HostTests
 
 
 To run a specific test, pass a filter, for example:
 
 ::
 
-   > ./tools/lldb/unittests/Host/HostTests 
--gtest_filter=SocketTest.DomainListenConnectAccept
+   $ ./tools/lldb/unittests/Host/HostTests 
--gtest_filter=SocketTest.DomainListenConnectAccept
 
 
 Running the Test Suite Remotely


Index: lldb/docs/resources/test.rst
===
--- lldb/docs/resources/test.rst
+++ lldb/docs/resources/test.rst
@@ -51,8 +51,8 @@
 
 ::
 
-   > cmake -DLLDB_TEST_USER_ARGS="-A i386 -C /path/to/custom/clang" -G Ninja
-   > ninja check-lldb
+   $ cmake -DLLDB_TEST_USER_ARGS="-A i386 -C /path/to/custom/clang" -G Ninja
+   $ ninja check-lldb
 
 Note that multiple ``-A`` and ``-C`` flags can be specified to
 ``LLDB_TEST_USER_ARGS``.
@@ -82,7 +82,7 @@
 
 ::
 
-   > ./bin/llvm-lit -sv tools/lldb/test --filter 
+   $ ./bin/llvm-lit -sv tools/lldb/test --filter 
 
 
 Because lit automatically scans a directory for tests, it's also possible to
@@ -90,7 +90,7 @@
 
 ::
 
-   > ./bin/llvm-lit -sv tools/lldb/test/Shell/Commands/CommandScriptImmediateOutput
+   $ ./bin/llvm-lit -sv tools/lldb/test/Shell/Commands/CommandScriptImmediateOutput
 
 
 For the SB API tests it is possible to forward arguments to ``dotest.py`` by
@@ -98,7 +98,7 @@
 
 ::
 
-   > ./bin/llvm-lit -sv tools/lldb/test --param dotest-args='-C gcc'
+   $ ./bin/llvm-lit -sv tools/lldb/test --param dotest-args='-C gcc'
 
 
 Below is an overview of running individual test in the unit and API test suites
@@ -119,12 +119,12 @@
 
 ::
 
-   > ./bin/lldb-dotest -p TestInferiorCrashing.py
+   $ ./bin/lldb-dotest -p TestInferiorCrashing.py
 
 ::
 
-   > cd $lldb/test
-   > python dotest.py --executable  -p TestInferiorCrashing.py ../packages/Python/lldbsuite/test
+   $ cd $lldb/test
+   $ python dotest.py --executable  -p TestInferiorCrashing.py ../packages/Python/lldbsuite/test
 
 If the test is not specified by name (e.g. if you leave the ``-p`` argument
 off),  all tests in that directory will be executed:
@@ -132,17 +132,17 @@
 
 ::
 
-   > ./bin/lldb-dotest functionalities/data-formatter
+   $ ./bin/lldb-dotest functionalities/data-formatter
 
 ::
 
-   > python dotest.py --executable  functionalities/data-formatter
+   $ python dotest.py --executable  

[Lldb-commits] [lldb] 6115bd9 - [LLDB] Fix GCC warnings about extra semicolons. NFC.

2020-02-10 Thread Martin Storsjö via lldb-commits

Author: Martin Storsjö
Date: 2020-02-10T11:20:44+02:00
New Revision: 6115bd9ba2851469d372d0d7b36d87a3e1d8094b

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

LOG: [LLDB] Fix GCC warnings about extra semicolons. NFC.

Added: 


Modified: 
lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp
lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp
lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp
lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp
lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp
lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp
lldb/source/Plugins/ABI/X86/ABISysV_i386.cpp
lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
lldb/source/Plugins/Architecture/Arm/ArchitectureArm.cpp
lldb/source/Plugins/Architecture/Mips/ArchitectureMips.cpp
lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp

lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp

lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp

lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp

lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp

lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp

lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp

lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp

lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp

lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataD

[Lldb-commits] [PATCH] D74252: Fix+re-enable Assert StackFrame Recognizer on Linux

2020-02-10 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib added a comment.

Hello Jan,

Has the latest version of this patch landed yet or does it need some extra work 
?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74252



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


[Lldb-commits] [lldb] 1a39f1b - [lldb] Fix+re-enable Assert StackFrame Recognizer on Linux

2020-02-10 Thread Jan Kratochvil via lldb-commits

Author: Jan Kratochvil
Date: 2020-02-10T10:29:32+01:00
New Revision: 1a39f1b966a8d8f15ed0d5a832d5097cccefe93b

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

LOG: [lldb] Fix+re-enable Assert StackFrame Recognizer on Linux

D73303 was failing on Fedora Linux and so it was disabled by Skip the
AssertFrameRecognizer test for Linux.

I find no easy way how to find out if it gets recognized as
`__assert_fail` or `__GI___assert_fail` as during `Process` ctor
libc.so.6 is not yet loaded by the debuggee.

DWARF symbol `__GI___assert_fail` overrides the ELF symbol `__assert_fail`.
While external debug info (=DWARF) gets disabled for testsuite (D55859)
that sure does not apply for real world usage.

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

Added: 


Modified: 
lldb/include/lldb/Target/StackFrameRecognizer.h
lldb/source/Commands/CommandObjectFrame.cpp

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/source/Target/AssertFrameRecognizer.cpp
lldb/source/Target/StackFrameRecognizer.cpp
lldb/test/Shell/Recognizer/assert.test
lldb/unittests/Target/StackFrameRecognizerTest.cpp

Removed: 




diff  --git a/lldb/include/lldb/Target/StackFrameRecognizer.h 
b/lldb/include/lldb/Target/StackFrameRecognizer.h
index b509e0760b31..92cfca4227cf 100644
--- a/lldb/include/lldb/Target/StackFrameRecognizer.h
+++ b/lldb/include/lldb/Target/StackFrameRecognizer.h
@@ -101,8 +101,8 @@ class ScriptedStackFrameRecognizer : public 
StackFrameRecognizer {
 class StackFrameRecognizerManager {
 public:
   static void AddRecognizer(lldb::StackFrameRecognizerSP recognizer,
-ConstString module,
-ConstString symbol,
+ConstString module, ConstString symbol,
+ConstString alternate_symbol,
 bool first_instruction_only = true);
 
   static void AddRecognizer(lldb::StackFrameRecognizerSP recognizer,
@@ -113,7 +113,8 @@ class StackFrameRecognizerManager {
   static void ForEach(
   std::function const &callback);
+ std::string alternate_symbol, bool regexp)> const
+  &callback);
 
   static bool RemoveRecognizerWithID(uint32_t recognizer_id);
 

diff  --git a/lldb/source/Commands/CommandObjectFrame.cpp 
b/lldb/source/Commands/CommandObjectFrame.cpp
index d86b50bd7aad..5af9e2e314be 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -881,7 +881,7 @@ bool CommandObjectFrameRecognizerAdd::DoExecute(Args 
&command,
   } else {
 auto module = ConstString(m_options.m_module);
 auto func = ConstString(m_options.m_function);
-StackFrameRecognizerManager::AddRecognizer(recognizer_sp, module, func);
+StackFrameRecognizerManager::AddRecognizer(recognizer_sp, module, func, 
{});
   }
 #endif
 
@@ -960,12 +960,13 @@ class CommandObjectFrameRecognizerList : public 
CommandObjectParsed {
 StackFrameRecognizerManager::ForEach(
 [&result, &any_printed](uint32_t recognizer_id, std::string name,
 std::string function, std::string symbol,
-bool regexp) {
+std::string alternate_symbol, bool regexp) {
   if (name == "")
 name = "(internal)";
   result.GetOutputStream().Printf(
-  "%d: %s, module %s, function %s%s\n", recognizer_id, 
name.c_str(),
-  function.c_str(), symbol.c_str(), regexp ? " (regexp)" : "");
+  "%d: %s, module %s, function %s{%s}%s\n", recognizer_id,
+  name.c_str(), function.c_str(), symbol.c_str(),
+  alternate_symbol.c_str(), regexp ? " (regexp)" : "");
   any_printed = true;
 });
 

diff  --git 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 6acc23176248..62d16296bd66 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -2691,6 +2691,7 @@ static void RegisterObjCExceptionRecognizer() {
 std::tie(module, function) = AppleObjCRuntime::GetExceptionThrowLocation();
 StackFrameRecognizerManager::AddRecognizer(
 StackFrameRecognizerSP(new ObjCExceptionThrowFrameRecognizer()),
-module.GetFilename(), function, /*first_instruction_only*/ true);
+module.GetFilename(), function, /*alternate_symbol*/ {},
+/*first_instruction_only*/ true);
   });
 }

diff  --git a/lldb/source/Target/AssertFrameRecognizer.cpp 
b/lldb

[Lldb-commits] [PATCH] D74252: Fix+re-enable Assert StackFrame Recognizer on Linux

2020-02-10 Thread Jan Kratochvil via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1a39f1b966a8: [lldb] Fix+re-enable Assert StackFrame 
Recognizer on Linux (authored by jankratochvil).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74252

Files:
  lldb/include/lldb/Target/StackFrameRecognizer.h
  lldb/source/Commands/CommandObjectFrame.cpp
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  lldb/source/Target/AssertFrameRecognizer.cpp
  lldb/source/Target/StackFrameRecognizer.cpp
  lldb/test/Shell/Recognizer/assert.test
  lldb/unittests/Target/StackFrameRecognizerTest.cpp

Index: lldb/unittests/Target/StackFrameRecognizerTest.cpp
===
--- lldb/unittests/Target/StackFrameRecognizerTest.cpp
+++ lldb/unittests/Target/StackFrameRecognizerTest.cpp
@@ -77,6 +77,7 @@
   StackFrameRecognizerManager::ForEach(
   [&any_printed](uint32_t recognizer_id, std::string name,
  std::string function, std::string symbol,
+ std::string alternate_symbol,
  bool regexp) { any_printed = true; });
 
   EXPECT_TRUE(any_printed);
Index: lldb/test/Shell/Recognizer/assert.test
===
--- lldb/test/Shell/Recognizer/assert.test
+++ lldb/test/Shell/Recognizer/assert.test
@@ -1,4 +1,4 @@
-# UNSUPPORTED: system-windows, system-linux
+# UNSUPPORTED: system-windows
 # RUN: %clang_host -g -O0 %S/Inputs/assert.c -o %t.out
 # RUN: %lldb -b -s %s %t.out | FileCheck %s
 run
Index: lldb/source/Target/StackFrameRecognizer.cpp
===
--- lldb/source/Target/StackFrameRecognizer.cpp
+++ lldb/source/Target/StackFrameRecognizer.cpp
@@ -50,24 +50,28 @@
 
 class StackFrameRecognizerManagerImpl {
 public:
-  void AddRecognizer(StackFrameRecognizerSP recognizer,
- ConstString module, ConstString symbol,
+  void AddRecognizer(StackFrameRecognizerSP recognizer, ConstString module,
+ ConstString symbol, ConstString alternate_symbol,
  bool first_instruction_only) {
-m_recognizers.push_front({(uint32_t)m_recognizers.size(), false, recognizer, false, module, RegularExpressionSP(),
-  symbol, RegularExpressionSP(),
+m_recognizers.push_front({(uint32_t)m_recognizers.size(), false, recognizer,
+  false, module, RegularExpressionSP(), symbol,
+  alternate_symbol, RegularExpressionSP(),
   first_instruction_only});
   }
 
   void AddRecognizer(StackFrameRecognizerSP recognizer,
  RegularExpressionSP module, RegularExpressionSP symbol,
  bool first_instruction_only) {
-m_recognizers.push_front({(uint32_t)m_recognizers.size(), false, recognizer, true, ConstString(), module,
+m_recognizers.push_front({(uint32_t)m_recognizers.size(), false, recognizer,
+  true, ConstString(), module, ConstString(),
   ConstString(), symbol, first_instruction_only});
   }
 
   void ForEach(
-  std::function const &callback) {
+  std::function const
+  &callback) {
 for (auto entry : m_recognizers) {
   if (entry.is_regexp) {
 std::string module_name;
@@ -79,11 +83,12 @@
   symbol_name = entry.symbol_regexp->GetText().str();
 
 callback(entry.recognizer_id, entry.recognizer->GetName(), module_name,
- symbol_name, true);
+ symbol_name, {}, true);
 
   } else {
-callback(entry.recognizer_id, entry.recognizer->GetName(), entry.module.GetCString(),
- entry.symbol.GetCString(), false);
+callback(entry.recognizer_id, entry.recognizer->GetName(),
+ entry.module.GetCString(), entry.symbol.GetCString(),
+ entry.alternate_symbol.GetCString(), false);
   }
 }
   }
@@ -120,7 +125,10 @@
 if (!entry.module_regexp->Execute(module_name.GetStringRef())) continue;
 
   if (entry.symbol)
-if (entry.symbol != function_name) continue;
+if (entry.symbol != function_name &&
+(!entry.alternate_symbol ||
+ entry.alternate_symbol != function_name))
+  continue;
 
   if (entry.symbol_regexp)
 if (!entry.symbol_regexp->Execute(function_name.GetStringRef()))
@@ -149,6 +157,7 @@
 ConstString module;
 RegularExpressionSP module_regexp;
 ConstString symbol;
+ConstString alternate_symbol;
 RegularExpressionSP symbol_regexp;
 bool first_instruction_only;
   };
@@ -163,10 +172,10 @@
 }
 
 void StackFrameRecognizerManager::AddRecognizer(
-StackFrameRecognizerSP recognizer, ConstString module,
-ConstString symbol, bool 

[Lldb-commits] [PATCH] D74252: Fix+re-enable Assert StackFrame Recognizer on Linux

2020-02-10 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

In D74252#1866476 , @mib wrote:

> Has the latest version of this patch landed yet or does it need some extra 
> work ?


I was giving some time to other reviewers but it is checked-in now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74252



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


[Lldb-commits] [lldb] 0ed233c - [lldb][NFC] Don't construct a ConstString twice in LibCxxVariant

2020-02-10 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-02-10T12:23:01+01:00
New Revision: 0ed233c85134e5e1581c5ef73edd1e746f6f0d0f

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

LOG: [lldb][NFC] Don't construct a ConstString twice in LibCxxVariant

Added: 


Modified: 
lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
index f7a0b040920d..a2b1733fa59f 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
@@ -242,7 +242,7 @@ ValueObjectSP VariantFrontEnd::GetChildAtIndex(size_t idx) {
   if (!head_value)
 return ValueObjectSP();
 
-  return head_value->Clone(ConstString(ConstString("Value").AsCString()));
+  return head_value->Clone(ConstString("Value"));
 }
 
 SyntheticChildrenFrontEnd *



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


[Lldb-commits] [lldb] 9721212 - [lldb][NFC] Fix code style of LibcxxVariantIndexValidity

2020-02-10 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-02-10T12:37:51+01:00
New Revision: 97212121c504aa9e028b1b4f2778696cc741e982

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

LOG: [lldb][NFC] Fix code style of LibcxxVariantIndexValidity

Enum cases aren't all uppercase.

Added: 


Modified: 
lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
index a2b1733fa59f..da2e916a5b9b 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp
@@ -60,10 +60,10 @@ using namespace lldb_private;
 
 namespace {
 // libc++ std::variant index could have one of three states
-// 1) VALID, we can obtain it and its not variant_npos
-// 2) INVALID, we can't obtain it or it is not a type we expect
-// 3) NPOS, its value is variant_npos which means the variant has no value
-enum class LibcxxVariantIndexValidity { VALID, INVALID, NPOS };
+// 1) Valid, we can obtain it and its not variant_npos
+// 2) Invalid, we can't obtain it or it is not a type we expect
+// 3) NPos, its value is variant_npos which means the variant has no value
+enum class LibcxxVariantIndexValidity { Valid, Invalid, NPos };
 
 LibcxxVariantIndexValidity
 LibcxxVariantGetIndexValidity(ValueObjectSP &impl_sp) {
@@ -71,14 +71,14 @@ LibcxxVariantGetIndexValidity(ValueObjectSP &impl_sp) {
   impl_sp->GetChildMemberWithName(ConstString("__index"), true));
 
   if (!index_sp)
-return LibcxxVariantIndexValidity::INVALID;
+return LibcxxVariantIndexValidity::Invalid;
 
   int64_t index_value = index_sp->GetValueAsSigned(0);
 
   if (index_value == -1)
-return LibcxxVariantIndexValidity::NPOS;
+return LibcxxVariantIndexValidity::NPos;
 
-  return LibcxxVariantIndexValidity::VALID;
+  return LibcxxVariantIndexValidity::Valid;
 }
 
 llvm::Optional LibcxxVariantIndexValue(ValueObjectSP &impl_sp) {
@@ -129,10 +129,10 @@ bool LibcxxVariantSummaryProvider(ValueObject &valobj, 
Stream &stream,
 
   LibcxxVariantIndexValidity validity = LibcxxVariantGetIndexValidity(impl_sp);
 
-  if (validity == LibcxxVariantIndexValidity::INVALID)
+  if (validity == LibcxxVariantIndexValidity::Invalid)
 return false;
 
-  if (validity == LibcxxVariantIndexValidity::NPOS) {
+  if (validity == LibcxxVariantIndexValidity::NPos) {
 stream.Printf(" No Value");
 return true;
   }
@@ -196,10 +196,10 @@ bool VariantFrontEnd::Update() {
 
   LibcxxVariantIndexValidity validity = LibcxxVariantGetIndexValidity(impl_sp);
 
-  if (validity == LibcxxVariantIndexValidity::INVALID)
+  if (validity == LibcxxVariantIndexValidity::Invalid)
 return false;
 
-  if (validity == LibcxxVariantIndexValidity::NPOS)
+  if (validity == LibcxxVariantIndexValidity::NPos)
 return true;
 
   m_size = 1;



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


[Lldb-commits] [lldb] 1a77955 - [lldb][NFC] Don't call call formatv for no reason in LibCxxOptional

2020-02-10 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-02-10T12:39:42+01:00
New Revision: 1a779550aa1d94f1c0ea8a22c98a850600be6144

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

LOG: [lldb][NFC] Don't call call formatv for no reason in LibCxxOptional

Added: 


Modified: 
lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp
index ead0746c22c1..e6de525e7d79 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp
@@ -71,7 +71,7 @@ ValueObjectSP OptionalFrontEnd::GetChildAtIndex(size_t idx) {
   if (!holder_type)
 return ValueObjectSP();
 
-  return val_sp->Clone(ConstString(llvm::formatv("Value").str()));
+  return val_sp->Clone(ConstString("Value"));
 }
 
 SyntheticChildrenFrontEnd *



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


[Lldb-commits] [lldb] 2a3ef37 - [lldb][NFC] Don't hide a bool in LibCxxOptional's OptionalFrontend::m_size

2020-02-10 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-02-10T13:03:06+01:00
New Revision: 2a3ef377ec00e7c7d3f4c47614ab6baee727cd82

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

LOG: [lldb][NFC] Don't hide a bool in LibCxxOptional's OptionalFrontend::m_size

m_size can only be 1 or 0 and indicates if the optional has a value. Calling
it 'm_size', giving it a size_t data type and then also comparing indices 
against
'size' is very confusing. Let's just make this a bool.

Added: 


Modified: 
lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp
index e6de525e7d79..c0c819632851 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp
@@ -26,11 +26,12 @@ class OptionalFrontEnd : public SyntheticChildrenFrontEnd {
 
   bool MightHaveChildren() override { return true; }
   bool Update() override;
-  size_t CalculateNumChildren() override { return m_size; }
+  size_t CalculateNumChildren() override { return m_has_value ? 1U : 0U; }
   ValueObjectSP GetChildAtIndex(size_t idx) override;
 
 private:
-  size_t m_size = 0;
+  /// True iff the option contains a value.
+  bool m_has_value = false;
 };
 } // namespace
 
@@ -44,13 +45,13 @@ bool OptionalFrontEnd::Update() {
   // __engaged_ is a bool flag and is true if the optional contains a value.
   // Converting it to unsigned gives us a size of 1 if it contains a value
   // and 0 if not.
-  m_size = engaged_sp->GetValueAsUnsigned(0);
+  m_has_value = engaged_sp->GetValueAsUnsigned(0) == 1;
 
   return false;
 }
 
 ValueObjectSP OptionalFrontEnd::GetChildAtIndex(size_t idx) {
-  if (idx >= m_size)
+  if (!m_has_value)
 return ValueObjectSP();
 
   // __val_ contains the underlying value of an optional if it has one.



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


[Lldb-commits] [PATCH] D74244: [lldb] Delete register info definitions in the x86_64 ABI classes

2020-02-10 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha added inline comments.



Comment at: lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp:938
+  .Case("R8", LLDB_REGNUM_GENERIC_ARG5)
+  .Case("r9", LLDB_REGNUM_GENERIC_ARG6)
+  .Default(LLDB_INVALID_REGNUM);

Typo? It should be uppercase, I think.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74244



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


[Lldb-commits] [PATCH] D74310: [lldb] Don't model std::atomic as a transparent data structure in the data formatter

2020-02-10 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added reviewers: JDevlieghere, jingham.
Herald added subscribers: lldb-commits, abidh, jfb, christof.
Herald added a project: LLDB.

Currently the data formatter is treating `std::atomic` variables as transparent 
wrappers
around their underlying value type. This causes that when printing 
`std::atomic`, the data
formatter will forward all requests for the children of the atomic variable to 
the `A *` pointer type
which will then return the respective members of `A`. If `A` in turn has a 
member that contains
the original atomic variable, this causes LLDB to infinitely recurse when 
printing an object with
such a `std::atomic` pointer member.

We could implement a workaround similar to whatever we do for pointer values 
but this patch
just implements the `std::atomic` formatter in the same way as we already 
implement other
formatters (e.g. smart pointers or `std::optional`) that just model the 
contents of the  as a child
"Value". This way LLDB knows when it actually prints a pointer and can just use 
its normal
workaround if "Value" is a recursive pointer.

Fixes rdar://59189235


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D74310

Files:
  
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
  
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/main.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp

Index: lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp
===
--- lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp
+++ lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp
@@ -7,6 +7,7 @@
 //===--===//
 
 #include "LibCxxAtomic.h"
+#include "lldb/DataFormatters/FormattersHelpers.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -100,8 +101,6 @@
 
   size_t GetIndexOfChildWithName(ConstString name) override;
 
-  lldb::ValueObjectSP GetSyntheticValue() override;
-
 private:
   ValueObject *m_real_child;
 };
@@ -127,26 +126,20 @@
 
 size_t lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::
 CalculateNumChildren() {
-  return m_real_child ? m_real_child->GetNumChildren() : 0;
+  return m_real_child ? 1 : 0;
 }
 
 lldb::ValueObjectSP
 lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::GetChildAtIndex(
 size_t idx) {
-  return m_real_child ? m_real_child->GetChildAtIndex(idx, true) : nullptr;
+  if (idx == 0)
+return m_real_child->GetSP()->Clone(ConstString("Value"));
+  return nullptr;
 }
 
 size_t lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::
 GetIndexOfChildWithName(ConstString name) {
-  return m_real_child ? m_real_child->GetIndexOfChildWithName(name)
-  : UINT32_MAX;
-}
-
-lldb::ValueObjectSP lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::
-GetSyntheticValue() {
-  if (m_real_child && m_real_child->CanProvideValue())
-return m_real_child->GetSP();
-  return nullptr;
+  return formatters::ExtractIndexFromString(name.GetCString());
 }
 
 SyntheticChildrenFrontEnd *
Index: lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/main.cpp
===
--- lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/main.cpp
+++ lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/main.cpp
@@ -8,6 +8,18 @@
 
 #include 
 
+// Define a Parent and Child struct that can point to each other.
+class Parent;
+struct Child {
+  // This should point to the parent which in turn owns this
+  // child instance. This cycle should not cause LLDB to infinite loop
+  // during printing.
+  std::atomic parent{nullptr};
+};
+struct Parent {
+  Child child;
+};
+
 struct S {
 int x = 1;
 int y = 2;
@@ -19,7 +31,11 @@
 s.store(S());
 std::atomic i;
 i.store(5);
-
+
+Parent p;
+// Let the child node know what its parent is.
+p.child.parent = &p;
+
 return 0; // Set break point at this line.
 }
 
Index: lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
@@ -42,13 +42,19 @@
 substrs=['stopped',
  'stop reason = breakpoint'])
 
-s = self.get_variable('s')
-i = self.get_variable('i')
+s_atomic = self.get_variable('s')
+i_atomic = self.get_v

[Lldb-commits] [PATCH] D74252: Fix+re-enable Assert StackFrame Recognizer on Linux

2020-02-10 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments.



Comment at: lldb/source/Commands/CommandObjectFrame.cpp:966
 name = "(internal)";
   result.GetOutputStream().Printf(
+  "%d: %s, module %s, function %s{%s}%s\n", recognizer_id,

We should stream to the output stream directly to avoid all these useless 
conversions. 



Comment at: lldb/source/Target/AssertFrameRecognizer.cpp:29
 ///Otherwise, returns \a llvm::None.
-llvm::Optional>
+llvm::Optional>
 GetAbortLocation(Process *process) {

With two elements in the tuple I was torn between a struct with named fields, 
but with 3 fields I strongly believe that would be the better choice. 



Comment at: lldb/source/Target/AssertFrameRecognizer.cpp:152
+ConstString func_name = sym_ctx.GetFunctionName();
+if (func_name == ConstString(function_name) ||
+alternate_function_name.empty() ||

I believe someone added an overload for comparing ConstStrings with StringRefs. 
We shouldn't have to pay the price of creating one here just for comparison. 
Same below.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74252



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


[Lldb-commits] [PATCH] D73938: [Host.mm] Check for the right macro instead of inlining it

2020-02-10 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 243608.
vsk retitled this revision from "[Host.mm] Check for the right macro instead of 
inlining it." to "[Host.mm] Check for the right macro instead of inlining it".
vsk added a comment.

- Check TARGET_OS_EMBEDDED.


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

https://reviews.llvm.org/D73938

Files:
  lldb/source/Host/macosx/objcxx/Host.mm


Index: lldb/source/Host/macosx/objcxx/Host.mm
===
--- lldb/source/Host/macosx/objcxx/Host.mm
+++ lldb/source/Host/macosx/objcxx/Host.mm
@@ -10,9 +10,10 @@
 #include "../PosixSpawnResponsible.h"
 
 #include 
+#include 
 
 // On device doesn't have supporty for XPC.
-#if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__))
+#if defined(__APPLE__) && defined(TARGET_OS_EMBEDDED)
 #define NO_XPC_SERVICES 1
 #endif
 
@@ -156,7 +157,7 @@
   return NULL;
 }
 
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#if !NO_XPC_SERVICES
 
 const char *applscript_in_new_tty = "tell application \"Terminal\"\n"
 "   activate\n"
@@ -310,11 +311,11 @@
   return error;
 }
 
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // #if !NO_XPC_SERVICES
 
 bool Host::OpenFileInExternalEditor(const FileSpec &file_spec,
 uint32_t line_no) {
-#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
+#if NO_XPC_SERVICES
   return false;
 #else
   // We attach this to an 'odoc' event to specify a particular selection
@@ -407,7 +408,7 @@
   }
 
   return true;
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // #if !NO_XPC_SERVICES
 }
 
 Environment Host::GetEnvironment() { return Environment(*_NSGetEnviron()); }
@@ -1294,7 +1295,7 @@
   }
 
   if (launch_info.GetFlags().Test(eLaunchFlagLaunchInTTY)) {
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#if !NO_XPC_SERVICES
 return LaunchInNewTerminalWithAppleScript(exe_spec.GetPath().c_str(),
   launch_info);
 #else


Index: lldb/source/Host/macosx/objcxx/Host.mm
===
--- lldb/source/Host/macosx/objcxx/Host.mm
+++ lldb/source/Host/macosx/objcxx/Host.mm
@@ -10,9 +10,10 @@
 #include "../PosixSpawnResponsible.h"
 
 #include 
+#include 
 
 // On device doesn't have supporty for XPC.
-#if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__))
+#if defined(__APPLE__) && defined(TARGET_OS_EMBEDDED)
 #define NO_XPC_SERVICES 1
 #endif
 
@@ -156,7 +157,7 @@
   return NULL;
 }
 
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#if !NO_XPC_SERVICES
 
 const char *applscript_in_new_tty = "tell application \"Terminal\"\n"
 "   activate\n"
@@ -310,11 +311,11 @@
   return error;
 }
 
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // #if !NO_XPC_SERVICES
 
 bool Host::OpenFileInExternalEditor(const FileSpec &file_spec,
 uint32_t line_no) {
-#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
+#if NO_XPC_SERVICES
   return false;
 #else
   // We attach this to an 'odoc' event to specify a particular selection
@@ -407,7 +408,7 @@
   }
 
   return true;
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // #if !NO_XPC_SERVICES
 }
 
 Environment Host::GetEnvironment() { return Environment(*_NSGetEnviron()); }
@@ -1294,7 +1295,7 @@
   }
 
   if (launch_info.GetFlags().Test(eLaunchFlagLaunchInTTY)) {
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#if !NO_XPC_SERVICES
 return LaunchInNewTerminalWithAppleScript(exe_spec.GetPath().c_str(),
   launch_info);
 #else
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D73938: [Host.mm] Check for the right macro instead of inlining it

2020-02-10 Thread Vedant Kumar via Phabricator via lldb-commits
vsk commandeered this revision.
vsk edited reviewers, added: davide; removed: vsk.
vsk added a comment.

This just came up again as the watchOS/tvOS build breaks without the 
TARGET_OS_EMBEDDED check.


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

https://reviews.llvm.org/D73938



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


[Lldb-commits] [PATCH] D73938: [Host.mm] Check for the right macro instead of inlining it

2020-02-10 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

LGTM =)


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

https://reviews.llvm.org/D73938



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


[Lldb-commits] [lldb] 936d142 - [Host.mm] Check for the right macro instead of inlining it

2020-02-10 Thread Vedant Kumar via lldb-commits

Author: Vedant Kumar
Date: 2020-02-10T10:06:40-08:00
New Revision: 936d1427da1432d724dfa5851097347bcdf7c521

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

LOG: [Host.mm] Check for the right macro instead of inlining it

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

Added: 


Modified: 
lldb/source/Host/macosx/objcxx/Host.mm

Removed: 




diff  --git a/lldb/source/Host/macosx/objcxx/Host.mm 
b/lldb/source/Host/macosx/objcxx/Host.mm
index 233734109c41..8c22b57d09d8 100644
--- a/lldb/source/Host/macosx/objcxx/Host.mm
+++ b/lldb/source/Host/macosx/objcxx/Host.mm
@@ -9,9 +9,10 @@
 #include "lldb/Host/Host.h"
 
 #include 
+#include 
 
 // On device doesn't have supporty for XPC.
-#if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__))
+#if defined(__APPLE__) && defined(TARGET_OS_EMBEDDED)
 #define NO_XPC_SERVICES 1
 #endif
 
@@ -153,7 +154,7 @@
   return NULL;
 }
 
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#if !NO_XPC_SERVICES
 
 const char *applscript_in_new_tty = "tell application \"Terminal\"\n"
 "   activate\n"
@@ -307,11 +308,11 @@ repeat with the_window in (get windows)\n\
   return error;
 }
 
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // #if !NO_XPC_SERVICES
 
 bool Host::OpenFileInExternalEditor(const FileSpec &file_spec,
 uint32_t line_no) {
-#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
+#if NO_XPC_SERVICES
   return false;
 #else
   // We attach this to an 'odoc' event to specify a particular selection
@@ -404,7 +405,7 @@ repeat with the_window in (get windows)\n\
   }
 
   return true;
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // #if !NO_XPC_SERVICES
 }
 
 Environment Host::GetEnvironment() { return Environment(*_NSGetEnviron()); }
@@ -1263,7 +1264,7 @@ static bool ShouldLaunchUsingXPC(ProcessLaunchInfo 
&launch_info) {
   }
 
   if (launch_info.GetFlags().Test(eLaunchFlagLaunchInTTY)) {
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#if !NO_XPC_SERVICES
 return LaunchInNewTerminalWithAppleScript(exe_spec.GetPath().c_str(),
   launch_info);
 #else



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


[Lldb-commits] [PATCH] D73938: [Host.mm] Check for the right macro instead of inlining it

2020-02-10 Thread Vedant Kumar via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG936d1427da14: [Host.mm] Check for the right macro instead of 
inlining it (authored by vsk).

Changed prior to commit:
  https://reviews.llvm.org/D73938?vs=243608&id=243613#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73938

Files:
  lldb/source/Host/macosx/objcxx/Host.mm


Index: lldb/source/Host/macosx/objcxx/Host.mm
===
--- lldb/source/Host/macosx/objcxx/Host.mm
+++ lldb/source/Host/macosx/objcxx/Host.mm
@@ -9,9 +9,10 @@
 #include "lldb/Host/Host.h"
 
 #include 
+#include 
 
 // On device doesn't have supporty for XPC.
-#if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__))
+#if defined(__APPLE__) && defined(TARGET_OS_EMBEDDED)
 #define NO_XPC_SERVICES 1
 #endif
 
@@ -153,7 +154,7 @@
   return NULL;
 }
 
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#if !NO_XPC_SERVICES
 
 const char *applscript_in_new_tty = "tell application \"Terminal\"\n"
 "   activate\n"
@@ -307,11 +308,11 @@
   return error;
 }
 
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // #if !NO_XPC_SERVICES
 
 bool Host::OpenFileInExternalEditor(const FileSpec &file_spec,
 uint32_t line_no) {
-#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
+#if NO_XPC_SERVICES
   return false;
 #else
   // We attach this to an 'odoc' event to specify a particular selection
@@ -404,7 +405,7 @@
   }
 
   return true;
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // #if !NO_XPC_SERVICES
 }
 
 Environment Host::GetEnvironment() { return Environment(*_NSGetEnviron()); }
@@ -1263,7 +1264,7 @@
   }
 
   if (launch_info.GetFlags().Test(eLaunchFlagLaunchInTTY)) {
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#if !NO_XPC_SERVICES
 return LaunchInNewTerminalWithAppleScript(exe_spec.GetPath().c_str(),
   launch_info);
 #else


Index: lldb/source/Host/macosx/objcxx/Host.mm
===
--- lldb/source/Host/macosx/objcxx/Host.mm
+++ lldb/source/Host/macosx/objcxx/Host.mm
@@ -9,9 +9,10 @@
 #include "lldb/Host/Host.h"
 
 #include 
+#include 
 
 // On device doesn't have supporty for XPC.
-#if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__))
+#if defined(__APPLE__) && defined(TARGET_OS_EMBEDDED)
 #define NO_XPC_SERVICES 1
 #endif
 
@@ -153,7 +154,7 @@
   return NULL;
 }
 
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#if !NO_XPC_SERVICES
 
 const char *applscript_in_new_tty = "tell application \"Terminal\"\n"
 "   activate\n"
@@ -307,11 +308,11 @@
   return error;
 }
 
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // #if !NO_XPC_SERVICES
 
 bool Host::OpenFileInExternalEditor(const FileSpec &file_spec,
 uint32_t line_no) {
-#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
+#if NO_XPC_SERVICES
   return false;
 #else
   // We attach this to an 'odoc' event to specify a particular selection
@@ -404,7 +405,7 @@
   }
 
   return true;
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // #if !NO_XPC_SERVICES
 }
 
 Environment Host::GetEnvironment() { return Environment(*_NSGetEnviron()); }
@@ -1263,7 +1264,7 @@
   }
 
   if (launch_info.GetFlags().Test(eLaunchFlagLaunchInTTY)) {
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#if !NO_XPC_SERVICES
 return LaunchInNewTerminalWithAppleScript(exe_spec.GetPath().c_str(),
   launch_info);
 #else
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] eaeb561 - debugserver: Rely on mig architectures being specified externally

2020-02-10 Thread Vedant Kumar via lldb-commits

Author: Vedant Kumar
Date: 2020-02-10T10:13:05-08:00
New Revision: eaeb5610ced23404f2c799d6e0c46c05f06ac3b5

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

LOG: debugserver: Rely on mig architectures being specified externally

Look up the -arch flags to pass to the mig invocation from an
optionally-defined MIG_ARCHS variable. We can't use CMAKE_OSX_ARCHS
because the {i,tv,watch}OS builds don't use this mechanism to achieve
fat builds (they build each slice separately & then lipo them together).

This supercedes the mig -arch/-isysroot fix from
510758dae2a8fa4b0b26dea89d4d1efd576b8ad6.

Added: 


Modified: 
lldb/tools/debugserver/source/CMakeLists.txt

Removed: 




diff  --git a/lldb/tools/debugserver/source/CMakeLists.txt 
b/lldb/tools/debugserver/source/CMakeLists.txt
index ef8dcd1f5353..151386d0c130 100644
--- a/lldb/tools/debugserver/source/CMakeLists.txt
+++ b/lldb/tools/debugserver/source/CMakeLists.txt
@@ -136,9 +136,11 @@ set(generated_mach_interfaces
   )
 
 set(MIG_ARCH_FLAGS "")
-foreach(ARCH ${CMAKE_OSX_ARCHITECTURES})
-  set(MIG_ARCH_FLAGS "${MIG_ARCH_FLAGS} -arch ${ARCH}")
-endforeach()
+if (DEFINED MIG_ARCHS)
+  foreach(ARCH ${MIG_ARCHS})
+set(MIG_ARCH_FLAGS "${MIG_ARCH_FLAGS} -arch ${ARCH}")
+  endforeach()
+endif()
 separate_arguments(MIG_ARCH_FLAGS_SEPARTED NATIVE_COMMAND "${MIG_ARCH_FLAGS}")
 
 add_custom_command(OUTPUT ${generated_mach_interfaces}



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


[Lldb-commits] [PATCH] D73946: [lldb] Fix another instance where we pass a nullptr as TypeSourceInfo to NonTypeTemplateParmDecl::Create

2020-02-10 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik accepted this revision.
shafik added a comment.

Thank you fixing this!


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

https://reviews.llvm.org/D73946



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


[Lldb-commits] [PATCH] D73938: [Host.mm] Check for the right macro instead of inlining it

2020-02-10 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

I think this is now causing a warning:

  1600⧐952 ( 37%) Building CXX object 
tools/lldb/source/Host/macosx/objcxx/CMakeFiles/lldbHostMacOSXObjCXX.dir/Host.mm.o
  
/Users/teemperor/2llvm/llvm-project/lldb/source/Host/macosx/objcxx/Host.mm:139:14:
 warning: unused function 'AcceptPIDFromInferior' [-Wunused-function]
  static void *AcceptPIDFromInferior(void *arg) {
   ^
  1 warning generated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73938



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


[Lldb-commits] [lldb] 6fd818c - Don't fail step out if remote server doesn't implement qMemoryRegionInfo

2020-02-10 Thread Ted Woodward via lldb-commits

Author: Ted Woodward
Date: 2020-02-10T13:40:44-06:00
New Revision: 6fd818c5a9c565b8aaeaf1ca85ad14735ee0eb0c

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

LOG: Don't fail step out if remote server doesn't implement qMemoryRegionInfo

Summary:
The return address validation in D71372 will fail if the memory permissions 
can't be determined. Many embedded stubs either don't implement the 
qMemoryRegionInfo packet, or don't have memory permissions at all.

Remove the return from the if clause that calls GetLoadAddressPermissions, so 
this call failing doesn't cause the step out to abort. Instead, assume that the 
memory permission check doesn't apply to this type of target.

Reviewers: labath, jingham, clayborg, mossberg

Reviewed By: labath, jingham

Subscribers: lldb-commits

Tags: #lldb

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

Added: 


Modified: 
lldb/source/Target/ThreadPlanStepOut.cpp

Removed: 




diff  --git a/lldb/source/Target/ThreadPlanStepOut.cpp 
b/lldb/source/Target/ThreadPlanStepOut.cpp
index eead322f6b89..7581ccea625a 100644
--- a/lldb/source/Target/ThreadPlanStepOut.cpp
+++ b/lldb/source/Target/ThreadPlanStepOut.cpp
@@ -130,11 +130,9 @@ ThreadPlanStepOut::ThreadPlanStepOut(
 uint32_t permissions = 0;
 if (!m_thread.GetProcess()->GetLoadAddressPermissions(m_return_addr,
   permissions)) {
-  m_constructor_errors.Printf("Return address (0x%" PRIx64
-  ") permissions not found.",
-  m_return_addr);
-  LLDB_LOGF(log, "ThreadPlanStepOut(%p): %s", static_cast(this),
-m_constructor_errors.GetData());
+  LLDB_LOGF(log, "ThreadPlanStepOut(%p): Return address (0x%" PRIx64
+") permissions not found.", static_cast(this),
+m_return_addr);
 } else if (!(permissions & ePermissionsExecutable)) {
   m_constructor_errors.Printf("Return address (0x%" PRIx64
   ") did not point to executable memory.",



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


[Lldb-commits] [PATCH] D72513: Don't fail step out if remote server doesn't implement qMemoryRegionInfo

2020-02-10 Thread Ted Woodward via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6fd818c5a9c5: Don't fail step out if remote server 
doesn't implement qMemoryRegionInfo (authored by ted).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72513

Files:
  lldb/source/Target/ThreadPlanStepOut.cpp


Index: lldb/source/Target/ThreadPlanStepOut.cpp
===
--- lldb/source/Target/ThreadPlanStepOut.cpp
+++ lldb/source/Target/ThreadPlanStepOut.cpp
@@ -130,11 +130,9 @@
 uint32_t permissions = 0;
 if (!m_thread.GetProcess()->GetLoadAddressPermissions(m_return_addr,
   permissions)) {
-  m_constructor_errors.Printf("Return address (0x%" PRIx64
-  ") permissions not found.",
-  m_return_addr);
-  LLDB_LOGF(log, "ThreadPlanStepOut(%p): %s", static_cast(this),
-m_constructor_errors.GetData());
+  LLDB_LOGF(log, "ThreadPlanStepOut(%p): Return address (0x%" PRIx64
+") permissions not found.", static_cast(this),
+m_return_addr);
 } else if (!(permissions & ePermissionsExecutable)) {
   m_constructor_errors.Printf("Return address (0x%" PRIx64
   ") did not point to executable memory.",


Index: lldb/source/Target/ThreadPlanStepOut.cpp
===
--- lldb/source/Target/ThreadPlanStepOut.cpp
+++ lldb/source/Target/ThreadPlanStepOut.cpp
@@ -130,11 +130,9 @@
 uint32_t permissions = 0;
 if (!m_thread.GetProcess()->GetLoadAddressPermissions(m_return_addr,
   permissions)) {
-  m_constructor_errors.Printf("Return address (0x%" PRIx64
-  ") permissions not found.",
-  m_return_addr);
-  LLDB_LOGF(log, "ThreadPlanStepOut(%p): %s", static_cast(this),
-m_constructor_errors.GetData());
+  LLDB_LOGF(log, "ThreadPlanStepOut(%p): Return address (0x%" PRIx64
+") permissions not found.", static_cast(this),
+m_return_addr);
 } else if (!(permissions & ePermissionsExecutable)) {
   m_constructor_errors.Printf("Return address (0x%" PRIx64
   ") did not point to executable memory.",
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] d23c15a - Do not define AcceptPIDFromInferior when it will not be used

2020-02-10 Thread Vedant Kumar via lldb-commits

Author: Vedant Kumar
Date: 2020-02-10T12:06:46-08:00
New Revision: d23c15a687ff15327b88fa64da3184395012c2dc

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

LOG: Do not define AcceptPIDFromInferior when it will not be used

Added: 


Modified: 
lldb/source/Host/macosx/objcxx/Host.mm

Removed: 




diff  --git a/lldb/source/Host/macosx/objcxx/Host.mm 
b/lldb/source/Host/macosx/objcxx/Host.mm
index 8c22b57d09d8..778cf3d90869 100644
--- a/lldb/source/Host/macosx/objcxx/Host.mm
+++ b/lldb/source/Host/macosx/objcxx/Host.mm
@@ -136,6 +136,8 @@
   return false;
 }
 
+#if !NO_XPC_SERVICES
+
 static void *AcceptPIDFromInferior(void *arg) {
   const char *connect_url = (const char *)arg;
   ConnectionFileDescriptor file_conn;
@@ -154,8 +156,6 @@
   return NULL;
 }
 
-#if !NO_XPC_SERVICES
-
 const char *applscript_in_new_tty = "tell application \"Terminal\"\n"
 "   activate\n"
 "  do script \"/bin/bash -c '%s';exit\"\n"



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


[Lldb-commits] [PATCH] D73938: [Host.mm] Check for the right macro instead of inlining it

2020-02-10 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment.

Fixed in d23c15a687ff15327b88fa64da3184395012c2dc 
.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73938



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


[Lldb-commits] [lldb] 6b2979c - Revert "[lldb] Fix+re-enable Assert StackFrame Recognizer on Linux"

2020-02-10 Thread Davide Italiano via lldb-commits

Author: Davide Italiano
Date: 2020-02-10T13:27:35-08:00
New Revision: 6b2979c12300b90a1e69791d43ee9cff14f4265e

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

LOG: Revert "[lldb] Fix+re-enable Assert StackFrame Recognizer on Linux"

This reverts commit 1a39f1b966a8d8f15ed0d5a832d5097cccefe93b as
it breaks macOS.

Added: 


Modified: 
lldb/include/lldb/Target/StackFrameRecognizer.h
lldb/source/Commands/CommandObjectFrame.cpp

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/source/Target/AssertFrameRecognizer.cpp
lldb/source/Target/StackFrameRecognizer.cpp
lldb/test/Shell/Recognizer/assert.test
lldb/unittests/Target/StackFrameRecognizerTest.cpp

Removed: 




diff  --git a/lldb/include/lldb/Target/StackFrameRecognizer.h 
b/lldb/include/lldb/Target/StackFrameRecognizer.h
index 92cfca4227cf..b509e0760b31 100644
--- a/lldb/include/lldb/Target/StackFrameRecognizer.h
+++ b/lldb/include/lldb/Target/StackFrameRecognizer.h
@@ -101,8 +101,8 @@ class ScriptedStackFrameRecognizer : public 
StackFrameRecognizer {
 class StackFrameRecognizerManager {
 public:
   static void AddRecognizer(lldb::StackFrameRecognizerSP recognizer,
-ConstString module, ConstString symbol,
-ConstString alternate_symbol,
+ConstString module,
+ConstString symbol,
 bool first_instruction_only = true);
 
   static void AddRecognizer(lldb::StackFrameRecognizerSP recognizer,
@@ -113,8 +113,7 @@ class StackFrameRecognizerManager {
   static void ForEach(
   std::function const
-  &callback);
+ bool regexp)> const &callback);
 
   static bool RemoveRecognizerWithID(uint32_t recognizer_id);
 

diff  --git a/lldb/source/Commands/CommandObjectFrame.cpp 
b/lldb/source/Commands/CommandObjectFrame.cpp
index 5af9e2e314be..d86b50bd7aad 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -881,7 +881,7 @@ bool CommandObjectFrameRecognizerAdd::DoExecute(Args 
&command,
   } else {
 auto module = ConstString(m_options.m_module);
 auto func = ConstString(m_options.m_function);
-StackFrameRecognizerManager::AddRecognizer(recognizer_sp, module, func, 
{});
+StackFrameRecognizerManager::AddRecognizer(recognizer_sp, module, func);
   }
 #endif
 
@@ -960,13 +960,12 @@ class CommandObjectFrameRecognizerList : public 
CommandObjectParsed {
 StackFrameRecognizerManager::ForEach(
 [&result, &any_printed](uint32_t recognizer_id, std::string name,
 std::string function, std::string symbol,
-std::string alternate_symbol, bool regexp) {
+bool regexp) {
   if (name == "")
 name = "(internal)";
   result.GetOutputStream().Printf(
-  "%d: %s, module %s, function %s{%s}%s\n", recognizer_id,
-  name.c_str(), function.c_str(), symbol.c_str(),
-  alternate_symbol.c_str(), regexp ? " (regexp)" : "");
+  "%d: %s, module %s, function %s%s\n", recognizer_id, 
name.c_str(),
+  function.c_str(), symbol.c_str(), regexp ? " (regexp)" : "");
   any_printed = true;
 });
 

diff  --git 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 62d16296bd66..6acc23176248 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -2691,7 +2691,6 @@ static void RegisterObjCExceptionRecognizer() {
 std::tie(module, function) = AppleObjCRuntime::GetExceptionThrowLocation();
 StackFrameRecognizerManager::AddRecognizer(
 StackFrameRecognizerSP(new ObjCExceptionThrowFrameRecognizer()),
-module.GetFilename(), function, /*alternate_symbol*/ {},
-/*first_instruction_only*/ true);
+module.GetFilename(), function, /*first_instruction_only*/ true);
   });
 }

diff  --git a/lldb/source/Target/AssertFrameRecognizer.cpp 
b/lldb/source/Target/AssertFrameRecognizer.cpp
index b024ee7ba97c..89ed3ce022d9 100644
--- a/lldb/source/Target/AssertFrameRecognizer.cpp
+++ b/lldb/source/Target/AssertFrameRecognizer.cpp
@@ -16,6 +16,26 @@ using namespace lldb;
 using namespace lldb_private;
 
 namespace lldb_private {
+/// Checkes if the module containing a symbol has debug info.
+///
+/// \param[in] target
+///The target containing the module.
+/// \param[in] module_spec
+///The module spec th

Re: [Lldb-commits] [lldb] 1a39f1b - [lldb] Fix+re-enable Assert StackFrame Recognizer on Linux

2020-02-10 Thread Davide Italiano via lldb-commits
This caused three failures on macOS.
I reverted the patch to unbreak the bots.
http://lab.llvm.org:8080/green/job/lldb-cmake/8565/console 


Thanks,

—
Davide

> On Feb 10, 2020, at 01:33, Jan Kratochvil via lldb-commits 
>  wrote:
> 
> 
> Author: Jan Kratochvil
> Date: 2020-02-10T10:29:32+01:00
> New Revision: 1a39f1b966a8d8f15ed0d5a832d5097cccefe93b
> 
> URL: 
> https://github.com/llvm/llvm-project/commit/1a39f1b966a8d8f15ed0d5a832d5097cccefe93b
> DIFF: 
> https://github.com/llvm/llvm-project/commit/1a39f1b966a8d8f15ed0d5a832d5097cccefe93b.diff
> 
> LOG: [lldb] Fix+re-enable Assert StackFrame Recognizer on Linux
> 
> D73303 was failing on Fedora Linux and so it was disabled by Skip the
> AssertFrameRecognizer test for Linux.
> 
> I find no easy way how to find out if it gets recognized as
> `__assert_fail` or `__GI___assert_fail` as during `Process` ctor
> libc.so.6 is not yet loaded by the debuggee.
> 
> DWARF symbol `__GI___assert_fail` overrides the ELF symbol `__assert_fail`.
> While external debug info (=DWARF) gets disabled for testsuite (D55859)
> that sure does not apply for real world usage.
> 
> Differential Revision: https://reviews.llvm.org/D74252
> 
> Added: 
> 
> 
> Modified: 
>lldb/include/lldb/Target/StackFrameRecognizer.h
>lldb/source/Commands/CommandObjectFrame.cpp
>
> lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
>lldb/source/Target/AssertFrameRecognizer.cpp
>lldb/source/Target/StackFrameRecognizer.cpp
>lldb/test/Shell/Recognizer/assert.test
>lldb/unittests/Target/StackFrameRecognizerTest.cpp
> 
> Removed: 
> 
> 
> 
> 
> diff  --git a/lldb/include/lldb/Target/StackFrameRecognizer.h 
> b/lldb/include/lldb/Target/StackFrameRecognizer.h
> index b509e0760b31..92cfca4227cf 100644
> --- a/lldb/include/lldb/Target/StackFrameRecognizer.h
> +++ b/lldb/include/lldb/Target/StackFrameRecognizer.h
> @@ -101,8 +101,8 @@ class ScriptedStackFrameRecognizer : public 
> StackFrameRecognizer {
> class StackFrameRecognizerManager {
> public:
>   static void AddRecognizer(lldb::StackFrameRecognizerSP recognizer,
> -ConstString module,
> -ConstString symbol,
> +ConstString module, ConstString symbol,
> +ConstString alternate_symbol,
> bool first_instruction_only = true);
> 
>   static void AddRecognizer(lldb::StackFrameRecognizerSP recognizer,
> @@ -113,7 +113,8 @@ class StackFrameRecognizerManager {
>   static void ForEach(
>   std::function  std::string module, std::string symbol,
> - bool regexp)> const &callback);
> + std::string alternate_symbol, bool regexp)> const
> +  &callback);
> 
>   static bool RemoveRecognizerWithID(uint32_t recognizer_id);
> 
> 
> diff  --git a/lldb/source/Commands/CommandObjectFrame.cpp 
> b/lldb/source/Commands/CommandObjectFrame.cpp
> index d86b50bd7aad..5af9e2e314be 100644
> --- a/lldb/source/Commands/CommandObjectFrame.cpp
> +++ b/lldb/source/Commands/CommandObjectFrame.cpp
> @@ -881,7 +881,7 @@ bool CommandObjectFrameRecognizerAdd::DoExecute(Args 
> &command,
>   } else {
> auto module = ConstString(m_options.m_module);
> auto func = ConstString(m_options.m_function);
> -StackFrameRecognizerManager::AddRecognizer(recognizer_sp, module, func);
> +StackFrameRecognizerManager::AddRecognizer(recognizer_sp, module, func, 
> {});
>   }
> #endif
> 
> @@ -960,12 +960,13 @@ class CommandObjectFrameRecognizerList : public 
> CommandObjectParsed {
> StackFrameRecognizerManager::ForEach(
> [&result, &any_printed](uint32_t recognizer_id, std::string name,
> std::string function, std::string symbol,
> -bool regexp) {
> +std::string alternate_symbol, bool regexp) {
>   if (name == "")
> name = "(internal)";
>   result.GetOutputStream().Printf(
> -  "%d: %s, module %s, function %s%s\n", recognizer_id, 
> name.c_str(),
> -  function.c_str(), symbol.c_str(), regexp ? " (regexp)" : "");
> +  "%d: %s, module %s, function %s{%s}%s\n", recognizer_id,
> +  name.c_str(), function.c_str(), symbol.c_str(),
> +  alternate_symbol.c_str(), regexp ? " (regexp)" : "");
>   any_printed = true;
> });
> 
> 
> diff  --git 
> a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
>  
> b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
> index 6acc23176248..62d16296bd66 100644
> --- 
> a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
> +++ 
> b/lldb/source/Plugins/Languag

[Lldb-commits] [PATCH] D74252: Fix+re-enable Assert StackFrame Recognizer on Linux

2020-02-10 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a subscriber: davide.
jankratochvil added a comment.

@davide Sorry for the revert rG6b2979c12300b90a1e69791d43ee9cff14f4265e 
 - I will 
find some way to test stuff on OSX, I already made too many OSX breakages 
recently.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74252



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


[Lldb-commits] [PATCH] D74244: [lldb] Delete register info definitions in the x86_64 ABI classes

2020-02-10 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda accepted this revision.
jasonmolenda added a comment.
This revision is now accepted and ready to land.

Nice elimination of duplication.




Comment at: lldb/source/Target/ABI.cpp:249
+  int eh = -1;
+  int dwarf = -1;
+  for (unsigned reg = 0; reg < m_mc_register_info_up->getNumRegs(); ++reg) {

Would it be simpler to assign these to `LLDB_INVALID_REGNUM` at the beginning, 
instead of -1 and setting it later?



Comment at: lldb/source/Target/ABI.cpp:267
+  if (name_ref.consume_front(from_prefix) && to_integer(name_ref, _, 10))
+name = (to_prefix + name_ref).str();
+}

will `to_integer` bit work with an all-letter reg like `cpsr`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74244



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


[Lldb-commits] [lldb] bf65f19 - Revert "[Host.mm] Check for the right macro instead of inlining it"

2020-02-10 Thread Vedant Kumar via lldb-commits

Author: Vedant Kumar
Date: 2020-02-10T14:34:48-08:00
New Revision: bf65f19bce88fd9f1a74154d92afe37193ecd7a5

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

LOG: Revert "[Host.mm] Check for the right macro instead of inlining it"

This breaks macOS, because TARGET_OS_EMBEDDED is always defined. Thanks
to Jason Molenda for pointing this out.

Revert "Do not define AcceptPIDFromInferior when it will not be used"

This reverts commit d23c15a687ff15327b88fa64da3184395012c2dc.
This reverts commit 936d1427da1432d724dfa5851097347bcdf7c521.

Added: 


Modified: 
lldb/source/Host/macosx/objcxx/Host.mm

Removed: 




diff  --git a/lldb/source/Host/macosx/objcxx/Host.mm 
b/lldb/source/Host/macosx/objcxx/Host.mm
index 778cf3d90869..233734109c41 100644
--- a/lldb/source/Host/macosx/objcxx/Host.mm
+++ b/lldb/source/Host/macosx/objcxx/Host.mm
@@ -9,10 +9,9 @@
 #include "lldb/Host/Host.h"
 
 #include 
-#include 
 
 // On device doesn't have supporty for XPC.
-#if defined(__APPLE__) && defined(TARGET_OS_EMBEDDED)
+#if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__))
 #define NO_XPC_SERVICES 1
 #endif
 
@@ -136,8 +135,6 @@
   return false;
 }
 
-#if !NO_XPC_SERVICES
-
 static void *AcceptPIDFromInferior(void *arg) {
   const char *connect_url = (const char *)arg;
   ConnectionFileDescriptor file_conn;
@@ -156,6 +153,8 @@
   return NULL;
 }
 
+#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+
 const char *applscript_in_new_tty = "tell application \"Terminal\"\n"
 "   activate\n"
 "  do script \"/bin/bash -c '%s';exit\"\n"
@@ -308,11 +307,11 @@ repeat with the_window in (get windows)\n\
   return error;
 }
 
-#endif // #if !NO_XPC_SERVICES
+#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
 
 bool Host::OpenFileInExternalEditor(const FileSpec &file_spec,
 uint32_t line_no) {
-#if NO_XPC_SERVICES
+#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
   return false;
 #else
   // We attach this to an 'odoc' event to specify a particular selection
@@ -405,7 +404,7 @@ repeat with the_window in (get windows)\n\
   }
 
   return true;
-#endif // #if !NO_XPC_SERVICES
+#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
 }
 
 Environment Host::GetEnvironment() { return Environment(*_NSGetEnviron()); }
@@ -1264,7 +1263,7 @@ static bool ShouldLaunchUsingXPC(ProcessLaunchInfo 
&launch_info) {
   }
 
   if (launch_info.GetFlags().Test(eLaunchFlagLaunchInTTY)) {
-#if !NO_XPC_SERVICES
+#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
 return LaunchInNewTerminalWithAppleScript(exe_spec.GetPath().c_str(),
   launch_info);
 #else



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


[Lldb-commits] [PATCH] D73938: [Host.mm] Check for the right macro instead of inlining it

2020-02-10 Thread Vedant Kumar via Phabricator via lldb-commits
vsk reopened this revision.
vsk added a comment.
This revision is now accepted and ready to land.

Reverted in bf65f19bce88fd9f1a74154d92afe37193ecd7a5 
. Jason 
pointed out this breaks macOS, as TARGET_OS_EMBEDDED is always defined (just 
not always to 1). Let's try this again.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73938



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


[Lldb-commits] [PATCH] D73921: Assert that a subprogram should have a name when parsing DWARF

2020-02-10 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

I will try to look into `dwarfdump --verify` separately.


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

https://reviews.llvm.org/D73921



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


[Lldb-commits] [PATCH] D73921: Assert that a subprogram should have a name when parsing DWARF

2020-02-10 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik updated this revision to Diff 243678.
shafik marked 5 inline comments as done.
shafik added a comment.
Herald added a reviewer: jdoerfert.

Updated approach based on comments and added test for the new approach.


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

https://reviews.llvm.org/D73921

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/test/Shell/SymbolFile/DWARF/missing_dw_at_name_error.s

Index: lldb/test/Shell/SymbolFile/DWARF/missing_dw_at_name_error.s
===
--- /dev/null
+++ lldb/test/Shell/SymbolFile/DWARF/missing_dw_at_name_error.s
@@ -0,0 +1,203 @@
+# This test verifies that we catch that a subprogram is missing a DW_AT_name
+# during processing.
+
+# REQUIRES: x86
+
+# RUN: llvm-mc -triple x86_64-apple-macosx10.14.0  %s -filetype=obj > %t.o
+# RUN: lldb-test symbols --dump-clang-ast %t.o 2>&1 | FileCheck %s
+
+# CHECK: DWARF validation error: DW_TAG_subprogram without DW_AT_name
+
+# Generated from:
+#
+# int f() {
+#  return 1;
+# }
+#
+# The debug-info was modified by hand.
+	.section	__TEXT,__text,regular,pure_instructions
+	.build_version macos, 10, 14	sdk_version 10, 14
+	.globl	__Z1fv  ## -- Begin function _Z1fv
+	.p2align	4, 0x90
+__Z1fv: ## @_Z1fv
+Lfunc_begin0:
+	.file	1 "/Users/shafik/code" "simple_function.cpp"
+	.loc	1 1 0   ## simple_function.cpp:1:0
+	.cfi_startproc
+## %bb.0:
+	pushq	%rbp
+	.cfi_def_cfa_offset 16
+	.cfi_offset %rbp, -16
+	movq	%rsp, %rbp
+	.cfi_def_cfa_register %rbp
+Ltmp0:
+	.loc	1 2 3 prologue_end  ## simple_function.cpp:2:3
+	movl	$1, %eax
+	popq	%rbp
+	retq
+Ltmp1:
+Lfunc_end0:
+	.cfi_endproc
+## -- End function
+	.section	__DWARF,__debug_str,regular,debug
+Linfo_string:
+	.asciz	"Apple clang version 11.0.0 (clang-1100.0.31.5)" ## string offset=0
+	.asciz	"simple_function.cpp"   ## string offset=47
+	.asciz	"/Users/shafik/code"## string offset=67
+	.asciz	"f" ## string offset=86
+	.asciz	"_Z1fv" ## string offset=88
+	.asciz	"int"   ## string offset=94
+	.section	__DWARF,__debug_abbrev,regular,debug
+Lsection_abbrev:
+	.byte	1   ## Abbreviation Code
+	.byte	17  ## DW_TAG_compile_unit
+	.byte	1   ## DW_CHILDREN_yes
+	.byte	37  ## DW_AT_producer
+	.byte	14  ## DW_FORM_strp
+	.byte	19  ## DW_AT_language
+	.byte	5   ## DW_FORM_data2
+	.byte	3   ## DW_AT_name
+	.byte	14  ## DW_FORM_strp
+	.byte	16  ## DW_AT_stmt_list
+	.byte	23  ## DW_FORM_sec_offset
+	.byte	27  ## DW_AT_comp_dir
+	.byte	14  ## DW_FORM_strp
+	.ascii	"\264B" ## DW_AT_GNU_pubnames
+	.byte	25  ## DW_FORM_flag_present
+	.byte	17  ## DW_AT_low_pc
+	.byte	1   ## DW_FORM_addr
+	.byte	18  ## DW_AT_high_pc
+	.byte	6   ## DW_FORM_data4
+	.byte	0   ## EOM(1)
+	.byte	0   ## EOM(2)
+	.byte	2   ## Abbreviation Code
+	.byte	46  ## DW_TAG_subprogram
+	.byte	0   ## DW_CHILDREN_no
+	.byte	17  ## DW_AT_low_pc
+	.byte	1   ## DW_FORM_addr
+	.byte	18  ## DW_AT_high_pc
+	.byte	6   ## DW_FORM_data4
+	.byte	64  ## DW_AT_frame_base
+	.byte	24  ## DW_FORM_exprloc
+	.byte	110 ## DW_AT_linkage_name
+	.byte	14  ## DW_FORM_strp
+	.byte	58  ## DW_AT_decl_file
+	.byte	11  ## DW_FORM_data1
+	.byte	59  ## DW_AT_decl_line
+	.byte	11  ## DW_FORM_data1
+	.byte	73  ## DW_AT_type
+	.byte	19  ## DW_FORM_ref4
+	.byte	63  ## DW_AT_external
+	.byte	25  ## DW_FORM_flag_present
+	.byte	0   ## EOM(1)
+	.byte	0   ## EOM(2)
+	.byte	3   ## Abbreviation Code
+	.byte	36  ## DW_TAG_base_type
+	.byte	0   ## DW_CHILDREN_no
+	.byte	3   ## DW_AT_name
+	.byte	14  ## DW_FORM_strp
+	.byte	62  ## DW_AT_encoding
+	.byte	11  ## DW_FORM_data1
+	.byte	11  ## DW_AT_byte_size
+	.byte	11  ## DW_FORM_data1
+	.byte	0   ## EOM(1)
+	.byte	0   ## EOM(2)
+	.byte	0   ## EOM(3)
+	.section	__DWARF,__debug_info,regular,debug
+Lsection_info:
+L

[Lldb-commits] [PATCH] D73938: [Host.mm] Check for the right macro instead of inlining it

2020-02-10 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 243679.
vsk added a reviewer: jasonmolenda.

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

https://reviews.llvm.org/D73938

Files:
  lldb/source/Host/macosx/objcxx/Host.mm


Index: lldb/source/Host/macosx/objcxx/Host.mm
===
--- lldb/source/Host/macosx/objcxx/Host.mm
+++ lldb/source/Host/macosx/objcxx/Host.mm
@@ -9,13 +9,9 @@
 #include "lldb/Host/Host.h"
 
 #include 
+#include 
 
-// On device doesn't have supporty for XPC.
-#if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__))
-#define NO_XPC_SERVICES 1
-#endif
-
-#if !defined(NO_XPC_SERVICES)
+#if TARGET_OS_OSX
 #define __XPC_PRIVATE_H__
 #include 
 
@@ -135,6 +131,8 @@
   return false;
 }
 
+#if TARGET_OS_OSX
+
 static void *AcceptPIDFromInferior(void *arg) {
   const char *connect_url = (const char *)arg;
   ConnectionFileDescriptor file_conn;
@@ -153,8 +151,6 @@
   return NULL;
 }
 
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
-
 const char *applscript_in_new_tty = "tell application \"Terminal\"\n"
 "   activate\n"
 "  do script \"/bin/bash -c '%s';exit\"\n"
@@ -307,13 +303,13 @@
   return error;
 }
 
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // TARGET_OS_OSX
 
 bool Host::OpenFileInExternalEditor(const FileSpec &file_spec,
 uint32_t line_no) {
-#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
+#if !TARGET_OS_OSX
   return false;
-#else
+#else // !TARGET_OS_OSX
   // We attach this to an 'odoc' event to specify a particular selection
   typedef struct {
 int16_t reserved0; // must be zero
@@ -404,7 +400,7 @@
   }
 
   return true;
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // TARGET_OS_OSX
 }
 
 Environment Host::GetEnvironment() { return Environment(*_NSGetEnviron()); }
@@ -689,7 +685,7 @@
   return false;
 }
 
-#if !NO_XPC_SERVICES
+#if TARGET_OS_OSX
 static void PackageXPCArguments(xpc_object_t message, const char *prefix,
 const Args &args) {
   size_t count = args.GetArgumentCount();
@@ -841,7 +837,7 @@
 static Status LaunchProcessXPC(const char *exe_path,
ProcessLaunchInfo &launch_info,
lldb::pid_t &pid) {
-#if !NO_XPC_SERVICES
+#if TARGET_OS_OSX
   Status error = getXPCAuthorization(launch_info);
   if (error.Fail())
 return error;
@@ -1231,7 +1227,7 @@
 static bool ShouldLaunchUsingXPC(ProcessLaunchInfo &launch_info) {
   bool result = false;
 
-#if !NO_XPC_SERVICES
+#if TARGET_OS_OSX
   bool launchingAsRoot = launch_info.GetUserID() == 0;
   bool currentUserIsRoot = HostInfo::GetEffectiveUserID() == 0;
 
@@ -1263,7 +1259,7 @@
   }
 
   if (launch_info.GetFlags().Test(eLaunchFlagLaunchInTTY)) {
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#if TARGET_OS_OSX
 return LaunchInNewTerminalWithAppleScript(exe_spec.GetPath().c_str(),
   launch_info);
 #else


Index: lldb/source/Host/macosx/objcxx/Host.mm
===
--- lldb/source/Host/macosx/objcxx/Host.mm
+++ lldb/source/Host/macosx/objcxx/Host.mm
@@ -9,13 +9,9 @@
 #include "lldb/Host/Host.h"
 
 #include 
+#include 
 
-// On device doesn't have supporty for XPC.
-#if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__))
-#define NO_XPC_SERVICES 1
-#endif
-
-#if !defined(NO_XPC_SERVICES)
+#if TARGET_OS_OSX
 #define __XPC_PRIVATE_H__
 #include 
 
@@ -135,6 +131,8 @@
   return false;
 }
 
+#if TARGET_OS_OSX
+
 static void *AcceptPIDFromInferior(void *arg) {
   const char *connect_url = (const char *)arg;
   ConnectionFileDescriptor file_conn;
@@ -153,8 +151,6 @@
   return NULL;
 }
 
-#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
-
 const char *applscript_in_new_tty = "tell application \"Terminal\"\n"
 "   activate\n"
 "	do script \"/bin/bash -c '%s';exit\"\n"
@@ -307,13 +303,13 @@
   return error;
 }
 
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // TARGET_OS_OSX
 
 bool Host::OpenFileInExternalEditor(const FileSpec &file_spec,
 uint32_t line_no) {
-#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
+#if !TARGET_OS_OSX
   return false;
-#else
+#else // !TARGET_OS_OSX
   // We attach this to an 'odoc' event to specify a particular selection
   typedef struct {
 int16_t reserved0; // must be zero
@@ -404,7 +400,7 @@
   }
 
   return true;
-#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
+#endif // TARGET_OS_OSX
 }
 
 Environment Host::GetEnvironment() { return Envi

[Lldb-commits] [PATCH] D73921: Assert that a subprogram should have a name when parsing DWARF

2020-02-10 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

Given that this error is non-actionable, I don't see any value in diagnosing 
this LLDB. It is important to have this in dwarfdump, which does not detect 
this right now.

It might be interesting to have LLDB run in a sort of "pedantic" mode which 
verifies all the DWARF it consumes with the dwarf verifier in LLVM. We have 
something similar in dsymutil which runs the verifier over the generated dSYM.


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

https://reviews.llvm.org/D73921



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


[Lldb-commits] [PATCH] D74310: [lldb] Don't model std::atomic as a transparent data structure in the data formatter

2020-02-10 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik accepted this revision.
shafik added a comment.
This revision is now accepted and ready to land.

LGTM otherwise.




Comment at: 
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py:70
+# This should just treat the atomic pointer as a normal pointer.
+self.expect("frame var p.child", substrs=["Value = 0x"])

What about inspecting `p` and `p.child.parent`?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D74310



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


[Lldb-commits] [lldb] b7bd35a - [TestKernVerStrLCNOTE] Check the *right* architecture.

2020-02-10 Thread Davide Italiano via lldb-commits

Author: Davide Italiano
Date: 2020-02-10T15:17:52-08:00
New Revision: b7bd35a8f13fd332fc7d32c0f03b13ef9e2fb2c1

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

LOG: [TestKernVerStrLCNOTE] Check the *right* architecture.

Added: 


Modified: 

lldb/packages/Python/lldbsuite/test/macosx/lc-note/kern-ver-str/TestKernVerStrLCNOTE.py

Removed: 




diff  --git 
a/lldb/packages/Python/lldbsuite/test/macosx/lc-note/kern-ver-str/TestKernVerStrLCNOTE.py
 
b/lldb/packages/Python/lldbsuite/test/macosx/lc-note/kern-ver-str/TestKernVerStrLCNOTE.py
index c28b4bc52a58..167f0984fc6c 100644
--- 
a/lldb/packages/Python/lldbsuite/test/macosx/lc-note/kern-ver-str/TestKernVerStrLCNOTE.py
+++ 
b/lldb/packages/Python/lldbsuite/test/macosx/lc-note/kern-ver-str/TestKernVerStrLCNOTE.py
@@ -17,7 +17,7 @@ class TestKernVerStrLCNOTE(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 
 @skipIf(debug_info=no_match(["dsym"]), bugnumber="This test is looking 
explicitly for a dSYM")
-@skipIf(archs=no_match(['amd64']))
+@skipIf(archs=no_match(['x86_64']))
 @skipUnlessDarwin
 def test_lc_note(self):
 self.build()



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


[Lldb-commits] [PATCH] D73921: Assert that a subprogram should have a name when parsing DWARF

2020-02-10 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

In D73921#1855961 , @davide wrote:

> DWARFASTParserClang looks to me the wrong layer to fix this. Why can't this 
> be caught in the generic DWARF Parser?
>  I also believe that it's better if dwarfdump -verify crashes on this, rather 
> than lldb.


Many

In D73921#1868191 , @JDevlieghere 
wrote:

> Given that this error is non-actionable, I don't see any value in diagnosing 
> this LLDB. It is important to have this in dwarfdump, which does not detect 
> this right now.
>
> It might be interesting to have LLDB run in a sort of "pedantic" mode which 
> verifies all the DWARF it consumes with the dwarf verifier in LLVM. We have 
> something similar in dsymutil which runs the verifier over the generated dSYM.


Note that many OS X developers never debug a dSYM build of their project.  They 
debug with .o files, then make a dSYM when they do their release builds.  And 
they probably don't look at the output of dsymutil amidst all the noise of a 
build.  So if we only do this in dsymutil, we are greatly narrowing the range 
of folks who might see & report this error to us.


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

https://reviews.llvm.org/D73921



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


[Lldb-commits] [PATCH] D73921: Assert that a subprogram should have a name when parsing DWARF

2020-02-10 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D73921#1868228 , @jingham wrote:

> In D73921#1855961 , @davide wrote:
>
> > DWARFASTParserClang looks to me the wrong layer to fix this. Why can't this 
> > be caught in the generic DWARF Parser?
> >  I also believe that it's better if dwarfdump -verify crashes on this, 
> > rather than lldb.
>
>
> Many
>
> In D73921#1868191 , @JDevlieghere 
> wrote:
>
> > Given that this error is non-actionable, I don't see any value in 
> > diagnosing this LLDB. It is important to have this in dwarfdump, which does 
> > not detect this right now.
> >
> > It might be interesting to have LLDB run in a sort of "pedantic" mode which 
> > verifies all the DWARF it consumes with the dwarf verifier in LLVM. We have 
> > something similar in dsymutil which runs the verifier over the generated 
> > dSYM.
>
>
> Note that many OS X developers never debug a dSYM build of their project.  
> They debug with .o files, then make a dSYM when they do their release builds. 
>  And they probably don't look at the output of dsymutil amidst all the noise 
> of a build.  So if we only do this in dsymutil, we are greatly narrowing the 
> range of folks who might see & report this error to us.


I think you misunderstood my suggestion. I'm not saying that we should limit 
this to dsymutil. I'm saying that dsymutil has a mode where it verifies the 
dSYM it just created. It's entirely optional and you have to pass `--verify` to 
enable it. I suggest we have something similar in LLDB, where we have a 
pedantic mode that, when enabled, checks all the DWARF it reads with the DWARF 
verifier.

As discussed offline with Shafik, I prefer this over the current approach for a 
few reasons:

- It would make this behavior opt-in. Verifying the DWARF can be expensive and 
not every user has control over the debug info it reads. It should be possible 
to silence these warnings if they don't change LLDB's behavior.
- It would provide much better coverage than some ad-hoc checks. Currently, not 
getting these kind of errors form LLDB doesn't tell you much. We may or may not 
have a check for a particular kind of invalid DWARF, so to be sure you'd still 
have to run it through `dwarfdump -verify`.
- It would mean we only have to maintain a single DWARF verifier, which is 
already tested extensively.
- It fits with our long-term goal of moving to LLVM's DWARF parser.


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

https://reviews.llvm.org/D73921



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


[Lldb-commits] [PATCH] D73921: Assert that a subprogram should have a name when parsing DWARF

2020-02-10 Thread Davide Italiano via Phabricator via lldb-commits
davide added a comment.

In D73921#1868286 , @JDevlieghere 
wrote:

> In D73921#1868228 , @jingham wrote:
>
> > In D73921#1855961 , @davide wrote:
> >
> > > DWARFASTParserClang looks to me the wrong layer to fix this. Why can't 
> > > this be caught in the generic DWARF Parser?
> > >  I also believe that it's better if dwarfdump -verify crashes on this, 
> > > rather than lldb.
> >
> >
> > Many
> >
> > In D73921#1868191 , @JDevlieghere 
> > wrote:
> >
> > > Given that this error is non-actionable, I don't see any value in 
> > > diagnosing this LLDB. It is important to have this in dwarfdump, which 
> > > does not detect this right now.
> > >
> > > It might be interesting to have LLDB run in a sort of "pedantic" mode 
> > > which verifies all the DWARF it consumes with the dwarf verifier in LLVM. 
> > > We have something similar in dsymutil which runs the verifier over the 
> > > generated dSYM.
> >
> >
> > Note that many OS X developers never debug a dSYM build of their project.  
> > They debug with .o files, then make a dSYM when they do their release 
> > builds.  And they probably don't look at the output of dsymutil amidst all 
> > the noise of a build.  So if we only do this in dsymutil, we are greatly 
> > narrowing the range of folks who might see & report this error to us.
>
>
> I think you misunderstood my suggestion. I'm not saying that we should limit 
> this to dsymutil. I'm saying that dsymutil has a mode where it verifies the 
> dSYM it just created. It's entirely optional and you have to pass `--verify` 
> to enable it. I suggest we have something similar in LLDB, where we have a 
> pedantic mode that, when enabled, checks all the DWARF it reads with the 
> DWARF verifier.
>
> As discussed offline with Shafik, I prefer this over the current approach for 
> a few reasons:
>
> - It would make this behavior opt-in. Verifying the DWARF can be expensive 
> and not every user has control over the debug info it reads. It should be 
> possible to silence these warnings if they don't change LLDB's behavior.
> - It would provide much better coverage than some ad-hoc checks. Currently, 
> not getting these kind of errors form LLDB doesn't tell you much. We may or 
> may not have a check for a particular kind of invalid DWARF, so to be sure 
> you'd still have to run it through `dwarfdump -verify`.
> - It would mean we only have to maintain a single DWARF verifier, which is 
> already tested extensively.
> - It fits with our long-term goal of moving to LLVM's DWARF parser.


I second this motion.
Realistically what this patch is currently doing is diagnosing a very narrow 
problem emitting a somewhat obscure diagnostic for users. People who use 
debuggers aren't necessarily asked to understand DWARF.
If we really want to move towards a verification mode, the plan suggested above 
is much more reasonable than having piecemeal diagnostic sprinkled over the 
parser.


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

https://reviews.llvm.org/D73921



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


[Lldb-commits] [lldb] 9ed9742 - Only perform the login_session_has_gui_access on macOS

2020-02-10 Thread Jason Molenda via lldb-commits

Author: Jason Molenda
Date: 2020-02-10T18:16:31-08:00
New Revision: 9ed9742ec05091e4c16d93005acbfafc6f801e7d

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

LOG: Only perform the login_session_has_gui_access on macOS

Added: 


Modified: 
lldb/tools/debugserver/source/RNBRemote.cpp

Removed: 




diff  --git a/lldb/tools/debugserver/source/RNBRemote.cpp 
b/lldb/tools/debugserver/source/RNBRemote.cpp
index b4dd9031eb67..87aca91c00c4 100644
--- a/lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/lldb/tools/debugserver/source/RNBRemote.cpp
@@ -3741,12 +3741,17 @@ static bool process_is_already_being_debugged 
(nub_process_t pid) {
 // for debug permission by popping up a dialog box and attach
 // may fail outright).
 static bool login_session_has_gui_access () {
+  // I believe this API only works on macOS.
+#if TARGET_OS_OSX == 0
+  return true;
+#else
   auditinfo_addr_t info;
   getaudit_addr(&info, sizeof(info));
   if (info.ai_flags & AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS)
 return true;
   else
 return false;
+#endif
 }
 
 // Checking for 
@@ -3766,6 +3771,7 @@ static bool login_session_has_gui_access () {
 // $ security authorizationdb read system.privilege.taskport.debug
 
 static bool developer_mode_enabled () {
+  // This API only exists on macOS.
 #if TARGET_OS_OSX == 0
   return true;
 #else



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


[Lldb-commits] [PATCH] D74377: [lldb-vscode] fix logging

2020-02-10 Thread walter erquinigo via Phabricator via lldb-commits
wallace created this revision.
wallace added a reviewer: clayborg.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This applies the patch clayborg sent me for fixing logging, which didn't 
include incoming messages from VSCode.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74377

Files:
  lldb/tools/lldb-vscode/VSCode.cpp


Index: lldb/tools/lldb-vscode/VSCode.cpp
===
--- lldb/tools/lldb-vscode/VSCode.cpp
+++ lldb/tools/lldb-vscode/VSCode.cpp
@@ -128,6 +128,12 @@
 
   if (!input.read_full(log.get(), length, json_str))
 return json_str;
+
+  if (log) {
+*log << "--> " << std::endl
+ << "Content-Length: " << length << "\r\n\r\n"
+ << json_str << std::endl;
+  }
 
   return json_str;
 }


Index: lldb/tools/lldb-vscode/VSCode.cpp
===
--- lldb/tools/lldb-vscode/VSCode.cpp
+++ lldb/tools/lldb-vscode/VSCode.cpp
@@ -128,6 +128,12 @@
 
   if (!input.read_full(log.get(), length, json_str))
 return json_str;
+
+  if (log) {
+*log << "--> " << std::endl
+ << "Content-Length: " << length << "\r\n\r\n"
+ << json_str << std::endl;
+  }
 
   return json_str;
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 14ecbd7 - [lldb][NFC] Refactor TypeSystemClang::GetTypeName

2020-02-10 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-02-11T08:43:57+01:00
New Revision: 14ecbd7b8ded18af6c95f6a9957da541d1ec0e80

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

LOG: [lldb][NFC] Refactor TypeSystemClang::GetTypeName

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 b1704e625634..3d9a80dd3f73 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -3495,21 +3495,20 @@ bool 
TypeSystemClang::GetCompleteType(lldb::opaque_compiler_type_t type) {
 }
 
 ConstString TypeSystemClang::GetTypeName(lldb::opaque_compiler_type_t type) {
-  std::string type_name;
-  if (type) {
-clang::PrintingPolicy printing_policy(getASTContext().getPrintingPolicy());
-clang::QualType qual_type(GetQualType(type));
-printing_policy.SuppressTagKeyword = true;
-const clang::TypedefType *typedef_type =
-qual_type->getAs();
-if (typedef_type) {
-  const clang::TypedefNameDecl *typedef_decl = typedef_type->getDecl();
-  type_name = typedef_decl->getQualifiedNameAsString();
-} else {
-  type_name = qual_type.getAsString(printing_policy);
-}
+  if (!type)
+return ConstString();
+
+  clang::QualType qual_type(GetQualType(type));
+
+  // For a typedef just return the qualified name.
+  if (const auto *typedef_type = qual_type->getAs()) {
+const clang::TypedefNameDecl *typedef_decl = typedef_type->getDecl();
+return ConstString(typedef_decl->getQualifiedNameAsString());
   }
-  return ConstString(type_name);
+
+  clang::PrintingPolicy printing_policy(getASTContext().getPrintingPolicy());
+  printing_policy.SuppressTagKeyword = true;
+  return ConstString(qual_type.getAsString(printing_policy));
 }
 
 uint32_t



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