[LLDB][NativePDB] Fix parameter size for member functions LF_MFUNCTION
authorZequan Wu <zequanwu@google.com>
Tue, 18 Oct 2022 22:58:07 +0000 (15:58 -0700)
committerZequan Wu <zequanwu@google.com>
Thu, 27 Oct 2022 23:36:05 +0000 (16:36 -0700)
commit3b0f38bb5186cdda52ab38b13965678036aba22c
treec2d6e0e8738091cc32d3fb50fea9037be3386549
parent2ec51f1c753a63c786805708eb7875086cc5da9d
[LLDB][NativePDB] Fix parameter size for member functions LF_MFUNCTION

Fix the problem that it was treating member functions as non-member functions
when trying to get the parameter size. This causes some non-parameter variables
showing up in function signature. Suprisingly,
`cantFail(TypeDeserializer::deserializeAs<ProcedureRecord>(...))` just sliently
parse it without error and gave the wrong result.

It's hard to test it. This only causes problem when `params_remaining`
is larger than the real parameter size. If it's smaller, we also check
individual local variable's attribute to see it's a parameter. When I trying to
come up with a test, the parameter size is always 0 if we parse LF_MFUNCTION as
LF_PROCEDURE.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D136209
lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp