This is an archive of the discontinued LLVM Phabricator instance.

Expose hit count via SBBreakpointLocation.
ClosedPublic

Authored by brucem on Mar 23 2017, 6:41 AM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

brucem created this revision.Mar 23 2017, 6:41 AM
jingham requested changes to this revision.Mar 23 2017, 10:17 AM
jingham added a subscriber: jingham.

If you are exposing this, could you write a test to make sure it stays correct? I added a sample test that you can easily copy and modify in:

packages/Python/lldbsuite/test/sample_test

The TestSampleTest.py test makes the binary, loads it into lldb and runs to a breakpoint. So it should be trivial to just check the location and make sure it is correct. Maybe drive around a little more and make sure it updates...

The breakpoint tests go in functionalities/breakpoints. Don't forget to reset the "LEVEL" variable in the Makefile to track the test location.

This revision now requires changes to proceed.Mar 23 2017, 10:17 AM

BTW, other than the lack of a test, this is fine.

brucem updated this revision to Diff 107271.Jul 19 2017, 2:59 AM
brucem edited edge metadata.

Add a test.

Pavel, since Jim was okay with this before apart from it not having a test, want to take a quick look now? Thanks!

labath accepted this revision.Jul 19 2017, 3:35 AM

The test looks well written. I've added a couple of suggestions you can consider including.

packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
15 ↗(On Diff #107271)

You may want to add NO_DEBUG_INFO_TESTCASE = True here to turn off magic test duplication.

105 ↗(On Diff #107271)

using assertEqual will give more meaningful error messages in case this ever breaks.

brucem updated this revision to Diff 107297.Jul 19 2017, 7:16 AM

Update per comments.

brucem marked 2 inline comments as done.Jul 19 2017, 7:17 AM
This revision was automatically updated to reflect the committed changes.