[Lldb-commits] [lldb] ad709bc - [lldb] Fix -Wformat warning after 5a27b99825a5ba3a7a2eec3d35aea381a3ba9a31

2022-03-09 Thread Krasimir Georgiev via lldb-commits

Author: Krasimir Georgiev
Date: 2022-03-09T12:41:34+01:00
New Revision: ad709bcfb02e5bc7c92a8f1b9b6f0ef76a8081fd

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

LOG: [lldb] Fix -Wformat warning after 5a27b99825a5ba3a7a2eec3d35aea381a3ba9a31

No functional changes intended.

Added: 


Modified: 
lldb/source/Core/Debugger.cpp

Removed: 




diff  --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 3ebf3ceefc3a8..3d3bc75b34eb1 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1802,7 +1802,7 @@ void Debugger::HandleProgressEvent(const lldb::EventSP 
&event_sp) {
   // Print the progress message.
   std::string message = data->GetMessage();
   if (data->GetTotal() != UINT64_MAX) {
-output.Printf("[%llu/%llu] %s...", data->GetCompleted(), data->GetTotal(),
+output.Printf("[%" PRIu64 "/%" PRIu64 "] %s...", data->GetCompleted(), 
data->GetTotal(),
   message.c_str());
   } else {
 output.Printf("%s...", message.c_str());



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


[Lldb-commits] [lldb] 92b475f - [lldb] silence -Wsometimes-uninitialized warnings

2021-09-27 Thread Krasimir Georgiev via lldb-commits

Author: Krasimir Georgiev
Date: 2021-09-27T09:35:58+02:00
New Revision: 92b475f0b079e125c588b121dc50116ea5d6d9f2

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

LOG: [lldb] silence -Wsometimes-uninitialized warnings

No functional changes intended.

Silence warnings from
https://github.com/llvm/llvm-project/commit/3a6ba3675177cb5e47dee325f300aced4cd864ed.

Added: 


Modified: 
lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp 
b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
index a3a9d963c2213..f6a2cdf309815 100644
--- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
+++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
@@ -141,8 +141,8 @@ DynamicRegisterInfo::SetRegisterInfo(const 
StructuredData::Dictionary &dict,
   std::string reg_name_str = matches[1].str();
   std::string msbit_str = matches[2].str();
   std::string lsbit_str = matches[3].str();
-  uint32_t msbit;
-  uint32_t lsbit;
+  uint32_t msbit = 0;
+  uint32_t lsbit = 0;
   if (llvm::to_integer(msbit_str, msbit) &&
   llvm::to_integer(lsbit_str, lsbit)) {
 if (msbit > lsbit) {



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


Re: [Lldb-commits] [lldb] 92b475f - [lldb] silence -Wsometimes-uninitialized warnings

2021-09-28 Thread Krasimir Georgiev via lldb-commits
Thank you David. I just initialized these variables as suggested by
the warnings, without considering this case.
MichaƂ, could you please double check this case?



On Mon, Sep 27, 2021 at 9:09 PM David Blaikie  wrote:

> Maybe this isn't the right fix - msbit and lsbit probably shouldn't be
> printed if to_integer returns false in the diagnostic on line 195. If that
> diagnostic didn't use the variables, then I don't think this'd warn?
>
> On Mon, Sep 27, 2021 at 12:38 AM Krasimir Georgiev via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>>
>> Author: Krasimir Georgiev
>> Date: 2021-09-27T09:35:58+02:00
>> New Revision: 92b475f0b079e125c588b121dc50116ea5d6d9f2
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/92b475f0b079e125c588b121dc50116ea5d6d9f2
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/92b475f0b079e125c588b121dc50116ea5d6d9f2.diff
>>
>> LOG: [lldb] silence -Wsometimes-uninitialized warnings
>>
>> No functional changes intended.
>>
>> Silence warnings from
>>
>> https://github.com/llvm/llvm-project/commit/3a6ba3675177cb5e47dee325f300aced4cd864ed
>> .
>>
>> Added:
>>
>>
>> Modified:
>> lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>>
>> Removed:
>>
>>
>>
>>
>> 
>> diff  --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>> b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>> index a3a9d963c2213..f6a2cdf309815 100644
>> --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>> +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>> @@ -141,8 +141,8 @@ DynamicRegisterInfo::SetRegisterInfo(const
>> StructuredData::Dictionary &dict,
>>std::string reg_name_str = matches[1].str();
>>std::string msbit_str = matches[2].str();
>>std::string lsbit_str = matches[3].str();
>> -  uint32_t msbit;
>> -  uint32_t lsbit;
>> +  uint32_t msbit = 0;
>> +  uint32_t lsbit = 0;
>>if (llvm::to_integer(msbit_str, msbit) &&
>>llvm::to_integer(lsbit_str, lsbit)) {
>>  if (msbit > lsbit) {
>>
>>
>>
>> ___
>> 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] r353161 - [Expressions] Fix -Wreorder warning from r353149

2019-10-04 Thread Krasimir Georgiev via lldb-commits
Author: krasimir
Date: Tue Feb  5 03:35:45 2019
New Revision: 353161

URL: http://llvm.org/viewvc/llvm-project?rev=353161&view=rev
Log:
[Expressions] Fix -Wreorder warning from r353149

Summary:
```
ClangExpressionDeclMap.cpp:72:60: error: field 'm_struct_vars' will be 
initialized after field 'm_ctx_obj' [-Werror,-Wreorder]
  m_result_delegate(result_delegate), m_parser_vars(), m_struct_vars(),
```

Reviewers: bkramer, aleksandr.urakov

Reviewed By: aleksandr.urakov

Subscribers: aleksandr.urakov

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

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp?rev=353161&r1=353160&r2=353161&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp 
Tue Feb  5 03:35:45 2019
@@ -65,12 +65,11 @@ const char *g_lldb_local_vars_namespace_
 ClangExpressionDeclMap::ClangExpressionDeclMap(
 bool keep_result_in_memory,
 Materializer::PersistentVariableDelegate *result_delegate,
-ExecutionContext &exe_ctx,
-ValueObject *ctx_obj)
+ExecutionContext &exe_ctx, ValueObject *ctx_obj)
 : ClangASTSource(exe_ctx.GetTargetSP()), m_found_entities(),
   m_struct_members(), m_keep_result_in_memory(keep_result_in_memory),
-  m_result_delegate(result_delegate), m_parser_vars(), m_struct_vars(),
-  m_ctx_obj(ctx_obj) {
+  m_result_delegate(result_delegate), m_ctx_obj(ctx_obj), m_parser_vars(),
+  m_struct_vars() {
   EnableStructVars();
 }
 


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


[Lldb-commits] [lldb] r344722 - Revert "Return a named error in the result object of an expression with no result"

2019-10-04 Thread Krasimir Georgiev via lldb-commits
Author: krasimir
Date: Wed Oct 17 20:10:43 2018
New Revision: 344722

URL: http://llvm.org/viewvc/llvm-project?rev=344722&view=rev
Log:
Revert "Return a named error in the result object of an expression with no 
result"

This reverts commit r344647.
This causes build failures with [-Werror, -Wswitch]. Some cases where the newly
introduced enum value is not handled in particular are in:
  lldb/source/Expression/REPL.cpp:350
  lldb/source/Interpreter/CommandInterpreter.cpp:1529
(maybe there could be more)

As I don't understand lldb to make sure the likely trivial fixes are
correct and also as they might need additional tests, leaving to the
author to resolve.

Removed:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/no-result/Makefile

lldb/trunk/packages/Python/lldbsuite/test/expression_command/no-result/TestNoResult.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/no-result/main.c
Modified:
lldb/trunk/include/lldb/Expression/UserExpression.h
lldb/trunk/include/lldb/lldb-enumerations.h
lldb/trunk/source/Commands/CommandObjectExpression.cpp
lldb/trunk/source/Expression/ExpressionSourceCode.cpp
lldb/trunk/source/Expression/REPL.cpp
lldb/trunk/source/Expression/UserExpression.cpp

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp

Modified: lldb/trunk/include/lldb/Expression/UserExpression.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/UserExpression.h?rev=344722&r1=344721&r2=344722&view=diff
==
--- lldb/trunk/include/lldb/Expression/UserExpression.h (original)
+++ lldb/trunk/include/lldb/Expression/UserExpression.h Wed Oct 17 20:10:43 2018
@@ -288,6 +288,10 @@ public:
uint32_t line_offset = 0, std::string *fixed_expression = nullptr,
lldb::ModuleSP *jit_module_sp_ptr = nullptr);
 
+  static const Status::ValueType kNoResult =
+  0x1001; ///< ValueObject::GetError() returns this if there is no result
+  /// from the expression.
+
   const char *GetFixedText() {
 if (m_fixed_text.empty())
   return nullptr;

Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=344722&r1=344721&r2=344722&view=diff
==
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Wed Oct 17 20:10:43 2018
@@ -254,8 +254,7 @@ enum ExpressionResults {
   eExpressionHitBreakpoint,
   eExpressionTimedOut,
   eExpressionResultUnavailable,
-  eExpressionStoppedForDebug,
-  eExpressionProducedNoResult
+  eExpressionStoppedForDebug
 };
 
 enum SearchDepth {

Removed: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/no-result/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/no-result/Makefile?rev=344721&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/no-result/Makefile 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/no-result/Makefile 
(removed)
@@ -1,6 +0,0 @@
-LEVEL = ../../make
-
-C_SOURCES := main.c
-CFLAGS_EXTRAS += -std=c99
-
-include $(LEVEL)/Makefile.rules

Removed: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/no-result/TestNoResult.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/no-result/TestNoResult.py?rev=344721&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/no-result/TestNoResult.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/no-result/TestNoResult.py
 (removed)
@@ -1,45 +0,0 @@
-"""
-Test that an expression that returns no result returns a sensible error.
-"""
-
-from __future__ import print_function
-
-
-import os
-import time
-import re
-import lldb
-import lldbsuite.test.lldbutil as lldbutil
-from lldbsuite.test.lldbtest import *
-
-
-class TestExprNoResult(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-# If your test case doesn't stress debug info, the
-# set this to true.  That way it won't be run once for
-# each debug info format.
-NO_DEBUG_INFO_TESTCASE = True
-
-def test_no_result(self):
-"""Run an expression that has no result, check the error."""
-self.build()
-self.main_source_file = lldb.SBFileSpec("main.c")
-self.sample_test()
-
-def setUp(self):
-# Call super's setUp().
-TestBase.setUp(self)
-
-def sample_test(self):
-(target, process, thread, bkpt) = 
lldbutil.run_to_source_breakpoint(self,
-  

[Lldb-commits] [lldb] r372112 - lldb: move a test input to the test Inputs dir

2019-10-04 Thread Krasimir Georgiev via lldb-commits
Author: krasimir
Date: Tue Sep 17 05:23:03 2019
New Revision: 372112

URL: http://llvm.org/viewvc/llvm-project?rev=372112&view=rev
Log:
lldb: move a test input to the test Inputs dir

Summary:
This makes the input file for a new test added in r372060 directly
available in the Inputs subdirectory of the test dir.

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

Added:
lldb/trunk/lit/Commands/Inputs/main.c
Modified:
lldb/trunk/lit/Commands/command-script-import.test

Added: lldb/trunk/lit/Commands/Inputs/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Commands/Inputs/main.c?rev=372112&view=auto
==
--- lldb/trunk/lit/Commands/Inputs/main.c (added)
+++ lldb/trunk/lit/Commands/Inputs/main.c Tue Sep 17 05:23:03 2019
@@ -0,0 +1,2 @@
+int foo() { return 0; }
+int main() { return foo(); }

Modified: lldb/trunk/lit/Commands/command-script-import.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Commands/command-script-import.test?rev=372112&r1=372111&r2=372112&view=diff
==
--- lldb/trunk/lit/Commands/command-script-import.test (original)
+++ lldb/trunk/lit/Commands/command-script-import.test Tue Sep 17 05:23:03 2019
@@ -2,7 +2,7 @@
 # RUN: echo 'run' >> %t.in
 # RUN: echo 'command script import %S/Inputs/frame.py' >> %t.in
 
-# RUN: %clang -g -O0 %S/../Settings/Inputs/main.c -o %t.out
+# RUN: %clang -g -O0 %S/Inputs/main.c -o %t.out
 # RUN: %lldb -b -s %t.in %t.out | FileCheck %s
 
 # CHECK: frame #0


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


[Lldb-commits] [lldb] r360146 - [lldb] Add MacroQualified switch cases for r360109

2019-10-04 Thread Krasimir Georgiev via lldb-commits
Author: krasimir
Date: Tue May  7 06:59:30 2019
New Revision: 360146

URL: http://llvm.org/viewvc/llvm-project?rev=360146&view=rev
Log:
[lldb] Add MacroQualified switch cases for r360109

Summary:
r360109 added a new enum case, causing lldb build to fail with several errors 
like:
lldb/source/Symbol/ClangASTContext.cpp:4342:11: error: enumeration value 
'MacroQualified' not handled in switch [-Werror,-Wswitch]
  switch (qual_type->getTypeClass()) {
  ^
This adds the missing switch cases.
I'm not an lldb maintainer and just used my best judgement that it's probably 
expected that we break in these cases. Feel free to ping / revert / fix this 
change if this behavior is not appropriate.

Reviewers: gribozavr

Reviewed By: gribozavr

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

Modified:
lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=360146&r1=360145&r2=360146&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue May  7 06:59:30 2019
@@ -4469,6 +4469,8 @@ ClangASTContext::GetTypeClass(lldb::opaq
 
   case clang::Type::DependentAddressSpace:
 break;
+  case clang::Type::MacroQualified:
+break;
   }
   // We don't know hot to display this type...
   return lldb::eTypeClassOther;
@@ -5337,6 +5339,8 @@ lldb::Encoding ClangASTContext::GetEncod
 
   case clang::Type::DependentAddressSpace:
 break;
+  case clang::Type::MacroQualified:
+break;
   }
   count = 0;
   return lldb::eEncodingInvalid;
@@ -5504,6 +5508,8 @@ lldb::Format ClangASTContext::GetFormat(
 
   case clang::Type::DependentAddressSpace:
 break;
+  case clang::Type::MacroQualified:
+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] r372221 - [lldb] Fix a test assertion after r372192

2019-10-04 Thread Krasimir Georgiev via lldb-commits
Author: krasimir
Date: Wed Sep 18 05:41:17 2019
New Revision: 372221

URL: http://llvm.org/viewvc/llvm-project?rev=372221&view=rev
Log:
[lldb] Fix a test assertion after r372192

Summary:
The `CHECK: frame:py: None` seems to have been a typo, causing build bot 
failures:

```
# CHECK: frame:py: None

 ^

:1:1: note: scanning from here

(lldb) command source -s 0 
'E:/build_slave/lldb-x64-windows-ninja/build/tools/lldb\lit\lit-lldb-init'

^

:23:1: note: possible intended match here

frame:py: No value

^
```

This update fixes the build bots.

--

Reviewers: bkramer

Reviewed By: bkramer

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

Modified:
lldb/trunk/lit/Commands/command-script-import.test

Modified: lldb/trunk/lit/Commands/command-script-import.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Commands/command-script-import.test?rev=372221&r1=372220&r2=372221&view=diff
==
--- lldb/trunk/lit/Commands/command-script-import.test (original)
+++ lldb/trunk/lit/Commands/command-script-import.test Wed Sep 18 05:41:17 2019
@@ -6,7 +6,7 @@
 # RUN: %lldb -b -s %t.in -o 'script print("script: {}").format(lldb.frame)' 
%t.out | FileCheck %s
 
 # Make sure that we don't have access to lldb.frame from the Python script.
-# CHECK: frame:py: None
+# CHECK: frame:py: No value
 
 # Make sure that we do have access to lldb.frame from the script command.
 # CHECK: script: frame #0


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