Skip to content

Commit

Permalink
test_line_info now passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha Nicolas committed Jul 13, 2017
1 parent c9dc674 commit 2268b75
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions symtabAPI/src/Object-elf.C
Expand Up @@ -4324,7 +4324,6 @@ void Object::parseLineInfoForCU(Dwarf_Die cuDIE, LineInformation* li_for_module)
{
return;
}

StringTablePtr strings(li_for_module->getStrings());
Dwarf_Files * files;
size_t offset = strings->size();
Expand Down Expand Up @@ -4354,7 +4353,6 @@ void Object::parseLineInfoForCU(Dwarf_Die cuDIE, LineInformation* li_for_module)
}
}
li_for_module->setStrings(strings);

/* 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. */
Expand Down Expand Up @@ -4395,13 +4393,28 @@ void Object::parseLineInfoForCU(Dwarf_Die cuDIE, LineInformation* li_for_module)
if (result)
current_statement.start_addr = new_lineAddr;
}
//TODO

//status = dwarf_line_srcfileno(line, &current_statement.string_table_index);
//if ( status != 0 ) {
// cout << "dwarf_line_srcfileno failed" << endl;
// continue;
//}
//current_statement.string_table_index += offset;
const char * file_name = dwarf_linesrc(line, NULL, NULL);
if ( !file_name ) {
cout << "dwarf_line_srcfileno failed" << endl;
continue;
}
std::string file_name_str(file_name);
int index = -1;
for(size_t idx = offset; idx < strings->size(); ++idx)
{
if((*strings)[idx].str==file_name_str)
{
index = idx;
break;
}
}
if( index == -1 ) {
cout << "dwarf_line_srcfileno failed" << endl;
continue;
}
current_statement.string_table_index = index;

bool isEndOfSequence;
status = dwarf_lineendsequence(line, &isEndOfSequence);
Expand Down

0 comments on commit 2268b75

Please sign in to comment.