V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
platoo
V2EX  ›  Linux

有没有涉及到 strace, pmap, nm, objdump 以及 objcopy 这些命令的Linux图书?

  •  
  •   platoo · 2012-11-29 11:27:25 +08:00 · 4087 次点击
    这是一个创建于 4168 天前的主题,其中的信息可能已经有所发展或是发生改变。
    这是一个教授布置的作业,要搞明白这些命令的使用和含义。看了一天文档,太抽象了搞不定啊。请问是否有专门介绍这些命令实现以及使用的书啊?跪谢!
    8 条回复    1970-01-01 08:00:00 +08:00
    SErHo
        1
    SErHo  
       2012-11-29 11:32:32 +08:00
    有一本书叫 Google!还有一本书叫 man!
    platoo
        2
    platoo  
    OP
       2012-11-29 11:48:39 +08:00
    @SErHo 谢谢,我的问题没有写清楚,抱歉。主要想了解命令的原理,以及打印信息的含义,感觉要搞清楚这些需要理解命令的实现什么的。刚找到 linker and loaders,好像是一个门路的?
    Js
        3
    Js  
       2012-11-29 11:49:39 +08:00
    <<binary hacks>>应该有,篇幅多不多就记不得了, 日本人写的, o'reilly出的, 国内翻译的名字很奇葩,叫<<黑客秘笈100选>>
    binux
        4
    binux  
       2012-11-29 11:59:37 +08:00
    <程序员的自我修养>
    likuku
        5
    likuku  
       2012-11-29 12:06:04 +08:00   ❤️ 2
    「主要想了解命令的原理,以及打印信息的含义,感觉要搞清楚这些需要理解命令的实现什么的」
    去看源码可能是最佳方式,代码就是这些命令的设计理念和实现方式的最形象呈现。

    freebsd 下查到
    % whereis strace
    strace: /usr/ports/devel/strace
    % cat /usr/ports/devel/strace/pkg-descr
    Strace is a process tracer, i.e. a debugging tool that prints out
    a trace of all the system calls made and signals received by a
    process itself or a process and its descendants.

    Strace is similar to the native BSD ``truss'' utility, but it's
    output style is more convenient in most cases.

    For strace to work, procfs has to be mounted. FreeBSD does not
    mount it by default. For more information, man procfs.

    WWW: http://sourceforge.net/projects/strace/
    # 以上为strace官网,也能下载到源码包

    % whereis pmap
    pmap: /usr/ports/sysutils/pmap
    cat /usr/ports/sysutils/pmap/pkg-descr
    % cat /usr/ports/sysutils/pmap/pkg-descr
    pmap is an utility for displaying the address space of a process.

    Author: Roman V. Palagin <[email protected]>
    WWW: ftp://ftp.wuppy.net.ru/pub/FreeBSD/local/pmap/
    # 同上

    ------
    以下的都属于freebsd的base system,所以自己下载freebsd官方源码包(ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/9.0-RELEASE/src.txz) tar和gunzip解压成 src 目录再去对应路径下去找就是了。
    % whereis nm
    nm: /usr/bin/nm /usr/share/man/en.UTF-8/man1/nm.1.gz /usr/src/gnu/usr.bin/binutils/nm
    % whereis objdump
    objdump: /usr/bin/objdump /usr/share/man/en.UTF-8/man1/objdump.1.gz /usr/src/gnu/usr.bin/binutils/objdump
    % whereis objcopy
    objcopy: /usr/bin/objcopy /usr/share/man/en.UTF-8/man1/objcopy.1.gz /usr/src/gnu/usr.bin/binutils/objcopy
    nodenode
        6
    nodenode  
       2012-11-29 14:10:38 +08:00
    同推荐 “程序员的自我修养”
    jjgod
        7
    jjgod  
       2012-11-30 05:24:33 +08:00
    就看 Linkers and Loaders 吧。
    hanf
        8
    hanf  
       2012-11-30 08:37:27 +08:00
    《binary hacks》
    没有更好的了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5811 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:32 · PVG 10:32 · LAX 19:32 · JFK 22:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.