diff options
author | Cary Coutant <ccoutant@google.com> | 2013-03-01 22:53:02 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2013-03-01 22:53:02 +0000 |
commit | a68a081d64d23c94aae82a9111024cbee879ab57 (patch) | |
tree | d97481bf4e1294899a81e80e34bd7951aee6b23a /gold/dwarf_reader.cc | |
parent | 69e2f9c4dcf6b15f501ba0fb81be7ea1ae3c7fc7 (diff) | |
download | gdb-a68a081d64d23c94aae82a9111024cbee879ab57.zip gdb-a68a081d64d23c94aae82a9111024cbee879ab57.tar.gz gdb-a68a081d64d23c94aae82a9111024cbee879ab57.tar.bz2 |
gold/
* dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
function into class definition in header file.
(Dwarf_info_reader::warn_corrupt_debug_section): New function.
* dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
New function.
(Dwarf_info_reader::check_buffer): Move here from .cc file.
Diffstat (limited to 'gold/dwarf_reader.cc')
-rw-r--r-- | gold/dwarf_reader.cc | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc index ec0e845..de41418 100644 --- a/gold/dwarf_reader.cc +++ b/gold/dwarf_reader.cc @@ -1141,21 +1141,6 @@ Dwarf_die::sibling_offset() // class Dwarf_info_reader -// Check that the pointer P is within the current compilation unit. - -inline bool -Dwarf_info_reader::check_buffer(const unsigned char* p) const -{ - if (p > this->buffer_ + this->cu_offset_ + this->cu_length_) - { - gold_warning(_("%s: corrupt debug info in %s"), - this->object_->name().c_str(), - this->object_->section_name(this->shndx_).c_str()); - return false; - } - return true; -} - // Begin parsing the debug info. This calls visit_compilation_unit() // or visit_type_unit() for each compilation or type unit found in the // section, and visit_die() for each top-level DIE. @@ -1447,6 +1432,16 @@ Dwarf_info_reader::visit_type_unit(off_t, off_t, uint64_t, Dwarf_die*) { } +// Print a warning about a corrupt debug section. + +void +Dwarf_info_reader::warn_corrupt_debug_section() const +{ + gold_warning(_("%s: corrupt debug info in %s"), + this->object_->name().c_str(), + this->object_->section_name(this->shndx_).c_str()); +} + // class Sized_dwarf_line_info struct LineStateMachine |