[Lldb-commits] [PATCH] D136209: [LLDB][NativePDB] Fix parameter size for member functions LF_MFUNCTION

Zequan Wu via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 24 11:01:59 PDT 2022


zequanwu added a comment.

In D136209#3878821 <https://reviews.llvm.org/D136209#3878821>, @labath wrote:

> So if I understand correctly, when we deserialize incorrectly, this causes us to misclassify some function parameters (arguments) as local variables. Is that correct? If yes, then that is something that can be checked. Even if the misclassified variables behave perfectly, their kind is still visible, e.g. in the output of "frame variable --scope".

It's the opposite. Some non parameters local variables are misclassified as parameters, since deserialized parameter count is incorrect/larger. Those misclassified local variables will have the parameter bit set. See the inline comment for detail.

Or maybe we should just rely on individual variable's debug info to determine if a local var is parameter or not, not the parameter count found in function debug info.



================
Comment at: lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp:1825
 
   is_param |= var_info.is_param;
   ValueType var_scope =
----------------
Because we also check individual variable's debug info kind (parameter or not), if the deserialized parameter count number is smaller than actual number, this would fix it. So, it only causes problem when the deserialized result is larger which causes non-parameter local variables count as parameters.

The reason for this check, I vaguely remember, is that some function debug info has missing parameter count (e.g. 0), but the individual variable debug info says it's a parameter.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136209/new/

https://reviews.llvm.org/D136209



More information about the lldb-commits mailing list