Skip to content

Commit e98ef0a

Browse files
committed
[lldb] Fix several LLDB_LOGs with wrong indices in ClangASTSource.cpp
1 parent 58079aa commit e98ef0a

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ void ClangASTSource::CompleteType(TagDecl *tag_decl) {
190190

191191
if (log) {
192192
LLDB_LOG(log,
193-
" CompleteTagDecl on (ASTContext*){1} Completing "
194-
"(TagDecl*){2} named {3}",
193+
" CompleteTagDecl on (ASTContext*){0} Completing "
194+
"(TagDecl*){1} named {2}",
195195
m_clang_ast_context->getDisplayName(), tag_decl,
196196
tag_decl->getName());
197197

@@ -220,7 +220,7 @@ void ClangASTSource::CompleteType(TagDecl *tag_decl) {
220220
ClangASTImporter::NamespaceMapSP namespace_map =
221221
m_ast_importer_sp->GetNamespaceMap(namespace_context);
222222

223-
LLDB_LOGV(log, " CTD Inspecting namespace map{1} ({2} entries)",
223+
LLDB_LOGV(log, " CTD Inspecting namespace map{0} ({1} entries)",
224224
namespace_map.get(), namespace_map->size());
225225

226226
if (!namespace_map)
@@ -229,7 +229,7 @@ void ClangASTSource::CompleteType(TagDecl *tag_decl) {
229229
for (ClangASTImporter::NamespaceMap::iterator i = namespace_map->begin(),
230230
e = namespace_map->end();
231231
i != e && !found; ++i) {
232-
LLDB_LOG(log, " CTD Searching namespace {1} in module {2}",
232+
LLDB_LOG(log, " CTD Searching namespace {0} in module {1}",
233233
i->second.GetName(), i->first->GetFileSpec().GetFilename());
234234

235235
TypeList types;
@@ -478,12 +478,12 @@ void ClangASTSource::FindExternalLexicalDecls(
478478
std::string ast_dump = ClangUtil::DumpDecl(decl);
479479
if (const NamedDecl *context_named_decl =
480480
dyn_cast<NamedDecl>(context_decl))
481-
LLDB_LOG(log, " FELD Adding [to {1}Decl {2}] lexical {3}Decl {4}",
481+
LLDB_LOG(log, " FELD Adding [to {0}Decl {1}] lexical {2}Decl 34}",
482482
context_named_decl->getDeclKindName(),
483483
context_named_decl->getName(), decl->getDeclKindName(),
484484
ast_dump);
485485
else
486-
LLDB_LOG(log, " FELD Adding lexical {1}Decl {2}",
486+
LLDB_LOG(log, " FELD Adding lexical {0}Decl {1}",
487487
decl->getDeclKindName(), ast_dump);
488488
}
489489

@@ -527,19 +527,19 @@ void ClangASTSource::FindExternalVisibleDecls(NameSearchContext &context) {
527527
if (!context.m_decl_context)
528528
LLDB_LOG(log,
529529
"ClangASTSource::FindExternalVisibleDecls on "
530-
"(ASTContext*){1} '{2}' for '{3}' in a NULL DeclContext",
530+
"(ASTContext*){0} '{1}' for '{2}' in a NULL DeclContext",
531531
m_ast_context, m_clang_ast_context->getDisplayName(), name);
532532
else if (const NamedDecl *context_named_decl =
533533
dyn_cast<NamedDecl>(context.m_decl_context))
534534
LLDB_LOG(log,
535535
"ClangASTSource::FindExternalVisibleDecls on "
536-
"(ASTContext*){1} '{2}' for '{3}' in '{4}'",
536+
"(ASTContext*){0} '{1}' for '{2}' in '{3}'",
537537
m_ast_context, m_clang_ast_context->getDisplayName(), name,
538538
context_named_decl->getName());
539539
else
540540
LLDB_LOG(log,
541541
"ClangASTSource::FindExternalVisibleDecls on "
542-
"(ASTContext*){1} '{2}' for '{3}' in a '{4}'",
542+
"(ASTContext*){0} '{1}' for '{2}' in a '{3}'",
543543
m_ast_context, m_clang_ast_context->getDisplayName(), name,
544544
context.m_decl_context->getDeclKindName());
545545
}
@@ -631,7 +631,7 @@ void ClangASTSource::FindExternalVisibleDecls(
631631
if (log) {
632632
const char *name_string = type_sp->GetName().GetCString();
633633

634-
LLDB_LOG(log, " CAS::FEVD Matching type found for \"{1}\": {2}", name,
634+
LLDB_LOG(log, " CAS::FEVD Matching type found for \"{0}\": {1}", name,
635635
(name_string ? name_string : "<anonymous>"));
636636
}
637637

@@ -682,7 +682,7 @@ void ClangASTSource::FillNamespaceMap(
682682
std::pair<lldb::ModuleSP, CompilerDeclContext>(
683683
module_sp, found_namespace_decl));
684684

685-
LLDB_LOG(log, " CAS::FEVD Found namespace {1} in module {2}", name,
685+
LLDB_LOG(log, " CAS::FEVD Found namespace {0} in module {1}", name,
686686
module_sp->GetFileSpec().GetFilename());
687687
}
688688
}
@@ -712,7 +712,7 @@ void ClangASTSource::FillNamespaceMap(
712712
std::pair<lldb::ModuleSP, CompilerDeclContext>(image,
713713
found_namespace_decl));
714714

715-
LLDB_LOG(log, " CAS::FEVD Found namespace {1} in module {2}", name,
715+
LLDB_LOG(log, " CAS::FEVD Found namespace {0} in module {1}", name,
716716
image->GetFileSpec().GetFilename());
717717
}
718718
}
@@ -841,7 +841,7 @@ bool ClangASTSource::FindObjCMethodDeclsWithOrigin(
841841

842842
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
843843

844-
LLDB_LOG(log, " CAS::FOMD found ({1}) {2}", log_info,
844+
LLDB_LOG(log, " CAS::FOMD found ({0}) {1}", log_info,
845845
ClangUtil::DumpDecl(copied_method_decl));
846846

847847
context.AddNamedDecl(copied_method_decl);
@@ -866,7 +866,7 @@ void ClangASTSource::FindDeclInModules(NameSearchContext &context,
866866
if (!modules_decl_vendor->FindDecls(name, append, max_matches, decls))
867867
return;
868868

869-
LLDB_LOG(log, " CAS::FEVD Matching entity found for \"{1}\" in the modules",
869+
LLDB_LOG(log, " CAS::FEVD Matching entity found for \"{0}\" in the modules",
870870
name);
871871

872872
clang::NamedDecl *const decl_from_modules = decls[0];
@@ -981,8 +981,8 @@ void ClangASTSource::FindObjCMethodDecls(NameSearchContext &context) {
981981
ConstString selector_name(ss.GetString());
982982

983983
LLDB_LOG(log,
984-
"ClangASTSource::FindObjCMethodDecls on (ASTContext*){1} '{2}' "
985-
"for selector [{3} {4}]",
984+
"ClangASTSource::FindObjCMethodDecls on (ASTContext*){0} '{1}' "
985+
"for selector [{2} {3}]",
986986
m_ast_context, m_clang_ast_context->getDisplayName(),
987987
interface_decl->getName(), selector_name);
988988
SymbolContextList sc_list;
@@ -1104,7 +1104,7 @@ void ClangASTSource::FindObjCMethodDecls(NameSearchContext &context) {
11041104
if (!copied_method_decl)
11051105
continue;
11061106

1107-
LLDB_LOG(log, " CAS::FOMD found (in symbols)\n{1}",
1107+
LLDB_LOG(log, " CAS::FOMD found (in symbols)\n{0}",
11081108
ClangUtil::DumpDecl(copied_method_decl));
11091109

11101110
context.AddNamedDecl(copied_method_decl);
@@ -1134,7 +1134,7 @@ void ClangASTSource::FindObjCMethodDecls(NameSearchContext &context) {
11341134

11351135
LLDB_LOG(log,
11361136
"CAS::FOPD trying origin "
1137-
"(ObjCInterfaceDecl*){1}/(ASTContext*){2}...",
1137+
"(ObjCInterfaceDecl*){0}/(ASTContext*){1}...",
11381138
complete_interface_decl, &complete_iface_decl->getASTContext());
11391139

11401140
FindObjCMethodDeclsWithOrigin(context, complete_interface_decl,
@@ -1233,7 +1233,7 @@ static bool FindObjCPropertyAndIvarDeclsWithOrigin(
12331233
DeclFromParser<ObjCPropertyDecl> parser_property_decl(
12341234
origin_property_decl.Import(source));
12351235
if (parser_property_decl.IsValid()) {
1236-
LLDB_LOG(log, " CAS::FOPD found\n{1}",
1236+
LLDB_LOG(log, " CAS::FOPD found\n{0}",
12371237
ClangUtil::DumpDecl(parser_property_decl.decl));
12381238

12391239
context.AddNamedDecl(parser_property_decl.decl);
@@ -1248,7 +1248,7 @@ static bool FindObjCPropertyAndIvarDeclsWithOrigin(
12481248
DeclFromParser<ObjCIvarDecl> parser_ivar_decl(
12491249
origin_ivar_decl.Import(source));
12501250
if (parser_ivar_decl.IsValid()) {
1251-
LLDB_LOG(log, " CAS::FOPD found\n{1}",
1251+
LLDB_LOG(log, " CAS::FOPD found\n{0}",
12521252
ClangUtil::DumpDecl(parser_ivar_decl.decl));
12531253

12541254
context.AddNamedDecl(parser_ivar_decl.decl);
@@ -1271,7 +1271,7 @@ void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {
12711271

12721272
LLDB_LOG(log,
12731273
"ClangASTSource::FindObjCPropertyAndIvarDecls on "
1274-
"(ASTContext*){1} '{2}' for '{3}.{4}'",
1274+
"(ASTContext*){0} '{1}' for '{2}.{3}'",
12751275
m_ast_context, m_clang_ast_context->getDisplayName(),
12761276
parser_iface_decl->getName(), context.m_decl_name.getAsString());
12771277

@@ -1280,7 +1280,7 @@ void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {
12801280

12811281
LLDB_LOG(log,
12821282
"CAS::FOPD couldn't find the property on origin "
1283-
"(ObjCInterfaceDecl*){1}/(ASTContext*){2}, searching "
1283+
"(ObjCInterfaceDecl*){0}/(ASTContext*){1}, searching "
12841284
"elsewhere...",
12851285
origin_iface_decl.decl, &origin_iface_decl->getASTContext());
12861286

@@ -1305,7 +1305,7 @@ void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {
13051305

13061306
LLDB_LOG(log,
13071307
"CAS::FOPD trying origin "
1308-
"(ObjCInterfaceDecl*){1}/(ASTContext*){2}...",
1308+
"(ObjCInterfaceDecl*){0}/(ASTContext*){1}...",
13091309
complete_iface_decl.decl, &complete_iface_decl->getASTContext());
13101310

13111311
FindObjCPropertyAndIvarDeclsWithOrigin(context, *this, complete_iface_decl);
@@ -1338,7 +1338,7 @@ void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {
13381338

13391339
LLDB_LOG(log,
13401340
"CAS::FOPD[{0}] trying module "
1341-
"(ObjCInterfaceDecl*){1}/(ASTContext*){2}...",
1341+
"(ObjCInterfaceDecl*){0}/(ASTContext*){1}...",
13421342
interface_decl_from_modules.decl,
13431343
&interface_decl_from_modules->getASTContext());
13441344

@@ -1382,7 +1382,7 @@ void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {
13821382

13831383
LLDB_LOG(log,
13841384
"CAS::FOPD[{0}] trying runtime "
1385-
"(ObjCInterfaceDecl*){1}/(ASTContext*){2}...",
1385+
"(ObjCInterfaceDecl*){0}/(ASTContext*){1}...",
13861386
interface_decl_from_runtime.decl,
13871387
&interface_decl_from_runtime->getASTContext());
13881388

@@ -1401,7 +1401,7 @@ void ClangASTSource::LookupInNamespace(NameSearchContext &context) {
14011401
ClangASTImporter::NamespaceMapSP namespace_map =
14021402
m_ast_importer_sp->GetNamespaceMap(namespace_context);
14031403

1404-
LLDB_LOGV(log, " CAS::FEVD Inspecting namespace map {1} ({2} entries)",
1404+
LLDB_LOGV(log, " CAS::FEVD Inspecting namespace map {0} ({1} entries)",
14051405
namespace_map.get(), namespace_map->size());
14061406

14071407
if (!namespace_map)
@@ -1410,7 +1410,7 @@ void ClangASTSource::LookupInNamespace(NameSearchContext &context) {
14101410
for (ClangASTImporter::NamespaceMap::iterator i = namespace_map->begin(),
14111411
e = namespace_map->end();
14121412
i != e; ++i) {
1413-
LLDB_LOG(log, " CAS::FEVD Searching namespace {1} in module {2}",
1413+
LLDB_LOG(log, " CAS::FEVD Searching namespace {0} in module {1}",
14141414
i->second.GetName(), i->first->GetFileSpec().GetFilename());
14151415

14161416
FindExternalVisibleDecls(context, i->first, i->second);
@@ -1506,7 +1506,7 @@ bool ClangASTSource::layoutRecordType(const RecordDecl *record, uint64_t &size,
15061506
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
15071507

15081508
LLDB_LOG(log,
1509-
"LayoutRecordType on (ASTContext*){1} '{2}' for (RecordDecl*)"
1509+
"LayoutRecordType on (ASTContext*){0} '{1}' for (RecordDecl*)"
15101510
"{3} [name = '{4}']",
15111511
m_ast_context, m_clang_ast_context->getDisplayName(), record,
15121512
record->getName());
@@ -1583,7 +1583,7 @@ bool ClangASTSource::layoutRecordType(const RecordDecl *record, uint64_t &size,
15831583
fe = record->field_end();
15841584
fi != fe; ++fi) {
15851585
LLDB_LOG(log,
1586-
"LRT[{0}] (FieldDecl*){1}, Name = '{2}', Offset = {3} bits",
1586+
"LRT (FieldDecl*){0}, Name = '{1}', Offset = {2} bits",
15871587
*fi, fi->getName(), field_offsets[*fi]);
15881588
}
15891589
DeclFromParser<const CXXRecordDecl> parser_cxx_record =
@@ -1603,8 +1603,8 @@ bool ClangASTSource::layoutRecordType(const RecordDecl *record, uint64_t &size,
16031603
DynCast<CXXRecordDecl>(base_record);
16041604

16051605
LLDB_LOG(log,
1606-
"LRT {1}(CXXRecordDecl*){2}, Name = '{3}', Offset = "
1607-
"{4} chars",
1606+
"LRT {0}(CXXRecordDecl*){1}, Name = '{2}', Offset = "
1607+
"{3} chars",
16081608
(is_virtual ? "Virtual " : ""), base_cxx_record.decl,
16091609
base_cxx_record.decl->getName(),
16101610
(is_virtual
@@ -1628,14 +1628,14 @@ void ClangASTSource::CompleteNamespaceMap(
16281628
if (log) {
16291629
if (parent_map && parent_map->size())
16301630
LLDB_LOG(log,
1631-
"CompleteNamespaceMap on (ASTContext*){1} '{2}' Searching "
1632-
"for namespace {3} in namespace {4}",
1631+
"CompleteNamespaceMap on (ASTContext*){0} '{1}' Searching "
1632+
"for namespace {2} in namespace {3}",
16331633
m_ast_context, m_clang_ast_context->getDisplayName(), name,
16341634
parent_map->begin()->second.GetName());
16351635
else
16361636
LLDB_LOG(log,
1637-
"CompleteNamespaceMap on (ASTContext*){1} '{2}' Searching "
1638-
"for namespace {3}",
1637+
"CompleteNamespaceMap on (ASTContext*){0} '{1}' Searching "
1638+
"for namespace {2}",
16391639
m_ast_context, m_clang_ast_context->getDisplayName(), name);
16401640
}
16411641

@@ -1662,7 +1662,7 @@ void ClangASTSource::CompleteNamespaceMap(
16621662
namespace_map->push_back(std::pair<lldb::ModuleSP, CompilerDeclContext>(
16631663
module_sp, found_namespace_decl));
16641664

1665-
LLDB_LOG(log, " CMN Found namespace {1} in module {2}", name,
1665+
LLDB_LOG(log, " CMN Found namespace {0} in module {1}", name,
16661666
module_sp->GetFileSpec().GetFilename());
16671667
}
16681668
} else {
@@ -1693,7 +1693,7 @@ void ClangASTSource::CompleteNamespaceMap(
16931693
namespace_map->push_back(std::pair<lldb::ModuleSP, CompilerDeclContext>(
16941694
image, found_namespace_decl));
16951695

1696-
LLDB_LOG(log, " CMN[{0}] Found namespace {1} in module {2}", name,
1696+
LLDB_LOG(log, " CMN[{0}] Found namespace {0} in module {1}", name,
16971697
image->GetFileSpec().GetFilename());
16981698
}
16991699
}

0 commit comments

Comments
 (0)