aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorCraig Silverstein <csilvers@google.com>2008-05-01 00:25:33 +0000
committerCraig Silverstein <csilvers@google.com>2008-05-01 00:25:33 +0000
commite4e5049b7bb41c36b6696a59f59eaafee95aedb1 (patch)
tree461b3fb5fa13581bb234dbd13c08d19160b35c9c /gold/symtab.cc
parentf089c43345c097a7f604adcb0dcbef301d57ef93 (diff)
downloadgdb-e4e5049b7bb41c36b6696a59f59eaafee95aedb1.zip
gdb-e4e5049b7bb41c36b6696a59f59eaafee95aedb1.tar.gz
gdb-e4e5049b7bb41c36b6696a59f59eaafee95aedb1.tar.bz2
* dwarf_reader.cc (next_generation_count): New static var.
(Addr2line_cache_entry): New struct. (addr2line_cache): New static var. (Dwarf_line_info::one_addr2line): Added caching. (Dwarf_line_info::clear_addr2line_cache): New function. * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add cache-size parameter. (Dwarf_line_info::one_addr2line_cache): New function. * symtab.cc (Symbol_table::detect_odr_violations): Pass new cache-size argument to one_addr2line(), and clear cache.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index eeb32fd..170a209 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -2343,10 +2343,12 @@ Symbol_table::detect_odr_violations(const Task* task,
// want to run this in a general Task for better
// performance, we will need one Task for object, plus
// appropriate locking to ensure that we don't conflict with
- // other uses of the object.
+ // other uses of the object. Also note, one_addr2line is not
+ // currently thread-safe.
Task_lock_obj<Object> tl(task, locs->object);
+ // 16 is the size of the object-cache that one_addr2line should use.
std::string lineno = Dwarf_line_info::one_addr2line(
- locs->object, locs->shndx, locs->offset);
+ locs->object, locs->shndx, locs->offset, 16);
if (!lineno.empty())
line_nums.insert(lineno);
}
@@ -2362,6 +2364,8 @@ Symbol_table::detect_odr_violations(const Task* task,
fprintf(stderr, " %s\n", it2->c_str());
}
}
+ // We only call one_addr2line() in this function, so we can clear its cache.
+ Dwarf_line_info::clear_addr2line_cache();
}
// Warnings functions.