diff options
author | Pavel Labath <labath@google.com> | 2017-03-15 09:53:10 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-03-15 09:53:10 +0000 |
commit | bf37a037d035d0a2e85ce5fff22214d67fd9973d (patch) | |
tree | 47dcf53aa33edf94f32345cd31dd21192eddce8f /lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/main.cpp | |
parent | ae455c562da7d859f37337aa2a1eb1390e9f137b (diff) | |
download | bcm5719-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/tools/lldb-mi/breakpoint/main.cpp')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/main.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/main.cpp b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/main.cpp index 9416a0d01c7..366c53c3143 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/main.cpp @@ -15,13 +15,16 @@ namespace ns int foo2(void) { printf("In foo2\n"); return 2; } } -// BP_before_main - int x; -int -main(int argc, char const *argv[]) -{ +int main(int argc, char const *argv[]) { // BP_main_decl printf("Print a formatted string so that GCC does not optimize this printf call: %s\n", argv[0]); + // This is a long comment with no code inside + // This is a long comment with no code inside + // This is a long comment with no code inside + // BP_in_main + // This is a long comment with no code inside + // This is a long comment with no code inside + // This is a long comment with no code inside x = ns::foo1() + ns::foo2(); return 0; // BP_return } |