summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-07-30 08:20:05 +0000
committerPavel Labath <pavel@labath.sk>2019-07-30 08:20:05 +0000
commit656ddeb2b7c1a4a824446829e5b88b38307e1e08 (patch)
tree7dcf6dc4d9750f6a1aec5a87daab0fd9ee620fed /lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
parente3a4a13fcc0d23101f2dc71ffd0b9cedbc25c80c (diff)
downloadbcm5719-llvm-656ddeb2b7c1a4a824446829e5b88b38307e1e08.tar.gz
bcm5719-llvm-656ddeb2b7c1a4a824446829e5b88b38307e1e08.zip
SymbolVendor: Move locking into the Symbol Files
Summary: The last bit of functionality in SymbolVendor passthrough functions is the locking the module mutex. While it may be nice doing the locking in a central place, we weren't really succesful in doing that right now, because some SymbolFile function could still be called without going through the SymbolVendor. This meant in SymbolFileDWARF (the only battle-tested symbol file implementation) roughly a half of the functions was taking additional locks and another half was asserting that the lock is already held. By making the SymbolFile responsible for locking, we can at least make the situation in SymbolFileDWARF more consistent. Reviewers: clayborg, JDevlieghere, jingham, jdoerfert Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D65329 llvm-svn: 367298
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
index 42a5e85cb30..ec1a5bc568b 100644
--- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
+++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
@@ -228,6 +228,7 @@ size_t SymbolFileBreakpad::ParseFunctions(CompileUnit &comp_unit) {
}
bool SymbolFileBreakpad::ParseLineTable(CompileUnit &comp_unit) {
+ std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
CompUnitData &data = m_cu_data->GetEntryRef(comp_unit.GetID()).data;
if (!data.line_table_up)
@@ -239,6 +240,7 @@ bool SymbolFileBreakpad::ParseLineTable(CompileUnit &comp_unit) {
bool SymbolFileBreakpad::ParseSupportFiles(CompileUnit &comp_unit,
FileSpecList &support_files) {
+ std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
CompUnitData &data = m_cu_data->GetEntryRef(comp_unit.GetID()).data;
if (!data.support_files)
ParseLineTableAndSupportFiles(comp_unit, data);
@@ -251,6 +253,7 @@ uint32_t
SymbolFileBreakpad::ResolveSymbolContext(const Address &so_addr,
SymbolContextItem resolve_scope,
SymbolContext &sc) {
+ std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
if (!(resolve_scope & (eSymbolContextCompUnit | eSymbolContextLineEntry)))
return 0;
@@ -275,6 +278,7 @@ SymbolFileBreakpad::ResolveSymbolContext(const Address &so_addr,
uint32_t SymbolFileBreakpad::ResolveSymbolContext(
const FileSpec &file_spec, uint32_t line, bool check_inlines,
lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) {
+ std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
if (!(resolve_scope & eSymbolContextCompUnit))
return 0;
OpenPOWER on IntegriCloud