This is an archive of the discontinued LLVM Phabricator instance.

Add synchronization to TestWatchLocation.
ClosedPublic

Authored by chaoren on Feb 26 2015, 11:52 AM.

Details

Summary

There was no guarantee that the three threads haven't already exited by the
time the watchpoint is set.

Diff Detail

Repository
rL LLVM

Event Timeline

chaoren updated this revision to Diff 20786.Feb 26 2015, 11:52 AM
chaoren retitled this revision from to Add synchronization to TestWatchLocation..
chaoren updated this object.
chaoren edited the test plan for this revision. (Show Details)
chaoren added a reviewer: ovyalov.
chaoren added a subscriber: Unknown Object (MLST).
ovyalov edited edge metadata.Feb 26 2015, 12:16 PM

Please see my comments.

test/functionalities/watchpoint/hello_watchlocation/main.cpp
20 ↗(On Diff #20786)

Please follow the existing naming convention here - g_barrier ?

85 ↗(On Diff #20786)

My understanding the watchpoint is set for g_char_ptr variable but I don't see any command to set watchpoint - is watchpoint here set implicitly by lldb?

85 ↗(On Diff #20786)

Very minor unrelated thing - do we need to free this memory?

chaoren updated this revision to Diff 20789.Feb 26 2015, 12:32 PM
chaoren edited edge metadata.

Fix memory leak.

chaoren added inline comments.Feb 26 2015, 12:33 PM
test/functionalities/watchpoint/hello_watchlocation/main.cpp
85 ↗(On Diff #20786)

TestWatchLocation.py breaks on the printf and does "watchpoint set expression -w write -x 1 -- g_char_ptr".

85 ↗(On Diff #20786)

Yeah, there's a memory leak. I'll fix that too.

ovyalov accepted this revision.Feb 26 2015, 1:29 PM
ovyalov edited edge metadata.

Looks good.

test/functionalities/watchpoint/hello_watchlocation/main.cpp
21 ↗(On Diff #20789)

Please rename to g_barrier before submitting.

This revision is now accepted and ready to land.Feb 26 2015, 1:29 PM
This revision was automatically updated to reflect the committed changes.