Re: [Lldb-commits] [PATCH] D13296: [LLDB] Fix watchpoint ignore feature for architectures with watchpoint_exceptions_received=before

2015-10-30 Thread Mohit Bhakkad via lldb-commits
mohit.bhakkad requested a review of this revision.
mohit.bhakkad added a comment.



> Note, if you end up going with the current patch, isn't quite right, however. 
>  You need to move the check for the watchpoint ignore count up before 
> printing out the old & new values.  An ignored watchpoint shouldn't print 
> anything, it should be as if it never stopped.  Where you have the check, the 
> old & new values will get printed even if the watchpoint is ignored.


Hi @jingham, I re-checked it today, we are not printing anything when we ignore 
a watchpoint.


Repository:
  rL LLVM

http://reviews.llvm.org/D13296



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


[Lldb-commits] [PATCH] D14197: Handle the option and parameter separator in every command.

2015-10-30 Thread Hafiz Abid Qadeer via lldb-commits
abidh created this revision.
abidh added a reviewer: ki.stfu.
abidh added a subscriber: lldb-commits.

As per the following link, the "--" as separator between options and
parameter can come in any command. Currently, it was being handled in
only one command. I have moved into the base so that any command can
have this separator.

https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Input-Syntax.html#GDB_002fMI-Input-Syntax

http://reviews.llvm.org/D14197

Files:
  tools/lldb-mi/MICmdBase.cpp
  tools/lldb-mi/MICmdBase.h
  tools/lldb-mi/MICmdCmdData.cpp
  tools/lldb-mi/MICmdCmdData.h

Index: tools/lldb-mi/MICmdCmdData.h
===
--- tools/lldb-mi/MICmdCmdData.h
+++ tools/lldb-mi/MICmdCmdData.h
@@ -106,7 +106,6 @@
   private:
 const CMIUtilString m_constStrArgAddrStart; // MI spec non mandatory, 
*this command mandatory
 const CMIUtilString m_constStrArgAddrEnd;   // MI spec non mandatory, 
*this command mandatory
-const CMIUtilString m_constStrArgConsume;
 const CMIUtilString m_constStrArgMode;
 CMICmnMIValueList m_miValueList;
 };
Index: tools/lldb-mi/MICmdCmdData.cpp
===
--- tools/lldb-mi/MICmdCmdData.cpp
+++ tools/lldb-mi/MICmdCmdData.cpp
@@ -239,7 +239,6 @@
 CMICmdCmdDataDisassemble::CMICmdCmdDataDisassemble()
 : m_constStrArgAddrStart("s")
 , m_constStrArgAddrEnd("e")
-, m_constStrArgConsume("--")
 , m_constStrArgMode("mode")
 , m_miValueList(true)
 {
@@ -277,7 +276,6 @@
 new CMICmdArgValOptionShort(m_constStrArgAddrStart, true, true, 
CMICmdArgValListBase::eArgValType_StringQuotedNumber, 1));
 m_setCmdArgs.Add(
 new CMICmdArgValOptionShort(m_constStrArgAddrEnd, true, true, 
CMICmdArgValListBase::eArgValType_StringQuotedNumber, 1));
-m_setCmdArgs.Add(new CMICmdArgValConsume(m_constStrArgConsume, true));
 m_setCmdArgs.Add(new CMICmdArgValNumber(m_constStrArgMode, true, true));
 return ParseValidateCmdOptions();
 }
Index: tools/lldb-mi/MICmdBase.h
===
--- tools/lldb-mi/MICmdBase.h
+++ tools/lldb-mi/MICmdBase.h
@@ -98,6 +98,7 @@
 const CMIUtilString m_constStrArgThreadGroup;
 const CMIUtilString m_constStrArgThread;
 const CMIUtilString m_constStrArgFrame;
+const CMIUtilString m_constStrArgConsume;
 
 // These 3 members can be used by the derived classes to make any of
 // "thread", "frame" or "thread-group" mandatory.
Index: tools/lldb-mi/MICmdBase.cpp
===
--- tools/lldb-mi/MICmdBase.cpp
+++ tools/lldb-mi/MICmdBase.cpp
@@ -12,6 +12,7 @@
 #include "MICmnMIValueConst.h"
 #include "MICmnLLDBDebugSessionInfo.h"
 #include "MICmdArgValOptionLong.h"
+#include "MICmdArgValConsume.h"
 
 //++ 

 // Details: CMICmdBase constructor.
@@ -27,6 +28,7 @@
 , m_constStrArgThreadGroup("thread-group")
 , m_constStrArgThread("thread")
 , m_constStrArgFrame("frame")
+, m_constStrArgConsume("--")
 , m_ThreadGrpArgMandatory(false)
 , m_ThreadArgMandatory(false)
 , m_FrameArgMandatory(false)
@@ -97,6 +99,7 @@
 m_setCmdArgs.Add(new CMICmdArgValOptionLong(m_constStrArgThreadGroup, 
m_ThreadGrpArgMandatory, true, CMICmdArgValListBase::eArgValType_ThreadGrp, 1));
 m_setCmdArgs.Add(new CMICmdArgValOptionLong(m_constStrArgThread, 
m_ThreadArgMandatory, true, CMICmdArgValListBase::eArgValType_Number, 1));
 m_setCmdArgs.Add(new CMICmdArgValOptionLong(m_constStrArgFrame, 
m_FrameArgMandatory, true, CMICmdArgValListBase::eArgValType_Number, 1));
+m_setCmdArgs.Add(new CMICmdArgValConsume(m_constStrArgConsume, false));
 }
 
 //++ 



Index: tools/lldb-mi/MICmdCmdData.h
===
--- tools/lldb-mi/MICmdCmdData.h
+++ tools/lldb-mi/MICmdCmdData.h
@@ -106,7 +106,6 @@
   private:
 const CMIUtilString m_constStrArgAddrStart; // MI spec non mandatory, *this command mandatory
 const CMIUtilString m_constStrArgAddrEnd;   // MI spec non mandatory, *this command mandatory
-const CMIUtilString m_constStrArgConsume;
 const CMIUtilString m_constStrArgMode;
 CMICmnMIValueList m_miValueList;
 };
Index: tools/lldb-mi/MICmdCmdData.cpp
===
--- tools/lldb-mi/MICmdCmdData.cpp
+++ tools/lldb-mi/MICmdCmdData.cpp
@@ -239,7 +239,6 @@
 CMICmdCmdDataDisassemble::CMICmdCmdDataDisassemble()
 : m_constStrArgAddrStart("s")
 , m_constStrArgAddrEnd("e")
-, m_constStrArgConsume("--")
 , m_constStrArgMode("mode")
 , m_miValueList(true)
 {
@@ -277,7 +276,6 @@
 new CMICmdArgValOptionShort(m_constStrArgAddrStart, true, true, CMICmdArgValListBase::eArgValType_Stri

Re: [Lldb-commits] [PATCH] D13296: [LLDB] Fix watchpoint ignore feature for architectures with watchpoint_exceptions_received=before

2015-10-30 Thread Mohit Bhakkad via lldb-commits
mohit.bhakkad added a comment.

I forgot about note part, is it okay to add a TODO before ignore count 
condition in source/Target/StopInfo.cpp:

TODO: This condition should be checked in synchronous part of watchpoint code 
(Watchpoint::ShouldStop), so that 
we avoid pulling an event even if watchpoint fails ignore count condition. It 
is moved here temporarily, because for
archs with watchpoint_exceptions_received=before, there is an adjustment code 
in above lines, which takes control 
of inferior to next PC. We have to check ignore count condition after this is 
done, otherwise we will get same watchpoint 
multiple  times untill we pass ignore condition, and we won't be ignoring them 
actually.


Repository:
  rL LLVM

http://reviews.llvm.org/D13296



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


Re: [Lldb-commits] [PATCH] D12877: [LLDB] Switch to assembly view if source is moved

2015-10-30 Thread Mohit Bhakkad via lldb-commits
mohit.bhakkad updated this revision to Diff 38799.
mohit.bhakkad added a comment.

Changes in this revision:

- changed no-source to no-debuginfo and made it default
- now no-source means display assembly if source file is missing, even if 
debug-info is present.


Repository:
  rL LLVM

http://reviews.llvm.org/D12877

Files:
  source/Core/Debugger.cpp
  source/Target/StackFrame.cpp

Index: source/Target/StackFrame.cpp
===
--- source/Target/StackFrame.cpp
+++ source/Target/StackFrame.cpp
@@ -1487,7 +1487,7 @@
 if (show_source)
 {
 ExecutionContext exe_ctx (shared_from_this());
-bool have_source = false;
+bool have_source = false, have_debuginfo = false;
 Debugger::StopDisassemblyType disasm_display = 
Debugger::eStopDisassemblyTypeNever;
 Target *target = exe_ctx.GetTargetPtr();
 if (target)
@@ -1500,26 +1500,35 @@
 GetSymbolContext(eSymbolContextCompUnit | eSymbolContextLineEntry);
 if (m_sc.comp_unit && m_sc.line_entry.IsValid())
 {
-have_source = true;
+have_debuginfo = true;
 if (source_lines_before > 0 || source_lines_after > 0)
 {
-
target->GetSourceManager().DisplaySourceLinesWithLineNumbers 
(m_sc.line_entry.file,
+size_t num_lines = 
target->GetSourceManager().DisplaySourceLinesWithLineNumbers 
(m_sc.line_entry.file,

   m_sc.line_entry.line,

   source_lines_before,

   source_lines_after,

   "->",

   &strm);
+if (num_lines != 0)
+have_source = true;
+// TODO: Give here a one time warning if source file is 
missing.
 }
 }
 switch (disasm_display)
 {
 case Debugger::eStopDisassemblyTypeNever:
 break;
-
+
+case Debugger::eStopDisassemblyTypeNoDebugInfo:
+if (have_debuginfo)
+break;
+// Fall through to next case
+
 case Debugger::eStopDisassemblyTypeNoSource:
 if (have_source)
 break;
 // Fall through to next case
+
 case Debugger::eStopDisassemblyTypeAlways:
 if (target)
 {
Index: source/Core/Debugger.cpp
===
--- source/Core/Debugger.cpp
+++ source/Core/Debugger.cpp
@@ -86,9 +86,10 @@
 OptionEnumValueElement
 g_show_disassembly_enum_values[] =
 {
-{ Debugger::eStopDisassemblyTypeNever,"never", "Never show 
disassembly when displaying a stop context."},
-{ Debugger::eStopDisassemblyTypeNoSource, "no-source", "Show disassembly 
when there is no source information, or the source file is missing when 
displaying a stop context."},
-{ Debugger::eStopDisassemblyTypeAlways,   "always","Always show 
disassembly when displaying a stop context."},
+{ Debugger::eStopDisassemblyTypeNever,  "never","Never 
show disassembly when displaying a stop context."},
+{ Debugger::eStopDisassemblyTypeNoDebugInfo,"no-debuginfo", "Show 
disassembly when there is no debug information."},
+{ Debugger::eStopDisassemblyTypeNoSource,   "no-source","Show 
disassembly when there is no source information, or the source file is missing 
when displaying a stop context."},
+{ Debugger::eStopDisassemblyTypeAlways, "always",   
"Always show disassembly when displaying a stop context."},
 { 0, NULL, NULL }
 };
 
@@ -150,7 +151,7 @@
 {   "prompt",   OptionValue::eTypeString  , true, 
OptionValueString::eOptionEncodeCharacterEscapeSequences, "(lldb) ", NULL, "The 
debugger command line prompt displayed for the user." },
 {   "script-lang",  OptionValue::eTypeEnum, true, 
eScriptLanguagePython, NULL, g_language_enumerators, "The script language to be 
used for evaluating user-written scripts." },
 {   "stop-disassembly-count",   OptionValue::eTypeSInt64  , true, 4, 
NULL, NULL, "The number of disassembly lines to show when displaying a stopped 
context." },
-{   "stop-disassembly-display", OptionValue::eTypeEnum, true, 
Debugger::eStopDisassemblyTypeNoSource, NULL, g_show_disassembly_enum_values, 
"Control when to display disassembly when displaying a stopped context." },
+{   "stop-disassembly-display", OptionValue::eTypeEnum

[Lldb-commits] [PATCH] D14201: Fix race during process detach

2015-10-30 Thread Pavel Labath via lldb-commits
labath created this revision.
labath added reviewers: clayborg, jingham.
labath added a subscriber: lldb-commits.

The code which was preventing the usage of the OS plugin while detach is in
progress also prevented us to update the thread list correctly. This resulted
in an empty thread list, which confused the detaching logic. Change the
condition do only do what it says (disable the usage of the OS plugin).

http://reviews.llvm.org/D14201

Files:
  
packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py
  source/Target/Process.cpp

Index: source/Target/Process.cpp
===
--- source/Target/Process.cpp
+++ source/Target/Process.cpp
@@ -1565,41 +1565,38 @@
 // Don't call into the OperatingSystem to update the thread 
list if we are shutting down, since
 // that may call back into the SBAPI's, requiring the API lock 
which is already held by whoever is
 // shutting us down, causing a deadlock.
-if (!m_destroy_in_process)
+OperatingSystem *os = GetOperatingSystem ();
+if (os && !m_destroy_in_process)
 {
-OperatingSystem *os = GetOperatingSystem ();
-if (os)
-{
-// Clear any old backing threads where memory threads 
might have been
-// backed by actual threads from the 
lldb_private::Process subclass
-size_t num_old_threads = 
old_thread_list.GetSize(false);
-for (size_t i=0; iClearBackingThread();
-
-// Turn off dynamic types to ensure we don't run any 
expressions. Objective C
-// can run an expression to determine if a SBValue is 
a dynamic type or not
-// and we need to avoid this. OperatingSystem plug-ins 
can't run expressions
-// that require running code...
-
-Target &target = GetTarget();
-const lldb::DynamicValueType saved_prefer_dynamic = 
target.GetPreferDynamicValue ();
-if (saved_prefer_dynamic != lldb::eNoDynamicValues)
-
target.SetPreferDynamicValue(lldb::eNoDynamicValues);
-
-// Now let the OperatingSystem plug-in update the 
thread list
-
-os->UpdateThreadList (old_thread_list,  // Old list 
full of threads created by OS plug-in
-  real_thread_list, // The actual 
thread list full of threads created by each lldb_private::Process subclass
-  new_thread_list); // The new 
thread list that we will show to the user that gets filled in
-
-if (saved_prefer_dynamic != lldb::eNoDynamicValues)
-target.SetPreferDynamicValue(saved_prefer_dynamic);
-}
-else
-{
-// No OS plug-in, the new thread list is the same as 
the real thread list
-new_thread_list = real_thread_list;
-}
+// Clear any old backing threads where memory threads 
might have been
+// backed by actual threads from the lldb_private::Process 
subclass
+size_t num_old_threads = old_thread_list.GetSize(false);
+for (size_t i=0; iClearBackingThread();
+
+// Turn off dynamic types to ensure we don't run any 
expressions. Objective C
+// can run an expression to determine if a SBValue is a 
dynamic type or not
+// and we need to avoid this. OperatingSystem plug-ins 
can't run expressions
+// that require running code...
+
+Target &target = GetTarget();
+const lldb::DynamicValueType saved_prefer_dynamic = 
target.GetPreferDynamicValue ();
+if (saved_prefer_dynamic != lldb::eNoDynamicValues)
+target.SetPreferDynamicValue(lldb::eNoDynamicValues);
+
+// Now let the OperatingSystem plug-in update the thread 
list
+
+os->UpdateThreadList (old_thread_list,  // Old list full 
of threads created by OS plug-in
+  real_thread_list, // The actual 
thread list full of threads created by each lldb_private::Process subclass
+  new_thread_list); // The new thread 
list that we will show to the user that gets filled in
+
+if (saved_prefer_dynamic != lldb::eNoDynamicValues)
+target.SetPreferDynamicValue(saved_prefer_dynamic);
+}
+else
+{
+// No OS 

[Lldb-commits] [lldb] r251699 - Mark another TestEvents test as flaky on linux

2015-10-30 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri Oct 30 09:08:19 2015
New Revision: 251699

URL: http://llvm.org/viewvc/llvm-project?rev=251699&view=rev
Log:
Mark another TestEvents test as flaky on linux

I don't think anything has changed recently - the test was always flaky, but
only very rarely. Still, it is causing noise in the buildbots.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py?rev=251699&r1=251698&r2=251699&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
Fri Oct 30 09:08:19 2015
@@ -101,6 +101,7 @@ class EventAPITestCase(TestBase):
 my_thread.join()
 
 @add_test_categories(['pyapi'])
+@expectedFlakeyLinux("llvm.org/pr23730") # Flaky, fails ~1/100 cases
 def test_wait_for_event(self):
 """Exercise SBListener.WaitForEvent() API."""
 self.build()


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


Re: [Lldb-commits] [lldb] r251678 - Some test cases that need the lldbExec path were failing because lldbExec was turning out to be None even though it was being validly set by dotest.py

2015-10-30 Thread Zachary Turner via lldb-commits
I'm also still a little confused why this worked before my patch.  How is
unittest2 importing the individual tests in a way that behaves differently
when dotest is a package (now) versus a standalone script (before)?

On Thu, Oct 29, 2015 at 11:31 PM Zachary Turner  wrote:

> Wow.  That's a weird problem.  Thanks for finding it!
>
> Would it work if we move the definition of the `lldbtest_config` class
> into lldbsuite/test/__init__.py?  This way the configuration should be part
> of the global package state of the lldbsuite.test package, which all the
> tests are already members of the same package, so they wouldn't even need
> to import anything (I think).
>
> On Thu, Oct 29, 2015 at 6:12 PM Enrico Granata via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>> Author: enrico
>> Date: Thu Oct 29 20:09:54 2015
>> New Revision: 251678
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=251678&view=rev
>> Log:
>> Some test cases that need the lldbExec path were failing because lldbExec
>> was turning out to be None even though it was being validly set by dotest.py
>>
>> It turns out that lldbtest_config was being imported locally to
>> "lldbsuite.test" instead of globally, so when the test cases got
>> individually brought by a global import via __import__ by unittest2, they
>> did not see the lldbtest_config import, and ended up importing a new
>> separate copy of it, with lldbExec unset
>>
>> This is a simple hackaround that brings lldbtest_config to global
>> visibility and makes sure the configuration data is correctly shared
>>
>>
>> Modified:
>> lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>>
>> Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=251678&r1=251677&r2=251678&view=diff
>>
>> ==
>> --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
>> +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Oct 29
>> 20:09:54 2015
>> @@ -21,6 +21,10 @@ for available options.
>>  """
>>
>>  from __future__ import print_function
>> +# this module needs to have global visibility, otherwise test cases
>> +# will import it anew in their local namespace, essentially losing access
>> +# to all the configuration data
>> +globals()['lldbtest_config'] = __import__('lldbtest_config')
>>
>>  import use_lldb_suite
>>
>> @@ -42,7 +46,6 @@ import test_results
>>  from test_results import EventBuilder
>>  import inspect
>>  import unittest2
>> -import lldbtest_config
>>  import test_categories
>>
>>  import six
>>
>>
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r251704 - Remove 2 lines missed in earlier commit (r251636).

2015-10-30 Thread Hafiz Abid Qadeer via lldb-commits
Author: abidh
Date: Fri Oct 30 11:20:40 2015
New Revision: 251704

URL: http://llvm.org/viewvc/llvm-project?rev=251704&view=rev
Log:
Remove 2 lines missed in earlier commit (r251636).


Modified:
lldb/trunk/tools/lldb-mi/MICmdCmdStack.cpp

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdStack.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdStack.cpp?rev=251704&r1=251703&r2=251704&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmdCmdStack.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdStack.cpp Fri Oct 30 11:20:40 2015
@@ -297,7 +297,6 @@ CMICmdCmdStackListFrames::~CMICmdCmdStac
 bool
 CMICmdCmdStackListFrames::ParseArgs()
 {
-m_setCmdArgs.Add(new CMICmdArgValOptionLong(m_constStrArgThread, false, 
true, CMICmdArgValListBase::eArgValType_Number, 1));
 m_setCmdArgs.Add(new CMICmdArgValNumber(m_constStrArgFrameLow, false, 
true));
 m_setCmdArgs.Add(new CMICmdArgValNumber(m_constStrArgFrameHigh, false, 
true));
 return ParseValidateCmdOptions();
@@ -477,7 +476,6 @@ CMICmdCmdStackListArguments::~CMICmdCmdS
 bool
 CMICmdCmdStackListArguments::ParseArgs()
 {
-m_setCmdArgs.Add(new CMICmdArgValOptionLong(m_constStrArgThread, false, 
true, CMICmdArgValListBase::eArgValType_Number, 1));
 m_setCmdArgs.Add(new CMICmdArgValPrintValues(m_constStrArgPrintValues, 
true, true));
 m_setCmdArgs.Add(new CMICmdArgValNumber(m_constStrArgFrameLow, false, 
true));
 m_setCmdArgs.Add(new CMICmdArgValNumber(m_constStrArgFrameHigh, false, 
true));


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


Re: [Lldb-commits] [lldb] r251681 - Added real editline tests.

2015-10-30 Thread Todd Fiala via lldb-commits
> What are all these setenv lines for?

libedit requires a TERM to know how to deal with the screen.  We can't talk
to libedit if it can't figure out what kind of terminal it is working with.

> Another option is to use TEST_F instead of TEST(), and then declare a
class with Setup() and TearDown() methods, and do the setenv() in the setup
method.

I am planning on doing that.  I have another few tests I am writing.  I
have a "reduce duplication" XP style phase that will eliminate that.  Good
catch.  I should have done it at my second test.


On Thu, Oct 29, 2015 at 11:26 PM, Zachary Turner  wrote:

>
>
> On Thu, Oct 29, 2015 at 7:57 PM Todd Fiala via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>> Author: tfiala
>> Date: Thu Oct 29 21:54:52 2015
>> New Revision: 251681
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=251681&view=rev
>> Log:
>> Added real editline tests.
>>
>> These are two simple tests that make sure single line and
>> multiline content are processed and received by Editline.cpp.
>>
>> Fancier tests to come...
>>
>> Modified:
>> lldb/trunk/lldb.xcodeproj/project.pbxproj
>> lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-gtest.xcscheme
>> lldb/trunk/source/Host/CMakeLists.txt
>> lldb/trunk/unittests/Editline/EditlineTest.cpp
>>
>> Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=251681&r1=251680&r2=251681&view=diff
>>
>> ==
>> --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
>> +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Oct 29 21:54:52 2015
>> @@ -909,13 +909,6 @@
>>  /* End PBXBuildFile section */
>>
>>  /* Begin PBXContainerItemProxy section */
>> -   2326CF411BDD636100A5CEAC /* PBXContainerItemProxy */ = {
>> -   isa = PBXContainerItemProxy;
>> -   containerPortal = 08FB7793FE84155DC02AAC07 /*
>> Project object */;
>> -   proxyType = 1;
>> -   remoteGlobalIDString = 26680206115FD0ED008E1FE4;
>> -   remoteInfo = LLDB;
>> -   };
>> 235AFBC1199BC70700897A4B /* PBXContainerItemProxy */ = {
>> isa = PBXContainerItemProxy;
>> containerPortal = 08FB7793FE84155DC02AAC07 /*
>> Project object */;
>> @@ -937,6 +930,13 @@
>> remoteGlobalIDString = 456F67721AD46CE9002850C2;
>> remoteInfo = "debugserver-mini";
>> };
>> +   23AB8B6A1BDF513B008BF3B0 /* PBXContainerItemProxy */ = {
>> +   isa = PBXContainerItemProxy;
>> +   containerPortal = 08FB7793FE84155DC02AAC07 /*
>> Project object */;
>> +   proxyType = 1;
>> +   remoteGlobalIDString = 2689FFC913353D7A00698AC0;
>> +   remoteInfo = "lldb-core";
>> +   };
>> 262CFC7111A450CB00946C6C /* PBXContainerItemProxy */ = {
>> isa = PBXContainerItemProxy;
>> containerPortal = 265E9BE1115C2BAA00D0DCCB /*
>> debugserver.xcodeproj */;
>> @@ -5831,7 +5831,7 @@
>> buildRules = (
>> );
>> dependencies = (
>> -   2326CF421BDD636100A5CEAC /*
>> PBXTargetDependency */,
>> +   23AB8B6B1BDF513B008BF3B0 /*
>> PBXTargetDependency */,
>> );
>> name = "lldb-gtest";
>> productName = "lldb-gtest";
>> @@ -6965,11 +6965,6 @@
>>  /* End PBXSourcesBuildPhase section */
>>
>>  /* Begin PBXTargetDependency section */
>> -   2326CF421BDD636100A5CEAC /* PBXTargetDependency */ = {
>> -   isa = PBXTargetDependency;
>> -   target = 26680206115FD0ED008E1FE4 /* LLDB */;
>> -   targetProxy = 2326CF411BDD636100A5CEAC /*
>> PBXContainerItemProxy */;
>> -   };
>> 235AFBC2199BC70700897A4B /* PBXTargetDependency */ = {
>> isa = PBXTargetDependency;
>> target = 26F5C26910F3D9A4009D5894 /* lldb-tool */;
>> @@ -6980,6 +6975,11 @@
>> target = 235AFBB5199BC6AD00897A4B /* Linux */;
>> targetProxy = 235AFBC3199BC70B00897A4B /*
>> PBXContainerItemProxy */;
>> };
>> +   23AB8B6B1BDF513B008BF3B0 /* PBXTargetDependency */ = {
>> +   isa = PBXTargetDependency;
>> +   target = 2689FFC913353D7A00698AC0 /* lldb-core */;
>> +   targetProxy = 23AB8B6A1BDF513B008BF3B0 /*
>> PBXContainerItemProxy */;
>> +   };
>> 262CFC7211A450CB00946C6C /* PBXTargetDependency */ 

Re: [Lldb-commits] [lldb] r251681 - Added real editline tests.

2015-10-30 Thread Todd Fiala via lldb-commits
> Should a unittest really have debug printfs?

Those are behind a define.  edit line is inherently about converting input
to output, and when we layer in auto-tabbing, auto-completion, etc. it is
critical in test development to see how these develop.  Every single touch
of this test is going to involve flipping them on and off, so from a
workflow perspective, having the define (and usually turned off) for the
debug printing way trumps purity of carrying that debug content that is
usually #ifdef'd out.

On Fri, Oct 30, 2015 at 9:40 AM, Todd Fiala  wrote:

> > What are all these setenv lines for?
>
> libedit requires a TERM to know how to deal with the screen.  We can't
> talk to libedit if it can't figure out what kind of terminal it is working
> with.
>
> > Another option is to use TEST_F instead of TEST(), and then declare a
> class with Setup() and TearDown() methods, and do the setenv() in the setup
> method.
>
> I am planning on doing that.  I have another few tests I am writing.  I
> have a "reduce duplication" XP style phase that will eliminate that.  Good
> catch.  I should have done it at my second test.
>
>
> On Thu, Oct 29, 2015 at 11:26 PM, Zachary Turner 
> wrote:
>
>>
>>
>> On Thu, Oct 29, 2015 at 7:57 PM Todd Fiala via lldb-commits <
>> lldb-commits@lists.llvm.org> wrote:
>>
>>> Author: tfiala
>>> Date: Thu Oct 29 21:54:52 2015
>>> New Revision: 251681
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=251681&view=rev
>>> Log:
>>> Added real editline tests.
>>>
>>> These are two simple tests that make sure single line and
>>> multiline content are processed and received by Editline.cpp.
>>>
>>> Fancier tests to come...
>>>
>>> Modified:
>>> lldb/trunk/lldb.xcodeproj/project.pbxproj
>>> lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-gtest.xcscheme
>>> lldb/trunk/source/Host/CMakeLists.txt
>>> lldb/trunk/unittests/Editline/EditlineTest.cpp
>>>
>>> Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=251681&r1=251680&r2=251681&view=diff
>>>
>>> ==
>>> --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
>>> +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Oct 29 21:54:52 2015
>>> @@ -909,13 +909,6 @@
>>>  /* End PBXBuildFile section */
>>>
>>>  /* Begin PBXContainerItemProxy section */
>>> -   2326CF411BDD636100A5CEAC /* PBXContainerItemProxy */ = {
>>> -   isa = PBXContainerItemProxy;
>>> -   containerPortal = 08FB7793FE84155DC02AAC07 /*
>>> Project object */;
>>> -   proxyType = 1;
>>> -   remoteGlobalIDString = 26680206115FD0ED008E1FE4;
>>> -   remoteInfo = LLDB;
>>> -   };
>>> 235AFBC1199BC70700897A4B /* PBXContainerItemProxy */ = {
>>> isa = PBXContainerItemProxy;
>>> containerPortal = 08FB7793FE84155DC02AAC07 /*
>>> Project object */;
>>> @@ -937,6 +930,13 @@
>>> remoteGlobalIDString = 456F67721AD46CE9002850C2;
>>> remoteInfo = "debugserver-mini";
>>> };
>>> +   23AB8B6A1BDF513B008BF3B0 /* PBXContainerItemProxy */ = {
>>> +   isa = PBXContainerItemProxy;
>>> +   containerPortal = 08FB7793FE84155DC02AAC07 /*
>>> Project object */;
>>> +   proxyType = 1;
>>> +   remoteGlobalIDString = 2689FFC913353D7A00698AC0;
>>> +   remoteInfo = "lldb-core";
>>> +   };
>>> 262CFC7111A450CB00946C6C /* PBXContainerItemProxy */ = {
>>> isa = PBXContainerItemProxy;
>>> containerPortal = 265E9BE1115C2BAA00D0DCCB /*
>>> debugserver.xcodeproj */;
>>> @@ -5831,7 +5831,7 @@
>>> buildRules = (
>>> );
>>> dependencies = (
>>> -   2326CF421BDD636100A5CEAC /*
>>> PBXTargetDependency */,
>>> +   23AB8B6B1BDF513B008BF3B0 /*
>>> PBXTargetDependency */,
>>> );
>>> name = "lldb-gtest";
>>> productName = "lldb-gtest";
>>> @@ -6965,11 +6965,6 @@
>>>  /* End PBXSourcesBuildPhase section */
>>>
>>>  /* Begin PBXTargetDependency section */
>>> -   2326CF421BDD636100A5CEAC /* PBXTargetDependency */ = {
>>> -   isa = PBXTargetDependency;
>>> -   target = 26680206115FD0ED008E1FE4 /* LLDB */;
>>> -   targetProxy = 2326CF411BDD636100A5CEAC /*
>>> PBXContainerItemProxy */;
>>> -   };
>>> 235AFBC2199BC70700897A4B /* PBXTargetDependency */ = {
>>> isa = PBXTargetDependency;
>>> 

Re: [Lldb-commits] [lldb] r251681 - Added real editline tests.

2015-10-30 Thread Zachary Turner via lldb-commits
BTW, can you add EditlineTests.cpp to unittests/Editline/CMakeLists.txt?
Currently this unittest only appears to be enabled for the Xcode build (and
it might actually break the CMake build since CMake complains if there is a
cpp file that is not added to a target)

On Fri, Oct 30, 2015 at 9:43 AM Todd Fiala  wrote:

> > Should a unittest really have debug printfs?
>
> Those are behind a define.  edit line is inherently about converting input
> to output, and when we layer in auto-tabbing, auto-completion, etc. it is
> critical in test development to see how these develop.  Every single touch
> of this test is going to involve flipping them on and off, so from a
> workflow perspective, having the define (and usually turned off) for the
> debug printing way trumps purity of carrying that debug content that is
> usually #ifdef'd out.
>
> On Fri, Oct 30, 2015 at 9:40 AM, Todd Fiala  wrote:
>
>> > What are all these setenv lines for?
>>
>> libedit requires a TERM to know how to deal with the screen.  We can't
>> talk to libedit if it can't figure out what kind of terminal it is working
>> with.
>>
>> > Another option is to use TEST_F instead of TEST(), and then declare a
>> class with Setup() and TearDown() methods, and do the setenv() in the setup
>> method.
>>
>> I am planning on doing that.  I have another few tests I am writing.  I
>> have a "reduce duplication" XP style phase that will eliminate that.  Good
>> catch.  I should have done it at my second test.
>>
>>
>> On Thu, Oct 29, 2015 at 11:26 PM, Zachary Turner 
>> wrote:
>>
>>>
>>>
>>> On Thu, Oct 29, 2015 at 7:57 PM Todd Fiala via lldb-commits <
>>> lldb-commits@lists.llvm.org> wrote:
>>>
 Author: tfiala
 Date: Thu Oct 29 21:54:52 2015
 New Revision: 251681

 URL: http://llvm.org/viewvc/llvm-project?rev=251681&view=rev
 Log:
 Added real editline tests.

 These are two simple tests that make sure single line and
 multiline content are processed and received by Editline.cpp.

 Fancier tests to come...

 Modified:
 lldb/trunk/lldb.xcodeproj/project.pbxproj
 lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-gtest.xcscheme
 lldb/trunk/source/Host/CMakeLists.txt
 lldb/trunk/unittests/Editline/EditlineTest.cpp

 Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
 URL:
 http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=251681&r1=251680&r2=251681&view=diff

 ==
 --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
 +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Oct 29 21:54:52 2015
 @@ -909,13 +909,6 @@
  /* End PBXBuildFile section */

  /* Begin PBXContainerItemProxy section */
 -   2326CF411BDD636100A5CEAC /* PBXContainerItemProxy */ = {
 -   isa = PBXContainerItemProxy;
 -   containerPortal = 08FB7793FE84155DC02AAC07 /*
 Project object */;
 -   proxyType = 1;
 -   remoteGlobalIDString = 26680206115FD0ED008E1FE4;
 -   remoteInfo = LLDB;
 -   };
 235AFBC1199BC70700897A4B /* PBXContainerItemProxy */ = {
 isa = PBXContainerItemProxy;
 containerPortal = 08FB7793FE84155DC02AAC07 /*
 Project object */;
 @@ -937,6 +930,13 @@
 remoteGlobalIDString = 456F67721AD46CE9002850C2;
 remoteInfo = "debugserver-mini";
 };
 +   23AB8B6A1BDF513B008BF3B0 /* PBXContainerItemProxy */ = {
 +   isa = PBXContainerItemProxy;
 +   containerPortal = 08FB7793FE84155DC02AAC07 /*
 Project object */;
 +   proxyType = 1;
 +   remoteGlobalIDString = 2689FFC913353D7A00698AC0;
 +   remoteInfo = "lldb-core";
 +   };
 262CFC7111A450CB00946C6C /* PBXContainerItemProxy */ = {
 isa = PBXContainerItemProxy;
 containerPortal = 265E9BE1115C2BAA00D0DCCB /*
 debugserver.xcodeproj */;
 @@ -5831,7 +5831,7 @@
 buildRules = (
 );
 dependencies = (
 -   2326CF421BDD636100A5CEAC /*
 PBXTargetDependency */,
 +   23AB8B6B1BDF513B008BF3B0 /*
 PBXTargetDependency */,
 );
 name = "lldb-gtest";
 productName = "lldb-gtest";
 @@ -6965,11 +6965,6 @@
  /* End PBXSourcesBuildPhase section */

  /* Begin PBXTargetDependency section */
 -   2326CF421BDD63610

Re: [Lldb-commits] [PATCH] D13296: [LLDB] Fix watchpoint ignore feature for architectures with watchpoint_exceptions_received=before

2015-10-30 Thread Jim Ingham via lldb-commits
The substance is fine.  I fixed up the grammar a little, maybe something like:

TODO: This condition should be checked in the synchronous part of the 
watchpoint code (Watchpoint::ShouldStop), so that 
we avoid pulling an event even if the watchpoint fails the ignore count 
condition. It is moved here temporarily, because for
archs with watchpoint_exceptions_received=before, the code in the previous 
lines takes care of moving the inferior to next PC. 
We have to check the ignore count condition after this is done, otherwise we 
will hit same watchpoint 
multiple times until we pass ignore condition, but we won't actually be 
ignoring them.

Jim

> On Oct 30, 2015, at 4:54 AM, Mohit Bhakkad  wrote:
> 
> mohit.bhakkad added a comment.
> 
> I forgot about note part, is it okay to add a TODO before ignore count 
> condition in source/Target/StopInfo.cpp:
> 
> TODO: This condition should be checked in synchronous part of watchpoint code 
> (Watchpoint::ShouldStop), so that 
> we avoid pulling an event even if watchpoint fails ignore count condition. It 
> is moved here temporarily, because for
> archs with watchpoint_exceptions_received=before, there is an adjustment code 
> in above lines, which takes control 
> of inferior to next PC. We have to check ignore count condition after this is 
> done, otherwise we will get same watchpoint 
> multiple  times untill we pass ignore condition, and we won't be ignoring 
> them actually.
> 
> 
> Repository:
>  rL LLVM
> 
> http://reviews.llvm.org/D13296
> 
> 
> 

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


Re: [Lldb-commits] [PATCH] D13296: [LLDB] Fix watchpoint ignore feature for architectures with watchpoint_exceptions_received=before

2015-10-30 Thread Jim Ingham via lldb-commits
jingham added a subscriber: jingham.
jingham added a comment.

The substance is fine.  I fixed up the grammar a little, maybe something like:

TODO: This condition should be checked in the synchronous part of the 
watchpoint code (Watchpoint::ShouldStop), so that 
we avoid pulling an event even if the watchpoint fails the ignore count 
condition. It is moved here temporarily, because for
archs with watchpoint_exceptions_received=before, the code in the previous 
lines takes care of moving the inferior to next PC. 
We have to check the ignore count condition after this is done, otherwise we 
will hit same watchpoint 
multiple times until we pass ignore condition, but we won't actually be 
ignoring them.

Jim


Repository:
  rL LLVM

http://reviews.llvm.org/D13296



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


[Lldb-commits] [lldb] r251716 - Fix Clang-tidy modernize-use-nullptr warnings in source/Breakpoint; other minor fixes.

2015-10-30 Thread Eugene Zelenko via lldb-commits
Author: eugenezelenko
Date: Fri Oct 30 13:50:12 2015
New Revision: 251716

URL: http://llvm.org/viewvc/llvm-project?rev=251716&view=rev
Log:
Fix Clang-tidy modernize-use-nullptr warnings in source/Breakpoint; other minor 
fixes.

Modified:
lldb/trunk/source/Breakpoint/Breakpoint.cpp
lldb/trunk/source/Breakpoint/BreakpointID.cpp
lldb/trunk/source/Breakpoint/BreakpointIDList.cpp
lldb/trunk/source/Breakpoint/BreakpointLocation.cpp
lldb/trunk/source/Breakpoint/BreakpointLocationList.cpp
lldb/trunk/source/Breakpoint/BreakpointOptions.cpp
lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
lldb/trunk/source/Breakpoint/BreakpointSite.cpp
lldb/trunk/source/Breakpoint/StoppointCallbackContext.cpp
lldb/trunk/source/Breakpoint/Watchpoint.cpp
lldb/trunk/source/Breakpoint/WatchpointOptions.cpp

Modified: lldb/trunk/source/Breakpoint/Breakpoint.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/Breakpoint.cpp?rev=251716&r1=251715&r2=251716&view=diff
==
--- lldb/trunk/source/Breakpoint/Breakpoint.cpp (original)
+++ lldb/trunk/source/Breakpoint/Breakpoint.cpp Fri Oct 30 13:50:12 2015
@@ -7,12 +7,12 @@
 //
 
//===--===//
 
-
 // C Includes
 // C++ Includes
 // Other libraries and framework includes
-// Project includes
+#include "llvm/Support/Casting.h"
 
+// Project includes
 #include "lldb/Core/Address.h"
 #include "lldb/Breakpoint/Breakpoint.h"
 #include "lldb/Breakpoint/BreakpointLocation.h"
@@ -31,7 +31,6 @@
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/ThreadSpec.h"
-#include "llvm/Support/Casting.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -83,9 +82,7 @@ Breakpoint::Breakpoint (Target &new_targ
 //--
 // Destructor
 //--
-Breakpoint::~Breakpoint()
-{
-}
+Breakpoint::~Breakpoint() = default;
 
 const lldb::TargetSP
 Breakpoint::GetTargetSP ()
@@ -236,7 +233,7 @@ Breakpoint::SetThreadID (lldb::tid_t thr
 lldb::tid_t
 Breakpoint::GetThreadID () const
 {
-if (m_options.GetThreadSpecNoCreate() == NULL)
+if (m_options.GetThreadSpecNoCreate() == nullptr)
 return LLDB_INVALID_THREAD_ID;
 else
 return m_options.GetThreadSpecNoCreate()->GetTID();
@@ -255,7 +252,7 @@ Breakpoint::SetThreadIndex (uint32_t ind
 uint32_t
 Breakpoint::GetThreadIndex() const
 {
-if (m_options.GetThreadSpecNoCreate() == NULL)
+if (m_options.GetThreadSpecNoCreate() == nullptr)
 return 0;
 else
 return m_options.GetThreadSpecNoCreate()->GetIndex();
@@ -264,7 +261,7 @@ Breakpoint::GetThreadIndex() const
 void
 Breakpoint::SetThreadName (const char *thread_name)
 {
-if (m_options.GetThreadSpec()->GetName() != NULL
+if (m_options.GetThreadSpec()->GetName() != nullptr
 && ::strcmp (m_options.GetThreadSpec()->GetName(), thread_name) == 0)
 return;
 
@@ -275,8 +272,8 @@ Breakpoint::SetThreadName (const char *t
 const char *
 Breakpoint::GetThreadName () const
 {
-if (m_options.GetThreadSpecNoCreate() == NULL)
-return NULL;
+if (m_options.GetThreadSpecNoCreate() == nullptr)
+return nullptr;
 else
 return m_options.GetThreadSpecNoCreate()->GetName();
 }
@@ -284,7 +281,7 @@ Breakpoint::GetThreadName () const
 void 
 Breakpoint::SetQueueName (const char *queue_name)
 {
-if (m_options.GetThreadSpec()->GetQueueName() != NULL
+if (m_options.GetThreadSpec()->GetQueueName() != nullptr
 && ::strcmp (m_options.GetThreadSpec()->GetQueueName(), queue_name) == 
0)
 return;
 
@@ -295,8 +292,8 @@ Breakpoint::SetQueueName (const char *qu
 const char *
 Breakpoint::GetQueueName () const
 {
-if (m_options.GetThreadSpecNoCreate() == NULL)
-return NULL;
+if (m_options.GetThreadSpecNoCreate() == nullptr)
+return nullptr;
 else
 return m_options.GetThreadSpecNoCreate()->GetQueueName();
 }
@@ -456,7 +453,6 @@ Breakpoint::ModulesChanged (ModuleList &
 
 if (!seen)
 new_modules.AppendIfNeeded (module_sp);
-
 }
 
 if (new_modules.GetSize() > 0)
@@ -474,7 +470,7 @@ Breakpoint::ModulesChanged (ModuleList &
 removed_locations_event = new BreakpointEventData 
(eBreakpointEventTypeLocationsRemoved, 

shared_from_this());
 else
-removed_locations_event = NULL;
+removed_locations_event = nullptr;
 
 size_t num_modules = module_list.GetSize();
 for (size_t i = 0; i < num_modules; i++)
@@ -502,7 +498,6 @@ Breakpoint::ModulesChanged (ModuleList &
 }
 if (delete_locat

Re: [Lldb-commits] [lldb] r251678 - Some test cases that need the lldbExec path were failing because lldbExec was turning out to be None even though it was being validly set by dotest.py

2015-10-30 Thread Enrico Granata via lldb-commits

> On Oct 29, 2015, at 11:31 PM, Zachary Turner  wrote:
> 
> Wow.  That's a weird problem.  Thanks for finding it!  
> 
> Would it work if we move the definition of the `lldbtest_config` class into 
> lldbsuite/test/__init__.py?  This way the configuration should be part of the 
> global package state of the lldbsuite.test package, which all the tests are 
> already members of the same package, so they wouldn't even need to import 
> anything (I think).
> 

I think the problem is exactly that we want lldbtest_config to be *global* 
state and not package local state. 
Honestly, I think if we are not content with the fix as it stands, the right 
way would be to change the way unittest2 imports test cases as to use the 
package-level global scope instead of the global global state as it is now.

> On Oct 30, 2015, at 8:32 AM, Zachary Turner  wrote:
> 
> I'm also still a little confused why this worked before my patch.  How is 
> unittest2 importing the individual tests in a way that behaves differently 
> when dotest is a package (now) versus a standalone script (before)?
> 


That is a good question. One to which “because Python” is the only answer I can 
think of. I suspect scripts live at the global scope anyway, so we were just 
getting lucky with those imports making it through correctly.

> On Thu, Oct 29, 2015 at 6:12 PM Enrico Granata via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> Author: enrico
> Date: Thu Oct 29 20:09:54 2015
> New Revision: 251678
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=251678&view=rev 
> 
> Log:
> Some test cases that need the lldbExec path were failing because lldbExec was 
> turning out to be None even though it was being validly set by dotest.py
> 
> It turns out that lldbtest_config was being imported locally to 
> "lldbsuite.test" instead of globally, so when the test cases got individually 
> brought by a global import via __import__ by unittest2, they did not see the 
> lldbtest_config import, and ended up importing a new separate copy of it, 
> with lldbExec unset
> 
> This is a simple hackaround that brings lldbtest_config to global visibility 
> and makes sure the configuration data is correctly shared
> 
> 
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/dotest.py
> 
> Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=251678&r1=251677&r2=251678&view=diff
>  
> 
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Oct 29 20:09:54 
> 2015
> @@ -21,6 +21,10 @@ for available options.
>  """
> 
>  from __future__ import print_function
> +# this module needs to have global visibility, otherwise test cases
> +# will import it anew in their local namespace, essentially losing access
> +# to all the configuration data
> +globals()['lldbtest_config'] = __import__('lldbtest_config')
> 
>  import use_lldb_suite
> 
> @@ -42,7 +46,6 @@ import test_results
>  from test_results import EventBuilder
>  import inspect
>  import unittest2
> -import lldbtest_config
>  import test_categories
> 
>  import six
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org 
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits 
> 


Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


Re: [Lldb-commits] [lldb] r251678 - Some test cases that need the lldbExec path were failing because lldbExec was turning out to be None even though it was being validly set by dotest.py

2015-10-30 Thread Zachary Turner via lldb-commits
Can you give me a command line which will reproduce the original problem?
Because I ran through the entire test suite and nothing failed, so I want
to make sure we're doing the same thing.  I'm still a little confused about
how this happens, but I plan to look into it when I'm back on Monday and
see if I can understand it better to identify a better fix.

On Fri, Oct 30, 2015 at 11:58 AM Enrico Granata  wrote:

> On Oct 29, 2015, at 11:31 PM, Zachary Turner  wrote:
>
> Wow.  That's a weird problem.  Thanks for finding it!
>
> Would it work if we move the definition of the `lldbtest_config` class
> into lldbsuite/test/__init__.py?  This way the configuration should be part
> of the global package state of the lldbsuite.test package, which all the
> tests are already members of the same package, so they wouldn't even need
> to import anything (I think).
>
>
> I think the problem is exactly that we want lldbtest_config to be *global*
> state and not package local state.
> Honestly, I think if we are not content with the fix as it stands, the
> right way would be to change the way unittest2 imports test cases as to use
> the package-level global scope instead of the global global state as it is
> now.
>
> On Oct 30, 2015, at 8:32 AM, Zachary Turner  wrote:
>
> I'm also still a little confused why this worked before my patch.  How is
> unittest2 importing the individual tests in a way that behaves differently
> when dotest is a package (now) versus a standalone script (before)?
>
>
> That is a good question. One to which “because Python” is the only answer
> I can think of. I suspect scripts live at the global scope anyway, so we
> were just getting lucky with those imports making it through correctly.
>
> On Thu, Oct 29, 2015 at 6:12 PM Enrico Granata via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>> Author: enrico
>> Date: Thu Oct 29 20:09:54 2015
>> New Revision: 251678
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=251678&view=rev
>> Log:
>> Some test cases that need the lldbExec path were failing because lldbExec
>> was turning out to be None even though it was being validly set by dotest.py
>>
>> It turns out that lldbtest_config was being imported locally to
>> "lldbsuite.test" instead of globally, so when the test cases got
>> individually brought by a global import via __import__ by unittest2, they
>> did not see the lldbtest_config import, and ended up importing a new
>> separate copy of it, with lldbExec unset
>>
>> This is a simple hackaround that brings lldbtest_config to global
>> visibility and makes sure the configuration data is correctly shared
>>
>>
>> Modified:
>> lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>>
>> Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=251678&r1=251677&r2=251678&view=diff
>>
>> ==
>> --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
>> +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Oct 29
>> 20:09:54 2015
>> @@ -21,6 +21,10 @@ for available options.
>>  """
>>
>>  from __future__ import print_function
>> +# this module needs to have global visibility, otherwise test cases
>> +# will import it anew in their local namespace, essentially losing access
>> +# to all the configuration data
>> +globals()['lldbtest_config'] = __import__('lldbtest_config')
>>
>>  import use_lldb_suite
>>
>> @@ -42,7 +46,6 @@ import test_results
>>  from test_results import EventBuilder
>>  import inspect
>>  import unittest2
>> -import lldbtest_config
>>  import test_categories
>>
>>  import six
>>
>>
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>>
>
>
> Thanks,
> *- Enrico*
> 📩 egranata@.com ☎️ 27683
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14166: Correctly include LLVM_EXTERNAL_CLANG_SOURCE_DIR.

2015-10-30 Thread Stephane Sezer via lldb-commits
sas added a comment.

Thanks for fixing this. Didn't test external LLVM builds.


Repository:
  rL LLVM

http://reviews.llvm.org/D14166



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


Re: [Lldb-commits] [lldb] r251678 - Some test cases that need the lldbExec path were failing because lldbExec was turning out to be None even though it was being validly set by dotest.py

2015-10-30 Thread Enrico Granata via lldb-commits
I think what I was doing is be in lldb/test and do

$ ./dotest.py ../packages/python/lldbsuite/functionalities/completion

> On Oct 30, 2015, at 12:22 PM, Zachary Turner  wrote:
> 
> Can you give me a command line which will reproduce the original problem?  
> Because I ran through the entire test suite and nothing failed, so I want to 
> make sure we're doing the same thing.  I'm still a little confused about how 
> this happens, but I plan to look into it when I'm back on Monday and see if I 
> can understand it better to identify a better fix.
> 
> On Fri, Oct 30, 2015 at 11:58 AM Enrico Granata  > wrote:
>> On Oct 29, 2015, at 11:31 PM, Zachary Turner > > wrote:
>> 
>> Wow.  That's a weird problem.  Thanks for finding it!  
>> 
>> Would it work if we move the definition of the `lldbtest_config` class into 
>> lldbsuite/test/__init__.py?  This way the configuration should be part of 
>> the global package state of the lldbsuite.test package, which all the tests 
>> are already members of the same package, so they wouldn't even need to 
>> import anything (I think).
>> 
> 
> I think the problem is exactly that we want lldbtest_config to be *global* 
> state and not package local state. 
> Honestly, I think if we are not content with the fix as it stands, the right 
> way would be to change the way unittest2 imports test cases as to use the 
> package-level global scope instead of the global global state as it is now.
> 
>> On Oct 30, 2015, at 8:32 AM, Zachary Turner > > wrote:
>> 
>> I'm also still a little confused why this worked before my patch.  How is 
>> unittest2 importing the individual tests in a way that behaves differently 
>> when dotest is a package (now) versus a standalone script (before)?
>> 
> 
> 
> That is a good question. One to which “because Python” is the only answer I 
> can think of. I suspect scripts live at the global scope anyway, so we were 
> just getting lucky with those imports making it through correctly.
> 
>> On Thu, Oct 29, 2015 at 6:12 PM Enrico Granata via lldb-commits 
>> mailto:lldb-commits@lists.llvm.org>> wrote:
>> Author: enrico
>> Date: Thu Oct 29 20:09:54 2015
>> New Revision: 251678
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=251678&view=rev 
>> 
>> Log:
>> Some test cases that need the lldbExec path were failing because lldbExec 
>> was turning out to be None even though it was being validly set by dotest.py
>> 
>> It turns out that lldbtest_config was being imported locally to 
>> "lldbsuite.test" instead of globally, so when the test cases got 
>> individually brought by a global import via __import__ by unittest2, they 
>> did not see the lldbtest_config import, and ended up importing a new 
>> separate copy of it, with lldbExec unset
>> 
>> This is a simple hackaround that brings lldbtest_config to global visibility 
>> and makes sure the configuration data is correctly shared
>> 
>> 
>> Modified:
>> lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>> 
>> Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=251678&r1=251677&r2=251678&view=diff
>>  
>> 
>> ==
>> --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
>> +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Oct 29 20:09:54 
>> 2015
>> @@ -21,6 +21,10 @@ for available options.
>>  """
>> 
>>  from __future__ import print_function
>> +# this module needs to have global visibility, otherwise test cases
>> +# will import it anew in their local namespace, essentially losing access
>> +# to all the configuration data
>> +globals()['lldbtest_config'] = __import__('lldbtest_config')
>> 
>>  import use_lldb_suite
>> 
>> @@ -42,7 +46,6 @@ import test_results
>>  from test_results import EventBuilder
>>  import inspect
>>  import unittest2
>> -import lldbtest_config
>>  import test_categories
>> 
>>  import six
>> 
>> 
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org 
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits 
>> 
> 
> 
> 
> Thanks,
> - Enrico
> 📩 egranata@.com ☎️ 27683
> 


Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


Re: [Lldb-commits] [lldb] r251678 - Some test cases that need the lldbExec path were failing because lldbExec was turning out to be None even though it was being validly set by dotest.py

2015-10-30 Thread Zachary Turner via lldb-commits
Thanks.  I'll follow up next week after I do some investigation

On Fri, Oct 30, 2015 at 1:25 PM Enrico Granata  wrote:

> I think what I was doing is be in lldb/test and do
>
> $ ./dotest.py ../packages/python/lldbsuite/functionalities/completion
>
> On Oct 30, 2015, at 12:22 PM, Zachary Turner  wrote:
>
> Can you give me a command line which will reproduce the original problem?
> Because I ran through the entire test suite and nothing failed, so I want
> to make sure we're doing the same thing.  I'm still a little confused about
> how this happens, but I plan to look into it when I'm back on Monday and
> see if I can understand it better to identify a better fix.
>
> On Fri, Oct 30, 2015 at 11:58 AM Enrico Granata 
> wrote:
>
>> On Oct 29, 2015, at 11:31 PM, Zachary Turner  wrote:
>>
>> Wow.  That's a weird problem.  Thanks for finding it!
>>
>> Would it work if we move the definition of the `lldbtest_config` class
>> into lldbsuite/test/__init__.py?  This way the configuration should be part
>> of the global package state of the lldbsuite.test package, which all the
>> tests are already members of the same package, so they wouldn't even need
>> to import anything (I think).
>>
>>
>> I think the problem is exactly that we want lldbtest_config to be
>> *global* state and not package local state.
>> Honestly, I think if we are not content with the fix as it stands, the
>> right way would be to change the way unittest2 imports test cases as to use
>> the package-level global scope instead of the global global state as it is
>> now.
>>
>> On Oct 30, 2015, at 8:32 AM, Zachary Turner  wrote:
>>
>> I'm also still a little confused why this worked before my patch.  How is
>> unittest2 importing the individual tests in a way that behaves differently
>> when dotest is a package (now) versus a standalone script (before)?
>>
>>
>> That is a good question. One to which “because Python” is the only answer
>> I can think of. I suspect scripts live at the global scope anyway, so we
>> were just getting lucky with those imports making it through correctly.
>>
>> On Thu, Oct 29, 2015 at 6:12 PM Enrico Granata via lldb-commits <
>> lldb-commits@lists.llvm.org> wrote:
>>
>>> Author: enrico
>>> Date: Thu Oct 29 20:09:54 2015
>>> New Revision: 251678
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=251678&view=rev
>>> Log:
>>> Some test cases that need the lldbExec path were failing because
>>> lldbExec was turning out to be None even though it was being validly set by
>>> dotest.py
>>>
>>> It turns out that lldbtest_config was being imported locally to
>>> "lldbsuite.test" instead of globally, so when the test cases got
>>> individually brought by a global import via __import__ by unittest2, they
>>> did not see the lldbtest_config import, and ended up importing a new
>>> separate copy of it, with lldbExec unset
>>>
>>> This is a simple hackaround that brings lldbtest_config to global
>>> visibility and makes sure the configuration data is correctly shared
>>>
>>>
>>> Modified:
>>> lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>>>
>>> Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=251678&r1=251677&r2=251678&view=diff
>>>
>>> ==
>>> --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
>>> +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Oct 29
>>> 20:09:54 2015
>>> @@ -21,6 +21,10 @@ for available options.
>>>  """
>>>
>>>  from __future__ import print_function
>>> +# this module needs to have global visibility, otherwise test cases
>>> +# will import it anew in their local namespace, essentially losing
>>> access
>>> +# to all the configuration data
>>> +globals()['lldbtest_config'] = __import__('lldbtest_config')
>>>
>>>  import use_lldb_suite
>>>
>>> @@ -42,7 +46,6 @@ import test_results
>>>  from test_results import EventBuilder
>>>  import inspect
>>>  import unittest2
>>> -import lldbtest_config
>>>  import test_categories
>>>
>>>  import six
>>>
>>>
>>> ___
>>> lldb-commits mailing list
>>> lldb-commits@lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>>>
>>
>>
>> Thanks,
>> *- Enrico*
>> 📩 egranata@.com ☎️ 27683
>>
>>
>
> Thanks,
> *- Enrico*
> 📩 egranata@.com ☎️ 27683
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r251678 - Some test cases that need the lldbExec path were failing because lldbExec was turning out to be None even though it was being validly set by dotest.py

2015-10-30 Thread Jim Ingham via lldb-commits
Note, the other important step was that you had to have an lldb installed in 
/usr/bin/lldb that FAILED this test.  If you have a more recent lldb there, the 
test will succeed, and you won't notice you aren't testing your newly built 
sources.

Jim

> On Oct 30, 2015, at 1:25 PM, Enrico Granata via lldb-commits 
>  wrote:
> 
> I think what I was doing is be in lldb/test and do
> 
> $ ./dotest.py ../packages/python/lldbsuite/functionalities/completion
> 
>> On Oct 30, 2015, at 12:22 PM, Zachary Turner  wrote:
>> 
>> Can you give me a command line which will reproduce the original problem?  
>> Because I ran through the entire test suite and nothing failed, so I want to 
>> make sure we're doing the same thing.  I'm still a little confused about how 
>> this happens, but I plan to look into it when I'm back on Monday and see if 
>> I can understand it better to identify a better fix.
>> 
>> On Fri, Oct 30, 2015 at 11:58 AM Enrico Granata  wrote:
>>> On Oct 29, 2015, at 11:31 PM, Zachary Turner  wrote:
>>> 
>>> Wow.  That's a weird problem.  Thanks for finding it!  
>>> 
>>> Would it work if we move the definition of the `lldbtest_config` class into 
>>> lldbsuite/test/__init__.py?  This way the configuration should be part of 
>>> the global package state of the lldbsuite.test package, which all the tests 
>>> are already members of the same package, so they wouldn't even need to 
>>> import anything (I think).
>>> 
>> 
>> I think the problem is exactly that we want lldbtest_config to be *global* 
>> state and not package local state. 
>> Honestly, I think if we are not content with the fix as it stands, the right 
>> way would be to change the way unittest2 imports test cases as to use the 
>> package-level global scope instead of the global global state as it is now.
>> 
>>> On Oct 30, 2015, at 8:32 AM, Zachary Turner  wrote:
>>> 
>>> I'm also still a little confused why this worked before my patch.  How is 
>>> unittest2 importing the individual tests in a way that behaves differently 
>>> when dotest is a package (now) versus a standalone script (before)?
>>> 
>> 
>> That is a good question. One to which “because Python” is the only answer I 
>> can think of. I suspect scripts live at the global scope anyway, so we were 
>> just getting lucky with those imports making it through correctly.
>> 
>>> On Thu, Oct 29, 2015 at 6:12 PM Enrico Granata via lldb-commits 
>>>  wrote:
>>> Author: enrico
>>> Date: Thu Oct 29 20:09:54 2015
>>> New Revision: 251678
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=251678&view=rev
>>> Log:
>>> Some test cases that need the lldbExec path were failing because lldbExec 
>>> was turning out to be None even though it was being validly set by dotest.py
>>> 
>>> It turns out that lldbtest_config was being imported locally to 
>>> "lldbsuite.test" instead of globally, so when the test cases got 
>>> individually brought by a global import via __import__ by unittest2, they 
>>> did not see the lldbtest_config import, and ended up importing a new 
>>> separate copy of it, with lldbExec unset
>>> 
>>> This is a simple hackaround that brings lldbtest_config to global 
>>> visibility and makes sure the configuration data is correctly shared
>>> 
>>> 
>>> Modified:
>>> lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>>> 
>>> Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=251678&r1=251677&r2=251678&view=diff
>>> ==
>>> --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
>>> +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Oct 29 20:09:54 
>>> 2015
>>> @@ -21,6 +21,10 @@ for available options.
>>>  """
>>> 
>>>  from __future__ import print_function
>>> +# this module needs to have global visibility, otherwise test cases
>>> +# will import it anew in their local namespace, essentially losing access
>>> +# to all the configuration data
>>> +globals()['lldbtest_config'] = __import__('lldbtest_config')
>>> 
>>>  import use_lldb_suite
>>> 
>>> @@ -42,7 +46,6 @@ import test_results
>>>  from test_results import EventBuilder
>>>  import inspect
>>>  import unittest2
>>> -import lldbtest_config
>>>  import test_categories
>>> 
>>>  import six
>>> 
>>> 
>>> ___
>>> lldb-commits mailing list
>>> lldb-commits@lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>> 
>> 
>> Thanks,
>> - Enrico
>> 📩 egranata@.com ☎️ 27683
>> 
> 
> 
> Thanks,
> - Enrico
> 📩 egranata@.com ☎️ 27683
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

Re: [Lldb-commits] [lldb] r251681 - Added real editline tests.

2015-10-30 Thread Todd Fiala via lldb-commits
It should already be there.  I had a single test in it before (a do-nothing
single test), for maybe 4 or 5 days.

On Fri, Oct 30, 2015 at 9:48 AM, Zachary Turner  wrote:

> BTW, can you add EditlineTests.cpp to unittests/Editline/CMakeLists.txt?
> Currently this unittest only appears to be enabled for the Xcode build (and
> it might actually break the CMake build since CMake complains if there is a
> cpp file that is not added to a target)
>
> On Fri, Oct 30, 2015 at 9:43 AM Todd Fiala  wrote:
>
>> > Should a unittest really have debug printfs?
>>
>> Those are behind a define.  edit line is inherently about converting
>> input to output, and when we layer in auto-tabbing, auto-completion, etc.
>> it is critical in test development to see how these develop.  Every single
>> touch of this test is going to involve flipping them on and off, so from a
>> workflow perspective, having the define (and usually turned off) for the
>> debug printing way trumps purity of carrying that debug content that is
>> usually #ifdef'd out.
>>
>> On Fri, Oct 30, 2015 at 9:40 AM, Todd Fiala  wrote:
>>
>>> > What are all these setenv lines for?
>>>
>>> libedit requires a TERM to know how to deal with the screen.  We can't
>>> talk to libedit if it can't figure out what kind of terminal it is working
>>> with.
>>>
>>> > Another option is to use TEST_F instead of TEST(), and then declare a
>>> class with Setup() and TearDown() methods, and do the setenv() in the setup
>>> method.
>>>
>>> I am planning on doing that.  I have another few tests I am writing.  I
>>> have a "reduce duplication" XP style phase that will eliminate that.  Good
>>> catch.  I should have done it at my second test.
>>>
>>>
>>> On Thu, Oct 29, 2015 at 11:26 PM, Zachary Turner 
>>> wrote:
>>>


 On Thu, Oct 29, 2015 at 7:57 PM Todd Fiala via lldb-commits <
 lldb-commits@lists.llvm.org> wrote:

> Author: tfiala
> Date: Thu Oct 29 21:54:52 2015
> New Revision: 251681
>
> URL: http://llvm.org/viewvc/llvm-project?rev=251681&view=rev
> Log:
> Added real editline tests.
>
> These are two simple tests that make sure single line and
> multiline content are processed and received by Editline.cpp.
>
> Fancier tests to come...
>
> Modified:
> lldb/trunk/lldb.xcodeproj/project.pbxproj
>
> lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-gtest.xcscheme
> lldb/trunk/source/Host/CMakeLists.txt
> lldb/trunk/unittests/Editline/EditlineTest.cpp
>
> Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=251681&r1=251680&r2=251681&view=diff
>
> ==
> --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
> +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Oct 29 21:54:52 2015
> @@ -909,13 +909,6 @@
>  /* End PBXBuildFile section */
>
>  /* Begin PBXContainerItemProxy section */
> -   2326CF411BDD636100A5CEAC /* PBXContainerItemProxy */ =
> {
> -   isa = PBXContainerItemProxy;
> -   containerPortal = 08FB7793FE84155DC02AAC07 /*
> Project object */;
> -   proxyType = 1;
> -   remoteGlobalIDString =
> 26680206115FD0ED008E1FE4;
> -   remoteInfo = LLDB;
> -   };
> 235AFBC1199BC70700897A4B /* PBXContainerItemProxy */ =
> {
> isa = PBXContainerItemProxy;
> containerPortal = 08FB7793FE84155DC02AAC07 /*
> Project object */;
> @@ -937,6 +930,13 @@
> remoteGlobalIDString =
> 456F67721AD46CE9002850C2;
> remoteInfo = "debugserver-mini";
> };
> +   23AB8B6A1BDF513B008BF3B0 /* PBXContainerItemProxy */ =
> {
> +   isa = PBXContainerItemProxy;
> +   containerPortal = 08FB7793FE84155DC02AAC07 /*
> Project object */;
> +   proxyType = 1;
> +   remoteGlobalIDString =
> 2689FFC913353D7A00698AC0;
> +   remoteInfo = "lldb-core";
> +   };
> 262CFC7111A450CB00946C6C /* PBXContainerItemProxy */ =
> {
> isa = PBXContainerItemProxy;
> containerPortal = 265E9BE1115C2BAA00D0DCCB /*
> debugserver.xcodeproj */;
> @@ -5831,7 +5831,7 @@
> buildRules = (
> );
> dependencies = (
> -   2326CF421BDD636100A5CEAC /*
> PBXTargetDependency */,
> +   23AB8B6B1BDF513B008BF3B0 /*
>>>

Re: [Lldb-commits] [PATCH] D14182: Centos 5 compile fixes for lldb

2015-10-30 Thread Mark Chandler via lldb-commits
mchandler-blizzard added inline comments.


Comment at: tools/lldb/source/Host/common/File.cpp:301
@@ -299,1 +300,3 @@
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
 if (options & eOpenOptionCloseOnExec)

krytarowski wrote:
> labath wrote:
> > This needs to evaluate to true on non-linux systems.
> > Would `#ifdef O_CLOEXEC` work for you ?
> NetBSD:
> 
> ```
> /usr/include/fcntl.h:#define  O_CLOEXEC   0x0040  /* set close on 
> exec */
> ```
If that is ok by the coding standards im happy to change it to that


Comment at: tools/lldb/source/Host/linux/HostThreadLinux.cpp:33
@@ -32,3 +32,3 @@
 {
-#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || defined(__ANDROID__)
+#if (defined(__GLIBC__) && defined(_GNU_SOURCE) && __GLIBC__ >= 2 && 
__GLIBC_MINOR__ >= 12) || defined(__ANDROID__)
 ::pthread_setname_np(thread, name.data());

brucem wrote:
> This is probably better done with weak symbols or a check in configure and 
> cmake rather than hard-coding this stuff in the C pre-processor.
> 
If you want to provide code that does that, im happy to change it. 


Comment at: tools/lldb/source/Host/posix/PipePosix.cpp:32
@@ -31,1 +31,3 @@
 
+#include 
+

brucem wrote:
> krytarowski wrote:
> > Is this file just for Linux?
> This file isn't Linux only, so the concerns expressed by Labath are valid 
> here as well.  (The same thing is true of other inclusions of 
> ``.)
I dont have other OS's to build on so not sure. Think @krytarowski comment 
below is the way to go.


Comment at: tools/lldb/source/Host/posix/PipePosix.cpp:254
@@ -251,1 +253,3 @@
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
 if (!child_process_inherit)

krytarowski wrote:
> Stop breaking NetBSD.
:(


Repository:
  rL LLVM

http://reviews.llvm.org/D14182



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


[Lldb-commits] [PATCH] D14182: Centos 5 compile fixes for lldb

2015-10-30 Thread Mark Chandler via lldb-commits
mchandler-blizzard created this revision.
mchandler-blizzard added reviewers: labath, ovyalov.
mchandler-blizzard added a subscriber: lldb-commits.
mchandler-blizzard set the repository for this revision to rL LLVM.
Herald added subscribers: srhines, danalbert, tberghammer.

Adds checks for posix features not present in centos 5

Repository:
  rL LLVM

http://reviews.llvm.org/D14182

Files:
  tools/lldb/include/lldb/Host/linux/Signalfd.h
  tools/lldb/source/Host/common/File.cpp
  tools/lldb/source/Host/linux/HostThreadLinux.cpp
  tools/lldb/source/Host/posix/PipePosix.cpp
  tools/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
  tools/lldb/source/Target/ProcessLaunchInfo.cpp
  tools/lldb/source/Utility/PseudoTerminal.cpp

Index: tools/lldb/source/Utility/PseudoTerminal.cpp
===
--- tools/lldb/source/Utility/PseudoTerminal.cpp
+++ tools/lldb/source/Utility/PseudoTerminal.cpp
@@ -32,6 +32,8 @@
 
 pid_t fork(void) { return 0; }
 pid_t setsid(void) { return 0; }
+
+#include 
 #elif defined(__ANDROID_NDK__)
 #include "lldb/Host/android/Android.h"
 int posix_openpt(int flags);
@@ -242,7 +244,10 @@
 pid_t pid = LLDB_INVALID_PROCESS_ID;
 #if !defined(LLDB_DISABLE_POSIX)
 int flags = O_RDWR;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
 flags |= O_CLOEXEC;
+#endif
 if (OpenFirstAvailableMaster (flags, error_str, error_len))
 {
 // Successfully opened our master pseudo terminal
Index: tools/lldb/source/Target/ProcessLaunchInfo.cpp
===
--- tools/lldb/source/Target/ProcessLaunchInfo.cpp
+++ tools/lldb/source/Target/ProcessLaunchInfo.cpp
@@ -18,6 +18,8 @@
 
 #if !defined(_WIN32)
 #include 
+
+#include 
 #endif
 
 using namespace lldb;
@@ -360,7 +362,7 @@
  __FUNCTION__);
 
 int open_flags = O_RDWR | O_NOCTTY;
-#if !defined(_MSC_VER)
+#if !defined(_MSC_VER) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
 // We really shouldn't be specifying platform specific flags
 // that are intended for a system call in generic code.  But
 // this will have to do for now.
Index: tools/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
===
--- tools/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ tools/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -69,6 +69,36 @@
   #define TRAP_HWBKPT 4
 #endif
 
+// Missing defines due to bug: https://sourceware.org/bugzilla/show_bug.cgi?id=4125
+
+#if !HAVE_DECL_ADDR_NO_RANDOMIZE
+  #define ADDR_NO_RANDOMIZE 0x004
+#endif
+
+#ifndef PTRACE_O_TRACECLONE
+  #define PTRACE_O_TRACECLONE0x0008
+#endif
+
+#ifndef PTRACE_O_TRACEEXEC
+  #define PTRACE_O_TRACEEXEC 0x0010
+#endif
+
+#ifndef PTRACE_O_TRACEEXIT
+  #define PTRACE_O_TRACEEXIT 0x0040
+#endif
+
+#ifndef PTRACE_EVENT_CLONE
+  #define PTRACE_EVENT_CLONE 3
+#endif
+
+#ifndef PTRACE_EVENT_EXEC
+  #define PTRACE_EVENT_EXEC  4
+#endif
+
+#ifndef PTRACE_EVENT_EXIT
+  #define PTRACE_EVENT_EXIT  6
+#endif
+
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::process_linux;
Index: tools/lldb/source/Host/posix/PipePosix.cpp
===
--- tools/lldb/source/Host/posix/PipePosix.cpp
+++ tools/lldb/source/Host/posix/PipePosix.cpp
@@ -29,6 +29,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace lldb;
 using namespace lldb_private;
 
@@ -38,7 +40,7 @@
 
 // pipe2 is supported by a limited set of platforms
 // TODO: Add more platforms that support pipe2.
-#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD__ >= 10) || defined(__NetBSD__)
+#if (defined(__linux__) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) || (defined(__FreeBSD__) && __FreeBSD__ >= 10) || defined(__NetBSD__)
 #define PIPE2_SUPPORTED 1
 #else
 #define PIPE2_SUPPORTED 0
@@ -248,13 +250,25 @@
 return Error("Pipe is already opened");
 
 int flags = O_RDONLY | O_NONBLOCK;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
 if (!child_process_inherit)
 flags |= O_CLOEXEC;
+#endif
 
 Error error;
 int fd = ::open(name.data(), flags);
 if (fd != -1)
+{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+if (!child_process_inherit)
+{
+int oldFlags = fcntl(fd, F_GETFD, 0);
+fcntl(fd, F_SETFD, FD_CLOEXEC|oldFlags);
+}
+#endif
 m_fds[READ] = fd;
+}
 else
 error.SetErrorToErrno();
 
@@ -268,8 +282,11 @@
 return Error("Pipe is already opened");
 
 int flags = O_WRONLY | O_NONBLOCK;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
 if (!child_process_inherit)
 flags |= O_CLOEXEC;
+#endif
 
 using namespace std::chrono;
 const auto finish_time = Now() + ti

Re: [Lldb-commits] [PATCH] D14182: Centos 5 compile fixes for lldb

2015-10-30 Thread Ed Maste via lldb-commits
emaste added a subscriber: emaste.
emaste added a comment.

For future diffs please include additional context (e.g. git diff -U9)


Repository:
  rL LLVM

http://reviews.llvm.org/D14182



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


[Lldb-commits] [lldb] r251720 - Fix an error message (the debugger was invalid, not the target.)

2015-10-30 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Fri Oct 30 16:32:03 2015
New Revision: 251720

URL: http://llvm.org/viewvc/llvm-project?rev=251720&view=rev
Log:
Fix an error message (the debugger was invalid, not the target.)

Modified:
lldb/trunk/source/API/SBDebugger.cpp

Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=251720&r1=251719&r2=251720&view=diff
==
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Fri Oct 30 16:32:03 2015
@@ -638,7 +638,7 @@ SBDebugger::CreateTarget (const char *fi
 }
 else
 {
-sb_error.SetErrorString("invalid target");
+sb_error.SetErrorString("invalid debugger");
 }
 
 Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));


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


[Lldb-commits] [lldb] r251721 - Add a few missing includes.

2015-10-30 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Fri Oct 30 16:32:25 2015
New Revision: 251721

URL: http://llvm.org/viewvc/llvm-project?rev=251721&view=rev
Log:
Add a few missing includes.

Modified:
lldb/trunk/include/lldb/API/LLDB.h

Modified: lldb/trunk/include/lldb/API/LLDB.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/LLDB.h?rev=251721&r1=251720&r2=251721&view=diff
==
--- lldb/trunk/include/lldb/API/LLDB.h (original)
+++ lldb/trunk/include/lldb/API/LLDB.h Fri Oct 30 16:32:25 2015
@@ -29,6 +29,7 @@
 #include "lldb/API/SBDeclaration.h"
 #include "lldb/API/SBError.h"
 #include "lldb/API/SBEvent.h"
+#include "lldb/API/SBExpressionOptions.h"
 #include "lldb/API/SBExecutionContext.h"
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBFrame.h"
@@ -50,6 +51,7 @@
 #include "lldb/API/SBTarget.h"
 #include "lldb/API/SBThread.h"
 #include "lldb/API/SBType.h"
+#include "lldb/API/SBUnixSignals.h"
 #include "lldb/API/SBValue.h"
 #include "lldb/API/SBValueList.h"
 #include "lldb/API/SBVariablesOptions.h"


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


[Lldb-commits] [lldb] r251722 - Make the error return more explicit when an SBValue has no value.

2015-10-30 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Fri Oct 30 16:43:15 2015
New Revision: 251722

URL: http://llvm.org/viewvc/llvm-project?rev=251722&view=rev
Log:
Make the error return more explicit when an SBValue has no value.

Modified:
lldb/trunk/source/API/SBValue.cpp

Modified: lldb/trunk/source/API/SBValue.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=251722&r1=251721&r2=251722&view=diff
==
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Fri Oct 30 16:43:15 2015
@@ -1425,7 +1425,10 @@ lldb::ValueObjectSP
 SBValue::GetSP (ValueLocker &locker) const
 {
 if (!m_opaque_sp || !m_opaque_sp->IsValid())
+{
+locker.GetError().SetErrorString("No value");
 return ValueObjectSP();
+}
 return locker.GetLockedSP(*m_opaque_sp.get());
 }
 


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


[Lldb-commits] [lldb] r251727 - Abstract the notion of the truth value of an expression result, for use

2015-10-30 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Fri Oct 30 19:02:18 2015
New Revision: 251727

URL: http://llvm.org/viewvc/llvm-project?rev=251727&view=rev
Log:
Abstract the notion of the truth value of an expression result, for use
in breakpoint conditions.

Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/source/Breakpoint/BreakpointLocation.cpp
lldb/trunk/source/Core/ValueObject.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=251727&r1=251726&r2=251727&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Fri Oct 30 19:02:18 2015
@@ -605,6 +605,12 @@ public:
 virtual bool
 ResolveValue (Scalar &scalar);
 
+// return 'false' whenever you set the error, otherwise
+// callers may assume true means everything is OK - this will
+// break breakpoint conditions among potentially a few others
+virtual bool
+IsLogicalTrue (Error& error);
+
 virtual const char *
 GetLocationAsCString ();
 

Modified: lldb/trunk/source/Breakpoint/BreakpointLocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointLocation.cpp?rev=251727&r1=251726&r2=251727&view=diff
==
--- lldb/trunk/source/Breakpoint/BreakpointLocation.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointLocation.cpp Fri Oct 30 19:02:18 2015
@@ -356,18 +356,20 @@ BreakpointLocation::ConditionSaysStop (E
 
 if (result_value_sp)
 {
-Scalar scalar_value;
-if (result_value_sp->ResolveValue (scalar_value))
+ret = result_value_sp->IsLogicalTrue(error);
+if (log)
 {
-ret = (scalar_value.ULongLong(1) != 0);
-if (log)
+if (error.Success())
+{
 log->Printf("Condition successfully evaluated, result is 
%s.\n",
 ret ? "true" : "false");
-}
-else
-{
-ret = false;
-error.SetErrorString("Failed to get an integer result from the 
expression");
+}
+else
+{
+error.SetErrorString("Failed to get an integer result from 
the expression");
+ret = false;
+}
+
 }
 }
 else

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=251727&r1=251726&r2=251727&view=diff
==
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Fri Oct 30 19:02:18 2015
@@ -513,6 +513,26 @@ ValueObject::ResolveValue (Scalar &scala
 }
 
 bool
+ValueObject::IsLogicalTrue (Error& error)
+{
+Scalar scalar_value;
+
+if (!ResolveValue (scalar_value))
+{
+error.SetErrorString("failed to get a scalar result");
+return false;
+}
+
+bool ret;
+if (scalar_value.ULongLong(1) == 0)
+ret = false;
+else
+ret = true;
+error.Clear();
+return ret;
+}
+
+bool
 ValueObject::GetValueIsValid () const
 {
 return m_value_is_valid;


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


Re: [Lldb-commits] [lldb] r251727 - Abstract the notion of the truth value of an expression result, for use

2015-10-30 Thread Enrico Granata via lldb-commits

> On Oct 30, 2015, at 5:02 PM, Jim Ingham via lldb-commits 
>  wrote:
> 
> bool
> +ValueObject::IsLogicalTrue (Error& error)
> +{
> +Scalar scalar_value;
> +
> +if (!ResolveValue (scalar_value))
> +{
> +error.SetErrorString("failed to get a scalar result");
> +return false;
> +}
> +
> +bool ret;
> +if (scalar_value.ULongLong(1) == 0)
> +ret = false;
> +else
> +ret = true;
> +error.Clear();
> +return ret;
> +}
> +

Should we be hardcoding the C notion of false == 0 and true == 1?
Could we instead not do something like

bool
ValueObject::IsLogicalTrue()
{
 Language *language = Language::FindPlugin(GetObjectRuntimeLanguage())
if (language)
  return language->IsLogicalTrue(*this);
else
 // we could fall back to your algorithm in that case since we don’t have a 
language plugin for C?
}

Thanks,
- Enrico
📩 egranata@.com ☎️ 27683

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


[Lldb-commits] [lldb] r251730 - Fix Clang-tidy modernize-use-override warnings in include/lldb/Expression, source/Expression and tools/lldb-mi; other minor fixes.

2015-10-30 Thread Eugene Zelenko via lldb-commits
Author: eugenezelenko
Date: Fri Oct 30 19:43:59 2015
New Revision: 251730

URL: http://llvm.org/viewvc/llvm-project?rev=251730&view=rev
Log:
Fix Clang-tidy modernize-use-override warnings in include/lldb/Expression, 
source/Expression and tools/lldb-mi; other minor fixes.

Modified:
lldb/trunk/include/lldb/Expression/REPL.h
lldb/trunk/source/Expression/IRDynamicChecks.cpp
lldb/trunk/source/Expression/REPL.cpp
lldb/trunk/tools/lldb-mi/MICmdArgSet.h
lldb/trunk/tools/lldb-mi/MICmdArgValBase.cpp
lldb/trunk/tools/lldb-mi/MICmdArgValBase.h
lldb/trunk/tools/lldb-mi/MICmdBase.h

Modified: lldb/trunk/include/lldb/Expression/REPL.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/REPL.h?rev=251730&r1=251729&r2=251730&view=diff
==
--- lldb/trunk/include/lldb/Expression/REPL.h (original)
+++ lldb/trunk/include/lldb/Expression/REPL.h Fri Oct 30 19:43:59 2015
@@ -7,10 +7,15 @@
 //
 
//===--===//
 
-
 #ifndef lldb_REPL_h
 #define lldb_REPL_h
 
+// C Includes
+// C++ Includes
+#include 
+
+// Other libraries and framework includes
+// Project includes
 #include "lldb/Interpreter/OptionGroupFormat.h"
 #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
 #include "lldb/../../source/Commands/CommandObjectExpression.h"
@@ -35,7 +40,7 @@ public:
 
 REPL(LLVMCastKind kind, Target &target);
 
-virtual ~REPL();
+~REPL() override;
 
 //--
 /// Get a REPL with an existing target (or, failing that, a debugger to 
use), and (optional) extra arguments for the compiler.
@@ -47,7 +52,7 @@ public:
 /// The language to create a REPL for.
 ///
 /// @param[in] debugger
-/// If provided, and target is NULL, the debugger to use when setting 
up a top-level REPL.
+/// If provided, and target is nullptr, the debugger to use when 
setting up a top-level REPL.
 ///
 /// @param[in] target
 /// If provided, the target to put the REPL inside.
@@ -139,10 +144,6 @@ public:
int max_matches,
StringList &matches) override;
 
-private:
-std::string
-GetSourcePath();
-
 protected:
 static int
 CalculateActualIndentation (const StringList &lines);
@@ -199,8 +200,12 @@ protected:
 Target &m_target;
 lldb::IOHandlerSP m_io_handler_sp;
 LLVMCastKind m_kind;
+
+private:
+std::string
+GetSourcePath();
 };
 
-}
+} // namespace lldb_private
 
-#endif /* REPL_h */
+#endif // lldb_REPL_h

Modified: lldb/trunk/source/Expression/IRDynamicChecks.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRDynamicChecks.cpp?rev=251730&r1=251729&r2=251730&view=diff
==
--- lldb/trunk/source/Expression/IRDynamicChecks.cpp (original)
+++ lldb/trunk/source/Expression/IRDynamicChecks.cpp Fri Oct 30 19:43:59 2015
@@ -1,4 +1,4 @@
-//===-- IRDynamicChecks.cpp ---*- C++ 
-*-===//
+//===-- IRDynamicChecks.cpp -*- C++ 
-*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -7,6 +7,18 @@
 //
 
//===--===//
 
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/DataLayout.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/Module.h"
+#include "llvm/IR/Value.h"
+
+// Project includes
 #include "lldb/Expression/IRDynamicChecks.h"
 
 #include "lldb/Core/ConstString.h"
@@ -18,14 +30,6 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/IR/Constants.h"
-#include "llvm/IR/DataLayout.h"
-#include "llvm/IR/Function.h"
-#include "llvm/IR/Instructions.h"
-#include "llvm/IR/Module.h"
-#include "llvm/IR/Value.h"
-
 using namespace llvm;
 using namespace lldb_private;
 
@@ -41,13 +45,9 @@ static const char g_valid_pointer_check_
 "unsigned char $__lldb_local_val = *$__lldb_arg_ptr;\n"
 "}";
 
-DynamicCheckerFunctions::DynamicCheckerFunctions ()
-{
-}
+DynamicCheckerFunctions::DynamicCheckerFunctions() = default;
 
-DynamicCheckerFunctions::~DynamicCheckerFunctions ()
-{
-}
+DynamicCheckerFunctions::~DynamicCheckerFunctions() = default;
 
 bool
 DynamicCheckerFunctions::Install(Stream &error_stream,
@@ -87,12 +87,12 @@ DynamicCheckerFunctions::DoCheckersExpla
 {
 // FIXME: We have to get the checkers to know why they scotched the call 
in more detail,
 // so we can print a better message here.
-if (m_valid_pointer_check.get() != NULL && 
m_valid_pointer_check->ContainsAddress

[Lldb-commits] [lldb] r251732 - Harden this test case to do the right thing in the face of compiler changes

2015-10-30 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Fri Oct 30 20:19:27 2015
New Revision: 251732

URL: http://llvm.org/viewvc/llvm-project?rev=251732&view=rev
Log:
Harden this test case to do the right thing in the face of compiler changes

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/main.c

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py?rev=251732&r1=251731&r2=251732&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
 Fri Oct 30 20:19:27 2015
@@ -25,6 +25,7 @@ class ConstVariableTestCase(TestBase):
 @expectedFailureAll(oslist=["freebsd", "linux"], compiler="icc")
 @expectedFailureWindows("llvm.org/pr24489: Name lookup not working 
correctly on Windows")
 @expectedFailureWindows("llvm.org/pr24490: We shouldn't be using 
platform-specific names like `getpid` in tests")
+@expectedFailureDarwin
 def test_and_run_command(self):
 """Test interpreted and JITted expressions on constant values."""
 self.build()
@@ -46,6 +47,7 @@ class ConstVariableTestCase(TestBase):
 substrs = [' resolved, hit count = 1'])
 
 self.runCmd("next")
+self.runCmd("next")
 
 # Try frame variable.
 self.expect("frame variable index", VARIABLES_DISPLAYED_CORRECTLY,
@@ -53,10 +55,10 @@ class ConstVariableTestCase(TestBase):
 
 # Try an interpreted expression.
 self.expect("expr (index + 512)", VARIABLES_DISPLAYED_CORRECTLY,
-substrs = ['(int) $0 = 1024'])
+substrs = ['1024'])
 
 # Try a JITted expression.
 self.expect("expr (int)getpid(); (index - 256)", 
VARIABLES_DISPLAYED_CORRECTLY,
-substrs = ['(int) $1 = 256'])
+substrs = ['256'])
 
 self.runCmd("kill")

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/main.c?rev=251732&r1=251731&r2=251732&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/main.c 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/main.c Fri 
Oct 30 20:19:27 2015
@@ -1,4 +1,5 @@
 #include 
+#include 
 
 extern int foo();
 extern int bar();
@@ -13,7 +14,10 @@ int main()
   index = 512;
 
   if (bar())
+  {
+printf("COMPILER PLEASE STOP HERE\n");
 index = 256;
+  }
 
   baaz(index);
 }


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


[Lldb-commits] [lldb] r251733 - Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/API and source/API; other minor fixes.

2015-10-30 Thread Eugene Zelenko via lldb-commits
Author: eugenezelenko
Date: Fri Oct 30 20:22:59 2015
New Revision: 251733

URL: http://llvm.org/viewvc/llvm-project?rev=251733&view=rev
Log:
Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/API and 
source/API; other minor fixes.

Other fixes should reduce number of readability-redundant-smartptr-get and 
readability-implicit-bool-cast.

Modified:
lldb/trunk/include/lldb/API/SBCommandInterpreter.h
lldb/trunk/include/lldb/API/SBCommandReturnObject.h
lldb/trunk/include/lldb/API/SBDebugger.h
lldb/trunk/include/lldb/API/SBTarget.h
lldb/trunk/source/API/SBBreakpoint.cpp
lldb/trunk/source/API/SBCommandInterpreter.cpp
lldb/trunk/source/API/SBCommandReturnObject.cpp
lldb/trunk/source/API/SBDebugger.cpp
lldb/trunk/source/API/SBFrame.cpp

Modified: lldb/trunk/include/lldb/API/SBCommandInterpreter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBCommandInterpreter.h?rev=251733&r1=251732&r2=251733&view=diff
==
--- lldb/trunk/include/lldb/API/SBCommandInterpreter.h (original)
+++ lldb/trunk/include/lldb/API/SBCommandInterpreter.h Fri Oct 30 20:22:59 2015
@@ -10,6 +10,12 @@
 #ifndef LLDB_SBCommandInterpreter_h_
 #define LLDB_SBCommandInterpreter_h_
 
+// C Includes
+// C++ Includes
+#include 
+
+// Other libraries and framework includes
+// Project includes
 #include "lldb/API/SBDefines.h"
 #include "lldb/API/SBDebugger.h"
 
@@ -59,6 +65,7 @@ public:
 
 void
 SetAddToHistory (bool);
+
 private:
 lldb_private::CommandInterpreterRunOptions *
 get () const;
@@ -84,11 +91,11 @@ public:
 
 SBCommandInterpreter (const lldb::SBCommandInterpreter &rhs);
 
+~SBCommandInterpreter ();
+
 const lldb::SBCommandInterpreter &
 operator = (const lldb::SBCommandInterpreter &rhs);
 
-~SBCommandInterpreter ();
-
 static const char * 
 GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type);
 
@@ -187,7 +194,7 @@ public:
 lldb::CommandOverrideCallback callback,
 void *baton);
 
-SBCommandInterpreter (lldb_private::CommandInterpreter *interpreter_ptr = 
NULL);   // Access using SBDebugger::GetCommandInterpreter();
+SBCommandInterpreter(lldb_private::CommandInterpreter *interpreter_ptr = 
nullptr);   // Access using SBDebugger::GetCommandInterpreter();
 
 //--
 /// Return true if the command interpreter is the active IO handler.
@@ -213,7 +220,7 @@ public:
 ///
 /// @return
 /// The string that should be written into the file handle that is
-/// feeding the input stream for the debugger, or NULL if there is
+/// feeding the input stream for the debugger, or nullptr if there is
 /// no string for this control key.
 //--
 const char *
@@ -233,7 +240,6 @@ public:
 ResolveCommand(const char *command_line, SBCommandReturnObject &result);
 
 protected:
-
 lldb_private::CommandInterpreter &
 ref ();
 
@@ -242,6 +248,7 @@ protected:
 
 void
 reset (lldb_private::CommandInterpreter *);
+
 private:
 friend class SBDebugger;
 
@@ -254,6 +261,9 @@ private:
 class SBCommandPluginInterface
 {
 public:
+virtual
+~SBCommandPluginInterface() = default;
+
 virtual bool
 DoExecute (lldb::SBDebugger /*debugger*/,
char** /*command*/,
@@ -261,16 +271,11 @@ public:
 {
 return false;
 }
-
-virtual
-~SBCommandPluginInterface ()
-{}
 };
 
 class SBCommand
 {
 public:
-
 SBCommand ();
 
 bool
@@ -298,13 +303,12 @@ public:
 SetFlags (uint32_t flags);
 
 lldb::SBCommand
-AddMultiwordCommand (const char* name, const char* help = NULL);
+AddMultiwordCommand(const char* name, const char* help = nullptr);
 
 lldb::SBCommand
-AddCommand (const char* name, lldb::SBCommandPluginInterface* impl, const 
char* help = NULL);
+AddCommand(const char* name, lldb::SBCommandPluginInterface* impl, const 
char* help = nullptr);
 
 private:
-
 friend class SBDebugger;
 friend class SBCommandInterpreter;
 

Modified: lldb/trunk/include/lldb/API/SBCommandReturnObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBCommandReturnObject.h?rev=251733&r1=251732&r2=251733&view=diff
==
--- lldb/trunk/include/lldb/API/SBCommandReturnObject.h (original)
+++ lldb/trunk/include/lldb/API/SBCommandReturnObject.h Fri Oct 30 20:22:59 2015
@@ -10,8 +10,14 @@
 #ifndef LLDB_SBCommandReturnObject_h_
 #define LLDB_SBCommandReturnObject_h_
 
+// C Includes
 #include 
 
+// C++ Includes
+#include 
+
+// Other libraries and framework includes
+// Project includes
 #include "l