[Lldb-commits] [PATCH] D74951: [lldb] Remove all the 'current_id' logging counters from the lookup code.

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 21 01:35:34 PST 2020


teemperor created this revision.
teemperor added reviewers: labath, shafik, JDevlieghere.
Herald added subscribers: lldb-commits, abidh.
Herald added a project: LLDB.
teemperor retitled this revision from "[lldb] Remove all the`current_id`  logging counters from the lookup code." to "[lldb] Remove all the 'current_id'  logging counters from the lookup code.".

We have a lot of code in our lookup code to pass around `current_id` counters which end up in our logs like this:

  AOCTV::FT [234] Found XYZ

This patch removes all of this code because:

- I'm splitting up all humongous functions, so I need to write more and more boilerplate to pass around these ids.
- I never saw any similar counters in the LLDB/LLVM code base.
- They're essentially globals and the last thing we need in LLDB is even more global state.
- They're not really useful when readings logs. It doesn't help that there isn't just 1 or 2 counters, but 12 (!) unique counters. I always thought that if I see two identical counter values in those brackets it's the same lookup request, but it seems that's only true by accident (and you can't know which of the 12 counters is actually printed without reading the code). The only time I know I can trust the counters is when it's obvious from the log that it's the same counter like in the log below, but then why have the counters in the first place?

  LayoutRecordType[28] on (ASTContext*)0x00007FFA1C840200 'scratch ASTContext' for (RecordDecl*)0x00007FFA0AAE8CF0 [name = '__tree']
  LRT[28] returned:
  LRT[28]   Original = (RecordDecl*)%p
  LRT[28]   Size = %lld
  LRT[28]   Alignment = %lld
  LRT[28]   Fields:
  LRT[28]     (FieldDecl*)0x00007FFA1A13B1D0, Name = '__begin_node_', Offset = 0 bits
  LRT[28]     (FieldDecl*)0x00007FFA1C08FD30, Name = '__pair1_', Offset = 64 bits
  LRT[28]     (FieldDecl*)0x00007FFA1C061210, Name = '__pair3_', Offset = 128 bits
  LRT[28]   Bases:


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D74951

Files:
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
  lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74951.245803.patch
Type: text/x-patch
Size: 64769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200221/939d06b9/attachment-0001.bin>


More information about the lldb-commits mailing list