Re: [Lldb-commits] [PATCH] D16055: Add clang::Type::Pipe to ClangASTContext

2016-01-12 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257460: Add clang::Type::Pipe to ClangASTContext (authored 
by labath).

Changed prior to commit:
  http://reviews.llvm.org/D16055?vs=44456&id=44607#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16055

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

Index: lldb/trunk/source/Symbol/ClangASTContext.cpp
===
--- lldb/trunk/source/Symbol/ClangASTContext.cpp
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp
@@ -4158,6 +4158,7 @@
 case clang::Type::Decltype: break;
 case clang::Type::TemplateSpecialization:   break;
 case clang::Type::Atomic:   break;
+case clang::Type::Pipe: break;
 
 // pointer type decayed from an array or function type.
 case clang::Type::Decayed:  break;
@@ -4891,6 +4892,7 @@
 case clang::Type::TemplateSpecialization:
 case clang::Type::Atomic:
 case clang::Type::Adjusted:
+case clang::Type::Pipe:
 break;
 
 // pointer type decayed from an array or function type.
@@ -5008,6 +5010,7 @@
 case clang::Type::TemplateSpecialization:
 case clang::Type::Atomic:
 case clang::Type::Adjusted:
+case clang::Type::Pipe:
 break;
 
 // pointer type decayed from an array or function type.


Index: lldb/trunk/source/Symbol/ClangASTContext.cpp
===
--- lldb/trunk/source/Symbol/ClangASTContext.cpp
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp
@@ -4158,6 +4158,7 @@
 case clang::Type::Decltype: break;
 case clang::Type::TemplateSpecialization:   break;
 case clang::Type::Atomic:   break;
+case clang::Type::Pipe: break;
 
 // pointer type decayed from an array or function type.
 case clang::Type::Decayed:  break;
@@ -4891,6 +4892,7 @@
 case clang::Type::TemplateSpecialization:
 case clang::Type::Atomic:
 case clang::Type::Adjusted:
+case clang::Type::Pipe:
 break;
 
 // pointer type decayed from an array or function type.
@@ -5008,6 +5010,7 @@
 case clang::Type::TemplateSpecialization:
 case clang::Type::Atomic:
 case clang::Type::Adjusted:
+case clang::Type::Pipe:
 break;
 
 // pointer type decayed from an array or function type.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r257460 - Add clang::Type::Pipe to ClangASTContext

2016-01-12 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jan 12 02:51:28 2016
New Revision: 257460

URL: http://llvm.org/viewvc/llvm-project?rev=257460&view=rev
Log:
Add clang::Type::Pipe to ClangASTContext

Summary:
Clang recently added support for an OpenCL pipe type. Adding the new type to 
relevant switches to
avoid warnings.

Reviewers: clayborg

Subscribers: lldb-commits

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

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

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=257460&r1=257459&r2=257460&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Jan 12 02:51:28 2016
@@ -4158,6 +4158,7 @@ ClangASTContext::GetTypeClass (lldb::opa
 case clang::Type::Decltype: break;
 case clang::Type::TemplateSpecialization:   break;
 case clang::Type::Atomic:   break;
+case clang::Type::Pipe: break;
 
 // pointer type decayed from an array or function type.
 case clang::Type::Decayed:  break;
@@ -4891,6 +4892,7 @@ ClangASTContext::GetEncoding (lldb::opaq
 case clang::Type::TemplateSpecialization:
 case clang::Type::Atomic:
 case clang::Type::Adjusted:
+case clang::Type::Pipe:
 break;
 
 // pointer type decayed from an array or function type.
@@ -5008,6 +5010,7 @@ ClangASTContext::GetFormat (lldb::opaque
 case clang::Type::TemplateSpecialization:
 case clang::Type::Atomic:
 case clang::Type::Adjusted:
+case clang::Type::Pipe:
 break;
 
 // pointer type decayed from an array or function type.


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


[Lldb-commits] [lldb] r257465 - Fix for TestNoreturnUnwind.py on i386

2016-01-12 Thread Ravitheja Addepally via lldb-commits
Author: ravitheja
Date: Tue Jan 12 04:08:41 2016
New Revision: 257465

URL: http://llvm.org/viewvc/llvm-project?rev=257465&view=rev
Log:
Fix for TestNoreturnUnwind.py on i386

Summary:
The testcase TestNoreturnUnwind.py was failing
because the unwind from the vdso library was not
successful for clang compiler while it was passing
for gcc. It was passing for gcc since the unwind plan
used was the assembly plan and the ebp register was
set by the main function in case of gcc and was not
used by the functions in the call flow to the vdso, whereas
clang did not emit assembly prologue for main and so
 the assembly unwind was failing. Normally in case of
failure of assembly unwind, lldb switches to EH CFI frame
based unwinding, but this was not happening for
the first frame. This patch tries to fix this behaviour by
falling to EH CFI frame based unwinding in case of assembly
unwind failure even for the first frame.
The test is still marked as XFAIL since it relys on the fix
of another bug.

Reviewers: lldb-commits, jingham, zturner, tberghammer, jasonmolenda

Subscribers: jasonmolenda

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py?rev=257465&r1=257464&r2=257465&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
 Tue Jan 12 04:08:41 2016
@@ -14,7 +14,7 @@ import lldbsuite.test.lldbutil as lldbut
 class NoreturnUnwind(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailurei386 #xfail to get buildbot green, failing config: i386 
binary running on ubuntu 14.04 x86_64
+@expectedFailurei386("llvm.org/pr25338")
 @skipIfWindows # clang-cl does not support gcc style attributes.
 def test (self):
 """Test that we can backtrace correctly with 'noreturn' functions on 
the stack"""

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=257465&r1=257464&r2=257465&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Tue Jan 
12 04:08:41 2016
@@ -265,9 +265,32 @@ RegisterContextLLDB::InitializeZerothFra
 
 if (!ReadCFAValueForRow (row_register_kind, active_row, m_cfa))
 {
-UnwindLogMsg ("could not read CFA register for this frame.");
-m_frame_type = eNotAValidFrame;
-return;
+// Try the fall back unwind plan since the
+// full unwind plan failed.
+FuncUnwindersSP func_unwinders_sp;
+UnwindPlanSP call_site_unwind_plan;
+bool cfa_status = false;
+
+if (m_sym_ctx_valid)
+{
+func_unwinders_sp = 
pc_module_sp->GetObjectFile()->GetUnwindTable().GetFuncUnwindersContainingAddress
 (m_current_pc, m_sym_ctx);
+}
+
+if(func_unwinders_sp.get() != nullptr)
+call_site_unwind_plan = 
func_unwinders_sp->GetUnwindPlanAtCallSite(process->GetTarget(), 
m_current_offset_backed_up_one);
+
+if (call_site_unwind_plan.get() != nullptr)
+{
+m_fallback_unwind_plan_sp = call_site_unwind_plan;
+if(TryFallbackUnwindPlan())
+cfa_status = true;
+}
+if (!cfa_status)
+{
+UnwindLogMsg ("could not read CFA value for first frame.");
+m_frame_type = eNotAValidFrame;
+return;
+}
 }
 
 UnwindLogMsg ("initialized frame current pc is 0x%" PRIx64 " cfa is 0x%" 
PRIx64 " using %s UnwindPlan",


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


[Lldb-commits] [lldb] r257469 - Try to fix the mips64 build after rL257447

2016-01-12 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Jan 12 04:41:43 2016
New Revision: 257469

URL: http://llvm.org/viewvc/llvm-project?rev=257469&view=rev
Log:
Try to fix the mips64 build after rL257447

Modified:

lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp?rev=257469&r1=257468&r2=257469&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp 
Tue Jan 12 04:41:43 2016
@@ -1389,7 +1389,7 @@ NativeRegisterContextLinux_mips64::DoRea
 lldb_private::ArchSpec arch;
 if (m_thread.GetProcess()->GetArchitecture(arch))
 {
-void* target_address = ((uint8_t*)®s) + offset + 4 * 
(arch.GetMachine() == llvm::Triple::mips;
+void* target_address = ((uint8_t*)®s) + offset + 4 * 
(arch.GetMachine() == llvm::Triple::mips);
 uint32_t target_size;
 if ((::strcmp(reg_name, "sr") == 0) || (::strcmp(reg_name, 
"cause") == 0) || (::strcmp(reg_name, "config5") == 0))
 target_size = 4;


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


Re: [Lldb-commits] [PATCH] D15527: Add ability to override JIT expr compiler options.

2016-01-12 Thread Luke Drummond via lldb-commits
ldrumm requested a review of this revision.
ldrumm added a comment.

bump



Comment at: 
source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:85-97
@@ -83,1 +84,15 @@
 
+namespace {
+void debugStringVector(Log *log, const std::vector& vec, 
const char *name)
+{
+if(!log)
+return;
+
+log->Debug("Begin %s:", name);
+for (const auto& s : vec)
+log->Debug("%s", s.c_str());
+
+log->Debug("End %s.", name);
+}
+}
+

clayborg wrote:
> We have an internal class named StringList that is a vector of strings. It 
> would be nice to use that class instead of a direct std::vector and place 
> this call inside the StringList class as a new method.
Thanks for the suggestion. I've added that as a separate commit, as it touches 
an entirely different codepath: http://reviews.llvm.org/D15773


http://reviews.llvm.org/D15527



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


Re: [Lldb-commits] [PATCH] D16107: Fix for Bug 25338

2016-01-12 Thread Pavel Labath via lldb-commits
labath added a comment.

Could you explain what is the nature of the failure in the vdso parsing? 
Otherwise it's quite hard to see what's the relationship of your patch to it, 
as it seems that the ObjectFile should be able to handle files which are not 
fully contained within the initial read (comment on Module::GetMemoryObjectFile 
says that it's enough if size_to_read contains the file header).

Also, if this fixes a test (I think I remember us disabling a test because of 
this), can you please enable it again?



Comment at: include/lldb/Target/Process.h:3145
@@ +3144,3 @@
+/// Try to find the end address of a file.
+/// The end address is defined as the address of the last memory
+/// region what contains data mapped from the specified file.

This definition sounds confusing to me. I would read this as the "start address 
of the last block ...", which is clearly not what you want. It's probably 
enough to change it to "*end* address of the last block".


Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:2973
@@ +2972,3 @@
+StringExtractor addr_extractor(maps_columns[0].str().c_str());
+addr_extractor.GetHexMaxU64(false, LLDB_INVALID_ADDRESS);
+char ch = addr_extractor.GetChar('\0');

This will be wrong if the file contains multiple entries for the same file 
(probably because different segments are mapped with different permissions). 
Doesn't happen for the vdso, but all other files have this. You should probably 
look for the *last* segment matching this file and get it's end address.


Comment at: source/Utility/StringExtractorGDBRemote.cpp:149
@@ -148,2 +148,3 @@
 if (PACKET_STARTS_WITH ("qFileLoadAddress:"))   return 
eServerPacketType_qFileLoadAddress;
+if (PACKET_STARTS_WITH ("qFileEndAddress:"))   return 
eServerPacketType_qFileEndAddress;
 break;

Could you also document this packet in `docs/lldb-gdb-remote.txt`?


http://reviews.llvm.org/D16107



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


Re: [Lldb-commits] [PATCH] D16107: Fix for Bug 25338

2016-01-12 Thread Pavel Labath via lldb-commits
labath added a comment.

In http://reviews.llvm.org/D16107#324594, @labath wrote:

> Could you explain what is the nature of the failure in the vdso parsing?


Strike that. I see that you have linked the bug # in the title...


http://reviews.llvm.org/D16107



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


Re: [Lldb-commits] [PATCH] D16107: Fix for Bug 25338

2016-01-12 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

Can we calculate the size of the object file based on elf headers and the 
section headers instead of using the /proc file system?

I think a good algorithm would be to take the maximum of the following 2 
expression:

  Start of section header + Number of section headers x  Size of section headers
  Max (for each section: section file address + section size)




http://reviews.llvm.org/D16107



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


Re: [Lldb-commits] [PATCH] D15527: Add ability to override JIT expr compiler options.

2016-01-12 Thread Sean Callanan via lldb-commits
spyffe added a comment.

I'm a little concerned that LanguageRuntime::GetOverrideExprOptions() appears 
to generate a new set of options from whole cloth rather than using the 
existing set as a starting point.

Specifically, since your use case is wanting to override the calling 
convention, I think it's heavy handed to override all the options.  I could 
conceive of new expression parser features changing some other flags in the 
future, and it'd be unfortunate if we had to duplicate those features in the 
ActionScript code just because the options are being overridden.

Could we model this as OverrideExprOptions(clang::TargetOptions &) instead and 
modify the options in place?  That way customizations could stack.


http://reviews.llvm.org/D15527



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


[Lldb-commits] [lldb] r257502 - Increase use of svr4 packets to improve performance on POSIX remotes

2016-01-12 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Tue Jan 12 13:02:41 2016
New Revision: 257502

URL: http://llvm.org/viewvc/llvm-project?rev=257502&view=rev
Log:
Increase use of svr4 packets to improve performance on POSIX remotes

Summary:
Allows the remote to enumerate the link map when adding and removing
shared libraries, so that lldb doesn't need to read it manually from
the remote's memory.

This provides very large speedups (on the order of 50%) in total
startup time when using the ds2 remote on android or Tizen devices.

Reviewers: ADodds, tberghammer, tfiala

Subscribers: tberghammer, sas, danalbert, llvm-commits, srhines

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

Change by Francis Ricci 

Added:
lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h
Modified:
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h

Added: lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h?rev=257502&view=auto
==
--- lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h (added)
+++ lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h Tue Jan 12 13:02:41 2016
@@ -0,0 +1,152 @@
+//===-- LoadedModuleInfoList.h --*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef liblldb_LoadedModuleInfoList_h_
+#define liblldb_LoadedModuleInfoList_h_
+
+// C Includes
+
+// C++ Includes
+#include 
+
+// Other libraries and framework includes
+#include "lldb/lldb-private-forward.h"
+
+namespace lldb_private {
+class LoadedModuleInfoList
+{
+public:
+
+class LoadedModuleInfo
+{
+public:
+
+enum e_data_point
+{
+e_has_name  = 0,
+e_has_base  ,
+e_has_dynamic   ,
+e_has_link_map  ,
+e_num
+};
+
+LoadedModuleInfo ()
+{
+for (uint32_t i = 0; i < e_num; ++i)
+m_has[i] = false;
+};
+
+void set_name (const std::string & name)
+{
+m_name = name;
+m_has[e_has_name] = true;
+}
+bool get_name (std::string & out) const
+{
+out = m_name;
+return m_has[e_has_name];
+}
+
+void set_base (const lldb::addr_t base)
+{
+m_base = base;
+m_has[e_has_base] = true;
+}
+bool get_base (lldb::addr_t & out) const
+{
+out = m_base;
+return m_has[e_has_base];
+}
+
+void set_base_is_offset (bool is_offset)
+{
+m_base_is_offset = is_offset;
+}
+bool get_base_is_offset(bool & out) const
+{
+out = m_base_is_offset;
+return m_has[e_has_base];
+}
+
+void set_link_map (const lldb::addr_t addr)
+{
+m_link_map = addr;
+m_has[e_has_link_map] = true;
+}
+bool get_link_map (lldb::addr_t & out) const
+{
+out = m_link_map;
+return m_has[e_has_link_map];
+}
+
+void set_dynamic (const lldb::addr_t addr)
+{
+m_dynamic = addr;
+m_has[e_has_dynamic] = true;
+}
+bool get_dynamic (lldb::addr_t & out) const
+{
+out = m_dynamic;
+return m_has[e_has_dynamic];
+}
+
+bool has_info (e_data_point datum) const
+{
+assert (datum < e_num);
+return m_has[datum];
+}
+
+bool
+operator == (LoadedModuleInfo const &rhs) const
+{
+if (e_num != rhs.e_num)
+return false;
+
+for (size_t i = 0; i < e_num; ++i)
+{
+if (m_has[i] != rhs.m_has[i])
+return false;
+}
+
+return (m_base == rhs.m_base) &&
+   (m_link_map == rhs.m_link_map) &&
+   (m_dynamic == rhs.m_dynamic) &&
+   (m_name == rhs.m_name);
+}
+protected:
+
+bool m_has[e_num];
+std::string m_name;
+lldb::addr_t m_link_map;
+lldb::addr_t m_base;
+bool m_base_is_offset;
+lldb::addr_t m_dynamic;
+};
+
+LoadedModuleInfoList ()
+: m_list ()
+, m_link_map (LLDB_INVALID_ADDRESS)
+{}
+
+void add (const LoadedModuleInfo & mod)
+{
+m

Re: [Lldb-commits] [PATCH] D16107: Fix for Bug 25338

2016-01-12 Thread Oleksiy Vyalov via lldb-commits
ovyalov added a comment.

vdso issue is related to ELF format and I'm wondering whether we can keep the 
fix contained in ObjectFileELF - for example, if a section that we're trying to 
read is beyond the boundaries of memory buffer we can read its content from 
inferior's memory using ObjectFile::m_process_wp.


http://reviews.llvm.org/D16107



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


Re: [Lldb-commits] [lldb] r257502 - Increase use of svr4 packets to improve performance on POSIX remotes

2016-01-12 Thread Stephane Sezer via lldb-commits
Looking at it now.

On Tue, Jan 12, 2016 at 11:25 AM, Siva Chandra  wrote:
> This breaks the build:
> http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/4487
>
> On Tue, Jan 12, 2016 at 11:02 AM, Stephane Sezer via lldb-commits
>  wrote:
>> Author: sas
>> Date: Tue Jan 12 13:02:41 2016
>> New Revision: 257502
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=257502&view=rev
>> Log:
>> Increase use of svr4 packets to improve performance on POSIX remotes
>>
>> Summary:
>> Allows the remote to enumerate the link map when adding and removing
>> shared libraries, so that lldb doesn't need to read it manually from
>> the remote's memory.
>>
>> This provides very large speedups (on the order of 50%) in total
>> startup time when using the ds2 remote on android or Tizen devices.
>>
>> Reviewers: ADodds, tberghammer, tfiala
>>
>> Subscribers: tberghammer, sas, danalbert, llvm-commits, srhines
>>
>> Differential Revision: http://reviews.llvm.org/D16004
>>
>> Change by Francis Ricci 
>>
>> Added:
>> lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h
>> Modified:
>> lldb/trunk/include/lldb/Target/Process.h
>> lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
>> lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
>> lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
>> lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
>>
>> Added: lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h?rev=257502&view=auto
>> ==
>> --- lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h (added)
>> +++ lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h Tue Jan 12 13:02:41 
>> 2016
>> @@ -0,0 +1,152 @@
>> +//===-- LoadedModuleInfoList.h --*- C++ 
>> -*-===//
>> +//
>> +// The LLVM Compiler Infrastructure
>> +//
>> +// This file is distributed under the University of Illinois Open Source
>> +// License. See LICENSE.TXT for details.
>> +//
>> +//===--===//
>> +
>> +#ifndef liblldb_LoadedModuleInfoList_h_
>> +#define liblldb_LoadedModuleInfoList_h_
>> +
>> +// C Includes
>> +
>> +// C++ Includes
>> +#include 
>> +
>> +// Other libraries and framework includes
>> +#include "lldb/lldb-private-forward.h"
>> +
>> +namespace lldb_private {
>> +class LoadedModuleInfoList
>> +{
>> +public:
>> +
>> +class LoadedModuleInfo
>> +{
>> +public:
>> +
>> +enum e_data_point
>> +{
>> +e_has_name  = 0,
>> +e_has_base  ,
>> +e_has_dynamic   ,
>> +e_has_link_map  ,
>> +e_num
>> +};
>> +
>> +LoadedModuleInfo ()
>> +{
>> +for (uint32_t i = 0; i < e_num; ++i)
>> +m_has[i] = false;
>> +};
>> +
>> +void set_name (const std::string & name)
>> +{
>> +m_name = name;
>> +m_has[e_has_name] = true;
>> +}
>> +bool get_name (std::string & out) const
>> +{
>> +out = m_name;
>> +return m_has[e_has_name];
>> +}
>> +
>> +void set_base (const lldb::addr_t base)
>> +{
>> +m_base = base;
>> +m_has[e_has_base] = true;
>> +}
>> +bool get_base (lldb::addr_t & out) const
>> +{
>> +out = m_base;
>> +return m_has[e_has_base];
>> +}
>> +
>> +void set_base_is_offset (bool is_offset)
>> +{
>> +m_base_is_offset = is_offset;
>> +}
>> +bool get_base_is_offset(bool & out) const
>> +{
>> +out = m_base_is_offset;
>> +return m_has[e_has_base];
>> +}
>> +
>> +void set_link_map (const lldb::addr_t addr)
>> +{
>> +m_link_map = addr;
>> +m_has[e_has_link_map] = true;
>> +}
>> +bool get_link_map (lldb::addr_t & out) const
>> +{
>> +out = m_link_map;
>> +return m_has[e_has_link_map];
>> +}
>> +
>> +void set_dynamic (const lldb::addr_t addr)
>> +{
>> +m_dynamic = addr;
>> +m_has[e_has_dynamic] = true;
>> +}
>> +bool get_dynamic (lldb::addr_t & out) const
>> +{
>> +out = m_dynamic;
>> +return m_has[e_has_dynamic];
>> +}
>> +
>> +bool has_info (e_data_point datum) const
>> +{
>> +assert (datum < e_num);
>> +return m_has[datum];
>> +}
>> +
>> +bool
>> +operator == (LoadedModuleInfo const &rhs) const
>> +{
>> +if (e_num != rhs.e_num)
>> +return false;
>> +
>> +for (size_t i = 0; i 

[Lldb-commits] [lldb] r257510 - Fix build breakage of r257502.

2016-01-12 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Tue Jan 12 14:22:58 2016
New Revision: 257510

URL: http://llvm.org/viewvc/llvm-project?rev=257510&view=rev
Log:
Fix build breakage of r257502.

Modified:
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp

Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp?rev=257510&r1=257509&r2=257510&view=diff
==
--- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp 
(original)
+++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp Tue 
Jan 12 14:22:58 2016
@@ -349,7 +349,7 @@ DYLDRendezvous::RemoveSOEntriesFromRemot
 // Only add shared libraries and not the executable.
 if (!SOEntryIsMainExecutable(entry))
 {
-iterator pos = std::find(m_soentries.begin(), m_soentries.end(), 
entry);
+auto pos = std::find(m_soentries.begin(), m_soentries.end(), 
entry);
 if (pos == m_soentries.end())
 return false;
 


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


[Lldb-commits] [lldb] r257513 - Fix TestThreadJump on Windows.

2016-01-12 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Jan 12 14:45:29 2016
New Revision: 257513

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

The system can create threads for a system threadpool, so there is
no guarantee that the thread that is stopped is thread 1.  So use
a more robust check.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py?rev=257513&r1=257512&r2=257513&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
 Tue Jan 12 14:45:29 2016
@@ -34,8 +34,7 @@ class ThreadJumpTestCase(TestBase):
 # The stop reason of the thread should be breakpoint 1.
 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT + " 1",
 substrs = ['stopped',
-   '* thread #1',
-   'stop reason = breakpoint 1'])
+   'main.cpp:{}, stop reason = breakpoint 
1'.format(self.mark3)])
 
 self.do_min_test(self.mark3, self.mark1, "i", "4"); # Try the int 
path, force it to return 'a'
 self.do_min_test(self.mark3, self.mark2, "i", "5"); # Try the int 
path, force it to return 'b'


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


Re: [Lldb-commits] [PATCH] D15527: Add ability to override JIT expr compiler options.

2016-01-12 Thread Luke Drummond via lldb-commits
ldrumm added a comment.

In http://reviews.llvm.org/D15527#324919, @spyffe wrote:

> I'm a little concerned that LanguageRuntime::GetOverrideExprOptions() appears 
> to generate a new set of options from whole cloth rather than using the 
> existing set as a starting point.
>
> Specifically, since your use case is wanting to override the calling 
> convention, I think it's heavy handed to override all the options.  I could 
> conceive of new expression parser features changing some other flags in the 
> future, and it'd be unfortunate if we had to duplicate those features in the 
> ActionScript code just because the options are being overridden.


That's definitely a good point!

> Could we model this as OverrideExprOptions(clang::TargetOptions &) instead 
> and modify the options in place?  That way customizations could stack.


I think this is a really helpful suggestion, but I'm slightly foggy on the 
semantic changes you propose.
If we go ahead, and implement `OverrideExprOptions(clang::TargetOptions &)` 
what type do you think the virtual method  should return as a default value? I 
like the semantics of the `nullptr` meaning "nothing going on here", and I 
think it's conceptually easier to specialize instances of OverrideExprOptions 
in individual runtimes with the default base implementation return `nullptr` in 
case the user doesn't know or care (though this may be only a personal 
preference. AFAICS this will also make it easier to pass around pointers to the 
base class, while having specialized  instances available to be constructed in 
the `Runtime dynamically`.

I propose that we incorporate your suggestion and pass in a ``const 
clang::TargetOptions &`` which allows the runtime to learn about its 
environment, but allows dynamic allocation in subclasses, where this is 
appropriate. Perhaps also incorporating use of ``std::shared_ptr`` to track 
ownership of the returned object would be helpful here to improve the 
management style.

Thanks

Luke


http://reviews.llvm.org/D15527



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


[Lldb-commits] [PATCH] D16125: [TestThreadJump] Adjust match sub-string after recent change.

2016-01-12 Thread Siva Chandra via lldb-commits
sivachandra created this revision.
sivachandra added a reviewer: zturner.
sivachandra added a subscriber: lldb-commits.

http://reviews.llvm.org/D16125

Files:
  packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py

Index: 
packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
===
--- packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
+++ packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
@@ -34,7 +34,7 @@
 # The stop reason of the thread should be breakpoint 1.
 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT + " 1",
 substrs = ['stopped',
-   'main.cpp:{}, stop reason = breakpoint 
1'.format(self.mark3)])
+   "main.cpp:{0}, name = '{1}', stop reason = breakpoint 
1".format(self.mark3, os.path.basename(exe))])
 
 self.do_min_test(self.mark3, self.mark1, "i", "4"); # Try the int 
path, force it to return 'a'
 self.do_min_test(self.mark3, self.mark2, "i", "5"); # Try the int 
path, force it to return 'b'


Index: packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
===
--- packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
+++ packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
@@ -34,7 +34,7 @@
 # The stop reason of the thread should be breakpoint 1.
 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT + " 1",
 substrs = ['stopped',
-   'main.cpp:{}, stop reason = breakpoint 1'.format(self.mark3)])
+   "main.cpp:{0}, name = '{1}', stop reason = breakpoint 1".format(self.mark3, os.path.basename(exe))])
 
 self.do_min_test(self.mark3, self.mark1, "i", "4"); # Try the int path, force it to return 'a'
 self.do_min_test(self.mark3, self.mark2, "i", "5"); # Try the int path, force it to return 'b'
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16125: [TestThreadJump] Adjust match sub-string after recent change.

2016-01-12 Thread Zachary Turner via lldb-commits
This isn't going to work either, because Windows doesn't the name=
portion.  God I really hate these tests that do substring matching.

I guess there's no easy way to guarantee that the main.cpp: is
on the same frame as the breakpoint.  Can you change it to:

substrs = ['stopped',
'main.cpp:{}'.format(self.mark3),
'stop reason = breakpoint 1'
]

On Tue, Jan 12, 2016 at 2:14 PM Siva Chandra  wrote:

> sivachandra created this revision.
> sivachandra added a reviewer: zturner.
> sivachandra added a subscriber: lldb-commits.
>
> http://reviews.llvm.org/D16125
>
> Files:
>
> packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
>
> Index:
> packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
> ===
> ---
> packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
> +++
> packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
> @@ -34,7 +34,7 @@
>  # The stop reason of the thread should be breakpoint 1.
>  self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT + " 1",
>  substrs = ['stopped',
> -   'main.cpp:{}, stop reason = breakpoint
> 1'.format(self.mark3)])
> +   "main.cpp:{0}, name = '{1}', stop reason =
> breakpoint 1".format(self.mark3, os.path.basename(exe))])
>
>  self.do_min_test(self.mark3, self.mark1, "i", "4"); # Try the int
> path, force it to return 'a'
>  self.do_min_test(self.mark3, self.mark2, "i", "5"); # Try the int
> path, force it to return 'b'
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16125: [TestThreadJump] Adjust match sub-string after recent change.

2016-01-12 Thread Siva Chandra via lldb-commits
sivachandra updated this revision to Diff 44674.
sivachandra added a comment.

Address comment


http://reviews.llvm.org/D16125

Files:
  packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py

Index: 
packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
===
--- packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
+++ packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
@@ -33,8 +33,7 @@
 
 # The stop reason of the thread should be breakpoint 1.
 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT + " 1",
-substrs = ['stopped',
-   'main.cpp:{}, stop reason = breakpoint 
1'.format(self.mark3)])
+substrs=['stopped', 'main.cpp:{}'.format(self.mark3), 
'stop reason = breakpoint 1'])
 
 self.do_min_test(self.mark3, self.mark1, "i", "4"); # Try the int 
path, force it to return 'a'
 self.do_min_test(self.mark3, self.mark2, "i", "5"); # Try the int 
path, force it to return 'b'


Index: packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
===
--- packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
+++ packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
@@ -33,8 +33,7 @@
 
 # The stop reason of the thread should be breakpoint 1.
 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT + " 1",
-substrs = ['stopped',
-   'main.cpp:{}, stop reason = breakpoint 1'.format(self.mark3)])
+substrs=['stopped', 'main.cpp:{}'.format(self.mark3), 'stop reason = breakpoint 1'])
 
 self.do_min_test(self.mark3, self.mark1, "i", "4"); # Try the int path, force it to return 'a'
 self.do_min_test(self.mark3, self.mark2, "i", "5"); # Try the int path, force it to return 'b'
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16125: [TestThreadJump] Adjust match sub-string after recent change.

2016-01-12 Thread Zachary Turner via lldb-commits
zturner accepted this revision.
zturner added a comment.
This revision is now accepted and ready to land.

If this passes on your side, go ahead.  Just from looking, I think it should 
pass on Windows.


http://reviews.llvm.org/D16125



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


[Lldb-commits] [lldb] r257531 - [TestThreadJump] Adjust match sub-string after recent change.

2016-01-12 Thread Siva Chandra via lldb-commits
Author: sivachandra
Date: Tue Jan 12 16:33:19 2016
New Revision: 257531

URL: http://llvm.org/viewvc/llvm-project?rev=257531&view=rev
Log:
[TestThreadJump] Adjust match sub-string after recent change.

Reviewers: zturner

Subscribers: zturner, lldb-commits

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py?rev=257531&r1=257530&r2=257531&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
 Tue Jan 12 16:33:19 2016
@@ -33,8 +33,7 @@ class ThreadJumpTestCase(TestBase):
 
 # The stop reason of the thread should be breakpoint 1.
 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT + " 1",
-substrs = ['stopped',
-   'main.cpp:{}, stop reason = breakpoint 
1'.format(self.mark3)])
+substrs=['stopped', 'main.cpp:{}'.format(self.mark3), 
'stop reason = breakpoint 1'])
 
 self.do_min_test(self.mark3, self.mark1, "i", "4"); # Try the int 
path, force it to return 'a'
 self.do_min_test(self.mark3, self.mark2, "i", "5"); # Try the int 
path, force it to return 'b'


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


[Lldb-commits] [PATCH] D16128: Fix TestProcessLaunch.test_environment_with_special_char for Python 3

2016-01-12 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added a reviewer: amccarth.
zturner added a subscriber: lldb-commits.

There were a number of problems preventing this from working:

1. The SWIG typemaps for converting Python lists to and from C++
   arrays were not updated for Python 3.  So they were doing things
   like PyString_Check instead of using the PythonString from
   PythonDataObjects.
2. ProcessLauncherWindows was ignoring the environment completely.
   So any test that involved launching an inferior with any kind
   of environment variable would have failed.
3. The test itself was using process.GetSTDOUT(), which isn't
   implemented on Windows.  So this was changed to redirect
   stdout to a file, and then the test reads the file.

http://reviews.llvm.org/D16128

Files:
  
packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
  packages/Python/lldbsuite/test/functionalities/process_launch/print_env.cpp
  scripts/Python/python-typemaps.swig
  source/Host/windows/ProcessLauncherWindows.cpp

Index: source/Host/windows/ProcessLauncherWindows.cpp
===
--- source/Host/windows/ProcessLauncherWindows.cpp
+++ source/Host/windows/ProcessLauncherWindows.cpp
@@ -17,6 +17,28 @@
 using namespace lldb;
 using namespace lldb_private;
 
+namespace
+{
+void
+CreateEnvironmentBuffer(const Args &env, std::vector &buffer)
+{
+if (env.GetArgumentCount() == 0)
+return;
+
+int bytes = 0;
+for (int i = 0; i < env.GetArgumentCount(); ++i)
+bytes += strlen(env.GetArgumentAtIndex(i)) + sizeof(char);
+bytes += sizeof(char);
+buffer.resize(bytes);
+char *cur_entry = &buffer[0];
+for (int i = 0; i < env.GetArgumentCount(); ++i)
+{
+::strcpy(cur_entry, env.GetArgumentAtIndex(i));
+cur_entry += strlen(cur_entry) + sizeof(char);
+}
+}
+}
+
 HostProcess
 ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo &launch_info, Error &error)
 {
@@ -49,10 +71,16 @@
 if (launch_info.GetFlags().Test(eLaunchFlagDebug))
 flags |= DEBUG_ONLY_THIS_PROCESS;
 
+auto &env = const_cast(launch_info.GetEnvironmentEntries());
+LPVOID env_block = nullptr;
+::CreateEnvironmentBuffer(env, environment);
+if (!environment.empty())
+env_block = environment.data();
+
 executable = launch_info.GetExecutableFile().GetPath();
 launch_info.GetArguments().GetQuotedCommandString(commandLine);
-BOOL result = ::CreateProcessA(executable.c_str(), const_cast(commandLine.c_str()), NULL, NULL, TRUE, flags, NULL,
-   launch_info.GetWorkingDirectory().GetCString(), &startupinfo, &pi);
+BOOL result = ::CreateProcessA(executable.c_str(), const_cast(commandLine.c_str()), NULL, NULL, TRUE, flags,
+   env_block, launch_info.GetWorkingDirectory().GetCString(), &startupinfo, &pi);
 if (result)
 {
 // Do not call CloseHandle on pi.hProcess, since we want to pass that back through the HostProcess.
Index: scripts/Python/python-typemaps.swig
===
--- scripts/Python/python-typemaps.swig
+++ scripts/Python/python-typemaps.swig
@@ -1,20 +1,22 @@
 /* Typemap definitions, to allow SWIG to properly handle 'char**' data types. */
 
 %typemap(in) char ** {
+  using namespace lldb_private;
   /* Check if is a list  */
-  if (PyList_Check($input)) {
-int size = PyList_Size($input);
+  if (PythonList::Check($input)) {
+PythonList list(PyRefType::Borrowed, $input);
+int size = list.GetSize();
 int i = 0;
-$1 = (char **) malloc((size+1) * sizeof(char*));
+$1 = (char**)malloc((size+1)*sizeof(char*));
 for (i = 0; i < size; i++) {
-  PyObject *o = PyList_GetItem($input,i);
-  if (PyString_Check(o))
-$1[i] = PyString_AsString(o);
-  else {
+  PythonString py_str = list.GetItemAtIndex(i).AsType();
+  if (!py_str.IsAllocated()) {
 PyErr_SetString(PyExc_TypeError,"list must contain strings");
 free($1);
-return NULL;
+return nullptr;
   }
+
+  $1[i] = const_cast(py_str.GetString().data());
 }
 $1[i] = 0;
   } else if ($input == Py_None) {
@@ -42,12 +44,14 @@
 %typemap(typecheck) char ** {
   /* Check if is a list  */
   $1 = 1;
-  if (PyList_Check($input)) {
-int size = PyList_Size($input);
+  using namespace lldb_private;
+  if (PythonList::Check($input)) {
+PythonList list(PyRefType::Borrowed, $input);
+int size = list.GetSize();
 int i = 0;
 for (i = 0; i < size; i++) {
-  PyObject *o = PyList_GetItem($input,i);
-  if (!PyString_Check(o)) { $1 = 0; }
+  PythonString s = list.GetItemAtIndex(i).AsType();
+  if (!s.IsAllocated()) { $1 = 0; }
 }
   }
   else
@@ -81,13 +85,12 @@
 
 $1 = (char**)malloc((size+1)*sizeof(char*));
 for (int i = 0; i < size; i++) {
-

Re: [Lldb-commits] [PATCH] D16128: Fix TestProcessLaunch.test_environment_with_special_char for Python 3

2016-01-12 Thread Adrian McCarthy via lldb-commits
amccarth accepted this revision.
amccarth added a comment.
This revision is now accepted and ready to land.

I don't know enough about SWIG to give that a thorough review.



Comment at: source/Host/windows/ProcessLauncherWindows.cpp:38
@@ +37,3 @@
+cur_entry += strlen(cur_entry) + sizeof(char);
+}
+}

I would explicitly set

*cur_entry = '\0';

after the loop to make it clear that this is a null-terminated block of 
null-terminated strings.

I get that buffer.resize(bytes) is going to zero out the bytes initially, _if_ 
it grows, so it's not technically necessary in the current use case.  But if a 
future caller calls it with a junk buffer that's already long enough (or 
longer), then you could end up with a non-zero in that last byte.


http://reviews.llvm.org/D16128



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


Re: [Lldb-commits] [PATCH] D16051: [LLDB][MIPS] Merge emulation of similar instructions for MIPS64

2016-01-12 Thread Bhushan Attarde via lldb-commits
bhushan closed this revision.
bhushan added a comment.

Closed by commit http://reviews.llvm.org/rL257442


Repository:
  rL LLVM

http://reviews.llvm.org/D16051



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


Re: [Lldb-commits] [PATCH] D16046: [LLDB][MIPS] Handle PIC calling convention for MIPS64

2016-01-12 Thread Bhushan Attarde via lldb-commits
bhushan closed this revision.
bhushan added a comment.

Closed by commit http://reviews.llvm.org/rL257441


Repository:
  rL LLVM

http://reviews.llvm.org/D16046



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


[Lldb-commits] [lldb] r257569 - Add a small refinement to the qSymbol:: support in lldb.

2016-01-12 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Jan 12 22:08:10 2016
New Revision: 257569

URL: http://llvm.org/viewvc/llvm-project?rev=257569&view=rev
Log:
Add a small refinement to the qSymbol:: support in lldb.
This is a packet which allows the remote gdb stub to ask for the address
of a symbol in the process.  lldb sends the packet (offering to provide
addresses for symbol names) after every solib loaded.  I changed lldb so
that once the stub has indicated that it doesn't need any more symbol
addresses, lldb will stop sending the qSymbol:: packet on new solib loads.

This can yield a performance benefit over slower communication links when
there are many solibs involved.

 


Modified:

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

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=257569&r1=257568&r2=257569&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
Tue Jan 12 22:08:10 2016
@@ -101,6 +101,7 @@ GDBRemoteCommunicationClient::GDBRemoteC
 m_supports_QEnvironment (true),
 m_supports_QEnvironmentHexEncoded (true),
 m_supports_qSymbol (true),
+m_qSymbol_requests_done (false),
 m_supports_qModuleInfo (true),
 m_supports_jThreadsInfo (true),
 m_curr_pid (LLDB_INVALID_PROCESS_ID),
@@ -377,6 +378,7 @@ GDBRemoteCommunicationClient::ResetDisco
 m_supports_QEnvironment = true;
 m_supports_QEnvironmentHexEncoded = true;
 m_supports_qSymbol = true;
+m_qSymbol_requests_done = false;
 m_supports_qModuleInfo = true;
 m_host_arch.Clear();
 m_os_version_major = UINT32_MAX;
@@ -4443,11 +4445,42 @@ GDBRemoteCommunicationClient::ReadExtFea
 //  qSymbol:  The target requests the value of symbol sym_name (hex 
encoded).
 //  LLDB may provide the value by sending another qSymbol 
packet
 //  in the form of"qSymbol::".
+//
+//  Three examples:
+//
+//  lldb sends:qSymbol::
+//  lldb receives: OK
+// Remote gdb stub does not need to know the addresses of any symbols, 
lldb does not
+// need to ask again in this session.
+//
+//  lldb sends:qSymbol::
+//  lldb receives: qSymbol:64697370617463685f71756575655f6f73657473
+//  lldb sends:qSymbol::64697370617463685f71756575655f6f73657473
+//  lldb receives: OK
+// Remote gdb stub asks for address of 'dispatch_queue_offsets'.  lldb 
does not know
+// the address at this time.  lldb needs to send qSymbol:: again when it 
has more
+// solibs loaded.
+//
+//  lldb sends:qSymbol::
+//  lldb receives: qSymbol:64697370617463685f71756575655f6f73657473
+//  lldb sends:
qSymbol:2bc97554:64697370617463685f71756575655f6f73657473
+//  lldb receives: OK
+// Remote gdb stub asks for address of 'dispatch_queue_offsets'.  lldb 
says that it
+// is at address 0x2bc97554.  Remote gdb stub sends 'OK' indicating that 
it does not
+// need any more symbols.  lldb does not need to ask again in this session.
 
 void
 GDBRemoteCommunicationClient::ServeSymbolLookups(lldb_private::Process 
*process)
 {
-if (m_supports_qSymbol)
+// Set to true once we've resolved a symbol to an address for the remote 
stub.
+// If we get an 'OK' response after this, the remote stub doesn't need any 
more
+// symbols and we can stop asking.
+bool symbol_response_provided = false;
+
+// Is this the inital qSymbol:: packet?
+bool first_qsymbol_query = true;
+
+if (m_supports_qSymbol && m_qSymbol_requests_done == false)
 {
 Mutex::Locker locker;
 if (GetSequenceMutex(locker, 
"GDBRemoteCommunicationClient::ServeSymbolLookups() failed due to not getting 
the sequence mutex"))
@@ -4459,9 +4492,15 @@ GDBRemoteCommunicationClient::ServeSymbo
 {
 if (response.IsOKResponse())
 {
+if (symbol_response_provided || first_qsymbol_query)
+{
+m_qSymbol_requests_done = true;
+}
+
 // We are done serving symbols requests
 return;
 }
+first_qsymbol_query = false;
 
 if (response.IsUnsupportedResponse())
 {
@@ -4541,7 +4580,14 @@ GDBRemoteCommunicationClient::ServeSymbo
 packet.Clear();
 packet.PutCString("qSymbol:");
 if (symbol_load_addr != LLDB_INVALID_ADDRESS)
+{

[Lldb-commits] [PATCH] D16132: [LLDB][MIPS] Fix TestExprsChar.py

2016-01-12 Thread Nitesh Jain via lldb-commits
nitesh.jain created this revision.
nitesh.jain added reviewers: clayborg, ovyalov.
nitesh.jain added subscribers: jaydeep, bhushan, sagar, mohit.bhakkad, 
lldb-commits.
nitesh.jain set the repository for this revision to rL LLVM.

When incorrect type used for 'char' then (at least) one of the expression 
evaluates to incorrect value. Please refer to bug llvm.org/pr23069

Repository:
  rL LLVM

http://reviews.llvm.org/D16132

Files:
  packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py

Index: packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
===
--- packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
+++ packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
@@ -65,5 +65,6 @@
 @expectedFailurei386("llvm.org/pr23069")
 @expectedFailurex86_64("llvm.org/pr23069")
 @expectedFailureWindows("llvm.org/pr21765")
+@expectedFailureAll(bugnumber="llvm.org/pr23069", triple = 'mips*')
 def test_unsigned_char(self):
 self.do_test(dictionary={'CFLAGS_EXTRAS': '-funsigned-char'})


Index: packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
===
--- packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
+++ packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
@@ -65,5 +65,6 @@
 @expectedFailurei386("llvm.org/pr23069")
 @expectedFailurex86_64("llvm.org/pr23069")
 @expectedFailureWindows("llvm.org/pr21765")
+@expectedFailureAll(bugnumber="llvm.org/pr23069", triple = 'mips*')
 def test_unsigned_char(self):
 self.do_test(dictionary={'CFLAGS_EXTRAS': '-funsigned-char'})
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits