Re: [Lldb-commits] [PATCH] D24846: [CMake] Generate LLDB_REVISION at build time

2016-09-22 Thread Todd Fiala via lldb-commits
tfiala accepted this revision.
tfiala added a comment.
This revision is now accepted and ready to land.

Looks good.

I think it's fine landing here for now based on your earlier comments about the 
refactoring effort to get it into LLVM/clang.  I do think it's worth trying to 
sink it lower when the time is right to do more of that refactoring, though.

Thanks!


https://reviews.llvm.org/D24846



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


Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef

2016-09-22 Thread Zachary Turner via lldb-commits
zturner updated this revision to Diff 72234.
zturner added a comment.

Updated the two requested functions.  I still had to make a few more changes to 
catch the implicit conversions into each of these functions, but it wasn't too 
bad.


https://reviews.llvm.org/D24847

Files:
  include/lldb/Interpreter/Args.h
  include/lldb/Interpreter/OptionGroupArchitecture.h
  include/lldb/Interpreter/OptionGroupBoolean.h
  include/lldb/Interpreter/OptionGroupFile.h
  include/lldb/Interpreter/OptionGroupFormat.h
  include/lldb/Interpreter/OptionGroupOutputFile.h
  include/lldb/Interpreter/OptionGroupPlatform.h
  include/lldb/Interpreter/OptionGroupString.h
  include/lldb/Interpreter/OptionGroupUInt64.h
  include/lldb/Interpreter/OptionGroupUUID.h
  include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
  include/lldb/Interpreter/OptionGroupVariable.h
  include/lldb/Interpreter/OptionGroupWatchpoint.h
  include/lldb/Interpreter/OptionValue.h
  include/lldb/Interpreter/OptionValueArch.h
  include/lldb/Interpreter/OptionValueArray.h
  include/lldb/Interpreter/OptionValueBoolean.h
  include/lldb/Interpreter/OptionValueChar.h
  include/lldb/Interpreter/OptionValueDictionary.h
  include/lldb/Interpreter/OptionValueEnumeration.h
  include/lldb/Interpreter/OptionValueFileSpec.h
  include/lldb/Interpreter/OptionValueFileSpecList.h
  include/lldb/Interpreter/OptionValueFormat.h
  include/lldb/Interpreter/OptionValueFormatEntity.h
  include/lldb/Interpreter/OptionValueLanguage.h
  include/lldb/Interpreter/OptionValuePathMappings.h
  include/lldb/Interpreter/OptionValueProperties.h
  include/lldb/Interpreter/OptionValueRegex.h
  include/lldb/Interpreter/OptionValueSInt64.h
  include/lldb/Interpreter/OptionValueString.h
  include/lldb/Interpreter/OptionValueUInt64.h
  include/lldb/Interpreter/OptionValueUUID.h
  include/lldb/Interpreter/Options.h
  include/lldb/Target/Language.h
  include/lldb/Target/Platform.h
  source/API/SBLanguageRuntime.cpp
  source/Commands/CommandObjectBreakpoint.cpp
  source/Commands/CommandObjectBreakpointCommand.cpp
  source/Commands/CommandObjectCommands.cpp
  source/Commands/CommandObjectExpression.cpp
  source/Commands/CommandObjectExpression.h
  source/Commands/CommandObjectMemory.cpp
  source/Commands/CommandObjectPlatform.cpp
  source/Commands/CommandObjectRegister.cpp
  source/Commands/CommandObjectTarget.cpp
  source/Commands/CommandObjectThread.cpp
  source/Commands/CommandObjectType.cpp
  source/Commands/CommandObjectWatchpointCommand.cpp
  source/Interpreter/Args.cpp
  source/Interpreter/OptionGroupArchitecture.cpp
  source/Interpreter/OptionGroupBoolean.cpp
  source/Interpreter/OptionGroupFile.cpp
  source/Interpreter/OptionGroupFormat.cpp
  source/Interpreter/OptionGroupOutputFile.cpp
  source/Interpreter/OptionGroupPlatform.cpp
  source/Interpreter/OptionGroupString.cpp
  source/Interpreter/OptionGroupUInt64.cpp
  source/Interpreter/OptionGroupUUID.cpp
  source/Interpreter/OptionGroupValueObjectDisplay.cpp
  source/Interpreter/OptionGroupVariable.cpp
  source/Interpreter/OptionGroupWatchpoint.cpp
  source/Interpreter/OptionValue.cpp
  source/Interpreter/OptionValueChar.cpp
  source/Interpreter/OptionValueDictionary.cpp
  source/Interpreter/OptionValueString.cpp
  source/Interpreter/OptionValueUInt64.cpp
  source/Interpreter/Options.cpp
  source/Interpreter/Property.cpp
  source/Target/Language.cpp
  source/Target/Platform.cpp

Index: source/Target/Platform.cpp
===
--- source/Target/Platform.cpp
+++ source/Target/Platform.cpp
@@ -1401,7 +1401,7 @@
 
 lldb_private::Error
 OptionGroupPlatformRSync::SetOptionValue(uint32_t option_idx,
- const char *option_arg,
+ llvm::StringRef option_arg,
  ExecutionContext *execution_context) {
   Error error;
   char short_option = (char)GetDefinitions()[option_idx].short_option;
@@ -1447,7 +1447,7 @@
 
 lldb_private::Error
 OptionGroupPlatformSSH::SetOptionValue(uint32_t option_idx,
-   const char *option_arg,
+   llvm::StringRef option_arg,
ExecutionContext *execution_context) {
   Error error;
   char short_option = (char)GetDefinitions()[option_idx].short_option;
@@ -1478,7 +1478,7 @@
 }
 
 lldb_private::Error OptionGroupPlatformCaching::SetOptionValue(
-uint32_t option_idx, const char *option_arg,
+uint32_t option_idx, llvm::StringRef option_arg,
 ExecutionContext *execution_context) {
   Error error;
   char short_option = (char)GetDefinitions()[option_idx].short_option;
Index: source/Target/Language.cpp
===
--- source/Target/Language.cpp
+++ source/Target/Language.cpp
@@ -171,10 +171,6 @@
 static uint32_t num_languages =
 sizeof(language_names) / sizeof(struct 

Re: [Lldb-commits] [PATCH] D24853: Fix windows build.It does not like mixed 'enum' and 'enum class'.

2016-09-22 Thread Zachary Turner via lldb-commits
Fixed in r282226, thanks for the tip.

On Thu, Sep 22, 2016 at 5:15 PM Andrew Ford via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> andrewford added a comment.
>
> BTW, I don't have commit access, would appreciate if someone could submit
> for me assuming this is acceptable :)
>
>
> https://reviews.llvm.org/D24853
>
>
>
> ___
> 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] r282226 - Fix windows build caused by mixing enum and enum class.

2016-09-22 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Sep 22 21:54:26 2016
New Revision: 282226

URL: http://llvm.org/viewvc/llvm-project?rev=282226=rev
Log:
Fix windows build caused by mixing enum and enum class.

Modified:
lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h
lldb/trunk/include/lldb/Target/ThreadSpec.h

Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h?rev=282226=282225=282226=diff
==
--- lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h Thu Sep 22 21:54:26 
2016
@@ -368,7 +368,7 @@ protected:
   };
   static const char *g_option_names[(size_t) OptionNames::LastOptionName];
 
-  static const char *GetKey(enum OptionNames enum_value) {
+  static const char *GetKey(OptionNames enum_value) {
 return g_option_names[(size_t) enum_value];
   }
 

Modified: lldb/trunk/include/lldb/Target/ThreadSpec.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadSpec.h?rev=282226=282225=282226=diff
==
--- lldb/trunk/include/lldb/Target/ThreadSpec.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadSpec.h Thu Sep 22 21:54:26 2016
@@ -123,7 +123,7 @@ private:
   };
   static const char *g_option_names[(size_t)OptionNames::LastOptionName];
 
-  static const char *GetKey(enum OptionNames enum_value) {
+  static const char *GetKey(OptionNames enum_value) {
 return g_option_names[(size_t) enum_value];
   }
 


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


Re: [Lldb-commits] [PATCH] D21032: Eliminate differences in lldbinline-generated Makefiles and ensure they're regenerated every time

2016-09-22 Thread Eugene Zelenko via lldb-commits
Eugene.Zelenko added a subscriber: Eugene.Zelenko.
Eugene.Zelenko added a comment.

Appear to be reverted in r272062.


Repository:
  rL LLVM

https://reviews.llvm.org/D21032



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


Re: [Lldb-commits] [PATCH] D21152: Hunt for unused memory properly when dealing with processes that can tell us about memory mappings

2016-09-22 Thread Eugene Zelenko via lldb-commits
Eugene.Zelenko added a subscriber: Eugene.Zelenko.
Eugene.Zelenko added a comment.

Looks like patch was part of r272301.


Repository:
  rL LLVM

https://reviews.llvm.org/D21152



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


Re: [Lldb-commits] [PATCH] D24853: Fix windows build.It does not like mixed 'enum' and 'enum class'.

2016-09-22 Thread Andrew Ford via lldb-commits
andrewford added a comment.

BTW, I don't have commit access, would appreciate if someone could submit for 
me assuming this is acceptable :)


https://reviews.llvm.org/D24853



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


[Lldb-commits] [PATCH] D24853: Fix windows build.It does not like mixed 'enum' and 'enum class'.

2016-09-22 Thread Andrew Ford via lldb-commits
andrewford created this revision.
andrewford added a reviewer: jingham.
andrewford added a subscriber: lldb-commits.

Change-Id: I611460cf4df58073bda64e16847e5358c3361aa7

https://reviews.llvm.org/D24853

Files:
  include/lldb/Breakpoint/BreakpointOptions.h

Index: include/lldb/Breakpoint/BreakpointOptions.h
===
--- include/lldb/Breakpoint/BreakpointOptions.h
+++ include/lldb/Breakpoint/BreakpointOptions.h
@@ -368,7 +368,7 @@
   };
   static const char *g_option_names[(size_t) OptionNames::LastOptionName];
 
-  static const char *GetKey(enum OptionNames enum_value) {
+  static const char *GetKey(OptionNames enum_value) {
 return g_option_names[(size_t) enum_value];
   }
 


Index: include/lldb/Breakpoint/BreakpointOptions.h
===
--- include/lldb/Breakpoint/BreakpointOptions.h
+++ include/lldb/Breakpoint/BreakpointOptions.h
@@ -368,7 +368,7 @@
   };
   static const char *g_option_names[(size_t) OptionNames::LastOptionName];
 
-  static const char *GetKey(enum OptionNames enum_value) {
+  static const char *GetKey(OptionNames enum_value) {
 return g_option_names[(size_t) enum_value];
   }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r282212 - Add the ability to append breakpoints to the save file.

2016-09-22 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Thu Sep 22 18:42:42 2016
New Revision: 282212

URL: http://llvm.org/viewvc/llvm-project?rev=282212=rev
Log:
Add the ability to append breakpoints to the save file.

Modified:
lldb/trunk/include/lldb/API/SBTarget.h
lldb/trunk/include/lldb/Target/Target.h

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
lldb/trunk/scripts/interface/SBTarget.i
lldb/trunk/source/API/SBTarget.cpp
lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=282212=282211=282212=diff
==
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Thu Sep 22 18:42:42 2016
@@ -703,11 +703,17 @@ public:
   /// @param[in] bkpt_list
   ///Only write breakpoints from this list.
   ///
+  /// @param[in] append
+  ///If \btrue, append the breakpoints in bkpt_list to the others
+  ///serialized in dest_file.  If dest_file doesn't exist, then a new
+  ///file will be created and the breakpoints in bkpt_list written to it.
+  ///
   /// @return
   /// An SBError detailing any errors in writing in the breakpoints.
   //--
   lldb::SBError BreakpointsWriteToFile(SBFileSpec _file,
-   SBBreakpointList _list);
+   SBBreakpointList _list,
+   bool append = false);
 
   uint32_t GetNumBreakpoints() const;
 

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=282212=282211=282212=diff
==
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Thu Sep 22 18:42:42 2016
@@ -679,7 +679,7 @@ public:
   bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count);
 
   Error SerializeBreakpointsToFile(const FileSpec ,
-   const BreakpointIDList _ids);
+   const BreakpointIDList _ids, bool 
append);
 
   Error CreateBreakpointsFromFile(const FileSpec ,
   BreakpointIDList _bps);

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py?rev=282212=282211=282212=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
 Thu Sep 22 18:42:42 2016
@@ -37,6 +37,12 @@ class BreakpointSerialization(TestBase):
 self.setup_targets_and_cleanup()
 self.do_check_options()
 
+def test_appending(self):
+"""Use Python APIs to test that we serialize breakpoint options 
correctly."""
+self.build()
+self.setup_targets_and_cleanup()
+self.do_check_appending()
+
 def test_name_filters(self):
 """Use python APIs to test that reading in by name works correctly."""
 self.build()
@@ -70,11 +76,13 @@ class BreakpointSerialization(TestBase):
 self.bkpts_file_path = os.path.join(os.getcwd(), "breakpoints.json")
 self.bkpts_file_spec = lldb.SBFileSpec(self.bkpts_file_path)
 
-def check_equivalence(self, source_bps):
+def check_equivalence(self, source_bps, do_write = True):
 
 error = lldb.SBError()
-error = self.orig_target.BreakpointsWriteToFile(self.bkpts_file_spec, 
source_bps)
-self.assertTrue(error.Success(), "Failed writing breakpoints to file: 
%s."%(error.GetCString()))
+
+if (do_write):
+error = 
self.orig_target.BreakpointsWriteToFile(self.bkpts_file_spec, source_bps)
+self.assertTrue(error.Success(), "Failed writing breakpoints to 
file: %s."%(error.GetCString()))
 
 copy_bps = lldb.SBBreakpointList(self.copy_target)
 error = 
self.copy_target.BreakpointsCreateFromFile(self.bkpts_file_spec, copy_bps)
@@ -205,6 +213,52 @@ class BreakpointSerialization(TestBase):
 
 self.check_equivalence(source_bps)
 
+def do_check_appending(self):
+"""Use Python APIs to check appending to already serialized options."""
+
+empty_module_list = lldb.SBFileSpecList()
+empty_cu_list = lldb.SBFileSpecList()
+blubby_file_spec = 

Re: [Lldb-commits] [PATCH] D24846: [CMake] Generate LLDB_REVISION at build time

2016-09-22 Thread Zachary Turner via lldb-commits
If it's non trivial then then can go in first, that's fine. I'm ooo for the
rest of the day, so let me test it out on Windows first
On Thu, Sep 22, 2016 at 4:36 PM Chris Bieneman  wrote:

> beanz added a comment.
>
> Putting this in LLVM would be ideal, but I think doing that requires a
> larger refactoring of how LLVM and Clang handle SCM versions. I was kinda
> hoping to land this and fix the lldb support, but if you'd prefer I can
> shelve this until after fixing LLVM & Clang.
>
>
> https://reviews.llvm.org/D24846
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D24846: [CMake] Generate LLDB_REVISION at build time

2016-09-22 Thread Chris Bieneman via lldb-commits
beanz added a comment.

Putting this in LLVM would be ideal, but I think doing that requires a larger 
refactoring of how LLVM and Clang handle SCM versions. I was kinda hoping to 
land this and fix the lldb support, but if you'd prefer I can shelve this until 
after fixing LLVM & Clang.


https://reviews.llvm.org/D24846



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


Re: [Lldb-commits] [PATCH] D24850: add hook for calling platform-dependent pre-kill action on a timed out test

2016-09-22 Thread Todd Fiala via lldb-commits
tfiala added a comment.

Greg also had the idea of having a fallback mechanism that uses a newly-spun-up 
lldb to attach to the to-be-killed process, and retrieves the threads and 
backdtraces, to dump out a compact description.  That's nice in that it should 
work on any host that has a working lldb with python support.


https://reviews.llvm.org/D24850



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


Re: [Lldb-commits] [PATCH] D24850: add hook for calling platform-dependent pre-kill action on a timed out test

2016-09-22 Thread Todd Fiala via lldb-commits
tfiala added inline comments.


Comment at: packages/Python/lldbsuite/test/dosep.py:238-245
@@ +237,10 @@
+# runner for our platform.
+module_name = "lldbsuite.pre_kill_hook." + platform.system().lower()
+try:
+import importlib
+module = importlib.import_module(module_name)
+except ImportError:
+# We don't have one for this platform.  Skip.
+sys.stderr.write("\nwarning: no timeout handler module: " + 
module_name)
+return
+

I suspect we will need to tweak this a bit.  We need to be able to dispatch on 
more than just the host platform.system(). It may be sufficient to pass along 
the test platform info as an argument.


https://reviews.llvm.org/D24850



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


[Lldb-commits] [PATCH] D24850: add hook for calling platform-dependent pre-kill action on a timed out test

2016-09-22 Thread Todd Fiala via lldb-commits
tfiala created this revision.
tfiala added reviewers: clayborg, labath.
tfiala added a subscriber: lldb-commits.

This change introduces the concept of a platform-specific, pre-kill-hook 
mechanism.  If a platform defines the hook, then the hook gets called right 
after a timeout is detected in a test run, but before the process is killed.

The pre-kill-hook mechanism works as follows:

* When a timeout is detected in the process_control.ProcessDriver class that 
runs the per-test lldb process, a new overridable on_timeout_pre_kill() method 
is called on the ProcessDriver instance.

* The concurrent test driver's derived ProcessDriver overrides this method.  It 
looks to see if a module called 
"lldbsuite.pre_kill_hook/{platform-system-name}" module exists, where 
platform-system-name is replaced with platform.system().lower():

  * If that module doesn't exist, no further process of the pre-killed process 
occurs.

  * If that module does exist, it is loaded, and the method 
"do_pre_kill(process_id, output_stream)" is called.  If that method throws an 
exception, we log it and we ignore further processing of the pre-killed process.

  * The process_id arg of the do_pre_kill function is the process id as 
returned by the ProcessDriver.pid property.

  * The output_stream arg of the do_pre_kill function takes a file-like object. 
 Output to be collected from doing an processing on the process-to-be-killed 
should be written into the object.  The current impl uses a six.StringIO and 
then writes this output to {TestFilename}-{pid}.sample in the session directory.

Platforms where platform.system() is "Darwin" will get a pre-kill action that 
runs the 'sample' program on the lldb that has timed out.  That data will be 
collected on CI and analyzed to determine what is happening during timeouts.  
(This has an advantage over a core in that it is much smaller and that it 
clearly demonstrates any liveness of the process, if there is any).

I will also hunt around on Linux to see if there might be something akin to 
'sample' that might be available.  If so, it would be nice to hook something up 
for that.

https://reviews.llvm.org/D24850

Files:
  packages/Python/lldbsuite/pre_kill_hook/__init__.py
  packages/Python/lldbsuite/pre_kill_hook/darwin.py
  packages/Python/lldbsuite/pre_kill_hook/tests/__init__.py
  packages/Python/lldbsuite/pre_kill_hook/tests/test_darwin.py
  packages/Python/lldbsuite/test/dosep.py
  packages/Python/lldbsuite/test/test_runner/process_control.py

Index: packages/Python/lldbsuite/test/test_runner/process_control.py
===
--- packages/Python/lldbsuite/test/test_runner/process_control.py
+++ packages/Python/lldbsuite/test/test_runner/process_control.py
@@ -472,6 +472,7 @@
 # be fast.
 self.hard_terminate_timeout = 5.0
 self.returncode = None
+self.command = None
 
 # =
 # Methods for subclasses to override if desired.
@@ -483,6 +484,19 @@
 def on_process_exited(self, command, output, was_timeout, exit_status):
 pass
 
+def on_timeout_pre_kill(self):
+"""Called after the timeout interval elapses but before killing it.
+
+This method is added to enable derived classes the ability to do
+something to the process prior to it being killed.  For example,
+this would be a good spot to run a program that samples the process
+to see what it was doing (or not doing).
+
+Do not attempt to reap the process (i.e. use wait()) in this method.
+That will interfere with the kill mechanism and return code processing.
+"""
+pass
+
 def write(self, content):
 # pylint: disable=no-self-use
 # Intended - we want derived classes to be able to override
@@ -495,6 +509,10 @@
 # ==
 
 def run_command(self, command):
+# Remember the command we were running so we can refer back
+# to it later.
+self.command = command
+
 # Start up the child process and the thread that does the
 # communication pump.
 self._start_process_and_io_thread(command)
@@ -640,6 +658,11 @@
 # Reap the child process here.
 self.returncode = self.process.wait()
 else:
+
+# Allow derived classes to do some work after we detected
+# a timeout but before we touch the timed-out process.
+self.on_timeout_pre_kill()
+
 # Prepare to stop the process
 process_terminated = completed_normally
 terminate_attempt_count = 0
Index: packages/Python/lldbsuite/test/dosep.py
===
--- packages/Python/lldbsuite/test/dosep.py
+++ packages/Python/lldbsuite/test/dosep.py
@@ -46,6 +46,7 @@
 import sys
 import threading
 
+from six import 

Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef

2016-09-22 Thread Zachary Turner via lldb-commits
Ok that's fine then
On Thu, Sep 22, 2016 at 3:59 PM Greg Clayton  wrote:

> clayborg added a comment.
>
> You can still leave the "const char *" versions in there for now until you
> get to the cleanup. No spiral if you do that.
>
>
> https://reviews.llvm.org/D24847
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef

2016-09-22 Thread Greg Clayton via lldb-commits
clayborg added a comment.

You can still leave the "const char *" versions in there for now until you get 
to the cleanup. No spiral if you do that.


https://reviews.llvm.org/D24847



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


Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef

2016-09-22 Thread Zachary Turner via lldb-commits
I took a quick glance, now I remember. It uses a validator, so the
validator has to either update its signature or make a copy. It's also
called by SetValueFromCString, so that has to be updated or make a copy.
Then it spirals out from there.

So yea, the copy is still going to be there, just in a different place
until there's quite a bit more plumbing done
On Thu, Sep 22, 2016 at 3:45 PM Greg Clayton  wrote:

> clayborg added a comment.
>
> no printf fixes are fine. I don't mind if error cases have str().c_str()
> so much.
>
>
> https://reviews.llvm.org/D24847
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef

2016-09-22 Thread Greg Clayton via lldb-commits
clayborg added a comment.

no printf fixes are fine. I don't mind if error cases have str().c_str() so 
much.


https://reviews.llvm.org/D24847



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


Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef

2016-09-22 Thread Greg Clayton via lldb-commits
clayborg added a comment.

Yeah, don't do any calls that don't need to be converted. Just the ones you 
need. Should just add 2 StringRef variant functions. Don't feel the need to 
completely fix OptionValueString or OptionValueUInt64. We can do the full 
change over in a future CL. See if you can just add the two quick ones.


https://reviews.llvm.org/D24847



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


Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef

2016-09-22 Thread Zachary Turner via lldb-commits
I'll try the 2 additional string ref changes first and see how bad it is
On Thu, Sep 22, 2016 at 3:36 PM Zachary Turner  wrote:

> OptionValueString is actually the next item on my list. I tried it before
> this and it was a very big CL, But maybe with this done it will be smaller.
>
> I can try again but if the cl grows too large i think it's better to do it
> in a followup. If nothing else so that if a buildbot fails it's easier to
> track it down with a more modest sized cl.
>
> For the printing stuff, it might be cleaner to just use an llvm stream and
> then pass it to Error::SetErrorString. The %*s macros will look kind of
> gross (for the same reason that the PRIx64 style macros look so horrible).
>
> But all these things combined will make a really big CL, I'd rather do it
> in chunks. Maybe format strings next then OptionValueString?
> On Thu, Sep 22, 2016 at 3:15 PM Greg Clayton  wrote:
>
> clayborg added a comment.
>
> I am not saying we have to do the printf changes, I was just seeing what
> you think. I would like to see the StringRef variants of functions put in
> as part of this.
>
>
> https://reviews.llvm.org/D24847
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef

2016-09-22 Thread Zachary Turner via lldb-commits
OptionValueString is actually the next item on my list. I tried it before
this and it was a very big CL, But maybe with this done it will be smaller.

I can try again but if the cl grows too large i think it's better to do it
in a followup. If nothing else so that if a buildbot fails it's easier to
track it down with a more modest sized cl.

For the printing stuff, it might be cleaner to just use an llvm stream and
then pass it to Error::SetErrorString. The %*s macros will look kind of
gross (for the same reason that the PRIx64 style macros look so horrible).

But all these things combined will make a really big CL, I'd rather do it
in chunks. Maybe format strings next then OptionValueString?
On Thu, Sep 22, 2016 at 3:15 PM Greg Clayton  wrote:

> clayborg added a comment.
>
> I am not saying we have to do the printf changes, I was just seeing what
> you think. I would like to see the StringRef variants of functions put in
> as part of this.
>
>
> https://reviews.llvm.org/D24847
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r282207 - Add the ability to deserialize only breakpoints matching a given name.

2016-09-22 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Thu Sep 22 17:20:28 2016
New Revision: 282207

URL: http://llvm.org/viewvc/llvm-project?rev=282207=rev
Log:
Add the ability to deserialize only breakpoints matching a given name.

Also tests for this and the ThreadSpec serialization.

Modified:
lldb/trunk/include/lldb/API/SBTarget.h
lldb/trunk/include/lldb/Breakpoint/Breakpoint.h
lldb/trunk/include/lldb/Target/Target.h

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
lldb/trunk/scripts/interface/SBTarget.i
lldb/trunk/source/API/SBTarget.cpp
lldb/trunk/source/Breakpoint/Breakpoint.cpp
lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=282207=282206=282207=diff
==
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Thu Sep 22 17:20:28 2016
@@ -646,15 +646,66 @@ public:
 
   lldb::SBBreakpoint BreakpointCreateBySBAddress(SBAddress );
 
-  // Reads in breakpoints from source_file, returning the newly created
-  // breakpoints in new_bps.
+  //--
+  /// Read breakpoints from source_file and return the newly created
+  /// breakpoints in bkpt_list.
+  ///
+  /// @param[in] source_file
+  ///The file from which to read the breakpoints.
+  ///
+  /// @param[out] bkpt_list
+  ///A list of the newly created breakpoints.
+  ///
+  /// @return
+  /// An SBError detailing any errors in reading in the breakpoints.
+  //--
   lldb::SBError BreakpointsCreateFromFile(SBFileSpec _file,
   SBBreakpointList _bps);
 
-  // Writes all breakpoints to dest_file.
+  //--
+  /// Read breakpoints from source_file and return the newly created
+  /// breakpoints in bkpt_list.
+  ///
+  /// @param[in] source_file
+  ///The file from which to read the breakpoints.
+  ///
+  /// @param[in] matching_names
+  ///Only read in breakpoints whose names match one of the names in this
+  ///list.
+  ///
+  /// @param[out] bkpt_list
+  ///A list of the newly created breakpoints.
+  ///
+  /// @return
+  /// An SBError detailing any errors in reading in the breakpoints.
+  //--
+  lldb::SBError BreakpointsCreateFromFile(SBFileSpec _file,
+  SBStringList _names,
+  SBBreakpointList _bps);
+
+  //--
+  /// Write breakpoints to dest_file.
+  ///
+  /// @param[in] dest_file
+  ///The file to which to write the breakpoints.
+  ///
+  /// @return
+  /// An SBError detailing any errors in writing in the breakpoints.
+  //--
   lldb::SBError BreakpointsWriteToFile(SBFileSpec _file);
 
-  // Writes the breakpoints in bkpt_list to dest_file
+  //--
+  /// Write breakpoints listed in bkpt_list to dest_file.
+  ///
+  /// @param[in] dest_file
+  ///The file to which to write the breakpoints.
+  ///
+  /// @param[in] bkpt_list
+  ///Only write breakpoints from this list.
+  ///
+  /// @return
+  /// An SBError detailing any errors in writing in the breakpoints.
+  //--
   lldb::SBError BreakpointsWriteToFile(SBFileSpec _file,
SBBreakpointList _list);
 

Modified: lldb/trunk/include/lldb/Breakpoint/Breakpoint.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/Breakpoint.h?rev=282207=282206=282207=diff
==
--- lldb/trunk/include/lldb/Breakpoint/Breakpoint.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/Breakpoint.h Thu Sep 22 17:20:28 2016
@@ -180,6 +180,10 @@ public:
   static lldb::BreakpointSP CreateFromStructuredData(
   Target , StructuredData::ObjectSP _object_sp, Error );
 
+  static bool
+  SerializedBreakpointMatchesNames(StructuredData::ObjectSP _object_sp,
+   std::vector );
+
   virtual StructuredData::ObjectSP SerializeToStructuredData();
 
   static const char *GetSerializationKey() { return "Breakpoint"; }

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=282207=282206=282207=diff

Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef

2016-09-22 Thread Greg Clayton via lldb-commits
clayborg added a comment.

I am not saying we have to do the printf changes, I was just seeing what you 
think. I would like to see the StringRef variants of functions put in as part 
of this.


https://reviews.llvm.org/D24847



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


Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef

2016-09-22 Thread Greg Clayton via lldb-commits
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

We could avoid many of the copies in the printf statements by by doing 
something like this in a common header file:

  #define LLVM_STRINGREF_PRINTF_FORMAT "%*s"
  #define LLVM_STRINGREF_PRINTF_ARGS(s) (int)s.size(), s.data()

Then when doing errors or anything that does printf:

  error.SetErrorStringWithFormat("invalid all-threads value setting: \"" 
LLVM_STRINGREF_PRINTF_FORMAT "\"", LLVM_STRINGREF_PRINTF_ARGS(option_arg));

There are a few places where we should plumb through StringRef variants of 
calls, only 2, so I think it is worth including in this change.



Comment at: source/Commands/CommandObjectRegister.cpp:269
@@ -268,3 +268,3 @@
   case 's': {
-OptionValueSP value_sp(OptionValueUInt64::Create(option_value, error));
+OptionValueSP 
value_sp(OptionValueUInt64::Create(option_value.str().c_str(), error));
 if (value_sp)

Add a StringRef variant as inside of OptionValueUInt64 it can use the 
StringRef::getAsInteger().


Comment at: source/Interpreter/OptionGroupVariable.cpp:104
@@ -103,3 +103,3 @@
   case 'y':
-error = summary.SetCurrentValue(option_arg);
+error = summary.SetCurrentValue(option_arg.str().c_str());
 break;

Please add llvm::StringRef version of SetCurrentValue to OptionValueString:

```
Error
OptionValueString::SetCurrentValue(const llvm::StringRef );
```



Comment at: source/Interpreter/OptionGroupVariable.cpp:107
@@ -106,3 +106,3 @@
   case 'z':
-error = summary_string.SetCurrentValue(option_arg);
+error = summary_string.SetCurrentValue(option_arg.str().c_str());
 break;

Please add llvm::StringRef version of SetCurrentValue to OptionValueString:



https://reviews.llvm.org/D24847



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


[Lldb-commits] [lldb] r282205 - Serilize the thread options within the breakpoint options.

2016-09-22 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Thu Sep 22 17:00:59 2016
New Revision: 282205

URL: http://llvm.org/viewvc/llvm-project?rev=282205=rev
Log:
Serilize the thread options within the breakpoint options.

Modified:
lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h
lldb/trunk/include/lldb/Target/ThreadSpec.h
lldb/trunk/source/Breakpoint/BreakpointOptions.cpp
lldb/trunk/source/Target/ThreadSpec.cpp

Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h?rev=282205=282204=282205=diff
==
--- lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h Thu Sep 22 17:00:59 
2016
@@ -359,22 +359,24 @@ protected:
   //--
   // Classes that inherit from BreakpointOptions can see and modify these
   //--
-  enum OptionNames {
+  enum class OptionNames {
 ConditionText = 0,
 IgnoreCount,
 EnabledState,
 OneShotState,
 LastOptionName
   };
-  static const char *g_option_names[LastOptionName];
+  static const char *g_option_names[(size_t) OptionNames::LastOptionName];
 
   static const char *GetKey(enum OptionNames enum_value) {
-return g_option_names[enum_value];
+return g_option_names[(size_t) enum_value];
   }
 
   static bool BreakpointOptionsCallbackFunction(
   void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id,
   lldb::user_id_t break_loc_id);
+  
+  void SetThreadSpec(std::unique_ptr _spec_up);
 
 private:
   //--

Modified: lldb/trunk/include/lldb/Target/ThreadSpec.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadSpec.h?rev=282205=282204=282205=diff
==
--- lldb/trunk/include/lldb/Target/ThreadSpec.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadSpec.h Thu Sep 22 17:00:59 2016
@@ -43,6 +43,14 @@ public:
 
   const ThreadSpec =(const ThreadSpec );
 
+  static std::unique_ptr
+  CreateFromStructuredData(const StructuredData::Dictionary _dict,
+   Error );
+
+  StructuredData::ObjectSP SerializeToStructuredData();
+
+  static const char *GetSerializationKey() { return "ThreadSpec"; }
+
   void SetIndex(uint32_t index) { m_index = index; }
 
   void SetTID(lldb::tid_t tid) { m_tid = tid; }
@@ -106,6 +114,19 @@ public:
   void GetDescription(Stream *s, lldb::DescriptionLevel level) const;
 
 private:
+  enum class OptionNames {
+ThreadIndex = 0,
+ThreadID,
+ThreadName,
+QueueName,
+LastOptionName
+  };
+  static const char *g_option_names[(size_t)OptionNames::LastOptionName];
+
+  static const char *GetKey(enum OptionNames enum_value) {
+return g_option_names[(size_t) enum_value];
+  }
+
   uint32_t m_index;
   lldb::tid_t m_tid;
   std::string m_name;

Modified: lldb/trunk/source/Breakpoint/BreakpointOptions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointOptions.cpp?rev=282205=282204=282205=diff
==
--- lldb/trunk/source/Breakpoint/BreakpointOptions.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointOptions.cpp Thu Sep 22 17:00:59 2016
@@ -101,9 +101,9 @@ BreakpointOptions::CommandData::CreateFr
 return std::unique_ptr();
 }
 
-const char *BreakpointOptions::g_option_names
-[BreakpointOptions::OptionNames::LastOptionName]{
-"ConditionText", "IgnoreCount", "EnabledState", "OneShotState"};
+const char *BreakpointOptions::g_option_names[(
+size_t)BreakpointOptions::OptionNames::LastOptionName]{
+"ConditionText", "IgnoreCount", "EnabledState", "OneShotState"};
 
 bool BreakpointOptions::NullCallback(void *baton,
  StoppointCallbackContext *context,
@@ -232,6 +232,23 @@ std::unique_ptr Break
   condition_text.c_str(), enabled, ignore_count, one_shot);
   if (cmd_data_up.get())
 bp_options->SetCommandDataCallback(cmd_data_up);
+
+  StructuredData::Dictionary *thread_spec_dict;
+  success = options_dict.GetValueForKeyAsDictionary(
+  ThreadSpec::GetSerializationKey(), thread_spec_dict);
+  if (success) {
+Error thread_spec_error;
+std::unique_ptr thread_spec_up =
+ThreadSpec::CreateFromStructuredData(*thread_spec_dict,
+ thread_spec_error);
+if (thread_spec_error.Fail()) {
+  error.SetErrorStringWithFormat(
+  "Failed to deserialize breakpoint thread spec options: %s.",
+  thread_spec_error.AsCString());
+  return nullptr;
+}
+bp_options->SetThreadSpec(thread_spec_up);
+  }
   

Re: [Lldb-commits] [PATCH] D24846: [CMake] Generate LLDB_REVISION at build time

2016-09-22 Thread Zachary Turner via lldb-commits
zturner added a comment.

Should this be sunk into a common llvm function instead of copying from clang?  
I don't have a strong opinion, but are you one of the main CMake maintainers in 
LLVM, so whatever you think is best.


https://reviews.llvm.org/D24846



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


[Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef

2016-09-22 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added a reviewer: clayborg.
zturner added a subscriber: lldb-commits.

As before, some copies are removed, a few are introduced.  When I get to 
Option::SetValue, those that are introduced should go away.

https://reviews.llvm.org/D24847

Files:
  include/lldb/Interpreter/Args.h
  include/lldb/Interpreter/OptionGroupArchitecture.h
  include/lldb/Interpreter/OptionGroupBoolean.h
  include/lldb/Interpreter/OptionGroupFile.h
  include/lldb/Interpreter/OptionGroupFormat.h
  include/lldb/Interpreter/OptionGroupOutputFile.h
  include/lldb/Interpreter/OptionGroupPlatform.h
  include/lldb/Interpreter/OptionGroupString.h
  include/lldb/Interpreter/OptionGroupUInt64.h
  include/lldb/Interpreter/OptionGroupUUID.h
  include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
  include/lldb/Interpreter/OptionGroupVariable.h
  include/lldb/Interpreter/OptionGroupWatchpoint.h
  include/lldb/Interpreter/OptionValue.h
  include/lldb/Interpreter/OptionValueArch.h
  include/lldb/Interpreter/OptionValueArray.h
  include/lldb/Interpreter/OptionValueBoolean.h
  include/lldb/Interpreter/OptionValueChar.h
  include/lldb/Interpreter/OptionValueDictionary.h
  include/lldb/Interpreter/OptionValueEnumeration.h
  include/lldb/Interpreter/OptionValueFileSpec.h
  include/lldb/Interpreter/OptionValueFileSpecList.h
  include/lldb/Interpreter/OptionValueFormat.h
  include/lldb/Interpreter/OptionValueFormatEntity.h
  include/lldb/Interpreter/OptionValueLanguage.h
  include/lldb/Interpreter/OptionValuePathMappings.h
  include/lldb/Interpreter/OptionValueProperties.h
  include/lldb/Interpreter/OptionValueRegex.h
  include/lldb/Interpreter/OptionValueSInt64.h
  include/lldb/Interpreter/OptionValueString.h
  include/lldb/Interpreter/OptionValueUInt64.h
  include/lldb/Interpreter/OptionValueUUID.h
  include/lldb/Interpreter/Options.h
  include/lldb/Target/Language.h
  include/lldb/Target/Platform.h
  source/API/SBLanguageRuntime.cpp
  source/Commands/CommandObjectBreakpoint.cpp
  source/Commands/CommandObjectBreakpointCommand.cpp
  source/Commands/CommandObjectCommands.cpp
  source/Commands/CommandObjectExpression.cpp
  source/Commands/CommandObjectExpression.h
  source/Commands/CommandObjectMemory.cpp
  source/Commands/CommandObjectPlatform.cpp
  source/Commands/CommandObjectRegister.cpp
  source/Commands/CommandObjectTarget.cpp
  source/Commands/CommandObjectThread.cpp
  source/Commands/CommandObjectType.cpp
  source/Commands/CommandObjectWatchpointCommand.cpp
  source/Interpreter/Args.cpp
  source/Interpreter/OptionGroupArchitecture.cpp
  source/Interpreter/OptionGroupBoolean.cpp
  source/Interpreter/OptionGroupFile.cpp
  source/Interpreter/OptionGroupFormat.cpp
  source/Interpreter/OptionGroupOutputFile.cpp
  source/Interpreter/OptionGroupPlatform.cpp
  source/Interpreter/OptionGroupString.cpp
  source/Interpreter/OptionGroupUInt64.cpp
  source/Interpreter/OptionGroupUUID.cpp
  source/Interpreter/OptionGroupValueObjectDisplay.cpp
  source/Interpreter/OptionGroupVariable.cpp
  source/Interpreter/OptionGroupWatchpoint.cpp
  source/Interpreter/OptionValue.cpp
  source/Interpreter/OptionValueChar.cpp
  source/Interpreter/OptionValueDictionary.cpp
  source/Interpreter/OptionValueUInt64.cpp
  source/Interpreter/Options.cpp
  source/Interpreter/Property.cpp
  source/Target/Language.cpp
  source/Target/Platform.cpp

Index: source/Target/Platform.cpp
===
--- source/Target/Platform.cpp
+++ source/Target/Platform.cpp
@@ -1401,7 +1401,7 @@
 
 lldb_private::Error
 OptionGroupPlatformRSync::SetOptionValue(uint32_t option_idx,
- const char *option_arg,
+ llvm::StringRef option_arg,
  ExecutionContext *execution_context) {
   Error error;
   char short_option = (char)GetDefinitions()[option_idx].short_option;
@@ -1447,7 +1447,7 @@
 
 lldb_private::Error
 OptionGroupPlatformSSH::SetOptionValue(uint32_t option_idx,
-   const char *option_arg,
+  llvm::StringRef option_arg,
ExecutionContext *execution_context) {
   Error error;
   char short_option = (char)GetDefinitions()[option_idx].short_option;
@@ -1478,7 +1478,7 @@
 }
 
 lldb_private::Error OptionGroupPlatformCaching::SetOptionValue(
-uint32_t option_idx, const char *option_arg,
+uint32_t option_idx, llvm::StringRef option_arg,
 ExecutionContext *execution_context) {
   Error error;
   char short_option = (char)GetDefinitions()[option_idx].short_option;
Index: source/Target/Language.cpp
===
--- source/Target/Language.cpp
+++ source/Target/Language.cpp
@@ -171,10 +171,6 @@
 static uint32_t num_languages =
 sizeof(language_names) / sizeof(struct language_name_pair);
 
-LanguageType Language::GetLanguageTypeFromString(const char *s) {
-  

[Lldb-commits] [PATCH] D24846: [CMake] Generate LLDB_REVISION at build time

2016-09-22 Thread Chris Bieneman via lldb-commits
beanz created this revision.
beanz added reviewers: tfiala, zturner.
beanz added a subscriber: lldb-commits.
Herald added subscribers: mgorny, beanz.

This alters the generation of LLDB_REVISION to be heavily based on how clang 
generates its version header. There are two benefits of this aproach.

(1) The LLDB_REVISION is generated at build time, so it will be updated after 
an SCM pull/update even if CMake doesn't re-run
(2) This works on Windows

As noted this code is a simplified implementation of the code from clang.

https://reviews.llvm.org/D24846

Files:
  source/CMakeLists.txt
  source/lldb.cpp

Index: source/lldb.cpp
===
--- source/lldb.cpp
+++ source/lldb.cpp
@@ -18,6 +18,10 @@
 
 #include "clang/Basic/Version.h"
 
+#ifdef HAVE_SVN_VERSION_INC
+#  include "SVNVersion.inc"
+#endif
+
 static const char *GetLLDBRevision() {
 #ifdef LLDB_REVISION
   return LLDB_REVISION;
Index: source/CMakeLists.txt
===
--- source/CMakeLists.txt
+++ source/CMakeLists.txt
@@ -40,6 +40,41 @@
 DEPENDS ${LLDB_VERS_GENERATED_FILE})
 endif()
 
+foreach(file
+"${LLDB_SOURCE_DIR}/.git/logs/HEAD" # Git
+"${LLDB_SOURCE_DIR}/.svn/wc.db" # SVN 1.7
+"${LLDB_SOURCE_DIR}/.svn/entries"   # SVN 1.6
+)
+  if(EXISTS "${file}")
+set(lldb_vc "${file}")
+break()
+  endif()
+endforeach()
+
+if(DEFINED lldb_vc)
+  set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc")
+  set(get_svn_script "${LLVM_MAIN_SRC_DIR}/cmake/modules/GetSVN.cmake")
+
+  # Create custom target to generate the VC revision include.
+  add_custom_command(OUTPUT "${version_inc}"
+DEPENDS "${lldb_vc}" "${get_svn_script}"
+COMMAND
+${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${LLDB_SOURCE_DIR}"
+ "-DFIRST_NAME=LLDB"
+ "-DHEADER_FILE=${version_inc}"
+ -P "${get_svn_script}")
+
+  # Mark the generated header as being generated.
+  set_source_files_properties("${version_inc}"
+PROPERTIES GENERATED TRUE
+   HEADER_FILE_ONLY TRUE)
+
+  # Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC.
+  set_source_files_properties(lldb.cpp
+PROPERTIES COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC")
+  list(APPEND lldbBase_SOURCES ${version_inc})
+endif()
+
 add_lldb_library(lldbBase
   ${lldbBase_SOURCES}
   )
@@ -64,29 +99,3 @@
 # Build API last.  Since liblldb needs to link against every other target, it 
needs
 # those targets to have already been created.
 add_subdirectory(API)
-
-# Determine LLDB revision and repository. GetSourceVersion and 
GetRepositoryPath are shell-scripts, and as
-# such will not work on Windows.
-if ( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
-  execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetSourceVersion 
${LLDB_SOURCE_DIR}
-  OUTPUT_VARIABLE LLDB_REVISION)
-  if ( LLDB_REVISION )
-string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REVISION ${LLDB_REVISION})
-  endif()
-
-  execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath 
${LLDB_SOURCE_DIR}
-  OUTPUT_VARIABLE LLDB_REPOSITORY)
-  if ( LLDB_REPOSITORY )
-# Replace newline characters with spaces
-string(REGEX REPLACE "(\r?\n)+" " " LLDB_REPOSITORY ${LLDB_REPOSITORY})
-
-# Remove trailing spaces
-string(REGEX REPLACE "(\ )+$" "" LLDB_REPOSITORY ${LLDB_REPOSITORY})
-  endif()
-
-  set_property(
-SOURCE lldb.cpp
-PROPERTY COMPILE_DEFINITIONS "LLDB_REVISION=\"${LLDB_REVISION}\"" 
"LLDB_REPOSITORY=\"${LLDB_REPOSITORY}\"")
-endif ()
-# FIXME: implement svn/git revision and repository parsing solution on 
Windows. There is an SVN-only
-#revision parsing solution in tools/clang/lib/Basic/CMakelists.txt.


Index: source/lldb.cpp
===
--- source/lldb.cpp
+++ source/lldb.cpp
@@ -18,6 +18,10 @@
 
 #include "clang/Basic/Version.h"
 
+#ifdef HAVE_SVN_VERSION_INC
+#  include "SVNVersion.inc"
+#endif
+
 static const char *GetLLDBRevision() {
 #ifdef LLDB_REVISION
   return LLDB_REVISION;
Index: source/CMakeLists.txt
===
--- source/CMakeLists.txt
+++ source/CMakeLists.txt
@@ -40,6 +40,41 @@
 DEPENDS ${LLDB_VERS_GENERATED_FILE})
 endif()
 
+foreach(file
+"${LLDB_SOURCE_DIR}/.git/logs/HEAD" # Git
+"${LLDB_SOURCE_DIR}/.svn/wc.db" # SVN 1.7
+"${LLDB_SOURCE_DIR}/.svn/entries"   # SVN 1.6
+)
+  if(EXISTS "${file}")
+set(lldb_vc "${file}")
+break()
+  endif()
+endforeach()
+
+if(DEFINED lldb_vc)
+  set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc")
+  set(get_svn_script "${LLVM_MAIN_SRC_DIR}/cmake/modules/GetSVN.cmake")
+
+  # Create custom target to generate the VC revision include.
+  add_custom_command(OUTPUT "${version_inc}"
+DEPENDS "${lldb_vc}" "${get_svn_script}"
+COMMAND
+

Re: [Lldb-commits] [lldb] r282196 - [CMake] Fixing a small hack in add_lldb_library

2016-09-22 Thread Chris Bieneman via lldb-commits
Also of note. This implementation is “standalone” safe. If LLDB is being built 
without clang (against a pre-installed clang) CLANG_TABLEGEN_TARGETS will not 
be set, so no dependency will be setup.

That same concern came up in a similar patch I submitted to Swift.

-Chris

> On Sep 22, 2016, at 2:23 PM, Zachary Turner  wrote:
> 
> Ok, cool!
> 
> On Thu, Sep 22, 2016 at 2:23 PM Chris Bieneman  > wrote:
> Calls to add_dependencies don’t setup linkage, they just setup build order, 
> so changing this has no impact on what is linked or how.
> 
> -Chris
> 
>> On Sep 22, 2016, at 2:21 PM, Zachary Turner > > wrote:
>> 
>> At the end of the day though, lldb DOES need to link against libclang.  Is 
>> it still doing this?
>> 
>> 
>> On Thu, Sep 22, 2016 at 2:17 PM Chris Bieneman via lldb-commits 
>> > wrote:
>> Author: cbieneman
>> Date: Thu Sep 22 16:08:27 2016
>> New Revision: 282196
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=282196=rev 
>> 
>> Log:
>> [CMake] Fixing a small hack in add_lldb_library
>> 
>> This code was adding an explicit dependency on libclang because lldb needs 
>> clang headers, changing this to instead depend on the clang tablegen targets 
>> means we don't have to depend on building the clang bits in libclang that 
>> lldb doesn't need.
>> 
>> Note this is still a bit of a hack because we're adding the dependency to 
>> all lldb libraries, instead of just the ones that need it.
>> 
>> Modified:
>> lldb/trunk/cmake/modules/AddLLDB.cmake
>> 
>> Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=282196=282195=282196=diff
>>  
>> 
>> ==
>> --- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
>> +++ lldb/trunk/cmake/modules/AddLLDB.cmake Thu Sep 22 16:08:27 2016
>> @@ -91,7 +91,10 @@ macro(add_lldb_library name)
>># Hack: only some LLDB libraries depend on the clang autogenerated 
>> headers,
>># but it is simple enough to make all of LLDB depend on some of those
>># headers without negatively impacting much of anything.
>> -  add_dependencies(${name} libclang)
>> +  get_property(CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY 
>> CLANG_TABLEGEN_TARGETS)
>> +  if(CLANG_TABLEGEN_TARGETS)
>> +add_dependencies(${name} ${CLANG_TABLEGEN_TARGETS})
>> +  endif()
>> 
>>set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
>>  endmacro(add_lldb_library)
>> 
>> 
>> ___
>> 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


Re: [Lldb-commits] [lldb] r282196 - [CMake] Fixing a small hack in add_lldb_library

2016-09-22 Thread Zachary Turner via lldb-commits
Ok, cool!

On Thu, Sep 22, 2016 at 2:23 PM Chris Bieneman  wrote:

> Calls to add_dependencies don’t setup linkage, they just setup build
> order, so changing this has no impact on what is linked or how.
>
> -Chris
>
> On Sep 22, 2016, at 2:21 PM, Zachary Turner  wrote:
>
> At the end of the day though, lldb DOES need to link against libclang.  Is
> it still doing this?
>
>
> On Thu, Sep 22, 2016 at 2:17 PM Chris Bieneman via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
> Author: cbieneman
> Date: Thu Sep 22 16:08:27 2016
> New Revision: 282196
>
> URL: http://llvm.org/viewvc/llvm-project?rev=282196=rev
> Log:
> [CMake] Fixing a small hack in add_lldb_library
>
> This code was adding an explicit dependency on libclang because lldb needs
> clang headers, changing this to instead depend on the clang tablegen
> targets means we don't have to depend on building the clang bits in
> libclang that lldb doesn't need.
>
> Note this is still a bit of a hack because we're adding the dependency to
> all lldb libraries, instead of just the ones that need it.
>
> Modified:
> lldb/trunk/cmake/modules/AddLLDB.cmake
>
> Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=282196=282195=282196=diff
>
> ==
> --- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
> +++ lldb/trunk/cmake/modules/AddLLDB.cmake Thu Sep 22 16:08:27 2016
> @@ -91,7 +91,10 @@ macro(add_lldb_library name)
># Hack: only some LLDB libraries depend on the clang autogenerated
> headers,
># but it is simple enough to make all of LLDB depend on some of those
># headers without negatively impacting much of anything.
> -  add_dependencies(${name} libclang)
> +  get_property(CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY
> CLANG_TABLEGEN_TARGETS)
> +  if(CLANG_TABLEGEN_TARGETS)
> +add_dependencies(${name} ${CLANG_TABLEGEN_TARGETS})
> +  endif()
>
>set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
>  endmacro(add_lldb_library)
>
>
> ___
> 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


Re: [Lldb-commits] [lldb] r282196 - [CMake] Fixing a small hack in add_lldb_library

2016-09-22 Thread Chris Bieneman via lldb-commits
Calls to add_dependencies don’t setup linkage, they just setup build order, so 
changing this has no impact on what is linked or how.

-Chris

> On Sep 22, 2016, at 2:21 PM, Zachary Turner  wrote:
> 
> At the end of the day though, lldb DOES need to link against libclang.  Is it 
> still doing this?
> 
> 
> On Thu, Sep 22, 2016 at 2:17 PM Chris Bieneman via lldb-commits 
> > wrote:
> Author: cbieneman
> Date: Thu Sep 22 16:08:27 2016
> New Revision: 282196
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=282196=rev 
> 
> Log:
> [CMake] Fixing a small hack in add_lldb_library
> 
> This code was adding an explicit dependency on libclang because lldb needs 
> clang headers, changing this to instead depend on the clang tablegen targets 
> means we don't have to depend on building the clang bits in libclang that 
> lldb doesn't need.
> 
> Note this is still a bit of a hack because we're adding the dependency to all 
> lldb libraries, instead of just the ones that need it.
> 
> Modified:
> lldb/trunk/cmake/modules/AddLLDB.cmake
> 
> Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=282196=282195=282196=diff
>  
> 
> ==
> --- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
> +++ lldb/trunk/cmake/modules/AddLLDB.cmake Thu Sep 22 16:08:27 2016
> @@ -91,7 +91,10 @@ macro(add_lldb_library name)
># Hack: only some LLDB libraries depend on the clang autogenerated headers,
># but it is simple enough to make all of LLDB depend on some of those
># headers without negatively impacting much of anything.
> -  add_dependencies(${name} libclang)
> +  get_property(CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY CLANG_TABLEGEN_TARGETS)
> +  if(CLANG_TABLEGEN_TARGETS)
> +add_dependencies(${name} ${CLANG_TABLEGEN_TARGETS})
> +  endif()
> 
>set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
>  endmacro(add_lldb_library)
> 
> 
> ___
> 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


Re: [Lldb-commits] [lldb] r282196 - [CMake] Fixing a small hack in add_lldb_library

2016-09-22 Thread Zachary Turner via lldb-commits
At the end of the day though, lldb DOES need to link against libclang.  Is
it still doing this?


On Thu, Sep 22, 2016 at 2:17 PM Chris Bieneman via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: cbieneman
> Date: Thu Sep 22 16:08:27 2016
> New Revision: 282196
>
> URL: http://llvm.org/viewvc/llvm-project?rev=282196=rev
> Log:
> [CMake] Fixing a small hack in add_lldb_library
>
> This code was adding an explicit dependency on libclang because lldb needs
> clang headers, changing this to instead depend on the clang tablegen
> targets means we don't have to depend on building the clang bits in
> libclang that lldb doesn't need.
>
> Note this is still a bit of a hack because we're adding the dependency to
> all lldb libraries, instead of just the ones that need it.
>
> Modified:
> lldb/trunk/cmake/modules/AddLLDB.cmake
>
> Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=282196=282195=282196=diff
>
> ==
> --- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
> +++ lldb/trunk/cmake/modules/AddLLDB.cmake Thu Sep 22 16:08:27 2016
> @@ -91,7 +91,10 @@ macro(add_lldb_library name)
># Hack: only some LLDB libraries depend on the clang autogenerated
> headers,
># but it is simple enough to make all of LLDB depend on some of those
># headers without negatively impacting much of anything.
> -  add_dependencies(${name} libclang)
> +  get_property(CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY
> CLANG_TABLEGEN_TARGETS)
> +  if(CLANG_TABLEGEN_TARGETS)
> +add_dependencies(${name} ${CLANG_TABLEGEN_TARGETS})
> +  endif()
>
>set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
>  endmacro(add_lldb_library)
>
>
> ___
> 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] r282196 - [CMake] Fixing a small hack in add_lldb_library

2016-09-22 Thread Chris Bieneman via lldb-commits
Author: cbieneman
Date: Thu Sep 22 16:08:27 2016
New Revision: 282196

URL: http://llvm.org/viewvc/llvm-project?rev=282196=rev
Log:
[CMake] Fixing a small hack in add_lldb_library

This code was adding an explicit dependency on libclang because lldb needs 
clang headers, changing this to instead depend on the clang tablegen targets 
means we don't have to depend on building the clang bits in libclang that lldb 
doesn't need.

Note this is still a bit of a hack because we're adding the dependency to all 
lldb libraries, instead of just the ones that need it.

Modified:
lldb/trunk/cmake/modules/AddLLDB.cmake

Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=282196=282195=282196=diff
==
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Thu Sep 22 16:08:27 2016
@@ -91,7 +91,10 @@ macro(add_lldb_library name)
   # Hack: only some LLDB libraries depend on the clang autogenerated headers,
   # but it is simple enough to make all of LLDB depend on some of those
   # headers without negatively impacting much of anything.
-  add_dependencies(${name} libclang)
+  get_property(CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY CLANG_TABLEGEN_TARGETS)
+  if(CLANG_TABLEGEN_TARGETS)
+add_dependencies(${name} ${CLANG_TABLEGEN_TARGETS})
+  endif()
 
   set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
 endmacro(add_lldb_library)


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


[Lldb-commits] [lldb] r282195 - Try to fix build errors on Android.

2016-09-22 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Sep 22 16:06:13 2016
New Revision: 282195

URL: http://llvm.org/viewvc/llvm-project?rev=282195=rev
Log:
Try to fix build errors on Android.

It doesn't like the implicit conversion from T[] to ArrayRef
so I'm using `llvm::makeArrayRef()`.  Hopefully I got everything.

Modified:
lldb/trunk/source/Commands/CommandObjectArgs.cpp
lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp
lldb/trunk/source/Commands/CommandObjectCommands.cpp
lldb/trunk/source/Commands/CommandObjectDisassemble.cpp
lldb/trunk/source/Commands/CommandObjectExpression.cpp
lldb/trunk/source/Commands/CommandObjectFrame.cpp
lldb/trunk/source/Commands/CommandObjectHelp.cpp
lldb/trunk/source/Commands/CommandObjectLog.cpp
lldb/trunk/source/Commands/CommandObjectMemory.cpp
lldb/trunk/source/Commands/CommandObjectPlatform.cpp
lldb/trunk/source/Commands/CommandObjectProcess.cpp
lldb/trunk/source/Commands/CommandObjectRegister.cpp
lldb/trunk/source/Commands/CommandObjectSettings.cpp
lldb/trunk/source/Commands/CommandObjectSource.cpp
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Commands/CommandObjectThread.cpp
lldb/trunk/source/Commands/CommandObjectType.cpp
lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp
lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp
lldb/trunk/source/Interpreter/OptionGroupArchitecture.cpp
lldb/trunk/source/Interpreter/OptionGroupFormat.cpp
lldb/trunk/source/Interpreter/OptionGroupOutputFile.cpp
lldb/trunk/source/Interpreter/OptionGroupUUID.cpp
lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp
lldb/trunk/source/Interpreter/OptionGroupVariable.cpp
lldb/trunk/source/Interpreter/OptionGroupWatchpoint.cpp

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

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

lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Commands/CommandObjectArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectArgs.cpp?rev=282195=282194=282195=diff
==
--- lldb/trunk/source/Commands/CommandObjectArgs.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectArgs.cpp Thu Sep 22 16:06:13 2016
@@ -69,7 +69,7 @@ void CommandObjectArgs::CommandOptions::
 
 llvm::ArrayRef
 CommandObjectArgs::CommandOptions::GetDefinitions() {
-  return g_arg_options;
+  return llvm::makeArrayRef(g_arg_options);
 }
 
 CommandObjectArgs::CommandObjectArgs(CommandInterpreter )

Modified: lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp?rev=282195=282194=282195=diff
==
--- lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp Thu Sep 22 16:06:13 
2016
@@ -456,7 +456,7 @@ public:
 }
 
 llvm::ArrayRef GetDefinitions() override {
-  return g_breakpoint_set_options;
+  return llvm::makeArrayRef(g_breakpoint_set_options);
 }
 
 // Instance variables to hold the values for command options.
@@ -962,7 +962,7 @@ public:
 }
 
 llvm::ArrayRef GetDefinitions() override {
-  return g_breakpoint_modify_options;
+  return llvm::makeArrayRef(g_breakpoint_modify_options);
 }
 
 // Instance variables to hold the values for command options.
@@ -1363,7 +1363,7 @@ public:
 }
 
 llvm::ArrayRef GetDefinitions() override {
-  return g_breakpoint_list_options;
+  return llvm::makeArrayRef(g_breakpoint_list_options);
 }
 
 // Instance variables to hold the values for command options.
@@ -1502,7 +1502,7 @@ public:
 }
 
 llvm::ArrayRef GetDefinitions() override {
-  return g_breakpoint_clear_options;
+  return llvm::makeArrayRef(g_breakpoint_clear_options);
 }
 
 // Instance variables to hold the values for command options.
@@ -1661,7 +1661,7 @@ public:
 }
 
 llvm::ArrayRef GetDefinitions() override {
-  return g_breakpoint_delete_options;
+  return llvm::makeArrayRef(g_breakpoint_delete_options);
 }
 
 // Instance variables to hold the values for command options.
@@ -1769,7 +1769,7 @@ public:
   ~BreakpointNameOptionGroup() override = default;
 
   llvm::ArrayRef GetDefinitions() override {
-return g_breakpoint_name_options;
+return llvm::makeArrayRef(g_breakpoint_name_options);
   }
 
   Error SetOptionValue(uint32_t option_idx, const char *option_value,
@@ -2135,7 +2135,7 @@ public:
 }
 
 

[Lldb-commits] [lldb] r282179 - Actually, do it this way because I will want to know if I am in a host build elsewhere too

2016-09-22 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Sep 22 12:59:58 2016
New Revision: 282179

URL: http://llvm.org/viewvc/llvm-project?rev=282179=rev
Log:
Actually, do it this way because I will want to know if I am in a host build 
elsewhere too


Modified:
lldb/trunk/scripts/Xcode/lldbbuild.py

Modified: lldb/trunk/scripts/Xcode/lldbbuild.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/lldbbuild.py?rev=282179=282178=282179=diff
==
--- lldb/trunk/scripts/Xcode/lldbbuild.py (original)
+++ lldb/trunk/scripts/Xcode/lldbbuild.py Thu Sep 22 12:59:58 2016
@@ -33,11 +33,17 @@ def archives_txt():
 def expected_package_build_path():
 return os.path.abspath(os.path.join(expected_llvm_build_path(), ".."))
 
-
-def architecture():
+def is_host_build():
 rc_project_name = os.environ.get('RC_ProjectName')
 if rc_project_name:
-  if rc_project_name == 'lldb_host': return 'macosx'
+  if rc_project_name == 'lldb_host': return True
+return False
+
+def rc_release_target():
+  return os.environ.get('RC_RELEASE', '')
+
+def architecture():
+if is_host_build(): return 'macosx'
 platform_name = os.environ.get('RC_PLATFORM_NAME')
 if not platform_name:
 platform_name = os.environ.get('PLATFORM_NAME')


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


[Lldb-commits] [lldb] r282178 - The host version of lldb always builds for macosx

2016-09-22 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Sep 22 12:47:33 2016
New Revision: 282178

URL: http://llvm.org/viewvc/llvm-project?rev=282178=rev
Log:
The host version of lldb always builds for macosx


Modified:
lldb/trunk/scripts/Xcode/lldbbuild.py

Modified: lldb/trunk/scripts/Xcode/lldbbuild.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/lldbbuild.py?rev=282178=282177=282178=diff
==
--- lldb/trunk/scripts/Xcode/lldbbuild.py (original)
+++ lldb/trunk/scripts/Xcode/lldbbuild.py Thu Sep 22 12:47:33 2016
@@ -35,6 +35,9 @@ def expected_package_build_path():
 
 
 def architecture():
+rc_project_name = os.environ.get('RC_ProjectName')
+if rc_project_name:
+  if rc_project_name == 'lldb_host': return 'macosx'
 platform_name = os.environ.get('RC_PLATFORM_NAME')
 if not platform_name:
 platform_name = os.environ.get('PLATFORM_NAME')


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


[Lldb-commits] [PATCH] D24794: Use Clang for D language support until there is a proper language plugin for it.

2016-09-22 Thread Johan Engelen via lldb-commits
johanengelen created this revision.
johanengelen added a reviewer: LLDB.
johanengelen added a subscriber: lldb-commits.

Binaries with Dwarf language set to "DW_LANG_D" currently do not show much 
information in LLDB (e.g. no local variables).

With this simple change, Clang language support is used for D (the same as what 
is done for Rust) and local variables show up nicely.

I don't know whether, or how, to add a testcase for this. Please advise.

(I don't have write access, so if you accept the change, please apply it too. 
Thanks!)

https://reviews.llvm.org/D24794

Files:
  source/Symbol/ClangASTContext.cpp

Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -113,7 +113,9 @@
  Language::LanguageIsPascal(language) ||
  // Use Clang for Rust until there is a proper language plugin for it
  language == eLanguageTypeRust ||
- language == eLanguageTypeExtRenderScript;
+ language == eLanguageTypeExtRenderScript ||
+ // Use Clang for D until there is a proper language plugin for it
+ language == eLanguageTypeD;
 }
 }
 


Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -113,7 +113,9 @@
  Language::LanguageIsPascal(language) ||
  // Use Clang for Rust until there is a proper language plugin for it
  language == eLanguageTypeRust ||
- language == eLanguageTypeExtRenderScript;
+ language == eLanguageTypeExtRenderScript ||
+ // Use Clang for D until there is a proper language plugin for it
+ language == eLanguageTypeD;
 }
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r282171 - added environment variable-related Args gtests

2016-09-22 Thread Todd Fiala via lldb-commits
Okay. Yeah I don't see us needing to support the equal with trailing nothing.

-Todd

> On Sep 22, 2016, at 9:23 AM, Zachary Turner  wrote:
> 
> yea I mostly just wanted to know if we needed to specificlaly distinguish 
> between ARG=\0 and ARG\0.  Because if so the second parameter would need to 
> be Optional since StringRef has no way to differentiate between "I 
> don't refer to anything" versus "I refer to the empty string".  (Technically 
> it kinda does, but I think it relies on an implementation detail so shouldn't 
> be used)
> 
>> On Thu, Sep 22, 2016 at 9:20 AM Todd Fiala  wrote:
>> Primarily because we pass them verbatim to posix_spawn and other launchers, 
>> and there it is legitimate to not have an equal with trailing nothingness.  
>> On the Xcode side, we use a ton of environment variables.
>> 
>> As to whether there is a difference between ARG1=\0 and ARG1\0, I'm not sure.
>> 
>> On Thu, Sep 22, 2016 at 9:12 AM, Zachary Turner  wrote:
>> Thanks for the test.  Is there any practical difference between "ARGS=" and 
>> "ARGS"?
>> 
>> On Thu, Sep 22, 2016 at 9:08 AM Todd Fiala via lldb-commits 
>>  wrote:
>> Author: tfiala
>> Date: Thu Sep 22 11:00:01 2016
>> New Revision: 282171
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=282171=rev
>> Log:
>> added environment variable-related Args gtests
>> 
>> Also fixed up a couple misbehaving functions.  It is perfectly
>> legal to have env vars with no values (i.e. the '=' and following
>> need not be present).
>> 
>> Modified:
>> lldb/trunk/source/Interpreter/Args.cpp
>> lldb/trunk/unittests/Interpreter/TestArgs.cpp
>> 
>> Modified: lldb/trunk/source/Interpreter/Args.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=282171=282170=282171=diff
>> ==
>> --- lldb/trunk/source/Interpreter/Args.cpp (original)
>> +++ lldb/trunk/source/Interpreter/Args.cpp Thu Sep 22 11:00:01 2016
>> @@ -976,13 +976,15 @@ void Args::LongestCommonPrefix(std::stri
>> 
>>  void Args::AddOrReplaceEnvironmentVariable(llvm::StringRef env_var_name,
>> llvm::StringRef new_value) {
>> -  if (env_var_name.empty() || new_value.empty())
>> +  if (env_var_name.empty())
>>  return;
>> 
>>// Build the new entry.
>>std::string var_string(env_var_name);
>> -  var_string += "=";
>> -  var_string += new_value;
>> +  if (!new_value.empty()) {
>> +var_string += "=";
>> +var_string += new_value;
>> +  }
>> 
>>size_t index = 0;
>>if (ContainsEnvironmentVariable(env_var_name, )) {
>> @@ -1006,7 +1008,7 @@ bool Args::ContainsEnvironmentVariable(l
>> 
>>  llvm::StringRef name, value;
>>  std::tie(name, value) = arg_value.split('=');
>> -if (name == env_var_name && !value.empty()) {
>> +if (name == env_var_name) {
>>if (argument_index)
>>  *argument_index = i;
>>return true;
>> 
>> Modified: lldb/trunk/unittests/Interpreter/TestArgs.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Interpreter/TestArgs.cpp?rev=282171=282170=282171=diff
>> ==
>> --- lldb/trunk/unittests/Interpreter/TestArgs.cpp (original)
>> +++ lldb/trunk/unittests/Interpreter/TestArgs.cpp Thu Sep 22 11:00:01 2016
>> @@ -11,6 +11,9 @@
>> 
>>  #include "lldb/Interpreter/Args.h"
>> 
>> +#include 
>> +#include 
>> +
>>  using namespace lldb_private;
>> 
>>  TEST(ArgsTest, TestSingleArg) {
>> @@ -153,3 +156,85 @@ TEST(ArgsTest, StringToScriptLanguage) {
>>  }
>> 
>>  TEST(ArgsTest, StringToVersion) {}
>> +
>> +// Environment Variable Tests
>> +
>> +class EnvVarFixture: public ::testing::Test {
>> +protected:
>> +
>> +void SetUp() {
>> +args.AppendArgument(llvm::StringRef("Arg1=foo"));
>> +args.AppendArgument(llvm::StringRef("Arg2"));
>> +args.AppendArgument(llvm::StringRef("Arg3=bar"));
>> +}
>> +
>> +size_t GetIndexForEnvVar(llvm::StringRef envvar_name) {
>> +size_t argument_index = std::numeric_limits::max();
>> +EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name,
>> + _index));
>> +EXPECT_LT(argument_index, args.GetArgumentCount());
>> +return argument_index;
>> +}
>> +
>> +Args  args;
>> +};
>> +
>> +
>> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNoValue) {
>> +EXPECT_TRUE(args.ContainsEnvironmentVariable(llvm::StringRef("Arg2")));
>> +}
>> +
>> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableWithValue) {
>> +EXPECT_TRUE(args.ContainsEnvironmentVariable(llvm::StringRef("Arg3")));
>> +}
>> +
>> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNonExistentVariable) {
>> +auto nonexistent_envvar = llvm::StringRef("ThisEnvVarShouldNotExist");

[Lldb-commits] [lldb] r282172 - fix DarwinLog no-info/no-debug case

2016-09-22 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Sep 22 11:29:48 2016
New Revision: 282172

URL: http://llvm.org/viewvc/llvm-project?rev=282172=rev
Log:
fix DarwinLog no-info/no-debug case

This started failing recently:
TestDarwinLogSourceDebug.py

It looks like the behavior of specifying the OS_ACTIVITY_MODE
env var with no value used to work for no-info/no-debug content.
That doesn't appear to be the case now.  Switch to specifying
the proper value ('default') when no info-level and no debug-level
content is expected.

Modified:

lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp

Modified: 
lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp?rev=282172=282171=282172=diff
==
--- 
lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp 
Thu Sep 22 11:29:48 2016
@@ -1566,7 +1566,7 @@ Error StructuredDataDarwinLog::FilterLau
   else if (options_sp->GetIncludeInfoLevel())
 env_var_value = "info";
   else
-env_var_value = "";
+env_var_value = "default";
 
   if (env_var_value) {
 launch_info.GetEnvironmentEntries().AddOrReplaceEnvironmentVariable(


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


Re: [Lldb-commits] [lldb] r282171 - added environment variable-related Args gtests

2016-09-22 Thread Todd Fiala via lldb-commits
Primarily because we pass them verbatim to posix_spawn and other launchers,
and there it is legitimate to not have an equal with trailing nothingness.
On the Xcode side, we use a ton of environment variables.

As to whether there is a difference between ARG1=\0 and ARG1\0, I'm not
sure.

On Thu, Sep 22, 2016 at 9:12 AM, Zachary Turner  wrote:

> Thanks for the test.  Is there any practical difference between "ARGS="
> and "ARGS"?
>
> On Thu, Sep 22, 2016 at 9:08 AM Todd Fiala via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
>> Author: tfiala
>> Date: Thu Sep 22 11:00:01 2016
>> New Revision: 282171
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=282171=rev
>> Log:
>> added environment variable-related Args gtests
>>
>> Also fixed up a couple misbehaving functions.  It is perfectly
>> legal to have env vars with no values (i.e. the '=' and following
>> need not be present).
>>
>> Modified:
>> lldb/trunk/source/Interpreter/Args.cpp
>> lldb/trunk/unittests/Interpreter/TestArgs.cpp
>>
>> Modified: lldb/trunk/source/Interpreter/Args.cpp
>> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/
>> Interpreter/Args.cpp?rev=282171=282170=282171=diff
>> 
>> ==
>> --- lldb/trunk/source/Interpreter/Args.cpp (original)
>> +++ lldb/trunk/source/Interpreter/Args.cpp Thu Sep 22 11:00:01 2016
>> @@ -976,13 +976,15 @@ void Args::LongestCommonPrefix(std::stri
>>
>>  void Args::AddOrReplaceEnvironmentVariable(llvm::StringRef env_var_name,
>> llvm::StringRef new_value) {
>> -  if (env_var_name.empty() || new_value.empty())
>> +  if (env_var_name.empty())
>>  return;
>>
>>// Build the new entry.
>>std::string var_string(env_var_name);
>> -  var_string += "=";
>> -  var_string += new_value;
>> +  if (!new_value.empty()) {
>> +var_string += "=";
>> +var_string += new_value;
>> +  }
>>
>>size_t index = 0;
>>if (ContainsEnvironmentVariable(env_var_name, )) {
>> @@ -1006,7 +1008,7 @@ bool Args::ContainsEnvironmentVariable(l
>>
>>  llvm::StringRef name, value;
>>  std::tie(name, value) = arg_value.split('=');
>> -if (name == env_var_name && !value.empty()) {
>> +if (name == env_var_name) {
>>if (argument_index)
>>  *argument_index = i;
>>return true;
>>
>> Modified: lldb/trunk/unittests/Interpreter/TestArgs.cpp
>> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/
>> Interpreter/TestArgs.cpp?rev=282171=282170=282171=diff
>> 
>> ==
>> --- lldb/trunk/unittests/Interpreter/TestArgs.cpp (original)
>> +++ lldb/trunk/unittests/Interpreter/TestArgs.cpp Thu Sep 22 11:00:01
>> 2016
>> @@ -11,6 +11,9 @@
>>
>>  #include "lldb/Interpreter/Args.h"
>>
>> +#include 
>> +#include 
>> +
>>  using namespace lldb_private;
>>
>>  TEST(ArgsTest, TestSingleArg) {
>> @@ -153,3 +156,85 @@ TEST(ArgsTest, StringToScriptLanguage) {
>>  }
>>
>>  TEST(ArgsTest, StringToVersion) {}
>> +
>> +// Environment Variable Tests
>> +
>> +class EnvVarFixture: public ::testing::Test {
>> +protected:
>> +
>> +void SetUp() {
>> +args.AppendArgument(llvm::StringRef("Arg1=foo"));
>> +args.AppendArgument(llvm::StringRef("Arg2"));
>> +args.AppendArgument(llvm::StringRef("Arg3=bar"));
>> +}
>> +
>> +size_t GetIndexForEnvVar(llvm::StringRef envvar_name) {
>> +size_t argument_index = std::numeric_limits::max();
>> +EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name,
>> + _index));
>> +EXPECT_LT(argument_index, args.GetArgumentCount());
>> +return argument_index;
>> +}
>> +
>> +Args  args;
>> +};
>> +
>> +
>> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNoValue) {
>> +EXPECT_TRUE(args.ContainsEnvironmentVariable(
>> llvm::StringRef("Arg2")));
>> +}
>> +
>> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableWithValue) {
>> +EXPECT_TRUE(args.ContainsEnvironmentVariable(
>> llvm::StringRef("Arg3")));
>> +}
>> +
>> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNonExistentVariable)
>> {
>> +auto nonexistent_envvar = llvm::StringRef("
>> ThisEnvVarShouldNotExist");
>> +EXPECT_FALSE(args.ContainsEnvironmentVariable(nonexistent_envvar));
>> +}
>> +
>> +TEST_F(EnvVarFixture, 
>> TestReplaceEnvironmentVariableInitialNoValueWithNoValue)
>> {
>> +auto envvar_name = llvm::StringRef("Arg2");
>> +auto argument_index = GetIndexForEnvVar(envvar_name);
>> +
>> +args.AddOrReplaceEnvironmentVariable(envvar_name,
>> llvm::StringRef(""));
>> +EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name));
>> +EXPECT_EQ(envvar_name, args.GetArgumentAtIndex(argument_index));
>> +}
>> +
>> +TEST_F(EnvVarFixture, TestReplaceEnvironmentVariableInitialNoValueWithValue)
>> {
>> +auto envvar_name = 

Re: [Lldb-commits] [lldb] r282171 - added environment variable-related Args gtests

2016-09-22 Thread Zachary Turner via lldb-commits
yea I mostly just wanted to know if we needed to specificlaly distinguish
between ARG=\0 and ARG\0.  Because if so the second parameter would need to
be Optional since StringRef has no way to differentiate between
"I don't refer to anything" versus "I refer to the empty string".
 (Technically it kinda does, but I think it relies on an implementation
detail so shouldn't be used)

On Thu, Sep 22, 2016 at 9:20 AM Todd Fiala  wrote:

> Primarily because we pass them verbatim to posix_spawn and other
> launchers, and there it is legitimate to not have an equal with trailing
> nothingness.  On the Xcode side, we use a ton of environment variables.
>
> As to whether there is a difference between ARG1=\0 and ARG1\0, I'm not
> sure.
>
> On Thu, Sep 22, 2016 at 9:12 AM, Zachary Turner 
> wrote:
>
> Thanks for the test.  Is there any practical difference between "ARGS="
> and "ARGS"?
>
> On Thu, Sep 22, 2016 at 9:08 AM Todd Fiala via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
>
> Author: tfiala
> Date: Thu Sep 22 11:00:01 2016
> New Revision: 282171
>
> URL: http://llvm.org/viewvc/llvm-project?rev=282171=rev
> Log:
> added environment variable-related Args gtests
>
> Also fixed up a couple misbehaving functions.  It is perfectly
> legal to have env vars with no values (i.e. the '=' and following
> need not be present).
>
> Modified:
> lldb/trunk/source/Interpreter/Args.cpp
> lldb/trunk/unittests/Interpreter/TestArgs.cpp
>
> Modified: lldb/trunk/source/Interpreter/Args.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=282171=282170=282171=diff
>
> ==
> --- lldb/trunk/source/Interpreter/Args.cpp (original)
> +++ lldb/trunk/source/Interpreter/Args.cpp Thu Sep 22 11:00:01 2016
> @@ -976,13 +976,15 @@ void Args::LongestCommonPrefix(std::stri
>
>  void Args::AddOrReplaceEnvironmentVariable(llvm::StringRef env_var_name,
> llvm::StringRef new_value) {
> -  if (env_var_name.empty() || new_value.empty())
> +  if (env_var_name.empty())
>  return;
>
>// Build the new entry.
>std::string var_string(env_var_name);
> -  var_string += "=";
> -  var_string += new_value;
> +  if (!new_value.empty()) {
> +var_string += "=";
> +var_string += new_value;
> +  }
>
>size_t index = 0;
>if (ContainsEnvironmentVariable(env_var_name, )) {
> @@ -1006,7 +1008,7 @@ bool Args::ContainsEnvironmentVariable(l
>
>  llvm::StringRef name, value;
>  std::tie(name, value) = arg_value.split('=');
> -if (name == env_var_name && !value.empty()) {
> +if (name == env_var_name) {
>if (argument_index)
>  *argument_index = i;
>return true;
>
> Modified: lldb/trunk/unittests/Interpreter/TestArgs.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Interpreter/TestArgs.cpp?rev=282171=282170=282171=diff
>
> ==
> --- lldb/trunk/unittests/Interpreter/TestArgs.cpp (original)
> +++ lldb/trunk/unittests/Interpreter/TestArgs.cpp Thu Sep 22 11:00:01 2016
> @@ -11,6 +11,9 @@
>
>  #include "lldb/Interpreter/Args.h"
>
> +#include 
> +#include 
> +
>  using namespace lldb_private;
>
>  TEST(ArgsTest, TestSingleArg) {
> @@ -153,3 +156,85 @@ TEST(ArgsTest, StringToScriptLanguage) {
>  }
>
>  TEST(ArgsTest, StringToVersion) {}
> +
> +// Environment Variable Tests
> +
> +class EnvVarFixture: public ::testing::Test {
> +protected:
> +
> +void SetUp() {
> +args.AppendArgument(llvm::StringRef("Arg1=foo"));
> +args.AppendArgument(llvm::StringRef("Arg2"));
> +args.AppendArgument(llvm::StringRef("Arg3=bar"));
> +}
> +
> +size_t GetIndexForEnvVar(llvm::StringRef envvar_name) {
> +size_t argument_index = std::numeric_limits::max();
> +EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name,
> + _index));
> +EXPECT_LT(argument_index, args.GetArgumentCount());
> +return argument_index;
> +}
> +
> +Args  args;
> +};
> +
> +
> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNoValue) {
> +
> EXPECT_TRUE(args.ContainsEnvironmentVariable(llvm::StringRef("Arg2")));
> +}
> +
> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableWithValue) {
> +
> EXPECT_TRUE(args.ContainsEnvironmentVariable(llvm::StringRef("Arg3")));
> +}
> +
> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNonExistentVariable)
> {
> +auto nonexistent_envvar = llvm::StringRef("ThisEnvVarShouldNotExist");
> +EXPECT_FALSE(args.ContainsEnvironmentVariable(nonexistent_envvar));
> +}
> +
> +TEST_F(EnvVarFixture,
> TestReplaceEnvironmentVariableInitialNoValueWithNoValue) {
> +auto envvar_name = llvm::StringRef("Arg2");
> +auto argument_index = GetIndexForEnvVar(envvar_name);
> +
> +

Re: [Lldb-commits] [lldb] r282171 - added environment variable-related Args gtests

2016-09-22 Thread Zachary Turner via lldb-commits
Thanks for the test.  Is there any practical difference between "ARGS=" and
"ARGS"?

On Thu, Sep 22, 2016 at 9:08 AM Todd Fiala via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: tfiala
> Date: Thu Sep 22 11:00:01 2016
> New Revision: 282171
>
> URL: http://llvm.org/viewvc/llvm-project?rev=282171=rev
> Log:
> added environment variable-related Args gtests
>
> Also fixed up a couple misbehaving functions.  It is perfectly
> legal to have env vars with no values (i.e. the '=' and following
> need not be present).
>
> Modified:
> lldb/trunk/source/Interpreter/Args.cpp
> lldb/trunk/unittests/Interpreter/TestArgs.cpp
>
> Modified: lldb/trunk/source/Interpreter/Args.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=282171=282170=282171=diff
>
> ==
> --- lldb/trunk/source/Interpreter/Args.cpp (original)
> +++ lldb/trunk/source/Interpreter/Args.cpp Thu Sep 22 11:00:01 2016
> @@ -976,13 +976,15 @@ void Args::LongestCommonPrefix(std::stri
>
>  void Args::AddOrReplaceEnvironmentVariable(llvm::StringRef env_var_name,
> llvm::StringRef new_value) {
> -  if (env_var_name.empty() || new_value.empty())
> +  if (env_var_name.empty())
>  return;
>
>// Build the new entry.
>std::string var_string(env_var_name);
> -  var_string += "=";
> -  var_string += new_value;
> +  if (!new_value.empty()) {
> +var_string += "=";
> +var_string += new_value;
> +  }
>
>size_t index = 0;
>if (ContainsEnvironmentVariable(env_var_name, )) {
> @@ -1006,7 +1008,7 @@ bool Args::ContainsEnvironmentVariable(l
>
>  llvm::StringRef name, value;
>  std::tie(name, value) = arg_value.split('=');
> -if (name == env_var_name && !value.empty()) {
> +if (name == env_var_name) {
>if (argument_index)
>  *argument_index = i;
>return true;
>
> Modified: lldb/trunk/unittests/Interpreter/TestArgs.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Interpreter/TestArgs.cpp?rev=282171=282170=282171=diff
>
> ==
> --- lldb/trunk/unittests/Interpreter/TestArgs.cpp (original)
> +++ lldb/trunk/unittests/Interpreter/TestArgs.cpp Thu Sep 22 11:00:01 2016
> @@ -11,6 +11,9 @@
>
>  #include "lldb/Interpreter/Args.h"
>
> +#include 
> +#include 
> +
>  using namespace lldb_private;
>
>  TEST(ArgsTest, TestSingleArg) {
> @@ -153,3 +156,85 @@ TEST(ArgsTest, StringToScriptLanguage) {
>  }
>
>  TEST(ArgsTest, StringToVersion) {}
> +
> +// Environment Variable Tests
> +
> +class EnvVarFixture: public ::testing::Test {
> +protected:
> +
> +void SetUp() {
> +args.AppendArgument(llvm::StringRef("Arg1=foo"));
> +args.AppendArgument(llvm::StringRef("Arg2"));
> +args.AppendArgument(llvm::StringRef("Arg3=bar"));
> +}
> +
> +size_t GetIndexForEnvVar(llvm::StringRef envvar_name) {
> +size_t argument_index = std::numeric_limits::max();
> +EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name,
> + _index));
> +EXPECT_LT(argument_index, args.GetArgumentCount());
> +return argument_index;
> +}
> +
> +Args  args;
> +};
> +
> +
> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNoValue) {
> +
> EXPECT_TRUE(args.ContainsEnvironmentVariable(llvm::StringRef("Arg2")));
> +}
> +
> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableWithValue) {
> +
> EXPECT_TRUE(args.ContainsEnvironmentVariable(llvm::StringRef("Arg3")));
> +}
> +
> +TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNonExistentVariable)
> {
> +auto nonexistent_envvar = llvm::StringRef("ThisEnvVarShouldNotExist");
> +EXPECT_FALSE(args.ContainsEnvironmentVariable(nonexistent_envvar));
> +}
> +
> +TEST_F(EnvVarFixture,
> TestReplaceEnvironmentVariableInitialNoValueWithNoValue) {
> +auto envvar_name = llvm::StringRef("Arg2");
> +auto argument_index = GetIndexForEnvVar(envvar_name);
> +
> +args.AddOrReplaceEnvironmentVariable(envvar_name,
> llvm::StringRef(""));
> +EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name));
> +EXPECT_EQ(envvar_name, args.GetArgumentAtIndex(argument_index));
> +}
> +
> +TEST_F(EnvVarFixture,
> TestReplaceEnvironmentVariableInitialNoValueWithValue) {
> +auto envvar_name = llvm::StringRef("Arg2");
> +auto argument_index = GetIndexForEnvVar(envvar_name);
> +
> +auto new_value = llvm::StringRef("NewValue");
> +args.AddOrReplaceEnvironmentVariable(envvar_name, new_value);
> +EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name));
> +
> +std::stringstream stream;
> +stream << envvar_name.str() << '=' << new_value.str();
> +EXPECT_EQ(llvm::StringRef(stream.str()),
> +  args.GetArgumentAtIndex(argument_index));
> +}
> +
> +TEST_F(EnvVarFixture,
> 

[Lldb-commits] [lldb] r282171 - added environment variable-related Args gtests

2016-09-22 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Thu Sep 22 11:00:01 2016
New Revision: 282171

URL: http://llvm.org/viewvc/llvm-project?rev=282171=rev
Log:
added environment variable-related Args gtests

Also fixed up a couple misbehaving functions.  It is perfectly
legal to have env vars with no values (i.e. the '=' and following
need not be present).

Modified:
lldb/trunk/source/Interpreter/Args.cpp
lldb/trunk/unittests/Interpreter/TestArgs.cpp

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=282171=282170=282171=diff
==
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Thu Sep 22 11:00:01 2016
@@ -976,13 +976,15 @@ void Args::LongestCommonPrefix(std::stri
 
 void Args::AddOrReplaceEnvironmentVariable(llvm::StringRef env_var_name,
llvm::StringRef new_value) {
-  if (env_var_name.empty() || new_value.empty())
+  if (env_var_name.empty())
 return;
 
   // Build the new entry.
   std::string var_string(env_var_name);
-  var_string += "=";
-  var_string += new_value;
+  if (!new_value.empty()) {
+var_string += "=";
+var_string += new_value;
+  }
 
   size_t index = 0;
   if (ContainsEnvironmentVariable(env_var_name, )) {
@@ -1006,7 +1008,7 @@ bool Args::ContainsEnvironmentVariable(l
 
 llvm::StringRef name, value;
 std::tie(name, value) = arg_value.split('=');
-if (name == env_var_name && !value.empty()) {
+if (name == env_var_name) {
   if (argument_index)
 *argument_index = i;
   return true;

Modified: lldb/trunk/unittests/Interpreter/TestArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Interpreter/TestArgs.cpp?rev=282171=282170=282171=diff
==
--- lldb/trunk/unittests/Interpreter/TestArgs.cpp (original)
+++ lldb/trunk/unittests/Interpreter/TestArgs.cpp Thu Sep 22 11:00:01 2016
@@ -11,6 +11,9 @@
 
 #include "lldb/Interpreter/Args.h"
 
+#include 
+#include 
+
 using namespace lldb_private;
 
 TEST(ArgsTest, TestSingleArg) {
@@ -153,3 +156,85 @@ TEST(ArgsTest, StringToScriptLanguage) {
 }
 
 TEST(ArgsTest, StringToVersion) {}
+
+// Environment Variable Tests
+
+class EnvVarFixture: public ::testing::Test {
+protected:
+
+void SetUp() {
+args.AppendArgument(llvm::StringRef("Arg1=foo"));
+args.AppendArgument(llvm::StringRef("Arg2"));
+args.AppendArgument(llvm::StringRef("Arg3=bar"));
+}
+
+size_t GetIndexForEnvVar(llvm::StringRef envvar_name) {
+size_t argument_index = std::numeric_limits::max();
+EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name,
+ _index));
+EXPECT_LT(argument_index, args.GetArgumentCount());
+return argument_index;
+}
+
+Args  args;
+};
+
+
+TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNoValue) {
+EXPECT_TRUE(args.ContainsEnvironmentVariable(llvm::StringRef("Arg2")));
+}
+
+TEST_F(EnvVarFixture, TestContainsEnvironmentVariableWithValue) {
+EXPECT_TRUE(args.ContainsEnvironmentVariable(llvm::StringRef("Arg3")));
+}
+
+TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNonExistentVariable) {
+auto nonexistent_envvar = llvm::StringRef("ThisEnvVarShouldNotExist");
+EXPECT_FALSE(args.ContainsEnvironmentVariable(nonexistent_envvar));
+}
+
+TEST_F(EnvVarFixture, TestReplaceEnvironmentVariableInitialNoValueWithNoValue) 
{
+auto envvar_name = llvm::StringRef("Arg2");
+auto argument_index = GetIndexForEnvVar(envvar_name);
+
+args.AddOrReplaceEnvironmentVariable(envvar_name, llvm::StringRef(""));
+EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name));
+EXPECT_EQ(envvar_name, args.GetArgumentAtIndex(argument_index));
+}
+
+TEST_F(EnvVarFixture, TestReplaceEnvironmentVariableInitialNoValueWithValue) {
+auto envvar_name = llvm::StringRef("Arg2");
+auto argument_index = GetIndexForEnvVar(envvar_name);
+
+auto new_value = llvm::StringRef("NewValue");
+args.AddOrReplaceEnvironmentVariable(envvar_name, new_value);
+EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name));
+
+std::stringstream stream;
+stream << envvar_name.str() << '=' << new_value.str();
+EXPECT_EQ(llvm::StringRef(stream.str()),
+  args.GetArgumentAtIndex(argument_index));
+}
+
+TEST_F(EnvVarFixture, TestReplaceEnvironmentVariableInitialValueWithNoValue) {
+auto envvar_name = llvm::StringRef("Arg1");
+auto argument_index = GetIndexForEnvVar(envvar_name);
+
+args.AddOrReplaceEnvironmentVariable(envvar_name, llvm::StringRef(""));
+EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name));
+EXPECT_EQ(envvar_name, args.GetArgumentAtIndex(argument_index));
+}
+
+TEST_F(EnvVarFixture, 

[Lldb-commits] [lldb] r282167 - Fix TestBreakpointSerialization on windows

2016-09-22 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Sep 22 10:26:43 2016
New Revision: 282167

URL: http://llvm.org/viewvc/llvm-project?rev=282167=rev
Log:
Fix TestBreakpointSerialization on windows

The test exposed a bug in the StructuredData Serialization code, which did not
escape the backslash properly. This manifested itself as windows breakpoint
serialization roundtrip test not succeeding (as windows paths included
backslashes).

Added:
lldb/trunk/unittests/Core/StructuredDataTest.cpp
Modified:
lldb/trunk/source/Core/StructuredData.cpp
lldb/trunk/unittests/Core/CMakeLists.txt

Modified: lldb/trunk/source/Core/StructuredData.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/StructuredData.cpp?rev=282167=282166=282167=diff
==
--- lldb/trunk/source/Core/StructuredData.cpp (original)
+++ lldb/trunk/source/Core/StructuredData.cpp Thu Sep 22 10:26:43 2016
@@ -264,7 +264,7 @@ void StructuredData::String::Dump(Stream
   const size_t strsize = m_value.size();
   for (size_t i = 0; i < strsize; ++i) {
 char ch = m_value[i];
-if (ch == '"')
+if (ch == '"' || ch == '\\')
   quoted.push_back('\\');
 quoted.push_back(ch);
   }

Modified: lldb/trunk/unittests/Core/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/CMakeLists.txt?rev=282167=282166=282167=diff
==
--- lldb/trunk/unittests/Core/CMakeLists.txt (original)
+++ lldb/trunk/unittests/Core/CMakeLists.txt Thu Sep 22 10:26:43 2016
@@ -3,4 +3,5 @@ add_lldb_unittest(LLDBCoreTests
   BroadcasterTest.cpp
   DataExtractorTest.cpp
   ScalarTest.cpp
+  StructuredDataTest.cpp
   )

Added: lldb/trunk/unittests/Core/StructuredDataTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/StructuredDataTest.cpp?rev=282167=auto
==
--- lldb/trunk/unittests/Core/StructuredDataTest.cpp (added)
+++ lldb/trunk/unittests/Core/StructuredDataTest.cpp Thu Sep 22 10:26:43 2016
@@ -0,0 +1,32 @@
+//===-- StructuredDataTest.cpp --*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "gtest/gtest.h"
+
+#include "lldb/Core/StructuredData.h"
+#include "lldb/Core/StreamString.h"
+
+#include "llvm/Support/MachO.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+TEST(StructuredDataTest, StringDump) {
+  std::pair TestCases[] = {
+{ R"(asdfg)", R"("asdfg")" },
+{ R"(as"df)", R"("as\"df")" },
+{ R"(as\df)", R"("as\\df")" },
+  };
+  for(auto P : TestCases) {
+StreamString S;
+const bool pretty_print = false;
+StructuredData::String(P.first).Dump(S, pretty_print);
+EXPECT_EQ(P.second, S.GetString());
+  }
+}


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


Re: [Lldb-commits] [PATCH] D24610: LLDB Arm Watchpoints: Use single hardware watchpoint slot to watch multiple bytes where possible

2016-09-22 Thread Pavel Labath via lldb-commits
labath accepted this revision.


Comment at: 
source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp:513-521
@@ -513,1 +512,11 @@
+
+  // Find out how many bytes we need to watch after 4-byte alignment boundary.
+  uint8_t watch_size = (addr & 0x03) + size;
+
+  // We cannot watch zero or more than 4 bytes after 4-byte alignment boundary.
+  if (size == 0 || watch_size > 4)
+return LLDB_INVALID_INDEX32;
+
+  // Strip away last two bits of address for byte/half-word/word selection.
+  addr &= ~((lldb::addr_t)3);
 

omjavaid wrote:
> labath wrote:
> > zturner wrote:
> > > This block of code is a bit confusing to me.  Is this equivalent to:
> > > 
> > > ```
> > > lldb::addr_t start = llvm::alignDown(addr, 4);
> > > lldb::addr_t end = addr + size;
> > > if (start == end || (end-start)>4)
> > >   return LLDB_INVALID_INDEX32;
> > > ```
> > I am not sure this is much clearer, especially, as we will later need a 
> > separate varaible for `end-start` anyway.
> > 
> > +1 for `llvm::alignDown` though.
> There is significant performance difference when we choose addr = addr & 
> (~0x03); over llvm::alignDown
> 
> It will eventually effect responsiveness if we keep increasing code size like 
> this. 
> 
> Even if we use -Os then alignDown is squeezed down to 8-9 instructions. I 
> havnt tried clang though.
> 
> Instructions needed for addr = addr & (~0x03):
>   4008bd: 48 8b 45 e8 mov-0x18(%rbp),%rax
>   4008c1: 48 83 e0 fc and$0xfffc,%rax
>   4008c5: 48 89 45 e8 mov%rax,-0x18(%rbp)
> 
> Call penalty for llvm::alignDown
> 400918:   ba 00 00 00 00  mov$0x0,%edx
>   40091d: 48 89 cemov%rcx,%rsi
>   400920: 48 89 c7mov%rax,%rdi
>   400923: e8 ae 00 00 00  callq  4009d6 <_Z9alignDownmmm>
>   400928: 49 89 c4mov%rax,%r12
>   40092b: 48 8b 5d d8 mov-0x28(%rbp),%rbx
> 
> Disassembly for llvm::alignDown
> 004009d6 <_Z9alignDownmmm>:
>   4009d6: 55  push   %rbp
>   4009d7: 48 89 e5mov%rsp,%rbp
>   4009da: 48 89 7d f8 mov%rdi,-0x8(%rbp)
>   4009de: 48 89 75 f0 mov%rsi,-0x10(%rbp)
>   4009e2: 48 89 55 e8 mov%rdx,-0x18(%rbp)
>   4009e6: 48 8b 45 e8 mov-0x18(%rbp),%rax
>   4009ea: ba 00 00 00 00  mov$0x0,%edx
>   4009ef: 48 f7 75 f0 divq   -0x10(%rbp)
>   4009f3: 48 89 55 e8 mov%rdx,-0x18(%rbp)
>   4009f7: 48 8b 45 f8 mov-0x8(%rbp),%rax
>   4009fb: 48 2b 45 e8 sub-0x18(%rbp),%rax
>   4009ff: ba 00 00 00 00  mov$0x0,%edx
>   400a04: 48 f7 75 f0 divq   -0x10(%rbp)
>   400a08: 48 0f af 45 f0  imul   -0x10(%rbp),%rax
>   400a0d: 48 89 c2mov%rax,%rdx
>   400a10: 48 8b 45 e8 mov-0x18(%rbp),%rax
>   400a14: 48 01 d0add%rdx,%rax
>   400a17: 5d  pop%rbp
>   400a18: c3  retq   
>   400a19: 0f 1f 80 00 00 00 00nopl   0x0(%rax)
> 
> Number of instructions generated for alignDown with gcc -Os
> 
>   400892: 48 8b 6c 24 08  mov0x8(%rsp),%rbp
>   400897: 48 8b 4c 24 10  mov0x10(%rsp),%rcx
>   40089c: 31 d2   xor%edx,%edx
>   40089e: be c2 0a 40 00  mov$0x400ac2,%esi
>   4008a3: bf a0 11 60 00  mov$0x6011a0,%edi
>   4008a8: 48 89 e8mov%rbp,%rax
>   4008ab: 48 f7 f1div%rcx
>   4008ae: 48 0f af c1 imul   %rcx,%rax
>   4008b2: 48 89 c3mov%rax,%rbx
I tried this with clang-3.6 -O3. The entire alignDown function call compiled 
down to `andq $-4, %rdi`. I'll leave this up to you, as I think it is readable 
enough right now, but I don't think we should be afraid of using utility 
functions like this. I think LLVM cares a lot more about performance than we, 
so I believe we can rely on them knowing what they're doing. Also we have much 
bigger higher-level issues affecting performance, the least of which is the 
change below, where you re-calculate all watchpoints on every resume.


Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp:552
@@ -559,1 +551,3 @@
 
+  uint8_t current_watch_size, new_watch_size;
+  // Calculate overall size width to be watched by current hardware watchpoint 
slot.

omjavaid wrote:
> labath wrote:
> > Looks much better. Any reason for not using `NextPowerOf2` ? Among other 
> > things, it is self-documenting, so you do not need the comment above that.
> so llvm::NextPowerOf2 doesnt serve the intended behaviour.
> 
> llvm::NextPowerOf2 returns 2 for 1, 4 for 2 or 3, and 8 for 

Re: [Lldb-commits] [lldb] r282079 - Make lldb::Regex use StringRef.

2016-09-22 Thread Zachary Turner via lldb-commits
+1. One of the points I outlined on my list was to use llvm streams. So
that also solves the problem
On Thu, Sep 22, 2016 at 4:54 AM Pavel Labath  wrote:

> On 22 September 2016 at 01:00, Greg Clayton via lldb-commits
>  wrote:
> > If you use a StringRef in printf, please use "%*s" and then put the
> count and data pointer into the printf, so the above line would become:
> >
> > +  s->Printf("source regex = \"%*s\", exact_match = %d",
> > +(int)m_regex.GetText().size(), m_regex.GetText().data(),
> m_exact_match);
>
> I think this is a very good argument to use a c++-like api for
> streams/logging:
>
> s << "source regex = \"" << m_regex.GetText() << "\", exact_match = "
> << m_exact_match;
>
> It's shorter and much less error-prone.
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r282079 - Make lldb::Regex use StringRef.

2016-09-22 Thread Pavel Labath via lldb-commits
On 22 September 2016 at 01:00, Greg Clayton via lldb-commits
 wrote:
> If you use a StringRef in printf, please use "%*s" and then put the count and 
> data pointer into the printf, so the above line would become:
>
> +  s->Printf("source regex = \"%*s\", exact_match = %d",
> +(int)m_regex.GetText().size(), m_regex.GetText().data(), 
> m_exact_match);

I think this is a very good argument to use a c++-like api for streams/logging:

s << "source regex = \"" << m_regex.GetText() << "\", exact_match = "
<< m_exact_match;

It's shorter and much less error-prone.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits