Skip to content

Commit

Permalink
Warning cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrwilliams committed Oct 31, 2016
1 parent 74febd6 commit c52f9e4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 18 deletions.
14 changes: 14 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/webServers.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 14 additions & 18 deletions symtabAPI/src/Object-elf.C
Expand Up @@ -4324,18 +4324,14 @@ void Object::parseLineInfoForCU(Dwarf_Die cuDIE, LineInformation* li_for_module)
}

assert( status == DW_DLV_OK );
char** srcfiles;
Dwarf_Signed fileCount;

status = dwarf_srcfiles(cuDIE, &srcfiles, &fileCount, NULL);
/* The 'lines' returned are actually interval markers; the code
generated from lineNo runs from lineAddr up to but not including
the lineAddr of the next line. */
bool isPreviousValid = false;
Dwarf_Unsigned previousLineNo = 0;
Dwarf_Signed previousLineColumn = 0;
Dwarf_Addr previousLineAddr = 0x0;
Dwarf_Unsigned previousLineSource = NULL;
char * previousLineSource = NULL;

Offset baseAddr = getBaseAddress();

Expand Down Expand Up @@ -4375,10 +4371,8 @@ void Object::parseLineInfoForCU(Dwarf_Die cuDIE, LineInformation* li_for_module)


char * lineSource;
Dwarf_Unsigned srcfileindex;
status = dwarf_line_srcfileno(lineBuffer[i], &srcfileindex, NULL);
status = dwarf_linesrc( lineBuffer[i], & lineSource, NULL );
if ( status != DW_DLV_OK ) { continue; }
lineSource = srcfiles[srcfileindex];

Dwarf_Bool isEndOfSequence;
status = dwarf_lineendsequence( lineBuffer[i], & isEndOfSequence, NULL );
Expand All @@ -4389,20 +4383,26 @@ void Object::parseLineInfoForCU(Dwarf_Die cuDIE, LineInformation* li_for_module)
/* If we're talking about the same (source file, line number) tuple,
and it isn't the end of the sequence, we can coalesce the range.
(The end of sequence marker marks discontinuities in the ranges.) */
if ( lineNo == previousLineNo && ( srcfileindex == previousLineSource )
if ( lineNo == previousLineNo && strcmp( lineSource, previousLineSource ) == 0
&& ! isEndOfSequence )
{
/* Don't update the prev* values; just keep going until we hit the end of
a sequence or new sourcefile. */
continue;
} /* end if we can coalesce this range */

char *canonicalLineSource = srcfiles[previousLineSource];
char *canonicalLineSource;
if (truncateLineFilenames) {
canonicalLineSource = strrchr( srcfiles[previousLineSource], '/' );
if( canonicalLineSource == NULL ) { canonicalLineSource = srcfiles[previousLineSource]; }
canonicalLineSource = strrchr( previousLineSource, '/' );
if( canonicalLineSource == NULL ) { canonicalLineSource = previousLineSource; }
else { ++canonicalLineSource; }
}
else {
canonicalLineSource = previousLineSource;
}




Dyninst::Offset startAddrToUse = previousLineAddr;
Dyninst::Offset endAddrToUse = lineAddr;
Expand All @@ -4428,8 +4428,9 @@ void Object::parseLineInfoForCU(Dwarf_Die cuDIE, LineInformation* li_for_module)
isPreviousValid = false;
}
else {
if( isPreviousValid ) { dwarf_dealloc( dbg, previousLineSource, DW_DLA_STRING ); }
previousLineNo = lineNo;
previousLineSource = srcfileindex;
previousLineSource = lineSource;
previousLineAddr = lineAddr;
previousLineColumn = lineOff;

Expand All @@ -4439,11 +4440,6 @@ void Object::parseLineInfoForCU(Dwarf_Die cuDIE, LineInformation* li_for_module)

/* Free this CU's source lines. */
dwarf_srclines_dealloc(dbg, lineBuffer, lineCount);
for(int i = 0; i < fileCount; ++i)
{
dwarf_dealloc(dbg, srcfiles[i], DW_DLA_STRING);
}
dwarf_dealloc(dbg, srcfiles, DW_DLA_LIST);
}


Expand Down

0 comments on commit c52f9e4

Please sign in to comment.