diff options
author | Ian Lance Taylor <iant@google.com> | 2007-11-13 01:26:27 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-11-13 01:26:27 +0000 |
commit | af674d1d6c9874056b9893f3f8c3b60464d6380f (patch) | |
tree | 477fd45b410a0ecb150f3756c6142b83aa7e8fc0 /gold/dwarf_reader.h | |
parent | merge from gcc (diff) | |
download | binutils-gdb-af674d1d6c9874056b9893f3f8c3b60464d6380f.tar.gz binutils-gdb-af674d1d6c9874056b9893f3f8c3b60464d6380f.tar.bz2 binutils-gdb-af674d1d6c9874056b9893f3f8c3b60464d6380f.zip |
From Craig Silverstein: Support debug info for shared libraries.
Diffstat (limited to 'gold/dwarf_reader.h')
-rw-r--r-- | gold/dwarf_reader.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/gold/dwarf_reader.h b/gold/dwarf_reader.h index c5347e4f77a..d35cbf10bae 100644 --- a/gold/dwarf_reader.h +++ b/gold/dwarf_reader.h @@ -90,6 +90,10 @@ class Dwarf_line_info process_one_opcode(const unsigned char* start, struct LineStateMachine* lsm, size_t* len); + // Some parts of processing differ depending on whether the input + // was a .o file or not. + bool input_is_relobj(); + // If we saw anything amiss while parsing, we set this to false. // Then addr2line will always fail (rather than return possibly- // corrupt data). @@ -123,15 +127,20 @@ class Dwarf_line_info // This is used to figure out what section to apply a relocation to. const unsigned char* symtab_buffer_; - const unsigned char* symtab_buffer_end_; + off_t symtab_buffer_size_; - // Holds the directories and files as we see them. - std::vector<std::string> directories_; + // 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 + // there will just be one, but there may be more if input is a .so). + std::vector<std::vector<std::string> > directories_; // The first part is an index into directories_, the second the filename. - std::vector< std::pair<int, std::string> > files_; + std::vector<std::vector< std::pair<int, std::string> > > files_; + + // An index into the current directories_ and files_ vectors. + int current_header_index_; - // A map from offset of the relocation target to the shndx and - // addend for the relocation. + // A sorted map from offset of the relocation target to the shndx + // and addend for the relocation. typedef std::map<typename elfcpp::Elf_types<size>::Elf_Addr, std::pair<unsigned int, typename elfcpp::Elf_types<size>::Elf_Swxword> > @@ -143,8 +152,9 @@ class Dwarf_line_info 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; + 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; } |