[Lldb-commits] [PATCH] D65414: Fix ClangASTContext::CreateParameterDeclaration to not call addDecl

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 29 13:09:45 PDT 2019


shafik created this revision.
shafik added reviewers: jingham, aprantl, clayborg, teemperor, davide.

The change D55575 <https://reviews.llvm.org/D55575> modified `ClangASTContext::CreateParameterDeclaration` to call `decl_ctx->addDecl(decl);` this caused a regression since the existing code in `DWARFASTParserClang::ParseChildParameters` is called with the containing `DeclContext`:

  m_ast.CreateParameterDeclaration(containing_decl_ctx, name,
                                   type->GetForwardCompilerType(),
                                   storage);

So when end up with cases where we are parsing a parameter for a member function and the parameter is added to the `CXXRecordDecl` as opposed to the `CXXMethodDecl`. This example is given in the regression test  `TestBreakpointInMemberFuncWNonPrimitiveParams.py` which without this fix in a modules build leads to assert on setting a breakpoint in a member function with non primitive parameters. This scenario would be common when debugging LLDB or clang.

This leaves a the existing issue which D55571 <https://reviews.llvm.org/D55571> tried to fix but apparently did not fix the issue or at least not totally, since there are no tests added with the PR it is hard to tell.


https://reviews.llvm.org/D65414

Files:
  packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/Makefile
  packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/TestBreakpointInMemberFuncWNonPrimitiveParams.py
  packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.cpp
  packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.h
  packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/main.cpp
  packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/module.modulemap
  source/Symbol/ClangASTContext.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65414.212212.patch
Type: text/x-patch
Size: 3969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190729/c1c26c59/attachment-0001.bin>


More information about the lldb-commits mailing list