labath added a comment.

Here's one more question. AIUI, lldb relies on the order of formal parameter 
declarations in dwarf to establish the the function signature (dwarf doesn't 
leave us much choice. This then affects how the function is printed in the 
backtrace, for instance. What will be the resulting order of arguments for 
these functions? I'm wondering if we don't need a two-pass algorithm, which 
first parses the arguments in the function declaration (to establish their 
order), and then do another pass over the concrete instance to fill in the 
missing information. (I'm sorry if you're doing this already, but I'm still too 
scared of the code to figure it out myself :P ).

In D110571#3031140 <https://reviews.llvm.org/D110571#3031140>, @jarin wrote:

> I have also packaged the C test, but as Greg notes I am not convinced it will 
> keep testing what it's supposed to.

Given that we have targeted asm tests, I am not particularly worried about 
that. In fact, one could consider that a feature, as it means we will be able 
to catch the cases where the compiler output for unused variables changes into 
something we do not support (that is one of the goals of API tests).

In D110571#3032599 <https://reviews.llvm.org/D110571#3032599>, @jarin wrote:

> From what you say, this is not the desired behavior? If we wanted two 
> instances of the variable (one for each block), we could change the 
> DIE-to-variable cache 
> <https://github.com/llvm/llvm-project/blob/47d66355ef9039a15b7265945e3deb331d7f9e05/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h#L324>
>  to be indexed by a pair <symbol-context-DIE, variable-DIE>.

Given that was Greg's (and yours, kinda) reaction as well. I guess we should do 
something like that. Even if it does not cause problems now, it could certainly 
cause them in the future, if something starts relying on the 
symbol_context_scope link making sense.

I am wondering about the best way to implement in though. Having a pair as a 
key seems very redundant to me. As we already know the block its going to end 
up in maybe we could somehow check if its already present there? Since 
blocks/functions don't generally have that many variables [citation needed], 
maybe even a simple iteration would suffice? (The situation is probably 
different for global variables, but those don't need the extra key.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110571

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to