GoInterpreter(ExecutionContext &exe_ctx, const char *expr) : m_exe_ctx(exe_ctx), m_frame(exe_ctx.GetFrameSP()), m_parser(expr) { if (m_frame) { const SymbolContext &ctx = m_frame->GetSymbolContext(eSymbolContextFunction); ConstString fname = ctx.GetFunctionName(); if (fname.GetLength() > 0) { size_t dot = fname.GetStringRef().find('.'); if (dot != llvm::StringRef::npos) m_package = llvm::StringRef(fname.AsCString(), dot); } } }
bool isThrownError(ValueObjectSP valobj_sp) { ConstString name = valobj_sp->GetName(); size_t length = name.GetLength(); if (length < 3) return false; const char *name_cstr = name.AsCString(); if (name_cstr[0] != '$') return false; if (name_cstr[1] != 'E') return false; for (int index = 2; index < length; index++) { char digit = name_cstr[index]; if (digit < '0' || digit > '9') return false; } return true; }