[Lldb-commits] [lldb] r367441 - Don't crash when pass by value struct has no definition.

Saleem Abdulrasool via lldb-commits lldb-commits at lists.llvm.org
Sun Aug 4 11:28:50 PDT 2019


On Wed, Jul 31, 2019 at 11:29 AM Greg Clayton via lldb-commits <
lldb-commits at lists.llvm.org> wrote:

>
>
> > On Jul 31, 2019, at 10:57 AM, Raphael Isemann <teemperor at gmail.com>
> wrote:
> >
> > It seems that patch is lacking a test (which doesn't seem too hard to
> provide).
>
> I am not the original author of this patch that was causing the crash,
> just fixing a crash that was introduced by the patch.
>

Perhaps we should identify the original change and revert that instead?


> I am all ears for anyone that can provide me with DWARF to help reproduce
> this scenario where we have a DW_CC_pass_by_value struct with no
> definition. Not sure how you would have a compiler that is passing a struct
> to a function as a parameter and yet does not emit debug info for that
> struct it is clearly using in the debug info.
>

Was this something that you noticed by inspection?  It doesn't sound like
it, so we should be able to reduce something from what caused it to be
triggered.  lldb has been better about adding test coverage, and I think
that we should be encouraging that.  It really does help make it easier to
make changes to the project where we can be sure that we don't cause
regressions.


>
> >
> > Am Mi., 31. Juli 2019 um 18:24 Uhr schrieb Greg Clayton via
> > lldb-commits <lldb-commits at lists.llvm.org>:
> >>
> >> Author: gclayton
> >> Date: Wed Jul 31 09:24:55 2019
> >> New Revision: 367441
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=367441&view=rev
> >> Log:
> >> Don't crash when pass by value struct has no definition.
> >>
> >>
> >> Modified:
> >>    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
> >>
> >> Modified:
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
> >> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=367441&r1=367440&r2=367441&view=diff
> >>
> ==============================================================================
> >> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
> (original)
> >> +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
> Wed Jul 31 09:24:55 2019
> >> @@ -1010,7 +1010,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
> >>     if (attrs.calling_convention == llvm::dwarf::DW_CC_pass_by_value) {
> >>       clang::CXXRecordDecl *record_decl =
> >>           m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
> >> -      if (record_decl) {
> >> +      if (record_decl && record_decl->getDefinition()) {
> >>         record_decl->setHasTrivialSpecialMemberForCall();
> >>       }
> >>     }
> >>
> >>
> >> _______________________________________________
> >> lldb-commits mailing list
> >> lldb-commits at lists.llvm.org
> >> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190804/73118bb4/attachment.html>


More information about the lldb-commits mailing list