small bug fixes

This commit is contained in:
Sami Samhuri 2013-01-20 22:51:10 -08:00
parent e77ac481d8
commit 20c758ae85
2 changed files with 3 additions and 2 deletions

View file

@ -327,8 +327,8 @@ if $0 == __FILE__
puts MachHeader::MemberSizes.inspect
puts "# of MachHeader members: " + MachHeader.size.to_s + ", size in bytes: " + MachHeader.bytesize.to_s
mh = MachHeader.new(0xfeedface, 7, 3, "foobar")
%w[magic, cputype, cpusubtype, segname].each do |field|
puts "#{field}(#{MachHeader.sizeof(field.to_sym)}): " + mh[field.to_sym].inspect
%w[magic cputype cpusubtype segname].each do |field|
puts "#{field}(#{MachHeader.sizeof(field.to_sym)}): #{mh[field.to_sym].inspect}"
end
puts mh.pack_pattern.inspect
binstr = mh.serialize

View file

@ -10,6 +10,7 @@ require 'build'
def main
func = ARGV.shift
outdir = ARGV.shift || '.'
Dir.mkdir(outdir) unless File.exists?(outdir)
binformat = (ARGV.shift || 'elf').downcase
format = (ARGV.shift || 'asm').downcase
platform = `uname -s`.chomp.downcase