Re: [Lldb-commits] [lldb] 8a0f0e2 - [lldb/test] Tweak libcxx string test on Apple+ARM devices

2020-02-21 Thread Davidino Italiano via lldb-commits


> On Feb 21, 2020, at 3:54 PM, Vedant Kumar via lldb-commits 
>  wrote:
> 
> 
> Author: Vedant Kumar
> Date: 2020-02-21T15:54:38-08:00
> New Revision: 8a0f0e2656abf76b771037c6543caf9a31744120
> 
> URL: 
> https://github.com/llvm/llvm-project/commit/8a0f0e2656abf76b771037c6543caf9a31744120
> DIFF: 
> https://github.com/llvm/llvm-project/commit/8a0f0e2656abf76b771037c6543caf9a31744120.diff
> 
> LOG: [lldb/test] Tweak libcxx string test on Apple+ARM devices
> 
> On Apple platforms, is __arm__ isn't defined and we're not on Intel, we use an
> alternate std::string layout. I.e., the libcxx string test fails on phones
> because the hand-crafted "garbage" string structs are actually valid strings.
> 
> See:
> 
> ```
>  // _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for
>  // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility.
>  #if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && 
>   \
>   (!defined(__arm__) || __ARM_ARCH_7K__ >= 2)) || 
>   \
>  defined(_LIBCPP_ALTERNATE_STRING_LAYOUT)
>  #define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
>  #endif
> ```
> 
> Disable inspection of the garbage structs on Apple+ARM devices.
> 
> Added: 
> 
> 
> Modified: 
>
> lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
> 
> Removed: 
> 
> 

Thank you for the commit message. We (me in particular) historically have been 
bad at this but this is an example of something great for archeology.

> 
> 
> diff  --git 
> a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
>  
> b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
> index 3753067113b1..c6f95d7e8593 100644
> --- 
> a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
> +++ 
> b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
> @@ -116,7 +116,9 @@ def cleanup():
> '%s::allocator >) uchar = "a"'%(ns,ns,ns),
> ])
> 
> -if is_64_bit:
> +# The test assumes that std::string is in its cap-size-data layout.
> +is_alternate_layout = ('arm' in self.getArchitecture()) and 
> self.platformIsDarwin()
> +if is_64_bit and not is_alternate_layout:
> self.expect("frame variable garbage1", substrs=['garbage1 = 
> Summary Unavailable'])
> self.expect("frame variable garbage2", substrs=['garbage2 = 
> Summary Unavailable'])
> self.expect("frame variable garbage3", substrs=['garbage3 = 
> Summary Unavailable'])
> 
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


Re: [Lldb-commits] [lldb] 6385c2a - [AppleObjCRuntimeV2] Force lazily allocated class names to be resolved.

2020-03-20 Thread Davidino Italiano via lldb-commits


> On Mar 20, 2020, at 1:43 PM, Davide Italiano via lldb-commits 
>  wrote:
> 
> 
> Author: Davide Italiano
> Date: 2020-03-20T13:43:08-07:00
> New Revision: 6385c2ab8ff8304eafa822012c40934690bde124
> 
> URL: 
> https://github.com/llvm/llvm-project/commit/6385c2ab8ff8304eafa822012c40934690bde124
> DIFF: 
> https://github.com/llvm/llvm-project/commit/6385c2ab8ff8304eafa822012c40934690bde124.diff
> 
> LOG: [AppleObjCRuntimeV2] Force lazily allocated class names to be resolved.
> 
> Fixes a couple of tests on new versions of the Obj-C runtime.
> 
> Added: 
> 
> 
> Modified: 
>
> lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
>lldb/test/Shell/ExecControl/StopHook/stop-hook.test
> 
> Removed: 
> 
> 
> 
> 
> diff  --git 
> a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
>  
> b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
> index 9fea9a217dce..4a07c792eebb 100644
> --- 
> a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
> +++ 
> b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
> @@ -1175,6 +1175,28 @@ AppleObjCRuntimeV2::GetClassDescriptorFromISA(ObjCISA 
> isa) {
>   return class_descriptor_sp;
> }
> 
> +static std::pair ObjCGetClassNameRaw(
> +  AppleObjCRuntime::ObjCISA isa,
> +  Process *process) {
> +  StreamString expr_string;
> +  std::string input = std::to_string(isa);
> +  expr_string.Printf("(const char *)objc_debug_class_getNameRaw(%s)",
> + input.c_str());
> +
> +  ValueObjectSP result_sp;
> +  EvaluateExpressionOptions eval_options;
> +  eval_options.SetLanguage(lldb::eLanguageTypeObjC);
> +  eval_options.SetResultIsInternal(true);
> +  eval_options.SetGenerateDebugInfo(true);
> +  eval_options.SetTimeout(process->GetUtilityExpressionTimeout());
> +  auto eval_result = process->GetTarget().EvaluateExpression(
> +  expr_string.GetData(),
> +  process->GetThreadList().GetSelectedThread()->GetSelectedFrame().get(),
> +  result_sp, eval_options);
> +  ConstString type_name(result_sp->GetSummaryAsCString());
> +  return std::make_pair(eval_result == eExpressionCompleted, type_name);
> +}
> +
> ObjCLanguageRuntime::ClassDescriptorSP
> AppleObjCRuntimeV2::GetClassDescriptor(ValueObject &valobj) {
>   ClassDescriptorSP objc_class_sp;
> @@ -1210,7 +1232,10 @@ AppleObjCRuntimeV2::GetClassDescriptor(ValueObject 
> &valobj) {
> return objc_class_sp;
> 
>   objc_class_sp = GetClassDescriptorFromISA(isa);
> -  if (isa && !objc_class_sp) {
> +
> +  if (objc_class_sp)
> +return objc_class_sp;
> +  else {
> Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS |
>   LIBLLDB_LOG_TYPES));
> LLDB_LOGF(log,
> @@ -1219,6 +1244,13 @@ AppleObjCRuntimeV2::GetClassDescriptor(ValueObject 
> &valobj) {
>   "not in class descriptor cache 0x%" PRIx64,
>   isa_pointer, isa);
>   }
> +
> +  ClassDescriptorSP descriptor_sp(new ClassDescriptorV2(*this, isa, 
> nullptr));
> +  auto resolved = ObjCGetClassNameRaw(isa, process);
> +  if (resolved.first == true) {
> +AddClass(isa, descriptor_sp, resolved.second.AsCString());
> +objc_class_sp = descriptor_sp;
> +  }
>   return objc_class_sp;
> }
> 
> 
> diff  --git a/lldb/test/Shell/ExecControl/StopHook/stop-hook.test 
> b/lldb/test/Shell/ExecControl/StopHook/stop-hook.test
> index a06de6634ea1..7e5b37b63854 100644
> --- a/lldb/test/Shell/ExecControl/StopHook/stop-hook.test
> +++ b/lldb/test/Shell/ExecControl/StopHook/stop-hook.test
> @@ -51,7 +51,7 @@ run
> thread step-over
> # Stepping inside of the stop hook range
> # CHECK: (lldb) thread step-over
> -# CHECK-NEXT: (void *) $1 = 0x
> +# CHECK-NEXT: (void *) $2 = 0x
> # CHECK: ->{{.*}} // We should stop here after stepping.

This is an unfortunate side effect of SetResultInternal not working in the 
expression parser.
Jim Ingham is fixing this, to the best of my knowledge.

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


Re: [Lldb-commits] [lldb] 6385c2a - [AppleObjCRuntimeV2] Force lazily allocated class names to be resolved.

2020-03-20 Thread Davidino Italiano via lldb-commits


> On Mar 20, 2020, at 1:48 PM, Jim Ingham  wrote:
> 
> Yes, I’m working on a fix.
> 
> Can you use regular expressions or globs in FileCheck matching?   It means if 
> you ever add a test that makes an expression above this test in the file, you 
> have to go renumber everything.  That's kind of annoying even if the 
> numbering was still working, and you aren’t testing the expression results 
> numbering here anyway…
> 
> Jim
> 

Sure. Fix coming in a second.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] 6385c2a - [AppleObjCRuntimeV2] Force lazily allocated class names to be resolved.

2020-03-20 Thread Davidino Italiano via lldb-commits


> On Mar 20, 2020, at 1:49 PM, Davidino Italiano via lldb-commits 
>  wrote:
> 
> 
> 
>> On Mar 20, 2020, at 1:48 PM, Jim Ingham  wrote:
>> 
>> Yes, I’m working on a fix.
>> 
>> Can you use regular expressions or globs in FileCheck matching?   It means 
>> if you ever add a test that makes an expression above this test in the file, 
>> you have to go renumber everything.  That's kind of annoying even if the 
>> numbering was still working, and you aren’t testing the expression results 
>> numbering here anyway…
>> 
>> Jim
>> 
> 
> Sure. Fix coming in a second.

commit 696ae6f7d8e170c82d5f2978fc99cc061f52b4ef (HEAD -> master, origin/master, 
origin/HEAD)
Author: Davide Italiano 
Date:   Fri Mar 20 13:57:40 2020 -0700

[StopHook] Use wildcard matching. Pointed out by Jim Ingham.

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


Re: [Lldb-commits] [lldb] 64799fb - [debugserver/ARM64] Make sure watchpoints hit are attributed correctly.

2020-03-31 Thread Davidino Italiano via lldb-commits
Folks, I don’t have a Windows or a Linux machine to try this, but please let me 
know or skip this test in case it breaks something.
I’ll try to keep an eye on the bots for notifications.

> On Mar 31, 2020, at 3:56 PM, Davide Italiano via lldb-commits 
>  wrote:
> 
> 
> Author: Davide Italiano
> Date: 2020-03-31T15:56:20-07:00
> New Revision: 64799fbebddc9877f78c7501b0b986b7afe84d6b
> 
> URL: 
> https://github.com/llvm/llvm-project/commit/64799fbebddc9877f78c7501b0b986b7afe84d6b
> DIFF: 
> https://github.com/llvm/llvm-project/commit/64799fbebddc9877f78c7501b0b986b7afe84d6b.diff
> 
> LOG: [debugserver/ARM64] Make sure watchpoints hit are attributed correctly.
> 
> This didn't happen for arm64 if you have watches for variables
> that are contigous in memory.
> 
> 
> 
> Added: 
>lldb/test/API/commands/watchpoints/watchpoint_count/Makefile
>lldb/test/API/commands/watchpoints/watchpoint_count/TestWatchpointCount.py
>lldb/test/API/commands/watchpoints/watchpoint_count/main.c
> 
> Modified: 
>lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
> 
> Removed: 
> 
> 
> 
> 
> diff  --git a/lldb/test/API/commands/watchpoints/watchpoint_count/Makefile 
> b/lldb/test/API/commands/watchpoints/watchpoint_count/Makefile
> new file mode 100644
> index ..10495940055b
> --- /dev/null
> +++ b/lldb/test/API/commands/watchpoints/watchpoint_count/Makefile
> @@ -0,0 +1,3 @@
> +C_SOURCES := main.c
> +
> +include Makefile.rules
> 
> diff  --git 
> a/lldb/test/API/commands/watchpoints/watchpoint_count/TestWatchpointCount.py 
> b/lldb/test/API/commands/watchpoints/watchpoint_count/TestWatchpointCount.py
> new file mode 100644
> index ..18667e913a94
> --- /dev/null
> +++ 
> b/lldb/test/API/commands/watchpoints/watchpoint_count/TestWatchpointCount.py
> @@ -0,0 +1,43 @@
> +import lldb
> +from lldbsuite.test.decorators import *
> +from lldbsuite.test.lldbtest import *
> +from lldbsuite.test import lldbutil
> +
> +class TestWatchpointCount(TestBase):
> +mydir = TestBase.compute_mydir(__file__)
> +NO_DEBUG_INFO_TESTCASE = True
> +
> +def setUp(self):
> +TestBase.setUp(self)
> +
> +def test_watchpoint_count(self):
> +self.build()
> +(_, process, thread, _) = lldbutil.run_to_source_breakpoint(self, 
> "patatino", lldb.SBFileSpec("main.c"))
> +frame = thread.GetFrameAtIndex(0)
> +first_var = frame.FindVariable("x1")
> +second_var = frame.FindVariable("x2")
> +
> +error = lldb.SBError()
> +first_watch = first_var.Watch(True, False, True, error)
> +if not error.Success():
> +self.fail(
> +"Failed to make watchpoint for x1: %s" %
> +(error.GetCString()))
> +
> +second_watch = second_var.Watch(True, False, True, error)
> +if not error.Success():
> +self.fail(
> +"Failed to make watchpoint for x2: %s" %
> +(error.GetCString()))
> +process.Continue()
> +
> +stop_reason = thread.GetStopReason()
> +self.assertEqual(stop_reason, lldb.eStopReasonWatchpoint, 
> "watchpoint for x1 not hit")
> +stop_reason_descr = thread.GetStopDescription(256)
> +self.assertEqual(stop_reason_descr, "watchpoint 1")
> +
> +process.Continue()
> +stop_reason = thread.GetStopReason()
> +self.assertEqual(stop_reason, lldb.eStopReasonWatchpoint, 
> "watchpoint for x2 not hit")
> +stop_reason_descr = thread.GetStopDescription(256)
> +self.assertEqual(stop_reason_descr, "watchpoint 2")
> 
> diff  --git a/lldb/test/API/commands/watchpoints/watchpoint_count/main.c 
> b/lldb/test/API/commands/watchpoints/watchpoint_count/main.c
> new file mode 100644
> index ..fc9a370e41f3
> --- /dev/null
> +++ b/lldb/test/API/commands/watchpoints/watchpoint_count/main.c
> @@ -0,0 +1,13 @@
> +#include 
> +#include 
> +
> +int main() {
> +  uint8_t x1 = 0;
> +  uint16_t x2 = 0;
> +
> +  printf("patatino\n");
> +
> +  x1 += 1;
> +  x2 += 2;
> +  return 0;
> +}
> 
> diff  --git a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp 
> b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
> index e5d4b05d987c..3e7bda88e6af 100644
> --- a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
> +++ b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
> @@ -1067,31 +1067,34 @@ uint32_t 
> DNBArchMachARM64::GetHardwareWatchpointHit(nub_addr_t &addr) {
>"DNBArchMachARM64::GetHardwareWatchpointHit() addr = 
> 0x%llx",
>(uint64_t)addr);
> 
> -  // This is the watchpoint value to match against, i.e., word address.
> -  nub_addr_t wp_val = addr & ~((nub_addr_t)3);
>   if (kret == KERN_SUCCESS) {
> DBG &debug_state = m_state.dbg;
> uint32_t i, num = NumSupportedHardwareWatchpoints();
> for (i = 0; i < num; ++

Re: [Lldb-commits] [lldb] 29beabb - [lldb/API] Add missing LLDB_REGISTER_METHOD macros

2020-04-06 Thread Davidino Italiano via lldb-commits


> On Apr 6, 2020, at 4:09 PM, Jonas Devlieghere via lldb-commits 
>  wrote:
> 
> 
> Author: Jonas Devlieghere
> Date: 2020-04-06T16:09:40-07:00
> New Revision: 29beabbe51c222c7ee0f8aead5b45649363cdbea
> 
> URL: 
> https://github.com/llvm/llvm-project/commit/29beabbe51c222c7ee0f8aead5b45649363cdbea
> DIFF: 
> https://github.com/llvm/llvm-project/commit/29beabbe51c222c7ee0f8aead5b45649363cdbea.diff
> 
> LOG: [lldb/API] Add missing LLDB_REGISTER_METHOD macros
> 
> Add LLDB_REGISTER_METHOD macros for GetRetriesWithFixIts and
> SetRetriesWithFixIts.
> 
> Added: 
> 
> 
> Modified: 
>lldb/source/API/SBExpressionOptions.cpp
> 
> Removed: 
> 
> 

I’m seeing a crash on green dragon for TestFixIts. Will this fix it?

Thanks,

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


Re: [Lldb-commits] [lldb] 62ccfb6 - [LLDB] Fix Arm/AArch64 Linux broken build

2020-07-21 Thread Davidino Italiano via lldb-commits


> On Jul 21, 2020, at 1:47 AM, Muhammad Omair Javaid via lldb-commits 
>  wrote:
> 
> 
> Author: Muhammad Omair Javaid
> Date: 2020-07-21T13:46:39+05:00
> New Revision: 62ccfb6ed0bed899f22abc00bec96a372420c5d0
> 
> URL: 
> https://github.com/llvm/llvm-project/commit/62ccfb6ed0bed899f22abc00bec96a372420c5d0
> DIFF: 
> https://github.com/llvm/llvm-project/commit/62ccfb6ed0bed899f22abc00bec96a372420c5d0.diff
> 
> LOG: [LLDB] Fix Arm/AArch64 Linux broken build
> 
> This patch fixes build breakage on LLDB Arm/AArch64 Linux buildbots.
> 
> http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/6649
> http://lab.llvm.org:8011/builders/lldb-arm-ubuntu/builds/1919
> 
> This build breakage was introduces by commit: 
> 001c8e1fd9f09d3de9ff6e64bdac4b8ca681dfb4
> 
> Added: 
> 
> 
> Modified: 
>lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
> 
> Removed: 
> 
> 
> 
> 
> diff  --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h 
> b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
> index 30b11eb37684..3e9a0b3aab90 100644
> --- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
> +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
> @@ -79,6 +79,10 @@ class PlatformMacOSX : public PlatformDarwin {
> private:
>   PlatformMacOSX(const PlatformMacOSX &) = delete;
>   const PlatformMacOSX &operator=(const PlatformMacOSX &) = delete;
> +
> +#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
> +  uint32_t m_num_arm_arches = 0;
> +#endif
> };

Uh, I think this is wrong. Let me take a look.

—
Davide

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

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


Re: [Lldb-commits] [lldb] cd05406 - [testsuite] Adapt lldb-server base test helper to run on arm64

2020-07-21 Thread Davidino Italiano via lldb-commits


> On Jul 21, 2020, at 5:17 AM, Pavel Labath  wrote:
> 
> On 20/07/2020 23:38, Davide Italiano via lldb-commits wrote:
>> @@ -1601,8 +1601,18 @@ def single_step_only_steps_one_instruction(
>> # variable value
>> if re.match("s390x", arch):
>> expected_step_count = 2
>> +# ARM64 requires "4" instructions: 2 to compute the address (adrp, 
>> add),
>> +# one to materialize the constant (mov) and the store
>> +if re.match("arm64", arch):
>> +expected_step_count = 4
>> +
>> self.assertEqual(step_count, expected_step_count)
>> 
>> +# ARM64: Once addresses and constants are materialized, only one
>> +# instruction is needed.
>> +if re.match("arm64", arch):
>> +expected_step_count = 1
>> +
>> # Verify we hit the next state.
>> args["expected_g_c1"] = "0"
>> args["expected_g_c2"] = "0"
>> 
> 
> I have a feeling this was racing with aa73ee052f -- [lldb/test] Use
> inline assembly for instruction counting tests.
> 
> There should be no need for magic step counts after that patch. (If
> there is, I'd like to know why.)
> 
> pl

Interesting. I’ll try on my device and see whether we can revert this.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] 1fae85a - [DWARF] Add instructions to regenerate this test, if needed.

2020-04-16 Thread Davidino Italiano via lldb-commits


> On Apr 16, 2020, at 2:01 PM, Robinson, Paul  wrote:
> 
> 
> 
>> -Original Message-
>> From: lldb-commits > > On Behalf Of
>> Davide Italiano via lldb-commits
>> Sent: Thursday, April 16, 2020 4:32 PM
>> To: lldb-commits@lists.llvm.org 
>> Subject: [Lldb-commits] [lldb] 1fae85a - [DWARF] Add instructions to
>> regenerate this test, if needed.
>> 
>> 
>> Author: Davide Italiano
>> Date: 2020-04-16T13:31:32-07:00
>> New Revision: 1fae85a8534ec51ca893899314bd244b3e9684c7
>> 
>> URL: https://github.com/llvm/llvm-
>> project/commit/1fae85a8534ec51ca893899314bd244b3e9684c7
>> DIFF: https://github.com/llvm/llvm-
>> project/commit/1fae85a8534ec51ca893899314bd244b3e9684c7.diff
>> 
>> LOG: [DWARF] Add instructions to regenerate this test, if needed.
>> 
>> Added:
>> 
>> 
>> Modified:
>>lldb/test/Shell/SymbolFile/DWARF/static_scope.s
>> 
>> Removed:
>> 
>> 
>> 
>> ##
>> ##
>> diff  --git a/lldb/test/Shell/SymbolFile/DWARF/static_scope.s
>> b/lldb/test/Shell/SymbolFile/DWARF/static_scope.s
>> index 84a69e08ecfc..02d497ac9ccb 100644
>> --- a/lldb/test/Shell/SymbolFile/DWARF/static_scope.s
>> +++ b/lldb/test/Shell/SymbolFile/DWARF/static_scope.s
>> @@ -3,6 +3,15 @@
>> 
>> # REQUIRES: x86
>> 
>> +# Original test case (for future reference), compiled with:
>> +# $ clang-10 -g -Og test.c -o test
>> +# $ cat test.c
>> +# volatile int a;
>> +# main() {
>> +#   int b = 3;
> 
> Did you mean this to be `static`?
> --paulr
> 

No. Read the the review that introduced this test.

>> +#   a;
>> +# }
>> +
>> # RUN: llvm-mc -triple=x86_64-apple-macosx10.15.0 -filetype=obj %s > %t.o
>> # RUN: lldb-test symbols %t.o | FileCheck %s
>> 
>> 
>> 
>> 
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org 
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits 
>> 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] 9f6a308 - [lldb/Utility] Fix a bug in stringify_append for printing addresses.

2020-04-16 Thread Davidino Italiano via lldb-commits


> On Apr 16, 2020, at 2:37 PM, Shafik Yaghmour via lldb-commits 
>  wrote:
> 
>> 
>> On Apr 16, 2020, at 2:04 PM, Jonas Devlieghere via lldb-commits 
>>  wrote:
>> 
>> 
>> Author: Jonas Devlieghere
>> Date: 2020-04-16T14:03:55-07:00
>> New Revision: 9f6a308457d1bfebf1cee94b0306e738f270e512
>> 
>> URL: 
>> https://github.com/llvm/llvm-project/commit/9f6a308457d1bfebf1cee94b0306e738f270e512
>> DIFF: 
>> https://github.com/llvm/llvm-project/commit/9f6a308457d1bfebf1cee94b0306e738f270e512.diff
>> 
>> LOG: [lldb/Utility] Fix a bug in stringify_append for printing addresses.
>> 
>> The recent change in the API macros revealed that we were not printing
>> the pointer address for a bunch of methods, but rather the address of
>> the pointer. It's something I had already noticed while looking at some
>> reproducer traces, but hadn't made it to the top of my list yet. This
>> fixes the issue by providing a more specific overload.
>> 
>> Added: 
>> 
>> 
>> Modified: 
>>   lldb/include/lldb/Utility/ReproducerInstrumentation.h
>> 
>> Removed: 
>> 
>> 
>> 
>> 
>> diff  --git a/lldb/include/lldb/Utility/ReproducerInstrumentation.h 
>> b/lldb/include/lldb/Utility/ReproducerInstrumentation.h
>> index 3728e19386d1..3b5dde3d2e2a 100644
>> --- a/lldb/include/lldb/Utility/ReproducerInstrumentation.h
>> +++ b/lldb/include/lldb/Utility/ReproducerInstrumentation.h
>> @@ -32,6 +32,11 @@ inline void stringify_append(llvm::raw_string_ostream 
>> &ss, const T &t) {
>>  ss << &t;
>> }
>> 
> 
> 
> Note you can use the narrower static_cast
> 

That would be wrong.

>> +template 
>> +inline void stringify_append(llvm::raw_string_ostream &ss, T *t) {
>> +  ss << reinterpret_cast(t);
>> +}
>> +
>> template 
>> inline void stringify_append(llvm::raw_string_ostream &ss, const T *t) {
>>  ss << reinterpret_cast(t);
>> @@ -115,7 +120,7 @@ template  inline std::string 
>> stringify_args(const Ts &... ts) {
>> 
>> #define LLDB_CONSTRUCT_(T, ...)  
>>   \
>>  lldb_private::repro::Recorder _recorder(LLVM_PRETTY_FUNCTION,   
>>  \
>> -  stringify_args(__VA_ARGS__)); 
>>\
>> +  stringify_args(this, 
>> __VA_ARGS__));  \
>>  if (lldb_private::repro::InstrumentationData _data =
>>  \
>>  LLDB_GET_INSTRUMENTATION_DATA()) {  
>>  \
>>_recorder.Record(_data.GetSerializer(), _data.GetRegistry(),  
>>  \
>> 
>> 
>> 
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org 
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits 
> 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] 304ba5d - Delete cargo-cult code that doesn't affect the testsuite.

2020-04-24 Thread Davidino Italiano via lldb-commits


> On Apr 24, 2020, at 11:55 AM, Adrian Prantl via lldb-commits 
>  wrote:
> 
> 
> Author: Adrian Prantl
> Date: 2020-04-24T11:54:52-07:00
> New Revision: 304ba5d4c6bc48853832e4fc4666f8e37308d7a4
> 
> URL: 
> https://github.com/llvm/llvm-project/commit/304ba5d4c6bc48853832e4fc4666f8e37308d7a4
> DIFF: 
> https://github.com/llvm/llvm-project/commit/304ba5d4c6bc48853832e4fc4666f8e37308d7a4.diff
> 
> LOG: Delete cargo-cult code that doesn't affect the testsuite.
> 
> 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 3446db0b1214..4f35d8ac51f0 100644
> --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
> +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
> @@ -1231,11 +1231,6 @@ void TypeSystemClang::SetOwningModule(clang::Decl 
> *decl,
>   decl->setFromASTFile();
>   decl->setOwningModuleID(owning_module.GetValue());
>   decl->setModuleOwnershipKind(clang::Decl::ModuleOwnershipKind::Visible);
> -  if (auto *decl_ctx = llvm::dyn_cast(decl)) {
> -decl_ctx->setHasExternalVisibleStorage();
> -if (auto *ns = llvm::dyn_cast(decl_ctx))
> -  ns->getPrimaryContext()->setMustBuildLookupTable();
> -  }
> }

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


Re: [Lldb-commits] [lldb] b3757f3 - [lldb/CMake] Autodetect Python dependency

2020-01-06 Thread Davidino Italiano via lldb-commits


> On Jan 6, 2020, at 9:07 AM, Jonas Devlieghere via lldb-commits 
>  wrote:
> 
> 
> Author: Jonas Devlieghere
> Date: 2020-01-06T09:05:05-08:00
> New Revision: b3757f3091d1c718a91f5b06b7364b2af28339fa
> 
> URL: 
> https://github.com/llvm/llvm-project/commit/b3757f3091d1c718a91f5b06b7364b2af28339fa
> DIFF: 
> https://github.com/llvm/llvm-project/commit/b3757f3091d1c718a91f5b06b7364b2af28339fa.diff
> 
> LOG: [lldb/CMake] Autodetect Python dependency
> 
> Python was the last remaining "optional" dependency for LLDB. This moves
> the code to find Python into FindPythonInterpAndLibs using the same
> principles as FindCursesAndPanel.
> 
> Differential revision: https://reviews.llvm.org/D72107
> 
> Added: 
>lldb/cmake/modules/FindPythonInterpAndLibs.cmake
>lldb/lldb/cmake/modules/FindPythonInterpAndLibs.cmake
> 
> Modified: 
>lldb/cmake/modules/LLDBConfig.cmake
> 
> Removed: 
> 
> 
> 
> 
> diff  --git a/lldb/cmake/modules/FindPythonInterpAndLibs.cmake 
> b/lldb/cmake/modules/FindPythonInterpAndLibs.cmake
> new file mode 100644
> index ..fcbf0212d72b
> --- /dev/null
> +++ b/lldb/cmake/modules/FindPythonInterpAndLibs.cmake
> @@ -0,0 +1,51 @@
> +#.rst:
> +# FindPythonInterpAndLibs
> +# ---
> +#
> +# Find the python interpreter and libraries as a whole.
> +
> +if(PYTHON_LIBRARIES AND PYTHON_INCLUDE_DIRS AND PYTHON_EXECUTABLE)
> +  set(PYTHONINTERPANDLIBS_FOUND TRUE)
> +else()
> +  if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
> +find_package(Python3 COMPONENTS Interpreter Development QUIET)
> +if (Python3_FOUND AND Python3_Interpreter_FOUND)
> +  set(PYTHON_LIBRARIES ${Python3_LIBRARIES})
> +  set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
> +  set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
> +  mark_as_advanced(
> +PYTHON_LIBRARIES
> +PYTHON_INCLUDE_DIRS
> +PYTHON_EXECUTABLE)
> +endif()
> +  else()
> +find_package(PythonInterp QUIET)
> +find_package(PythonLibs QUIET)
> +if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND)
> +  if (NOT CMAKE_CROSSCOMPILING)
> +string(REPLACE "." ";" pythonlibs_version_list 
> ${PYTHONLIBS_VERSION_STRING})
> +list(GET pythonlibs_version_list 0 pythonlibs_major)
> +list(GET pythonlibs_version_list 1 pythonlibs_minor)
> +
> +# Ignore the patch version. Some versions of macOS report a 
> diff erent
> +# patch version for the system provided interpreter and libraries.
> +if (CMAKE_CROSSCOMPILING OR (PYTHON_VERSION_MAJOR VERSION_EQUAL 
> pythonlibs_major AND
> +PYTHON_VERSION_MINOR VERSION_EQUAL pythonlibs_minor))
> +  mark_as_advanced(
> +PYTHON_LIBRARIES
> +PYTHON_INCLUDE_DIRS
> +PYTHON_EXECUTABLE)
> +endif()
> +  endif()
> +endif()
> +  endif()
> +
> +  include(FindPackageHandleStandardArgs)
> +  find_package_handle_standard_args(PythonInterpAndLibs
> +FOUND_VAR
> +  PYTHONINTERPANDLIBS_FOUND
> +REQUIRED_VARS
> +  PYTHON_LIBRARIES
> +  PYTHON_INCLUDE_DIRS
> +  PYTHON_EXECUTABLE)
> +endif()
> 
> diff  --git a/lldb/cmake/modules/LLDBConfig.cmake 
> b/lldb/cmake/modules/LLDBConfig.cmake
> index 52b8257951be..12fb97fc9d7d 100644
> --- a/lldb/cmake/modules/LLDBConfig.cmake
> +++ b/lldb/cmake/modules/LLDBConfig.cmake
> @@ -51,16 +51,8 @@ add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable 
> editline support in LLDB" Li
> add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" 
> CursesAndPanel CURSESANDPANEL_FOUND)
> add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in 
> LLDB" LibLZMA LIBLZMA_FOUND)
> add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in 
> LLDB" Lua LUA_FOUND)
> +add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support 
> in LLDB" PythonInterpAndLibs PYTHONINTERPANDLIBS_FOUND)
> 
> -set(default_enable_python ON)
> -
> -if(CMAKE_SYSTEM_NAME MATCHES "Android")
> -  set(default_enable_python OFF)
> -elseif(IOS)
> -  set(default_enable_python OFF)
> -endif()
> -
> -option(LLDB_ENABLE_PYTHON "Enable Python scripting integration." 
> ${default_enable_python})
> option(LLDB_RELOCATABLE_PYTHON "Use the PYTHONHOME environment variable to 
> locate Python." OFF)
> option(LLDB_USE_SYSTEM_SIX "Use six.py shipped with system and do not install 
> a copy of it" OFF)
> option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if 
> available" ON)
> @@ -142,48 +134,13 @@ if (LLDB_ENABLE_LIBEDIT)
> endif()
> 
> if (LLDB_ENABLE_PYTHON)
> -  if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
> -find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
> -if(Python3_VERSION VERSION_LESS 3.5)
>