Skip to content

Commit

Permalink
Added the lldb_coverage analysis function
Browse files Browse the repository at this point in the history
  • Loading branch information
rogwfu committed Nov 6, 2014
1 parent 99304dd commit 067606a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/plympton/disassembly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ def evaluate(runtime="0")
return(result)
end

# Function to process hit tracing recorded by lldb
# @param [String] Path to a lldb trace file
def lldb_coverage(lldbTrace)
# Open the valgrind xml trace file
xmlFile = File.open(lldbTrace, "r")
xmlDoc = Nokogiri::XML(xmlFile)

# Delete any previous hit traces
@attributes.functionHitTrace.clear()

# Parse all the function hits
xmlDoc.xpath("//hit").each do |hit|
functionOffset = hit.search("offset").first().inner_text()
functionHits = hit.search("count").first().inner_text()
@attributes.functionHitTrace[functionOffset] = [functionHits.to_i()]
end

# FIXME: Add code to handle the markov matrix

# Cleanup open file
xmlFile.close()
end

# Function to process hit tracing recorded by Valgrind tools (rufus and callgrind)
# @param [String] Path to a valgrind trace file
def valgrind_coverage(valgrindTrace)
Expand Down

0 comments on commit 067606a

Please sign in to comment.