[Lldb-commits] [lldb] r257117 - Performance improvement: Change lldb so that it puts a breakpoint

2016-01-07 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Jan  7 18:06:03 2016
New Revision: 257117

URL: http://llvm.org/viewvc/llvm-project?rev=257117=rev
Log:
Performance improvement: Change lldb so that it puts a breakpoint
on the first branch instruction after a function return (or the end
of a source line), instead of a breakpoint on the return address,
to skip an extra stop & start of the inferior process.

I changed Process::AdvanceAddressToNextBranchInstruction to not
take an optional InstructionList argument - no callers are providing
a cached InstructionList today, and if this function was going to
do that, the right thing to do would be to fill out / use a
DisassemblerSP which is a disassembler with the InstructionList for
this address range.


http://reviews.llvm.org/D15708
 


Modified:
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/include/lldb/Target/Thread.h
lldb/trunk/include/lldb/Target/ThreadPlanStepOut.h
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/Thread.cpp
lldb/trunk/source/Target/ThreadPlanShouldStopHere.cpp
lldb/trunk/source/Target/ThreadPlanStepOut.cpp
lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=257117=257116=257117=diff
==
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Thu Jan  7 18:06:03 2016
@@ -3149,6 +3149,34 @@ public:
 void
 ResetImageToken(size_t token);
 
+//--
+/// Find the next branch instruction to set a breakpoint on
+///
+/// When instruction stepping through a source line, instead of 
+/// stepping through each instruction, we can put a breakpoint on
+/// the next branch instruction (within the range of instructions
+/// we are stepping through) and continue the process to there,
+/// yielding significant performance benefits over instruction
+/// stepping.  
+///
+/// @param[in] default_stop_addr
+/// The address of the instruction where lldb would put a 
+/// breakpoint normally.
+///
+/// @param[in] range_bounds
+/// The range which the breakpoint must be contained within.
+/// Typically a source line.
+///
+/// @return
+/// The address of the next branch instruction, or the end of
+/// the range provided in range_bounds.  If there are any
+/// problems with the disassembly or getting the instructions,
+/// the original default_stop_addr will be returned.
+//--
+Address
+AdvanceAddressToNextBranchInstruction (Address default_stop_addr, 
+   AddressRange range_bounds);
+
 protected:
 void
 SetState (lldb::EventSP _sp);

Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=257117=257116=257117=diff
==
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Thu Jan  7 18:06:03 2016
@@ -888,6 +888,16 @@ public:
 /// @param[in] run_vote
 ///See standard meanings for the stop & run votes in ThreadPlan.h.
 ///
+/// @param[in] continue_to_next_branch
+///Normally this will enqueue a plan that will put a breakpoint on the 
return address and continue
+///to there.  If continue_to_next_branch is true, this is an operation 
not involving the user -- 
+///e.g. stepping "next" in a source line and we instruction stepped 
into another function -- 
+///so instead of putting a breakpoint on the return address, advance 
the breakpoint to the 
+///end of the source line that is doing the call, or until the next 
flow control instruction.
+///If the return value from the function call is to be retrieved / 
displayed to the user, you must stop
+///on the return address.  The return value may be stored in volatile 
registers which are overwritten
+///before the next branch instruction.
+///
 /// @return
 /// A shared pointer to the newly queued thread plan, or nullptr if 
the plan could not be queued.
 //--
@@ -898,7 +908,8 @@ public:
bool stop_other_threads,
Vote stop_vote, // = eVoteYes,
Vote run_vote, // = eVoteNoOpinion);
-   uint32_t frame_idx);
+   uint32_t frame_idx,
+

Re: [Lldb-commits] [PATCH] D15708: Advance the return-address breakpoint location to the end of the next source line, or the next branching instruction, when stepping over a func call

2016-01-07 Thread Jason Molenda via lldb-commits
jasonmolenda closed this revision.
jasonmolenda added a comment.

Landed in r257117.

Sendinginclude/lldb/Target/Process.h
Sendinginclude/lldb/Target/Thread.h
Sendinginclude/lldb/Target/ThreadPlanStepOut.h
Sendingsource/Target/Process.cpp
Sendingsource/Target/Thread.cpp
Sendingsource/Target/ThreadPlanShouldStopHere.cpp
Sendingsource/Target/ThreadPlanStepOut.cpp
Sendingsource/Target/ThreadPlanStepOverRange.cpp
Transmitting file data 
Committed revision 257117.


Repository:
  rL LLVM

http://reviews.llvm.org/D15708



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


Re: [Lldb-commits] [PATCH] D15834: Handle hardcoded breakpoints on Windows (e.g., int3 or __debugbreak())

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

Windows stuff looks good to me.


http://reviews.llvm.org/D15834



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


Re: [Lldb-commits] [PATCH] D15972: Make sure we don't send qModuleInfo packets unnecessarily.

2016-01-07 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks good.


http://reviews.llvm.org/D15972



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


[Lldb-commits] [lldb] r257120 - Fix a glitch in the Driver's batch mode when used with "attach".

2016-01-07 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Thu Jan  7 18:20:47 2016
New Revision: 257120

URL: http://llvm.org/viewvc/llvm-project?rev=257120=rev
Log:
Fix a glitch in the Driver's batch mode when used with "attach".  

Batch mode is supposed to stop execution and return control to the user when an
exceptional stop occurs (crash, signal or instrumentation).  But attach always 
stops
with a SIGSTOP on OSX (maybe on Linux too?) which would short circuit the rest 
of the
commands given.

This change allows a command result object to indicate that it expected to 
leave the 
process stopped with an exceptional stop reason, and it is okay for batch mode 
to keep going.



Modified:
lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c
lldb/trunk/source/Commands/CommandObjectProcess.cpp
lldb/trunk/source/Interpreter/CommandInterpreter.cpp
lldb/trunk/source/Interpreter/CommandReturnObject.cpp

Modified: lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h?rev=257120=257119=257120=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h Thu Jan  7 
18:20:47 2016
@@ -169,6 +169,18 @@ public:
 
 void
 SetInteractive (bool b);
+
+bool
+GetAbnormalStopWasExpected() const
+{
+return m_abnormal_stop_was_expected;
+}
+
+void
+SetAbnormalStopWasExpected(bool signal_was_expected)
+{
+m_abnormal_stop_was_expected = signal_was_expected;
+}
 
 private:
 enum 
@@ -182,7 +194,13 @@ private:
 
 lldb::ReturnStatus m_status;
 bool m_did_change_process_state;
-bool m_interactive; // If true, then the input handle from the debugger 
will be hooked up
+bool m_interactive;  // If true, then the input handle from the 
debugger will be hooked up
+bool m_abnormal_stop_was_expected;  // This is to support 
eHandleCommandFlagStopOnCrash vrs. attach.
+// The attach command often ends up 
with the process stopped due to a signal.
+// Normally that would mean stop on 
crash should halt batch execution, but we
+// obviously don't want that for 
attach.  Using this flag, the attach command
+// (and anything else for which this 
is relevant) can say that the signal is
+// expected, and batch command 
execution can continue.
 };
 
 } // namespace lldb_private

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py?rev=257120=257119=257120=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py 
Thu Jan  7 18:20:47 2016
@@ -14,21 +14,12 @@ class DriverBatchModeTest (TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipIfRemote # test not remote-ready llvm.org/pr24813
-@expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot")
-@expectedFlakeyLinux("llvm.org/pr25172")
-@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for 
windows")
-def test_driver_batch_mode(self):
-"""Test that the lldb driver's batch mode works correctly."""
-self.build()
-self.setTearDownCleanup()
-self.batch_mode()
-
 def setUp(self):
 # Call super's setUp().
 TestBase.setUp(self)
 # Our simple source filename.
 self.source = 'main.c'
+self.victim = None
 
 def expect_string (self, string):
 import pexpect
@@ -40,12 +31,20 @@ class DriverBatchModeTest (TestBase):
 except pexpect.TIMEOUT:
 self.fail ("Timed out waiting for '%s'"%(string))
 
-def batch_mode (self):
+@skipIfRemote # test not remote-ready llvm.org/pr24813
+@expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot")
+@expectedFlakeyLinux("llvm.org/pr25172")
+@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for 
windows")
+def test_batch_mode_run_crash (self):
+"""Test that the lldb driver's batch mode works correctly."""
+self.build()
+self.setTearDownCleanup()
+
 import pexpect
 exe = os.path.join(os.getcwd(), "a.out")
 prompt = "(lldb) "
 
-# First time through, pass CRASH 

[Lldb-commits] [lldb] r257121 - Change the key name for the libdispatch queue serial number from

2016-01-07 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Jan  7 18:20:48 2016
New Revision: 257121

URL: http://llvm.org/viewvc/llvm-project?rev=257121=rev
Log:
Change the key name for the libdispatch queue serial number from
"qserial" to "qserialnum" because "qserial" looks a lot like the
queue type (either 'serial' or 'concurrent') and can be confusing
to read through.  debugserver passes these up either in the questionmark
("T") packet, or in the response to the jThreadsInfo packet.

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
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=257121=257120=257121=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Thu Jan  
7 18:20:48 2016
@@ -2250,7 +2250,7 @@ ProcessGDBRemote::SetThreadStopInfo (Str
 static ConstString g_key_qaddr("qaddr");
 static ConstString g_key_queue_name("qname");
 static ConstString g_key_queue_kind("qkind");
-static ConstString g_key_queue_serial("qserial");
+static ConstString g_key_queue_serial_number("qserialnum");
 static ConstString g_key_registers("registers");
 static ConstString g_key_memory("memory");
 static ConstString g_key_address("address");
@@ -2272,7 +2272,7 @@ ProcessGDBRemote::SetThreadStopInfo (Str
 bool queue_vars_valid = false;
 std::string queue_name;
 QueueKind queue_kind = eQueueKindUnknown;
-uint64_t queue_serial = 0;
+uint64_t queue_serial_number = 0;
 // Iterate through all of the thread dictionary key/value pairs from the 
structured data dictionary
 
 thread_dict->ForEach([this,
@@ -2288,7 +2288,7 @@ ProcessGDBRemote::SetThreadStopInfo (Str
   _vars_valid,
   _name,
   _kind,
-  _serial]
+  _serial_number]
   (ConstString key, StructuredData::Object* object) -> 
bool
 {
 if (key == g_key_tid)
@@ -2340,10 +2340,10 @@ ProcessGDBRemote::SetThreadStopInfo (Str
 queue_kind = eQueueKindConcurrent;
 }
 }
-else if (key == g_key_queue_serial)
+else if (key == g_key_queue_serial_number)
 {
-queue_serial = object->GetIntegerValue(0);
-if (queue_serial != 0)
+queue_serial_number = object->GetIntegerValue(0);
+if (queue_serial_number != 0)
 queue_vars_valid = true;
 }
 else if (key == g_key_reason)
@@ -2418,7 +2418,7 @@ ProcessGDBRemote::SetThreadStopInfo (Str
   queue_vars_valid,
   queue_name,
   queue_kind,
-  queue_serial);
+  queue_serial_number);
 }
 
 StateType
@@ -2463,7 +2463,7 @@ ProcessGDBRemote::SetThreadStopInfo (Str
 bool queue_vars_valid = false; // says if locals below that start 
with "queue_" are valid
 std::string queue_name;
 QueueKind queue_kind = eQueueKindUnknown;
-uint64_t queue_serial = 0;
+uint64_t queue_serial_number = 0;
 ExpeditedRegisterMap expedited_register_map;
 while (stop_packet.GetNameColonValue(key, value))
 {
@@ -2577,10 +2577,10 @@ ProcessGDBRemote::SetThreadStopInfo (Str
 queue_kind = eQueueKindConcurrent;
 }
 }
-else if (key.compare("qserial") == 0)
+else if (key.compare("qserialnum") == 0)
 {
-queue_serial = StringConvert::ToUInt64 (value.c_str(), 0, 
0);
-if (queue_serial != 0)
+queue_serial_number = StringConvert::ToUInt64 
(value.c_str(), 0, 0);
+if (queue_serial_number != 0)
 queue_vars_valid = true;
 }
 else if (key.compare("reason") == 0)
@@ -2680,7 +2680,7 @@ ProcessGDBRemote::SetThreadStopInfo (Str
 queue_vars_valid,
 queue_name,
 queue_kind,
-queue_serial);
+queue_serial_number);
 
 return eStateStopped;
 }

Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=257121=257120=257121=diff

Re: [Lldb-commits] [PATCH] D15979: Fix dwarf sequence insertions

2016-01-07 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks good.


http://reviews.llvm.org/D15979



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


[Lldb-commits] [lldb] r257113 - Better scheme to lookup alternate mangled name when looking up function address.

2016-01-07 Thread Siva Chandra via lldb-commits
Author: sivachandra
Date: Thu Jan  7 17:32:34 2016
New Revision: 257113

URL: http://llvm.org/viewvc/llvm-project?rev=257113=rev
Log:
Better scheme to lookup alternate mangled name when looking up function address.

Summary:
This change is relevant for inferiors compiled with GCC. GCC does not
emit complete debug info for std::basic_string<...>, and consequently, Clang
(the LLDB compiler) does not generate correct mangled names for certain
functions.

This change removes the hard-coded alternate names in
ItaniumABILanguageRuntime.cpp.

Before the hard-coded names were put in ItaniumABILanguageRuntime.cpp, one could
not evaluate std::string methods (ex. std::string::length). After putting in
the hard-coded names, one could evaluate them. However, it did not still
enable one to call methods on, say for example, std::vector.
This change makes that possible.

There is some amount of incompleteness in this change. Consider the
following example:

std::string hello("hello"), world("world");
std::map m;
m[hello] = world;

One can still not evaluate the expression "m[hello]" in LLDB. Will
address this issue in another pass.

Reviewers: jingham, vharron, evgeny777, spyffe, dawn

Subscribers: clayborg, dawn, lldb-commits

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

Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h
lldb/trunk/include/lldb/Symbol/GoASTContext.h
lldb/trunk/include/lldb/Symbol/SymbolFile.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h

lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp

lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/CompilerDeclContext.cpp
lldb/trunk/source/Symbol/SymbolFile.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=257113=257112=257113=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Thu Jan  7 17:32:34 2016
@@ -573,6 +573,9 @@ public:
 ConstString
 DeclContextGetName (void *opaque_decl_ctx) override;
 
+ConstString
+DeclContextGetScopeQualifiedName (void *opaque_decl_ctx) override;
+
 bool
 DeclContextIsClassMethod (void *opaque_decl_ctx,
   lldb::LanguageType *language_ptr,

Modified: lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h?rev=257113=257112=257113=diff
==
--- lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h Thu Jan  7 17:32:34 
2016
@@ -128,6 +128,9 @@ public:
 ConstString
 GetName () const;
 
+ConstString
+GetScopeQualifiedName() const;
+
 bool
 IsStructUnionOrClass () const;
 

Modified: lldb/trunk/include/lldb/Symbol/GoASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/GoASTContext.h?rev=257113=257112=257113=diff
==
--- lldb/trunk/include/lldb/Symbol/GoASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/GoASTContext.h Thu Jan  7 17:32:34 2016
@@ -112,6 +112,12 @@ class GoASTContext : public TypeSystem
 return ConstString();
 }
 
+ConstString
+DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) override
+{
+return ConstString();
+}
+
 bool
 DeclContextIsClassMethod(void *opaque_decl_ctx, lldb::LanguageType 
*language_ptr, bool *is_instance_method_ptr,
  ConstString *language_object_name_ptr) override

Modified: lldb/trunk/include/lldb/Symbol/SymbolFile.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolFile.h?rev=257113=257112=257113=diff
==
--- 

[Lldb-commits] [PATCH] D15972: Make sure we don't send qModuleInfo packets unnecessarily.

2016-01-07 Thread Stephane Sezer via lldb-commits
sas created this revision.
sas added a reviewer: clayborg.
sas added subscribers: lldb-commits, fjricci.

Some debug servers don't support it so there's no point in spamming
this.

http://reviews.llvm.org/D15972

Files:
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h

Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -619,6 +619,7 @@
 m_supports_QEnvironment:1,
 m_supports_QEnvironmentHexEncoded:1,
 m_supports_qSymbol:1,
+m_supports_qModuleInfo:1,
 m_supports_jThreadsInfo:1;
 
 lldb::pid_t m_curr_pid;
Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -101,6 +101,7 @@
 m_supports_QEnvironment (true),
 m_supports_QEnvironmentHexEncoded (true),
 m_supports_qSymbol (true),
+m_supports_qModuleInfo (true),
 m_supports_jThreadsInfo (true),
 m_curr_pid (LLDB_INVALID_PROCESS_ID),
 m_curr_tid (LLDB_INVALID_THREAD_ID),
@@ -376,6 +377,7 @@
 m_supports_QEnvironment = true;
 m_supports_QEnvironmentHexEncoded = true;
 m_supports_qSymbol = true;
+m_supports_qModuleInfo = true;
 m_host_arch.Clear();
 m_os_version_major = UINT32_MAX;
 m_os_version_minor = UINT32_MAX;
@@ -4284,6 +4286,9 @@
  const lldb_private::ArchSpec& 
arch_spec,
  ModuleSpec _spec)
 {
+if (!m_supports_qModuleInfo)
+return false;
+
 std::string module_path = module_file_spec.GetPath (false);
 if (module_path.empty ())
 return false;
@@ -4299,8 +4304,14 @@
 if (SendPacketAndWaitForResponse (packet.GetData(), packet.GetSize(), 
response, false) != PacketResult::Success)
 return false;
 
-if (response.IsErrorResponse () || response.IsUnsupportedResponse ())
+if (response.IsErrorResponse ())
+return false;
+
+if (response.IsUnsupportedResponse ())
+{
+m_supports_qModuleInfo = false;
 return false;
+}
 
 std::string name;
 std::string value;


Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -619,6 +619,7 @@
 m_supports_QEnvironment:1,
 m_supports_QEnvironmentHexEncoded:1,
 m_supports_qSymbol:1,
+m_supports_qModuleInfo:1,
 m_supports_jThreadsInfo:1;
 
 lldb::pid_t m_curr_pid;
Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -101,6 +101,7 @@
 m_supports_QEnvironment (true),
 m_supports_QEnvironmentHexEncoded (true),
 m_supports_qSymbol (true),
+m_supports_qModuleInfo (true),
 m_supports_jThreadsInfo (true),
 m_curr_pid (LLDB_INVALID_PROCESS_ID),
 m_curr_tid (LLDB_INVALID_THREAD_ID),
@@ -376,6 +377,7 @@
 m_supports_QEnvironment = true;
 m_supports_QEnvironmentHexEncoded = true;
 m_supports_qSymbol = true;
+m_supports_qModuleInfo = true;
 m_host_arch.Clear();
 m_os_version_major = UINT32_MAX;
 m_os_version_minor = UINT32_MAX;
@@ -4284,6 +4286,9 @@
  const lldb_private::ArchSpec& arch_spec,
  ModuleSpec _spec)
 {
+if (!m_supports_qModuleInfo)
+return false;
+
 std::string module_path = module_file_spec.GetPath (false);
 if (module_path.empty ())
 return false;
@@ -4299,8 +4304,14 @@
 if (SendPacketAndWaitForResponse (packet.GetData(), packet.GetSize(), response, false) != PacketResult::Success)
 return false;
 
-if (response.IsErrorResponse () || response.IsUnsupportedResponse ())
+if (response.IsErrorResponse ())
+return false;
+
+if (response.IsUnsupportedResponse ())
+{
+m_supports_qModuleInfo = false;
 return false;
+}
 
 std::string name;
 std::string value;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r257116 - Make sure we don't send qModuleInfo packets unnecessarily.

2016-01-07 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Thu Jan  7 18:00:17 2016
New Revision: 257116

URL: http://llvm.org/viewvc/llvm-project?rev=257116=rev
Log:
Make sure we don't send qModuleInfo packets unnecessarily.

Summary:
Some debug servers don't support it so there's no point in spamming
this.

Reviewers: clayborg

Subscribers: fjricci, lldb-commits

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

Modified:

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

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=257116=257115=257116=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
Thu Jan  7 18:00:17 2016
@@ -101,6 +101,7 @@ GDBRemoteCommunicationClient::GDBRemoteC
 m_supports_QEnvironment (true),
 m_supports_QEnvironmentHexEncoded (true),
 m_supports_qSymbol (true),
+m_supports_qModuleInfo (true),
 m_supports_jThreadsInfo (true),
 m_curr_pid (LLDB_INVALID_PROCESS_ID),
 m_curr_tid (LLDB_INVALID_THREAD_ID),
@@ -376,6 +377,7 @@ GDBRemoteCommunicationClient::ResetDisco
 m_supports_QEnvironment = true;
 m_supports_QEnvironmentHexEncoded = true;
 m_supports_qSymbol = true;
+m_supports_qModuleInfo = true;
 m_host_arch.Clear();
 m_os_version_major = UINT32_MAX;
 m_os_version_minor = UINT32_MAX;
@@ -4284,6 +4286,9 @@ GDBRemoteCommunicationClient::GetModuleI
  const lldb_private::ArchSpec& 
arch_spec,
  ModuleSpec _spec)
 {
+if (!m_supports_qModuleInfo)
+return false;
+
 std::string module_path = module_file_spec.GetPath (false);
 if (module_path.empty ())
 return false;
@@ -4299,8 +4304,14 @@ GDBRemoteCommunicationClient::GetModuleI
 if (SendPacketAndWaitForResponse (packet.GetData(), packet.GetSize(), 
response, false) != PacketResult::Success)
 return false;
 
-if (response.IsErrorResponse () || response.IsUnsupportedResponse ())
+if (response.IsErrorResponse ())
+return false;
+
+if (response.IsUnsupportedResponse ())
+{
+m_supports_qModuleInfo = false;
 return false;
+}
 
 std::string name;
 std::string value;

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=257116=257115=257116=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h 
Thu Jan  7 18:00:17 2016
@@ -619,6 +619,7 @@ protected:
 m_supports_QEnvironment:1,
 m_supports_QEnvironmentHexEncoded:1,
 m_supports_qSymbol:1,
+m_supports_qModuleInfo:1,
 m_supports_jThreadsInfo:1;
 
 lldb::pid_t m_curr_pid;


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


Re: [Lldb-commits] [PATCH] D15972: Make sure we don't send qModuleInfo packets unnecessarily.

2016-01-07 Thread Stephane Sezer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257116: Make sure we don't send qModuleInfo packets 
unnecessarily. (authored by sas).

Changed prior to commit:
  http://reviews.llvm.org/D15972?vs=44268=44288#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15972

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

Index: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -619,6 +619,7 @@
 m_supports_QEnvironment:1,
 m_supports_QEnvironmentHexEncoded:1,
 m_supports_qSymbol:1,
+m_supports_qModuleInfo:1,
 m_supports_jThreadsInfo:1;
 
 lldb::pid_t m_curr_pid;
Index: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -101,6 +101,7 @@
 m_supports_QEnvironment (true),
 m_supports_QEnvironmentHexEncoded (true),
 m_supports_qSymbol (true),
+m_supports_qModuleInfo (true),
 m_supports_jThreadsInfo (true),
 m_curr_pid (LLDB_INVALID_PROCESS_ID),
 m_curr_tid (LLDB_INVALID_THREAD_ID),
@@ -376,6 +377,7 @@
 m_supports_QEnvironment = true;
 m_supports_QEnvironmentHexEncoded = true;
 m_supports_qSymbol = true;
+m_supports_qModuleInfo = true;
 m_host_arch.Clear();
 m_os_version_major = UINT32_MAX;
 m_os_version_minor = UINT32_MAX;
@@ -4284,6 +4286,9 @@
  const lldb_private::ArchSpec& 
arch_spec,
  ModuleSpec _spec)
 {
+if (!m_supports_qModuleInfo)
+return false;
+
 std::string module_path = module_file_spec.GetPath (false);
 if (module_path.empty ())
 return false;
@@ -4299,8 +4304,14 @@
 if (SendPacketAndWaitForResponse (packet.GetData(), packet.GetSize(), 
response, false) != PacketResult::Success)
 return false;
 
-if (response.IsErrorResponse () || response.IsUnsupportedResponse ())
+if (response.IsErrorResponse ())
+return false;
+
+if (response.IsUnsupportedResponse ())
+{
+m_supports_qModuleInfo = false;
 return false;
+}
 
 std::string name;
 std::string value;


Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -619,6 +619,7 @@
 m_supports_QEnvironment:1,
 m_supports_QEnvironmentHexEncoded:1,
 m_supports_qSymbol:1,
+m_supports_qModuleInfo:1,
 m_supports_jThreadsInfo:1;
 
 lldb::pid_t m_curr_pid;
Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -101,6 +101,7 @@
 m_supports_QEnvironment (true),
 m_supports_QEnvironmentHexEncoded (true),
 m_supports_qSymbol (true),
+m_supports_qModuleInfo (true),
 m_supports_jThreadsInfo (true),
 m_curr_pid (LLDB_INVALID_PROCESS_ID),
 m_curr_tid (LLDB_INVALID_THREAD_ID),
@@ -376,6 +377,7 @@
 m_supports_QEnvironment = true;
 m_supports_QEnvironmentHexEncoded = true;
 m_supports_qSymbol = true;
+m_supports_qModuleInfo = true;
 m_host_arch.Clear();
 m_os_version_major = UINT32_MAX;
 m_os_version_minor = UINT32_MAX;
@@ -4284,6 +4286,9 @@
  const lldb_private::ArchSpec& arch_spec,
  ModuleSpec _spec)
 {
+if (!m_supports_qModuleInfo)
+return false;
+
 std::string module_path = module_file_spec.GetPath (false);
 if (module_path.empty ())
 return false;
@@ -4299,8 +4304,14 @@
 if (SendPacketAndWaitForResponse (packet.GetData(), packet.GetSize(), response, false) != PacketResult::Success)
 return false;
 
-if (response.IsErrorResponse () || response.IsUnsupportedResponse ())
+if (response.IsErrorResponse ())
+return false;
+
+if (response.IsUnsupportedResponse ())
+{
+m_supports_qModuleInfo = false;
  

Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor

2016-01-07 Thread Jim Ingham via lldb-commits
jingham added a comment.

Can you post the backtrace in this case?  It seems to me odd that CanJIT -> 
AllocateMemory needs to construct the AppleObjCRuntime to do its job.  I'd 
rather cut the chain at that point if it makes sense.


http://reviews.llvm.org/D15978



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


Re: [Lldb-commits] [PATCH] D15834: Handle hardcoded breakpoints on Windows (e.g., int3 or __debugbreak())

2016-01-07 Thread Adrian McCarthy via lldb-commits
amccarth updated this revision to Diff 44264.
amccarth added a comment.

Restored TestBuiltinTrap.py because that's actually for something else.

Changed TestDebugbreak.py to use asm("int3") on non-Windows x86.

I've ordered a Linux box, but I don't currently have one, so I haven't been 
able to try this on Linux yet.


http://reviews.llvm.org/D15834

Files:
  packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/Makefile
  
packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
  packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c
  source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp

Index: source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp
===
--- source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp
+++ source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp
@@ -550,56 +550,74 @@
 if (!stop_thread)
 return;
 
-RegisterContextSP register_context = stop_thread->GetRegisterContext();
-
-// The current EIP is AFTER the BP opcode, which is one byte.
-uint64_t pc = register_context->GetPC() - 1;
-if (active_exception->GetExceptionCode() == EXCEPTION_BREAKPOINT)
+switch (active_exception->GetExceptionCode())
 {
-BreakpointSiteSP site(GetBreakpointSiteList().FindByAddress(pc));
+case EXCEPTION_SINGLE_STEP:
+{
+stop_info = StopInfo::CreateStopReasonToTrace(*stop_thread);
+stop_thread->SetStopInfo(stop_info);
+WINLOG_IFANY(WINDOWS_LOG_EXCEPTION | WINDOWS_LOG_STEP, "RefreshStateAfterStop single stepping thread %u",
+ stop_thread->GetID());
+stop_thread->SetStopInfo(stop_info);
+return;
+}
 
-if (site)
+case EXCEPTION_BREAKPOINT:
 {
-WINLOG_IFANY(WINDOWS_LOG_BREAKPOINTS | WINDOWS_LOG_EXCEPTION,
- "RefreshStateAfterStop detected breakpoint in process %I64u at "
- "address 0x%I64x with breakpoint site %d",
- m_session_data->m_debugger->GetProcess().GetProcessId(), pc, site->GetID());
+RegisterContextSP register_context = stop_thread->GetRegisterContext();
 
-if (site->ValidForThisThread(stop_thread.get()))
-{
-WINLOG_IFALL(WINDOWS_LOG_BREAKPOINTS | WINDOWS_LOG_EXCEPTION,
- "Breakpoint site %d is valid for this thread (0x%I64x), creating stop info.",
- site->GetID(), stop_thread->GetID());
+// The current EIP is AFTER the BP opcode, which is one byte.
+uint64_t pc = register_context->GetPC() - 1;
 
-stop_info = StopInfo::CreateStopReasonWithBreakpointSiteID(
-*stop_thread, site->GetID());
-register_context->SetPC(pc);
+BreakpointSiteSP site(GetBreakpointSiteList().FindByAddress(pc));
+if (site)
+{
+WINLOG_IFANY(WINDOWS_LOG_BREAKPOINTS | WINDOWS_LOG_EXCEPTION,
+ "RefreshStateAfterStop detected breakpoint in process %I64u at "
+ "address 0x%I64x with breakpoint site %d",
+ m_session_data->m_debugger->GetProcess().GetProcessId(), pc, site->GetID());
+
+if (site->ValidForThisThread(stop_thread.get()))
+{
+WINLOG_IFALL(WINDOWS_LOG_BREAKPOINTS | WINDOWS_LOG_EXCEPTION,
+ "Breakpoint site %d is valid for this thread (0x%I64x), creating stop info.",
+ site->GetID(), stop_thread->GetID());
+
+stop_info = StopInfo::CreateStopReasonWithBreakpointSiteID(
+*stop_thread, site->GetID());
+register_context->SetPC(pc);
+}
+else
+{
+WINLOG_IFALL(WINDOWS_LOG_BREAKPOINTS | WINDOWS_LOG_EXCEPTION,
+ "Breakpoint site %d is not valid for this thread, creating empty stop info.",
+ site->GetID());
+}
+stop_thread->SetStopInfo(stop_info);
+return;
 }
 else
 {
+// The thread hit a hard-coded breakpoint like an `int 3` or `__debugbreak()`.
 WINLOG_IFALL(WINDOWS_LOG_BREAKPOINTS | WINDOWS_LOG_EXCEPTION,
- "Breakpoint site %d is not valid for this thread, creating empty stop info.",
- site->GetID());
+"No breakpoint site matches for this thread. __debugbreak()?  "
+"Creating stop info with the exception.");
+// FALLTHROUGH:  We'll treat this as a generic exception record 

Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.

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

Rebase


http://reviews.llvm.org/D12809

Files:
  include/lldb/Symbol/ClangASTContext.h
  include/lldb/Symbol/CompilerDeclContext.h
  include/lldb/Symbol/GoASTContext.h
  include/lldb/Symbol/SymbolFile.h
  include/lldb/Symbol/TypeSystem.h
  include/lldb/Target/CPPLanguageRuntime.h
  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
  
source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
  
source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
  
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
  source/Plugins/SymbolFile/DWARF/DIERef.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Symbol/ClangASTContext.cpp
  source/Symbol/CompilerDeclContext.cpp
  source/Symbol/SymbolFile.cpp

Index: source/Symbol/SymbolFile.cpp
===
--- source/Symbol/SymbolFile.cpp
+++ source/Symbol/SymbolFile.cpp
@@ -134,6 +134,12 @@
 return 0;
 }
 
+void
+SymbolFile::GetMangledNamesForFunction(const std::string _qualified_name, std::vector _names)
+{
+return;
+}
+
 uint32_t
 SymbolFile::FindTypes (const SymbolContext& sc, const ConstString , const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, TypeMap& types)
 {
Index: source/Symbol/CompilerDeclContext.cpp
===
--- source/Symbol/CompilerDeclContext.cpp
+++ source/Symbol/CompilerDeclContext.cpp
@@ -38,6 +38,15 @@
 return ConstString();
 }
 
+ConstString
+CompilerDeclContext::GetScopeQualifiedName () const
+{
+if (IsValid())
+return m_type_system->DeclContextGetScopeQualifiedName(m_opaque_decl_ctx);
+else
+return ConstString();
+}
+
 bool
 CompilerDeclContext::IsStructUnionOrClass () const
 {
Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -9969,6 +9969,18 @@
 return ConstString();
 }
 
+ConstString
+ClangASTContext::DeclContextGetScopeQualifiedName (void *opaque_decl_ctx)
+{
+if (opaque_decl_ctx)
+{
+clang::NamedDecl *named_decl = llvm::dyn_cast((clang::DeclContext *)opaque_decl_ctx);
+if (named_decl)
+return ConstString(llvm::StringRef(named_decl->getQualifiedNameAsString()));
+}
+return ConstString();
+}
+
 bool
 ClangASTContext::DeclContextIsClassMethod (void *opaque_decl_ctx,
lldb::LanguageType *language_ptr,
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -208,6 +208,10 @@
bool append,
lldb_private::SymbolContextList& sc_list) override;
 
+void
+GetMangledNamesForFunction (const std::string _qualified_name,
+std::vector _names) override;
+
 uint32_t
 FindTypes (const lldb_private::SymbolContext& sc,
const lldb_private::ConstString ,
@@ -577,6 +581,9 @@
 m_fetched_external_modules:1;
 lldb_private::LazyBool  m_supports_DW_AT_APPLE_objc_complete_type;
 
+typedef std::shared_ptr DIERefSetSP;
+typedef std::unordered_map NameToOffsetMap;
+NameToOffsetMap m_function_scope_qualified_name_map;
 std::unique_ptr m_ranges;
 UniqueDWARFASTTypeMap m_unique_ast_type_map;
 DIEToTypePtr m_die_to_type;
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2927,6 +2927,40 @@
 return sc_list.GetSize() - original_size;
 }
 
+void
+SymbolFileDWARF::GetMangledNamesForFunction (const std::string _qualified_name,
+ std::vector _names)
+{
+DWARFDebugInfo* info = DebugInfo();
+uint32_t num_comp_units = 0;
+if (info)
+num_comp_units = info->GetNumCompileUnits();
+
+for (uint32_t i = 0; i < num_comp_units; i++)
+{
+DWARFCompileUnit *cu = info->GetCompileUnitAtIndex(i);
+if (cu == nullptr)
+continue;
+
+SymbolFileDWARFDwo *dwo = cu->GetDwoSymbolFile();
+if (dwo)
+dwo->GetMangledNamesForFunction(scope_qualified_name, mangled_names);
+}
+
+

[Lldb-commits] [lldb] r257052 - Remove some Windows->Android XTIMEOUTs

2016-01-07 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Jan  7 05:16:30 2016
New Revision: 257052

URL: http://llvm.org/viewvc/llvm-project?rev=257052=rev
Log:
Remove some Windows->Android XTIMEOUTs

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dosep.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dosep.py?rev=257052=257051=257052=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dosep.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dosep.py Thu Jan  7 05:16:30 2016
@@ -1149,11 +1149,6 @@ def getExpectedTimeouts(platform_name):
 "TestExitDuringStep.py",
 "TestHelloWorld.py",
 }
-if host.startswith("win32"):
-expected_timeout |= {
-"TestEvents.py",
-"TestThreadStates.py",
-}
 elif target.startswith("freebsd"):
 expected_timeout |= {
 "TestBreakpointConditions.py",


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


[Lldb-commits] [PATCH] D15948: Remove duplicate header added in http://reviews.llvm.org/rL256927

2016-01-07 Thread Luke Drummond via lldb-commits
ldrumm created this revision.
ldrumm added a reviewer: EwanCrawford.
ldrumm added a subscriber: lldb-commits.

rL256927 included a duplicate `StreamString` header file. This patch simply 
removes the duplicate.

http://reviews.llvm.org/D15948

Files:
  source/Core/StringList.cpp

Index: source/Core/StringList.cpp
===
--- source/Core/StringList.cpp
+++ source/Core/StringList.cpp
@@ -12,7 +12,6 @@
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
-#include "lldb/Core/StreamString.h"
 
 #include 
 


Index: source/Core/StringList.cpp
===
--- source/Core/StringList.cpp
+++ source/Core/StringList.cpp
@@ -12,7 +12,6 @@
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
-#include "lldb/Core/StreamString.h"
 
 #include 
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15948: Remove duplicate header added in http://reviews.llvm.org/rL256927

2016-01-07 Thread Ewan Crawford via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL257061: Remove duplicate header added in r256927 (authored 
by EwanCrawford).

Changed prior to commit:
  http://reviews.llvm.org/D15948?vs=44205=44207#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15948

Files:
  lldb/trunk/source/Core/StringList.cpp

Index: lldb/trunk/source/Core/StringList.cpp
===
--- lldb/trunk/source/Core/StringList.cpp
+++ lldb/trunk/source/Core/StringList.cpp
@@ -12,7 +12,6 @@
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
-#include "lldb/Core/StreamString.h"
 
 #include 
 


Index: lldb/trunk/source/Core/StringList.cpp
===
--- lldb/trunk/source/Core/StringList.cpp
+++ lldb/trunk/source/Core/StringList.cpp
@@ -12,7 +12,6 @@
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
-#include "lldb/Core/StreamString.h"
 
 #include 
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r257068 - XFAIL TestMultithreaded on linux

2016-01-07 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Jan  7 09:24:51 2016
New Revision: 257068

URL: http://llvm.org/viewvc/llvm-project?rev=257068=rev
Log:
XFAIL TestMultithreaded on linux

Test sometimes fails even during the reruns, upgrading to xflaky to xfail.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py?rev=257068=257067=257068=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
 Thu Jan  7 09:24:51 2016
@@ -51,7 +51,7 @@ class SBBreakpointCallbackCase(TestBase)
 @skipIfNoSBHeaders
 @skipIfWindows # clang-cl does not support throw or catch 
(llvm.org/pr24538)
 @expectedFlakeyFreeBSD
-@expectedFlakeyLinux
+@expectedFailureLinux
 def test_sb_api_listener_resume(self):
 """ Test that a process can be resumed from a non-main thread. """
 self.build_and_test('driver.cpp listener_test.cpp 
test_listener_resume.cpp',


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


Re: [Lldb-commits] [PATCH] D15979: Fix dwarf sequence insertions

2016-01-07 Thread Stephane Sezer via lldb-commits
sas closed this revision.
sas added a comment.

Committed as r257132.


http://reviews.llvm.org/D15979



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


[Lldb-commits] [lldb] r257132 - Fix dwarf sequence insertions

2016-01-07 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Thu Jan  7 19:39:14 2016
New Revision: 257132

URL: http://llvm.org/viewvc/llvm-project?rev=257132=rev
Log:
Fix dwarf sequence insertions

Summary:
If two dwarf sequences begin with entries that have identical addresses,
it is possible for the comparator to order the first entry of the new
sequence between the first and second entries of the existing sequence.

This will result in an attempted insertion of the second sequence inside
of the first sequence, which is invalid.

Ensure that insertions only occur in between existing sequences.

Reviewers: andrew.w.kaylor, clayborg

Subscribers: sas, lldb-commits

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

Change by Francis Ricci 

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

Modified: lldb/trunk/source/Symbol/LineTable.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/LineTable.cpp?rev=257132=257131=257132=diff
==
--- lldb/trunk/source/Symbol/LineTable.cpp (original)
+++ lldb/trunk/source/Symbol/LineTable.cpp Thu Jan  7 19:39:14 2016
@@ -143,6 +143,13 @@ LineTable::InsertSequence (LineSequence*
 entry_collection::iterator end_pos = m_entries.end();
 LineTable::Entry::LessThanBinaryPredicate less_than_bp(this);
 entry_collection::iterator pos = upper_bound(begin_pos, end_pos, entry, 
less_than_bp);
+
+// We should never insert a sequence in the middle of another sequence
+if (pos != begin_pos) {
+while (pos < end_pos && !((pos - 1)->is_terminal_entry))
+pos++;
+}
+
 #ifdef LLDB_CONFIGURATION_DEBUG
 // If we aren't inserting at the beginning, the previous entry should
 // terminate a sequence.


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


Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor

2016-01-07 Thread Jim Ingham via lldb-commits
jingham added a comment.

Cool!  For completeness I think it is a good idea to do this to all the 
functions in InferiorCallPOSIX.  For the general InferiorCall one it might be a 
good idea to add a defaulted (to false) parameter so that if somebody really 
needs to use it for something that might throw they can.  But this is for 
calling simple low level function which shouldn't be throwing, so defaulting to 
not firing up the runtimes to catch exceptions is more appropriate.

Then this is good to go.


http://reviews.llvm.org/D15978



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


Re: [Lldb-commits] [lldb] r257117 - Performance improvement: Change lldb so that it puts a breakpoint

2016-01-07 Thread Jason Molenda via lldb-commits
Thanks Siva, I'll revert the change.  I have access to a linux machine but I 
haven't used it in a long time.  Would it be easy to send me the binary (with 
debug info) for this test case so I can see what gcc emitted here and figure 
out how it went wrong?  This test passes with clang on x86_64 darwin but there 
must be something in gcc's debug info that is confusing it.

Jason


> On Jan 7, 2016, at 6:16 PM, Siva Chandra  wrote:
> 
> This broke TestStepNoDebug, atleast on Linux when inferior is compiled
> with GCC: 
> http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/10091
> 
> I am able to reproduce this on my machine. Let me know if you need any
> help with anything.
> 
> On Thu, Jan 7, 2016 at 4:06 PM, Jason Molenda via lldb-commits
>  wrote:
>> Author: jmolenda
>> Date: Thu Jan  7 18:06:03 2016
>> New Revision: 257117
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=257117=rev
>> Log:
>> Performance improvement: Change lldb so that it puts a breakpoint
>> on the first branch instruction after a function return (or the end
>> of a source line), instead of a breakpoint on the return address,
>> to skip an extra stop & start of the inferior process.
>> 
>> I changed Process::AdvanceAddressToNextBranchInstruction to not
>> take an optional InstructionList argument - no callers are providing
>> a cached InstructionList today, and if this function was going to
>> do that, the right thing to do would be to fill out / use a
>> DisassemblerSP which is a disassembler with the InstructionList for
>> this address range.
>> 
>> 
>> http://reviews.llvm.org/D15708
>> 
>> 
>> 
>> Modified:
>>lldb/trunk/include/lldb/Target/Process.h
>>lldb/trunk/include/lldb/Target/Thread.h
>>lldb/trunk/include/lldb/Target/ThreadPlanStepOut.h
>>lldb/trunk/source/Target/Process.cpp
>>lldb/trunk/source/Target/Thread.cpp
>>lldb/trunk/source/Target/ThreadPlanShouldStopHere.cpp
>>lldb/trunk/source/Target/ThreadPlanStepOut.cpp
>>lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
>> 
>> Modified: lldb/trunk/include/lldb/Target/Process.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=257117=257116=257117=diff
>> ==
>> --- lldb/trunk/include/lldb/Target/Process.h (original)
>> +++ lldb/trunk/include/lldb/Target/Process.h Thu Jan  7 18:06:03 2016
>> @@ -3149,6 +3149,34 @@ public:
>> void
>> ResetImageToken(size_t token);
>> 
>> +//--
>> +/// Find the next branch instruction to set a breakpoint on
>> +///
>> +/// When instruction stepping through a source line, instead of
>> +/// stepping through each instruction, we can put a breakpoint on
>> +/// the next branch instruction (within the range of instructions
>> +/// we are stepping through) and continue the process to there,
>> +/// yielding significant performance benefits over instruction
>> +/// stepping.
>> +///
>> +/// @param[in] default_stop_addr
>> +/// The address of the instruction where lldb would put a
>> +/// breakpoint normally.
>> +///
>> +/// @param[in] range_bounds
>> +/// The range which the breakpoint must be contained within.
>> +/// Typically a source line.
>> +///
>> +/// @return
>> +/// The address of the next branch instruction, or the end of
>> +/// the range provided in range_bounds.  If there are any
>> +/// problems with the disassembly or getting the instructions,
>> +/// the original default_stop_addr will be returned.
>> +//--
>> +Address
>> +AdvanceAddressToNextBranchInstruction (Address default_stop_addr,
>> +   AddressRange range_bounds);
>> +
>> protected:
>> void
>> SetState (lldb::EventSP _sp);
>> 
>> Modified: lldb/trunk/include/lldb/Target/Thread.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=257117=257116=257117=diff
>> ==
>> --- lldb/trunk/include/lldb/Target/Thread.h (original)
>> +++ lldb/trunk/include/lldb/Target/Thread.h Thu Jan  7 18:06:03 2016
>> @@ -888,6 +888,16 @@ public:
>> /// @param[in] run_vote
>> ///See standard meanings for the stop & run votes in ThreadPlan.h.
>> ///
>> +/// @param[in] continue_to_next_branch
>> +///Normally this will enqueue a plan that will put a breakpoint on 
>> the return address and continue
>> +///to there.  If continue_to_next_branch is true, this is an 
>> operation not involving the user --
>> +///e.g. stepping "next" in a source line and we instruction stepped 
>> into another function --
>> +///

Re: [Lldb-commits] [lldb] r257117 - Performance improvement: Change lldb so that it puts a breakpoint

2016-01-07 Thread Jason Molenda via lldb-commits
Thanks for the help with this.  

The problem is that lldb would try to advance the return breakpoint in 
no_debug_caller:

(lldb) disass -b
a.out`no_debug_caller:
0x4005dd <+0>:  55pushq  %rbp
0x4005de <+1>:  48 89 e5  movq   %rsp, %rbp
0x4005e1 <+4>:  48 83 ec 20   subq   $0x20, %rsp
0x4005e5 <+8>:  89 7d ec  movl   %edi, -0x14(%rbp)
0x4005e8 <+11>: 48 89 75 e0   movq   %rsi, -0x20(%rbp)
0x4005ec <+15>: c7 45 fc 00 00 00 00  movl   $0x0, -0x4(%rbp)
0x4005f3 <+22>: 48 8b 55 e0   movq   -0x20(%rbp), %rdx
0x4005f7 <+26>: 8b 45 ec  movl   -0x14(%rbp), %eax
0x4005fa <+29>: 48 89 d6  movq   %rdx, %rsi
0x4005fd <+32>: 89 c7 movl   %eax, %edi
0x4005ff <+34>: e8 b0 ff ff ffcallq  0x4005b4  ; 
no_debug_caller_intermediate
0x400604 <+39>: 89 45 fc  movl   %eax, -0x4(%rbp)
0x400607 <+42>: 8b 45 fc  movl   -0x4(%rbp), %eax
0x40060a <+45>: c9leave  
0x40060b <+46>: c3retq   

which has no source line information so ThreadPlanStepOut::ThreadPlanStepOut() 
would advance that to the last instruction of the function (retq) and stop 
there.  This is arguably not necessary or even helpful, so I could simply 
change ThreadPlanStepOut::ThreadPlanStepOut to not advance the pc unless we 
have source line information (the only time we're really doing anything to help 
the user / performance).

When we stop on the retq instruction, we expose the fact that lldb doesn't know 
what the 'leave' instruction does so the unwind information is wrong.  Instead 
of finding the caller is main(), we find the stack frame above that, 
__libc_start_main() which has some random debug info for line 321 (which is how 
that line # came up in the testsuite failure).  You can see this with the 
unwind info difference between the assembly profiling and the eh_frame 
information:

Assembly language inspection UnwindPlan:
This UnwindPlan originally sourced from assembly insn profiling
This UnwindPlan is sourced from the compiler: no.
This UnwindPlan is valid at all instruction locations: yes.
Address range of this UnwindPlan: [a.out..text + 413-0x01cc)
row[0]:0: CFA=rsp +8 => rsp=CFA+0 rip=[CFA-8] 
row[1]:1: CFA=rsp+16 => rbp=[CFA-16] rsp=CFA+0 rip=[CFA-8] 
row[2]:4: CFA=rbp+16 => rbp=[CFA-16] rsp=CFA+0 rip=[CFA-8] 
row[3]:   46: CFA=rbp+16 => rbp=[CFA-16] rsp=CFA+0 rip=[CFA-8] 

eh_frame UnwindPlan:
This UnwindPlan originally sourced from eh_frame CFI
This UnwindPlan is sourced from the compiler: yes.
This UnwindPlan is valid at all instruction locations: no.
Address range of this UnwindPlan: [a.out..text + 413-0x01cc)
row[0]:0: CFA=rsp +8 => rip=[CFA-8] 
row[1]:1: CFA=rsp+16 => rbp=[CFA-16] rip=[CFA-8] 
row[2]:4: CFA=rbp+16 => rbp=[CFA-16] rip=[CFA-8] 
row[3]:   46: CFA=rsp +8 => rbp=[CFA-16] rip=[CFA-8] 

clang doesn't emit the LEAVE instruction which is why I didn't see this on the 
mac when I was testing there.



I have a patch to handle the LEAVE instruction but I need to head home in a bit 
- I'll check that in tomorrow after I've had a chance to look at it more 
closely.  And I'll talk to Jim about advancing the pc when we don't have line 
level information; I'm inclined to not do that. 

Thanks again - having the same binary that was failing was a big help.



> On Jan 7, 2016, at 6:16 PM, Siva Chandra  wrote:
> 
> This broke TestStepNoDebug, atleast on Linux when inferior is compiled
> with GCC: 
> http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/10091
> 
> I am able to reproduce this on my machine. Let me know if you need any
> help with anything.
> 
> On Thu, Jan 7, 2016 at 4:06 PM, Jason Molenda via lldb-commits
>  wrote:
>> Author: jmolenda
>> Date: Thu Jan  7 18:06:03 2016
>> New Revision: 257117
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=257117=rev
>> Log:
>> Performance improvement: Change lldb so that it puts a breakpoint
>> on the first branch instruction after a function return (or the end
>> of a source line), instead of a breakpoint on the return address,
>> to skip an extra stop & start of the inferior process.
>> 
>> I changed Process::AdvanceAddressToNextBranchInstruction to not
>> take an optional InstructionList argument - no callers are providing
>> a cached InstructionList today, and if this function was going to
>> do that, the right thing to do would be to fill out / use a
>> DisassemblerSP which is a disassembler with the InstructionList for
>> this address range.
>> 
>> 
>> http://reviews.llvm.org/D15708
>> 
>> 
>> 
>> Modified:
>>lldb/trunk/include/lldb/Target/Process.h
>>lldb/trunk/include/lldb/Target/Thread.h
>>lldb/trunk/include/lldb/Target/ThreadPlanStepOut.h
>>lldb/trunk/source/Target/Process.cpp
>>

Re: [Lldb-commits] [lldb] r257117 - Performance improvement: Change lldb so that it puts a breakpoint

2016-01-07 Thread Siva Chandra via lldb-commits
This broke TestStepNoDebug, atleast on Linux when inferior is compiled
with GCC: 
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/10091

I am able to reproduce this on my machine. Let me know if you need any
help with anything.

On Thu, Jan 7, 2016 at 4:06 PM, Jason Molenda via lldb-commits
 wrote:
> Author: jmolenda
> Date: Thu Jan  7 18:06:03 2016
> New Revision: 257117
>
> URL: http://llvm.org/viewvc/llvm-project?rev=257117=rev
> Log:
> Performance improvement: Change lldb so that it puts a breakpoint
> on the first branch instruction after a function return (or the end
> of a source line), instead of a breakpoint on the return address,
> to skip an extra stop & start of the inferior process.
>
> I changed Process::AdvanceAddressToNextBranchInstruction to not
> take an optional InstructionList argument - no callers are providing
> a cached InstructionList today, and if this function was going to
> do that, the right thing to do would be to fill out / use a
> DisassemblerSP which is a disassembler with the InstructionList for
> this address range.
>
>
> http://reviews.llvm.org/D15708
> 
>
>
> Modified:
> lldb/trunk/include/lldb/Target/Process.h
> lldb/trunk/include/lldb/Target/Thread.h
> lldb/trunk/include/lldb/Target/ThreadPlanStepOut.h
> lldb/trunk/source/Target/Process.cpp
> lldb/trunk/source/Target/Thread.cpp
> lldb/trunk/source/Target/ThreadPlanShouldStopHere.cpp
> lldb/trunk/source/Target/ThreadPlanStepOut.cpp
> lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
>
> Modified: lldb/trunk/include/lldb/Target/Process.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=257117=257116=257117=diff
> ==
> --- lldb/trunk/include/lldb/Target/Process.h (original)
> +++ lldb/trunk/include/lldb/Target/Process.h Thu Jan  7 18:06:03 2016
> @@ -3149,6 +3149,34 @@ public:
>  void
>  ResetImageToken(size_t token);
>
> +//--
> +/// Find the next branch instruction to set a breakpoint on
> +///
> +/// When instruction stepping through a source line, instead of
> +/// stepping through each instruction, we can put a breakpoint on
> +/// the next branch instruction (within the range of instructions
> +/// we are stepping through) and continue the process to there,
> +/// yielding significant performance benefits over instruction
> +/// stepping.
> +///
> +/// @param[in] default_stop_addr
> +/// The address of the instruction where lldb would put a
> +/// breakpoint normally.
> +///
> +/// @param[in] range_bounds
> +/// The range which the breakpoint must be contained within.
> +/// Typically a source line.
> +///
> +/// @return
> +/// The address of the next branch instruction, or the end of
> +/// the range provided in range_bounds.  If there are any
> +/// problems with the disassembly or getting the instructions,
> +/// the original default_stop_addr will be returned.
> +//--
> +Address
> +AdvanceAddressToNextBranchInstruction (Address default_stop_addr,
> +   AddressRange range_bounds);
> +
>  protected:
>  void
>  SetState (lldb::EventSP _sp);
>
> Modified: lldb/trunk/include/lldb/Target/Thread.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=257117=257116=257117=diff
> ==
> --- lldb/trunk/include/lldb/Target/Thread.h (original)
> +++ lldb/trunk/include/lldb/Target/Thread.h Thu Jan  7 18:06:03 2016
> @@ -888,6 +888,16 @@ public:
>  /// @param[in] run_vote
>  ///See standard meanings for the stop & run votes in ThreadPlan.h.
>  ///
> +/// @param[in] continue_to_next_branch
> +///Normally this will enqueue a plan that will put a breakpoint on 
> the return address and continue
> +///to there.  If continue_to_next_branch is true, this is an 
> operation not involving the user --
> +///e.g. stepping "next" in a source line and we instruction stepped 
> into another function --
> +///so instead of putting a breakpoint on the return address, advance 
> the breakpoint to the
> +///end of the source line that is doing the call, or until the next 
> flow control instruction.
> +///If the return value from the function call is to be retrieved / 
> displayed to the user, you must stop
> +///on the return address.  The return value may be stored in 
> volatile registers which are overwritten
> +///before the next branch instruction.
> +///
>  /// @return
>  /// A shared pointer to the newly queued 

Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor

2016-01-07 Thread Jim Ingham via lldb-commits
jingham added a comment.

Ah, right.  We're doing that so that we can make sure that an ObjC Exception 
thrown during the course of expression evaluation doesn't unwind past the frame 
we are using to call the function.

Seems like for low-level stuff like AllocateMemory we should be avoiding all 
this extra work, which you can do by calling options.SetTrapExceptions(false) 
on the ExpressionEvaluationOptions that you pass in to the thread plan in 
InferiorCallMmap in InferiorCallPOSIX.cpp.

Would you mind checking that adding that bit to InferiorCallMmap (without your 
change to avoid recursion fixes the problem as well.)  I don't mind the current 
change as well, but it would be really nice to get the ObjC runtime out of the 
picture when trying to allocate memory...


http://reviews.llvm.org/D15978



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


Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor

2016-01-07 Thread Jim Ingham via lldb-commits
jingham added a comment.

That penultimate sentence would be clearer if I had put the end ")" in the 
right place - after "recursion"


http://reviews.llvm.org/D15978



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


[Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor

2016-01-07 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, jingham.
fjricci added subscribers: lldb-commits, sas.

When we construct AppleObjCTrampolineHandler, if m_impl_fn_addr is invalid, we 
call CanJIT(). If the gdb remote process does not support allocating and 
deallocating memory, this call stack will include a call to the 
AppleObjCRuntime constructor. The AppleObjCRuntime constructor will then call 
the AppleObjCTrampolineHandler constructor, creating a recursive call loop that 
eventually overflows the stack and segfaults.

Avoid this call loop by not constructing the AppleObjCTrampolineHandler within 
AppleObjCRuntime until we actually need to use it.

http://reviews.llvm.org/D15978

Files:
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp

Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
===
--- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -50,7 +50,6 @@
 m_objc_trampoline_handler_ap (),
 m_Foundation_major()
 {
-ReadObjCLibraryIfNeeded (process->GetTarget().GetImages());
 }
 
 bool
@@ -76,6 +75,7 @@
 bool
 AppleObjCRuntime::GetObjectDescription (Stream , Value , 
ExecutionContextScope *exe_scope)
 {
+ReadObjCLibraryIfNeeded (m_process->GetTarget().GetImages());
 if (!m_read_objc_library)
 return false;
 
@@ -369,6 +369,7 @@
 AppleObjCRuntime::GetStepThroughTrampolinePlan (Thread , bool 
stop_others)
 {
 ThreadPlanSP thread_plan_sp;
+ReadObjCLibraryIfNeeded (m_process->GetTarget().GetImages());
 if (m_objc_trampoline_handler_ap.get())
 thread_plan_sp = 
m_objc_trampoline_handler_ap->GetStepThroughDispatchPlan (thread, stop_others);
 return thread_plan_sp;


Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
===
--- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -50,7 +50,6 @@
 m_objc_trampoline_handler_ap (),
 m_Foundation_major()
 {
-ReadObjCLibraryIfNeeded (process->GetTarget().GetImages());
 }
 
 bool
@@ -76,6 +75,7 @@
 bool
 AppleObjCRuntime::GetObjectDescription (Stream , Value , ExecutionContextScope *exe_scope)
 {
+ReadObjCLibraryIfNeeded (m_process->GetTarget().GetImages());
 if (!m_read_objc_library)
 return false;
 
@@ -369,6 +369,7 @@
 AppleObjCRuntime::GetStepThroughTrampolinePlan (Thread , bool stop_others)
 {
 ThreadPlanSP thread_plan_sp;
+ReadObjCLibraryIfNeeded (m_process->GetTarget().GetImages());
 if (m_objc_trampoline_handler_ap.get())
 thread_plan_sp = m_objc_trampoline_handler_ap->GetStepThroughDispatchPlan (thread, stop_others);
 return thread_plan_sp;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor

2016-01-07 Thread Francis Ricci via lldb-commits
fjricci added a comment.

Here's a paste of the end of the backtrace.

pastebin.com/3VkF3Biq


http://reviews.llvm.org/D15978



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


[Lldb-commits] [PATCH] D15979: Fix dwarf sequence insertions

2016-01-07 Thread Francis Ricci via lldb-commits
fjricci created this revision.
fjricci added reviewers: clayborg, andrew.w.kaylor.
fjricci added subscribers: lldb-commits, sas.

If two dwarf sequences begin with entries that have identical addresses,
it is possible for the comparator to order the first entry of the new
sequence between the first and second entries of the existing sequence.

This will result in an attempted insertion of the second sequence inside
of the first sequence, which is invalid.

Ensure that insertions only occur in between existing sequences.

http://reviews.llvm.org/D15979

Files:
  source/Symbol/LineTable.cpp

Index: source/Symbol/LineTable.cpp
===
--- source/Symbol/LineTable.cpp
+++ source/Symbol/LineTable.cpp
@@ -143,6 +143,13 @@
 entry_collection::iterator end_pos = m_entries.end();
 LineTable::Entry::LessThanBinaryPredicate less_than_bp(this);
 entry_collection::iterator pos = upper_bound(begin_pos, end_pos, entry, 
less_than_bp);
+
+// We should never insert a sequence in the middle of another sequence
+if (pos != begin_pos) {
+while (pos < end_pos && !((pos - 1)->is_terminal_entry))
+pos++;
+}
+
 #ifdef LLDB_CONFIGURATION_DEBUG
 // If we aren't inserting at the beginning, the previous entry should
 // terminate a sequence.


Index: source/Symbol/LineTable.cpp
===
--- source/Symbol/LineTable.cpp
+++ source/Symbol/LineTable.cpp
@@ -143,6 +143,13 @@
 entry_collection::iterator end_pos = m_entries.end();
 LineTable::Entry::LessThanBinaryPredicate less_than_bp(this);
 entry_collection::iterator pos = upper_bound(begin_pos, end_pos, entry, less_than_bp);
+
+// We should never insert a sequence in the middle of another sequence
+if (pos != begin_pos) {
+while (pos < end_pos && !((pos - 1)->is_terminal_entry))
+pos++;
+}
+
 #ifdef LLDB_CONFIGURATION_DEBUG
 // If we aren't inserting at the beginning, the previous entry should
 // terminate a sequence.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor

2016-01-07 Thread Francis Ricci via lldb-commits
fjricci added a comment.

@jingham - your suggestion does avoid the recursion as well, and seems a lot 
cleaner.


http://reviews.llvm.org/D15978



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


Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor

2016-01-07 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 44305.
fjricci added a comment.

Follow suggestion by @jingham to avoid setting up ObjC runtime for low-level 
POSIX memory allocations


http://reviews.llvm.org/D15978

Files:
  source/Plugins/Process/Utility/InferiorCallPOSIX.cpp

Index: source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
===
--- source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
+++ source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
@@ -72,6 +72,7 @@
 options.SetTryAllThreads(true);
 options.SetDebug (false);
 options.SetTimeoutUsec(50);
+options.SetTrapExceptions(false);
 
 addr_t prot_arg, flags_arg = 0;
 if (prot == eMmapProtNone)


Index: source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
===
--- source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
+++ source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
@@ -72,6 +72,7 @@
 options.SetTryAllThreads(true);
 options.SetDebug (false);
 options.SetTimeoutUsec(50);
+options.SetTrapExceptions(false);
 
 addr_t prot_arg, flags_arg = 0;
 if (prot == eMmapProtNone)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits