Index: include/lldb/Core/Address.h =================================================================== --- include/lldb/Core/Address.h +++ include/lldb/Core/Address.h @@ -508,9 +508,9 @@ /// /// @see SymbolContextScope::CalculateSymbolContext(SymbolContext*) //------------------------------------------------------------------ - uint32_t CalculateSymbolContext( - SymbolContext *sc, - uint32_t resolve_scope = lldb::eSymbolContextEverything) const; + uint32_t CalculateSymbolContext(SymbolContext *sc, + lldb::SymbolContextItem resolve_scope = + lldb::eSymbolContextEverything) const; lldb::ModuleSP CalculateSymbolContextModule() const; Index: include/lldb/Core/Module.h =================================================================== --- include/lldb/Core/Module.h +++ include/lldb/Core/Module.h @@ -816,10 +816,9 @@ /// /// @see SymbolContext::Scope //------------------------------------------------------------------ - uint32_t - ResolveSymbolContextForAddress(const Address &so_addr, uint32_t resolve_scope, - SymbolContext &sc, - bool resolve_tail_call_address = false); + uint32_t ResolveSymbolContextForAddress( + const Address &so_addr, lldb::SymbolContextItem resolve_scope, + SymbolContext &sc, bool resolve_tail_call_address = false); //------------------------------------------------------------------ /// Resolve items in the symbol context for a given file and line. @@ -862,10 +861,9 @@ /// /// @see SymbolContext::Scope //------------------------------------------------------------------ - uint32_t ResolveSymbolContextForFilePath(const char *file_path, uint32_t line, - bool check_inlines, - uint32_t resolve_scope, - SymbolContextList &sc_list); + uint32_t ResolveSymbolContextForFilePath( + const char *file_path, uint32_t line, bool check_inlines, + lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list); //------------------------------------------------------------------ /// Resolve items in the symbol context for a given file and line. @@ -909,10 +907,9 @@ /// /// @see SymbolContext::Scope //------------------------------------------------------------------ - uint32_t ResolveSymbolContextsForFileSpec(const FileSpec &file_spec, - uint32_t line, bool check_inlines, - uint32_t resolve_scope, - SymbolContextList &sc_list); + uint32_t ResolveSymbolContextsForFileSpec( + const FileSpec &file_spec, uint32_t line, bool check_inlines, + lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list); void SetFileSpecAndObjectName(const FileSpec &file, const ConstString &object_name); @@ -1155,7 +1152,7 @@ //------------------------------------------------------------------ uint32_t ResolveSymbolContextForAddress(lldb::addr_t vm_addr, bool vm_addr_is_file_addr, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, Address &so_addr, SymbolContext &sc); void SymbolIndicesToSymbolContextList(Symtab *symtab, Index: include/lldb/Core/ModuleList.h =================================================================== --- include/lldb/Core/ModuleList.h +++ include/lldb/Core/ModuleList.h @@ -495,26 +495,24 @@ /// &,uint32_t,SymbolContext&) //------------------------------------------------------------------ uint32_t ResolveSymbolContextForAddress(const Address &so_addr, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, SymbolContext &sc) const; //------------------------------------------------------------------ /// @copydoc Module::ResolveSymbolContextForFilePath (const char /// *,uint32_t,bool,uint32_t,SymbolContextList&) //------------------------------------------------------------------ - uint32_t ResolveSymbolContextForFilePath(const char *file_path, uint32_t line, - bool check_inlines, - uint32_t resolve_scope, - SymbolContextList &sc_list) const; + uint32_t ResolveSymbolContextForFilePath( + const char *file_path, uint32_t line, bool check_inlines, + lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const; //------------------------------------------------------------------ /// @copydoc Module::ResolveSymbolContextsForFileSpec (const FileSpec /// &,uint32_t,bool,uint32_t,SymbolContextList&) //------------------------------------------------------------------ - uint32_t ResolveSymbolContextsForFileSpec(const FileSpec &file_spec, - uint32_t line, bool check_inlines, - uint32_t resolve_scope, - SymbolContextList &sc_list) const; + uint32_t ResolveSymbolContextsForFileSpec( + const FileSpec &file_spec, uint32_t line, bool check_inlines, + lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const; //------------------------------------------------------------------ /// Gets the size of the module list. Index: include/lldb/Symbol/CompileUnit.h =================================================================== --- include/lldb/Symbol/CompileUnit.h +++ include/lldb/Symbol/CompileUnit.h @@ -391,7 +391,7 @@ //------------------------------------------------------------------ uint32_t ResolveSymbolContext(const FileSpec &file_spec, uint32_t line, bool check_inlines, bool exact, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list); //------------------------------------------------------------------ Index: include/lldb/Symbol/SymbolFile.h =================================================================== --- include/lldb/Symbol/SymbolFile.h +++ include/lldb/Symbol/SymbolFile.h @@ -155,11 +155,11 @@ return CompilerDeclContext(); } virtual uint32_t ResolveSymbolContext(const Address &so_addr, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, SymbolContext &sc) = 0; virtual uint32_t ResolveSymbolContext(const FileSpec &file_spec, uint32_t line, bool check_inlines, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list); virtual uint32_t FindGlobalVariables(const ConstString &name, Index: include/lldb/Symbol/SymbolVendor.h =================================================================== --- include/lldb/Symbol/SymbolVendor.h +++ include/lldb/Symbol/SymbolVendor.h @@ -71,12 +71,12 @@ virtual Type *ResolveTypeUID(lldb::user_id_t type_uid); virtual uint32_t ResolveSymbolContext(const Address &so_addr, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, SymbolContext &sc); virtual uint32_t ResolveSymbolContext(const FileSpec &file_spec, uint32_t line, bool check_inlines, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list); virtual size_t FindGlobalVariables(const ConstString &name, Index: include/lldb/Target/StackFrame.h =================================================================== --- include/lldb/Target/StackFrame.h +++ include/lldb/Target/StackFrame.h @@ -173,7 +173,7 @@ /// A SymbolContext reference which includes the types of information /// requested by resolve_scope, if they are available. //------------------------------------------------------------------ - const SymbolContext &GetSymbolContext(uint32_t resolve_scope); + const SymbolContext &GetSymbolContext(lldb::SymbolContextItem resolve_scope); //------------------------------------------------------------------ /// Return the Canonical Frame Address (DWARF term) for this frame. Index: include/lldb/lldb-enumerations.h =================================================================== --- include/lldb/lldb-enumerations.h +++ include/lldb/lldb-enumerations.h @@ -10,6 +10,36 @@ #ifndef LLDB_lldb_enumerations_h_ #define LLDB_lldb_enumerations_h_ +#include + +// Macro to enable bitmask operations on an enum. Without this, Enum | Enum +// gets promoted to an int, so you have to say Enum a = Enum(eFoo | eBar). If +// you mark Enum with LLDB_MARK_AS_BITMASK_ENUM(Enum), however, you can simply +// write Enum a = eFoo | eBar. +#define LLDB_MARK_AS_BITMASK_ENUM(Enum) \ + inline Enum operator|(Enum a, Enum b) { \ + return static_cast( \ + static_cast::type>(a) | \ + static_cast::type>(b)); \ + } \ + inline Enum operator&(Enum a, Enum b) { \ + return static_cast( \ + static_cast::type>(a) & \ + static_cast::type>(b)); \ + } \ + inline Enum operator~(Enum a) { \ + return static_cast( \ + ~static_cast::type>(a)); \ + } \ + inline Enum &operator|=(Enum &a, Enum b) { \ + a = a | b; \ + return a; \ + } \ + inline Enum &operator&=(Enum &a, Enum b) { \ + a = a & b; \ + return a; \ + } + #ifndef SWIG // With MSVC, the default type of an enum is always signed, even if one of the // enumerator values is too large to fit into a signed integer but would @@ -327,39 +357,40 @@ //------------------------------------------------------------------ FLAGS_ENUM(SymbolContextItem){ eSymbolContextTarget = (1u << 0), ///< Set when \a target is requested from - ///a query, or was located in query - ///results + /// a query, or was located in query + /// results eSymbolContextModule = (1u << 1), ///< Set when \a module is requested from - ///a query, or was located in query - ///results + /// a query, or was located in query + /// results eSymbolContextCompUnit = (1u << 2), ///< Set when \a comp_unit is requested - ///from a query, or was located in query - ///results + /// from a query, or was located in + /// query results eSymbolContextFunction = (1u << 3), ///< Set when \a function is requested - ///from a query, or was located in query - ///results + /// from a query, or was located in + /// query results eSymbolContextBlock = (1u << 4), ///< Set when the deepest \a block is - ///requested from a query, or was located - ///in query results + /// requested from a query, or was located + /// in query results eSymbolContextLineEntry = (1u << 5), ///< Set when \a line_entry is - ///requested from a query, or was - ///located in query results + /// requested from a query, or was + /// located in query results eSymbolContextSymbol = (1u << 6), ///< Set when \a symbol is requested from - ///a query, or was located in query - ///results + /// a query, or was located in query + /// results eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1u), ///< Indicates to try and lookup everything - ///up during a routine symbol context - ///query. - eSymbolContextVariable = (1u << 7) ///< Set when \a global or static - ///variable is requested from a query, or - ///was located in query results. + /// up during a routine symbol context + /// query. + eSymbolContextVariable = (1u << 7), ///< Set when \a global or static + /// variable is requested from a query, + /// or was located in query results. ///< eSymbolContextVariable is potentially expensive to lookup so it isn't - ///included in + /// included in ///< eSymbolContextEverything which stops it from being used during frame PC - ///lookups and + /// lookups and ///< many other potential address to symbol context lookups. }; +LLDB_MARK_AS_BITMASK_ENUM(SymbolContextItem) FLAGS_ENUM(Permissions){ePermissionsWritable = (1u << 0), ePermissionsReadable = (1u << 1), @@ -1086,7 +1117,6 @@ eTypeSummaryCapped = true, eTypeSummaryUncapped = false }; - } // namespace lldb #endif // LLDB_lldb_enumerations_h_ Index: source/API/SBAddress.cpp =================================================================== --- source/API/SBAddress.cpp +++ source/API/SBAddress.cpp @@ -198,8 +198,9 @@ SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) { SBSymbolContext sb_sc; + SymbolContextItem scope = static_cast(resolve_scope); if (m_opaque_ap->IsValid()) - m_opaque_ap->CalculateSymbolContext(&sb_sc.ref(), resolve_scope); + m_opaque_ap->CalculateSymbolContext(&sb_sc.ref(), scope); return sb_sc; } Index: source/API/SBFrame.cpp =================================================================== --- source/API/SBFrame.cpp +++ source/API/SBFrame.cpp @@ -112,7 +112,7 @@ SBSymbolContext sb_sym_ctx; std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); - + SymbolContextItem scope = static_cast(resolve_scope); StackFrame *frame = nullptr; Target *target = exe_ctx.GetTargetPtr(); Process *process = exe_ctx.GetProcessPtr(); @@ -121,7 +121,7 @@ if (stop_locker.TryLock(&process->GetRunLock())) { frame = exe_ctx.GetFramePtr(); if (frame) { - sb_sym_ctx.SetSymbolContext(&frame->GetSymbolContext(resolve_scope)); + sb_sym_ctx.SetSymbolContext(&frame->GetSymbolContext(scope)); } else { if (log) log->Printf("SBFrame::GetVariables () => error: could not " Index: source/API/SBModule.cpp =================================================================== --- source/API/SBModule.cpp +++ source/API/SBModule.cpp @@ -217,9 +217,9 @@ uint32_t resolve_scope) { SBSymbolContext sb_sc; ModuleSP module_sp(GetSP()); + SymbolContextItem scope = static_cast(resolve_scope); if (module_sp && addr.IsValid()) - module_sp->ResolveSymbolContextForAddress(addr.ref(), resolve_scope, - *sb_sc); + module_sp->ResolveSymbolContextForAddress(addr.ref(), scope, *sb_sc); return sb_sc; } Index: source/API/SBTarget.cpp =================================================================== --- source/API/SBTarget.cpp +++ source/API/SBTarget.cpp @@ -660,11 +660,12 @@ SBTarget::ResolveSymbolContextForAddress(const SBAddress &addr, uint32_t resolve_scope) { SBSymbolContext sc; + SymbolContextItem scope = static_cast(resolve_scope); if (addr.IsValid()) { TargetSP target_sp(GetSP()); if (target_sp) - target_sp->GetImages().ResolveSymbolContextForAddress( - addr.ref(), resolve_scope, sc.ref()); + target_sp->GetImages().ResolveSymbolContextForAddress(addr.ref(), scope, + sc.ref()); } return sc; } Index: source/Commands/CommandObjectSource.cpp =================================================================== --- source/Commands/CommandObjectSource.cpp +++ source/Commands/CommandObjectSource.cpp @@ -1210,7 +1210,9 @@ target->GetImages().FindModules(module_spec, matching_modules); num_matches += matching_modules.ResolveSymbolContextForFilePath( filename, 0, check_inlines, - eSymbolContextModule | eSymbolContextCompUnit, sc_list); + SymbolContextItem(eSymbolContextModule | + eSymbolContextCompUnit), + sc_list); } } } else { Index: source/Core/Address.cpp =================================================================== --- source/Core/Address.cpp +++ source/Core/Address.cpp @@ -779,8 +779,9 @@ m_section_wp.owner_before(empty_section_wp); } -uint32_t Address::CalculateSymbolContext(SymbolContext *sc, - uint32_t resolve_scope) const { +uint32_t +Address::CalculateSymbolContext(SymbolContext *sc, + SymbolContextItem resolve_scope) const { sc->Clear(false); // Absolute addresses don't have enough information to reconstruct even their // target. Index: source/Core/Disassembler.cpp =================================================================== --- source/Core/Disassembler.cpp +++ source/Core/Disassembler.cpp @@ -429,9 +429,9 @@ const Address &addr = inst->GetAddress(); ModuleSP module_sp(addr.GetModule()); if (module_sp) { - const uint32_t resolve_mask = eSymbolContextFunction | - eSymbolContextSymbol | - eSymbolContextLineEntry; + const SymbolContextItem resolve_mask = eSymbolContextFunction | + eSymbolContextSymbol | + eSymbolContextLineEntry; uint32_t resolved_mask = module_sp->ResolveSymbolContextForAddress(addr, resolve_mask, sc); if (resolved_mask) { Index: source/Core/Module.cpp =================================================================== --- source/Core/Module.cpp +++ source/Core/Module.cpp @@ -433,8 +433,8 @@ } uint32_t Module::ResolveSymbolContextForAddress( - const Address &so_addr, uint32_t resolve_scope, SymbolContext &sc, - bool resolve_tail_call_address) { + const Address &so_addr, lldb::SymbolContextItem resolve_scope, + SymbolContext &sc, bool resolve_tail_call_address) { std::lock_guard guard(m_mutex); uint32_t resolved_flags = 0; @@ -566,21 +566,17 @@ return resolved_flags; } -uint32_t Module::ResolveSymbolContextForFilePath(const char *file_path, - uint32_t line, - bool check_inlines, - uint32_t resolve_scope, - SymbolContextList &sc_list) { +uint32_t Module::ResolveSymbolContextForFilePath( + const char *file_path, uint32_t line, bool check_inlines, + lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) { FileSpec file_spec(file_path, false); return ResolveSymbolContextsForFileSpec(file_spec, line, check_inlines, resolve_scope, sc_list); } -uint32_t Module::ResolveSymbolContextsForFileSpec(const FileSpec &file_spec, - uint32_t line, - bool check_inlines, - uint32_t resolve_scope, - SymbolContextList &sc_list) { +uint32_t Module::ResolveSymbolContextsForFileSpec( + const FileSpec &file_spec, uint32_t line, bool check_inlines, + lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) { std::lock_guard guard(m_mutex); static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); Timer scoped_timer(func_cat, Index: source/Core/ModuleList.cpp =================================================================== --- source/Core/ModuleList.cpp +++ source/Core/ModuleList.cpp @@ -662,9 +662,10 @@ return false; } -uint32_t ModuleList::ResolveSymbolContextForAddress(const Address &so_addr, - uint32_t resolve_scope, - SymbolContext &sc) const { +uint32_t +ModuleList::ResolveSymbolContextForAddress(const Address &so_addr, + SymbolContextItem resolve_scope, + SymbolContext &sc) const { // The address is already section offset so it has a module uint32_t resolved_flags = 0; ModuleSP module_sp(so_addr.GetModule()); @@ -687,7 +688,7 @@ uint32_t ModuleList::ResolveSymbolContextForFilePath( const char *file_path, uint32_t line, bool check_inlines, - uint32_t resolve_scope, SymbolContextList &sc_list) const { + SymbolContextItem resolve_scope, SymbolContextList &sc_list) const { FileSpec file_spec(file_path, false); return ResolveSymbolContextsForFileSpec(file_spec, line, check_inlines, resolve_scope, sc_list); @@ -695,7 +696,7 @@ uint32_t ModuleList::ResolveSymbolContextsForFileSpec( const FileSpec &file_spec, uint32_t line, bool check_inlines, - uint32_t resolve_scope, SymbolContextList &sc_list) const { + SymbolContextItem resolve_scope, SymbolContextList &sc_list) const { std::lock_guard guard(m_modules_mutex); collection::const_iterator pos, end = m_modules.end(); for (pos = m_modules.begin(); pos != end; ++pos) { Index: source/Core/SourceManager.cpp =================================================================== --- source/Core/SourceManager.cpp +++ source/Core/SourceManager.cpp @@ -397,7 +397,8 @@ size_t num_matches = target->GetImages().ResolveSymbolContextForFilePath( file_spec.GetFilename().AsCString(), 0, check_inlines, - lldb::eSymbolContextModule | lldb::eSymbolContextCompUnit, + SymbolContextItem(eSymbolContextModule | + eSymbolContextCompUnit), sc_list); bool got_multiple = false; if (num_matches != 0) { Index: source/Plugins/Architecture/Mips/ArchitectureMips.cpp =================================================================== --- source/Plugins/Architecture/Mips/ArchitectureMips.cpp +++ source/Plugins/Architecture/Mips/ArchitectureMips.cpp @@ -96,7 +96,8 @@ ModuleSP temp_addr_module_sp(resolved_addr.GetModule()); if (temp_addr_module_sp) { SymbolContext sc; - uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol; + SymbolContextItem resolve_scope = + eSymbolContextFunction | eSymbolContextSymbol; temp_addr_module_sp->ResolveSymbolContextForAddress(resolved_addr, resolve_scope, sc); Address sym_addr; Index: source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp =================================================================== --- source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -1382,7 +1382,7 @@ } SymbolContext sym_ctx; - const uint32_t resolve_scope = + const SymbolContextItem resolve_scope = eSymbolContextFunction | eSymbolContextSymbol; if (pc_so_addr.IsValid() && pc_so_addr.GetModule()) { pc_so_addr.GetModule()->ResolveSymbolContextForAddress( Index: source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp =================================================================== --- source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -3718,7 +3718,8 @@ continue; // Find the function name - const SymbolContext sym_ctx = frame_sp->GetSymbolContext(false); + const SymbolContext sym_ctx = + frame_sp->GetSymbolContext(eSymbolContextFunction); const ConstString func_name = sym_ctx.GetFunctionName(); if (!func_name) continue; Index: source/Plugins/Process/Utility/RegisterContextLLDB.cpp =================================================================== --- source/Plugins/Process/Utility/RegisterContextLLDB.cpp +++ source/Plugins/Process/Utility/RegisterContextLLDB.cpp @@ -150,7 +150,8 @@ // We require either a symbol or function in the symbols context to be // successfully filled in or this context is of no use to us. - const uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol; + const SymbolContextItem resolve_scope = + eSymbolContextFunction | eSymbolContextSymbol; if (pc_module_sp.get() && (pc_module_sp->ResolveSymbolContextForAddress( m_current_pc, resolve_scope, m_sym_ctx) & resolve_scope)) { @@ -436,7 +437,8 @@ // then we might not find the correct unwind information later. Instead, let // ResolveSymbolContextForAddress fail, and handle the case via // decr_pc_and_recompute_addr_range below. - const uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol; + const SymbolContextItem resolve_scope = + eSymbolContextFunction | eSymbolContextSymbol; uint32_t resolved_scope = pc_module_sp->ResolveSymbolContextForAddress( m_current_pc, resolve_scope, m_sym_ctx, resolve_tail_call_address); @@ -494,7 +496,8 @@ temporary_pc.SetLoadAddress(pc - 1, &process->GetTarget()); m_sym_ctx.Clear(false); m_sym_ctx_valid = false; - uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol; + SymbolContextItem resolve_scope = + eSymbolContextFunction | eSymbolContextSymbol; ModuleSP temporary_module_sp = temporary_pc.GetModule(); if (temporary_module_sp && Index: source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp =================================================================== --- source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp +++ source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp @@ -114,7 +114,7 @@ if (!m_cursors.empty()) { lldb::addr_t first_frame_pc = m_cursors.front().pc; if (first_frame_pc != LLDB_INVALID_ADDRESS) { - const uint32_t resolve_scope = + const SymbolContextItem resolve_scope = eSymbolContextModule | eSymbolContextCompUnit | eSymbolContextFunction | eSymbolContextSymbol; @@ -205,7 +205,7 @@ if (!m_cursors.empty()) { lldb::addr_t first_frame_pc = m_cursors.front().pc; if (first_frame_pc != LLDB_INVALID_ADDRESS) { - const uint32_t resolve_scope = + const SymbolContextItem resolve_scope = eSymbolContextModule | eSymbolContextCompUnit | eSymbolContextFunction | eSymbolContextSymbol; Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -168,12 +168,13 @@ ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override; uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override; uint32_t ResolveSymbolContext(const lldb_private::FileSpec &file_spec, uint32_t line, - bool check_inlines, uint32_t resolve_scope, + bool check_inlines, + lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContextList &sc_list) override; uint32_t Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1777,7 +1777,7 @@ } uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr, - uint32_t resolve_scope, + SymbolContextItem resolve_scope, SymbolContext &sc) { static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); Timer scoped_timer(func_cat, @@ -1911,7 +1911,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec, uint32_t line, bool check_inlines, - uint32_t resolve_scope, + SymbolContextItem resolve_scope, SymbolContextList &sc_list) { const uint32_t prev_size = sc_list.GetSize(); if (resolve_scope & eSymbolContextCompUnit) { Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -86,11 +86,12 @@ bool CompleteType(lldb_private::CompilerType &compiler_type) override; uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override; uint32_t ResolveSymbolContext(const lldb_private::FileSpec &file_spec, uint32_t line, - bool check_inlines, uint32_t resolve_scope, + bool check_inlines, + lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContextList &sc_list) override; uint32_t FindGlobalVariables(const lldb_private::ConstString &name, Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -717,8 +717,10 @@ return success; } -uint32_t SymbolFileDWARFDebugMap::ResolveSymbolContext( - const Address &exe_so_addr, uint32_t resolve_scope, SymbolContext &sc) { +uint32_t +SymbolFileDWARFDebugMap::ResolveSymbolContext(const Address &exe_so_addr, + SymbolContextItem resolve_scope, + SymbolContext &sc) { uint32_t resolved_flags = 0; Symtab *symtab = m_obj_file->GetSymtab(); if (symtab) { @@ -760,7 +762,7 @@ uint32_t SymbolFileDWARFDebugMap::ResolveSymbolContext( const FileSpec &file_spec, uint32_t line, bool check_inlines, - uint32_t resolve_scope, SymbolContextList &sc_list) { + SymbolContextItem resolve_scope, SymbolContextList &sc_list) { const uint32_t initial = sc_list.GetSize(); const uint32_t cu_count = GetNumCompileUnits(); Index: source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h =================================================================== --- source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h +++ source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h @@ -109,7 +109,8 @@ } Type *ResolveTypeUID(lldb::user_id_t type_uid) override; bool CompleteType(CompilerType &compiler_type) override; - uint32_t ResolveSymbolContext(const Address &so_addr, uint32_t resolve_scope, + uint32_t ResolveSymbolContext(const Address &so_addr, + lldb::SymbolContextItem resolve_scope, SymbolContext &sc) override; size_t GetTypes(SymbolContextScope *sc_scope, uint32_t type_mask, Index: source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp =================================================================== --- source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp +++ source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp @@ -960,9 +960,8 @@ return (resolve_scope & flags) != 0; } -uint32_t SymbolFileNativePDB::ResolveSymbolContext(const Address &addr, - uint32_t resolve_scope, - SymbolContext &sc) { +uint32_t SymbolFileNativePDB::ResolveSymbolContext( + const Address &addr, SymbolContextItem resolve_scope, SymbolContext &sc) { uint32_t resolved_flags = 0; lldb::addr_t file_addr = addr.GetFileAddress(); Index: source/Plugins/SymbolFile/PDB/SymbolFilePDB.h =================================================================== --- source/Plugins/SymbolFile/PDB/SymbolFilePDB.h +++ source/Plugins/SymbolFile/PDB/SymbolFilePDB.h @@ -100,12 +100,13 @@ ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override; uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override; uint32_t ResolveSymbolContext(const lldb_private::FileSpec &file_spec, uint32_t line, - bool check_inlines, uint32_t resolve_scope, + bool check_inlines, + lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContextList &sc_list) override; uint32_t Index: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp =================================================================== --- source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp @@ -684,7 +684,7 @@ uint32_t SymbolFilePDB::ResolveSymbolContext(const lldb_private::Address &so_addr, - uint32_t resolve_scope, + SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) { uint32_t resolved_flags = 0; if (resolve_scope & eSymbolContextCompUnit || @@ -744,7 +744,7 @@ uint32_t SymbolFilePDB::ResolveSymbolContext( const lldb_private::FileSpec &file_spec, uint32_t line, bool check_inlines, - uint32_t resolve_scope, lldb_private::SymbolContextList &sc_list) { + SymbolContextItem resolve_scope, lldb_private::SymbolContextList &sc_list) { const size_t old_size = sc_list.GetSize(); if (resolve_scope & lldb::eSymbolContextCompUnit) { // Locate all compilation units with line numbers referencing the specified Index: source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h =================================================================== --- source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h +++ source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h @@ -84,7 +84,7 @@ bool CompleteType(lldb_private::CompilerType &compiler_type) override; uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override; size_t GetTypes(lldb_private::SymbolContextScope *sc_scope, Index: source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp =================================================================== --- source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp +++ source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp @@ -244,7 +244,7 @@ } uint32_t SymbolFileSymtab::ResolveSymbolContext(const Address &so_addr, - uint32_t resolve_scope, + SymbolContextItem resolve_scope, SymbolContext &sc) { if (m_obj_file->GetSymtab() == NULL) return 0; Index: source/Symbol/CompileUnit.cpp =================================================================== --- source/Symbol/CompileUnit.cpp +++ source/Symbol/CompileUnit.cpp @@ -278,7 +278,8 @@ uint32_t CompileUnit::ResolveSymbolContext(const FileSpec &file_spec, uint32_t line, bool check_inlines, - bool exact, uint32_t resolve_scope, + bool exact, + SymbolContextItem resolve_scope, SymbolContextList &sc_list) { // First find all of the file indexes that match our "file_spec". If // "file_spec" has an empty directory, then only compare the basenames when Index: source/Symbol/SymbolFile.cpp =================================================================== --- source/Symbol/SymbolFile.cpp +++ source/Symbol/SymbolFile.cpp @@ -97,7 +97,7 @@ uint32_t SymbolFile::ResolveSymbolContext(const FileSpec &file_spec, uint32_t line, bool check_inlines, - uint32_t resolve_scope, + lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) { return 0; } Index: source/Symbol/SymbolVendor.cpp =================================================================== --- source/Symbol/SymbolVendor.cpp +++ source/Symbol/SymbolVendor.cpp @@ -235,7 +235,7 @@ } uint32_t SymbolVendor::ResolveSymbolContext(const Address &so_addr, - uint32_t resolve_scope, + SymbolContextItem resolve_scope, SymbolContext &sc) { ModuleSP module_sp(GetModule()); if (module_sp) { @@ -248,7 +248,7 @@ uint32_t SymbolVendor::ResolveSymbolContext(const FileSpec &file_spec, uint32_t line, bool check_inlines, - uint32_t resolve_scope, + SymbolContextItem resolve_scope, SymbolContextList &sc_list) { ModuleSP module_sp(GetModule()); if (module_sp) { Index: source/Target/StackFrame.cpp =================================================================== --- source/Target/StackFrame.cpp +++ source/Target/StackFrame.cpp @@ -35,6 +35,8 @@ #include "lldb/Target/Thread.h" #include "lldb/Utility/RegisterValue.h" +#include "lldb/lldb-enumerations.h" + using namespace lldb; using namespace lldb_private; @@ -262,7 +264,8 @@ // StackFrame object, everyone will have as much information as possible and no // one will ever have to look things up manually. //---------------------------------------------------------------------- -const SymbolContext &StackFrame::GetSymbolContext(uint32_t resolve_scope) { +const SymbolContext & +StackFrame::GetSymbolContext(SymbolContextItem resolve_scope) { std::lock_guard guard(m_mutex); // Copy our internal symbol context into "sc". if ((m_flags.Get() & resolve_scope) != resolve_scope) { @@ -314,7 +317,7 @@ // haven't already tried to lookup one of those things. If we haven't // then we will do the query. - uint32_t actual_resolve_scope = 0; + SymbolContextItem actual_resolve_scope = SymbolContextItem(0); if (resolve_scope & eSymbolContextCompUnit) { if (m_flags.IsClear(eSymbolContextCompUnit)) {