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

📄 install

📁 gdb-6.0 linux 下的调试工具
💻
📖 第 1 页 / 共 2 页
字号:
		PSIM - model the PowerPC environment    Copyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au>.    ----------------------------------------------------------------------			Building PSIM	This file describes how to build the program PSIM	o	Walk through a basic build	o	Discussion of PSIM's components and		how they relate to the build process	o	Detailed description of each of PSIM's		compile time configuration options    ----------------------------------------------------------------------BUILDING PSIM:PSIM 1.0.2 is included in GDB-4.16.  To build PSIM you will need thefollowing:	gdb-4.16.tar.gz		Available from your favorite GNU				ftp site	gcc			GCC version two includes suport				for long long (64bit integer)				arrithemetic which PSIM uses.  Hence				it is recommended that you build PSIM				using GCC.				Method:	1.	Unpack gdb		$ cd .../scratch		$ gunzip < gdb-4.16.tar.gz | tar xf -	2.	Configure gdb		First consult the gdb documentation		$ cd .../scratch		$ cd gdb-4.16		$ more README		$ more gdb/README		then something like (I assume SH):		$ CC=gcc ./configure \                        --enable-sim-powerpc \                        --target=powerpc-unknown-eabi \                        --prefix=/applications/psim	4.	Build (again specifying GCC)		$ make CC=gcc		alternatively, if you are short on disk space or only		want to build the simulator:		$ ( cd libiberty && make CC=gcc )		$ ( cd bfd && make CC=gcc )		$ ( cd sim/ppc && make CC=gcc )	5.	Install		$ make CC=gcc install		or just		$ cp gdb/gdb ~/bin/powerpc-unknown-eabisim-gdb		$ cp sim/ppc/run ~/bin/powerpc-unknown-eabisim-run    ----------------------------------------------------------------------UPDATING PSIM:A PSIM is an ongoing development.  Occasional snapshots which both contain newfeatures and fix old bugs are made available.  See the ftp directory:	ftp://ftp.ci.com.au/pub/psim/betaor	ftp://cambridge.cygnus.com/pub/psim/betafor the latest version.  To build/install one of these snapshots, youreplace the sim/ppc found in the gdb archive with with one from thesnapshot.  Then just re-configure and rebuild/install.	Procedure:	0.	A starting point		$ cd gdb-4.16	1.	Remove the old psim directory		$ mv sim/ppc sim/old.ppc	2.	Unpack the new one		$ gunzip < ../psim-NNNNNN.tar.gz | tar tf -		$ gunzip < ../psim-NNNNNN.tar.gz | tar tf -	3.	Reconfigure/rebuild (as seen above):		$ CC=gcc ./configure \			--enable-sim-powerpc \                        --target=powerpc-unknown-eabi \                        --prefix=/applications/psim		$ make CC=gcc    ----------------------------------------------------------------------UPDATES TO GDB:From time to time, problems involving the integration of PSIM into gdbare found.  While eventually each of these problems is resolved therecan be periouds during which a local hack may be needed.At the time of writing the following were outstanding:	ATTACH command:		ftp://ftp.ci.com.au/pub/psim/gdb-4.15+attach.diff.gz	or	ftp://cambridge.cygnus.com/pub/psim/gdb-4.15+attach.diff.gz		PSIM, unlike the other simulators found in GDB, is able to load	the description of a target machine (including the initial	state of all processor registers) from a file.	Unfortunatly GDB does not yet have a standard command that	facilitates the use of this feature.  Until such a command is	added, the patch (hack?) gdb-4.15+attach.diff.gz can be used to	extend GDB's attach command so that it can be used to initialize	the simulators configuration from a file.    ----------------------------------------------------------------------RUNNING PROGRAMS:See the file:	ftp://ftp.ci.com.au/pub/psim/RUNor	ftp://cambridge.cygnus.com/pub/psim/RUN    ----------------------------------------------------------------------COMPILE TIME CONFIGURATION OPTIONS:PSIM's compile time configuration is controlled by autoconf.  PSIM'sconfigure script recognises options of the form:		--enable-sim-<option>[=<val>]And can be specified on the configure command line (at the top levelof the gdb directory tree) vis:		$ cd gdb-4.15		$ CC=gcc ./configure \                        --target=powerpc-unknown-eabisim \                        --prefix=/applications/psim \			--enable-sim-inline		$ make CC=gccFor a brief list of PSIM's configuration options, configure --helpwill list them vis:	$ cd sim/ppc	$ ./configure --helpEach PSIM specific option is discussed in detail below.--enable-sim-cflags=<opts>Specify additional C compiler flags that are to be used when compilingjust PSIM.PSIM places heavy demands on both the host machine and its C compiler.  So thatthe builder has better control over the compiler the above option can be usedto pass additional options to the compiler while PSIM is being built.Ex: No debug informationPSIM can be built with everything inline.  Unfortunately, because ofall the debugging information generated the C compiler can grow veryvery large as a result.  For GCC, the debug information can berestricted with the `-g0' option.  To specify that this option shouldbe include in the CFLAGS when compiling the psim source code use:	--enable-sim-cflags=-g0Ex: Additional optimization flagsA significant gain in performance can be achieved by tuning theoptimization flags passed to the C compiler.  For instance on an x86you may consider:	--enable-sim-cflags='-g0 -O2 -fno-strength-reduce -f...'--enable-sim-warnings=<flags>Turn on additional GCC specific checks.Some hosts (NetBSD, Linux, Solaris-2.5) have complete header filesthat include correct prototypes for all library functions.  On suchhosts, PSIM can be built with many more than the standard C checksenabled.  The option --enable-sim-warnings controls this.Ex: Default warningsWith just --enable-sim-warnings, the following -W options are enabled:-Werror -Wall -Wpointer-arith -Wmissing-prototypes.--enable-sim-opcode=whichSpecify the file containing the rules for generating the instructiondecode and execute functions from the file ppc-instructions.The form of the instruction decode and execute functions is controlledby an opcode table.  It specifies: the combination of switchstatements and jump tables to use when decoding an instruction and howmuch of each instruction should be decoded before calling theinstruction execute function.PSIM includes a number of opcode tables:	psim-opcode-simple		Generates a small compact two level switch statement		that will compile quickly and run reasonably fast.		This may be useful on a small machine.	psim-opcode-complex		(the default) A fairly aggressive instruction decode		table that includes the breaking out of a number		of special instruction cases (eg RA==0 vs RA!=0).	psim-opcode-flat		Identical to complex except a switch statement		is used.  Ideal for when the icache is being		disabled.	psim-opcode-stupid		In addition to the instruction decodes performed		by psim-opcode-complex, this also full decodes mtspr,		mfspr, and branch instructions.  The table generated		is very large and, as a consequence, only performs		well on machines with large caches.	ppc-opcode-test-1	ppc-opcode-test-2		Generate test (but workable) tables.  These exercise		PSIM's ability to generate instruction decode functions		that are a combination of jump-tables and switch statements.The program igen generates the instruction tables from the opcodetable and the ppc-instruction table.--enable-sim-switchEnable/disable the use of a switch statement when looking up theattributes of a SPR register.The PowerPC architecture defines a number of Special Purpose Registers(SPR's).  Associated with each of these registers are a number ofattributes (such as validity or size) which the instructionsmtspr/mfspr query as part of their execution.For PSIM, this information is kept in a table (ppc-spr-table).  Theprogram dgen converts this table into lookup routines (contained inthe generated files spreg.h spreg.c) that can be used to query anSPR's attributes.  Those lookup routines are either implemented asa table or alternatively as a number of switch statements:	spr_table spr_info[] = { .... };	int spr_length(sprs spr) { return spr_info[spr].length; }vs	int spr_length(sprs spr) { switch (spr) { case ..: return ..; } }In general the first implementation (a table) is the most efficient.It may, however, prove that when performing an aggressive optimizationwhere both the SPR is known and the above function is being inlined(with the consequence that GCC can eliminate the switch statement)that the second choice is improves performance.In practice, only a marginal (if any benefit) has ever been seen.--enable-sim-duplicateCreate a duplicate copy of each instruction function hardwiringinstruction fields that would have otherwise have been variable.As discussed above, igen outputs a C function generated from the fileppc-instructions (using the opcode rules) for each of theinstructions.  Thus multiple entries in the instruction decode tablesmay be pointing back at the same function.  Enabling duplicate, willresult in psim creating a duplicate of the instruction's function foreach different entry in the instruction decode tables.For instance, given the branch instruction:	0.19,6.BO,11.BI,16./,21.528,31.LK	...	if (LK) LR = (spreg)IEA(CIA + 4);	...igen as part of its instruction lookup table may have generated twodifferent entries - one for LK=0 and one for LK=1.  With duplicateenabled, igen outputs (almost) duplicate copies of branch function,one with LK hardwired to 0 and one with LK hardwired to 1.By doing this the compiler is provided with additional information thatwill allow it possibly eliminate dead code.  (such as the assignmentto LK if LR==0).Ex: defaultBecause this feature is such a big win, --enable-sim-duplicate isturned on by default.Ex: A small machineOnly rarely (eg on a very small host) would this feature need to bedisabled (using: --disable-sim-duplicate).--enable-sim-filter=ruleInclude/exclude PowerPC instructions that are specific to a particularimplementation.Some of the PowerPC instructions included in the file ppc-instructionsare limited to certain specific PPC implementations.  For instance,the instruction:	0.58,6.RT,11.RA,16.DS,30.2:DS:64::Load Word AlgebraicIs only valid for the 64bit architecture.  The enable-sim-filter flagis passed to igen so that it can `filter out' any invalidinstructions.  The filter rule has the form:	-f <name>thus:	--enable-sim-filter='-f 64'(the default) would filter out all 64bit instructions.Ex: Remove floating point instructionsA given 32bit PowerPC implementation may not include floating pointhardware.  Consequently there is little point in including floatingpoint instructions in the instruction table.  The option:	--enable-sim-filter='-f 64 -f f'will eliminate all floating point instructions from the instructiontable.--enable-sim-icache=size

⌨️ 快捷键说明

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