Skip to content

Commit 0e7e597

Browse files
committed
[meta] Add Root.TClass.GetClass.AutoParsing rootrc key.
This allows to disable auto-parsing during `TClass::GetClass` for debugging purposes.
1 parent 188a5fb commit 0e7e597

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

config/rootrc.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,3 +644,11 @@ Rint.Canvas.HighLightColor: 5
644644
# 1 All Branches (default)
645645
# Can be overridden by the environment variable ROOT_TTREECACHE_PREFILL
646646
# TTreeCache.Prefill: 1
647+
648+
# Advanced Debug Settings
649+
# Setting Root.TClass.GetClass.AutoParsing to false
650+
# will disable any auto-parsing execution of `TClass::GetClass`. This will
651+
# result in not being able to find TClass-es when the name requires not-already
652+
# loaded interpreted information (eg. a typedef to be resolved).
653+
#
654+
# Root.TClass.GetClass.AutoParsing: true

core/meta/src/TClass.cxx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ In order to access the name of a class within the ROOT type system, the method T
5555
#include "TDataType.h"
5656
#include "TDatime.h"
5757
#include "TEnum.h"
58+
#include "TEnv.h"
5859
#include "TError.h"
5960
#include "TExMap.h"
6061
#include "TFunctionTemplate.h"
@@ -3154,11 +3155,7 @@ TClass *TClass::GetClass(const char *name, Bool_t load, Bool_t silent, size_t hi
31543155
#ifdef ROOT_DISABLE_TCLASS_GET_CLASS_AUTOPARSING
31553156
constexpr bool requestDisableAutoLoading = true;
31563157
#else
3157-
// We could get the user choice from:
3158-
// - environment variable ROOT_DISABLE_TCLASS_GET_CLASS_AUTOPARSING
3159-
// - rootrc key Root.TClass.GetClass.AutoParsing
3160-
// - TClass::SetGetClassAutoParsing
3161-
constexpr bool requestDisableAutoLoading = false;
3158+
static const bool requestDisableAutoLoading = !gEnv->GetValue("Root.TClass.GetClass.AutoParsing", true);
31623159
#endif
31633160
if (requestDisableAutoLoading)
31643161
disableAutoParsing = true;

0 commit comments

Comments
 (0)