Forgot to add modified files for the last commit!

http://breakpad.appspot.com/33002

A=jim.blandy
R=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/branches/linux-dwarf@415 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
nealsid 2009-10-08 19:20:06 +00:00
parent 11fbf26119
commit 01ca4892d8
6 changed files with 82 additions and 9 deletions

View File

@ -486,5 +486,40 @@ enum DwarfOpcode {
DW_OP_GNU_push_tls_address =0xe0
};
// Source languages. These are values for DW_AT_language.
enum DwarfLanguage
{
DW_LANG_none =0x0000,
DW_LANG_C89 =0x0001,
DW_LANG_C =0x0002,
DW_LANG_Ada83 =0x0003,
DW_LANG_C_plus_plus =0x0004,
DW_LANG_Cobol74 =0x0005,
DW_LANG_Cobol85 =0x0006,
DW_LANG_Fortran77 =0x0007,
DW_LANG_Fortran90 =0x0008,
DW_LANG_Pascal83 =0x0009,
DW_LANG_Modula2 =0x000a,
DW_LANG_Java =0x000b,
DW_LANG_C99 =0x000c,
DW_LANG_Ada95 =0x000d,
DW_LANG_Fortran95 =0x000e,
DW_LANG_PLI =0x000f,
DW_LANG_ObjC =0x0010,
DW_LANG_ObjC_plus_plus =0x0011,
DW_LANG_UPC =0x0012,
DW_LANG_D =0x0013,
// Implementation-defined language code range.
DW_LANG_lo_user = 0x8000,
DW_LANG_hi_user = 0xffff,
// Extensions.
// MIPS assembly language. The GNU toolchain uses this for all
// assembly languages, since there's no generic DW_LANG_ value for that.
DW_LANG_Mips_Assembler =0x8001,
DW_LANG_Upc =0x8765 // Unified Parallel C
};
} // namespace dwarf2reader
#endif // COMMON_DWARF_DWARF2ENUMS_H__

View File

@ -815,16 +815,18 @@ void LineInfo::ReadLines() {
lengthstart += 4;
const char* lineptr = after_header_;
lsm.Reset(header_.default_is_stmt);
while (lineptr < lengthstart + header_.total_length) {
lsm.Reset(header_.default_is_stmt);
while (!lsm.end_sequence) {
size_t oplength;
bool add_line = ProcessOneOpcode(reader_, handler_, header_,
lineptr, &lsm, &oplength, (uintptr_t)-1, NULL);
if (add_line)
handler_->AddLine(lsm.address, lsm.file_num, lsm.line_num,
lsm.column_num);
lineptr += oplength;
size_t oplength;
bool add_line = ProcessOneOpcode(reader_, handler_, header_,
lineptr, &lsm, &oplength, (uintptr_t)-1, NULL);
lineptr += oplength;
if (lsm.end_sequence) {
handler_->EndSequence(lsm.address);
lsm.Reset(header_.default_is_stmt);
} else if (add_line) {
handler_->AddLine(lsm.address, lsm.file_num, lsm.line_num,
lsm.column_num);
}
}

View File

@ -173,6 +173,16 @@ class LineInfoHandler {
// starts at, if we know it (0 otherwise).
virtual void AddLine(uint64 address, uint32 file_num, uint32 line_num,
uint32 column_num) { }
// Called at the end of a sequence of lines. ADDRESS is the address
// of the first byte after the final machine instruction of the
// sequence.
//
// Note that this is *not* necessarily the end of the line data for
// the compilation unit: a single compilation unit's line program
// may contain several "end of sequence" markers, to describe (for
// example) several discontiguous regions of code.
virtual void EndSequence(uint64 address) { }
};
// The base of DWARF2/3 debug info is a DIE (Debugging Information

View File

@ -121,6 +121,17 @@ void CULineInfoHandler::AddLine(uint64 address, uint32 file_num,
}
}
void CULineInfoHandler::EndSequence(uint64 address) {
// To preserve this code's behavior prior to the addition of the
// EndSequence member function, we duplicate the previous line,
// changing its address to ADDRESS.
LineMap::iterator it = linemap_->lower_bound(address);
if (it != linemap_->begin()) {
it--;
linemap_->insert(make_pair(address, it->second));
}
}
bool CUFunctionInfoHandler::StartCompilationUnit(uint64 offset,
uint8 address_size,
uint8 offset_size,

View File

@ -99,6 +99,16 @@ class CULineInfoHandler: public LineInfoHandler {
virtual void AddLine(uint64 address, uint32 file_num, uint32 line_num,
uint32 column_num);
// Called at the end of a sequence of lines. ADDRESS is the address
// of the first byte after the final machine instruction of the
// sequence.
//
// Note that this is *not* necessarily the end of the line data for
// the compilation unit: a single compilation unit's line program
// may contain several "end of sequence" markers, to describe (for
// example) several discontiguous regions of code.
virtual void EndSequence(uint64 address);
private:
LineMap* linemap_;

View File

@ -19,10 +19,12 @@ all:$(BIN)
TOP = ../../../..
VPATH = $(TOP)/src/common/linux
VPATH += $(TOP)/src/common
VPATH += $(TOP)/src/common/dwarf
DUMP_OBJ = \
dump_symbols.o \
dump_syms.o \
dwarf2diehandler.o \
file_id.o \
guid_creator.o \
md5.o \
@ -46,5 +48,8 @@ file_id.o: file_id.cc
# From src/common:
md5.o: md5.c
# From src/common/dwarf:
dwarf2diehandler.o: dwarf2diehandler.cc
clean:
rm -f $(BIN) $(DUMP_OBJ)