Skip to content

[lldb] Fix that C++ base name is only calculated when Swift plugin is… #1940

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

Conversation

Teemperor
Copy link

… enabled

In 41c6ab2 I put the C++ GetBasename() call
in Module::LookupInfo behind the LLDB_ENABLE_SWIFT as it appeard to be
introduced by a downstream Swift change. However our downstream change
actually changed

  basename = cpp_method.GetBasename();

into

  if (swift)
    /*swift stuff*/
  else if (c++)
    basename = cpp_method.GetBasename();

By putting both if and the else behind LLDB_ENABLE_SWIFT this actually broke
LLDB's ability to set C++ breakpoints by function name when LLDB_ENABLE_SWIFT
wasn't set (which in turn broke the TestCPPBreakpointLocations test).

This patch moves #ifdef LLDB_ENABLE_SWIFT only around the Swift-specific
part and leaves the basename calculation enabled independently of Swift.

I also removed the unnecessary else as we can't have a method that has
both a language value of Swift and C++, so those branches are anyway mutually
exlusive and comparing the language enum value is cheap.

(cherry picked from commit c24d7bf)

… enabled

In 41c6ab2 I put the C++ GetBasename() call
in Module::LookupInfo behind the LLDB_ENABLE_SWIFT as it appeard to be
introduced by a downstream Swift change. However our downstream change
actually changed
```
  basename = cpp_method.GetBasename();
```
into
```
  if (swift)
    /*swift stuff*/
  else if (c++)
    basename = cpp_method.GetBasename();
```

By putting both if and the else behind LLDB_ENABLE_SWIFT this actually broke
LLDB's ability to set C++ breakpoints by function name when LLDB_ENABLE_SWIFT
wasn't set (which in turn broke the TestCPPBreakpointLocations test).

This patch moves `#ifdef LLDB_ENABLE_SWIFT` only around the Swift-specific
part and leaves the basename calculation enabled independently of Swift.

I also removed the unnecessary `else` as we can't have a method that has
both a language value of Swift and C++, so those branches are anyway mutually
exlusive and comparing the `language` enum value is cheap.

(cherry picked from commit c24d7bf)
@Teemperor Teemperor merged commit 5a73d02 into swiftlang:swift/next Oct 12, 2020
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