[Lldb-commits] [PATCH] D33213: Use socketpair on all Unix platforms
labath added a comment. In https://reviews.llvm.org/D33213#814041, @DemiMarie wrote: > In https://reviews.llvm.org/D33213#813037, @clayborg wrote: > > > Before any changes are submitted, we assume you are getting a clean test > > suite run. > > > On my system, I get build failures in clang. I suggest you write an email to cfe-dev http://lists.llvm.org/mailman/listinfo/cfe-dev and ask for help (or just google around). It's kinda hard to develop a feature without even being able to build the code :) https://reviews.llvm.org/D33213 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35614: Update API headers.
brucem created this revision. - Provide API doc for SBProcess::SaveCore. - Fix typo in SBAttachInfo doc comments. - SBBreakpointList: Name some variables same as C++. https://reviews.llvm.org/D35614 Files: include/lldb/API/SBAttachInfo.h include/lldb/API/SBBreakpoint.h include/lldb/API/SBProcess.h Index: include/lldb/API/SBProcess.h === --- include/lldb/API/SBProcess.h +++ include/lldb/API/SBProcess.h @@ -350,7 +350,7 @@ bool IsInstrumentationRuntimePresent(InstrumentationRuntimeType type); - // Save the state of the process in a core file (or mini dump on Windows). + /// Save the state of the process in a core file (or mini dump on Windows). lldb::SBError SaveCore(const char *file_name); //-- Index: include/lldb/API/SBBreakpoint.h === --- include/lldb/API/SBBreakpoint.h +++ include/lldb/API/SBBreakpoint.h @@ -154,9 +154,9 @@ SBBreakpoint FindBreakpointByID(lldb::break_id_t); - void Append(const SBBreakpoint &sb_file); + void Append(const SBBreakpoint &sb_bkpt); - bool AppendIfUnique(const SBBreakpoint &sb_file); + bool AppendIfUnique(const SBBreakpoint &sb_bkpt); void AppendByID(lldb::break_id_t id); Index: include/lldb/API/SBAttachInfo.h === --- include/lldb/API/SBAttachInfo.h +++ include/lldb/API/SBAttachInfo.h @@ -162,7 +162,7 @@ /// Get the listener that will be used to receive process events. /// /// If no listener has been set via a call to - /// SBLaunchInfo::SetListener(), then an invalid SBListener will be + /// SBAttachInfo::SetListener(), then an invalid SBListener will be /// returned (SBListener::IsValid() will return false). If a listener /// has been set, then the valid listener object will be returned. //-- Index: include/lldb/API/SBProcess.h === --- include/lldb/API/SBProcess.h +++ include/lldb/API/SBProcess.h @@ -350,7 +350,7 @@ bool IsInstrumentationRuntimePresent(InstrumentationRuntimeType type); - // Save the state of the process in a core file (or mini dump on Windows). + /// Save the state of the process in a core file (or mini dump on Windows). lldb::SBError SaveCore(const char *file_name); //-- Index: include/lldb/API/SBBreakpoint.h === --- include/lldb/API/SBBreakpoint.h +++ include/lldb/API/SBBreakpoint.h @@ -154,9 +154,9 @@ SBBreakpoint FindBreakpointByID(lldb::break_id_t); - void Append(const SBBreakpoint &sb_file); + void Append(const SBBreakpoint &sb_bkpt); - bool AppendIfUnique(const SBBreakpoint &sb_file); + bool AppendIfUnique(const SBBreakpoint &sb_bkpt); void AppendByID(lldb::break_id_t id); Index: include/lldb/API/SBAttachInfo.h === --- include/lldb/API/SBAttachInfo.h +++ include/lldb/API/SBAttachInfo.h @@ -162,7 +162,7 @@ /// Get the listener that will be used to receive process events. /// /// If no listener has been set via a call to - /// SBLaunchInfo::SetListener(), then an invalid SBListener will be + /// SBAttachInfo::SetListener(), then an invalid SBListener will be /// returned (SBListener::IsValid() will return false). If a listener /// has been set, then the valid listener object will be returned. //-- ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35607: Extend 'target symbols add' to load symbols from a given file by UUID.
labath added a reviewer: jingham. labath added a comment. I think Jim (or maybe Greg?) should take a look at this. Right now I'll just comment on the test. Comment at: packages/Python/lldbsuite/test/linux/add-symbols/Makefile:1 +all: clean + mkdir debug_binaries This is a very non-standard Makefile. As it is now, it will fail if running the test against android. I think you should be able to replace the strip command with a `LD_EXTRAS += -Wl,--build-id=none`. This should allow you to use Makefile.rules and be more portable. Also, I'd recommend setting this up in a way that you don't overwrite the `a.out` compiler output, as that will make the rules simpler. I'm thinking of something like this (untested) snippet: ``` LEVEL= ??? C_SOURCES := a.c LD_EXTRAS += -Wl,--build-id=none include $(LEVEL)/Makefile.rules b.out: a.out $(OBJCOPY) --strip-debug a.out b.out #Have the test use b.out as the main executable all: b.out clean:: rm -rf b.out ``` https://reviews.llvm.org/D35607 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35614: Update API headers.
labath accepted this revision. labath added a comment. This revision is now accepted and ready to land. thanks https://reviews.llvm.org/D35614 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r308425 - Update API headers.
Author: brucem Date: Wed Jul 19 02:30:04 2017 New Revision: 308425 URL: http://llvm.org/viewvc/llvm-project?rev=308425&view=rev Log: Update API headers. Summary: * Provide API doc for SBProcess::SaveCore. * Fix typo in SBAttachInfo doc comments. * SBBreakpointList: Name some variables same as C++. Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D35614 Modified: lldb/trunk/include/lldb/API/SBAttachInfo.h lldb/trunk/include/lldb/API/SBBreakpoint.h lldb/trunk/include/lldb/API/SBProcess.h Modified: lldb/trunk/include/lldb/API/SBAttachInfo.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBAttachInfo.h?rev=308425&r1=308424&r2=308425&view=diff == --- lldb/trunk/include/lldb/API/SBAttachInfo.h (original) +++ lldb/trunk/include/lldb/API/SBAttachInfo.h Wed Jul 19 02:30:04 2017 @@ -162,7 +162,7 @@ public: /// Get the listener that will be used to receive process events. /// /// If no listener has been set via a call to - /// SBLaunchInfo::SetListener(), then an invalid SBListener will be + /// SBAttachInfo::SetListener(), then an invalid SBListener will be /// returned (SBListener::IsValid() will return false). If a listener /// has been set, then the valid listener object will be returned. //-- Modified: lldb/trunk/include/lldb/API/SBBreakpoint.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBBreakpoint.h?rev=308425&r1=308424&r2=308425&view=diff == --- lldb/trunk/include/lldb/API/SBBreakpoint.h (original) +++ lldb/trunk/include/lldb/API/SBBreakpoint.h Wed Jul 19 02:30:04 2017 @@ -154,9 +154,9 @@ public: SBBreakpoint FindBreakpointByID(lldb::break_id_t); - void Append(const SBBreakpoint &sb_file); + void Append(const SBBreakpoint &sb_bkpt); - bool AppendIfUnique(const SBBreakpoint &sb_file); + bool AppendIfUnique(const SBBreakpoint &sb_bkpt); void AppendByID(lldb::break_id_t id); Modified: lldb/trunk/include/lldb/API/SBProcess.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBProcess.h?rev=308425&r1=308424&r2=308425&view=diff == --- lldb/trunk/include/lldb/API/SBProcess.h (original) +++ lldb/trunk/include/lldb/API/SBProcess.h Wed Jul 19 02:30:04 2017 @@ -350,7 +350,7 @@ public: bool IsInstrumentationRuntimePresent(InstrumentationRuntimeType type); - // Save the state of the process in a core file (or mini dump on Windows). + /// Save the state of the process in a core file (or mini dump on Windows). lldb::SBError SaveCore(const char *file_name); //-- ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35614: Update API headers.
This revision was automatically updated to reflect the committed changes. Closed by commit rL308425: Update API headers. (authored by brucem). Repository: rL LLVM https://reviews.llvm.org/D35614 Files: lldb/trunk/include/lldb/API/SBAttachInfo.h lldb/trunk/include/lldb/API/SBBreakpoint.h lldb/trunk/include/lldb/API/SBProcess.h Index: lldb/trunk/include/lldb/API/SBBreakpoint.h === --- lldb/trunk/include/lldb/API/SBBreakpoint.h +++ lldb/trunk/include/lldb/API/SBBreakpoint.h @@ -154,9 +154,9 @@ SBBreakpoint FindBreakpointByID(lldb::break_id_t); - void Append(const SBBreakpoint &sb_file); + void Append(const SBBreakpoint &sb_bkpt); - bool AppendIfUnique(const SBBreakpoint &sb_file); + bool AppendIfUnique(const SBBreakpoint &sb_bkpt); void AppendByID(lldb::break_id_t id); Index: lldb/trunk/include/lldb/API/SBProcess.h === --- lldb/trunk/include/lldb/API/SBProcess.h +++ lldb/trunk/include/lldb/API/SBProcess.h @@ -350,7 +350,7 @@ bool IsInstrumentationRuntimePresent(InstrumentationRuntimeType type); - // Save the state of the process in a core file (or mini dump on Windows). + /// Save the state of the process in a core file (or mini dump on Windows). lldb::SBError SaveCore(const char *file_name); //-- Index: lldb/trunk/include/lldb/API/SBAttachInfo.h === --- lldb/trunk/include/lldb/API/SBAttachInfo.h +++ lldb/trunk/include/lldb/API/SBAttachInfo.h @@ -162,7 +162,7 @@ /// Get the listener that will be used to receive process events. /// /// If no listener has been set via a call to - /// SBLaunchInfo::SetListener(), then an invalid SBListener will be + /// SBAttachInfo::SetListener(), then an invalid SBListener will be /// returned (SBListener::IsValid() will return false). If a listener /// has been set, then the valid listener object will be returned. //-- Index: lldb/trunk/include/lldb/API/SBBreakpoint.h === --- lldb/trunk/include/lldb/API/SBBreakpoint.h +++ lldb/trunk/include/lldb/API/SBBreakpoint.h @@ -154,9 +154,9 @@ SBBreakpoint FindBreakpointByID(lldb::break_id_t); - void Append(const SBBreakpoint &sb_file); + void Append(const SBBreakpoint &sb_bkpt); - bool AppendIfUnique(const SBBreakpoint &sb_file); + bool AppendIfUnique(const SBBreakpoint &sb_bkpt); void AppendByID(lldb::break_id_t id); Index: lldb/trunk/include/lldb/API/SBProcess.h === --- lldb/trunk/include/lldb/API/SBProcess.h +++ lldb/trunk/include/lldb/API/SBProcess.h @@ -350,7 +350,7 @@ bool IsInstrumentationRuntimePresent(InstrumentationRuntimeType type); - // Save the state of the process in a core file (or mini dump on Windows). + /// Save the state of the process in a core file (or mini dump on Windows). lldb::SBError SaveCore(const char *file_name); //-- Index: lldb/trunk/include/lldb/API/SBAttachInfo.h === --- lldb/trunk/include/lldb/API/SBAttachInfo.h +++ lldb/trunk/include/lldb/API/SBAttachInfo.h @@ -162,7 +162,7 @@ /// Get the listener that will be used to receive process events. /// /// If no listener has been set via a call to - /// SBLaunchInfo::SetListener(), then an invalid SBListener will be + /// SBAttachInfo::SetListener(), then an invalid SBListener will be /// returned (SBListener::IsValid() will return false). If a listener /// has been set, then the valid listener object will be returned. //-- ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r308426 - Fix typos in documentation.
Author: brucem Date: Wed Jul 19 02:35:58 2017 New Revision: 308426 URL: http://llvm.org/viewvc/llvm-project?rev=308426&view=rev Log: Fix typos in documentation. Reviewers: lldb-commits Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31282 Modified: lldb/trunk/scripts/interface/SBBreakpoint.i lldb/trunk/scripts/interface/SBModule.i lldb/trunk/scripts/interface/SBSymbol.i Modified: lldb/trunk/scripts/interface/SBBreakpoint.i URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBBreakpoint.i?rev=308426&r1=308425&r2=308426&view=diff == --- lldb/trunk/scripts/interface/SBBreakpoint.i (original) +++ lldb/trunk/scripts/interface/SBBreakpoint.i Wed Jul 19 02:35:58 2017 @@ -70,7 +70,7 @@ SBBreakpoint supports breakpoint locatio print('breakpoint location load addr: %s' % hex(bl.GetLoadAddress())) print('breakpoint location condition: %s' % hex(bl.GetCondition())) -and rich comparion methods which allow the API program to use, +and rich comparison methods which allow the API program to use, if aBreakpoint == bBreakpoint: ... Modified: lldb/trunk/scripts/interface/SBModule.i URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBModule.i?rev=308426&r1=308425&r2=308426&view=diff == --- lldb/trunk/scripts/interface/SBModule.i (original) +++ lldb/trunk/scripts/interface/SBModule.i Wed Jul 19 02:35:58 2017 @@ -26,7 +26,7 @@ SBModule supports symbol iteration, for saddr = symbol.GetStartAddress() eaddr = symbol.GetEndAddress() -and rich comparion methods which allow the API program to use, +and rich comparison methods which allow the API program to use, if thisModule == thatModule: print('This module is the same as that module') Modified: lldb/trunk/scripts/interface/SBSymbol.i URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBSymbol.i?rev=308426&r1=308425&r2=308426&view=diff == --- lldb/trunk/scripts/interface/SBSymbol.i (original) +++ lldb/trunk/scripts/interface/SBSymbol.i Wed Jul 19 02:35:58 2017 @@ -11,7 +11,7 @@ namespace lldb { %feature("docstring", "Represents the symbol possibly associated with a stack frame. -SBModule contains SBSymbol(s). SBSymbol can also be retrived from SBFrame. +SBModule contains SBSymbol(s). SBSymbol can also be retrieved from SBFrame. See also SBModule and SBFrame." ) SBSymbol; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31282: Fix typos in documentation.
This revision was automatically updated to reflect the committed changes. Closed by commit rL308426: Fix typos in documentation. (authored by brucem). Repository: rL LLVM https://reviews.llvm.org/D31282 Files: lldb/trunk/scripts/interface/SBBreakpoint.i lldb/trunk/scripts/interface/SBModule.i lldb/trunk/scripts/interface/SBSymbol.i Index: lldb/trunk/scripts/interface/SBBreakpoint.i === --- lldb/trunk/scripts/interface/SBBreakpoint.i +++ lldb/trunk/scripts/interface/SBBreakpoint.i @@ -70,7 +70,7 @@ print('breakpoint location load addr: %s' % hex(bl.GetLoadAddress())) print('breakpoint location condition: %s' % hex(bl.GetCondition())) -and rich comparion methods which allow the API program to use, +and rich comparison methods which allow the API program to use, if aBreakpoint == bBreakpoint: ... Index: lldb/trunk/scripts/interface/SBSymbol.i === --- lldb/trunk/scripts/interface/SBSymbol.i +++ lldb/trunk/scripts/interface/SBSymbol.i @@ -11,7 +11,7 @@ %feature("docstring", "Represents the symbol possibly associated with a stack frame. -SBModule contains SBSymbol(s). SBSymbol can also be retrived from SBFrame. +SBModule contains SBSymbol(s). SBSymbol can also be retrieved from SBFrame. See also SBModule and SBFrame." ) SBSymbol; Index: lldb/trunk/scripts/interface/SBModule.i === --- lldb/trunk/scripts/interface/SBModule.i +++ lldb/trunk/scripts/interface/SBModule.i @@ -26,7 +26,7 @@ saddr = symbol.GetStartAddress() eaddr = symbol.GetEndAddress() -and rich comparion methods which allow the API program to use, +and rich comparison methods which allow the API program to use, if thisModule == thatModule: print('This module is the same as that module') Index: lldb/trunk/scripts/interface/SBBreakpoint.i === --- lldb/trunk/scripts/interface/SBBreakpoint.i +++ lldb/trunk/scripts/interface/SBBreakpoint.i @@ -70,7 +70,7 @@ print('breakpoint location load addr: %s' % hex(bl.GetLoadAddress())) print('breakpoint location condition: %s' % hex(bl.GetCondition())) -and rich comparion methods which allow the API program to use, +and rich comparison methods which allow the API program to use, if aBreakpoint == bBreakpoint: ... Index: lldb/trunk/scripts/interface/SBSymbol.i === --- lldb/trunk/scripts/interface/SBSymbol.i +++ lldb/trunk/scripts/interface/SBSymbol.i @@ -11,7 +11,7 @@ %feature("docstring", "Represents the symbol possibly associated with a stack frame. -SBModule contains SBSymbol(s). SBSymbol can also be retrived from SBFrame. +SBModule contains SBSymbol(s). SBSymbol can also be retrieved from SBFrame. See also SBModule and SBFrame." ) SBSymbol; Index: lldb/trunk/scripts/interface/SBModule.i === --- lldb/trunk/scripts/interface/SBModule.i +++ lldb/trunk/scripts/interface/SBModule.i @@ -26,7 +26,7 @@ saddr = symbol.GetStartAddress() eaddr = symbol.GetEndAddress() -and rich comparion methods which allow the API program to use, +and rich comparison methods which allow the API program to use, if thisModule == thatModule: print('This module is the same as that module') ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31283: Expose hit count via SBBreakpointLocation.
brucem updated this revision to Diff 107271. brucem added a comment. Add a test. https://reviews.llvm.org/D31283 Files: include/lldb/API/SBBreakpointLocation.h packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/Makefile packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp scripts/interface/SBBreakpointLocation.i source/API/SBBreakpointLocation.cpp Index: source/API/SBBreakpointLocation.cpp === --- source/API/SBBreakpointLocation.cpp +++ source/API/SBBreakpointLocation.cpp @@ -100,6 +100,16 @@ return false; } +uint32_t SBBreakpointLocation::GetHitCount() { + BreakpointLocationSP loc_sp = GetSP(); + if (loc_sp) { +std::lock_guard guard( +loc_sp->GetTarget().GetAPIMutex()); +return loc_sp->GetHitCount(); + } else +return 0; +} + uint32_t SBBreakpointLocation::GetIgnoreCount() { BreakpointLocationSP loc_sp = GetSP(); if (loc_sp) { Index: scripts/interface/SBBreakpointLocation.i === --- scripts/interface/SBBreakpointLocation.i +++ scripts/interface/SBBreakpointLocation.i @@ -48,6 +48,9 @@ IsEnabled (); uint32_t +GetHitCount (); + +uint32_t GetIgnoreCount (); void Index: packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp === --- /dev/null +++ packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp @@ -0,0 +1,27 @@ +//===-- main.cpp *- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +int a(int val) +{ + return val; // Breakpoint Location 1 +} + +float a(float val) +{ +return val; // Breakpoint Location 2 +} + +int main (int argc, char const *argv[]) +{ +int A1 = a(1); +float A2 = a(2.0f); +float A3 = a(3.0f); + +return 0; +} Index: packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py === --- /dev/null +++ packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py @@ -0,0 +1,107 @@ +""" +Test breakpoint hit count features. +""" + +from __future__ import print_function + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class BreakpointHitCountTestCase(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +@add_test_categories(['pyapi']) +def test_breakpoint_location_hit_count(self): +"""Use Python APIs to check breakpoint hit count.""" +self.build() +self.do_test_breakpoint_location_hit_count() + +def setUp(self): +# Call super's setUp(). +TestBase.setUp(self) +self.a_int_body_line_no = line_number( +'main.cpp', '// Breakpoint Location 1') +self.a_float_body_line_no = line_number( +'main.cpp', '// Breakpoint Location 2') + +def do_test_breakpoint_location_hit_count(self): +"""Use Python APIs to check breakpoint hit count.""" +exe = os.path.join(os.getcwd(), "a.out") + +target = self.dbg.CreateTarget(exe) +self.assertTrue(target, VALID_TARGET) + +# Create a breakpoint in main.cpp by name 'a', +# there should be two locations. +breakpoint = target.BreakpointCreateByName('a', 'a.out') +self.assertTrue(breakpoint and +breakpoint.GetNumLocations() == 2, +VALID_BREAKPOINT) + +# Verify all breakpoint locations are enabled. +location1 = breakpoint.GetLocationAtIndex(0) +self.assertTrue(location1 and +location1.IsEnabled(), +VALID_BREAKPOINT_LOCATION) + +location2 = breakpoint.GetLocationAtIndex(1) +self.assertTrue(location2 and +location2.IsEnabled(), +VALID_BREAKPOINT_LOCATION) + +# 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) + +# Verify 1st breakpoint location is hit. +from lldbsuite.test.lldbutil import get_stopped_thread +thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) +self.assertTrue( +thread.Is
[Lldb-commits] [PATCH] D31283: Expose hit count via SBBreakpointLocation.
brucem added a reviewer: labath. brucem added a comment. Pavel, since Jim was okay with this before apart from it not having a test, want to take a quick look now? Thanks! https://reviews.llvm.org/D31283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31283: Expose hit count via SBBreakpointLocation.
labath accepted this revision. labath added a comment. The test looks well written. I've added a couple of suggestions you can consider including. Comment at: packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py:15 + +mydir = TestBase.compute_mydir(__file__) + You may want to add `NO_DEBUG_INFO_TESTCASE = True` here to turn off magic test duplication. Comment at: packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py:105 +self.assertTrue(location1.GetHitCount() == 1) +self.assertTrue(breakpoint.GetHitCount() == 3) + using `assertEqual` will give more meaningful error messages in case this ever breaks. https://reviews.llvm.org/D31283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35615: Add data formatter for libc++ std::tuple
labath created this revision. Herald added subscribers: mgorny, srhines. Herald added a reviewer: EricWF. https://reviews.llvm.org/D35615 Files: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp source/Plugins/Language/CPlusPlus/CMakeLists.txt source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp source/Plugins/Language/CPlusPlus/LibCxx.h source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp Index: source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp === --- /dev/null +++ source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp @@ -0,0 +1,81 @@ +//===-- LibCxxTuple.cpp -*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +#include "LibCxx.h" +#include "lldb/DataFormatters/FormattersHelpers.h" + +using namespace lldb; +using namespace lldb_private; + +namespace { + +class TupleFrontEnd: public SyntheticChildrenFrontEnd { +public: + TupleFrontEnd(ValueObject &valobj) : SyntheticChildrenFrontEnd(valobj) { +Update(); + } + + size_t GetIndexOfChildWithName(const ConstString &name) override { +return formatters::ExtractIndexFromString(name.GetCString()); + } + + bool MightHaveChildren() override { return true; } + bool Update() override; + size_t CalculateNumChildren() override { return m_elements.size(); } + ValueObjectSP GetChildAtIndex(size_t idx) override; + +private: + size_t GetElementCount(ValueObject &valobj); + + std::vector m_elements; + ValueObjectSP m_base_sp; +}; +} + +bool TupleFrontEnd::Update() { + m_elements.clear(); + m_base_sp = m_backend.GetChildMemberWithName(ConstString("base_"), true); + if (! m_base_sp) +return false; + m_elements.assign(m_base_sp->GetCompilerType().GetNumDirectBaseClasses(), +nullptr); + return false; +} + +ValueObjectSP TupleFrontEnd::GetChildAtIndex(size_t idx) { + if (idx >= m_elements.size()) +return nullptr; + if (!m_base_sp) +return nullptr; + if (m_elements[idx]) +return m_elements[idx]; + + CompilerType holder_type = + m_base_sp->GetCompilerType().GetDirectBaseClassAtIndex(idx, nullptr); + if (!holder_type) +return nullptr; + ValueObjectSP holder_sp = m_base_sp->GetChildAtIndex(idx, true); + if (!holder_sp) +return nullptr; + + ValueObjectSP elem_sp = holder_sp->GetChildAtIndex(0, true); + if (elem_sp) +m_elements[idx] = +elem_sp->Clone(ConstString(llvm::formatv("[{0}]", idx).str())); + + return m_elements[idx]; +} + +SyntheticChildrenFrontEnd * +formatters::LibcxxTupleFrontEndCreator(CXXSyntheticChildren *, + lldb::ValueObjectSP valobj_sp) { + if (valobj_sp) +return new TupleFrontEnd(*valobj_sp); + return nullptr; +} Index: source/Plugins/Language/CPlusPlus/LibCxx.h === --- source/Plugins/Language/CPlusPlus/LibCxx.h +++ source/Plugins/Language/CPlusPlus/LibCxx.h @@ -123,6 +123,9 @@ SyntheticChildrenFrontEnd *LibcxxFunctionFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); +SyntheticChildrenFrontEnd *LibcxxTupleFrontEndCreator(CXXSyntheticChildren *, + lldb::ValueObjectSP); + } // namespace formatters } // namespace lldb_private Index: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp === --- source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -472,6 +472,10 @@ "libc++ std::initializer_list synthetic children", ConstString("^std::initializer_list<.+>(( )?&)?$"), stl_synth_flags, true); + AddCXXSynthetic(cpp_category_sp, LibcxxTupleFrontEndCreator, + "libc++ std::tuple synthetic children", + ConstString("^std::__(ndk)?1::tuple<.*>(( )?&)?$"), stl_synth_flags, + true); AddCXXSynthetic( cpp_category_sp, lldb_private::formatters::LibcxxAtomicSyntheticFrontEndCreator, @@ -545,6 +549,10 @@ "libc++ std::unordered containers summary provider", ConstString("^(std::__(ndk)?1::)unordered_(multi)?(map|set)<.+> >$"), stl_summary_flags, true); + AddCXXSummary(cpp_category_sp, LibcxxContainerSummaryProvider, +"libc++ std::tuple summary provider", +ConstString("^
[Lldb-commits] [PATCH] D35618: Remove shared_pointer from NativeThreadProtocol
labath created this revision. The NativeThread class is useless without the containing process (and in some places it is already assuming the process is always around). This makes it clear that the NativeProcessProtocol is the object owning the threads, and makes the destruction order deterministic (first threads, then process). The NativeProcess is the only thing holding a thread unique_ptr, and methods that used to hand out thread shared pointers now return raw pointers or references. https://reviews.llvm.org/D35618 Files: include/lldb/Host/common/NativeProcessProtocol.h include/lldb/lldb-private-forward.h source/Host/common/NativeProcessProtocol.cpp source/Plugins/Process/Linux/NativeProcessLinux.cpp source/Plugins/Process/Linux/NativeProcessLinux.h source/Plugins/Process/Linux/NativeThreadLinux.h source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp source/Plugins/Process/NetBSD/NativeProcessNetBSD.h source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h === --- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h @@ -234,7 +234,7 @@ void HandleInferiorState_Stopped(NativeProcessProtocol *process); - NativeThreadProtocolSP GetThreadFromSuffix(StringExtractorGDBRemote &packet); + NativeThreadProtocol *GetThreadFromSuffix(StringExtractorGDBRemote &packet); uint32_t GetNextSavedRegistersID(); Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp === --- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -523,16 +523,16 @@ // Ensure we can get info on the given thread. uint32_t thread_idx = 0; - for (NativeThreadProtocolSP thread_sp; - (thread_sp = process.GetThreadAtIndex(thread_idx)) != nullptr; + for (NativeThreadProtocol *thread; + (thread = process.GetThreadAtIndex(thread_idx)) != nullptr; ++thread_idx) { -lldb::tid_t tid = thread_sp->GetID(); +lldb::tid_t tid = thread->GetID(); // Grab the reason this thread stopped. struct ThreadStopInfo tid_stop_info; std::string description; -if (!thread_sp->GetStopReason(tid_stop_info, description)) +if (!thread->GetStopReason(tid_stop_info, description)) return nullptr; const int signum = tid_stop_info.details.signal.signo; @@ -548,15 +548,15 @@ threads_array_sp->AppendObject(thread_obj_sp); if (!abridged) { - if (JSONObject::SP registers_sp = GetRegistersAsJSON(*thread_sp)) + if (JSONObject::SP registers_sp = GetRegistersAsJSON(*thread)) thread_obj_sp->SetObject("registers", registers_sp); } thread_obj_sp->SetObject("tid", std::make_shared(tid)); if (signum != 0) thread_obj_sp->SetObject("signal", std::make_shared(signum)); -const std::string thread_name = thread_sp->GetName(); +const std::string thread_name = thread->GetName(); if (!thread_name.empty()) thread_obj_sp->SetObject("name", std::make_shared(thread_name)); @@ -604,14 +604,14 @@ m_debugged_process_up->GetID(), tid); // Ensure we can get info on the given thread. - NativeThreadProtocolSP thread_sp(m_debugged_process_up->GetThreadByID(tid)); - if (!thread_sp) + NativeThreadProtocol *thread = m_debugged_process_up->GetThreadByID(tid); + if (!thread) return SendErrorResponse(51); // Grab the reason this thread stopped. struct ThreadStopInfo tid_stop_info; std::string description; - if (!thread_sp->GetStopReason(tid_stop_info, description)) + if (!thread->GetStopReason(tid_stop_info, description)) return SendErrorResponse(52); // FIXME implement register handling for exec'd inferiors. @@ -638,7 +638,7 @@ response.Printf("thread:%" PRIx64 ";", tid); // Include the thread name if there is one. - const std::string thread_name = thread_sp->GetName(); + const std::string thread_name = thread->GetName(); if (!thread_name.empty()) { size_t thread_name_len = thread_name.length(); @@ -665,15 +665,13 @@ response.PutCString("threads:"); uint32_t thread_index = 0; -NativeThreadProtocolSP listed_thread_sp; -for (listed_thread_sp = - m_debugged_process_up->GetThreadAtIndex(thread_index); - listed_thread_sp; ++thread_index, -listed_thread_sp = m_debugged_process_up->GetThreadAtIndex( -thread_index)) { +NativeThreadProtocol *listed_thread; +for (listed_thread = m_debugged_process_up->GetThreadAtIndex(thread_index); + listed_thread; ++thread_index, +listed_
[Lldb-commits] [PATCH] D35618: Remove shared_pointer from NativeThreadProtocol
krytarowski added a comment. I don't have particular opinion. This change makes code cleaner. https://reviews.llvm.org/D35618 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31283: Expose hit count via SBBreakpointLocation.
brucem updated this revision to Diff 107297. brucem added a comment. Update per comments. https://reviews.llvm.org/D31283 Files: include/lldb/API/SBBreakpointLocation.h packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/Makefile packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp scripts/interface/SBBreakpointLocation.i source/API/SBBreakpointLocation.cpp Index: source/API/SBBreakpointLocation.cpp === --- source/API/SBBreakpointLocation.cpp +++ source/API/SBBreakpointLocation.cpp @@ -100,6 +100,16 @@ return false; } +uint32_t SBBreakpointLocation::GetHitCount() { + BreakpointLocationSP loc_sp = GetSP(); + if (loc_sp) { +std::lock_guard guard( +loc_sp->GetTarget().GetAPIMutex()); +return loc_sp->GetHitCount(); + } else +return 0; +} + uint32_t SBBreakpointLocation::GetIgnoreCount() { BreakpointLocationSP loc_sp = GetSP(); if (loc_sp) { Index: scripts/interface/SBBreakpointLocation.i === --- scripts/interface/SBBreakpointLocation.i +++ scripts/interface/SBBreakpointLocation.i @@ -48,6 +48,9 @@ IsEnabled (); uint32_t +GetHitCount (); + +uint32_t GetIgnoreCount (); void Index: packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp === --- /dev/null +++ packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp @@ -0,0 +1,27 @@ +//===-- main.cpp *- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +int a(int val) +{ + return val; // Breakpoint Location 1 +} + +float a(float val) +{ +return val; // Breakpoint Location 2 +} + +int main (int argc, char const *argv[]) +{ +int A1 = a(1); +float A2 = a(2.0f); +float A3 = a(3.0f); + +return 0; +} Index: packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py === --- /dev/null +++ packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py @@ -0,0 +1,109 @@ +""" +Test breakpoint hit count features. +""" + +from __future__ import print_function + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class BreakpointHitCountTestCase(TestBase): + +NO_DEBUG_INFO_TESTCASE = True + +mydir = TestBase.compute_mydir(__file__) + +@add_test_categories(['pyapi']) +def test_breakpoint_location_hit_count(self): +"""Use Python APIs to check breakpoint hit count.""" +self.build() +self.do_test_breakpoint_location_hit_count() + +def setUp(self): +# Call super's setUp(). +TestBase.setUp(self) +self.a_int_body_line_no = line_number( +'main.cpp', '// Breakpoint Location 1') +self.a_float_body_line_no = line_number( +'main.cpp', '// Breakpoint Location 2') + +def do_test_breakpoint_location_hit_count(self): +"""Use Python APIs to check breakpoint hit count.""" +exe = os.path.join(os.getcwd(), "a.out") + +target = self.dbg.CreateTarget(exe) +self.assertTrue(target, VALID_TARGET) + +# Create a breakpoint in main.cpp by name 'a', +# there should be two locations. +breakpoint = target.BreakpointCreateByName('a', 'a.out') +self.assertTrue(breakpoint and +breakpoint.GetNumLocations() == 2, +VALID_BREAKPOINT) + +# Verify all breakpoint locations are enabled. +location1 = breakpoint.GetLocationAtIndex(0) +self.assertTrue(location1 and +location1.IsEnabled(), +VALID_BREAKPOINT_LOCATION) + +location2 = breakpoint.GetLocationAtIndex(1) +self.assertTrue(location2 and +location2.IsEnabled(), +VALID_BREAKPOINT_LOCATION) + +# 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) + +# Verify 1st breakpoint location is hit. +from lldbsuite.test.lldbutil import get_stopped_thread +thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) +
[Lldb-commits] [lldb] r308480 - Expose hit count via SBBreakpointLocation.
Author: brucem Date: Wed Jul 19 07:31:19 2017 New Revision: 308480 URL: http://llvm.org/viewvc/llvm-project?rev=308480&view=rev Log: Expose hit count via SBBreakpointLocation. Summary: SBBreakpointLocation exposed the ignore count, but didn't expose the hit count. Both values were exposed by SBBreakpoint and SBWatchpoint, so this makes things a bit more consistent. Reviewers: lldb-commits Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31283 Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp Modified: lldb/trunk/include/lldb/API/SBBreakpointLocation.h lldb/trunk/scripts/interface/SBBreakpointLocation.i lldb/trunk/source/API/SBBreakpointLocation.cpp Modified: lldb/trunk/include/lldb/API/SBBreakpointLocation.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBBreakpointLocation.h?rev=308480&r1=308479&r2=308480&view=diff == --- lldb/trunk/include/lldb/API/SBBreakpointLocation.h (original) +++ lldb/trunk/include/lldb/API/SBBreakpointLocation.h Wed Jul 19 07:31:19 2017 @@ -38,6 +38,8 @@ public: bool IsEnabled(); + uint32_t GetHitCount(); + uint32_t GetIgnoreCount(); void SetIgnoreCount(uint32_t n); Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/Makefile?rev=308480&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/Makefile Wed Jul 19 07:31:19 2017 @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +CXX_SOURCES := main.cpp + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py?rev=308480&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py Wed Jul 19 07:31:19 2017 @@ -0,0 +1,109 @@ +""" +Test breakpoint hit count features. +""" + +from __future__ import print_function + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class BreakpointHitCountTestCase(TestBase): + +NO_DEBUG_INFO_TESTCASE = True + +mydir = TestBase.compute_mydir(__file__) + +@add_test_categories(['pyapi']) +def test_breakpoint_location_hit_count(self): +"""Use Python APIs to check breakpoint hit count.""" +self.build() +self.do_test_breakpoint_location_hit_count() + +def setUp(self): +# Call super's setUp(). +TestBase.setUp(self) +self.a_int_body_line_no = line_number( +'main.cpp', '// Breakpoint Location 1') +self.a_float_body_line_no = line_number( +'main.cpp', '// Breakpoint Location 2') + +def do_test_breakpoint_location_hit_count(self): +"""Use Python APIs to check breakpoint hit count.""" +exe = os.path.join(os.getcwd(), "a.out") + +target = self.dbg.CreateTarget(exe) +self.assertTrue(target, VALID_TARGET) + +# Create a breakpoint in main.cpp by name 'a', +# there should be two locations. +breakpoint = target.BreakpointCreateByName('a', 'a.out') +self.assertTrue(breakpoint and +breakpoint.GetNumLocations() == 2, +VALID_BREAKPOINT) + +# Verify all breakpoint locations are enabled. +location1 = breakpoint.GetLocationAtIndex(0) +self.assertTrue(location1 and +location1.IsEnabled(), +VALID_BREAKPOINT_LOCATION) + +location2 = breakpoint.GetLocationAtIndex(1) +self.assertTrue(location2 and +location2.IsEnabled(), +VALID_BREAKPOINT_LOCATION) + +# Launch the process, and do not stop at entry point. +process = ta
[Lldb-commits] [PATCH] D31283: Expose hit count via SBBreakpointLocation.
This revision was automatically updated to reflect the committed changes. Closed by commit rL308480: Expose hit count via SBBreakpointLocation. (authored by brucem). Repository: rL LLVM https://reviews.llvm.org/D31283 Files: lldb/trunk/include/lldb/API/SBBreakpointLocation.h lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp lldb/trunk/scripts/interface/SBBreakpointLocation.i lldb/trunk/source/API/SBBreakpointLocation.cpp Index: lldb/trunk/include/lldb/API/SBBreakpointLocation.h === --- lldb/trunk/include/lldb/API/SBBreakpointLocation.h +++ lldb/trunk/include/lldb/API/SBBreakpointLocation.h @@ -38,6 +38,8 @@ bool IsEnabled(); + uint32_t GetHitCount(); + uint32_t GetIgnoreCount(); void SetIgnoreCount(uint32_t n); Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp === --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp @@ -0,0 +1,27 @@ +//===-- main.cpp *- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +int a(int val) +{ + return val; // Breakpoint Location 1 +} + +float a(float val) +{ +return val; // Breakpoint Location 2 +} + +int main (int argc, char const *argv[]) +{ +int A1 = a(1); +float A2 = a(2.0f); +float A3 = a(3.0f); + +return 0; +} Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py === --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py @@ -0,0 +1,109 @@ +""" +Test breakpoint hit count features. +""" + +from __future__ import print_function + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class BreakpointHitCountTestCase(TestBase): + +NO_DEBUG_INFO_TESTCASE = True + +mydir = TestBase.compute_mydir(__file__) + +@add_test_categories(['pyapi']) +def test_breakpoint_location_hit_count(self): +"""Use Python APIs to check breakpoint hit count.""" +self.build() +self.do_test_breakpoint_location_hit_count() + +def setUp(self): +# Call super's setUp(). +TestBase.setUp(self) +self.a_int_body_line_no = line_number( +'main.cpp', '// Breakpoint Location 1') +self.a_float_body_line_no = line_number( +'main.cpp', '// Breakpoint Location 2') + +def do_test_breakpoint_location_hit_count(self): +"""Use Python APIs to check breakpoint hit count.""" +exe = os.path.join(os.getcwd(), "a.out") + +target = self.dbg.CreateTarget(exe) +self.assertTrue(target, VALID_TARGET) + +# Create a breakpoint in main.cpp by name 'a', +# there should be two locations. +breakpoint = target.BreakpointCreateByName('a', 'a.out') +self.assertTrue(breakpoint and +breakpoint.GetNumLocations() == 2, +VALID_BREAKPOINT) + +# Verify all breakpoint locations are enabled. +location1 = breakpoint.GetLocationAtIndex(0) +self.assertTrue(location1 and +location1.IsEnabled(), +VALID_BREAKPOINT_LOCATION) + +location2 = breakpoint.GetLocationAtIndex(1) +self.assertTrue(location2 and +location2.IsEnabled(), +VALID_BREAKPOINT_LOCATION) + +# 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) + +# Verify 1st breakpoint location is hit. +from lldbsuite.test.lldbutil import get_stopped_thread +thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) +self.assertTrue( +thread.IsValid(), +"There should be a thread stopped due to breakpoint") + +frame0 = th
[Lldb-commits] [PATCH] D35607: Extend 'target symbols add' to load symbols from a given file by UUID.
labath added a comment. Btw, will this work correctly if we are cross-debugging from a mac? (because then we will use the fancy DownloadObjectAndSymbolFile implementation) https://reviews.llvm.org/D35607 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35311: lldb-server tests: Add support for testing debugserver
labath added a comment. @beanz: It looks like you're doing some debugserver work. :) Any thoughts on this? https://reviews.llvm.org/D35311 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r308489 - silence a couple of -Wqual-cast warning from GCC (NFC)
Author: compnerd Date: Wed Jul 19 08:46:21 2017 New Revision: 308489 URL: http://llvm.org/viewvc/llvm-project?rev=308489&view=rev Log: silence a couple of -Wqual-cast warning from GCC (NFC) Cast to `const uint8_t *` instead of `uint8_t *` to avoid the warning from GCC. EmulationStateARM.cpp:206:34: warning: cast from type 'const void*' to type 'uint8_t* {aka unsigned char*}' casts away qualifiers [-Wcast-qual] Cast to `const uint32_t *` and the explicitly cast away the const-ness of the value. This seems pretty sketchy as the `DataExtractor` holds a const reference to the data. However, this is no worse than before. ObjectFilePECOFF.cpp:540:78: warning: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'uint32_t* {aka unsigned int*}' casts away qualifiers [-Wcast-qual] Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp?rev=308489&r1=308488&r2=308489&view=diff == --- lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp Wed Jul 19 08:46:21 2017 @@ -203,7 +203,8 @@ size_t EmulationStateARM::WritePseudoMem uint32_t value1; uint32_t value2; memcpy (&value1, dst, sizeof (uint32_t)); -memcpy (&value2, (uint8_t *) dst + sizeof (uint32_t), sizeof (uint32_t)); +memcpy(&value2, static_cast(dst) + sizeof(uint32_t), + sizeof(uint32_t)); if (endian::InlHostByteOrder() == lldb::eByteOrderBig) { value1 = llvm::ByteSwap_32(value1); value2 = llvm::ByteSwap_32(value2); Modified: lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp?rev=308489&r1=308488&r2=308489&view=diff == --- lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp (original) +++ lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Wed Jul 19 08:46:21 2017 @@ -537,7 +537,8 @@ Symtab *ObjectFilePECOFF::GetSymtab() { // First 4 bytes should be zeroed after strtab_size has been read, // because it is used as offset 0 to encode a NULL string. - uint32_t *strtab_data_start = (uint32_t *)strtab_data.GetDataStart(); + uint32_t *strtab_data_start = const_cast( + reinterpret_cast(strtab_data.GetDataStart())); strtab_data_start[0] = 0; offset = 0; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35607: Extend 'target symbols add' to load symbols from a given file by UUID.
eugene added a comment. In https://reviews.llvm.org/D35607#814560, @labath wrote: > Btw, will this work correctly if we are cross-debugging from a mac? (because > then we will use the fancy DownloadObjectAndSymbolFile implementation) Yeah, you're right. I'll move this logic to the CommandObjectTarget.cpp itself. https://reviews.llvm.org/D35607 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D33213: Use socketpair on all Unix platforms
clayborg added a comment. I am not sure how you expect to submit any patches then. Patches must be tested prior to submission. https://reviews.llvm.org/D33213 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35607: Extend 'target symbols add' to load symbols from a given file by UUID.
jingham requested changes to this revision. jingham added a comment. This revision now requires changes to proceed. This seems like an okay change. You want to make sure that passing the file name and UUID into AddModuleSymbols doesn't override a UUID mismatch against the symbol file however you find it. It looks like that function does the right thing, but can you add a test for this? You also need to fix up the error messages (around line 4270.) At present they assume that the uuid & file option's are mutually exclusive. It's disconcerting to specify two things and have the error mention only one. This is more Greg's area than mine, so he should also give it the okay. https://reviews.llvm.org/D35607 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35311: lldb-server tests: Add support for testing debugserver
jingham added a comment. This isn't about this patch, but replying to: > debugserver replies to the k packet instead of just dropping the connection - > stopping code adjusted, although we should probably consider aligning the > behavior of the two stubs in this case Especially when dealing with flakey connections, knowing that you are done with a target was really handy. People what to hit "rerun" in some UI and have the rerun happen instantly, but if you have no way of knowing when the former process actually died, you have to introduce delays, which slows this down. This is particularly true when talking to an OS that really wants only one copy of an "app" running at a time (e.g. iOS) but is more generally useful for responsiveness. And if something goes wrong with killing the target, we could even use the new error reply strings to give more info about this. https://reviews.llvm.org/D35311 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r308509 - Fix GreenDragon bots
Author: cbieneman Date: Wed Jul 19 11:57:16 2017 New Revision: 308509 URL: http://llvm.org/viewvc/llvm-project?rev=308509&view=rev Log: Fix GreenDragon bots This commit removes a very old deprecated API that was causing compile failures for LLDB on Darwin. Since the comment says we only needed to keep the old API around for a few Xcode builds, and the comment was written 6 years ago... I think this can safely go away. Failure URL: http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/29936/console Modified: lldb/trunk/include/lldb/API/SBTarget.h lldb/trunk/source/API/SBTarget.cpp Modified: lldb/trunk/include/lldb/API/SBTarget.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=308509&r1=308508&r2=308509&view=diff == --- lldb/trunk/include/lldb/API/SBTarget.h (original) +++ lldb/trunk/include/lldb/API/SBTarget.h Wed Jul 19 11:57:16 2017 @@ -218,14 +218,6 @@ public: lldb::SBProcess AttachToProcessWithID(SBListener &listener, lldb::pid_t pid, lldb::SBError &error); -#if defined(__APPLE__) - // We need to keep this around for a build or two since Xcode links - // to the 32 bit version of this function. We will take it out soon. - lldb::SBProcess AttachToProcessWithID(SBListener &listener, -::pid_t pid, // 32 bit int process ID -lldb::SBError &error); // DEPRECATED -#endif - //-- /// Attach to process with name. /// Modified: lldb/trunk/source/API/SBTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=308509&r1=308508&r2=308509&view=diff == --- lldb/trunk/source/API/SBTarget.cpp (original) +++ lldb/trunk/source/API/SBTarget.cpp Wed Jul 19 11:57:16 2017 @@ -414,16 +414,6 @@ lldb::SBProcess SBTarget::Attach(SBAttac return sb_process; } -#if defined(__APPLE__) - -lldb::SBProcess SBTarget::AttachToProcessWithID(SBListener &listener, -::pid_t pid, -lldb::SBError &error) { - return AttachToProcessWithID(listener, (lldb::pid_t)pid, error); -} - -#endif // #if defined(__APPLE__) - lldb::SBProcess SBTarget::AttachToProcessWithID( SBListener &listener, lldb::pid_t pid, // The process ID to attach to ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35607: Extend 'target symbols add' to load symbols from a given file by UUID.
clayborg requested changes to this revision. clayborg added a comment. So we should just make sure this works: (lldb) target symbols add --shlib a.out debug_binaries/a.out The --uuid option is there to help you match up without having to specify the file path. If I am understanding correctly, "a.out" has no UUID or build ID, but "debug_binaries/a.out" does? In that case, there is no need to specify the --uuid option. If the UUID do match, then you could just do: (lldb) target symbols add debug_binaries/a.out It would extract the UUID from "debug_binaries/a.out" and then match it to the file. So the "--shlib" option is there to point you in the right direction. When the UUIDs don't match, we should make sure that "target symbols add --shlib a.out debug_binaries/a.out" by recognizing that "a.out" doesn't have a valid UUID so the UUID doesn't need to match in order for "debug_binaries/a.out" to be an acceptable match for it as a symbol file. This might make some of the changes above go away and move them to the ModuleSpec matching code. https://reviews.llvm.org/D35607 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r308549 - Add help text for "expression" telling how to enter multi-line mode.
Author: jingham Date: Wed Jul 19 16:25:42 2017 New Revision: 308549 URL: http://llvm.org/viewvc/llvm-project?rev=308549&view=rev Log: Add help text for "expression" telling how to enter multi-line mode. This seemed natural to us, but wasn't documented anywhere and was not clear to everybody. Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=308549&r1=308548&r2=308549&view=diff == --- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Wed Jul 19 16:25:42 2017 @@ -228,6 +228,16 @@ CommandObjectExpression::CommandObjectEx m_command_options(), m_expr_line_count(0), m_expr_lines() { SetHelpLong( R"( +Single and multi-line expressions: + +)" + "The expression provided on the command line must be a complete expression \ +with no newlines. To evaluate a multi-line expression, \ +hit a return after an empty expression, and lldb will enter the multi-line expression editor. \ +Hit return on an empty line to end the multi-line expression." + + R"( + Timeouts: )" @@ -256,6 +266,7 @@ from the stack with \"thread return -x\" you can issue the \"continue\" command and the expression evaluation will complete and the \ expression result will be available using the \"thread.completed-expression\" key in the thread \ format." + R"( Examples: ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits