Re: [Lldb-commits] [PATCH] D12025: Make UriParser to support [$HOSTNAME] notation.

2015-08-20 Thread Tamas Berghammer via lldb-commits
tberghammer added inline comments.


Comment at: source/Utility/UriParser.cpp:13
@@ -12,4 +12,3 @@
 // C Includes
-#include 
-#include 
+#include 
 

I think you wanted to include , not 


Comment at: source/Utility/UriParser.cpp:52-61
@@ +51,12 @@
+// Extract hostname
+if (host_port[0] == '[')
+{
+// hostname is enclosed with square brackets.
+pos = host_port.find(']');
+if (pos == std::string::npos)
+return false;
+
+tmp_hostname = host_port.substr(1, pos - 1);
+host_port.erase(0, pos + 1);
+}
+else

I would prefer no to remove the '[' and the ']' characters from the hostname. 
At the moment you don't use the hostname for the adb protocol so it isn't 
matter but if we consider IPv6 then having '[' and ']' around the address 
sounds like a good idea to me (later stages can use this information).


http://reviews.llvm.org/D12025



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


[Lldb-commits] [lldb] r245545 - [NativeProcessLinux] Fix a bug in instruction-stepping over thread creation

2015-08-20 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Aug 20 04:06:12 2015
New Revision: 245545

URL: http://llvm.org/viewvc/llvm-project?rev=245545&view=rev
Log:
[NativeProcessLinux] Fix a bug in instruction-stepping over thread creation

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

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

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

Reviewers: ovyalov, tberghammer

Subscribers: lldb-commits

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

Added:
lldb/trunk/test/functionalities/thread/create_during_instruction_step/

lldb/trunk/test/functionalities/thread/create_during_instruction_step/Makefile

lldb/trunk/test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py

lldb/trunk/test/functionalities/thread/create_during_instruction_step/main.cpp
Modified:
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.h
lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.h

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=245545&r1=245544&r2=245545&view=diff
==
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Thu Aug 20 
04:06:12 2015
@@ -428,7 +428,8 @@ NativeProcessLinux::NativeProcessLinux (
 m_arch (),
 m_supports_mem_region (eLazyBoolCalculate),
 m_mem_region_cache (),
-m_mem_region_cache_mutex ()
+m_mem_region_cache_mutex(),
+m_pending_notification_tid(LLDB_INVALID_THREAD_ID)
 {
 }
 
@@ -1055,7 +1056,7 @@ NativeProcessLinux::WaitForNewThread(::p
 {
 Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
 
-NativeThreadProtocolSP new_thread_sp = GetThreadByID(tid);
+NativeThreadLinuxSP new_thread_sp = 
std::static_pointer_cast(GetThreadByID(tid));
 
 if (new_thread_sp)
 {
@@ -1113,9 +1114,8 @@ NativeProcessLinux::WaitForNewThread(::p
 log->Printf ("NativeProcessLinux::%s() pid = %" PRIu64 ": tracking new 
thread tid %" PRIu32,
  __FUNCTION__, GetID (), tid);
 
-new_thread_sp = AddThread(tid);
-std::static_pointer_cast (new_thread_sp)->SetRunning ();
-Resume (tid, LLDB_INVALID_SIGNAL_NUMBER);
+new_thread_sp = 
std::static_pointer_cast(AddThread(tid));
+ResumeThread(new_thread_sp, eStateRunning, LLDB_INVALID_SIGNAL_NUMBER);
 ThreadWasCreated(tid);
 }
 
@@ -1132,7 +1132,7 @@ NativeProcessLinux::MonitorSIGTRAP(const
 Mutex::Locker locker (m_threads_mutex);
 
 // See if we can find a thread for this signal.
-NativeThreadProtocolSP thread_sp = GetThreadByID (pid);
+NativeThreadLinuxSP thread_sp = 
std::static_pointer_cast(GetThreadByID(pid));
 if (!thread_sp)
 {
 if (log)
@@ -1161,7 +1161,7 @@ NativeProcessLinux::MonitorSIGTRAP(const
 } else 
 WaitForNewThread(event_message);
 
-Resume (pid, LLDB_INVALID_SIGNAL_NUMBER);
+ResumeThread(thread_sp, thread_sp->GetState(), 
LLDB_INVALID_SIGNAL_NUMBER);
 break;
 }
 
@@ -1172,7 +1172,7 @@ NativeProcessLinux::MonitorSIGTRAP(const
 log->Printf ("NativeProcessLinux::%s() received exec event, code = 
%d", __FUNCTION__, info->si_code ^ SIGTRAP);
 
 // Exec clears any pending notifications.
-m_pending_notification_up.reset ();
+m_pending_notification_tid = LLDB_INVALID_THREAD_ID;
 
 // Remove all but the main thread here.  Linux fork creates a new 
process which only copies the main thread.  Mutexes are in undefined state.
 if (log)
@@ -1253,7 +1253,7 @@ NativeProcessLinux::MonitorSIGTRAP(const
 SetExitStatus (convert_pid_status_to_exit_type (data), 
convert_pid_status_to_return_code (data), nullptr, true);
 }
 
-Resume(pid, LLDB_INVALID_SIGNAL_NUMBER);
+ResumeThread(thread_sp, thread_sp->GetState(), 
LLDB_INVALID_SIGNAL_NUMBER);
 
 break;
 }
@@ -1313,7 +1313,7 @@ NativeProcessLinux::MonitorSIGTRAP(const
 log->Printf ("NativeProcessLinux::%s() received unknown SIGTRAP 
system call st

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

2015-08-20 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL245545: [NativeProcessLinux] Fix a bug in 
instruction-stepping over thread creation (authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D12104?vs=32571&id=32669#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12104

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

Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.h
===
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.h
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.h
@@ -140,6 +140,8 @@
 std::vector m_mem_region_cache;
 Mutex m_mem_region_cache_mutex;
 
+lldb::tid_t m_pending_notification_tid;
+
 // List of thread ids stepping with a breakpoint with the address of
 // the relevan breakpoint
 std::map m_threads_stepping_with_breakpoint;
@@ -300,55 +302,25 @@
 Detach(lldb::tid_t tid);
 
 
-// Typedefs.
-typedef std::unordered_set ThreadIDSet;
-
 // This method is requests a stop on all threads which are still running. It sets up a
 // deferred delegate notification, which will fire once threads report as stopped. The
 // triggerring_tid will be set as the current thread (main stop reason).
 void
 StopRunningThreads(lldb::tid_t triggering_tid);
 
-struct PendingNotification
-{
-PendingNotification (lldb::tid_t triggering_tid):
-triggering_tid (triggering_tid),
-wait_for_stop_tids ()
-{
-}
-
-const lldb::tid_t  triggering_tid;
-ThreadIDSetwait_for_stop_tids;
-};
-typedef std::unique_ptr PendingNotificationUP;
-
 // Notify the delegate if all threads have stopped.
 void SignalIfAllThreadsStopped();
 
-void
-RequestStopOnAllRunningThreads();
-
-Error
-ThreadDidStop(lldb::tid_t tid, bool initiated_by_llgs);
-
-// Resume the thread with the given thread id using the request_thread_resume_function
-// called. If error_when_already_running is then then an error is raised if we think this
-// thread is already running.
+// Resume the given thread, optionally passing it the given signal. The type of resume
+// operation (continue, single-step) depends on the state parameter.
 Error
-ResumeThread(lldb::tid_t tid, NativeThreadLinux::ResumeThreadFunction request_thread_resume_function,
-bool error_when_already_running);
-
-void
-DoStopThreads(PendingNotificationUP &¬ification_up);
+ResumeThread(const NativeThreadLinuxSP &thread_sp, lldb::StateType state, int signo);
 
 void
 ThreadWasCreated (lldb::tid_t tid);
 
 void
 SigchldHandler();
-
-// Member variables.
-PendingNotificationUP m_pending_notification_up;
 };
 
 } // namespace process_linux
Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
===
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -428,7 +428,8 @@
 m_arch (),
 m_supports_mem_region (eLazyBoolCalculate),
 m_mem_region_cache (),
-m_mem_region_cache_mutex ()
+m_mem_region_cache_mutex(),
+m_pending_notification_tid(LLDB_INVALID_THREAD_ID)
 {
 }
 
@@ -1055,7 +1056,7 @@
 {
 Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
 
-NativeThreadProtocolSP new_thread_sp = GetThreadByID(tid);
+NativeThreadLinuxSP new_thread_sp = std::static_pointer_cast(GetThreadByID(tid));
 
 if (new_thread_sp)
 {
@@ -1113,9 +1114,8 @@
 log->Printf ("NativeProcessLinux::%s() pid = %" PRIu64 ": tracking new thread tid %" PRIu32,
  __FUNCTION__, GetID (), tid);
 
-new_thread_sp = AddThread(tid);
-std::static_pointer_cast (new_thread_sp)->SetRunning ();
-Resume (tid, LLDB_INVALID_SIGNAL_NUMBER);
+new_thread_sp = std::static_pointer_cast(AddThread(tid));
+ResumeThread(new_thread_sp, eStateRunning, LLDB_INVALID_SIGNAL_NUMBER);
 ThreadWasCreated(tid);
 }
 
@@ -1132,7 +1132,7 @@
 Mutex::Locker locker (m_threads_mutex);
 
 // See if we can find a thread for this signal.
-NativeThread

[Lldb-commits] [lldb] r245546 - Improve instruction emulation based stack unwinding

2015-08-20 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Thu Aug 20 04:09:01 2015
New Revision: 245546

URL: http://llvm.org/viewvc/llvm-project?rev=245546&view=rev
Log:
Improve instruction emulation based stack unwinding

On ARM there is no difference petween a pop and a load instruction so
a register can be loaded multiple times during the function. Add check
to threat the load as a restore only if it do the restore from the
same location where the register was saved.

Differential revision: http://reviews.llvm.org/D11947

Modified:
lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp

lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp

Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=245546&r1=245545&r2=245546&view=diff
==
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp 
(original)
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Thu Aug 
20 04:09:01 2015
@@ -578,7 +578,7 @@ EmulateInstructionARM::EmulatePOP (const
 {
 if (BitIsSet (registers, i))
 {
-context.SetRegisterPlusOffset (sp_reg, addr - sp);
+context.SetAddress(addr);
 data = MemARead(context, addr, 4, 0, &success);
 if (!success)
 return false;
@@ -2214,7 +2214,7 @@ EmulateInstructionARM::EmulateVPOP (cons
 for (i=0; ihttp://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp?rev=245546&r1=245545&r2=245546&view=diff
==
--- lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp 
(original)
+++ lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp Thu 
Aug 20 04:09:01 2015
@@ -768,8 +768,6 @@ EmulateInstructionARM64::EmulateLDPSTP (
 Context context_t;
 Context context_t2;
 
-context_t.SetRegisterToRegisterPlusOffset (reg_info_Rt, reg_info_base, 0);
-context_t2.SetRegisterToRegisterPlusOffset (reg_info_Rt2, reg_info_base, 
size);
 uint8_t buffer [RegisterValue::kMaxRegisterByteSize];
 Error error;
 
@@ -787,6 +785,8 @@ EmulateInstructionARM64::EmulateLDPSTP (
 context_t.type = eContextRegisterStore;
 context_t2.type = eContextRegisterStore;
 }
+context_t.SetRegisterToRegisterPlusOffset (reg_info_Rt, 
reg_info_base, 0);
+context_t2.SetRegisterToRegisterPlusOffset (reg_info_Rt2, 
reg_info_base, size);
 
 if (!ReadRegister (®_info_Rt, data_Rt))
 return false;
@@ -820,6 +820,8 @@ EmulateInstructionARM64::EmulateLDPSTP (
 context_t.type = eContextRegisterLoad;
 context_t2.type = eContextRegisterLoad;
 }
+context_t.SetAddress(address);
+context_t2.SetAddress(address + size);
 
 if (rt_unknown)
 memset (buffer, 'U', reg_info_Rt.byte_size);
@@ -950,8 +952,6 @@ EmulateInstructionARM64::EmulateLDRSTRIm
 return false;
 
 Context context;
-context.SetRegisterToRegisterPlusOffset (reg_info_Rt, reg_info_base, 
postindex ? 0 : offset);
-
 switch (memop)
 {
 case MemOp_STORE:
@@ -959,6 +959,7 @@ EmulateInstructionARM64::EmulateLDRSTRIm
 context.type = eContextPushRegisterOnStack;
 else
 context.type = eContextRegisterStore;
+context.SetRegisterToRegisterPlusOffset (reg_info_Rt, 
reg_info_base, postindex ? 0 : offset);
 
 if (!ReadRegister (®_info_Rt, data_Rt))
 return false;
@@ -975,6 +976,7 @@ EmulateInstructionARM64::EmulateLDRSTRIm
 context.type = eContextPopRegisterOffStack;
 else
 context.type = eContextRegisterLoad;
+context.SetAddress(address);
 
 if (!ReadMemory (context, address, buffer, reg_info_Rt.byte_size))
 return false;

Modified: 
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp?rev=245546&r1=245545&r2=245546&view=diff
==
--- 
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
 Thu Aug 20 04:09:01 2015
@@ -580,8 +580,17 @@ UnwindAssemblyInstEmulation::WriteRegist
 const uint32_t generic_regnum = 

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

2015-08-20 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL245546: Improve instruction emulation based stack unwinding 
(authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D11947?vs=32395&id=32670#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11947

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

Index: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
===
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
@@ -578,7 +578,7 @@
 {
 if (BitIsSet (registers, i))
 {
-context.SetRegisterPlusOffset (sp_reg, addr - sp);
+context.SetAddress(addr);
 data = MemARead(context, addr, 4, 0, &success);
 if (!success)
 return false;
@@ -2214,7 +2214,7 @@
 for (i=0; ikinds[eRegisterKindGeneric];
 if (reg_num != LLDB_INVALID_REGNUM && generic_regnum != LLDB_REGNUM_GENERIC_SP)
 {
-m_curr_row->SetRegisterLocationToSame (reg_num, /*must_replace*/ false);
-m_curr_row_modified = true;
+if (context.info_type == EmulateInstruction::eInfoTypeAddress)
+{
+if (m_pushed_regs.find (reg_num) != m_pushed_regs.end () &&
+context.info.address == m_pushed_regs[reg_num])
+{
+m_curr_row->SetRegisterLocationToSame (reg_num, /*must_replace*/ false);
+m_curr_row_modified = true;
+}
+}
+else
+assert (!"unhandled case, add code to handle this!");
 }
 }
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D12187: [NativeProcessLinux] Reduce the number of casts

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

NPL used to be peppered with casts of the NativeThreadProtocol objects into 
NativeThreadLinux. I
move these closer to the source where we obtain these objects. This way, the 
rest of the code can
assume we are working with the correct type of objects.

http://reviews.llvm.org/D12187

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

Index: source/Plugins/Process/Linux/NativeProcessLinux.h
===
--- source/Plugins/Process/Linux/NativeProcessLinux.h
+++ source/Plugins/Process/Linux/NativeProcessLinux.h
@@ -113,6 +113,9 @@
 Error
 GetFileLoadAddress(const llvm::StringRef& file_name, lldb::addr_t& load_addr) override;
 
+NativeThreadLinuxSP
+GetThreadByID(lldb::tid_t id);
+
 // -
 // Interface used by NativeRegisterContext-derived classes.
 // -
@@ -225,13 +228,13 @@
 MonitorSIGTRAP(const siginfo_t *info, lldb::pid_t pid);
 
 void
-MonitorTrace(lldb::pid_t pid, NativeThreadProtocolSP thread_sp);
+MonitorTrace(lldb::pid_t pid, const NativeThreadLinuxSP &thread_sp);
 
 void
-MonitorBreakpoint(lldb::pid_t pid, NativeThreadProtocolSP thread_sp);
+MonitorBreakpoint(lldb::pid_t pid, const NativeThreadLinuxSP &thread_sp);
 
 void
-MonitorWatchpoint(lldb::pid_t pid, NativeThreadProtocolSP thread_sp, uint32_t wp_index);
+MonitorWatchpoint(NativeThreadLinux &thread, uint32_t wp_index);
 
 void
 MonitorSignal(const siginfo_t *info, lldb::pid_t pid, bool exited);
@@ -265,14 +268,14 @@
 bool
 StopTrackingThread (lldb::tid_t thread_id);
 
-NativeThreadProtocolSP
+NativeThreadLinuxSP
 AddThread (lldb::tid_t thread_id);
 
 Error
 GetSoftwareBreakpointPCOffset (NativeRegisterContextSP context_sp, uint32_t &actual_opcode_size);
 
 Error
-FixupBreakpointPCAsNeeded (NativeThreadProtocolSP &thread_sp);
+FixupBreakpointPCAsNeeded(const NativeThreadLinuxSP &thread_sp);
 
 /// Writes a siginfo_t structure corresponding to the given thread ID to the
 /// memory region pointed to by @p siginfo.
@@ -317,7 +320,7 @@
 ResumeThread(const NativeThreadLinuxSP &thread_sp, lldb::StateType state, int signo);
 
 void
-ThreadWasCreated (lldb::tid_t tid);
+ThreadWasCreated(NativeThreadLinux &thread);
 
 void
 SigchldHandler();
Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp
===
--- source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -532,9 +532,6 @@
 const size_t err_len = 1024;
 char err_str[err_len];
 lldb::pid_t pid;
-NativeThreadProtocolSP thread_sp;
-
-lldb::ThreadSP inferior;
 
 // Propagate the environment if one is not supplied.
 if (envp == NULL || envp[0] == NULL)
@@ -763,10 +760,10 @@
 if (log)
 log->Printf ("NativeProcessLinux::%s() adding pid = %" PRIu64, __FUNCTION__, pid);
 
-thread_sp = AddThread (pid);
+NativeThreadLinuxSP thread_sp = AddThread(pid);
 assert (thread_sp && "AddThread() returned a nullptr thread");
-std::static_pointer_cast (thread_sp)->SetStoppedBySignal (SIGSTOP);
-ThreadWasCreated(pid);
+thread_sp->SetStoppedBySignal(SIGSTOP);
+ThreadWasCreated(*thread_sp);
 
 // Let our process instance know the thread has stopped.
 SetCurrentThreadID (thread_sp->GetID ());
@@ -791,7 +788,6 @@
 ::pid_t
 NativeProcessLinux::Attach(lldb::pid_t pid, Error &error)
 {
-lldb::ThreadSP inferior;
 Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
 
 // Use a map to keep track of the threads which we have attached/need to attach.
@@ -857,12 +853,12 @@
 it->second = true;
 
 // Create the thread, mark it as stopped.
-NativeThreadProtocolSP thread_sp (AddThread (static_cast (tid)));
+NativeThreadLinuxSP thread_sp (AddThread(static_cast(tid)));
 assert (thread_sp && "AddThread() returned a nullptr");
 
 // This will notify this is a new thread and tell the system it is stopped.
-std::static_pointer_cast (thread_sp)->SetStoppedBySignal (SIGSTOP);
-ThreadWasCreated(tid);
+thread_sp->SetStoppedBySignal(SIGSTOP);
+ThreadWasCreated(*thread_sp);
 SetCurrentThreadID (thread_sp->GetID ());
 }
 
@@ -1056,7 +1052,7 @@
 {
 Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PR

Re: [Lldb-commits] [PATCH] D12187: [NativeProcessLinux] Reduce the number of casts

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

Looks good.

One inconsistency what might worth a change is that you usually pass NPL as a 
shared_ptr (or a reference to a shared_ptr) but you created a few function 
where it isn't true (e.g. ThreadWasCreated). I would prefer to always pass it 
by shared_ptr (possibly as a reference) for consistency.


http://reviews.llvm.org/D12187



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


[Lldb-commits] [lldb] r245552 - Skip TestCreateDuringInstructionStep on android aarch64

2015-08-20 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Aug 20 06:37:19 2015
New Revision: 245552

URL: http://llvm.org/viewvc/llvm-project?rev=245552&view=rev
Log:
Skip TestCreateDuringInstructionStep on android aarch64

we are unable to step through _M_start_thread due to atomic instruction 
sequences.

Modified:

lldb/trunk/test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
lldb/trunk/test/lldbtest.py

Modified: 
lldb/trunk/test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py?rev=245552&r1=245551&r2=245552&view=diff
==
--- 
lldb/trunk/test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
 (original)
+++ 
lldb/trunk/test/functionalities/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
 Thu Aug 20 06:37:19 2015
@@ -25,6 +25,8 @@ class CreateDuringInstructionStepTestCas
 self.create_during_step_inst_test()
 
 @dwarf_test
+@skipIfTargetAndroid(archs=['aarch64'])
+@expectedFailureAndroid("llvm.org/pr23944", archs=['aarch64']) # We are 
unable to step through std::thread::_M_start_thread
 def test_step_inst_with_dwarf(self):
 self.buildDwarf(dictionary=self.getBuildFlags())
 self.create_during_step_inst_test()
@@ -62,7 +64,8 @@ class CreateDuringInstructionStepTestCas
 # instruction, which creates the thread.
 if thread.GetFrameAtIndex(0).GetFunctionName() in [
 '__sync_fetch_and_add_4', # Android arm: unable to set a 
breakpoint for software single-step
-'pthread_mutex_lock'  # Android arm: function contains 
atomic instruction sequences
+'pthread_mutex_lock', # Android arm: function contains 
atomic instruction sequences
+'pthread_mutex_unlock'# Android arm: function contains 
atomic instruction sequences
 ]:
 thread.StepOut()
 else:

Modified: lldb/trunk/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=245552&r1=245551&r2=245552&view=diff
==
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Thu Aug 20 06:37:19 2015
@@ -698,6 +698,18 @@ def expectedFailureWindows(bugnumber=Non
 def expectedFailureHostWindows(bugnumber=None, compilers=None):
 return expectedFailureHostOS(['windows'], bugnumber, compilers)
 
+def matchAndroid(api_levels=None, archs=None):
+def match(self):
+if not target_is_android():
+return False
+if archs is not None and self.getArchitecture() not in archs:
+return False
+if api_levels is not None and android_device_api() not in api_levels:
+return False
+return True
+return match
+
+
 def expectedFailureAndroid(bugnumber=None, api_levels=None, archs=None):
 """ Mark a test as xfail for Android.
 
@@ -708,15 +720,7 @@ def expectedFailureAndroid(bugnumber=Non
 arch - A sequence of architecture names specifying the architectures
 for which a test is expected to fail. None means all architectures.
 """
-def fn(self):
-if target_is_android():
-if archs is not None and self.getArchitecture() not in archs:
-return False
-if api_levels is not None and android_device_api() not in 
api_levels:
-return False
-return True
-
-return expectedFailure(fn, bugnumber)
+return expectedFailure(matchAndroid(api_levels, archs), bugnumber)
 
 # if the test passes on the first try, we're done (success)
 # if the test fails once, then passes on the second try, raise an 
ExpectedFailure
@@ -1061,12 +1065,14 @@ def skipIfi386(func):
 func(*args, **kwargs)
 return wrapper
 
-def skipIfTargetAndroid(api_levels=None):
+def skipIfTargetAndroid(api_levels=None, archs=None):
 """Decorator to skip tests when the target is Android.
 
 Arguments:
 api_levels - The API levels for which the test should be skipped. If
 it is None, then the test will be skipped for all API levels.
+arch - A sequence of architecture names specifying the architectures
+for which a test is skipped. None means all architectures.
 """
 def myImpl(func):
 if isinstance(func, type) and issubclass(func, unittest2.TestCase):
@@ -1076,14 +1082,9 @@ def skipIfTargetAndroid(api_levels=None)
 def wrapper(*args, **kwargs):
 from unittest2 import case
 self = args[0]
-if target_is_android():
-if api_levels:
-device_api = android

[Lldb-commits] [lldb] r245555 - Increase timeout in TestCallWithTimeout to reduce flakyness

2015-08-20 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Aug 20 07:12:09 2015
New Revision: 24

URL: http://llvm.org/viewvc/llvm-project?rev=24&view=rev
Log:
Increase timeout in TestCallWithTimeout to reduce flakyness

The test was flaky on the android buildbot, because the 10ms test completed 
before we got a
chance to interrupt it. I increase the duration to 50ms to hopefully get more 
consistent results.

Modified:
lldb/trunk/test/expression_command/timeout/TestCallWithTimeout.py

Modified: lldb/trunk/test/expression_command/timeout/TestCallWithTimeout.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/timeout/TestCallWithTimeout.py?rev=24&r1=245554&r2=24&view=diff
==
--- lldb/trunk/test/expression_command/timeout/TestCallWithTimeout.py (original)
+++ lldb/trunk/test/expression_command/timeout/TestCallWithTimeout.py Thu Aug 
20 07:12:09 2015
@@ -65,15 +65,15 @@ class ExprCommandWithTimeoutsTestCase(Te
 
 frame = thread.GetFrameAtIndex(0)
 
-value = frame.EvaluateExpression ("wait_a_while (1)", options)
+value = frame.EvaluateExpression ("wait_a_while (5)", options)
 self.assertTrue (value.IsValid())
-self.assertTrue (value.GetError().Success() == False)
+self.assertFalse (value.GetError().Success())
 
 # Now do the same thing with the command line command, and make sure 
it works too.
 interp = self.dbg.GetCommandInterpreter()
 
 result = lldb.SBCommandReturnObject()
-return_value = interp.HandleCommand ("expr -t 100 -u true -- 
wait_a_while(1)", result)
+return_value = interp.HandleCommand ("expr -t 100 -u true -- 
wait_a_while(5)", result)
 self.assertTrue (return_value == lldb.eReturnStatusFailed)
 
 # Okay, now do it again with long enough time outs:


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


Re: [Lldb-commits] [PATCH] D12025: Make UriParser to support [$HOSTNAME] notation.

2015-08-20 Thread Oleksiy Vyalov via lldb-commits
ovyalov added inline comments.


Comment at: source/Utility/UriParser.cpp:13
@@ -12,4 +12,3 @@
 // C Includes
-#include 
-#include 
+#include 
 

tberghammer wrote:
> I think you wanted to include , not 
I need string.h for strlen - it's required even with  included .


Comment at: source/Utility/UriParser.cpp:52-61
@@ +51,12 @@
+// Extract hostname
+if (host_port[0] == '[')
+{
+// hostname is enclosed with square brackets.
+pos = host_port.find(']');
+if (pos == std::string::npos)
+return false;
+
+tmp_hostname = host_port.substr(1, pos - 1);
+host_port.erase(0, pos + 1);
+}
+else

tberghammer wrote:
> I would prefer no to remove the '[' and the ']' characters from the hostname. 
> At the moment you don't use the hostname for the adb protocol so it isn't 
> matter but if we consider IPv6 then having '[' and ']' around the address 
> sounds like a good idea to me (later stages can use this information).
Let me leave [] removal as-is since we treat hostname as device_id in case of 
adb and then use it for port forwarding setup - 
https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/Platform/Android/PlatformAndroid.cpp#L199


http://reviews.llvm.org/D12025



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


Re: [Lldb-commits] [PATCH] D12025: Make UriParser to support [$HOSTNAME] notation.

2015-08-20 Thread Pavel Labath via lldb-commits
labath added a subscriber: labath.


Comment at: source/Utility/UriParser.cpp:13
@@ -12,4 +12,3 @@
 // C Includes
-#include 
-#include 
+#include 
 

ovyalov wrote:
> tberghammer wrote:
> > I think you wanted to include , not 
> I need string.h for strlen - it's required even with  included .
The C++ way would be to #include 




http://reviews.llvm.org/D12025



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


Re: [Lldb-commits] [PATCH] D12025: Make UriParser to support [$HOSTNAME] notation.

2015-08-20 Thread Tamas Berghammer via lldb-commits
tberghammer added inline comments.


Comment at: source/Utility/UriParser.cpp:13
@@ -12,4 +12,3 @@
 // C Includes
-#include 
-#include 
+#include 
 

labath wrote:
> ovyalov wrote:
> > tberghammer wrote:
> > > I think you wanted to include , not 
> > I need string.h for strlen - it's required even with  included .
> The C++ way would be to #include 
> 
> 
Sorry, I missed that you use strlen


Comment at: source/Utility/UriParser.cpp:52-61
@@ +51,12 @@
+// Extract hostname
+if (host_port[0] == '[')
+{
+// hostname is enclosed with square brackets.
+pos = host_port.find(']');
+if (pos == std::string::npos)
+return false;
+
+tmp_hostname = host_port.substr(1, pos - 1);
+host_port.erase(0, pos + 1);
+}
+else

ovyalov wrote:
> tberghammer wrote:
> > I would prefer no to remove the '[' and the ']' characters from the 
> > hostname. At the moment you don't use the hostname for the adb protocol so 
> > it isn't matter but if we consider IPv6 then having '[' and ']' around the 
> > address sounds like a good idea to me (later stages can use this 
> > information).
> Let me leave [] removal as-is since we treat hostname as device_id in case of 
> adb and then use it for port forwarding setup - 
> https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/Platform/Android/PlatformAndroid.cpp#L199
I would prefer to remove them in PlatformAndroid when we convert it to devices 
id, but if you want to leave it this way I am fine with that also.


http://reviews.llvm.org/D12025



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


Re: [Lldb-commits] [PATCH] D12025: Make UriParser to support [$HOSTNAME] notation.

2015-08-20 Thread Oleksiy Vyalov via lldb-commits
ovyalov updated this revision to Diff 32701.
ovyalov marked an inline comment as done.
ovyalov added a comment.

Replaced #include  with 


http://reviews.llvm.org/D12025

Files:
  source/Host/posix/ConnectionFileDescriptorPosix.cpp
  source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
  source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
  source/Utility/UriParser.cpp
  source/Utility/UriParser.h
  unittests/Utility/UriParserTest.cpp

Index: unittests/Utility/UriParserTest.cpp
===
--- unittests/Utility/UriParserTest.cpp
+++ unittests/Utility/UriParserTest.cpp
@@ -79,12 +79,36 @@
 VALIDATE
 }
 
+TEST_F (UriParserTest, LongPath)
+{
+const UriTestCase testCase("x://y/abc/def/xyz", "x", "y", -1, "/abc/def/xyz");
+VALIDATE
+}
+
 TEST_F (UriParserTest, TypicalPortPath)
 {
 const UriTestCase testCase("connect://192.168.100.132:5432/", "connect", "192.168.100.132", 5432, "/");
 VALIDATE
 }
 
+TEST_F (UriParserTest, BracketedHostnamePort)
+{
+const UriTestCase testCase("connect://[192.168.100.132]:5432/", "connect", "192.168.100.132", 5432, "/");
+VALIDATE
+}
+
+TEST_F (UriParserTest, BracketedHostname)
+{
+const UriTestCase testCase("connect://[192.168.100.132]", "connect", "192.168.100.132", -1, "/");
+VALIDATE
+}
+
+TEST_F (UriParserTest, BracketedHostnameWithColon)
+{
+const UriTestCase testCase("connect://[192.168.100.132:]:1234", "connect", "192.168.100.132:", 1234, "/");
+VALIDATE
+}
+
 TEST_F (UriParserTest, SchemeHostSeparator)
 {
 const UriTestCase testCase("x:/y");
Index: source/Utility/UriParser.h
===
--- source/Utility/UriParser.h
+++ source/Utility/UriParser.h
@@ -28,12 +28,12 @@
 //
 //   if the url is invalid, function returns false and
 //   output parameters remain unchanged
-static bool Parse(const char* uri,
-std::string& scheme,
-std::string& hostname,
-int& port,
-std::string& path
-);
+static bool
+Parse(const std::string& uri,
+  std::string& scheme,
+  std::string& hostname,
+  int& port,
+  std::string& path);
 };
 
 #endif  // utility_UriParser_h_
Index: source/Utility/UriParser.cpp
===
--- source/Utility/UriParser.cpp
+++ source/Utility/UriParser.cpp
@@ -10,10 +10,10 @@
 #include "Utility/UriParser.h"
 
 // C Includes
-#include 
-#include 
 
 // C++ Includes
+#include 
+
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Host/StringConvert.h"
@@ -24,43 +24,71 @@
 // UriParser::Parse
 //--
 bool
-UriParser::Parse(const char* uri,
-std::string& scheme,
-std::string& hostname,
-int& port,
-std::string& path
-)
+UriParser::Parse(const std::string& uri,
+ std::string& scheme,
+ std::string& hostname,
+ int& port,
+ std::string& path)
 {
-char scheme_buf[100] = {0};
-char hostname_buf[256] = {0};
-char port_buf[11] = {0}; // 10==strlen(2^32)
-char path_buf[2049] = {'/', 0};
-  
-bool ok = false;
- if (4==sscanf(uri, "%99[^:/]://%255[^/:]:%10[^/]/%2047s", scheme_buf, hostname_buf, port_buf, path_buf+1)) { ok = true; }
-else if (3==sscanf(uri, "%99[^:/]://%255[^/:]:%10[^/]", scheme_buf, hostname_buf, port_buf)) { ok = true; }
-else if (3==sscanf(uri, "%99[^:/]://%255[^/]/%2047s", scheme_buf, hostname_buf, path_buf+1)) { ok = true; }
-else if (2==sscanf(uri, "%99[^:/]://%255[^/]", scheme_buf, hostname_buf)) { ok = true; }
+std::string tmp_scheme, tmp_hostname, tmp_port, tmp_path;
+
+static const char* kSchemeSep = "://";
+auto pos = uri.find(kSchemeSep);
+if (pos == std::string::npos)
+return false;
+
+// Extract path.
+tmp_scheme = uri.substr(0, pos);
+auto host_pos = pos + strlen(kSchemeSep);
+auto path_pos = uri.find_first_of("/", host_pos);
+if (path_pos != std::string::npos)
+tmp_path = uri.substr(path_pos);
+else
+tmp_path = "/";
+
+auto host_port = uri.substr(
+host_pos, ((path_pos != std::string::npos) ? path_pos  : uri.size()) - host_pos);
+
+// Extract hostname
+if (host_port[0] == '[')
+{
+// hostname is enclosed with square brackets.
+pos = host_port.find(']');
+if (pos == std::string::npos)
+return false;
+
+tmp_hostname = host_port.substr(1, pos - 1);
+host_port.erase(0, pos + 1);
+}
+else
+{
+pos = host_port.find(':');
+tmp_hostname = host_port.substr(0, (pos != std::string::npos) ? pos : host_port.size());
+

Re: [Lldb-commits] [PATCH] D12187: [NativeProcessLinux] Reduce the number of casts

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

LGTM



Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:2834
@@ -2843,3 +2833,3 @@
 
-NativeThreadProtocolSP thread_sp (new NativeThreadLinux (this, thread_id));
+NativeThreadLinuxSP thread_sp (new NativeThreadLinux(this, thread_id));
 m_threads.push_back (thread_sp);

You may use std::make_shared


http://reviews.llvm.org/D12187



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


[Lldb-commits] [PATCH] D12203: Fix some format strings in ProcessGDBRemote.cpp.

2015-08-20 Thread Stephane Sezer via lldb-commits
sas created this revision.
sas added reviewers: clayborg, ADodds.
sas added a subscriber: lldb-commits.

Size specifier should come after `%` not before.

http://reviews.llvm.org/D12203

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4603,7 +4603,7 @@
 module.get_base (base);
 module.get_dynamic (ld);
 
-log->Printf ("found (link_map:0x08%" PRIx64 ", base:0x08%" 
PRIx64 ", ld:0x08%" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
+log->Printf ("found (link_map:0x%08" PRIx64 ", base:0x%08" 
PRIx64 ", ld:0x%08" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
 }
 
 list.add (module);
@@ -4653,7 +4653,7 @@
 module.get_name (name);
 module.get_base (base);
 
-log->Printf ("found (base:0x%" PRIx64 ", name:'%s')", base, 
name.c_str());
+log->Printf ("found (base:0x%08" PRIx64 ", name:'%s')", base, 
name.c_str());
 }
 
 list.add (module);


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4603,7 +4603,7 @@
 module.get_base (base);
 module.get_dynamic (ld);
 
-log->Printf ("found (link_map:0x08%" PRIx64 ", base:0x08%" PRIx64 ", ld:0x08%" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
+log->Printf ("found (link_map:0x%08" PRIx64 ", base:0x%08" PRIx64 ", ld:0x%08" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
 }
 
 list.add (module);
@@ -4653,7 +4653,7 @@
 module.get_name (name);
 module.get_base (base);
 
-log->Printf ("found (base:0x%" PRIx64 ", name:'%s')", base, name.c_str());
+log->Printf ("found (base:0x%08" PRIx64 ", name:'%s')", base, name.c_str());
 }
 
 list.add (module);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D12204: Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.

2015-08-20 Thread Stephane Sezer via lldb-commits
sas created this revision.
sas added reviewers: clayborg, zturner, ADodds.
sas added a subscriber: lldb-commits.

This is useful when dealing with Windows remote that use only the
qXfer:libraries command which returns absolute base addresses, as
opposed to qXfer:libraries-svr4 which returns relative offsets for
module bases.

http://reviews.llvm.org/D12204

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

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -452,7 +452,7 @@
 GetLoadedModuleList (GDBLoadedModuleInfoList &);
 
 lldb::ModuleSP
-LoadModuleAtAddress (const FileSpec &file, lldb::addr_t base_addr);
+LoadModuleAtAddress (const FileSpec &file, lldb::addr_t base_addr, bool value_is_offset);
 
 private:
 //--
Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -216,6 +216,16 @@
 return m_has[e_has_base];
 }
 
+void set_base_is_offset (bool is_offset)
+{
+m_base_is_offset = is_offset;
+}
+bool get_base_is_offset(bool & out) const
+{
+out = m_base_is_offset;
+return m_has[e_has_base];
+}
+
 void set_link_map (const lldb::addr_t addr)
 {
 m_link_map = addr;
@@ -250,6 +260,7 @@
 std::string m_name;
 lldb::addr_t m_link_map;
 lldb::addr_t m_base;
+bool m_base_is_offset;
 lldb::addr_t m_dynamic;
 };
 
@@ -4582,7 +4593,8 @@
 {
 // the displacement as read from the field 'l_addr' of the link_map struct.
 module.set_base(StringConvert::ToUInt64(value.data(), LLDB_INVALID_ADDRESS, 0));
-
+// base address is always a displacement, not an absolute value.
+module.set_base_is_offset(true);
 }
 else if (name == "l_ld")
 {
@@ -4597,13 +4609,15 @@
 {
 std::string name;
 lldb::addr_t lm=0, base=0, ld=0;
+bool base_is_offset;
 
 module.get_name (name);
 module.get_link_map (lm);
 module.get_base (base);
+module.get_base_is_offset (base_is_offset);
 module.get_dynamic (ld);
 
-log->Printf ("found (link_map:0x%08" PRIx64 ", base:0x%08" PRIx64 ", ld:0x%08" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
+log->Printf ("found (link_map:0x%08" PRIx64 ", base:0x%08" PRIx64 "[%s], ld:0x%08" PRIx64 ", name:'%s')", lm, base, (base_is_offset ? "offset" : "absolute"), ld, name.c_str());
 }
 
 list.add (module);
@@ -4645,15 +4659,19 @@
 const XMLNode §ion = library.FindFirstChildElementWithName("section");
 llvm::StringRef address = section.GetAttributeValue("address");
 module.set_base(StringConvert::ToUInt64(address.data(), LLDB_INVALID_ADDRESS, 0));
+// These addresses are absolute values.
+module.set_base_is_offset(false);
 
 if (log)
 {
 std::string name;
 lldb::addr_t base = 0;
+bool base_is_offset;
 module.get_name (name);
 module.get_base (base);
+module.get_base_is_offset (base_is_offset);
 
-log->Printf ("found (base:0x%08" PRIx64 ", name:'%s')", base, name.c_str());
+log->Printf ("found (base:0x%08" PRIx64 "[%s], name:'%s')", base, (base_is_offset ? "offset" : "absolute"), name.c_str());
 }
 
 list.add (module);
@@ -4670,7 +4688,7 @@
 }
 
 lldb::ModuleSP
-ProcessGDBRemote::LoadModuleAtAddress (const FileSpec &file, lldb::addr_t base_addr)
+ProcessGDBRemote::LoadModuleAtAddress (const FileSpec &file, lldb::addr_t base_addr, bool value_is_offset)
 {
 Target &target = m_process->GetTarget();
 ModuleList &modules = target.GetImages();
@@ -4681,11 +4699,11 @@
 ModuleSpec module_spec (file, target.GetArchitecture());
 if ((module_sp = modules.FindFirstModule (module_spec)))
 {
-module_sp->SetLoadAddress (target, base_addr, true, changed);
+module_sp->SetLoadAddress (target, base_addr, value_is_offset, changed);
 }
 else if ((module_sp = target.GetSharedModule (module_spec)))
 {
-module_sp->SetLoadAddress (target, base_addr, true, changed);
+module_sp->SetLoadAddress (

Re: [Lldb-commits] [PATCH] D12184: [MIPS] Avoid breakpoint in delay slot

2015-08-20 Thread Jim Ingham via lldb-commits
jingham added a subscriber: jingham.
jingham requested changes to this revision.
jingham added a reviewer: jingham.
jingham added a comment.
This revision now requires changes to proceed.

I wish we had a better abstraction for machine-specific behaviors than 
ArchSpec, since it seems sad to put this machine specific a bit of business in 
Target.cpp, but I don't think you should have to tackle that to get this fix in.

However, I think you came in at too low a level by making the interface about 
delay slots.  Rather, there should be a function 
Target::GetBreakableLoadAddress (analogous to GetOpcodeLoadAddress & 
GetCallableLoadAddress) that encapsulated calculating the new breakpoint 
address and CreateBreakpoint should call that.  After all, maybe there will be 
other reasons why "you want to set a breakpoint on address X but we know Y is a 
better address" might happen and it would be better to hide the specific reason 
away as much as possible.

Also, since this will get called for every breakpoint address we set, please 
don't do any work in this function till you've decided you are on a machine 
that would require it.

Also, for you own sanity, I would suggest putting some logging (under the 
breakpoint channel) summarizing what you did to the address.  Someday, you'll 
get some weird bug report from somebody whose breakpoints are going wrong, and 
then you'll wish too late that you knew what you thought you were doing...


Repository:
  rL LLVM

http://reviews.llvm.org/D12184



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


Re: [Lldb-commits] [PATCH] D12204: Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.

2015-08-20 Thread Tamas Berghammer via lldb-commits
tberghammer added a subscriber: tberghammer.
tberghammer added a comment.

Looks good to me, but I don't know too much about the Windows stuff. I have a 
pending CL what will fix several issues related to absolute base addresses in 
the DynamicLoader. If it is something what is required on Windows side also I 
will try to upload it.


http://reviews.llvm.org/D12204



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


[Lldb-commits] [PATCH] D12206: Inline fake snprintf to avoid linkage issues on Windows.

2015-08-20 Thread Chaoren Lin via lldb-commits
chaoren created this revision.
chaoren added a reviewer: zturner.
chaoren added a subscriber: lldb-commits.

dllexport doesn't work if linking against a static library with its own
copy of snprintf.

http://reviews.llvm.org/D12206

Files:
  include/lldb/Host/windows/win32.h
  source/Host/windows/Windows.cpp

Index: source/Host/windows/Windows.cpp
===
--- source/Host/windows/Windows.cpp
+++ source/Host/windows/Windows.cpp
@@ -203,18 +203,17 @@
 }
 
 #if _MSC_VER < 1900
-int snprintf(char *buffer, size_t count, const char *format, ...)
+namespace lldb_private {
+int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr)
 {
 int old_errno = errno;
-va_list argptr;
-va_start(argptr, format);
-int r = vsnprintf(buffer, count, format, argptr);
+int r = ::vsnprintf(buffer, count, format, argptr);
 int new_errno = errno;
 buffer[count-1] = '\0';
 if (r == -1 || r == count)
 {
 FILE *nul = fopen("nul", "w");
-int bytes_written = vfprintf(nul, format, argptr);
+int bytes_written = ::vfprintf(nul, format, argptr);
 fclose(nul);
 if (bytes_written < count)
 errno = new_errno;
@@ -224,9 +223,9 @@
 r = bytes_written;
 }
 }
-va_end(argptr);
 return r;
 }
+} // namespace lldb_private
 #endif
 
 #endif // _MSC_VER
Index: include/lldb/Host/windows/win32.h
===
--- include/lldb/Host/windows/win32.h
+++ include/lldb/Host/windows/win32.h
@@ -65,8 +65,18 @@
 int strncasecmp(const char* s1, const char* s2, size_t n);
 
 #if _MSC_VER < 1900
-int __declspec(dllexport)
-snprintf(char *buffer, size_t count, const char *format, ...);
+namespace lldb_private {
+int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr);
+}
+
+int inline snprintf(char *buffer, size_t count, const char *format, ...)
+{
+va_list argptr;
+va_start(argptr, format);
+int r = lldb_private::vsnprintf(buffer, count, format, argptr);
+va_end(argptr);
+return r;
+}
 #endif
 
 #define STDIN_FILENO  0


Index: source/Host/windows/Windows.cpp
===
--- source/Host/windows/Windows.cpp
+++ source/Host/windows/Windows.cpp
@@ -203,18 +203,17 @@
 }
 
 #if _MSC_VER < 1900
-int snprintf(char *buffer, size_t count, const char *format, ...)
+namespace lldb_private {
+int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr)
 {
 int old_errno = errno;
-va_list argptr;
-va_start(argptr, format);
-int r = vsnprintf(buffer, count, format, argptr);
+int r = ::vsnprintf(buffer, count, format, argptr);
 int new_errno = errno;
 buffer[count-1] = '\0';
 if (r == -1 || r == count)
 {
 FILE *nul = fopen("nul", "w");
-int bytes_written = vfprintf(nul, format, argptr);
+int bytes_written = ::vfprintf(nul, format, argptr);
 fclose(nul);
 if (bytes_written < count)
 errno = new_errno;
@@ -224,9 +223,9 @@
 r = bytes_written;
 }
 }
-va_end(argptr);
 return r;
 }
+} // namespace lldb_private
 #endif
 
 #endif // _MSC_VER
Index: include/lldb/Host/windows/win32.h
===
--- include/lldb/Host/windows/win32.h
+++ include/lldb/Host/windows/win32.h
@@ -65,8 +65,18 @@
 int strncasecmp(const char* s1, const char* s2, size_t n);
 
 #if _MSC_VER < 1900
-int __declspec(dllexport)
-snprintf(char *buffer, size_t count, const char *format, ...);
+namespace lldb_private {
+int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr);
+}
+
+int inline snprintf(char *buffer, size_t count, const char *format, ...)
+{
+va_list argptr;
+va_start(argptr, format);
+int r = lldb_private::vsnprintf(buffer, count, format, argptr);
+va_end(argptr);
+return r;
+}
 #endif
 
 #define STDIN_FILENO  0
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12206: Inline fake snprintf to avoid linkage issues on Windows.

2015-08-20 Thread Zachary Turner via lldb-commits
looks good, can you add a comment to explain why it's inlined though.

On Thu, Aug 20, 2015 at 12:14 PM Chaoren Lin  wrote:

> chaoren created this revision.
> chaoren added a reviewer: zturner.
> chaoren added a subscriber: lldb-commits.
>
> dllexport doesn't work if linking against a static library with its own
> copy of snprintf.
>
> http://reviews.llvm.org/D12206
>
> Files:
>   include/lldb/Host/windows/win32.h
>   source/Host/windows/Windows.cpp
>
> Index: source/Host/windows/Windows.cpp
> ===
> --- source/Host/windows/Windows.cpp
> +++ source/Host/windows/Windows.cpp
> @@ -203,18 +203,17 @@
>  }
>
>  #if _MSC_VER < 1900
> -int snprintf(char *buffer, size_t count, const char *format, ...)
> +namespace lldb_private {
> +int vsnprintf(char *buffer, size_t count, const char *format, va_list
> argptr)
>  {
>  int old_errno = errno;
> -va_list argptr;
> -va_start(argptr, format);
> -int r = vsnprintf(buffer, count, format, argptr);
> +int r = ::vsnprintf(buffer, count, format, argptr);
>  int new_errno = errno;
>  buffer[count-1] = '\0';
>  if (r == -1 || r == count)
>  {
>  FILE *nul = fopen("nul", "w");
> -int bytes_written = vfprintf(nul, format, argptr);
> +int bytes_written = ::vfprintf(nul, format, argptr);
>  fclose(nul);
>  if (bytes_written < count)
>  errno = new_errno;
> @@ -224,9 +223,9 @@
>  r = bytes_written;
>  }
>  }
> -va_end(argptr);
>  return r;
>  }
> +} // namespace lldb_private
>  #endif
>
>  #endif // _MSC_VER
> Index: include/lldb/Host/windows/win32.h
> ===
> --- include/lldb/Host/windows/win32.h
> +++ include/lldb/Host/windows/win32.h
> @@ -65,8 +65,18 @@
>  int strncasecmp(const char* s1, const char* s2, size_t n);
>
>  #if _MSC_VER < 1900
> -int __declspec(dllexport)
> -snprintf(char *buffer, size_t count, const char *format, ...);
> +namespace lldb_private {
> +int vsnprintf(char *buffer, size_t count, const char *format, va_list
> argptr);
> +}
> +
> +int inline snprintf(char *buffer, size_t count, const char *format, ...)
> +{
> +va_list argptr;
> +va_start(argptr, format);
> +int r = lldb_private::vsnprintf(buffer, count, format, argptr);
> +va_end(argptr);
> +return r;
> +}
>  #endif
>
>  #define STDIN_FILENO  0
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12203: Fix some format strings in ProcessGDBRemote.cpp.

2015-08-20 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/D12203



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


Re: [Lldb-commits] [PATCH] D12204: Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.

2015-08-20 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks fine.


http://reviews.llvm.org/D12204



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


[Lldb-commits] [lldb] r245608 - Fix some format strings in ProcessGDBRemote.cpp.

2015-08-20 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Thu Aug 20 15:43:29 2015
New Revision: 245608

URL: http://llvm.org/viewvc/llvm-project?rev=245608&view=rev
Log:
Fix some format strings in ProcessGDBRemote.cpp.

Summary: Size specifier should come after `%` not before.

Reviewers: clayborg, ADodds

Subscribers: lldb-commits

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

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=245608&r1=245607&r2=245608&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Thu Aug 
20 15:43:29 2015
@@ -4615,7 +4615,7 @@ ProcessGDBRemote::GetLoadedModuleList (G
 module.get_base (base);
 module.get_dynamic (ld);
 
-log->Printf ("found (link_map:0x08%" PRIx64 ", base:0x08%" 
PRIx64 ", ld:0x08%" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
+log->Printf ("found (link_map:0x%08" PRIx64 ", base:0x%08" 
PRIx64 ", ld:0x%08" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
 }
 
 list.add (module);
@@ -4665,7 +4665,7 @@ ProcessGDBRemote::GetLoadedModuleList (G
 module.get_name (name);
 module.get_base (base);
 
-log->Printf ("found (base:0x%" PRIx64 ", name:'%s')", base, 
name.c_str());
+log->Printf ("found (base:0x%08" PRIx64 ", name:'%s')", base, 
name.c_str());
 }
 
 list.add (module);


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


Re: [Lldb-commits] [PATCH] D12203: Fix some format strings in ProcessGDBRemote.cpp.

2015-08-20 Thread Stephane Sezer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL245608: Fix some format strings in ProcessGDBRemote.cpp. 
(authored by sas).

Changed prior to commit:
  http://reviews.llvm.org/D12203?vs=32719&id=32737#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12203

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

Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4615,7 +4615,7 @@
 module.get_base (base);
 module.get_dynamic (ld);
 
-log->Printf ("found (link_map:0x08%" PRIx64 ", base:0x08%" 
PRIx64 ", ld:0x08%" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
+log->Printf ("found (link_map:0x%08" PRIx64 ", base:0x%08" 
PRIx64 ", ld:0x%08" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
 }
 
 list.add (module);
@@ -4665,7 +4665,7 @@
 module.get_name (name);
 module.get_base (base);
 
-log->Printf ("found (base:0x%" PRIx64 ", name:'%s')", base, 
name.c_str());
+log->Printf ("found (base:0x%08" PRIx64 ", name:'%s')", base, 
name.c_str());
 }
 
 list.add (module);


Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4615,7 +4615,7 @@
 module.get_base (base);
 module.get_dynamic (ld);
 
-log->Printf ("found (link_map:0x08%" PRIx64 ", base:0x08%" PRIx64 ", ld:0x08%" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
+log->Printf ("found (link_map:0x%08" PRIx64 ", base:0x%08" PRIx64 ", ld:0x%08" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
 }
 
 list.add (module);
@@ -4665,7 +4665,7 @@
 module.get_name (name);
 module.get_base (base);
 
-log->Printf ("found (base:0x%" PRIx64 ", name:'%s')", base, name.c_str());
+log->Printf ("found (base:0x%08" PRIx64 ", name:'%s')", base, name.c_str());
 }
 
 list.add (module);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12204: Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.

2015-08-20 Thread Stephane Sezer via lldb-commits
sas added a comment.

Thanks for the reviews.

I'll take a look at your change when you upload it, Tamas. Do you think I can 
commit this in the meantime?


http://reviews.llvm.org/D12204



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


[Lldb-commits] [lldb] r245610 - Inline fake snprintf to avoid linkage issues on Windows.

2015-08-20 Thread Chaoren Lin via lldb-commits
Author: chaoren
Date: Thu Aug 20 15:53:15 2015
New Revision: 245610

URL: http://llvm.org/viewvc/llvm-project?rev=245610&view=rev
Log:
Inline fake snprintf to avoid linkage issues on Windows.

Summary:
dllexport doesn't work if linking against a static library with its own
copy of snprintf.

Reviewers: zturner

Subscribers: zturner, lldb-commits

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

Modified:
lldb/trunk/include/lldb/Host/windows/win32.h
lldb/trunk/source/Host/windows/Windows.cpp

Modified: lldb/trunk/include/lldb/Host/windows/win32.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/win32.h?rev=245610&r1=245609&r2=245610&view=diff
==
--- lldb/trunk/include/lldb/Host/windows/win32.h (original)
+++ lldb/trunk/include/lldb/Host/windows/win32.h Thu Aug 20 15:53:15 2015
@@ -65,8 +65,19 @@ int strcasecmp(const char* s1, const cha
 int strncasecmp(const char* s1, const char* s2, size_t n);
 
 #if _MSC_VER < 1900
-int __declspec(dllexport)
-snprintf(char *buffer, size_t count, const char *format, ...);
+namespace lldb_private {
+int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr);
+}
+
+// inline to avoid linkage conflicts
+int inline snprintf(char *buffer, size_t count, const char *format, ...)
+{
+va_list argptr;
+va_start(argptr, format);
+int r = lldb_private::vsnprintf(buffer, count, format, argptr);
+va_end(argptr);
+return r;
+}
 #endif
 
 #define STDIN_FILENO  0

Modified: lldb/trunk/source/Host/windows/Windows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/Windows.cpp?rev=245610&r1=245609&r2=245610&view=diff
==
--- lldb/trunk/source/Host/windows/Windows.cpp (original)
+++ lldb/trunk/source/Host/windows/Windows.cpp Thu Aug 20 15:53:15 2015
@@ -203,18 +203,17 @@ int usleep(uint32_t useconds)
 }
 
 #if _MSC_VER < 1900
-int snprintf(char *buffer, size_t count, const char *format, ...)
+namespace lldb_private {
+int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr)
 {
 int old_errno = errno;
-va_list argptr;
-va_start(argptr, format);
-int r = vsnprintf(buffer, count, format, argptr);
+int r = ::vsnprintf(buffer, count, format, argptr);
 int new_errno = errno;
 buffer[count-1] = '\0';
 if (r == -1 || r == count)
 {
 FILE *nul = fopen("nul", "w");
-int bytes_written = vfprintf(nul, format, argptr);
+int bytes_written = ::vfprintf(nul, format, argptr);
 fclose(nul);
 if (bytes_written < count)
 errno = new_errno;
@@ -224,9 +223,9 @@ int snprintf(char *buffer, size_t count,
 r = bytes_written;
 }
 }
-va_end(argptr);
 return r;
 }
+} // namespace lldb_private
 #endif
 
 #endif // _MSC_VER


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


Re: [Lldb-commits] [PATCH] D12206: Inline fake snprintf to avoid linkage issues on Windows.

2015-08-20 Thread Chaoren Lin via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL245610: Inline fake snprintf to avoid linkage issues on 
Windows. (authored by chaoren).

Changed prior to commit:
  http://reviews.llvm.org/D12206?vs=32722&id=32740#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12206

Files:
  lldb/trunk/include/lldb/Host/windows/win32.h
  lldb/trunk/source/Host/windows/Windows.cpp

Index: lldb/trunk/source/Host/windows/Windows.cpp
===
--- lldb/trunk/source/Host/windows/Windows.cpp
+++ lldb/trunk/source/Host/windows/Windows.cpp
@@ -203,18 +203,17 @@
 }
 
 #if _MSC_VER < 1900
-int snprintf(char *buffer, size_t count, const char *format, ...)
+namespace lldb_private {
+int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr)
 {
 int old_errno = errno;
-va_list argptr;
-va_start(argptr, format);
-int r = vsnprintf(buffer, count, format, argptr);
+int r = ::vsnprintf(buffer, count, format, argptr);
 int new_errno = errno;
 buffer[count-1] = '\0';
 if (r == -1 || r == count)
 {
 FILE *nul = fopen("nul", "w");
-int bytes_written = vfprintf(nul, format, argptr);
+int bytes_written = ::vfprintf(nul, format, argptr);
 fclose(nul);
 if (bytes_written < count)
 errno = new_errno;
@@ -224,9 +223,9 @@
 r = bytes_written;
 }
 }
-va_end(argptr);
 return r;
 }
+} // namespace lldb_private
 #endif
 
 #endif // _MSC_VER
Index: lldb/trunk/include/lldb/Host/windows/win32.h
===
--- lldb/trunk/include/lldb/Host/windows/win32.h
+++ lldb/trunk/include/lldb/Host/windows/win32.h
@@ -65,8 +65,19 @@
 int strncasecmp(const char* s1, const char* s2, size_t n);
 
 #if _MSC_VER < 1900
-int __declspec(dllexport)
-snprintf(char *buffer, size_t count, const char *format, ...);
+namespace lldb_private {
+int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr);
+}
+
+// inline to avoid linkage conflicts
+int inline snprintf(char *buffer, size_t count, const char *format, ...)
+{
+va_list argptr;
+va_start(argptr, format);
+int r = lldb_private::vsnprintf(buffer, count, format, argptr);
+va_end(argptr);
+return r;
+}
 #endif
 
 #define STDIN_FILENO  0


Index: lldb/trunk/source/Host/windows/Windows.cpp
===
--- lldb/trunk/source/Host/windows/Windows.cpp
+++ lldb/trunk/source/Host/windows/Windows.cpp
@@ -203,18 +203,17 @@
 }
 
 #if _MSC_VER < 1900
-int snprintf(char *buffer, size_t count, const char *format, ...)
+namespace lldb_private {
+int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr)
 {
 int old_errno = errno;
-va_list argptr;
-va_start(argptr, format);
-int r = vsnprintf(buffer, count, format, argptr);
+int r = ::vsnprintf(buffer, count, format, argptr);
 int new_errno = errno;
 buffer[count-1] = '\0';
 if (r == -1 || r == count)
 {
 FILE *nul = fopen("nul", "w");
-int bytes_written = vfprintf(nul, format, argptr);
+int bytes_written = ::vfprintf(nul, format, argptr);
 fclose(nul);
 if (bytes_written < count)
 errno = new_errno;
@@ -224,9 +223,9 @@
 r = bytes_written;
 }
 }
-va_end(argptr);
 return r;
 }
+} // namespace lldb_private
 #endif
 
 #endif // _MSC_VER
Index: lldb/trunk/include/lldb/Host/windows/win32.h
===
--- lldb/trunk/include/lldb/Host/windows/win32.h
+++ lldb/trunk/include/lldb/Host/windows/win32.h
@@ -65,8 +65,19 @@
 int strncasecmp(const char* s1, const char* s2, size_t n);
 
 #if _MSC_VER < 1900
-int __declspec(dllexport)
-snprintf(char *buffer, size_t count, const char *format, ...);
+namespace lldb_private {
+int vsnprintf(char *buffer, size_t count, const char *format, va_list argptr);
+}
+
+// inline to avoid linkage conflicts
+int inline snprintf(char *buffer, size_t count, const char *format, ...)
+{
+va_list argptr;
+va_start(argptr, format);
+int r = lldb_private::vsnprintf(buffer, count, format, argptr);
+va_end(argptr);
+return r;
+}
 #endif
 
 #define STDIN_FILENO  0
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12204: Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.

2015-08-20 Thread Tamas Berghammer via lldb-commits
tberghammer added a comment.

Yes, mine is effecting the ObjectFile plugins and the DynamicLoader plugins. I 
will try to upload it tomorrow


http://reviews.llvm.org/D12204



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


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

2015-08-20 Thread Ying Chen via lldb-commits
chying added a subscriber: chying.
chying added a comment.

It seems a bunch of darwin->android_arm tests are broken after this patch.
Could you take a look?
Here is the first build after this patch. 
http://lab.llvm.org:8011/builders/lldb-x86_64-darwin-13.4/builds/4977/steps/test7/logs/stdio


Repository:
  rL LLVM

http://reviews.llvm.org/D11947



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


Re: [Lldb-commits] [PATCH] D12204: Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.

2015-08-20 Thread Stephane Sezer via lldb-commits
sas added a comment.

Sounds good. Thanks.


http://reviews.llvm.org/D12204



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


[Lldb-commits] [lldb] r245625 - Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.

2015-08-20 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Thu Aug 20 17:07:48 2015
New Revision: 245625

URL: http://llvm.org/viewvc/llvm-project?rev=245625&view=rev
Log:
Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.

Summary:
This is useful when dealing with Windows remote that use only the
qXfer:libraries command which returns absolute base addresses, as
opposed to qXfer:libraries-svr4 which returns relative offsets for
module bases.

Reviewers: clayborg, zturner, ADodds

Subscribers: lldb-commits

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

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

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=245625&r1=245624&r2=245625&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Thu Aug 
20 17:07:48 2015
@@ -216,6 +216,16 @@ public:
 return m_has[e_has_base];
 }
 
+void set_base_is_offset (bool is_offset)
+{
+m_base_is_offset = is_offset;
+}
+bool get_base_is_offset(bool & out) const
+{
+out = m_base_is_offset;
+return m_has[e_has_base];
+}
+
 void set_link_map (const lldb::addr_t addr)
 {
 m_link_map = addr;
@@ -250,6 +260,7 @@ public:
 std::string m_name;
 lldb::addr_t m_link_map;
 lldb::addr_t m_base;
+bool m_base_is_offset;
 lldb::addr_t m_dynamic;
 };
 
@@ -4594,7 +4605,8 @@ ProcessGDBRemote::GetLoadedModuleList (G
 {
 // the displacement as read from the field 'l_addr' of the 
link_map struct.
 module.set_base(StringConvert::ToUInt64(value.data(), 
LLDB_INVALID_ADDRESS, 0));
-
+// base address is always a displacement, not an absolute 
value.
+module.set_base_is_offset(true);
 }
 else if (name == "l_ld")
 {
@@ -4609,13 +4621,15 @@ ProcessGDBRemote::GetLoadedModuleList (G
 {
 std::string name;
 lldb::addr_t lm=0, base=0, ld=0;
+bool base_is_offset;
 
 module.get_name (name);
 module.get_link_map (lm);
 module.get_base (base);
+module.get_base_is_offset (base_is_offset);
 module.get_dynamic (ld);
 
-log->Printf ("found (link_map:0x%08" PRIx64 ", base:0x%08" 
PRIx64 ", ld:0x%08" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
+log->Printf ("found (link_map:0x%08" PRIx64 ", base:0x%08" 
PRIx64 "[%s], ld:0x%08" PRIx64 ", name:'%s')", lm, base, (base_is_offset ? 
"offset" : "absolute"), ld, name.c_str());
 }
 
 list.add (module);
@@ -4657,15 +4671,19 @@ ProcessGDBRemote::GetLoadedModuleList (G
 const XMLNode §ion = 
library.FindFirstChildElementWithName("section");
 llvm::StringRef address = section.GetAttributeValue("address");
 module.set_base(StringConvert::ToUInt64(address.data(), 
LLDB_INVALID_ADDRESS, 0));
+// These addresses are absolute values.
+module.set_base_is_offset(false);
 
 if (log)
 {
 std::string name;
 lldb::addr_t base = 0;
+bool base_is_offset;
 module.get_name (name);
 module.get_base (base);
+module.get_base_is_offset (base_is_offset);
 
-log->Printf ("found (base:0x%08" PRIx64 ", name:'%s')", base, 
name.c_str());
+log->Printf ("found (base:0x%08" PRIx64 "[%s], name:'%s')", 
base, (base_is_offset ? "offset" : "absolute"), name.c_str());
 }
 
 list.add (module);
@@ -4682,7 +4700,7 @@ ProcessGDBRemote::GetLoadedModuleList (G
 }
 
 lldb::ModuleSP
-ProcessGDBRemote::LoadModuleAtAddress (const FileSpec &file, lldb::addr_t 
base_addr)
+ProcessGDBRemote::LoadModuleAtAddress (const FileSpec &file, lldb::addr_t 
base_addr, bool value_is_offset)
 {
 Target &target = m_process->GetTarget();
 ModuleList &modules = target.GetImages();
@@ -4693,11 +4711,11 @@ ProcessGDBRemote::LoadModuleAtAddress (c
 ModuleSpec module_spec (file, target.GetArchitecture());
 if ((module_sp = modules.FindFirstModule (module_spec)))
 {
-module_sp->SetLoadAddress (target, base_addr, true, changed);
+module_sp->SetLoadAddress (target, base_addr, value_is_offset, 
changed);
 }
 else if ((module_sp = target.GetSharedModule (module_spec)))
 {
-mo

Re: [Lldb-commits] [PATCH] D12204: Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.

2015-08-20 Thread Stephane Sezer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL245625: Understand absolute base addresses in 
ProcessGDBRemote::GetLoadedModuleList. (authored by sas).

Changed prior to commit:
  http://reviews.llvm.org/D12204?vs=32720&id=32757#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12204

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

Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -452,7 +452,7 @@
 GetLoadedModuleList (GDBLoadedModuleInfoList &);
 
 lldb::ModuleSP
-LoadModuleAtAddress (const FileSpec &file, lldb::addr_t base_addr);
+LoadModuleAtAddress (const FileSpec &file, lldb::addr_t base_addr, bool value_is_offset);
 
 private:
 //--
Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -216,6 +216,16 @@
 return m_has[e_has_base];
 }
 
+void set_base_is_offset (bool is_offset)
+{
+m_base_is_offset = is_offset;
+}
+bool get_base_is_offset(bool & out) const
+{
+out = m_base_is_offset;
+return m_has[e_has_base];
+}
+
 void set_link_map (const lldb::addr_t addr)
 {
 m_link_map = addr;
@@ -250,6 +260,7 @@
 std::string m_name;
 lldb::addr_t m_link_map;
 lldb::addr_t m_base;
+bool m_base_is_offset;
 lldb::addr_t m_dynamic;
 };
 
@@ -4594,7 +4605,8 @@
 {
 // the displacement as read from the field 'l_addr' of the link_map struct.
 module.set_base(StringConvert::ToUInt64(value.data(), LLDB_INVALID_ADDRESS, 0));
-
+// base address is always a displacement, not an absolute value.
+module.set_base_is_offset(true);
 }
 else if (name == "l_ld")
 {
@@ -4609,13 +4621,15 @@
 {
 std::string name;
 lldb::addr_t lm=0, base=0, ld=0;
+bool base_is_offset;
 
 module.get_name (name);
 module.get_link_map (lm);
 module.get_base (base);
+module.get_base_is_offset (base_is_offset);
 module.get_dynamic (ld);
 
-log->Printf ("found (link_map:0x%08" PRIx64 ", base:0x%08" PRIx64 ", ld:0x%08" PRIx64 ", name:'%s')", lm, base, ld, name.c_str());
+log->Printf ("found (link_map:0x%08" PRIx64 ", base:0x%08" PRIx64 "[%s], ld:0x%08" PRIx64 ", name:'%s')", lm, base, (base_is_offset ? "offset" : "absolute"), ld, name.c_str());
 }
 
 list.add (module);
@@ -4657,15 +4671,19 @@
 const XMLNode §ion = library.FindFirstChildElementWithName("section");
 llvm::StringRef address = section.GetAttributeValue("address");
 module.set_base(StringConvert::ToUInt64(address.data(), LLDB_INVALID_ADDRESS, 0));
+// These addresses are absolute values.
+module.set_base_is_offset(false);
 
 if (log)
 {
 std::string name;
 lldb::addr_t base = 0;
+bool base_is_offset;
 module.get_name (name);
 module.get_base (base);
+module.get_base_is_offset (base_is_offset);
 
-log->Printf ("found (base:0x%08" PRIx64 ", name:'%s')", base, name.c_str());
+log->Printf ("found (base:0x%08" PRIx64 "[%s], name:'%s')", base, (base_is_offset ? "offset" : "absolute"), name.c_str());
 }
 
 list.add (module);
@@ -4682,7 +4700,7 @@
 }
 
 lldb::ModuleSP
-ProcessGDBRemote::LoadModuleAtAddress (const FileSpec &file, lldb::addr_t base_addr)
+ProcessGDBRemote::LoadModuleAtAddress (const FileSpec &file, lldb::addr_t base_addr, bool value_is_offset)
 {
 Target &target = m_process->GetTarget();
 ModuleList &modules = target.GetImages();
@@ -4693,11 +4711,11 @@
 ModuleSpec module_spec (file, target.GetArchitecture());
 if ((module_sp = modules.FindFirstModule (module_spec)))
 {
-module_sp->SetLoadAddress (target, base_addr, true, changed);
+module_sp->SetLoadAddress (target, base_addr, value_is_offset, changed);
 }
 else if ((module_sp = target.GetSharedModule (module_spec)))
 {
-module_sp->SetLoadAddress (target, 

[Lldb-commits] [lldb] r245627 - XFAIL TestAnonymous.test_expr_null_with_dwarf on Windows.

2015-08-20 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Aug 20 17:08:48 2015
New Revision: 245627

URL: http://llvm.org/viewvc/llvm-project?rev=245627&view=rev
Log:
XFAIL TestAnonymous.test_expr_null_with_dwarf on Windows.

This bug is tracked in llvm.org/pr21550, and also reproduces on
FreeBSD apparently.

Modified:
lldb/trunk/test/lang/c/anonymous/TestAnonymous.py

Modified: lldb/trunk/test/lang/c/anonymous/TestAnonymous.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/anonymous/TestAnonymous.py?rev=245627&r1=245626&r2=245627&view=diff
==
--- lldb/trunk/test/lang/c/anonymous/TestAnonymous.py (original)
+++ lldb/trunk/test/lang/c/anonymous/TestAnonymous.py Thu Aug 20 17:08:48 2015
@@ -63,6 +63,7 @@ class AnonymousTestCase(TestBase):
 self.expr_parent()
 
 @expectedFailureFreeBSD('llvm.org/pr21550')
+@expectedFailureWindows('llvm.org/pr21550')
 @dwarf_test
 def test_expr_null_with_dwarf(self):
 self.buildDwarf()


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


[Lldb-commits] [lldb] r245626 - [ProcessWindows] Fix rare crash on shutdown.

2015-08-20 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Aug 20 17:08:38 2015
New Revision: 245626

URL: http://llvm.org/viewvc/llvm-project?rev=245626&view=rev
Log:
[ProcessWindows] Fix rare crash on shutdown.

There might be an underlying race condition here that should be
figured out, but this at least prevents the crash for the time
being and doesn't appear to have any adverse effects.

Modified:
lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp

Modified: lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp?rev=245626&r1=245625&r2=245626&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp Thu Aug 20 
17:08:38 2015
@@ -568,6 +568,9 @@ ProcessWindows::RefreshStateAfterStop()
 StopInfoSP stop_info;
 m_thread_list.SetSelectedThreadByID(active_exception->GetThreadID());
 ThreadSP stop_thread = m_thread_list.GetSelectedThread();
+if (!stop_thread)
+return;
+
 RegisterContextSP register_context = stop_thread->GetRegisterContext();
 
 // The current EIP is AFTER the BP opcode, which is one byte.


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


[Lldb-commits] [lldb] r245628 - XFAIL TestBSDArchives.py on Windows

2015-08-20 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Aug 20 17:08:57 2015
New Revision: 245628

URL: http://llvm.org/viewvc/llvm-project?rev=245628&view=rev
Log:
XFAIL TestBSDArchives.py on Windows

llvm.org/pr24527 tracks this bug.  Makefile.rules does not know
how to build static libraries on Windows.

Modified:
lldb/trunk/test/functionalities/archives/TestBSDArchives.py

Modified: lldb/trunk/test/functionalities/archives/TestBSDArchives.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/archives/TestBSDArchives.py?rev=245628&r1=245627&r2=245628&view=diff
==
--- lldb/trunk/test/functionalities/archives/TestBSDArchives.py (original)
+++ lldb/trunk/test/functionalities/archives/TestBSDArchives.py Thu Aug 20 
17:08:57 2015
@@ -10,6 +10,7 @@ class BSDArchivesTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
+@expectedFailureHostWindows("llvm.org/pr24527") # Makefile.rules doesn't 
know how to build static libs on Windows.
 def test_with_dwarf(self):
 """Break inside a() and b() defined within libfoo.a."""
 self.buildDwarf()


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


[Lldb-commits] [lldb] r245630 - [Windows] XFAIL tests that require calling a function in target.

2015-08-20 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Aug 20 17:09:35 2015
New Revision: 245630

URL: http://llvm.org/viewvc/llvm-project?rev=245630&view=rev
Log:
[Windows] XFAIL tests that require calling a function in target.

This has known issues on Windows.  Fixing this is tracked by
http://llvm.org/pr21765

Modified:
lldb/trunk/test/expression_command/formatters/TestFormatters.py

lldb/trunk/test/expression_command/persistent_types/TestNestedPersistentTypes.py
lldb/trunk/test/expression_command/persistent_types/TestPersistentTypes.py
lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py
lldb/trunk/test/expression_command/radar_9673664/TestExprHelpExamples.py
lldb/trunk/test/expression_command/test/TestExprs.py
lldb/trunk/test/lang/c/function_types/TestFunctionTypes.py
lldb/trunk/test/lang/c/set_values/TestSetValues.py
lldb/trunk/test/lang/c/strings/TestCStrings.py
lldb/trunk/test/lang/cpp/static_members/TestCPPStaticMembers.py

Modified: lldb/trunk/test/expression_command/formatters/TestFormatters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/formatters/TestFormatters.py?rev=245630&r1=245629&r2=245630&view=diff
==
--- lldb/trunk/test/expression_command/formatters/TestFormatters.py (original)
+++ lldb/trunk/test/expression_command/formatters/TestFormatters.py Thu Aug 20 
17:09:35 2015
@@ -27,6 +27,7 @@ class ExprFormattersTestCase(TestBase):
 
 @expectedFailureFreeBSD('llvm.org/pr19011') # Newer Clang omits C1 
complete object constructor
 @expectedFailureLinux('llvm.org/pr19011', ['clang'])
+@expectedFailureWindows("llvm.org/pr21765")
 @dwarf_test
 def test_with_dwarf(self):
 """Test expr + formatters for good interoperability."""

Modified: 
lldb/trunk/test/expression_command/persistent_types/TestNestedPersistentTypes.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/persistent_types/TestNestedPersistentTypes.py?rev=245630&r1=245629&r2=245630&view=diff
==
--- 
lldb/trunk/test/expression_command/persistent_types/TestNestedPersistentTypes.py
 (original)
+++ 
lldb/trunk/test/expression_command/persistent_types/TestNestedPersistentTypes.py
 Thu Aug 20 17:09:35 2015
@@ -11,6 +11,7 @@ class NestedPersistentTypesTestCase(Test
 
 mydir = TestBase.compute_mydir(__file__)
 
+@expectedFailureWindows("llvm.org/pr21765")
 def test_persistent_types(self):
 """Test that nested persistent types work."""
 self.buildDefault()

Modified: 
lldb/trunk/test/expression_command/persistent_types/TestPersistentTypes.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/persistent_types/TestPersistentTypes.py?rev=245630&r1=245629&r2=245630&view=diff
==
--- lldb/trunk/test/expression_command/persistent_types/TestPersistentTypes.py 
(original)
+++ lldb/trunk/test/expression_command/persistent_types/TestPersistentTypes.py 
Thu Aug 20 17:09:35 2015
@@ -11,6 +11,7 @@ class PersistenttypesTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
+@expectedFailureWindows("llvm.org/pr21765")
 def test_persistent_types(self):
 """Test that lldb persistent types works correctly."""
 self.buildDefault()

Modified: lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py?rev=245630&r1=245629&r2=245630&view=diff
==
--- lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py 
(original)
+++ lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py Thu 
Aug 20 17:09:35 2015
@@ -13,6 +13,7 @@ class Radar9531204TestCase(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 
 # rdar://problem/9531204
+@expectedFailureWindows("llvm.org/pr21765")
 def test_expr_commands(self):
 """The evaluating printf(...) after break stop and then up a stack 
frame."""
 self.buildDefault()

Modified: 
lldb/trunk/test/expression_command/radar_9673664/TestExprHelpExamples.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/radar_9673664/TestExprHelpExamples.py?rev=245630&r1=245629&r2=245630&view=diff
==
--- lldb/trunk/test/expression_command/radar_9673664/TestExprHelpExamples.py 
(original)
+++ lldb/trunk/test/expression_command/radar_9673664/TestExprHelpExamples.py 
Thu Aug 20 17:09:35 2015
@@ -20,6 +20,7 @@ class Radar9673644TestCase(TestBase):
 self.line = line_number(self.main_source, '// Set breakpoint here.')
 
 @expectedFailureDarwin(15641319)
+@expected

[Lldb-commits] [lldb] r245629 - XFAIL breakpoint tests on Windows

2015-08-20 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Aug 20 17:09:08 2015
New Revision: 245629

URL: http://llvm.org/viewvc/llvm-project?rev=245629&view=rev
Log:
XFAIL breakpoint tests on Windows

llvm.org/pr24528 tracks fixing this test.

Modified:

lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py

lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py

Modified: 
lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py?rev=245629&r1=245628&r2=245629&view=diff
==
--- 
lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
 (original)
+++ 
lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
 Thu Aug 20 17:09:08 2015
@@ -27,6 +27,7 @@ class BreakpointCommandTestCase(TestBase
 self.breakpoint_command_script_parameters ()
 
 @dwarf_test
+@expectedFailureWindows("llvm.org/pr24528")
 def test_with_dwarf(self):
 """Test a sequence of breakpoint command add, list, and delete."""
 self.buildDwarf()

Modified: 
lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py?rev=245629&r1=245628&r2=245629&view=diff
==
--- 
lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
 (original)
+++ 
lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
 Thu Aug 20 17:09:08 2015
@@ -20,6 +20,7 @@ class BreakpointLocationsTestCase(TestBa
 self.breakpoint_locations_test()
 
 @dwarf_test
+@expectedFailureWindows("llvm.org/pr24528")
 def test_with_dwarf(self):
 """Test breakpoint enable/disable for a breakpoint ID with multiple 
locations."""
 self.buildDwarf()


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


[Lldb-commits] [PATCH] D12217: Run clang-format on DynamicLoaderWindowsDYLD.

2015-08-20 Thread Stephane Sezer via lldb-commits
sas created this revision.
sas added reviewers: clayborg, zturner.
sas added a subscriber: lldb-commits.

This uses the .clang-format at the root of the LLDB repo and is just a
mechanical change that precedes more work in this file.

http://reviews.llvm.org/D12217

Files:
  source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
  source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h

Index: source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
===
--- source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
+++ source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
@@ -19,25 +19,24 @@
 class DynamicLoaderWindowsDYLD : public DynamicLoader
 {
   public:
-DynamicLoaderWindowsDYLD(Process *process);
-virtual ~DynamicLoaderWindowsDYLD();
-
 static void Initialize();
 static void Terminate();
 static ConstString GetPluginNameStatic();
 static const char *GetPluginDescriptionStatic();
 
+DynamicLoaderWindowsDYLD(Process *process);
+virtual ~DynamicLoaderWindowsDYLD();
+
 static DynamicLoader *CreateInstance(Process *process, bool force);
 
-void DidAttach () override;
-void DidLaunch () override;
-Error CanLoadImage () override;
+void DidAttach() override;
+void DidLaunch() override;
+Error CanLoadImage() override;
 lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop) override;
 
 ConstString GetPluginName() override;
 uint32_t GetPluginVersion() override;
 };
-
 }
 
 #endif
Index: source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
===
--- source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
+++ source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
@@ -21,40 +21,39 @@
 DynamicLoaderWindowsDYLD::DynamicLoaderWindowsDYLD(Process *process)
 : DynamicLoader(process)
 {
-
 }
 
 DynamicLoaderWindowsDYLD::~DynamicLoaderWindowsDYLD()
 {
-
 }
 
-void DynamicLoaderWindowsDYLD::Initialize()
+void
+DynamicLoaderWindowsDYLD::Initialize()
 {
-PluginManager::RegisterPlugin(GetPluginNameStatic(),
-  GetPluginDescriptionStatic(),
-  CreateInstance);
+PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance);
 }
 
-void DynamicLoaderWindowsDYLD::Terminate()
+void
+DynamicLoaderWindowsDYLD::Terminate()
 {
-
 }
 
-ConstString DynamicLoaderWindowsDYLD::GetPluginNameStatic()
+ConstString
+DynamicLoaderWindowsDYLD::GetPluginNameStatic()
 {
 static ConstString g_plugin_name("windows-dyld");
 return g_plugin_name;
 }
 
-const char *DynamicLoaderWindowsDYLD::GetPluginDescriptionStatic()
+const char *
+DynamicLoaderWindowsDYLD::GetPluginDescriptionStatic()
 {
 return "Dynamic loader plug-in that watches for shared library "
"loads/unloads in Windows processes.";
 }
 
-
-DynamicLoader *DynamicLoaderWindowsDYLD::CreateInstance(Process *process, bool force)
+DynamicLoader *
+DynamicLoaderWindowsDYLD::CreateInstance(Process *process, bool force)
 {
 bool should_create = force;
 if (!should_create)
@@ -65,32 +64,35 @@
 }
 
 if (should_create)
-return new DynamicLoaderWindowsDYLD (process);
+return new DynamicLoaderWindowsDYLD(process);
 
 return nullptr;
 }
 
-void DynamicLoaderWindowsDYLD::DidAttach()
+void
+DynamicLoaderWindowsDYLD::DidAttach()
 {
-
 }
 
-void DynamicLoaderWindowsDYLD::DidLaunch()
+void
+DynamicLoaderWindowsDYLD::DidLaunch()
 {
-
 }
 
-Error DynamicLoaderWindowsDYLD::CanLoadImage()
+Error
+DynamicLoaderWindowsDYLD::CanLoadImage()
 {
 return Error();
 }
 
-ConstString DynamicLoaderWindowsDYLD::GetPluginName()
+ConstString
+DynamicLoaderWindowsDYLD::GetPluginName()
 {
 return GetPluginNameStatic();
 }
 
-uint32_t DynamicLoaderWindowsDYLD::GetPluginVersion()
+uint32_t
+DynamicLoaderWindowsDYLD::GetPluginVersion()
 {
 return 1;
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r245631 - Change TestBSDArchives to expectedFailureWindows.

2015-08-20 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Thu Aug 20 17:25:45 2015
New Revision: 245631

URL: http://llvm.org/viewvc/llvm-project?rev=245631&view=rev
Log:
Change TestBSDArchives to expectedFailureWindows.

Modified:
lldb/trunk/test/functionalities/archives/TestBSDArchives.py

Modified: lldb/trunk/test/functionalities/archives/TestBSDArchives.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/archives/TestBSDArchives.py?rev=245631&r1=245630&r2=245631&view=diff
==
--- lldb/trunk/test/functionalities/archives/TestBSDArchives.py (original)
+++ lldb/trunk/test/functionalities/archives/TestBSDArchives.py Thu Aug 20 
17:25:45 2015
@@ -10,7 +10,7 @@ class BSDArchivesTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailureHostWindows("llvm.org/pr24527") # Makefile.rules doesn't 
know how to build static libs on Windows.
+@expectedFailureWindows("llvm.org/pr24527") # Makefile.rules doesn't know 
how to build static libs on Windows.
 def test_with_dwarf(self):
 """Break inside a() and b() defined within libfoo.a."""
 self.buildDwarf()


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


[Lldb-commits] [lldb] r245634 - Run clang-format on DynamicLoaderWindowsDYLD.

2015-08-20 Thread Stephane Sezer via lldb-commits
Author: sas
Date: Thu Aug 20 17:30:20 2015
New Revision: 245634

URL: http://llvm.org/viewvc/llvm-project?rev=245634&view=rev
Log:
Run clang-format on DynamicLoaderWindowsDYLD.

Summary:
This uses the .clang-format at the root of the LLDB repo and is just a
mechanical change that precedes more work in this file.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

Modified:

lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp

lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp?rev=245634&r1=245633&r2=245634&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
 Thu Aug 20 17:30:20 2015
@@ -21,40 +21,39 @@ using namespace lldb_private;
 DynamicLoaderWindowsDYLD::DynamicLoaderWindowsDYLD(Process *process)
 : DynamicLoader(process)
 {
-
 }
 
 DynamicLoaderWindowsDYLD::~DynamicLoaderWindowsDYLD()
 {
-
 }
 
-void DynamicLoaderWindowsDYLD::Initialize()
+void
+DynamicLoaderWindowsDYLD::Initialize()
 {
-PluginManager::RegisterPlugin(GetPluginNameStatic(),
-  GetPluginDescriptionStatic(),
-  CreateInstance);
+PluginManager::RegisterPlugin(GetPluginNameStatic(), 
GetPluginDescriptionStatic(), CreateInstance);
 }
 
-void DynamicLoaderWindowsDYLD::Terminate()
+void
+DynamicLoaderWindowsDYLD::Terminate()
 {
-
 }
 
-ConstString DynamicLoaderWindowsDYLD::GetPluginNameStatic()
+ConstString
+DynamicLoaderWindowsDYLD::GetPluginNameStatic()
 {
 static ConstString g_plugin_name("windows-dyld");
 return g_plugin_name;
 }
 
-const char *DynamicLoaderWindowsDYLD::GetPluginDescriptionStatic()
+const char *
+DynamicLoaderWindowsDYLD::GetPluginDescriptionStatic()
 {
 return "Dynamic loader plug-in that watches for shared library "
"loads/unloads in Windows processes.";
 }
 
-
-DynamicLoader *DynamicLoaderWindowsDYLD::CreateInstance(Process *process, bool 
force)
+DynamicLoader *
+DynamicLoaderWindowsDYLD::CreateInstance(Process *process, bool force)
 {
 bool should_create = force;
 if (!should_create)
@@ -65,32 +64,35 @@ DynamicLoader *DynamicLoaderWindowsDYLD:
 }
 
 if (should_create)
-return new DynamicLoaderWindowsDYLD (process);
+return new DynamicLoaderWindowsDYLD(process);
 
 return nullptr;
 }
 
-void DynamicLoaderWindowsDYLD::DidAttach()
+void
+DynamicLoaderWindowsDYLD::DidAttach()
 {
-
 }
 
-void DynamicLoaderWindowsDYLD::DidLaunch()
+void
+DynamicLoaderWindowsDYLD::DidLaunch()
 {
-
 }
 
-Error DynamicLoaderWindowsDYLD::CanLoadImage()
+Error
+DynamicLoaderWindowsDYLD::CanLoadImage()
 {
 return Error();
 }
 
-ConstString DynamicLoaderWindowsDYLD::GetPluginName()
+ConstString
+DynamicLoaderWindowsDYLD::GetPluginName()
 {
 return GetPluginNameStatic();
 }
 
-uint32_t DynamicLoaderWindowsDYLD::GetPluginVersion()
+uint32_t
+DynamicLoaderWindowsDYLD::GetPluginVersion()
 {
 return 1;
 }

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h?rev=245634&r1=245633&r2=245634&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h 
(original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h 
Thu Aug 20 17:30:20 2015
@@ -19,25 +19,24 @@ namespace lldb_private
 class DynamicLoaderWindowsDYLD : public DynamicLoader
 {
   public:
-DynamicLoaderWindowsDYLD(Process *process);
-virtual ~DynamicLoaderWindowsDYLD();
-
 static void Initialize();
 static void Terminate();
 static ConstString GetPluginNameStatic();
 static const char *GetPluginDescriptionStatic();
 
+DynamicLoaderWindowsDYLD(Process *process);
+virtual ~DynamicLoaderWindowsDYLD();
+
 static DynamicLoader *CreateInstance(Process *process, bool force);
 
-void DidAttach () override;
-void DidLaunch () override;
-Error CanLoadImage () override;
+void DidAttach() override;
+void DidLaunch() override;
+Error CanLoadImage() override;
 lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop) 
override;
 
 ConstString GetPluginName() override;
 uint32_t GetPluginVersion() override;
 };
-
 }
 
 #endif


___
lldb-commits mailing list
lldb-commits@list

Re: [Lldb-commits] [PATCH] D12217: Run clang-format on DynamicLoaderWindowsDYLD.

2015-08-20 Thread Stephane Sezer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL245634: Run clang-format on DynamicLoaderWindowsDYLD. 
(authored by sas).

Changed prior to commit:
  http://reviews.llvm.org/D12217?vs=32758&id=32759#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12217

Files:
  
lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
  
lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h

Index: lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
===
--- lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
+++ lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
@@ -19,25 +19,24 @@
 class DynamicLoaderWindowsDYLD : public DynamicLoader
 {
   public:
-DynamicLoaderWindowsDYLD(Process *process);
-virtual ~DynamicLoaderWindowsDYLD();
-
 static void Initialize();
 static void Terminate();
 static ConstString GetPluginNameStatic();
 static const char *GetPluginDescriptionStatic();
 
+DynamicLoaderWindowsDYLD(Process *process);
+virtual ~DynamicLoaderWindowsDYLD();
+
 static DynamicLoader *CreateInstance(Process *process, bool force);
 
-void DidAttach () override;
-void DidLaunch () override;
-Error CanLoadImage () override;
+void DidAttach() override;
+void DidLaunch() override;
+Error CanLoadImage() override;
 lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop) override;
 
 ConstString GetPluginName() override;
 uint32_t GetPluginVersion() override;
 };
-
 }
 
 #endif
Index: lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
===
--- lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
+++ lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
@@ -21,40 +21,39 @@
 DynamicLoaderWindowsDYLD::DynamicLoaderWindowsDYLD(Process *process)
 : DynamicLoader(process)
 {
-
 }
 
 DynamicLoaderWindowsDYLD::~DynamicLoaderWindowsDYLD()
 {
-
 }
 
-void DynamicLoaderWindowsDYLD::Initialize()
+void
+DynamicLoaderWindowsDYLD::Initialize()
 {
-PluginManager::RegisterPlugin(GetPluginNameStatic(),
-  GetPluginDescriptionStatic(),
-  CreateInstance);
+PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance);
 }
 
-void DynamicLoaderWindowsDYLD::Terminate()
+void
+DynamicLoaderWindowsDYLD::Terminate()
 {
-
 }
 
-ConstString DynamicLoaderWindowsDYLD::GetPluginNameStatic()
+ConstString
+DynamicLoaderWindowsDYLD::GetPluginNameStatic()
 {
 static ConstString g_plugin_name("windows-dyld");
 return g_plugin_name;
 }
 
-const char *DynamicLoaderWindowsDYLD::GetPluginDescriptionStatic()
+const char *
+DynamicLoaderWindowsDYLD::GetPluginDescriptionStatic()
 {
 return "Dynamic loader plug-in that watches for shared library "
"loads/unloads in Windows processes.";
 }
 
-
-DynamicLoader *DynamicLoaderWindowsDYLD::CreateInstance(Process *process, bool force)
+DynamicLoader *
+DynamicLoaderWindowsDYLD::CreateInstance(Process *process, bool force)
 {
 bool should_create = force;
 if (!should_create)
@@ -65,32 +64,35 @@
 }
 
 if (should_create)
-return new DynamicLoaderWindowsDYLD (process);
+return new DynamicLoaderWindowsDYLD(process);
 
 return nullptr;
 }
 
-void DynamicLoaderWindowsDYLD::DidAttach()
+void
+DynamicLoaderWindowsDYLD::DidAttach()
 {
-
 }
 
-void DynamicLoaderWindowsDYLD::DidLaunch()
+void
+DynamicLoaderWindowsDYLD::DidLaunch()
 {
-
 }
 
-Error DynamicLoaderWindowsDYLD::CanLoadImage()
+Error
+DynamicLoaderWindowsDYLD::CanLoadImage()
 {
 return Error();
 }
 
-ConstString DynamicLoaderWindowsDYLD::GetPluginName()
+ConstString
+DynamicLoaderWindowsDYLD::GetPluginName()
 {
 return GetPluginNameStatic();
 }
 
-uint32_t DynamicLoaderWindowsDYLD::GetPluginVersion()
+uint32_t
+DynamicLoaderWindowsDYLD::GetPluginVersion()
 {
 return 1;
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D12218: Implement handling of `library:` keys in thread stop replies.

2015-08-20 Thread Stephane Sezer via lldb-commits
sas created this revision.
sas added reviewers: clayborg, zturner, tberghammer.
sas added a subscriber: lldb-commits.

When a windows remote stops because of a DLL load/unload, the debug server
sends a stop reply packet that contains a `library` key with any value (usually
just `library:1`). This indicates to the debugger that a library has been
loaded or unloaded and that the list of libraries should be refreshed (usually
with `qXfer:libraries:read`).

This change just triggers a call to `LoadModules()` which in turns will send a
remote library read command when a stop reply that requests it is received.

http://reviews.llvm.org/D12218

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2522,6 +2522,10 @@
 ostr.Printf("%" PRIu64 " %" PRIu32, wp_addr, wp_index);
 description = ostr.GetString().c_str();
 }
+else if (key.compare("library"))
+{
+LoadModules();
+}
 else if (key.size() == 2 && ::isxdigit(key[0]) && 
::isxdigit(key[1]))
 {
 uint32_t reg = StringConvert::ToUInt32 (key.c_str(), 
UINT32_MAX, 16);


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2522,6 +2522,10 @@
 ostr.Printf("%" PRIu64 " %" PRIu32, wp_addr, wp_index);
 description = ostr.GetString().c_str();
 }
+else if (key.compare("library"))
+{
+LoadModules();
+}
 else if (key.size() == 2 && ::isxdigit(key[0]) && ::isxdigit(key[1]))
 {
 uint32_t reg = StringConvert::ToUInt32 (key.c_str(), UINT32_MAX, 16);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12218: Implement handling of `library:` keys in thread stop replies.

2015-08-20 Thread Stephane Sezer via lldb-commits
sas updated this revision to Diff 32766.
sas added a comment.

Fix bug with bool comparison.


http://reviews.llvm.org/D12218

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2522,6 +2522,10 @@
 ostr.Printf("%" PRIu64 " %" PRIu32, wp_addr, wp_index);
 description = ostr.GetString().c_str();
 }
+else if (key.compare("library") == 0)
+{
+LoadModules();
+}
 else if (key.size() == 2 && ::isxdigit(key[0]) && 
::isxdigit(key[1]))
 {
 uint32_t reg = StringConvert::ToUInt32 (key.c_str(), 
UINT32_MAX, 16);


Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2522,6 +2522,10 @@
 ostr.Printf("%" PRIu64 " %" PRIu32, wp_addr, wp_index);
 description = ostr.GetString().c_str();
 }
+else if (key.compare("library") == 0)
+{
+LoadModules();
+}
 else if (key.size() == 2 && ::isxdigit(key[0]) && ::isxdigit(key[1]))
 {
 uint32_t reg = StringConvert::ToUInt32 (key.c_str(), UINT32_MAX, 16);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r245639 - Make UriParser to support [$HOSTNAME] notation.

2015-08-20 Thread Oleksiy Vyalov via lldb-commits
Author: ovyalov
Date: Thu Aug 20 18:09:34 2015
New Revision: 245639

URL: http://llvm.org/viewvc/llvm-project?rev=245639&view=rev
Log:
Make UriParser to support [$HOSTNAME] notation.

http://reviews.llvm.org/D12025


Modified:
lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp

lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
lldb/trunk/source/Utility/UriParser.cpp
lldb/trunk/source/Utility/UriParser.h
lldb/trunk/unittests/Utility/UriParserTest.cpp

Modified: lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp?rev=245639&r1=245638&r2=245639&view=diff
==
--- lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp (original)
+++ lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp Thu Aug 20 
18:09:34 2015
@@ -33,6 +33,8 @@
 #endif
 
 // C++ Includes
+#include 
+
 // Other libraries and framework includes
 #include "llvm/Support/ErrorHandling.h"
 #if defined(__APPLE__)
@@ -47,6 +49,8 @@
 #include "lldb/Host/Socket.h"
 #include "lldb/Interpreter/Args.h"
 
+#include "Utility/UriParser.h"
+
 using namespace lldb;
 using namespace lldb_private;
 
@@ -169,10 +173,16 @@ ConnectionFileDescriptor::Connect(const
 else if (strstr(s, "adb://") == s)
 {
 int port = -1;
-sscanf(s, "adb://%*[^:]:%d", &port);
-char host_and_port[sizeof("localhost:65535")];
-snprintf(host_and_port, sizeof(host_and_port), "localhost:%d", 
port);
-return ConnectTCP(host_and_port, error_ptr);
+std::string scheme, host, path;
+if (!UriParser::Parse(s, scheme, host, port, path))
+{
+if (error_ptr)
+error_ptr->SetErrorStringWithFormat("Failed to parse URL 
'%s'", s);
+return eConnectionStatusError;
+}
+std::ostringstream host_and_port;
+host_and_port << "localhost:" << port;
+return ConnectTCP(host_and_port.str().c_str(), error_ptr);
 }
 else if (strstr(s, "connect://") == s)
 {

Modified: 
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp?rev=245639&r1=245638&r2=245639&view=diff
==
--- 
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp 
Thu Aug 20 18:09:34 2015
@@ -16,6 +16,8 @@
 #include "PlatformAndroidRemoteGDBServer.h"
 #include "Utility/UriParser.h"
 
+#include 
+
 using namespace lldb;
 using namespace lldb_private;
 using namespace platform_android;
@@ -135,3 +137,19 @@ PlatformAndroidRemoteGDBServer::DeleteFo
 }
 m_port_forwards.erase(it);
 }
+
+std::string
+PlatformAndroidRemoteGDBServer::MakeServerUrl(const char* scheme,
+  const char* hostname,
+  uint16_t port)
+{
+std::ostringstream hostname_str;
+if (!strcmp(scheme, "adb"))
+hostname_str << "[" << hostname << "]";
+else
+hostname_str << hostname;
+
+return PlatformRemoteGDBServer::MakeServerUrl(scheme,
+  hostname_str.str().c_str(),
+  port);
+}

Modified: 
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h?rev=245639&r1=245638&r2=245639&view=diff
==
--- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h 
(original)
+++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h 
Thu Aug 20 18:09:34 2015
@@ -49,6 +49,11 @@ protected:
 void
 DeleteForwardPort (lldb::pid_t pid);
 
+std::string
+MakeServerUrl(const char* scheme,
+  const char* hostname,
+  uint16_t port) override;
+
 private:
 DISALLOW_COPY_AND_ASSIGN (PlatformAndroidRemoteGDBServer);
 

Modified: 
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp?rev=245639&r1=245638&r2=245639&view=diff
=

Re: [Lldb-commits] [PATCH] D12025: Make UriParser to support [$HOSTNAME] notation.

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

Files:

  /lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp
  /lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
  /lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
  /lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  /lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
  /lldb/trunk/source/Utility/UriParser.cpp
  /lldb/trunk/source/Utility/UriParser.h
  /lldb/trunk/unittests/Utility/UriParserTest.cpp

Users:

  ovyalov (Author)

http://reviews.llvm.org/rL245639


http://reviews.llvm.org/D12025



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


[Lldb-commits] [lldb] r245645 - The llvm Triple for an armv6m now comes back as llvm::Triple::thumb.

2015-08-20 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Aug 20 19:13:37 2015
New Revision: 245645

URL: http://llvm.org/viewvc/llvm-project?rev=245645&view=rev
Log:
The llvm Triple for an armv6m now comes back as llvm::Triple::thumb.
This was breaking disassembly for arm machines that we force to be
thumb mode all the time because we were only checking for llvm::Triple::arm.
i.e.

armv6m (ARM Cortex-M0)
armv7m (ARM Cortex-M3)
armv7em (ARM Cortex-M4)




Modified:
lldb/trunk/source/Core/Disassembler.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp

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

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=245645&r1=245644&r2=245645&view=diff
==
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Thu Aug 20 19:13:37 2015
@@ -1264,7 +1264,7 @@ Disassembler::Disassembler(const ArchSpe
 // 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
+if ((arch.GetTriple().getArch() == llvm::Triple::arm || 
arch.GetTriple().getArch() == llvm::Triple::thumb)
 && (arch.GetCore() == ArchSpec::Core::eCore_arm_armv7m
 || arch.GetCore() == ArchSpec::Core::eCore_arm_armv7em
 || arch.GetCore() == ArchSpec::Core::eCore_arm_armv6m))

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=245645&r1=245644&r2=245645&view=diff
==
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Thu Aug 
20 19:13:37 2015
@@ -604,7 +604,7 @@ DisassemblerLLVMC::DisassemblerLLVMC (co
 }
 
 ArchSpec thumb_arch(arch);
-if (arch.GetTriple().getArch() == llvm::Triple::arm)
+if (arch.GetTriple().getArch() == llvm::Triple::arm || 
arch.GetTriple().getArch() == llvm::Triple::thumb)
 {
 std::string thumb_arch_name 
(thumb_arch.GetTriple().getArchName().str());
 // Replace "arm" with "thumb" so we get all thumb variants correct
@@ -626,7 +626,7 @@ DisassemblerLLVMC::DisassemblerLLVMC (co
 // Handle the Cortex-M0 (armv6m) the same; the ISA is a subset of the T 
and T32
 // instructions defined in ARMv7-A.
 
-if (arch.GetTriple().getArch() == llvm::Triple::arm
+if ((arch.GetTriple().getArch() == llvm::Triple::arm || 
arch.GetTriple().getArch() == llvm::Triple::thumb)
 && (arch.GetCore() == ArchSpec::Core::eCore_arm_armv7m
 || arch.GetCore() == ArchSpec::Core::eCore_arm_armv7em
 || arch.GetCore() == ArchSpec::Core::eCore_arm_armv6m))
@@ -698,7 +698,7 @@ DisassemblerLLVMC::DisassemblerLLVMC (co
 }
 
 // For arm CPUs that can execute arm or thumb instructions, also create a 
thumb instruction disassembler.
-if (arch.GetTriple().getArch() == llvm::Triple::arm)
+if (arch.GetTriple().getArch() == llvm::Triple::arm || 
arch.GetTriple().getArch() == llvm::Triple::thumb)
 {
 std::string thumb_triple(thumb_arch.GetTriple().getTriple());
 m_alternate_disasm_ap.reset(new 
LLVMCDisassembler(thumb_triple.c_str(), "", "", flavor, *this));

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=245645&r1=245644&r2=245645&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Thu Aug 20 
19:13:37 2015
@@ -5721,6 +5721,7 @@ ObjectFileMachO::SaveCore (const lldb::P
 {
 case llvm::Triple::aarch64:
 case llvm::Triple::arm:
+case llvm::Triple::thumb:
 case llvm::Triple::x86:
 case llvm::Triple::x86_64:
 make_core = true;

Modified: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp?rev=245645&r1=245644&r2=245645&view=diff
==
--- lldb/trunk/source/Plugins/Process/Ut