⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpatrol.texi

📁 debug source code under unix platform.
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
The library and tools can be built using the GNU autoconf, automake and libtoolutilities.  Build scripts are also supplied to build both installation packagesand binary distributions.  A Linux Software Map file is also provided.@cindex test suite@itemA small test suite is provided in order to test basic features.@itemUser documentation is currently available in @TeX{}info format as well as UNIXmanual pages and a quick reference card.  The source code for the library andtools can also be formatted for a printed manual.@end itemize@node Installation, Integration, Features, Top@chapter Installation@cindex installation@cindex building the library@cindex library, building@cindex Amiga 4000/040@cindex Dell Inspiron 7500The mpatrol library was initially developed on an Amiga 4000/040 running AmigaOS3.1.  I then installed Red Hat Linux 5.1 on my Amiga and added support forLinux/m68k.  I've now just recently purchased a Dell Inspiron 7500 Notebook PCand put my Amiga in retirement, so development will now continue on Red HatLinux 6.2 and above on the Intel platform.  I've tried my best to make it aseasy as possible to build and install mpatrol on any system, but it isn'tlikely to run smoothly for everybody.  However, there shouldn't be any majorproblems if you perform the following steps.@cindex CHECKSUMS@cindex md5sumNote that if you want to check the integrity of the files that came with thempatrol distribution you can use the @file{CHECKSUMS} file in the @file{mpatrol}base directory.  You must have the @command{md5sum} command installed on yoursystem in order to make use of this file.@cindex autoconf@cindex automake@cindex libtool@cindex configure@cindex setup@cindex cleanup@cindex distclean (make target)If you wish to use GNU autoconf, automake and libtool to build and installmpatrol you may do so by entering the @file{pkg/auto} directory and typing@samp{./setup}.  This will construct the directory structure that is requiredby these tools and will also create a @file{configure} script.  Please see the@file{INSTALL} file in that directory for information on how to proceed.  Notethat you can clean up the @file{pkg/auto} directory by typing @samp{makedistclean} (if the @file{configure} script has already been run) followed by@samp{./cleanup}.For a manual installation, perform the following steps.@enumerate 1@itemGo into the @file{build} directory and then into the appropriate subdirectoryfor your system.@cindex Makefile@cindex CC@cindex AR@cindex LD@cindex CFLAGS@cindex OFLAGS@cindex SFLAGS@cindex TFLAGS@cindex GUISUP@cindex compiling@cindex compiler@cindex linking@cindex linker@cindex optimisation@itemEdit the @file{Makefile} in that directory and check that it is using theappropriate compiler and build tools.  The @code{CC} macro specifies thecompiler@footnote{On many systems this actually a C++ compiler by default, andshould be a C++ compiler if you wish to use the C++ operators.}, the @code{AR}macro specifies the tool used to build the archive library and the @code{LD}macro specifies the tool to build the shared library.  The @code{CFLAGS} macrospecifies compiler options that are always to be used, the @code{OFLAGS} macrospecifies optimisation options for the compiler, the @code{SFLAGS} macrospecifies options to be passed to the compiler when building a shared libraryand the @code{TFLAGS} macro specifies options to be passed to the compiler whenbuilding a thread-safe library.  You may also need to change the library namesand library build commands on different systems.Note that the generic UNIX @file{Makefile} contains a macro called @code{GUISUP}which is set to @code{false} by default.  If it is set to @code{true} then the@command{mptrace} command will be built with GUI support enabled.  However,your system must contain the correct header files and libraries in order tosupport this.@cindex make@cindex all (make target)@cindex lint (make target)@cindex clean (make target)@cindex clobber (make target)@cindex lint@itemUse the @command{make} command (or equivalent) to build the mpatrol library inarchive form.  The @samp{all} target builds all possible combinations of thempatrol library for your system.  The @samp{clean} target removes all relevantobject files from the current directory, while the @samp{clobber} target alsoremoves all libraries that have been built from the current directory.  On someUNIX platforms, the @samp{lint} target will build a @command{lint} library forthe mpatrol library.@cindex Inuse@itemIf the mpatrol library is to be built with support for Parasoft Inuse then the@code{MP_INUSE_SUPPORT} preprocessor macro must be defined in the@code{CFLAGS} portion of the @file{Makefile} before building.  This will ensurethat Inuse will be notified of every memory allocation, reallocation anddeallocation, but the Insure++ runtime library will also have to be linked inwith any program that uses mpatrol.@cindex symbolic links@cindex links, symbolic@cindex ldconfig@itemCopy all of the libraries that have been built into your local librarydirectory.  If there were symbolic links created in the @file{build} directorythen these should be recreated in the local library directory rather than simplycopying them.  You may need to run a command such as @command{ldconfig} in orderfor the system to recognise the newly-installed libraries, and you may also needto add the filename of the directory containing the newly-installed libraries toan environment variable such as @env{LD_LIBRARY_PATH} if you installed thelibraries in a non-standard location.@itemCopy the @command{mpatrol}, @command{mprof}, @command{mptrace} and@command{mleak} programs that have been built into your local bin directory.You may also wish to copy the @command{mpsym}, @command{mpedit} and@command{hexwords} commands to your local bin directory as well if your systemsupports Bourne shell scripts.@itemGo up two directory levels into the @file{src} directory and copy the@file{mpatrol.h}, @file{mpalloc.h} and @file{mpdebug.h} header files into yourlocal include directory.@itemGo up one directory level into the @file{tools} directory and copy all of theheader files into the @file{mpatrol} subdirectory (which you'll need to create)in your local include directory.@cindex manual pages@itemOn UNIX platforms, go up one directory level into the @file{man} directory andcopy the @file{man1} and @file{man3} subdirectories to your local man directory.Unfortunately, the location for manual pages varies from system to system so youmay or may not also be able to copy the @file{cat1} and @file{cat3}subdirectories as well.  The @file{man*} subdirectories contain the unformattedmanual pages while the @file{cat*} subdirectories contain the formatted manualpages.@cindex @TeX{}info@cindex La@TeX{}@cindex documentation@cindex reference card@cindex quick reference card@cindex printing@itemGo up one directory level into the @file{doc} directory and examine the fileslocated there.  The @file{mpatrol.texi} file contains the @TeX{}info source forthis manual and can be translated into a wide variety of documentation formats.The @file{refcard.tex} file contains the La@TeX{} source for the quick referencecard and can be translated into formats suitable for printing onto a few pages.There should already be translated files in the @file{doc} directory, but if notyou will have to generate them yourself using the @file{Makefile} provided.  Youcan then install or print these documents.@cindex source code documentationThe mpatrol library source code can also be formatted for a printed manual forlater perusal.  The @samp{source} target in the @file{Makefile} within the@file{doc} directory can be used to build the source code documentation in DVI,postscript and PDF formats, but be prepared for a large number of pages!If you are not installing on a system that supports UNIX manual pages then youshould also check in the @file{man} directory to ensure that there arealternative formats for the mpatrol manual pages that you can install.  If not,you will have to generate them yourself using the @file{Makefile} provided.@end enumerate@cindex PKG package@cindex SD/UX package@cindex RPM package@cindex Debian package@cindex TAR archive@cindex LhA archive@cindex ZIP archiveAlternatively, the @file{pkg} directory contains files that can be used toautomatically generate a @emph{package} in a specific format suitable forinstallation on a system.  Four package formats (PKG, SD/UX, RPM and Debian) andthree archive formats are currently supported (generic tape archive, LhA andZIP).The first package format is generally used on UNIX SVR4 systems, while thesecond is used on HP/UX systems.  The RPM and Debian package formats wereintroduced by Red Hat and Debian respectively for use in their Linuxdistributions.@cindex Aminet@cindex WinSiteThe generic tape archive can be used as a distribution for UNIX systems where nopackage format is supported, but it does not contain information on how toinstall the files on the system once they have been extracted from thedistribution.  The LhA and ZIP formats are also roughly the same, but the LhAformat is intended for Amiga systems and is used for Aminet distributions, whilethe ZIP format is intended for Windows systems and is used for WinSitedistributions.You should really know what you are doing before you attempt to build a package,and you should also be aware that some of the package files may need to bemodified before you begin.@cindex Linux Software Map@cindex LSMIn addition, a Linux Software Map index file exists in the @file{pkg/lsm}directory.@cindex extraNote that the @file{extra} directory that comes with the mpatrol distributioncontains several prototype configuration files for certain third-party programs.These files should be examined so that you can decide whether to integrate theircontents into your existing configuration files.  The purpose of each file isdescribed in the relevant sections of this manual.@node Integration, Memory allocations, Installation, Top@chapter Integration@cindex integrationThis section describes how to go about adding or removing the mpatrol libraryfrom your code.  There are several levels for each category so it is worthreading about each before proceeding.@menu* Adding mpatrol::              Adding mpatrol to your program.* Removing mpatrol::            Removing mpatrol from your program.@end menu@node Adding mpatrol, Removing mpatrol, , Integration@section Adding mpatrol@cindex adding mpatrol@cindex recompilationThe following steps should allow you to easily integrate the mpatrol libraryinto an existing application, although some of them may not be available to doon many platforms.  They are listed in the order of number of changes requiredto modify existing code --- the last step will require a complete recompilationof all your code.@enumerate 1@itemThis step is currently only available on DYNIX/ptx, FreeBSD, IRIX, Linux,NetBSD, OpenBSD, Solaris and Tru64 platforms and on DG/UX 4.20MU07@footnote{Alsoavailable on DG/UX 4.20MU05 with patch dgux_R4.20MU05.p59 and DG/UX 4.20MU06with patch dgux_R4.20MU06.p08.} or later platforms with the @env{LD_PRELOAD}feature.If your program or application has been dynamically linked with the system Clibrary (@file{libc.so}) or an alternative malloc shared library then you canuse the @option{--dynamic} option to the @file{mpatrol} command to override thedefault definitions of @code{malloc()}, etc.@: at run-time without having torelink your program.  If your program is multithreaded then you must also addthe @option{--threads} option to pick up the multithreaded shared librariesinstead.For example, if your program's executable file is called @file{testprog} and itaccepts an option specifying an input file, you can force the system's dynamiclinker to use mpatrol's versions of @code{malloc()}, etc.@: instead of thedefault versions by typing:@smallexamplempatrol --dynamic ./testprog -i file@end smallexampleThe resulting log file should be called @file{mpatrol.<procid>.log} by default(where @var{procid} is the current process id), but if no such file exists afterrunning the @file{mpatrol} command then it will not be possible to force therun-time linking of mpatrol functions to your program and you will have toproceed to the next step.  Note that the @command{mpatrol} command overridesany previous setting of the @env{MPATROL_OPTIONS} environment variable.@itemThis step is currently only available on UNIX and Windows platforms (and AmigaOSwhen using @command{gcc}).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -