Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Line Counter .exe
05-07-2012, 09:32 AM (This post was last modified: 05-07-2012 09:40 AM by Francis.)
Post: #1
Line Counter .exe
Hello
here is a little tool that I devellopped to find the number of occurence of a line in a trace output.

For Example I have done a trace on a Gorgar rom to see what is the code that is executed for a particular switch. The Trace output is sometimes as long as 50 000 lines and most of those line are routine that are always executed. (Display score, music, etc.) So the trick is to find the line that are executed only once or twice.

So the program that I develloped take a .txt file like that:
*****
FA40: bne $FA3F
FA3F: dex
FA40: bne $FA3F
FA3F: dex
******

and transform it into an output file like that:
*******************
FA40: bne $FA3F **2**
FA3F: dex **2**
FA40: bne $FA3F **2**
FA3F: dex **2**

***************

the numbers between the ** ** is the number of times this line is on the file.

so to find a line that is there only once
you just have to do a find **1** in the output document
To use this program
you just have to drag a file into the Line_Counter.exe

the file will generate an output file with the same name + _Line_count_output.txt


Attached File(s)
.zip  Line_Counter.zip (Size: 9.64 KB / Downloads: 333)
Find all posts by this user
Quote this message in a reply
10-17-2012, 02:04 PM
Post: #2
RE: Line Counter .exe
Francis pthe numbers between the ** ** is the number of times this line is on the file.

so to find a line that is there only once
you just have to do a find **1** in the output document[hr Wrote:
To use this program
you just have to drag a file into the Line_Counter.exe

the file will generate an output file with the same name + _Line_count_output.txt

I know this tool helped you out because it's customizable, but notepad++ (free) will show and count all occurrences of a line. I found it to avoid writing a similar program, although now when I do trace dumps like you are describing, I pick a start and end point, changing the break points, and turning the trace on and off at those breakpoints.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)