google / lldb-eval

lldb-eval is a library for evaluating expressions in the debugger context
Apache License 2.0
72 stars 17 forks source link

Fix lookup in value context of alias type #178

Closed tonkosi closed 2 years ago

tonkosi commented 2 years ago

When evaluating expression StaticMember in the context of value of type TypeAlias, lldb-eval appends type name in front of the identifier before resolving it (TypeAlias::StaticMember), but fails since LLDB expects the name in canonical form CanonicalType::StaticMember.

This change fixes this by appending type in its canonical form. Note that this still doesn't fix the general case (e.g. evaluating an expression TypeAlias::StaticMember where alias name is already part of the expression).

github-actions[bot] commented 2 years ago

Benchmark comparison for b2da1487 (base) vs 85ced9dc (PR)

Benchmark                             Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------
BM/AddTwoNumbers                   -0.0279         -0.0311        181144        176087        181010        175384
BM/ArrayDereference                -0.0105         -0.0103        186132        184178        186077        184165
BM/ArraySubscript                  -0.0256         -0.0256        235955        229912        235839        229810
BM/TypeCasting                     -0.0492         -0.0492        483287        459494        483252        459462
BM/ParseInteger                    -0.0299         -0.0298        246129        238776        246069        238740
github-actions[bot] commented 2 years ago

Benchmark comparison for fb47c485 (base) vs eb103b57 (PR)

Benchmark                             Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------
BM/AddTwoNumbers                   +0.0280         +0.0283        177534        182501        177427        182442
BM/ArrayDereference                +0.0278         +0.0271        184782        189922        184763        189771
BM/ArraySubscript                  -0.0549         -0.0550        234970        222062        234947        222036
BM/TypeCasting                     +0.0080         +0.0084        459176        462837        458959        462800
BM/ParseInteger                    +0.0105         +0.0107        144888        146412        144833        146386
github-actions[bot] commented 2 years ago

Benchmark comparison for fb47c485 (base) vs 2f4c95d1 (PR)

Benchmark                             Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------
BM/AddTwoNumbers                   -0.0606         -0.0602        126197        118554        126112        118517
BM/ArrayDereference                -0.0302         -0.0305        125612        121815        125584        121758
BM/ArraySubscript                  -0.0495         -0.0494        163958        155850        163934        155834
BM/TypeCasting                     +0.0067         +0.0062        350584        352915        350545        352732
BM/ParseInteger                    +0.0228         +0.0225        107698        110152        107691        110115