-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Fix a thinko in the CallSite handling code: #114896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
lldb/test/API/functionalities/breakpoint/same_cu_name/Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
CXX_SOURCES := main.cpp | ||
LD_EXTRAS := ns1.o ns2.o ns3.o ns4.o | ||
|
||
a.out: main.o ns1.o ns2.o ns3.o ns4.o | ||
|
||
ns1.o: common.cpp | ||
$(CC) -g -c -DNAMESPACE=ns1 -o $@ $< | ||
|
||
ns2.o: common.cpp | ||
$(CC) -g -c -DNAMESPACE=ns2 -o $@ $< | ||
|
||
ns3.o: common.cpp | ||
$(CC) -g -c -DNAMESPACE=ns3 -o $@ $< | ||
|
||
ns4.o: common.cpp | ||
$(CC) -g -c -DNAMESPACE=ns4 -o $@ $< | ||
|
||
|
||
include Makefile.rules |
32 changes: 32 additions & 0 deletions
32
lldb/test/API/functionalities/breakpoint/same_cu_name/TestFileBreakpoinsSameCUName.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
Test setting a breakpoint by file and line when many instances of the | ||
same file name exist in the CU list. | ||
""" | ||
|
||
|
||
import lldb | ||
from lldbsuite.test.decorators import * | ||
from lldbsuite.test.lldbtest import * | ||
from lldbsuite.test import lldbutil | ||
|
||
|
||
class TestBreakpointSameCU(TestBase): | ||
def test_breakpoint_same_cu(self): | ||
self.build() | ||
target = self.createTestTarget() | ||
|
||
# Break both on the line before the code: | ||
comment_line = line_number("common.cpp", "// A comment here") | ||
self.assertNotEqual(comment_line, 0, "line_number worked") | ||
bkpt = target.BreakpointCreateByLocation("common.cpp", comment_line) | ||
self.assertEqual( | ||
bkpt.GetNumLocations(), 4, "Got the right number of breakpoints" | ||
) | ||
|
||
# And break on the code, both should work: | ||
code_line = line_number("common.cpp", "// The line with code") | ||
self.assertNotEqual(comment_line, 0, "line_number worked again") | ||
bkpt = target.BreakpointCreateByLocation("common.cpp", code_line) | ||
self.assertEqual( | ||
bkpt.GetNumLocations(), 4, "Got the right number of breakpoints" | ||
) |
8 changes: 8 additions & 0 deletions
8
lldb/test/API/functionalities/breakpoint/same_cu_name/common.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace NAMESPACE { | ||
static int g_value = 0; | ||
void DoSomeStuff() { | ||
// A comment here | ||
g_value++; // The line with code | ||
} | ||
|
||
} // namespace NAMESPACE |
24 changes: 24 additions & 0 deletions
24
lldb/test/API/functionalities/breakpoint/same_cu_name/main.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace ns1 { | ||
extern void DoSomeStuff(); | ||
} | ||
|
||
namespace ns2 { | ||
extern void DoSomeStuff(); | ||
} | ||
|
||
namespace ns3 { | ||
extern void DoSomeStuff(); | ||
} | ||
|
||
namespace ns4 { | ||
extern void DoSomeStuff(); | ||
} | ||
|
||
int main(int argc, char *argv[]) { | ||
ns1::DoSomeStuff(); | ||
ns2::DoSomeStuff(); | ||
ns3::DoSomeStuff(); | ||
ns4::DoSomeStuff(); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: inconsistent indentation.