Sha256: b258a1bfebf42e4cb863fec02f3354241c202a31de100b509ec279f9fe851fbf

Contents?: true

Size: 908 Bytes

Versions: 22

Compression:

Stored size: 908 Bytes

Contents

#!/usr/bin/env ruby

require 'ragweed'

filename = ARGV[0]
pid = ARGV[1].to_i

raise "hittracertux.rb FILE PID" if (ARGV.size < 2 or pid <= 0)

opts = {}
d = Ragweed::Debuggertux.new(pid, opts)
d.attach

File.open(filename, "r") do |fd|
  lines = fd.readlines
  lines.map {|x| x.chomp}
  lines.each do |tl|
    fn, addr = tl.split(",", 2)
    d.breakpoint_set(addr.to_i(16), fn, (bpl = lambda do puts "hit - #{fn} #{addr}\n"; end))
  end
end

d.install_bps
d.continue
catch(:throw) { d.loop }

# An IDC script for generating the text file this hit tracer requires
=begin
#include <idc.idc>

static main()
{
  auto entry, fname, outf, fd;
  outf = AskFile(1, "*.txt", "Please select an output file");
  fd = fopen(outf,"w");
   
	for(entry=NextFunction(0); entry  != BADADDR; entry=NextFunction(entry) )
	{
		fname = GetFunctionName(entry);
		fprintf(fd, "%s,0x%x\n", fname, entry);
 	}

  fclose(fd);
}
=end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ragweed-0.2.9 examples/hittracertux.rb
ragweed-0.2.8 examples/hittracertux.rb
ragweed-0.2.7 examples/hittracertux.rb
ragweed-0.2.6-java examples/hittracertux.rb
ragweed-0.2.6 examples/hittracertux.rb
ragweed-0.2.5-java examples/hittracertux.rb
ragweed-0.2.5 examples/hittracertux.rb
ragweed-0.2.4-java examples/hittracertux.rb
ragweed-0.2.4 examples/hittracertux.rb
ragweed-0.2.3-java examples/hittracertux.rb
ragweed-0.2.3 examples/hittracertux.rb
ragweed-0.2.2 examples/hittracertux.rb
ragweed-0.2.1-java examples/hittracertux.rb
ragweed-0.2.1 examples/hittracertux.rb
ragweed-0.2.0-java examples/hittracertux.rb
ragweed-0.2.0 examples/hittracertux.rb
ragweed-0.2.0.pre3-java examples/hittracertux.rb
ragweed-0.2.0.pre3 examples/hittracertux.rb
ragweed-0.2.0.pre2-java examples/hittracertux.rb
ragweed-0.2.0.pre2 examples/hittracertux.rb