Use N_ for option help strings, and call gettext when printing them.
[deliverable/binutils-gdb.git] / gold / dwarf_reader.h
index cefc0270c3a829bdc71854b2c34385fe453a349c..4d28518bcb66ee700eefd1c01d925d98e2b57672 100644 (file)
@@ -38,6 +38,19 @@ template<int size, bool big_endian>
 class Track_relocs;
 struct LineStateMachine;
 
+// We can't do better than to keep the offsets in a sorted vector.
+// Here, offset is the key, and file_num/line_num is the value.
+struct Offset_to_lineno_entry
+{
+  off_t offset;
+  int header_num;  // which file-list to use (i.e. which .o file are we in)
+  int file_num;    // a pointer into files_
+  int line_num;    // the line number in the source file
+  // Offsets are unique within a section, so that's a sufficient sort key.
+  bool operator<(const Offset_to_lineno_entry& that) const
+  { return this->offset < that.offset; }
+};
+
 // This class is used to read the line information from the debugging
 // section of an object file.
 
@@ -72,23 +85,23 @@ class Dwarf_line_info
 };
 
 template<int size, bool big_endian>
-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); }
+  // If SHNDX is specified and non-negative, only read the debug
+  // information that pertains to the specified section.
+  Sized_dwarf_line_info(Object* object, off_t read_shndx = -1U);
 
  private:
   std::string
   do_addr2line(unsigned int shndx, off_t offset);
 
   // Start processing line info, and populates the offset_map_.
+  // If SHNDX is non-negative, only store debug information that
+  // pertains to the specified section.
   void
-  read_line_mappings();
+  read_line_mappings(off_t shndx);
 
   // Reads the relocation section associated with .debug_line and
   // stores relocation information in reloc_map_.
@@ -108,9 +121,11 @@ class Sized_dwarf_line_info
   const unsigned char*
   read_header_tables(const unsigned char* lineptr);
 
-  // Reads the DWARF2/3 line information.
+  // Reads the DWARF2/3 line information.  If shndx is non-negative,
+  // discard all line information that doesn't pertain to the given
+  // section.
   const unsigned char*
-  read_lines(const unsigned char* lineptr);
+  read_lines(const unsigned char* lineptr, off_t shndx);
 
   // Process a single line info opcode at START using the state
   // machine at LSM.  Return true if we should define a line using the
@@ -157,7 +172,7 @@ class Sized_dwarf_line_info
 
   // This is used to figure out what section to apply a relocation to.
   const unsigned char* symtab_buffer_;
-  off_t symtab_buffer_size_;
+  section_size_type symtab_buffer_size_;
 
   // Holds the directories and files as we see them.  We have an array
   // of directory-lists, one for each .o file we're reading (usually
@@ -177,18 +192,6 @@ class Sized_dwarf_line_info
   Reloc_map;
   Reloc_map reloc_map_;
 
-  // We can't do better than to keep the offsets in a sorted vector.
-  // Here, offset is the key, and file_num/line_num is the value.
-  struct Offset_to_lineno_entry
-  {
-    off_t offset;
-    int header_num;  // which file-list to use (i.e. which .o file are we in)
-    int file_num;    // a pointer into files_
-    int line_num;    // the line number in the source file
-    // Offsets are unique within a section, so that's a sufficient sort key.
-    bool operator<(const Offset_to_lineno_entry& that) const
-    { return this->offset < that.offset; }
-  };
   // We have a vector of offset->lineno entries for every input section.
   typedef Unordered_map<unsigned int, std::vector<Offset_to_lineno_entry> >
   Lineno_map;
This page took 0.024775 seconds and 4 git commands to generate.