Re: [Lldb-commits] [lldb] 079e664 - [lldb] Re-enable TestPlatformProcessConnect on macos

2021-01-20 Thread Eric Christopher via lldb-commits
On Wed, Jan 20, 2021 at 2:51 PM Pavel Labath  wrote:

> On 20/01/2021 04:35, Eric Christopher wrote:
> > +Jordan Rupprecht 
> >
> > Interesting, we were using this internally to point to an lldb-server to
> > test. I've disabled some tests at the moment, but I'm not sure it isn't
> > entirely useful functionality :)
> >
> > -eric
> >
>
> Yes, I don't think I have fully considered all the aspects of this
> patch. I'll revert this and start over.
>
>
Cheers!  :)

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


Re: [Lldb-commits] [lldb] 079e664 - [lldb] Re-enable TestPlatformProcessConnect on macos

2021-01-19 Thread Eric Christopher via lldb-commits
+Jordan Rupprecht 

Interesting, we were using this internally to point to an lldb-server to
test. I've disabled some tests at the moment, but I'm not sure it isn't
entirely useful functionality :)

-eric

On Tue, Jan 19, 2021 at 5:01 AM Pavel Labath via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

>
> Author: Pavel Labath
> Date: 2021-01-19T11:01:07+01:00
> New Revision: 079e664661770a78e30c0d27a12d50047f1b1ea8
>
> URL:
> https://github.com/llvm/llvm-project/commit/079e664661770a78e30c0d27a12d50047f1b1ea8
> DIFF:
> https://github.com/llvm/llvm-project/commit/079e664661770a78e30c0d27a12d50047f1b1ea8.diff
>
> LOG: [lldb] Re-enable TestPlatformProcessConnect on macos
>
> The test couldn't find lldb-server as it's path was being overridden by
> LLDB_DEBUGSERVER_PATH environment variable (pointing to debugserver).
> This test should always use lldb-server, as it tests its platform
> capabilities.
>
> There's no need for the environment override, as lldb-server tests
> should test the executable they just built, so I just remote the
> override capability.
>
> Added:
>
>
> Modified:
>
> lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
>
> lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
>
> Removed:
>
>
>
>
> 
> diff  --git
> a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
> b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
> index 07136108b2a4..d16549420a14 100644
> ---
> a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
> +++
> b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
> @@ -72,9 +72,6 @@ def get_lldb_server_exe():
>  A path to the lldb-server exe if it is found to exist; otherwise,
>  returns None.
>  """
> -if "LLDB_DEBUGSERVER_PATH" in os.environ:
> -return os.environ["LLDB_DEBUGSERVER_PATH"]
> -
>  return _get_debug_monitor_from_lldb(
>  lldbtest_config.lldbExec, "lldb-server")
>
>
> diff  --git
> a/lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
> b/lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
> index 8ddab260b494..3607c49c9c97 100644
> ---
> a/lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
> +++
> b/lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
> @@ -11,7 +11,6 @@ class
> TestPlatformProcessConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
>  @skipIfRemote
>  @expectedFailureAll(hostoslist=["windows"], triple='.*-android')
>  @skipIfWindows # lldb-server does not terminate correctly
> -@skipIfDarwin # lldb-server not found correctly
>  def test_platform_process_connect(self):
>  self.build()
>
>
>
>
> ___
> 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] [lldb] c140322 - Use zu rather than llu format specifier for size_t (-Wformat warning fix).

2020-09-16 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-09-16T19:28:05-07:00
New Revision: c140322819806cb292e079d62f2e9dbab697c08c

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

LOG: Use zu rather than llu format specifier for size_t (-Wformat warning fix).

Added: 


Modified: 
lldb/source/Expression/REPL.cpp

Removed: 




diff  --git a/lldb/source/Expression/REPL.cpp b/lldb/source/Expression/REPL.cpp
index 1f2b009c4893..c3d14960f74c 100644
--- a/lldb/source/Expression/REPL.cpp
+++ b/lldb/source/Expression/REPL.cpp
@@ -196,7 +196,7 @@ static bool ReadCode(const std::string , std::string 
,
   const size_t max_size = code.max_size();
   if (file_size > max_size) {
 error_sp->Printf("file at path '%s' too large: "
- "file_size = %llu, max_size = %llu\n",
+ "file_size = %zu, max_size = %zu\n",
  path.c_str(), file_size, max_size);
 return false;
   }



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


[Lldb-commits] [lldb] b529c52 - Add override to fix -Winconsistent-missing-override warning.

2020-08-09 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-08-09T22:12:10-07:00
New Revision: b529c5270c99e0ca18e3cbd9a5f50eb0970e560a

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

LOG: Add override to fix -Winconsistent-missing-override warning.

Added: 


Modified: 
lldb/include/lldb/Target/ThreadPlanPython.h

Removed: 




diff  --git a/lldb/include/lldb/Target/ThreadPlanPython.h 
b/lldb/include/lldb/Target/ThreadPlanPython.h
index c04500ad5de8..7b37b2b9ce5a 100644
--- a/lldb/include/lldb/Target/ThreadPlanPython.h
+++ b/lldb/include/lldb/Target/ThreadPlanPython.h
@@ -47,7 +47,7 @@ class ThreadPlanPython : public ThreadPlan {
 
   bool StopOthers() override { return m_stop_others; }
 
-  void SetStopOthers(bool new_value) { m_stop_others = new_value; }
+  void SetStopOthers(bool new_value) override { m_stop_others = new_value; }
 
   void DidPush() override;
 



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


Re: [Lldb-commits] [lldb] 1d9b860 - Unify the return value of GetByteSize to an llvm::Optional (NFC-ish)

2020-07-27 Thread Eric Christopher via lldb-commits
Thanks Pavel :)

On Mon, Jul 27, 2020, 11:35 AM Pavel Labath  wrote:

> On 27/07/2020 19:03, Adrian Prantl via lldb-commits wrote:
> > Do you happen to have a link to a bot with the failures? Or can you send
> > me the output in case it's an internal bot?
> >
> > thanks,
> > adrian
> >
>
> This should do it:
> http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/14598
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] 1d9b860 - Unify the return value of GetByteSize to an llvm::Optional (NFC-ish)

2020-07-27 Thread Eric Christopher via lldb-commits
No problem, thanks! :)

On Mon, Jul 27, 2020, 9:26 AM Adrian Prantl  wrote:

> Thanks, Eric! Sorry for not paying attention after landing this.
>
> -- adrian
>
> On Jul 25, 2020, at 6:43 PM, Eric Christopher  wrote:
>
> Hi Adrian,
>
> I'm really sorry, but I've just reverted this. I'm not sure what's up, but
> it's causing massive test failures in lldb on linux. Happy to help sync up
> with you.
>
> echristo@athyra ~/s/llvm-project> git push
> To github.com:llvm/llvm-project.git
>18975762c19..4b14ef33e81  master -> master
>
> Thanks!
>
> -eric
>
> On Sat, Jul 25, 2020 at 8:28 AM Adrian Prantl via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>>
>> Author: Adrian Prantl
>> Date: 2020-07-25T08:27:21-07:00
>> New Revision: 1d9b860fb6a85df33fd52fcacc6a5efb421621bd
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/1d9b860fb6a85df33fd52fcacc6a5efb421621bd
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/1d9b860fb6a85df33fd52fcacc6a5efb421621bd.diff
>>
>> LOG: Unify the return value of GetByteSize to an llvm::Optional
>> (NFC-ish)
>>
>> This cleanup patch unifies all methods called GetByteSize() in the
>> ValueObject hierarchy to return an optional, like the methods in
>> CompilerType do. This means fewer magic 0 values, which could fix bugs
>> down the road in languages where types can have a size of zero, such
>> as Swift and C (but not C++).
>>
>> Differential Revision: https://reviews.llvm.org/D84285
>>
>> Added:
>>
>>
>> Modified:
>> lldb/include/lldb/Core/ValueObject.h
>> lldb/include/lldb/Core/ValueObjectCast.h
>> lldb/include/lldb/Core/ValueObjectChild.h
>> lldb/include/lldb/Core/ValueObjectConstResult.h
>> lldb/include/lldb/Core/ValueObjectDynamicValue.h
>> lldb/include/lldb/Core/ValueObjectMemory.h
>> lldb/include/lldb/Core/ValueObjectRegister.h
>> lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
>> lldb/include/lldb/Core/ValueObjectVariable.h
>> lldb/include/lldb/Expression/ExpressionVariable.h
>> lldb/include/lldb/Target/StackFrameRecognizer.h
>> lldb/source/API/SBValue.cpp
>> lldb/source/Commands/CommandObjectWatchpoint.cpp
>> lldb/source/Core/ValueObject.cpp
>> lldb/source/Core/ValueObjectCast.cpp
>> lldb/source/Core/ValueObjectConstResult.cpp
>> lldb/source/Core/ValueObjectDynamicValue.cpp
>> lldb/source/Core/ValueObjectMemory.cpp
>> lldb/source/Core/ValueObjectRegister.cpp
>> lldb/source/Core/ValueObjectSyntheticFilter.cpp
>> lldb/source/Core/ValueObjectVariable.cpp
>> lldb/source/Expression/ExpressionVariable.cpp
>> lldb/source/Expression/Materializer.cpp
>> lldb/source/Target/StackFrame.cpp
>>
>> Removed:
>>
>>
>>
>>
>> 
>> diff  --git a/lldb/include/lldb/Core/ValueObject.h
>> b/lldb/include/lldb/Core/ValueObject.h
>> index 0080368fd996..a557d69f3ae3 100644
>> --- a/lldb/include/lldb/Core/ValueObject.h
>> +++ b/lldb/include/lldb/Core/ValueObject.h
>> @@ -358,7 +358,7 @@ class ValueObject : public UserID {
>>virtual bool CanProvideValue();
>>
>>// Subclasses must implement the functions below.
>> -  virtual uint64_t GetByteSize() = 0;
>> +  virtual llvm::Optional GetByteSize() = 0;
>>
>>virtual lldb::ValueType GetValueType() const = 0;
>>
>>
>> diff  --git a/lldb/include/lldb/Core/ValueObjectCast.h
>> b/lldb/include/lldb/Core/ValueObjectCast.h
>> index d91ca6a92be8..342803f8ca63 100644
>> --- a/lldb/include/lldb/Core/ValueObjectCast.h
>> +++ b/lldb/include/lldb/Core/ValueObjectCast.h
>> @@ -30,7 +30,7 @@ class ValueObjectCast : public ValueObject {
>>  ConstString name,
>>  const CompilerType _type);
>>
>> -  uint64_t GetByteSize() override;
>> +  llvm::Optional GetByteSize() override;
>>
>>size_t CalculateNumChildren(uint32_t max) override;
>>
>>
>> diff  --git a/lldb/include/lldb/Core/ValueObjectChild.h
>> b/lldb/include/lldb/Core/ValueObjectChild.h
>> index c6f44a29b059..9a9fd9294261 100644
>> --- a/lldb/include/lldb/Core/ValueObjectChild.h
>> +++ b/lldb/include/lldb/Core/ValueObjectChild.h
>> @@ -30,7 +30,7 @@ class ValueObjectChild : public ValueObject {
>>  public:
>>~ValueObjectChild() override;
>>
>> -  uint64_t GetByteSize() override { return m_byte_size; }
>> +  llvm::Optional GetByteSize() override { return m_byte_size; }
>>
>>lldb::offset_t GetByteOffset() override { return m_byte_offset; }
>>
>>
>> diff  --git a/lldb/include/lldb/Core/ValueObjectConstResult.h
>> b/lldb/include/lldb/Core/ValueObjectConstResult.h
>> index 0e868c687e93..8d823baa0b7b 100644
>> --- a/lldb/include/lldb/Core/ValueObjectConstResult.h
>> +++ b/lldb/include/lldb/Core/ValueObjectConstResult.h
>> @@ -62,7 +62,7 @@ class ValueObjectConstResult : public ValueObject {
>>static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
>>  const Status );
>>
>> -  uint64_t 

Re: [Lldb-commits] [lldb] 1d9b860 - Unify the return value of GetByteSize to an llvm::Optional (NFC-ish)

2020-07-25 Thread Eric Christopher via lldb-commits
Hi Adrian,

I'm really sorry, but I've just reverted this. I'm not sure what's up, but
it's causing massive test failures in lldb on linux. Happy to help sync up
with you.

echristo@athyra ~/s/llvm-project> git push
To github.com:llvm/llvm-project.git
   18975762c19..4b14ef33e81  master -> master

Thanks!

-eric

On Sat, Jul 25, 2020 at 8:28 AM Adrian Prantl via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

>
> Author: Adrian Prantl
> Date: 2020-07-25T08:27:21-07:00
> New Revision: 1d9b860fb6a85df33fd52fcacc6a5efb421621bd
>
> URL:
> https://github.com/llvm/llvm-project/commit/1d9b860fb6a85df33fd52fcacc6a5efb421621bd
> DIFF:
> https://github.com/llvm/llvm-project/commit/1d9b860fb6a85df33fd52fcacc6a5efb421621bd.diff
>
> LOG: Unify the return value of GetByteSize to an llvm::Optional
> (NFC-ish)
>
> This cleanup patch unifies all methods called GetByteSize() in the
> ValueObject hierarchy to return an optional, like the methods in
> CompilerType do. This means fewer magic 0 values, which could fix bugs
> down the road in languages where types can have a size of zero, such
> as Swift and C (but not C++).
>
> Differential Revision: https://reviews.llvm.org/D84285
>
> Added:
>
>
> Modified:
> lldb/include/lldb/Core/ValueObject.h
> lldb/include/lldb/Core/ValueObjectCast.h
> lldb/include/lldb/Core/ValueObjectChild.h
> lldb/include/lldb/Core/ValueObjectConstResult.h
> lldb/include/lldb/Core/ValueObjectDynamicValue.h
> lldb/include/lldb/Core/ValueObjectMemory.h
> lldb/include/lldb/Core/ValueObjectRegister.h
> lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
> lldb/include/lldb/Core/ValueObjectVariable.h
> lldb/include/lldb/Expression/ExpressionVariable.h
> lldb/include/lldb/Target/StackFrameRecognizer.h
> lldb/source/API/SBValue.cpp
> lldb/source/Commands/CommandObjectWatchpoint.cpp
> lldb/source/Core/ValueObject.cpp
> lldb/source/Core/ValueObjectCast.cpp
> lldb/source/Core/ValueObjectConstResult.cpp
> lldb/source/Core/ValueObjectDynamicValue.cpp
> lldb/source/Core/ValueObjectMemory.cpp
> lldb/source/Core/ValueObjectRegister.cpp
> lldb/source/Core/ValueObjectSyntheticFilter.cpp
> lldb/source/Core/ValueObjectVariable.cpp
> lldb/source/Expression/ExpressionVariable.cpp
> lldb/source/Expression/Materializer.cpp
> lldb/source/Target/StackFrame.cpp
>
> Removed:
>
>
>
>
> 
> diff  --git a/lldb/include/lldb/Core/ValueObject.h
> b/lldb/include/lldb/Core/ValueObject.h
> index 0080368fd996..a557d69f3ae3 100644
> --- a/lldb/include/lldb/Core/ValueObject.h
> +++ b/lldb/include/lldb/Core/ValueObject.h
> @@ -358,7 +358,7 @@ class ValueObject : public UserID {
>virtual bool CanProvideValue();
>
>// Subclasses must implement the functions below.
> -  virtual uint64_t GetByteSize() = 0;
> +  virtual llvm::Optional GetByteSize() = 0;
>
>virtual lldb::ValueType GetValueType() const = 0;
>
>
> diff  --git a/lldb/include/lldb/Core/ValueObjectCast.h
> b/lldb/include/lldb/Core/ValueObjectCast.h
> index d91ca6a92be8..342803f8ca63 100644
> --- a/lldb/include/lldb/Core/ValueObjectCast.h
> +++ b/lldb/include/lldb/Core/ValueObjectCast.h
> @@ -30,7 +30,7 @@ class ValueObjectCast : public ValueObject {
>  ConstString name,
>  const CompilerType _type);
>
> -  uint64_t GetByteSize() override;
> +  llvm::Optional GetByteSize() override;
>
>size_t CalculateNumChildren(uint32_t max) override;
>
>
> diff  --git a/lldb/include/lldb/Core/ValueObjectChild.h
> b/lldb/include/lldb/Core/ValueObjectChild.h
> index c6f44a29b059..9a9fd9294261 100644
> --- a/lldb/include/lldb/Core/ValueObjectChild.h
> +++ b/lldb/include/lldb/Core/ValueObjectChild.h
> @@ -30,7 +30,7 @@ class ValueObjectChild : public ValueObject {
>  public:
>~ValueObjectChild() override;
>
> -  uint64_t GetByteSize() override { return m_byte_size; }
> +  llvm::Optional GetByteSize() override { return m_byte_size; }
>
>lldb::offset_t GetByteOffset() override { return m_byte_offset; }
>
>
> diff  --git a/lldb/include/lldb/Core/ValueObjectConstResult.h
> b/lldb/include/lldb/Core/ValueObjectConstResult.h
> index 0e868c687e93..8d823baa0b7b 100644
> --- a/lldb/include/lldb/Core/ValueObjectConstResult.h
> +++ b/lldb/include/lldb/Core/ValueObjectConstResult.h
> @@ -62,7 +62,7 @@ class ValueObjectConstResult : public ValueObject {
>static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
>  const Status );
>
> -  uint64_t GetByteSize() override;
> +  llvm::Optional GetByteSize() override;
>
>lldb::ValueType GetValueType() const override;
>
> @@ -113,7 +113,7 @@ class ValueObjectConstResult : public ValueObject {
>CompilerType GetCompilerTypeImpl() override;
>
>ConstString m_type_name;
> -  uint64_t m_byte_size;
> +  llvm::Optional m_byte_size;
>
>

[Lldb-commits] [lldb] 4b14ef3 - Temporarily Revert "Unify the return value of GetByteSize to an llvm::Optional (NFC-ish)"

2020-07-25 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-07-25T18:42:04-07:00
New Revision: 4b14ef33e81c01632e848e7a67ccc6b11fb4c595

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

LOG: Temporarily Revert "Unify the return value of GetByteSize to an 
llvm::Optional (NFC-ish)"
as it's causing numerous (176) test failures on linux.

This reverts commit 1d9b860fb6a85df33fd52fcacc6a5efb421621bd.

Added: 


Modified: 
lldb/include/lldb/Core/ValueObject.h
lldb/include/lldb/Core/ValueObjectCast.h
lldb/include/lldb/Core/ValueObjectChild.h
lldb/include/lldb/Core/ValueObjectConstResult.h
lldb/include/lldb/Core/ValueObjectDynamicValue.h
lldb/include/lldb/Core/ValueObjectMemory.h
lldb/include/lldb/Core/ValueObjectRegister.h
lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/include/lldb/Core/ValueObjectVariable.h
lldb/include/lldb/Expression/ExpressionVariable.h
lldb/include/lldb/Target/StackFrameRecognizer.h
lldb/source/API/SBValue.cpp
lldb/source/Commands/CommandObjectWatchpoint.cpp
lldb/source/Core/ValueObject.cpp
lldb/source/Core/ValueObjectCast.cpp
lldb/source/Core/ValueObjectConstResult.cpp
lldb/source/Core/ValueObjectDynamicValue.cpp
lldb/source/Core/ValueObjectMemory.cpp
lldb/source/Core/ValueObjectRegister.cpp
lldb/source/Core/ValueObjectSyntheticFilter.cpp
lldb/source/Core/ValueObjectVariable.cpp
lldb/source/Expression/ExpressionVariable.cpp
lldb/source/Expression/Materializer.cpp
lldb/source/Target/StackFrame.cpp

Removed: 




diff  --git a/lldb/include/lldb/Core/ValueObject.h 
b/lldb/include/lldb/Core/ValueObject.h
index a557d69f3ae3..0080368fd996 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -358,7 +358,7 @@ class ValueObject : public UserID {
   virtual bool CanProvideValue();
 
   // Subclasses must implement the functions below.
-  virtual llvm::Optional GetByteSize() = 0;
+  virtual uint64_t GetByteSize() = 0;
 
   virtual lldb::ValueType GetValueType() const = 0;
 

diff  --git a/lldb/include/lldb/Core/ValueObjectCast.h 
b/lldb/include/lldb/Core/ValueObjectCast.h
index 342803f8ca63..d91ca6a92be8 100644
--- a/lldb/include/lldb/Core/ValueObjectCast.h
+++ b/lldb/include/lldb/Core/ValueObjectCast.h
@@ -30,7 +30,7 @@ class ValueObjectCast : public ValueObject {
 ConstString name,
 const CompilerType _type);
 
-  llvm::Optional GetByteSize() override;
+  uint64_t GetByteSize() override;
 
   size_t CalculateNumChildren(uint32_t max) override;
 

diff  --git a/lldb/include/lldb/Core/ValueObjectChild.h 
b/lldb/include/lldb/Core/ValueObjectChild.h
index 9a9fd9294261..c6f44a29b059 100644
--- a/lldb/include/lldb/Core/ValueObjectChild.h
+++ b/lldb/include/lldb/Core/ValueObjectChild.h
@@ -30,7 +30,7 @@ class ValueObjectChild : public ValueObject {
 public:
   ~ValueObjectChild() override;
 
-  llvm::Optional GetByteSize() override { return m_byte_size; }
+  uint64_t GetByteSize() override { return m_byte_size; }
 
   lldb::offset_t GetByteOffset() override { return m_byte_offset; }
 

diff  --git a/lldb/include/lldb/Core/ValueObjectConstResult.h 
b/lldb/include/lldb/Core/ValueObjectConstResult.h
index 8d823baa0b7b..0e868c687e93 100644
--- a/lldb/include/lldb/Core/ValueObjectConstResult.h
+++ b/lldb/include/lldb/Core/ValueObjectConstResult.h
@@ -62,7 +62,7 @@ class ValueObjectConstResult : public ValueObject {
   static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
 const Status );
 
-  llvm::Optional GetByteSize() override;
+  uint64_t GetByteSize() override;
 
   lldb::ValueType GetValueType() const override;
 
@@ -113,7 +113,7 @@ class ValueObjectConstResult : public ValueObject {
   CompilerType GetCompilerTypeImpl() override;
 
   ConstString m_type_name;
-  llvm::Optional m_byte_size;
+  uint64_t m_byte_size;
 
   ValueObjectConstResultImpl m_impl;
 

diff  --git a/lldb/include/lldb/Core/ValueObjectDynamicValue.h 
b/lldb/include/lldb/Core/ValueObjectDynamicValue.h
index 2806857339ef..9f5304b55e93 100644
--- a/lldb/include/lldb/Core/ValueObjectDynamicValue.h
+++ b/lldb/include/lldb/Core/ValueObjectDynamicValue.h
@@ -34,7 +34,7 @@ class ValueObjectDynamicValue : public ValueObject {
 public:
   ~ValueObjectDynamicValue() override;
 
-  llvm::Optional GetByteSize() override;
+  uint64_t GetByteSize() override;
 
   ConstString GetTypeName() override;
 

diff  --git a/lldb/include/lldb/Core/ValueObjectMemory.h 
b/lldb/include/lldb/Core/ValueObjectMemory.h
index b5d5e6ecf4c0..d1cd6ae41445 100644
--- a/lldb/include/lldb/Core/ValueObjectMemory.h
+++ b/lldb/include/lldb/Core/ValueObjectMemory.h
@@ -40,7 +40,7 @@ class ValueObjectMemory : 

Re: [Lldb-commits] [lldb] 074b121 - Reland [lldb] Unify type name matching in FormattersContainer

2020-07-23 Thread Eric Christopher via lldb-commits
Hi Raphael,

I've temporarily reverted this again with hopefully a better explanation
here:

echristo@athyra ~/s/llvm-project> git push
To github.com:llvm/llvm-project.git
   55c0f12a869..3a75466f41b  master -> master

One review thought: If you don't want people using the default constructor
for TypeMatcher perhaps just delete it? (i.e. = delete). If that's not
where you were going then perhaps we can come up with another way around
this :)

Thanks and sorry for the inconvenience!

-eric

On Wed, Jul 22, 2020 at 12:34 AM Raphael Isemann via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

>
> Author: Raphael Isemann
> Date: 2020-07-22T09:32:28+02:00
> New Revision: 074b121642b286afb16adeebda5ec8236f7b8ea9
>
> URL:
> https://github.com/llvm/llvm-project/commit/074b121642b286afb16adeebda5ec8236f7b8ea9
> DIFF:
> https://github.com/llvm/llvm-project/commit/074b121642b286afb16adeebda5ec8236f7b8ea9.diff
>
> LOG: Reland [lldb] Unify type name matching in FormattersContainer
>
> This was originally reverted because the Linux bots were red after this
> landed,
> but it seems that was actually caused by a different commit. I double
> checked
> that this works on Linux, so let's reland this on Linux.
>
> Summary:
>
> FormattersContainer stores LLDB's formatters. It's implemented as a
> templated
> map-like data structures that supports any kind of value type and only
> allows
> ConstString and RegularExpression as the key types. The keys are used for
> matching type names (e.g., the ConstString key `std::vector` matches the
> type
> with the same name while RegularExpression keys match any type where the
> RegularExpression instance matches).
>
> The fact that a single FormattersContainer can only match either by string
> comparison or regex matching (depending on the KeyType) causes us to
> always have
> two FormatterContainer instances in all the formatting code. This also
> leads to
> us having every type name matching logic in LLDB twice. For example,
> TypeCategory has to implement every method twice (one string matching one,
> one
> regex matching one).
>
> This patch changes FormattersContainer to instead have a single
> `TypeMatcher`
> key that wraps the logic for string-based and regex-based type matching
> and is
> now the only possible KeyType for the FormattersContainer. This means that
> a
> single FormattersContainer can now match types with both regex and string
> comparison.
>
> To summarize the changes in this patch:
> * Remove all the `*_Impl` methods from `FormattersContainer`
> * Instead call the FormatMap functions from `FormattersContainer` with a
>   `TypeMatcher` type that does the respective matching.
> * Replace `ConstString` with `TypeMatcher` in the few places that directly
>   interact with `FormattersContainer`.
>
> I'm working on some follow up patches that I split up because they deserve
> their
> own review:
>
> * Unify FormatMap and FormattersContainer (they are nearly identical now).
> * Delete the duplicated half of all the type matching code that can now
> use one
>   interface.
> * Propagate TypeMatcher through all the formatter code interfaces instead
> of
>   always offering two functions for everything.
>
> There is one ugly design part that I couldn't get rid of yet and that is
> that we
> have to support getting back the string used to construct a `TypeMatcher`
> later
> on. The reason for this is that LLDB only supports referencing existing
> type
> matchers by just typing their respective input string again (without even
> supplying if it's a regex or not).
>
> Reviewers: davide, mib
>
> Reviewed By: mib
>
> Subscribers: mgorny, JDevlieghere
>
> Differential Revision: https://reviews.llvm.org/D84151
>
> Added:
> lldb/unittests/DataFormatter/FormattersContainerTest.cpp
>
> Modified:
> lldb/include/lldb/DataFormatters/DataVisualization.h
> lldb/include/lldb/DataFormatters/FormatManager.h
> lldb/include/lldb/DataFormatters/FormattersContainer.h
> lldb/include/lldb/DataFormatters/TypeCategory.h
> lldb/include/lldb/DataFormatters/TypeCategoryMap.h
> lldb/source/Commands/CommandObjectType.cpp
> lldb/source/DataFormatters/DataVisualization.cpp
> lldb/source/DataFormatters/FormatManager.cpp
> lldb/unittests/DataFormatter/CMakeLists.txt
>
> Removed:
>
>
>
>
> 
> diff  --git a/lldb/include/lldb/DataFormatters/DataVisualization.h
> b/lldb/include/lldb/DataFormatters/DataVisualization.h
> index b053aa074d9e..7be07d65acdd 100644
> --- a/lldb/include/lldb/DataFormatters/DataVisualization.h
> +++ b/lldb/include/lldb/DataFormatters/DataVisualization.h
> @@ -69,9 +69,9 @@ class DataVisualization {
>
>  static void Clear();
>
> -static void
> -ForEach(std::function &)>
> -callback);
> +static void ForEach(std::function +   const lldb::TypeSummaryImplSP
> &)>
> +

[Lldb-commits] [lldb] 3a75466 - Temporarily Revert "Reland [lldb] Unify type name matching in FormattersContainer"

2020-07-23 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-07-23T00:47:05-07:00
New Revision: 3a75466f41be12a8cdcff7ff786d55a319e6c2df

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

LOG: Temporarily Revert "Reland [lldb] Unify type name matching in 
FormattersContainer"
as it breaks bots with due to m_valid being an unused class member
except in assert builds.

This reverts commit 074b121642b286afb16adeebda5ec8236f7b8ea9.

Added: 


Modified: 
lldb/include/lldb/DataFormatters/DataVisualization.h
lldb/include/lldb/DataFormatters/FormatManager.h
lldb/include/lldb/DataFormatters/FormattersContainer.h
lldb/include/lldb/DataFormatters/TypeCategory.h
lldb/include/lldb/DataFormatters/TypeCategoryMap.h
lldb/source/Commands/CommandObjectType.cpp
lldb/source/DataFormatters/DataVisualization.cpp
lldb/source/DataFormatters/FormatManager.cpp
lldb/unittests/DataFormatter/CMakeLists.txt

Removed: 
lldb/unittests/DataFormatter/FormattersContainerTest.cpp



diff  --git a/lldb/include/lldb/DataFormatters/DataVisualization.h 
b/lldb/include/lldb/DataFormatters/DataVisualization.h
index 7be07d65acdd..b053aa074d9e 100644
--- a/lldb/include/lldb/DataFormatters/DataVisualization.h
+++ b/lldb/include/lldb/DataFormatters/DataVisualization.h
@@ -69,9 +69,9 @@ class DataVisualization {
 
 static void Clear();
 
-static void ForEach(std::function
-callback);
+static void
+ForEach(std::function
+callback);
 
 static uint32_t GetCount();
   };

diff  --git a/lldb/include/lldb/DataFormatters/FormatManager.h 
b/lldb/include/lldb/DataFormatters/FormatManager.h
index 98c5b132c203..56a0303f9b02 100644
--- a/lldb/include/lldb/DataFormatters/FormatManager.h
+++ b/lldb/include/lldb/DataFormatters/FormatManager.h
@@ -34,7 +34,7 @@ namespace lldb_private {
 // this file's objects directly
 
 class FormatManager : public IFormatChangeListener {
-  typedef FormatMap NamedSummariesMap;
+  typedef FormatMap NamedSummariesMap;
   typedef TypeCategoryMap::MapType::iterator CategoryMapIterator;
 
 public:
@@ -144,6 +144,13 @@ class FormatManager : public IFormatChangeListener {
 
   static const char *GetFormatAsCString(lldb::Format format);
 
+  // if the user tries to add formatters for, say, "struct Foo" those will not
+  // match any type because of the way we strip qualifiers from typenames this
+  // method looks for the case where the user is adding a
+  // "class","struct","enum" or "union" Foo and strips the unnecessary
+  // qualifier
+  static ConstString GetValidTypeName(ConstString type);
+
   // when DataExtractor dumps a vectorOfT, it uses a predefined format for each
   // item this method returns it, or eFormatInvalid if vector_format is not a
   // vectorOf

diff  --git a/lldb/include/lldb/DataFormatters/FormattersContainer.h 
b/lldb/include/lldb/DataFormatters/FormattersContainer.h
index 69dd1ecf1752..a22cf494bf8a 100644
--- a/lldb/include/lldb/DataFormatters/FormattersContainer.h
+++ b/lldb/include/lldb/DataFormatters/FormattersContainer.h
@@ -37,113 +37,57 @@ class IFormatChangeListener {
   virtual uint32_t GetCurrentRevision() = 0;
 };
 
-/// Class for matching type names.
-class TypeMatcher {
-  RegularExpression m_type_name_regex;
-  ConstString m_type_name;
-  /// False if m_type_name_regex should be used for matching. False if this is
-  /// just matching by comparing with m_type_name string.
-  bool m_is_regex;
-  /// True iff this TypeMatcher is invalid and shouldn't be used for any
-  /// type matching logic.
-  bool m_valid = true;
-
-  // if the user tries to add formatters for, say, "struct Foo" those will not
-  // match any type because of the way we strip qualifiers from typenames this
-  // method looks for the case where the user is adding a
-  // "class","struct","enum" or "union" Foo and strips the unnecessary 
qualifier
-  static ConstString StripTypeName(ConstString type) {
-if (type.IsEmpty())
-  return type;
-
-std::string type_cstr(type.AsCString());
-StringLexer type_lexer(type_cstr);
-
-type_lexer.AdvanceIf("class ");
-type_lexer.AdvanceIf("enum ");
-type_lexer.AdvanceIf("struct ");
-type_lexer.AdvanceIf("union ");
-
-while (type_lexer.NextIf({' ', '\t', '\v', '\f'}).first)
-  ;
-
-return ConstString(type_lexer.GetUnlexed());
-  }
+// if the user tries to add formatters for, say, "struct Foo" those will not
+// match any type because of the way we strip qualifiers from typenames this
+// method looks for the case where the user is adding a "class","struct","enum"
+// or "union" Foo and strips the unnecessary qualifier
+static inline ConstString GetValidTypeName_Impl(ConstString type) {
+  if (type.IsEmpty())
+return type;
 
-public:
-  /// Creates an 

[Lldb-commits] [lldb] 368eb77 - Fix a -Wunused-variable warning.

2020-07-14 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-07-14T12:40:56-07:00
New Revision: 368eb7712f9f19f93f3e318d8b16e732436fb9c4

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

LOG: Fix a -Wunused-variable warning.

Added: 


Modified: 
lldb/unittests/TestingSupport/TestUtilities.cpp

Removed: 




diff  --git a/lldb/unittests/TestingSupport/TestUtilities.cpp 
b/lldb/unittests/TestingSupport/TestUtilities.cpp
index 28120505acba..4d369bd0968a 100644
--- a/lldb/unittests/TestingSupport/TestUtilities.cpp
+++ b/lldb/unittests/TestingSupport/TestUtilities.cpp
@@ -27,8 +27,7 @@ std::string lldb_private::GetInputFilePath(const llvm::Twine 
) {
 }
 
 llvm::Expected TestFile::fromYaml(llvm::StringRef Yaml) {
-  const auto *Info = testing::UnitTest::GetInstance()->current_test_info();
-  assert(Info);
+  assert(testing::UnitTest::GetInstance()->current_test_info());
 
   std::string Buffer;
   llvm::raw_string_ostream OS(Buffer);



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


Re: [Lldb-commits] [lldb] 90c1af1 - [lldb][NFC] Add more test for builtin formats

2020-06-21 Thread Eric Christopher via lldb-commits
No problem at all, happens to all of us :)

-eric

On Sun, Jun 21, 2020 at 12:56 AM Raphael “Teemperor” Isemann <
teempe...@gmail.com> wrote:

> Sorry for that, it seems I overlooked those failure mails. Thanks!
>
> On 20 Jun 2020, at 23:22, Eric Christopher  wrote:
>
> This is failing on some of the debian buildbots so I've temporarily
> reverted it here:
>
> commit 10b43541360efb35a1d33e9cf1e93023ebd69b15 (HEAD -> master,
> origin/master, origin/HEAD)
> Author: Eric Christopher 
> Date:   Sat Jun 20 14:21:42 2020
>
> Temporarily Revert "[lldb][NFC] Add more test for builtin formats"
> as it's failing on the debian buildbots:
>
> http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/12531
>
> This reverts commit 90c1af106a20785ffd01c0d6a41db8bc0160fd11.
>
> buildbot link:
>
> http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/12531
>
> Sorry for any inconvenience.
>
> -eric
>
> On Sat, Jun 20, 2020 at 12:35 PM Raphael Isemann via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>>
>> Author: Raphael Isemann
>> Date: 2020-06-20T19:31:40+02:00
>> New Revision: 90c1af106a20785ffd01c0d6a41db8bc0160fd11
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/90c1af106a20785ffd01c0d6a41db8bc0160fd11
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/90c1af106a20785ffd01c0d6a41db8bc0160fd11.diff
>>
>> LOG: [lldb][NFC] Add more test for builtin formats
>>
>> The previous tests apparently missed a few code branches in
>> DumpDataExtractor
>> code. Also renames the 'test_instruction' which had the same name as
>> another
>> test (and Python therefore ignored the test entirely).
>>
>> Added:
>>
>>
>> Modified:
>>
>> lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
>>
>> Removed:
>>
>>
>>
>>
>> 
>> diff  --git
>> a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
>> b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
>> index 9fefae6bbf5c..1a413a13986a 100644
>> ---
>> a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
>> +++
>> b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
>> @@ -42,6 +42,9 @@ def test(self):
>>  self.assertIn("= 0\n", self.getFormatted("float", "0"))
>>  self.assertIn("= 2\n", self.getFormatted("float", "0x4000"))
>>  self.assertIn("= NaN\n", self.getFormatted("float", "-1"))
>> +# Checks the float16 code.
>> +self.assertIn("= 2\n", self.getFormatted("float",
>> "(__UINT16_TYPE__)0x4000"))
>> +self.assertIn("= error: unsupported byte size (1) for float
>> format\n", self.getFormatted("float", "'a'"))
>>
>>  # enumeration
>>  self.assertIn("= 0\n", self.getFormatted("enumeration", "0"))
>> @@ -59,6 +62,13 @@ def test(self):
>>
>>  # octal
>>  self.assertIn("= 04553207\n", self.getFormatted("octal",
>> "1234567"))
>> +self.assertIn("= 0221505317046536757\n",
>> self.getFormatted("octal", "(__uint128_t)0x123456789ABDEFull"))
>> +
>> +# complex float
>> +self.assertIn("= error: unsupported byte size (1) for complex
>> float format\n", self.getFormatted("complex float", "'a'"))
>> +
>> +# complex integer
>> +self.assertIn("= error: unsupported byte size (1) for complex
>> integer format\n", self.getFormatted("complex integer", "'a'"))
>>
>>  # hex
>>  self.assertIn("= 0x00abc123\n", self.getFormatted("hex",
>> "0xABC123"))
>> @@ -86,6 +96,17 @@ def test(self):
>>  self.assertIn('= " \\U001b\\a\\b\\f\\n\\r\\t\\vaA09"\n',
>> self.getFormatted("OSType", "cstring"))
>>  self.assertIn('= " \\U001b\\a\\b\\f\\n\\r\\t\\vaA09"\n',
>> self.getFormatted("unicode8", "cstring"))
>>
>> +# FIXME: Passing a 'const char *' will ignore any given format,
>> +# so we have to repeat the tests with a void* casts to actually
>> test our formats.
>> +self.assertIn('= \\x9a\\x0f\\0\\0\\x01\\0\\0\\0\n',
>> self.getFormatted("character array", "(void *)cstring"))
>> +self.assertIn('= \\x9a\\x0f\\0\\0\\x01\\0\\0\\0\n',
>> self.getFormatted("character", "(void *)cstring"))
>> +self.assertIn('= " \\e\\a\\b\\f\\n\\r\\t\\vaA09"\n',
>> self.getFormatted("c-string", "(void *)cstring"))
>> +# FIXME: Ignores the printables characters at the end.
>> +self.assertIn('= \n', self.getFormatted("printable
>> character", "(void *)cstring"))
>> +self.assertIn('= \'\\0\\0\\0\\x01\\0\\0\\x0f\\x9a\'\n',
>> self.getFormatted("OSType", "(void *)cstring"))
>> +# FIXME: This should print a string.
>> +self.assertIn('= 0x00010f9a\n',
>> self.getFormatted("unicode8", "(void *)cstring"))
>> +
>>  self.assertIn('= \\0\\0\\0\\0\\0\\0\\0\\0\n',
>> self.getFormatted("character array", 

Re: [Lldb-commits] [lldb] 90c1af1 - [lldb][NFC] Add more test for builtin formats

2020-06-20 Thread Eric Christopher via lldb-commits
This is failing on some of the debian buildbots so I've temporarily
reverted it here:

commit 10b43541360efb35a1d33e9cf1e93023ebd69b15 (HEAD -> master,
origin/master, origin/HEAD)
Author: Eric Christopher 
Date:   Sat Jun 20 14:21:42 2020

Temporarily Revert "[lldb][NFC] Add more test for builtin formats"
as it's failing on the debian buildbots:

http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/12531

This reverts commit 90c1af106a20785ffd01c0d6a41db8bc0160fd11.

buildbot link:

http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/12531

Sorry for any inconvenience.

-eric

On Sat, Jun 20, 2020 at 12:35 PM Raphael Isemann via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

>
> Author: Raphael Isemann
> Date: 2020-06-20T19:31:40+02:00
> New Revision: 90c1af106a20785ffd01c0d6a41db8bc0160fd11
>
> URL:
> https://github.com/llvm/llvm-project/commit/90c1af106a20785ffd01c0d6a41db8bc0160fd11
> DIFF:
> https://github.com/llvm/llvm-project/commit/90c1af106a20785ffd01c0d6a41db8bc0160fd11.diff
>
> LOG: [lldb][NFC] Add more test for builtin formats
>
> The previous tests apparently missed a few code branches in
> DumpDataExtractor
> code. Also renames the 'test_instruction' which had the same name as
> another
> test (and Python therefore ignored the test entirely).
>
> Added:
>
>
> Modified:
>
> lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
>
> Removed:
>
>
>
>
> 
> diff  --git
> a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
> b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
> index 9fefae6bbf5c..1a413a13986a 100644
> ---
> a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
> +++
> b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
> @@ -42,6 +42,9 @@ def test(self):
>  self.assertIn("= 0\n", self.getFormatted("float", "0"))
>  self.assertIn("= 2\n", self.getFormatted("float", "0x4000"))
>  self.assertIn("= NaN\n", self.getFormatted("float", "-1"))
> +# Checks the float16 code.
> +self.assertIn("= 2\n", self.getFormatted("float",
> "(__UINT16_TYPE__)0x4000"))
> +self.assertIn("= error: unsupported byte size (1) for float
> format\n", self.getFormatted("float", "'a'"))
>
>  # enumeration
>  self.assertIn("= 0\n", self.getFormatted("enumeration", "0"))
> @@ -59,6 +62,13 @@ def test(self):
>
>  # octal
>  self.assertIn("= 04553207\n", self.getFormatted("octal",
> "1234567"))
> +self.assertIn("= 0221505317046536757\n",
> self.getFormatted("octal", "(__uint128_t)0x123456789ABDEFull"))
> +
> +# complex float
> +self.assertIn("= error: unsupported byte size (1) for complex
> float format\n", self.getFormatted("complex float", "'a'"))
> +
> +# complex integer
> +self.assertIn("= error: unsupported byte size (1) for complex
> integer format\n", self.getFormatted("complex integer", "'a'"))
>
>  # hex
>  self.assertIn("= 0x00abc123\n", self.getFormatted("hex",
> "0xABC123"))
> @@ -86,6 +96,17 @@ def test(self):
>  self.assertIn('= " \\U001b\\a\\b\\f\\n\\r\\t\\vaA09"\n',
> self.getFormatted("OSType", "cstring"))
>  self.assertIn('= " \\U001b\\a\\b\\f\\n\\r\\t\\vaA09"\n',
> self.getFormatted("unicode8", "cstring"))
>
> +# FIXME: Passing a 'const char *' will ignore any given format,
> +# so we have to repeat the tests with a void* casts to actually
> test our formats.
> +self.assertIn('= \\x9a\\x0f\\0\\0\\x01\\0\\0\\0\n',
> self.getFormatted("character array", "(void *)cstring"))
> +self.assertIn('= \\x9a\\x0f\\0\\0\\x01\\0\\0\\0\n',
> self.getFormatted("character", "(void *)cstring"))
> +self.assertIn('= " \\e\\a\\b\\f\\n\\r\\t\\vaA09"\n',
> self.getFormatted("c-string", "(void *)cstring"))
> +# FIXME: Ignores the printables characters at the end.
> +self.assertIn('= \n', self.getFormatted("printable
> character", "(void *)cstring"))
> +self.assertIn('= \'\\0\\0\\0\\x01\\0\\0\\x0f\\x9a\'\n',
> self.getFormatted("OSType", "(void *)cstring"))
> +# FIXME: This should print a string.
> +self.assertIn('= 0x00010f9a\n',
> self.getFormatted("unicode8", "(void *)cstring"))
> +
>  self.assertIn('= \\0\\0\\0\\0\\0\\0\\0\\0\n',
> self.getFormatted("character array", "(__UINT64_TYPE__)0"))
>  self.assertIn('= \\0\\0\\0\\0\\0\\0\\0\\0\n',
> self.getFormatted("character", "(__UINT64_TYPE__)0"))
>  self.assertIn('=\n', self.getFormatted("c-string",
> "(__UINT64_TYPE__)0"))
> @@ -137,6 +158,11 @@ def test(self):
>  # There is not int128_t[] style, so this only tests uint128_t[].
>  self.assertIn("= {0x0123456789abcdef}\n",
> 

[Lldb-commits] [lldb] 10b4354 - Temporarily Revert "[lldb][NFC] Add more test for builtin formats"

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

Author: Eric Christopher
Date: 2020-06-20T14:21:42-07:00
New Revision: 10b43541360efb35a1d33e9cf1e93023ebd69b15

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

LOG: Temporarily Revert "[lldb][NFC] Add more test for builtin formats"
as it's failing on the debian buildbots:

http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/12531

This reverts commit 90c1af106a20785ffd01c0d6a41db8bc0160fd11.

Added: 


Modified: 

lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py

Removed: 




diff  --git 
a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
 
b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
index 1a413a13986a..9fefae6bbf5c 100644
--- 
a/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
+++ 
b/lldb/test/API/functionalities/data-formatter/builtin-formats/TestBuiltinFormats.py
@@ -42,9 +42,6 @@ def test(self):
 self.assertIn("= 0\n", self.getFormatted("float", "0"))
 self.assertIn("= 2\n", self.getFormatted("float", "0x4000"))
 self.assertIn("= NaN\n", self.getFormatted("float", "-1"))
-# Checks the float16 code.
-self.assertIn("= 2\n", self.getFormatted("float", 
"(__UINT16_TYPE__)0x4000"))
-self.assertIn("= error: unsupported byte size (1) for float format\n", 
self.getFormatted("float", "'a'"))
 
 # enumeration
 self.assertIn("= 0\n", self.getFormatted("enumeration", "0"))
@@ -62,13 +59,6 @@ def test(self):
 
 # octal
 self.assertIn("= 04553207\n", self.getFormatted("octal", "1234567"))
-self.assertIn("= 0221505317046536757\n", self.getFormatted("octal", 
"(__uint128_t)0x123456789ABDEFull"))
-
-# complex float
-self.assertIn("= error: unsupported byte size (1) for complex float 
format\n", self.getFormatted("complex float", "'a'"))
-
-# complex integer
-self.assertIn("= error: unsupported byte size (1) for complex integer 
format\n", self.getFormatted("complex integer", "'a'"))
 
 # hex
 self.assertIn("= 0x00abc123\n", self.getFormatted("hex", "0xABC123"))
@@ -96,17 +86,6 @@ def test(self):
 self.assertIn('= " \\U001b\\a\\b\\f\\n\\r\\t\\vaA09"\n', 
self.getFormatted("OSType", "cstring"))
 self.assertIn('= " \\U001b\\a\\b\\f\\n\\r\\t\\vaA09"\n', 
self.getFormatted("unicode8", "cstring"))
 
-# FIXME: Passing a 'const char *' will ignore any given format,
-# so we have to repeat the tests with a void* casts to actually test 
our formats.
-self.assertIn('= \\x9a\\x0f\\0\\0\\x01\\0\\0\\0\n', 
self.getFormatted("character array", "(void *)cstring"))
-self.assertIn('= \\x9a\\x0f\\0\\0\\x01\\0\\0\\0\n', 
self.getFormatted("character", "(void *)cstring"))
-self.assertIn('= " \\e\\a\\b\\f\\n\\r\\t\\vaA09"\n', 
self.getFormatted("c-string", "(void *)cstring"))
-# FIXME: Ignores the printables characters at the end.
-self.assertIn('= \n', self.getFormatted("printable character", 
"(void *)cstring"))
-self.assertIn('= \'\\0\\0\\0\\x01\\0\\0\\x0f\\x9a\'\n', 
self.getFormatted("OSType", "(void *)cstring"))
-# FIXME: This should print a string.
-self.assertIn('= 0x00010f9a\n', self.getFormatted("unicode8", 
"(void *)cstring"))
-
 self.assertIn('= \\0\\0\\0\\0\\0\\0\\0\\0\n', 
self.getFormatted("character array", "(__UINT64_TYPE__)0"))
 self.assertIn('= \\0\\0\\0\\0\\0\\0\\0\\0\n', 
self.getFormatted("character", "(__UINT64_TYPE__)0"))
 self.assertIn('=\n', self.getFormatted("c-string", 
"(__UINT64_TYPE__)0"))
@@ -158,11 +137,6 @@ def test(self):
 # There is not int128_t[] style, so this only tests uint128_t[].
 self.assertIn("= {0x0123456789abcdef}\n", 
self.getFormatted("uint128_t[]", "__uint128_t i = 0x123456789ABCDEF; i"))
 
-# Different fixed-width float type arrays.
-self.assertIn("{2 2}\n", self.getFormatted("float16[]", "0x40004000"))
-self.assertIn("{2 2}\n", self.getFormatted("float32[]", 
"0x40004000ll"))
-self.assertIn("{2 0}\n", self.getFormatted("float64[]", "__uint128_t i 
= 0x4000ll; i"))
-
 # Invalid format string
 self.expect("expr --format invalid_format_string -- 1", error=True,
 substrs=["error: Invalid format character or name 
'invalid_format_string'. Valid values are:"])
@@ -170,12 +144,10 @@ def test(self):
 # Extends to host target pointer width.
 @skipIf(archs=no_match(['x86_64']))
 @no_debug_info_test
-def test_pointer(self):
+def test_instruction(self):
 # pointer
 self.assertIn("= 

[Lldb-commits] [lldb] 2db1d75 - As part of using inclusive language within the llvm project,

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

Author: Eric Christopher
Date: 2020-06-19T14:51:04-07:00
New Revision: 2db1d75396fe3700530e3703f8c951a53cff00ee

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

LOG: As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

Added: 


Modified: 
lldb/examples/darwin/heap_find/heap.py

Removed: 




diff  --git a/lldb/examples/darwin/heap_find/heap.py 
b/lldb/examples/darwin/heap_find/heap.py
index 0c8744ff15f4..a8bc377ffe4c 100644
--- a/lldb/examples/darwin/heap_find/heap.py
+++ b/lldb/examples/darwin/heap_find/heap.py
@@ -226,7 +226,7 @@ def get_member_types_for_offset(value_type, offset, 
member_list):
 def append_regex_callback(option, opt, value, parser):
 try:
 ivar_regex = re.compile(value)
-parser.values.ivar_regex_blacklist.append(ivar_regex)
+parser.values.ivar_regex_exclusions.append(ivar_regex)
 except:
 print('error: an exception was thrown when compiling the ivar regular 
expression for "%s"' % value)
 
@@ -287,7 +287,7 @@ def add_common_options(parser):
 type='string',
 action='callback',
 callback=append_regex_callback,
-dest='ivar_regex_blacklist',
+dest='ivar_regex_exclusions',
 default=[],
 help='specify one or more regular expressions used to backlist any 
matches that are in ivars')
 parser.add_option(
@@ -773,8 +773,8 @@ def display_match_results(
 member_path += '.'
 member_path += member_name
 if member_path:
-if options.ivar_regex_blacklist:
-for ivar_regex in 
options.ivar_regex_blacklist:
+if options.ivar_regex_exclusions:
+for ivar_regex in 
options.ivar_regex_exclusions:
 if ivar_regex.match(
 member_path):
 print_entry = False



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


[Lldb-commits] [lldb] efb328f - As part of using inclusive language with the llvm project,

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

Author: Eric Christopher
Date: 2020-06-19T14:48:48-07:00
New Revision: efb328f674ca67081818bbac45dda3f3452fc44b

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

LOG: As part of using inclusive language with the llvm project,
migrate away from the use of blacklist and whitelist.

Added: 


Modified: 
lldb/include/lldb/Target/LanguageRuntime.h
lldb/source/Core/ValueObject.cpp
lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.h
lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h
lldb/source/Plugins/ABI/Mips/ABISysV_mips64.h
lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.h
lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.h
lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.h
lldb/source/Plugins/ABI/X86/ABISysV_i386.h
lldb/source/Plugins/ABI/X86/ABISysV_x86_64.h
lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h
lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h
lldb/source/Utility/Args.cpp

Removed: 




diff  --git a/lldb/include/lldb/Target/LanguageRuntime.h 
b/lldb/include/lldb/Target/LanguageRuntime.h
index 3ee60a5f876f..b0b9b919911a 100644
--- a/lldb/include/lldb/Target/LanguageRuntime.h
+++ b/lldb/include/lldb/Target/LanguageRuntime.h
@@ -153,7 +153,7 @@ class LanguageRuntime : public PluginInterface {
 
   /// Identify whether a name is a runtime value that should not be hidden by
   /// from the user interface.
-  virtual bool IsWhitelistedRuntimeValue(ConstString name) { return false; }
+  virtual bool IsAllowedRuntimeValue(ConstString name) { return false; }
 
   virtual llvm::Optional GetRuntimeType(CompilerType base_type) {
 return llvm::None;

diff  --git a/lldb/source/Core/ValueObject.cpp 
b/lldb/source/Core/ValueObject.cpp
index 3a6ca522f308..ba3d2c509be8 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -1723,7 +1723,7 @@ bool ValueObject::IsRuntimeSupportValue() {
 return false;
 
   if (auto *runtime = 
process->GetLanguageRuntime(GetVariable()->GetLanguage()))
-if (runtime->IsWhitelistedRuntimeValue(GetName()))
+if (runtime->IsAllowedRuntimeValue(GetName()))
   return false;
 
   return true;

diff  --git a/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.h 
b/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.h
index b056df27ea5d..fc8ccee92e71 100644
--- a/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.h
+++ b/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.h
@@ -42,7 +42,7 @@ class ABIMacOSX_arm64 : public ABIAArch64 {
   //
   // To work around this, we relax that alignment to be just word-size
   // (8-bytes).
-  // Whitelisting the trap handlers for user space would be easy (_sigtramp) 
but
+  // Allowing the trap handlers for user space would be easy (_sigtramp) but
   // in other environments there can be a large number of 
diff erent functions
   // involved in async traps.
   bool CallFrameAddressIsValid(lldb::addr_t cfa) override {

diff  --git a/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h 
b/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h
index f2a73be03292..aeb74acc38b5 100644
--- a/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h
+++ b/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h
@@ -45,7 +45,7 @@ class ABISysV_arm64 : public ABIAArch64 {
   //
   // To work around this, we relax that alignment to be just word-size
   // (8-bytes).
-  // Whitelisting the trap handlers for user space would be easy (_sigtramp) 
but
+  // Allowing the trap handlers for user space would be easy (_sigtramp) but
   // in other environments there can be a large number of 
diff erent functions
   // involved in async traps.
   bool CallFrameAddressIsValid(lldb::addr_t cfa) override {

diff  --git a/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.h 
b/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.h
index 76253f21ee07..91428216a73a 100644
--- a/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.h
+++ b/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.h
@@ -51,7 +51,7 @@ class ABISysV_mips64 : public lldb_private::RegInfoBasedABI {
   //
   // To work around this, we relax that alignment to be just word-size
   // (8-bytes).
-  // Whitelisting the trap handlers for user space would be easy (_sigtramp) 
but
+  // Allowing the trap handlers for user space would be easy (_sigtramp) but
   // in other environments there can be a large number of 
diff erent functions
   // involved in async traps.
   bool CallFrameAddressIsValid(lldb::addr_t cfa) override {

diff  --git a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.h 
b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.h
index 

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

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

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

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

LOG: Add SveBFloat16 to type switch.

Added: 


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

Removed: 




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



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


[Lldb-commits] [lldb] 713538b - Be more specific about auto * vs auto for po alias.

2020-05-26 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-05-26T11:59:09-07:00
New Revision: 713538b629e45e6236b5d60fd6b64d7b8669cd00

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

LOG: Be more specific about auto * vs auto for po alias.

Added: 


Modified: 
lldb/source/Interpreter/CommandInterpreter.cpp

Removed: 




diff  --git a/lldb/source/Interpreter/CommandInterpreter.cpp 
b/lldb/source/Interpreter/CommandInterpreter.cpp
index 1cd71b07eaeb..61288fc42131 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -356,7 +356,7 @@ void CommandInterpreter::Initialize() {
 AddAlias("p", cmd_obj_sp, "--")->SetHelpLong("");
 AddAlias("print", cmd_obj_sp, "--")->SetHelpLong("");
 AddAlias("call", cmd_obj_sp, "--")->SetHelpLong("");
-if (auto po = AddAlias("po", cmd_obj_sp, "-O --")) {
+if (auto *po = AddAlias("po", cmd_obj_sp, "-O --")) {
   po->SetHelp("Evaluate an expression on the current thread.  Displays any 
"
   "returned value with formatting "
   "controlled by the type's author.");



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


[Lldb-commits] [lldb] 7510aed - Handle eExpressionThreadVanished in error switch to handle

2020-05-22 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-05-22T13:43:10-07:00
New Revision: 7510aede627267819d9693381ad6c16dccfa0d17

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

LOG: Handle eExpressionThreadVanished in error switch to handle
covered switch warning.

Added: 


Modified: 
lldb/source/Interpreter/CommandInterpreter.cpp

Removed: 




diff  --git a/lldb/source/Interpreter/CommandInterpreter.cpp 
b/lldb/source/Interpreter/CommandInterpreter.cpp
index df19855b5f8c..1cd71b07eaeb 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -1620,6 +1620,11 @@ Status CommandInterpreter::PreprocessCommand(std::string 
) {
"expression '%s'",
expr_str.c_str());
 break;
+  case eExpressionThreadVanished:
+error.SetErrorStringWithFormat(
+"expression thread vanished for the expression '%s'",
+expr_str.c_str());
+break;
   }
 }
   }



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


Re: [Lldb-commits] [PATCH] D80150: [lldb/DataFormatter] Check for overflow when finding NSDate epoch

2020-05-20 Thread Eric Christopher via lldb-commits
Agreed. Something is off here. My change was only to silence a few
warnings, but they're definitely highlighting a conversion issue. What's up
with NSDate conversions here. Does the API have a way to convert from
time_t?

On Wed, May 20, 2020, 2:07 AM Pavel Labath via Phabricator via lldb-commits
 wrote:

> labath added a comment.
>
> In D80150#2045364 , @vsk wrote:
>
> > @labath Agreed on all points, I've addressed the feedback in 82dbf4aca84
>  by
> moving "DataFormatters/Mock.h" to "Plugins/Language/ObjC/Utilities.h", and
> adding a separate LanguageObjCTests unit test.
>
>
> Cool. Thanks.
>
>
>
> 
> Comment at: lldb/unittests/DataFormatter/MockTests.cpp:30
> +  // Can't convert the date_value to a time_t.
> +  EXPECT_EQ(formatDateValue(std::numeric_limits::max() + 1),
> +llvm::None);
> 
> vsk wrote:
> > labath wrote:
> > > Isn't this actually `std::numeric_limits::min()` (and UB due
> to singed wraparound) ? Did you want to convert to double before doing the
> `+1` ?
> > Yes, thank you! It looks like Eric caught this before I did.
> Actually, thinking about that further, (for 64-bit `time_t`s),
> `double(numeric_limits::max())` is [[ https://godbolt.org/z/t3iSd7
> | exactly the same value ]] as `double(numeric_limits::max())+1.0`
> because `double` doesn't have enough bits to represent the value precisely.
> So, I have a feeling these checks are still not testing the exact thing you
> want to test (though I'm not sure what that is exactly).
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D80150/new/
>
> https://reviews.llvm.org/D80150
>
>
>
> ___
> 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] [lldb] 15ee8a3 - Silence warnings around int/float conversions.

2020-05-19 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-05-19T10:56:18-07:00
New Revision: 15ee8a3a58223b48afbe33cb60084f864ef20889

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

LOG: Silence warnings around int/float conversions.

Added: 


Modified: 
lldb/source/Plugins/Language/ObjC/Cocoa.cpp
lldb/unittests/DataFormatter/MockTests.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp 
b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
index 1ad443b8b74e..37b352263260 100644
--- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
+++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
@@ -794,8 +794,8 @@ bool 
lldb_private::formatters::NSDate::FormatDateValue(double date_value,
 return true;
   }
 
-  if (date_value > std::numeric_limits::max() ||
-  date_value < std::numeric_limits::min())
+  if ((time_t)date_value > std::numeric_limits::max() ||
+  (time_t)date_value < std::numeric_limits::min())
 return false;
 
   time_t epoch = GetOSXEpoch();

diff  --git a/lldb/unittests/DataFormatter/MockTests.cpp 
b/lldb/unittests/DataFormatter/MockTests.cpp
index 1185d7bf2c9c..f7daaf22d140 100644
--- a/lldb/unittests/DataFormatter/MockTests.cpp
+++ b/lldb/unittests/DataFormatter/MockTests.cpp
@@ -28,14 +28,14 @@ TEST(DataFormatterMockTest, NSDate) {
   EXPECT_EQ(*formatDateValue(-63114076800), "0001-12-30 00:00:00 +");
 
   // Can't convert the date_value to a time_t.
-  EXPECT_EQ(formatDateValue(std::numeric_limits::max() + 1),
+  EXPECT_EQ(formatDateValue((double)(std::numeric_limits::max()) + 1),
 llvm::None);
-  EXPECT_EQ(formatDateValue(std::numeric_limits::min() - 1),
+  EXPECT_EQ(formatDateValue((double)(std::numeric_limits::min()) - 1),
 llvm::None);
 
   // Can't add the macOS epoch to the converted date_value (the add overflows).
-  EXPECT_EQ(formatDateValue(std::numeric_limits::max()), llvm::None);
-  EXPECT_EQ(formatDateValue(std::numeric_limits::min()), llvm::None);
+  EXPECT_EQ(formatDateValue((double)std::numeric_limits::max()), 
llvm::None);
+  EXPECT_EQ(formatDateValue((double)std::numeric_limits::min()), 
llvm::None);
 
   // FIXME: The formatting result is wrong on Windows because we adjust the
   // epoch when _WIN32 is defined (see GetOSXEpoch).



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


[Lldb-commits] [lldb] 8d7796c - Fix a few clang-tidy warnings about auto * and const auto.

2020-05-11 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-05-11T15:33:17-07:00
New Revision: 8d7796cf9427a0c361a5831e4371ff030b98dfac

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

LOG: Fix a few clang-tidy warnings about auto * and const auto.

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 1665d68db6ff..970d4161899e 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -3416,9 +3416,9 @@ bool 
TypeSystemClang::IsPossibleDynamicType(lldb::opaque_compiler_type_t type,
 
 case clang::Type::ObjCObjectPointer:
   if (check_objc) {
-if (auto objc_pointee_type =
+if (const auto *objc_pointee_type =
 qual_type->getPointeeType().getTypePtrOrNull()) {
-  if (auto objc_object_type =
+  if (const auto *objc_object_type =
   llvm::dyn_cast_or_null(
   objc_pointee_type)) {
 if (objc_object_type->isObjCClass())
@@ -7092,7 +7092,7 @@ clang::FieldDecl *TypeSystemClang::AddFieldToRecordType(
 
   field_clang_type.GetCompleteType();
 
-  auto ivar = clang::ObjCIvarDecl::CreateDeserialized(clang_ast, 0);
+  auto *ivar = clang::ObjCIvarDecl::CreateDeserialized(clang_ast, 0);
   ivar->setDeclContext(class_interface_decl);
   ivar->setDeclName(ident);
   ivar->setType(ClangUtil::GetQualType(field_clang_type));
@@ -8570,7 +8570,7 @@ static bool DumpEnumValue(const clang::QualType 
_type, Stream *s,
   // every enumerator is either a one bit value or a superset of the previous
   // enumerators. Also 0 doesn't make sense when the enumerators are used as
   // flags.
-  for (auto enumerator : enum_decl->enumerators()) {
+  for (auto *enumerator : enum_decl->enumerators()) {
 uint64_t val = enumerator->getInitVal().getSExtValue();
 val = llvm::SignExtend64(val, 8*byte_size);
 if (llvm::countPopulation(val) != 1 && (val & ~covered_bits) != 0)
@@ -8602,7 +8602,7 @@ static bool DumpEnumValue(const clang::QualType 
_type, Stream *s,
   uint64_t remaining_value = enum_uvalue;
   std::vector> values;
   values.reserve(num_enumerators);
-  for (auto enumerator : enum_decl->enumerators())
+  for (auto *enumerator : enum_decl->enumerators())
 if (auto val = enumerator->getInitVal().getZExtValue())
   values.emplace_back(val, enumerator->getName());
 



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


[Lldb-commits] [lldb] cd7cb1f - Update lldb for rG10658691951f to avoid Werror messages around

2020-05-11 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-05-11T13:45:21-07:00
New Revision: cd7cb1f4ce3ffc8be1146eeba28ae7dc50089459

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

LOG: Update lldb for rG10658691951f to avoid Werror messages around
new unhandled matrix types.

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 de1ce9d36b04..1665d68db6ff 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -4061,6 +4061,11 @@ 
TypeSystemClang::GetTypeClass(lldb::opaque_compiler_type_t type) {
 break;
   case clang::Type::MacroQualified:
 break;
+
+  // Matrix types that we're not sure how to display at the moment.
+  case clang::Type::ConstantMatrix:
+  case clang::Type::DependentSizedMatrix:
+break;
   }
   // We don't know hot to display this type...
   return lldb::eTypeClassOther;
@@ -4878,6 +4883,10 @@ lldb::Encoding 
TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
 break;
   case clang::Type::MacroQualified:
 break;
+
+  case clang::Type::ConstantMatrix:
+  case clang::Type::DependentSizedMatrix:
+break;
   }
   count = 0;
   return lldb::eEncodingInvalid;
@@ -5024,6 +5033,11 @@ lldb::Format 
TypeSystemClang::GetFormat(lldb::opaque_compiler_type_t type) {
 break;
   case clang::Type::MacroQualified:
 break;
+
+  // Matrix types we're not sure how to display yet.
+  case clang::Type::ConstantMatrix:
+  case clang::Type::DependentSizedMatrix:
+break;
   }
   // We don't know hot to display this type...
   return lldb::eFormatBytes;



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


[Lldb-commits] [lldb] 4d40d66 - Fix up a clang-tidy nit about using empty rather than size == 0.

2020-04-27 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-04-27T15:22:44-07:00
New Revision: 4d40d6640238a8d304c39603a4938de85301fcba

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

LOG: Fix up a clang-tidy nit about using empty rather than size == 0.

Added: 


Modified: 
lldb/source/Host/common/TCPSocket.cpp

Removed: 




diff  --git a/lldb/source/Host/common/TCPSocket.cpp 
b/lldb/source/Host/common/TCPSocket.cpp
index d6f6b2cd30a7..047cb0e4c2bf 100644
--- a/lldb/source/Host/common/TCPSocket.cpp
+++ b/lldb/source/Host/common/TCPSocket.cpp
@@ -238,7 +238,7 @@ Status TCPSocket::Listen(llvm::StringRef name, int backlog) 
{
 m_listen_sockets[fd] = address;
   }
 
-  if (m_listen_sockets.size() == 0) {
+  if (m_listen_sockets.empty()) {
 assert(error.Fail());
 return error;
   }



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


[Lldb-commits] [lldb] 6a9edce - Fix a dangling-gsl warning and avoid transitively including string.

2020-04-24 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-04-24T16:03:17-07:00
New Revision: 6a9edce25778e6c131914ab2e6c3f8528785a8df

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

LOG: Fix a dangling-gsl warning and avoid transitively including string.

Added: 


Modified: 
lldb/source/Utility/XcodeSDK.cpp

Removed: 




diff  --git a/lldb/source/Utility/XcodeSDK.cpp 
b/lldb/source/Utility/XcodeSDK.cpp
index a34eac6b2c95..197eef182f69 100644
--- a/lldb/source/Utility/XcodeSDK.cpp
+++ b/lldb/source/Utility/XcodeSDK.cpp
@@ -10,6 +10,7 @@
 #include "lldb/Utility/XcodeSDK.h"
 
 #include "lldb/lldb-types.h"
+#include 
 
 using namespace lldb;
 using namespace lldb_private;
@@ -187,7 +188,7 @@ bool XcodeSDK::SDKSupportsModules(XcodeSDK::Type 
desired_type,
 const std::string sdk_name_lower = sdk_name.lower();
 Info info;
 info.type = desired_type;
-const llvm::StringRef sdk_string = GetCanonicalName(info);
+const std::string sdk_string = GetCanonicalName(info);
 if (!llvm::StringRef(sdk_name_lower).startswith(sdk_string))
   return false;
 



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


[Lldb-commits] [lldb] ff1658b - Fix -Wdeprecated-copy warning in XcodeSDK.

2020-04-08 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-04-08T15:12:53-07:00
New Revision: ff1658b167c835ca55f554a3ad5aac444a6f9c9c

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

LOG: Fix -Wdeprecated-copy warning in XcodeSDK.

Added: 


Modified: 
lldb/include/lldb/Utility/XcodeSDK.h

Removed: 




diff  --git a/lldb/include/lldb/Utility/XcodeSDK.h 
b/lldb/include/lldb/Utility/XcodeSDK.h
index 9b9f1d226bf0..b186ab4a7091 100644
--- a/lldb/include/lldb/Utility/XcodeSDK.h
+++ b/lldb/include/lldb/Utility/XcodeSDK.h
@@ -45,6 +45,7 @@ class XcodeSDK {
   void Merge(XcodeSDK other);
 
   XcodeSDK =(XcodeSDK other);
+  XcodeSDK(const XcodeSDK&) = default;
   bool operator==(XcodeSDK other);
 
   /// Return parsed SDK number, and SDK version number.



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


[Lldb-commits] [lldb] 3ccd454 - Fix unused variable, format, and format string warnings.

2020-04-03 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2020-04-03T17:58:59-07:00
New Revision: 3ccd454c102b069d2230a18cfe16b84a5f005fc8

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

LOG: Fix unused variable, format, and format string warnings.
NFC.

Added: 


Modified: 
lldb/include/lldb/Target/ThreadPlanStack.h
lldb/source/Commands/CommandObjectThread.cpp
lldb/source/Target/ThreadPlan.cpp
lldb/source/Target/ThreadPlanStack.cpp
lldb/source/Target/ThreadPlanStepRange.cpp

Removed: 




diff  --git a/lldb/include/lldb/Target/ThreadPlanStack.h 
b/lldb/include/lldb/Target/ThreadPlanStack.h
index de52ee3ee198..f1874136cad8 100644
--- a/lldb/include/lldb/Target/ThreadPlanStack.h
+++ b/lldb/include/lldb/Target/ThreadPlanStack.h
@@ -125,7 +125,7 @@ class ThreadPlanStackMap {
 
   void AddThread(Thread ) {
 lldb::tid_t tid = thread.GetID();
-auto result = m_plans_list.emplace(tid, thread);
+m_plans_list.emplace(tid, thread);
   }
 
   bool RemoveTID(lldb::tid_t tid) {

diff  --git a/lldb/source/Commands/CommandObjectThread.cpp 
b/lldb/source/Commands/CommandObjectThread.cpp
index 579f3362be89..fe86c9d34c6c 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -2061,7 +2061,6 @@ class CommandObjectThreadPlanPrune : public 
CommandObjectParsed {
   return true;  
 }
 
-bool success;
 const size_t num_args = args.GetArgumentCount();
 
 std::lock_guard guard(

diff  --git a/lldb/source/Target/ThreadPlan.cpp 
b/lldb/source/Target/ThreadPlan.cpp
index 52b1a8b29c87..b3ff3232a0ac 100644
--- a/lldb/source/Target/ThreadPlan.cpp
+++ b/lldb/source/Target/ThreadPlan.cpp
@@ -24,7 +24,7 @@ ThreadPlan::ThreadPlan(ThreadPlanKind kind, const char *name, 
Thread ,
 : m_process(*thread.GetProcess().get()), m_tid(thread.GetID()),
   m_stop_vote(stop_vote), m_run_vote(run_vote),
   m_takes_iteration_count(false), m_could_not_resolve_hw_bp(false),
-  m_kind(kind), m_thread(), m_name(name), m_plan_complete_mutex(),
+  m_thread(), m_kind(kind), m_name(name), m_plan_complete_mutex(),
   m_cached_plan_explains_stop(eLazyBoolCalculate), m_plan_complete(false),
   m_plan_private(false), m_okay_to_discard(true), m_is_master_plan(false),
   m_plan_succeeded(true) {

diff  --git a/lldb/source/Target/ThreadPlanStack.cpp 
b/lldb/source/Target/ThreadPlanStack.cpp
index 6120d0ccefcb..44e47f385a82 100644
--- a/lldb/source/Target/ThreadPlanStack.cpp
+++ b/lldb/source/Target/ThreadPlanStack.cpp
@@ -39,9 +39,6 @@ ThreadPlanStack::ThreadPlanStack(const Thread , bool 
make_null) {
 void ThreadPlanStack::DumpThreadPlans(Stream ,
   lldb::DescriptionLevel desc_level,
   bool include_internal) const {
-
-  uint32_t stack_size;
-
   s.IndentMore();
   PrintOneStack(s, "Active plan stack", m_plans, desc_level, include_internal);
   PrintOneStack(s, "Completed plan stack", m_completed_plans, desc_level,
@@ -73,7 +70,7 @@ void ThreadPlanStack::PrintOneStack(Stream , 
llvm::StringRef stack_name,
   if (include_internal || any_public) {
 int print_idx = 0;
 s.Indent();
-s.Printf("%s:\n", stack_name);
+s << stack_name << ":\n";
 for (auto plan : stack) {
   if (!include_internal && plan->GetPrivate())
 continue;
@@ -270,7 +267,6 @@ lldb::ThreadPlanSP ThreadPlanStack::GetCompletedPlan(bool 
skip_private) const {
 lldb::ThreadPlanSP ThreadPlanStack::GetPlanByIndex(uint32_t plan_idx,
bool skip_private) const {
   uint32_t idx = 0;
-  ThreadPlan *up_to_plan_ptr = nullptr;
 
   for (lldb::ThreadPlanSP plan_sp : m_plans) {
 if (skip_private && plan_sp->GetPrivate())

diff  --git a/lldb/source/Target/ThreadPlanStepRange.cpp 
b/lldb/source/Target/ThreadPlanStepRange.cpp
index 85b89e7a080b..f4b2ee3d08a2 100644
--- a/lldb/source/Target/ThreadPlanStepRange.cpp
+++ b/lldb/source/Target/ThreadPlanStepRange.cpp
@@ -86,7 +86,6 @@ void ThreadPlanStepRange::AddRange(const AddressRange 
_range) {
 }
 
 void ThreadPlanStepRange::DumpRanges(Stream *s) {
-  Thread  = GetThread();
   size_t num_ranges = m_address_ranges.size();
   if (num_ranges == 1) {
 m_address_ranges[0].Dump(s, (), Address::DumpStyleLoadAddress);



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


[Lldb-commits] [lldb] 1d41d1b - Revert "Temporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple GDB remotes"

2019-12-10 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2019-12-10T15:04:45-08:00
New Revision: 1d41d1bcdfd70cf8f77bb32e2617392395c299a4

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

LOG: Revert "Temporarily revert [lldb] e81268d - [lldb/Reproducers] Support 
multiple GDB remotes"

On multiple retry this issue won't duplicate - will revisit with author if
duplication works again.

This reverts commit c9e0b354e2749ce7ab553974692cb35c8651a869.

Added: 
lldb/test/Shell/Reproducer/Inputs/MultipleTargetsCapture.in
lldb/test/Shell/Reproducer/TestMultipleTargets.test

Modified: 
lldb/include/lldb/Utility/GDBRemote.h
lldb/include/lldb/Utility/Reproducer.h
lldb/source/API/SBDebugger.cpp
lldb/source/Commands/CommandObjectReproducer.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationHistory.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationHistory.h
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Utility/GDBRemote.cpp
lldb/source/Utility/Reproducer.cpp

Removed: 




diff  --git a/lldb/include/lldb/Utility/GDBRemote.h 
b/lldb/include/lldb/Utility/GDBRemote.h
index b4adeb368524..21b2c8cd73cd 100644
--- a/lldb/include/lldb/Utility/GDBRemote.h
+++ b/lldb/include/lldb/Utility/GDBRemote.h
@@ -9,6 +9,8 @@
 #ifndef liblldb_GDBRemote_h_
 #define liblldb_GDBRemote_h_
 
+#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/Reproducer.h"
 #include "lldb/Utility/StreamString.h"
 #include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-public.h"
@@ -69,7 +71,6 @@ struct GDBRemotePacket {
 std::string data;
   };
 
-  void Serialize(llvm::raw_ostream ) const;
   void Dump(Stream ) const;
 
   BinaryData packet;
@@ -82,6 +83,46 @@ struct GDBRemotePacket {
   llvm::StringRef GetTypeStr() const;
 };
 
+namespace repro {
+class PacketRecorder : public AbstractRecorder {
+public:
+  PacketRecorder(const FileSpec , std::error_code )
+  : AbstractRecorder(filename, ec) {}
+
+  static llvm::Expected>
+  Create(const FileSpec );
+
+  void Record(const GDBRemotePacket );
+};
+
+class GDBRemoteProvider : public repro::Provider {
+public:
+  struct Info {
+static const char *name;
+static const char *file;
+  };
+
+  GDBRemoteProvider(const FileSpec ) : Provider(directory) {}
+
+  llvm::raw_ostream *GetHistoryStream();
+  PacketRecorder *GetNewPacketRecorder();
+
+  void SetCallback(std::function callback) {
+m_callback = std::move(callback);
+  }
+
+  void Keep() override;
+  void Discard() override;
+
+  static char ID;
+
+private:
+  std::function m_callback;
+  std::unique_ptr m_stream_up;
+  std::vector> m_packet_recorders;
+};
+
+} // namespace repro
 } // namespace lldb_private
 
 LLVM_YAML_IS_DOCUMENT_LIST_VECTOR(lldb_private::GDBRemotePacket)

diff  --git a/lldb/include/lldb/Utility/Reproducer.h 
b/lldb/include/lldb/Utility/Reproducer.h
index ddb1f45a7219..0d23fe8571ff 100644
--- a/lldb/include/lldb/Utility/Reproducer.h
+++ b/lldb/include/lldb/Utility/Reproducer.h
@@ -153,24 +153,13 @@ class WorkingDirectoryProvider : public 
Provider {
   static char ID;
 };
 
-class DataRecorder {
-public:
-  DataRecorder(const FileSpec , std::error_code )
+class AbstractRecorder {
+protected:
+  AbstractRecorder(const FileSpec , std::error_code )
   : m_filename(filename.GetFilename().GetStringRef()),
 m_os(filename.GetPath(), ec, llvm::sys::fs::OF_Text), m_record(true) {}
 
-  static llvm::Expected>
-  Create(const FileSpec );
-
-  template  void Record(const T , bool newline = false) {
-if (!m_record)
-  return;
-m_os << t;
-if (newline)
-  m_os << '\n';
-m_os.flush();
-  }
-
+public:
   const FileSpec () { return m_filename; }
 
   void Stop() {
@@ -180,10 +169,30 @@ class DataRecorder {
 
 private:
   FileSpec m_filename;
+
+protected:
   llvm::raw_fd_ostream m_os;
   bool m_record;
 };
 
+class DataRecorder : public AbstractRecorder {
+public:
+  DataRecorder(const FileSpec , std::error_code )
+  : AbstractRecorder(filename, ec) {}
+
+  static llvm::Expected>
+  Create(const FileSpec );
+
+  template  void Record(const T , bool newline = false) {
+if (!m_record)
+  return;
+m_os << t;
+if (newline)
+  m_os << '\n';
+m_os.flush();
+  }
+};
+
 class CommandProvider : public Provider {
 public:
   struct Info {
@@ -204,32 +213,6 @@ class CommandProvider : public Provider {
   std::vector> m_data_recorders;
 };
 
-class ProcessGDBRemoteProvider
-: public repro::Provider {
-public:
-  struct Info {
-static const char *name;
-static const char *file;
-  };
-
-  ProcessGDBRemoteProvider(const FileSpec ) : 

Re: [Lldb-commits] [lldb] e81268d - [lldb/Reproducers] Support multiple GDB remotes

2019-12-10 Thread Eric Christopher via lldb-commits
For now I've gone ahead and reverted thusly:

echristo@athyra ~/r/llvm-project> git push
To github.com:llvm/llvm-project.git
   a2602bdd731..c9e0b354e27  master -> master

Sorry for the very quick turnaround.

-eric

On Tue, Dec 10, 2019 at 12:21 PM Eric Christopher 
wrote:

> Hi Jonas,
>
> This appears to be causing crashes in a release asserts build:
>
>  #3 0x7efe57b613a0 __restore_rt
> (/lib/x86_64-linux-gnu/libpthread.so.0+0x123a0)
>  #4 0x7efe54178d00 llvm::raw_ostream::operator<<(llvm::StringRef)
> sources/llvm-project/llvm/include/llvm/Support/raw_ostream.h:190:7
>  #5 0x7efe54178d00 llvm::yaml::Output::output(llvm::StringRef)
> sources/llvm-project/llvm/lib/Support/YAMLTraits.cpp:751:7
>  #6 0x7efe54178d00
> llvm::yaml::Output::outputUpToEndOfLine(llvm::StringRef)
> sources/llvm-project/llvm/lib/Support/YAMLTraits.cpp:755:3
>  #7 0x7efe54178d00 llvm::yaml::Output::beginDocuments()
> sources/llvm-project/llvm/lib/Support/YAMLTraits.cpp:537:3
>  #8 0x7efe53fc5d7e
> std::enable_if llvm::yaml::EmptyContext>::value, llvm::yaml::Output&>::type
> llvm::yaml::operator<<(llvm::yaml::Output&,
> lldb_private::GDBRemotePacket&)
> sources/llvm-project/llvm/include/llvm/Support/YAMLTraits.h:1796:13
>  #9 0x7efe53fc5d7e
> lldb_private::GDBRemotePacket::Serialize(llvm::raw_ostream&) const
> sources/llvm-project/lldb/source/Utility/GDBRemote.cpp:50:8
> ...
>
> want to revert and see what's going on? Happy to help if you can't
> duplicate?
>
> Thanks!
>
> -eric
>
> On Tue, Dec 10, 2019 at 11:17 AM Jonas Devlieghere via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>>
>> Author: Jonas Devlieghere
>> Date: 2019-12-10T11:16:52-08:00
>> New Revision: e81268d03e73aef4f9c7bd8ece8ad02f5b017dcf
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/e81268d03e73aef4f9c7bd8ece8ad02f5b017dcf
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/e81268d03e73aef4f9c7bd8ece8ad02f5b017dcf.diff
>>
>> LOG: [lldb/Reproducers] Support multiple GDB remotes
>>
>> When running the test suite with always capture on, a handful of tests
>> are failing because they have multiple targets and therefore multiple
>> GDB remote connections. The current reproducer infrastructure is capable
>> of dealing with that.
>>
>> This patch reworks the GDB remote provider to support multiple GDB
>> remote connections, similar to how the reproducers support shadowing
>> multiple command interpreter inputs. The provider now keeps a list of
>> packet recorders which deal with a single GDB remote connection. During
>> replay we rely on the order of creation to match the number of packets
>> to the GDB remote connection.
>>
>> Differential revision: https://reviews.llvm.org/D71105
>>
>> Added:
>> lldb/test/Shell/Reproducer/Inputs/MultipleTargetsCapture.in
>> lldb/test/Shell/Reproducer/TestMultipleTargets.test
>>
>> Modified:
>> lldb/include/lldb/Utility/GDBRemote.h
>> lldb/include/lldb/Utility/Reproducer.h
>> lldb/source/API/SBDebugger.cpp
>> lldb/source/Commands/CommandObjectReproducer.cpp
>> lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
>> lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
>>
>> lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationHistory.cpp
>> lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationHistory.h
>> lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
>> lldb/source/Utility/GDBRemote.cpp
>> lldb/source/Utility/Reproducer.cpp
>>
>> Removed:
>>
>>
>>
>>
>> 
>> diff  --git a/lldb/include/lldb/Utility/GDBRemote.h
>> b/lldb/include/lldb/Utility/GDBRemote.h
>> index b4adeb368524..21b2c8cd73cd 100644
>> --- a/lldb/include/lldb/Utility/GDBRemote.h
>> +++ b/lldb/include/lldb/Utility/GDBRemote.h
>> @@ -9,6 +9,8 @@
>>  #ifndef liblldb_GDBRemote_h_
>>  #define liblldb_GDBRemote_h_
>>
>> +#include "lldb/Utility/FileSpec.h"
>> +#include "lldb/Utility/Reproducer.h"
>>  #include "lldb/Utility/StreamString.h"
>>  #include "lldb/lldb-enumerations.h"
>>  #include "lldb/lldb-public.h"
>> @@ -69,7 +71,6 @@ struct GDBRemotePacket {
>>  std::string data;
>>};
>>
>> -  void Serialize(llvm::raw_ostream ) const;
>>void Dump(Stream ) const;
>>
>>BinaryData packet;
>> @@ -82,6 +83,46 @@ struct GDBRemotePacket {
>>llvm::StringRef GetTypeStr() const;
>>  };
>>
>> +namespace repro {
>> +class PacketRecorder : public AbstractRecorder {
>> +public:
>> +  PacketRecorder(const FileSpec , std::error_code )
>> +  : AbstractRecorder(filename, ec) {}
>> +
>> +  static llvm::Expected>
>> +  Create(const FileSpec );
>> +
>> +  void Record(const GDBRemotePacket );
>> +};
>> +
>> +class GDBRemoteProvider : public repro::Provider {
>> +public:
>> +  struct Info {
>> +static const char *name;
>> +static const char *file;
>> +  };
>> +
>> +  GDBRemoteProvider(const FileSpec ) : Provider(directory) {}
>> +
>> +  

[Lldb-commits] [lldb] c9e0b35 - Temporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple GDB remotes

2019-12-10 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2019-12-10T12:29:46-08:00
New Revision: c9e0b354e2749ce7ab553974692cb35c8651a869

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

LOG: Temporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple 
GDB remotes

This was causing a crash in opt+assert builds on linux and a follow-up
message was posted.

This reverts commit e81268d03e73aef4f9c7bd8ece8ad02f5b017dcf

Added: 


Modified: 
lldb/include/lldb/Utility/GDBRemote.h
lldb/include/lldb/Utility/Reproducer.h
lldb/source/API/SBDebugger.cpp
lldb/source/Commands/CommandObjectReproducer.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationHistory.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationHistory.h
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Utility/GDBRemote.cpp
lldb/source/Utility/Reproducer.cpp

Removed: 
lldb/test/Shell/Reproducer/Inputs/MultipleTargetsCapture.in
lldb/test/Shell/Reproducer/TestMultipleTargets.test



diff  --git a/lldb/include/lldb/Utility/GDBRemote.h 
b/lldb/include/lldb/Utility/GDBRemote.h
index 21b2c8cd73cd..b4adeb368524 100644
--- a/lldb/include/lldb/Utility/GDBRemote.h
+++ b/lldb/include/lldb/Utility/GDBRemote.h
@@ -9,8 +9,6 @@
 #ifndef liblldb_GDBRemote_h_
 #define liblldb_GDBRemote_h_
 
-#include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/Reproducer.h"
 #include "lldb/Utility/StreamString.h"
 #include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-public.h"
@@ -71,6 +69,7 @@ struct GDBRemotePacket {
 std::string data;
   };
 
+  void Serialize(llvm::raw_ostream ) const;
   void Dump(Stream ) const;
 
   BinaryData packet;
@@ -83,46 +82,6 @@ struct GDBRemotePacket {
   llvm::StringRef GetTypeStr() const;
 };
 
-namespace repro {
-class PacketRecorder : public AbstractRecorder {
-public:
-  PacketRecorder(const FileSpec , std::error_code )
-  : AbstractRecorder(filename, ec) {}
-
-  static llvm::Expected>
-  Create(const FileSpec );
-
-  void Record(const GDBRemotePacket );
-};
-
-class GDBRemoteProvider : public repro::Provider {
-public:
-  struct Info {
-static const char *name;
-static const char *file;
-  };
-
-  GDBRemoteProvider(const FileSpec ) : Provider(directory) {}
-
-  llvm::raw_ostream *GetHistoryStream();
-  PacketRecorder *GetNewPacketRecorder();
-
-  void SetCallback(std::function callback) {
-m_callback = std::move(callback);
-  }
-
-  void Keep() override;
-  void Discard() override;
-
-  static char ID;
-
-private:
-  std::function m_callback;
-  std::unique_ptr m_stream_up;
-  std::vector> m_packet_recorders;
-};
-
-} // namespace repro
 } // namespace lldb_private
 
 LLVM_YAML_IS_DOCUMENT_LIST_VECTOR(lldb_private::GDBRemotePacket)

diff  --git a/lldb/include/lldb/Utility/Reproducer.h 
b/lldb/include/lldb/Utility/Reproducer.h
index 0d23fe8571ff..ddb1f45a7219 100644
--- a/lldb/include/lldb/Utility/Reproducer.h
+++ b/lldb/include/lldb/Utility/Reproducer.h
@@ -153,32 +153,11 @@ class WorkingDirectoryProvider : public 
Provider {
   static char ID;
 };
 
-class AbstractRecorder {
-protected:
-  AbstractRecorder(const FileSpec , std::error_code )
-  : m_filename(filename.GetFilename().GetStringRef()),
-m_os(filename.GetPath(), ec, llvm::sys::fs::OF_Text), m_record(true) {}
-
-public:
-  const FileSpec () { return m_filename; }
-
-  void Stop() {
-assert(m_record);
-m_record = false;
-  }
-
-private:
-  FileSpec m_filename;
-
-protected:
-  llvm::raw_fd_ostream m_os;
-  bool m_record;
-};
-
-class DataRecorder : public AbstractRecorder {
+class DataRecorder {
 public:
   DataRecorder(const FileSpec , std::error_code )
-  : AbstractRecorder(filename, ec) {}
+  : m_filename(filename.GetFilename().GetStringRef()),
+m_os(filename.GetPath(), ec, llvm::sys::fs::OF_Text), m_record(true) {}
 
   static llvm::Expected>
   Create(const FileSpec );
@@ -191,6 +170,18 @@ class DataRecorder : public AbstractRecorder {
   m_os << '\n';
 m_os.flush();
   }
+
+  const FileSpec () { return m_filename; }
+
+  void Stop() {
+assert(m_record);
+m_record = false;
+  }
+
+private:
+  FileSpec m_filename;
+  llvm::raw_fd_ostream m_os;
+  bool m_record;
 };
 
 class CommandProvider : public Provider {
@@ -213,6 +204,32 @@ class CommandProvider : public Provider {
   std::vector> m_data_recorders;
 };
 
+class ProcessGDBRemoteProvider
+: public repro::Provider {
+public:
+  struct Info {
+static const char *name;
+static const char *file;
+  };
+
+  ProcessGDBRemoteProvider(const FileSpec ) : Provider(directory) {}
+
+  llvm::raw_ostream 

Re: [Lldb-commits] [lldb] e81268d - [lldb/Reproducers] Support multiple GDB remotes

2019-12-10 Thread Eric Christopher via lldb-commits
Hi Jonas,

This appears to be causing crashes in a release asserts build:

 #3 0x7efe57b613a0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x123a0)
 #4 0x7efe54178d00 llvm::raw_ostream::operator<<(llvm::StringRef)
sources/llvm-project/llvm/include/llvm/Support/raw_ostream.h:190:7
 #5 0x7efe54178d00 llvm::yaml::Output::output(llvm::StringRef)
sources/llvm-project/llvm/lib/Support/YAMLTraits.cpp:751:7
 #6 0x7efe54178d00
llvm::yaml::Output::outputUpToEndOfLine(llvm::StringRef)
sources/llvm-project/llvm/lib/Support/YAMLTraits.cpp:755:3
 #7 0x7efe54178d00 llvm::yaml::Output::beginDocuments()
sources/llvm-project/llvm/lib/Support/YAMLTraits.cpp:537:3
 #8 0x7efe53fc5d7e
std::enable_if::value, llvm::yaml::Output&>::type
llvm::yaml::operator<<(llvm::yaml::Output&,
lldb_private::GDBRemotePacket&)
sources/llvm-project/llvm/include/llvm/Support/YAMLTraits.h:1796:13
 #9 0x7efe53fc5d7e
lldb_private::GDBRemotePacket::Serialize(llvm::raw_ostream&) const
sources/llvm-project/lldb/source/Utility/GDBRemote.cpp:50:8
...

want to revert and see what's going on? Happy to help if you can't
duplicate?

Thanks!

-eric

On Tue, Dec 10, 2019 at 11:17 AM Jonas Devlieghere via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

>
> Author: Jonas Devlieghere
> Date: 2019-12-10T11:16:52-08:00
> New Revision: e81268d03e73aef4f9c7bd8ece8ad02f5b017dcf
>
> URL:
> https://github.com/llvm/llvm-project/commit/e81268d03e73aef4f9c7bd8ece8ad02f5b017dcf
> DIFF:
> https://github.com/llvm/llvm-project/commit/e81268d03e73aef4f9c7bd8ece8ad02f5b017dcf.diff
>
> LOG: [lldb/Reproducers] Support multiple GDB remotes
>
> When running the test suite with always capture on, a handful of tests
> are failing because they have multiple targets and therefore multiple
> GDB remote connections. The current reproducer infrastructure is capable
> of dealing with that.
>
> This patch reworks the GDB remote provider to support multiple GDB
> remote connections, similar to how the reproducers support shadowing
> multiple command interpreter inputs. The provider now keeps a list of
> packet recorders which deal with a single GDB remote connection. During
> replay we rely on the order of creation to match the number of packets
> to the GDB remote connection.
>
> Differential revision: https://reviews.llvm.org/D71105
>
> Added:
> lldb/test/Shell/Reproducer/Inputs/MultipleTargetsCapture.in
> lldb/test/Shell/Reproducer/TestMultipleTargets.test
>
> Modified:
> lldb/include/lldb/Utility/GDBRemote.h
> lldb/include/lldb/Utility/Reproducer.h
> lldb/source/API/SBDebugger.cpp
> lldb/source/Commands/CommandObjectReproducer.cpp
> lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
> lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
>
> lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationHistory.cpp
> lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationHistory.h
> lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
> lldb/source/Utility/GDBRemote.cpp
> lldb/source/Utility/Reproducer.cpp
>
> Removed:
>
>
>
>
> 
> diff  --git a/lldb/include/lldb/Utility/GDBRemote.h
> b/lldb/include/lldb/Utility/GDBRemote.h
> index b4adeb368524..21b2c8cd73cd 100644
> --- a/lldb/include/lldb/Utility/GDBRemote.h
> +++ b/lldb/include/lldb/Utility/GDBRemote.h
> @@ -9,6 +9,8 @@
>  #ifndef liblldb_GDBRemote_h_
>  #define liblldb_GDBRemote_h_
>
> +#include "lldb/Utility/FileSpec.h"
> +#include "lldb/Utility/Reproducer.h"
>  #include "lldb/Utility/StreamString.h"
>  #include "lldb/lldb-enumerations.h"
>  #include "lldb/lldb-public.h"
> @@ -69,7 +71,6 @@ struct GDBRemotePacket {
>  std::string data;
>};
>
> -  void Serialize(llvm::raw_ostream ) const;
>void Dump(Stream ) const;
>
>BinaryData packet;
> @@ -82,6 +83,46 @@ struct GDBRemotePacket {
>llvm::StringRef GetTypeStr() const;
>  };
>
> +namespace repro {
> +class PacketRecorder : public AbstractRecorder {
> +public:
> +  PacketRecorder(const FileSpec , std::error_code )
> +  : AbstractRecorder(filename, ec) {}
> +
> +  static llvm::Expected>
> +  Create(const FileSpec );
> +
> +  void Record(const GDBRemotePacket );
> +};
> +
> +class GDBRemoteProvider : public repro::Provider {
> +public:
> +  struct Info {
> +static const char *name;
> +static const char *file;
> +  };
> +
> +  GDBRemoteProvider(const FileSpec ) : Provider(directory) {}
> +
> +  llvm::raw_ostream *GetHistoryStream();
> +  PacketRecorder *GetNewPacketRecorder();
> +
> +  void SetCallback(std::function callback) {
> +m_callback = std::move(callback);
> +  }
> +
> +  void Keep() override;
> +  void Discard() override;
> +
> +  static char ID;
> +
> +private:
> +  std::function m_callback;
> +  std::unique_ptr m_stream_up;
> +  std::vector> m_packet_recorders;
> +};
> +
> +} // namespace repro
>  } // namespace lldb_private
>
>  

[Lldb-commits] [lldb] 53acf06 - Fix a -Wsign-compare error around wchar_t vs unsigned int.

2019-12-10 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2019-12-10T11:18:57-08:00
New Revision: 53acf0663f80e1be99bae28769c6b658fff0e097

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

LOG: Fix a -Wsign-compare error around wchar_t vs unsigned int.

Added: 


Modified: 
lldb/source/Host/common/Editline.cpp

Removed: 




diff  --git a/lldb/source/Host/common/Editline.cpp 
b/lldb/source/Host/common/Editline.cpp
index b29c218f0369..5fd5a0cfc7fc 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -1484,7 +1484,7 @@ bool Editline::CompleteCharacter(char ch, 
EditLineGetCharType ) {
 switch (cvt.in(state, input.begin(), input.end(), from_next, ,  + 
1,
to_next)) {
 case std::codecvt_base::ok:
-  return out != WEOF;
+  return out != (int)WEOF;
 
 case std::codecvt_base::error:
 case std::codecvt_base::noconv:



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


[Lldb-commits] [lldb] 5312139 - Add a default copy-assignment or copy-constructor for -Wdeprecated-copy warnings.

2019-12-04 Thread Eric Christopher via lldb-commits

Author: Eric Christopher
Date: 2019-12-04T20:35:32-08:00
New Revision: 5312139f779f9f18cc5fa1c4ce5e5c5c1e854e90

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

LOG: Add a default copy-assignment or copy-constructor for -Wdeprecated-copy 
warnings.

Added: 


Modified: 
lldb/source/Core/IOHandlerCursesGUI.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp

Removed: 




diff  --git a/lldb/source/Core/IOHandlerCursesGUI.cpp 
b/lldb/source/Core/IOHandlerCursesGUI.cpp
index cb6fbaa99ea6..a9114aa71b06 100644
--- a/lldb/source/Core/IOHandlerCursesGUI.cpp
+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -1461,6 +1461,8 @@ class TreeItem {
 return *this;
   }
 
+  TreeItem(const TreeItem &) = default;
+
   size_t GetDepth() const {
 if (m_parent)
   return 1 + m_parent->GetDepth();

diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
index 619c718a1c1b..f6d8d4d9a7eb 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
@@ -94,6 +94,8 @@ class MapIterator {
   MapIterator(ValueObject *entry, size_t depth = 0)
   : m_entry(entry), m_max_depth(depth), m_error(false) {}
 
+  MapIterator =(const MapIterator &) = default;
+
   ValueObjectSP value() { return m_entry.GetEntry(); }
 
   ValueObjectSP advance(size_t count) {



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


Re: [Lldb-commits] [PATCH] D54747: Discard debuginfo for object files empty after GC

2019-05-16 Thread Eric Christopher via lldb-commits
For now I think the compelling argument on revert is:

- this breaks currently working thinlto builds

whether or not this has uncovered a latent problem in thinlto, the
linking strategy used, or something else I think we should revert
until we can take a look and decide where the problems are and what
should be done about them.

Thanks

-eric

On Thu, May 16, 2019 at 4:17 PM Bob Haarman via Phabricator
 wrote:
>
> inglorion added a comment.
>
> I also think we should revert this change while we think about the approach. 
> I've been reluctant to do this because I was impressed by how many bytes of 
> output it saves, and I didn't want to lose that just because it doesn't play 
> nice with ThinLTO. However, after some more data gathering and talking to 
> people, I think that:
>
> 1. There is enough doubt that this is the right approach that we probably 
> should take some time to think about which way we really want to go.
>
> 2. In the meantime, a build configuration that used to work is broken.
>
> 3. To fix that while leaving this change in, we would have to build more 
> things on top of the change, which seems unwise if we're not sure that this 
> is the best approach.
>
> So I think we should revert and rethink.
>
> Reasons I'm not convinced that this is the right approach:
>
> 1. We have now identified multiple use cases that break with this change. 
> ThinLTO is one, -fmodules-debuginfo is another. The general theme here is 
> that the expectation is that if an object file is passed to the linker and 
> not between --start-lib and --end-lib or in a static library, the expectation 
> is that it makes it into the final link. -gc-sections asks to discard unused 
> sections, but it's not clear that this should also apply to debug 
> information, and we have seen some problems.
>
> 2. It's also not clear to me that this is as much of a win as I initially 
> thought. It is in the cases that have been demonstrated, of course, but I'm 
> not sure how well that generalizes. On a local Clang build I performed, for 
> example, it made exactly 0 bytes difference. Perhaps the big wins only happen 
> in pathological cases that are better addressed some other way.
>
> So I'm going to revert this to unbreak the Chromium/Android build, and then 
> we can think some more about how we can get the size win without the breakage.
>
>
> Repository:
>   rL LLVM
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D54747/new/
>
> https://reviews.llvm.org/D54747
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D54747: Discard debuginfo for object files empty after GC

2019-05-16 Thread Eric Christopher via lldb-commits
Unlikely. I'm in the middle of getting some, but that's still going to
be a few months I think.

And yes, we should probably just revert for now.

I can unless someone beats me to it.

Thanks!

On Thu, May 16, 2019 at 2:29 PM Nico Weber via Phabricator
 wrote:
>
> thakis added a comment.
>
> This breaking both debug info in thinlto builds and fmodules-debuginfo is 
> probably enough to revert and go back to the drawing board.
>
> I suppose we don't have any debug info quality tests that use thinlto?
>
>
> Repository:
>   rL LLVM
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D54747/new/
>
> https://reviews.llvm.org/D54747
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D54747: Discard debuginfo for object files empty after GC

2019-05-08 Thread Eric Christopher via lldb-commits
Tagging in Teresa as well for the thinlto parts.

On Wed, May 8, 2019 at 12:43 PM Nico Weber via Phabricator
 wrote:
>
> thakis added a comment.
>
> That problem only seems to happen when (thin) lto is enabled.
>
>
> Repository:
>   rL LLVM
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D54747/new/
>
> https://reviews.llvm.org/D54747
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D59235: Remove Support for DWARF64

2019-03-12 Thread Eric Christopher via lldb-commits
Yep yep yep.

On Tue, Mar 12, 2019 at 1:24 PM Adrian Prantl via Phabricator
 wrote:
>
> aprantl added a comment.
>
> In D59235#1426716 , @JDevlieghere 
> wrote:
>
> > Agreed, and we've been doing this for new patches for a while now. However, 
> > I very strongly prefer having asserts over "returning a default value", 
> > which only hides real bugs.
>
>
> I think everyone is on the same page here, but it doesn't hurt to explicitly 
> repeat this  :-)
>
> - Assertions should be used liberally to assert internal consistency and to 
> enforce contracts in the API. Basically when you write an assertion, you 
> should be already convinced that it will always hold.
> - Assertions may never be used to handle invalid external input in a parser. 
> Invalid external input must use error handling, expected, optional, ...
>
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D59235/new/
>
> https://reviews.llvm.org/D59235
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r346294 - Add a break to avoid an unannotated fall-through.

2018-11-06 Thread Eric Christopher via lldb-commits
Author: echristo
Date: Tue Nov  6 21:17:31 2018
New Revision: 346294

URL: http://llvm.org/viewvc/llvm-project?rev=346294=rev
Log:
Add a break to avoid an unannotated fall-through.

Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp

Modified: 
lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp?rev=346294=346293=346294=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp 
Tue Nov  6 21:17:31 2018
@@ -63,6 +63,7 @@ MSVCUndecoratedNameParser::MSVCUndecorat
 name.slice(last_base_start, i - 1));
 
   last_base_start = i + 1;
+  break;
 default:
   break;
 }


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


[Lldb-commits] [lldb] r345086 - Remove unused variable.

2018-10-23 Thread Eric Christopher via lldb-commits
Author: echristo
Date: Tue Oct 23 14:55:41 2018
New Revision: 345086

URL: http://llvm.org/viewvc/llvm-project?rev=345086=rev
Log:
Remove unused variable.

Modified:
lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp?rev=345086=345085=345086=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp Tue 
Oct 23 14:55:41 2018
@@ -868,7 +868,6 @@ TypeSP SymbolFileNativePDB::CreateAndCac
 lldbassert(record_decl);
 
 TypeIndex ti(type_id.index);
-CVType cvt = m_index->tpi().getType(ti);
 m_uid_to_decl[best_uid.toOpaqueId()] = record_decl;
 m_decl_to_status[record_decl] =
 DeclStatus(best_uid.toOpaqueId(), Type::eResolveStateForward);


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


[Lldb-commits] [lldb] r338459 - Tidy up comment.

2018-07-31 Thread Eric Christopher via lldb-commits
Author: echristo
Date: Tue Jul 31 16:53:24 2018
New Revision: 338459

URL: http://llvm.org/viewvc/llvm-project?rev=338459=rev
Log:
Tidy up comment.

Modified:
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp

Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp?rev=338459=338458=338459=diff
==
--- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp Tue Jul 31 
16:53:24 2018
@@ -83,9 +83,9 @@ PlatformSP PlatformAndroid::CreateInstan
   break;
 
 #if defined(__ANDROID__)
-// Only accept "unknown" for the vendor if the host is android and it
+// Only accept "unknown" for the vendor if the host is android and if
 // "unknown" wasn't specified (it was just returned because it was NOT
-// specified_
+// specified).
 case llvm::Triple::VendorType::UnknownVendor:
   create = !arch->TripleVendorWasSpecified();
   break;


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


[Lldb-commits] [lldb] r338460 - Android is an environment and we were comparing the android triple

2018-07-31 Thread Eric Christopher via lldb-commits
Author: echristo
Date: Tue Jul 31 16:53:24 2018
New Revision: 338460

URL: http://llvm.org/viewvc/llvm-project?rev=338460=rev
Log:
Android is an environment and we were comparing the android triple
against the OS rather than the environment. Also update other
uses of OS when we meant environment in the android local code.

NFC intended.

Modified:
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp

Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp?rev=338460=338459=338460=diff
==
--- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp Tue Jul 31 
16:53:24 2018
@@ -95,7 +95,7 @@ PlatformSP PlatformAndroid::CreateInstan
 }
 
 if (create) {
-  switch (triple.getOS()) {
+  switch (triple.getEnvironment()) {
   case llvm::Triple::Android:
 break;
 
@@ -103,8 +103,8 @@ PlatformSP PlatformAndroid::CreateInstan
   // Only accept "unknown" for the OS if the host is android and it
   // "unknown" wasn't specified (it was just returned because it was NOT
   // specified)
-  case llvm::Triple::OSType::UnknownOS:
-create = !arch->TripleOSWasSpecified();
+  case llvm::Triple::EnvironmentType::UnknownEnvironment:
+create = !arch->TripleEnvironmentWasSpecified();
 break;
 #endif
   default:


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


[Lldb-commits] [lldb] r338458 - Use UnknownVendor rather than UnknownArch since they're in two different enums

2018-07-31 Thread Eric Christopher via lldb-commits
Author: echristo
Date: Tue Jul 31 16:53:23 2018
New Revision: 338458

URL: http://llvm.org/viewvc/llvm-project?rev=338458=rev
Log:
Use UnknownVendor rather than UnknownArch since they're in two different enums
and we're switching on vendor and not arch.

Modified:
lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp

Modified: lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp?rev=338458=338457=338458=diff
==
--- lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp Tue Jul 31 
16:53:23 2018
@@ -78,7 +78,7 @@ PlatformSP PlatformWindows::CreateInstan
   create = true;
   break;
 
-case llvm::Triple::UnknownArch:
+case llvm::Triple::UnknownVendor:
   create = !arch->TripleVendorWasSpecified();
   break;
 


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


[Lldb-commits] [lldb] r336884 - Remove unused variable m_header as it hasn't been used since it was

2018-07-11 Thread Eric Christopher via lldb-commits
Author: echristo
Date: Wed Jul 11 20:52:45 2018
New Revision: 336884

URL: http://llvm.org/viewvc/llvm-project?rev=336884=rev
Log:
Remove unused variable m_header as it hasn't been used since it was
added in 2016.

Modified:
lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp
lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h

Modified: lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp?rev=336884=336883=336884=diff
==
--- lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp (original)
+++ lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp Wed Jul 11 
20:52:45 2018
@@ -60,14 +60,13 @@ MinidumpParser::Create(const lldb::DataB
 directory->location;
   }
 
-  return MinidumpParser(data_buf_sp, header, std::move(directory_map));
+  return MinidumpParser(data_buf_sp, std::move(directory_map));
 }
 
 MinidumpParser::MinidumpParser(
-const lldb::DataBufferSP _buf_sp, const MinidumpHeader *header,
+const lldb::DataBufferSP _buf_sp,
 llvm::DenseMap &_map)
-: m_data_sp(data_buf_sp), m_header(header), m_directory_map(directory_map) 
{
-}
+: m_data_sp(data_buf_sp), m_directory_map(directory_map) {}
 
 llvm::ArrayRef MinidumpParser::GetData() {
   return llvm::ArrayRef(m_data_sp->GetBytes(),

Modified: lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h?rev=336884=336883=336884=diff
==
--- lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h (original)
+++ lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h Wed Jul 11 
20:52:45 2018
@@ -91,11 +91,10 @@ public:
 
 private:
   lldb::DataBufferSP m_data_sp;
-  const MinidumpHeader *m_header;
   llvm::DenseMap m_directory_map;
 
   MinidumpParser(
-  const lldb::DataBufferSP _buf_sp, const MinidumpHeader *header,
+  const lldb::DataBufferSP _buf_sp,
   llvm::DenseMap &_map);
 };
 


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


[Lldb-commits] [lldb] r336885 - Remove the unused m_signal member variable, but leave the code that gets it out of the json.

2018-07-11 Thread Eric Christopher via lldb-commits
Author: echristo
Date: Wed Jul 11 20:52:46 2018
New Revision: 336885

URL: http://llvm.org/viewvc/llvm-project?rev=336885=rev
Log:
Remove the unused m_signal member variable, but leave the code that gets it out 
of the json.

Modified:
lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.cpp
lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.h

Modified: lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.cpp?rev=336885=336884=336885=diff
==
--- lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.cpp (original)
+++ lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.cpp Wed Jul 11 
20:52:46 2018
@@ -58,9 +58,9 @@ support::endianness ProcessInfo::GetEndi
 
 //== ThreadInfo 

 ThreadInfo::ThreadInfo(StringRef name, StringRef reason, RegisterMap registers,
-   unsigned int signal)
+   unsigned int)
 : m_name(name.str()), m_reason(reason.str()),
-  m_registers(std::move(registers)), m_signal(signal) {}
+  m_registers(std::move(registers)) {}
 
 const RegisterValue *ThreadInfo::ReadRegister(unsigned int Id) const {
   auto Iter = m_registers.find(Id);

Modified: lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.h?rev=336885=336884=336885=diff
==
--- lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.h (original)
+++ lldb/trunk/unittests/tools/lldb-server/tests/MessageObjects.h Wed Jul 11 
20:52:46 2018
@@ -60,7 +60,6 @@ private:
   std::string m_name;
   std::string m_reason;
   RegisterMap m_registers;
-  unsigned int m_signal;
 };
 
 class JThreadsInfo : public Parser {


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