From: Ian Lance Taylor Date: Wed, 14 Nov 2007 18:33:47 +0000 (+0000) Subject: From Craig Silverstein: Clean up DWARF line reader code. X-Git-Tag: sid-snapshot-20071201~145 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a18f2bd699004425944ed7633fdd792a6e332c96;p=platform%2Fupstream%2Fbinutils.git From Craig Silverstein: Clean up DWARF line reader code. --- diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc index d07e3e7..e3e1963 100644 --- a/gold/dwarf_reader.cc +++ b/gold/dwarf_reader.cc @@ -630,7 +630,7 @@ Sized_dwarf_line_info::do_addr2line(unsigned int shndx, // If we found an exact match, great, otherwise find the last entry // before the passed-in offset. - if (it->offset > offset) + if (it == offsets->end() || it->offset > offset) { if (it == offsets->begin()) return ""; @@ -673,10 +673,6 @@ Sized_dwarf_line_info::do_addr2line(unsigned int shndx, // Dwarf_line_info routines. -// Note: this routine instantiates the appropriate -// Sized_dwarf_line_info templates for this config, so we don't have -// to have a separte instantiation section for them. - std::string Dwarf_line_info::one_addr2line(Object* object, unsigned int shndx, off_t offset) diff --git a/gold/dwarf_reader.h b/gold/dwarf_reader.h index cefc027..4ce65b0 100644 --- a/gold/dwarf_reader.h +++ b/gold/dwarf_reader.h @@ -72,16 +72,12 @@ class Dwarf_line_info }; template -class Sized_dwarf_line_info +class Sized_dwarf_line_info : public Dwarf_line_info { public: // Initializes a .debug_line reader for a given object file. Sized_dwarf_line_info(Object* object); - std::string - addr2line(unsigned int shndx, off_t offset) - { return do_addr2line(shndx, offset); } - private: std::string do_addr2line(unsigned int shndx, off_t offset);