[Lldb-commits] [PATCH] D131335: WIP: [lldb] abi_tag support 3/3 - Use mangle tree API to determine approximate mangled matches

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 10 04:42:28 PDT 2022


Michael137 added a comment.

Another interesting example of how the fallback mechanism produces unexpected result:

  namespace A {
  struct B {};
  
  template <typename T>             
  [[gnu::abi_tag ("vTest")]]        
  int insideNS(T t) { return 0; }
  
  [[gnu::abi_tag ("vTest")]]        
  int insideNS(int t) { return 1; }
  } // namespace A
  
  template <typename T>             
  [[gnu::abi_tag ("vTest")]]        
  int outsideNS(T t) { return 0; }  
                                    
  [[gnu::abi_tag ("vTest")]]        
  int outsideNS(int t) { return 1; }



  (lldb) p outsideNS(A::B{})    <<< Uses the fallback `outsideNS`
  (int) $1 = 1
  (lldb) p outsideNS(0)         <<< Uses the fallback `_Z9outsideNSi`
  (int) $2 = 1
  
  (inner) p insideNS(A::B{})
  error: Couldn't lookup symbols:
  (inner) p insideNS(0)
  error: Couldn't lookup symbols:

I should add this to the API test


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131335



More information about the lldb-commits mailing list