Skip to content

[cherry-pick][stable/20220421] [lldb][Breakpoint] Fix setting breakpoints on templates by basename #5459

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

Conversation

Michael137
Copy link

This patch fixes a regression with setting breakpoints on template functions by name. E.g.,:

$ cat main.cpp
template<typename T>
struct Foo {
  template<typename U>
  void func() {}
};

int main() {
  Foo<int> f;
  f.func<double>();
}

(lldb) br se -n func

This has regressed since 3339000e0bda696c2e29173d15958c0a4978a143 where we started using the CPlusPlusNameParser for getting the basename of the function symbol and match it exactly against the name in the breakpoint command. The parser will include template parameters in the basename, so the exact match will always fail

Testing

  • Added API tests
  • Added unit-tests

Differential Revision: https://reviews.llvm.org/D135921

(cherry picked from commit d4a55ad)

@Michael137
Copy link
Author

@swift-ci test

1 similar comment
@Michael137
Copy link
Author

@swift-ci test

This patch fixes a regression with setting breakpoints on template
functions by name. E.g.,:
```
$ cat main.cpp
template<typename T>
struct Foo {
  template<typename U>
  void func() {}
};

int main() {
  Foo<int> f;
  f.func<double>();
}

(lldb) br se -n func
```

This has regressed since `3339000e0bda696c2e29173d15958c0a4978a143`
where we started using the `CPlusPlusNameParser` for getting the
basename of the function symbol and match it exactly against
the name in the breakpoint command. The parser will include template
parameters in the basename, so the exact match will always fail

**Testing**

* Added API tests
* Added unit-tests

Differential Revision: https://reviews.llvm.org/D135921

(cherry picked from commit d4a55ad)
@Michael137 Michael137 force-pushed the bugfix/break-on-templates-by-basename-to-20220421 branch from a6d1168 to 30f4901 Compare November 4, 2022 15:57
@Michael137
Copy link
Author

@swift-ci test

@Michael137 Michael137 merged commit 99679a1 into swiftlang:stable/20220421 Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant