[all-commits] [llvm/llvm-project] e657a1: [lldb] Remove all the 'current_id' logging counte...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Sun Feb 23 23:39:21 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e657a1eb23f8231296ac0c62a1cd497762bd0f3e
      https://github.com/llvm/llvm-project/commit/e657a1eb23f8231296ac0c62a1cd497762bd0f3e
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-02-24 (Mon, 24 Feb 2020)

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

  Log Message:
  -----------
  [lldb] Remove all the 'current_id'  logging counters from the lookup code.

Summary:
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:
```

Reviewers: labath, shafik, JDevlieghere

Reviewed By: labath, shafik, JDevlieghere

Subscribers: abidh, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D74951




More information about the All-commits mailing list