summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-03-15 09:53:10 +0000
committerPavel Labath <labath@google.com>2017-03-15 09:53:10 +0000
commitbf37a037d035d0a2e85ce5fff22214d67fd9973d (patch)
tree47dcf53aa33edf94f32345cd31dd21192eddce8f /lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options
parentae455c562da7d859f37337aa2a1eb1390e9f137b (diff)
downloadbcm5719-llvm-bf37a037d035d0a2e85ce5fff22214d67fd9973d.tar.gz
bcm5719-llvm-bf37a037d035d0a2e85ce5fff22214d67fd9973d.zip
BreakpointResolverFileLine: Restrict move-to-nearest-code from moving across function boundaries
Summary: This fixes the case where a user tries to set a breakpoint on a source line outside of any function (e.g. because that code is #ifdefed out, or the compiler did not emit code for the function, etc.) and we would silently move the breakpoint to the next function. Now we check whether the line range of the resolved symbol context function matches the original line number. We reject any breakpoint locations that appear to move the breakpoint into a new function. This filtering only happens if we have full debug info available (e.g. in case of -gline-tables-only compilation, we still set the breakpoint on the nearest source line). Reviewers: jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30817 llvm-svn: 297817
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py10
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/main.cpp6
2 files changed, 1 insertions, 15 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
index c0c2267a836..871363b7aed 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
@@ -45,14 +45,6 @@ class BreakpointOptionsTestCase(TestBase):
extra_options="-K 0",
num_expected_locations=1)
- # This should create a breakpoint 0 locations.
- lldbutil.run_break_set_by_file_and_line(
- self,
- "main.cpp",
- self.line,
- extra_options="-m 0",
- num_expected_locations=0)
-
# Run the program.
self.runCmd("run", RUN_SUCCEEDED)
@@ -68,8 +60,6 @@ class BreakpointOptionsTestCase(TestBase):
"1: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" %
self.line,
"2: file = 'main.cpp', line = %d, exact_match = 0, locations = 1" %
- self.line,
- "3: file = 'main.cpp', line = %d, exact_match = 1, locations = 0" %
self.line])
# Continue the program, there should be another stop.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/main.cpp
index 363b90003d7..b2e8f523c84 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/main.cpp
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/main.cpp
@@ -1,8 +1,4 @@
-// Set break point at this line.
-
extern "C" int foo(void);
-int
-main (int argc, char **argv)
-{
+int main (int argc, char **argv) { // Set break point at this line.
return foo();
}
OpenPOWER on IntegriCloud