[Lldb-commits] [lldb] r280039 - Update debugserver project to pull in StdStringExtractor.cpp instead of the new

2016-08-29 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Aug 29 19:58:23 2016
New Revision: 280039

URL: http://llvm.org/viewvc/llvm-project?rev=280039=rev
Log:
Update debugserver project to pull in StdStringExtractor.cpp instead of the new
llvm-using StringExtractor.cpp in the xcode project file settings.

Modified:
lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj

Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=280039=280038=280039=diff
==
--- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj 
(original)
+++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Mon Aug 
29 19:58:23 2016
@@ -30,7 +30,6 @@
23D1B0291D497E8B00FF831B /* OsLogger.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 23D1B0271D497E8B00FF831B /* OsLogger.cpp */; };
23D1B02A1D497E8B00FF831B /* OsLogger.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 23D1B0271D497E8B00FF831B /* OsLogger.cpp */; };
264D5D581293835600ED4C01 /* DNBArch.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 264D5D571293835600ED4C01 /* DNBArch.cpp */; };
-   2660D9CE1192280900958FBD /* StringExtractor.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 2660D9CC1192280900958FBD /* StringExtractor.cpp 
*/; };
266B5ED11460A68200E43F0A /* DNBArchImplARM64.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 266B5ECF1460A68200E43F0A /* 
DNBArchImplARM64.cpp */; };
26CE05A7115C360D0022F371 /* DNBError.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 26C637DE0C71334A0024798E /* DNBError.cpp */; };
26CE05A8115C36170022F371 /* DNBThreadResumeActions.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 260E7331114BFFE600D1DFB3 /* 
DNBThreadResumeActions.cpp */; };
@@ -94,12 +93,13 @@
456F67621AD46CE9002850C2 /* CFString.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 2695DD9B0D3EC160007E4CA2 /* CFString.cpp */; };
456F67641AD46CE9002850C2 /* CFBundle.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 2695DD910D3EBFF6007E4CA2 /* CFBundle.cpp */; };
456F67651AD46CE9002850C2 /* PseudoTerminal.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF67ABFF0D34604D0022D128 /* PseudoTerminal.cpp 
*/; };
-   456F67661AD46CE9002850C2 /* StringExtractor.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 2660D9CC1192280900958FBD /* StringExtractor.cpp 
*/; };
456F67671AD46CE9002850C2 /* DNBArch.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 264D5D571293835600ED4C01 /* DNBArch.cpp */; };
456F67681AD46CE9002850C2 /* HasAVX.s in Sources */ = {isa = 
PBXBuildFile; fileRef = 4971AE7113D10F4F00649E37 /* HasAVX.s */; };
456F67691AD46CE9002850C2 /* DNBArchImplARM64.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 266B5ECF1460A68200E43F0A /* 
DNBArchImplARM64.cpp */; };
456F676B1AD46CE9002850C2 /* CoreFoundation.framework in 
Frameworks */ = {isa = PBXBuildFile; fileRef = 26ACA3340D3E956300A2120B /* 
CoreFoundation.framework */; settings = {ATTRIBUTES = (Required, ); }; };
4971AE7213D10F4F00649E37 /* HasAVX.s in Sources */ = {isa = 
PBXBuildFile; fileRef = 4971AE7113D10F4F00649E37 /* HasAVX.s */; };
+   AF48558C1D75126800D19C07 /* StdStringExtractor.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF48558B1D75126800D19C07 /* 
StdStringExtractor.cpp */; };
+   AF48558D1D75127500D19C07 /* StdStringExtractor.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF48558B1D75126800D19C07 /* 
StdStringExtractor.cpp */; };
AFEC3364194A8B0B00FF05C6 /* Genealogy.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = AFEC3363194A8B0B00FF05C6 /* Genealogy.cpp */; };
 /* End PBXBuildFile section */
 
@@ -141,7 +141,6 @@
264D5D571293835600ED4C01 /* DNBArch.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = DNBArch.cpp; sourceTree = ""; };
264F679A1B2F9EB200140093 /* JSONGenerator.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSONGenerator.h; 
sourceTree = ""; };
26593A060D4931CC001C9FE3 /* ChangeLog */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ChangeLog; 
sourceTree = ""; };
-   2660D9CC1192280900958FBD /* StringExtractor.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = StringExtractor.cpp; path = ../../source/Utility/StringExtractor.cpp; 
sourceTree = SOURCE_ROOT; };
266B5ECF1460A68200E43F0A /* DNBArchImplARM64.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = 

Re: [Lldb-commits] [PATCH] D24013: Removed the `GetStringRef()` functions of `StringExtractor`

2016-08-29 Thread Zachary Turner via lldb-commits
zturner added inline comments.


Comment at: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:1677
@@ -1676,3 +1676,2 @@
 {
-m_thread_ids.clear();
 m_thread_pcs.clear();

Also, was this a bug?  I fixed it because it certainly looks like a bug, but if 
this is intended behavior please let me know.


https://reviews.llvm.org/D24013



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


[Lldb-commits] [PATCH] D24013: Removed the `GetStringRef()` functions of `StringExtractor`

2016-08-29 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added reviewers: labath, tberghammer.
zturner added a subscriber: lldb-commits.

The motivation here was that operations which were using the `const` version of 
this function might as well be using `Peek()`, since it does essentially the 
same thing.  And since `Peek()` was updated to return `StringRef`, it even 
provides a more useful interface than `std::string`.  

On the other hand, operations which were using the non `const` version of the 
function won't work in an environment where `StringExtractor` stores a 
`StringRef` instead of a `std::string`, and on top of that they are unsafe 
since modifying the `StringExtractor` by exposing its internals breaks 
encapsulation and requires the user to remember to update the file pos lest the 
class enter an invalid state.

So I add a new `SetString()` method.  Instead of calling `GetStringRef()` and 
then manipulating the result, you just manipulate a `std::string` you create 
yourself, and then call `SetString()`.

Because calls to the `const` version of `GetStringRef()` are changed to using 
`Peek()`, certain functions that were reproducing functionality already built 
in to `StringRef` have been simplified quite a bit.

https://reviews.llvm.org/D24013

Files:
  include/lldb/Core/Event.h
  include/lldb/Core/RegularExpression.h
  include/lldb/Utility/StringExtractor.h
  source/Core/Event.cpp
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  source/Utility/StringExtractor.cpp
  source/Utility/StringExtractorGDBRemote.cpp
  unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
  unittests/Utility/StringExtractorTest.cpp

Index: unittests/Utility/StringExtractorTest.cpp
===
--- unittests/Utility/StringExtractorTest.cpp
+++ unittests/Utility/StringExtractorTest.cpp
@@ -17,7 +17,7 @@
 
 ASSERT_EQ (true, ex.IsGood());
 ASSERT_EQ (0u, ex.GetFilePos());
-ASSERT_STREQ (kEmptyString, ex.GetStringRef().c_str());
+ASSERT_EQ(kEmptyString, ex.Peek());
 ASSERT_EQ (true, ex.Empty());
 ASSERT_EQ (0u, ex.GetBytesLeft());
 }
@@ -29,12 +29,53 @@
 
 ASSERT_EQ (true, ex.IsGood());
 ASSERT_EQ (0u, ex.GetFilePos());
-ASSERT_STREQ (kInitMiscString, ex.GetStringRef().c_str());
+ASSERT_EQ(kInitMiscString, ex.Peek());
 ASSERT_EQ (false, ex.Empty());
 ASSERT_EQ (sizeof(kInitMiscString)-1, ex.GetBytesLeft());
 ASSERT_EQ(kInitMiscString[0], ex.PeekChar());
 }
 
+TEST_F(StringExtractorTest, PeekAndGetSize)
+{
+llvm::StringRef Str("StringExtractorTest::Size()");
+StringExtractor ex(Str);
+
+EXPECT_EQ(true, ex.IsGood());
+EXPECT_EQ(0u, ex.GetFilePos());
+EXPECT_EQ(Str.size(), ex.GetTotalBytes());
+EXPECT_EQ(Str.size(), ex.GetBytesLeft());
+
+EXPECT_EQ('S', ex.PeekChar());
+EXPECT_EQ(Str.size(), ex.GetTotalBytes());
+EXPECT_EQ(Str.size(), ex.GetBytesLeft());
+EXPECT_EQ(Str, ex.Peek());
+
+EXPECT_EQ('S', ex.GetChar());
+EXPECT_EQ(Str.size(), ex.GetTotalBytes());
+EXPECT_EQ(Str.size() - 1, ex.GetBytesLeft());
+EXPECT_EQ(Str.drop_front(1), ex.Peek());
+}
+
+TEST_F(StringExtractorTest, Consume)
+{
+llvm::StringRef Str("StringExtractorTest::Consume()");
+llvm::StringRef ConsumeStr("String");
+StringExtractor ex(Str);
+
+ASSERT_TRUE(ex.IsGood());
+ASSERT_EQ(0u, ex.GetFilePos());
+
+EXPECT_EQ(Str.size(), ex.GetBytesLeft());
+EXPECT_FALSE(ex.Consume("Blah"));
+EXPECT_EQ(Str.size(), ex.GetBytesLeft());
+EXPECT_EQ(Str, ex.Peek());
+
+EXPECT_TRUE(ex.Consume(ConsumeStr));
+EXPECT_EQ(Str.size() - ConsumeStr.size(), ex.GetBytesLeft());
+EXPECT_EQ("ExtractorTest::Consume()", ex.Peek());
+;
+}
+
 TEST_F (StringExtractorTest, DecodeHexU8_Underflow)
 {
 const char kEmptyString[] = "";
Index: unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
===
--- unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -41,7 +41,7 @@
 {
 StringExtractorGDBRemote request;
 ASSERT_EQ(PacketResult::Success, server.GetPacket(request));
-

[Lldb-commits] [lldb] r280000 - Convert GetNameColonValue to return StringRefs.

2016-08-29 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Aug 29 14:58:14 2016
New Revision: 28

URL: http://llvm.org/viewvc/llvm-project?rev=28=rev
Log:
Convert GetNameColonValue to return StringRefs.

StringExtractor::GetNameColonValue() looks for a substring of the
form ":" and returns  and  to the caller.
This results in two unnecessary string copies, since the name and
value are not translated in any way and simply returned as-is.

By converting this to return StringRefs we can get rid of hundreds
of string copies.

Modified:
lldb/trunk/include/lldb/Interpreter/Args.h
lldb/trunk/include/lldb/Utility/StringExtractor.h
lldb/trunk/source/Interpreter/Args.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Utility/StringExtractor.cpp
lldb/trunk/source/Utility/StringExtractorGDBRemote.h
lldb/trunk/unittests/Utility/StringExtractorTest.cpp

Modified: lldb/trunk/include/lldb/Interpreter/Args.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/Args.h?rev=28=27=28=diff
==
--- lldb/trunk/include/lldb/Interpreter/Args.h (original)
+++ lldb/trunk/include/lldb/Interpreter/Args.h Mon Aug 29 14:58:14 2016
@@ -397,6 +397,9 @@ public:
 static bool
 StringToBoolean (const char *s, bool fail_value, bool *success_ptr);
 
+static bool
+StringToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr);
+
 static char StringToChar(const char *s, char fail_value, bool 
*success_ptr);
 
 static int64_t
@@ -405,6 +408,7 @@ public:
 static lldb::ScriptLanguage
 StringToScriptLanguage (const char *s, lldb::ScriptLanguage fail_value, 
bool *success_ptr);
 
+// TODO: Use StringRef
 static Error
 StringToFormat (const char *s,
 lldb::Format ,
@@ -414,9 +418,16 @@ public:
 StringToEncoding (const char *s,
   lldb::Encoding fail_value = lldb::eEncodingInvalid);
 
+static lldb::Encoding
+StringToEncoding(llvm::StringRef s, lldb::Encoding fail_value = 
lldb::eEncodingInvalid);
+
 static uint32_t
 StringToGenericRegister (const char *s);
-
+
+static uint32_t
+StringToGenericRegister(llvm::StringRef s);
+
+// TODO: Update to take a StringRef
 static const char *
 StringToVersion (const char *s, uint32_t , uint32_t , uint32_t 
);
 

Modified: lldb/trunk/include/lldb/Utility/StringExtractor.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/StringExtractor.h?rev=28=27=28=diff
==
--- lldb/trunk/include/lldb/Utility/StringExtractor.h (original)
+++ lldb/trunk/include/lldb/Utility/StringExtractor.h Mon Aug 29 14:58:14 2016
@@ -17,6 +17,7 @@
 
 // Other libraries and framework includes
 // Project includes
+#include "llvm/ADT/StringRef.h"
 
 class StringExtractor
 {
@@ -30,6 +31,7 @@ public:
 // Constructors and Destructors
 //--
 StringExtractor();
+StringExtractor(llvm::StringRef packet_str);
 StringExtractor(const char *packet_cstr);
 StringExtractor(const StringExtractor& rhs);
 virtual ~StringExtractor();
@@ -118,7 +120,7 @@ public:
 GetHexU8Ex (uint8_t& ch, bool set_eof_on_fail = true);
 
 bool
-GetNameColonValue (std::string , std::string );
+GetNameColonValue(llvm::StringRef , llvm::StringRef );
 
 int32_t
 GetS32 (int32_t fail_value, int base = 0);
@@ -166,6 +168,12 @@ public:
 }
 
 protected:
+bool
+fail()
+{
+m_index = UINT64_MAX;
+return false;
+}
 //--
 // For StringExtractor only
 //--

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=28=27=28=diff
==
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Mon Aug 29 14:58:14 2016
@@ -25,6 +25,8 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 
+#include "llvm/ADT/StringSwitch.h"
+
 using namespace lldb;
 using namespace lldb_private;
 
@@ -838,7 +840,14 @@ Args::StripSpaces (std::string , bool
 bool
 Args::StringToBoolean (const char *s, bool fail_value, bool *success_ptr)
 {
-llvm::StringRef ref = llvm::StringRef(s).trim();
+if (!s)
+return fail_value;
+return 

[Lldb-commits] [lldb] r279997 - Copy StringExtractor to StdStringExtractor.

2016-08-29 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Aug 29 14:45:59 2016
New Revision: 279997

URL: http://llvm.org/viewvc/llvm-project?rev=279997=rev
Log:
Copy StringExtractor to StdStringExtractor.

I have some improvements to make to StringExtractor that require
using LLVM.  debugserver can't take a dependency on LLVM but uses
this file, so I'm forking it off into StdStringExtractor and
StringExtractor, so that StringExtractor can take advantage of
some performance improvements and readability improvements that
LLVM can provide.

Added:
lldb/trunk/include/lldb/Utility/StdStringExtractor.h
lldb/trunk/source/Utility/StdStringExtractor.cpp
Modified:
lldb/trunk/source/Utility/CMakeLists.txt
lldb/trunk/tools/debugserver/source/JSON.cpp
lldb/trunk/tools/debugserver/source/JSON.h
lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Added: lldb/trunk/include/lldb/Utility/StdStringExtractor.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/StdStringExtractor.h?rev=279997=auto
==
--- lldb/trunk/include/lldb/Utility/StdStringExtractor.h (added)
+++ lldb/trunk/include/lldb/Utility/StdStringExtractor.h Mon Aug 29 14:45:59 
2016
@@ -0,0 +1,181 @@
+//===-- StdStringExtractor.h *- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef utility_StdStringExtractor_h_
+#define utility_StdStringExtractor_h_
+
+// C Includes
+// C++ Includes
+#include 
+#include 
+
+// Other libraries and framework includes
+// Project includes
+
+// Based on StringExtractor, with the added limitation that this file should 
not
+// take a dependency on LLVM, as it is used from debugserver.
+class StdStringExtractor
+{
+public:
+
+enum {
+BigEndian = 0,
+LittleEndian = 1
+};
+//--
+// Constructors and Destructors
+//--
+StdStringExtractor();
+StdStringExtractor(const char *packet_cstr);
+StdStringExtractor(const StdStringExtractor& rhs);
+virtual ~StdStringExtractor();
+
+//--
+// Operators
+//--
+const StdStringExtractor&
+operator=(const StdStringExtractor& rhs);
+
+// Returns true if the file position is still valid for the data
+// contained in this string extractor object.
+bool
+IsGood() const
+{
+return m_index != UINT64_MAX;
+}
+
+uint64_t
+GetFilePos () const
+{
+return m_index;
+}
+
+void
+SetFilePos (uint32_t idx)
+{
+m_index = idx;
+}
+
+void
+Clear ()
+{
+m_packet.clear();
+m_index = 0;
+}
+
+void
+SkipSpaces ();
+
+std::string &
+GetStringRef ()
+{
+return m_packet;
+}
+
+const std::string &
+GetStringRef () const
+{
+return m_packet;
+}
+
+bool
+Empty()
+{
+return m_packet.empty();
+}
+
+size_t
+GetBytesLeft ()
+{
+if (m_index < m_packet.size())
+return m_packet.size() - m_index;
+return 0;
+}
+
+char
+GetChar (char fail_value = '\0');
+
+char
+PeekChar (char fail_value = '\0')
+{
+const char *cstr = Peek();
+if (cstr)
+return cstr[0];
+return fail_value;
+}
+
+int
+DecodeHexU8();
+
+uint8_t
+GetHexU8 (uint8_t fail_value = 0, bool set_eof_on_fail = true);
+
+bool
+GetHexU8Ex (uint8_t& ch, bool set_eof_on_fail = true);
+
+bool
+GetNameColonValue (std::string , std::string );
+
+int32_t
+GetS32 (int32_t fail_value, int base = 0);
+
+uint32_t
+GetU32 (uint32_t fail_value, int base = 0);
+
+int64_t
+GetS64 (int64_t fail_value, int base = 0);
+
+uint64_t
+GetU64 (uint64_t fail_value, int base = 0);
+
+uint32_t
+GetHexMaxU32 (bool little_endian, uint32_t fail_value);
+
+uint64_t
+GetHexMaxU64 (bool little_endian, uint64_t fail_value);
+
+size_t
+GetHexBytes (void *dst, size_t dst_len, uint8_t fail_fill_value);
+
+size_t
+GetHexBytesAvail (void *dst, size_t dst_len);
+
+uint64_t
+GetHexWithFixedSize (uint32_t byte_size, bool little_endian, uint64_t 
fail_value);
+
+size_t
+GetHexByteString (std::string );
+
+size_t
+GetHexByteStringFixedLength (std::string , uint32_t nibble_length);
+
+size_t
+GetHexByteStringTerminatedBy (std::string ,
+  char terminator);
+
+const char *
+Peek ()
+   

[Lldb-commits] [lldb] r279994 - Remove std::atomic from lldb::Address.

2016-08-29 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Aug 29 14:30:26 2016
New Revision: 279994

URL: http://llvm.org/viewvc/llvm-project?rev=279994=rev
Log:
Remove std::atomic from lldb::Address.

std::atomic requires 64-bit alignment in order to
guarantee atomicity.  Normally the compiler is pretty good about
aligning types, but an exception to this is when the type is
passed by value as a function parameter.  In this case, if your
stack is 4-byte aligned, most modern compilers (including clang
as of LLVM 4.0) fail to align the type, rendering the atomicity
ineffective.

A deeper investigation of the class's implementation suggests
that the use of atomic was in vain anyway, because if the class
were to be shared amongst multiple threads, there were already
other data races present, and that the proper way to ensure
thread-safe access to this data would be to use a mutex from a
higher level.

Since the std::atomic was not serving its intended purpose anyway,
and since the presence of it generates compiler errors on some
platforms that cannot be workaround, we remove std::atomic from
Address here.  Although unlikely, if data races do resurface
the proper fix should involve a mutex from a higher level, or an
attempt to limit the Address's access to a single thread.

Modified:
lldb/trunk/include/lldb/Core/Address.h
lldb/trunk/source/Core/Address.cpp

Modified: lldb/trunk/include/lldb/Core/Address.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=279994=279993=279994=diff
==
--- lldb/trunk/include/lldb/Core/Address.h (original)
+++ lldb/trunk/include/lldb/Core/Address.h Mon Aug 29 14:30:26 2016
@@ -12,7 +12,6 @@
 
 // C Includes
 // C++ Includes
-#include 
 
 // Other libraries and framework includes
 // Project includes
@@ -119,7 +118,7 @@ public:
 //--
 Address (const Address& rhs) :
 m_section_wp (rhs.m_section_wp),
-m_offset(rhs.m_offset.load())
+m_offset(rhs.m_offset)
 {
 }
 
@@ -556,7 +555,7 @@ protected:
 // Member variables.
 //--
 lldb::SectionWP m_section_wp;   ///< The section for the address, can be 
NULL.
-std::atomic m_offset;  ///< Offset into section if \a 
m_section_wp is valid...
+lldb::addr_t m_offset;  ///< Offset into section if \a 
m_section_wp is valid...
 
 //--
 // Returns true if the m_section_wp once had a reference to a valid

Modified: lldb/trunk/source/Core/Address.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Address.cpp?rev=279994=279993=279994=diff
==
--- lldb/trunk/source/Core/Address.cpp (original)
+++ lldb/trunk/source/Core/Address.cpp Mon Aug 29 14:30:26 2016
@@ -235,7 +235,7 @@ Address::operator= (const Address& rhs)
 if (this != )
 {
 m_section_wp = rhs.m_section_wp;
-m_offset = rhs.m_offset.load();
+m_offset = rhs.m_offset;
 }
 return *this;
 }
@@ -429,7 +429,7 @@ Address::Dump (Stream *s, ExecutionConte
 if (section_sp)
 {
 section_sp->DumpName(s);
-s->Printf (" + %" PRIu64, m_offset.load());
+s->Printf (" + %" PRIu64, m_offset);
 }
 else
 {


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


Re: [Lldb-commits] [PATCH] D23952: Remove unused frame_zero_id local variable

2016-08-29 Thread Jim Ingham via lldb-commits
jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

Thanks for finding that.


https://reviews.llvm.org/D23952



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


Re: [Lldb-commits] [PATCH] D23951: Remove unused any_found local variable

2016-08-29 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.
This revision is now accepted and ready to land.

LGTM


https://reviews.llvm.org/D23951



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


Re: [Lldb-commits] [PATCH] D23950: Remove unused local variable

2016-08-29 Thread Enrico Granata via lldb-commits
granata.enrico accepted this revision.
granata.enrico added a comment.
This revision is now accepted and ready to land.

Looks good to me


https://reviews.llvm.org/D23950



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


Re: [Lldb-commits] [PATCH] D23977: Support of lldb on Kfreebsd

2016-08-29 Thread Ed Maste via lldb-commits
emaste added a subscriber: emaste.
emaste added a comment.

- in the future can you please upload with context (e.g. git diff -U)
- I think the OS names in utilsOsType.py are kept sorted and the actual enum 
values are not part of an ABI


https://reviews.llvm.org/D23977



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


Re: [Lldb-commits] [PATCH] D23882: Replace uses of MIUtilParse::CRegexParser with llvm::Regex

2016-08-29 Thread Ilia K via lldb-commits
ki.stfu accepted this revision.
ki.stfu added a comment.
This revision is now accepted and ready to land.

lgtm if tests are passed


https://reviews.llvm.org/D23882



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


Re: [Lldb-commits] [PATCH] D23977: Support of lldb on Kfreebsd

2016-08-29 Thread Kamil Rytarowski via lldb-commits
krytarowski added a subscriber: krytarowski.


Comment at: cmake/LLDBDependencies.cmake:168
@@ -167,3 +167,3 @@
 # On FreeBSD/NetBSD backtrace() is provided by libexecinfo, not libc.
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+if ((CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES 
"NetBSD") AND NOT CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD")
   list(APPEND LLDB_SYSTEM_LIBS execinfo)

brucem wrote:
> This really should turn into a check so that we don't need this to be 
> extended for every single OS that gets added.
There is now support for CMake >= 3.0, which offers a builtin check for it.


https://reviews.llvm.org/D23977



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