[all-commits] [llvm/llvm-project] d4a55a: [lldb][Breakpoint] Fix setting breakpoints on temp...

Michael137 via All-commits all-commits at lists.llvm.org
Fri Oct 14 15:51:38 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d4a55ad346514b2478762cbc198942c72347e81e
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2022-10-14 (Fri, 14 Oct 2022)

  Changed paths:
    M lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
    M lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
    M lldb/test/API/functionalities/breakpoint/cpp/Makefile
    M lldb/test/API/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
    M lldb/test/API/functionalities/breakpoint/cpp/main.cpp
    M lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

  Log Message:
  [lldb][Breakpoint] Fix setting breakpoints on templates by basename

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;

(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


* Added API tests
* Added unit-tests

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

More information about the All-commits mailing list