我想探索生命过程的记忆,当我这样做时,过程一定不会受到干扰 - 所以将gdb附加到进程(这会阻止它)不是一种选择.因此,我想从/ proc/kcore获取此信息(如果您知道另一种方法,请告诉我).所以我做了一个小实验.我创建了一个名为TEST的文件,里面只有"EXTRATESTEXTRA".然后我少用它打开它
$ less TEST
Run Code Online (Sandbox Code Playgroud)
我得到了这个过程的PID
$ ps aux | grep TEST
user 7785 0.0 0.0 17944 992 pts/8 S+ 16:15 0:00 less TEST
user 7798 0.0 0.0 13584 904 pts/9 S+ 16:16 0:00 grep TEST
Run Code Online (Sandbox Code Playgroud)
然后我使用此脚本创建所有文件的转储:
#!/bin/bash
grep rw-p /proc/$1/maps | sed -n 's/^\([0-9a-f]*\)-\([0-9a-f]*\) .*$/\1 \2/p' | while read start stop; do gdb --batch --pid $1 -ex "dump memory $1-$start-$stop.dump 0x$start 0x$stop"; done
Run Code Online (Sandbox Code Playgroud)
(我在这个网站上找到了它https://serverfault.com/questions/173999/dump-a-linux-processs-memory-to-file)
$ sudo ./dump_all_pid_memory.sh 7785
Run Code Online (Sandbox Code Playgroud)
在此之后,我在所有转储文件中查找"TRATESTEX":
$ grep -a -o -e '...TRATESTEX...' …Run Code Online (Sandbox Code Playgroud) 我正在尝试在ubuntu 12.04上构建boost:python示例.我从包管理器(而不是源代码)安装了库.我之前也没有使用过boost,并且没有为此设置任何环境变量(BOOST_BUILD_PATH未设置).我收到此错误:
/usr/share/doc/libboost1.46-doc/examples/libs/python/example/tutorial$ bjam --debug-configuration
notice: found boost-build.jam at /usr/share/doc/libboost1.46-doc/examples/libs/python/example/boost-build.jam
Unable to load Boost.Build: could not find build system.
---------------------------------------------------------
/usr/share/doc/libboost1.46-doc/examples/libs/python/example/boost-build.jam attempted to load the build system by invoking
'boost-build ../../../tools/build/v2 ;'
but we were unable to find "bootstrap.jam" in the specified directory
or in BOOST_BUILD_PATH (searching /usr/share/doc/libboost1.46-doc/examples/libs/python/example/../../../tools/build/v2, /usr/share/boost-build).
Please consult the documentation at 'http://www.boost.org'.
Run Code Online (Sandbox Code Playgroud)
我该如何解决?我应该在哪里指向BOOST_BUILD_PATH?