[Lldb-commits] [lldb] r259344 - Set correct ThreadStopInfo in case of trace event
Author: abhishek Date: Mon Feb 1 03:01:42 2016 New Revision: 259344 URL: http://llvm.org/viewvc/llvm-project?rev=259344&view=rev Log: Set correct ThreadStopInfo in case of trace event Summary: - The patch solves Bug 23478 and Bug 19311. Resolving Bug 23478 also resolves Bug 23039. Correct ThreadStopInfo is set for Linux and FreeBSD platforms. - Summary: When a trace event is reported, we need to check whether the trace event lands at a breakpoint site. If it lands at a breakpoint site then set the thread's StopInfo with the reason 'breakpoint'. Else, set the reason to be 'Trace'. Change-Id: I0af9765e782fd74bc0cead41548486009f8abb87 Signed-off-by: Abhishek Aggarwal Reviewers: jingham, emaste, lldb-commits, clayborg, ovyalov Subscribers: emaste Differential Revision: http://reviews.llvm.org/D16720 Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py?rev=259344&r1=259343&r2=259344&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py Mon Feb 1 03:01:42 2016 @@ -15,7 +15,6 @@ class ConsecutiveBreakpointsTestCase(Tes mydir = TestBase.compute_mydir(__file__) -@expectedFailureAll("llvm.org/pr23478", oslist = not_in(["macosx"])) def test (self): self.build () self.consecutive_breakpoints_tests() Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py?rev=259344&r1=259343&r2=259344&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py Mon Feb 1 03:01:42 2016 @@ -31,10 +31,7 @@ class DynamicValueChildCountTestCase(Tes self.main_sixth_call_line = line_number('pass-to-base.cpp', '// Break here and check b has 0 children again') -@expectedFailureLinux("llvm.org/pr23039") -@expectedFailureFreeBSD("llvm.org/pr19311") # continue at a breakpoint does not work @expectedFailureWindows("llvm.org/pr24663") -@expectedFailurei386("to be figured out") @add_test_categories(['pyapi']) def test_get_dynamic_vals(self): """Test fetching C++ dynamic values from pointers & references.""" Modified: lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp?rev=259344&r1=259343&r2=259344&view=diff == --- lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp (original) +++ lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp Mon Feb 1 03:01:42 2016 @@ -558,22 +558,49 @@ FreeBSDThread::WatchNotify(const Process void FreeBSDThread::TraceNotify(const ProcessMessage &message) { -POSIXBreakpointProtocol* reg_ctx = GetPOSIXBreakpointProtocol(); -if (reg_ctx) +Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD)); + +// Try to resolve the breakpoint object corresponding to the current PC. +assert(GetRegisterContext()); +lldb::addr_t pc = GetRegisterContext()->GetPC(); +if (log) +log->Printf ("FreeBSDThread::%s () PC=0x%8.8" PRIx64, __FUNCTION__, pc); +lldb::BreakpointSiteSP bp_site(GetProcess()->GetBreakpointSiteList().FindByAddress(pc)); + +// If the current pc is a breakpoint site then set the StopInfo to Breakpoint. +// Otherwise, set the StopInfo to Watchpoint or Trace. +if (bp_site) { -uint32_t num_hw_wps = reg_ctx->NumSupportedHardwareWatchpoints(); -uint32_t wp_idx; -for (wp_idx = 0; wp_idx < num_hw_wps; wp_idx++) +
Re: [Lldb-commits] [lldb] r258919 - [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS
Hi Hans, Could you please add this (r258919) to the release branch? Also commit r258967 (on top of this) by Zachary which fixes some python 3 incompatibilities. Thanks, Bhushan -Original Message- From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of Bhushan D. Attarde via lldb-commits Sent: 27 January 2016 15:47 To: lldb-commits@lists.llvm.org Subject: [Lldb-commits] [lldb] r258919 - [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS Author: bhushan.attarde Date: Wed Jan 27 04:16:30 2016 New Revision: 258919 URL: http://llvm.org/viewvc/llvm-project?rev=258919&view=rev Log: [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS SUMMARY: Get the load address for the address given by symbol and function. Earlier, this was done for function only, this patch does it for symbol too. This patch also adds TestAvoidBreakpointInDelaySlot.py to test this change. Reviewers: clayborg Subscribers: labath, zturner, mohit.bhakkad, sagar, jaydeep, lldb-commits Differential Revision: http://reviews.llvm.org/D16049 Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/main.c Modified: lldb/trunk/include/lldb/API/SBInstruction.h lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py lldb/trunk/scripts/interface/SBInstruction.i lldb/trunk/source/API/SBInstruction.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/API/SBInstruction.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBInstruction.h?rev=258919&r1=258918&r2=258919&view=diff == --- lldb/trunk/include/lldb/API/SBInstruction.h (original) +++ lldb/trunk/include/lldb/API/SBInstruction.h Wed Jan 27 04:16:30 2016 @@ -60,6 +60,9 @@ public: bool DoesBranch (); +bool +HasDelaySlot (); + void Print (FILE *out); Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile?rev=258919&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint +++ /breakpoint_in_delayslot/Makefile Wed Jan 27 04:16:30 2016 @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +C_SOURCES := main.c + +include $(LEVEL)/Makefile.rules + Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py?rev=258919&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint +++ /breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py Wed Jan +++ 27 04:16:30 2016 @@ -0,0 +1,82 @@ +""" +Test specific to MIPS +""" + +import os, time +import re +import unittest2 +import lldb +import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest +import * + +class AvoidBreakpointInDelaySlotAPITestCase(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +@skipUnlessArch(archs=re.compile('mips*')) +def test(self): +self.build() +exe = os.path.join(os.getcwd(), "a.out") +self.expect("file " + exe, +patterns = [ "Current executable set to .*a.out.*" + ]) + +# Create a target by the debugger. +target = self.dbg.CreateTarget(exe) +self.assertTrue(target, VALID_TARGET) + +breakpoint = target.BreakpointCreateByName('main', 'a.out') +self.assertTrue(breakpoint and +breakpoint.GetNumLocations() == 1, +VALID_BREAKPOINT) + +# Now launch the process, and do not stop at entry point. +process = target.LaunchSimple (None, None, self.get_process_working_directory()) +self.assertTrue(process, PROCESS_IS_VALID) + +list = target.FindFunctions('foo', lldb.eFunctionNameTypeAuto) +self.assertTrue(list.GetSize() == 1) +
Re: [Lldb-commits] [PATCH] D16741: Make many of the skip decorators use common code
labath added a comment. I am confused as to how could this even work, since all your decorators seem to be ignoring the function they are decorating. I'm pretty sure this is going to cause some very weird things to happen things to come out of the decoration process, which might explain your confusion. Try giving it a go by passing the function explicitly. Comment at: packages/Python/lldbsuite/test/lldbtest.py:560 @@ -559,3 +559,1 @@ """Decorate the item as a debugserver test.""" -if isinstance(func, type) and issubclass(func, unittest2.TestCase): -raise Exception("@debugserver_test can only be used to decorate a test method") Please don't remove these. They make sure that you do not attempt to apply this decorator to a class. If the decorator is not ready for that (and the current skipIfTestFn does not appear to be), it will just cause the whole cause the whole class to be silently ignored (we've had this happen before). I think it's ok to centralize the check in skipTestIfFn. Comment at: packages/Python/lldbsuite/test/lldbtest.py:562 @@ -571,1 +561,3 @@ +return (configuration.dont_do_debugserver_test, "debugserver tests") +return skipTestIfFn(should_skip_debugserver_tests) You have dropped "func" completely here. Should this be `skipTestIfFn(should_skip_debugserver_tests, func)`? (Same goes for other decorators.) http://reviews.llvm.org/D16741 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D16766: [RenderScript] Use LLVM DWARF language enum
EwanCrawford created this revision. EwanCrawford added a reviewer: clayborg. EwanCrawford added a subscriber: lldb-commits. EwanCrawford set the repository for this revision to rL LLVM. A DWARF language vender extension for RenderScript was added to LLVM in r259348(http://reviews.llvm.org/D16409) We should use this generated enum instead of the hardcoded value. RenderScript is also C99 with some extensions, so when it's detected we should treat it as C. Repository: rL LLVM http://reviews.llvm.org/D16766 Files: source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp source/Target/Language.cpp Index: source/Target/Language.cpp === --- source/Target/Language.cpp +++ source/Target/Language.cpp @@ -269,6 +269,7 @@ case eLanguageTypeC89: case eLanguageTypeC99: case eLanguageTypeC11: +case eLanguageTypeExtRenderScript: return true; default: return false; Index: source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp === --- source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -1180,7 +1180,7 @@ { case DW_LANG_Mips_Assembler: return eLanguageTypeMipsAssembler; -case 0x8e57: // FIXME: needs to be added to llvm +case DW_LANG_GOOGLE_RenderScript: return eLanguageTypeExtRenderScript; default: return static_cast(val); Index: source/Target/Language.cpp === --- source/Target/Language.cpp +++ source/Target/Language.cpp @@ -269,6 +269,7 @@ case eLanguageTypeC89: case eLanguageTypeC99: case eLanguageTypeC11: +case eLanguageTypeExtRenderScript: return true; default: return false; Index: source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp === --- source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -1180,7 +1180,7 @@ { case DW_LANG_Mips_Assembler: return eLanguageTypeMipsAssembler; -case 0x8e57: // FIXME: needs to be added to llvm +case DW_LANG_GOOGLE_RenderScript: return eLanguageTypeExtRenderScript; default: return static_cast(val); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D16767: Fix single-stepping onto a breakpoint
labath created this revision. labath added reviewers: tberghammer, emaste. labath added subscribers: lldb-commits, abhishek.aggarwal. Herald added a subscriber: emaste. r259344 introduced a bug, where we fail to perform a single step, when the instruction we are stepping onto contains a breakpoint which is not valid for this thread. This fixes the problem and add a test case. http://reviews.llvm.org/D16767 Files: packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestSingleStepOntoBreakpoint.py source/Plugins/Process/FreeBSD/FreeBSDThread.cpp 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 @@ -2006,19 +2006,10 @@ // If the current pc is a breakpoint site then the StopInfo should be set to Breakpoint // Otherwise, it will be set to Trace. -if (bp_site_sp) +if (bp_site_sp && bp_site_sp->ValidForThisThread(thread_sp.get())) { -// If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread, -// we can just report no reason. -if (bp_site_sp->ValidForThisThread (thread_sp.get())) -{ -thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID (*thread_sp, bp_site_sp->GetID())); -} -else -{ -StopInfoSP invalid_stop_info_sp; -thread_sp->SetStopInfo (invalid_stop_info_sp); -} +thread_sp->SetStopInfo( +StopInfo::CreateStopReasonWithBreakpointSiteID(*thread_sp, bp_site_sp->GetID())); } else thread_sp->SetStopInfo (StopInfo::CreateStopReasonToTrace (*thread_sp)); Index: source/Plugins/Process/FreeBSD/FreeBSDThread.cpp === --- source/Plugins/Process/FreeBSD/FreeBSDThread.cpp +++ source/Plugins/Process/FreeBSD/FreeBSDThread.cpp @@ -569,20 +569,11 @@ // If the current pc is a breakpoint site then set the StopInfo to Breakpoint. // Otherwise, set the StopInfo to Watchpoint or Trace. -if (bp_site) -{ -lldb::break_id_t bp_id = bp_site->GetID(); -// If we have an operating system plug-in, we might have set a thread specific breakpoint using the -// operating system thread ID, so we can't make any assumptions about the thread ID so we must always -// report the breakpoint regardless of the thread. -if (bp_site->ValidForThisThread(this) || GetProcess()->GetOperatingSystem () != NULL) -SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id)); -else -{ -const bool should_stop = false; -SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id, should_stop)); -} -} +// If we have an operating system plug-in, we might have set a thread specific breakpoint using the +// operating system thread ID, so we can't make any assumptions about the thread ID so we must always +// report the breakpoint regardless of the thread. +if (bp_site && (bp_site->ValidForThisThread(this) || GetProcess()->GetOperatingSystem () != NULL)) +SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id)); else { POSIXBreakpointProtocol* reg_ctx = GetPOSIXBreakpointProtocol(); Index: packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestSingleStepOntoBreakpoint.py === --- /dev/null +++ packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestSingleStepOntoBreakpoint.py @@ -0,0 +1,77 @@ +""" +Test continue from a breakpoint when there is a breakpoint on the next instruction also. +""" + +from __future__ import print_function + + + +import unittest2 +import lldb +import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.lldbtest import * + +class SingleStepOntoBreakpointTestCase(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +@no_debug_info_test +def test_thread_specific_breakpoint(self): +self.run_test(True) + +@no_debug_info_test +def test_general_breakpoint(self): +self.run_test(False) + +def run_test(self, thread_sp
Re: [Lldb-commits] [PATCH] D16736: Always write the session log file in UTF-8
labath added a comment. TestGDBRemoteMemoryRead.py is my test and I gotta admit it is somewhat hackish. If this is the only issue that is stopping this from going through, then please xfail it, and i'll rewrite it in some other way. http://reviews.llvm.org/D16736 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16722: Remove Timer::Initialize routine
labath added a comment. We are still using VS2013 at the moment, but we have started to investigate the possibility of migrating to 2015. I can report back when I know more, but I would leave the thread_local keyword out for now. http://reviews.llvm.org/D16722 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16767: Fix single-stepping onto a breakpoint
tberghammer accepted this revision. tberghammer added a comment. This revision is now accepted and ready to land. Looks reasonable but should we merge TestSingleStepOntoBreakpoint.py and TestConsecutiveBreakpoints.py? I think they have quite a bit of code in common. http://reviews.llvm.org/D16767 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r259356 - Remove Timer::Initialize routine
Author: labath Date: Mon Feb 1 07:29:41 2016 New Revision: 259356 URL: http://llvm.org/viewvc/llvm-project?rev=259356&view=rev Log: Remove Timer::Initialize routine Summary: I've run into an issue when running unit tests, where the underlying problem turned out to be that we were creating Timer objects (through several layers of indirection) without calling Timer::Initialize. Since Timer's thread-local storage was not properly initialized, we were overwriting gtest's own thread-local storage, causing test failures. Instead of requiring that every test calls Timer::Initialize(), I remove the function altogether: The thread-local storage can be initialized on-demand, and the g_file variable initialized to stdout and never changed, so I have simply removed it. Reviewers: clayborg, zturner, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16722 Modified: lldb/trunk/include/lldb/Core/Timer.h lldb/trunk/source/Core/Timer.cpp lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Modified: lldb/trunk/include/lldb/Core/Timer.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Timer.h?rev=259356&r1=259355&r2=259356&view=diff == --- lldb/trunk/include/lldb/Core/Timer.h (original) +++ lldb/trunk/include/lldb/Core/Timer.h Mon Feb 1 07:29:41 2016 @@ -50,9 +50,6 @@ public: //-- ~Timer(); -static void -Initialize (); - void Dump (); @@ -90,7 +87,6 @@ protected: static std::atomic g_quiet; static std::atomic g_display_depth; static std::mutex g_file_mutex; -static FILE* g_file; private: Timer(); Modified: lldb/trunk/source/Core/Timer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Timer.cpp?rev=259356&r1=259355&r2=259356&view=diff == --- lldb/trunk/source/Core/Timer.cpp (original) +++ lldb/trunk/source/Core/Timer.cpp Mon Feb 1 07:29:41 2016 @@ -40,9 +40,7 @@ namespace std::atomic Timer::g_quiet(true); std::atomic Timer::g_display_depth(0); std::mutex Timer::g_file_mutex; -FILE* Timer::g_file = nullptr; -static lldb::thread_key_t g_key; static Mutex & GetCategoryMutex() @@ -58,10 +56,17 @@ GetCategoryMap() return g_category_map; } +static void +ThreadSpecificCleanup(void *p) +{ +delete static_cast(p); +} static TimerStack * GetTimerStackForCurrentThread () { +static lldb::thread_key_t g_key = Host::ThreadLocalStorageCreate(ThreadSpecificCleanup); + void *timer_stack = Host::ThreadLocalStorageGet(g_key); if (timer_stack == NULL) { @@ -72,24 +77,11 @@ GetTimerStackForCurrentThread () } void -ThreadSpecificCleanup (void *p) -{ -delete (TimerStack *)p; -} - -void Timer::SetQuiet (bool value) { g_quiet = value; } -void -Timer::Initialize () -{ -Timer::g_file = stdout; -g_key = Host::ThreadLocalStorageCreate(ThreadSpecificCleanup); -} - Timer::Timer (const char *category, const char *format, ...) : m_category (category), m_total_start (), @@ -108,15 +100,15 @@ Timer::Timer (const char *category, cons std::lock_guard lock(g_file_mutex); // Indent -::fprintf (g_file, "%*s", stack->m_depth * TIMER_INDENT_AMOUNT, ""); +::fprintf(stdout, "%*s", stack->m_depth * TIMER_INDENT_AMOUNT, ""); // Print formatted string va_list args; va_start (args, format); -::vfprintf (g_file, format, args); +::vfprintf(stdout, format, args); va_end (args); // Newline -::fprintf (g_file, "\n"); +::fprintf(stdout, "\n"); } TimeValue start_time(TimeValue::Now()); m_total_start = start_time; @@ -161,11 +153,8 @@ Timer::~Timer() if (g_quiet == false) { std::lock_guard lock(g_file_mutex); -::fprintf (g_file, - "%*s%.9f sec (%.9f sec)\n", - (stack->m_depth - 1) *TIMER_INDENT_AMOUNT, "", - total_nsec / 10.0, - timer_nsec / 10.0); +::fprintf(stdout, "%*s%.9f sec (%.9f sec)\n", (stack->m_depth - 1) * TIMER_INDENT_AMOUNT, "", + total_nsec / 10.0, timer_nsec / 10.0); } // Keep total results for each category so we can dump results. Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=259356&r1=259355&r2=259356&view=diff == --- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original) +++ lldb
Re: [Lldb-commits] [PATCH] D16722: Remove Timer::Initialize routine
This revision was automatically updated to reflect the committed changes. Closed by commit rL259356: Remove Timer::Initialize routine (authored by labath). Changed prior to commit: http://reviews.llvm.org/D16722?vs=46380&id=46524#toc Repository: rL LLVM http://reviews.llvm.org/D16722 Files: lldb/trunk/include/lldb/Core/Timer.h lldb/trunk/source/Core/Timer.cpp lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Index: lldb/trunk/source/Core/Timer.cpp === --- lldb/trunk/source/Core/Timer.cpp +++ lldb/trunk/source/Core/Timer.cpp @@ -40,9 +40,7 @@ std::atomic Timer::g_quiet(true); std::atomic Timer::g_display_depth(0); std::mutex Timer::g_file_mutex; -FILE* Timer::g_file = nullptr; -static lldb::thread_key_t g_key; static Mutex & GetCategoryMutex() @@ -58,10 +56,17 @@ return g_category_map; } +static void +ThreadSpecificCleanup(void *p) +{ +delete static_cast(p); +} static TimerStack * GetTimerStackForCurrentThread () { +static lldb::thread_key_t g_key = Host::ThreadLocalStorageCreate(ThreadSpecificCleanup); + void *timer_stack = Host::ThreadLocalStorageGet(g_key); if (timer_stack == NULL) { @@ -72,24 +77,11 @@ } void -ThreadSpecificCleanup (void *p) -{ -delete (TimerStack *)p; -} - -void Timer::SetQuiet (bool value) { g_quiet = value; } -void -Timer::Initialize () -{ -Timer::g_file = stdout; -g_key = Host::ThreadLocalStorageCreate(ThreadSpecificCleanup); -} - Timer::Timer (const char *category, const char *format, ...) : m_category (category), m_total_start (), @@ -108,15 +100,15 @@ std::lock_guard lock(g_file_mutex); // Indent -::fprintf (g_file, "%*s", stack->m_depth * TIMER_INDENT_AMOUNT, ""); +::fprintf(stdout, "%*s", stack->m_depth * TIMER_INDENT_AMOUNT, ""); // Print formatted string va_list args; va_start (args, format); -::vfprintf (g_file, format, args); +::vfprintf(stdout, format, args); va_end (args); // Newline -::fprintf (g_file, "\n"); +::fprintf(stdout, "\n"); } TimeValue start_time(TimeValue::Now()); m_total_start = start_time; @@ -161,11 +153,8 @@ if (g_quiet == false) { std::lock_guard lock(g_file_mutex); -::fprintf (g_file, - "%*s%.9f sec (%.9f sec)\n", - (stack->m_depth - 1) *TIMER_INDENT_AMOUNT, "", - total_nsec / 10.0, - timer_nsec / 10.0); +::fprintf(stdout, "%*s%.9f sec (%.9f sec)\n", (stack->m_depth - 1) * TIMER_INDENT_AMOUNT, "", + total_nsec / 10.0, timer_nsec / 10.0); } // Keep total results for each category so we can dump results. Index: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp === --- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp +++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp @@ -97,7 +97,6 @@ Log::Initialize(); HostInfo::Initialize(); -Timer::Initialize(); Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); llvm::install_fatal_error_handler(fatal_error_handler, 0); Index: lldb/trunk/include/lldb/Core/Timer.h === --- lldb/trunk/include/lldb/Core/Timer.h +++ lldb/trunk/include/lldb/Core/Timer.h @@ -50,9 +50,6 @@ //-- ~Timer(); -static void -Initialize (); - void Dump (); @@ -90,7 +87,6 @@ static std::atomic g_quiet; static std::atomic g_display_depth; static std::mutex g_file_mutex; -static FILE* g_file; private: Timer(); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16767: Fix single-stepping onto a breakpoint
abhishek.aggarwal added a comment. source/Plugins/Process/FreeBSD/FreeBSDThread.cpp will not compile for FreeBSD. In Line 576, bp_id is undefined. Please replace it with bp_site_sp->GetID() http://reviews.llvm.org/D16767 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16767: Fix single-stepping onto a breakpoint
labath updated this revision to Diff 46528. labath added a comment. Merged test cases, and updated the FreeBSD version. Please take another look. http://reviews.llvm.org/D16767 Files: packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py source/Plugins/Process/FreeBSD/FreeBSDThread.cpp 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 @@ -2006,19 +2006,10 @@ // If the current pc is a breakpoint site then the StopInfo should be set to Breakpoint // Otherwise, it will be set to Trace. -if (bp_site_sp) +if (bp_site_sp && bp_site_sp->ValidForThisThread(thread_sp.get())) { -// If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread, -// we can just report no reason. -if (bp_site_sp->ValidForThisThread (thread_sp.get())) -{ -thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID (*thread_sp, bp_site_sp->GetID())); -} -else -{ -StopInfoSP invalid_stop_info_sp; -thread_sp->SetStopInfo (invalid_stop_info_sp); -} +thread_sp->SetStopInfo( +StopInfo::CreateStopReasonWithBreakpointSiteID(*thread_sp, bp_site_sp->GetID())); } else thread_sp->SetStopInfo (StopInfo::CreateStopReasonToTrace (*thread_sp)); Index: source/Plugins/Process/FreeBSD/FreeBSDThread.cpp === --- source/Plugins/Process/FreeBSD/FreeBSDThread.cpp +++ source/Plugins/Process/FreeBSD/FreeBSDThread.cpp @@ -569,20 +569,11 @@ // If the current pc is a breakpoint site then set the StopInfo to Breakpoint. // Otherwise, set the StopInfo to Watchpoint or Trace. -if (bp_site) -{ -lldb::break_id_t bp_id = bp_site->GetID(); -// If we have an operating system plug-in, we might have set a thread specific breakpoint using the -// operating system thread ID, so we can't make any assumptions about the thread ID so we must always -// report the breakpoint regardless of the thread. -if (bp_site->ValidForThisThread(this) || GetProcess()->GetOperatingSystem () != NULL) -SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id)); -else -{ -const bool should_stop = false; -SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id, should_stop)); -} -} +// If we have an operating system plug-in, we might have set a thread specific breakpoint using the +// operating system thread ID, so we can't make any assumptions about the thread ID so we must always +// report the breakpoint regardless of the thread. +if (bp_site && (bp_site->ValidForThisThread(this) || GetProcess()->GetOperatingSystem () != NULL)) +SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_site->GetID())); else { POSIXBreakpointProtocol* reg_ctx = GetPOSIXBreakpointProtocol(); Index: packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py === --- packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py +++ packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py @@ -1,5 +1,5 @@ """ -Test continue from a breakpoint when there is a breakpoint on the next instruction also. +Test that we handle breakpoints on consecutive instructions correctly. """ from __future__ import print_function @@ -15,44 +15,83 @@ mydir = TestBase.compute_mydir(__file__) -def test (self): -self.build () -self.consecutive_breakpoints_tests() - -def consecutive_breakpoints_tests(self): +def prepare_test(self): +self.build() exe = os.path.join (os.getcwd(), "a.out") # Create a target by the debugger. -target = self.dbg.CreateTarget(exe) -self.assertTrue(target, VALID_TARGET) +self.target = self.dbg.CreateTarget(exe) +self.
Re: [Lldb-commits] [PATCH] D16736: Always write the session log file in UTF-8
Just that x command needs to be commented out. The m command is fine as is. -Todd > On Feb 1, 2016, at 5:03 AM, Pavel Labath wrote: > > labath added a comment. > > TestGDBRemoteMemoryRead.py is my test and I gotta admit it is somewhat > hackish. If this is the only issue that is stopping this from going through, > then please xfail it, and i'll rewrite it in some other way. > > > http://reviews.llvm.org/D16736 > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D16769: [NFC] Cleanup RangeMap.h
tberghammer created this revision. tberghammer added reviewers: clayborg, labath. tberghammer added a subscriber: lldb-commits. [NFC] Cleanup RangeMap.h The file contained very similar 4 implementation of the same data structure with a lot of duplicated code and some minor API differences. This CL refactor the class to eliminate the duplicated codes and to unify the APIs. RangeMap.h also contained a class called AddressDataArray what have very little added functionality over an std::vector and used only by ObjectFileMachO The CL moves the class to ObjectFileMachO.cpp as it isn't belongs into RangeMap.h and shouldn't be used in new places anyway because of the little added functionality. Note1: As the change touches most of the line of RangeMap.h I run clang-format on the full file because we lose the history anyway. Note2: I would prefer to get rid of AddressDataArray all together but I don't understand ObjectFileMachO well enough to make the change with high confidence http://reviews.llvm.org/D16769 Files: include/lldb/Core/RangeMap.h source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Index: source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp === --- source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -107,6 +107,181 @@ uint32_tnlistCount; }; +//-- +// A simple range with data class where you get to define the type of +// the range base "B", the type used for the range byte size "S", and +// the type for the associated data "T". +//-- +template +struct AddressData +{ +typedef B BaseType; +typedef T DataType; + +BaseType addr; +DataType data; + +AddressData () : +addr (), +data () +{ +} + +AddressData (B a, DataType d) : +addr (a), +data (d) +{ +} + +bool +operator < (const AddressData &rhs) const +{ +if (this->addr == rhs.addr) +return this->data < rhs.data; +return this->addr < rhs.addr; +} + +bool +operator == (const AddressData &rhs) const +{ +return this->addr == rhs.addr && + this->data == rhs.data; +} + +bool +operator != (const AddressData &rhs) const +{ +return this->addr != rhs.addr || + this->data == rhs.data; +} +}; + +template +class AddressDataArray +{ +public: +typedef AddressData Entry; +typedef llvm::SmallVector Collection; + +AddressDataArray() = default; + +~AddressDataArray() = default; + +void +Append (const Entry &entry) +{ +m_entries.push_back (entry); +} + +void +Sort () +{ +if (m_entries.size() > 1) +std::stable_sort (m_entries.begin(), m_entries.end()); +} + +#ifdef ASSERT_RANGEMAP_ARE_SORTED +bool +IsSorted () const +{ +typename Collection::const_iterator pos, end, prev; +// First we determine if we can combine any of the Entry objects so we +// don't end up allocating and making a new collection for no reason +for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++) +{ +if (prev != end && *pos < *prev) +return false; +} +return true; +} +#endif + +void +Clear () +{ +m_entries.clear(); +} + +bool +IsEmpty () const +{ +return m_entries.empty(); +} + +size_t +GetSize () const +{ +return m_entries.size(); +} + +const Entry * +GetEntryAtIndex (size_t i) const +{ +return ((i < m_entries.size()) ? &m_entries[i] : nullptr); +} + +// Clients must ensure that "i" is a valid index prior to calling this function +const Entry & +GetEntryRef (size_t i) const +{ +return m_entries[i]; +} + +static bool +BaseLessThan (const Entry& lhs, const Entry& rhs) +{ +return lhs.addr < rhs.addr; +} + +Entry * +FindEntry (B addr, bool exact_match_only) +{ +#ifdef ASSERT_RANGEMAP_ARE_SORTED +assert (IsSorted()); +#endif +if ( !m_entries.empty() ) +{ +Entry entry; +entry.addr = addr; +typename Collection::iterator begin = m_entries.begin(); +typename Collection::iterator end = m_entries.end(); +typename Collection::iterator pos = std::lower_bound (begin, end, entry, BaseLessThan); + +while(pos != begin && pos[-1].addr == addr) +--pos; + +if (pos != end) +{ +if (pos->addr == addr || !exact_match_only) +return &(*pos); +} +} +
Re: [Lldb-commits] [PATCH] D16736: Always write the session log file in UTF-8
tfiala added a subscriber: tfiala. tfiala added a comment. Just that x command needs to be commented out. The m command is fine as is. -Todd http://reviews.llvm.org/D16736 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D16772: Fix single stepping over the IT instruction
tberghammer created this revision. tberghammer added reviewers: omjavaid, clayborg. tberghammer added a subscriber: lldb-commits. Herald added a subscriber: aemerson. Fix single stepping over the IT instruction The ARM instruction emulator had 2 bugs related to the handling of the IT instruction causing an error in single stepping: * We haven't initialized the IT mask from the CPSR so if the last instruction of the IT block is a branch and the condition is false then the emulator evaluated the branch what resulted in an incorrect pc for the next instruction. * The ITSTATE was advanced before the execution of each instruction. As a result the emulator was using the condition of following instruction in every case. The ITSTATE should be edvanced after the execution of an instruction except after an IT instruction. http://reviews.llvm.org/D16772 Files: source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Index: source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp === --- source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -13062,6 +13062,15 @@ m_opcode_mode = eModeARM; m_opcode.SetOpcode32 (MemARead(read_inst_context, pc, 4, 0, &success), GetByteOrder()); } + +if (!m_ignore_conditions) +{ +// If we are not ignoreing the conditions then init the it session from the current +// value of cpsr. +uint32_t it = (Bits32(m_opcode_cpsr, 15, 10) << 2) | Bits32(m_opcode_cpsr, 26, 25); +if (it != 0) +m_it_session.InitIT(it); +} } } if (!success) @@ -13572,10 +13581,6 @@ bool EmulateInstructionARM::EvaluateInstruction (uint32_t evaluate_options) { -// Advance the ITSTATE bits to their values for the next instruction. -if (m_opcode_mode == eModeThumb && m_it_session.InITBlock()) -m_it_session.ITAdvance(); - ARMOpcode *opcode_data = NULL; if (m_opcode_mode == eModeThumb) @@ -13614,7 +13619,13 @@ success = (this->*opcode_data->callback) (m_opcode.GetOpcode32(), opcode_data->encoding); if (!success) return false; - + +// Advance the ITSTATE bits to their values for the next instruction if we haven't just executed +// an IT instruction what initialized it. +if (m_opcode_mode == eModeThumb && m_it_session.InITBlock() && +opcode_data->callback != &EmulateInstructionARM::EmulateIT) +m_it_session.ITAdvance(); + if (auto_advance_pc) { uint32_t after_pc_value = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_pc, 0, &success); Index: source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp === --- source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -13062,6 +13062,15 @@ m_opcode_mode = eModeARM; m_opcode.SetOpcode32 (MemARead(read_inst_context, pc, 4, 0, &success), GetByteOrder()); } + +if (!m_ignore_conditions) +{ +// If we are not ignoreing the conditions then init the it session from the current +// value of cpsr. +uint32_t it = (Bits32(m_opcode_cpsr, 15, 10) << 2) | Bits32(m_opcode_cpsr, 26, 25); +if (it != 0) +m_it_session.InitIT(it); +} } } if (!success) @@ -13572,10 +13581,6 @@ bool EmulateInstructionARM::EvaluateInstruction (uint32_t evaluate_options) { -// Advance the ITSTATE bits to their values for the next instruction. -if (m_opcode_mode == eModeThumb && m_it_session.InITBlock()) -m_it_session.ITAdvance(); - ARMOpcode *opcode_data = NULL; if (m_opcode_mode == eModeThumb) @@ -13614,7 +13619,13 @@ success = (this->*opcode_data->callback) (m_opcode.GetOpcode32(), opcode_data->encoding); if (!success) return false; - + +// Advance the ITSTATE bits to their values for the next instruction if we haven't just executed +// an IT instruction what initialized it. +if (m_opcode_mode == eModeThumb && m_it_session.InITBlock() && +opcode_data->callback != &EmulateInstructionARM::EmulateIT) +m_it_session.ITAdvance(); + if (auto_advance_pc) { uint32_t after_pc_value = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_pc, 0, &success); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r259368 - Remove flaky annotation for TestCallWithTimeout on linux
Author: labath Date: Mon Feb 1 10:50:28 2016 New Revision: 259368 URL: http://llvm.org/viewvc/llvm-project?rev=259368&view=rev Log: Remove flaky annotation for TestCallWithTimeout on linux The test has passed last 100 runs of the buildbot. Modified: lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py Modified: lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py?rev=259368&r1=259367&r2=259368&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py Mon Feb 1 10:50:28 2016 @@ -23,7 +23,6 @@ class ExprCommandWithTimeoutsTestCase(Te @expectedFlakeyFreeBSD("llvm.org/pr19605") -@expectedFlakeyLinux("llvm.org/pr20275") @expectedFailureWindows("llvm.org/pr21765") def test(self): """Test calling std::String member function.""" ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r258919 - [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS
On Mon, Feb 1, 2016 at 2:37 AM, Bhushan Attarde wrote: > Hi Hans, > > Could you please add this (r258919) to the release branch? > Also commit r258967 (on top of this) by Zachary which fixes some python 3 > incompatibilities. Since this touched more than just MIPS-specific files, I'd like Greg to approve it for the branch. Greg, is this OK for 3.8? Thanks, Hans > -Original Message- > From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of > Bhushan D. Attarde via lldb-commits > Sent: 27 January 2016 15:47 > To: lldb-commits@lists.llvm.org > Subject: [Lldb-commits] [lldb] r258919 - [LLDB][MIPS] A small fix in > GetBreakableLoadAddress() for MIPS > > Author: bhushan.attarde > Date: Wed Jan 27 04:16:30 2016 > New Revision: 258919 > > URL: http://llvm.org/viewvc/llvm-project?rev=258919&view=rev > Log: > [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS > > SUMMARY: > Get the load address for the address given by symbol and function. > Earlier, this was done for function only, this patch does it for symbol > too. > This patch also adds TestAvoidBreakpointInDelaySlot.py to test this > change. > > Reviewers: clayborg > Subscribers: labath, zturner, mohit.bhakkad, sagar, jaydeep, lldb-commits > Differential Revision: http://reviews.llvm.org/D16049 > > Added: > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/ > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/main.c > Modified: > lldb/trunk/include/lldb/API/SBInstruction.h > lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py > lldb/trunk/scripts/interface/SBInstruction.i > lldb/trunk/source/API/SBInstruction.cpp > lldb/trunk/source/Target/Target.cpp > > Modified: lldb/trunk/include/lldb/API/SBInstruction.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBInstruction.h?rev=258919&r1=258918&r2=258919&view=diff > == > --- lldb/trunk/include/lldb/API/SBInstruction.h (original) > +++ lldb/trunk/include/lldb/API/SBInstruction.h Wed Jan 27 04:16:30 2016 > @@ -60,6 +60,9 @@ public: > bool > DoesBranch (); > > +bool > +HasDelaySlot (); > + > void > Print (FILE *out); > > > Added: > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile?rev=258919&view=auto > == > --- > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/Makefile > (added) > +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint > +++ /breakpoint_in_delayslot/Makefile Wed Jan 27 04:16:30 2016 > @@ -0,0 +1,6 @@ > +LEVEL = ../../../make > + > +C_SOURCES := main.c > + > +include $(LEVEL)/Makefile.rules > + > > Added: > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py?rev=258919&view=auto > == > --- > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py > (added) > +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint > +++ /breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py Wed Jan > +++ 27 04:16:30 2016 > @@ -0,0 +1,82 @@ > +""" > +Test specific to MIPS > +""" > + > +import os, time > +import re > +import unittest2 > +import lldb > +import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest > +import * > + > +class AvoidBreakpointInDelaySlotAPITestCase(TestBase): > + > +mydir = TestBase.compute_mydir(__file__) > + > +@skipUnlessArch(archs=re.compile('mips*')) > +def test(self): > +self.build() > +exe = os.path.join(os.getcwd(), "a.out") > +self.expect("file " + exe, > +patterns = [ "Current executable set to .*a.out.*" > + ]) > + > +# Create a target by the debugger. > +target = self.dbg.CreateTarget(exe) > +self.assertTrue(target, VALID_TARGET) > + > +breakpoint = target.BreakpointCreateByName('main', 'a.out') > +self.assertTrue(breakpoint and > +breakpoint
Re: [Lldb-commits] [PATCH] D16746: Use an artifical namespace so that member vars do not hide local vars.
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Looks good to me, but Sean should be the one to OK this for real. http://reviews.llvm.org/D16746 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16745: Fix a thinko in StackFrame::GetInScopeVariableList.
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Looks good. http://reviews.llvm.org/D16745 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Looks good. Repository: rL LLVM http://reviews.llvm.org/D16508 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r259379 - Always write the session file in UTF-8.
Author: zturner Date: Mon Feb 1 12:12:59 2016 New Revision: 259379 URL: http://llvm.org/viewvc/llvm-project?rev=259379&view=rev Log: Always write the session file in UTF-8. This patch attempts to solve the Python 2 / Python 3 incompatibilities by introducing a new `encoded_file` abstraction that we use instead of `io.open()`. The problem with the builtin implementation of `io.open` is that `read` and `write` accept and return `unicode` objects, which are not always convenient to work with in Python 2. We solve this by making `encoded_file.open()` return the same object returned by `io.open()` but with hooked `read()` and `write()` methods. These hooked methods will accept binary or text data, and conditionally convert what it gets to a `unicode` object using the correct encoding. When calling `read()` it also does any conversion necessary to convert the output back into the native `string` type of the running python version. Differential Revision: http://reviews.llvm.org/D16736 Added: lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGDBRemoteMemoryRead.py Added: lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py?rev=259379&view=auto == --- lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py (added) +++ lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py Mon Feb 1 12:12:59 2016 @@ -0,0 +1,48 @@ +""" + The LLVM Compiler Infrastructure + +This file is distributed under the University of Illinois Open Source +License. See LICENSE.TXT for details. + +Prepares language bindings for LLDB build process. Run with --help +to see a description of the supported command line arguments. +""" + +# Python modules: +import io + +# Third party modules +import six + +def _encoded_read(old_read, encoding): +def impl(size): +result = old_read(size) +# If this is Python 2 then we need to convert the resulting `unicode` back +# into a `str` before returning +if six.PY2: +result = result.encode(encoding) +return result +return impl + +def _encoded_write(old_write, encoding): +def impl(s): +# If we were asked to write a `str` (in Py2) or a `bytes` (in Py3) decode it +# as unicode before attempting to write. +if isinstance(s, six.binary_type): +s = s.decode(encoding) +return old_write(s) +return impl + +''' +Create a Text I/O file object that can be written to with either unicode strings or byte strings +under Python 2 and Python 3, and automatically encodes and decodes as necessary to return the +native string type for the current Python version +''' +def open(file, encoding, mode='r', buffering=-1, errors=None, newline=None, closefd=True): +wrapped_file = io.open(file, mode=mode, buffering=buffering, encoding=encoding, + errors=errors, newline=newline, closefd=closefd) +new_read = _encoded_read(getattr(wrapped_file, 'read'), encoding) +new_write = _encoded_write(getattr(wrapped_file, 'write'), encoding) +setattr(wrapped_file, 'read', new_read) +setattr(wrapped_file, 'write', new_write) +return wrapped_file Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py?rev=259379&r1=259378&r2=259379&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py Mon Feb 1 12:12:59 2016 @@ -25,7 +25,6 @@ class Char1632TestCase(TestBase): line_number(self.source, '// breakpoint2') ] @expectedFailureIcc # ICC (13.1) does not emit the DW_TAG_base_type for char16_t and char32_t. -@expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows") def test(self): """Test that the C++11 support for char16_t and char32_t works correctly.""" self.build() Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=259379&r1=259378&r2=259379&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Feb 1 12:12:59 2
[Lldb-commits] [lldb] r259378 - Fix misnamed variable in TestProcessAPI.py
Author: zturner Date: Mon Feb 1 12:12:54 2016 New Revision: 259378 URL: http://llvm.org/viewvc/llvm-project?rev=259378&view=rev Log: Fix misnamed variable in TestProcessAPI.py Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py?rev=259378&r1=259377&r2=259378&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py Mon Feb 1 12:12:54 2016 @@ -231,7 +231,7 @@ class ProcessAPITestCase(TestBase): # The bytearray_to_int utility function expects a little endian bytearray. if byteOrder == lldb.eByteOrderBig: -new_bytes.reverse() +content.reverse() new_value = bytearray_to_int(content, byteSize) if new_value != 256: @@ -239,7 +239,7 @@ class ProcessAPITestCase(TestBase): # Dump the memory content if self.TraceOn(): -for i in new_bytes: +for i in content: print("byte:", i) @add_test_categories(['pyapi']) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16736: Always write the session log file in UTF-8
This revision was automatically updated to reflect the committed changes. Closed by commit rL259379: Always write the session file in UTF-8. (authored by zturner). Changed prior to commit: http://reviews.llvm.org/D16736?vs=46426&id=46556#toc Repository: rL LLVM http://reviews.llvm.org/D16736 Files: lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGDBRemoteMemoryRead.py Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py === --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py @@ -58,11 +58,13 @@ import six # LLDB modules +import use_lldb_suite import lldb from . import configuration from . import lldbtest_config from . import lldbutil from . import test_categories +from lldbsuite.support import encoded_file from .result_formatter import EventBuilder @@ -1489,7 +1491,7 @@ session_file = "{}.log".format(self.log_basename) # Python 3 doesn't support unbuffered I/O in text mode. Open buffered. -self.session = open(session_file, "w") +self.session = encoded_file.open(session_file, "utf-8", mode="w") # Optimistically set __errored__, __failed__, __expected__ to False # initially. If the test errored/failed, the session info Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGDBRemoteMemoryRead.py === --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGDBRemoteMemoryRead.py +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGDBRemoteMemoryRead.py @@ -34,7 +34,8 @@ error = lldb.SBError() memory = process.ReadMemory(pc, size, error) self.assertTrue(error.Success()) -self.match("process plugin packet send x%x,%x" % (pc, size), ["response:", memory]) +# Results in trying to write non-printable characters to the session log. +# self.match("process plugin packet send x%x,%x" % (pc, size), ["response:", memory]) self.match("process plugin packet send m%x,%x" % (pc, size), ["response:", binascii.hexlify(memory)]) process.Continue() Index: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py === --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py @@ -25,7 +25,6 @@ line_number(self.source, '// breakpoint2') ] @expectedFailureIcc # ICC (13.1) does not emit the DW_TAG_base_type for char16_t and char32_t. -@expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows") def test(self): """Test that the C++11 support for char16_t and char32_t works correctly.""" self.build() Index: lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py === --- lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py +++ lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py @@ -0,0 +1,48 @@ +""" + The LLVM Compiler Infrastructure + +This file is distributed under the University of Illinois Open Source +License. See LICENSE.TXT for details. + +Prepares language bindings for LLDB build process. Run with --help +to see a description of the supported command line arguments. +""" + +# Python modules: +import io + +# Third party modules +import six + +def _encoded_read(old_read, encoding): +def impl(size): +result = old_read(size) +# If this is Python 2 then we need to convert the resulting `unicode` back +# into a `str` before returning +if six.PY2: +result = result.encode(encoding) +return result +return impl + +def _encoded_write(old_write, encoding): +def impl(s): +# If we were asked to write a `str` (in Py2) or a `bytes` (in Py3) decode it +# as unicode before attempting to write. +if isinstance(s, six.binary_type): +s = s.decode(encoding) +return old_write(s) +return impl + +''' +Create a Text I/O file object that can be written to with either unicode strings or byte strings +under Python 2 and Python 3, and automatically encodes and decodes as necessary to return the +native string type for the current Python version +''' +def open(file, encoding, mode='r', buffering=-1, errors=None, newline=None, closefd=True): +wrapped_file = io.open(file, mode=mode, buffering=buffering, encoding=encoding, +
Re: [Lldb-commits] [PATCH] D16746: Use an artifical namespace so that member vars do not hide local vars.
spyffe requested changes to this revision. spyffe added a comment. This revision now requires changes to proceed. Siva, this is a clever and self-contained solution to a problem that's annoyed us a great deal for a while now. I have a few minor quibbles about implementation but overall this is a great fix! Thank you! Comment at: source/Expression/ExpressionSourceCode.cpp:306 @@ +305,3 @@ +ConstString object_name; +if (IsCppMethod(frame, object_name)) +{ I think we should do this in all C++ cases. The reason is because it'll make sure the method gets more testing and if anything fails we'll catch it in the common case instead of seeing it only in specific "edge" cases. Could we just check if the frame is C++? Comment at: source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp:1381 @@ +1380,3 @@ +clang::NamespaceDecl *namespace_decl = ast->GetUniqueNamespaceDeclaration( +name_unique_cstr, nullptr, m_ast_context); +if (namespace_decl) This bit where we're passing the AST context as an argument as well as the this pointer is a bit awkward. The common pattern when we have a class (like lldb::ClangASTContext) that provides useful functionality on top of another class (clang::ASTContext, in this case) is to add a method: ``` static void GetUniqueNamespaceDeclaration(clang::ASTContext *, …) ``` and then have the instance method call through to it transparently. Unless there's some reason why the frame's AST context is important, let's just do that here too. http://reviews.llvm.org/D16746 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64
tfiala accepted this revision. tfiala added a comment. Seems reasonable to start. If there are issues, they'll show up when lldb starts using registers. This will get you started, though. Repository: rL LLVM http://reviews.llvm.org/D16508 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16769: [NFC] Cleanup RangeMap.h
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Looks fine. A few things I don't like, but I can live with: - Making constructors appear all on one line does save space, but it means you can't debug very well as stepping into these constructors will stop on the constructor line and then if you step, you will step over and out of the entire thing. Granted these classes are very simple and probably don't require debugging anymore, but it is a drawback to clang-format. - Many functions had variables that were put into temporaries like: bool DoesAdjoinOrIntersect (const Range &rhs) const { const BaseType lhs_base = this->GetRangeBase(); const BaseType rhs_base = rhs.GetRangeBase(); const BaseType lhs_end = this->GetRangeEnd(); const BaseType rhs_end = rhs.GetRangeEnd(); bool result = (lhs_base <= rhs_end) && (lhs_end >= rhs_base); return result; } were reduced to lines like the following: bool DoesAdjoinOrIntersect(const Range &rhs) const { return GetRangeBase() <= rhs.GetRangeEnd() && GetRangeEnd() >= rhs.GetRangeBase(); } So I see the efficiency, but if I step into this function now it means less useful debugging as you will be stepping into and out of functions and you will lose the values and not be able to see what is going on. The compiler will get rid of the temporary variables when it optimizes things so I am not sure why these changes make things better. http://reviews.llvm.org/D16769 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16772: Fix single stepping over the IT instruction
clayborg added a comment. Looks good. A related comment about IT instructions. You need to be careful when software single stepping through instructions that are in the middle of an ITSTATE block. You can NOT use a 16 bit instruction that isn't a BKPT otherwise you change your instructions. Are you guys using the BKPT trap for software breakpoints? If not, you should not step through IT instructions that have 32 bit thumb instructions or you will hose your program. Let me know if you need to know more about this. http://reviews.llvm.org/D16772 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16766: [RenderScript] Use LLVM DWARF language enum
clayborg added a comment. See inlined comments. Comment at: source/Target/Language.cpp:272 @@ -271,2 +271,3 @@ case eLanguageTypeC11: +case eLanguageTypeExtRenderScript: return true; Why is this needed? Seems like this is incorrect. Are you trying to ask if a language uses the clang::ASTContext? Please explain why renderscript is C. Repository: rL LLVM http://reviews.llvm.org/D16766 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r259396 - Add a note on how to create an empty target and use it to attach to
Author: jingham Date: Mon Feb 1 14:05:37 2016 New Revision: 259396 URL: http://llvm.org/viewvc/llvm-project?rev=259396&view=rev Log: Add a note on how to create an empty target and use it to attach to processes whose executables you don't know up front. Modified: lldb/trunk/scripts/interface/SBDebugger.i Modified: lldb/trunk/scripts/interface/SBDebugger.i URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBDebugger.i?rev=259396&r1=259395&r2=259396&view=diff == --- lldb/trunk/scripts/interface/SBDebugger.i (original) +++ lldb/trunk/scripts/interface/SBDebugger.i Mon Feb 1 14:05:37 2016 @@ -105,6 +105,16 @@ if target: else: print('Unexpected process state: %s, killing process...' % debugger.StateAsCString (state)) process.Kill() + +Sometimes you need to create an empty target that will get filled in later. The most common use for this +is to attach to a process by name or pid where you don't know the executable up front. The most convenient way +to do this is: + +target = debugger.CreateTarget('') +error = lldb.SBError() +process = target.AttachToProcessWithName(debugger.GetListener(), 'PROCESS_NAME', False, error) + +or the equivalent arguments for AttachToProcessWithID. ") SBDebugger; class SBDebugger { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16772: Fix single stepping over the IT instruction
omjavaid accepted this revision. omjavaid added a comment. Looks good. Was there a test failing in testsuite due to this? http://reviews.llvm.org/D16772 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r257926 - Implement missing GoASTContext methods
Greg: ping? On Tue, Jan 26, 2016 at 11:10 AM, Hans Wennborg wrote: > Greg: Ping? > > On Tue, Jan 19, 2016 at 1:12 PM, Hans Wennborg wrote: >> Sure. Greg, are you the code owner for this, or is there a specific >> owner for Go? >> >> Thanks, >> Hans >> >> On Fri, Jan 15, 2016 at 11:43 AM, Ryan Brown via lldb-commits >> wrote: >>> It would be nice if we could get this into 3.8 to get rid of these asserts. >>> >>> -- Ryan Brown >>> >>> On Fri, Jan 15, 2016 at 11:35 AM, Ryan Brown via lldb-commits >>> wrote: Author: ribrdb Date: Fri Jan 15 13:35:48 2016 New Revision: 257926 URL: http://llvm.org/viewvc/llvm-project?rev=257926&view=rev Log: Implement missing GoASTContext methods Modified: lldb/trunk/source/Symbol/GoASTContext.cpp Modified: lldb/trunk/source/Symbol/GoASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/GoASTContext.cpp?rev=257926&r1=257925&r2=257926&view=diff == --- lldb/trunk/source/Symbol/GoASTContext.cpp (original) +++ lldb/trunk/source/Symbol/GoASTContext.cpp Fri Jan 15 13:35:48 2016 @@ -13,6 +13,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" +#include "lldb/Core/StreamFile.h" #include "lldb/Core/UniqueCStringMap.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/StringPrinter.h" @@ -1268,13 +1269,115 @@ GoASTContext::ConvertStringToFloatValue( //-- // Dumping types //-- +#define DEPTH_INCREMENT 2 + void GoASTContext::DumpValue(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, lldb::Format format, -const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, +const DataExtractor &data, lldb::offset_t data_byte_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, bool show_types, bool show_summary, bool verbose, uint32_t depth) { -assert(false); +if (IsTypedefType(type)) +type = GetTypedefedType(type).GetOpaqueQualType(); +if (!type) +return; +GoType *t = static_cast(type); + +if (GoStruct *st = t->GetStruct()) +{ +if (GetCompleteType(type)) +{ +uint32_t field_idx = 0; +for (auto* field = st->GetField(field_idx); field != nullptr; field_idx++) +{ +// Print the starting squiggly bracket (if this is the +// first member) or comma (for member 2 and beyond) for +// the struct/union/class member. +if (field_idx == 0) +s->PutChar('{'); +else +s->PutChar(','); + +// Indent +s->Printf("\n%*s", depth + DEPTH_INCREMENT, ""); + +// Print the member type if requested +if (show_types) +{ +ConstString field_type_name = field->m_type.GetTypeName(); +s->Printf("(%s) ", field_type_name.AsCString()); +} +// Print the member name and equal sign +s->Printf("%s = ", field->m_name.AsCString()); + + +// Dump the value of the member +CompilerType field_type = field->m_type; +field_type.DumpValue (exe_ctx, + s, // Stream to dump to + field_type.GetFormat(), // The format with which to display the member + data, // Data buffer containing all bytes for this type + data_byte_offset + field->m_byte_offset,// Offset into "data" where to grab value from + field->m_type.GetByteSize(exe_ctx->GetBestExecutionContextScope()), // Size of this type in bytes + 0, // Bitfield bit size + 0, // Bitfield bit offset + show_types, // Boolean indicating if we should show the variable types + show_summary, // Boolean indicating if we should show a summary for the current type + verbos
Re: [Lldb-commits] [lldb] r258485 - Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB during expression evaluation
Greg: ping? On Mon, Jan 25, 2016 at 11:40 AM, Hans Wennborg wrote: > SGTM if Greg approves. > > On Mon, Jan 25, 2016 at 2:03 AM, Bhushan Attarde > wrote: >> Could you please add this to the release branch? >> >> Thanks, >> Bhushan >> >> >> -Original Message- >> From: lldb-commits [mailto:lldb-commits-boun...@lists.llvm.org] On Behalf Of >> Bhushan D. Attarde via lldb-commits >> Sent: 22 January 2016 10:32 >> To: lldb-commits@lists.llvm.org >> Subject: [Lldb-commits] [lldb] r258485 - Use "_$" prefix instead of "$" for >> dynamic checker function inserted by LLDB during expression evaluation >> >> Author: bhushan.attarde >> Date: Thu Jan 21 23:02:02 2016 >> New Revision: 258485 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=258485&view=rev >> Log: >> Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB >> during expression evaluation >> >> SUMMARY: >> The symbol "$" has a special meaning for MIPS i.e it is marker for >> temporary symbols for MIPS. >> So this patch uses additional _ prefix for "$__lldb_valid_pointer_check" >> so that it wont be marked as temporary symbol in case of MIPS. >> >> Reviewers: clayborg, spyffe >> Subscribers: dean, emaste, mohit.bhakkad, sagar, jaydeep, lldb-commits >> Differential http://reviews.llvm.org/D14111 >> >> Modified: >> lldb/trunk/source/Expression/IRDynamicChecks.cpp >> >> Modified: lldb/trunk/source/Expression/IRDynamicChecks.cpp >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRDynamicChecks.cpp?rev=258485&r1=258484&r2=258485&view=diff >> == >> --- lldb/trunk/source/Expression/IRDynamicChecks.cpp (original) >> +++ lldb/trunk/source/Expression/IRDynamicChecks.cpp Thu Jan 21 23:02:02 >> +++ 2016 >> @@ -35,12 +35,12 @@ using namespace lldb_private; >> >> static char ID; >> >> -#define VALID_POINTER_CHECK_NAME "$__lldb_valid_pointer_check" >> +#define VALID_POINTER_CHECK_NAME "_$__lldb_valid_pointer_check" >> #define VALID_OBJC_OBJECT_CHECK_NAME "$__lldb_objc_object_check" >> >> static const char g_valid_pointer_check_text[] = "extern \"C\" void\n" >> -"$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n" >> +"_$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n" >> "{\n" >> "unsigned char $__lldb_local_val = *$__lldb_arg_ptr;\n" >> "}"; >> >> >> ___ >> lldb-commits mailing list >> lldb-commits@lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r257926 - Implement missing GoASTContext methods
Sorry for the delay. This is fine. In general, feel free to accept any patches that are architecture specific for architectures that aren't x86 or ARM (MIPS, hexagon for example), and for any languages that aren't C/C++/ObjC or Swift (renderscript, go). > On Feb 1, 2016, at 1:49 PM, Hans Wennborg wrote: > > Greg: ping? > > On Tue, Jan 26, 2016 at 11:10 AM, Hans Wennborg wrote: >> Greg: Ping? >> >> On Tue, Jan 19, 2016 at 1:12 PM, Hans Wennborg wrote: >>> Sure. Greg, are you the code owner for this, or is there a specific >>> owner for Go? >>> >>> Thanks, >>> Hans >>> >>> On Fri, Jan 15, 2016 at 11:43 AM, Ryan Brown via lldb-commits >>> wrote: It would be nice if we could get this into 3.8 to get rid of these asserts. -- Ryan Brown On Fri, Jan 15, 2016 at 11:35 AM, Ryan Brown via lldb-commits wrote: > > Author: ribrdb > Date: Fri Jan 15 13:35:48 2016 > New Revision: 257926 > > URL: http://llvm.org/viewvc/llvm-project?rev=257926&view=rev > Log: > Implement missing GoASTContext methods > > Modified: >lldb/trunk/source/Symbol/GoASTContext.cpp > > Modified: lldb/trunk/source/Symbol/GoASTContext.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/GoASTContext.cpp?rev=257926&r1=257925&r2=257926&view=diff > > == > --- lldb/trunk/source/Symbol/GoASTContext.cpp (original) > +++ lldb/trunk/source/Symbol/GoASTContext.cpp Fri Jan 15 13:35:48 2016 > @@ -13,6 +13,7 @@ > > #include "lldb/Core/Module.h" > #include "lldb/Core/PluginManager.h" > +#include "lldb/Core/StreamFile.h" > #include "lldb/Core/UniqueCStringMap.h" > #include "lldb/Core/ValueObject.h" > #include "lldb/DataFormatters/StringPrinter.h" > @@ -1268,13 +1269,115 @@ GoASTContext::ConvertStringToFloatValue( > //-- > // Dumping types > //-- > +#define DEPTH_INCREMENT 2 > + > void > GoASTContext::DumpValue(lldb::opaque_compiler_type_t type, > ExecutionContext *exe_ctx, Stream *s, lldb::Format format, > -const DataExtractor &data, lldb::offset_t > data_offset, size_t data_byte_size, > +const DataExtractor &data, lldb::offset_t > data_byte_offset, size_t data_byte_size, > uint32_t bitfield_bit_size, uint32_t > bitfield_bit_offset, bool show_types, bool show_summary, > bool verbose, uint32_t depth) > { > -assert(false); > +if (IsTypedefType(type)) > +type = GetTypedefedType(type).GetOpaqueQualType(); > +if (!type) > +return; > +GoType *t = static_cast(type); > + > +if (GoStruct *st = t->GetStruct()) > +{ > +if (GetCompleteType(type)) > +{ > +uint32_t field_idx = 0; > +for (auto* field = st->GetField(field_idx); field != nullptr; > field_idx++) > +{ > +// Print the starting squiggly bracket (if this is the > +// first member) or comma (for member 2 and beyond) for > +// the struct/union/class member. > +if (field_idx == 0) > +s->PutChar('{'); > +else > +s->PutChar(','); > + > +// Indent > +s->Printf("\n%*s", depth + DEPTH_INCREMENT, ""); > + > +// Print the member type if requested > +if (show_types) > +{ > +ConstString field_type_name = > field->m_type.GetTypeName(); > +s->Printf("(%s) ", field_type_name.AsCString()); > +} > +// Print the member name and equal sign > +s->Printf("%s = ", field->m_name.AsCString()); > + > + > +// Dump the value of the member > +CompilerType field_type = field->m_type; > +field_type.DumpValue (exe_ctx, > + s, > // Stream to dump to > + field_type.GetFormat(), > // The format with which to display the member > + data, > // Data buffer containing all bytes for this type > + data_byte_offset + > field->m_byte_offset,// Offset into "data" where to grab value from > + > field->m_type.GetByteSize(exe_ctx->GetBestExecutionContextScope()), > // > Size of this type in bytes > +
Re: [Lldb-commits] [lldb] r257926 - Implement missing GoASTContext methods
Thanks! r259423. On Mon, Feb 1, 2016 at 2:19 PM, Greg Clayton wrote: > Sorry for the delay. This is fine. > > In general, feel free to accept any patches that are architecture specific > for architectures that aren't x86 or ARM (MIPS, hexagon for example), and for > any languages that aren't C/C++/ObjC or Swift (renderscript, go). > > >> On Feb 1, 2016, at 1:49 PM, Hans Wennborg wrote: >> >> Greg: ping? >> >> On Tue, Jan 26, 2016 at 11:10 AM, Hans Wennborg wrote: >>> Greg: Ping? >>> >>> On Tue, Jan 19, 2016 at 1:12 PM, Hans Wennborg wrote: Sure. Greg, are you the code owner for this, or is there a specific owner for Go? Thanks, Hans On Fri, Jan 15, 2016 at 11:43 AM, Ryan Brown via lldb-commits wrote: > It would be nice if we could get this into 3.8 to get rid of these > asserts. > > -- Ryan Brown > > On Fri, Jan 15, 2016 at 11:35 AM, Ryan Brown via lldb-commits > wrote: >> >> Author: ribrdb >> Date: Fri Jan 15 13:35:48 2016 >> New Revision: 257926 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=257926&view=rev >> Log: >> Implement missing GoASTContext methods >> >> Modified: >>lldb/trunk/source/Symbol/GoASTContext.cpp >> >> Modified: lldb/trunk/source/Symbol/GoASTContext.cpp >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/GoASTContext.cpp?rev=257926&r1=257925&r2=257926&view=diff >> >> == >> --- lldb/trunk/source/Symbol/GoASTContext.cpp (original) >> +++ lldb/trunk/source/Symbol/GoASTContext.cpp Fri Jan 15 13:35:48 2016 >> @@ -13,6 +13,7 @@ >> >> #include "lldb/Core/Module.h" >> #include "lldb/Core/PluginManager.h" >> +#include "lldb/Core/StreamFile.h" >> #include "lldb/Core/UniqueCStringMap.h" >> #include "lldb/Core/ValueObject.h" >> #include "lldb/DataFormatters/StringPrinter.h" >> @@ -1268,13 +1269,115 @@ GoASTContext::ConvertStringToFloatValue( >> //-- >> // Dumping types >> //-- >> +#define DEPTH_INCREMENT 2 >> + >> void >> GoASTContext::DumpValue(lldb::opaque_compiler_type_t type, >> ExecutionContext *exe_ctx, Stream *s, lldb::Format format, >> -const DataExtractor &data, lldb::offset_t >> data_offset, size_t data_byte_size, >> +const DataExtractor &data, lldb::offset_t >> data_byte_offset, size_t data_byte_size, >> uint32_t bitfield_bit_size, uint32_t >> bitfield_bit_offset, bool show_types, bool show_summary, >> bool verbose, uint32_t depth) >> { >> -assert(false); >> +if (IsTypedefType(type)) >> +type = GetTypedefedType(type).GetOpaqueQualType(); >> +if (!type) >> +return; >> +GoType *t = static_cast(type); >> + >> +if (GoStruct *st = t->GetStruct()) >> +{ >> +if (GetCompleteType(type)) >> +{ >> +uint32_t field_idx = 0; >> +for (auto* field = st->GetField(field_idx); field != >> nullptr; >> field_idx++) >> +{ >> +// Print the starting squiggly bracket (if this is the >> +// first member) or comma (for member 2 and beyond) for >> +// the struct/union/class member. >> +if (field_idx == 0) >> +s->PutChar('{'); >> +else >> +s->PutChar(','); >> + >> +// Indent >> +s->Printf("\n%*s", depth + DEPTH_INCREMENT, ""); >> + >> +// Print the member type if requested >> +if (show_types) >> +{ >> +ConstString field_type_name = >> field->m_type.GetTypeName(); >> +s->Printf("(%s) ", field_type_name.AsCString()); >> +} >> +// Print the member name and equal sign >> +s->Printf("%s = ", field->m_name.AsCString()); >> + >> + >> +// Dump the value of the member >> +CompilerType field_type = field->m_type; >> +field_type.DumpValue (exe_ctx, >> + s, >> // Stream to dump to >> + field_type.GetFormat(), >> // The format with which to display the member >> + data, >> // Data buffer containing all bytes for this type >> + data_byte_offset + >> field->m_byte_offset,// Offset
[Lldb-commits] LLVM buildmaster will be restarted tonight
Hello everyone, LLVM buildmaster will be updated and restarted after 7 PM Pacific time today. Thanks Galina ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r259433 - Fix getCompiler in unit testing framework on compiler symlinks
Author: sas Date: Mon Feb 1 17:21:27 2016 New Revision: 259433 URL: http://llvm.org/viewvc/llvm-project?rev=259433&view=rev Log: Fix getCompiler in unit testing framework on compiler symlinks Summary: Checks using the result of getCompiler() will fail to identify the compiler correctly if CC is a symlink path (ie /usr/bin/cc). Reviewers: zturner, emaste Subscribers: llvm-commits, sas Differential Revision: http://reviews.llvm.org/D16488 Change by Francis Ricci Modified: lldb/trunk/packages/Python/lldbsuite/test/plugins/builder_base.py Modified: lldb/trunk/packages/Python/lldbsuite/test/plugins/builder_base.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/plugins/builder_base.py?rev=259433&r1=259432&r2=259433&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/plugins/builder_base.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/plugins/builder_base.py Mon Feb 1 17:21:27 2016 @@ -22,7 +22,8 @@ def getArchitecture(): def getCompiler(): """Returns the compiler in effect the test suite is running with.""" -return os.environ["CC"] if "CC" in os.environ else "clang" +compiler = os.environ.get("CC", "clang") +return os.path.realpath(compiler) def getArchFlag(): """Returns the flag required to specify the arch""" ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64
krytarowski added a comment. Thank you very much! You made this patch possible. Repository: rL LLVM http://reviews.llvm.org/D16508 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16741: Make many of the skip decorators use common code
zturner marked an inline comment as done. Comment at: packages/Python/lldbsuite/test/lldbtest.py:560 @@ -559,3 +559,1 @@ """Decorate the item as a debugserver test.""" -if isinstance(func, type) and issubclass(func, unittest2.TestCase): -raise Exception("@debugserver_test can only be used to decorate a test method") labath wrote: > Please don't remove these. They make sure that you do not attempt to apply > this decorator to a class. If the decorator is not ready for that (and the > current skipIfTestFn does not appear to be), it will just cause the whole > cause the whole class to be silently ignored (we've had this happen before). > > I think it's ok to centralize the check in skipTestIfFn. Why don't we want this behavior? With this check, an exception is being thrown if the condition is true. Currently the test suite is not failing anywhere with this exception, meaning the check is never true. And it would only be true if we put the decorator on the actual class. Which we already do in some places (see `TestAddDsymCommand.py`) and is actually a very useful way of skipping or xfailing an entire class. I want to be able to skip / xfail entire classes *more* easily, not less easily. http://reviews.llvm.org/D16741 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16741: Make many of the skip decorators use common code
zturner marked an inline comment as done. zturner added a comment. I guess we need to be consistent. Do we want to be able to decorate entire classes, or not? If we do, then we should remove the check. If we don't then we should leave the check. But since many tests are already using these decorators at the class level (`TestEvents.py`, `TestAddDsymCommand.py`, `TestObjCMethods2.py`, `TestLoadUnload.py`, and many more) those decorators cannot yet be ported to using common code until we decide which we want. http://reviews.llvm.org/D16741 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r259443 - We try to avoid static objects. These are on the error path for unsupported features
Author: jingham Date: Mon Feb 1 18:21:39 2016 New Revision: 259443 URL: http://llvm.org/viewvc/llvm-project?rev=259443&view=rev Log: We try to avoid static objects. These are on the error path for unsupported features in the socket, so just returning freshly constructed objects is fine. Modified: lldb/trunk/source/Host/common/UDPSocket.cpp Modified: lldb/trunk/source/Host/common/UDPSocket.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/UDPSocket.cpp?rev=259443&r1=259442&r2=259443&view=diff == --- lldb/trunk/source/Host/common/UDPSocket.cpp (original) +++ lldb/trunk/source/Host/common/UDPSocket.cpp Mon Feb 1 18:21:39 2016 @@ -27,7 +27,7 @@ namespace { const int kDomain = AF_INET; const int kType = SOCK_DGRAM; -const Error kNotSupported("Not supported"); +static const char *g_not_supported_error = "Not supported"; } @@ -55,19 +55,19 @@ UDPSocket::Send(const void *buf, const s Error UDPSocket::Connect(llvm::StringRef name) { -return kNotSupported; +return Error("%s", g_not_supported_error); } Error UDPSocket::Listen(llvm::StringRef name, int backlog) { -return kNotSupported; +return Error("%s", g_not_supported_error); } Error UDPSocket::Accept(llvm::StringRef name, bool child_processes_inherit, Socket *&socket) { -return kNotSupported; +return Error("%s", g_not_supported_error); } Error ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16767: Fix single-stepping onto a breakpoint
amccarth added a subscriber: amccarth. amccarth added a comment. I was chasing this same bug on Windows before I noticed you were working on it. I patched in your latest diff, and the problem still occurs. In fact, now I get two failures: > == > FAIL: test_continue > (TestConsecutiveBreakpoints.ConsecutiveBreakpointsTestCase) > > Test that continue stops at the second breakpoint. > > -- > > Traceback (most recent call last): > > File > "D:\src\llvm\llvm\tools\lldb\packages\Python\lldbsuite\test\lldbtest.py", > line 552, in wrapper > return func(self, *args, **kwargs) > File > "D:\src\llvm\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\breakpoint\consecutive_breakpoints\TestConsecutiveBreakpoints.py", > line 58, in test_continue > self.assertEquals(self.process.GetState(), lldb.eStateStopped) > > AssertionError: 10 != 5 > Config=i686-D:\src\llvm\build\ninja_release\bin\clang.exe > == > FAIL: test_single_step > (TestConsecutiveBreakpoints.ConsecutiveBreakpointsTestCase) > > Test that single step stops at the second breakpoint. > > -- > > Traceback (most recent call last): > > File > "D:\src\llvm\llvm\tools\lldb\packages\Python\lldbsuite\test\lldbtest.py", > line 552, in wrapper > return func(self, *args, **kwargs) > File > "D:\src\llvm\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\breakpoint\consecutive_breakpoints\TestConsecutiveBreakpoints.py", > line 76, in test_single_step > self.assertIsNotNone(self.thread, "Expected one thread to be stopped at > breakpoint 2") > > AssertionError: unexpectedly None : Expected one thread to be stopped at > breakpoint 2 > Config=i686-D:\src\llvm\build\ninja_release\bin\clang.exe > > -- > > Ran 3 tests in 25.026s > > RESULT: FAILED (1 passes, 2 failures, 0 errors, 0 skipped, 0 expected > failures, 0 unexpected successes) http://reviews.llvm.org/D16767 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16741: Make many of the skip decorators use common code
zturner updated this revision to Diff 46599. zturner added a comment. Herald added subscribers: srhines, danalbert, tberghammer. I think this should fix most of the issues. A few of the decorators I wasn't able to touch because of the issues with class-level decorators. But I think this is a good start. My test statistics before and after this patch are the same. If someone else could run test suite before and after this patch and let me know how the numbers look on your platform I would appreciate it. Suggestions welcome. http://reviews.llvm.org/D16741 Files: packages/Python/lldbsuite/test/lldbtest.py Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -440,6 +440,14 @@ return __import__("builder_netbsd") return __import__("builder_" + sys.platform) +def does_function_require_argument(func): +import inspect +func_argc = len(inspect.getargspec(func).args) +if func_argc == 0 or (getattr(func,'im_self',None) is not None) or (hasattr(func, '__self__')): +return False +else: +return True + def run_adb_command(cmd, device_id): device_id_args = [] if device_id: @@ -531,71 +539,39 @@ def benchmarks_test(func): """Decorate the item as a benchmarks test.""" -if isinstance(func, type) and issubclass(func, unittest2.TestCase): -raise Exception("@benchmarks_test can only be used to decorate a test method") -@wraps(func) -def wrapper(self, *args, **kwargs): -self.skipTest("benchmarks test") -return func(self, *args, **kwargs) +def should_skip_benchmarks_test(): +return (True, "benchmarks test") # Mark this function as such to separate them from the regular tests. -wrapper.__benchmarks_test__ = True -return wrapper +result = skipTestIfFn(should_skip_benchmarks_test)(func) +result.__benchmarks_test__ = True +return result def no_debug_info_test(func): """Decorate the item as a test what don't use any debug info. If this annotation is specified then the test runner won't generate a separate test for each debug info format. """ -if isinstance(func, type) and issubclass(func, unittest2.TestCase): -raise Exception("@no_debug_info_test can only be used to decorate a test method") -@wraps(func) -def wrapper(self, *args, **kwargs): -return func(self, *args, **kwargs) # Mark this function as such to separate them from the regular tests. -wrapper.__no_debug_info_test__ = True -return wrapper +func.__no_debug_info_test__ = True +return func def debugserver_test(func): """Decorate the item as a debugserver test.""" -if isinstance(func, type) and issubclass(func, unittest2.TestCase): -raise Exception("@debugserver_test can only be used to decorate a test method") -@wraps(func) -def wrapper(self, *args, **kwargs): -if configuration.dont_do_debugserver_test: -self.skipTest("debugserver tests") -return func(self, *args, **kwargs) - -# Mark this function as such to separate them from the regular tests. -wrapper.__debugserver_test__ = True -return wrapper +def should_skip_debugserver_test(): +return (configuration.dont_do_debugserver_test, "debugserver tests") +return skipTestIfFn(should_skip_debugserver_test)(func) def llgs_test(func): """Decorate the item as a lldb-server test.""" -if isinstance(func, type) and issubclass(func, unittest2.TestCase): -raise Exception("@llgs_test can only be used to decorate a test method") -@wraps(func) -def wrapper(self, *args, **kwargs): -if configuration.dont_do_llgs_test: -self.skipTest("llgs tests") -return func(self, *args, **kwargs) - -# Mark this function as such to separate them from the regular tests. -wrapper.__llgs_test__ = True -return wrapper +def should_skip_llgs_tests(): +return (configuration.dont_do_llgs_test, "llgs tests") +return skipTestIfFn(should_skip_llgs_tests)(func) def not_remote_testsuite_ready(func): """Decorate the item as a test which is not ready yet for remote testsuite.""" -if isinstance(func, type) and issubclass(func, unittest2.TestCase): -raise Exception("@not_remote_testsuite_ready can only be used to decorate a test method") -@wraps(func) -def wrapper(self, *args, **kwargs): -if lldb.remote_platform: -self.skipTest("not ready for remote testsuite") -return func(self, *args, **kwargs) - -# Mark this function as such to separate them from the regular tests. -wrapper.__not_ready_for_remote_testsuite_test__ = True -return wrapper +def is_remote(): +return (lldb.remote_platform, "Not ready for remote testsuite") +return skipTestIfFn(is_remote)
Re: [Lldb-commits] [PATCH] D16741: Make many of the skip decorators use common code
tfiala added a subscriber: tfiala. tfiala added a comment. I'll see if I can run this tonight. If not tonight, I'll do it first thing in the morning. http://reviews.llvm.org/D16741 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16741: Make many of the skip decorators use common code
I'll see if I can run this tonight. If not tonight, I'll do it first thing in the morning. On Mon, Feb 1, 2016 at 5:17 PM, Zachary Turner wrote: > zturner updated this revision to Diff 46599. > zturner added a comment. > Herald added subscribers: srhines, danalbert, tberghammer. > > I think this should fix most of the issues. A few of the decorators I > wasn't able to touch because of the issues with class-level decorators. > But I think this is a good start. My test statistics before and after this > patch are the same. > > If someone else could run test suite before and after this patch and let > me know how the numbers look on your platform I would appreciate it. > > Suggestions welcome. > > > http://reviews.llvm.org/D16741 > > Files: > packages/Python/lldbsuite/test/lldbtest.py > > -- -Todd ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64
This revision was automatically updated to reflect the committed changes. Closed by commit rL259462: NetBSD: Define initial RegisterContextNetBSD_x86_64 (authored by kamil). Changed prior to commit: http://reviews.llvm.org/D16508?vs=46489&id=46610#toc Repository: rL LLVM http://reviews.llvm.org/D16508 Files: lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp === --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp @@ -0,0 +1,364 @@ +//===-- RegisterContextNetBSD_x86_64.cpp --*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===-===// + +#include +#include + +#include "llvm/Support/Compiler.h" + +#include "RegisterContextPOSIX_x86.h" +#include "RegisterContextNetBSD_x86_64.h" + +using namespace lldb_private; +using namespace lldb; + +// src/sys/arch/amd64/include/frame_regs.h +typedef struct _GPR +{ +uint64_t rdi; /* 0 */ +uint64_t rsi; /* 1 */ +uint64_t rdx; /* 2 */ +uint64_t rcx; /* 3 */ +uint64_t r8; /* 4 */ +uint64_t r9; /* 5 */ +uint64_t r10; /* 6 */ +uint64_t r11; /* 7 */ +uint64_t r12; /* 8 */ +uint64_t r13; /* 9 */ +uint64_t r14; /* 10 */ +uint64_t r15; /* 11 */ +uint64_t rbp; /* 12 */ +uint64_t rbx; /* 13 */ +uint64_t rax; /* 14 */ +uint64_t gs; /* 15 */ +uint64_t fs; /* 16 */ +uint64_t es; /* 17 */ +uint64_t ds; /* 18 */ +uint64_t trapno; /* 19 */ +uint64_t err; /* 20 */ +uint64_t rip; /* 21 */ +uint64_t cs; /* 22 */ +uint64_t rflags; /* 23 */ +uint64_t rsp; /* 24 */ +uint64_t ss; /* 25 */ +} GPR; + +/* + * As of NetBSD-7.99.25 there is no support for debug registers + * https://en.wikipedia.org/wiki/X86_debug_register + */ + +/* + * src/sys/arch/amd64/include/mcontext.h + * + * typedef struct { + * __gregset_t __gregs; + * __greg_t_mc_tlsbase; + * __fpregset_t__fpregs; + * } mcontext_t; + */ + +struct UserArea { +GPR gpr; +uint64_t mc_tlsbase; +FPR fpr; +}; + + +//--- +// Cherry-pick parts of RegisterInfos_x86_64.h, without debug registers +//--- +// Computes the offset of the given GPR in the user data area. +#define GPR_OFFSET(regname) \ +(LLVM_EXTENSION offsetof(GPR, regname)) + +// Computes the offset of the given FPR in the extended data area. +#define FPR_OFFSET(regname) \ +(LLVM_EXTENSION offsetof(UserArea, fpr) + \ + LLVM_EXTENSION offsetof(FPR, xstate) + \ + LLVM_EXTENSION offsetof(FXSAVE, regname)) + +// Computes the offset of the YMM register assembled from register halves. +// Based on DNBArchImplX86_64.cpp from debugserver +#define YMM_OFFSET(reg_index) \ +(LLVM_EXTENSION offsetof(UserArea, fpr) + \ + LLVM_EXTENSION offsetof(FPR, xstate) + \ + LLVM_EXTENSION offsetof(XSAVE, ymmh[0]) + \ + (32 * reg_index)) + +// Number of bytes needed to represent a FPR. +#define FPR_SIZE(reg) sizeof(((FXSAVE*)NULL)->reg) + +// Number of bytes needed to represent the i'th FP register. +#define FP_SIZE sizeof(((MMSReg*)NULL)->bytes) + +// Number of bytes needed to represent an XMM register. +#define XMM_SIZE sizeof(XMMReg) + +// Number of bytes needed to represent a YMM register. +#define YMM_SIZE sizeof(YMMReg) + +// RegisterKind: EHFrame, DWARF, Generic, Process Plugin, LLDB + +// Note that the size and offset will be updated by platform-specific classes. +#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4)\ +{ #reg, alt, sizeof(((GPR*)NULL)->reg), GPR_OFFSET(reg), eEncodingUint, \ + eFormatHex, { kind1, kind2, kind3, kind4, lldb_##reg##_x86_64 }, NULL, NULL } + +#define DEFINE_FPR(name, reg, kind1, kind2, kind3, kind4)\ +{ #name, NULL, FPR_SIZE(reg), FPR_OFFSET(reg), eEncodingUint, \ + eFormatHex, { kind1, kind2, kind3, kind4, lldb_##name##_x86_64 }, NULL, NULL } + +#define DEFINE_FP_ST(reg, i) \ +{ #reg#i, NULL, FP_SIZE, LLVM_EXTENSION FPR_OFFSET(stmm[i]), \ + eEncodingVector, eFormatVectorOfUInt8, \ + { dwarf_st##i##_x86_64, dwarf_st##i##_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, lldb_s
[Lldb-commits] [lldb] r259462 - NetBSD: Define initial RegisterContextNetBSD_x86_64
Author: kamil Date: Mon Feb 1 21:47:44 2016 New Revision: 259462 URL: http://llvm.org/viewvc/llvm-project?rev=259462&view=rev Log: NetBSD: Define initial RegisterContextNetBSD_x86_64 Summary: Add basic support, i386 version will be added later. Reviewers: emaste, joerg, clayborg, tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16508 Added: lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h Modified: lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt Modified: lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt?rev=259462&r1=259461&r2=259462&view=diff == --- lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt (original) +++ lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt Mon Feb 1 21:47:44 2016 @@ -34,6 +34,7 @@ add_lldb_library(lldbPluginProcessUtilit RegisterContextMach_i386.cpp RegisterContextMach_x86_64.cpp RegisterContextMemory.cpp + RegisterContextNetBSD_x86_64.cpp RegisterContextPOSIX_arm.cpp RegisterContextPOSIX_arm64.cpp RegisterContextPOSIX_mips64.cpp Added: lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp?rev=259462&view=auto == --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp (added) +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp Mon Feb 1 21:47:44 2016 @@ -0,0 +1,364 @@ +//===-- RegisterContextNetBSD_x86_64.cpp --*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===-===// + +#include +#include + +#include "llvm/Support/Compiler.h" + +#include "RegisterContextPOSIX_x86.h" +#include "RegisterContextNetBSD_x86_64.h" + +using namespace lldb_private; +using namespace lldb; + +// src/sys/arch/amd64/include/frame_regs.h +typedef struct _GPR +{ +uint64_t rdi; /* 0 */ +uint64_t rsi; /* 1 */ +uint64_t rdx; /* 2 */ +uint64_t rcx; /* 3 */ +uint64_t r8; /* 4 */ +uint64_t r9; /* 5 */ +uint64_t r10; /* 6 */ +uint64_t r11; /* 7 */ +uint64_t r12; /* 8 */ +uint64_t r13; /* 9 */ +uint64_t r14; /* 10 */ +uint64_t r15; /* 11 */ +uint64_t rbp; /* 12 */ +uint64_t rbx; /* 13 */ +uint64_t rax; /* 14 */ +uint64_t gs; /* 15 */ +uint64_t fs; /* 16 */ +uint64_t es; /* 17 */ +uint64_t ds; /* 18 */ +uint64_t trapno; /* 19 */ +uint64_t err; /* 20 */ +uint64_t rip; /* 21 */ +uint64_t cs; /* 22 */ +uint64_t rflags; /* 23 */ +uint64_t rsp; /* 24 */ +uint64_t ss; /* 25 */ +} GPR; + +/* + * As of NetBSD-7.99.25 there is no support for debug registers + * https://en.wikipedia.org/wiki/X86_debug_register + */ + +/* + * src/sys/arch/amd64/include/mcontext.h + * + * typedef struct { + * __gregset_t __gregs; + * __greg_t_mc_tlsbase; + * __fpregset_t__fpregs; + * } mcontext_t; + */ + +struct UserArea { +GPR gpr; +uint64_t mc_tlsbase; +FPR fpr; +}; + + +//--- +// Cherry-pick parts of RegisterInfos_x86_64.h, without debug registers +//--- +// Computes the offset of the given GPR in the user data area. +#define GPR_OFFSET(regname) \ +(LLVM_EXTENSION offsetof(GPR, regname)) + +// Computes the offset of the given FPR in the extended data area. +#define FPR_OFFSET(regname) \ +(LLVM_EXTENSION offsetof(UserArea, fpr) + \ + LLVM_EXTENSION offsetof(FPR, xstate) + \ + LLVM_EXTENSION offsetof(FXSAVE, regname)) + +// Computes the offset of the YMM register assembled from register halves. +// Based on DNBArchImplX86_64.cpp from debugserver +#define YMM_OFFSET(reg_index) \ +(LLVM_EXTENSION offsetof(UserArea, fpr) + \ + LLVM_EXTENSION offsetof(FPR, xstate) + \ + LLVM_EXTENSION offsetof(XSAVE, ymmh[0]) + \ + (32 * reg_index)) + +// Number of bytes needed to represent a FPR. +#define FPR_SIZE(reg) sizeof(((FXSAVE*)NULL)->reg) + +// Number of bytes needed to represent the i'th FP register. +#define FP_SIZE sizeof(((MMSReg*)NULL)->bytes) + +// Number of bytes needed to represent an XMM register. +#define XMM_SIZE sizeof(XMMReg) +
Re: [Lldb-commits] [PATCH] D16627: Add support to detect arm hard float ABI based binaries for ABISysV_arm
omjavaid updated this revision to Diff 46620. omjavaid marked 4 inline comments as done. omjavaid added a comment. Updated after addressing concerns. LGTM? http://reviews.llvm.org/D16627 Files: include/lldb/Core/ArchSpec.h source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp source/Plugins/ABI/SysV-arm/ABISysV_arm.h source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp === --- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1562,6 +1562,15 @@ } } +if (arch_spec.GetMachine() == llvm::Triple::arm || +arch_spec.GetMachine() == llvm::Triple::thumb) +{ +if (header.e_flags & llvm::ELF::EF_ARM_SOFT_FLOAT) +arch_spec.SetFlags (ArchSpec::eARM_abi_soft_float); +else if (header.e_flags & llvm::ELF::EF_ARM_VFP_FLOAT) +arch_spec.SetFlags (ArchSpec::eARM_abi_hard_float); +} + // If there are no section headers we are done. if (header.e_shnum == 0) return 0; Index: source/Plugins/ABI/SysV-arm/ABISysV_arm.h === --- source/Plugins/ABI/SysV-arm/ABISysV_arm.h +++ source/Plugins/ABI/SysV-arm/ABISysV_arm.h @@ -79,6 +79,9 @@ const lldb_private::RegisterInfo * GetRegisterInfoArray (uint32_t &count) override; +bool +IsArmHardFloat (lldb_private::Thread &thread) const; + //-- // Static Functions //-- Index: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp === --- source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp +++ source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp @@ -414,6 +414,20 @@ return true; } +bool +ABISysV_arm::IsArmHardFloat (Thread &thread) const +{ +ProcessSP process_sp (thread.GetProcess()); +if (process_sp) +{ +const ArchSpec &arch (process_sp->GetTarget().GetArchitecture()); + +return (arch.GetFlags() & ArchSpec::eARM_abi_hard_float) != 0; +} + +return false; +} + ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl (Thread &thread, lldb_private::CompilerType &compiler_type) const @@ -516,19 +530,42 @@ case 64: { static_assert(sizeof(double) == sizeof(uint64_t), ""); -const RegisterInfo *r1_reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG2); -uint64_t raw_value; -raw_value = reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT32_MAX; -raw_value |= ((uint64_t)(reg_ctx->ReadRegisterAsUnsigned(r1_reg_info, 0) & UINT32_MAX)) << 32; -value.GetScalar() = *reinterpret_cast(&raw_value); + +if (IsArmHardFloat(thread)) +{ +RegisterValue reg_value; +const RegisterInfo *d0_reg_info = reg_ctx->GetRegisterInfoByName("d0", 0); +reg_ctx->ReadRegister(d0_reg_info, reg_value); +value.GetScalar() = reg_value.GetAsDouble(); +} +else +{ +uint64_t raw_value; +const RegisterInfo *r1_reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG2); +raw_value = reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT32_MAX; +raw_value |= ((uint64_t)(reg_ctx->ReadRegisterAsUnsigned(r1_reg_info, 0) & UINT32_MAX)) << 32; +value.GetScalar() = *reinterpret_cast(&raw_value); +} break; } case 16: // Half precision returned after a conversion to single precision case 32: { static_assert(sizeof(float) == sizeof(uint32_t), ""); -uint32_t raw_value = reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT32_MAX; -value.GetScalar() = *reinterpret_cast(&raw_value); + +if (IsArmHardFloat(thread)) +{ +RegisterValue reg_value; +const RegisterInfo *s0_reg_info = reg_ctx->GetRegisterInfoByName("s0", 0); +reg_ctx->ReadRegister(s0_reg_info, reg_value); +value.GetScalar() = reg_value.GetAsFloat(); +} +else +{ +uint32_t raw_value; +raw_value = reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT32_MAX; +