Re: [Lldb-commits] [lldb] r245217 - [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode support

2015-08-18 Thread via lldb-commits

Hi Hans,

The file RegisterContext_mips64.h was replaced with 
RegisterContext_mips.h in master branch.

In the release branch, the file RegisterContext_mips64.h still exists.
Could you please delete RegisterContext_mips64.h from the release branch ?

Regards,
Sagar

On Tuesday 18 August 2015 02:47 AM, Hans Wennborg wrote:

Merged to 3.7 in r245240. There was a conflicts because r245141 isn't
on the branch. Please check that I got it right:
http://llvm.org/viewvc/llvm-project?rev=245240&view=rev

Thanks,
Hans

On Mon, Aug 17, 2015 at 1:28 PM, Greg Clayton  wrote:

Ok to merge.

On Aug 17, 2015, at 1:26 PM, Hans Wennborg  wrote:

I'm OK with it if Greg approves.

- Hans

On Mon, Aug 17, 2015 at 7:07 AM,   wrote:

Hi Hans,

Could you please also merge r245217 in the release branch.

Thanks,
Sagar

-Original Message-
From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of
Sagar Thakur via lldb-commits
Sent: 17 August 2015 19:10
To: lldb-commits@lists.llvm.org
Subject: [Lldb-commits] [lldb] r245217 - [LLDB][MIPS] Fix offsets of all
register sets and add MSA regset and FRE=1 mode support

Author: slthakur
Date: Mon Aug 17 08:40:17 2015
New Revision: 245217

URL: http://llvm.org/viewvc/llvm-project?rev=245217&view=rev
Log:
[LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1
mode support


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


Re: [Lldb-commits] [lldb] r245216 - [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue

2015-08-18 Thread Pavel Labath via lldb-commits
Hi all,

This commit was reverted in r245222 as it was causing failures on the
linux build-bot. It has a number of issues
 and I would prefer if it were not
merged until these are resolved. And in any case, this doesn't seem
like a "critical bug fix" suitable for merge in Testing Phase II.

pl


On 17 August 2015 at 21:29, Greg Clayton via lldb-commits
 wrote:
> Ok to merge.
>> On Aug 17, 2015, at 1:27 PM, Hans Wennborg  wrote:
>>
>> +lldb-commits
>>
>> On Mon, Aug 17, 2015 at 1:25 PM, Hans Wennborg  wrote:
>>> I'm OK with it if Greg approves.
>>>
>>> - Hans
>>>
>>> On Mon, Aug 17, 2015 at 7:06 AM,   wrote:
 Hi Hans,

 Could you please merge r245216 in the release branch?

 Thanks,
 Sagar

 -Original Message-
 From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf 
 Of
 Sagar Thakur via lldb-commits
 Sent: 17 August 2015 17:36
 To: lldb-commits@lists.llvm.org
 Subject: [Lldb-commits] [lldb] r245216 - [LLDB] Use llvm::APInt and
 llvm::APFloat in Scalar and RegisterValue

 Author: slthakur
 Date: Mon Aug 17 07:05:31 2015
 New Revision: 245216

 URL: http://llvm.org/viewvc/llvm-project?rev=245216&view=rev
 Log:
 [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue
>
> ___
> 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] [PATCH] D12083: [LLGS] Avoid misrepresenting log lines as inferior output

2015-08-18 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL245272: [LLGS] Avoid misrepresenting log lines as inferior 
output (authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D12083?vs=32298&id=32383#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12083

Files:
  lldb/trunk/source/Core/Log.cpp
  lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp

Index: lldb/trunk/source/Core/Log.cpp
===
--- lldb/trunk/source/Core/Log.cpp
+++ lldb/trunk/source/Core/Log.cpp
@@ -449,7 +449,7 @@
 {
 CallbackMap &callback_map = GetCallbackMap ();
 CallbackMapIter pos, end = callback_map.end();
-const char *categories[1] = {NULL};
+const char *categories[] = {"all", nullptr};
 
 for (pos = callback_map.begin(); pos != end; ++pos)
 pos->second.disable (categories, feedback_strm);
Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
===
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -560,8 +560,11 @@
 // Child process.
 if (pid == 0)
 {
+// First, make sure we disable all logging. If we are logging to 
stdout, our logs can be
+// mistaken for inferior output.
+Log::DisableAllLogChannels(nullptr);
 // FIXME consider opening a pipe between parent/child and have this 
forked child
-// send log info to parent re: launch status, in place of the log 
lines removed here.
+// send log info to parent re: launch status.
 
 // Start tracing this child that is about to exec.
 error = PtraceWrapper(PTRACE_TRACEME, 0);


Index: lldb/trunk/source/Core/Log.cpp
===
--- lldb/trunk/source/Core/Log.cpp
+++ lldb/trunk/source/Core/Log.cpp
@@ -449,7 +449,7 @@
 {
 CallbackMap &callback_map = GetCallbackMap ();
 CallbackMapIter pos, end = callback_map.end();
-const char *categories[1] = {NULL};
+const char *categories[] = {"all", nullptr};
 
 for (pos = callback_map.begin(); pos != end; ++pos)
 pos->second.disable (categories, feedback_strm);
Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
===
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -560,8 +560,11 @@
 // Child process.
 if (pid == 0)
 {
+// First, make sure we disable all logging. If we are logging to stdout, our logs can be
+// mistaken for inferior output.
+Log::DisableAllLogChannels(nullptr);
 // FIXME consider opening a pipe between parent/child and have this forked child
-// send log info to parent re: launch status, in place of the log lines removed here.
+// send log info to parent re: launch status.
 
 // Start tracing this child that is about to exec.
 error = PtraceWrapper(PTRACE_TRACEME, 0);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r245272 - [LLGS] Avoid misrepresenting log lines as inferior output

2015-08-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Aug 18 03:23:35 2015
New Revision: 245272

URL: http://llvm.org/viewvc/llvm-project?rev=245272&view=rev
Log:
[LLGS] Avoid misrepresenting log lines as inferior output

Summary:
in case we are logging to stdout, any log lines from the forked child can be 
misconstrued to be
inferior output. To avoid this, we disable all logging immediately after 
forking.

I also fix the implementatoion of DisableAllLogChannels, which was a no-op 
before this commit.

Reviewers: clayborg, ovyalov

Subscribers: dean, lldb-commits

Differential Revision: http://reviews.llvm.org/D12083

Modified:
lldb/trunk/source/Core/Log.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp

Modified: lldb/trunk/source/Core/Log.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Log.cpp?rev=245272&r1=245271&r2=245272&view=diff
==
--- lldb/trunk/source/Core/Log.cpp (original)
+++ lldb/trunk/source/Core/Log.cpp Tue Aug 18 03:23:35 2015
@@ -449,7 +449,7 @@ Log::DisableAllLogChannels (Stream *feed
 {
 CallbackMap &callback_map = GetCallbackMap ();
 CallbackMapIter pos, end = callback_map.end();
-const char *categories[1] = {NULL};
+const char *categories[] = {"all", nullptr};
 
 for (pos = callback_map.begin(); pos != end; ++pos)
 pos->second.disable (categories, feedback_strm);

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=245272&r1=245271&r2=245272&view=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Tue Aug 18 
03:23:35 2015
@@ -560,8 +560,11 @@ NativeProcessLinux::Launch(LaunchArgs *a
 // Child process.
 if (pid == 0)
 {
+// First, make sure we disable all logging. If we are logging to 
stdout, our logs can be
+// mistaken for inferior output.
+Log::DisableAllLogChannels(nullptr);
 // FIXME consider opening a pipe between parent/child and have this 
forked child
-// send log info to parent re: launch status, in place of the log 
lines removed here.
+// send log info to parent re: launch status.
 
 // Start tracing this child that is about to exec.
 error = PtraceWrapper(PTRACE_TRACEME, 0);


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


[Lldb-commits] [lldb] r245273 - Fix AArch64 watchpoint exception handling

2015-08-18 Thread Omair Javaid via lldb-commits
Author: omjavaid
Date: Tue Aug 18 03:28:06 2015
New Revision: 245273

URL: http://llvm.org/viewvc/llvm-project?rev=245273&view=rev
Log:
Fix AArch64 watchpoint exception handling
http://reviews.llvm.org/D11987

Modified:

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

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp?rev=245273&r1=245272&r2=245273&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
 Tue Aug 18 03:28:06 2015
@@ -181,7 +181,9 @@ GDBRemoteCommunicationServerCommon::Hand
 else
 response.Printf("watchpoint_exceptions_received:after;");
 #else
-if (host_arch.GetMachine() == llvm::Triple::mips64 ||
+if (host_arch.GetMachine() == llvm::Triple::aarch64 ||
+host_arch.GetMachine() == llvm::Triple::aarch64_be ||
+host_arch.GetMachine() == llvm::Triple::mips64 ||
 host_arch.GetMachine() == llvm::Triple::mips64el)
 response.Printf("watchpoint_exceptions_received:before;");
 else


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


[Lldb-commits] [lldb] r245275 - Fix Clang-tidy misc-use-override warnings in some files in include/lldb/Core, unify closing inclusion guards

2015-08-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Aug 18 03:39:09 2015
New Revision: 245275

URL: http://llvm.org/viewvc/llvm-project?rev=245275&view=rev
Log:
Fix Clang-tidy misc-use-override warnings in some files in include/lldb/Core, 
unify closing inclusion guards

patch by Eugene Zelenko

Differential Revision: http://reviews.llvm.org/D11695

Modified:
lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h
lldb/trunk/include/lldb/Core/DataBufferHeap.h
lldb/trunk/include/lldb/Core/DataBufferMemoryMap.h
lldb/trunk/include/lldb/Core/StructuredData.h
lldb/trunk/include/lldb/Core/ValueObjectCast.h
lldb/trunk/include/lldb/Core/ValueObjectChild.h
lldb/trunk/include/lldb/Core/ValueObjectConstResult.h
lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h
lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h
lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h

Modified: lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h?rev=245275&r1=245274&r2=245275&view=diff
==
--- lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h (original)
+++ lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h Tue Aug 18 03:39:09 
2015
@@ -28,33 +28,32 @@ public:
 
 ConnectionSharedMemory ();
 
-virtual
-~ConnectionSharedMemory ();
+~ConnectionSharedMemory () override;
 
-virtual bool
-IsConnected () const;
+bool
+IsConnected () const override;
 
 virtual lldb::ConnectionStatus
 BytesAvailable (uint32_t timeout_usec, Error *error_ptr);
 
-virtual lldb::ConnectionStatus
-Connect (const char *s, Error *error_ptr);
+lldb::ConnectionStatus
+Connect (const char *s, Error *error_ptr) override;
 
-virtual lldb::ConnectionStatus
-Disconnect (Error *error_ptr);
+lldb::ConnectionStatus
+Disconnect (Error *error_ptr) override;
 
-virtual size_t
+size_t
 Read (void *dst, 
   size_t dst_len, 
   uint32_t timeout_usec,
   lldb::ConnectionStatus &status, 
-  Error *error_ptr);
+  Error *error_ptr) override;
 
-virtual size_t
-Write (const void *src, size_t src_len, lldb::ConnectionStatus &status, 
Error *error_ptr);
+size_t
+Write (const void *src, size_t src_len, lldb::ConnectionStatus &status, 
Error *error_ptr) override;
 
-virtual std::string
-GetURI();
+std::string
+GetURI() override;
 
 lldb::ConnectionStatus
 Open (bool create, const char *name, size_t size, Error *error_ptr);
@@ -64,10 +63,12 @@ protected:
 std::string m_name;
 int m_fd;// One buffer that contains all we need
 DataBufferMemoryMap m_mmap;
+
 private:
+
 DISALLOW_COPY_AND_ASSIGN (ConnectionSharedMemory);
 };
 
 } // namespace lldb_private
 
-#endif  // liblldb_ConnectionSharedMemory_h_
+#endif // liblldb_ConnectionSharedMemory_h_

Modified: lldb/trunk/include/lldb/Core/DataBufferHeap.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DataBufferHeap.h?rev=245275&r1=245274&r2=245275&view=diff
==
--- lldb/trunk/include/lldb/Core/DataBufferHeap.h (original)
+++ lldb/trunk/include/lldb/Core/DataBufferHeap.h Tue Aug 18 03:39:09 2015
@@ -9,7 +9,6 @@
 
 #ifndef liblldb_DataBufferHeap_h_
 #define liblldb_DataBufferHeap_h_
-#if defined(__cplusplus)
 
 #include 
 
@@ -69,26 +68,25 @@ public:
 /// Virtual destructor since this class inherits from a pure virtual
 /// base class #DataBuffer.
 //--
-virtual
-~DataBufferHeap();
+~DataBufferHeap() override;
 
 //--
 /// @copydoc DataBuffer::GetBytes()
 //--
-virtual uint8_t *
-GetBytes ();
+uint8_t *
+GetBytes () override;
 
 //--
 /// @copydoc DataBuffer::GetBytes() const
 //--
-virtual const uint8_t *
-GetBytes () const;
+const uint8_t *
+GetBytes () const override;
 
 //--
 /// @copydoc DataBuffer::GetByteSize() const
 //--
-virtual lldb::offset_t
-GetByteSize () const;
+lldb::offset_t
+GetByteSize () const override;
 
 //--
 /// Set the number of bytes in the data buffer.
@@ -138,5 +136,4 @@ private:
 
 } // namespace lldb_private
 
-#endif  // #if defined(__cplusplus)
-#endif  // liblldb_DataBufferHeap_h_
+#endif // liblldb_Da

[Lldb-commits] [lldb] r245277 - Fix Clang-tidy misc-use-override warnings in include/lldb/Utility and some files in include/lldb/Target, unify closing inclusion guards

2015-08-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Aug 18 03:54:26 2015
New Revision: 245277

URL: http://llvm.org/viewvc/llvm-project?rev=245277&view=rev
Log:
Fix Clang-tidy misc-use-override warnings in include/lldb/Utility and some 
files in include/lldb/Target, unify closing inclusion guards

patch by Eugene Zelenko.

Differential Revision: http://reviews.llvm.org/D11701

Modified:
lldb/trunk/include/lldb/Target/ABI.h
lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h
lldb/trunk/include/lldb/Target/DynamicLoader.h
lldb/trunk/include/lldb/Target/LanguageRuntime.h
lldb/trunk/include/lldb/Target/OperatingSystem.h
lldb/trunk/include/lldb/Target/Platform.h
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/include/lldb/Target/StackFrame.h
lldb/trunk/include/lldb/Target/SystemRuntime.h
lldb/trunk/include/lldb/Target/TargetList.h
lldb/trunk/include/lldb/Target/Thread.h
lldb/trunk/include/lldb/Target/ThreadList.h
lldb/trunk/include/lldb/Target/UnwindAssembly.h
lldb/trunk/include/lldb/Utility/JSON.h
lldb/trunk/include/lldb/Utility/SharedCluster.h
lldb/trunk/include/lldb/Utility/SharingPtr.h

Modified: lldb/trunk/include/lldb/Target/ABI.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ABI.h?rev=245277&r1=245276&r2=245277&view=diff
==
--- lldb/trunk/include/lldb/Target/ABI.h (original)
+++ lldb/trunk/include/lldb/Target/ABI.h Tue Aug 18 03:54:26 2015
@@ -44,8 +44,7 @@ public:
 std::unique_ptr data_ap; /* host data pointer */
 };
 
-virtual
-~ABI();
+~ABI() override;
 
 virtual size_t
 GetRedZoneSize () const = 0;
@@ -148,14 +147,17 @@ public:
 FindPlugin (const ArchSpec &arch);
 
 protected:
+
 //--
 // Classes that inherit from ABI can see and modify these
 //--
 ABI();
+
 private:
+
 DISALLOW_COPY_AND_ASSIGN (ABI);
 };
 
 } // namespace lldb_private
 
-#endif  // liblldb_ABI_h_
+#endif // liblldb_ABI_h_

Modified: lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h?rev=245277&r1=245276&r2=245277&view=diff
==
--- lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h Tue Aug 18 03:54:26 2015
@@ -114,11 +114,10 @@ public:
 bool m_parse_error;
 };
 
-virtual
-~CPPLanguageRuntime();
+~CPPLanguageRuntime() override;
 
-virtual lldb::LanguageType
-GetLanguageType () const
+lldb::LanguageType
+GetLanguageType() const override
 {
 return lldb::eLanguageTypeC_plus_plus;
 }
@@ -126,11 +125,11 @@ public:
 virtual bool
 IsVTableName (const char *name) = 0;
 
-virtual bool
-GetObjectDescription (Stream &str, ValueObject &object);
+bool
+GetObjectDescription(Stream &str, ValueObject &object) override;
 
-virtual bool
-GetObjectDescription (Stream &str, Value &value, ExecutionContextScope 
*exe_scope);
+bool
+GetObjectDescription(Stream &str, Value &value, ExecutionContextScope 
*exe_scope) override;
 
 static bool
 IsCPPMangledName(const char *name);
@@ -157,14 +156,17 @@ public:
 GetAlternateManglings(const ConstString &mangled, std::vector 
&alternates) = 0;
 
 protected:
+
 //--
 // Classes that inherit from CPPLanguageRuntime can see and modify these
 //--
 CPPLanguageRuntime(Process *process);
+
 private:
+
 DISALLOW_COPY_AND_ASSIGN (CPPLanguageRuntime);
 };
 
 } // namespace lldb_private
 
-#endif  // liblldb_CPPLanguageRuntime_h_
+#endif // liblldb_CPPLanguageRuntime_h_

Modified: lldb/trunk/include/lldb/Target/DynamicLoader.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/DynamicLoader.h?rev=245277&r1=245276&r2=245277&view=diff
==
--- lldb/trunk/include/lldb/Target/DynamicLoader.h (original)
+++ lldb/trunk/include/lldb/Target/DynamicLoader.h Tue Aug 18 03:54:26 2015
@@ -71,8 +71,7 @@ public:
 /// The destructor is virtual since this class is designed to be
 /// inherited from by the plug-in instance.
 //--
-virtual
-~DynamicLoader ();
+~DynamicLoader() override;
 
 //--
 /// Called after attaching a process.
@@ -303,11 +302,12 @@ protected:
 // Member variables.
 //

[Lldb-commits] [lldb] r245279 - Fix Clang-tidy misc-use-override warnings in include/lldb/DataFormatters and include/lldb/Host, unify closing inclusion guards

2015-08-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Aug 18 04:06:31 2015
New Revision: 245279

URL: http://llvm.org/viewvc/llvm-project?rev=245279&view=rev
Log:
Fix Clang-tidy misc-use-override warnings in include/lldb/DataFormatters and 
include/lldb/Host, unify closing inclusion guards

patch by Eugene Zelenko.

Differential Revision: http://reviews.llvm.org/D11729

Modified:
lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/DataFormatters/TypeFormat.h
lldb/trunk/include/lldb/DataFormatters/TypeSummary.h
lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h
lldb/trunk/include/lldb/DataFormatters/TypeValidator.h
lldb/trunk/include/lldb/Host/File.h
lldb/trunk/include/lldb/Host/Socket.h
lldb/trunk/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
lldb/trunk/include/lldb/Host/posix/HostThreadPosix.h
lldb/trunk/include/lldb/Host/posix/LockFilePosix.h

Modified: lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h?rev=245279&r1=245278&r2=245279&view=diff
==
--- lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h Tue Aug 18 
04:06:31 2015
@@ -203,23 +203,23 @@ namespace lldb_private {
 public:
 LibcxxVectorBoolSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
 
-virtual size_t
-CalculateNumChildren ();
+size_t
+CalculateNumChildren() override;
 
-virtual lldb::ValueObjectSP
-GetChildAtIndex (size_t idx);
+lldb::ValueObjectSP
+GetChildAtIndex(size_t idx) override;
 
-virtual bool
-Update();
+bool
+Update() override;
 
-virtual bool
-MightHaveChildren ();
+bool
+MightHaveChildren() override;
 
-virtual size_t
-GetIndexOfChildWithName (const ConstString &name);
+size_t
+GetIndexOfChildWithName(const ConstString &name) override;
 
-virtual
-~LibcxxVectorBoolSyntheticFrontEnd ();
+~LibcxxVectorBoolSyntheticFrontEnd() override;
+
 private:
 CompilerType m_bool_type;
 ExecutionContextRef m_exe_ctx_ref;
@@ -238,23 +238,23 @@ namespace lldb_private {
 public:
 LibstdcppMapIteratorSyntheticFrontEnd (lldb::ValueObjectSP 
valobj_sp);
 
-virtual size_t
-CalculateNumChildren ();
+size_t
+CalculateNumChildren() override;
 
-virtual lldb::ValueObjectSP
-GetChildAtIndex (size_t idx);
+lldb::ValueObjectSP
+GetChildAtIndex(size_t idx) override;
 
-virtual bool
-Update();
+bool
+Update() override;
 
-virtual bool
-MightHaveChildren ();
+bool
+MightHaveChildren() override;
 
-virtual size_t
-GetIndexOfChildWithName (const ConstString &name);
+size_t
+GetIndexOfChildWithName (const ConstString &name) override;
 
-virtual
-~LibstdcppMapIteratorSyntheticFrontEnd ();
+~LibstdcppMapIteratorSyntheticFrontEnd() override;
+
 private:
 ExecutionContextRef m_exe_ctx_ref;
 lldb::addr_t m_pair_address;
@@ -270,23 +270,23 @@ namespace lldb_private {
 public:
 LibCxxMapIteratorSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
 
-virtual size_t
-CalculateNumChildren ();
+size_t
+CalculateNumChildren() override;
 
-virtual lldb::ValueObjectSP
-GetChildAtIndex (size_t idx);
+lldb::ValueObjectSP
+GetChildAtIndex(size_t idx) override;
 
-virtual bool
-Update();
+bool
+Update() override;
 
-virtual bool
-MightHaveChildren ();
+bool
+MightHaveChildren() override;
 
-virtual size_t
-GetIndexOfChildWithName (const ConstString &name);
+size_t
+GetIndexOfChildWithName(const ConstString &name) override;
 
-virtual
-~LibCxxMapIteratorSyntheticFrontEnd ();
+~LibCxxMapIteratorSyntheticFrontEnd() override;
+
 private:
 ValueObject *m_pair_ptr;
 };
@@ -299,23 +299,23 @@ namespace lldb_private {

[Lldb-commits] [lldb] r245283 - Fix Clang-tidy misc-use-override warnings in include/lldb/Expression and include/lldb/Initialization, unify inclusion guards

2015-08-18 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Aug 18 04:18:19 2015
New Revision: 245283

URL: http://llvm.org/viewvc/llvm-project?rev=245283&view=rev
Log:
Fix Clang-tidy misc-use-override warnings in include/lldb/Expression and 
include/lldb/Initialization, unify inclusion guards

patch by Eugene Zelenko.

Differential Revision: http://reviews.llvm.org/D11744

Modified:
lldb/trunk/include/lldb/Expression/ASTResultSynthesizer.h
lldb/trunk/include/lldb/Expression/ASTStructExtractor.h
lldb/trunk/include/lldb/Expression/ClangASTSource.h
lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
lldb/trunk/include/lldb/Expression/ClangFunction.h
lldb/trunk/include/lldb/Expression/ClangModulesDeclVendor.h
lldb/trunk/include/lldb/Expression/ClangUserExpression.h
lldb/trunk/include/lldb/Expression/ClangUtilityFunction.h
lldb/trunk/include/lldb/Expression/IRDynamicChecks.h
lldb/trunk/include/lldb/Expression/IRExecutionUnit.h
lldb/trunk/include/lldb/Expression/IRForTarget.h
lldb/trunk/include/lldb/Initialization/SystemInitializerCommon.h

Modified: lldb/trunk/include/lldb/Expression/ASTResultSynthesizer.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ASTResultSynthesizer.h?rev=245283&r1=245282&r2=245283&view=diff
==
--- lldb/trunk/include/lldb/Expression/ASTResultSynthesizer.h (original)
+++ lldb/trunk/include/lldb/Expression/ASTResultSynthesizer.h Tue Aug 18 
04:18:19 2015
@@ -51,7 +51,7 @@ public:
 //--
 /// Destructor
 //--
-~ASTResultSynthesizer();
+~ASTResultSynthesizer() override;
 
 //--
 /// Link this consumer with a particular AST context
@@ -60,7 +60,7 @@ public:
 /// This AST context will be used for types and identifiers, and also
 /// forwarded to the passthrough consumer, if one exists.
 //--
-void Initialize(clang::ASTContext &Context);
+void Initialize(clang::ASTContext &Context) override;
 
 //--
 /// Examine a list of Decls to find the function $__lldb_expr and 
@@ -71,32 +71,32 @@ public:
 /// which need to be searched recursively.  That job falls to
 /// TransformTopLevelDecl.
 //--
-bool HandleTopLevelDecl(clang::DeclGroupRef D);
+bool HandleTopLevelDecl(clang::DeclGroupRef D) override;
 
 //--
 /// Passthrough stub
 //--
-void HandleTranslationUnit(clang::ASTContext &Ctx);
+void HandleTranslationUnit(clang::ASTContext &Ctx) override;
 
 //--
 /// Passthrough stub
 //--
-void HandleTagDeclDefinition(clang::TagDecl *D);
+void HandleTagDeclDefinition(clang::TagDecl *D) override;
 
 //--
 /// Passthrough stub
 //--
-void CompleteTentativeDefinition(clang::VarDecl *D);
+void CompleteTentativeDefinition(clang::VarDecl *D) override;
 
 //--
 /// Passthrough stub
 //--
-void HandleVTable(clang::CXXRecordDecl *RD);
+void HandleVTable(clang::CXXRecordDecl *RD) override;
 
 //--
 /// Passthrough stub
 //--
-void PrintStats();
+void PrintStats() override;
 
 //--
 /// Set the Sema object to use when performing transforms, and pass it on
@@ -105,12 +105,13 @@ public:
 /// The Sema to use.  Because Sema isn't externally visible, this class
 /// casts it to an Action for actual use.
 //--
-void InitializeSema(clang::Sema &S);
+void InitializeSema(clang::Sema &S) override;
 
 //--
 /// Reset the Sema to NULL now that transformations are done
 //--
-void ForgetSema();
+ 

Re: [Lldb-commits] [PATCH] D12025: Make LLDB URLs to support hex encoding for special symbols

2015-08-18 Thread Tamas Berghammer via lldb-commits
tberghammer accepted this revision.
tberghammer added a comment.
This revision is now accepted and ready to land.

I see your point. I am still not too happy with this approach but I don't have 
any better idea to solve it. I am fine with committing it in in this format and 
we can improve it later if we find a better approach.


http://reviews.llvm.org/D12025



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


Re: [Lldb-commits] [PATCH] D11947: Improve instruction emulation based stack unwinding

2015-08-18 Thread Tamas Berghammer via lldb-commits
tberghammer updated this revision to Diff 32395.
tberghammer added a comment.

Fix incorrect assert


http://reviews.llvm.org/D11947

Files:
  source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
  source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
  source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp

Index: source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
===
--- source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -580,8 +580,17 @@
 const uint32_t generic_regnum = reg_info->kinds[eRegisterKindGeneric];
 if (reg_num != LLDB_INVALID_REGNUM && generic_regnum != LLDB_REGNUM_GENERIC_SP)
 {
-m_curr_row->SetRegisterLocationToSame (reg_num, /*must_replace*/ false);
-m_curr_row_modified = true;
+if (context.info_type == EmulateInstruction::eInfoTypeAddress)
+{
+if (m_pushed_regs.find (reg_num) != m_pushed_regs.end () &&
+context.info.address == m_pushed_regs[reg_num])
+{
+m_curr_row->SetRegisterLocationToSame (reg_num, /*must_replace*/ false);
+m_curr_row_modified = true;
+}
+}
+else
+assert (!"unhandled case, add code to handle this!");
 }
 }
 }
Index: source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
===
--- source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
+++ source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
@@ -768,8 +768,6 @@
 Context context_t;
 Context context_t2;
 
-context_t.SetRegisterToRegisterPlusOffset (reg_info_Rt, reg_info_base, 0);
-context_t2.SetRegisterToRegisterPlusOffset (reg_info_Rt2, reg_info_base, size);
 uint8_t buffer [RegisterValue::kMaxRegisterByteSize];
 Error error;
 
@@ -787,6 +785,8 @@
 context_t.type = eContextRegisterStore;
 context_t2.type = eContextRegisterStore;
 }
+context_t.SetRegisterToRegisterPlusOffset (reg_info_Rt, reg_info_base, 0);
+context_t2.SetRegisterToRegisterPlusOffset (reg_info_Rt2, reg_info_base, size);
 
 if (!ReadRegister (®_info_Rt, data_Rt))
 return false;
@@ -820,6 +820,8 @@
 context_t.type = eContextRegisterLoad;
 context_t2.type = eContextRegisterLoad;
 }
+context_t.SetAddress(address);
+context_t2.SetAddress(address + size);
 
 if (rt_unknown)
 memset (buffer, 'U', reg_info_Rt.byte_size);
@@ -950,15 +952,14 @@
 return false;
 
 Context context;
-context.SetRegisterToRegisterPlusOffset (reg_info_Rt, reg_info_base, postindex ? 0 : offset);
-
 switch (memop)
 {
 case MemOp_STORE:
 if (n == 31 || n == GetFramePointerRegisterNumber()) // if this store is based off of the sp or fp register
 context.type = eContextPushRegisterOnStack;
 else
 context.type = eContextRegisterStore;
+context.SetRegisterToRegisterPlusOffset (reg_info_Rt, reg_info_base, postindex ? 0 : offset);
 
 if (!ReadRegister (®_info_Rt, data_Rt))
 return false;
@@ -975,6 +976,7 @@
 context.type = eContextPopRegisterOffStack;
 else
 context.type = eContextRegisterLoad;
+context.SetAddress(address);
 
 if (!ReadMemory (context, address, buffer, reg_info_Rt.byte_size))
 return false;
Index: source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
===
--- source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
+++ source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
@@ -578,7 +578,7 @@
 {
 if (BitIsSet (registers, i))
 {
-context.SetRegisterPlusOffset (sp_reg, addr - sp);
+context.SetAddress(addr);
 data = MemARead(context, addr, 4, 0, &success);
 if (!success)
 return false;
@@ -2214,7 +2214,7 @@
 for (i=0; i___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12100: [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue

2015-08-18 Thread Sagar Thakur via lldb-commits
sagar added a comment.

Hi,

I have corrected the patch for Scalar which was reverted in r245222 and 
addressed all concerns raised (http://reviews.llvm.org/rL245216) by Pavel 
Labath.
Could you please review it?


Repository:
  rL LLVM

http://reviews.llvm.org/D12100



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


Re: [Lldb-commits] [lldb] r245141 - A messy bit of cleanup: Move towards more descriptive names

2015-08-18 Thread Ed Maste via lldb-commits
On 15 August 2015 at 01:21, Jason Molenda via lldb-commits
 wrote:
>
> Author: jmolenda
> Date: Fri Aug 14 20:21:01 2015
> New Revision: 245141
>
> URL: http://llvm.org/viewvc/llvm-project?rev=245141&view=rev
> Log:
> A messy bit of cleanup: Move towards more descriptive names
> for eh_frame and stabs register numberings.  This is not
> complete but it's a step in the right direction.  It's almost
> entirely mechanical.

This change broke all tests on FreeBSD, like so:

Command invoked: timeout -s QUIT 4m /usr/local/bin/python2.7
/tank/emaste/src/llvm/tools/lldb/test/dotest.py -q --arch=x86_64
--executable /tank/emaste/src/llvm/build-nodebug/bin/lldb -s
/tank/emaste/src/llvm/build-nodebug/lldb-test-traces -u CXXFLAGS -u
CFLAGS -C /usr/bin/clang -p TestGdbRemoteProcessInfo.py
/tank/emaste/src/llvm/tools/lldb/test/tools/lldb-server
362 out of 388 test suites processed - TestGdbRemoteProcessInfo.py
Traceback (most recent call last):
  File "/tank/emaste/src/llvm/tools/lldb/test/dotest.py", line 1242, in 
setupSysPath()
  File "/tank/emaste/src/llvm/tools/lldb/test/dotest.py", line 1061,
in setupSysPath
print "  4) The executable '%s' could not be found.  Please check
" % lldbExecutable
NameError: global name 'lldbExecutable' is not defined
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r245141 - A messy bit of cleanup: Move towards more descriptive names

2015-08-18 Thread Ed Maste via lldb-commits
On 18 August 2015 at 13:16, Ed Maste  wrote:
> On 15 August 2015 at 01:21, Jason Molenda via lldb-commits
>  wrote:
>>
>> Author: jmolenda
>> Date: Fri Aug 14 20:21:01 2015
>> New Revision: 245141
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=245141&view=rev
>> Log:
>> A messy bit of cleanup: Move towards more descriptive names
>> for eh_frame and stabs register numberings.  This is not
>> complete but it's a step in the right direction.  It's almost
>> entirely mechanical.
>
> This change broke all tests on FreeBSD, like so:
>
> Command invoked: timeout -s QUIT 4m /usr/local/bin/python2.7
> /tank/emaste/src/llvm/tools/lldb/test/dotest.py -q --arch=x86_64
> --executable /tank/emaste/src/llvm/build-nodebug/bin/lldb -s
> /tank/emaste/src/llvm/build-nodebug/lldb-test-traces -u CXXFLAGS -u
> CFLAGS -C /usr/bin/clang -p TestGdbRemoteProcessInfo.py
> /tank/emaste/src/llvm/tools/lldb/test/tools/lldb-server
> 362 out of 388 test suites processed - TestGdbRemoteProcessInfo.py
> Traceback (most recent call last):
>   File "/tank/emaste/src/llvm/tools/lldb/test/dotest.py", line 1242, in 
> 
> setupSysPath()
>   File "/tank/emaste/src/llvm/tools/lldb/test/dotest.py", line 1061,
> in setupSysPath
> print "  4) The executable '%s' could not be found.  Please check
> " % lldbExecutable
> NameError: global name 'lldbExecutable' is not defined

Oops, nevermind -- finish_swig didn't run after the build.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D12104: [NativeProcessLinux] Fix a bug in instruction-stepping over thread creation

2015-08-18 Thread Pavel Labath via lldb-commits
labath created this revision.
labath added reviewers: ovyalov, tberghammer.
labath added a subscriber: lldb-commits.

There was a bug in NativeProcessLinux, where doing an instruction-level 
single-step over the
thread-creation syscall resulted in loss of control over the inferior. This 
happened because
after the inferior entered the thread-creation maintenance stop, we 
unconditionally performed a
PTRACE_CONT, even though the original intention was to do a PTRACE_SINGLESTEP. 
This is fixed by
storing the original state of the thread before the stop (stepping or running) 
and then
performing the appropriate action when resuming.

I also get rid of the callback in the ThreadContext structure, which stored the 
lambda used to
resume the thread, but which was not used consistently.

A test verifying the correctness of the new behavior is included.

http://reviews.llvm.org/D12104

Files:
  source/Plugins/Process/Linux/NativeProcessLinux.cpp
  source/Plugins/Process/Linux/NativeProcessLinux.h
  source/Plugins/Process/Linux/NativeThreadLinux.cpp
  source/Plugins/Process/Linux/NativeThreadLinux.h
  test/functionalities/thread/create_during_instruction_step/Makefile
  
test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
  test/functionalities/thread/create_during_instruction_step/main.cpp

Index: test/functionalities/thread/create_during_instruction_step/main.cpp
===
--- /dev/null
+++ test/functionalities/thread/create_during_instruction_step/main.cpp
@@ -0,0 +1,36 @@
+//===-- main.cpp *- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include 
+#include 
+
+std::atomic flag(false);
+
+void do_nothing()
+{
+while (flag)
+;
+}
+
+int main ()
+{
+// Instruction-level stepping over a creation of the first thread takes a very long time, so
+// we give the threading machinery a chance to initialize all its data structures.
+// This way, stepping over the second thread will be much faster.
+std::thread dummy(do_nothing);
+dummy.join();
+
+// Make sure the new thread does not exit before we get a chance to notice the main thread stopped
+flag = true;
+
+std::thread thread(do_nothing); // Set breakpoint here
+flag = false; // Release the new thread.
+thread.join();
+return 0;
+}
Index: test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
===
--- /dev/null
+++ test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
@@ -0,0 +1,79 @@
+"""
+This tests that we do not lose control of the inferior, while doing an instruction-level step
+over a thread creation instruction.
+"""
+
+import os
+import unittest2
+import lldb
+from lldbtest import *
+import lldbutil
+
+class CreateDuringInstructionStepTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def setUp(self):
+# Call super's setUp().
+TestBase.setUp(self)
+# Find the line numbers to break and continue.
+self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
+
+@dsym_test
+def test_step_inst_with_dsym(self):
+self.buildDsym(dictionary=self.getBuildFlags())
+self.create_during_step_inst_test()
+
+@dwarf_test
+def test_step_inst_with_dwarf(self):
+self.buildDwarf(dictionary=self.getBuildFlags())
+self.create_during_step_inst_test()
+
+def create_during_step_inst_test(self):
+exe = os.path.join(os.getcwd(), "a.out")
+target = self.dbg.CreateTarget(exe)
+self.assertTrue(target and target.IsValid(), "Target is valid")
+
+# This should create a breakpoint in the stepping thread.
+self.bp_num = lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.breakpoint, num_expected_locations=-1)
+
+# Run the program.
+process = target.LaunchSimple(None, None, self.get_process_working_directory())
+self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID)
+
+# The stop reason of the thread should be breakpoint.
+self.assertEqual(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
+self.assertEqual(lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint).IsValid(), 1,
+STOPPED_DUE_TO_BREAKPOINT)
+
+# Get the number of threads
+num_threads = process.GetNumThreads()
+
+# Make sure we see only one threads
+self.assertEqual(num_threads, 1, 'Number of expected threads and actual threads do not match.')
+
+thread = process.GetThreadA

Re: [Lldb-commits] [PATCH] D12100: [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue

2015-08-18 Thread Pavel Labath via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Looks good as far as I am concerned.


Repository:
  rL LLVM

http://reviews.llvm.org/D12100



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


Re: [Lldb-commits] [PATCH] D12092: [ValueObjectSynthetic and ValueObjectDynamicValue] Override GetDeclaration

2015-08-18 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.

I'm good if the test suite is clean.


http://reviews.llvm.org/D12092



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


Re: [Lldb-commits] [PATCH] D12100: [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue

2015-08-18 Thread Greg Clayton via lldb-commits
clayborg added a comment.

Looks good.


Repository:
  rL LLVM

http://reviews.llvm.org/D12100



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


Re: [Lldb-commits] [lldb] r245217 - [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 mode support

2015-08-18 Thread Hans Wennborg via lldb-commits
Thanks for catching that! Should be fixed in r245306.

On Tue, Aug 18, 2015 at 12:19 AM,   wrote:
> Hi Hans,
>
> The file RegisterContext_mips64.h was replaced with RegisterContext_mips.h
> in master branch.
> In the release branch, the file RegisterContext_mips64.h still exists.
> Could you please delete RegisterContext_mips64.h from the release branch ?
>
> Regards,
> Sagar
>
>
> On Tuesday 18 August 2015 02:47 AM, Hans Wennborg wrote:
>>
>> Merged to 3.7 in r245240. There was a conflicts because r245141 isn't
>> on the branch. Please check that I got it right:
>> http://llvm.org/viewvc/llvm-project?rev=245240&view=rev
>>
>> Thanks,
>> Hans
>>
>> On Mon, Aug 17, 2015 at 1:28 PM, Greg Clayton  wrote:
>>>
>>> Ok to merge.

 On Aug 17, 2015, at 1:26 PM, Hans Wennborg  wrote:

 I'm OK with it if Greg approves.

 - Hans

 On Mon, Aug 17, 2015 at 7:07 AM,   wrote:
>
> Hi Hans,
>
> Could you please also merge r245217 in the release branch.
>
> Thanks,
> Sagar
>
> -Original Message-
> From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On
> Behalf Of
> Sagar Thakur via lldb-commits
> Sent: 17 August 2015 19:10
> To: lldb-commits@lists.llvm.org
> Subject: [Lldb-commits] [lldb] r245217 - [LLDB][MIPS] Fix offsets of
> all
> register sets and add MSA regset and FRE=1 mode support
>
> Author: slthakur
> Date: Mon Aug 17 08:40:17 2015
> New Revision: 245217
>
> URL: http://llvm.org/viewvc/llvm-project?rev=245217&view=rev
> Log:
> [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and
> FRE=1
> mode support
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r245319 - [ValueObjectSynthetic and ValueObjectDynamicValue] Override GetDeclaration

2015-08-18 Thread Siva Chandra via lldb-commits
Author: sivachandra
Date: Tue Aug 18 12:56:06 2015
New Revision: 245319

URL: http://llvm.org/viewvc/llvm-project?rev=245319&view=rev
Log:
[ValueObjectSynthetic and ValueObjectDynamicValue] Override GetDeclaration

Summary:
Returns the declaration of the parent (non-synthetic or static) value.


Reviewers: granata.enrico, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D12092

Modified:
lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py

Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=245319&r1=245318&r2=245319&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Tue Aug 18 12:56:06 
2015
@@ -85,7 +85,7 @@ public:
 {
 return m_parent->GetSP();
 }
-
+
 void
 SetOwningSP (lldb::ValueObjectSP &owning_sp)
 {
@@ -105,6 +105,9 @@ public:
 virtual TypeImpl
 GetTypeImpl ();
 
+virtual bool
+GetDeclaration (Declaration &decl);
+
 protected:
 virtual bool
 UpdateValue ();

Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=245319&r1=245318&r2=245319&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Tue Aug 18 
12:56:06 2015
@@ -152,6 +152,9 @@ public:
 virtual void
 SetFormat (lldb::Format format);
 
+virtual bool
+GetDeclaration (Declaration &decl);
+
 protected:
 virtual bool
 UpdateValue ();

Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=245319&r1=245318&r2=245319&view=diff
==
--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Tue Aug 18 12:56:06 2015
@@ -421,3 +421,12 @@ ValueObjectDynamicValue::SetData (DataEx
 SetNeedsUpdate();
 return ret_val;
 }
+
+bool
+ValueObjectDynamicValue::GetDeclaration (Declaration &decl)
+{
+if (m_parent)
+return m_parent->GetDeclaration(decl);
+
+return ValueObject::GetDeclaration(decl);
+}

Modified: lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp?rev=245319&r1=245318&r2=245319&view=diff
==
--- lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp Tue Aug 18 12:56:06 
2015
@@ -314,3 +314,12 @@ ValueObjectSynthetic::SetFormat (lldb::F
 this->ValueObject::SetFormat(format);
 this->ClearUserVisibleData(eClearUserVisibleDataItemsAll);
 }
+
+bool
+ValueObjectSynthetic::GetDeclaration (Declaration &decl)
+{
+if (m_parent)
+return m_parent->GetDeclaration(decl);
+
+return ValueObject::GetDeclaration(decl);
+}

Modified: lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py?rev=245319&r1=245318&r2=245319&view=diff
==
--- lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py (original)
+++ lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py Tue Aug 18 
12:56:06 2015
@@ -169,6 +169,7 @@ class SBFormattersAPITestCase(TestBase):
 
 foo_var = 
self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame().FindVariable('foo')
 self.assertTrue(foo_var.IsValid(), 'could not find foo')
+self.assertTrue(foo_var.GetDeclaration().IsValid(), 'foo declaration 
is invalid')
 
 self.assertTrue(foo_var.GetNumChildren() == 2, 'synthetic value has 
wrong number of child items (synth)')
 
self.assertTrue(foo_var.GetChildMemberWithName('X').GetValueAsUnsigned() == 1, 
'foo_synth.X has wrong value (synth)')


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


Re: [Lldb-commits] [PATCH] D12092: [ValueObjectSynthetic and ValueObjectDynamicValue] Override GetDeclaration

2015-08-18 Thread Siva Chandra via lldb-commits
sivachandra added a comment.

Committed. Test suite is clean.


http://reviews.llvm.org/D12092



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


Re: [Lldb-commits] [PATCH] D12100: [LLDB] Use llvm::APInt and llvm::APFloat in Scalar and RegisterValue

2015-08-18 Thread Oleksiy Vyalov via lldb-commits
ovyalov accepted this revision.


Comment at: include/lldb/Core/RegisterValue.h:51
@@ -51,2 +50,3 @@
 {
+m_scalar = (unsigned long)0;
 }

Nit: you can initialize m_scalar within initializer list.


Comment at: include/lldb/Core/RegisterValue.h:185
@@ -190,1 +184,3 @@
+llvm::APInt
+GetAsUInt128 (llvm::APInt& fail_value, bool *success_ptr = NULL) const;
 

Could you pass fail_value as a const reference?


Repository:
  rL LLVM

http://reviews.llvm.org/D12100



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


Re: [Lldb-commits] [PATCH] D11962: Mark TestCModules as XFAIL on OSX

2015-08-18 Thread Chaoren Lin via lldb-commits
chaoren added a subscriber: chaoren.
chaoren added a comment.

Ping? It's been a week, and the buildbot is still red because of this: 
http://lab.llvm.org:8011/builders/lldb-x86_64-darwin-13.4/builds/4923


http://reviews.llvm.org/D11962



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


[Lldb-commits] [lldb] r245338 - [Windows] XFAIL tests that depend on expression name lookup.

2015-08-18 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Aug 18 15:01:28 2015
New Revision: 245338

URL: http://llvm.org/viewvc/llvm-project?rev=245338&view=rev
Log:
[Windows] XFAIL tests that depend on expression name lookup.

Name lookup doesn't work properly with Windows targets.  This is
most likely due to issues with name mangling, although there is at
least one set of debug info related issues as well, since some of
the name lookup requests appear to be failing on types rather than
symbols.

Specifically, this patch XFAILS the following set of tests:

TestChar1632T.py
TestRdar12991846.py
TestConstVariables.py
TestCallCPPFunction.py
TestCallStopAndContinue.py
TestCallUserDefinedFunction.py
TestCModules.py
TestCPPThis.py
TestExprs2.py
TestOverloadedFunctions.py
TestRvalueReferences.py

And fixing the underlying issue is tracked in http://llvm.org/pr24489

Modified:
lldb/trunk/test/expression_command/call-function/TestCallStopAndContinue.py

lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py
lldb/trunk/test/expression_command/test/TestExprs2.py
lldb/trunk/test/lang/c/const_variables/TestConstVariables.py
lldb/trunk/test/lang/c/modules/TestCModules.py
lldb/trunk/test/lang/cpp/call-function/TestCallCPPFunction.py
lldb/trunk/test/lang/cpp/char1632_t/TestChar1632T.py
lldb/trunk/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
lldb/trunk/test/lang/cpp/rdar12991846/TestRdar12991846.py
lldb/trunk/test/lang/cpp/rvalue-references/TestRvalueReferences.py
lldb/trunk/test/lang/cpp/this/TestCPPThis.py

Modified: 
lldb/trunk/test/expression_command/call-function/TestCallStopAndContinue.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/call-function/TestCallStopAndContinue.py?rev=245338&r1=245337&r2=245338&view=diff
==
--- lldb/trunk/test/expression_command/call-function/TestCallStopAndContinue.py 
(original)
+++ lldb/trunk/test/expression_command/call-function/TestCallStopAndContinue.py 
Tue Aug 18 15:01:28 2015
@@ -30,6 +30,7 @@ class ExprCommandCallStopContinueTestCas
 
 @dwarf_test
 @expectedFlakeyDarwin("llvm.org/pr20274")
+@expectedFailureWindows("llvm.org/pr24489: Name lookup not working 
correctly on Windows")
 def test_with_dwarf(self):
 """Test gathering result from interrupted function call."""
 self.buildDwarf()

Modified: 
lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py?rev=245338&r1=245337&r2=245338&view=diff
==
--- 
lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py 
(original)
+++ 
lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py 
Tue Aug 18 15:01:28 2015
@@ -31,6 +31,7 @@ class ExprCommandCallUserDefinedFunction
 self.call_function()
 
 @dwarf_test
+@expectedFailureWindows("llvm.org/pr24489: Name lookup not working 
correctly on Windows")
 @expectedFailureFreeBSD("llvm.org/pr20274") # intermittent failure
 def test_with_dwarf(self):
 """Test return values of user defined function calls."""

Modified: lldb/trunk/test/expression_command/test/TestExprs2.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/test/TestExprs2.py?rev=245338&r1=245337&r2=245338&view=diff
==
--- lldb/trunk/test/expression_command/test/TestExprs2.py (original)
+++ lldb/trunk/test/expression_command/test/TestExprs2.py Tue Aug 18 15:01:28 
2015
@@ -19,6 +19,7 @@ class ExprCommands2TestCase(TestBase):
 self.line = line_number('main.cpp',
 '// Please test many expressions while stopped 
at this line:')
 
+@expectedFailureWindows("llvm.org/pr24489: Name lookup not working 
correctly on Windows")
 def test_more_expr_commands(self):
 """Test some more expression commands."""
 self.buildDefault()

Modified: lldb/trunk/test/lang/c/const_variables/TestConstVariables.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/const_variables/TestConstVariables.py?rev=245338&r1=245337&r2=245338&view=diff
==
--- lldb/trunk/test/lang/c/const_variables/TestConstVariables.py (original)
+++ lldb/trunk/test/lang/c/const_variables/TestConstVariables.py Tue Aug 18 
15:01:28 2015
@@ -18,6 +18,8 @@ class ConstVariableTestCase(TestBase):
 self.const_variable()
 
 @expectedFailureClang('13314878') # This test works with gcc, but fails 
with newer version of clang on Linux due to a clang issue. Fails for icc as 
well. Bug number TDB.
+@expectedFailureWindows("llvm.org/pr24489: Name looku

Re: [Lldb-commits] [PATCH] D11962: Mark TestCModules as XFAIL on OSX

2015-08-18 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.

Please commit.


http://reviews.llvm.org/D11962



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


Re: [Lldb-commits] [PATCH] D11962: Mark TestCModules as XFAIL on OSX

2015-08-18 Thread Greg Clayton via lldb-commits
clayborg added a comment.

No need to wait for Sean.


http://reviews.llvm.org/D11962



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


[Lldb-commits] [PATCH] D12113: [LLDB-MI] Add (gdb) prompt after =breakpoint-modified and =breakpoint-created.

2015-08-18 Thread Dawn Perchik via lldb-commits
dawn created this revision.
dawn added reviewers: abidh, ki.stfu, brucem.
dawn added a subscriber: lldb-commits.
dawn set the repository for this revision to rL LLVM.

This patch causes lldb-mi to print the (gdb) prompt after =breakpoint-modified 
and =breakpoint-created notifications.  This makes it clear to the user and 
IDEs that lldb is done and ready for input.

Repository:
  rL LLVM

http://reviews.llvm.org/D12113

Files:
  tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp

Index: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
===
--- tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
+++ tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
@@ -351,7 +351,8 @@
 
 const CMICmnMIValueResult miValueResultC("bkpt", miValueTuple);
 const CMICmnMIOutOfBandRecord 
miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, 
miValueResultC);
-const bool bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+bool bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+bOk = bOk && CMICmnStreamStdout::WritePrompt();
 
 return bOk;
 }
@@ -440,6 +441,7 @@
 const CMICmnMIValueResult miValueResult("bkpt", miValueTuple);
 const CMICmnMIOutOfBandRecord 
miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, 
miValueResult);
 bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+bOk = bOk && CMICmnStreamStdout::WritePrompt();
 }
 else
 {
@@ -462,6 +464,7 @@
 const CMICmnMIValueResult miValueResult("bkpt", miValueTuple);
 const CMICmnMIOutOfBandRecord 
miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointCreated, 
miValueResult);
 bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+bOk = bOk && CMICmnStreamStdout::WritePrompt();
 }
 
 return bOk;


Index: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
===
--- tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
+++ tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
@@ -351,7 +351,8 @@
 
 const CMICmnMIValueResult miValueResultC("bkpt", miValueTuple);
 const CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, miValueResultC);
-const bool bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+bool bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+bOk = bOk && CMICmnStreamStdout::WritePrompt();
 
 return bOk;
 }
@@ -440,6 +441,7 @@
 const CMICmnMIValueResult miValueResult("bkpt", miValueTuple);
 const CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointModified, miValueResult);
 bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+bOk = bOk && CMICmnStreamStdout::WritePrompt();
 }
 else
 {
@@ -462,6 +464,7 @@
 const CMICmnMIValueResult miValueResult("bkpt", miValueTuple);
 const CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_BreakPointCreated, miValueResult);
 bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord);
+bOk = bOk && CMICmnStreamStdout::WritePrompt();
 }
 
 return bOk;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line when Windows filenames are used.

2015-08-18 Thread Dawn Perchik via lldb-commits
dawn created this revision.
dawn added reviewers: abidh, ki.stfu, brucem.
dawn added a subscriber: lldb-commits.
dawn set the repository for this revision to rL LLVM.

This fixes -data-info-line to parse the filename and line correctly when 
LineEntry doesn't have the optional column number and the filename contains a 
Windows drive letter.

Repository:
  rL LLVM

http://reviews.llvm.org/D12115

Files:
  tools/lldb-mi/MICmdCmdData.cpp

Index: tools/lldb-mi/MICmdCmdData.cpp
===
--- tools/lldb-mi/MICmdCmdData.cpp
+++ tools/lldb-mi/MICmdCmdData.cpp
@@ -1754,8 +1754,15 @@
 const size_t nFileStartPos = rLine.find_first_not_of(' ', 
nEndAddressEndPos + 2);
 const size_t nFileOrLineEndPos = rLine.rfind(':');
 const size_t nFileOrLineStartPos = rLine.rfind(':', 
nFileOrLineEndPos - 1);
-const size_t nFileEndPos = nFileStartPos < nFileOrLineStartPos ? 
nFileOrLineStartPos : nFileOrLineEndPos;
-const size_t nFileLen = nFileEndPos - nFileStartPos;
+size_t nFileEndPos = nFileStartPos < nFileOrLineStartPos ? 
nFileOrLineStartPos : nFileOrLineEndPos;
+size_t nFileLen = nFileEndPos - nFileStartPos;
+if ((nFileLen == 1) && ((rLine.at(nFileEndPos + 1) == '\\') || 
(rLine.at(nFileEndPos + 1) == '/')))
+{
+// The filename contains a Windows drive letter; recalculate
+// nFileEndPos and nFileLen to account for it.
+nFileEndPos = nFileOrLineEndPos;
+nFileLen = nFileEndPos - nFileStartPos;
+}
 const CMIUtilString strFile(rLine.substr(nFileStartPos, 
nFileLen).c_str());
 const CMICmnMIValueConst miValueConst3(strFile);
 const CMICmnMIValueResult miValueResult3("file", miValueConst3);


Index: tools/lldb-mi/MICmdCmdData.cpp
===
--- tools/lldb-mi/MICmdCmdData.cpp
+++ tools/lldb-mi/MICmdCmdData.cpp
@@ -1754,8 +1754,15 @@
 const size_t nFileStartPos = rLine.find_first_not_of(' ', nEndAddressEndPos + 2);
 const size_t nFileOrLineEndPos = rLine.rfind(':');
 const size_t nFileOrLineStartPos = rLine.rfind(':', nFileOrLineEndPos - 1);
-const size_t nFileEndPos = nFileStartPos < nFileOrLineStartPos ? nFileOrLineStartPos : nFileOrLineEndPos;
-const size_t nFileLen = nFileEndPos - nFileStartPos;
+size_t nFileEndPos = nFileStartPos < nFileOrLineStartPos ? nFileOrLineStartPos : nFileOrLineEndPos;
+size_t nFileLen = nFileEndPos - nFileStartPos;
+if ((nFileLen == 1) && ((rLine.at(nFileEndPos + 1) == '\\') || (rLine.at(nFileEndPos + 1) == '/')))
+{
+// The filename contains a Windows drive letter; recalculate
+// nFileEndPos and nFileLen to account for it.
+nFileEndPos = nFileOrLineEndPos;
+nFileLen = nFileEndPos - nFileStartPos;
+}
 const CMIUtilString strFile(rLine.substr(nFileStartPos, nFileLen).c_str());
 const CMICmnMIValueConst miValueConst3(strFile);
 const CMICmnMIValueResult miValueResult3("file", miValueConst3);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line when Windows filenames are used.

2015-08-18 Thread Zachary Turner via lldb-commits
Rather than all of this ugly error-prone code, can we instead use
llvm::sys::fs::root_name to check whether the path contains a drive letter?

On Tue, Aug 18, 2015 at 1:52 PM Dawn Perchik via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> dawn created this revision.
> dawn added reviewers: abidh, ki.stfu, brucem.
> dawn added a subscriber: lldb-commits.
> dawn set the repository for this revision to rL LLVM.
>
> This fixes -data-info-line to parse the filename and line correctly when
> LineEntry doesn't have the optional column number and the filename contains
> a Windows drive letter.
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D12115
>
> Files:
>   tools/lldb-mi/MICmdCmdData.cpp
>
> Index: tools/lldb-mi/MICmdCmdData.cpp
> ===
> --- tools/lldb-mi/MICmdCmdData.cpp
> +++ tools/lldb-mi/MICmdCmdData.cpp
> @@ -1754,8 +1754,15 @@
>  const size_t nFileStartPos = rLine.find_first_not_of(' ',
> nEndAddressEndPos + 2);
>  const size_t nFileOrLineEndPos = rLine.rfind(':');
>  const size_t nFileOrLineStartPos = rLine.rfind(':',
> nFileOrLineEndPos - 1);
> -const size_t nFileEndPos = nFileStartPos <
> nFileOrLineStartPos ? nFileOrLineStartPos : nFileOrLineEndPos;
> -const size_t nFileLen = nFileEndPos - nFileStartPos;
> +size_t nFileEndPos = nFileStartPos < nFileOrLineStartPos ?
> nFileOrLineStartPos : nFileOrLineEndPos;
> +size_t nFileLen = nFileEndPos - nFileStartPos;
> +if ((nFileLen == 1) && ((rLine.at(nFileEndPos + 1) == '\\')
> || (rLine.at(nFileEndPos + 1) == '/')))
> +{
> +// The filename contains a Windows drive letter;
> recalculate
> +// nFileEndPos and nFileLen to account for it.
> +nFileEndPos = nFileOrLineEndPos;
> +nFileLen = nFileEndPos - nFileStartPos;
> +}
>  const CMIUtilString strFile(rLine.substr(nFileStartPos,
> nFileLen).c_str());
>  const CMICmnMIValueConst miValueConst3(strFile);
>  const CMICmnMIValueResult miValueResult3("file",
> miValueConst3);
>
>
> ___
> 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] r245357 - Mark TestCModules as XFAIL on OSX.

2015-08-18 Thread Oleksiy Vyalov via lldb-commits
Author: ovyalov
Date: Tue Aug 18 16:20:25 2015
New Revision: 245357

URL: http://llvm.org/viewvc/llvm-project?rev=245357&view=rev
Log:
Mark TestCModules as XFAIL on OSX.

http://reviews.llvm.org/D11962


Modified:
lldb/trunk/test/lang/c/modules/TestCModules.py

Modified: lldb/trunk/test/lang/c/modules/TestCModules.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/modules/TestCModules.py?rev=245357&r1=245356&r2=245357&view=diff
==
--- lldb/trunk/test/lang/c/modules/TestCModules.py (original)
+++ lldb/trunk/test/lang/c/modules/TestCModules.py Tue Aug 18 16:20:25 2015
@@ -16,12 +16,14 @@ class CModulesTestCase(TestBase):
 
 @skipUnlessDarwin
 @dsym_test
+@expectedFailureDarwin('http://llvm.org/pr24302')
 def test_expr_with_dsym(self):
 self.buildDsym()
 self.expr()
 
 @dwarf_test
 @skipIfFreeBSD
+@expectedFailureDarwin('http://llvm.org/pr24302')
 @expectedFailureLinux('http://llvm.org/pr23456') # 'fopen' has unknown 
return type
 @expectedFailureWindows("llvm.org/pr24489: Name lookup not working 
correctly on Windows")
 def test_expr_with_dwarf(self):


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


Re: [Lldb-commits] [PATCH] D11962: Mark TestCModules as XFAIL on OSX

2015-08-18 Thread Oleksiy Vyalov via lldb-commits
ovyalov closed this revision.
ovyalov added a comment.

Files:

  /lldb/trunk/test/lang/c/modules/TestCModules.py

Users:

  ovyalov (Author)

http://reviews.llvm.org/rL245357


http://reviews.llvm.org/D11962



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


Re: [Lldb-commits] [lldb] r245020 - [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] ABI

2015-08-18 Thread Hans Wennborg via lldb-commits
Greg: ping?

On Fri, Aug 14, 2015 at 11:06 AM, Hans Wennborg  wrote:
> Sure, if Greg approves.
>
> Thanks,
> Hans
>
> On Thu, Aug 13, 2015 at 11:25 PM, Bhushan Attarde
>  wrote:
>> Hi Hans,
>>
>> Could you please merge this to the release branch?
>>
>> Thanks
>> Bhushan
>>
>>
>> -Original Message-
>> From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of 
>> Bhushan D. Attarde via lldb-commits
>> Sent: 14 August 2015 09:11
>> To: lldb-commits@lists.llvm.org
>> Subject: [Lldb-commits] [lldb] r245020 - [MIPS]Handle floating point and 
>> aggregate return types in SysV-mips [32 bit] ABI
>>
>> Author: bhushan.attarde
>> Date: Thu Aug 13 22:40:31 2015
>> New Revision: 245020
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=245020&view=rev
>> Log:
>> [MIPS]Handle floating point and aggregate return types in SysV-mips [32 bit] 
>> ABI
>>
>> SUMMARY:
>> This patch adds support of floating point and aggregate return types in 
>> GetReturnValueObjectImpl() for mips32
>>
>> Reviewers: clayborg
>> Subscribers: mohit.bhakkad,  nitesh.jain, sagar, jaydeep, lldb-commits
>> Differential Revision: http://reviews.llvm.org/D11930
>>
>> Modified:
>> lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
>>
>> Modified: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp?rev=245020&r1=245019&r2=245020&view=diff
>> ==
>> --- lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp (original)
>> +++ lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Thu Aug 13 
>> 22:40:31 2015
>> @@ -423,15 +423,16 @@ ABISysV_mips::GetReturnValueObjectImpl (
>>  if (!reg_ctx)
>>  return return_valobj_sp;
>>
>> -bool is_signed;
>> +bool is_signed = false;
>> +bool is_complex = false;
>> +uint32_t count = 0;
>>
>>  // In MIPS register "r2" (v0) holds the integer function return values
>>  const RegisterInfo *r2_reg_info = reg_ctx->GetRegisterInfoByName("r2", 
>> 0);
>> +size_t bit_width = return_clang_type.GetBitSize(&thread);
>>
>>  if (return_clang_type.IsIntegerType (is_signed))
>>  {
>> -size_t bit_width = return_clang_type.GetBitSize(&thread);
>> -
>>  switch (bit_width)
>>  {
>>  default:
>> @@ -473,6 +474,52 @@ ABISysV_mips::GetReturnValueObjectImpl (
>>  uint32_t ptr = 
>> thread.GetRegisterContext()->ReadRegisterAsUnsigned(r2_reg_info, 0) & 
>> UINT32_MAX;
>>  value.GetScalar() = ptr;
>>  }
>> +else if (return_clang_type.IsAggregateType ())
>> +{
>> +// Structure/Vector is always passed in memory and pointer to that 
>> memory is passed in r2.
>> +uint64_t mem_address = 
>> reg_ctx->ReadRegisterAsUnsigned(reg_ctx->GetRegisterInfoByName("r2", 0), 0);
>> +// We have got the address. Create a memory object out of it
>> +return_valobj_sp = ValueObjectMemory::Create (&thread,
>> +  "",
>> +  Address (mem_address, 
>> NULL),
>> +  return_clang_type);
>> +return return_valobj_sp;
>> +}
>> +else if (return_clang_type.IsFloatingPointType (count, is_complex))
>> +{
>> +const RegisterInfo *f0_info = reg_ctx->GetRegisterInfoByName("f0", 
>> 0);
>> +const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 
>> 0);
>> +
>> +if (count == 1 && !is_complex)
>> +{
>> +switch (bit_width)
>> +{
>> +default:
>> +return return_valobj_sp;
>> +case 64:
>> +{
>> +static_assert(sizeof(double) == sizeof(uint64_t), "");
>> +uint64_t raw_value;
>> +raw_value = reg_ctx->ReadRegisterAsUnsigned(f0_info, 0) 
>> & UINT32_MAX;
>> +raw_value |= 
>> ((uint64_t)(reg_ctx->ReadRegisterAsUnsigned(f1_info, 0) & UINT32_MAX)) << 32;
>> +value.GetScalar() = 
>> *reinterpret_cast(&raw_value);
>> +break;
>> +}
>> +case 32:
>> +{
>> +static_assert(sizeof(float) == sizeof(uint32_t), "");
>> +uint32_t raw_value = 
>> reg_ctx->ReadRegisterAsUnsigned(f0_info, 0) & UINT32_MAX;
>> +value.GetScalar() = 
>> *reinterpret_cast(&raw_value);
>> +break;
>> +}
>> +}
>> +}
>> +else
>> +{
>> +// not handled yet
>> +return return_valobj_sp;
>> +}
>> +}
>>  else
>>  {
>>  // not handled yet
>>
>>
>> ___
>> lldb-commits maili

[Lldb-commits] [lldb] r245371 - Fix TestArrayTypes on Windows.

2015-08-18 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Aug 18 17:25:40 2015
New Revision: 245371

URL: http://llvm.org/viewvc/llvm-project?rev=245371&view=rev
Log:
Fix TestArrayTypes on Windows.

Whether or not frames print their tid in hex or decimal is apparently
hardcoded to depend on the operating system.  For now a comment was
added that this should be changed to a more sane check (for example
a setting), and the OS check is updated to do the right thing for
Windows.

Modified:
lldb/trunk/source/Core/FormatEntity.cpp
lldb/trunk/test/lang/c/array_types/TestArrayTypes.py

Modified: lldb/trunk/source/Core/FormatEntity.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=245371&r1=245370&r2=245371&view=diff
==
--- lldb/trunk/source/Core/FormatEntity.cpp (original)
+++ lldb/trunk/source/Core/FormatEntity.cpp Tue Aug 18 17:25:40 2015
@@ -1304,6 +1304,8 @@ FormatEntity::Format (const Entry &entry
 // Watch for the special "tid" format...
 if (entry.printf_format == "tid")
 {
+// TODO(zturner): Rather than hardcoding this to 
be platform specific, it should be controlled by a
+// setting and the default value of the setting 
can be different depending on the platform.
 Target &target = thread->GetProcess()->GetTarget();
 ArchSpec arch (target.GetArchitecture ());
 llvm::Triple::OSType ostype = arch.IsValid() ? 
arch.GetTriple().getOS() : llvm::Triple::UnknownOS;

Modified: lldb/trunk/test/lang/c/array_types/TestArrayTypes.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/array_types/TestArrayTypes.py?rev=245371&r1=245370&r2=245371&view=diff
==
--- lldb/trunk/test/lang/c/array_types/TestArrayTypes.py (original)
+++ lldb/trunk/test/lang/c/array_types/TestArrayTypes.py Tue Aug 18 17:25:40 
2015
@@ -130,10 +130,14 @@ class ArrayTypesTestCase(TestBase):
 
 # Sanity check the print representation of thread.
 thr = str(thread)
-if self.platformIsDarwin():
-tidstr = "tid = 0x%4.4x" % thread.GetThreadID()
-else:
+# TODO(zturner): Whether the TID is printed in hex or decimal should 
be controlled by a setting,
+# and this test should read the value of the setting.  This check is 
currently hardcoded to
+# match the check in Core/FormatEntity.cpp in the function 
FormatEntity::Format() for
+# the Entry::Type::ThreadID case of the switch statement.
+if self.getPlatform() == "linux" or self.getPlatform() == "freebsd":
 tidstr = "tid = %u" % thread.GetThreadID()
+else:
+tidstr = "tid = 0x%4.4x" % thread.GetThreadID()
 self.expect(thr, "Thread looks good with stop reason = breakpoint", 
exe=False,
 substrs = [tidstr])
 


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


[Lldb-commits] [lldb] r245373 - Quiet build warnings on MacOSX.

2015-08-18 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Tue Aug 18 17:30:25 2015
New Revision: 245373

URL: http://llvm.org/viewvc/llvm-project?rev=245373&view=rev
Log:
Quiet build warnings on MacOSX.


Modified:
lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp?rev=245373&r1=245372&r2=245373&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp Tue Aug 18 
17:30:25 2015
@@ -572,14 +572,14 @@ MachThread::DumpRegisterState(nub_size_t
 }
 else
 {
-if (m_arch_ap->RegisterSetStateIsValid(regSet))
+if (m_arch_ap->RegisterSetStateIsValid((int)regSet))
 {
 const size_t numRegisters = GetNumRegistersInSet(regSet);
 uint32_t regIndex = 0;
 DNBRegisterValueClass reg;
 for (regIndex = 0; regIndex < numRegisters; ++regIndex)
 {
-if (m_arch_ap->GetRegisterValue(regSet, regIndex, ®))
+if (m_arch_ap->GetRegisterValue((uint32_t)regSet, regIndex, 
®))
 {
 reg.Dump(NULL, NULL);
 }


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


[Lldb-commits] [lldb] r245375 - Fix inconsistent use of override warnings.

2015-08-18 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Tue Aug 18 17:31:29 2015
New Revision: 245375

URL: http://llvm.org/viewvc/llvm-project?rev=245375&view=rev
Log:
Fix inconsistent use of override warnings.


Modified:
lldb/trunk/include/lldb/Core/ValueObjectCast.h
lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h
lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h

Modified: lldb/trunk/include/lldb/Core/ValueObjectCast.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectCast.h?rev=245375&r1=245374&r2=245375&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectCast.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectCast.h Tue Aug 18 17:31:29 2015
@@ -62,11 +62,11 @@ public:
 }
 
 protected:
-virtual bool
-UpdateValue ();
+bool
+UpdateValue () override;
 
-virtual CompilerType
-GetClangTypeImpl ();
+CompilerType
+GetClangTypeImpl () override;
 
 CompilerType m_cast_type;
 

Modified: lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h?rev=245375&r1=245374&r2=245375&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h Tue Aug 18 
17:31:29 2015
@@ -44,21 +44,21 @@ public:
 return ValueObjectCast::GetClangType();
 }
 
-virtual lldb::ValueObjectSP
+lldb::ValueObjectSP
 GetSyntheticChildAtOffset(uint32_t offset,
   const CompilerType& type,
-  bool can_create);
+  bool can_create) override;
 
-virtual lldb::ValueObjectSP
-AddressOf (Error &error);
+lldb::ValueObjectSP
+AddressOf (Error &error) override;
 
-virtual size_t
+size_t
 GetPointeeData (DataExtractor& data,
 uint32_t item_idx = 0,
-uint32_t item_count = 1);
+uint32_t item_count = 1) override;
 
-virtual lldb::ValueObjectSP
-Cast (const CompilerType &clang_ast_type);
+lldb::ValueObjectSP
+Cast (const CompilerType &clang_ast_type) override;
 
 protected:
 ValueObjectConstResultImpl m_impl;

Modified: lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h?rev=245375&r1=245374&r2=245375&view=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h Tue Aug 18 
17:31:29 2015
@@ -51,19 +51,19 @@ public:
 return ValueObjectChild::GetClangType();
 }
 
-virtual lldb::ValueObjectSP
-GetSyntheticChildAtOffset(uint32_t offset, const CompilerType& type, bool 
can_create);
+lldb::ValueObjectSP
+GetSyntheticChildAtOffset(uint32_t offset, const CompilerType& type, bool 
can_create) override;
 
-virtual lldb::ValueObjectSP
-AddressOf (Error &error);
+lldb::ValueObjectSP
+AddressOf (Error &error) override;
 
-virtual size_t
+size_t
 GetPointeeData (DataExtractor& data,
 uint32_t item_idx = 0,
-   uint32_t item_count = 1);
+   uint32_t item_count = 1) override;
 
-virtual lldb::ValueObjectSP
-Cast (const CompilerType &clang_ast_type);
+lldb::ValueObjectSP
+Cast (const CompilerType &clang_ast_type) override;
 
 protected:
 ValueObjectConstResultImpl m_impl;


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


[Lldb-commits] [lldb] r245376 - More abstraction to get almost all clang specific DWARF parsing code into ClangASTContext.

2015-08-18 Thread Greg Clayton via lldb-commits
Author: gclayton
Date: Tue Aug 18 17:32:36 2015
New Revision: 245376

URL: http://llvm.org/viewvc/llvm-project?rev=245376&view=rev
Log:
More abstraction to get almost all clang specific DWARF parsing code into 
ClangASTContext.


Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/SymbolFile.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/Type.cpp
lldb/trunk/source/Symbol/TypeSystem.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=245376&r1=245375&r2=245376&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Aug 18 17:32:36 2015
@@ -525,21 +525,29 @@ public:
 const DWARFDebugInfoEntry *die) override;
 
 bool
-ResolveClangOpaqueTypeDefinition (SymbolFileDWARF *dwarf,
-  DWARFCompileUnit *dwarf_cu,
-  const DWARFDebugInfoEntry* die,
-  Type *type,
-  CompilerType &clang_type) override;
+CompleteTypeFromDWARF (SymbolFileDWARF *dwarf,
+   DWARFCompileUnit *dwarf_cu,
+   const DWARFDebugInfoEntry* die,
+   lldb_private::Type *type,
+   CompilerType &clang_type) override;
 
-bool
-LayoutRecordType (SymbolFileDWARF *dwarf,
-  const clang::RecordDecl *record_decl,
-  uint64_t &bit_size,
-  uint64_t &alignment,
-  llvm::DenseMap 
&field_offsets,
-  llvm::DenseMap &base_offsets,
-  llvm::DenseMap &vbase_offsets) override;
+//--
+// ClangASTContext callbacks for external source lookups.
+//--
+static void
+CompleteTagDecl (void *baton, clang::TagDecl *);
+
+static void
+CompleteObjCInterfaceDecl (void *baton, clang::ObjCInterfaceDecl *);
 
+static bool
+LayoutRecordType(void *baton,
+ const clang::RecordDecl *record_decl,
+ uint64_t &size,
+ uint64_t &alignment,
+ llvm::DenseMap 
&field_offsets,
+ llvm::DenseMap &base_offsets,
+ llvm::DenseMap &vbase_offsets);
 
 bool
 DIEIsInNamespace (const ClangNamespaceDecl *namespace_decl,
@@ -1204,6 +1212,30 @@ protected:
 DWARFCompileUnit* dst_cu,
 const DWARFDebugInfoEntry *dst_class_die,
 DWARFDIECollection &failures);
+
+clang::DeclContext *
+GetCachedClangDeclContextForDIE (const DWARFDebugInfoEntry *die)
+{
+DIEToDeclContextMap::iterator pos = m_die_to_decl_ctx.find(die);
+if (pos != m_die_to_decl_ctx.end())
+return pos->second;
+else
+return NULL;
+}
+
+void
+LinkDeclContextToDIE (clang::DeclContext *decl_ctx,
+  const DWARFDebugInfoEntry *die)
+{
+m_die_to_decl_ctx[die] = decl_ctx;
+// There can be many DIEs for a single decl context
+m_decl_ctx_to_die[decl_ctx].insert(die);
+}
+
+typedef llvm::SmallPtrSet DIEPointerSet;
+typedef llvm::DenseMap 
DIEToDeclContextMap;
+typedef llvm::DenseMap 
DeclContextToDIEMap;
+
 //--
 // Classes that inherit from ClangASTContext can see and modify these
 //--
@@ -1225,7 +1257,13 @@ protected:
 void *  m_callback_baton;
 uint32_tm_pointer_byte_size;
 boolm_ast_owned;
+// DWARF Parsing related ivars
 RecordDeclToLayoutMap   
m_record_decl_to_layout_map;
+DIEToDeclContextMap m_die_to_decl_ctx;
+DeclContextToDIEMap  

[Lldb-commits] [lldb] r245380 - Test chaned function calls and imported namespaces in C++

2015-08-18 Thread Paul Herman via lldb-commits
Author: paulherman
Date: Tue Aug 18 17:43:37 2015
New Revision: 245380

URL: http://llvm.org/viewvc/llvm-project?rev=245380&view=rev
Log:
Test chaned function calls and imported namespaces in C++

Added:
lldb/trunk/test/lang/cpp/chained-calls/
lldb/trunk/test/lang/cpp/chained-calls/Makefile
lldb/trunk/test/lang/cpp/chained-calls/TestCppChainedCalls.py
lldb/trunk/test/lang/cpp/chained-calls/main.cpp
lldb/trunk/test/lang/cpp/nsimport/
lldb/trunk/test/lang/cpp/nsimport/Makefile
lldb/trunk/test/lang/cpp/nsimport/TestCppNsImport.py
lldb/trunk/test/lang/cpp/nsimport/main.cpp

Added: lldb/trunk/test/lang/cpp/chained-calls/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/chained-calls/Makefile?rev=245380&view=auto
==
--- lldb/trunk/test/lang/cpp/chained-calls/Makefile (added)
+++ lldb/trunk/test/lang/cpp/chained-calls/Makefile Tue Aug 18 17:43:37 2015
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules

Added: lldb/trunk/test/lang/cpp/chained-calls/TestCppChainedCalls.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/chained-calls/TestCppChainedCalls.py?rev=245380&view=auto
==
--- lldb/trunk/test/lang/cpp/chained-calls/TestCppChainedCalls.py (added)
+++ lldb/trunk/test/lang/cpp/chained-calls/TestCppChainedCalls.py Tue Aug 18 
17:43:37 2015
@@ -0,0 +1,94 @@
+import lldb
+from lldbtest import *
+import lldbutil
+
+class TestCppChainedCalls(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipUnlessDarwin
+@dsym_test
+def test_with_dsym_and_run_command(self):
+self.buildDsym()
+self.check()
+
+@dwarf_test
+def test_with_dwarf_and_run_command(self):
+self.buildDwarf()
+self.check()
+
+def setUp(self):
+TestBase.setUp(self)
+
+def check(self):
+# Get main source file
+src_file = "main.cpp"
+src_file_spec = lldb.SBFileSpec(src_file)
+self.assertTrue(src_file_spec.IsValid(), "Main source file")
+
+# Get the path of the executable
+cwd = os.getcwd() 
+exe_file = "a.out"
+exe_path  = os.path.join(cwd, exe_file)
+
+# Load the executable
+target = self.dbg.CreateTarget(exe_path)
+self.assertTrue(target.IsValid(), VALID_TARGET)
+
+# Break on main function
+main_breakpoint = target.BreakpointCreateBySourceRegex("Break here", 
src_file_spec)
+self.assertTrue(main_breakpoint.IsValid() and 
main_breakpoint.GetNumLocations() >= 1, VALID_BREAKPOINT)
+
+# Launch the process
+args = None
+env = None
+process = target.LaunchSimple(args, env, cwd)
+self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
+
+# Get the thread of the process
+self.assertTrue(process.GetState() == lldb.eStateStopped, 
PROCESS_STOPPED)
+thread = lldbutil.get_stopped_thread(process, 
lldb.eStopReasonBreakpoint)
+
+# Get frame for current thread 
+frame = thread.GetSelectedFrame()
+
+# Test chained calls
+test_result = frame.EvaluateExpression("g(f(12345))")
+self.assertTrue(test_result.IsValid() and 
test_result.GetValueAsSigned() == 12345, "g(f(12345)) = 12345")
+
+test_result = frame.EvaluateExpression("q(p()).a")
+self.assertTrue(test_result.IsValid() and 
test_result.GetValueAsSigned() == 12345678, "q(p()).a = 12345678")
+
+test_result = frame.EvaluateExpression("(p() + r()).a")
+self.assertTrue(test_result.IsValid() and 
test_result.GetValueAsSigned() == 22345678, "(p() + r()).a = 22345678")
+
+test_result = frame.EvaluateExpression("q(p() + r()).a")
+self.assertTrue(test_result.IsValid() and 
test_result.GetValueAsSigned() == 22345678, "q(p() + r()).a = 22345678")
+
+test_result = frame.EvaluateExpression("g(f(6700) + f(89))")
+self.assertTrue(test_result.IsValid() and 
test_result.GetValueAsSigned() == 6789, "g(f(6700) + f(89)) = 6789")
+
+test_result = frame.EvaluateExpression("g(f(g(f(300) + f(40))) + 
f(5))")
+self.assertTrue(test_result.IsValid() and 
test_result.GetValueAsSigned() == 345, "g(f(g(f(300) + f(40))) + f(5)) = 345")
+
+test_result = frame.EvaluateExpression("getb(makeb(), 789)")
+self.assertTrue(test_result.IsValid() and 
test_result.GetValueAsSigned() == 789, "getb(makeb(), 789) = 789")
+
+test_result = frame.EvaluateExpression("(*c).a")
+self.assertTrue(test_result.IsValid() and 
test_result.GetValueAsSigned() == 5678, "(*c).a = 5678")
+
+test_result = frame.EvaluateExpression("(*c + *c).a")
+self.assertTrue(test_result.IsValid() and 
test_result.GetValueAsSigned() == 11356, "(*c + *c).a = 11356")
+
+test

[Lldb-commits] [lldb] r245381 - Fix resolution conflict between global and class static variables in C++

2015-08-18 Thread Paul Herman via lldb-commits
Author: paulherman
Date: Tue Aug 18 17:46:57 2015
New Revision: 245381

URL: http://llvm.org/viewvc/llvm-project?rev=245381&view=rev
Log:
Fix resolution conflict between global and class static variables in C++

Added:
lldb/trunk/test/lang/cpp/scope/
lldb/trunk/test/lang/cpp/scope/Makefile
lldb/trunk/test/lang/cpp/scope/TestCppScope.py
lldb/trunk/test/lang/cpp/scope/main.cpp
Modified:
lldb/trunk/include/lldb/Symbol/Variable.h
lldb/trunk/include/lldb/Symbol/VariableList.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/Variable.cpp
lldb/trunk/source/Symbol/VariableList.cpp
lldb/trunk/source/Target/StackFrame.cpp

Modified: lldb/trunk/include/lldb/Symbol/Variable.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Variable.h?rev=245381&r1=245380&r2=245381&view=diff
==
--- lldb/trunk/include/lldb/Symbol/Variable.h (original)
+++ lldb/trunk/include/lldb/Symbol/Variable.h Tue Aug 18 17:46:57 2015
@@ -36,7 +36,8 @@ public:
   Declaration* decl,
   const DWARFExpression& location,
   bool external,
-  bool artificial);
+  bool artificial,
+  bool static_member = false);
 
 virtual
 ~Variable();
@@ -99,6 +100,11 @@ public:
 return m_artificial;
 }
 
+bool IsStaticMember() const
+{
+return m_static_member;
+}
+
 DWARFExpression &
 LocationExpression()
 {
@@ -171,7 +177,8 @@ protected:
 DWARFExpression m_location; // The location of this variable that 
can be fed to DWARFExpression::Evaluate()
 uint8_t m_external:1,   // Visible outside the containing 
compile unit?
 m_artificial:1, // Non-zero if the variable is not 
explicitly declared in source
-m_loc_is_const_data:1;  // The m_location expression contains 
the constant variable value data, not a DWARF location
+m_loc_is_const_data:1,  // The m_location expression contains 
the constant variable value data, not a DWARF location
+m_static_member:1;  // Non-zero if variable is static 
member of a class or struct.
 private:
 Variable(const Variable& rhs);
 Variable& operator=(const Variable& rhs);

Modified: lldb/trunk/include/lldb/Symbol/VariableList.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/VariableList.h?rev=245381&r1=245380&r2=245381&view=diff
==
--- lldb/trunk/include/lldb/Symbol/VariableList.h (original)
+++ lldb/trunk/include/lldb/Symbol/VariableList.h Tue Aug 18 17:46:57 2015
@@ -48,10 +48,10 @@ public:
 RemoveVariableAtIndex (size_t idx);
 
 lldb::VariableSP
-FindVariable (const ConstString& name);
+FindVariable (const ConstString& name, bool include_static_members = true);
 
 lldb::VariableSP
-FindVariable (const ConstString& name, lldb::ValueType value_type);
+FindVariable (const ConstString& name, lldb::ValueType value_type, bool 
include_static_members = true);
 
 uint32_t
 FindVariableIndex (const lldb::VariableSP &var_sp);

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=245381&r1=245380&r2=245381&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Aug 18 
17:46:57 2015
@@ -3968,7 +3968,6 @@ SymbolFileDWARF::ParseVariablesForContex
 return 0;
 }
 
-
 VariableSP
 SymbolFileDWARF::ParseVariableDIE
 (
@@ -4124,6 +4123,9 @@ SymbolFileDWARF::ParseVariableDIE
 }
 }
 
+const DWARFDebugInfoEntry *parent_context_die = 
GetDeclContextDIEContainingDIE(dwarf_cu, die);
+bool is_static_member = die->GetParent()->Tag() == 
DW_TAG_compile_unit && (parent_context_die->Tag() == DW_TAG_class_type || 
parent_context_die->Tag() == DW_TAG_structure_type);
+
 ValueType scope = eValueTypeInvalid;
 
 const DWARFDebugInfoEntry *sc_parent_die = 
GetParentSymbolContextDIE(die);
@@ -4301,7 +4303,8 @@ SymbolFileDWARF::ParseVariableDIE
 &decl, 
 location, 
 is_external, 
-is_artificial));
+is_artificial,
+is_static_member));
 
 var_sp->SetLocationIsConstantValueData 
(location_is_const_value_data);
 }

Modified: lldb/trunk/source/

Re: [Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line when Windows filenames are used.

2015-08-18 Thread Dawn Perchik via lldb-commits
dawn added a comment.

In http://reviews.llvm.org/D12115#226962, @zturner wrote:

> Rather than all of this ugly error-prone code, can we instead use
>  llvm::sys::fs::root_name to check whether the path contains a drive letter?


Sadly no, because root_name only parses c:\ correctly if the platform is 
Windows.  Our IDE is hosted on Windows but talks to lldb running on OSX.  I've 
had this path problem with the DWARF reader and FileSpec - lldb has a core 
assumption that you only want to support Windows paths if you run on Windows.  
At least with FileSpec you can pass a PathSyntax, but you have to choose either 
Windows or Posix, not both.  We want to support both Posix and Windows style 
paths.  I've not come up with a clean patch for this problem so none have been 
submitted.  We should start another thread about how to resolve this problem...

For now, would it be OK to put a FIXME comment in the source?


Repository:
  rL LLVM

http://reviews.llvm.org/D12115



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


Re: [Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line when Windows filenames are used.

2015-08-18 Thread Zachary Turner via lldb-commits
Are you saying that there is a situation where you are given a path, and
you have no idea whether it is a posix path or a windows path?  That seems
strange to me.  Surely you must know (or be able to find out) if the
computer you are interfacing with is running Windows or non-Windows, right?

On Tue, Aug 18, 2015 at 3:58 PM Dawn Perchik  wrote:

> dawn added a comment.
>
> In http://reviews.llvm.org/D12115#226962, @zturner wrote:
>
> > Rather than all of this ugly error-prone code, can we instead use
> >  llvm::sys::fs::root_name to check whether the path contains a drive
> letter?
>
>
> Sadly no, because root_name only parses c:\ correctly if the platform is
> Windows.  Our IDE is hosted on Windows but talks to lldb running on OSX.
> I've had this path problem with the DWARF reader and FileSpec - lldb has a
> core assumption that you only want to support Windows paths if you run on
> Windows.  At least with FileSpec you can pass a PathSyntax, but you have to
> choose either Windows or Posix, not both.  We want to support both Posix
> and Windows style paths.  I've not come up with a clean patch for this
> problem so none have been submitted.  We should start another thread about
> how to resolve this problem...
>
> For now, would it be OK to put a FIXME comment in the source?
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D12115
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D12126: Read exception records from Windows mini dump

2015-08-18 Thread Adrian McCarthy via lldb-commits
amccarth created this revision.
amccarth added a reviewer: zturner.
amccarth added a subscriber: lldb-commits.

Now when you do a thread list, you'll see the exception information in the stop 
info for the thread that stopped.

I'd like to move the ExceptionRecord.h file to a common place as a separate 
patch.

http://reviews.llvm.org/D12126

Files:
  source/Plugins/Process/Windows/ExceptionRecord.h
  source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
  source/Plugins/Process/win-minidump/ProcessWinMiniDump.h

Index: source/Plugins/Process/win-minidump/ProcessWinMiniDump.h
===
--- source/Plugins/Process/win-minidump/ProcessWinMiniDump.h
+++ source/Plugins/Process/win-minidump/ProcessWinMiniDump.h
@@ -97,6 +97,15 @@
 lldb_private::ArchSpec
 DetermineArchitecture();
 
+void
+ReadExceptionRecord();
+
+// A thin wrapper around WinAPI's MiniDumpReadDumpStream to avoid redundant
+// checks.  If there's a failure (e.g., if the requested stream doesn't exist),
+// the function returns nullptr and sets *size_out to 0.
+void *
+FindDumpStream(unsigned stream_number, size_t *size_out);
+
 // Isolate the data to keep Windows-specific types out of this header.  Can't
 // use the typical pimpl idiom because the implementation of this class also
 // needs access to public and protected members of the base class.
Index: source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
===
--- source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
+++ source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
@@ -24,11 +24,15 @@
 #include "lldb/Core/State.h"
 #include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Target/StopInfo.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/DynamicLoader.h"
 #include "lldb/Target/UnixSignals.h"
+#include "llvm/Support/Format.h"
+#include "llvm/Support/raw_ostream.h"
 #include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"
 
+#include "../windows/ExceptionRecord.h"  // TODO(amccarth):  move this file to a common location
 #include "ThreadWinMiniDump.h"
 
 using namespace lldb_private;
@@ -45,6 +49,7 @@
 HANDLE m_dump_file;  // handle to the open minidump file
 HANDLE m_mapping;  // handle to the file mapping for the minidump file
 void * m_base_addr;  // base memory address of the minidump
+std::shared_ptr m_exception_sp;
 };
 
 ConstString
@@ -129,7 +134,8 @@
 
 m_target.SetArchitecture(DetermineArchitecture());
 // TODO(amccarth):  Build the module list.
-// TODO(amccarth):  Read the exeception record.
+
+ReadExceptionRecord();
 
 return error;
 
@@ -146,18 +152,10 @@
 bool
 ProcessWinMiniDump::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
 {
-assert(m_data_up != nullptr);
-assert(m_data_up->m_base_addr != 0);
-
-MINIDUMP_DIRECTORY *dir = nullptr;
-void *ptr = nullptr;
-ULONG size = 0;
-if (::MiniDumpReadDumpStream(m_data_up->m_base_addr, ThreadListStream, &dir, &ptr, &size))
+size_t size = 0;
+auto thread_list_ptr = static_cast(FindDumpStream(ThreadListStream, &size));
+if (thread_list_ptr)
 {
-assert(dir->StreamType == ThreadListStream);
-assert(size == dir->Location.DataSize);
-assert(ptr == static_cast(static_cast(m_data_up->m_base_addr) + dir->Location.Rva));
-auto thread_list_ptr = static_cast(ptr);
 const ULONG32 thread_count = thread_list_ptr->NumberOfThreads;
 assert(thread_count < std::numeric_limits::max());
 for (int i = 0; i < thread_count; ++i) {
@@ -172,6 +170,20 @@
 void
 ProcessWinMiniDump::RefreshStateAfterStop()
 {
+if (m_data_up && m_data_up->m_exception_sp)
+{
+auto active_exception = m_data_up->m_exception_sp;
+std::string desc;
+llvm::raw_string_ostream desc_stream(desc);
+desc_stream << "Exception "
+<< llvm::format_hex(active_exception->GetExceptionCode(), 8)
+<< " encountered at address "
+<< llvm::format_hex(active_exception->GetExceptionAddress(), 8);
+m_thread_list.SetSelectedThreadByID(active_exception->GetThreadID());
+auto stop_thread = m_thread_list.GetSelectedThread();
+auto stop_info = StopInfo::CreateStopReasonWithException(*stop_thread, desc_stream.str().c_str());
+stop_thread->SetStopInfo(stop_info);
+}
 }
 
 Error
@@ -302,18 +314,10 @@
 ArchSpec
 ProcessWinMiniDump::DetermineArchitecture()
 {
-assert(m_data_up != nullptr);
-assert(m_data_up->m_base_addr != 0);
-
-MINIDUMP_DIRECTORY *dir = nullptr;
-void *ptr = nullptr;
-ULONG size = 0;
-if (::MiniDumpReadDumpStream(m_data_up->m_base_addr, SystemInfoStream, &dir, &ptr, &size))
+size_t size = 0;
+auto system_info_ptr = static_cast(FindDumpStream(

Re: [Lldb-commits] [PATCH] D12126: Read exception records from Windows mini dump

2015-08-18 Thread Zachary Turner via lldb-commits
zturner added a comment.

I would really like to start seeing tests go in at the same time as the 
patches.  Can any of this functionality be tested yet?  i.e. are there commands 
that will exercise this code?  Also still haven't seen tests go in for the 
basic minidump functionality, like a test that just creates and loads a 
minidump without any errors.  Do you think it's better to do that now or as a 
followup patch?  Either way, I don't think we should wait too much longer 
before building up some tests.



Comment at: source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp:160
@@ -161,3 +159,3 @@
 const ULONG32 thread_count = thread_list_ptr->NumberOfThreads;
 assert(thread_count < std::numeric_limits::max());
 for (int i = 0; i < thread_count; ++i) {

Shouldn't this be `std::numeric_limits::max()` and the loop index 
variable be unsigned as well?


Comment at: source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp:173
@@ -174,1 +172,3 @@
 {
+if (m_data_up && m_data_up->m_exception_sp)
+{

Can you invert this conditional and early-out to keep the indentation level 
reduced?


Comment at: source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp:320
@@ -312,6 +319,3 @@
+if (system_info_ptr)
 {
 switch (system_info_ptr->ProcessorArchitecture)

Same here


Comment at: source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp:339
@@ +338,3 @@
+auto exception_stream_ptr = 
static_cast(FindDumpStream(ExceptionStream, &size));
+if (exception_stream_ptr)
+{

And here.


http://reviews.llvm.org/D12126



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


Re: [Lldb-commits] [PATCH] D12104: [NativeProcessLinux] Fix a bug in instruction-stepping over thread creation

2015-08-18 Thread Oleksiy Vyalov via lldb-commits
ovyalov added a comment.

Please see my comments.



Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:1457
@@ -1453,3 +1456,3 @@
 
-thread_sp = AddThread(pid);
+thread_sp = 
std::static_pointer_cast(AddThread(pid));
 assert (thread_sp.get() && "failed to create the tracking data for 
newly created inferior thread");

Since AddThread is private method of NPL we can make it to return 
NativeThreadLinuxSP.


Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:2822
@@ -2834,2 +2821,3 @@
 
 // If we have a pending notification, remove this from the set.
+SignalIfAllThreadsStopped();

It seems the comment is no longer actual.


Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:3056
@@ +3055,3 @@
+if (step_result.Success())
+SetState(eStateRunning, true);
+return step_result;

Should it be eStateStepping?


Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:3060
@@ -3087,1 +3059,3 @@
+default:
+llvm_unreachable("Unhandled state for resume");
 }

Could you print state value here?


Comment at: source/Plugins/Process/Linux/NativeProcessLinux.h:314
@@ -327,9 +313,3 @@
 
-void
-RequestStopOnAllRunningThreads();
-
-Error
-ThreadDidStop(lldb::tid_t tid, bool initiated_by_llgs);
-
 // Resume the thread with the given thread id using the 
request_thread_resume_function
 // called. If error_when_already_running is then then an error is 
raised if we think this

Please update the comment.


Comment at: source/Plugins/Process/Linux/NativeThreadLinux.h:115
@@ -125,2 +114,3 @@
 
+typedef std::shared_ptr NativeThreadLinuxSP;
 } // namespace process_linux

Nit  - include  for shared_ptr?


http://reviews.llvm.org/D12104



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


Re: [Lldb-commits] [PATCH] D12126: Read exception records from Windows mini dump

2015-08-18 Thread Adrian McCarthy via lldb-commits
amccarth marked 2 inline comments as done.


Comment at: source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp:173
@@ -174,1 +172,3 @@
 {
+if (m_data_up && m_data_up->m_exception_sp)
+{

zturner wrote:
> Can you invert this conditional and early-out to keep the indentation level 
> reduced?
Done, but >grumble<.  It seems likely this code will evolve into a cascaded 
if-else-if (as per the ProcessWindows::RefreshStateAfterStop), in which case 
the early out would have to be reverted.

Checking for prerequisites before doing something is natural, flexible, and 
avoids code duplication.  Early outs are like Yoda comparisons--harder to read 
for dubious advantage.


Comment at: source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp:320
@@ -312,6 +319,3 @@
+if (system_info_ptr)
 {
 switch (system_info_ptr->ProcessorArchitecture)

zturner wrote:
> Same here
That would violate the DRY principle, since I'd have to repeat the construction 
of an invalid or unknown ArchSpec.


http://reviews.llvm.org/D12126



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


Re: [Lldb-commits] [PATCH] D12126: Read exception records from Windows mini dump

2015-08-18 Thread Adrian McCarthy via lldb-commits
amccarth updated this revision to Diff 32475.
amccarth marked an inline comment as done.
amccarth added a comment.

Addresses some of Zach's comments.


http://reviews.llvm.org/D12126

Files:
  source/Plugins/Process/Windows/ExceptionRecord.h
  source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
  source/Plugins/Process/win-minidump/ProcessWinMiniDump.h

Index: source/Plugins/Process/win-minidump/ProcessWinMiniDump.h
===
--- source/Plugins/Process/win-minidump/ProcessWinMiniDump.h
+++ source/Plugins/Process/win-minidump/ProcessWinMiniDump.h
@@ -97,6 +97,15 @@
 lldb_private::ArchSpec
 DetermineArchitecture();
 
+void
+ReadExceptionRecord();
+
+// A thin wrapper around WinAPI's MiniDumpReadDumpStream to avoid redundant
+// checks.  If there's a failure (e.g., if the requested stream doesn't exist),
+// the function returns nullptr and sets *size_out to 0.
+void *
+FindDumpStream(unsigned stream_number, size_t *size_out);
+
 // Isolate the data to keep Windows-specific types out of this header.  Can't
 // use the typical pimpl idiom because the implementation of this class also
 // needs access to public and protected members of the base class.
Index: source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
===
--- source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
+++ source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
@@ -24,11 +24,15 @@
 #include "lldb/Core/State.h"
 #include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Target/StopInfo.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/DynamicLoader.h"
 #include "lldb/Target/UnixSignals.h"
+#include "llvm/Support/Format.h"
+#include "llvm/Support/raw_ostream.h"
 #include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"
 
+#include "../windows/ExceptionRecord.h"  // TODO(amccarth):  move this file to a common location
 #include "ThreadWinMiniDump.h"
 
 using namespace lldb_private;
@@ -45,6 +49,7 @@
 HANDLE m_dump_file;  // handle to the open minidump file
 HANDLE m_mapping;  // handle to the file mapping for the minidump file
 void * m_base_addr;  // base memory address of the minidump
+std::shared_ptr m_exception_sp;
 };
 
 ConstString
@@ -129,7 +134,8 @@
 
 m_target.SetArchitecture(DetermineArchitecture());
 // TODO(amccarth):  Build the module list.
-// TODO(amccarth):  Read the exeception record.
+
+ReadExceptionRecord();
 
 return error;
 
@@ -146,21 +152,12 @@
 bool
 ProcessWinMiniDump::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
 {
-assert(m_data_up != nullptr);
-assert(m_data_up->m_base_addr != 0);
-
-MINIDUMP_DIRECTORY *dir = nullptr;
-void *ptr = nullptr;
-ULONG size = 0;
-if (::MiniDumpReadDumpStream(m_data_up->m_base_addr, ThreadListStream, &dir, &ptr, &size))
+size_t size = 0;
+auto thread_list_ptr = static_cast(FindDumpStream(ThreadListStream, &size));
+if (thread_list_ptr)
 {
-assert(dir->StreamType == ThreadListStream);
-assert(size == dir->Location.DataSize);
-assert(ptr == static_cast(static_cast(m_data_up->m_base_addr) + dir->Location.Rva));
-auto thread_list_ptr = static_cast(ptr);
 const ULONG32 thread_count = thread_list_ptr->NumberOfThreads;
-assert(thread_count < std::numeric_limits::max());
-for (int i = 0; i < thread_count; ++i) {
+for (ULONG32 i = 0; i < thread_count; ++i) {
 std::shared_ptr thread_sp(new ThreadWinMiniDump(*this, thread_list_ptr->Threads[i].ThreadId));
 new_thread_list.AddThread(thread_sp);
 }
@@ -172,6 +169,20 @@
 void
 ProcessWinMiniDump::RefreshStateAfterStop()
 {
+if (m_data_up) return;
+if (m_data_up->m_exception_sp) return;
+
+auto active_exception = m_data_up->m_exception_sp;
+std::string desc;
+llvm::raw_string_ostream desc_stream(desc);
+desc_stream << "Exception "
+<< llvm::format_hex(active_exception->GetExceptionCode(), 8)
+<< " encountered at address "
+<< llvm::format_hex(active_exception->GetExceptionAddress(), 8);
+m_thread_list.SetSelectedThreadByID(active_exception->GetThreadID());
+auto stop_thread = m_thread_list.GetSelectedThread();
+auto stop_info = StopInfo::CreateStopReasonWithException(*stop_thread, desc_stream.str().c_str());
+stop_thread->SetStopInfo(stop_info);
 }
 
 Error
@@ -302,18 +313,10 @@
 ArchSpec
 ProcessWinMiniDump::DetermineArchitecture()
 {
-assert(m_data_up != nullptr);
-assert(m_data_up->m_base_addr != 0);
-
-MINIDUMP_DIRECTORY *dir = nullptr;
-void *ptr = nullptr;
-ULONG size = 0;
-if (::MiniDumpReadDumpStream(m_data_up->m_base_addr, SystemInfoStream, &dir, &ptr, &size))
+size_t size = 0;
+auto system_info_pt

Re: [Lldb-commits] [PATCH] D12126: Read exception records from Windows mini dump

2015-08-18 Thread Zachary Turner via lldb-commits
zturner added inline comments.


Comment at: source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp:172
@@ -174,1 +171,3 @@
 {
+if (m_data_up) return;
+if (m_data_up->m_exception_sp) return;

I know :-/  Not saying I agree or disagree, it's just the LLVM style.

http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code


http://reviews.llvm.org/D12126



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


Re: [Lldb-commits] [PATCH] D12126: Read exception records from Windows mini dump

2015-08-18 Thread Adrian McCarthy via lldb-commits
amccarth updated this revision to Diff 32476.
amccarth added a comment.

Forgot to flip logic for the early outs.


http://reviews.llvm.org/D12126

Files:
  source/Plugins/Process/Windows/ExceptionRecord.h
  source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
  source/Plugins/Process/win-minidump/ProcessWinMiniDump.h

Index: source/Plugins/Process/win-minidump/ProcessWinMiniDump.h
===
--- source/Plugins/Process/win-minidump/ProcessWinMiniDump.h
+++ source/Plugins/Process/win-minidump/ProcessWinMiniDump.h
@@ -97,6 +97,15 @@
 lldb_private::ArchSpec
 DetermineArchitecture();
 
+void
+ReadExceptionRecord();
+
+// A thin wrapper around WinAPI's MiniDumpReadDumpStream to avoid redundant
+// checks.  If there's a failure (e.g., if the requested stream doesn't exist),
+// the function returns nullptr and sets *size_out to 0.
+void *
+FindDumpStream(unsigned stream_number, size_t *size_out);
+
 // Isolate the data to keep Windows-specific types out of this header.  Can't
 // use the typical pimpl idiom because the implementation of this class also
 // needs access to public and protected members of the base class.
Index: source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
===
--- source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
+++ source/Plugins/Process/win-minidump/ProcessWinMiniDump.cpp
@@ -24,11 +24,15 @@
 #include "lldb/Core/State.h"
 #include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Target/StopInfo.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/DynamicLoader.h"
 #include "lldb/Target/UnixSignals.h"
+#include "llvm/Support/Format.h"
+#include "llvm/Support/raw_ostream.h"
 #include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"
 
+#include "../windows/ExceptionRecord.h"  // TODO(amccarth):  move this file to a common location
 #include "ThreadWinMiniDump.h"
 
 using namespace lldb_private;
@@ -45,6 +49,7 @@
 HANDLE m_dump_file;  // handle to the open minidump file
 HANDLE m_mapping;  // handle to the file mapping for the minidump file
 void * m_base_addr;  // base memory address of the minidump
+std::shared_ptr m_exception_sp;
 };
 
 ConstString
@@ -129,7 +134,8 @@
 
 m_target.SetArchitecture(DetermineArchitecture());
 // TODO(amccarth):  Build the module list.
-// TODO(amccarth):  Read the exeception record.
+
+ReadExceptionRecord();
 
 return error;
 
@@ -146,21 +152,12 @@
 bool
 ProcessWinMiniDump::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
 {
-assert(m_data_up != nullptr);
-assert(m_data_up->m_base_addr != 0);
-
-MINIDUMP_DIRECTORY *dir = nullptr;
-void *ptr = nullptr;
-ULONG size = 0;
-if (::MiniDumpReadDumpStream(m_data_up->m_base_addr, ThreadListStream, &dir, &ptr, &size))
+size_t size = 0;
+auto thread_list_ptr = static_cast(FindDumpStream(ThreadListStream, &size));
+if (thread_list_ptr)
 {
-assert(dir->StreamType == ThreadListStream);
-assert(size == dir->Location.DataSize);
-assert(ptr == static_cast(static_cast(m_data_up->m_base_addr) + dir->Location.Rva));
-auto thread_list_ptr = static_cast(ptr);
 const ULONG32 thread_count = thread_list_ptr->NumberOfThreads;
-assert(thread_count < std::numeric_limits::max());
-for (int i = 0; i < thread_count; ++i) {
+for (ULONG32 i = 0; i < thread_count; ++i) {
 std::shared_ptr thread_sp(new ThreadWinMiniDump(*this, thread_list_ptr->Threads[i].ThreadId));
 new_thread_list.AddThread(thread_sp);
 }
@@ -172,6 +169,20 @@
 void
 ProcessWinMiniDump::RefreshStateAfterStop()
 {
+if (!m_data_up) return;
+if (!m_data_up->m_exception_sp) return;
+
+auto active_exception = m_data_up->m_exception_sp;
+std::string desc;
+llvm::raw_string_ostream desc_stream(desc);
+desc_stream << "Exception "
+<< llvm::format_hex(active_exception->GetExceptionCode(), 8)
+<< " encountered at address "
+<< llvm::format_hex(active_exception->GetExceptionAddress(), 8);
+m_thread_list.SetSelectedThreadByID(active_exception->GetThreadID());
+auto stop_thread = m_thread_list.GetSelectedThread();
+auto stop_info = StopInfo::CreateStopReasonWithException(*stop_thread, desc_stream.str().c_str());
+stop_thread->SetStopInfo(stop_info);
 }
 
 Error
@@ -302,18 +313,10 @@
 ArchSpec
 ProcessWinMiniDump::DetermineArchitecture()
 {
-assert(m_data_up != nullptr);
-assert(m_data_up->m_base_addr != 0);
-
-MINIDUMP_DIRECTORY *dir = nullptr;
-void *ptr = nullptr;
-ULONG size = 0;
-if (::MiniDumpReadDumpStream(m_data_up->m_base_addr, SystemInfoStream, &dir, &ptr, &size))
+size_t size = 0;
+auto system_info_ptr = static_cast(FindDumpStream(Syst

Re: [Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line when Windows filenames are used.

2015-08-18 Thread Dawn Perchik via lldb-commits
dawn added a comment.

> Are you saying that there is a situation where you are given a path, and you 
> have no idea whether it is a posix path or a windows path?


Yes.  For example, in lldb on OSX, we can be debugging an app that was built on 
OSX, or an app that was built on Windows targeting OSX.  More likely, we would 
be debugging an app that was built on Windows but links with libraries that 
were built on OSX.

I've thought of various ways to fit this into lldb...
One idea was to add:

  settings set target.pathsyntax [posix|windows|any|native] #default=native

and a FileSpec::ePathSyntaxAny enum which would be set if the user chose "any".
But that doesn't solve the problem for llvm, whose path handling appears to be 
controlled by the define LLVM_ON_WIN32.

Ideas?


Repository:
  rL LLVM

http://reviews.llvm.org/D12115



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


Re: [Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line when Windows filenames are used.

2015-08-18 Thread Bruce Mitchener via lldb-commits
brucem added a comment.

Apart from the concerns expressed by zturner, this needs a test as well  if 
possible.


Repository:
  rL LLVM

http://reviews.llvm.org/D12115



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


Re: [Lldb-commits] [PATCH] D11543: Fix evaluation of global operators in C++

2015-08-18 Thread Paul Herman via lldb-commits
paulherman added a comment.

Ping


http://reviews.llvm.org/D11543



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


[Lldb-commits] [lldb] r245397 - Fix LLDB after Clang r245346.

2015-08-18 Thread Richard Smith via lldb-commits
Author: rsmith
Date: Tue Aug 18 20:05:34 2015
New Revision: 245397

URL: http://llvm.org/viewvc/llvm-project?rev=245397&view=rev
Log:
Fix LLDB after Clang r245346.

The right thing to do here would be to give the ASTConsumer to the
CompilerInstance so it can set things up for us, but we can't do that
because we don't own it. So instead just initialize it ourselves.

Modified:
lldb/trunk/source/Expression/ClangExpressionParser.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=245397&r1=245396&r2=245397&view=diff
==
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Tue Aug 18 20:05:34 
2015
@@ -410,6 +410,7 @@ ClangExpressionParser::Parse (Stream &st
 diag_buf->BeginSourceFile(m_compiler->getLangOpts(), 
&m_compiler->getPreprocessor());
 
 ASTConsumer *ast_transformer = 
m_expr.ASTTransformer(m_code_generator.get());
+ast_transformer->Initialize(m_compiler->getASTContext());
 
 if (ClangExpressionDeclMap *decl_map = m_expr.DeclMap())
 decl_map->InstallCodeGenerator(m_code_generator.get());


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


[Lldb-commits] [lldb] r245398 - Update to r245397.

2015-08-18 Thread Chaoren Lin via lldb-commits
Author: chaoren
Date: Tue Aug 18 20:24:57 2015
New Revision: 245398

URL: http://llvm.org/viewvc/llvm-project?rev=245398&view=rev
Log:
Update to r245397.

`ast_transformer` could be null, in which case we should initialize
`m_code_generator` with the ASTContext.

Modified:
lldb/trunk/source/Expression/ClangExpressionParser.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=245398&r1=245397&r2=245398&view=diff
==
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Tue Aug 18 20:24:57 
2015
@@ -410,15 +410,20 @@ ClangExpressionParser::Parse (Stream &st
 diag_buf->BeginSourceFile(m_compiler->getLangOpts(), 
&m_compiler->getPreprocessor());
 
 ASTConsumer *ast_transformer = 
m_expr.ASTTransformer(m_code_generator.get());
-ast_transformer->Initialize(m_compiler->getASTContext());
 
 if (ClangExpressionDeclMap *decl_map = m_expr.DeclMap())
 decl_map->InstallCodeGenerator(m_code_generator.get());
-
+
 if (ast_transformer)
+{
+ast_transformer->Initialize(m_compiler->getASTContext());
 ParseAST(m_compiler->getPreprocessor(), ast_transformer, 
m_compiler->getASTContext());
+}
 else
+{
+m_code_generator->Initialize(m_compiler->getASTContext());
 ParseAST(m_compiler->getPreprocessor(), m_code_generator.get(), 
m_compiler->getASTContext());
+}
 
 diag_buf->EndSourceFile();
 


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


Re: [Lldb-commits] [PATCH] D12115: [LLDB-MI] Fix -data-info-line when Windows filenames are used.

2015-08-18 Thread Dawn Perchik via lldb-commits
dawn added a comment.

In http://reviews.llvm.org/D12115#227241, @brucem wrote:

> ... this needs a test as well  if possible.


Since the lldb-mi tests don't run on Windows, I don't see how that would be 
possible.


Repository:
  rL LLVM

http://reviews.llvm.org/D12115



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


[Lldb-commits] [lldb] r245407 - XFAIL TestCppChainedCalls for GCC.

2015-08-18 Thread Chaoren Lin via lldb-commits
Author: chaoren
Date: Tue Aug 18 21:55:33 2015
New Revision: 245407

URL: http://llvm.org/viewvc/llvm-project?rev=245407&view=rev
Log:
XFAIL TestCppChainedCalls for GCC.

Modified:
lldb/trunk/test/lang/cpp/chained-calls/TestCppChainedCalls.py

Modified: lldb/trunk/test/lang/cpp/chained-calls/TestCppChainedCalls.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/chained-calls/TestCppChainedCalls.py?rev=245407&r1=245406&r2=245407&view=diff
==
--- lldb/trunk/test/lang/cpp/chained-calls/TestCppChainedCalls.py (original)
+++ lldb/trunk/test/lang/cpp/chained-calls/TestCppChainedCalls.py Tue Aug 18 
21:55:33 2015
@@ -12,6 +12,7 @@ class TestCppChainedCalls(TestBase):
 self.buildDsym()
 self.check()
 
+@expectedFailureGcc
 @dwarf_test
 def test_with_dwarf_and_run_command(self):
 self.buildDwarf()


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


[Lldb-commits] [lldb] r245412 - Fix TestCppNsImport and TestCppScope for remote tests.

2015-08-18 Thread Chaoren Lin via lldb-commits
Author: chaoren
Date: Tue Aug 18 23:08:56 2015
New Revision: 245412

URL: http://llvm.org/viewvc/llvm-project?rev=245412&view=rev
Log:
Fix TestCppNsImport and TestCppScope for remote tests.

Modified:
lldb/trunk/test/lang/cpp/nsimport/TestCppNsImport.py
lldb/trunk/test/lang/cpp/scope/TestCppScope.py

Modified: lldb/trunk/test/lang/cpp/nsimport/TestCppNsImport.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/nsimport/TestCppNsImport.py?rev=245412&r1=245411&r2=245412&view=diff
==
--- lldb/trunk/test/lang/cpp/nsimport/TestCppNsImport.py (original)
+++ lldb/trunk/test/lang/cpp/nsimport/TestCppNsImport.py Tue Aug 18 23:08:56 
2015
@@ -6,9 +6,9 @@ from lldbtest import *
 import lldbutil
 
 class TestCppNsImport(TestBase):
-
+
 mydir = TestBase.compute_mydir(__file__)
-
+
 @skipUnlessDarwin
 @dsym_test
 def test_with_dsym_and_run_command(self):
@@ -32,12 +32,12 @@ class TestCppNsImport(TestBase):
 src_file = "main.cpp"
 src_file_spec = lldb.SBFileSpec(src_file)
 self.assertTrue(src_file_spec.IsValid(), "Main source file")
-
+
 # Get the path of the executable
-cwd = os.getcwd() 
+cwd = os.getcwd()
 exe_file = "a.out"
 exe_path  = os.path.join(cwd, exe_file)
-
+
 # Load the executable
 target = self.dbg.CreateTarget(exe_path)
 self.assertTrue(target.IsValid(), VALID_TARGET)
@@ -49,20 +49,20 @@ class TestCppNsImport(TestBase):
 # Launch the process
 args = None
 env = None
-process = target.LaunchSimple(args, env, cwd)
+process = target.LaunchSimple(args, env, 
self.get_process_working_directory())
 self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
 
 # Get the thread of the process
 self.assertTrue(process.GetState() == lldb.eStateStopped, 
PROCESS_STOPPED)
 thread = lldbutil.get_stopped_thread(process, 
lldb.eStopReasonBreakpoint)
 
-# Get current fream of the thread at the breakpoint 
+# Get current fream of the thread at the breakpoint
 frame = thread.GetSelectedFrame()
 
 # Test imported namespaces
 test_result = frame.EvaluateExpression("x")
 self.assertTrue(test_result.IsValid() and 
test_result.GetValueAsSigned() == 11, "x = 11")
-
+
 test_result = frame.EvaluateExpression("xx")
 self.assertTrue(test_result.IsValid() and 
test_result.GetValueAsSigned() == 22, "xx = 22")
 

Modified: lldb/trunk/test/lang/cpp/scope/TestCppScope.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/scope/TestCppScope.py?rev=245412&r1=245411&r2=245412&view=diff
==
--- lldb/trunk/test/lang/cpp/scope/TestCppScope.py (original)
+++ lldb/trunk/test/lang/cpp/scope/TestCppScope.py Tue Aug 18 23:08:56 2015
@@ -6,9 +6,9 @@ from lldbtest import *
 import lldbutil
 
 class TestCppScopes(TestBase):
-
+
 mydir = TestBase.compute_mydir(__file__)
-
+
 @skipUnlessDarwin
 @dsym_test
 def test_with_dsym_and_run_command(self):
@@ -28,12 +28,12 @@ class TestCppScopes(TestBase):
 src_file = "main.cpp"
 src_file_spec = lldb.SBFileSpec(src_file)
 self.assertTrue(src_file_spec.IsValid(), "Main source file")
-
+
 # Get the path of the executable
-cwd = os.getcwd() 
+cwd = os.getcwd()
 exe_file = "a.out"
 exe_path  = os.path.join(cwd, exe_file)
-
+
 # Load the executable
 target = self.dbg.CreateTarget(exe_path)
 self.assertTrue(target.IsValid(), VALID_TARGET)
@@ -45,20 +45,20 @@ class TestCppScopes(TestBase):
 # Launch the process
 args = None
 env = None
-process = target.LaunchSimple(args, env, cwd)
+process = target.LaunchSimple(args, env, 
self.get_process_working_directory())
 self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
 
 # Get the thread of the process
 self.assertTrue(process.GetState() == lldb.eStateStopped, 
PROCESS_STOPPED)
 thread = lldbutil.get_stopped_thread(process, 
lldb.eStopReasonBreakpoint)
 
-# Get current fream of the thread at the breakpoint 
+# Get current fream of the thread at the breakpoint
 frame = thread.GetSelectedFrame()
 
-# Test result for scopes of variables 
+# Test result for scopes of variables
 
 global_variables = frame.GetVariables(True, True, True, False)
-global_variables_assert = { 
+global_variables_assert = {
 'A::a': ,
 'B::a': ,
 'C::a': ,
@@ -68,7 +68,7 @@ class TestCppScopes(TestBase):
 
 self.assertTrue(global_variables.GetSize() == 4, "target variable 
returns all variables")
 for variable in global_variables

Re: [Lldb-commits] [PATCH] D11543: Fix evaluation of global operators in C++

2015-08-18 Thread Chaoren Lin via lldb-commits
chaoren added a subscriber: chaoren.


Comment at: test/lang/cpp/global_operators/TestCppGlobalOperators.py:9
@@ +8,3 @@
+class TestCppGlobalOperators(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)

Please be careful of trailing whitespaces.


Comment at: test/lang/cpp/global_operators/TestCppGlobalOperators.py:48
@@ +47,3 @@
+env = None
+process = target.LaunchSimple(args, env, cwd)
+self.assertTrue(process.IsValid(), PROCESS_IS_VALID)

Please use `self.get_process_working_directory()` instead of `cwd`, so that 
this works for remote targets.


http://reviews.llvm.org/D11543



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


Re: [Lldb-commits] [PATCH] D11947: Improve instruction emulation based stack unwinding

2015-08-18 Thread Jason Molenda via lldb-commits
jasonmolenda accepted this revision.
jasonmolenda added a comment.
This revision is now accepted and ready to land.

Looks good to me.


http://reviews.llvm.org/D11947



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


[Lldb-commits] [lldb] r245418 - XFAIL TestCppScope for Darwin.

2015-08-18 Thread Chaoren Lin via lldb-commits
Author: chaoren
Date: Wed Aug 19 01:21:09 2015
New Revision: 245418

URL: http://llvm.org/viewvc/llvm-project?rev=245418&view=rev
Log:
XFAIL TestCppScope for Darwin.

Modified:
lldb/trunk/test/lang/cpp/scope/TestCppScope.py

Modified: lldb/trunk/test/lang/cpp/scope/TestCppScope.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/scope/TestCppScope.py?rev=245418&r1=245417&r2=245418&view=diff
==
--- lldb/trunk/test/lang/cpp/scope/TestCppScope.py (original)
+++ lldb/trunk/test/lang/cpp/scope/TestCppScope.py Wed Aug 19 01:21:09 2015
@@ -9,12 +9,14 @@ class TestCppScopes(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
+@expectedFailureDarwin
 @skipUnlessDarwin
 @dsym_test
 def test_with_dsym_and_run_command(self):
 self.buildDsym()
 self.check()
 
+@expectedFailureDarwin
 @dwarf_test
 def test_with_dwarf_and_run_command(self):
 self.buildDwarf()


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


[Lldb-commits] [PATCH] D12138: On Linux, clear the signal mask of the launched inferior

2015-08-18 Thread Yacine Belkadi via lldb-commits
ybelkadi created this revision.
ybelkadi added reviewers: labath, ovyalov.
ybelkadi added a subscriber: lldb-commits.

Due to fork()/execve(), the launched inferior inherits the signal mask of its 
parent (lldb-server). But because lldb-server modifies its signal mask (It 
blocks SIGCHLD, for example), the inferior starts with some signals being 
initially blocked.

One consequence is that TestCallThatRestarts.ExprCommandThatRestartsTestCase 
(test/expression_command/call-restarts) fails because sigchld_handler() in 
lotta-signals.c is not called, due to the SIGCHLD signal being blocked.

To prevent the signal masking done by lldb-server from affecting the created 
inferior, the signal mask of the inferior is now cleared before the execve().

http://reviews.llvm.org/D12138

Files:
  source/Plugins/Process/Linux/NativeProcessLinux.cpp

Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp
===
--- source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -554,7 +554,8 @@
 eDupStderrFailed,
 eChdirFailed,
 eExecFailed,
-eSetGidFailed
+eSetGidFailed,
+eSetSigMaskFailed
 };
 
 // Child process.
@@ -629,6 +630,12 @@
 }
 }
 
+// Clear the signal mask to prevent the child from being affected by
+// any masking done by the parent.
+sigset_t set;
+if (sigemptyset(&set) != 0 || pthread_sigmask(SIG_SETMASK, &set, 
nullptr) != 0)
+exit(eSetSigMaskFailed);
+
 // Execute.  We should never return...
 execve(argv[0],
const_cast(argv),
@@ -686,6 +693,9 @@
 case eSetGidFailed:
 error.SetErrorString("Child setgid failed.");
 break;
+case eSetSigMaskFailed:
+error.SetErrorString("Child failed to set signal mask.");
+break;
 default:
 error.SetErrorString("Child returned unknown exit status.");
 break;


Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp
===
--- source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -554,7 +554,8 @@
 eDupStderrFailed,
 eChdirFailed,
 eExecFailed,
-eSetGidFailed
+eSetGidFailed,
+eSetSigMaskFailed
 };
 
 // Child process.
@@ -629,6 +630,12 @@
 }
 }
 
+// Clear the signal mask to prevent the child from being affected by
+// any masking done by the parent.
+sigset_t set;
+if (sigemptyset(&set) != 0 || pthread_sigmask(SIG_SETMASK, &set, nullptr) != 0)
+exit(eSetSigMaskFailed);
+
 // Execute.  We should never return...
 execve(argv[0],
const_cast(argv),
@@ -686,6 +693,9 @@
 case eSetGidFailed:
 error.SetErrorString("Child setgid failed.");
 break;
+case eSetSigMaskFailed:
+error.SetErrorString("Child failed to set signal mask.");
+break;
 default:
 error.SetErrorString("Child returned unknown exit status.");
 break;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits