Beispiel #1
0
void DebugInfoFinder::processScope(DIScope Scope) {
  if (Scope.isType()) {
    DIType Ty(Scope);
    processType(Ty);
    return;
  }
  if (Scope.isCompileUnit()) {
    addCompileUnit(DICompileUnit(Scope));
    return;
  }
  if (Scope.isSubprogram()) {
    processSubprogram(DISubprogram(Scope));
    return;
  }
  if (!addScope(Scope))
    return;
  if (Scope.isLexicalBlock()) {
    DILexicalBlock LB(Scope);
    processScope(LB.getContext());
  } else if (Scope.isLexicalBlockFile()) {
    DILexicalBlockFile LBF = DILexicalBlockFile(Scope);
    processScope(LBF.getScope());
  } else if (Scope.isNameSpace()) {
    DINameSpace NS(Scope);
    processScope(NS.getContext());
  }
}
Beispiel #2
0
void DIEItem::ShowContext(DetailsView* detailsView, DIScope scope) {
  // TODO: Fill out these cases.
  if (scope.isCompileUnit()) {
    DICompileUnit diCompileUnit(scope);
    detailsView->Add(_("ContextType"), _("DICompileUnit"));
    detailsView->Add(_("Context"),
        toWxStr(diCompileUnit.getDirectory()) + _("/") +
        toWxStr(diCompileUnit.getFilename()));
  } else if (scope.isFile()) {
    DIFile diFile(scope);
    detailsView->Add(_("ContextType"), _("DIFile"));
    detailsView->Add(_("Context"),
        toWxStr(diFile.getDirectory()) + _("/") +
        toWxStr(diFile.getFilename()));
  } else if (scope.isNameSpace()) {
    DINameSpace diNameSpace(scope);
    detailsView->Add(_("ContextType"), _("DINameSpace"));
    detailsView->Add(_("Context"), diNameSpace.getName());
  } else if (scope.isSubprogram()) {
    DISubprogram diSubprogram(scope);
    detailsView->Add(_("ContextType"), _("DISubprogram"));
    detailsView->Add(_("Context"), diSubprogram.getName());
  } else if (scope.isLexicalBlock()) {
    detailsView->Add(_("ContextType"), _("DILexicalBlock"));
    // TODO: Implement context name.
    detailsView->Add(_("Context"), _("?{}"));
  } else if (scope.isType()) {
    detailsView->Add(_("ContextType"), _("DIType"));
    detailsView->Add(_("Context"), DITypeToString(DIType(scope)));
  } else {
    detailsView->Add(_("Context"), _("??? [Unknown]"));
  }
}