Re: [Lldb-commits] [PATCH] D11745: [debugserver] Fix "control may reach end of non-void function" warnings.

2015-08-03 Thread Jason Molenda
jasonmolenda added a subscriber: jasonmolenda.
jasonmolenda accepted this revision.
jasonmolenda added a reviewer: jasonmolenda.
jasonmolenda added a comment.
This revision is now accepted and ready to land.

Hm, won't we get some compiler warning about how there aren't default: cases 
for these switch statements? :)  This change is fine if it helps eliminate 
unhelpful warnings.


http://reviews.llvm.org/D11745




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243846 - GDBRemoteCommunication::DecompressPacket assumed that the buffer it was

2015-08-01 Thread Jason Molenda
Author: jmolenda
Date: Sat Aug  1 20:36:09 2015
New Revision: 243846

URL: http://llvm.org/viewvc/llvm-project?rev=243846&view=rev
Log:
GDBRemoteCommunication::DecompressPacket assumed that the buffer it was
working with (the Communication m_bytes ivar) contained a single packet.
Instead, it may contain multitudes.  Find the boundaries of the first packet
in the buffer and replace that with the decompressed version leaving the
rest of the buffer unmodified.
 

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=243846&r1=243845&r2=243846&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Sat 
Aug  1 20:36:09 2015
@@ -574,15 +574,24 @@ GDBRemoteCommunication::DecompressPacket
 return true;
 if (m_bytes[1] != 'C' && m_bytes[1] != 'N')
 return true;
-if (m_bytes[pkt_size - 3] != '#')
+
+size_t hash_mark_idx = m_bytes.find ('#');
+if (hash_mark_idx == std::string::npos)
+return true;
+if (hash_mark_idx + 2 >= m_bytes.size())
 return true;
-if (!::isxdigit (m_bytes[pkt_size - 2]) || !::isxdigit (m_bytes[pkt_size - 
1]))
+
+if (!::isxdigit (m_bytes[hash_mark_idx + 1]) || !::isxdigit 
(m_bytes[hash_mark_idx + 2]))
 return true;
 
-size_t content_length = pkt_size - 5;   // not counting '$', 'C' | 'N', 
'#', & the two hex checksum chars
-size_t content_start = 2;   // The first character of the 
compressed/not-compressed text of the packet
-size_t hash_mark_idx = pkt_size - 3;// The '#' character marking the 
end of the packet
-size_t checksum_idx = pkt_size - 2; // The first character of the two 
hex checksum characters
+size_t content_length = pkt_size - 5;// not counting '$', 'C' | 'N', 
'#', & the two hex checksum chars
+size_t content_start = 2;// The first character of the 
compressed/not-compressed text of the packet
+size_t checksum_idx = hash_mark_idx + 1; // The first character of the two 
hex checksum characters
+
+// Normally size_of_first_packet == m_bytes.size() but m_bytes may contain 
multiple packets.
+// size_of_first_packet is the size of the initial packet which we'll 
replace with the decompressed
+// version of, leaving the rest of m_bytes unmodified.
+size_t size_of_first_packet = hash_mark_idx + 3; 
 
 // Compressed packets ("$C") start with a base10 number which is the size 
of the uncompressed payload,
 // then a : and then the compressed data.  e.g. $C1024:#00
@@ -604,7 +613,7 @@ GDBRemoteCommunication::DecompressPacket
 decompressed_bufsize = ::strtoul (bufsize_str.c_str(), NULL, 10);
 if (errno != 0 || decompressed_bufsize == ULONG_MAX)
 {
-m_bytes.erase (0, pkt_size);
+m_bytes.erase (0, size_of_first_packet);
 return false;
 }
 }
@@ -633,7 +642,7 @@ GDBRemoteCommunication::DecompressPacket
 if (!success)
 {
 SendNack();
-m_bytes.erase (0, pkt_size);
+m_bytes.erase (0, size_of_first_packet);
 return false;
 }
 else
@@ -677,7 +686,7 @@ GDBRemoteCommunication::DecompressPacket
 decompressed_buffer = (uint8_t *) malloc (decompressed_bufsize + 1);
 if (decompressed_buffer == nullptr)
 {
-m_bytes.erase (0, pkt_size);
+m_bytes.erase (0, size_of_first_packet);
 return false;
 }
 
@@ -751,7 +760,7 @@ GDBRemoteCommunication::DecompressPacket
 {
 if (decompressed_buffer)
 free (decompressed_buffer);
-m_bytes.erase (0, pkt_size);
+m_bytes.erase (0, size_of_first_packet);
 return false;
 }
 
@@ -773,7 +782,7 @@ GDBRemoteCommunication::DecompressPacket
 new_packet.push_back ('0');
 }
 
-m_bytes = new_packet;
+m_bytes.replace (0, size_of_first_packet, new_packet.data(), 
new_packet.size());
 
 free (decompressed_buffer);
 return true;


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11415: Add jstopinfo support to llgs

2015-07-31 Thread Jason Molenda
Yes, we talked about this approach a few times.  Greg went with the jstopinfo 
addition to the T packet to keep the changes relatively small, but we're all in 
agreement that we should create a new JSON formatted stop info packet and dump 
the T packet altogether.

That's one of those changes where we're taking a big step away from traditional 
gdb-remote protocol which is the only reason Greg hesitated to do it.  There's 
always the concern about lldb compatibility with traditional gdb-remote 
implementations -- we don't test that very thoroughly/frequently/consistently, 
and it can be easy to add assumptions that we have the lldb extensions to the 
protocol.

None of this is an argument against a JSON formatted thread reply packet.  Greg 
and I both think that this is the best approach - it was more work than he 
wanted to take on when he was implementing this addition to the T packet.

J

> On Jul 31, 2015, at 2:46 AM, Pavel Labath  wrote:
> 
> Thank you all for the replies, very interesting information there.
> Given that the register caching approach will not work everywhere, I
> agree we should stick to sending the PC on all platforms for
> consistency.
> 
> Regarding the size of the stop-reply packet, I have a question. Is
> there any reason we are tied to the current format of the stop-reply
> packet as a whole? Couldn't we just change it as a whole? For example,
> we could add a QThreadStopInJSON packet, which will switch the server
> to send the stop-replies in the current jThreadsInfo format (perhaps
> prefixed by a T or something, to make it more easily detectable). This
> would solve the problem of the size increase, and it would enable us
> to easily add more data to the packet in the future.
> 
> What do you think?
> 
> cheers,
> pl
> 
> 
> On 30 July 2015 at 19:10, Jason Molenda  wrote:
>> We were discussing the same thing last week - I think we all agree that 
>> approach #1 is the way to go.  My main concern here is that jstopinfo is 
>> ascii-hex encoded.  JSON is already pretty verbose (particularly with all 
>> the numbers being base 10, sigh) but then we double the size of the string.  
>> Originally when we listed the stop reasons for all the threads were were 
>> including a list of all threads and their stop reasons (even if it is 
>> 'none') and the payload was enormous.  I was playing with ideas like given 
>> that the T packet already gives us a list of thread ids outside the 
>> jstopinfo payload, maybe we could include an array of thread pc values but 
>> that was not a good idea even though it would be compact.  I think we'll 
>> need to include a dictionary of threadid:pc's in there.  We could have 
>> mitigated the expansion a little by adopting base64 encoding instead of 
>> asciihex (133% increase as opposed to 200% increase) but base64 isn't used 
>> anywhere else in the protocol so it wo!
 uld have been weird to adopt it in this one place.
>> 
>> J
>> 
>>> On Jul 30, 2015, at 5:09 AM, Pavel Labath  wrote:
>>> 
>>> Hello Greg, Jim,
>>> 
>>> after adding jstopinfo support to LLGS, i am still getting a bunch of
>>> register read packets which access the program counter. These are
>>> coming from Thread::SetupForResume(), where we need to check whether a
>>> thread is on a breakpoint before letting it run. I would like to get
>>> rid of those packets (my preliminary tests show I can gain about 10%
>>> stepping speed improvement on my test app with 20 threads). I see two
>>> ways to go about this:
>>> 1. send the program counters as a part of the jstopinfo field. I will
>>> need to change the format of the field a bit, because the current
>>> assumption is that you do not include the threads which don't have a
>>> stop reason there, but we need the registers for every thread.
>>> 2. cache the registers on the client side. These queries happen after
>>> we have previously done a vCont:s (as a part of ThreadPlanStepOver),
>>> so the client can determine that the other threads have not executed,
>>> and the registers are unchanged. We would still avoid caching the stop
>>> reason, since on OSX this can change even if the thread is not
>>> running, but I hope the registers remain the same.
>>> 
>>> All in all, the first approach is probably more easier to implement,
>>> but the second one sounds better to me architecturally, and has the
>>> benefit of caching all registers, and not just the PC.
>>> 
>>> Do you have any thoughts on this?
>>> 
>>> cheers,
>>> pl
>>&

[Lldb-commits] [lldb] r243736 - Move the computation of whether a DWARF compile unit

2015-07-30 Thread Jason Molenda
Author: jmolenda
Date: Fri Jul 31 00:47:00 2015
New Revision: 243736

URL: http://llvm.org/viewvc/llvm-project?rev=243736&view=rev
Log:
Move the computation of whether a DWARF compile unit
is optimized into DWARFCompileUnit, where it should have
been.  Next I'll need to call this from another section 
of code for DWARF-in-.o-file behavior correctness.


Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=243736&r1=243735&r2=243736&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Fri Jul 31 
00:47:00 2015
@@ -52,7 +52,8 @@ DWARFCompileUnit::DWARFCompileUnit(Symbo
 m_producer_version_minor (0),
 m_producer_version_update (0),
 m_language_type (eLanguageTypeUnknown),
-m_is_dwarf64(false)
+m_is_dwarf64(false),
+m_is_optimized  (eLazyBoolCalculate)
 {
 }
 
@@ -71,6 +72,7 @@ DWARFCompileUnit::Clear()
 m_producer  = eProducerInvalid;
 m_language_type = eLanguageTypeUnknown;
 m_is_dwarf64= false;
+m_is_optimized  = eLazyBoolCalculate;
 }
 
 bool
@@ -1108,3 +1110,27 @@ DWARFCompileUnit::IsDWARF64() const
 return m_is_dwarf64;
 }
 
+bool
+DWARFCompileUnit::GetIsOptimized ()
+{
+if (m_is_optimized == eLazyBoolCalculate)
+{
+const DWARFDebugInfoEntry *die = GetCompileUnitDIEOnly();
+if (die)
+{
+m_is_optimized = eLazyBoolNo;
+if (die->GetAttributeValueAsUnsigned (m_dwarf2Data, this, 
DW_AT_APPLE_optimized, 0) == 1)
+{
+m_is_optimized = eLazyBoolYes;
+}
+}
+}
+if (m_is_optimized == eLazyBoolYes)
+{
+return true;
+}
+else
+{
+return false;
+}
+}

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h?rev=243736&r1=243735&r2=243736&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h Fri Jul 31 
00:47:00 2015
@@ -196,6 +196,9 @@ public:
 bool
 IsDWARF64() const;
 
+bool
+GetIsOptimized ();
+
 protected:
 SymbolFileDWARF*m_dwarf2Data;
 const DWARFAbbreviationDeclarationSet *m_abbrevs;
@@ -213,6 +216,7 @@ protected:
 uint32_tm_producer_version_update;
 lldb::LanguageType  m_language_type;
 boolm_is_dwarf64;
+lldb_private::LazyBool m_is_optimized;
 
 void
 ParseProducerInfo ();

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=243736&r1=243735&r2=243736&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Jul 31 
00:47:00 2015
@@ -1100,11 +1100,7 @@ SymbolFileDWARF::ParseCompileUnit (DWARF
 
 LanguageType cu_language = 
DWARFCompileUnit::LanguageTypeFromDWARF(cu_die->GetAttributeValueAsUnsigned(this,
 dwarf_cu, DW_AT_language, 0));
 
-bool is_optimized = false;
-if (cu_die->GetAttributeValueAsUnsigned(this, 
dwarf_cu, DW_AT_APPLE_optimized, 0) == 1)
-{
-is_optimized = true;
-}
+bool is_optimized = dwarf_cu->GetIsOptimized ();
 cu_sp.reset(new CompileUnit (module_sp,
  dwarf_cu,
  cu_file_spec, 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243732 - Add another log to the Host channel for logging

2015-07-30 Thread Jason Molenda
Author: jmolenda
Date: Thu Jul 30 23:21:25 2015
New Revision: 243732

URL: http://llvm.org/viewvc/llvm-project?rev=243732&view=rev
Log:
Add another log to the Host channel for logging
the actions taken when trying to locate binaries.

Modified:
lldb/trunk/source/Commands/CommandObjectTarget.cpp

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=243732&r1=243731&r2=243732&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Thu Jul 30 23:21:25 2015
@@ -1161,6 +1161,12 @@ protected:
 
 if (from[0] && to[0])
 {
+Log *log = 
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+if (log)
+{
+log->Printf ("target modules search path adding 
ImageSearchPath pair: '%s' -> '%s'",
+ from, to);
+}
 bool last_pair = ((argc - i) == 2);
 target->GetImageSearchPathList().Append 
(ConstString(from),
  
ConstString(to),


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11668: Fix build of lldb on Mavericks after svn rev.243511

2015-07-30 Thread Jason Molenda
jasonmolenda accepted this revision.
jasonmolenda added a comment.
This revision is now accepted and ready to land.

Looks good.  I suspected this wouldn't link on older systems.


Repository:
  rL LLVM

http://reviews.llvm.org/D11668




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11415: Add jstopinfo support to llgs

2015-07-30 Thread Jason Molenda
We were discussing the same thing last week - I think we all agree that 
approach #1 is the way to go.  My main concern here is that jstopinfo is 
ascii-hex encoded.  JSON is already pretty verbose (particularly with all the 
numbers being base 10, sigh) but then we double the size of the string.  
Originally when we listed the stop reasons for all the threads were were 
including a list of all threads and their stop reasons (even if it is 'none') 
and the payload was enormous.  I was playing with ideas like given that the T 
packet already gives us a list of thread ids outside the jstopinfo payload, 
maybe we could include an array of thread pc values but that was not a good 
idea even though it would be compact.  I think we'll need to include a 
dictionary of threadid:pc's in there.  We could have mitigated the expansion a 
little by adopting base64 encoding instead of asciihex (133% increase as 
opposed to 200% increase) but base64 isn't used anywhere else in the protocol 
so it would!
  have been weird to adopt it in this one place.

J

> On Jul 30, 2015, at 5:09 AM, Pavel Labath  wrote:
> 
> Hello Greg, Jim,
> 
> after adding jstopinfo support to LLGS, i am still getting a bunch of
> register read packets which access the program counter. These are
> coming from Thread::SetupForResume(), where we need to check whether a
> thread is on a breakpoint before letting it run. I would like to get
> rid of those packets (my preliminary tests show I can gain about 10%
> stepping speed improvement on my test app with 20 threads). I see two
> ways to go about this:
> 1. send the program counters as a part of the jstopinfo field. I will
> need to change the format of the field a bit, because the current
> assumption is that you do not include the threads which don't have a
> stop reason there, but we need the registers for every thread.
> 2. cache the registers on the client side. These queries happen after
> we have previously done a vCont:s (as a part of ThreadPlanStepOver),
> so the client can determine that the other threads have not executed,
> and the registers are unchanged. We would still avoid caching the stop
> reason, since on OSX this can change even if the thread is not
> running, but I hope the registers remain the same.
> 
> All in all, the first approach is probably more easier to implement,
> but the second one sounds better to me architecturally, and has the
> benefit of caching all registers, and not just the PC.
> 
> Do you have any thoughts on this?
> 
> cheers,
> pl
> 
> 
> On 23 July 2015 at 10:10, Pavel Labath  wrote:
>> This revision was automatically updated to reflect the committed changes.
>> labath marked 2 inline comments as done.
>> Closed by commit rL242997: Add jstopinfo support to llgs (authored by 
>> labath).
>> 
>> Changed prior to commit:
>>  http://reviews.llvm.org/D11415?vs=30348&id=30464#toc
>> 
>> Repository:
>>  rL LLVM
>> 
>> http://reviews.llvm.org/D11415
>> 
>> Files:
>>  lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
>>  lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
>>  lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.h
>>  
>> lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
>> 
> ___
> lldb-commits mailing list
> lldb-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243511 - When debugserver fails to attach to a process on a Darwin

2015-07-28 Thread Jason Molenda
Author: jmolenda
Date: Tue Jul 28 20:42:16 2015
New Revision: 243511

URL: http://llvm.org/viewvc/llvm-project?rev=243511&view=rev
Log:
When debugserver fails to attach to a process on a Darwin
system, make a couple of additional checks to see if the
attach was denied via the System Integrity Protection that
is new in Mac OS X 10.11.  If so, return a special E87
error code to indicate this to lldb.

Up in lldb, if we receive the E87 error code, be specific
about why the attach failed.

Also detect the more common case of general attach failure
and print a better error message than "lost connection".

I believe this code will all build on Mac OS X 10.10 systems.
It may not compile or run on earlier versions of the OS.
None of this should build on other non-darwin systems.

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/tools/debugserver/source/DNB.cpp
lldb/trunk/tools/debugserver/source/DNB.h
lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=243511&r1=243510&r2=243511&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Jul 
28 20:42:16 2015
@@ -3804,8 +3804,28 @@ ProcessGDBRemote::AsyncThread (void *arg
 break;
 }
 case eStateInvalid:
-process->SetExitStatus(-1, "lost 
connection");
-break;
+{
+// Check to see if we were trying 
to attach and if we got back
+// the "E87" error code from 
debugserver -- this indicates that
+// the process is not debuggable.  
Return a slightly more helpful
+// error message about why the 
attach failed.
+if (::strstr (continue_cstr, 
"vAttach") != NULL
+&& response.GetError() == 0x87)
+{
+process->SetExitStatus(-1, 
"cannot attach to process due to System Integrity Protection");
+}
+// E01 code from vAttach means 
that the attach failed
+if (::strstr (continue_cstr, 
"vAttach") != NULL
+&& response.GetError() == 0x1)
+{
+process->SetExitStatus(-1, 
"unable to attach");
+}
+else
+{
+process->SetExitStatus(-1, 
"lost connection");
+}
+break;
+}
 
 default:
 process->SetPrivateState 
(stop_state);

Modified: lldb/trunk/tools/debugserver/source/DNB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNB.cpp?rev=243511&r1=243510&r2=243511&view=diff
==
--- lldb/trunk/tools/debugserver/source/DNB.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNB.cpp Tue Jul 28 20:42:16 2015
@@ -455,6 +455,19 @@ DNBProcessLaunch (const char *path,
 return INVALID_NUB_PROCESS;
 }
 
+// If there is one process with a given name, return the pid for that process.
+nub_process_t
+DNBProcessGetPIDByName (const char *name)
+{
+std::vector matching_proc_infos;
+size_t num_matching_proc_infos = GetAllInfosMatchingName(name, 
matching_proc_infos);
+if (num_matching_proc_infos == 1)
+{
+return matching_proc_infos[0].kp_proc.p_pid;
+}
+return INVALID_NUB_PROCESS;
+}
+
 nub_process_t
 DNBProcessAttachByName (const char *name, struct timespec *timeout, char 
*err_str, size_t err_len)
 {

Modified: lldb/trunk/tools/debugserver/source/DNB.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNB.h?rev=243511&r1=243510&r2=243511&view=diff
==
--- lldb/trunk/tools/debugserver/source/DNB

Re: [Lldb-commits] [PATCH] D11561: Correct man page markup

2015-07-28 Thread Jason Molenda
jasonmolenda accepted this revision.
jasonmolenda added a comment.
This revision is now accepted and ready to land.

It's been a long time since I touched roff markup but this looks reasonable to 
me.


http://reviews.llvm.org/D11561




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243200 - Add some initial logging for when lldb is searching for binaries,

2015-07-24 Thread Jason Molenda
Author: jmolenda
Date: Fri Jul 24 21:39:42 2015
New Revision: 243200

URL: http://llvm.org/viewvc/llvm-project?rev=243200&view=rev
Log:
Add some initial logging for when lldb is searching for binaries,
dSYMs, or reading binaries out of memory to the 'Host' log channel.
There's more to be done here, both for Mac and for other platforms,
but the initial set of new loggings are useful enough to check in
at this point.

Modified:
lldb/trunk/source/Host/common/Symbols.cpp
lldb/trunk/source/Host/macosx/Symbols.cpp

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=243200&r1=243199&r2=243200&view=diff
==
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Fri Jul 24 21:39:42 2015
@@ -11,6 +11,7 @@
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/DataBuffer.h"
 #include "lldb/Core/DataExtractor.h"
+#include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/StreamString.h"
@@ -79,6 +80,7 @@ FileAtPathContainsArchAndUUID (const Fil
 static bool
 LocateDSYMInVincinityOfExecutable (const ModuleSpec &module_spec, FileSpec 
&dsym_fspec)
 {
+Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
 const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
 if (exec_fspec)
 {
@@ -88,6 +90,17 @@ LocateDSYMInVincinityOfExecutable (const
 // Make sure the module isn't already just a dSYM file...
 if (strcasestr(path, ".dSYM/Contents/Resources/DWARF") == NULL)
 {
+if (log)
+{
+if (module_spec.GetUUIDPtr() && 
module_spec.GetUUIDPtr()->IsValid())
+{
+log->Printf ("Searching for dSYM bundle next to 
executable %s, UUID %s", path, module_spec.GetUUIDPtr()->GetAsString().c_str());
+}
+else
+{
+log->Printf ("Searching for dSYM bundle next to 
executable %s", path);
+}
+}
 size_t obj_file_path_length = strlen(path);
 ::strncat(path, ".dSYM/Contents/Resources/DWARF/", 
sizeof(path) - strlen(path) - 1);
 ::strncat(path, exec_fspec->GetFilename().AsCString(), 
sizeof(path) - strlen(path) - 1);
@@ -99,6 +112,10 @@ LocateDSYMInVincinityOfExecutable (const
 if (dsym_fspec.Exists() &&
 FileAtPathContainsArchAndUUID(dsym_fspec, 
module_spec.GetArchitecturePtr(), module_spec.GetUUIDPtr()))
 {
+if (log)
+{
+log->Printf ("dSYM with matching UUID & arch found at 
%s", path);
+}
 return true;
 }
 else
@@ -118,6 +135,10 @@ LocateDSYMInVincinityOfExecutable (const
 if (dsym_fspec.Exists() &&
 FileAtPathContainsArchAndUUID(dsym_fspec, 
module_spec.GetArchitecturePtr(), module_spec.GetUUIDPtr()))
 {
+if (log)
+{
+log->Printf ("dSYM with matching UUID & 
arch found at %s", path);
+}
 return true;
 }
 else

Modified: lldb/trunk/source/Host/macosx/Symbols.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Symbols.cpp?rev=243200&r1=243199&r2=243200&view=diff
==
--- lldb/trunk/source/Host/macosx/Symbols.cpp (original)
+++ lldb/trunk/source/Host/macosx/Symbols.cpp Fri Jul 24 21:39:42 2015
@@ -22,6 +22,7 @@
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/DataBuffer.h"
 #include "lldb/Core/DataExtractor.h"
+#include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/StreamString.h"
@@ -99,6 +100,7 @@ LocateMacOSXFilesUsingDebugSymbols
 {
 CFCReleaser exec_url;
 const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
+Log *log = 
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
 if (exec_fspec)
 {
 char exec_cf_path[PATH_MAX];
@@ -108,6 +110,23 @@ LocateMacOSXFilesUsingDebugSymbols

   strlen(exec_cf_path),
 

Re: [Lldb-commits] [PATCH] D11497: Change Socket::Read / Socket::Write to log to LOG_COMMUNICATION instead of LOG_HOST

2015-07-24 Thread Jason Molenda
jasonmolenda closed this revision.
jasonmolenda added a comment.

Sendingsource/Host/common/Socket.cpp
Transmitting file data .
Committed revision 243175.


Repository:
  rL LLVM

http://reviews.llvm.org/D11497




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r243175 - Log socket communications to LIBLLDB_LOG_COMMUNICATION instead of

2015-07-24 Thread Jason Molenda
Author: jmolenda
Date: Fri Jul 24 17:42:03 2015
New Revision: 243175

URL: http://llvm.org/viewvc/llvm-project?rev=243175&view=rev
Log:
Log socket communications to LIBLLDB_LOG_COMMUNICATION instead of
the Host channel.

http://reviews.llvm.org/D11497

Modified:
lldb/trunk/source/Host/common/Socket.cpp

Modified: lldb/trunk/source/Host/common/Socket.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Socket.cpp?rev=243175&r1=243174&r2=243175&view=diff
==
--- lldb/trunk/source/Host/common/Socket.cpp (original)
+++ lldb/trunk/source/Host/common/Socket.cpp Fri Jul 24 17:42:03 2015
@@ -139,7 +139,7 @@ Error Socket::TcpConnect(llvm::StringRef
 NativeSocket sock = kInvalidSocketValue;
 Error error;
 
-Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_HOST));
+Log *log(lldb_private::GetLogIfAnyCategoriesSet 
(LIBLLDB_LOG_COMMUNICATION));
 if (log)
 log->Printf ("Socket::TcpConnect (host/port = %s)", 
host_and_port.data());
 
@@ -632,7 +632,7 @@ Error Socket::Read (void *buf, size_t &n
 else
 num_bytes = bytes_received;
 
-Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_HOST | 
LIBLLDB_LOG_COMMUNICATION)); 
+Log *log(lldb_private::GetLogIfAnyCategoriesSet 
(LIBLLDB_LOG_COMMUNICATION)); 
 if (log)
 {
 log->Printf ("%p Socket::Read() (socket = %" PRIu64 ", src = %p, 
src_len = %" PRIu64 ", flags = 0) => %" PRIi64 " (error = %s)",
@@ -674,7 +674,7 @@ Error Socket::Write (const void *buf, si
 else
 num_bytes = bytes_sent;
 
-Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_HOST));
+Log *log(lldb_private::GetLogIfAnyCategoriesSet 
(LIBLLDB_LOG_COMMUNICATION));
 if (log)
 {
 log->Printf ("%p Socket::Write() (socket = %" PRIu64 ", src = %p, 
src_len = %" PRIu64 ", flags = 0) => %" PRIi64 " (error = %s)",


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D11497: Change Socket::Read / Socket::Write to log to LOG_COMMUNICATION instead of LOG_HOST

2015-07-24 Thread Jason Molenda
jasonmolenda created this revision.
jasonmolenda added a reviewer: zturner.
jasonmolenda added a subscriber: lldb-commits.
jasonmolenda set the repository for this revision to rL LLVM.

I'm adding some new host logging to help diagnose problems of finding 
executable files or dSYMs, Greg suggested we should add it to the Host log 
channel.  Currently Socket::Read and Socket::Write are logging to Host which is 
super verbose.  He suggests that we should switch these over the Communication 
log channel instead.  Some of Socket.cpp is logging to LOG_CONNECTION already.  
Zachary, any opinion on this?  I think you touched this most recently.  Not 
sure if you're using this logging yourself.

Repository:
  rL LLVM

http://reviews.llvm.org/D11497

Files:
  source/Host/common/Socket.cpp

Index: source/Host/common/Socket.cpp
===
--- source/Host/common/Socket.cpp
+++ source/Host/common/Socket.cpp
@@ -139,7 +139,7 @@
 NativeSocket sock = kInvalidSocketValue;
 Error error;
 
-Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_HOST));
+Log *log(lldb_private::GetLogIfAnyCategoriesSet 
(LIBLLDB_LOG_COMMUNICATION));
 if (log)
 log->Printf ("Socket::TcpConnect (host/port = %s)", 
host_and_port.data());
 
@@ -632,7 +632,7 @@
 else
 num_bytes = bytes_received;
 
-Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_HOST | 
LIBLLDB_LOG_COMMUNICATION)); 
+Log *log(lldb_private::GetLogIfAnyCategoriesSet 
(LIBLLDB_LOG_COMMUNICATION)); 
 if (log)
 {
 log->Printf ("%p Socket::Read() (socket = %" PRIu64 ", src = %p, 
src_len = %" PRIu64 ", flags = 0) => %" PRIi64 " (error = %s)",
@@ -674,7 +674,7 @@
 else
 num_bytes = bytes_sent;
 
-Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_HOST));
+Log *log(lldb_private::GetLogIfAnyCategoriesSet 
(LIBLLDB_LOG_COMMUNICATION));
 if (log)
 {
 log->Printf ("%p Socket::Write() (socket = %" PRIu64 ", src = %p, 
src_len = %" PRIu64 ", flags = 0) => %" PRIi64 " (error = %s)",


Index: source/Host/common/Socket.cpp
===
--- source/Host/common/Socket.cpp
+++ source/Host/common/Socket.cpp
@@ -139,7 +139,7 @@
 NativeSocket sock = kInvalidSocketValue;
 Error error;
 
-Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_HOST));
+Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_COMMUNICATION));
 if (log)
 log->Printf ("Socket::TcpConnect (host/port = %s)", host_and_port.data());
 
@@ -632,7 +632,7 @@
 else
 num_bytes = bytes_received;
 
-Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_HOST | LIBLLDB_LOG_COMMUNICATION)); 
+Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_COMMUNICATION)); 
 if (log)
 {
 log->Printf ("%p Socket::Read() (socket = %" PRIu64 ", src = %p, src_len = %" PRIu64 ", flags = 0) => %" PRIi64 " (error = %s)",
@@ -674,7 +674,7 @@
 else
 num_bytes = bytes_sent;
 
-Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_HOST));
+Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_COMMUNICATION));
 if (log)
 {
 log->Printf ("%p Socket::Write() (socket = %" PRIu64 ", src = %p, src_len = %" PRIu64 ", flags = 0) => %" PRIi64 " (error = %s)",
___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r242968 - Fix the variable used to reply to the qGDBServerVersion

2015-07-22 Thread Jason Molenda
Author: jmolenda
Date: Wed Jul 22 18:42:54 2015
New Revision: 242968

URL: http://llvm.org/viewvc/llvm-project?rev=242968&view=rev
Log:
Fix the variable used to reply to the qGDBServerVersion
packet so that debugserver will send a reply like

name:debugserver;version:340.99;

 

Modified:
lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=242968&r1=242967&r2=242968&view=diff
==
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Wed Jul 22 18:42:54 2015
@@ -4941,7 +4941,7 @@ RNBRemote::HandlePacket_qGDBServerVersio
 #else
 strm << "name:debugserver;";
 #endif
-strm << "version:" << DEBUGSERVER_VERSION_STR << ";";
+strm << "version:" << DEBUGSERVER_VERSION_NUM << ";";
 
 return SendPacket (strm.str());
 }


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11295: [asan] Display ASan history threads in reverse chronological order

2015-07-21 Thread Jason Molenda
jasonmolenda accepted this revision.
jasonmolenda added a comment.
This revision is now accepted and ready to land.

Makes sense to me, please apply.


http://reviews.llvm.org/D11295




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11258: Improve conditional opcode handling in emulation based unwinding

2015-07-16 Thread Jason Molenda
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/D11258




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r242380 - Only include the stack memory for the caller stack

2015-07-15 Thread Jason Molenda
Author: jmolenda
Date: Wed Jul 15 22:42:40 2015
New Revision: 242380

URL: http://llvm.org/viewvc/llvm-project?rev=242380&view=rev
Log:
Only include the stack memory for the caller stack
frame, don't go any further, in RNBRemote::SendStopReplyPacketForThread.

These are the memory pre-fetches in the T05 packet and are
included in every private stop that lldb does.  lldb needs, at most,
the caller stack frame so we're sending more data than needed by
including additional stack memory prefetches in this reply packet.

Once we've stopped for a public stop, we're going to do a jThreadsInfo
which will include the stack memory prefetches for all threads, 
including the one which had the stop reason.

Modified:
lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=242380&r1=242379&r2=242380&view=diff
==
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Wed Jul 15 22:42:40 2015
@@ -2573,7 +2573,7 @@ typedef std::map 256)
+if (++frame_count > backtrace_limit)
 break;
 
 const nub_size_t read_size = reg_value.info.size*2;
@@ -2791,7 +2791,7 @@ RNBRemote::SendStopReplyPacketForThread
 // Add expedited stack memory so stack backtracing doesn't need to 
read anything from the
 // frame pointer chain.
 StackMemoryMap stack_mmap;
-ReadStackMemory (pid, tid, stack_mmap);
+ReadStackMemory (pid, tid, stack_mmap, 1);
 if (!stack_mmap.empty())
 {
 for (const auto &stack_memory : stack_mmap)


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r242379 - Build ValueObjectConstResultCast.cpp.

2015-07-15 Thread Jason Molenda
Author: jmolenda
Date: Wed Jul 15 22:38:17 2015
New Revision: 242379

URL: http://llvm.org/viewvc/llvm-project?rev=242379&view=rev
Log:
Build ValueObjectConstResultCast.cpp.

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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=242379&r1=242378&r2=242379&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Jul 15 22:38:17 2015
@@ -808,6 +808,7 @@
AF0F6E501739A76D009180FE /* RegisterContextKDP_arm64.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF0F6E4E1739A76D009180FE /* 
RegisterContextKDP_arm64.cpp */; };
AF1729D6182C907200E0AB97 /* HistoryThread.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF1729D4182C907200E0AB97 /* HistoryThread.cpp 
*/; };
AF1729D7182C907200E0AB97 /* HistoryUnwind.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF1729D5182C907200E0AB97 /* HistoryUnwind.cpp 
*/; };
+   AF1D88691B575E8D003CB899 /* ValueObjectConstResultCast.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF94726E1B575E430063D65C /* 
ValueObjectConstResultCast.cpp */; };
AF1F7B07189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF1F7B05189C904B0087DB9C /* 
AppleGetPendingItemsHandler.cpp */; };
AF1FA88A1A60A69500272AFC /* RegisterNumber.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF1FA8891A60A69500272AFC /* RegisterNumber.cpp 
*/; };
AF20F7661AF18F8500751A6E /* ABISysV_arm.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF20F7641AF18F8500751A6E /* ABISysV_arm.cpp */; 
};
@@ -2642,6 +2643,8 @@
AF9107EC168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp */ 
= {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = RegisterContextDarwin_arm64.cpp; path = 
Utility/RegisterContextDarwin_arm64.cpp; sourceTree = ""; };
AF9107ED168570D200DBCD3C /* RegisterContextDarwin_arm64.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
name = RegisterContextDarwin_arm64.h; path = 
Utility/RegisterContextDarwin_arm64.h; sourceTree = ""; };
AF94005711C03F6500085DB9 /* SymbolVendor.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = SymbolVendor.cpp; path = source/Symbol/SymbolVendor.cpp; sourceTree = 
""; };
+   AF94726E1B575E430063D65C /* ValueObjectConstResultCast.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = ValueObjectConstResultCast.cpp; path = 
source/Core/ValueObjectConstResultCast.cpp; sourceTree = ""; };
+   AF9472701B575E5F0063D65C /* ValueObjectConstResultCast.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
ValueObjectConstResultCast.h; path = 
include/lldb/Core/ValueObjectConstResultCast.h; sourceTree = ""; };
AF9B8F31182DB52900DA866F /* SystemRuntimeMacOSX.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = SystemRuntimeMacOSX.cpp; sourceTree = ""; };
AF9B8F32182DB52900DA866F /* SystemRuntimeMacOSX.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SystemRuntimeMacOSX.h; sourceTree = ""; };
AFB3D27E1AC262AB003B4B30 /* MICmdCmdGdbShow.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = MICmdCmdGdbShow.cpp; path = "tools/lldb-mi/MICmdCmdGdbShow.cpp"; 
sourceTree = SOURCE_ROOT; };
@@ -4101,6 +4104,8 @@
26BC7E9B10F1B85900F91463 /* 
ValueObjectChild.cpp */,
26424E3E125986D30016D82C /* 
ValueObjectConstResult.h */,
26424E3C125986CB0016D82C /* 
ValueObjectConstResult.cpp */,
+   AF9472701B575E5F0063D65C /* 
ValueObjectConstResultCast.h */,
+   AF94726E1B575E430063D65C /* 
ValueObjectConstResultCast.cpp */,
94FA3DDD1405D4E500833217 /* 
ValueObjectConstResultChild.h */,
94FA3DDF1405D50300833217 /* 
ValueObjectConstResultChild.cpp */,
949ADF001406F62E004833E1 /* 
ValueObjectConstResultImpl.h */,
@@ -6341,6 +6346,7 @@
AFDFDFD119E34D3400EAE509 /* 
ConnectionFileDescriptorPosix.cpp in Sources */,
9A22A163135E30370024DDC3 /* 
EmulationStateARM.cpp in Sources */,
9A4F35101368A51A00823F52 /* 
StreamAsynchronousIO.cpp in Sources */,
+   AF1D88691B575E8D

[Lldb-commits] [lldb] r242256 - Correct length of packet that GDBRemoteCommunicationClient::Detach

2015-07-14 Thread Jason Molenda
Author: jmolenda
Date: Tue Jul 14 19:16:09 2015
New Revision: 242256

URL: http://llvm.org/viewvc/llvm-project?rev=242256&view=rev
Log:
Correct length of packet that GDBRemoteCommunicationClient::Detach 
should send when detaching and leaving the remote process/system
halted.  Previously only the 'D' initial char was sent, which
resumed the process like a normal detach.

Modified:

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

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=242256&r1=242255&r2=242256&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
Tue Jul 14 19:16:09 2015
@@ -2311,7 +2311,7 @@ GDBRemoteCommunicationClient::Detach (bo
 else
 {
 StringExtractorGDBRemote response;
-PacketResult packet_result = SendPacketAndWaitForResponse ("D1", 
1, response, false);
+PacketResult packet_result = SendPacketAndWaitForResponse ("D1", 
2, response, false);
 if (packet_result != PacketResult::Success)
 error.SetErrorString ("Sending extended disconnect packet 
failed.");
 }


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11187: Add jThreadsInfo support to lldb-server

2015-07-14 Thread Jason Molenda
jasonmolenda added inline comments.


Comment at: docs/lldb-gdb-remote.txt:1555-1575
@@ +1554,23 @@
+"registers": {
+  "0":"8000",
+  "1":"",
+  "2":"20fabf5fff7f",
+  "3":"e8f8bf5fff7f",
+  "4":"0100",
+  "5":"d8f8bf5fff7f",
+  "6":"b0f8bf5fff7f",
+  "7":"20f4bf5fff7f",
+  "8":"8000",
+  "9":"61a8db78a61500db",
+  "10":"3200",
+  "11":"4602",
+  "12":"",
+  "13":"",
+  "14":"",
+  "15":"",
+  "16":"960b0100",
+  "17":"0202",
+  "18":"2b00",
+  "19":"",
+  "20":""
+},

jasonmolenda wrote:
> tberghammer wrote:
> > I would prefer to use hex numbers to be consistent with the stop reply 
> > packet but that change is out of scope for this change. The missing support 
> > for hex isn't an issue here because of the quotes.
> I agree with Tamas, the number-base assumptions in gdb-remote numbers are a 
> nightmare; at this point even decimal can be misconstrued as hex.  I'd rather 
> we just make it explicitly hex -- so instead of "14":, "0xe":.
> 
> I'm not a huge fan of sending back the registers as a series of bytes in 
> target-native-endian order like this,
> 
> +  "5":"d8f8bf5fff7f",
> 
> I'd push for sending this back as a native JSON number object, so  
> "0x5":140734799804632 but this would cause problems if we try to transfer a 
> 16-byte (or larger) vector register value - lldb's JSON parser is only 
> designed to handle 64-bit integer values, as are most others I would expect - 
> so maybe we have to live with this.  I'd argue for transposing to big-endian 
> order but when we send the expedited memory contents we need to send those in 
> target native endian order.
> 
> tl;dr: At least let's make the register numbers base 16 and prefixed with 
> "0x".
Thinking about the value part of the register set, we can allow for both types 
of returns.  e.g. both of these could be allowed:

"0xe":"d8f8bf5fff7f"
"0xe":140734799804632

If the value is a string, it is a series of hex bytes in target-native-endian 
order.  If the value is an integer, it is an integer.

Once these are in a StructuredData object, lldb can detect whether the value is 
a string or integer and decode as appropriate.

debugserver could return integers for 64-bits-and-less register values, strings 
of raw bytes for vector regs.


http://reviews.llvm.org/D11187




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r242184 - Add comment explaning sanity check on packet size in the packet decompression method.

2015-07-14 Thread Jason Molenda
Author: jmolenda
Date: Tue Jul 14 14:19:07 2015
New Revision: 242184

URL: http://llvm.org/viewvc/llvm-project?rev=242184&view=rev
Log:
Add comment explaning sanity check on packet size in the packet decompression 
method.

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=242184&r1=242183&r2=242184&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Tue 
Jul 14 14:19:07 2015
@@ -564,8 +564,12 @@ GDBRemoteCommunication::DecompressPacket
 return true;
 
 size_t pkt_size = m_bytes.size();
+
+// Smallest possible compressed packet is $N#00 - an uncompressed empty 
reply, most commonly indicating
+// an unsupported packet.  Anything less than 5 characters, it's 
definitely not a compressed packet.
 if (pkt_size < 5)
 return true;
+
 if (m_bytes[0] != '$' && m_bytes[0] != '%')
 return true;
 if (m_bytes[1] != 'C' && m_bytes[1] != 'N')


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11187: Add jThreadsInfo support to lldb-server

2015-07-14 Thread Jason Molenda
jasonmolenda added a subscriber: jasonmolenda.


Comment at: docs/lldb-gdb-remote.txt:1555-1575
@@ +1554,23 @@
+"registers": {
+  "0":"8000",
+  "1":"",
+  "2":"20fabf5fff7f",
+  "3":"e8f8bf5fff7f",
+  "4":"0100",
+  "5":"d8f8bf5fff7f",
+  "6":"b0f8bf5fff7f",
+  "7":"20f4bf5fff7f",
+  "8":"8000",
+  "9":"61a8db78a61500db",
+  "10":"3200",
+  "11":"4602",
+  "12":"",
+  "13":"",
+  "14":"",
+  "15":"",
+  "16":"960b0100",
+  "17":"0202",
+  "18":"2b00",
+  "19":"",
+  "20":""
+},

tberghammer wrote:
> I would prefer to use hex numbers to be consistent with the stop reply packet 
> but that change is out of scope for this change. The missing support for hex 
> isn't an issue here because of the quotes.
I agree with Tamas, the number-base assumptions in gdb-remote numbers are a 
nightmare; at this point even decimal can be misconstrued as hex.  I'd rather 
we just make it explicitly hex -- so instead of "14":, "0xe":.

I'm not a huge fan of sending back the registers as a series of bytes in 
target-native-endian order like this,

+  "5":"d8f8bf5fff7f",

I'd push for sending this back as a native JSON number object, so  
"0x5":140734799804632 but this would cause problems if we try to transfer a 
16-byte (or larger) vector register value - lldb's JSON parser is only designed 
to handle 64-bit integer values, as are most others I would expect - so maybe 
we have to live with this.  I'd argue for transposing to big-endian order but 
when we send the expedited memory contents we need to send those in target 
native endian order.

tl;dr: At least let's make the register numbers base 16 and prefixed with "0x".


http://reviews.llvm.org/D11187




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r242119 - Fix off-by-one error in the packet decompression routine

2015-07-13 Thread Jason Molenda
Author: jmolenda
Date: Mon Jul 13 23:51:05 2015
New Revision: 242119

URL: http://llvm.org/viewvc/llvm-project?rev=242119&view=rev
Log:
Fix off-by-one error in the packet decompression routine
that would not pass through empty ("unsupported packet") replies
correctly.

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=242119&r1=242118&r2=242119&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Mon 
Jul 13 23:51:05 2015
@@ -564,7 +564,7 @@ GDBRemoteCommunication::DecompressPacket
 return true;
 
 size_t pkt_size = m_bytes.size();
-if (pkt_size < 6)
+if (pkt_size < 5)
 return true;
 if (m_bytes[0] != '$' && m_bytes[0] != '%')
 return true;


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r241964 - Add a another packet to the gdb-remote protocol,

2015-07-10 Thread Jason Molenda
Author: jmolenda
Date: Fri Jul 10 18:15:22 2015
New Revision: 241964

URL: http://llvm.org/viewvc/llvm-project?rev=241964&view=rev
Log:
Add a another packet to the gdb-remote protocol,
jGetLoadedDynamicLibrariesInfos.  This packet is similar to
qXfer:libraries:read except that lldb supplies the number of solibs
that should be reported about, and the start address for the list
of them.  At the initial process launch we'll read the full list
of solibs linked by the process -- at this point we could be using
qXfer:libraries:read -- but on subsequence solib-loaded notifications,
we'll be fetching a smaller number of solibs, often only one or two.

A typical Mac/iOS GUI app may have a couple hundred different 
solibs loaded  - doing all of the loads via memory reads takes 
a couple of megabytes of traffic between lldb and debugserver.
Having debugserver summarize the load addresses of all the solibs
and sending it in JSON requires a couple of hundred kilobytes
of traffic.  It's a significant performance improvement when 
communicating over a slower channel.

This patch leaves all of the logic for loading the libraries
in DynamicLoaderMacOSXDYLD -- it only call over ot ProcesGDBRemote
to get the JSON result.

If the jGetLoadedDynamicLibrariesInfos packet is not implemented,
the normal technique of using memory read packets to get all of
the details from the target will be used.



Modified:
lldb/trunk/docs/lldb-gdb-remote.txt
lldb/trunk/include/lldb/Target/Process.h

lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp

lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/trunk/tools/debugserver/source/DNB.cpp
lldb/trunk/tools/debugserver/source/DNB.h
lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.h
lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
lldb/trunk/tools/debugserver/source/RNBRemote.cpp
lldb/trunk/tools/debugserver/source/RNBRemote.h

Modified: lldb/trunk/docs/lldb-gdb-remote.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/lldb-gdb-remote.txt?rev=241964&r1=241963&r2=241964&view=diff
==
--- lldb/trunk/docs/lldb-gdb-remote.txt (original)
+++ lldb/trunk/docs/lldb-gdb-remote.txt Fri Jul 10 18:15:22 2015
@@ -1447,3 +1447,86 @@ for this region.
 //   libcompression implements "LZMA level 6", the default compression for 
the
 //   open source LZMA implementation.
 //--
+
+//--
+// "jGetLoadedDynamicLibrariesInfos"
+//
+// BRIEF
+//  This packet asks the remote debug stub to send the details about libraries
+//  being added/removed from the process as a performance optimization.
+//
+//  LLDB SENDS: 
jGetLoadedDynamicLibrariesInfos:{"image_count":1,"image_list_address":140734800075128}
+//  STUB REPLIES: 
${"images":[{"load_address":4294967296,"mod_date":0,"pathname":"/tmp/a.out","uuid":"02CF262C-ED6F-3965-9E14-63538B465CFF","mach_header":{"magic":4277009103,"cputype":16777223,"cpusubtype":18446744071562067971,"filetype":2},"segments":{"name":"__PAGEZERO","vmaddr":0,"vmsize":4294967296,"fileoff":0,"filesize":0,"maxprot":0},{"name":"__TEXT","vmaddr":4294967296,"vmsize":4096,"fileoff":0,"filesize":4096,"maxprot":7},{"name":"__LINKEDIT","vmaddr":4294971392,"vmsize":4096,"fileoff":4096,"filesize":152,"maxprot":7}}]}#00
+//
+//  Or pretty-printed,
+//
+//  STUB REPLIES: ${"images":
+//  [
+//  {"load_address":4294967296,
+//   "mod_date":0,
+//   "pathname":"/tmp/a.out",
+//   "uuid":"02CF262C-ED6F-3965-9E14-63538B465CFF",
+//   "mach_header":
+//  {"magic":4277009103,
+//   "cputype":16777223,
+//   "cpusubtype":18446744071562067971,
+//   "filetype":2
+//   },
+//   "segments":
+//[
+//  {"name":"__PAGEZERO",
+//   "vmaddr":0,
+//   "vmsize":4294967296,
+//   "fileoff":0,
+//   "filesize":0,
+//   "maxprot":0
+//  },
+//  {"name":"__TEXT",
+//   "vmaddr":4294967296,
+//   "vmsize":4096,
+//   "fileoff":0,
+//   "filesiz

[Lldb-commits] [lldb] r241553 - When debugserver is running on an iOS device, call

2015-07-06 Thread Jason Molenda
Author: jmolenda
Date: Mon Jul  6 23:15:43 2015
New Revision: 241553

URL: http://llvm.org/viewvc/llvm-project?rev=241553&view=rev
Log:
When debugserver is running on an iOS device, call
proc_set_wakemon_params() to raise the limit on the # of wakeups
per second that are acceptable before the system may send an 
EXC_RESOURCE signal to debugserver.  

 

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

Modified: lldb/trunk/tools/debugserver/source/debugserver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/debugserver.cpp?rev=241553&r1=241552&r2=241553&view=diff
==
--- lldb/trunk/tools/debugserver/source/debugserver.cpp (original)
+++ lldb/trunk/tools/debugserver/source/debugserver.cpp Mon Jul  6 23:15:43 2015
@@ -27,6 +27,7 @@
 
 #if defined (__APPLE__)
 #include 
+extern "C" int proc_set_wakemon_params(pid_t, int, int); // 
 SPI
 #endif
 
 #include "CFString.h"
@@ -891,6 +892,8 @@ main (int argc, char *argv[])
 thread_param.sched_priority = 47;
 pthread_setschedparam(pthread_self(), thread_sched_policy, 
&thread_param);
 }
+
+::proc_set_wakemon_params (getpid(), 500, 0); // Allow up to 500 
wakeups/sec to avoid EXC_RESOURCE for normal use.
 #endif
 #endif
 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r241540 - For the "ios" target add a shell script phase at the end which

2015-07-06 Thread Jason Molenda
Author: jmolenda
Date: Mon Jul  6 22:38:42 2015
New Revision: 241540

URL: http://llvm.org/viewvc/llvm-project?rev=241540&view=rev
Log:
For the "ios" target add a shell script phase at the end which
removes the LLDB.framework/Resources and LLDB.framework/Swift
directories.  This isn't a deep bundle on ios builds; it is shallow.



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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=241540&r1=241539&r2=241540&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Jul  6 22:38:42 2015
@@ -55,6 +55,7 @@
buildConfigurationList = 26CEF3BD14FD596A007286B2 /* 
Build configuration list for PBXAggregateTarget "ios" */;
buildPhases = (
AFF87C85150FF5CC000E1742 /* CopyFiles */,
+   AF3059151B4B390800E25622 /* Run Script - remove 
unneeded Resources and Swift dirs from iOS LLDB.framework bundle */,
);
dependencies = (
26CEF3C214FD5973007286B2 /* PBXTargetDependency 
*/,
@@ -5821,6 +5822,21 @@
shellPath = /bin/sh;
shellScript = "sh 
$SRCROOT/scripts/finish-swig-wrapper-classes.sh $SRCROOT $TARGET_BUILD_DIR 
$CONFIGURATION_BUILD_DIR \"\"";
};
+   AF3059151B4B390800E25622 /* Run Script - remove unneeded 
Resources and Swift dirs from iOS LLDB.framework bundle */ = {
+   isa = PBXShellScriptBuildPhase;
+   buildActionMask = 12;
+   files = (
+   );
+   inputPaths = (
+   );
+   name = "Run Script - remove unneeded Resources and 
Swift dirs from iOS LLDB.framework bundle";
+   outputPaths = (
+   );
+   runOnlyForDeploymentPostprocessing = 0;
+   shellPath = "/bin/sh -x";
+   shellScript = "/bin/rm -rf 
\"$INSTALL_ROOT/System/Library/PrivateFrameworks/LLDB.framework/Resources\" 
\"$INSTALL_ROOT/System/Library/PrivateFrameworks/LLDB.framework/Swift\"";
+   showEnvVarsInLog = 0;
+   };
 /* End PBXShellScriptBuildPhase section */
 
 /* Begin PBXSourcesBuildPhase section */


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r241522 - Make the "lldb/Utility/JSON.h" able to parse JSON into tokens with the new JSONParser class.

2015-07-06 Thread Jason Molenda

> On Jul 6, 2015, at 5:31 PM, Siva Chandra  wrote:
> 
> On Mon, Jul 6, 2015 at 4:40 PM, Greg Clayton  wrote:
>> Modified: lldb/trunk/include/lldb/Utility/JSON.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/JSON.h?rev=241522&r1=241521&r2=241522&view=diff
>> ==
>> --- lldb/trunk/include/lldb/Utility/JSON.h (original)
>> +++ lldb/trunk/include/lldb/Utility/JSON.h Mon Jul  6 18:40:40 2015
>> @@ -11,6 +11,7 @@
>> #define utility_JSON_h_
>> 
>> #include "lldb/Core/Stream.h"
>> +#include "Utility/StringExtractor.h"
> 
> Should StringExtractor.h be moved to include/lldb/Utility? The build
> currently fails while compiling argdumper.cpp.


This happens to build cleanly on macosx, using the xcode build system.  Not 
sure if we're looking at a cmake vrs xcode build system difference or not.   
Doesn't NativeProcessLinux.cpp do the same thing?

> 
>> Modified: lldb/trunk/source/Utility/JSON.cpp
> ...
>> +if (CHAR_MIN <= escaped_ch && escaped_ch <= 
>> CHAR_MAX)
> 
> I am also requiring to include limits.h explicitly to see definitions
> of CHAR_MIN and CHAR_MAX.

Something must be too permissive on macosx; we should add  to this 
file.

J
___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D10932: Improve UnwindLLDB with better detection for unwinding failures

2015-07-03 Thread Jason Molenda
jasonmolenda accepted this revision.

This revision is now accepted and ready to land.

I'm fine with trying this approach. These heuristics for falling back to 
alternate unwind methods are tricky to get right; often the best approach is to 
live on them for a bit and pay close attention to the unwinder in complicated 
unwind situations.

The only question I have about the patch is the  UnwindLLDB::CursorSP 
UnwindLLDB::GetOneMoreFrame (ABI* abi) method - you have 'return nullptr;' as a 
shortcut in a few places.  Is that safe?  Normally in a function that returns a 
shared pointer we'll write 'return CursorSP();' for this. I'm sure the nullptr 
gets converted to an empty shared pointer via a copy constructor, or something 
like that.  I'm fine with coding it this way, just wanted to check if anyone 
knows it's OK.


http://reviews.llvm.org/D10932




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D10866: Improve DWARF CFI CIE parsing and remove duplicated code

2015-07-02 Thread Jason Molenda
jasonmolenda accepted this revision.
jasonmolenda added a comment.
This revision is now accepted and ready to land.

This looks OK to me too.


http://reviews.llvm.org/D10866




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D10902: Enable usage of eh_frame based unwind plan as a fallback

2015-07-02 Thread Jason Molenda
jasonmolenda accepted this revision.
jasonmolenda added a comment.
This revision is now accepted and ready to land.

Great idea.


http://reviews.llvm.org/D10902




___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Ignore "push/pop {sp}" in emulation based unwinding

2015-06-29 Thread Jason Molenda
Looks good to me.


http://reviews.llvm.org/D10806

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r240753 - When the user specifies a corefile that is not readable,

2015-06-25 Thread Jason Molenda
Author: jmolenda
Date: Thu Jun 25 21:16:48 2015
New Revision: 240753

URL: http://llvm.org/viewvc/llvm-project?rev=240753&view=rev
Log:
When the user specifies a corefile that is not readable,
give them a meaningful error message instead of 
"Unable to find process plug-in for core file ...".

 

http://blog.ignoranthack.me/?p=204

Modified:
lldb/trunk/source/Commands/CommandObjectTarget.cpp

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=240753&r1=240752&r2=240753&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Thu Jun 25 21:16:48 2015
@@ -387,6 +387,12 @@ protected:
 core_file.GetPath(core_path, sizeof(core_path));
 if (core_file.Exists())
 {
+if (!core_file.Readable())
+{
+result.AppendMessageWithFormat ("Core file '%s' is 
not readable.\n", core_path);
+result.SetStatus (eReturnStatusFailed);
+return false;
+}
 FileSpec core_file_dir;
 core_file_dir.GetDirectory() = 
core_file.GetDirectory();
 target_sp->GetExecutableSearchPaths ().Append 
(core_file_dir);


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r240737 - Re-enable 'process save-core' for arm64 targets.

2015-06-25 Thread Jason Molenda
Author: jmolenda
Date: Thu Jun 25 18:58:25 2015
New Revision: 240737

URL: http://llvm.org/viewvc/llvm-project?rev=240737&view=rev
Log:
Re-enable 'process save-core' for arm64 targets.
Whatever problem I saw that caused me to disable this
initially is not a problem today.

 

Modified:
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=240737&r1=240736&r2=240737&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Thu Jun 25 
18:58:25 2015
@@ -5675,11 +5675,7 @@ ObjectFileMachO::SaveCore (const lldb::P
 bool make_core = false;
 switch (target_arch.GetMachine())
 {
-  // arm64 core file writing is having some problem with 
writing  down the 
-  // dyld shared images info struct and/or the main executable 
binary. May
-  // turn out to be a debugserver problem, not sure yet.
-//case llvm::Triple::aarch64:
-
+case llvm::Triple::aarch64:
 case llvm::Triple::arm:
 case llvm::Triple::x86:
 case llvm::Triple::x86_64:


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r240713 - Mark armv7em and armv7m as compatible architectures.

2015-06-25 Thread Jason Molenda
Author: jmolenda
Date: Thu Jun 25 17:37:57 2015
New Revision: 240713

URL: http://llvm.org/viewvc/llvm-project?rev=240713&view=rev
Log:
Mark armv7em and armv7m as compatible architectures.
 

Modified:
lldb/trunk/source/Core/ArchSpec.cpp

Modified: lldb/trunk/source/Core/ArchSpec.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=240713&r1=240712&r2=240713&view=diff
==
--- lldb/trunk/source/Core/ArchSpec.cpp (original)
+++ lldb/trunk/source/Core/ArchSpec.cpp Thu Jun 25 17:37:57 2015
@@ -1091,6 +1091,8 @@ cores_match (const ArchSpec::Core core1,
 try_inverse = false;
 if (core2 == ArchSpec::eCore_arm_armv7)
 return true;
+if (core2 == ArchSpec::eCore_arm_armv6m)
+return true;
 }
 break;
 
@@ -1099,8 +1101,36 @@ cores_match (const ArchSpec::Core core1,
 return true;
 break;
 
-case ArchSpec::eCore_arm_armv7m:
 case ArchSpec::eCore_arm_armv7em:
+if (!enforce_exact_match)
+{
+if (core2 == ArchSpec::eCore_arm_generic)
+return true;
+if (core2 == ArchSpec::eCore_arm_armv7m)
+return true;
+if (core2 == ArchSpec::eCore_arm_armv6m)
+return true;
+if (core2 == ArchSpec::eCore_arm_armv7)
+return true;
+try_inverse = true;
+}
+break;
+
+case ArchSpec::eCore_arm_armv7m:
+if (!enforce_exact_match)
+{
+if (core2 == ArchSpec::eCore_arm_generic)
+return true;
+if (core2 == ArchSpec::eCore_arm_armv6m)
+return true;
+if (core2 == ArchSpec::eCore_arm_armv7)
+return true;
+if (core2 == ArchSpec::eCore_arm_armv7em)
+return true;
+try_inverse = true;
+}
+break;
+
 case ArchSpec::eCore_arm_armv7f:
 case ArchSpec::eCore_arm_armv7k:
 case ArchSpec::eCore_arm_armv7s:


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Add branch emulation to aarch64 instruction emulator

2015-06-24 Thread Jason Molenda
Greg's the best person to review this - as for the comment vrs. #if 0, I don't 
have a preference; I think for larger blocks of code the #if 0 is less noisy 
but it can also be easy to miss the fact that the code block is commented out 
when you're readingit.


http://reviews.llvm.org/D10702

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r240621 - xcode project file updates for the movement of the POSIX files into the FreeBSD process subdir.

2015-06-24 Thread Jason Molenda
Author: jmolenda
Date: Wed Jun 24 22:03:47 2015
New Revision: 240621

URL: http://llvm.org/viewvc/llvm-project?rev=240621&view=rev
Log:
xcode project file updates for the movement of the POSIX files into the FreeBSD 
process subdir.

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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=240621&r1=240620&r2=240621&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Jun 24 22:03:47 2015
@@ -913,6 +913,15 @@
AF2BCA6C18C7EFDE005B4526 /* JITLoaderGDB.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF2BCA6918C7EFDE005B4526 /* JITLoaderGDB.cpp */; 
};
AF2BCA6D18C7EFDE005B4526 /* JITLoaderGDB.h in Headers */ = {isa 
= PBXBuildFile; fileRef = AF2BCA6A18C7EFDE005B4526 /* JITLoaderGDB.h */; };
AF37E10A17C861F20061E18E /* ProcessRunLock.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF37E10917C861F20061E18E /* ProcessRunLock.cpp 
*/; };
+   AF3F54B11B3BA59C00186E73 /* CrashReason.h in Headers */ = {isa 
= PBXBuildFile; fileRef = AF3F54AF1B3BA59C00186E73 /* CrashReason.h */; };
+   AF3F54C31B3BA5D500186E73 /* POSIXStopInfo.h in Headers */ = 
{isa = PBXBuildFile; fileRef = AF3F54B31B3BA5D500186E73 /* POSIXStopInfo.h */; 
};
+   AF3F54C51B3BA5D500186E73 /* POSIXThread.h in Headers */ = {isa 
= PBXBuildFile; fileRef = AF3F54B51B3BA5D500186E73 /* POSIXThread.h */; };
+   AF3F54C71B3BA5D500186E73 /* ProcessPOSIX.h in Headers */ = {isa 
= PBXBuildFile; fileRef = AF3F54B71B3BA5D500186E73 /* ProcessPOSIX.h */; };
+   AF3F54C91B3BA5D500186E73 /* 
RegisterContextPOSIXProcessMonitor_arm.h in Headers */ = {isa = PBXBuildFile; 
fileRef = AF3F54B91B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_arm.h 
*/; };
+   AF3F54CB1B3BA5D500186E73 /* 
RegisterContextPOSIXProcessMonitor_arm64.h in Headers */ = {isa = PBXBuildFile; 
fileRef = AF3F54BB1B3BA5D500186E73 /* 
RegisterContextPOSIXProcessMonitor_arm64.h */; };
+   AF3F54CD1B3BA5D500186E73 /* 
RegisterContextPOSIXProcessMonitor_mips64.h in Headers */ = {isa = 
PBXBuildFile; fileRef = AF3F54BD1B3BA5D500186E73 /* 
RegisterContextPOSIXProcessMonitor_mips64.h */; };
+   AF3F54CF1B3BA5D500186E73 /* 
RegisterContextPOSIXProcessMonitor_powerpc.h in Headers */ = {isa = 
PBXBuildFile; fileRef = AF3F54BF1B3BA5D500186E73 /* 
RegisterContextPOSIXProcessMonitor_powerpc.h */; };
+   AF3F54D11B3BA5D500186E73 /* 
RegisterContextPOSIXProcessMonitor_x86.h in Headers */ = {isa = PBXBuildFile; 
fileRef = AF3F54C11B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_x86.h 
*/; };
AF455D571A9C231700D6C4F7 /* 
com.apple.lldb.launcherXPCService.xpc in CopyFiles */ = {isa = PBXBuildFile; 
fileRef = EDC6D49914E5C19B001B75F8 /* com.apple.lldb.launcherXPCService.xpc */; 
settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
AF455D581A9C231700D6C4F7 /* 
com.apple.lldb.launcherRootXPCService.xpc in CopyFiles */ = {isa = 
PBXBuildFile; fileRef = EDE274EC14EDCE1F005B0F75 /* 
com.apple.lldb.launcherRootXPCService.xpc */; settings = {ATTRIBUTES = 
(RemoveHeadersOnCopy, ); }; };
AF45FDE518A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp 
in Sources */ = {isa = PBXBuildFile; fileRef = AF45FDE318A1F3AC0007051C /* 
AppleGetThreadItemInfoHandler.cpp */; };
@@ -921,8 +930,6 @@
AF77E0901A033C700096C0EA /* ABISysV_ppc.h in Headers */ = {isa 
= PBXBuildFile; fileRef = AF77E08E1A033C700096C0EA /* ABISysV_ppc.h */; };
AF77E0931A033C7F0096C0EA /* ABISysV_ppc64.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF77E0911A033C7F0096C0EA /* ABISysV_ppc64.cpp 
*/; };
AF77E0941A033C7F0096C0EA /* ABISysV_ppc64.h in Headers */ = 
{isa = PBXBuildFile; fileRef = AF77E0921A033C7F0096C0EA /* ABISysV_ppc64.h */; 
};
-   AF77E0971A033CC70096C0EA /* 
RegisterContextPOSIXProcessMonitor_powerpc.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AF77E0951A033CC70096C0EA /* 
RegisterContextPOSIXProcessMonitor_powerpc.cpp */; };
-   AF77E0981A033CC70096C0EA /* 
RegisterContextPOSIXProcessMonitor_powerpc.h in Headers */ = {isa = 
PBXBuildFile; fileRef = AF77E0961A033CC70096C0EA /* 
RegisterContextPOSIXProcessMonitor_powerpc.h */; };
AF77E0A01A033D360096C0EA /* RegisterContext_powerpc.h in 
Headers */ = {isa = PBXBuildFile; fileRef = AF77E0991A033D360096C0EA /* 
RegisterContext_powerpc.h */; };
AF77E0A11A033D360096C0EA /* RegisterContextFreeBSD_powerpc.cpp 
in Sources */ = {isa = PBXBuildFile; fileRef = AF77E09A1A033D360096C0EA /* 
RegisterContextFreeBSD_powerpc.cpp */; };
AF77E0A21A033D360096C0EA /* RegisterContextFreeBSD_powerpc

Re: [Lldb-commits] [PATCH] Use both OS and Architecture to choose correct ABI

2015-06-22 Thread Jason Molenda
On Mac OS X there's these "simulator" processes used for debugging iOS apps on 
the Mac.  They are native i386/x86_64 code, they use the native Mac OS X ABI, 
but they link against different libraries so it behaves like an iOS device.  
These processes will have an architecture like i386-apple-ios.  So I'd also 
allow for arch.GetTriple().isiOS() to activate this plugin.


http://reviews.llvm.org/D10308

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


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

2015-06-22 Thread Jason Molenda
Tamas, I apologize for taking so long to get to this patch.  I meant to do it 
over the weekend but didn't have the time - I need to think hard about changes 
in the unwinder before I feel comfortable with them and it took me a couple 
hours of staring at the patch and thinking things over.

I much prefer your approach in EmulateInstruction of saving the unwind register 
state so that we can re-establish it after an epilogue.  Mine was not very 
elegant and I'm sure there are more complicated functions where mine could do 
the wrong thing.  In practice with the armv7/arm64 code that we were 
supporting, it worked fine.  But your approach is better.

One problem with the patch is that we're going to lose the mid-function 
epilogue correctness with the ARM64 instruction emulation plugin - it doesn't 
tag eContextAbsoluteBranchRegister / eContextRelativeBranchImmediate 
instructions which is the only way the m_forward_branch_offset ivar in 
EmulateInstruction is set.  I think it's reasonable to accept the patch knowing 
that we're regressing arm64 until someone (who supports arm64, like myself or 
Greg) adds the instruction support for recognizing branch instructions and 
correctly identifying the target offset of those branches.



Comment at: 
source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp:175
@@ -161,1 +174,3 @@
 
+// If the current instruction is a branch forward then 
save the current CIF information
+// for the offset where we are branching.

I think you mean "current CFI information" here.  The "I" in CFI stands for 
information, but it's one of those annoying aspects of english where it looks 
weird without "information" after it. :)


Comment at: 
source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp:188
@@ -164,29 +187,3 @@
 {
-reinstate_prologue_next_instruction = false;
-m_curr_row->SetOffset 
(inst->GetAddress().GetFileAddress() + inst->GetOpcode().GetByteSize() - 
base_addr);
-// Append the new row
-unwind_plan.AppendRow (m_curr_row);
-
-// Allocate a new Row for m_curr_row, copy the 
current state into it
-UnwindPlan::Row *newrow = new UnwindPlan::Row;
-*newrow = *m_curr_row.get();
-m_curr_row.reset(newrow);
-
-// If m_curr_insn_restored_a_register == true, 
we're looking at an epilogue instruction.
-// Set instructions_since_last_prologue_insn to a 
very high number so we don't append 
-// any of these epilogue instructions to our 
prologue_complete row.
-if (m_curr_insn_restored_a_register == false && 
instructions_since_last_prologue_insn < 8)
-  instructions_since_last_prologue_insn = 0;
-else
-  instructions_since_last_prologue_insn = 99;
-
-UnwindPlan::Row::RegisterLocation pc_regloc;
-UnwindPlan::Row::RegisterLocation ra_regloc;
-
-// While parsing the instructions of this 
function, if we've ever
-// seen the return address register (aka lr on 
arm) in a non-IsSame() state,
-// it has been saved on the stack.  If it's ever 
back to IsSame(), we've
-// executed an epilogue.
-if (ra_reg_num != LLDB_INVALID_REGNUM
-&& m_curr_row->GetRegisterInfo (ra_reg_num, 
ra_regloc)
-&& !ra_regloc.IsSame())
+// Save the modified row if we don't already have 
a CIF row in the currennt address
+if (saved_unwind_states.count(current_offset + 
inst->GetOpcode().GetByteSize()) == 0)

CFI.  Call Frame Information.

http://reviews.llvm.org/D10447

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r240354 - Reduced packet counts to the remote GDB server where possible.

2015-06-22 Thread Jason Molenda
Greg's out of the office for tonight.  Do you want to revert it or should I? 

> On Jun 22, 2015, at 7:10 PM, Chaoren Lin  wrote:
> 
> Hi Greg,
> 
> This commit caused a severe breakage on the Linux buildbot. Would you mind if 
> I reverted it until you can find a fix?
> 
> On Mon, Jun 22, 2015 at 4:12 PM, Greg Clayton  wrote:
> Author: gclayton
> Date: Mon Jun 22 18:12:45 2015
> New Revision: 240354
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=240354&view=rev
> Log:
> Reduced packet counts to the remote GDB server where possible.
> 
> We have been working on reducing the packet count that is sent between LLDB 
> and the debugserver on MacOSX and iOS. Our approach to this was to reduce the 
> packets required when debugging multiple threads. We currently make one 
> qThreadStopInfo call (where  is the thread ID in hex) per thread 
> except the thread that stopped with a stop reply packet. In order to 
> implement multiple thread infos in a single reply, we need to use structured 
> data, which means JSON. The new jThreadsInfo packet will attempt to retrieve 
> all thread infos in a single packet. The data is very similar to the stop 
> reply packets, but packaged in JSON and uses JSON arrays where applicable. 
> The JSON output looks like:
> 
> 
> [
>   { "tid":1580681,
> "metype":6,
> "medata":[2,0],
> "reason":"exception",
> "qaddr":140735118423168,
> "registers": {
>   "0":"8000",
>   "1":"",
>   "2":"20fabf5fff7f",
>   "3":"e8f8bf5fff7f",
>   "4":"0100",
>   "5":"d8f8bf5fff7f",
>   "6":"b0f8bf5fff7f",
>   "7":"20f4bf5fff7f",
>   "8":"8000",
>   "9":"61a8db78a61500db",
>   "10":"3200",
>   "11":"4602",
>   "12":"",
>   "13":"",
>   "14":"",
>   "15":"",
>   "16":"960b0100",
>   "17":"0202",
>   "18":"2b00",
>   "19":"",
>   "20":""},
> "memory":[
>   {"address":140734799804592,"bytes":"c8f8bf5fff7fc9a59e8cff7f"},
>   {"address":140734799804616,"bytes":"0100"}
> ]
>   }
> ]
> 
> It contains an array of dicitionaries with all of the key value pairs that 
> are normally in the stop reply packet. Including the expedited registers. 
> Notice that is also contains expedited memory in the "memory" key. Any values 
> in this memory will get included in a new L1 cache in lldb_private::Process 
> where if a memory read request is made and that memory request fits into one 
> of the L1 memory cache blocks, it will use that memory data. If a memory 
> request fails in the L1 cache, it will fall back to the L2 cache which is the 
> same block sized caching we were using before these changes. This allows a 
> process to expedite memory that you are likely to use and it reduces packet 
> count. On MacOSX with debugserver, we expedite the frame pointer backchain 
> for a thread (up to 256 entries) by reading 2 pointers worth of bytes at the 
> frame pointer (for the previous FP and PC), and follow the backchain. Most 
> backtraces on MacOSX and iOS now don't require us to read any memory!
> 
> We will try these packets out and if successful, we should port these to 
> lldb-server in the near future.
> 
> 
> 
> 
> Added:
> lldb/trunk/tools/debugserver/source/JSONGenerator.h
> Modified:
> lldb/trunk/include/lldb/Core/RangeMap.h
> lldb/trunk/include/lldb/Core/StructuredData.h
> lldb/trunk/include/lldb/Target/Memory.h
> lldb/trunk/source/API/SBThread.cpp
> lldb/trunk/source/Core/StructuredData.cpp
> 
> lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
> 
> lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
> lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
> lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
> lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
> lldb/trunk/source/Target/Memory.cpp
> lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
> lldb/trunk/tools/debugserver/source/RNBRemote.cpp
> lldb/trunk/tools/debugserver/source/RNBRemote.h
> 
> Modified: lldb/trunk/include/lldb/Core/RangeMap.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/RangeMap.h?rev=240354&r1=240353&r2=240354&view=diff
> ==
> --- lldb/trunk/include/lldb/Core/RangeMap.h (original)
> +++ lldb/trunk/include/lldb/Core/RangeMap.h Mon Jun 22 18:12:45 2015
> @@ -128,9 +128,10 @@ namespace lldb_private {
>  {
>  return Contains(range.GetRangeBase()) && 
> ContainsEndInclusive(range.GetRangeEnd());
>  }
> -
> +
> +// Returns true if the two ranges adjoing or

[Lldb-commits] [lldb] r240066 - Add a new wart, I mean feature, on to gdb-remote protocol: compression.

2015-06-18 Thread Jason Molenda
Author: jmolenda
Date: Thu Jun 18 16:46:06 2015
New Revision: 240066

URL: http://llvm.org/viewvc/llvm-project?rev=240066&view=rev
Log:
Add a new wart, I mean feature, on to gdb-remote protocol: compression.
For some communication channels, sending large packets can be very 
slow.  In those cases, it may be faster to compress the contents of
the packet on the target device and decompress it on the debug host
system.  For instance, communicating with a device using something
like Bluetooth may be an environment where this tradeoff is a good one.

This patch adds a new field to the response to the "qSupported" packet
(which returns a "qXfer:features:" response) -- SupportedCompressions
and DefaultCompressionMinSize.  These tell you what the remote
stub can support.

lldb, if it wants to enable compression and can handle one of those 
algorithms, it can send a QEnableCompression packet specifying the
algorithm and optionally the minimum packet size to use compression
on.  lldb may have better knowledge about the best tradeoff for
a given communication channel.

I added support to debugserver an lldb to use the zlib APIs
(if -DHAVE_LIBZ=1 is in CFLAGS and -lz is in LDFLAGS) and the
libcompression APIs on Mac OS X 10.11 and later 
(if -DHAVE_LIBCOMPRESSION=1).  libz "zlib-deflate" compression.
libcompression can support deflate, lz4, lzma, and a proprietary
lzfse algorithm.  libcompression has been hand-tuned for Apple
hardware so it should be preferred if available.

debugserver currently only adds the SupportedCompressions when
it is being run on an Apple watch (TARGET_OS_WATCH).  Comment
that #if out from RNBRemote.cpp if you want to enable it to
see how it works.  I haven't tested this on a native system
configuration but surely it will be slower to compress & decompress
the packets in a same-system debug session.

I haven't had a chance to add support for this to 
GDBRemoteCommunciationServer.cpp yet.

 

Modified:
lldb/trunk/docs/lldb-gdb-remote.txt
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
lldb/trunk/tools/debugserver/source/RNBRemote.cpp
lldb/trunk/tools/debugserver/source/RNBRemote.h

Modified: lldb/trunk/docs/lldb-gdb-remote.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/lldb-gdb-remote.txt?rev=240066&r1=240065&r2=240066&view=diff
==
--- lldb/trunk/docs/lldb-gdb-remote.txt (original)
+++ lldb/trunk/docs/lldb-gdb-remote.txt Thu Jun 18 16:46:06 2015
@@ -1384,3 +1384,66 @@ for this region.
 //
 // on the wire.
 //--
+
+//--
+// "QEnableCompression"
+//
+// BRIEF
+//  This packet enables compression of the packets that the debug stub sends 
to lldb.
+//  If the debug stub can support compression, it indictes this in the reply 
of the 
+//  "qSupported" packet.  e.g.
+//   LLDB SENDS:qSupported:xmlRegisters=i386,arm,mips
+//   STUB REPLIES:  
qXfer:features:read+;SupportedCompressions=lzfse,zlib-deflate,lz4,lzma;DefaultCompressionMinSize=384
+//
+//  If lldb knows how to use any of these compression algorithms, it can ask 
that this
+//  compression mode be enabled.  It may optionally change the minimum packet 
size 
+//  where compression is used.  Typically small packets do not benefit from 
compression,
+//  as well as compression headers -- compression is most beneficial with 
larger packets.
+//
+//  QEnableCompression:type:zlib-deflate;
+//  or
+//  QEnableCompression:type:zlib-deflate;minsize:512;
+//
+//  The debug stub should reply with an uncompressed "OK" packet to indicate 
that the
+//  request was accepted.  All further packets the stub sends will use this 
compression.
+//
+//  Packets are compressed as the last step before they are sent from the 
stub, and 
+//  decompressed as the first step after they are received.  The packet format 
in compressed
+//  mode becomes one of two:
+//
+//   $N#00
+//
+//   $C:#00
+//
+//  Where "#00" is the actual checksum value if noack mode is not enabled.  
The checksum
+//  value is for the "N" or 
+//  "C:" bytes in 
the packet.
+//
+//  The size of the uncompressed payload in base10 is provided because it will 
simplify
+//  decompression if the final buffer size needed is known ahead of time.
+//
+//  Compression on low-latency connections is unlikely to be an improvement.  
Particularly
+//  when the debug stub and lldb are running on the same host.  It should only 
be used
+//  for slow connections, and likely only for larger pack

[Lldb-commits] [lldb] r240060 - Correct the end-of-vector check in GetCompactUnwindInfoForFunction().

2015-06-18 Thread Jason Molenda
Author: jmolenda
Date: Thu Jun 18 16:15:58 2015
New Revision: 240060

URL: http://llvm.org/viewvc/llvm-project?rev=240060&view=rev
Log:
Correct the end-of-vector check in GetCompactUnwindInfoForFunction().
Problem noticed by Todd Fiala.

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

Modified: lldb/trunk/source/Symbol/CompactUnwindInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompactUnwindInfo.cpp?rev=240060&r1=240059&r2=240060&view=diff
==
--- lldb/trunk/source/Symbol/CompactUnwindInfo.cpp (original)
+++ lldb/trunk/source/Symbol/CompactUnwindInfo.cpp Thu Jun 18 16:15:58 2015
@@ -525,7 +525,7 @@ CompactUnwindInfo::GetCompactUnwindInfoF
 }
 
 auto next_it = it + 1;
-if (next_it != m_indexes.begin())
+if (next_it != m_indexes.end())
 {
 // initialize the function offset end range to be the start of the 
 // next index offset.  If we find an entry which is at the end of


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Add new test for stress testing stack unwinding

2015-06-16 Thread Jason Molenda
Excellent, then I'm all for it. :)  I didn't think it would turn up anything 
but it's great to hear that it is.  Thanks for working on this.


http://reviews.llvm.org/D10454

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Add new test for stress testing stack unwinding

2015-06-16 Thread Jason Molenda
I don't have any objections to this test idea.  Trying to encapsulate tricky 
unwind scenarios in an arch-independent manner is very hard.  IMO the only way 
to do this is hand-written platform-specific assembly or platform-specific 
corefiles that capture a problematic program state.

Realistically, the unwinder doesn't fail on C/C++ compiled code -- I mean, if 
it does, there are some big problems that we need to address.  The tricky stuff 
is always dealing with hand-written assembly code, or trying to backtrace 
through an asynchronous signal handler like sigtramp()/sigtrap(), or 
backtracing from address 0, or backtracing as we step through an assembly stub 
routine that jumps to another real destination function, or backtracing through 
jitted code that has no associated Module at all in lldb.  Sure, turn on 
-fomit-frame-pointer and see if lldb follows the eh_frame correctly as you 
stepi through a function (prologues and epilogues are always the most likely to 
get you the wrong caller func) but I don't think it'll be a rich source for 
regression detection.

I don't mean to discourage this, please do this.  I've been thinking about the 
problem of testing unwinds for a while now, and I'm not happy with any of the 
obvious approaches.  And it's such a critical component of the debugger, and so 
easy to break, that we really do need to work on this more.


http://reviews.llvm.org/D10454

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r239013 - Make the function that parses the json packets in debugserver

2015-06-03 Thread Jason Molenda
Author: jmolenda
Date: Thu Jun  4 01:03:03 2015
New Revision: 239013

URL: http://llvm.org/viewvc/llvm-project?rev=239013&view=rev
Log:
Make the function that parses the json packets in debugserver
a little more resilient to freely formatted json.  Greg's change
in r238279 made the json output from StructuredData unconditionally
pretty-printed and the spaces were confusing debugserver.


Modified:
lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=239013&r1=239012&r2=239013&view=diff
==
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Thu Jun  4 01:03:03 2015
@@ -4481,16 +4481,28 @@ get_integer_value_for_key_name_from_json
 uint64_t retval = INVALID_NUB_ADDRESS;
 std::string key_with_quotes = "\"";
 key_with_quotes += key;
-key_with_quotes += "\":";
+key_with_quotes += "\"";
 const char *c = strstr (json_string, key_with_quotes.c_str());
 if (c)
 {
 c += key_with_quotes.size();
-errno = 0;
-retval = strtoul (c, NULL, 10);
-if (errno != 0)
+
+while (*c != '\0' && (*c == ' ' || *c == '\t' || *c == '\n' || *c == 
'\r'))
+c++;
+
+if (*c == ':')
 {
-retval = INVALID_NUB_ADDRESS;
+c++;
+
+while (*c != '\0' && (*c == ' ' || *c == '\t' || *c == '\n' || *c 
== '\r'))
+c++;
+
+errno = 0;
+retval = strtoul (c, NULL, 10);
+if (errno != 0)
+{
+retval = INVALID_NUB_ADDRESS;
+}
 }
 }
 return retval;


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r238395 - Add quick bit of doc about SBFrame::GetCFA().

2015-05-27 Thread Jason Molenda
Author: jmolenda
Date: Wed May 27 23:55:53 2015
New Revision: 238395

URL: http://llvm.org/viewvc/llvm-project?rev=238395&view=rev
Log:
Add quick bit of doc about SBFrame::GetCFA().

Modified:
lldb/trunk/scripts/interface/SBFrame.i

Modified: lldb/trunk/scripts/interface/SBFrame.i
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBFrame.i?rev=238395&r1=238394&r2=238395&view=diff
==
--- lldb/trunk/scripts/interface/SBFrame.i (original)
+++ lldb/trunk/scripts/interface/SBFrame.i Wed May 27 23:55:53 2015
@@ -63,6 +63,12 @@ public:
 uint32_t
 GetFrameID () const;
 
+%feature("docstring", "
+Get the Canonical Frame Address for this stack frame.
+This is the DWARF standard's definition of a CFA, a stack address
+that remains constant throughout the lifetime of the function.
+Returns an lldb::addr_t stack address, or LLDB_INVALID_ADDRESS if
+the CFA cannot be determined.") GetCFA;
 lldb::addr_t
 GetCFA () const;
 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r235737 - Look for both .debug and dsym debugging symbol information for stripped executable.

2015-05-19 Thread Jason Molenda
Hi Robert, this change introduced a bit of a regression in Mac native lldb.  
It's not easy to spot on a Mac but in other environments it's a problem.


LocateDSYMInVincinityOfExecutable is a function in Host/common/Symbols.cpp.  It 
takes a ModuleSpec (the details about the executable binary -- the filename, 
architecture, UUID, etc) and it looks for a dSYM bundle near that executable.  
It adds things on to the file path and if it finds a likely candidate, 
retrieves the ModuleSpecs for that dSYM (in the case of a multiple-architecture 
universal dSYM binary) and compares them to the original executable binary's 
ModuleSpec.

The problem comes from using ModuleSpec::FindMatchingModuleSpec().  This calls 
ModuleSpec::Matches() and this method, among the things it checks, requires 
that the *filenames* match between the executable and the dSYM.

As a reminder, an executable name might be /tmp/a.out.  Its dSYM would be 
/tmp/a.out.dSYM/Contents/Resources/a.out.

After r235737, LocateDSYMInVincinityOfExecutable() never matches anything.

The only reason it escaped all of our notices is that lldb then asks the 
DebugSymbols framework to find the dSYM -- and it has usually been able to do 
that.

But if the DebugSymbols framework is not available or not working, lldb is 
completely broken for automatically loading a dSYM next to a binary.

The old version of LocateDSYMInVincinityOfExecutable() was written in very Mac 
specific terms, e.g.

if (dsym_fspec.Exists() && FileAtPathContainsArchAndUUID 
(dsym_fspec, module_spec.GetArchitecturePtr(), module_spec.GetUUIDPtr()))
{
return true;
}

(and FileAtPathContainsArchAndUUID was very mac-only) so you had a bit of 
rewriting to do there in making it non-mac-specific.  But I think using 
ModuleSpec::FindMatchingModuleSpec() in place of this is not correct.

As a quick workaround I made this patch,

Index: source/Host/common/Symbols.cpp
===
--- source/Host/common/Symbols.cpp  (revision 237751)
+++ source/Host/common/Symbols.cpp  (working copy)
@@ -76,9 +76,20 @@
 
 ModuleSpecList module_specs;
 ModuleSpec matched_module_spec;
+
+ModuleSpec uuid_match_only_module_spec;
+const ModuleSpec *module_spec_for_search = &module_spec;
+
+// If the ModuleSpec includes a UUID, only compare the UUID 
when looking at the
+// dSYM binary.
+if (module_spec.GetUUID().IsValid())
+{
+uuid_match_only_module_spec.GetUUID() = 
module_spec.GetUUID();
+module_spec_for_search = &uuid_match_only_module_spec;
+}
 if (dsym_fspec.Exists() &&
 ObjectFile::GetModuleSpecifications(dsym_fspec, 0, 0, 
module_specs) &&
-module_specs.FindMatchingModuleSpec(module_spec, 
matched_module_spec))
+
module_specs.FindMatchingModuleSpec(*module_spec_for_search, 
matched_module_spec))
 {
 return true;
 }
@@ -95,10 +106,20 @@
 *next_slash = '\0';
 ::strncat(path, ".dSYM/Contents/Resources/DWARF/", 
sizeof(path) - strlen(path) - 1);
 ::strncat(path, 
exec_fspec->GetFilename().AsCString(), sizeof(path) - strlen(path) - 1);
+module_spec_for_search = &module_spec;
+
+// If the ModuleSpec includes a UUID, only compare 
the UUID when looking at the
+// dSYM binary.
+if (module_spec.GetUUID().IsValid())
+{
+uuid_match_only_module_spec.GetUUID() = 
module_spec.GetUUID();
+module_spec_for_search = 
&uuid_match_only_module_spec;
+}
+
 dsym_fspec.SetFile(path, false);
 if (dsym_fspec.Exists() &&
 
ObjectFile::GetModuleSpecifications(dsym_fspec, 0, 0, module_specs) &&
-
module_specs.FindMatchingModuleSpec(module_spec, matched_module_spec))
+
module_specs.FindMatchingModuleSpec(*module_spec_for_search, 
matched_module_spec))
 {
 return true;
 }


which looks to see if the executable module has a UUID in its ModuleSpec -- and 
if so, it creates a new ModuleSpec with only that one field.  That is always 
enough to disambiguate among a multi-architecture dSYM, and to ensure that we 
have the correct dSYM.  (and on Mac, it's nigh impossible to get a binary that 
doesn't have a UUID in it--you never see them in practice.)

Do you want to tak

Re: [Lldb-commits] [lldb] r237411 - The StopInfo base class has an m_description std::string.

2015-05-15 Thread Jason Molenda
Sorry for causing the testsuite regression, Vince.  If I do break another 
platform with a checkin, reverting the change is fine -- I don't want to leave 
the sources in a broken state until I get back on-line to look at it.

Thanks for coming up with a fix Pavel.  I don't see a problem with your change 
but if there's fallout we can start by reverting both and I'll investigate more 
closely.

Jason

> On May 15, 2015, at 3:22 AM, Pavel Labath  wrote:
> 
> Hi all,
> 
> I have tracked this issue down to the processing of the description
> field of the gdb-remote stop reply packets. If the packet has a
> description field, we use it to override the description of the
> StopInfo class. However, in the case of watchpoints the description
> field contains the raw address that got hit, which is not exactly what
> we want to display to the user. I have committed a fix for this in
> r237436. I think it's a fairly low-risk change, but could you please
> take a look at it and see if you think it's the correct way to address
> this. Feel free to replace it with a more appropriate fix.
> 
> cheers,
> pl
> 
> 
> On 15 May 2015 at 06:35, Vince Harron  wrote:
>> Hi Jason,
>> 
>> Unfortunately, this broke watchpoints on Linux.  (I just confirmed by
>> building & testing both this revision and the previous.)
>> 
>> Do you have any guesses?  Would you like one of us to take a look?
>> 
>> How do you feel about reverting it to get the build green while it's being
>> investigated?
>> 
>> http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/2406
>> 
>> Vince
>> 
>> 
>> On Thu, May 14, 2015 at 5:19 PM, Jason Molenda  wrote:
>>> 
>>> Author: jmolenda
>>> Date: Thu May 14 19:19:28 2015
>>> New Revision: 237411
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=237411&view=rev
>>> Log:
>>> The StopInfo base class has an m_description std::string.
>>> Remove the m_description ivar from the StopInfoBreakpoint
>>> and StopInfoWatchpoint subclasses of StopInfo.  Also,
>>> initialize the m_description ivar in the StopInfo ctor.
>>> 
>>> 
>>> Modified:
>>>lldb/trunk/source/Target/StopInfo.cpp
>>> 
>>> Modified: lldb/trunk/source/Target/StopInfo.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StopInfo.cpp?rev=237411&r1=237410&r2=237411&view=diff
>>> 
>>> ==
>>> --- lldb/trunk/source/Target/StopInfo.cpp (original)
>>> +++ lldb/trunk/source/Target/StopInfo.cpp Thu May 14 19:19:28 2015
>>> @@ -40,6 +40,7 @@ StopInfo::StopInfo (Thread &thread, uint
>>> m_stop_id (thread.GetProcess()->GetStopID()),
>>> m_resume_id (thread.GetProcess()->GetResumeID()),
>>> m_value (value),
>>> +m_description (),
>>> m_override_should_notify (eLazyBoolCalculate),
>>> m_override_should_stop (eLazyBoolCalculate),
>>> m_extended_info()
>>> @@ -112,7 +113,6 @@ class StopInfoBreakpoint : public StopIn
>>> public:
>>> StopInfoBreakpoint (Thread &thread, break_id_t break_id) :
>>> StopInfo (thread, break_id),
>>> -m_description(),
>>> m_should_stop (false),
>>> m_should_stop_is_valid (false),
>>> m_should_perform_action (true),
>>> @@ -125,7 +125,6 @@ public:
>>> 
>>> StopInfoBreakpoint (Thread &thread, break_id_t break_id, bool
>>> should_stop) :
>>> StopInfo (thread, break_id),
>>> -m_description(),
>>> m_should_stop (should_stop),
>>> m_should_stop_is_valid (true),
>>> m_should_perform_action (true),
>>> @@ -568,7 +567,6 @@ protected:
>>> }
>>> 
>>> private:
>>> -std::string m_description;
>>> bool m_should_stop;
>>> bool m_should_stop_is_valid;
>>> bool m_should_perform_action; // Since we are trying to preserve the
>>> "state" of the system even if we run functions
>>> @@ -621,7 +619,6 @@ public:
>>> 
>>> StopInfoWatchpoint (Thread &thread, break_id_t watch_id) :
>>> StopInfo(thread, watch_id),
>>> -m_description(),
>>> m_should_stop(false),
>>> m_should_stop_is_valid(false)
>>> {
>>> @@ -860,7 +857,6 @@ protected:
>>> }
>>> 
>>> private:
>>> -std::string m_description;
>>> bool m_should_stop;
>>> bool m_should_stop_is_valid;
>>> };
>>> 
>>> 
>>> ___
>>> lldb-commits mailing list
>>> lldb-commits@cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>> 
>> 
>> 
>> ___
>> lldb-commits mailing list
>> lldb-commits@cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>> 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r237411 - The StopInfo base class has an m_description std::string.

2015-05-14 Thread Jason Molenda
Author: jmolenda
Date: Thu May 14 19:19:28 2015
New Revision: 237411

URL: http://llvm.org/viewvc/llvm-project?rev=237411&view=rev
Log:
The StopInfo base class has an m_description std::string.
Remove the m_description ivar from the StopInfoBreakpoint
and StopInfoWatchpoint subclasses of StopInfo.  Also,
initialize the m_description ivar in the StopInfo ctor.
 

Modified:
lldb/trunk/source/Target/StopInfo.cpp

Modified: lldb/trunk/source/Target/StopInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StopInfo.cpp?rev=237411&r1=237410&r2=237411&view=diff
==
--- lldb/trunk/source/Target/StopInfo.cpp (original)
+++ lldb/trunk/source/Target/StopInfo.cpp Thu May 14 19:19:28 2015
@@ -40,6 +40,7 @@ StopInfo::StopInfo (Thread &thread, uint
 m_stop_id (thread.GetProcess()->GetStopID()),
 m_resume_id (thread.GetProcess()->GetResumeID()),
 m_value (value),
+m_description (),
 m_override_should_notify (eLazyBoolCalculate),
 m_override_should_stop (eLazyBoolCalculate),
 m_extended_info()
@@ -112,7 +113,6 @@ class StopInfoBreakpoint : public StopIn
 public:
 StopInfoBreakpoint (Thread &thread, break_id_t break_id) :
 StopInfo (thread, break_id),
-m_description(),
 m_should_stop (false),
 m_should_stop_is_valid (false),
 m_should_perform_action (true),
@@ -125,7 +125,6 @@ public:
 
 StopInfoBreakpoint (Thread &thread, break_id_t break_id, bool should_stop) 
:
 StopInfo (thread, break_id),
-m_description(),
 m_should_stop (should_stop),
 m_should_stop_is_valid (true),
 m_should_perform_action (true),
@@ -568,7 +567,6 @@ protected:
 }
 
 private:
-std::string m_description;
 bool m_should_stop;
 bool m_should_stop_is_valid;
 bool m_should_perform_action; // Since we are trying to preserve the 
"state" of the system even if we run functions
@@ -621,7 +619,6 @@ public:
 
 StopInfoWatchpoint (Thread &thread, break_id_t watch_id) :
 StopInfo(thread, watch_id),
-m_description(),
 m_should_stop(false),
 m_should_stop_is_valid(false)
 {
@@ -860,7 +857,6 @@ protected:
 }
 
 private:
-std::string m_description;
 bool m_should_stop;
 bool m_should_stop_is_valid;
 };


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r236478 - Fix an uninitialized memory use error when interpreting

2015-05-04 Thread Jason Molenda
Author: jmolenda
Date: Mon May  4 21:05:53 2015
New Revision: 236478

URL: http://llvm.org/viewvc/llvm-project?rev=236478&view=rev
Log:
Fix an uninitialized memory use error when interpreting
compact unwind encodings for x86_64 / i386 omit-frame-pointer
code.  It was possible for lldb to get the location of saved
registers incorrect for some of these functions.
 

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

Modified: lldb/trunk/source/Symbol/CompactUnwindInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompactUnwindInfo.cpp?rev=236478&r1=236477&r2=236478&view=diff
==
--- lldb/trunk/source/Symbol/CompactUnwindInfo.cpp (original)
+++ lldb/trunk/source/Symbol/CompactUnwindInfo.cpp Mon May  4 21:05:53 2015
@@ -841,7 +841,7 @@ CompactUnwindInfo::CreateUnwindPlan_x86_
 //
 // This is done with Lehmer code permutation, e.g. see
 // 
http://stackoverflow.com/questions/1506078/fast-permutation-number-permutation-mapping-algorithms
-int permunreg[6];
+int permunreg[6] = {0, 0, 0, 0, 0, 0};
 
 // This decodes the variable-base number in the 10 bits
 // and gives us the Lehmer code sequence which can then
@@ -901,7 +901,7 @@ CompactUnwindInfo::CreateUnwindPlan_x86_
 // Decode the Lehmer code for this permutation of
 // the registers v. http://en.wikipedia.org/wiki/Lehmer_code
 
-int registers[6];
+int registers[6] = { UNWIND_X86_64_REG_NONE, 
UNWIND_X86_64_REG_NONE, UNWIND_X86_64_REG_NONE, UNWIND_X86_64_REG_NONE, 
UNWIND_X86_64_REG_NONE, UNWIND_X86_64_REG_NONE };
 bool used[7] = { false, false, false, false, false, false, 
false };
 for (uint32_t i = 0; i < register_count; i++)
 {
@@ -1115,7 +1115,7 @@ CompactUnwindInfo::CreateUnwindPlan_i386
 //
 // This is done with Lehmer code permutation, e.g. see
 // 
http://stackoverflow.com/questions/1506078/fast-permutation-number-permutation-mapping-algorithms
-int permunreg[6];
+int permunreg[6] = {0, 0, 0, 0, 0, 0};
 
 // This decodes the variable-base number in the 10 bits
 // and gives us the Lehmer code sequence which can then
@@ -1175,7 +1175,7 @@ CompactUnwindInfo::CreateUnwindPlan_i386
 // Decode the Lehmer code for this permutation of
 // the registers v. http://en.wikipedia.org/wiki/Lehmer_code
 
-int registers[6];
+int registers[6] = { UNWIND_X86_REG_NONE, UNWIND_X86_REG_NONE, 
UNWIND_X86_REG_NONE, UNWIND_X86_REG_NONE, UNWIND_X86_REG_NONE, 
UNWIND_X86_REG_NONE };
 bool used[7] = { false, false, false, false, false, false, 
false };
 for (uint32_t i = 0; i < register_count; i++)
 {


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r236477 - Add CommandObjectLanguage to the xcode project file.

2015-05-04 Thread Jason Molenda
Author: jmolenda
Date: Mon May  4 21:03:37 2015
New Revision: 236477

URL: http://llvm.org/viewvc/llvm-project?rev=236477&view=rev
Log:
Add CommandObjectLanguage to the xcode project file.

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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=236477&r1=236476&r2=236477&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon May  4 21:03:37 2015
@@ -931,6 +931,10 @@
AF9B8F33182DB52900DA866F /* SystemRuntimeMacOSX.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF9B8F31182DB52900DA866F /* 
SystemRuntimeMacOSX.cpp */; };
AF9B8F34182DB52900DA866F /* SystemRuntimeMacOSX.h in Headers */ 
= {isa = PBXBuildFile; fileRef = AF9B8F32182DB52900DA866F /* 
SystemRuntimeMacOSX.h */; };
AFB3D2801AC262AB003B4B30 /* MICmdCmdGdbShow.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AFB3D27E1AC262AB003B4B30 /* MICmdCmdGdbShow.cpp 
*/; };
+   AFC234081AF85CE000CDE8B6 /* CommandObjectLanguage.cpp in 
CopyFiles */ = {isa = PBXBuildFile; fileRef = AFC234061AF85CE000CDE8B6 /* 
CommandObjectLanguage.cpp */; };
+   AFC234091AF85CE100CDE8B6 /* CommandObjectLanguage.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AFC234061AF85CE000CDE8B6 /* 
CommandObjectLanguage.cpp */; };
+   AFC2340A1AF85CE100CDE8B6 /* CommandObjectLanguage.h in 
CopyFiles */ = {isa = PBXBuildFile; fileRef = AFC234071AF85CE000CDE8B6 /* 
CommandObjectLanguage.h */; };
+   AFC2340B1AF85CE100CDE8B6 /* CommandObjectLanguage.h in Headers 
*/ = {isa = PBXBuildFile; fileRef = AFC234071AF85CE000CDE8B6 /* 
CommandObjectLanguage.h */; };
AFDCDBCB19DD0F42005EA55E /* SBExecutionContext.h in Headers */ 
= {isa = PBXBuildFile; fileRef = 940B02F419DC96CB00AD0F52 /* 
SBExecutionContext.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFDFDFD119E34D3400EAE509 /* ConnectionFileDescriptorPosix.cpp 
in Sources */ = {isa = PBXBuildFile; fileRef = AFDFDFD019E34D3400EAE509 /* 
ConnectionFileDescriptorPosix.cpp */; };
AFEC3362194A8ABA00FF05C6 /* StructuredData.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AFEC3361194A8ABA00FF05C6 /* StructuredData.cpp 
*/; };
@@ -1157,7 +1161,9 @@
AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles 
*/,
33E5E8461A6736D30024ED68 /* StringConvert.h in 
CopyFiles */,
33064C9C1A5C7A490033D415 /* UriParser.h in 
CopyFiles */,
+   AFC234081AF85CE000CDE8B6 /* 
CommandObjectLanguage.cpp in CopyFiles */,
33E5E8421A672A240024ED68 /* StringConvert.cpp 
in CopyFiles */,
+   AFC2340A1AF85CE100CDE8B6 /* 
CommandObjectLanguage.h in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 1;
};
@@ -2699,6 +2705,8 @@
AF9B8F32182DB52900DA866F /* SystemRuntimeMacOSX.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SystemRuntimeMacOSX.h; sourceTree = ""; };
AFB3D27E1AC262AB003B4B30 /* MICmdCmdGdbShow.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = MICmdCmdGdbShow.cpp; path = "tools/lldb-mi/MICmdCmdGdbShow.cpp"; 
sourceTree = SOURCE_ROOT; };
AFB3D27F1AC262AB003B4B30 /* MICmdCmdGdbShow.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
MICmdCmdGdbShow.h; path = "tools/lldb-mi/MICmdCmdGdbShow.h"; sourceTree = 
SOURCE_ROOT; };
+   AFC234061AF85CE000CDE8B6 /* CommandObjectLanguage.cpp */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = CommandObjectLanguage.cpp; path = 
source/Commands/CommandObjectLanguage.cpp; sourceTree = ""; };
+   AFC234071AF85CE000CDE8B6 /* CommandObjectLanguage.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
CommandObjectLanguage.h; path = source/Commands/CommandObjectLanguage.h; 
sourceTree = ""; };
AFDFDFD019E34D3400EAE509 /* ConnectionFileDescriptorPosix.cpp 
*/ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; path = ConnectionFileDescriptorPosix.cpp; sourceTree = 
""; };
AFEC3361194A8ABA00FF05C6 /* StructuredData.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = StructuredData.cpp; path = source/Core/StructuredData.cpp; sourceTree = 
""; };
AFF87C86150FF669000E1742 /* com.apple.debugserver.plist */ = 
{isa = PBXFileReference; fileEncoding = 4; la

[Lldb-commits] [lldb] r236363 - Change process kill to call Process::Destroy (force_kill = true);

2015-05-01 Thread Jason Molenda
Author: jmolenda
Date: Fri May  1 18:39:48 2015
New Revision: 236363

URL: http://llvm.org/viewvc/llvm-project?rev=236363&view=rev
Log:
Change process kill to call Process::Destroy (force_kill = true);
follow-up to the change in r235158.  Right now if you attach to 
a process and type "kill", lldb doesn't kill it, it detaches.
 

Modified:
lldb/trunk/source/Commands/CommandObjectProcess.cpp

Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=236363&r1=236362&r2=236363&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Fri May  1 18:39:48 2015
@@ -1466,7 +1466,7 @@ protected:
 
 if (command.GetArgumentCount() == 0)
 {
-Error error (process->Destroy(false));
+Error error (process->Destroy(true));
 if (error.Success())
 {
 result.SetStatus (eReturnStatusSuccessFinishResult);


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r236286 - Guard against the case where the Write method is called with

2015-04-30 Thread Jason Molenda
Author: jmolenda
Date: Thu Apr 30 18:42:56 2015
New Revision: 236286

URL: http://llvm.org/viewvc/llvm-project?rev=236286&view=rev
Log:
Guard against the case where the Write method is called with
an argument pointing into the middle of m_buffer and then
Write() calls GrowBuffer() to resize m_buffer, leaving 
the content argument pointing into deallocated memory.

Patch by Kate Stone.
 

Modified:
lldb/trunk/source/Core/FastDemangle.cpp

Modified: lldb/trunk/source/Core/FastDemangle.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FastDemangle.cpp?rev=236286&r1=236285&r2=236286&view=diff
==
--- lldb/trunk/source/Core/FastDemangle.cpp (original)
+++ lldb/trunk/source/Core/FastDemangle.cpp Thu Apr 30 18:42:56 2015
@@ -383,10 +383,19 @@ private:
 char *end_m_write_ptr = m_write_ptr + content_length;
 if (end_m_write_ptr > m_buffer_end)
 {
-GrowBuffer(end_m_write_ptr - m_buffer_end);
+if (content >= m_buffer && content < m_buffer_end) 
+{
+long offset = content - m_buffer;
+GrowBuffer (end_m_write_ptr - m_buffer_end);
+content = m_buffer + offset;
+}
+else 
+{
+GrowBuffer (end_m_write_ptr - m_buffer_end);
+}
 end_m_write_ptr = m_write_ptr + content_length;
 }
-memcpy(m_write_ptr, content, content_length);
+memcpy (m_write_ptr, content, content_length);
 m_write_ptr = end_m_write_ptr;
 }
 #define WRITE(x) Write(x, sizeof (x) - 1)


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r236284 - Use #include "lldb/API/SBCommandReturnObject.h" instead of <...>.

2015-04-30 Thread Jason Molenda
Author: jmolenda
Date: Thu Apr 30 18:31:04 2015
New Revision: 236284

URL: http://llvm.org/viewvc/llvm-project?rev=236284&view=rev
Log:
Use #include "lldb/API/SBCommandReturnObject.h" instead of <...>.

Modified:
lldb/trunk/tools/lldb-mi/MICmdCmdData.h

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdData.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdData.h?rev=236284&r1=236283&r2=236284&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmdCmdData.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdData.h Thu Apr 30 18:31:04 2015
@@ -31,7 +31,7 @@
 #pragma once
 
 // Third party headers:
-#include 
+#include "lldb/API/SBCommandReturnObject.h"
 
 // In-house headers:
 #include "MICmdBase.h"


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r236174 - Introduce a NullLog class, which ignores all messages.

2015-04-29 Thread Jason Molenda

> On Apr 29, 2015, at 7:23 PM, Zachary Turner  wrote:
> 
> What do you think about Enrico's suggestion? If there's a way to make this 
> useful for everyone it's certainly better than me doing my own thing in 
> ProcessWindows, but when i look at my code decorated with log statements 
> using the existing paradigm, it's significantly harder to read than using the 
> NullLog paradigm, so i guess i will still move it to ProcessWindows if that's 
> the only way.
> 


My two cents, I agree with Jim on this, I'd prefer we maintain the current form 
of logging throughout the codebase.

In the unwinder, I wanted to have a consistent format style for all my logging 
-- in RegisterContextLLDB all of the logging calls UnwindLogMsg() 
unconditionally.  In that method I check if logging is enabled and add the 
standard formatting before the msg.

J
___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r236169 - Update to build sysv-arm/sysv-arm64/sblanguageinfo/registercontextlinux_arm64.

2015-04-29 Thread Jason Molenda
Author: jmolenda
Date: Wed Apr 29 17:16:19 2015
New Revision: 236169

URL: http://llvm.org/viewvc/llvm-project?rev=236169&view=rev
Log:
Update to build sysv-arm/sysv-arm64/sblanguageinfo/registercontextlinux_arm64.

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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=236169&r1=236168&r2=236169&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Apr 29 17:16:19 2015
@@ -887,6 +887,13 @@
AF1F7B07189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF1F7B05189C904B0087DB9C /* 
AppleGetPendingItemsHandler.cpp */; };
AF1F7B08189C904B0087DB9C /* AppleGetPendingItemsHandler.h in 
Headers */ = {isa = PBXBuildFile; fileRef = AF1F7B06189C904B0087DB9C /* 
AppleGetPendingItemsHandler.h */; };
AF1FA88A1A60A69500272AFC /* RegisterNumber.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF1FA8891A60A69500272AFC /* RegisterNumber.cpp 
*/; };
+   AF20F7661AF18F8500751A6E /* ABISysV_arm.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF20F7641AF18F8500751A6E /* ABISysV_arm.cpp */; 
};
+   AF20F7671AF18F8500751A6E /* ABISysV_arm.h in Headers */ = {isa 
= PBXBuildFile; fileRef = AF20F7651AF18F8500751A6E /* ABISysV_arm.h */; };
+   AF20F76A1AF18F9000751A6E /* ABISysV_arm64.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF20F7681AF18F9000751A6E /* ABISysV_arm64.cpp 
*/; };
+   AF20F76B1AF18F9000751A6E /* ABISysV_arm64.h in Headers */ = 
{isa = PBXBuildFile; fileRef = AF20F7691AF18F9000751A6E /* ABISysV_arm64.h */; 
};
+   AF20F76D1AF18FC700751A6E /* SBLanguageRuntime.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = AF20F76C1AF18FC700751A6E /* 
SBLanguageRuntime.cpp */; };
+   AF20F7701AF1902900751A6E /* RegisterContextLinux_arm64.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF20F76E1AF1902900751A6E /* 
RegisterContextLinux_arm64.cpp */; };
+   AF20F7711AF1902900751A6E /* RegisterContextLinux_arm64.h in 
Headers */ = {isa = PBXBuildFile; fileRef = AF20F76F1AF1902900751A6E /* 
RegisterContextLinux_arm64.h */; };
AF23B4DB19009C66003E2A58 /* FreeBSDSignals.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF23B4D919009C66003E2A58 /* FreeBSDSignals.cpp 
*/; };
AF254E31170CCC33007AE5C9 /* PlatformDarwinKernel.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF254E2F170CCC33007AE5C9 /* 
PlatformDarwinKernel.cpp */; };
AF254E32170CCC33007AE5C9 /* PlatformDarwinKernel.h in Headers 
*/ = {isa = PBXBuildFile; fileRef = AF254E30170CCC33007AE5C9 /* 
PlatformDarwinKernel.h */; };
@@ -2643,6 +2650,13 @@
AF1F7B05189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp */ 
= {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; path = AppleGetPendingItemsHandler.cpp; sourceTree = 
""; };
AF1F7B06189C904B0087DB9C /* AppleGetPendingItemsHandler.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
path = AppleGetPendingItemsHandler.h; sourceTree = ""; };
AF1FA8891A60A69500272AFC /* RegisterNumber.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = RegisterNumber.cpp; path = source/Utility/RegisterNumber.cpp; sourceTree 
= ""; };
+   AF20F7641AF18F8500751A6E /* ABISysV_arm.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = ABISysV_arm.cpp; path = "SysV-arm/ABISysV_arm.cpp"; sourceTree = 
""; };
+   AF20F7651AF18F8500751A6E /* ABISysV_arm.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
ABISysV_arm.h; path = "SysV-arm/ABISysV_arm.h"; sourceTree = ""; };
+   AF20F7681AF18F9000751A6E /* ABISysV_arm64.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = ABISysV_arm64.cpp; path = "SysV-arm64/ABISysV_arm64.cpp"; sourceTree = 
""; };
+   AF20F7691AF18F9000751A6E /* ABISysV_arm64.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
ABISysV_arm64.h; path = "SysV-arm64/ABISysV_arm64.h"; sourceTree = ""; };
+   AF20F76C1AF18FC700751A6E /* SBLanguageRuntime.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = SBLanguageRuntime.cpp; path = source/API/SBLanguageRuntime.cpp; 
sourceTree = ""; };
+   AF20F76E1AF1902900751A6E /* RegisterContextLinux_arm64.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = RegisterContextLinux_arm6

[Lldb-commits] [lldb] r236170 - Don't force a vendor check in ProcessMachCore::CanDebug() -- if this

2015-04-29 Thread Jason Molenda
Author: jmolenda
Date: Wed Apr 29 17:17:45 2015
New Revision: 236170

URL: http://llvm.org/viewvc/llvm-project?rev=236170&view=rev
Log:
Don't force a vendor check in ProcessMachCore::CanDebug() -- if this
is a Mach-O file and it is a Mach-O core file, activate the 
ProcessMachCore plugin.
 

Modified:
lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp

Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=236170&r1=236169&r2=236170&view=diff
==
--- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Wed Apr 29 
17:17:45 2015
@@ -110,13 +110,9 @@ ProcessMachCore::CanDebug(Target &target
 
 if (m_core_module_sp)
 {
-const llvm::Triple &triple_ref = 
m_core_module_sp->GetArchitecture().GetTriple();
-if (triple_ref.getVendor() == llvm::Triple::Apple)
-{
-ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
-if (core_objfile && core_objfile->GetType() == 
ObjectFile::eTypeCoreFile)
-return true;
-}
+ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
+if (core_objfile && core_objfile->GetType() == 
ObjectFile::eTypeCoreFile)
+return true;
 }
 }
 return false;


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r232619 - Initial Assembly profiler for mips64

2015-04-23 Thread Jason Molenda
Yeah, I see the problem with my change.

I'll need to look at this more closely.  We may need to add something to the 
arm insn emulation that doesn't flag mov rN,rN as doing anything.  I need to go 
read the manual and make sure that's the case.

Thanks.  I'll check with you before modifying anything here.


> On Apr 23, 2015, at 4:40 AM, Bhushan Attarde  
> wrote:
> 
> Hi Jason,
> 
> The change you have suggested will cause problems for MIPS.
> 
> Consider below function for example,
> 
> 00012ca0 :
>   12ca0:  67bdffc0daddiu  sp,sp,-64
>   12ca4:  ffbf0038sd  ra,56(sp)
>   12ca8:  ffbe0030sd  s8,48(sp)
>   12cac:  ffbc0028sd  gp,40(sp)
>   12cb0:  03a0f02dmoves8,sp
>   12cb4:  3c1c0002lui gp,0x2
>   12cb8:  0399e02ddaddu   gp,gp,t9
>   12cbc:  679c83a0daddiu  gp,gp,-31840
> [...]
>   12d08:  03c0e82dmovesp,s8
>   12d0c:  dfbf0038ld  ra,56(sp)   //offset from start of 
> function ->108
>   12d10:  dfbe0030ld  s8,48(sp)   //offset from start of 
> function ->112
>   12d14:  dfbc0028ld  gp,40(sp)   //offset from start of 
> function ->116
>   12d18:  67bd0040daddiu  sp,sp,64//offset from start of function 
> ->120
>   12d1c:  03e8jr  ra  //offset from start of 
> function ->124
>   12d20:  nop
> 
> With the current implementation, the unwinder gives following unwind info for 
> the function:
> 
> (lldb) target modules show-unwind -n bar
> 
> row[0]:0: CFA=sp +0 => pc=ra
> row[1]:4: CFA=sp+64 => pc=ra
> row[2]:8: CFA=sp+64 => ra=[CFA-8] pc=[CFA-8]
> row[3]:   12: CFA=sp+64 => fp=[CFA-16] ra=[CFA-8] pc=[CFA-8]
> row[4]:  112: CFA=sp+64 => fp=[CFA-16] ra=ra pc=ra
> row[5]:  116: CFA=sp+64 => fp=fp ra=ra pc=ra
> row[6]:  124: CFA=sp +0 => fp=fp ra=ra pc=ra
> 
> After your change is applied, the unwinder gives following output:
> 
> (lldb) target modules show-unwind -n bar
> 
> row[0]:0: CFA=sp +0 => pc=ra
> row[1]:4: CFA=sp+64 => pc=ra
> row[2]:8: CFA=sp+64 => ra=[CFA-8] pc=[CFA-8]
> row[3]:   12: CFA=sp+64 => fp=[CFA-16] ra=[CFA-8] pc=[CFA-8]
> row[4]:  124: CFA=sp +0 => fp=[CFA-16] ra=[CFA-8] pc=[CFA-8]
> 
> Note the registers restore happening in epilogue (at 12d0c and at 
> 12d10) is not getting reflected in unwind rules.
> So the rows for offsets 112 and 116 are not getting emitted.
> 
> In my patch, It seems that I have misunderstood the meaning of 
> EmulateInstruction::eContextRegisterLoad.
> As you stated it means "a register saved into another register", however I 
> have used it for "a register is restored/loaded from stack in epilogue".
> 
> If this is causing problems for other targets like ARM then can we add a new 
> ContextType say 'eContextRegisterRestore' and then
> - move code from eContextRegisterLoad into eContextRegisterRestore in 
> UnwindAssemblyInstEmulation::WriteRegister(). and
> - leave eContextRegisterLoad unimplemented (as it was before my patch).
> 
> []
>case EmulateInstruction::eContextRegisterLoad:
>break;
>case EmulateInstruction::eContextRegisterRestore:
>{
>const uint32_t unwind_reg_kind = 
> m_unwind_plan_ptr->GetRegisterKind();
>const uint32_t reg_num = reg_info->kinds[unwind_reg_kind];
>if (reg_num != LLDB_INVALID_REGNUM)
>{
>m_curr_row->SetRegisterLocationToRegister (reg_num, reg_num, 
> must_replace);
>m_curr_row_modified = true;
>m_curr_insn_restored_a_register = true;
> 
>if (reg_info->kinds[eRegisterKindGeneric] == 
> LLDB_REGNUM_GENERIC_RA)
>{
>// This load was restoring the return address register,
>// so this is also how we will unwind the PC...
>RegisterInfo pc_reg_info;
>if (instruction->GetRegisterInfo (eRegisterKindGeneric, 
> LLDB_REGNUM_GENERIC_PC, pc_reg_info))
>{
>uint32_t pc_reg_num = 
> pc_reg_info.kinds[unwind_reg_kind];
>    if (pc_reg_num != LLDB_INVALID_REGNUM)
>{
>m_curr_row->SetRegisterLocationToRegister 
> (pc_reg_num, reg_num, must_replace);
>m_curr_row_modified = true;
>}
>}
>}
>}
> 

Re: [Lldb-commits] [lldb] r232619 - Initial Assembly profiler for mips64

2015-04-22 Thread Jason Molenda
Hi, a small followup to this patch.  I noticed that our arm UnwindProfiles are 
having problems recently and tracked it down to the change in 
UnwindAssemblyInstEmulation.  The patch adds code to 
UnwindAssemblyInstEmulation which recognizes 
EmulateInstruction::eContextRegisterLoad -- a register saved into another 
register.

The problem is when we save the caller's register value on the stack and then 
*reuse* that register for something else.  For instance, an armv7 code sequence 
like

0x286b38 <+0>:   push   {r4, r5, r6, r7, lr}
0x286b3a <+2>:   addr7, sp, #0xc
[...]
0x286b52 <+26>:  blx0xa334bc  ; symbol stub for: 
objc_msgSend
0x286b56 <+30>:  movr7, r7

r7 is being used for a frame pointer in this code.  We save the caller's frame 
pointer on the stack in the first instruction.  Then at <+30>, we do a 
register-to-register mov of r7.  The instruction emulation should recognize the 
initial save but then any changes to r7 should be ignored for the rest of the 
function.

(I don't know what 'mov r7,r7' accomplishes in arm - that looks like a no-op to 
me but maybe it has some behavior that I don't recognize; I'm not an arm expert)

I *can* work around this with a patch like (I omitted the indentation of the 
block of code so the patch is easier to read).  When we've got a "THIS register 
was saved into ..." instruction, we only update the unwind rule for THIS if it 
hasn't already been saved.

Index: 
source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
===
--- source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp 
(revision 235572)
+++ source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp 
(working copy)
@@ -639,6 +639,10 @@
 const uint32_t reg_num = reg_info->kinds[unwind_reg_kind];
 if (reg_num != LLDB_INVALID_REGNUM)
 {
+UnwindPlan::Row::RegisterLocation current_reg_unwind;
+if (m_curr_row->GetRegisterInfo (reg_num, 
current_reg_unwind) == false
+|| current_reg_unwind.IsSame() == true)
+{
 m_curr_row->SetRegisterLocationToRegister (reg_num, 
reg_num, must_replace);
 m_curr_row_modified = true;
 m_curr_insn_restored_a_register = true;
@@ -658,6 +662,7 @@
 }
 }
 }
+}
 }
 }
 break;


Can you try this on your mips architecture and see if it causes problems?

fwiw I have to do something like this with the x86 instruction unwinder too.  
Once a register is saved, I ignore any "saves" of that register for the rest of 
the function.

J

> On Mar 18, 2015, at 2:21 AM, Bhushan D. Attarde  
> wrote:
> 
> Author: bhushan.attarde
> Date: Wed Mar 18 04:21:29 2015
> New Revision: 232619
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=232619&view=rev
> Log:
> Initial Assembly profiler for mips64
> 
> Summary:
> This is initial implementation of assembly profiler which only scans 
> prologue/epilogue assembly instructions to create CFI instructions.
> 
> Reviewers: clayborg, jasonmolenda
> 
> Differential Revision: http://reviews.llvm.org/D7696

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r235218 - Whitespace-only tweaks to Colin's r235109 patch to match the lldb

2015-04-17 Thread Jason Molenda
Author: jmolenda
Date: Fri Apr 17 14:15:02 2015
New Revision: 235218

URL: http://llvm.org/viewvc/llvm-project?rev=235218&view=rev
Log:
Whitespace-only tweaks to Colin's r235109 patch to match the lldb
coding style a little more closely.

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=235218&r1=235217&r2=235218&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Fri Apr 
17 14:15:02 2015
@@ -3442,9 +3442,11 @@ namespace {
 typedef std::vector stringVec;
 typedef std::vector xmlNodePtrVec;
 
-struct GdbServerRegisterInfo {
+struct GdbServerRegisterInfo
+{
 
-struct {
+struct
+{
 bool m_has_name : 1;
 bool m_has_bitSize  : 1;
 bool m_has_type : 1;
@@ -3458,7 +3460,8 @@ struct GdbServerRegisterInfo {
 uint32_tm_bitSize;
 uint32_tm_regNum;
 
-enum RegType {
+enum RegType
+{
 eUnknown   ,
 eCodePtr   ,
 eDataPtr   ,
@@ -3467,25 +3470,28 @@ struct GdbServerRegisterInfo {
 }
 m_type;
 
-void clear(  ) {
-memset( &m_flags, 0, sizeof( m_flags ) );
+void clear()
+{
+memset(&m_flags, 0, sizeof(m_flags));
 }
 };
 
 typedef std::vector GDBServerRegisterVec;
 
-struct GdbServerTargetInfo {
-
+struct GdbServerTargetInfo
+{
 std::string m_arch;
 std::string m_osabi;
 };
 
 // conversion table between gdb register type and enum
-struct {
+struct
+{
 const char * m_name;
 GdbServerRegisterInfo::RegType m_type;
 }
-RegTypeTable[] = {
+RegTypeTable[] =
+{
 { "int32"   , GdbServerRegisterInfo::eInt32},
 { "int" , GdbServerRegisterInfo::eInt32},
 { "data_ptr", GdbServerRegisterInfo::eDataPtr  },
@@ -3497,7 +3503,8 @@ RegTypeTable[] = {
 // find the first sibling with a matching name
 xmlNodePtr
 xmlExFindSibling (xmlNodePtr node,
-  const std::string & name) {
+  const std::string & name)
+{
 
 if ( !node ) return nullptr;
 // iterate through all siblings
@@ -3517,19 +3524,22 @@ xmlExFindSibling (xmlNodePtr node,
 // find an element from a given element path
 xmlNodePtr
 xmlExFindElement (xmlNodePtr node,
-  const stringVec & path) {
+  const stringVec & path)
+{
 
-if ( !node ) return nullptr;
+if (!node)
+return nullptr;
 xmlNodePtr temp = node;
 // iterate all elements in path
-for ( uint32_t i = 0; i < path.size( ); i++ ) {
+for (uint32_t i = 0; i < path.size(); i++)
+{
 
 // search for a sibling with this name
-temp = xmlExFindSibling( temp, path[i] );
-if ( !temp )
+temp = xmlExFindSibling(temp, path[i]);
+if (!temp)
 return nullptr;
 // enter this node if we still need to search
-if ( (i+1) < path.size() )
+if ((i + 1) < path.size())
 // enter the node we have found
 temp = temp->children;
 }
@@ -3539,18 +3549,21 @@ xmlExFindElement (xmlNodePtr node,
 
 // locate a specific attribute in an element
 xmlAttr *
-xmlExFindAttribute (xmlNodePtr node, 
-const std::string & name) {
+xmlExFindAttribute (xmlNodePtr node,
+const std::string & name)
+{
 
-if ( !node )
+if (!node)
 return nullptr;
-if ( node->type != XML_ELEMENT_NODE )
+if (node->type != XML_ELEMENT_NODE)
 return nullptr;
 // iterate over all attributes
-for ( xmlAttrPtr attr = node->properties; attr != nullptr; attr=attr->next 
) {
+for (xmlAttrPtr attr = node->properties; attr != nullptr; attr=attr->next)
+{
 // check if name matches
-if ( !attr->name ) continue;
-if ( std::strcmp( (const char*)attr->name, name.c_str( ) ) == 0 )
+if (!attr->name)
+continue;
+if (std::strcmp((const char*) attr->name, name.c_str()) == 0)
 return attr;
 }
 return nullptr;
@@ -3563,19 +3576,24 @@ xmlExFindAttribute (xmlNodePtr node,
 // output:  out  = list of matches
 // return:  number of children added to 'out'
 int
-xmlExFindChildren (xmlNodePtr node, 
-   const std::string & name, 
-   xmlNodePtrVec & out) {
+xmlExFindChildren (xmlNodePtr node,
+   const std::string & name,
+   xmlNodePtrVec & out)
+{
 
-if ( !node ) return 0;
+if (!node)
+return 0;
 int count = 0;
 // iterate over all children
-for ( xmlNodePtr child = node->children; child; child = child->next ) {
+for (xmlNodePtr child = node->children; child; child = child->next)
+{
 

[Lldb-commits] [lldb] r235158 - Add a "force_kill" arg to Process::Destroy(). This is needed after

2015-04-16 Thread Jason Molenda
Author: jmolenda
Date: Fri Apr 17 00:01:58 2015
New Revision: 235158

URL: http://llvm.org/viewvc/llvm-project?rev=235158&view=rev
Log:
Add a "force_kill" arg to Process::Destroy().  This is needed after
the changes in r233255/r233258.  Normally if lldb attaches to
a running process, when we call Process::Destroy, we want to detach
from the process.  If lldb launched the process itself, ::Destroy
should kill it.

However, if we attach to a process and the driver calls SBProcess::Kill()
(which calls Destroy), we need to kill it even if we didn't launch it
originally.

The force_kill param allows for the SBProcess::Kill method to force the
behavior of Destroy.

 


Modified:
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/source/API/SBProcess.cpp
lldb/trunk/source/Commands/CommandObjectProcess.cpp
lldb/trunk/source/Core/IOHandler.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=235158&r1=235157&r2=235158&view=diff
==
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Fri Apr 17 00:01:58 2015
@@ -1343,11 +1343,19 @@ public:
 /// This function is not meant to be overridden by Process
 /// subclasses.
 ///
+/// @param[in] force_kill
+/// Whether lldb should force a kill (instead of a detach) from
+/// the inferior process.  Normally if lldb launched a binary and
+/// Destory is called, lldb kills it.  If lldb attached to a 
+/// running process and Destory is called, lldb detaches.  If 
+/// this behavior needs to be over-ridden, this is the bool that
+/// can be used.
+///
 /// @return
 /// Returns an error object.
 //--
 Error
-Destroy();
+Destroy(bool force_kill);
 
 //--
 /// Sends a process a UNIX signal \a signal.

Modified: lldb/trunk/source/API/SBProcess.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBProcess.cpp?rev=235158&r1=235157&r2=235158&view=diff
==
--- lldb/trunk/source/API/SBProcess.cpp (original)
+++ lldb/trunk/source/API/SBProcess.cpp Fri Apr 17 00:01:58 2015
@@ -768,7 +768,7 @@ SBProcess::Destroy ()
 if (process_sp)
 {
 Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
-sb_error.SetError(process_sp->Destroy());
+sb_error.SetError(process_sp->Destroy(false));
 }
 else
 sb_error.SetErrorString ("SBProcess is invalid");
@@ -821,7 +821,7 @@ SBProcess::Kill ()
 if (process_sp)
 {
 Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
-sb_error.SetError (process_sp->Destroy());
+sb_error.SetError (process_sp->Destroy(true));
 }
 else
 sb_error.SetErrorString ("SBProcess is invalid");

Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=235158&r1=235157&r2=235158&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Fri Apr 17 00:01:58 2015
@@ -93,7 +93,7 @@ protected:
 }
 else
 {
-Error destroy_error (process->Destroy());
+Error destroy_error (process->Destroy(false));
 if (destroy_error.Success())
 {
 result.SetStatus 
(eReturnStatusSuccessFinishResult);
@@ -1466,7 +1466,7 @@ protected:
 
 if (command.GetArgumentCount() == 0)
 {
-Error error (process->Destroy());
+Error error (process->Destroy(false));
 if (error.Success())
 {
 result.SetStatus (eReturnStatusSuccessFinishResult);

Modified: lldb/trunk/source/Core/IOHandler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/IOHandler.cpp?rev=235158&r1=235157&r2=235158&view=diff
==
--- lldb/trunk/source/Core/IOHandler.cpp (original)
+++ lldb/trunk/source/Core/IOHandler.cpp Fri Apr 17 00:01:58 2015
@@ -4433,7 +4433,7 @@ public:
 {
 Process *process = exe_ctx.GetProcessPtr();
 if (process && process->IsAlive())
-pro

[Lldb-commits] [lldb] r234945 - Remove unneeded include.

2015-04-14 Thread Jason Molenda
Author: jmolenda
Date: Tue Apr 14 16:34:51 2015
New Revision: 234945

URL: http://llvm.org/viewvc/llvm-project?rev=234945&view=rev
Log:
Remove unneeded include.

Modified:
lldb/trunk/source/Core/Error.cpp

Modified: lldb/trunk/source/Core/Error.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Error.cpp?rev=234945&r1=234944&r2=234945&view=diff
==
--- lldb/trunk/source/Core/Error.cpp (original)
+++ lldb/trunk/source/Core/Error.cpp Tue Apr 14 16:34:51 2015
@@ -21,10 +21,6 @@
 #include 
 #include 
 
-#if (defined (__arm__) || defined (__arm64__) || defined (__aarch64__)) && 
defined (__APPLE__)
-#include 
-#endif
-
 using namespace lldb;
 using namespace lldb_private;
 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r233886 - Add a tiny bit of hardening to the eh_frame and compact unwind parsing.

2015-04-01 Thread Jason Molenda
Author: jmolenda
Date: Wed Apr  1 23:35:32 2015
New Revision: 233886

URL: http://llvm.org/viewvc/llvm-project?rev=233886&view=rev
Log:
Add a tiny bit of hardening to the eh_frame and compact unwind parsing.
When we're seeing offsets that exceed the size of our section, don't 
try to use that unwind info.
 

Modified:
lldb/trunk/source/Symbol/CompactUnwindInfo.cpp
lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp

Modified: lldb/trunk/source/Symbol/CompactUnwindInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompactUnwindInfo.cpp?rev=233886&r1=233885&r2=233886&view=diff
==
--- lldb/trunk/source/Symbol/CompactUnwindInfo.cpp (original)
+++ lldb/trunk/source/Symbol/CompactUnwindInfo.cpp Wed Apr  1 23:35:32 2015
@@ -283,9 +283,17 @@ CompactUnwindInfo::ScanIndex (const Proc
 
 uint32_t indexCount = m_unwindinfo_data.GetU32(&offset);
 
-if (m_unwind_header.version != 1)
+if (m_unwind_header.common_encodings_array_offset > 
m_unwindinfo_data.GetByteSize()
+|| m_unwind_header.personality_array_offset > 
m_unwindinfo_data.GetByteSize()
+|| indexSectionOffset > m_unwindinfo_data.GetByteSize()
+|| offset > m_unwindinfo_data.GetByteSize())
 {
+Host::SystemLog (Host::eSystemLogError,
+"error: Invalid offset encountered in compact unwind info, 
skipping\n");
+// don't trust anything from this compact_unwind section if it 
looks
+// blatently invalid data in the header.
 m_indexes_computed = eLazyBoolNo;
+return;
 }
 
 // Parse the basic information from the indexes

Modified: lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp?rev=233886&r1=233885&r2=233886&view=diff
==
--- lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp (original)
+++ lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp Wed Apr  1 23:35:32 2015
@@ -365,6 +365,31 @@ DWARFCallFrameInfo::GetFDEIndex ()
 cie_offset = current_entry + 4 - cie_id;
 }
 
+if (next_entry > m_cfi_data.GetByteSize() + 1)
+{
+Host::SystemLog (Host::eSystemLogError,
+"error: Invalid fde/cie next entry offset of 0x%x found in 
cie/fde at 0x%x\n",
+next_entry,
+current_entry);
+// Don't trust anything in this eh_frame section if we find 
blatently 
+// invalid data.
+m_fde_index.Clear();
+m_fde_index_initialized = true;
+return;
+}
+if (cie_offset > m_cfi_data.GetByteSize())
+{
+Host::SystemLog (Host::eSystemLogError,
+"error: Invalid cie offset of 0x%x found in cie/fde at 
0x%x\n",
+cie_offset,
+current_entry);
+// Don't trust anything in this eh_frame section if we find 
blatently 
+// invalid data.
+m_fde_index.Clear();
+m_fde_index_initialized = true;
+return;
+}
+
 if (cie_id == 0 || cie_id == UINT32_MAX || len == 0)
 {
 m_cie_map[current_entry] = ParseCIE (current_entry);


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r233167 - Update xcode project file for addition/removals in r233083 and r233114.

2015-03-24 Thread Jason Molenda
No worries, I know not everyone is using xcode.  We often forget cmakefile 
updates ourselves. :)

J

> On Mar 24, 2015, at 9:07 PM, Ilia K  wrote:
> 
> Thx! I forgot to do that.
> 
> Thanks,
> Ilia
> 
> On Mar 25, 2015 6:29 AM, "Jason Molenda"  wrote:
> Author: jmolenda
> Date: Tue Mar 24 22:26:02 2015
> New Revision: 233167
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=233167&view=rev
> Log:
> Update xcode project file for addition/removals in r233083 and r233114.
> 
> Modified:
> lldb/trunk/lldb.xcodeproj/project.pbxproj
> 
> Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=233167&r1=233166&r2=233167&view=diff
> ==
> --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
> +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Mar 24 22:26:02 2015
> @@ -241,7 +241,6 @@
> 26680336116005EF008E1FE4 /* SBBreakpointLocation.cpp in 
> Sources */ = {isa = PBXBuildFile; fileRef = 9AF16CC7114086A1007A7B3F /* 
> SBBreakpointLocation.cpp */; };
> 26680337116005F1008E1FE4 /* SBBreakpoint.cpp in Sources */ = 
> {isa = PBXBuildFile; fileRef = 9AF16A9C11402D5B007A7B3F /* SBBreakpoint.cpp 
> */; };
> 2668035C11601108008E1FE4 /* LLDB.framework in Frameworks */ = 
> {isa = PBXBuildFile; fileRef = 26680207115FD0ED008E1FE4 /* LLDB.framework */; 
> };
> -   266941FE1A6DC2AC0063BE93 /* Driver.cpp in Sources */ = {isa = 
> PBXBuildFile; fileRef = 2669415C1A6DC2AB0063BE93 /* Driver.cpp */; };
> 266942001A6DC2AC0063BE93 /* MICmdArgContext.cpp in Sources */ 
> = {isa = PBXBuildFile; fileRef = 266941601A6DC2AB0063BE93 /* 
> MICmdArgContext.cpp */; };
> 266942011A6DC2AC0063BE93 /* MICmdArgSet.cpp in Sources */ = 
> {isa = PBXBuildFile; fileRef = 266941621A6DC2AB0063BE93 /* MICmdArgSet.cpp 
> */; };
> 266942021A6DC2AC0063BE93 /* MICmdArgValBase.cpp in Sources */ 
> = {isa = PBXBuildFile; fileRef = 266941641A6DC2AB0063BE93 /* 
> MICmdArgValBase.cpp */; };
> @@ -313,7 +312,6 @@
> 266942461A6DC2AC0063BE93 /* MIUtilSystemLinux.cpp in Sources 
> */ = {isa = PBXBuildFile; fileRef = 266941F01A6DC2AC0063BE93 /* 
> MIUtilSystemLinux.cpp */; };
> 266942471A6DC2AC0063BE93 /* MIUtilSystemOsx.cpp in Sources */ 
> = {isa = PBXBuildFile; fileRef = 266941F21A6DC2AC0063BE93 /* 
> MIUtilSystemOsx.cpp */; };
> 266942481A6DC2AC0063BE93 /* MIUtilSystemWindows.cpp in 
> Sources */ = {isa = PBXBuildFile; fileRef = 266941F41A6DC2AC0063BE93 /* 
> MIUtilSystemWindows.cpp */; };
> -   266942491A6DC2AC0063BE93 /* MIUtilTermios.cpp in Sources */ = 
> {isa = PBXBuildFile; fileRef = 266941F61A6DC2AC0063BE93 /* MIUtilTermios.cpp 
> */; };
> 2669424A1A6DC2AC0063BE93 /* MIUtilThreadBaseStd.cpp in 
> Sources */ = {isa = PBXBuildFile; fileRef = 266941F81A6DC2AC0063BE93 /* 
> MIUtilThreadBaseStd.cpp */; };
> 2669424B1A6DC2AC0063BE93 /* MIUtilVariant.cpp in Sources */ = 
> {isa = PBXBuildFile; fileRef = 266941FA1A6DC2AC0063BE93 /* MIUtilVariant.cpp 
> */; };
> 2669424C1A6DC2AC0063BE93 /* Platform.cpp in Sources */ = {isa 
> = PBXBuildFile; fileRef = 266941FC1A6DC2AC0063BE93 /* Platform.cpp */; };
> @@ -909,11 +907,11 @@
> AF9107EF168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp 
> in Sources */ = {isa = PBXBuildFile; fileRef = AF9107EC168570D200DBCD3C /* 
> RegisterContextDarwin_arm64.cpp */; };
> AF9B8F33182DB52900DA866F /* SystemRuntimeMacOSX.cpp in 
> Sources */ = {isa = PBXBuildFile; fileRef = AF9B8F31182DB52900DA866F /* 
> SystemRuntimeMacOSX.cpp */; };
> AF9B8F34182DB52900DA866F /* SystemRuntimeMacOSX.h in Headers 
> */ = {isa = PBXBuildFile; fileRef = AF9B8F32182DB52900DA866F /* 
> SystemRuntimeMacOSX.h */; };
> +   AFB3D2801AC262AB003B4B30 /* MICmdCmdGdbShow.cpp in Sources */ 
> = {isa = PBXBuildFile; fileRef = AFB3D27E1AC262AB003B4B30 /* 
> MICmdCmdGdbShow.cpp */; };
> AFDCDBCB19DD0F42005EA55E /* SBExecutionContext.h in Headers 
> */ = {isa = PBXBuildFile; fileRef = 940B02F419DC96CB00AD0F52 /* 
> SBExecutionContext.h */; settings = {ATTRIBUTES = (Public, ); }; };
> AFDFDFD119E34D3400EAE509 /* ConnectionFileDescriptorPosix.cpp 
> in Sources */ = {isa = PBXBuildFile; fileRef = AFDFDFD019E34D3400EAE509 /* 
> ConnectionFileDescriptorPosix.cpp */; };
> AFEC3362194A8ABA00FF05C6 /* StructuredData.cpp in Sources */ 
> = {isa = PBXBuildFile; fileRef = AFEC3361194A8ABA00FF05C6 /* 

[Lldb-commits] [lldb] r233167 - Update xcode project file for addition/removals in r233083 and r233114.

2015-03-24 Thread Jason Molenda
Author: jmolenda
Date: Tue Mar 24 22:26:02 2015
New Revision: 233167

URL: http://llvm.org/viewvc/llvm-project?rev=233167&view=rev
Log:
Update xcode project file for addition/removals in r233083 and r233114.

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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=233167&r1=233166&r2=233167&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Mar 24 22:26:02 2015
@@ -241,7 +241,6 @@
26680336116005EF008E1FE4 /* SBBreakpointLocation.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 9AF16CC7114086A1007A7B3F /* 
SBBreakpointLocation.cpp */; };
26680337116005F1008E1FE4 /* SBBreakpoint.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 9AF16A9C11402D5B007A7B3F /* SBBreakpoint.cpp */; 
};
2668035C11601108008E1FE4 /* LLDB.framework in Frameworks */ = 
{isa = PBXBuildFile; fileRef = 26680207115FD0ED008E1FE4 /* LLDB.framework */; };
-   266941FE1A6DC2AC0063BE93 /* Driver.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 2669415C1A6DC2AB0063BE93 /* Driver.cpp */; };
266942001A6DC2AC0063BE93 /* MICmdArgContext.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941601A6DC2AB0063BE93 /* MICmdArgContext.cpp 
*/; };
266942011A6DC2AC0063BE93 /* MICmdArgSet.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941621A6DC2AB0063BE93 /* MICmdArgSet.cpp */; 
};
266942021A6DC2AC0063BE93 /* MICmdArgValBase.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941641A6DC2AB0063BE93 /* MICmdArgValBase.cpp 
*/; };
@@ -313,7 +312,6 @@
266942461A6DC2AC0063BE93 /* MIUtilSystemLinux.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 266941F01A6DC2AC0063BE93 /* 
MIUtilSystemLinux.cpp */; };
266942471A6DC2AC0063BE93 /* MIUtilSystemOsx.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941F21A6DC2AC0063BE93 /* MIUtilSystemOsx.cpp 
*/; };
266942481A6DC2AC0063BE93 /* MIUtilSystemWindows.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 266941F41A6DC2AC0063BE93 /* 
MIUtilSystemWindows.cpp */; };
-   266942491A6DC2AC0063BE93 /* MIUtilTermios.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941F61A6DC2AC0063BE93 /* MIUtilTermios.cpp 
*/; };
2669424A1A6DC2AC0063BE93 /* MIUtilThreadBaseStd.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 266941F81A6DC2AC0063BE93 /* 
MIUtilThreadBaseStd.cpp */; };
2669424B1A6DC2AC0063BE93 /* MIUtilVariant.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941FA1A6DC2AC0063BE93 /* MIUtilVariant.cpp 
*/; };
2669424C1A6DC2AC0063BE93 /* Platform.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 266941FC1A6DC2AC0063BE93 /* Platform.cpp */; };
@@ -909,11 +907,11 @@
AF9107EF168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF9107EC168570D200DBCD3C /* 
RegisterContextDarwin_arm64.cpp */; };
AF9B8F33182DB52900DA866F /* SystemRuntimeMacOSX.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF9B8F31182DB52900DA866F /* 
SystemRuntimeMacOSX.cpp */; };
AF9B8F34182DB52900DA866F /* SystemRuntimeMacOSX.h in Headers */ 
= {isa = PBXBuildFile; fileRef = AF9B8F32182DB52900DA866F /* 
SystemRuntimeMacOSX.h */; };
+   AFB3D2801AC262AB003B4B30 /* MICmdCmdGdbShow.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AFB3D27E1AC262AB003B4B30 /* MICmdCmdGdbShow.cpp 
*/; };
AFDCDBCB19DD0F42005EA55E /* SBExecutionContext.h in Headers */ 
= {isa = PBXBuildFile; fileRef = 940B02F419DC96CB00AD0F52 /* 
SBExecutionContext.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFDFDFD119E34D3400EAE509 /* ConnectionFileDescriptorPosix.cpp 
in Sources */ = {isa = PBXBuildFile; fileRef = AFDFDFD019E34D3400EAE509 /* 
ConnectionFileDescriptorPosix.cpp */; };
AFEC3362194A8ABA00FF05C6 /* StructuredData.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AFEC3361194A8ABA00FF05C6 /* StructuredData.cpp 
*/; };
AFF87C87150FF669000E1742 /* com.apple.debugserver.plist in 
CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C86150FF669000E1742 /* 
com.apple.debugserver.plist */; };
-   AFF87C89150FF672000E1742 /* com.apple.debugserver-secure.plist 
in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C88150FF672000E1742 /* 
com.apple.debugserver-secure.plist */; };
AFF87C8F150FF688000E1742 /* com.apple.debugserver.applist.plist 
in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C8E150FF688000E1742 /* 
com.apple.debugserver.applist.plist */; };
B207C4931429607D00F36E4E /* CommandObjectWatchpoint.cpp in 
Sources */ = {isa = PBXBu

Re: [Lldb-commits] [PATCH] Add support for 'leal' instruction to UnwindAssembly-x86

2015-03-24 Thread Jason Molenda
Looks good, thanks for adding this, please commit.  In the comments in 
lea_rsp_pattern_p() did you mean to write '8 bit' and '32 bit' displacement?


http://reviews.llvm.org/D8583

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Use eFlagRequiresFrame instead of manually checking in CommandObjectThread.cpp.

2015-03-23 Thread Jason Molenda
Good change as long as it accomplishes the same thing as your null check 
against GetStackFrameAtIndex(0).  eFlagRequiresFrame is slightly different, 
checking that the ExecutionContext got a frame but I suppose the ECX got it 
from the same place -- GetStackFrameAtIndex(0) so it should be fine.

I wouldn't raise such a pedantic point except that lldb is clearly in an odd 
state when this code path is erroring out; normal assumptions may not be safe.


http://reviews.llvm.org/D8574

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Add a missing null pointer check in CommandObjectThread.cpp.

2015-03-23 Thread Jason Molenda
Not worth changing the patch but fwiw you could have added eFlagRequiresFrame 
to the CommandObjectParsed flags for this command to do the same thing.  My 
main reaction echoes Jim's - I don't know what it means to have a thread and no 
frame 0.  But given that two lldb devs have hit it, I guess early in the 
startup of a new platform you can get hit this.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8554

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Report stopped by trace if none of the watchpoint was hit

2015-03-17 Thread Jason Molenda
On armv7 architecture systems, there are 4 hardware breakpoint registers 
(DBGBVR) and 4 hardware watchpoint registers (DBGWVR).  The breakpoint 
registers track values in the pc register.  You can also say "stop when the PC 
is not equal to this value" which is how single instruction stepping is done on 
armv7.

On armv8 architecture systems, AArch32 or AArch64, there is a single 
instruction step bit (MDSCR_EL1, SS bit) to accomplish this more simply.  There 
are still the dual sets of hardware breakpoint and hardware watchpoint 
registers -- but the hardware breakpoint registers don't have the "stop when 
the PC is not equal to this value" capability.

The kernel should have no problem distinguishing between an MDSCR_EL1 SS bit 
stop event and a watchpoint exception (on armv8 systems).  On an armv7 system, 
it's possible to distinguish between a breakpoint and watchpoint event.  And 
exhausting the watchpoint register file won't prevent stepping from working.

fwiw, lldb today doesn't use the hardware breakpoints, except for single 
stepping on armv7 systems.  breakpoint set does have the --hardware option to 
request that the remote gdb stub use a hardware breakpoint if it has that 
capability.  But lldb doesn't do that on its own today.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8081

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r232563 - Build fix for building debugserver for ios.

2015-03-17 Thread Jason Molenda
Author: jmolenda
Date: Tue Mar 17 18:16:42 2015
New Revision: 232563

URL: http://llvm.org/viewvc/llvm-project?rev=232563&view=rev
Log:
Build fix for building debugserver for ios.

Modified:
lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h

Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp?rev=232563&r1=232562&r2=232563&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp 
(original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp Tue 
Mar 17 18:16:42 2015
@@ -1674,7 +1674,7 @@ DNBArchMachARM64::GetRegisterSetInfo(nub
 }
 
 bool
-DNBArchMachARM64::FixGenericRegisterNumber (int &set, int ®)
+DNBArchMachARM64::FixGenericRegisterNumber (uint32_t &set, uint32_t ®)
 {
 if (set == REGISTER_SET_GENERIC)
 {

Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h?rev=232563&r1=232562&r2=232563&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h 
(original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h Tue Mar 
17 18:16:42 2015
@@ -79,7 +79,7 @@ protected:
 
 
 kern_return_t   EnableHardwareSingleStep (bool enable);
-static bool FixGenericRegisterNumber (int &set, int ®);
+static bool FixGenericRegisterNumber (uint32_t &set, uint32_t 
®);
 
 typedef enum RegisterSetTag
 {


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r231885 - If the user specifies a kernel binary that isn't correct for the current

2015-03-10 Thread Jason Molenda
Author: jmolenda
Date: Tue Mar 10 18:34:52 2015
New Revision: 231885

URL: http://llvm.org/viewvc/llvm-project?rev=231885&view=rev
Log:
If the user specifies a kernel binary that isn't correct for the current
kernel debug session, instead of issuing a warning (which on one ever
sees), drop the user-specified kernel binary Module from the target and
try to discover the correct one dynamically.
 

Modified:

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=231885&r1=231884&r2=231885&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 Tue Mar 10 18:34:52 2015
@@ -724,19 +724,20 @@ DynamicLoaderDarwinKernel::KextImageInfo
 }
 if (m_uuid.IsValid())
 {
-Module* exe_module = 
process->GetTarget().GetExecutableModulePointer();
-if (exe_module && exe_module->GetUUID().IsValid())
+ModuleSP exe_module_sp = 
process->GetTarget().GetExecutableModule();
+if (exe_module_sp.get() && exe_module_sp->GetUUID().IsValid())
 {
-if (m_uuid != exe_module->GetUUID())
+if (m_uuid != exe_module_sp->GetUUID())
 {
-Stream *s = 
process->GetTarget().GetDebugger().GetOutputFile().get();
-if (s)
-{
-s->Printf ("warning: Host-side kernel file has Mach-O 
UUID of %s but remote kernel has a UUID of %s -- a mismatched kernel file will 
result in a poor debugger experience.\n", 
-   exe_module->GetUUID().GetAsString().c_str(),
-   m_uuid.GetAsString().c_str());
-s->Flush ();
-}
+// The user specified a kernel binary that has a different 
UUID than
+// the kernel actually running in memory.  This never ends 
well; 
+// clear the user specified kernel binary from the Target.
+
+m_module_sp.reset();
+
+ModuleList user_specified_kernel_list;
+user_specified_kernel_list.Append (exe_module_sp);
+process->GetTarget().GetImages().Remove 
(user_specified_kernel_list);
 }
 }
 }


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Initial Assembly profiler for mips64

2015-03-10 Thread Jason Molenda
This looks good to me.  Greg?


REPOSITORY
  rL LLVM


Comment at: source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp:99
@@ +98,3 @@
+const char *
+EmulateInstructionMIPS64::GetRegisterName (unsigned reg_num, bool 
altnernate_name)
+{

s/altnernate_name/alternate_name/

http://reviews.llvm.org/D7696

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Expect stop reason watchpoint for the step over breakpoint thread plan

2015-03-05 Thread Jason Molenda
I'm no expert at this layer but you might want to have your kernel people look 
at the "ARMv8 Debug Architecture" manual from ARM, specifically section 4.2.1, 
"Effect of taking debug exception to an EL using AArch64 on system registers" 
(or the AArch32 section below that).  It should be possible for the kernel to 
distinguish between a single step with the MDSCR_EL1 SS bit and a watchpoint 
debug event.


http://reviews.llvm.org/D8081

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r231342 - Add support for the DWARFv3 (circa 2005) DW_OP_form_tls_address

2015-03-04 Thread Jason Molenda
Author: jmolenda
Date: Wed Mar  4 20:42:06 2015
New Revision: 231342

URL: http://llvm.org/viewvc/llvm-project?rev=231342&view=rev
Log:
Add support for the DWARFv3 (circa 2005) DW_OP_form_tls_address
operator in addition to the vendor-extension DW_OP_GNU_push_tls_address.
clang on PS4 and Darwin will be emitting the standard opcode 
as of r231286 via http://reviews.llvm.org/D8018

Behavior of this standard  opcode is the same as 
DW_OP_GNU_push_tls_address.



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

Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=231342&r1=231341&r2=231342&view=diff
==
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Wed Mar  4 20:42:06 2015
@@ -611,7 +611,6 @@ DWARFExpression::DumpLocation (Stream *s
 case DW_OP_call_ref:// 
0x9a DWARF3 1 4- or 8-byte offset of DIE
 s->Printf("DW_OP_call_ref(0x%8.8" PRIx64 ")", 
m_data.GetAddress(&offset));
 break;
-//  case DW_OP_form_tls_address: s << "form_tls_address"; break;// 
0x9b DWARF3
 //  case DW_OP_call_frame_cfa: s << "call_frame_cfa"; break;// 
0x9c DWARF3
 //  case DW_OP_bit_piece:   // 
0x9d DWARF3 2
 //  s->Printf("DW_OP_bit_piece(0x%x, 0x%x)", 
m_data.GetULEB128(&offset), m_data.GetULEB128(&offset));
@@ -624,6 +623,9 @@ DWARFExpression::DumpLocation (Stream *s
 //case DW_OP_APPLE_array_ref:
 //s->PutCString("DW_OP_APPLE_array_ref");
 //break;
+case DW_OP_form_tls_address:
+s->PutCString("DW_OP_form_tls_address");  // 0x9b
+break;
 case DW_OP_GNU_push_tls_address:
 s->PutCString("DW_OP_GNU_push_tls_address");  // 0xe0
 break;
@@ -2897,17 +2899,24 @@ DWARFExpression::Evaluate
 break;
 
 
//--
-// OPCODE: DW_OP_GNU_push_tls_address
+// OPCODE: DW_OP_form_tls_address (or the old pre-DWARFv3 vendor 
extension opcode, DW_OP_GNU_push_tls_address)
 // OPERANDS: none
 // DESCRIPTION: Pops a TLS offset from the stack, converts it to
-// an absolute value, and pushes it back on.
+// an address in the current thread's thread-local storage block, 
+// and pushes it on the stack.
 
//--
+case DW_OP_form_tls_address:
 case DW_OP_GNU_push_tls_address:
 {
 if (stack.size() < 1)
 {
 if (error_ptr)
-error_ptr->SetErrorString("DW_OP_GNU_push_tls_address 
needs an argument.");
+{
+if (op == DW_OP_form_tls_address)
+error_ptr->SetErrorString("DW_OP_form_tls_address 
needs an argument.");
+else
+
error_ptr->SetErrorString("DW_OP_GNU_push_tls_address needs an argument.");
+}
 return false;
 }
 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r230302 - Move the copy phases for the xpcservices bundles from the "LLDB"

2015-02-23 Thread Jason Molenda
Author: jmolenda
Date: Mon Feb 23 21:21:38 2015
New Revision: 230302

URL: http://llvm.org/viewvc/llvm-project?rev=230302&view=rev
Log:
Move the copy phases for the xpcservices bundles from the "LLDB"
target to the "desktop" target.  They aren't used for iOS builds.

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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=230302&r1=230301&r2=230302&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Feb 23 21:21:38 2015
@@ -38,6 +38,7 @@
buildConfigurationList = 26CEF3B214FD592B007286B2 /* 
Build configuration list for PBXAggregateTarget "desktop" */;
buildPhases = (
AF90106415AB7D2900FF120D /* CopyFiles */,
+   AF030DA31A9C20A2466A /* CopyFiles */,
);
dependencies = (
26CEF3B914FD5952007286B2 /* PBXTargetDependency 
*/,
@@ -875,6 +876,8 @@
AF2BCA6C18C7EFDE005B4526 /* JITLoaderGDB.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF2BCA6918C7EFDE005B4526 /* JITLoaderGDB.cpp */; 
};
AF2BCA6D18C7EFDE005B4526 /* JITLoaderGDB.h in Headers */ = {isa 
= PBXBuildFile; fileRef = AF2BCA6A18C7EFDE005B4526 /* JITLoaderGDB.h */; };
AF37E10A17C861F20061E18E /* ProcessRunLock.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF37E10917C861F20061E18E /* ProcessRunLock.cpp 
*/; };
+   AF455D571A9C231700D6C4F7 /* 
com.apple.lldb.launcherXPCService.xpc in CopyFiles */ = {isa = PBXBuildFile; 
fileRef = EDC6D49914E5C19B001B75F8 /* com.apple.lldb.launcherXPCService.xpc */; 
settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
+   AF455D581A9C231700D6C4F7 /* 
com.apple.lldb.launcherRootXPCService.xpc in CopyFiles */ = {isa = 
PBXBuildFile; fileRef = EDE274EC14EDCE1F005B0F75 /* 
com.apple.lldb.launcherRootXPCService.xpc */; settings = {ATTRIBUTES = 
(RemoveHeadersOnCopy, ); }; };
AF45FDE518A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp 
in Sources */ = {isa = PBXBuildFile; fileRef = AF45FDE318A1F3AC0007051C /* 
AppleGetThreadItemInfoHandler.cpp */; };
AF45FDE618A1F3AC0007051C /* AppleGetThreadItemInfoHandler.h in 
Headers */ = {isa = PBXBuildFile; fileRef = AF45FDE418A1F3AC0007051C /* 
AppleGetThreadItemInfoHandler.h */; };
AF77E08F1A033C700096C0EA /* ABISysV_ppc.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF77E08D1A033C700096C0EA /* ABISysV_ppc.cpp */; 
};
@@ -915,8 +918,6 @@
B2B7CCF015D1C20F00EEFB57 /* WatchpointOptions.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = B2B7CCEF15D1C20F00EEFB57 /* 
WatchpointOptions.cpp */; };
E769331C1A94D15400C73337 /* lldb-gdbserver.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26D6F3F4183E7F9300194858 /* lldb-gdbserver.cpp 
*/; };
E769331E1A94D18100C73337 /* lldb-server.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = E769331D1A94D18100C73337 /* lldb-server.cpp */; 
};
-   ED4AFF45199C2218004FFDC6 /* 
com.apple.lldb.launcherRootXPCService.xpc in CopyFiles */ = {isa = 
PBXBuildFile; fileRef = EDE274EC14EDCE1F005B0F75 /* 
com.apple.lldb.launcherRootXPCService.xpc */; settings = {ATTRIBUTES = 
(RemoveHeadersOnCopy, ); }; };
-   ED4AFF46199C2224004FFDC6 /* 
com.apple.lldb.launcherXPCService.xpc in CopyFiles */ = {isa = PBXBuildFile; 
fileRef = EDC6D49914E5C19B001B75F8 /* com.apple.lldb.launcherXPCService.xpc */; 
settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
ED88244E15114A9200BC98B9 /* Security.framework in Frameworks */ 
= {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework 
*/; };
ED88245015114CA200BC98B9 /* main.mm in Sources */ = {isa = 
PBXBuildFile; fileRef = ED88244F15114CA200BC98B9 /* main.mm */; };
ED88245115114CA200BC98B9 /* main.mm in Sources */ = {isa = 
PBXBuildFile; fileRef = ED88244F15114CA200BC98B9 /* main.mm */; };
@@ -1101,6 +1102,17 @@
);
runOnlyForDeploymentPostprocessing = 1;
};
+   AF030DA31A9C20A2466A /* CopyFiles */ = {
+   isa = PBXCopyFilesBuildPhase;
+   buildActionMask = 2147483647;
+   dstPath = "$(CONTENTS_FOLDER_PATH)/XPCServices";
+   dstSubfolderSpec = 16;
+   files = (
+   AF455D571A9C231700D6C4F7 /* 
com.apple.lldb.launcherXPCService.xpc in CopyFiles */,
+   AF455D581A9C231700D6C4F7 /* 
com.apple.lldb.launcherRootXPCService.xpc in CopyFiles */,
+  

Re: [Lldb-commits] [PATCH] Initial Assembly profiler for mips64

2015-02-21 Thread Jason Molenda
When you're talking about compiler generated code, a hand written assembly 
parser is easy.  The complication comes when the compiler changes how it 
expresses prologues -- or hand written assembly routines.

A simple example for x86_64, you can save a register to the stack with either

  push %rbx

or

  movq %rax, -0x10(%rbp)

(using at&t assembly syntax).  If your compiler only does the pushes and that's 
all you handle, your profiler will fail as soon as it sees the alternate 
instruction to do the same.

You see the assembly profilers like UnwindAssembly-x86 fall over if you don't 
think up all the instructions that might occur in prologue/epilogues.  That's 
the risk of them.

I just looked into the existing arm & arm64 emulation routines and I think I 
mis-stated what Greg suggested.  The arm instruction emulation (see 
source/Plugins/Instruction/ARM) is a full instruction emulation from the ARM 
xml instruction description files.  It could be a big undertaking.

The arm64 instruction emulation (see source/Plugins/Instruction/ARM64) is a 
hand written emulation of only a dozen different instructions - I hadn't looked 
into it in detail until now.  I think Greg would prefer that the MIPS assembly 
profiler be written in a similar style to the ARM64 instruction emulation 
routine.

The Instruction plugins are run by the 
UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp class.  This class 
uses the Instruction subclass to classify the instruction stream and it 
generates the UnwindPlan from there.

For that matter, you could argue that UnwindAssembly-x86 could be rewritten in 
the same way.

I'm less against Greg's suggestion given all of this.  It's separating the 
instruction recognition logic from the UnwindPlan creation logic and seems like 
a good direction to head in.  I haven't done this for the x86 profiler yet 
myself so I feel bad about asking someone else to jump in here.  The "full 
emulation of the entire ISA is more flexible" argument doesn't hold for 
something like the EmulateInstructionARM64 class but there is the separation of 
logic to argue in favor of it.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7696

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Support evaluation of DWARF expressions setting CFA

2015-02-21 Thread Jason Molenda
This patch looks good to me, please commit.  I don't anticipate any change in 
behavior on Mac systems.


http://reviews.llvm.org/D7792

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r230130 - If constructed llvm_build_dir doesn't exist, retry as an iphoneos path.

2015-02-20 Thread Jason Molenda
Author: jmolenda
Date: Sat Feb 21 00:13:51 2015
New Revision: 230130

URL: http://llvm.org/viewvc/llvm-project?rev=230130&view=rev
Log:
If constructed llvm_build_dir doesn't exist, retry as an iphoneos path.

Modified:
lldb/trunk/scripts/package-clang-headers.py

Modified: lldb/trunk/scripts/package-clang-headers.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/package-clang-headers.py?rev=230130&r1=230129&r2=230130&view=diff
==
--- lldb/trunk/scripts/package-clang-headers.py (original)
+++ lldb/trunk/scripts/package-clang-headers.py Sat Feb 21 00:13:51 2015
@@ -26,6 +26,9 @@ if not os.path.isdir(target_dir):
 sys.exit(1) 
 
 if not os.path.isdir(llvm_build_dir):
+llvm_build_dir = re.sub ("-macosx-", "-iphoneos-", llvm_build_dir)
+
+if not os.path.isdir(llvm_build_dir):
 print llvm_build_dir + " doesn't exist"
 sys.exit(1)
 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Initial Assembly profiler for mips64

2015-02-18 Thread Jason Molenda
OK, I see what you're thinking of.  I was looking at this from a dynamic point 
of view with an actually running process.  We need a live process for most of 
the unwinder stuff to work correctly -- you don't have any information about 
registers until you can get a RegisterContext from a Thread.  That means you 
can only run the tests on a matching architecture system.  (e.g. see the ctor 
in this patch where it gets a RegisterContext to look up registers by name).

We'd need also need to add a feature like "show me the unwind info for this 
block of bytes".  What we really need is an SB API for representing unwind 
information and an API to get the unwind information for a block of bytes.  
Otherwise our test file has to do something like parse the output of "image 
show-unwind" in some form.

Given that these unit tests could only be run on the mips64 system itself, we 
don't get anything from adding all these facilities - we could do the 
hand-written assembly approach and test behaviors with the higher level lldb 
cmds.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7696

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] FileSpec::Resolve should not turn a filename-only FileSpec into a qualified FileSpec if that file doesn't exist

2015-02-16 Thread Jason Molenda
Updated patch to include the fixes Zachary suggested, added a simple test case 
for this behavior to functionality/paths.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7477

Files:
  source/Host/common/FileSpec.cpp
  test/functionalities/paths/TestPaths.py

Index: source/Host/common/FileSpec.cpp
===
--- source/Host/common/FileSpec.cpp
+++ source/Host/common/FileSpec.cpp
@@ -164,7 +164,21 @@
 ResolveUsername(path);
 #endif // #ifdef LLDB_CONFIG_TILDE_RESOLVES_TO_USER
 
+// Save a copy of the original path that's passed in
+llvm::SmallString original_path(path.begin(), path.end());
+
 llvm::sys::fs::make_absolute(path);
+
+
+path.push_back(0);  // Be sure we have a nul terminated string
+path.pop_back();
+struct stat file_stats;
+if (::stat (path.data(), &file_stats) != 0)
+{
+path.clear();
+path.resize (original_path.size());
+memcpy (path.data(), original_path.data(), original_path.size());
+}
 }
 
 FileSpec::FileSpec() : 
Index: test/functionalities/paths/TestPaths.py
===
--- test/functionalities/paths/TestPaths.py
+++ test/functionalities/paths/TestPaths.py
@@ -28,6 +28,12 @@
 # No directory path types should have the filename set
 self.assertTrue (f.GetFilename() == None);
 
+def test_filespec_resolve_doesnt_prepend_cwd_if_file_doesnt_exist (self):
+file_only = 
lldb.SBFileSpec("VeryUnlikelToExistInTheCurrentWorkingDirectory", True)
+# SBFileSpec(path, True) should not prepend the 
current-working-directory to the
+# file path if it doesn't exist in the current directory.
+self.assertTrue (file_only.GetDirectory() == None)
+
 @unittest2.skipUnless(sys.platform.startswith("win32"), "Test for windows 
only")
 def test_windows_double_slash (self):
 '''Test to check the path with double slash is handled correctly '''

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
Index: source/Host/common/FileSpec.cpp
===
--- source/Host/common/FileSpec.cpp
+++ source/Host/common/FileSpec.cpp
@@ -164,7 +164,21 @@
 ResolveUsername(path);
 #endif // #ifdef LLDB_CONFIG_TILDE_RESOLVES_TO_USER
 
+// Save a copy of the original path that's passed in
+llvm::SmallString original_path(path.begin(), path.end());
+
 llvm::sys::fs::make_absolute(path);
+
+
+path.push_back(0);  // Be sure we have a nul terminated string
+path.pop_back();
+struct stat file_stats;
+if (::stat (path.data(), &file_stats) != 0)
+{
+path.clear();
+path.resize (original_path.size());
+memcpy (path.data(), original_path.data(), original_path.size());
+}
 }
 
 FileSpec::FileSpec() : 
Index: test/functionalities/paths/TestPaths.py
===
--- test/functionalities/paths/TestPaths.py
+++ test/functionalities/paths/TestPaths.py
@@ -28,6 +28,12 @@
 # No directory path types should have the filename set
 self.assertTrue (f.GetFilename() == None);
 
+def test_filespec_resolve_doesnt_prepend_cwd_if_file_doesnt_exist (self):
+file_only = lldb.SBFileSpec("VeryUnlikelToExistInTheCurrentWorkingDirectory", True)
+# SBFileSpec(path, True) should not prepend the current-working-directory to the
+# file path if it doesn't exist in the current directory.
+self.assertTrue (file_only.GetDirectory() == None)
+
 @unittest2.skipUnless(sys.platform.startswith("win32"), "Test for windows only")
 def test_windows_double_slash (self):
 '''Test to check the path with double slash is handled correctly '''
___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] FileSpec::Resolve should not turn a filename-only FileSpec into a qualified FileSpec if that file doesn't exist

2015-02-16 Thread Jason Molenda
F392748: patch.txt 


http://reviews.llvm.org/D7477

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] RFC: Proposed change in the disassembly default format in lldb

2015-02-13 Thread Jason Molenda
Landed in r229186.

Sendinginclude/lldb/Core/Address.h
Sendinginclude/lldb/Core/Disassembler.h
Sendinginclude/lldb/Core/FormatEntity.h
Sendinginclude/lldb/Symbol/SymbolContext.h
Sendingsource/API/SBInstruction.cpp
Sendingsource/API/SBInstructionList.cpp
Sendingsource/Breakpoint/BreakpointLocation.cpp
Sendingsource/Commands/CommandObjectSource.cpp
Sendingsource/Core/Address.cpp
Sendingsource/Core/Debugger.cpp
Sendingsource/Core/Disassembler.cpp
Sendingsource/Core/FormatEntity.cpp
Sendingsource/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
Sending
source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
Sendingsource/Symbol/SymbolContext.cpp
Sendingsource/Symbol/Variable.cpp
Sendingsource/Target/StackFrame.cpp
Sendingsource/Target/ThreadPlanTracer.cpp
Sendingtest/functionalities/abbreviation/TestAbbreviations.py
Sendingtest/functionalities/inferior-assert/TestInferiorAssert.py
Transmitting file data 
Committed revision 229186.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7578

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] RFC: Proposed change in the disassembly default format in lldb

2015-02-13 Thread Jason Molenda
Preparing to commit.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7578

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r229186 - Change the default disassembly format again. First attempt at

2015-02-13 Thread Jason Molenda
Author: jmolenda
Date: Fri Feb 13 17:24:21 2015
New Revision: 229186

URL: http://llvm.org/viewvc/llvm-project?rev=229186&view=rev
Log:
Change the default disassembly format again.  First attempt at
changing it was in r219544 - after living on that for a few 
months, I wanted to take another crack at this.

The disassembly-format setting still exists and the old format
can be user specified with a setting like

${current-pc-arrow}${addr-file-or-load}{ 
<${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>}:
 

This patch was discussed in http://reviews.llvm.org/D7578




Modified:
lldb/trunk/include/lldb/Core/Address.h
lldb/trunk/include/lldb/Core/Disassembler.h
lldb/trunk/include/lldb/Core/FormatEntity.h
lldb/trunk/include/lldb/Symbol/SymbolContext.h
lldb/trunk/source/API/SBInstruction.cpp
lldb/trunk/source/API/SBInstructionList.cpp
lldb/trunk/source/Breakpoint/BreakpointLocation.cpp
lldb/trunk/source/Commands/CommandObjectSource.cpp
lldb/trunk/source/Core/Address.cpp
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Core/Disassembler.cpp
lldb/trunk/source/Core/FormatEntity.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp

lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
lldb/trunk/source/Symbol/SymbolContext.cpp
lldb/trunk/source/Symbol/Variable.cpp
lldb/trunk/source/Target/StackFrame.cpp
lldb/trunk/source/Target/ThreadPlanTracer.cpp
lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py
lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py

Modified: lldb/trunk/include/lldb/Core/Address.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=229186&r1=229185&r2=229186&view=diff
==
--- lldb/trunk/include/lldb/Core/Address.h (original)
+++ lldb/trunk/include/lldb/Core/Address.h Fri Feb 13 17:24:21 2015
@@ -88,6 +88,8 @@ public:
 ///< if the address is in a section 
(section of pointers, c strings, etc).
 DumpStyleResolvedDescriptionNoModule,
 DumpStyleResolvedDescriptionNoFunctionArguments,
+DumpStyleNoFunctionName,///< Elide the function name; display 
an offset into the current function.
+///< Used primarily in disassembly 
symbolication
 DumpStyleDetailedSymbolContext, ///< Detailed symbol context 
information for an address for all symbol
 ///< context members.
 DumpStyleResolvedPointerDescription ///< Dereference a pointer at the 
current address and then lookup the

Modified: lldb/trunk/include/lldb/Core/Disassembler.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=229186&r1=229185&r2=229186&view=diff
==
--- lldb/trunk/include/lldb/Core/Disassembler.h (original)
+++ lldb/trunk/include/lldb/Core/Disassembler.h Fri Feb 13 17:24:21 2015
@@ -120,6 +120,12 @@ public:
 /// @param[in] disassembly_addr_format
 /// The format specification for how addresses are printed.
 /// Only needed if show_address is true.
+///
+/// @param[in] max_address_text_size
+/// The length of the longest address string at the start of the
+/// disassembly line that will be printed (the 
Debugger::FormatDisassemblerAddress() string)
+/// so this method can properly align the instruction opcodes.
+/// May be 0 to indicate no indentation/alignment of the opcodes.
 //--
 
 virtual void
@@ -130,7 +136,8 @@ public:
   const ExecutionContext* exe_ctx,
   const SymbolContext *sym_ctx,
   const SymbolContext *prev_sym_ctx,
-  const FormatEntity::Entry *disassembly_addr_format);
+  const FormatEntity::Entry *disassembly_addr_format,
+  size_t max_address_text_size);
 
 virtual bool
 DoesBranch () = 0;

Modified: lldb/trunk/include/lldb/Core/FormatEntity.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatEntity.h?rev=229186&r1=229185&r2=229186&view=diff
==
--- lldb/trunk/include/lldb/Core/FormatEntity.h (original)
+++ lldb/trunk/include/lldb/Core/FormatEntity.h Fri Feb 13 17:24:21 2015
@@ -78,6 +78,8 @@ namespace lldb_private
 FunctionAddrOffsetConcrete,
 FunctionLineOffset,
 FunctionPCOffset,
+FunctionInitial,
+FunctionChanged,
 LineEntryFile,
 LineEntryLineNumber,
 LineEntryStartAddress,

Modified: lldb/trunk/include/lldb/Symbol/SymbolContext.

Re: [Lldb-commits] [PATCH] RFC: Proposed change in the disassembly default format in lldb

2015-02-12 Thread Jason Molenda
Actually, on the bike ride home I realized that one of your concerns is 
justified:  There is no formatter for the comment field in the disassembly 
output.  A lot of different things can appear here -- this could be an address 
to an instruction in the current function, in a different function, in a 
segment of memory with no symbol at all, and there are a bunch of special 
behaviors like if it's the address of const data string, lldb prints the 
string.  And I mentioned earlier, lldb has assembler hints it can output and 
we've got a low-priority ToDo to expose those hints to the user -- in the 
comment field too.

This is a drag - my patch, as it is written today, is going to write branch 
instructions inside the current function as <+36> regardless of any format 
setting. :/


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7578

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] RFC: Proposed change in the disassembly default format in lldb

2015-02-11 Thread Jason Molenda
I didn't explain the disassembly-format in my proposal - it already works like 
you're describing.  The current lldb format is

${current-pc-arrow}${addr-file-or-load}{ 
<${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>}:

A user can put this in their ~/.lldbinit file to keep that style of output.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7578

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] RFC: Proposed change in the disassembly default format in lldb

2015-02-11 Thread Jason Molenda
Right, I'm saying that

jmp function+offset (addr)   ; comment

is a separate issue that I don't want to touch right now.

Yeah, Greg and I talked about what to put to indicate "this function".  Like, 
literally we were thinking "this" at one point.  Greg suggested a function 
pointer, like "(*)", and then we shortened it to just "*".  But after a couple 
of days looking at output like

0x100032 <*+36>: jump addr ; <*+36>

we were like, you know, the "*" isn't really necessary, we're just used to 
seeing something there.

I'm not opposed to putting something before the + -- I'm not sure what it 
should be.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7578

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] RFC: Proposed change in the disassembly default format in lldb

2015-02-11 Thread Jason Molenda
I like your suggestion of showing the comment contents as the operand instead 
of the raw address (or in addition to the raw address) -- but there are lots of 
things that can end up in the comments (and llvm can add additional things like 
hints about what an instruction does) so it might not make sense in every case.

I was ignoring the idea primarily because I want to stay focused on fixing the 
current output style.

gdb solved this too-long-name problem by having a maximum name length.  If the 
function name was any longer than that, it was truncated.  This was a poor 
solution IMO.

Why do people care where an instruction is in memory?

  They want to know where the pc is currently
  They have an address and want to know what instruction that is
  They want to know an offset into the function to follow a branch 
instruction's behavior

And so my new format includes the pc-indicator, the address, and the offset of 
each instruction.  I believe they don't need to see the function name on every 
line -- they need some way to know when one function ends and another begins 
(which we give them by a blank line and then a line with the new function name 
by itself).  It would be NICE if we could include the function name but in OO 
programs, these are often too long to include (especially when the instruction 
branches to another part of that same function) without forcing a line wrap, 
and they add much less value than the current-pc/addr/offset information.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7578

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r228910 - Search through all memory regions of the core file for

2015-02-11 Thread Jason Molenda
Author: jmolenda
Date: Thu Feb 12 00:14:23 2015
New Revision: 228910

URL: http://llvm.org/viewvc/llvm-project?rev=228910&view=rev
Log:
Search through all memory regions of the core file for
both a user process dyld and for a kernel binary -- we
will decide which to prefer after one or both have been
located.

It would be faster to stop the search thorugh the core
segments one we've found a dyld/kernel binary - but that
may trick us into missing the one we would prefer.

 

Modified:
lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp

Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=228910&r1=228909&r2=228910&view=diff
==
--- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Thu Feb 12 
00:14:23 2015
@@ -311,10 +311,14 @@ ProcessMachCore::DoLoadCore ()
 // We need to locate the main executable in the memory ranges
 // we have in the core file.  We need to search for both a 
user-process dyld binary
 // and a kernel binary in memory; we must look at all the pages in the 
binary so
-// we don't miss one or the other.  If we find a user-process dyld 
binary, stop
-// searching -- that's the one we'll prefer over the mach kernel.
+// we don't miss one or the other.  Step through all memory segments 
searching for
+// a kernel binary and for a user process dyld -- we'll decide which 
to prefer 
+// later if both are present.
+
 const size_t num_core_aranges = m_core_aranges.GetSize();
-for (size_t i=0; iGetRangeBase();


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] RFC: Proposed change in the disassembly default format in lldb

2015-02-11 Thread Jason Molenda
Initially I had this using "*" to mean current-function.  So offsets were 
expressed like <*+36> but when it was all said and done, the "*" wasn't adding 
any information so I nixed it.  If the <>'s weren't present, the * would be 
necessary but I think with the offset in the brackets, it's not needed.  I'm 
not wedded to omitting the "*" but I think we're fine without it.  I definitely 
don't want to lose the "+" and have the offsets expressed as "<30>" - that 
seems a little too much.

I originally was trying to think of a way to alternate the disassembly style 
based on the function name length.  But that makes it hard to have a 
`disassembly-format` customization capability unless there was a 
`disassembly-format-short-names` and `disassembly-format-long-names` ;).  And 
someone argued that it would be more confusing to users if we have multiple 
styles of disassembly formatting depending on the length of the function name 
-- people aren't going to know why the disassembler formats it one way for 
certain functions and a different way for a slightly longer function name 
function.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7578

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] RFC: Proposed change in the disassembly default format in lldb

2015-02-11 Thread Jason Molenda
In r219544 (2014-10-10) I changed the default disassembly format to more 
closely resemble gdb's disassembly format.  After living on this format for a 
few months, there are obvious shortcomings with C++ and Objective-C programs 
and I want to try a new approach.

Originally lldb's disassembly would display the Module & Function/Symbol name 
on a line by itself when a new function/symbol began, on each line of assembly 
display the file/load address followed by opcode, operands, and comments (e.g. 
showing the target of a branch insn).  Branches to the same function would have 
a comment listing the full function name plus an offset.  Note that the 
addresses did not display the offset, just raw addresses, meaning you had to 
compare the full address of the branch target with the disassembly output to 
find the target of the branch.  When the branch target was in inlined code, 
lldb would print all of the inlined functions in the comment field (on separate 
lines).

In October I changed this to more closely resemble gdb's output:  Each line has 
the file/load address, the function name, the offset into the function ("+35"), 
opcode, operand, comment. Comments pointing to the same function behaved the 
same but inlined functions were not included.  I try to elide function argument 
types (e.g. from a demangled C++ name) but with templated methods it can be 
enormous.

This style of disassembly looks pretty good for short C function names.  Like

(lldb) disass -c 20
   0x7fff94fbe188 : movq   %rcx, %r10
   0x7fff94fbe18b : movl   $0x11f, %eax
   0x7fff94fbe190 : syscall 
-> 0x7fff94fbe192 : retq   
   0x7fff94fbe193 : nop
   0x7fff94fbe194 : movq   %rcx, %r10
  
but as soon as you get a hefty C++ name in there, it becomes very messy:

0x107915454 : jne0x1be9331   
  ; CommandObjectBreakpointList::DoExecute + 113 at 
CommandObjectBreakpoint.cpp:1420

Or, an extreme example that I found in lldb with 30 seconds of looking 
(function name only) -

std::__1::function 
(lldb_private::ValueObject&)>::function


I want to go with a hybrid approach between these two styles.  When there is a 
new symbol, we print the full module + function name.  On each assembly line, 
we print the file/load address, the offset into the function in angle brackets, 
opcode, operand, and in the comments branches to the SAME function follow the 
<+36> style.  An example:


(lldb) disass
LLDB`CommandObjectBreakpointList::DoExecute:
0x107915410 <+0>:pushq  %rbp
0x107915411 <+1>:movq   %rsp, %rbp
0x107915414 <+4>:subq   $0x170, %rsp
0x10791541b <+11>:   movq   %rdi, -0x20(%rbp)
0x10791541f <+15>:   movq   %rsi, -0x28(%rbp)
0x107915423 <+19>:   movq   %rdx, -0x30(%rbp)
0x107915427 <+23>:   movq   -0x20(%rbp), %rdx
->  0x10791542b <+27>:   movq   %rdx, %rsi
0x10791542e <+30>:   movb   0x165(%rdx), %al
0x107915434 <+36>:   andb   $0x1, %al
0x107915436 <+38>:   movq   %rsi, %rdi
0x107915439 <+41>:   movzbl %al, %esi
0x10791543c <+44>:   movq   %rdx, -0xf8(%rbp)
0x107915443 <+51>:   callq  0x107d87bb0   ; 
lldb_private::CommandObject::GetSelectedOrDummyTarget at CommandObject.cpp:1045
0x107915448 <+56>:   movq   %rax, -0x38(%rbp)
0x10791544c <+60>:   cmpq   $0x0, -0x38(%rbp)
0x107915454 <+68>:   jne0x107915481   ; <+113> at 
CommandObjectBreakpoint.cpp:1420
0x10791545a <+74>:   leaq   0xf54d21(%rip), %rsi  ; "Invalid target. No 
current target or breakpoints."
0x107915461 <+81>:   movq   -0x30(%rbp), %rdi
0x107915465 <+85>:   callq  0x107d93640   ; 
lldb_private::CommandReturnObject::AppendError at CommandReturnObject.cpp:135
0x10791546a <+90>:   movl   $0x1, %esi
0x10791546f <+95>:   movq   -0x30(%rbp), %rdi
0x107915473 <+99>:   callq  0x107d93760   ; 
lldb_private::CommandReturnObject::SetStatus at CommandReturnObject.cpp:172
0x107915478 <+104>:  movb   $0x1, -0x11(%rbp)
0x10791547c <+108>:  jmp0x1079158bd   ; <+1197> at 
CommandObjectBreakpoint.cpp:1470
0x107915481 <+113>:  movq   -0x38(%rbp), %rdi

The main drawback for this new arrangement is that you may be looking at a long 
series of instructions and forget the name of the function/method.  You'll need 
to scroll backwards to the beginning of the disassembly to find this function's 
names.  Minor details include doing a two-pass over the instruction list to 
find the maximum length of the address component and padding all the lines so 
the opcodes line up.  For instance,

(lldb)  disass -c 30 -n mach_msg_trap
libsystem_kernel.dylib`mach_msg_trap:
0x7fff94fbe188 <+0>:  movq   %rcx, %r10
0x7fff94fbe18b <+3>:  movl   $0x11f, %eax
0x7fff94fbe190 <+8>:  syscall 
0x7fff94fbe192 <+10>: retq   
0x7fff94fbe193 <+11>: nop

dyld`mach_msg_trap:
0x7fff6a867210 <+0>:  movq   %rcx, %r10
0x7fff6a867213 <+3>:  movl   $0x11f, %eax
0x7fff6a867218 <+8>:  sys

Re: [Lldb-commits] [PATCH] FileSpec::Resolve should not turn a filename-only FileSpec into a qualified FileSpec if that file doesn't exist

2015-02-07 Thread Jason Molenda
Thanks for all the comments, no rush on this.  I need to update the patch to 
integrate your suggested changes and try to write a test case still.


http://reviews.llvm.org/D7477

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r228486 - When creating a disassembler for one of the arm variants that can

2015-02-06 Thread Jason Molenda
Author: jmolenda
Date: Sat Feb  7 00:03:49 2015
New Revision: 228486

URL: http://llvm.org/viewvc/llvm-project?rev=228486&view=rev
Log:
When creating a disassembler for one of the arm variants that can
only execute thumb instructions, force the arch triple string to
be "thumbv..." instead of "armv..." so we do the right thing by
default when disassembling arbitrary chunks of code.
 

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

Modified: lldb/trunk/include/lldb/Core/Disassembler.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=228486&r1=228485&r2=228486&view=diff
==
--- lldb/trunk/include/lldb/Core/Disassembler.h (original)
+++ lldb/trunk/include/lldb/Core/Disassembler.h Sat Feb  7 00:03:49 2015
@@ -457,7 +457,7 @@ protected:
 //--
 // Classes that inherit from Disassembler can see and modify these
 //--
-const ArchSpec m_arch;
+ArchSpec m_arch;
 InstructionList m_instruction_list;
 lldb::addr_t m_base_addr;
 std::string m_flavor;

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=228486&r1=228485&r2=228486&view=diff
==
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Sat Feb  7 00:03:49 2015
@@ -1172,6 +1172,24 @@ Disassembler::Disassembler(const ArchSpe
 m_flavor.assign("default");
 else
 m_flavor.assign(flavor);
+
+// If this is an arm variant that can only include thumb (T16, T32)
+// instructions, force the arch triple to be "thumbv.." instead of
+// "armv..."
+if (arch.GetTriple().getArch() == llvm::Triple::arm
+&& (arch.GetCore() == ArchSpec::Core::eCore_arm_armv7m
+|| arch.GetCore() == ArchSpec::Core::eCore_arm_armv7em
+|| arch.GetCore() == ArchSpec::Core::eCore_arm_armv6m))
+{
+std::string thumb_arch_name (arch.GetTriple().getArchName().str());
+// Replace "arm" with "thumb" so we get all thumb variants correct
+if (thumb_arch_name.size() > 3)
+{
+thumb_arch_name.erase(0, 3);
+thumb_arch_name.insert(0, "thumb");
+}
+m_arch.SetTriple (thumb_arch_name.c_str());
+}
 }
 
 //--


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] FileSpec::Resolve should not turn a filename-only FileSpec into a qualified FileSpec if that file doesn't exist

2015-02-06 Thread Jason Molenda
Forgot to include lldb-commits on the subscription list.


http://reviews.llvm.org/D7477

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] suppress compiler warning (mostly -Wsign-compare)

2015-02-04 Thread Jason Molenda
Those new warnings from UnwindAssembly-x86.cpp are my fault.  I'll fix them 
later today.


http://reviews.llvm.org/D6271

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r227419 - When starting a kernel debug session (PlatformDarwinKernel), scan

2015-01-28 Thread Jason Molenda
Author: jmolenda
Date: Thu Jan 29 00:20:05 2015
New Revision: 227419

URL: http://llvm.org/viewvc/llvm-project?rev=227419&view=rev
Log:
When starting a kernel debug session (PlatformDarwinKernel), scan
for executable binaries on the local filesystem so the user doesn't
need to provide the path to the correct binary manually.

Also have lldb search for kexts/the kernel in the current working
directory in addition to all the usual places.

 


Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp?rev=227419&r1=227418&r2=227419&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp 
(original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Thu Jan 
29 00:20:05 2015
@@ -250,13 +250,16 @@ PlatformDarwinKernel::DebuggerInitialize
 PlatformDarwinKernel::PlatformDarwinKernel (lldb_private::LazyBool 
is_ios_debug_session) :
 PlatformDarwin (false),// This is a remote platform
 m_name_to_kext_path_map(),
-m_directories_searched(),
+m_search_directories(),
+m_kernel_binaries(),
 m_ios_debug_session(is_ios_debug_session)
 
 {
 if (GetGlobalProperties()->GetSearchForKexts())
 {
-SearchForKexts ();
+CollectKextAndKernelDirectories ();
+IndexKextsInDirectories ();
+IndexKernelsInDirectories ();
 }
 }
 
@@ -282,23 +285,26 @@ PlatformDarwinKernel::GetStatus (Stream
 strm.Printf ("Mac OS X kernel debugging\n");
 else
 strm.Printf ("unknown kernel debugging\n");
-const uint32_t num_kext_dirs = m_directories_searched.size();
+const uint32_t num_kext_dirs = m_search_directories.size();
 for (uint32_t i=0; i sdk_dirs;
 if (m_ios_debug_session != eLazyBoolNo)
@@ -308,8 +314,14 @@ PlatformDarwinKernel::SearchForKexts ()
 
 GetGenericSDKDirectoriesToSearch (sdk_dirs);
 
-// Build up a list of directories that hold kext bundles on the system
-// e.g. 
/Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.Internal.sdk/System/Library/Extensions
+// Build up a list of directories that hold may kext bundles & kernels
+//
+// e.g. given 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
+// find 
+// 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.Internal.sdk/
+// and
+// 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.Internal.sdk/System/Library/Extensions
+
 std::vector kext_dirs;
 SearchSDKsForKextDirectories (sdk_dirs, kext_dirs);
 
@@ -322,10 +334,12 @@ PlatformDarwinKernel::SearchForKexts ()
 
 GetUserSpecifiedDirectoriesToSearch (kext_dirs);
 
-// We now have a complete list of directories that we will search for kext 
bundles
-m_directories_searched = kext_dirs;
+GetKernelDirectoriesToSearch (kext_dirs);
 
-IndexKextsInDirectories (kext_dirs);
+GetCurrentDirectoryToSearch (kext_dirs);
+
+// We now have a complete list of directories that we will search for kext 
bundles
+m_search_directories = kext_dirs;
 }
 
 void
@@ -379,7 +393,6 @@ PlatformDarwinKernel::GetGenericSDKDirec
 {
 directories.push_back (installed_kdks);
 }
-
 }
 
 void
@@ -427,6 +440,50 @@ PlatformDarwinKernel::GetGenericDirector
 }
 
 void
+PlatformDarwinKernel::GetKernelDirectoriesToSearch 
(std::vector &directories)
+{
+FileSpec system_library_kernels ("/System/Library/Kernels", true);
+if (system_library_kernels.Exists() && 
system_library_kernels.IsDirectory())
+{
+directories.push_back (system_library_kernels);
+}
+FileSpec slek("/System/Library/Extensions/KDK", true);
+if (slek.Exists() && slek.IsDirectory())
+{
+directories.push_back(slek);
+}
+}
+
+void
+PlatformDarwinKernel::GetCurrentDirectoryToSearch 
(std::vector &directories)
+{
+directories.push_back (FileSpec (".", true));
+
+FileSpec sle_directory ("System/Library/Extensions", true);
+if (sle_directory.Exists() && sle_directory.IsDirectory())
+{
+directories.push_back (sle_directory);
+}
+
+FileSpec le_directory ("Library/Extensions", true);
+if (le_directory.Exists() && le_directory.IsDirectory())
+{
+directories.push_back (le_directory);
+}
+
+FileSpec slk_directory ("System/Library/Kernels", true);
+if (slk_directory.Exists() && slk_directory.IsDirectory())
+{
+directories.push_back (slk_directory);
+}
+FileSpec slek("System/Library/Extensions/KDK", true);
+if (slek.Exists() && slek.IsD

[Lldb-commits] [lldb] r227083 - Add link to github x86-psABI repo where the ABI doc is being

2015-01-26 Thread Jason Molenda
Author: jmolenda
Date: Mon Jan 26 04:07:39 2015
New Revision: 227083

URL: http://llvm.org/viewvc/llvm-project?rev=227083&view=rev
Log:
Add link to github x86-psABI repo where the ABI doc is being 
revised.

Modified:
lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp

Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=227083&r1=227082&r2=227083&view=diff
==
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Mon Jan 26 
04:07:39 2015
@@ -1142,6 +1142,7 @@ ABISysV_x86_64::RegisterIsVolatile (cons
 // (this doc is also commonly referred to as the x86-64/AMD64 psABI)
 // Edited by Michael Matz, Jan Hubicka, Andreas Jaeger, and Mark Mitchell
 // current version is 0.99.6 released 2012-07-02 at 
http://refspecs.linuxfoundation.org/elf/x86-64-abi-0.99.pdf
+// It's being revised & updated at https://github.com/hjl-tools/x86-psABI/
 
 bool
 ABISysV_x86_64::RegisterIsCalleeSaved (const RegisterInfo *reg_info)


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r226892 - debug printfs that got left in. I blame greg.

2015-01-22 Thread Jason Molenda
Author: jmolenda
Date: Thu Jan 22 19:34:19 2015
New Revision: 226892

URL: http://llvm.org/viewvc/llvm-project?rev=226892&view=rev
Log:
debug printfs that got left in.  I blame greg.

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

Modified: lldb/trunk/source/Symbol/CompactUnwindInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompactUnwindInfo.cpp?rev=226892&r1=226891&r2=226892&view=diff
==
--- lldb/trunk/source/Symbol/CompactUnwindInfo.cpp (original)
+++ lldb/trunk/source/Symbol/CompactUnwindInfo.cpp Thu Jan 22 19:34:19 2015
@@ -1055,11 +1055,9 @@ CompactUnwindInfo::CreateUnwindPlan_i386
 if (mode == UNWIND_X86_MODE_STACK_IND && 
function_info.valid_range_offset_start != 0)
 {
 uint32_t stack_adjust = EXTRACT_BITS (function_info.encoding, 
UNWIND_X86_FRAMELESS_STACK_ADJUST);
-printf("JSMDEBUG got stack_adjust %d from encoding 0x%x\n", stack_adjust, 
function_info.encoding);
 
 // offset into the function instructions; 0 == beginning of 
first instruction
 uint32_t offset_to_subl_insn = EXTRACT_BITS 
(function_info.encoding, UNWIND_X86_FRAMELESS_STACK_SIZE);
-printf("JSMDEBUG got offset to sub instruction %d\n", offset_to_subl_insn);
 
 SectionList *sl = m_objfile.GetSectionList ();
 if (sl)


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r226889 - Two fixes for compact unwind decoding for frameless large-stack-size

2015-01-22 Thread Jason Molenda
Author: jmolenda
Date: Thu Jan 22 19:02:32 2015
New Revision: 226889

URL: http://llvm.org/viewvc/llvm-project?rev=226889&view=rev
Log:
Two fixes for compact unwind decoding for frameless large-stack-size
i386/x86_64 functions.  The stack size was being multiplied by the
pointer size incorrectly.  The register permutation placeholders
(UNWIND_X86_REG_NONE) were decrementing the stack offset of the
saved registers when it should not have been.

 

Modified:
lldb/trunk/source/Symbol/CompactUnwindInfo.cpp
lldb/trunk/tools/compact-unwind/compact-unwind-dumper.c

Modified: lldb/trunk/source/Symbol/CompactUnwindInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompactUnwindInfo.cpp?rev=226889&r1=226888&r2=226889&view=diff
==
--- lldb/trunk/source/Symbol/CompactUnwindInfo.cpp (original)
+++ lldb/trunk/source/Symbol/CompactUnwindInfo.cpp Thu Jan 22 19:02:32 2015
@@ -809,8 +809,16 @@ CompactUnwindInfo::CreateUnwindPlan_x86_
 }
 }
 
+if (mode == UNWIND_X86_64_MODE_STACK_IND)
+{
+row->SetCFAOffset (stack_size);
+}
+else
+{
+row->SetCFAOffset (stack_size * wordsize);
+}
+
 row->SetCFARegister (x86_64_eh_regnum::rsp);
-row->SetCFAOffset (stack_size * wordsize);
 row->SetOffset (0);
 row->SetRegisterLocationToAtCFAPlusOffset (x86_64_eh_regnum::rip, 
wordsize * -1, true);
 row->SetRegisterLocationToIsCFAPlusOffset (x86_64_eh_regnum::rsp, 
0, true);
@@ -919,10 +927,10 @@ CompactUnwindInfo::CreateUnwindPlan_x86_
 case UNWIND_X86_64_REG_R14:
 case UNWIND_X86_64_REG_R15:
 case UNWIND_X86_64_REG_RBP:
- row->SetRegisterLocationToAtCFAPlusOffset 
(translate_to_eh_frame_regnum_x86_64 (registers[i]), wordsize * 
-saved_registers_offset, true);
+row->SetRegisterLocationToAtCFAPlusOffset 
(translate_to_eh_frame_regnum_x86_64 (registers[i]), wordsize * 
-saved_registers_offset, true);
+saved_registers_offset++;
 break;
 }
-saved_registers_offset++;
 }
 }
 unwind_plan.AppendRow (row);
@@ -1047,9 +1055,11 @@ CompactUnwindInfo::CreateUnwindPlan_i386
 if (mode == UNWIND_X86_MODE_STACK_IND && 
function_info.valid_range_offset_start != 0)
 {
 uint32_t stack_adjust = EXTRACT_BITS (function_info.encoding, 
UNWIND_X86_FRAMELESS_STACK_ADJUST);
+printf("JSMDEBUG got stack_adjust %d from encoding 0x%x\n", stack_adjust, 
function_info.encoding);
 
 // offset into the function instructions; 0 == beginning of 
first instruction
 uint32_t offset_to_subl_insn = EXTRACT_BITS 
(function_info.encoding, UNWIND_X86_FRAMELESS_STACK_SIZE);
+printf("JSMDEBUG got offset to sub instruction %d\n", offset_to_subl_insn);
 
 SectionList *sl = m_objfile.GetSectionList ();
 if (sl)
@@ -1084,7 +1094,16 @@ CompactUnwindInfo::CreateUnwindPlan_i386
 }
 
 row->SetCFARegister (i386_eh_regnum::esp);
-row->SetCFAOffset (stack_size * wordsize);
+
+if (mode == UNWIND_X86_MODE_STACK_IND)
+{
+row->SetCFAOffset (stack_size);
+}
+else
+{
+row->SetCFAOffset (stack_size * wordsize);
+}
+
 row->SetOffset (0);
 row->SetRegisterLocationToAtCFAPlusOffset (i386_eh_regnum::eip, 
wordsize * -1, true);
 row->SetRegisterLocationToIsCFAPlusOffset (i386_eh_regnum::esp, 0, 
true);
@@ -1193,10 +1212,10 @@ CompactUnwindInfo::CreateUnwindPlan_i386
 case UNWIND_X86_REG_EDI:
 case UNWIND_X86_REG_ESI:
 case UNWIND_X86_REG_EBP:
- row->SetRegisterLocationToAtCFAPlusOffset 
(translate_to_eh_frame_regnum_i386 (registers[i]), wordsize * 
-saved_registers_offset, true);
+row->SetRegisterLocationToAtCFAPlusOffset 
(translate_to_eh_frame_regnum_i386 (registers[i]), wordsize * 
-saved_registers_offset, true);
+saved_registers_offset++;
 break;
 }
-saved_registers_offset++;
 }
 }
 

Modified: lldb/trunk/tools/compact-unwind/compact-unwind-dumper.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/compact-unwind/compact-unwind-dumper.c?rev=226889&r1=226888&r2=226889&view=diff
==
--- lldb/trunk/tools/compact-unwind/compact-unwind-dumper.c (original)
+++ lldb

[Lldb-commits] [lldb] r226789 - Update ExpressionSourceCode::GetText() to match the

2015-01-21 Thread Jason Molenda
Author: jmolenda
Date: Thu Jan 22 00:31:58 2015
New Revision: 226789

URL: http://llvm.org/viewvc/llvm-project?rev=226789&view=rev
Log:
Update ExpressionSourceCode::GetText() to match the
name of the iOS simulator platform which was changed
in r181631.
 

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

Modified: lldb/trunk/source/Expression/ExpressionSourceCode.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ExpressionSourceCode.cpp?rev=226789&r1=226788&r2=226789&view=diff
==
--- lldb/trunk/source/Expression/ExpressionSourceCode.cpp (original)
+++ lldb/trunk/source/Expression/ExpressionSourceCode.cpp Thu Jan 22 00:31:58 
2015
@@ -51,7 +51,7 @@ extern "C"
 bool ExpressionSourceCode::GetText (std::string &text, lldb::LanguageType 
wrapping_language, bool const_object, bool static_method, ExecutionContext 
&exe_ctx) const
 {
 const char *target_specific_defines = "typedef signed char BOOL;\n";
-static ConstString g_platform_ios_simulator ("PlatformiOSSimulator");
+static ConstString g_platform_ios_simulator ("ios-simulator");
 
 if (Target *target = exe_ctx.GetTargetPtr())
 {


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r226752 - Add Utility/UriParser.cpp to the lldb-core target so xcode builds

2015-01-21 Thread Jason Molenda
Author: jmolenda
Date: Wed Jan 21 18:39:36 2015
New Revision: 226752

URL: http://llvm.org/viewvc/llvm-project?rev=226752&view=rev
Log:
Add Utility/UriParser.cpp to the lldb-core target so xcode builds
work again.

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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=226752&r1=226751&r2=226752&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Jan 21 18:39:36 2015
@@ -664,7 +664,6 @@
26FFC19C14FC072100087D58 /* DYLDRendezvous.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 26FFC19614FC072100087D58 /* DYLDRendezvous.h */; 
};
26FFC19D14FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 26FFC19714FC072100087D58 /* 
DynamicLoaderPOSIXDYLD.cpp */; };
26FFC19E14FC072100087D58 /* DynamicLoaderPOSIXDYLD.h in Headers 
*/ = {isa = PBXBuildFile; fileRef = 26FFC19814FC072100087D58 /* 
DynamicLoaderPOSIXDYLD.h */; };
-   33064C9A1A5C7A330033D415 /* UriParser.cpp in CopyFiles */ = 
{isa = PBXBuildFile; fileRef = 33064C991A5C7A330033D415 /* UriParser.cpp */; };
33064C9C1A5C7A490033D415 /* UriParser.h in CopyFiles */ = {isa 
= PBXBuildFile; fileRef = 33064C9B1A5C7A490033D415 /* UriParser.h */; };
33E5E8421A672A240024ED68 /* StringConvert.cpp in CopyFiles */ = 
{isa = PBXBuildFile; fileRef = 33E5E8411A672A240024ED68 /* StringConvert.cpp 
*/; };
33E5E8461A6736D30024ED68 /* StringConvert.h in CopyFiles */ = 
{isa = PBXBuildFile; fileRef = 33E5E8451A6736D30024ED68 /* StringConvert.h */; 
};
@@ -839,6 +838,7 @@
AF25AB27188F685C0030DEC3 /* AppleGetQueuesHandler.h in Headers 
*/ = {isa = PBXBuildFile; fileRef = AF25AB25188F685C0030DEC3 /* 
AppleGetQueuesHandler.h */; };
AF26703A1852D01E00B6CC36 /* Queue.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AF2670381852D01E00B6CC36 /* Queue.cpp */; };
AF26703B1852D01E00B6CC36 /* QueueList.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = AF2670391852D01E00B6CC36 /* QueueList.cpp */; };
+   AF2BA6EC1A707E3400C5248A /* UriParser.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 33064C991A5C7A330033D415 /* UriParser.cpp */; };
AF2BCA6C18C7EFDE005B4526 /* JITLoaderGDB.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF2BCA6918C7EFDE005B4526 /* JITLoaderGDB.cpp */; 
};
AF2BCA6D18C7EFDE005B4526 /* JITLoaderGDB.h in Headers */ = {isa 
= PBXBuildFile; fileRef = AF2BCA6A18C7EFDE005B4526 /* JITLoaderGDB.h */; };
AF37E10A17C861F20061E18E /* ProcessRunLock.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF37E10917C861F20061E18E /* ProcessRunLock.cpp 
*/; };
@@ -1045,7 +1045,6 @@
33E5E8461A6736D30024ED68 /* StringConvert.h in 
CopyFiles */,
33064C9C1A5C7A490033D415 /* UriParser.h in 
CopyFiles */,
33E5E8421A672A240024ED68 /* StringConvert.cpp 
in CopyFiles */,
-   33064C9A1A5C7A330033D415 /* UriParser.cpp in 
CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 1;
};
@@ -5735,6 +5734,7 @@
2689006913353E0E00698AC0 /* 
ASTStructExtractor.cpp in Sources */,
2689006A13353E0E00698AC0 /* IRDynamicChecks.cpp 
in Sources */,
2689006B13353E0E00698AC0 /* IRForTarget.cpp in 
Sources */,
+   AF2BA6EC1A707E3400C5248A /* UriParser.cpp in 
Sources */,
2689006D13353E0E00698AC0 /* IRExecutionUnit.cpp 
in Sources */,
2689006E13353E1A00698AC0 /* File.cpp in Sources 
*/,
94D6A0AB16CEB55F00833B6E /* NSDictionary.cpp in 
Sources */,


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


  1   2   3   4   5   >