ติดตั้ง objdump (unix based)

 - by Nat
จะใช้งาน objdump แต่หาคำสั่งนี้ไม่เจอ เลยไปสืบค้นแล้วพบว่าต้องติดตั้ง binutils (objdump is part of binutils. )
ก็เลยจัดการติดตั้งด้วยคำสั่ง
sudo port -v install binutils
พอติดตั้งเสร็จก็ยังสั่ง objdump ไม่ได้ เลยลองค้นหาด้วยคำสั่ง
sudo find / -name “objdu*” -print
แล้วพบว่ามันอยู่ที่
/opt/local/i386-apple-darwin9.8.0/bin/objdump /opt/local/var/macports/software/binutils/2.20_1/opt/local/i386-apple-darwin9.8.0/bin/objdump
เลยลองสั่ง
opt/local/i386-apple-darwin9.8.0/bin/objdump
แก้ไข .profile เพื่อให้สามารถสั่ง objdump ได้เลย โดยเพิ่ม
export PATH=/opt/local/i386-apple-darwin9.8.0/bin:$PATH
แล้วลองสั่ง objdump จะได้ประมาณ
inazts-macbook:~ NAzT$ objdump Usage: objdump <option(s)> <file(s)> Display information from object <file(s)>. At least one of the following switches must be given: -a, –archive-headers    Display archive header information -f, –file-headers       Display the contents of the overall file header -p, –private-headers    Display object format specific file header contents -h, –[section-]headers  Display the contents of the section headers -x, –all-headers        Display the contents of all headers -d, –disassemble        Display assembler contents of executable sections -D, –disassemble-all    Display assembler contents of all sections -S, –source             Intermix source code with disassembly -s, –full-contents      Display the full contents of all sections requested -g, –debugging          Display debug information in object file -e, –debugging-tags     Display debug information using ctags style -G, –stabs              Display (in raw form) any STABS info in the file -W[lLiaprmfFsoR] or –dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=str,=loc,=Ranges] Display DWARF info in the file -t, –syms               Display the contents of the symbol table(s) -T, –dynamic-syms       Display the contents of the dynamic symbol table -r, –reloc              Display the relocation entries in the file -R, –dynamic-reloc      Display the dynamic relocation entries in the file @<file>                  Read options from <file> -v, –version            Display this program’s version number -i, –info               List object formats and architectures supported -H, –help               Display this information
อ้างอิงคำสั่งจาก http://osxbook.com/book/bonus/ancient/whatismacosx/tools.html

Related Blogs

เรื่องที่เกี่ยวข้อง