@@ -2962,17 +2962,24 @@ bool OIDebugger::processTargetData() {
2962
2962
}
2963
2963
2964
2964
std::optional<std::string> OIDebugger::generateCode (const irequest& req) {
2965
- auto root = symbols->getRootType (req);
2966
- if (!root.has_value ()) {
2967
- return std::nullopt ;
2968
- }
2969
2965
2970
2966
std::string code (headers::oi_OITraceCode_cpp);
2971
2967
2972
2968
if (generatorConfig.features [Feature::TypeGraph]) {
2973
2969
// CodeGen v2
2970
+ std::string rootVariableName;
2974
2971
CodeGen codegen2{generatorConfig, *symbols};
2975
- codegen2.codegenFromDrgn (root->type .type , code);
2972
+ if (generatorConfig.features [Feature::LLDB]) {
2973
+ throw std::runtime_error{" LLDB is not implemented yet" };
2974
+ } else {
2975
+ auto root = symbols->getDrgnRootType (req);
2976
+ if (!root.has_value ()) {
2977
+ return std::nullopt ;
2978
+ }
2979
+
2980
+ rootVariableName = std::move (root->varName );
2981
+ codegen2.codegenFromDrgn (root->type .type , code);
2982
+ }
2976
2983
2977
2984
TypeHierarchy th;
2978
2985
// Make this static as a big hack to extend the fake drgn_types' lifetimes
@@ -2981,10 +2988,15 @@ std::optional<std::string> OIDebugger::generateCode(const irequest& req) {
2981
2988
drgn_type* rootType;
2982
2989
codegen2.exportDrgnTypes (th, drgnTypes, &rootType);
2983
2990
2984
- typeInfos[req] = {RootInfo{root-> varName , {rootType, drgn_qualifiers{}}},
2991
+ typeInfos[req] = {RootInfo{rootVariableName , {rootType, drgn_qualifiers{}}},
2985
2992
th,
2986
2993
std::map<std::string, PaddingInfo>{}};
2987
2994
} else {
2995
+ auto root = symbols->getDrgnRootType (req);
2996
+ if (!root.has_value ()) {
2997
+ return std::nullopt ;
2998
+ }
2999
+
2988
3000
// OICodeGen (v1)
2989
3001
auto codegen = OICodeGen::buildFromConfig (generatorConfig, *symbols);
2990
3002
if (!codegen) {
0 commit comments