aboutsummaryrefslogtreecommitdiff
path: root/gold/dwarf_reader.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2013-03-01 22:53:02 +0000
committerCary Coutant <ccoutant@google.com>2013-03-01 22:53:02 +0000
commita68a081d64d23c94aae82a9111024cbee879ab57 (patch)
treed97481bf4e1294899a81e80e34bd7951aee6b23a /gold/dwarf_reader.h
parent69e2f9c4dcf6b15f501ba0fb81be7ea1ae3c7fc7 (diff)
downloadgdb-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.h')
-rw-r--r--gold/dwarf_reader.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/gold/dwarf_reader.h b/gold/dwarf_reader.h
index 2a8e56e..0285ca8 100644
--- a/gold/dwarf_reader.h
+++ b/gold/dwarf_reader.h
@@ -799,9 +799,21 @@ class Dwarf_info_reader
{ this->reloc_mapper_->reset(checkpoint); }
private:
+ // Print a warning about a corrupt debug section.
+ void
+ warn_corrupt_debug_section() const;
+
// Check that P is within the bounds of the current section.
bool
- check_buffer(const unsigned char* p) const;
+ check_buffer(const unsigned char* p) const
+ {
+ if (p > this->buffer_ + this->cu_offset_ + this->cu_length_)
+ {
+ this->warn_corrupt_debug_section();
+ return false;
+ }
+ return true;
+ }
// Read the DWARF string table.
bool