diff options
Diffstat (limited to 'contrib')
149 files changed, 75882 insertions, 317 deletions
diff --git a/contrib/gcc/INSTALL b/contrib/gcc/INSTALL new file mode 100644 index 0000000000000..d792b336e4c79 --- /dev/null +++ b/contrib/gcc/INSTALL @@ -0,0 +1,1877 @@ +This file documents the installation of the GNU compiler. Copyright +(C) 1988, 1989, 1992, 1994, 1995 Free Software Foundation, Inc. You +may copy, distribute, and modify it freely as long as you preserve this +copyright notice and permission notice. + +Installing GNU CC +***************** + + Here is the procedure for installing GNU CC on a Unix system. See +*Note VMS Install::, for VMS systems. In this section we assume you +compile in the same directory that contains the source files; see *Note +Other Dir::, to find out how to compile in a separate directory on Unix +systems. + + You cannot install GNU C by itself on MSDOS; it will not compile +under any MSDOS compiler except itself. You need to get the complete +compilation package DJGPP, which includes binaries as well as sources, +and includes all the necessary compilation tools and libraries. + + 1. If you have built GNU CC previously in the same directory for a + different target machine, do `make distclean' to delete all files + that might be invalid. One of the files this deletes is + `Makefile'; if `make distclean' complains that `Makefile' does not + exist, it probably means that the directory is already suitably + clean. + + 2. On a System V release 4 system, make sure `/usr/bin' precedes + `/usr/ucb' in `PATH'. The `cc' command in `/usr/ucb' uses + libraries which have bugs. + + 3. Specify the host, build and target machine configurations. You do + this by running the file `configure'. + + The "build" machine is the system which you are using, the "host" + machine is the system where you want to run the resulting compiler + (normally the build machine), and the "target" machine is the + system for which you want the compiler to generate code. + + If you are building a compiler to produce code for the machine it + runs on (a native compiler), you normally do not need to specify + any operands to `configure'; it will try to guess the type of + machine you are on and use that as the build, host and target + machines. So you don't need to specify a configuration when + building a native compiler unless `configure' cannot figure out + what your configuration is or guesses wrong. + + In those cases, specify the build machine's "configuration name" + with the `--build' option; the host and target will default to be + the same as the build machine. (If you are building a + cross-compiler, see *Note Cross-Compiler::.) + + Here is an example: + + ./configure --build=sparc-sun-sunos4.1 + + A configuration name may be canonical or it may be more or less + abbreviated. + + A canonical configuration name has three parts, separated by + dashes. It looks like this: `CPU-COMPANY-SYSTEM'. (The three + parts may themselves contain dashes; `configure' can figure out + which dashes serve which purpose.) For example, + `m68k-sun-sunos4.1' specifies a Sun 3. + + You can also replace parts of the configuration by nicknames or + aliases. For example, `sun3' stands for `m68k-sun', so + `sun3-sunos4.1' is another way to specify a Sun 3. You can also + use simply `sun3-sunos', since the version of SunOS is assumed by + default to be version 4. `sun3-bsd' also works, since `configure' + knows that the only BSD variant on a Sun 3 is SunOS. + + You can specify a version number after any of the system types, + and some of the CPU types. In most cases, the version is + irrelevant, and will be ignored. So you might as well specify the + version if you know it. + + See *Note Configurations::, for a list of supported configuration + names and notes on many of the configurations. You should check + the notes in that section before proceeding any further with the + installation of GNU CC. + + There are four additional options you can specify independently to + describe variant hardware and software configurations. These are + `--with-gnu-as', `--with-gnu-ld', `--with-stabs' and `--nfp'. + + `--with-gnu-as' + If you will use GNU CC with the GNU assembler (GAS), you + should declare this by using the `--with-gnu-as' option when + you run `configure'. + + Using this option does not install GAS. It only modifies the + output of GNU CC to work with GAS. Building and installing + GAS is up to you. + + Conversely, if you *do not* wish to use GAS and do not specify + `--with-gnu-as' when building GNU CC, it is up to you to make + sure that GAS is not installed. GNU CC searches for a + program named `as' in various directories; if the program it + finds is GAS, then it runs GAS. If you are not sure where + GNU CC finds the assembler it is using, try specifying `-v' + when you run it. + + The systems where it makes a difference whether you use GAS + are + `hppa1.0-ANY-ANY', `hppa1.1-ANY-ANY', `i386-ANY-sysv', + `i386-ANY-isc', + `i860-ANY-bsd', `m68k-bull-sysv', `m68k-hp-hpux', + `m68k-sony-bsd', + `m68k-altos-sysv', `m68000-hp-hpux', `m68000-att-sysv', + `ANY-lynx-lynxos', and `mips-ANY'). On any other system, + `--with-gnu-as' has no effect. + + On the systems listed above (except for the HP-PA, for ISC on + the 386, and for `mips-sgi-irix5.*'), if you use GAS, you + should also use the GNU linker (and specify `--with-gnu-ld'). + + `--with-gnu-ld' + Specify the option `--with-gnu-ld' if you plan to use the GNU + linker with GNU CC. + + This option does not cause the GNU linker to be installed; it + just modifies the behavior of GNU CC to work with the GNU + linker. Specifically, it inhibits the installation of + `collect2', a program which otherwise serves as a front-end + for the system's linker on most configurations. + + `--with-stabs' + On MIPS based systems and on Alphas, you must specify whether + you want GNU CC to create the normal ECOFF debugging format, + or to use BSD-style stabs passed through the ECOFF symbol + table. The normal ECOFF debug format cannot fully handle + languages other than C. BSD stabs format can handle other + languages, but it only works with the GNU debugger GDB. + + Normally, GNU CC uses the ECOFF debugging format by default; + if you prefer BSD stabs, specify `--with-stabs' when you + configure GNU CC. + + No matter which default you choose when you configure GNU CC, + the user can use the `-gcoff' and `-gstabs+' options to + specify explicitly the debug format for a particular + compilation. + + `--with-stabs' is meaningful on the ISC system on the 386, + also, if `--with-gas' is used. It selects use of stabs + debugging information embedded in COFF output. This kind of + debugging information supports C++ well; ordinary COFF + debugging information does not. + + `--with-stabs' is also meaningful on 386 systems running + SVR4. It selects use of stabs debugging information embedded + in ELF output. The C++ compiler currently (2.6.0) does not + support the DWARF debugging information normally used on 386 + SVR4 platforms; stabs provide a workable alternative. This + requires gas and gdb, as the normal SVR4 tools can not + generate or interpret stabs. + + `--nfp' + On certain systems, you must specify whether the machine has + a floating point unit. These systems include + `m68k-sun-sunosN' and `m68k-isi-bsd'. On any other system, + `--nfp' currently has no effect, though perhaps there are + other systems where it could usefully make a difference. + + The `configure' script searches subdirectories of the source + directory for other compilers that are to be integrated into GNU + CC. The GNU compiler for C++, called G++ is in a subdirectory + named `cp'. `configure' inserts rules into `Makefile' to build + all of those compilers. + + Here we spell out what files will be set up by `configure'. + Normally you need not be concerned with these files. + + * A file named `config.h' is created that contains a `#include' + of the top-level config file for the machine you will run the + compiler on (*note The Configuration File: + (gcc.info)Config.). This file is responsible for defining + information about the host machine. It includes `tm.h'. + + The top-level config file is located in the subdirectory + `config'. Its name is always `xm-SOMETHING.h'; usually + `xm-MACHINE.h', but there are some exceptions. + + If your system does not support symbolic links, you might + want to set up `config.h' to contain a `#include' command + which refers to the appropriate file. + + * A file named `tconfig.h' is created which includes the + top-level config file for your target machine. This is used + for compiling certain programs to run on that machine. + + * A file named `tm.h' is created which includes the + machine-description macro file for your target machine. It + should be in the subdirectory `config' and its name is often + `MACHINE.h'. + + * The command file `configure' also constructs the file + `Makefile' by adding some text to the template file + `Makefile.in'. The additional text comes from files in the + `config' directory, named `t-TARGET' and `x-HOST'. If these + files do not exist, it means nothing needs to be added for a + given target or host. + + 4. The standard directory for installing GNU CC is `/usr/local/lib'. + If you want to install its files somewhere else, specify + `--prefix=DIR' when you run `configure'. Here DIR is a directory + name to use instead of `/usr/local' for all purposes with one + exception: the directory `/usr/local/include' is searched for + header files no matter where you install the compiler. To override + this name, use the `--local-prefix' option below. + + 5. Specify `--local-prefix=DIR' if you want the compiler to search + directory `DIR/include' for locally installed header files + *instead* of `/usr/local/include'. + + You should specify `--local-prefix' *only* if your site has a + different convention (not `/usr/local') for where to put + site-specific files. + + *Do not* specify `/usr' as the `--local-prefix'! The directory + you use for `--local-prefix' *must not* contain any of the + system's standard header files. If it did contain them, certain + programs would be miscompiled (including GNU Emacs, on certain + targets), because this would override and nullify the header file + corrections made by the `fixincludes' script. + + 6. Make sure the Bison parser generator is installed. (This is + unnecessary if the Bison output files `c-parse.c' and `cexp.c' are + more recent than `c-parse.y' and `cexp.y' and you do not plan to + change the `.y' files.) + + Bison versions older than Sept 8, 1988 will produce incorrect + output for `c-parse.c'. + + 7. If you have chosen a configuration for GNU CC which requires other + GNU tools (such as GAS or the GNU linker) instead of the standard + system tools, install the required tools in the build directory + under the names `as', `ld' or whatever is appropriate. This will + enable the compiler to find the proper tools for compilation of + the program `enquire'. + + Alternatively, you can do subsequent compilation using a value of + the `PATH' environment variable such that the necessary GNU tools + come before the standard system tools. + + 8. Build the compiler. Just type `make LANGUAGES=c' in the compiler + directory. + + `LANGUAGES=c' specifies that only the C compiler should be + compiled. The makefile normally builds compilers for all the + supported languages; currently, C, C++ and Objective C. However, + C is the only language that is sure to work when you build with + other non-GNU C compilers. In addition, building anything but C + at this stage is a waste of time. + + In general, you can specify the languages to build by typing the + argument `LANGUAGES="LIST"', where LIST is one or more words from + the list `c', `c++', and `objective-c'. If you have any + additional GNU compilers as subdirectories of the GNU CC source + directory, you may also specify their names in this list. + + Ignore any warnings you may see about "statement not reached" in + `insn-emit.c'; they are normal. Also, warnings about "unknown + escape sequence" are normal in `genopinit.c' and perhaps some + other files. Likewise, you should ignore warnings about "constant + is so large that it is unsigned" in `insn-emit.c' and + `insn-recog.c' and a warning about a comparison always being zero + in `enquire.o'. Any other compilation errors may represent bugs in + the port to your machine or operating system, and should be + investigated and reported. + + Some commercial compilers fail to compile GNU CC because they have + bugs or limitations. For example, the Microsoft compiler is said + to run out of macro space. Some Ultrix compilers run out of + expression space; then you need to break up the statement where + the problem happens. + + 9. If you are building a cross-compiler, stop here. *Note + Cross-Compiler::. + + 10. Move the first-stage object files and executables into a + subdirectory with this command: + + make stage1 + + The files are moved into a subdirectory named `stage1'. Once + installation is complete, you may wish to delete these files with + `rm -r stage1'. + + 11. If you have chosen a configuration for GNU CC which requires other + GNU tools (such as GAS or the GNU linker) instead of the standard + system tools, install the required tools in the `stage1' + subdirectory under the names `as', `ld' or whatever is + appropriate. This will enable the stage 1 compiler to find the + proper tools in the following stage. + + Alternatively, you can do subsequent compilation using a value of + the `PATH' environment variable such that the necessary GNU tools + come before the standard system tools. + + 12. Recompile the compiler with itself, with this command: + + make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2" + + This is called making the stage 2 compiler. + + The command shown above builds compilers for all the supported + languages. If you don't want them all, you can specify the + languages to build by typing the argument `LANGUAGES="LIST"'. LIST + should contain one or more words from the list `c', `c++', + `objective-c', and `proto'. Separate the words with spaces. + `proto' stands for the programs `protoize' and `unprotoize'; they + are not a separate language, but you use `LANGUAGES' to enable or + disable their installation. + + If you are going to build the stage 3 compiler, then you might + want to build only the C language in stage 2. + + Once you have built the stage 2 compiler, if you are short of disk + space, you can delete the subdirectory `stage1'. + + On a 68000 or 68020 system lacking floating point hardware, unless + you have selected a `tm.h' file that expects by default that there + is no such hardware, do this instead: + + make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2 -msoft-float" + + 13. If you wish to test the compiler by compiling it with itself one + more time, install any other necessary GNU tools (such as GAS or + the GNU linker) in the `stage2' subdirectory as you did in the + `stage1' subdirectory, then do this: + + make stage2 + make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" + + This is called making the stage 3 compiler. Aside from the `-B' + option, the compiler options should be the same as when you made + the stage 2 compiler. But the `LANGUAGES' option need not be the + same. The command shown above builds compilers for all the + supported languages; if you don't want them all, you can specify + the languages to build by typing the argument `LANGUAGES="LIST"', + as described above. + + If you do not have to install any additional GNU tools, you may + use the command + + make bootstrap LANGUAGES=LANGUAGE-LIST BOOT_CFLAGS=OPTION-LIST + + instead of making `stage1', `stage2', and performing the two + compiler builds. + + 14. Then compare the latest object files with the stage 2 object + files--they ought to be identical, aside from time stamps (if any). + + On some systems, meaningful comparison of object files is + impossible; they always appear "different." This is currently + true on Solaris and some systems that use ELF object file format. + On some versions of Irix on SGI machines and DEC Unix (OSF/1) on + Alpha systems, you will not be able to compare the files without + specifying `-save-temps'; see the description of individual + systems above to see if you get comparison failures. You may have + similar problems on other systems. + + Use this command to compare the files: + + make compare + + This will mention any object files that differ between stage 2 and + stage 3. Any difference, no matter how innocuous, indicates that + the stage 2 compiler has compiled GNU CC incorrectly, and is + therefore a potentially serious bug which you should investigate + and report. + + If your system does not put time stamps in the object files, then + this is a faster way to compare them (using the Bourne shell): + + for file in *.o; do + cmp $file stage2/$file + done + + If you have built the compiler with the `-mno-mips-tfile' option on + MIPS machines, you will not be able to compare the files. + + 15. Install the compiler driver, the compiler's passes and run-time + support with `make install'. Use the same value for `CC', + `CFLAGS' and `LANGUAGES' that you used when compiling the files + that are being installed. One reason this is necessary is that + some versions of Make have bugs and recompile files gratuitously + when you do this step. If you use the same variable values, those + files will be recompiled properly. + + For example, if you have built the stage 2 compiler, you can use + the following command: + + make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" LANGUAGES="LIST" + + This copies the files `cc1', `cpp' and `libgcc.a' to files `cc1', + `cpp' and `libgcc.a' in the directory + `/usr/local/lib/gcc-lib/TARGET/VERSION', which is where the + compiler driver program looks for them. Here TARGET is the target + machine type specified when you ran `configure', and VERSION is + the version number of GNU CC. This naming scheme permits various + versions and/or cross-compilers to coexist. + + This also copies the driver program `xgcc' into + `/usr/local/bin/gcc', so that it appears in typical execution + search paths. + + On some systems, this command causes recompilation of some files. + This is usually due to bugs in `make'. You should either ignore + this problem, or use GNU Make. + + *Warning: there is a bug in `alloca' in the Sun library. To avoid + this bug, be sure to install the executables of GNU CC that were + compiled by GNU CC. (That is, the executables from stage 2 or 3, + not stage 1.) They use `alloca' as a built-in function and never + the one in the library.* + + (It is usually better to install GNU CC executables from stage 2 + or 3, since they usually run faster than the ones compiled with + some other compiler.) + + 16. If you're going to use C++, it's likely that you need to also + install the libg++ distribution. It should be available from the + same place where you got the GNU C distribution. Just as GNU C + does not distribute a C runtime library, it also does not include + a C++ run-time library. All I/O functionality, special class + libraries, etc., are available in the libg++ distribution. + +Configurations Supported by GNU CC +================================== + + Here are the possible CPU types: + + 1750a, a29k, alpha, arm, cN, clipper, dsp16xx, elxsi, h8300, + hppa1.0, hppa1.1, i370, i386, i486, i586, i860, i960, m68000, m68k, + m88k, mips, mipsel, mips64, mips64el, ns32k, powerpc, powerpcle, + pyramid, romp, rs6000, sh, sparc, sparclite, sparc64, vax, we32k. + + Here are the recognized company names. As you can see, customary +abbreviations are used rather than the longer official names. + + acorn, alliant, altos, apollo, att, bull, cbm, convergent, convex, + crds, dec, dg, dolphin, elxsi, encore, harris, hitachi, hp, ibm, + intergraph, isi, mips, motorola, ncr, next, ns, omron, plexus, + sequent, sgi, sony, sun, tti, unicom, wrs. + + The company name is meaningful only to disambiguate when the rest of +the information supplied is insufficient. You can omit it, writing +just `CPU-SYSTEM', if it is not needed. For example, `vax-ultrix4.2' +is equivalent to `vax-dec-ultrix4.2'. + + Here is a list of system types: + + 386bsd, aix, acis, amigados, aos, aout, bosx, bsd, clix, coff, + ctix, cxux, dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms, + genix, gnu, gnu/linux, hiux, hpux, iris, irix, isc, luna, lynxos, + mach, minix, msdos, mvs, netbsd, newsos, nindy, ns, osf, osfrose, + ptx, riscix, riscos, rtu, sco, sim, solaris, sunos, sym, sysv, + udi, ultrix, unicos, uniplus, unos, vms, vsta, vxworks, winnt, + xenix. + +You can omit the system type; then `configure' guesses the operating +system from the CPU and company. + + You can add a version number to the system type; this may or may not +make a difference. For example, you can write `bsd4.3' or `bsd4.4' to +distinguish versions of BSD. In practice, the version number is most +needed for `sysv3' and `sysv4', which are often treated differently. + + If you specify an impossible combination such as `i860-dg-vms', then +you may get an error message from `configure', or it may ignore part of +the information and do the best it can with the rest. `configure' +always prints the canonical name for the alternative that it used. GNU +CC does not support all possible alternatives. + + Often a particular model of machine has a name. Many machine names +are recognized as aliases for CPU/company combinations. Thus, the +machine name `sun3', mentioned above, is an alias for `m68k-sun'. +Sometimes we accept a company name as a machine name, when the name is +popularly used for a particular machine. Here is a table of the known +machine names: + + 3300, 3b1, 3bN, 7300, altos3068, altos, apollo68, att-7300, + balance, convex-cN, crds, decstation-3100, decstation, delta, + encore, fx2800, gmicro, hp7NN, hp8NN, hp9k2NN, hp9k3NN, hp9k7NN, + hp9k8NN, iris4d, iris, isi68, m3230, magnum, merlin, miniframe, + mmax, news-3600, news800, news, next, pbd, pc532, pmax, powerpc, + powerpcle, ps2, risc-news, rtpc, sun2, sun386i, sun386, sun3, + sun4, symmetry, tower-32, tower. + +Remember that a machine name specifies both the cpu type and the company +name. If you want to install your own homemade configuration files, +you can use `local' as the company name to access them. If you use +configuration `CPU-local', the configuration name without the cpu prefix +is used to form the configuration file names. + + Thus, if you specify `m68k-local', configuration uses files +`m68k.md', `local.h', `m68k.c', `xm-local.h', `t-local', and `x-local', +all in the directory `config/m68k'. + + Here is a list of configurations that have special treatment or +special things you must know: + +`1750a-*-*' + MIL-STD-1750A processors. + + Starting with GCC 2.6.1, the MIL-STD-1750A cross configuration no + longer supports the Tektronix Assembler, but instead produces + output for `as1750', an assembler/linker available under the GNU + Public License for the 1750A. Contact *kellogg@space.otn.dasa.de* + for more details on obtaining `as1750'. A similarly licensed + simulator for the 1750A is available from same address. + + You should ignore a fatal error during the building of libgcc + (libgcc is not yet implemented for the 1750A.) + + The `as1750' assembler requires the file `ms1750.inc', which is + found in the directory `config/1750a'. + + GNU CC produced the same sections as the Fairchild F9450 C + Compiler, namely: + + `Normal' + The program code section. + + `Static' + The read/write (RAM) data section. + + `Konst' + The read-only (ROM) constants section. + + `Init' + Initialization section (code to copy KREL to SREL). + + The smallest addressable unit is 16 bits (BITS_PER_UNIT is 16). + This means that type `char' is represented with a 16-bit word per + character. The 1750A's "Load/Store Upper/Lower Byte" instructions + are not used by GNU CC. + +`alpha-*-osf1' + Systems using processors that implement the DEC Alpha architecture + and are running the DEC Unix (OSF/1) operating system, for example + the DEC Alpha AXP systems. (VMS on the Alpha is not currently + supported by GNU CC.) + + GNU CC writes a `.verstamp' directive to the assembler output file + unless it is built as a cross-compiler. It gets the version to + use from the system header file `/usr/include/stamp.h'. If you + install a new version of DEC Unix, you should rebuild GCC to pick + up the new version stamp. + + Note that since the Alpha is a 64-bit architecture, + cross-compilers from 32-bit machines will not generate code as + efficient as that generated when the compiler is running on a + 64-bit machine because many optimizations that depend on being + able to represent a word on the target in an integral value on the + host cannot be performed. Building cross-compilers on the Alpha + for 32-bit machines has only been tested in a few cases and may + not work properly. + + `make compare' may fail on old versions of DEC Unix unless you add + `-save-temps' to `CFLAGS'. On these systems, the name of the + assembler input file is stored in the object file, and that makes + comparison fail if it differs between the `stage1' and `stage2' + compilations. The option `-save-temps' forces a fixed name to be + used for the assembler input file, instead of a randomly chosen + name in `/tmp'. Do not add `-save-temps' unless the comparisons + fail without that option. If you add `-save-temps', you will have + to manually delete the `.i' and `.s' files after each series of + compilations. + + GNU CC now supports both the native (ECOFF) debugging format used + by DBX and GDB and an encapsulated STABS format for use only with + GDB. See the discussion of the `--with-stabs' option of + `configure' above for more information on these formats and how to + select them. + + There is a bug in DEC's assembler that produces incorrect line + numbers for ECOFF format when the `.align' directive is used. To + work around this problem, GNU CC will not emit such alignment + directives while writing ECOFF format debugging information even + if optimization is being performed. Unfortunately, this has the + very undesirable side-effect that code addresses when `-O' is + specified are different depending on whether or not `-g' is also + specified. + + To avoid this behavior, specify `-gstabs+' and use GDB instead of + DBX. DEC is now aware of this problem with the assembler and + hopes to provide a fix shortly. + +`arm' + Advanced RISC Machines ARM-family processors. These are often + used in embedded applications. There are no standard Unix + configurations. This configuration corresponds to the basic + instruction sequences and will produce a.out format object modules. + + You may need to make a variant of the file `arm.h' for your + particular configuration. + +`arm-*-riscix' + The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD + Unix. If you are running a version of RISC iX prior to 1.2 then + you must specify the version number during configuration. Note + that the assembler shipped with RISC iX does not support stabs + debugging information; a new version of the assembler, with stabs + support included, is now available from Acorn. + +`a29k' + AMD Am29k-family processors. These are normally used in embedded + applications. There are no standard Unix configurations. This + configuration corresponds to AMD's standard calling sequence and + binary interface and is compatible with other 29k tools. + + You may need to make a variant of the file `a29k.h' for your + particular configuration. + +`a29k-*-bsd' + AMD Am29050 used in a system running a variant of BSD Unix. + +`decstation-*' + DECstations can support three different personalities: Ultrix, DEC + OSF/1, and OSF/rose. To configure GCC for these platforms use the + following configurations: + + `decstation-ultrix' + Ultrix configuration. + + `decstation-osf1' + Dec's version of OSF/1. + + `decstation-osfrose' + Open Software Foundation reference port of OSF/1 which uses + the OSF/rose object file format instead of ECOFF. Normally, + you would not select this configuration. + + The MIPS C compiler needs to be told to increase its table size + for switch statements with the `-Wf,-XNg1500' option in order to + compile `cp/parse.c'. If you use the `-O2' optimization option, + you also need to use `-Olimit 3000'. Both of these options are + automatically generated in the `Makefile' that the shell script + `configure' builds. If you override the `CC' make variable and + use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit + 3000'. + +`elxsi-elxsi-bsd' + The Elxsi's C compiler has known limitations that prevent it from + compiling GNU C. Please contact `mrs@cygnus.com' for more details. + +`dsp16xx' + A port to the AT&T DSP1610 family of processors. + +`h8300-*-*' + The calling convention and structure layout has changed in release + 2.6. All code must be recompiled. The calling convention now + passes the first three arguments in function calls in registers. + Structures are no longer a multiple of 2 bytes. + +`hppa*-*-*' + There are several variants of the HP-PA processor which run a + variety of operating systems. GNU CC must be configured to use + the correct processor type and operating system, or GNU CC will + not function correctly. The easiest way to handle this problem is + to *not* specify a target when configuring GNU CC, the `configure' + script will try to automatically determine the right processor + type and operating system. + + `-g' does not work on HP-UX, since that system uses a peculiar + debugging format which GNU CC does not know about. However, `-g' + will work if you also use GAS and GDB in conjunction with GCC. We + highly recommend using GAS for all HP-PA configurations. + + You should be using GAS-2.6 (or later) along with GDB-4.16 (or + later). These can be retrieved from all the traditional GNU ftp + archive sites. + + GAS will need to be installed into a directory before `/bin', + `/usr/bin', and `/usr/ccs/bin' in your search path. You should + install GAS before you build GNU CC. + + To enable debugging, you must configure GNU CC with the + `--with-gnu-as' option before building. + +`i370-*-*' + This port is very preliminary and has many known bugs. We hope to + have a higher-quality port for this machine soon. + +`i386-*-linuxoldld' + Use this configuration to generate a.out binaries on Linux-based + GNU systems, if you do not have gas/binutils version 2.5.2 or later + installed. This is an obsolete configuration. + +`i386-*-linuxaout' + Use this configuration to generate a.out binaries on Linux-based + GNU systems. This configuration is being superseded. You must use + gas/binutils version 2.5.2 or later. + +`i386-*-linux' + Use this configuration to generate ELF binaries on Linux-based GNU + systems. You must use gas/binutils version 2.5.2 or later. + +`i386-*-sco' + Compilation with RCC is recommended. Also, it may be a good idea + to link with GNU malloc instead of the malloc that comes with the + system. + +`i386-*-sco3.2v4' + Use this configuration for SCO release 3.2 version 4. + +`i386-*-isc' + It may be a good idea to link with GNU malloc instead of the + malloc that comes with the system. + + In ISC version 4.1, `sed' core dumps when building `deduced.h'. + Use the version of `sed' from version 4.0. + +`i386-*-esix' + It may be good idea to link with GNU malloc instead of the malloc + that comes with the system. + +`i386-ibm-aix' + You need to use GAS version 2.1 or later, and and LD from GNU + binutils version 2.2 or later. + +`i386-sequent-bsd' + Go to the Berkeley universe before compiling. In addition, you + probably need to create a file named `string.h' containing just + one line: `#include <strings.h>'. + +`i386-sequent-ptx1*' + Sequent DYNIX/ptx 1.x. + +`i386-sequent-ptx2*' + Sequent DYNIX/ptx 2.x. + +`i386-sun-sunos4' + You may find that you need another version of GNU CC to begin + bootstrapping with, since the current version when built with the + system's own compiler seems to get an infinite loop compiling part + of `libgcc2.c'. GNU CC version 2 compiled with GNU CC (any + version) seems not to have this problem. + + See *Note Sun Install::, for information on installing GNU CC on + Sun systems. + +`i[345]86-*-winnt3.5' + This version requires a GAS that has not let been released. Until + it is, you can get a prebuilt binary version via anonymous ftp from + `cs.washington.edu:pub/gnat' or `cs.nyu.edu:pub/gnat'. You must + also use the Microsoft header files from the Windows NT 3.5 SDK. + Find these on the CDROM in the `/mstools/h' directory dated + 9/4/94. You must use a fixed version of Microsoft linker made + especially for NT 3.5, which is also is available on the NT 3.5 + SDK CDROM. If you do not have this linker, can you also use the + linker from Visual C/C++ 1.0 or 2.0. + + Installing GNU CC for NT builds a wrapper linker, called `ld.exe', + which mimics the behaviour of Unix `ld' in the specification of + libraries (`-L' and `-l'). `ld.exe' looks for both Unix and + Microsoft named libraries. For example, if you specify `-lfoo', + `ld.exe' will look first for `libfoo.a' and then for `foo.lib'. + + You may install GNU CC for Windows NT in one of two ways, + depending on whether or not you have a Unix-like shell and various + Unix-like utilities. + + 1. If you do not have a Unix-like shell and few Unix-like + utilities, you will use a DOS style batch script called + `configure.bat'. Invoke it as `configure winnt' from an + MSDOS console window or from the program manager dialog box. + `configure.bat' assumes you have already installed and have + in your path a Unix-like `sed' program which is used to + create a working `Makefile' from `Makefile.in'. + + `Makefile' uses the Microsoft Nmake program maintenance + utility and the Visual C/C++ V8.00 compiler to build GNU CC. + You need only have the utilities `sed' and `touch' to use + this installation method, which only automatically builds the + compiler itself. You must then examine what `fixinc.winnt' + does, edit the header files by hand and build `libgcc.a' + manually. + + 2. The second type of installation assumes you are running a + Unix-like shell, have a complete suite of Unix-like utilities + in your path, and have a previous version of GNU CC already + installed, either through building it via the above + installation method or acquiring a pre-built binary. In this + case, use the `configure' script in the normal fashion. + +`i860-intel-osf1' + This is the Paragon. If you have version 1.0 of the operating + system, you need to take special steps to build GNU CC due to + peculiarities of the system. Newer system versions have no + problem. See the section `Installation Problems' in the GNU CC + Manual. + +`*-lynx-lynxos' + LynxOS 2.2 and earlier comes with GNU CC 1.x already installed as + `/bin/gcc'. You should compile with this instead of `/bin/cc'. + You can tell GNU CC to use the GNU assembler and linker, by + specifying `--with-gnu-as --with-gnu-ld' when configuring. These + will produce COFF format object files and executables; otherwise + GNU CC will use the installed tools, which produce a.out format + executables. + +`m68000-hp-bsd' + HP 9000 series 200 running BSD. Note that the C compiler that + comes with this system cannot compile GNU CC; contact + `law@cs.utah.edu' to get binaries of GNU CC for bootstrapping. + +`m68k-altos' + Altos 3068. You must use the GNU assembler, linker and debugger. + Also, you must fix a kernel bug. Details in the file + `README.ALTOS'. + +`m68k-att-sysv' + AT&T 3b1, a.k.a. 7300 PC. Special procedures are needed to + compile GNU CC with this machine's standard C compiler, due to + bugs in that compiler. You can bootstrap it more easily with + previous versions of GNU CC if you have them. + + Installing GNU CC on the 3b1 is difficult if you do not already + have GNU CC running, due to bugs in the installed C compiler. + However, the following procedure might work. We are unable to + test it. + + 1. Comment out the `#include "config.h"' line on line 37 of + `cccp.c' and do `make cpp'. This makes a preliminary version + of GNU cpp. + + 2. Save the old `/lib/cpp' and copy the preliminary GNU cpp to + that file name. + + 3. Undo your change in `cccp.c', or reinstall the original + version, and do `make cpp' again. + + 4. Copy this final version of GNU cpp into `/lib/cpp'. + + 5. Replace every occurrence of `obstack_free' in the file + `tree.c' with `_obstack_free'. + + 6. Run `make' to get the first-stage GNU CC. + + 7. Reinstall the original version of `/lib/cpp'. + + 8. Now you can compile GNU CC with itself and install it in the + normal fashion. + +`m68k-bull-sysv' + Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GNU + CC works either with native assembler or GNU assembler. You can use + GNU assembler with native coff generation by providing + `--with-gnu-as' to the configure script or use GNU assembler with + dbx-in-coff encapsulation by providing `--with-gnu-as --stabs'. + For any problem with native assembler or for availability of the + DPX/2 port of GAS, contact `F.Pierresteguy@frcl.bull.fr'. + +`m68k-crds-unox' + Use `configure unos' for building on Unos. + + The Unos assembler is named `casm' instead of `as'. For some + strange reason linking `/bin/as' to `/bin/casm' changes the + behavior, and does not work. So, when installing GNU CC, you + should install the following script as `as' in the subdirectory + where the passes of GCC are installed: + + #!/bin/sh + casm $* + + The default Unos library is named `libunos.a' instead of `libc.a'. + To allow GNU CC to function, either change all references to + `-lc' in `gcc.c' to `-lunos' or link `/lib/libc.a' to + `/lib/libunos.a'. + + When compiling GNU CC with the standard compiler, to overcome bugs + in the support of `alloca', do not use `-O' when making stage 2. + Then use the stage 2 compiler with `-O' to make the stage 3 + compiler. This compiler will have the same characteristics as the + usual stage 2 compiler on other systems. Use it to make a stage 4 + compiler and compare that with stage 3 to verify proper + compilation. + + (Perhaps simply defining `ALLOCA' in `x-crds' as described in the + comments there will make the above paragraph superfluous. Please + inform us of whether this works.) + + Unos uses memory segmentation instead of demand paging, so you + will need a lot of memory. 5 Mb is barely enough if no other + tasks are running. If linking `cc1' fails, try putting the object + files into a library and linking from that library. + +`m68k-hp-hpux' + HP 9000 series 300 or 400 running HP-UX. HP-UX version 8.0 has a + bug in the assembler that prevents compilation of GNU CC. To fix + it, get patch PHCO_4484 from HP. + + In addition, if you wish to use gas `--with-gnu-as' you must use + gas version 2.1 or later, and you must use the GNU linker version + 2.1 or later. Earlier versions of gas relied upon a program which + converted the gas output into the native HP/UX format, but that + program has not been kept up to date. gdb does not understand + that native HP/UX format, so you must use gas if you wish to use + gdb. + +`m68k-sun' + Sun 3. We do not provide a configuration file to use the Sun FPA + by default, because programs that establish signal handlers for + floating point traps inherently cannot work with the FPA. + + See *Note Sun Install::, for information on installing GNU CC on + Sun systems. + +`m88k-*-svr3' + Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port. + These systems tend to use the Green Hills C, revision 1.8.5, as the + standard C compiler. There are apparently bugs in this compiler + that result in object files differences between stage 2 and stage + 3. If this happens, make the stage 4 compiler and compare it to + the stage 3 compiler. If the stage 3 and stage 4 object files are + identical, this suggests you encountered a problem with the + standard C compiler; the stage 3 and 4 compilers may be usable. + + It is best, however, to use an older version of GNU CC for + bootstrapping if you have one. + +`m88k-*-dgux' + Motorola m88k running DG/UX. To build 88open BCS native or cross + compilers on DG/UX, specify the configuration name as + `m88k-*-dguxbcs' and build in the 88open BCS software development + environment. To build ELF native or cross compilers on DG/UX, + specify `m88k-*-dgux' and build in the DG/UX ELF development + environment. You set the software development environment by + issuing `sde-target' command and specifying either `m88kbcs' or + `m88kdguxelf' as the operand. + + If you do not specify a configuration name, `configure' guesses the + configuration based on the current software development + environment. + +`m88k-tektronix-sysv3' + Tektronix XD88 running UTekV 3.2e. Do not turn on optimization + while building stage1 if you bootstrap with the buggy Green Hills + compiler. Also, The bundled LAI System V NFS is buggy so if you + build in an NFS mounted directory, start from a fresh reboot, or + avoid NFS all together. Otherwise you may have trouble getting + clean comparisons between stages. + +`mips-mips-bsd' + MIPS machines running the MIPS operating system in BSD mode. It's + possible that some old versions of the system lack the functions + `memcpy', `memcmp', and `memset'. If your system lacks these, you + must remove or undo the definition of `TARGET_MEM_FUNCTIONS' in + `mips-bsd.h'. + + The MIPS C compiler needs to be told to increase its table size + for switch statements with the `-Wf,-XNg1500' option in order to + compile `cp/parse.c'. If you use the `-O2' optimization option, + you also need to use `-Olimit 3000'. Both of these options are + automatically generated in the `Makefile' that the shell script + `configure' builds. If you override the `CC' make variable and + use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit + 3000'. + +`mips-mips-riscos*' + The MIPS C compiler needs to be told to increase its table size + for switch statements with the `-Wf,-XNg1500' option in order to + compile `cp/parse.c'. If you use the `-O2' optimization option, + you also need to use `-Olimit 3000'. Both of these options are + automatically generated in the `Makefile' that the shell script + `configure' builds. If you override the `CC' make variable and + use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit + 3000'. + + MIPS computers running RISC-OS can support four different + personalities: default, BSD 4.3, System V.3, and System V.4 (older + versions of RISC-OS don't support V.4). To configure GCC for + these platforms use the following configurations: + + `mips-mips-riscos`rev'' + Default configuration for RISC-OS, revision `rev'. + + `mips-mips-riscos`rev'bsd' + BSD 4.3 configuration for RISC-OS, revision `rev'. + + `mips-mips-riscos`rev'sysv4' + System V.4 configuration for RISC-OS, revision `rev'. + + `mips-mips-riscos`rev'sysv' + System V.3 configuration for RISC-OS, revision `rev'. + + The revision `rev' mentioned above is the revision of RISC-OS to + use. You must reconfigure GCC when going from a RISC-OS revision + 4 to RISC-OS revision 5. This has the effect of avoiding a linker + bug. + +`mips-sgi-*' + In order to compile GCC on an SGI running IRIX 4, the "c.hdr.lib" + option must be installed from the CD-ROM supplied from Silicon + Graphics. This is found on the 2nd CD in release 4.0.1. + + In order to compile GCC on an SGI running IRIX 5, the + "compiler_dev.hdr" subsystem must be installed from the IDO CD-ROM + supplied by Silicon Graphics. + + `make compare' may fail on version 5 of IRIX unless you add + `-save-temps' to `CFLAGS'. On these systems, the name of the + assembler input file is stored in the object file, and that makes + comparison fail if it differs between the `stage1' and `stage2' + compilations. The option `-save-temps' forces a fixed name to be + used for the assembler input file, instead of a randomly chosen + name in `/tmp'. Do not add `-save-temps' unless the comparisons + fail without that option. If you do you `-save-temps', you will + have to manually delete the `.i' and `.s' files after each series + of compilations. + + The MIPS C compiler needs to be told to increase its table size + for switch statements with the `-Wf,-XNg1500' option in order to + compile `cp/parse.c'. If you use the `-O2' optimization option, + you also need to use `-Olimit 3000'. Both of these options are + automatically generated in the `Makefile' that the shell script + `configure' builds. If you override the `CC' make variable and + use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit + 3000'. + + On Irix version 4.0.5F, and perhaps on some other versions as well, + there is an assembler bug that reorders instructions incorrectly. + To work around it, specify the target configuration + `mips-sgi-irix4loser'. This configuration inhibits assembler + optimization. + + In a compiler configured with target `mips-sgi-irix4', you can turn + off assembler optimization by using the `-noasmopt' option. This + compiler option passes the option `-O0' to the assembler, to + inhibit reordering. + + The `-noasmopt' option can be useful for testing whether a problem + is due to erroneous assembler reordering. Even if a problem does + not go away with `-noasmopt', it may still be due to assembler + reordering--perhaps GNU CC itself was miscompiled as a result. + + To enable debugging under Irix 5, you must use GNU as 2.5 or later, + and use the `--with-gnu-as' configure option when configuring gcc. + GNU as is distributed as part of the binutils package. + +`mips-sony-sysv' + Sony MIPS NEWS. This works in NEWSOS 5.0.1, but not in 5.0.2 + (which uses ELF instead of COFF). Support for 5.0.2 will probably + be provided soon by volunteers. In particular, the linker does + not like the code generated by GCC when shared libraries are + linked in. + +`ns32k-encore' + Encore ns32000 system. Encore systems are supported only under + BSD. + +`ns32k-*-genix' + National Semiconductor ns32000 system. Genix has bugs in `alloca' + and `malloc'; you must get the compiled versions of these from GNU + Emacs. + +`ns32k-sequent' + Go to the Berkeley universe before compiling. In addition, you + probably need to create a file named `string.h' containing just + one line: `#include <strings.h>'. + +`ns32k-utek' + UTEK ns32000 system ("merlin"). The C compiler that comes with + this system cannot compile GNU CC; contact `tektronix!reed!mason' + to get binaries of GNU CC for bootstrapping. + +`romp-*-aos' +`romp-*-mach' + The only operating systems supported for the IBM RT PC are AOS and + MACH. GNU CC does not support AIX running on the RT. We + recommend you compile GNU CC with an earlier version of itself; if + you compile GNU CC with `hc', the Metaware compiler, it will work, + but you will get mismatches between the stage 2 and stage 3 + compilers in various files. These errors are minor differences in + some floating-point constants and can be safely ignored; the stage + 3 compiler is correct. + +`rs6000-*-aix' +`powerpc-*-aix' + Various early versions of each release of the IBM XLC compiler + will not bootstrap GNU CC. Symptoms include differences between + the stage2 and stage3 object files, and errors when compiling + `libgcc.a' or `enquire'. Known problematic releases include: + xlc-1.2.1.8, xlc-1.3.0.0 (distributed with AIX 3.2.5), and + xlc-1.3.0.19. Both xlc-1.2.1.28 and xlc-1.3.0.24 (PTF 432238) are + known to produce working versions of GNU CC, but most other recent + releases correctly bootstrap GNU CC. Also, releases of AIX prior + to AIX 3.2.4 include a version of the IBM assembler which does not + accept debugging directives: assembler updates are available as + PTFs. Also, if you are using AIX 3.2.5 or greater and the GNU + assembler, you must have a version modified after October 16th, + 1995 in order for the GNU C compiler to build. See the file + `README.RS6000' for more details on of these problems. + + GNU CC does not yet support the 64-bit PowerPC instructions. + + Objective C does not work on this architecture because it makes + assumptions that are incompatible with the calling conventions. + + AIX on the RS/6000 provides support (NLS) for environments outside + of the United States. Compilers and assemblers use NLS to support + locale-specific representations of various objects including + floating-point numbers ("." vs "," for separating decimal + fractions). There have been problems reported where the library + linked with GNU CC does not produce the same floating-point + formats that the assembler accepts. If you have this problem, set + the LANG environment variable to "C" or "En_US". + + Due to changes in the way that GNU CC invokes the binder (linker) + for AIX 4.1, you may now receive warnings of duplicate symbols + from the link step that were not reported before. The assembly + files generated by GNU CC for AIX have always included multiple + symbol definitions for certain global variable and function + declarations in the original program. The warnings should not + prevent the linker from producing a correct library or runnable + executable. + +`powerpc-*-elf' +`powerpc-*-sysv4' + PowerPC system in big endian mode, running System V.4. + + This configuration is currently under development. + +`powerpc-*-eabiaix' + Embedded PowerPC system in big endian mode with -mcall-aix + selected as the default. This system is currently under + development. + +`powerpc-*-eabisim' + Embedded PowerPC system in big endian mode for use in running + under the PSIM simulator. This system is currently under + development. + +`powerpc-*-eabi' + Embedded PowerPC system in big endian mode. + + This configuration is currently under development. + +`powerpcle-*-elf' +`powerpcle-*-sysv4' + PowerPC system in little endian mode, running System V.4. + + This configuration is currently under development. + +`powerpcle-*-sysv4' + Embedded PowerPC system in little endian mode. + + This system is currently under development. + +`powerpcle-*-eabisim' + Embedded PowerPC system in little endian mode for use in running + under the PSIM simulator. + + This system is currently under development. + +`powerpcle-*-eabi' + Embedded PowerPC system in little endian mode. + + This configuration is currently under development. + +`vax-dec-ultrix' + Don't try compiling with Vax C (`vcc'). It produces incorrect code + in some cases (for example, when `alloca' is used). + + Meanwhile, compiling `cp/parse.c' with pcc does not work because of + an internal table size limitation in that compiler. To avoid this + problem, compile just the GNU C compiler first, and use it to + recompile building all the languages that you want to run. + +`sparc-sun-*' + See *Note Sun Install::, for information on installing GNU CC on + Sun systems. + +`vax-dec-vms' + See *Note VMS Install::, for details on how to install GNU CC on + VMS. + +`we32k-*-*' + These computers are also known as the 3b2, 3b5, 3b20 and other + similar names. (However, the 3b1 is actually a 68000; see *Note + Configurations::.) + + Don't use `-g' when compiling with the system's compiler. The + system's linker seems to be unable to handle such a large program + with debugging information. + + The system's compiler runs out of capacity when compiling `stmt.c' + in GNU CC. You can work around this by building `cpp' in GNU CC + first, then use that instead of the system's preprocessor with the + system's C compiler to compile `stmt.c'. Here is how: + + mv /lib/cpp /lib/cpp.att + cp cpp /lib/cpp.gnu + echo '/lib/cpp.gnu -traditional ${1+"$@"}' > /lib/cpp + chmod +x /lib/cpp + + The system's compiler produces bad code for some of the GNU CC + optimization files. So you must build the stage 2 compiler without + optimization. Then build a stage 3 compiler with optimization. + That executable should work. Here are the necessary commands: + + make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g" + make stage2 + make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O" + + You may need to raise the ULIMIT setting to build a C++ compiler, + as the file `cc1plus' is larger than one megabyte. + +Compilation in a Separate Directory +=================================== + + If you wish to build the object files and executables in a directory +other than the one containing the source files, here is what you must +do differently: + + 1. Make sure you have a version of Make that supports the `VPATH' + feature. (GNU Make supports it, as do Make versions on most BSD + systems.) + + 2. If you have ever run `configure' in the source directory, you must + undo the configuration. Do this by running: + + make distclean + + 3. Go to the directory in which you want to build the compiler before + running `configure': + + mkdir gcc-sun3 + cd gcc-sun3 + + On systems that do not support symbolic links, this directory must + be on the same file system as the source code directory. + + 4. Specify where to find `configure' when you run it: + + ../gcc/configure ... + + This also tells `configure' where to find the compiler sources; + `configure' takes the directory from the file name that was used to + invoke it. But if you want to be sure, you can specify the source + directory with the `--srcdir' option, like this: + + ../gcc/configure --srcdir=../gcc OTHER OPTIONS + + The directory you specify with `--srcdir' need not be the same as + the one that `configure' is found in. + + Now, you can run `make' in that directory. You need not repeat the +configuration steps shown above, when ordinary source files change. You +must, however, run `configure' again when the configuration files +change, if your system does not support symbolic links. + +Building and Installing a Cross-Compiler +======================================== + + GNU CC can function as a cross-compiler for many machines, but not +all. + + * Cross-compilers for the Mips as target using the Mips assembler + currently do not work, because the auxiliary programs + `mips-tdump.c' and `mips-tfile.c' can't be compiled on anything + but a Mips. It does work to cross compile for a Mips if you use + the GNU assembler and linker. + + * Cross-compilers between machines with different floating point + formats have not all been made to work. GNU CC now has a floating + point emulator with which these can work, but each target machine + description needs to be updated to take advantage of it. + + * Cross-compilation between machines of different word sizes is + somewhat problematic and sometimes does not work. + + Since GNU CC generates assembler code, you probably need a +cross-assembler that GNU CC can run, in order to produce object files. +If you want to link on other than the target machine, you need a +cross-linker as well. You also need header files and libraries suitable +for the target machine that you can install on the host machine. + +Steps of Cross-Compilation +-------------------------- + + To compile and run a program using a cross-compiler involves several +steps: + + * Run the cross-compiler on the host machine to produce assembler + files for the target machine. This requires header files for the + target machine. + + * Assemble the files produced by the cross-compiler. You can do this + either with an assembler on the target machine, or with a + cross-assembler on the host machine. + + * Link those files to make an executable. You can do this either + with a linker on the target machine, or with a cross-linker on the + host machine. Whichever machine you use, you need libraries and + certain startup files (typically `crt....o') for the target + machine. + + It is most convenient to do all of these steps on the same host +machine, since then you can do it all with a single invocation of GNU +CC. This requires a suitable cross-assembler and cross-linker. For +some targets, the GNU assembler and linker are available. + +Configuring a Cross-Compiler +---------------------------- + + To build GNU CC as a cross-compiler, you start out by running +`configure'. Use the `--target=TARGET' to specify the target type. If +`configure' was unable to correctly identify the system you are running +on, also specify the `--build=BUILD' option. For example, here is how +to configure for a cross-compiler that produces code for an HP 68030 +system running BSD on a system that `configure' can correctly identify: + + ./configure --target=m68k-hp-bsd4.3 + +Tools and Libraries for a Cross-Compiler +---------------------------------------- + + If you have a cross-assembler and cross-linker available, you should +install them now. Put them in the directory `/usr/local/TARGET/bin'. +Here is a table of the tools you should put in this directory: + +`as' + This should be the cross-assembler. + +`ld' + This should be the cross-linker. + +`ar' + This should be the cross-archiver: a program which can manipulate + archive files (linker libraries) in the target machine's format. + +`ranlib' + This should be a program to construct a symbol table in an archive + file. + + The installation of GNU CC will find these programs in that +directory, and copy or link them to the proper place to for the +cross-compiler to find them when run later. + + The easiest way to provide these files is to build the Binutils +package and GAS. Configure them with the same `--host' and `--target' +options that you use for configuring GNU CC, then build and install +them. They install their executables automatically into the proper +directory. Alas, they do not support all the targets that GNU CC +supports. + + If you want to install libraries to use with the cross-compiler, +such as a standard C library, put them in the directory +`/usr/local/TARGET/lib'; installation of GNU CC copies all all the +files in that subdirectory into the proper place for GNU CC to find +them and link with them. Here's an example of copying some libraries +from a target machine: + + ftp TARGET-MACHINE + lcd /usr/local/TARGET/lib + cd /lib + get libc.a + cd /usr/lib + get libg.a + get libm.a + quit + +The precise set of libraries you'll need, and their locations on the +target machine, vary depending on its operating system. + + Many targets require "start files" such as `crt0.o' and `crtn.o' +which are linked into each executable; these too should be placed in +`/usr/local/TARGET/lib'. There may be several alternatives for +`crt0.o', for use with profiling or other compilation options. Check +your target's definition of `STARTFILE_SPEC' to find out what start +files it uses. Here's an example of copying these files from a target +machine: + + ftp TARGET-MACHINE + lcd /usr/local/TARGET/lib + prompt + cd /lib + mget *crt*.o + cd /usr/lib + mget *crt*.o + quit + +`libgcc.a' and Cross-Compilers +------------------------------ + + Code compiled by GNU CC uses certain runtime support functions +implicitly. Some of these functions can be compiled successfully with +GNU CC itself, but a few cannot be. These problem functions are in the +source file `libgcc1.c'; the library made from them is called +`libgcc1.a'. + + When you build a native compiler, these functions are compiled with +some other compiler-the one that you use for bootstrapping GNU CC. +Presumably it knows how to open code these operations, or else knows how +to call the run-time emulation facilities that the machine comes with. +But this approach doesn't work for building a cross-compiler. The +compiler that you use for building knows about the host system, not the +target system. + + So, when you build a cross-compiler you have to supply a suitable +library `libgcc1.a' that does the job it is expected to do. + + To compile `libgcc1.c' with the cross-compiler itself does not work. +The functions in this file are supposed to implement arithmetic +operations that GNU CC does not know how to open code for your target +machine. If these functions are compiled with GNU CC itself, they will +compile into infinite recursion. + + On any given target, most of these functions are not needed. If GNU +CC can open code an arithmetic operation, it will not call these +functions to perform the operation. It is possible that on your target +machine, none of these functions is needed. If so, you can supply an +empty library as `libgcc1.a'. + + Many targets need library support only for multiplication and +division. If you are linking with a library that contains functions for +multiplication and division, you can tell GNU CC to call them directly +by defining the macros `MULSI3_LIBCALL', and the like. These macros +need to be defined in the target description macro file. For some +targets, they are defined already. This may be sufficient to avoid the +need for libgcc1.a; if so, you can supply an empty library. + + Some targets do not have floating point instructions; they need other +functions in `libgcc1.a', which do floating arithmetic. Recent +versions of GNU CC have a file which emulates floating point. With a +certain amount of work, you should be able to construct a floating +point emulator that can be used as `libgcc1.a'. Perhaps future +versions will contain code to do this automatically and conveniently. +That depends on whether someone wants to implement it. + + Some embedded targets come with all the necessary `libgcc1.a' +routines written in C or assembler. These targets build `libgcc1.a' +automatically and you do not need to do anything special for them. +Other embedded targets do not need any `libgcc1.a' routines since all +the necessary operations are supported by the hardware. + + If your target system has another C compiler, you can configure GNU +CC as a native compiler on that machine, build just `libgcc1.a' with +`make libgcc1.a' on that machine, and use the resulting file with the +cross-compiler. To do this, execute the following on the target +machine: + + cd TARGET-BUILD-DIR + ./configure --host=sparc --target=sun3 + make libgcc1.a + +And then this on the host machine: + + ftp TARGET-MACHINE + binary + cd TARGET-BUILD-DIR + get libgcc1.a + quit + + Another way to provide the functions you need in `libgcc1.a' is to +define the appropriate `perform_...' macros for those functions. If +these definitions do not use the C arithmetic operators that they are +meant to implement, you should be able to compile them with the +cross-compiler you are building. (If these definitions already exist +for your target file, then you are all set.) + + To build `libgcc1.a' using the perform macros, use +`LIBGCC1=libgcc1.a OLDCC=./xgcc' when building the compiler. +Otherwise, you should place your replacement library under the name +`libgcc1.a' in the directory in which you will build the +cross-compiler, before you run `make'. + +Cross-Compilers and Header Files +-------------------------------- + + If you are cross-compiling a standalone program or a program for an +embedded system, then you may not need any header files except the few +that are part of GNU CC (and those of your program). However, if you +intend to link your program with a standard C library such as `libc.a', +then you probably need to compile with the header files that go with +the library you use. + + The GNU C compiler does not come with these files, because (1) they +are system-specific, and (2) they belong in a C library, not in a +compiler. + + If the GNU C library supports your target machine, then you can get +the header files from there (assuming you actually use the GNU library +when you link your program). + + If your target machine comes with a C compiler, it probably comes +with suitable header files also. If you make these files accessible +from the host machine, the cross-compiler can use them also. + + Otherwise, you're on your own in finding header files to use when +cross-compiling. + + When you have found suitable header files, put them in +`/usr/local/TARGET/include', before building the cross compiler. Then +installation will run fixincludes properly and install the corrected +versions of the header files where the compiler will use them. + + Provide the header files before you build the cross-compiler, because +the build stage actually runs the cross-compiler to produce parts of +`libgcc.a'. (These are the parts that *can* be compiled with GNU CC.) +Some of them need suitable header files. + + Here's an example showing how to copy the header files from a target +machine. On the target machine, do this: + + (cd /usr/include; tar cf - .) > tarfile + + Then, on the host machine, do this: + + ftp TARGET-MACHINE + lcd /usr/local/TARGET/include + get tarfile + quit + tar xf tarfile + +Actually Building the Cross-Compiler +------------------------------------ + + Now you can proceed just as for compiling a single-machine compiler +through the step of building stage 1. If you have not provided some +sort of `libgcc1.a', then compilation will give up at the point where +it needs that file, printing a suitable error message. If you do +provide `libgcc1.a', then building the compiler will automatically +compile and link a test program called `libgcc1-test'; if you get +errors in the linking, it means that not all of the necessary routines +in `libgcc1.a' are available. + + You must provide the header file `float.h'. One way to do this is +to compile `enquire' and run it on your target machine. The job of +`enquire' is to run on the target machine and figure out by experiment +the nature of its floating point representation. `enquire' records its +findings in the header file `float.h'. If you can't produce this file +by running `enquire' on the target machine, then you will need to come +up with a suitable `float.h' in some other way (or else, avoid using it +in your programs). + + Do not try to build stage 2 for a cross-compiler. It doesn't work to +rebuild GNU CC as a cross-compiler using the cross-compiler, because +that would produce a program that runs on the target machine, not on the +host. For example, if you compile a 386-to-68030 cross-compiler with +itself, the result will not be right either for the 386 (because it was +compiled into 68030 code) or for the 68030 (because it was configured +for a 386 as the host). If you want to compile GNU CC into 68030 code, +whether you compile it on a 68030 or with a cross-compiler on a 386, you +must specify a 68030 as the host when you configure it. + + To install the cross-compiler, use `make install', as usual. + +Installing GNU CC on the Sun +============================ + + On Solaris (version 2.1), do not use the linker or other tools in +`/usr/ucb' to build GNU CC. Use `/usr/ccs/bin'. + + Make sure the environment variable `FLOAT_OPTION' is not set when +you compile `libgcc.a'. If this option were set to `f68881' when +`libgcc.a' is compiled, the resulting code would demand to be linked +with a special startup file and would not link properly without special +pains. + + There is a bug in `alloca' in certain versions of the Sun library. +To avoid this bug, install the binaries of GNU CC that were compiled by +GNU CC. They use `alloca' as a built-in function and never the one in +the library. + + Some versions of the Sun compiler crash when compiling GNU CC. The +problem is a segmentation fault in cpp. This problem seems to be due to +the bulk of data in the environment variables. You may be able to avoid +it by using the following command to compile GNU CC with Sun CC: + + make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc" + +Installing GNU CC on VMS +======================== + + The VMS version of GNU CC is distributed in a backup saveset +containing both source code and precompiled binaries. + + To install the `gcc' command so you can use the compiler easily, in +the same manner as you use the VMS C compiler, you must install the VMS +CLD file for GNU CC as follows: + + 1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to + point to the directories where the GNU CC executables + (`gcc-cpp.exe', `gcc-cc1.exe', etc.) and the C include files are + kept respectively. This should be done with the commands: + + $ assign /system /translation=concealed - + disk:[gcc.] gnu_cc + $ assign /system /translation=concealed - + disk:[gcc.include.] gnu_cc_include + + with the appropriate disk and directory names. These commands can + be placed in your system startup file so they will be executed + whenever the machine is rebooted. You may, if you choose, do this + via the `GCC_INSTALL.COM' script in the `[GCC]' directory. + + 2. Install the `GCC' command with the command line: + + $ set command /table=sys$common:[syslib]dcltables - + /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc + $ install replace sys$common:[syslib]dcltables + + 3. To install the help file, do the following: + + $ library/help sys$library:helplib.hlb gcc.hlp + + Now you can invoke the compiler with a command like `gcc /verbose + file.c', which is equivalent to the command `gcc -v -c file.c' in + Unix. + + If you wish to use GNU C++ you must first install GNU CC, and then +perform the following steps: + + 1. Define the VMS logical name `GNU_GXX_INCLUDE' to point to the + directory where the preprocessor will search for the C++ header + files. This can be done with the command: + + $ assign /system /translation=concealed - + disk:[gcc.gxx_include.] gnu_gxx_include + + with the appropriate disk and directory name. If you are going to + be using libg++, this is where the libg++ install procedure will + install the libg++ header files. + + 2. Obtain the file `gcc-cc1plus.exe', and place this in the same + directory that `gcc-cc1.exe' is kept. + + The GNU C++ compiler can be invoked with a command like `gcc /plus + /verbose file.cc', which is equivalent to the command `g++ -v -c + file.cc' in Unix. + + We try to put corresponding binaries and sources on the VMS +distribution tape. But sometimes the binaries will be from an older +version than the sources, because we don't always have time to update +them. (Use the `/version' option to determine the version number of +the binaries and compare it with the source file `version.c' to tell +whether this is so.) In this case, you should use the binaries you get +to recompile the sources. If you must recompile, here is how: + + 1. Execute the command procedure `vmsconfig.com' to set up the files + `tm.h', `config.h', `aux-output.c', and `md.', and to create files + `tconfig.h' and `hconfig.h'. This procedure also creates several + linker option files used by `make-cc1.com' and a data file used by + `make-l2.com'. + + $ @vmsconfig.com + + 2. Setup the logical names and command tables as defined above. In + addition, define the VMS logical name `GNU_BISON' to point at the + to the directories where the Bison executable is kept. This + should be done with the command: + + $ assign /system /translation=concealed - + disk:[bison.] gnu_bison + + You may, if you choose, use the `INSTALL_BISON.COM' script in the + `[BISON]' directory. + + 3. Install the `BISON' command with the command line: + + $ set command /table=sys$common:[syslib]dcltables - + /output=sys$common:[syslib]dcltables - + gnu_bison:[000000]bison + $ install replace sys$common:[syslib]dcltables + + 4. Type `@make-gcc' to recompile everything (alternatively, submit + the file `make-gcc.com' to a batch queue). If you wish to build + the GNU C++ compiler as well as the GNU CC compiler, you must + first edit `make-gcc.com' and follow the instructions that appear + in the comments. + + 5. In order to use GCC, you need a library of functions which GCC + compiled code will call to perform certain tasks, and these + functions are defined in the file `libgcc2.c'. To compile this + you should use the command procedure `make-l2.com', which will + generate the library `libgcc2.olb'. `libgcc2.olb' should be built + using the compiler built from the same distribution that + `libgcc2.c' came from, and `make-gcc.com' will automatically do + all of this for you. + + To install the library, use the following commands: + + $ library gnu_cc:[000000]gcclib/delete=(new,eprintf) + $ library gnu_cc:[000000]gcclib/delete=L_* + $ library libgcc2/extract=*/output=libgcc2.obj + $ library gnu_cc:[000000]gcclib libgcc2.obj + + The first command simply removes old modules that will be replaced + with modules from `libgcc2' under different module names. The + modules `new' and `eprintf' may not actually be present in your + `gcclib.olb'--if the VMS librarian complains about those modules + not being present, simply ignore the message and continue on with + the next command. The second command removes the modules that + came from the previous version of the library `libgcc2.c'. + + Whenever you update the compiler on your system, you should also + update the library with the above procedure. + + 6. You may wish to build GCC in such a way that no files are written + to the directory where the source files reside. An example would + be the when the source files are on a read-only disk. In these + cases, execute the following DCL commands (substituting your + actual path names): + + $ assign dua0:[gcc.build_dir.]/translation=concealed, - + dua1:[gcc.source_dir.]/translation=concealed gcc_build + $ set default gcc_build:[000000] + + where the directory `dua1:[gcc.source_dir]' contains the source + code, and the directory `dua0:[gcc.build_dir]' is meant to contain + all of the generated object files and executables. Once you have + done this, you can proceed building GCC as described above. (Keep + in mind that `gcc_build' is a rooted logical name, and thus the + device names in each element of the search list must be an actual + physical device name rather than another rooted logical name). + + 7. *If you are building GNU CC with a previous version of GNU CC, you + also should check to see that you have the newest version of the + assembler*. In particular, GNU CC version 2 treats global constant + variables slightly differently from GNU CC version 1, and GAS + version 1.38.1 does not have the patches required to work with GCC + version 2. If you use GAS 1.38.1, then `extern const' variables + will not have the read-only bit set, and the linker will generate + warning messages about mismatched psect attributes for these + variables. These warning messages are merely a nuisance, and can + safely be ignored. + + If you are compiling with a version of GNU CC older than 1.33, + specify `/DEFINE=("inline=")' as an option in all the + compilations. This requires editing all the `gcc' commands in + `make-cc1.com'. (The older versions had problems supporting + `inline'.) Once you have a working 1.33 or newer GNU CC, you can + change this file back. + + 8. If you want to build GNU CC with the VAX C compiler, you will need + to make minor changes in `make-cccp.com' and `make-cc1.com' to + choose alternate definitions of `CC', `CFLAGS', and `LIBS'. See + comments in those files. However, you must also have a working + version of the GNU assembler (GNU as, aka GAS) as it is used as + the back-end for GNU CC to produce binary object modules and is + not included in the GNU CC sources. GAS is also needed to compile + `libgcc2' in order to build `gcclib' (see above); `make-l2.com' + expects to be able to find it operational in + `gnu_cc:[000000]gnu-as.exe'. + + To use GNU CC on VMS, you need the VMS driver programs `gcc.exe', + `gcc.com', and `gcc.cld'. They are distributed with the VMS + binaries (`gcc-vms') rather than the GNU CC sources. GAS is also + included in `gcc-vms', as is Bison. + + Once you have successfully built GNU CC with VAX C, you should use + the resulting compiler to rebuild itself. Before doing this, be + sure to restore the `CC', `CFLAGS', and `LIBS' definitions in + `make-cccp.com' and `make-cc1.com'. The second generation + compiler will be able to take advantage of many optimizations that + must be suppressed when building with other compilers. + + Under previous versions of GNU CC, the generated code would +occasionally give strange results when linked with the sharable +`VAXCRTL' library. Now this should work. + + Even with this version, however, GNU CC itself should not be linked +with the sharable `VAXCRTL'. The version of `qsort' in `VAXCRTL' has a +bug (known to be present in VMS versions V4.6 through V5.5) which +causes the compiler to fail. + + The executables are generated by `make-cc1.com' and `make-cccp.com' +use the object library version of `VAXCRTL' in order to make use of the +`qsort' routine in `gcclib.olb'. If you wish to link the compiler +executables with the shareable image version of `VAXCRTL', you should +edit the file `tm.h' (created by `vmsconfig.com') to define the macro +`QSORT_WORKAROUND'. + + `QSORT_WORKAROUND' is always defined when GNU CC is compiled with +VAX C, to avoid a problem in case `gcclib.olb' is not yet available. + +`collect2' +========== + + Many target systems do not have support in the assembler and linker +for "constructors"--initialization functions to be called before the +official "start" of `main'. On such systems, GNU CC uses a utility +called `collect2' to arrange to call these functions at start time. + + The program `collect2' works by linking the program once and looking +through the linker output file for symbols with particular names +indicating they are constructor functions. If it finds any, it creates +a new temporary `.c' file containing a table of them, compiles it, and +links the program a second time including that file. + + The actual calls to the constructors are carried out by a subroutine +called `__main', which is called (automatically) at the beginning of +the body of `main' (provided `main' was compiled with GNU CC). Calling +`__main' is necessary, even when compiling C code, to allow linking C +and C++ object code together. (If you use `-nostdlib', you get an +unresolved reference to `__main', since it's defined in the standard +GCC library. Include `-lgcc' at the end of your compiler command line +to resolve this reference.) + + The program `collect2' is installed as `ld' in the directory where +the passes of the compiler are installed. When `collect2' needs to +find the *real* `ld', it tries the following file names: + + * `real-ld' in the directories listed in the compiler's search + directories. + + * `real-ld' in the directories listed in the environment variable + `PATH'. + + * The file specified in the `REAL_LD_FILE_NAME' configuration macro, + if specified. + + * `ld' in the compiler's search directories, except that `collect2' + will not execute itself recursively. + + * `ld' in `PATH'. + + "The compiler's search directories" means all the directories where +`gcc' searches for passes of the compiler. This includes directories +that you specify with `-B'. + + Cross-compilers search a little differently: + + * `real-ld' in the compiler's search directories. + + * `TARGET-real-ld' in `PATH'. + + * The file specified in the `REAL_LD_FILE_NAME' configuration macro, + if specified. + + * `ld' in the compiler's search directories. + + * `TARGET-ld' in `PATH'. + + `collect2' explicitly avoids running `ld' using the file name under +which `collect2' itself was invoked. In fact, it remembers up a list +of such names--in case one copy of `collect2' finds another copy (or +version) of `collect2' installed as `ld' in a second place in the +search path. + + `collect2' searches for the utilities `nm' and `strip' using the +same algorithm as above for `ld'. + +Standard Header File Directories +================================ + + `GCC_INCLUDE_DIR' means the same thing for native and cross. It is +where GNU CC stores its private include files, and also where GNU CC +stores the fixed include files. A cross compiled GNU CC runs +`fixincludes' on the header files in `$(tooldir)/include'. (If the +cross compilation header files need to be fixed, they must be installed +before GNU CC is built. If the cross compilation header files are +already suitable for ANSI C and GNU CC, nothing special need be done). + + `GPLUS_INCLUDE_DIR' means the same thing for native and cross. It +is where `g++' looks first for header files. `libg++' installs only +target independent header files in that directory. + + `LOCAL_INCLUDE_DIR' is used only for a native compiler. It is +normally `/usr/local/include'. GNU CC searches this directory so that +users can install header files in `/usr/local/include'. + + `CROSS_INCLUDE_DIR' is used only for a cross compiler. GNU CC +doesn't install anything there. + + `TOOL_INCLUDE_DIR' is used for both native and cross compilers. It +is the place for other packages to install header files that GNU CC will +use. For a cross-compiler, this is the equivalent of `/usr/include'. +When you build a cross-compiler, `fixincludes' processes any header +files in this directory. + diff --git a/contrib/gcc/config/i386/freebsd.h.fixed b/contrib/gcc/config/i386/freebsd.h.fixed deleted file mode 100644 index fd83cb9d4f6b5..0000000000000 --- a/contrib/gcc/config/i386/freebsd.h.fixed +++ /dev/null @@ -1,298 +0,0 @@ -/* Definitions of target machine for GNU compiler for Intel 80386 - running FreeBSD. - Copyright (C) 1988, 1992, 1994 Free Software Foundation, Inc. - Contributed by Poul-Henning Kamp <phk@login.dkuug.dk> - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* This is tested by i386gas.h. */ -#define YES_UNDERSCORES - -/* Don't assume anything about the header files. */ -#define NO_IMPLICIT_EXTERN_C - -#include "i386/gstabs.h" - -/* Get perform_* macros to build libgcc.a. */ -#include "i386/perform.h" - -/* This was cloned from ../netbsd.h. It and several other things in - this file should be in ../freebsd.h. */ -/* FREEBSD_NATIVE is defined when gcc is integrated into the FreeBSD - source tree so it can be configured appropriately without using - the GNU configure/build mechanism. */ - -#ifdef FREEBSD_NATIVE - -/* Look for the include files in the system-defined places. */ - -#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++" - -#define GCC_INCLUDE_DIR "/usr/include" - -/* FreeBSD has GCC_INCLUDE_DIR first. */ -#define INCLUDE_DEFAULTS \ - { \ - { GCC_INCLUDE_DIR, 0, 0 }, \ - { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \ - { 0, 0, 0 } \ - } - -/* Under FreeBSD, the normal location of the compiler back ends is the - /usr/libexec directory. */ - -#define STANDARD_EXEC_PREFIX "/usr/libexec/" - -/* Under FreeBSD, the normal location of the various *crt*.o files is the - /usr/lib directory. */ - -#define STANDARD_STARTFILE_PREFIX "/usr/lib/" - -/* On FreeBSD, gcc is called 'cc' */ -#define GCC_NAME "cc" - -/* FreeBSD is 4.4BSD derived */ -#define bsd4_4 - -#endif /* FREEBSD_NATIVE */ - -#define MASK_PROFILER_EPILOGUE 010000000000 - -#define TARGET_PROFILER_EPILOGUE (target_flags & MASK_PROFILER_EPILOGUE) - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "profiler-epilogue", MASK_PROFILER_EPILOGUE}, \ - { "no-profiler-epilogue", -MASK_PROFILER_EPILOGUE}, - - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=2 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" - -#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}" - -/* Like the default, except no -lg. */ -#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" - -#define LINK_SPEC \ - "%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*} \ - %{p:-Bstatic} %{pg:-Bstatic} %{Z} %{R*}" - -#define LINK_LIBGCC_SPECIAL_1 1 - -#define STARTFILE_SPEC \ - "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:%{static:scrt0.o%s}%{!static:crt0.o%s}}}" - -/* This goes away when the math emulator is fixed. */ -#undef TARGET_DEFAULT -#define TARGET_DEFAULT (MASK_NO_FANCY_MATH_387 | 0301) - -#undef SIZE_TYPE -#define SIZE_TYPE "unsigned int" - -#undef PTRDIFF_TYPE -#define PTRDIFF_TYPE "int" - -#undef WCHAR_TYPE -#define WCHAR_TYPE "int" - -#define WCHAR_UNSIGNED 0 - -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE BITS_PER_WORD - -#define HAVE_ATEXIT - -#define HAVE_PUTENV - -/* Override the default comment-starter of "/". */ - -#undef ASM_COMMENT_START -#define ASM_COMMENT_START "#" - -#undef ASM_APP_ON -#define ASM_APP_ON "#APP\n" - -#undef ASM_APP_OFF -#define ASM_APP_OFF "#NO_APP\n" - -/* The following macros are stolen from i386v4.h */ -/* These have to be defined to get PIC code correct */ - -/* This is how to output an element of a case-vector that is relative. - This is only used for PIC code. See comments by the `casesi' insn in - i386.md for an explanation of the expression this outputs. */ - -#undef ASM_OUTPUT_ADDR_DIFF_ELT -#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \ - fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE) - -/* Indicate that jump tables go in the text section. This is - necessary when compiling PIC code. */ - -#define JUMP_TABLES_IN_TEXT_SECTION - -/* Don't default to pcc-struct-return, because gcc is the only compiler, and - we want to retain compatibility with older gcc versions. */ -#define DEFAULT_PCC_STRUCT_RETURN 0 - -/* Tell final.c that we don't need a label passed to mcount. */ - -#define NO_PROFILE_DATA - -/* Redefine this to not pass an unused label in %edx. */ - -#undef FUNCTION_PROFILER -#define FUNCTION_PROFILER(FILE, LABELNO) \ -{ \ - if (flag_pic) \ - fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \ - else \ - fprintf (FILE, "\tcall mcount\n"); \ -} - -#define FUNCTION_PROFILER_EPILOGUE(FILE) \ -{ \ - if (TARGET_PROFILER_EPILOGUE) \ - { \ - if (flag_pic) \ - fprintf (FILE, "\tcall *mexitcount@GOT(%%ebx)\n"); \ - else \ - fprintf (FILE, "\tcall mexitcount\n"); \ - } \ -} - -/* - * Some imports from svr4.h in support of shared libraries. - * Currently, we need the DECLARE_OBJECT_SIZE stuff. - */ - -#define HANDLE_SYSV_PRAGMA - -/* Define the strings used for the special svr4 .type and .size directives. - These strings generally do not vary from one system running svr4 to - another, but if a given system (e.g. m88k running svr) needs to use - different pseudo-op names for these, they may be overridden in the - file which includes this one. */ - -#define TYPE_ASM_OP ".type" -#define SIZE_ASM_OP ".size" -#define SET_ASM_OP ".set" - -/* This is how we tell the assembler that a symbol is weak. */ -#define ASM_WEAKEN_LABEL(FILE,NAME) \ - do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \ - fputc ('\n', FILE); } while (0) - -/* The following macro defines the format used to output the second - operand of the .type assembler directive. Different svr4 assemblers - expect various different forms for this operand. The one given here - is just a default. You may need to override it in your machine- - specific tm.h file (depending upon the particulars of your assembler). */ - -#define TYPE_OPERAND_FMT "@%s" - -/* Write the extra assembler code needed to declare a function's result. - Most svr4 assemblers don't require any special declaration of the - result value, but there are exceptions. */ - -#ifndef ASM_DECLARE_RESULT -#define ASM_DECLARE_RESULT(FILE, RESULT) -#endif - -/* These macros generate the special .type and .size directives which - are used to set the corresponding fields of the linker symbol table - entries in an ELF object file under SVR4. These macros also output - the starting labels for the relevant functions/objects. */ - -/* Write the extra assembler code needed to declare a function properly. - Some svr4 assemblers need to also have something extra said about the - function's return value. We allow for that here. */ - -#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ - do { \ - fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ - assemble_name (FILE, NAME); \ - putc (',', FILE); \ - fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ - putc ('\n', FILE); \ - ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ - ASM_OUTPUT_LABEL(FILE, NAME); \ - } while (0) - -/* Write the extra assembler code needed to declare an object properly. */ - -#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ - do { \ - fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ - assemble_name (FILE, NAME); \ - putc (',', FILE); \ - fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ - putc ('\n', FILE); \ - size_directive_output = 0; \ - if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ - { \ - size_directive_output = 1; \ - fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ - assemble_name (FILE, NAME); \ - fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ - } \ - ASM_OUTPUT_LABEL(FILE, NAME); \ - } while (0) - -/* Output the size directive for a decl in rest_of_decl_compilation - in the case where we did not do so before the initializer. - Once we find the error_mark_node, we know that the value of - size_directive_output was set - by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */ - -#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ -do { \ - char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ - if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \ - && ! AT_END && TOP_LEVEL \ - && DECL_INITIAL (DECL) == error_mark_node \ - && !size_directive_output) \ - { \ - fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ - assemble_name (FILE, name); \ - fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL)));\ - } \ - } while (0) - - -/* This is how to declare the size of a function. */ - -#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ - do { \ - if (!flag_inhibit_size_directive) \ - { \ - char label[256]; \ - static int labelno; \ - labelno++; \ - ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \ - ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \ - fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ - assemble_name (FILE, (FNAME)); \ - fprintf (FILE, ","); \ - assemble_name (FILE, label); \ - fprintf (FILE, "-"); \ - assemble_name (FILE, (FNAME)); \ - putc ('\n', FILE); \ - } \ - } while (0) diff --git a/contrib/gdb/bfd/ChangeLog b/contrib/gdb/bfd/ChangeLog new file mode 100644 index 0000000000000..0c84449f0a5ef --- /dev/null +++ b/contrib/gdb/bfd/ChangeLog @@ -0,0 +1,3385 @@ +Sun Apr 7 18:23:36 1996 Fred Fish <fnf@cygnus.com> + + From: Miles Bader <miles@gnu.ai.mit.edu> + * configure.in: Use AC_CHECK_TOOL to find ar & ranlib. + * configure: Regenerate with autoconf. + +Wed Apr 3 16:22:16 1996 Fred Fish <fnf@cygnus.com> + + * configure.in (mips-sony-bsd*): Fix typo in AC_DEFINE. + (AC_CHECK_HEADERS): Check for sys/time.h + (AC_HEADER_TIME): Add macro. + * configure: Regenerate with autoconf. + * config.in: Regenerate with autoheader. + * sysdep.h: Use TIME_WITH_SYS_TIME and HAVE_SYS_TIME_H + to control what combination of <time> and <sys/time.h> + get included. + +Wed Mar 20 16:53:12 1996 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (coff_add_missing_symbols): Ifdef out. + (coff_write_object_contents): Don't call coff_add_missing_symbols. + * coffgen.c (coff_section_symbol): Ifdef out. + +Mon Mar 18 12:54:41 1996 Ian Lance Taylor <ian@cygnus.com> + + * elf32-mips.c (mips_elf_gprel32_reloc): Initialize gp if + output_bfd is not NULL. + +Thu Mar 14 17:12:06 1996 Doug Evans <dje@charmed.cygnus.com> + + * coffgen.c (coff_get_normalized_symtab): Call bfd_zalloc instead + of bfd_alloc (fixes fix_line not being initialized). + Delete zeroing of fix_{value,tag,end,scnlen} fields. + +Thu Mar 14 16:06:06 1996 Jeffrey A Law (law@cygnus.com) + + * coffcode.h: Allow specific backends to override the + bfd_link_add_symbols routine. + + * coff-h8300.c: Include genlink.h. + (howto_table): Add R_MEM_INDIRECT. + (rtype2howto): Support R_MEM_INDIRECT. + (h8300_reloc16_extra_cases): Handle R_MEM_INDIRECT like R_RELBYTE + for now. + +Tue Mar 12 12:41:17 1996 David Mosberger-Tang <davidm@koala.azstarnet.com> + + * coff-alpha.c (alpha_relocate_section): Use + info->callbacks_warning, rather than _bfd_error_handler, for + "multiple gp" warning. + +Tue Mar 12 12:10:55 1996 Ian Lance Taylor <ian@cygnus.com> + + * linker.c (bfd_wrapped_link_hash_lookup): New function. + (_bfd_generic_link_add_one_symbol): Remove BFD_ASSERT on hash + table string. Use bfd_wrapped_link_hash_lookup. + (_bfd_generic_link_write_global_symbol): Remove BFD_ASSERT on hash + table string. + * aoutx.h (aout_link_write_symbols): Use the name from the hash + table, if any, when writing out symbols. + (aout_link_input_section_std): Use the name from the hash table, + if any, when reporting undefined symbols. + (aout_link_input_section_ext): Likewise. + (aout_link_reloc_link_order): Use bfd_wrapped_link_hash_lookup. + * bout.c (get_value): Likewise. + * cofflink.c (_bfd_coff_reloc_link_order): Likewise. + * ecoff.c (ecoff_reloc_link_order): Likewise. + * elflink.h (elf_link_add_object_symbols): Likewise. + (elf_reloc_link_order): Likewise. + * linker.c (_bfd_generic_link_output_symbols): Likewise. + (_bfd_generic_reloc_link_order): Likewise. + (default_indirect_link_order): Likewise. + * reloc16.c (bfd_coff_reloc16_get_value): Likewise. + * sunos.c (sunos_add_one_symbol): Likewise. + * xcofflink.c (xcoff_link_add_symbols): Likewise. + (bfd_xcoff_link_count_reloc): Likewise. + (xcoff_reloc_link_order): Likewise. + + * ecoffswap.h (ecoff_swap_fdr_in): If ECOFF_64, turn 0xffffffff + into -1 for intern->rss. + + * configure: Rebuild with autoconf 2.8. + +Mon Mar 11 12:28:31 1996 Ian Lance Taylor <ian@cygnus.com> + + * stab-syms.c (__define_stab_duplicate): Define. + (bfd_get_stab_name): Rename from aout_stab_name. Rewrite to use a + switch. + * bfd-in.h (bfd_get_stab_name): Declare. + * bfd-in2.h: Rebuild. + * Makefile.in: Rebuild dependencies. + (BFD_LIBS): Add stab-syms.o. + (BFD_LIBS_CFILES): Add stab-syms.c. + (BFD32_BACKENDS): Remove stab-syms.o. + (BFD32_BACKENDS_CFILES): Remove stab-syms.c. + * configure.in: Don't list stab-syms.o in bfd_backends. + * configure: Rebuild. + * libaout.h (aout_stab_name): Don't declare. + * aoutx.h (NAME(aout,get_symbol_info)): Call bfd_get_stab_name, + not aout_stab_name. + +Fri Mar 8 11:26:20 1996 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (assign_file_positions_for_segments): Adjust file offset + for section alignment even if SEC_LOAD is not set. + +Tue Mar 5 12:02:23 1996 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Don't set SHLIB or SHLINK to an empty string, + since they appear as targets in Makefile.in. + * configure: Rebuild. + + * sunos.c (sunos_scan_ext_relocs): If not making a shared library, + don't fiddle with a symbol which is not defined anywhere. + +Mon Mar 4 12:49:16 1996 Ian Lance Taylor <ian@cygnus.com> + + * xcofflink.c (xcoff_mark): Treat undefined imported symbols as + though they are defined in a shared library. + (xcoff_build_ldsyms): Likewise. + + * coffgen.c (coff_find_nearest_line): Don't look at the line + numbers for the section if section->lineno is NULL. + + * elf.c (_bfd_elf_symbol_from_bfd_symbol): Print a useful error + message rather than calling BFD_ASSERT. + * elfcode.h (write_relocs): Check return value of + _bfd_elf_symbol_from_bfd_symbol. + +Fri Mar 1 09:42:59 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_add_symbol_hook): Don't set SEC_LOAD flag + for .sbss section. + +Wed Feb 28 11:25:47 1996 Jeffrey A Law (law@cygnus.com) + + * libhppa.h (hppa_reloc_field_selector_type): Add R_HPPA_NLSEL + and R_HPPA_NLRSEL. + (e_nsel, e_nlsel, e_nlrsel): Undefine. Add to + hppa_reloc_field_selector_type_alt. + (hppa_field_adjust): Handle e_nlsel, e_nlrsel. Fix e_nsel handling. + * som.c (hppa_som_gen_reloc_type): Handle N', NL' NLR' field + selectors. + (som_write_fixups): Finish handling of R_N0SEL and R_N1SEL. + +Wed Feb 28 11:00:24 1996 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (assign_file_positions_for_segments): Adjust the segment + memory size for the alignment of a SEC_ALLOC section, not just a + SEC_LOAD section. + +Tue Feb 27 14:17:31 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * m68klinux.c: New file. + * hosts/m68klinux.h: New file. + * config.bfd (m68*-*-linuxaout*, m68*-*-linux*): New targets. + * configure.in (m68*-*-linux*): New native host. + (m68klinux_vec): New vector. + * configure: Rebuild. + * targets.c (m68klinux_vec): Declare. + * i386linux.c (bfd_i386linux_size_dynamic_sections): Renamed from + bfd_linux_size_dynmic_sections to avoid clash with m68klinux.c. + * bfd-in.h (bfd_i386linux_size_dynamic_sections): Rename + declaration from bfd_linux_size_dynamic_sections. + (bfd_m68klinux_size_dynamic_sections): Declare. + * bfd-in2.h: Rebuild. + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add m68klinux.o. + (BFD32_BACKENDS_CFILES): Add m68klinux.c. + +Tue Feb 27 11:31:34 1996 Jeffrey A Law (law@cygnus.com) + + * libhppa.h (pa_arch): Add pa20. + (hppa_reloc_field_selector_type): Add R_HPPA_NSEL. + (e_nsel): Undefine. Add to hppa_reloc_field_selector_type_alt. + (hppa_field_adjust): Handle e_nsel. + * som.c: Provide default definitions for many new relocs found only + in hpux10 include files. + (som_fixup_formats): Add several new relocs from hpux10. + (som_hppa_howto_table): Add hpux10 relocs. + (som_write_fixups): Handle R_N0SEL and R_N1SEL hpux10 relocs. + +Mon Feb 26 12:52:48 1996 Stan Shebs <shebs@andros.cygnus.com> + + * mpw-make.sed: Edit out recent shared library support, and + rules to rebuild .h files using doc/chew. + +Mon Feb 26 14:48:39 1996 David Mosberger-Tang <davidm@AZStarNet.com> + + * ecoff.c (ecoff_compute_section_file_positions): Adjust the file + size even of sections with no contents. + +Mon Feb 26 14:01:13 1996 Ian Lance Taylor <ian@cygnus.com> + + * cofflink.c (_bfd_coff_link_input_bfd): When merging, skip names + starting with '$' the way we skip names starting with '.'. When + updating x_endndx, don't be fooled by an index which has been + merged. + + * cofflink.c (_bfd_coff_link_input_bfd): Don't try to optimize a + struct/union/enum type with no elements. + +Sat Feb 24 11:38:58 1996 Ian Lance Taylor <ian@cygnus.com> + + * bfd.c (bfd_errmsg): Handle a NULL return from strerror. + + * archive.c (bfd_generic_archive_p): If the first file in the + archive can not be recognized as an object, don't assume that this + is the wrong format. + + * elf.c (bfd_elf_set_dt_needed_name): Don't do anything if the + format is not bfd_object. + (bfd_elf_get_dt_soname): Likewise. + +Wed Feb 21 13:58:04 1996 Ian Lance Taylor <ian@cygnus.com> + + * coff-sh.c (sh_relax_delete_bytes): Correct range of R_SH_USES + reloc. + +Tue Feb 20 16:22:44 1996 J.T. Conklin <jtc@rtl.cygnus.com> + + * bfd.c (tdata): Add netbsd_core_data. + * bfd-in2.h: Regenerated. + +Tue Feb 20 16:50:02 1996 Ian Lance Taylor <ian@cygnus.com> + + * sunos.c (SUNOS_CONSTRUCTOR): Define. + (sunos_add_one_symbol): Don't let a symbol from a dynamic object + override a constructor symbol. Set SUNOS_CONSTRUCTOR when + appropriate. + + * bout.c (b_out_squirt_out_relocs): Use udata.i rather than flags + to get the symbol index, matching 14 Jul 95 change. + +Tue Feb 20 08:26:27 1996 Fred Fish <fnf@phydeaux.cygnus.com> + + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): + Remove duplicate definition of gp. + +Mon Feb 19 12:37:41 1996 Ian Lance Taylor <ian@cygnus.com> + + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Don't + assume that we can set the GP value and then get the same value, + since it won't be true if the output file is neither ELF nor + ECOFF. + * coff-mips.c (mips_adjust_reloc_in): Don't bother to use + _bfd_get_gp_value here. + (mips_gprel_reloc): Don't assume we can set and get the GP value. + * elf32-mips.c (mips_elf_hi16_reloc): Get gp value from + mips_elf_final_gp. + (mips_elf_lo16_reloc): Likewise. + (mips_elf_final_gp): Add pgp parameter. Set it to the GP value. + Don't require that the BFD be ELF. + (mips_elf_gprel16_reloc): Get gp value from mips_elf_final_gp. + (mips_elf_gprel32_reloc): Likewise. + (mips_elf_relocate_section): Don't assume we can set and get the + GP value. + (mips_elf_finish_dynamic_symbol): Don't bother to use + _bfd_get_gp_value here. + + * elf32-mips.c (mips_elf_create_procedure_table): Initialize sv. + Don't change epdr between malloc and free. Be careful not to free + NULL pointers. Zero out the first RPDR. + + * configure.host: On Linux, only pass -rpath option if $(libdir) + is neither /lib nor /usr/lib. From Alan Modra + <alan@mullet.Levels.UniSA.Edu.Au>. + + * elf-bfd.h (struct elf_obj_tdata): Rename dt_needed_name to + dt_name. + (elf_dt_name): Rename from elf_dt_needed_name. + * elf.c (bfd_elf_set_dt_needed_name): Use elf_dt_name, not + elf_dt_needed_name. + (bfd_elf_get_dt_soname): New function. + * elflink.h (elf_link_add_object_symbols): Use elf_dt_name, not + elf_dt_needed_name. Save the SONAME back in elf_dt_name. + * bfd-in.h (bfd_elf_get_dt_soname): Declare. + * bfd-in2.h: Rebuild. + +Mon Feb 19 02:50:23 1996 Doug Evans <dje@charmed.cygnus.com> + + * elf32-sparc.c (elf32_sparc_reloc_type_lookup): Renamed from + _bfd_sparc_elf_reloc_type_lookup. + (bfd_elf32_bfd_reloc_type_lookup): Update. + * elf64-sparc.c (SPARC64_OLD_RELOCS): Define. + (sparc64_elf_howto_table): Define. + (sparc_reloc_map): Define. + (sparc64_elf_reloc_type_lookup): New function. + (sparc_elf_wdisp16_reloc): New function. + (elf_info_to_howto): Use sparc64_elf_howto_table. + (sparc64_elf_relocate_section): Likewise. + (bfd_elf64_bfd_reloc_type_lookup): Update. + +Sun Feb 18 15:02:25 1996 Ian Lance Taylor <ian@cygnus.com> + + * configure.host: Check for 'do not mix' from native linker before + trying to use -rpath. + +Fri Feb 16 12:46:18 1996 Ian Lance Taylor <ian@cygnus.com> + + * bfd.c (_bfd_get_gp_value): New function. + (_bfd_set_gp_value): New function. + * libbfd-in.h (_bfd_get_gp_value): Declare. + (_bfd_set_gp_value): Declare. + * libbfd.h: Rebuild. + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Use + _bfd_get_gp_value and _bfd_set_gp_value rather than referring + directly to the fields in the tdata information. + (alpha_relocate_section): Likewise. + * coff-mips.c (mips_adjust_reloc_in): Likewise. + (mips_gprel_reloc): Likewise. + (mips_relocate_section): Likewise. + * elf32-mips.c (mips_elf_hi16_reloc): Likewise. + (mips_elf_lo16_reloc): Likewise. + (mips_elf_final_gp): Likewise. + (mips_elf_gprel16_reloc): Likewise. + (mips_elf_gprel32_reloc): Likewise. + (mips_elf_relocate_section): Likewise. + (mips_elf_finish_dynamic_symbol): Likewise. + + * bout.c (b_out_set_arch_mach): Recognize bfd_mach_i960_jx. + +Thu Feb 15 11:29:13 1996 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Call AC_PROG_CC before configure.host. + * configure: Rebuild. + * configure.host: Don't set information which autoconf should + figure out, namely CC, CFLAGS, LDFLAGS, AR, and RANLIB. + + * configure.host: Remove go32 and win32 host information, since it + should no longer be needed. + + * elf.c (map_sections_to_segments): If we have a .dynamic section, + then start a new segment rather than put a writable section in a + readonly segment. + + * configure.host: Set RPATH_ENVVAR. + + * Makefile.in: Rebuild dependencies. + + * elflink.c (_bfd_elf_create_linker_section): Remove unused + zero_section variable. + +Thu Feb 15 10:39:17 1996 H.J. Lu <hjl@zoom.com> + + * Makefile.in ($(srcdir)/bfd-in2.h): Rename target from bfd-in2.h. + ($(srcdir)/libbfd.h): Rename from libbfd.h. + ($(srcdir)/libcoff.h): Rename from libcoff.h. + +Wed Feb 14 16:29:07 1996 Martin Anantharaman <martin@mail.imech.uni-duisburg.de> + + * ieee.c (ieee_write_expression): Only use an R variable for a + local symbol. Don't output a zero offset. Handle a zero address. + (SRC_MASK, PCREL_OFFSET): Define based on KEEPMINUSPCININST. + (rel32_howto, rel16_howto, rel8_howto): Use SRC_MASK and + PCREL_OFFSET. + (parse_expression): Don't try to handle multiple occurrences of a + P variable. Handle I variables differently from X variables. Fix + the order of minus expressions. + (ieee_slurp_external_symbols): Generate an I variable for an NN + record. Fix handling of ATI and ATX records. + (ieee_slurp_sections): Only set minimal section attributes. + Adjust them later, based on the section contents. + (ieee_object_p): Read in the file until just after the ME record. + Call ieee_slurp_section_data to set the section flags. + (do_one): Add iterations parameter. Only repeat the first load + item. Set the section and file reloc flags. + (ieee_slurp_section_data): Set section flags. Pass iterations to + do_one. + (ieee_canonicalize_reloc): Handle I variables. + (do_with_relocs): Only emit relocation size when necessary. + Increase MAXRUN to 127. Change ov to be assigned, and take + src_mask and pcrel_offset into account. + (ieee_write_data_part): Skip sections that are not loaded. + (ieee_write_external_part): Don't output optional last entry of WX + records. + (ieee_write_me_part): Make setting of me_record neater. + (ieee_generic_stat_arch_elt): Get the size of an archive element. + + * syms.c (stt): Add entries for zerovars, vars, and code. + + * elfcode.h (validate_reloc): New static function. + (write_relocs): Call validate_reloc for non ELF relocs. + + * elfxx-target.h (elf_symbol_leading_char): Define if not defined. + (TARGET_BIG_SYM): Use elf_symbol_leading_char. + (TARGET_LITTLE_SYM): Likewise. + + * config.bfd (m68*-*-psos*): New target. + +Tue Feb 13 15:56:22 1996 Bryan Ford <baford@snake.cs.utah.edu> + + * i386msdos.c: Remove some #if 0 code. + (msdos_write_object_contents): Don't include empty sections in the + size computation, regardless of their address. + +Tue Feb 13 15:36:37 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_relocate_section): Don't segfault if dynboj + is NULL, ie, the -r switch is used. + +Tue Feb 13 14:35:15 1996 Ian Lance Taylor <ian@cygnus.com> + + * reloc.c (BFD_RELOC_MIPS_GOT_HI16): Define. + (BFD_RELOC_MIPS_GOT_LO16): Define. + (BFD_RELOC_MIPS_CALL_HI16, BFD_RELOC_MIPS_CALL_LO16): Define. + * bfd-in2.h, libbfd.h: Rebuild. + * elf32-mips.c (mips_reloc_map): Map new relocs. + + * configure.host: Set HDLFLAGS for *-*-hpux with --enable-shared. + + * Makefile.in ($(SHLINK)): Check ts against $(SHLIB), not + $(SHLINK). + + * ieee.c (get_symbol): Set the section to bfd_abs_section. + (do_with_relocs): If EXEC_P is set and there are no relocs, use a + simple number for the section address, rather than an expression. + Limit the number of bytes between relocs to MAXRUN. + (ieee_write_me_part): Set me_record to the file offset after the + start address. + (ieee_write_processor): New static function. + (ieee_write_object_contents): Use ieee_write_processor. + +Fri Feb 9 10:53:00 1996 Ian Lance Taylor <ian@cygnus.com> + + * configure.host: Use ${CC-gcc} when testing for -rpath on SunOS. + + * coff-aux.c: Change include of aux.h to aux-coff.h. + +Thu Feb 8 14:01:03 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * elf32-m68k.c (elf_m68k_relocate_section): For a R_68K_RELATIVE + relocation put the addend both in the reloc entry and the data. + (elf_m68k_finish_dynamic_symbol): Likewise. Mask out marker in + GOT offset value. + + * elf32-m68k.c (elf_m68k_relocate_section): If -Bsymbolic, resolve + a R_68K_PCxx reloc against a defined global symbol directly. + (elf_m68k_check_relocs): Don't count such a reloc. + + * elf32-m68k.c (elf_m68k_check_relocs): Don't record a symbol with + a PLTxx reloc as dynamic. Disallow PLTxxO reloc against a local + symbol for now, otherwise always record the symbol as dynamic. + (elf_m68k_adjust_dynamic_symbol): If a symbol with a PLTxx reloc + is not referenced by a dynamic object, and we are not making a + shared object, then don't make a PLT entry. If we do make a PLT + entry, make sure the symbol has been recorded as dynamic. + +Wed Feb 7 13:56:06 1996 Ian Lance Taylor <ian@cygnus.com> + + * configure.host: When making a shared library, set HLDFLAGS to + pass an appropriate -rpath option. Use the make variable SONAME + as the shared library soname, rather than computing it here. On + SunOS, build stamp-tshlink in place of $(SHLINK). + * Makefile.in (SONAME): New variable. + ($(SHLINK)): Make a link to the transformed name, as well. + (stamp-tshlink): New target. + (install): Skip stamp-tshlink during install. + +Wed Feb 7 13:37:39 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_add_symbol_hook): Do not assume that the + linker sections have been set up yet. + + * elf.c (make_mapping): Add an additional argument to suppress + making the first section include the program headers. + (map_sections_to_segments): If the user used -Ttext such that the + program headers are on a different page, do not set the flags + saying that this section includes the program headers. + +Tue Feb 6 14:04:49 1996 J.T. Conklin <jtc@rtl.cygnus.com> + + * configure.in (*-*-netbsd*): Set COREFILE to netbsd-core.c. + don't define TRAD_HEADER. + * configure: Rebuild. + + * netbsd-core.c: New file, support for NetBSD core files. + * hosts/*nbsd.h: Removed. + +Tue Feb 6 11:47:49 1996 Doug Evans <dje@charmed.cygnus.com> + + * reloc.c (BFD_RELOC_SPARC_[567]): New reloc types. + (BFD_RELOC_SPARC_LO7 reloc type): Deleted. + * libbfd.h, bfd-in2.h: Regenerated. + * elf32-sparc.c (_bfd_sparc_elf_reloc_type_lookup): Renamed from + bfd_elf32_bfd_reloc_type_lookup. + (reloc_type{,_names}): Deleted. + (_bfd_sparc_elf_howto_table): Renamed from elf_sparc_howto_table. + Add sparc64 relocs. + (sparc_reloc_map): Add sparc64 relocs. + (sparc_elf_notsupported_reloc): New static function. + (sparc_elf_wdisp16_reloc): New static function. + (elf32_sparc_check_relocs): Handle R_SPARC_WDISP{16,19}. + (elf32_sparc_relocate_section): Likewise. + (bfd_elf32_bfd_reloc_type_lookup): Define. + * elf64-sparc.c (sparc64_elf_wdisp16_reloc): Deleted. + (reloc_type{,_names}): Deleted. + (elf_sparc_howto_table): Deleted. + (sparc_reloc_map): Deleted. + (_bfd_sparc_elf_howto_table): Renamed from elf_sparc_howto_table. + (bfd_elf64_bfd_reloc_type_lookup): Change from function to #define. + +Tue Feb 6 12:12:22 1996 Ian Lance Taylor <ian@cygnus.com> + + * configure.host: Make SHLIB_CFLAGS include $(PICFLAG) on a + *-*-hpux* host. + + * Makefile.in (program_transform_name): New variable. + (install): Transform library name before installing it. + +Mon Feb 5 10:38:27 1996 Ian Lance Taylor <ian@cygnus.com> + + * archures.c (bfd_mach_i960_hx): Define. + * bfd-in2.h: Rebuild. + * cpu-i960.c (scan_960_mach): Accept machine "hx". + (MATRIX): Expand entries for HX. + (arch_info_struct): Add i960:hx entry. + * bout.c (b_out_set_arch_mach): Handle bfd_mach_i960_hx. + * coffcode.h (coff_set_arch_mach_hook): Handle F_I960HX. + (coff_set_flags): Handle bfd_mach_i960_hx. + + Support for building as a shared library, based on patches from + Alan Modra <alan@spri.levels.unisa.edu.au>: + * configure.in: Add AC_ARG_ENABLE for shared and commonbfdlib. + New substitutions: ALLLIBS, PICFLAG, SHLIB, SHLIB_CC, + SHLIB_CFLAGS, COMMON_SHLIB, PICLIST, SHLINK. + * configure: Rebuild. + * configure.host: If --enable-shared, adjust shared library stuff + based on the host. If the host is SunOS, and the linker supports + -rpath, set HLDFLAGS to use it. + * Makefile.in (ALLLIBS): New variable. + (PICFLAG, SHLIB, SHLIB_CC, SHLIB_CFLAGS): New variables. + (COMMON_SHLIB, SHLINK): New variables. + (.c.o): If PICFLAG is set, compile twice, once PIC, once normal. + (STAGESTUFF): Remove variable. + (all): Depend upon $(ALLLIBS) and @PICLIST@ rather than + $(TARGETLIB). + (stamp-ofiles): New target, like old ofiles target, but build + using a temporary file and move-if-change, and touch stamp-ofiles + when done. + (ofiles): Just depend upon stamp-ofiles. + (stamp-piclist, piclist): New targets. + ($(SHLIB), $(SHLINK)): New targets. + (targets.o, archures.o): Build twice if PICFLAG is set. + (do_mostlyclean): Remove pic/*.o. + (do_clean): Remove stamp-ofiles, $(SHLIB), $(SHLINK), piclist, and + stamp-piclist. + (do_distclean): Remove pic and stamp-picdir. + (install): Install shared libraries. + ($(OFILES)): Depend upon stamp-picdir. + (stamp-picdir): New target. + + * libcoff-in.h: Add comment reminding people that libcoff.h is a + generated file. + * libcoff.h: Rebuild. + + * elflink.h (elf_adjust_dynamic_symbol): Don't try to get the + flavour of a section with no owner. + + * elf32-mips.c (mips_elf_create_dynamic_sections): Clear + ELF_LINK_NON_ELF flag. + (mips_elf_create_got_section): Likewise. + + * elf.c: Revert last change, since it breaks dynamic linking. + * elf-bfd.h (struct elf_backend_data): Remove want_hdr_in_seg + field. + * elf32-mips.c (elf_backend_want_hdr_in_seg): Don't define. + * elfxx-target.h (elf_backend_want_hdr_in_seg): Don't define. + (elfNN_bed): Don't initialize want_hdr_in_seg field. + +Sun Feb 4 20:45:13 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf.c (assign_file_positions_for_segments): If the backend does + not want the elf header or the program headers in the address + space, do not include them in the calculations. + + * elf32-ppc.c (ppc_elf_additional_program_headers): New hook + function to determine if we need additional program headers. + (ppc_elf_modify_segment_map): Define as a NOP function for now. + (ppc_elf_create_linker_section): .sdata2 is a read-only section. + +Sat Feb 3 23:00:03 1996 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h: Move today's libcoff.h change into coffcode.h. + +Sat Feb 3 15:43:44 1996 Fred Fish <fnf@cygnus.com> + + * libcoff.h (bfd_coff_link_add_one_symbol): Combine macro args + back into one line. Some compilers (sunos 4.1.3 for example) + won't accept args split across more than one line. + +Fri Feb 2 11:42:15 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * aclocal.m4 (BFD_BINARY_FOPEN): Understand cygwin32. + * configure: Regenerate. + +Fri Feb 2 12:12:16 1996 Jeffrey A Law (law@cygnus.com) + + * elf32-hppa.c (elf32_hppa_backend_symbol_table_processing): Don't + try to do arithmetic on a void *, cast it to a unsigned char * first. + +Thu Feb 1 16:04:06 1996 Ian Lance Taylor <ian@cygnus.com> + + * elf-bfd.h (ELF_LINK_NON_ELF): Define. + * elf.c (_bfd_elf_link_hash_newfunc): Set elf_link_hash_flags to + ELF_LINK_NON_ELF. + * elflink.h (elf_link_add_object_symbols): Reset ELF_LINK_NON_ELF + flag for a newly defined symbol. + (NAME(bfd_elf,record_link_assignment)): Likewise. + (elf_adjust_dynamic_symbol): If ELF_LINK_NON_ELF is set, try to + set the DEF or REF_REGULAR flags correctly. + + * Makefile.in (bfd-in2.h): Make bfd.h, not protos, in docdir. + (libbfd.h, libcoff.h): Corresponding change. + + * elf32-i386.c (elf_i386_check_relocs): Don't record a symbol with + a PLT32 reloc as dynamic. + (elf_i386_adjust_dynamic_symbol): If a symbol with a PLT32 reloc + is not referenced by a dynamic object, and we are not making a + shared object, then don't make a PLT entry. If we do make a PLT + entry, make sure the symbol has been recorded as dynamic. + +Wed Jan 31 17:23:32 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * coff-i386.c (coff_i386_reloc_type_lookup): Add BFD_RELOC_32_PCREL. + * config.bfd (i[345]86-*-win32): Becomes i[345]86-*-cygwin32. + (powerpcle-*-cygwin32): New. + * peicode.h (add_data_entry): Get address from vma. + +Wed Jan 31 16:23:57 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elflink.c (_bfd_elf_create_linker_section): If the symbol + attached to the section has already been created as an undefined + symbol, treat it as if it hasn't been created yet. + +Wed Jan 31 16:16:53 1996 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_bfd_final_link): Don't output initial dummy + symbol or section symbols if stripping all symbols and this is not + a relocateable link. Don't output the symbol string table if + there are no symbols. + (elf_link_flush_output_syms): Don't do anything if there are no + symbols to flush. + +Wed Jan 31 12:55:49 1996 Richard Henderson <rth@tamu.edu> + + * coff-aux.c: New file. + * hosts/m68kaux.h: New file. + * config.bfd (m68*-apple-aux*): New target. + * configure.in (m68*-apple-aux*): New native host. + (m68kaux_coff_vec): New vector. + * configure: Rebuild. + * targets.c (m68kaux_coff_vec): Declare. + * coffcode.h (bfd_coff_backend_data): Add field + _bfd_coff_link_add_one_symbol. + (bfd_coff_link_add_one_symbol): Define. + (compare_arelent_ptr): New static function if TARG_AUX. + (coff_write_relocs): If TARG_AUX, sort the relocs. + (coff_write_object_contents): Set A/UX aouthdr magic number. + (coff_link_add_one_symbol): Define if not defined. + (bfd_coff_std_swap_table): Initialize new field. + * libcoff.h: Rebuild. + * cofflink.c (coff_link_add_symbols): Call + bfd_coff_link_add_one_symbol rather than + _bfd_generic_link_add_one_symbol. + * coff-m68k.c (COFF_PAGE_SIZE): Don't define if already defined. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add coff-aux.o. + (BFD32_BACKENDS_CFILES): Add coff-aux.c. + +Wed Jan 31 11:37:46 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * elf32-m68k.c (elf_m68k_relocate_section): Fix R_68K_GOT* + relocation; ignore addend with R_68K_{GOT,PLT}*O relocation. + +Tue Jan 30 12:09:04 1996 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.in (do_maintainer_clean): Remove $(srcdir)/bfd-in2.h, + $(srcdir)/libbfd.h and $(srcdir)/libcoff.h. + (maintainer-clean): Warn about deleting special files. + (bfd-in2.h, libbfd.h, libcoff.h): New targets. + + * elf32-hppa.c (elf32_hppa_relocate_section): Handle indirect and + warning symbols correctly. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mips.c (mips_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + + * syms.c (_bfd_stab_section_find_nearest_line): Add casts to avoid + warnings. + +Mon Jan 29 14:27:24 1996 Kim Knuttila <krk@cygnus.com> + + * libcoff-in.h: aligned newly exported names with bfd naming + conventions. Removed an erroneous define of POWERPC_LE_PE. + * libcoff.h: Rebuild. + * cofflink.c, coff-ppc.c: the above function name changes + +Mon Jan 29 13:06:28 1996 Ian Lance Taylor <ian@cygnus.com> + + From Basim Kadhim <kadhim@spock.cs.colorado.edu>: + * ecoff.c (struct extsym_info): Define. + (_bfd_ecoff_bfd_final_link): Pass a pointer to struct extsym_info + to ecoff_link_write_external. + (ecoff_link_write_external): Accept a struct extsym_info pointer. + Strip symbols when appropriate. + + Based on patches from Ronald F. Guilmette <rfg@monkeys.com>: + * syms.c (BSF_OBJECT): Define. + (bfd_print_symbol_vandf): Print 'O' for BSF_OBJECT. + * bfd-in2.h: Rebuild. + * elfcode.h (elf_slurp_symbol_table): Set BSF_OBJECT for an + STT_OBJECT symbol. + * elf.c (swap_out_syms): Only set type to STT_OBJECT if BSF_OBJECT + is set. + + * elf32-i386.c (elf_i386_relocate_section): If -Bsymbolic, when + copying relocs into a shared object, treat a defined global symbol + as a local symbol. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mips.c (mips_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + + * elflink.h (elf_link_add_object_symbols): Only set weakdef to a + real defined symbol, not to a weak defined symbol. + +Mon Jan 29 11:34:36 1996 Kim Knuttila <krk@cygnus.com> + + * cofflink.c: removed the POWERPC_LE_PE hack, promoted some types + and made a few static functions externs. + + * coff-ppc.c (ppc_bfd_coff_final_link): new function, replaces the + POWERPC_LE_PE hack in cofflink. + + * libcoff-in.h: promoted the following from cofflink.c to allow + _bfd_coff_final_link to be overridden - STRING_SIZE_SIZE, + coff_debug_merge_element, struct coff_debug_merge_type, + coff_debug_merge_hash_entry, coff_debug_merge_hash_table, + coff_debug_merge_hash_table_init, coff_debug_merge_hash_table_free, + coff_debug_merge_hash_lookup, coff_link_section_info, + coff_final_link_info, coff_debug_merge_hash_newfunc, + coff_write_global_sym, coff_link_input_bfd, coff_reloc_link_order. + + * libcoff.h: re-gen'd + +Fri Jan 26 18:33:35 1996 Ian Lance Taylor <ian@cygnus.com> + + * syms.c: Include "bfdlink.h". + (struct stab_find_info): Define. + (_bfd_stab_section_find_nearest_line): New function. + * libbfd-in.h (_bfd_stab_section_find_nearest_line): Declare. + * libbfd.h: Rebuild. + * elf-bfd.h (struct elf_obj_tdata): Add line_info field. + * elf.c (_bfd_elf_find_nearest_line): Try calling + _bfd_stab_section_find_nearest_line before searching the ELF + symbol table. Find the closest STT_FUNC symbol, not the last one. + * libcoff-in.h (coff_data_type): Add line_info field. + * libcoff.h: Rebuild. + * coffgen.c (coff_find_nearest_line): Try calling + _bfd_stab_section_find_nearest_line before searching the COFF + symbol table. + * Makefile.in: Rebuild dependencies. + +Fri Jan 26 16:11:19 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (R_PPC_EMB_SDA21 relocations): Make relocation size + 4 bytes, so we get the correct value when updating the register + field in little endian mode. + +Thu Jan 25 12:14:16 1996 Ian Lance Taylor <ian@cygnus.com> + + * libcoff-in.h (struct xcoff_tdata): Remove toc_section and + entry_section fields. Add sntoc and snentry fields. + * libcoff.h: Rebuild. + * coffcode.h (coff_mkobject_hook): Initialize sntoc and snentry, + not toc_section and entry_section (the COFF file does not have any + sections at this point). + (coff_write_object_contents): Set o_snentry and o_sntoc from + snentry and sntoc rather than entry_section and toc_section. + * coff-rs6000.c (xcoff_copy_private_bfd_data): Copy sntoc and + snentry, not toc_section and entry_section. + * xcofflink.c (bfd_xcoff_size_dynamic_sections): Don't set + entry_section from hentry. + (xcoff_link_input_bfd): If a defined symbol has XCOFF_ENTRY set, + set snenty. + (xcoff_link_input_bfd): Set sntoc, not toc_section. + (xcoff_write_global_symbol): Get toc_section from sntoc, rather + than using toc_section directly. + + * archures.c: Add missing `.' in enum bfd_architecture. + * bfd-in2.h: Rebuild. + + * config.bfd (i[345]86-*-sco*elf*): Use bfd_elf32_i386_vec. From + Robert Lipe <robertl@arnet.com>. + +Thu Jan 25 12:08:51 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Add .rela.sdata{,2} + to sections we allocate. Use bfd_zalloc to allocate initialial + sections, not bfd_alloc. + (ppc_elf_check_relocs): Remove BFD_ASSERTs for !shared from + SDA{,2}I16 relocations. + (ppc_elf_add_symbol_hook): Use the value of -G nn to determine + whether to put something in .sbss or not. + (ppc_elf_relocate_section): Add support for more relocations. Add + in sec->output_offset where appropriate. Make error messages + include the symbol name. + + * elflink.c (_bfd_elf_create_linker_section): Lookup symbol before + trying to add it to the symbol table, so _GLOBAL_OFFSET_TABLE_ + doesn't get redefined messages if -shared. + + * elflink.h (elf_create_pointer_linker_section) Only bump RELA + section if the rel_section field has been set up. + +Wed Jan 24 20:40:26 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_relocate_section): Fix typo in eabi + relocations. + +Wed Jan 24 10:38:34 1996 Doug Evans <dje@charmed.cygnus.com> + + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Delete checking + of flags, only flags used are controlled by mach number. Bump up + output file mach number to highest of input file mach numbers. + (elf32_sparc_object_p): Watch for EF_SPARC_SUN_US1. + (elf32_sparc_final_write_processing): Set EF_SPARC_SUN_US1 if v8plusa. + + * config.bfd (sparc64-*-{sysv4*,solaris2*}): Comment out + bfd_elf64_sparc_vec support. + +Tue Jan 23 14:33:05 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_copy_private_bfd_data): Don't complain if + the embedded bit is set on some objects and not on others. Just + or it together. + (ppc_elf_relocate_section): Implement R_PPC_EMB_{SDA21,RELSDA} + relocations. + +Tue Jan 23 14:22:45 1996 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (coff_new_section_hook): Don't try to align the + .stabstr section. + + * coffcode.h (coff_set_section_contents): Fix the handling of the + .lib section to work even if the entire section contents are + written at once. From Gvran Uddeborg <gvran@uddeborg.pp.se> and + Robert Lipe <robertl@arnet.com>. + +Mon Jan 22 18:45:51 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elflink.h (elf_finish_pointer_linker_section): Don't allocate + memory here for contents. + + * elf32-ppc.c (ppc_elf_relocate_section): Bump up _SDA_BASE_ and + _SDA2_BASE_ by 32768. + (ppc_elf_size_dynamic_sections): #if out PLT code which we haven't + started using. Allocate contents for .sdata and .sdata2 sections + also. + (ppc_elf_check_relocs): Use bfd_get_section_name in debug message, + rather than _name. + (ppc_elf_finish_dynamic_symbol): Remove code that attempted to + size _SDA{,2}_BASE_. + (ppc_elf_relocate_section): Change how sdata{,2} relocations are + done. + +Mon Jan 22 08:52:04 1996 Doug Evans <dje@charmed.cygnus.com> + + * elflink.h (elf_finish_pointer_linker_section): Fix typo. + + * archures.c (bfd_mach_sparc_v9): Renamed from bfd_mach_sparc64. + (bfd_mach_sparc_{v8plus,v8plusa}): Define. + (bfd_mach_sparc_v9a): Define. + (bfd_mach_sparc_v9_p): Define. + * bfd-in2.h: Regenerated. + * aoutx.h (aout,machine_type): bfd_mach_sparc64 renamed to + bfd_mach_sparc_v9. + * elf64-sparc.c (sparc64_elf_object_p): Likewise. + * config.bfd (sparc64-*-sysv4*,sparc64-*-solaris2*): Set targ_defvec + to bfd_elf32_sparc_vec. + * cpu-sparc.c (arch_info_struct): Renamed from sparc_arch_info. + Add v8plus{,a} support. + Add v9a support. + (sparc_compatible): New function. + * elf32-sparc.h: #include "elf/sparc.h". + (elf32_sparc_merge_private_bfd_data, elf32_sparc_object_p, + elf32_sparc_final_write_processing): New functions. + (bfd_elf32_bfd_merge_private_bfd_data, elf_backend_object_p, + elf_backend_final_write_processing): Define. + +Mon Jan 22 11:21:51 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf-bfd.h (struct elf_link_hash_entry): Add + linker_section_pointer field. + (enum elf_linker_section_enum): Enumeration for new way of + creating linker dynamic sections and symbols. + (elf_linker_section{,_pointers}): New structures for creating + dynamic sections and symbols. + (elf_obj_tdata): Add linker_section_pointers and linker_section + fields. + (elf_local_ptr_offsets,elf_linker_section): New accessor macros. + (_bfd_elf_create_linker_section): New declarations. + (_bfd_elf_find_pointer_linker_section): Ditto. + (bfd_elf{32,64}_{create,finish}_pointer_linker_section): Ditto. + (_bfd_elf_make_linker_section_rela): Ditto. + + * elf.c (_bfd_elf_link_hash_newfunc): Initialize new fields. + + * elf32-ppc.c (ppc_elf_create_dynamic_sections): Delete. + (ppc_elf_create_linker_section): New function to create the + sections .got, .sdata, and .sdata2. + (ppc_elf_size_dynamic_sections): Zap .rela.{sdata,sdata2} if + needed. + (ppc_elf_check_relocs): Support more of the eabi relocations. + (ppc_elf_relocate_section): Ditto. + (ppc_elf_finish_dynamic_symbols): Adjust _SDA{,2}_BASE_ by 32768 + if the .sdata{,2} + .sbss{,2} section size is > 32k. + + * elflink.h (elf_create_pointer_linker_section): New function to + create initialized pointers in dynamic linker sections. + (elf_finish_pointer_linker_section): Actually intialize the + pointers created above. + + * elfcode.h (bfd_elf{32,64}_create_pointer_linker_section): New + macros to provide both 32 and 64 bit versions of + elf_create_pointer_linker_section. + (bfd_elf{32,64}_finish_pointer_linker_section): New macros to + provide both 32 and 64 bit versions of + elf_finish_pointer_linker_section. + + * elflink.c (_bfd_elf_create_linker_section): New function to + create a linker section. + (_bfd_elf_find_pointer_linker_section): Find a unique pointer to a + given address in the linker pointer offsets created for a given + symbol. + (_bfd_elf_make_linker_section_rela): Make a RELA section + corresponding to the generated linker section. + +Sat Jan 20 08:36:10 1996 Doug Evans <dje@canuck.cygnus.com> + + * elf32-sparc.c (ELF_MACHINE_ALT1): Define. + +Thu Jan 18 18:25:34 1996 Kim Knuttila <krk@cygnus.com> + + * coff-ppc.c (coff_ppc_relocate_section): changed TOCDEFN relocs. + (coff_ppc_relocate_section): Handle special values for gcc built dlls. + (dump_toc): fix diagnosing code to identify out-of-toc-bounds entries. + Also begin the toc at 4 as an eye catcher ('31313131' marks the first + toc entry in an objdump) for now. + (ppc_do_last, ppc_get_last): New function - needed to save processing + the toc owner to the end. + (ppc_coff_swap_sym_in_hook): Removed an incorrect hack for doing the + toc owner last. + + * cofflink.c (_bfd_coff_final_link): Added a new hack to keep the + toc owner from being done till last. Must define POWERPC_LE_PC + to enable it. + + * coffcode.h (coff_set_alignment_hook): alignment setting for .stab + + * peicode.h (coff_swap_scnhdr_out): set section flags for stab/str + to INFO. + (coff_swap_aouthdr_out): Removed a non-working hack for computing the + SizeOfImage for PowerPC. Ignore the size of the .junk section. + +Thu Jan 18 17:42:12 1996 Ian Lance Taylor <ian@cygnus.com> + + * elfcore.h: Include <signal.h> before <sys/procfs.h>. + +Wed Jan 17 12:40:14 1996 Ian Lance Taylor <ian@cygnus.com> + + * cpu-powerpc.c (arch_info_struct): Change last entry to not point + back to first. + (bfd_powerpc_arch): Point at first entry in arch_info_struct. + +Tue Jan 16 15:10:49 1996 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (assign_file_positions_for_segments): Don't increment file + offset for a segment which contains no loadable sections. + +Mon Jan 15 17:46:27 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * reloc.c: Add new PowerPC relocations. + * {bfd-in2,libbfd}.h: Regenerate. + + * elf32-ppc.c (ppc_elf_howto_raw): Add more PPC relocations. + (ppc_elf_reloc_type_lookup): Lookup new relocations. + +Mon Jan 15 14:29:44 1996 Ian Lance Taylor <ian@cygnus.com> + + * aoutx.h (howto_table_ext): Fix RELOC_BASE10 and RELOC_BASE22 + entries. + + * sunos.c (sunos_scan_ext_relocs): Don't fail assert if + info->shared. + + * coffgen.c (coff_find_nearest_line): Don't try to cache + information in sections that are not owned by a BFD. From Richard + Henderson <richard@atheist.tamu.edu>. + + * elf32-mips.c: Numerous changes to dynamic linking code, mostly + from Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>. + * elflink.h (elf_link_output_extsym): Remove special check for + _rld_new_interface. + + * ecoffswap.h: Add prototypes for static functions. + +Sun Jan 14 21:36:08 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_{unsupported,std}_reloc): Remove functions. + (ppc_elf_howto_raw): Remove ppc_elf_{unsupported,std}_reloc + references. + (ppc_elf_relocate_section): No longer allow .sdata/.sbss sections + to satisfy a TOC16 relocation. Rewrite unsupported relocation + support. Begin support for R_PPC_SDA{2,}REL. + +Sat Jan 13 09:36:52 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_create_dynamic_sections): New function to + create the .got and .got.neg sections. + (ppc_elf_size_dynamic_sections): Call it. + (ppc_elf_check_relocs): Call it. + (ppc_elf_size_dynamic_sections): Support .got.neg, just like .got. + (ppc_elf_check_relocs): Add error messages for relocations we + don't yet support. Do not include R_PPC_SDAREL16 like a GOT + relocation. + +Fri Jan 12 15:27:59 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_fake_sections): Define, and handle the new + section flags for V.4 and eabi. + +Fri Jan 12 13:59:16 1996 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (assign_file_positions_for_segments): If a segment + contains no sections, don't mark it as readable. + + * elf-bfd.h (_bfd_elf_section_from_bfd_section): Declare. + * elfcode.h (_bfd_elf_section_from_bfd_section): Don't declare. + + * elf.c (_bfd_elf_print_private_bfd_data): Dump contents of + dynamic section, if there is one. + * elf-bfd.h (struct elf_size_info): Add swap_dyn_in field. + (bfd_elf32_swap_dyn_in): Change type of second parameter to PTR. + (bfd_elf64_swap_dyn_in): Likewise. + * elfcode.h (elf_swap_dyn_in): Change type of second parameter to + PTR. + (NAME(_bfd_elf,size_info)): Initialize swap_dyn_in field. + + * elf32-i386.c (elf_i386_size_dynamic_sections): Don't create a + DT_TEXTREL entry because of .rel.plt. From Martin Pirker + <pirker@eiunix.tuwien.ac.at>. + +Thu Jan 11 17:06:14 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * section.c (SEC_{EXCLUDE,SORT_ENTRIES}): New section flags for + PowerPC V.4 and eabi. + * bfd-in2.h: Regenerate. + * libfd.h: Regenerate. + + * elfxx-target.h (TARGET_{BIG,LITTLE}_SYM): Add new flags. + + * elf32-ppc.c (ppc_elf_section_from_shdr): Support SHT_ORDERED + section type and SHF_EXCLUDE section flag, turning them into the + appropriate bfd section flag. + +Thu Jan 11 11:23:30 1996 Ian Lance Taylor <ian@cygnus.com> + + * xcofflink.c (xcoff_link_add_symbols): Create the special + sections if we see a DYNAMIC object, in case that is the only + XCOFF input object we see. + + * elf32-mips.c: Extensive changes for a start at dynamic linking + support, from Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>. + + * elf-bfd.h (struct elf_backend_data): Add type_change_ok field. + (struct elf_backend_data): Remove + elf_backend_create_program_headers field. Add + elf_backend_additional_program_headers and + elf_backend_modify_segment_map fields. + * elfxx-target.h (elf_backend_type_change_ok): Define if not + defined. + (elf_backend_additional_program_headers): Likewise. + (elf_backend_modify_segment_map): Likewise. + (elf_backend_create_program_headers): Don't define. + (elfNN_bed): Change to account for field changes. + * elf.c (assign_file_positions_for_segments): Call new + modify_segment_map backend function. Don't call old + create_program_headers backend function. + (get_program_header_size): Call additional_program_headers rather + than create_program_headers. + * elflink.h (elf_link_add_object_symbols): Initialize + type_change_ok from new backend field. + (elf_link_output_extsym): Don't warn if _rld_new_interface is + defined. + (elf_reloc_link_order): Treat a reloc against a defined symbol as + a reloc against the appropriate section. + + * elf-bfd.h (struct bfd_elf_section_data): Add tdata field. + (struct elf_obj_tdata): Rename ppc_flags_init field to flags_init. + (elf_flags_init): Rename from elf_ppc_flags_init. + * elf32-ppc.c (ppc_elf_set_private_flags): Use elf_flags_init, not + elf_ppc_flags_init. + (ppc_elf_copy_private_bfd_data): Likewise. + (ppc_elf_merge_private_bfd_data): Likewise. + + * elf32-m68k.c (howto_table): Change src_mask to 0 for all + relocation entries. + +Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com> + + * coff-alpha.c (alpha_relocate_section): During final link, allow + output .lita section to be bigger than 64k by adjusting gp value + on a per-input section basis. + * libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning + field. + (struct ecoff_section_tdata): Add gp field. + +Tue Jan 9 12:00:36 1996 Ian Lance Taylor <ian@cygnus.com> + + Handle Alpha ECOFF changes in OSF/1 3.2. + * libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos + field. + * coff-alpha.c: Include "aout/ar.h". + (alpha_ecoff_get_relocated_section_contents): Don't require an + ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1 + 3.2 doesn't generate one. + (alpha_relocate_section): Likewise. + (alpha_ecoff_slurp_armap): Define. + (alpha_ecoff_slurp_extended_name_table): Define. + (alpha_ecoff_construct_extended_name_table): Define. + (alpha_ecoff_truncate_arname): Define. + (alpha_ecoff_write_armap): Define. + (alpha_ecoff_generic_stat_arch_elt): Define. + (alpha_ecoff_update_armap_timestamp): Define. + (ARFZMAG): Define. + (alpha_ecoff_read_ar_hdr): New static function. + (alpha_ecoff_get_elt_at_filepos): New static function. + (alpha_ecoff_openr_next_archived_file): New static function. + (alpha_ecoff_get_elt_at_index): New static function. + (alpha_ecoff_backend_data): Initialize get_elt_at_filepos field. + (ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from + _bfd_ecoff to alpha_ecoff. + * ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos + field from backend structure, rather than always calling + _bfd_get_elt_at_filepos. + * coff-mips.c (mips_ecoff_backend_data): Initialize + get_elt_at_filepos field. + * archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied + from _bfd_generic_read_ar_hdr with minor changes. + (_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag. + * libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare. + * libbfd.h: Rebuild. + + * bfd-in.h (BFD_IN_MEMORY): Define. + * libbfd-in.h (struct bfd_in_memory): Define. + * libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag. + (bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file. + (bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set. + (bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag. + * bfd.c (struct _bfd): Change iostream field from char * to PTR. + (bfd_get_size): Handle BFD_IN_MEMORY flag. + * cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files. + (bfd_open_file): Cast to PTR, not char *, when setting iostream. + (bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set. + * opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting + iostream. + (bfd_openstreamr): Likewise. + * aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if + BFD_IN_MEMORY is not set. + * riscix.c (riscix_some_aout_object_p): Likewise. + * bfd-in2.h, libbfd.h: Rebuild. + + * targets.c (bfd_target): Add _bfd_get_elt_at_index field. + (BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index. + (bfd_get_elt_at_index): Define. + * archive.c (_bfd_generic_get_elt_at_index): Rename from + bfd_get_elt_at_index. Change index parameter from int to + symindex. + * libbfd-in.h (_bfd_generic_get_elt_at_index): Declare. + (_bfd_noarchive_get_elt_at_index): Define. + (_bfd_archive_bsd_get_elt_at_index): Define. + (_bfd_archive_coff_get_elt_at_index): Define. + * bfd-in2.h, libbfd.h: Rebuild. + * aout-target.h (MY_get_elt_at_index): Define if not defined. + * coff-rs6000.c (xcoff_get_elt_at_index): Define. + * ieee.c (ieee_get_elt_at_index): Define. + * libecoff.h (_bfd_ecoff_get_elt_at_index): Define. + * oasys.c (oasys_get_elt_at_index): Define. + * som.c (som_get_elt_at_index): Define. + + * ecoff.c (_bfd_ecoff_find_nearest_line): Don't restrict line + numbers to the .text section. + +Mon Jan 8 17:00:57 1996 Ian Lance Taylor <ian@cygnus.com> + + * ieee.c (ieee_write_debug_part): Change return type to boolean. + If there is a SEC_DEBUGGING section, get the contents of the debug + information part from it. + (ieee_set_section_contents): Store the contents of a SEC_DEBUGGING + section in memory. + (ieee_write_object_contents): Check ieee_write_debug_part return. + +Thu Jan 4 17:12:37 1996 Fred Fish <fnf@cygnus.com> + + * config.bfd (i[345]86-*-freebsd*): Add target. + * configure.in (i386freebsd_vec): Add vec. + * configure: Regenerate. + * Makefile.in (BFD32_BACKENDS): Add i386freebsd.o. + (BFD32_BACKENDS_CFILES): Add i386freebsd.c. + Rebuild dependencies.. + * freebsd.h: New file. + * i386freebsd.c: New file. + * targets.c (i386freebsd_vec): Declare. + (bfd_target_vector): Add i386freebsd_vec. + * i386linux.c (SEGMENT_SIZE): Define as TARGET_PAGE_SIZE + * i386netbsd.c (SEGMENT_SIZE): Define as TARGET_PAGE_SIZE + +Thu Jan 4 16:27:46 1996 Ian Lance Taylor <ian@cygnus.com> + + * ieee.c (ieee_slurp_debug): New static function. + (ieee_object_p): Call it. + (ieee_slurp_section_data): Skip debugging sections. + (ieee_get_reloc_upper_bound): Likewise. + (ieee_get_section_contents): Likewise. + (ieee_canonicalize_reloc): Likewise. + (ieee_write_section_part): Likewise. + (ieee_write_debug_part): Likewise. + (ieee_write_data_part): Likewise. + (init_for_output): Likewise. + +Wed Jan 3 19:42:47 1996 Michael Meissner <meissner@wogglebug.tiac.net> + + * elf32-ppc.c (ppc_elf_relocate_section): Make @GOT relocations + work. + (ppc_elf_howto_raw): Just use bfd_elf_generic_reloc for all howto + relocs, since ppc_elf_relocate_section handles the linker case. + (ppc_elf_{addr16_ha,got16,toc16,brtaken}_reloc): Delete, no longer + used. + (ppc_elf_{addr16_ha,got16,toc16,brtaken}_inner): Merge these into + ppc_elf_relocate_section since that is now the only caller. + (ppc_elf_relocate_section): Ditto. + +Wed Jan 3 15:11:30 1996 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (coff_write_object_contents): If we don't know the + section of the entry point for an XCOFF executable, always set the + entry address to -1. + +Tue Jan 2 14:17:15 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf.c (bfd_section_from_shdr): Add support for note sections. + +Tue Jan 2 13:10:25 1996 Ian Lance Taylor <ian@cygnus.com> + + * bfd-in.h (struct _symbol_info): Add stab_type field. + * bfd-in2.h: Rebuild. + * aoutx.h (NAME(aout,get_symbol_info)): Set stab_type. + + * elf32-ppc.c: Remove trailing newline from calls to + _bfd_error_handler. + (ppc_elf_merge_private_bfd_data): Only warn about endianness + difference if target endianness is known. + +Thu Dec 21 12:43:49 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_howto_raw): Add a phony reloc to handle the + old style TOC16 references without using R_PPC_GOT. + (ppc_reloc_type): Ditto. + (ppc_elf_reloc_type_lookup): Add support for TOC16. + (ppc_elf_toc16_inner): Renamed from ppc_elf_got16_inner. + (ppc_elf_toc16_reloc): Renamed from ppc_elf_toc16_reloc. + (ppc_elf_got16_{inner,reloc}): Stubs for real GOT support. + (ppc_elf_check_relocs): New function for GOT/PLT support that is + work in progress. + (ppc_elf_adjust_dynamic_symbol): Ditto. + (ppc_elf_adjust_dynindx): Ditto. + (ppc_elf_size_dynamic_sections): Ditto. + (ppc_elf_finish_dynamic_symbol): Ditto. + (ppc_elf_finish_dynamic_sections): Ditto. + (ELF_DYNAMIC_INTERPRETER): Define. + +Wed Dec 20 19:14:18 1995 Ken Raeburn <raeburn@cygnus.com> + + * elf.c (copy_private_bfd_data): When attaching sections to + segments ignore sections that won't be allocated. Patch from + Andreas Schwab. + +Tue Dec 19 20:01:43 1995 Ken Raeburn <raeburn@cygnus.com> + + * config.bfd: Match on m68k-cbm-* only if OS doesn't match + anything else. + +Tue Dec 19 16:38:59 1995 Ian Lance Taylor <ian@cygnus.com> + + * coff-i960.c (CALC_ADDEND): Define. + (coff_i960_relocate_section): Add the input section VMA to the + addend for PC relative relocs. + +Sun Dec 17 20:11:55 1995 Kim Knuttila <krk@cygnus.com> + + * peicode.h (pe_print_pdata): Must test the entire entry for zero + to correctly terminate. + +Fri Dec 15 12:05:57 1995 Ian Lance Taylor <ian@cygnus.com> + + * targets.c (enum bfd_endian): Define. + (bfd_target): Rename byteorder_big_p to byteorder, and change it + from boolean to enum bfd_endian. Change header_byteorder_big_p + correspondingly. + * bfd-in.h (bfd_big_endian, bfd_little_endian): New macros. + (bfd_header_big_endian, bfd_header_little_endian): New macros. + * bfd-in2.h: Rebuild. + * All targets: Change initialization of byteorder and + header_byteorder to use enum bfd_endian values rather than + booleans. + * All files: Change all references to byteorder_big_p and + header_byteorder_big_p to use new bfd_*_endian macros. + + * coffgen.c (make_a_section_from_file): Set lma to s_paddr, not + s_vaddr. + * coffcode.h (coff_write_object_contents): Set s_paddr to lma, not + vma. + * ecoff.c (_bfd_ecoff_write_object_contents): Likewise. + +Fri Dec 15 07:32:09 1995 steve chamberlain <sac@slash.cygnus.com> + + * pe[i]-i386.c (TARGET_UNDERSCORE): Define to '_'. + +Thu Dec 14 13:45:37 1995 Ian Lance Taylor <ian@cygnus.com> + + * ieee.c: Lots of minor cleanups. Make many functions return + errors rather than calling abort. Also: + (ieee_write_twobyte): Remove; change callers to call existing + ieee_write_2bytes function. + (ieee_write_expression): Don't output the section twice when + outputting a local symbol. Don't emit an extraneous zero if there + is only one term. + (ieee_slurp_sections): Set the lma as well as the vma. + (ieee_archive_p): Use bfd_alloc_grow rather than an obstack. + + * ihex.c (ihex_set_arch_mach): Don't accept any architecture, just + a recognized one or bfd_arch_unknown. + (ihex_get_symtab_upper_bound): Define as bfd_0l, to permit objcopy + to succeed. + (ihex_get_symtab): Likewise. + +Wed Dec 13 15:44:06 1995 Ian Lance Taylor <ian@cygnus.com> + + * aoutx.h: Include <ctype.h>. + (struct aout_link_includes_table): Define. + (struct aout_link_includes_totals): Define. + (struct aout_link_includes_entry): Define. + (aout_link_includes_lookup): Define macro. + (struct aout_final_link_info): Add includes field. + (aout_link_includes_newfunc): New static function. + (NAME(aout,final_link)): Initialize includes hash table. + (aout_link_write_symbols): Eliminate duplicate N_BINCL entries. + +Wed Dec 13 10:52:14 1995 Stan Shebs <shebs@andros.cygnus.com> + + * mpw-config.in: Match on mips-*-* instead of mips-idt-ecoff. + +Wed Dec 13 11:07:45 1995 Kim Knuttila <krk@cygnus.com> + + * coff-ppc.c (coff_ppc_relocate_section): removed debugging code. + +Tue Dec 12 17:42:06 1995 Kim Knuttila <krk@cygnus.com> + + * peicode.h (pe_print_reloc): New function to dump the .reloc section. + (pe_print_private_bfd_data): call pe_print_reloc. + * coffcode.h (coff_set_alignment_hook): .reloc section alignment. + * coff-ppc.c (in_reloc_p): Added missing non-eligible relocs. Spiffed + up some debugging as well. + +Tue Dec 12 11:34:23 1995 Ian Lance Taylor <ian@cygnus.com> + + * config.bfd: Handle sparc-*-elf*. From Ronald F. Guilmette + <rfg@monkeys.com>. + +Fri Dec 8 17:47:07 1995 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_link_add_object_symbols): Set section_count to 0 + when setting sections to NULL. + +Wed Dec 6 17:05:37 1995 Ian Lance Taylor <ian@cygnus.com> + + * xcofflink.c (struct xcoff_loader_info): Add export_defineds + field. + (bfd_xcoff_size_dynamic_sections): Add export_defineds parameter. + (xcoff_build_ldsyms): If export_defineds is set, set XCOFF_EXPORT + for all symbols. + * bfd-in.h (bfd_xcoff_size_dynamic_sections): Update declaration. + * bfd-in2.h: Rebuild. + +Mon Dec 4 16:40:47 1995 Kim Knuttila <krk@cygnus.com> + + * coffcode.h (coff_set_alignment_hook): Removed some debugging printf's + +Mon Dec 4 11:25:39 1995 Ian Lance Taylor <ian@cygnus.com> + + * ihex.c (ihex_scan): Handle record types 4 and 5. + (ihex_object_p): Permit types 4 and 5. + (ihex_set_section_contents): Remove check for out of range + addresses. + (ihex_write_object_contents): Generate types 4 and 5. + + * elflink.h (elf_link_output_extsym): Just ignore warning and + indirect references to symbols which don't really exist. + +Sun Dec 3 19:00:27 1995 Kim Knuttila <krk@cygnus.com> + + * peicode.h (pe_print_idata): Minor format fixes + (pe_print_edata): New function. Under private printing, this formats + the edata section of a PE file. + (pe_print_private_bfd_data): Added call to pe_print_edata. + +Sun Dec 3 16:46:54 1995 Richard Earnshaw (rearnsha@armltd.co.uk) + + * aout-arm.c (MY_swap_std_reloc_out): Use KEEPIT to get the symbol + index, don't call stoi. + +Fri Dec 1 14:46:51 1995 Ian Lance Taylor <ian@cygnus.com> + + * srec.c (srec_scan): Set lma as well as vma. + + * ihex.c: New file; support for Intel Hex format. + * targets.c (enum bfd_flavour): Add bfd_target_ihex_flavour. + (ihex_vec): Declare. + (bfd_target_vector): Always include ihex_vec. + * bfd.c (struct _bfd): Add ihex_data field to tdata union. + * Makefile.in: Rebuild dependencies. + (BFD_LIBS): Add ihex.o + (BFD_LIBS_CFILES): Add ihex.c. + * bfd-in2.h: Rebuild. + + * elf.c (assign_file_positions_for_segments): Sort the sections in + each segment. + (get_program_header_size): Return the right size if segment_map is + not NULL. + (copy_private_bfd_data): Don't bother to sort the sections. + + * bfd.c (bfd_record_phdr): New function. + * bfd-in.h (bfd_record_phdr): Declare. + * bfd_in2.h: Rebuild. + + * elf32-sparc.c (elf32_sparc_relocate_section): Remove bogus + BFD_ASSERT. + + * libbfd.c (bfd_malloc, bfd_realloc): New functions. + (bfd_zmalloc): Return PTR, not char *. Take size_t, not + bfd_size_type. + * libbfd-in.h (bfd_malloc, bfd_realloc): Declare. + (bfd_zmalloc): Change declaration. + * libbfd.h: Rebuild. + * Many files: Use bfd_malloc and bfd_realloc rather than malloc + and realloc. Don't set bfd_error_no_memory if they fail. + +Thu Nov 30 19:32:26 1995 Kim Knuttila <krk@cygnus.com> + + * coff-ppc.c: Added macros to tidy up toc cell treatment. Numerous + uses as well. Added a new howto to deal with TOCREL16 relocs that + are TOCDEFN as well. + (coff_ppc_relocate_section): Expanded treatment of ADDR32NB relocs + to handle RVA relocs from dlltool. + (ppc_coff_rtype2howto): TOCDEFN reloc addition. + (coff_ppc_rtype_to_howto): TOCDEFN reloc addition. + (ppc_coff_reloc_type_lookup): TOCDEFN reloc addition. + + * coffcode.h (coff_set_alignment_hook): check idata$X sections + to get the right section alignment. + +Thu Nov 30 16:48:18 1995 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on + p_paddr if p_paddr is zero. + (make_mapping): Set includes_filehdr and includes_phdrs for first + PT_LOAD segment. + (map_sections_to_segments): Set includes_phdrs for PT_PHDR + segment. + (assign_file_positions_for_segments): Handle includes_filehdr and + includes_phdrs. Remove special handling of PT_PHDR and first + PT_LOAD segments. + (copy_private_bfd_data): Set includes_filehdr and includes_phdr + when appropriate. Remove special handling of PT_PHDR segment. + Use a more complex condition for when a section is included in a + segment to handle Solaris linker oddities. + +Thu Nov 30 11:17:33 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de> + + * coff-m88k.c (howto_table): Reformatted for easier reading; + special_function now points to new function m88k_special_reloc. + (howto_hvrt16): Function previously used for handling HVRT16 relocs + removed. + (rtype2howto): Do not add reloc's r_offset to the addend, this will + be done correctly by m88k_special_reloc. + (reloc_processing): New function to be used by RELOC_PROCESSING. + (RELOC_PROCESSING): Define to call reloc_processing. + +Wed Nov 29 12:42:36 1995 Ian Lance Taylor <ian@cygnus.com> + + * peicode.h (pe_print_idata): Call malloc rather than xmalloc. + (pe_print_pdata): Likewise. + + * opncls.c (bfd_alloc_by_size_t): Set bfd_error_no_memory if + obstack_alloc fails. + (bfd_alloc_finish): Set bfd_error_no_memory if obstack_finish + fails. + * libbfd.c (bfd_zmalloc): Set bfd_error_no_memory if malloc fails. + * Many files: don't set bfd_error_no_memory if one of the above + routines fails. + + * elf.c (assign_file_positions_for_segments): Don't adjust p_paddr + if p_paddr_valid is set. + (copy_private_bfd_data): New static function. + (_bfd_elf_copy_private_section_data): Call copy_private_bfd_data. + + * elf.c (assign_file_positions_for_segments): Fix case where extra + program headers were allocated. + + * elf.c (_bfd_elf_print_private_bfd_data): New function. + * elf-bfd.h (_bfd_elf_print_private_bfd_data): Declare. + * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define to + _bfd_elf_print_private_bfd_data. + + * coff-alpha.c (alpha_ecoff_swap_reloc_in): Don't abort if + r_symndx is RELOC_SECTION_NONE for an ALPHA_R_IGNORE reloc. + Change a RELOC_SECTION_LITA symndx to RELOC_SECTION_ABS. + (alpha_ecoff_swap_reloc_out): Change RELOC_SECTION_ABS to + RELOC_SECTION_LITA for ALPHA_R_IGNORE. + (alpha_adjust_reloc_out): For ALPHA_R_IGNORE, don't change + RELOC_SECTION_ABS to RELOC_SECTION_NONE. + +Tue Nov 28 16:59:50 1995 Ian Lance Taylor <ian@cygnus.com> + + * elf-bfd.h (struct elf_obj_tdata): Add segment_map field. + * elf.c (make_mapping): New static function. + (map_sections_to_segments): New static function. + (elf_sort_sections): New static function. + (assign_file_positions_for_segments): New static function. + (map_program_segments): Remove. + (get_program_header_size): Remove sorted_hdrs, count, and + maxpagesize parameters. Simplify. + (assign_file_positions_except_relocs): When generating an + executable, use assign_file_positions_for_segments. + (elf_sort_hdrs): Remove. + (_bfd_elf_sizeof_headers): Remove eliminated parameters from call + to get_program_header_size. + +Mon Nov 27 12:27:46 1995 Ian Lance Taylor <ian@cygnus.com> + + * hp300hpux.c (MY(callback)): Set lma as well as vma. + + * configure, config.in: Regenerate with autoconf 2.7. + + * elf32-i386.c (elf_backend_plt_readonly): Set correctly, to 1. + * elf32-sparc.c (elf_backend_plt_readonly): Set correctly, to 0. + +Wed Nov 22 12:02:09 1995 Ian Lance Taylor <ian@cygnus.com> + + * ecoff.c (_bfd_ecoff_new_section_hook): Handle .rconst section. + (ecoff_sec_to_styp_flags): Likewise. + (_bfd_ecoff_styp_to_sec_flags): Handle STYP_RCONST. + (ecoff_set_symbol_info): Handle scRConst. + (ecoff_slurp_reloc_table): Handle RELOC_SECTION_RCONST. + (ecoff_compute_section_file_positions): Handle .rconst section. + (_bfd_ecoff_write_object_contents): Likewise. + (ecoff_link_check_archive_element): Handle scRConst. + (ecoff_link_add_externals): Likewise. + (ecoff_link_write_external): Handle .rconst section. + (ecoff_reloc_link_order): Likewise. + * ecofflink.c (bfd_ecoff_debug_accumulate): Handle scRConst. + * coff-alpha.c (alpha_convert_external_reloc): Handle .rconst + section. + (alpha_relocate_section): Handle RELOC_SECTION_RCONST. + + * sunos.c (sunos_scan_dynamic_symbol): Only set written if the + DEF_DYNAMIC flag is set. + +Tue Nov 21 13:25:29 1995 Ken Raeburn <raeburn@cygnus.com> + + * host-aout.c: If TRAD_HEADER is defined, include it. + +Tue Nov 21 13:03:57 1995 Ian Lance Taylor <ian@cygnus.com> + + * aclocal.m4 (AC_PROG_CC): Remove local definition. + (BFD_BINARY_FOPEN): Require AC_CANONICAL_SYSTEM. + (BFD_NEED_DECLARATION): New function. + * configure.in: Use BFD_NEED_DECLARATION. + * acconfig.h: Put NEED_DECLARATION_* in @TOP@ section. + * configure, config.in: Rebuild with autoconf 2.6. + + * xcofflink.c (bfd_xcoff_size_dynamic_sections): Clear + special_sections before returning when called with a non XCOFF + BFD. + + * coffgen.c (coff_renumber_symbols): Sort common symbols with + global symbols. + + * coffcode.h (coff_compute_section_file_positions): Only pad the + previous section to force file alignment when creating an + executable. + +Mon Nov 20 14:54:09 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (coff_compute_section_file_positions): If + RS6000COFF_C, set up the .debug section. + + * xcofflink.c (xcoff_link_input_bfd): Adjust the TOC anchor value + if it is not large enough to accomodate the entire TOC area with + signed 16 bit offsets. + (xcoff_write_global_symbol): Handle negative TOC offsets in global + linkage code. + (_bfd_ppc_xcoff_relocate_section): Adjust relocations against a + TOC anchor to use the TOC value used in the output file. + +Sat Nov 18 18:01:41 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffgen.c (_bfd_coff_get_external_symbols): Cast malloc return. + (_bfd_coff_read_string_table): Likewise. + +Sat Nov 18 19:43:04 1995 Richard Earnshaw (rearnsha@armltd.co.uk) + + * pe-arm.c: Fix typos. + * coff-arm.c: Likewise. + +Fri Nov 17 16:22:04 1995 Kim Knuttila <krk@cygnus.com> + + * coff-ppc.c (list_ele): Added "cat"egory member. + (record_toc): New category parameter (priv or pub). + (ppc_record_toc_entry): Check to see if toc bounds exceeded. + (ppc_process_before_allocation): Removed embrionic data-in-toc from + the mainline. It addes extra toc cells in error. + (ppc_coff_swap_sym_in_hook): Added some documentation. + (dump_toc): Can now diagnose "virtual toc" chicanery. + +Fri Nov 17 10:41:25 1995 Philippe De Muyter <phdm@info.ucl.ac.be> + + * elf-bfd.h (struct elf_link_hash_table): Change type of + dynsymcount and bucketcount fields from size_t to bfd_size_type. + +Fri Nov 17 10:02:58 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (coff_pointerize_aux_hook): I960 version: don't + pointerize C_LEAFSTAT or C_LEAFEXT entries. + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Only create + DT_INIT and DT_FINI entries if the _init or _fini symbol is + defined or mentioned in a regular file. + +Thu Nov 16 15:16:42 1995 Kim Knuttila <krk@cygnus.com> + + * coff-ppc.c (ppc_record_data_in_toc_entry): new function + (coff_ppc_relocate_section): Handle TOCDEFN attribute + (coff_ppc_relocate_section): Correct REL24 handling + (ppc_process_before_allocation): Correct TOCDEFN handling + + * peicode.h (dir_names): Added name descriptions + +Thu Nov 16 03:38:03 1995 Ken Raeburn <raeburn@cygnus.com> + + * VERSION: Updated to cygnus-2.6. + +Wed Nov 15 19:30:07 1995 Ken Raeburn <raeburn@cygnus.com> + + * targets.c (m68k4knetbsd_vec): Declare. + +Wed Nov 15 18:05:52 1995 Ian Lance Taylor <ian@cygnus.com> + + * targets.c (bfd_target): Change type of second argument to + _bfd_print_private_bfd_data from void * to PTR. + * libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): Cast + using PTR rather than void *. + * bfd-in2, libbfd.h: Rebuild. + * peicode.h (pe_print_private_bfd_data): Change vfile from void * + to PTR. + * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define as + _bfd_generic_bfd_print_private_bfd_data rather than casting + bfd_true. + +Wed Nov 15 04:09:14 1995 Ken Raeburn <raeburn@cygnus.com> + + * Makefile.in (.dep1): Fix stupid typo in last change. Remove any + "DO NOT DELETE" lines or blank lines that mkdep writes on some + systems. + (BFD_LIBS_CFILES, ALL_MACHINES_CFILES, BFD32_BACKENDS_CFILES, + BFD64_BACKENDS_CFILES): New variables. + (CFILES): Use them. + +Tue Nov 14 11:52:23 1995 Ian Lance Taylor <ian@cygnus.com> + + * peicode.h (coff_swap_aouthdr_out): For PPC PE, start isize at 0, + not at the file position of the first section. + * coffcode.h (coff_compute_section_file_positions): Avoid using + unportable #elif. + (coff_write_object_contents): When generating a PPC PE executable + with no symbols, round up the file size to a COFF_PAGE_SIZE + boundary. + * cofflink.c (_bfd_coff_final_link): If there are no symbols, + don't write out a string table. + + * elf.c (bfd_section_from_shdr): When using a different section + header, pass the new one to _bfd_elf_make_section_from_shdr. + (elf_fake_sections): Don't set sh_info and sh_entsize fields. + (elf_map_symbols): Add section VMA to symbol value when comparing + against 0. + (_bfd_elf_compute_section_file_positions): Only build symbol table + if there are some symbols. Set file offset of symtab and strtab + sections. + (assign_file_positions_except_relocs): Remove dosyms parameter. + Change all callers. Never set file offset of symtab and strtab + sections. + (_bfd_elf_copy_private_section_data): New function. + (MAP_ONESYMTAB, MAP_DYNSYMTAB, MAP_STRTAB, MAP_SHSTRTAB): Define. + (_bfd_elf_copy_private_symbol_data): New function. + (swap_out_syms): Check for special mapping of st_shndx created by + copy_private_symbol_data. + * elfxx-target.h: Use new copy routines. + * elf-bfd.h (_bfd_elf_copy_private_symbol_data): Declare. + (_bfd_elf_copy_private_section_data): Declare. + + * config.bfd (sh-*-*): Set targ_defvec to shcoff_vec. + + * coffcode.h (coff_slurp_symbol_table): If COFF_WITH_PE, handle + C_NT_WEAK. + + * coff-sh.c (shlcoff_vec): Use _bfd_generic_archive_p, not + _bfd_dummy_target, matching the recent change to archive + recognition. + +Mon Nov 13 13:24:38 1995 Ian Lance Taylor <ian@cygnus.com> + + * libbfd.c (bfd_get_file_window): Use casts to avoid doing + arithmetic on PTR types. + + * aout-target.h (MY(callback)): Set the lma of the sections. + + * ecoff.c (ecoff_reloc_link_order): Turn a reloc against a defined + symbol into a reloc against the section. + +Mon Nov 13 07:31:35 1995 Kim Knuttila <krk@cygnus.com> + + * coff-ppc.c (ppc_coff_link_hash_entry): added support for inline + glue for the relocs: IMGLUE and IFGLUE. + (record_toc): new function - tracks toc contents + (ppc_mark_symbol_as_glue): new function - supports the IMGLUE reloc + (coff_ppc_relocate_section): Added support and fixes for IMGLUE/IFGLUE + (ppc_coff_rtype2howto): removed invalid IMGLUE hack + (coff_ppc_rtype_to_howto): removed invalid IMGLUE hack + (ppc_record_toc_entry): Removed a debug define (duh) + + * peicode.h (coff_swap_scnhdr_out): Fixed invalid strcmp for ".reldata" + (pe_print_idata): New function - formats the idata section data + (pe_print_pdata): New function - formats the pdata section data + (pe_print_private_bfd_data): calls to above + +Sun Nov 12 12:23:24 1995 Stan Shebs <shebs@andros.cygnus.com> + + * Makefile.in (bfd_libs_here, etc): Provide empty definitions. + * coff-rs6000.c (rs6000coff_vec): Add conditional defines + TARGET_SYM and TARGET_NAME for vector and BFD name. + * coff-pmac.c (pmac_xcoff_vec): Remove. + (TARGET_SYM, TARGET_NAME): Define. + * coffcode.h (coff_set_arch_mach_hook) [POWERMAC]: Set the + machine to 0, not all PowerMacs are 601s. + +Fri Nov 10 12:10:14 1995 Ian Lance Taylor <ian@cygnus.com> + + * elfcode.h (elf_object_p): Read in any program headers. + * elf.c (_bfd_elf_make_section_from_shdr): Adjust section lma + based on the program headers, if any. + (elf_fake_sections): Set sh_addr from the vma, not the lma. + (map_program_segments): Set p_paddr of program headers based on + the lma. + +Thu Nov 9 13:01:31 1995 Ian Lance Taylor <ian@cygnus.com> + + * archive.c (bfd_generic_archive_p): Preserve tdata in case of + failure. + + * aoutx.h (NAME(aout,final_link)): Report a reasonable error when + trying to do a relocateable link with a non-a.out object file. + + * archive.c (bfd_generic_archive_p): Check the first object file + in an archive even if target_defaulted is set. If the object file + has the wrong xvec, reject it. + + * aoutx.h (NAME(aout,set_section_contents)): If a section can not + be represented, report the name via _bfd_error_handler. + (translate_to_native_sym_flags): Likewise. + * elf32-mips.c (mips_elf_final_link): Likewise. + * oasys.c (oasys_write_sections): Likewise. + + * coffcode.h (coff_set_alignment_hook): Write RS6000COFF_C version + which checks for STYP_OVRFLO sections. + (coff_compute_section_file_positions): If RS6000COFF_C, handle + reloc and lineno count overflows. + (coff_write_object_contents): Call coff_count_linenumbers before + coff_compute_section_file_positions. If RS6000COFF_C, handle + reloc and lineno count overflows. + * xcofflink.c (_bfd_xcoff_bfd_final_link): Count line numbers and + relocs before dealing with .pad sections. Count overflow section + headers when handling .pad sections. + + * coffcode.h (coff_write_object_contents): Set a.out vstamp to 1 + if RS6000COFF_C. + + * xcofflink.c (XCOFF_DESCRIPTOR): Define. + (struct xcoff_link_hash_table): Add descriptor_section and + special_sections fields. + (_bfd_xcoff_bfd_link_hash_table_create): Initialize new fields. + (xcoff_link_add_symbols): Set linkage section alignment. Create + descriptor section. Check for magic symbol names (_text, etc.), + and record them in special_sections if found. Set + XCOFF_DESCRIPTOR flag for a function descriptor, and set its + descriptor field to point back to the function code symbol. + (xcoff_sweep): Always mark the special descriptor_section. + (bfd_xcoff_export_symbol): Check whether the symbol might be a + function descriptor, and mark it if it is. + (bfd_xcoff_size_dynamic_sections): Add new special_sections + parameter, and fill it in. Allocate space for the descriptor + section. + (xcoff_build_ldsyms): Set XCOFF_DEF_REGULAR flag when defining + global linkage code. If an undefined function descriptor is + exported, arrange to define it. Warn about any other undefined + exported symbol. + (_bfd_xcoff_bfd_final_link): Write out the descriptor section. + (xcoff_write_global_symbol): Create a function descriptor when + necessary. + * bfd-in.h (bfd_xcoff_size_dynamic_sections): Update declaration. + * bfd-in2.h: Rebuild. + +Thu Nov 9 08:40:23 1995 Kim Knuttila <krk@cygnus.com> + + * coff-ppc.c (ppc_coff_link_hash_entry): new types for hashing + (ppc_coff_link_hash_table): new types for hashing + (ppc_coff_link_hash_newfunc): hash entry constructor + (ppc_coff_link_hash_table_init): hash table initializer + (ppc_coff_link_hash_table_create): hash table constructor + (ppc_record_toc_entry): changed references to hash table + (coff_ppc_relocate_section): changed references to hash table + + * libcoff-in.h (coff_link_hash_entry): removed toc_offset + * libcoff.h: Rebuild + + * cofflink.c (_bfd_coff_link_hash_newfunc): removed toc_offset init + (coff_link_add_symbols): removed toc_offset init + +Thu Nov 9 04:00:38 1995 Ken Raeburn <raeburn@cygnus.com> + + * Makefile.in (.dep1): Make sure the file mkdep is to write exists + first. + + * configure.in: Added new option --with[out]-mmap. Set USE_MMAP + if it is given and mmep is available. + * acconfig.h: Undef USE_MMAP. + * configure, config.in: Regenerated. + * aoutx.h: If USE_MMAP is not defined, do all symbol and string + table handling the old way. + (aout_get_external_symbols): Don't complain if last byte of string + table is nonzero. + * libbfd.c [HAVE_MADVISE]: Include sys/types.h and sys/mman.h. + (bfd_free_window) [! USE_MMAP]: Don't define. + (bfd_get_file_window, + _bfd_generic_get_section_contents_in_window) [! USE_MMAP]: Abort. + +Wed Nov 8 20:03:44 1995 Eric Freudenthal <freudenthal@nyu.edu> + + * coff-a29k.c (SIGN_EXTEND_HWORD): Use ~0xffff rather than + 0xffff0000. + +Wed Nov 8 11:31:11 1995 Ian Lance Taylor <ian@cygnus.com> + + * coff-a29k.c (a29k_reloc): Change handling of R_IREL reloc to be + compatible with AMD generated COFF files. Try to support both AMD + and GNU formats simultaneously. + (coff_a29k_relocate_section): Likewise. + + * libbfd.c (bfd_get_file_window): Change writable parameter from + int to boolean; update all callers. Pass MAP_SHARED if not + writable--it's required on Solaris. Cast fprintf argument to + avoid warning. + * bfd-in.h (bfd_get_file_window): Update declaration. + * bfd-in2.h: Rebuild. + * aoutx.h: Update calls to bfd_get_file_window. + + * xcofflink.c (XCOFF_DEF_DYNAMIC): Rename from XCOFF_REF_DYNAMIC. + Change all uses. + (xcoff_swap_ldhdr_in): New static function. + (xcoff_swap_ldsym_in): New static function. + (xcoff_find_reloc): Handle the case of a single reloc correctly. + (xcoff_link_add_symbols): If we just created a descriptor, pass it + to _bfd_generic_link_add_one_symbol, to save a hash lookup. + Handle XTY_ER/XMC_XO symbols correctly. + (xcoff_link_add_dynamic_symbols): Rewrite to read .loader symbols + rather than normal symbol table. + (bfd_xcoff_import_symbol): It's not an error if the symbol is + already defined with the same absolute value. + (xcoff_mark): When considering called symbols, check whether the + descriptor is from a dynamic object, rather than the symbol + itself. + (xcoff_build_ldsyms): Likewise. + + * libbfd.c (bfd_get_file_window): Change return type to boolean. + Cast realloc and malloc return values. If malloc or realloc fail, + set bfd_error_no_memory. + * bfd-in.h (bfd_get_file_window): Change type to boolean. + * bfd-in2.h: Rebuild. + +Tue Nov 7 11:53:48 1995 Kim Knuttila <krk@cygnus.com> + + * coff-ppc.c (ppc_record_toc_entry): new function. + (in_reloc_p): changed return value. + (coff_ppc_relocate_section): much rework. + (ppc_allocate_toc_section): new function. + (ppc_process_before_allocation): new function. + (ppc_coff_swap_sym_in_hook): new function. + + * cofflink.c (_bfd_coff_link_hash_newfunc): initialize toc_offset. + (coff_link_add_symbols): initialize toc_offset. + + * peicode.h (coff_swap_sym_in): Added coff_swap_sym_in_hook + (coff_swap_aouthdr_out): Added more sections to the data + dictionary for the pe file header. Also changed linker version + number on the ppc side. + (dir_names): small improvements to the dictionary printing. + (pe_mkobject_hook): save the file level flags. + + * libcoff-in.h (coff_link_hash_entry): added toc_offset field + (pe_tdata): added real_flags field + (coff_tdata): added local_toc_sym_map and access macro + + * libcoff.h (coff_link_hash_entry): added toc_offset field + (pe_tdata): added real_flags field + (coff_tdata): added local_toc_sym_map and access macro + + * coffcode.h (coff_set_alignment_hook): added hook for PE. + (coff_mkobject): init for local_toc_sym_map + (coff_write_object_contents): set the internal_a.magic to + IMAGE_NT_OPTIONAL_HDR_MAGIC which appears to be what other + ppc compilers use. + +Tue Nov 7 13:48:58 1995 Ian Lance Taylor <ian@cygnus.com> + + * ecofflink.c (_bfd_ecoff_locate_line): Keep looking through stabs + entries until both the line number address and the function name + address are too large. + + * configure.in: Call AC_CHECK_PROG to find and cache AR. + * configure: Rebuilt. + + * aclocal.m4 (BFD_CC_FOR_BUILD): Don't define CC_FOR_BUILD if it + is defined in the environment. + +Tue Nov 7 10:57:24 1995 Jeffrey A Law (law@cygnus.com) + + * som.c (som_get_section_contents_in_window): Define to use + generic version. + +Mon Nov 6 17:13:15 1995 Harry Dolan <dolan@ssd.intel.com> + + * coff-i860.c: New file, based on coff-i386.c. + * cpu-i860.c: New file, based on cpu-i386.c. + * hosts/i860mach3.h: New file, based on hosts/i386mach3.h. + * config.bfd (i860-*-mach3*, i860-*-osf1*, i860-*-coff*): New + targets, using i860coff_vec. + * configure.in (i860-*-mach3*, i860-*-osf1*): New hosts, using + trad-core.o and hosts/i860mach3.h. + (i860coff_vec): Use coff-i860.o and cofflink.o. + * configure: Rebuild. + * Makefile.in: Rebuild dependencies. + (ALL_MACHINES): Add cpu-i860.o. + (BFD32_BACKENDS): Add coff-i860.o. + (CFILES): Add cpu-i860.c and coff-i860.c. + * targets.c (i860coff_vec): Declare. + (bfd_target_vector): Add &i860coff_vec. + * archures.c (bfd_i860_arch): Declare. + (bfd_archures_list): Add &bfd_i860_arch. + * coffcode.h (coff_set_arch_mach_hook): Handle I860 magic number. + (coff_set_flags): Handle bfd_arch_i860. + (coff_write_object_contents): Handle I860 a.out magic number. + +Mon Nov 6 14:34:07 1995 Ian Lance Taylor <ian@cygnus.com> + + * xcofflink.c (xcoff_link_add_symbols): Set the alignment power of + the created .tc section to 2. + (xcoff_mark): Don't keep a .loader reloc for a call to an + undefined symbol when creating a shared library. + (xcoff_build_ldsyms): When creating a shared library, generate + global linkage code for a call to an undefined symbol. + +Sun Nov 5 21:44:13 1995 Ken Raeburn <raeburn@cygnus.com> + + * Makefile.in (CFILES): Rebuild list from BFD_LIBS, ALL_MACHINES, + BFD32_BACKENDS, BFD64_BACKENDS. + (.dep1): Put mkdep output in a separate file. + Rebuilt dependencies. + + * ecoff.c (_bfd_ecoff_slurp_armap): Cast _bfd_read_ar_hdr return + value. + + Permit use of mmap when available: + + * configure.in: Check for mmap, madvise, mprotect. + * config.in, configure: Regenerated. + + * libbfd.c (struct _bfd_window_internal): Define type. + (bfd_init_window, bfd_free_window, bfd_get_file_window): New + functions. + (ok_to_map): New static variable for debugging. + (_bfd_generic_get_section_contents_in_window): New function. + * bfd-in.h (bfd_window_internal): Declare type. + (bfd_window): Define type. + (bfd_init_window, bfd_free_window, bfd_get_file_window): Declare. + * libbfd-in.h (_bfd_generic_get_section_contents_in_window): + Declare. + + * libaout.h (struct aoutdata): Add two window fields. + (obj_aout_sym_window, obj_aout_string_window): New macros. + * aoutx.h (some_aout_object_p): Initialize windows. + (aout_get_external_symbols): Get symbol data and strings in + windows instead of explicitly allocated buffers. + (slurp_symbol_table): Free window instead of memory. + (bfd_free_cached_info): Release windows instead of freeing storage + directly. + (aout_link_free_symbols): Ditto. + + * targets.c (bfd_target): Add new field for + get_section_contents_in_window. + (BFD_JUMP_TABLE_GENERIC): Updated. + * aout-adobe.c, aout-target.h, binary.c, bout.c, coff-alpha.c, + coff-mips.c, elfxx-target.h, i386msdos.c, i386os9k.c, ieee.c, + libcoff-in.h, oasys.c, srec.c, tekhex.c, versados.c: Added new + macros for get_section_contents_in_window field. + +Sat Nov 4 12:23:26 1995 Fred Fish <fnf@cygnus.com> + + * core.c: Renamed to corefile.c + * makefile.dos (OBJS): Change core.o to corefile.o + * Makefile.in (CFILES, BFD_LIBS): Use corefile.c instead of core.c + +Fri Nov 3 15:54:59 1995 Ian Lance Taylor <ian@cygnus.com> + + * xcofflink.c (xcoff_link_add_symbols): Rename local variable sub + to o. Clobber and restore the list of new csects around the call + to _bfd_generic_link_add_one_symbol, in case it wants to report a + linker error and the linker wants to read the symbol table. Reset + the line number count of a real section even if it has no relocs. + (_bfd_xcoff_bfd_final_link): If shared, set the DYNAMIC flag. + + * coffgen.c (_bfd_coff_read_string_table): Warn if the string size + is too small. + +Thu Nov 2 23:16:39 1995 Ian Lance Taylor <ian@cygnus.com> + + * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Don't warn about + an undefined symbol in a shared link. + + * linker.c (_bfd_generic_link_add_one_symbol): Correct type of + oldtype from bfd_link_order_type to bfd_link_hash_type. From + phdm@info.ucl.ac.be (Philippe De Muyter). + +Wed Nov 1 14:26:02 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de> + + * coff-m88k.c (rtype2howto): New static function. + (RTYPE2HOWTO): Use it rather than a macro definition. + + * coffcode.h (coff_write_object_contents): set internal_a.magic + to PAGEMAGICPEXECPAGED #if defined (M68) && !defined (LYNXOS). + + * configure.in: m68*-motorola-sysv* does not use ptrace-core.o; + define TRAD_HEADER to new file hosts/delta68.h. + m88*-motorola-sysv*, however, does use ptrace-core.o. + * hosts/delta68.h: New file. + + * ptrace-core.c (ptrace_unix_core_file_p): change bfd_zmalloc to + bfd_zalloc; provide proper parm abfd to calls to bfd_zalloc. + +Wed Nov 1 13:51:54 1995 Ken Raeburn <raeburn@cygnus.com> + + * i386linux.c (MY(vec)): Declare before use. + +Wed Nov 1 11:45:07 1995 Ian Lance Taylor <ian@cygnus.com> + + * reloc16.c (bfd_coff_reloc16_get_relocated_section_contents): + Pass input_bfd, not in_bfd, to bfd_coff_reloc16_extra_cases. + + * elf.c (bfd_elf_set_dt_needed_name): Don't do anything if the + BFD is not of the right type. + (bfd_elf_get_needed_list): Likewise. + * i386linux.c (bfd_linux_size_dynamic_sections): Likewise. + * sunos.c (bfd_sunos_get_needed_list): Likewise. + * xcofflink.c (XCOFF_XVECP): Define. + (bfd_xcoff_link_record_set): Don't do anything if the BFD is not + of the right type. + (bfd_xcoff_import_symbol): Likewise. + (bfd_xcoff_export_symbol): Likewise. + (bfd_xcoff_link_count_reloc): Likewise. + (bfd_xcoff_record_link_assignment): Likewise. + (bfd_xcoff_size_dynamic_sections): Likewise. + + * sunos.c (sunos_scan_ext_relocs): Only check the reloc symbol + table index against the number of symbols for a base relative + reloc. + + * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Change from macro to + static function. + * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Set + full_aouthdr flag here... + (_bfd_xcoff_bfd_final_link): ...not here. + +Tue Oct 31 12:52:02 1995 Fred Fish <fnf@cygnus.com> + + * libelf.h: Rename to elf-bfd.h to avoid conflict with + systems that have a system <libelf.h>. + * Makefile.in: Globally replace libelf.h with elf-bfd.h. + * bfd.c, elf.c, elf32-arc.c, elf32-gen.c, elf32-hppa.c, + elf32-hppa.h, elf32-i386.c, elf32-i860.c, elf32-m68k.c, + elf32-m88k.c, elf32-mips.c, elf32-ppc.c, elf32-sparc.c, + elf64-gen.c, elf64-sparc.c, elfcode.h, elflink.c, + elfxx-target.h: Include elf-bfd.h rather than libelf.h. + * elfxx-target.h: Change libelf.h reference to elf-bfd.h. + +Tue Oct 31 15:30:07 1995 David Mosberger-Tang <davidm@azstarnet.com> + + * ecoff.c (ecoff_set_symbol_info): Add new parameter weak. If + set, set BSF_WEAK in symbol. Change all callers. + (ecoff_get_extr): Set weakext based on BSF_WEAK. + (ecoff_link_add_externals): If weakext is set, pass BSF_WEAK to + _bfd_generic_link_add_one_symbol. + (ecoff_indirect_link_order): Check that the section tdata relocs + are not NULL before using them. + + * configure.in (alpha*-*-linux*): Set COREFILE to trad-core.o and + define TRAD_HEADER as hosts/alphalinux.h. + * configure: Rebuild. + * hosts/alphalinux.h: New file. + * trad-core.c (trad_unix_core_file_p): Cast u.u_ar0 to bfd_vma, + not int. + +Tue Oct 31 12:34:11 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (coff_slurp_symbol_table): Accept C_BCOMM and + C_ECOMM storage classes. + + * xcofflink.c (xcoff_mark_symbol): New static function, broken out + of xcoff_mark. + (xcoff_mark): Call xcoff_mark_symbol. + (bfd_xcoff_export_symbol): Call xcoff_mark_symbol. + (bfd_xcoff_link_count_reloc): Call xcoff_mark_symbol rather than + doing it by hand. + (xcoff_build_ldsyms): Build a .loader symbol for an export symbol. + +Mon Oct 30 14:53:48 1995 Ian Lance Taylor <ian@cygnus.com> + + * xcofflink.c (struct xcoff_final_link_info): Add new line_filepos + field. + (xcoff_find_reloc): New static function. + (xcoff_link_add_symbols): Use it. + (_bfd_xcoff_bfd_final_link): Set finfo.line_filepos. + (xcoff_link_input_bfd): Handle C_BINCL and C_EINCL. Don't + relocate the value of C_DECL. + + * elf.c (elf_fake_sections): Remove bogus BFD_ASSERT. + +Sat Oct 28 01:25:34 1995 steve chamberlain <sac@slash.cygnus.com> + + * cofflink.c (_bfd_coff_generic_relocate_section): Make + callback decide what goes in .relocs. + * pe[i]-i386.c (TARGET_UNDERSCORE): Define. + * peicode.h (pe_mkobject_hook): Only copy aouthdr if + there is one. + +Sat Oct 28 01:51:02 1995 Ian Lance Taylor <ian@cygnus.com> + + * xcofflink.c (xcoff_link_add_symbols): Handle csects in the + absolute section. + +Fri Oct 27 18:14:39 1995 Ian Lance Taylor <ian@cygnus.com> + + * xcofflink.c: More improvements, mostly to fix handling of + constructors and a few other special cases. + * coff-rs6000.c (rs6000coff_vec): Set symbol_leading_char back to + zero, reverting yesterday's change. + * bfd-in.h (bfd_xcoff_link_record_set): Declare. + (bfd_xcoff_link_count_reloc): Declare. + (bfd_xcoff_record_link_assignment): Declare. + * bfd-in2.h: Rebuild. + +Fri Oct 27 14:42:15 1995 Niklas Hallqvist <niklas@appli.se> + + * PORTING, aout-arm.c, aout-encap.c, aout-rce.c, aout-target.h, + aoutx.h, gen-aout.c, host-aout.c, hp300bsd.c, i386aout.c + i386bsd.c, i386dynix.c, i386linux.c, i386lynx.c, i386mach3.c, + i386netbsd.c, m68klynx.c, m88kmach3.c, mipsbsd.c, newsos3.c, + ns32knetbsd.c, pc532-mach.c, riscix.c, sparclynx.c, sparcnetbsd.c: + Change PAGE_SIZE to TARGET_PAGE_SIZE. + + * m68knetbsd.c: Ditto as well as add support for the m68k4k object + format. + + * netbsd.h: Double ditto (incl. m68k4k support). NetBSD's text + segments includes the a.out header. See to that the magic number + *always* is big-endian. + + * config.bfd: Add m68*-hp*-netbsd* case. Cross-pollinate m68k and + m68k4k NetBSD configurations. + + * configure.in, configure: Separate i386 & mips NetBSD + configurations from other BSD ones. Don't assume DEC is the only + thing NetBSD/mips run on. Add {m68k,ns32k,sparc}-*-netbsd* + configurations. Add support for m68k4k NetBSD object format. + + * libaout.h: Added M_68K4K_NETBSD magic. + + * m68k4knetbsd.c: New file. + + * hosts/{m68k,sparc}nbsd.h: Don't define HOST_BIG_ENDIAN_P. + + * hosts/nbsd.h: Define HOST_BIG_ENDIAN_P according to + <machine/endian.h>. + + * hosts/mipsnbsd.h: New file. + +Thu Oct 26 14:16:47 1995 Ian Lance Taylor <ian@cygnus.com> + + * xcofflink.c: Numerous changes to get closer to a working XCOFF + linker. + * libcoff-in.h (struct xcoff_tdata): Add full_aouthdr, + toc_section, and entry_section fields. + (struct xcoff_section_tdata): Remove ldrel_count field. + * libcoff.h: Rebuild. + * coffcode.h (coff_mkobject_hook): Initialize new xcoff_data + fields. + (coff_compute_section_file_positions): If RS6000COFF_C, generate + full a.out header if full_aouthdr is set in xcoff_data. + (coff_write_object_contents): Likewise. Set o_snentry and o_sntoc + based on sections stored in xcoff_data. + * coff-rs6000.c (xcoff_copy_private_bfd_data): Copy new xcoff_data + fields. + (xcoff_reloc_type_lookup): Handle BFD_RELOC_CTOR. + (rs6000coff_vec): Set symbol_leading_char to '.'. + * coffgen.c (coff_get_symbol_info): If fix_value is set, fix the + value stored in ret rather than returning a pointer value. + +Wed Oct 25 23:10:39 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * config.bfd (powerpc{,le}-{elf,sysv4,eabi,solaris2}): Remove MAC + format for now. + +Wed Oct 25 16:19:27 1995 Jeffrey A Law (law@cygnus.com) + + * som.c (som_slurp_string_table): Allocate the strings with malloc + since they're free'd by free_cached_info. + (som_slurp_symbol_table): Similarly for the symbol table. + +Wed Oct 25 14:59:22 1995 Per Bothner <bothner@kalessin.cygnus.com> + + * Makefile.in (diststuff): Don't make headers. + +Wed Oct 25 11:32:54 1995 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.in: Rebuild dependencies. + + * sunos.c (bfd_sunos_record_link_assignment): Don't do anything if + output_bfd is not SunOS. + (bfd_sunos_size_dynamic_sections): Likewise. Don't scan relocs of + non-SunOS input files. + + * xcofflink.c: Extensive changes to support linking shared objects + and generating a .loader section. + * libcoff-in.h (struct xcoff_tdata): Add import_file_id field. + (struct xcoff_section_tdata): Add lineno_count, first_symndx, + last_symndx, and ldrel_count fields. + * libcoff.h: Rebuild. + * coff-rs6000.c (xcoff_howto_table): Correct reloc names. + * coffcode.h (styp_to_sec_flags): Don't set any flags if STYP_PAD + is set. + * bfd-in.h (bfd_xcoff_import_symbol): Declare. + (bfd_xcoff_export_symbol): Declare. + (bfd_xcoff_size_dynamic_sections): Declare. + * bfd-in2.h: Rebuild. + +Tue Oct 24 17:44:20 1995 Stan Shebs <shebs@andros.cygnus.com> + + * configure.in: Add xcofflink.o to pmac_xcoff_vec. + * configure: Rebuild. + * mpw-config.in: Add xcofflink.c.o to powerpc-apple-macos. + * coff-pmac.c: Include coff-rs6000.c instead of duplicating its + contents. + (pmac_xcoff_vec): Update to use new xcoff support. + * coff-rs6000.c (xcoff_generic_stat_arch_elt): Make static. + (xcoff_write_armap): Declare buf as unsigned char. + * xcofflink.c (xcoff_link_add_symbols): Declare a local as PTR. + + * mpw-make.sed: Generalize subdir_do edit. + +Tue Oct 24 10:25:01 1995 Jeffrey A Law (law@cygnus.com) + + * hppabsd-core.c (make_bfd_asection): Initialize asect->filepos + correctly. Don't initialize asect->vma. + +Fri Oct 20 13:23:48 1995 Ken Raeburn <raeburn@cygnus.com> + + * opncls.c (_bfd_new_bfd): If _bfd_chunksize wasn't preset, use + something a little less than the page size. + +Thu Oct 19 13:06:09 1995 Ian Lance Taylor <ian@cygnus.com> + + * coff-i960.c (coff_i960_adjust_symndx): Clear *adjustedp. + +Wed Oct 18 16:20:08 1995 steve chamberlain <sac@slash.cygnus.com> + + * coff-i386.c (coff_i386_reloc_type_lookup): New. + * coffcode.h (coff_write_object_contents): If .bss is before + .data us that as data_start. + * cofflink.c (_bfd_coff_generic_relocate_section): Get reloc + calc correct. + * peicode.h (add_data_entry): Use _cooked_size of data directory. + (coff_swap_outhdr_out): Hardwire in version number. + +Wed Oct 18 16:50:54 1995 Ken Raeburn <raeburn@cygnus.com> + + * sunos.c (sunos_add_dynamic_symbols): Rename local variables + major and minor to *_vno, since the former are also macros in + SunOS header files. Cast result of bfd_alloc to appropriate + type. + + * coffgen.c (coff_find_nearest_line): Cast used_by_bfd value + before assigning to sec_data. + +Wed Oct 18 13:25:17 1995 Ian Lance Taylor <ian@cygnus.com> + + * ecoff.c (_bfd_ecoff_find_nearest_line): The offset argument is + now relative to the section, not absolute. + * ecofflink.c (_bfd_ecoff_locate_line): Use the right symbol to + get the file name when there is a N_SO directory name. When + handling stabs, remember that section->vma was added to the + offset. + +Tue Oct 17 18:24:54 1995 Ian Lance Taylor <ian@cygnus.com> + + * sunos.c (struct sunos_link_hash_table): Add needed field. + (sunos_link_hash_table_create): Call bfd_release, not free. + (sunos_link_hash_table_create): Initialize needed field. + (sunos_add_dynamic_symbols): Record needed objects. + (bfd_sunos_get_needed_list): New function. + * bfd-in.h (bfd_sunos_get_needed_list): Declare. + * bfd-in2.h: Rebuild. + +Mon Oct 16 14:43:59 1995 steve chamberlain <sac@slash.cygnus.com> + + * libcoff-in.h (pe_data_type.in_reloc_p): New. + +Mon Oct 16 10:52:50 1995 Ian Lance Taylor <ian@cygnus.com> + + * bfd-in.h (struct bfd_link_needed_list): Rename from + bfd_elf_link_needed_list. + * bfd-in2.h: Rebuild. + * elf.c, elflink.h, libelf.h: Corresponding changes. + + Add start at AIX linker support; no shared libraries yet. + * xcofflink.c: New file. + * configure.in (rs600coff_vec): Use xcofflink.o. + * configure: Rebuild. + * libcoff-in.h (struct xcoff_tdata): Add csects and debug_indices + fields. + (struct xcoff_section_tdata): Define. + (xcoff_section_data): Define macro. + (_bfd_xcoff_bfd_link_hash_table_create): Declare. + (_bfd_xcoff_bfd_link_add_symbols): Declare. + (_bfd_xcoff_bfd_final_link): Declare. + (_bfd_ppc_xcoff_relocate_section): Declare. + * libcoff.h: Rebuild. + * coff-rs6000.c: Clean up a bit. + (xcoff_mkobject): Default modtype to 1L, not RE. Initialize + cputype, csects, and debug_indices. + (xcoff_copy_private_bfd_data): Copy cputype. + (xcoff_howto_table): Rename from rs6000coff_howto_table. + (xcoff_rtype2howto): Rename from rs6000coff_rtype2howto. + (xcoff_reloc_type_lookup): Rename from + rs6000coff_reloc_type_lookup. + (coff_relocate_section): Define. + (_bfd_xcoff_sizeof_headers): Define. + (_bfd_xcoff_bfd_get_relocated_section_contents): Define. + (_bfd_xcoff_bfd_relax_section): Define. + (_bfd_xcoff_bfd_link_split_section): Define. + (rs6000coff_vec): For BFD_JUMP_TABLE_LINK, use _bfd_xcoff, not + coff. + * coffcode.h (coff_compute_section_file_positions): If AIX, + increment sofar by SMALL_AOUTSZ if not executable. + (coff_write_object_contents): If AIX, always output an a.out + header; if not executable, header size of SMALL_AOUTSZ. + * hash.c (struct bfd_strtab_hash): Add xcoff field. + (_bfd_stringtab_init): Initialize xcoff field. + (_bfd_xcoff_stringtab_init): New function. + (_bfd_stringtab_add): In XCOFF mode, leave two bytes for length. + (_bfd_stringtab_emit): In XCOFF mode, write out length. + * libbfd-in.h (_bfd_xcoff_stringtab_init): Declare. + * libbfd.h: Rebuild. + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add xcofflink.o. + (CFILES): Add xcofflink.c. + + * elf32-mips.c (mips_elf_symbol_processing): Set SEC_ALLOC, not + SEC_NO_FLAGS, for .acommon section. From Peter Schauer + <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>. + +Sat Oct 14 21:36:02 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * coff-ppc.c (in_reloc_p): Add, clone from coff-i386.c. + +Fri Oct 13 17:48:43 1995 Ken Raeburn <raeburn@cygnus.com> + + * acconfig.h (HAVE_SYS_PROCFS_H): Undef, with comment. + * config.in: Regenerated. + + * opncls.c (getpagesize) [!HAVE_GETPAGESIZE]: Define as 2048. + (_bfd_chunksize): New variable. + (_bfd_new_bfd): Set it to getpagesize() if negative, and use it + for obstack chunk size. + * configure.in: Check for getpagesize. + * configure: Regenerated. + + Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * trad-core.c (rawptr): Make it a local variable of + ptrace_unix_core_file_p. + +Fri Oct 13 11:22:01 1995 steve chamberlain <sac@slash.cygnus.com> + + * coff-arm.c (in_reloc_p): New. + * coff-i386.c (in_reloc_p): New. + * coffcode.h: Allways include peicode.h if COFF_WITH_PE. + (coff_write_object_contents): Only set has_reloc_section + if PE_IMAGE. + * cofflink.c (_bfd_coff_generic_relocate_section): Call + in_reloc_p to decide if reloc should be emitted. + * libcoff.h (pe_data_type.in_reloc_p): New. + * peicode.h (pe_mkobject): Initialize in_reloc_p. + +Wed Oct 11 00:49:29 1995 Ian Lance Taylor <ian@cygnus.com> + + * cofflink.c (_bfd_coff_internal_syment_name): Move to coffgen.c. + (_bfd_coff_read_internal_relocs): Likewise. + * coffgen.c (_bfd_coff_internal_syment_name): Copy from coffgen.c. + (_bfd_coff_read_internal_relocs): Likewise. + + * elflink.h (elf_link_add_object_symbols): Correct conditions + under which type and size change warnings are issued. + +Tue Oct 10 18:32:46 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffgen.c (coff_count_linenumbers): Don't count line numbers for + a symbol which is not in a real section. + (coff_write_native_symbol): Corresponding change. + + * cofflink.c (_bfd_coff_link_hash_newfunc): Rename from + coff_link_hash_newfunc and make non-static. + (_bfd_coff_link_hash_table_init): New function, broken out of + _bfd_coff_link_hash_table_create. + (_bfd_coff_link_hash_table_create): Use it. + (process_embedded_commands): Make static. + * libcoff-in.h ((_bfd_coff_link_hash_newfunc): Declare. + (_bfd_coff_link_hash_table_init): Declare. + * libcoff.h: Rebuild. + + * coffcode.h (coff_mkobject_hook): If RS6000COFF_C, set cputype + field in XCOFF tdata. + (coff_set_arch_mach_hook): Check ifdef RS6000COFF_C, not ifdef + U802ROMAGIC, for clarity. Try to set arch and machine correctly + based on cputype stored in a.out header, or in n_type of initial + .file symbol. + (coff_write_object_contents): Set cputype correctly in a.out + header. + (coff_slurp_symbol_table): Add casts to file_ptr to avoid + warnings. + * coffswap.h (coff_swap_aouthdr_in): Swap in cputype field. + (coff_swap_aouthdr_out): Swap out cputype field. Don't clear + old resv1 field. + * libcoff-in.h (struct xcoff_tdata): Add cputype field. + * libcoff.h: Rebuild. + + * cpu-rs6000.c (rs6000_compatible): New static function. + (bfd_rs6000_arch): Use it. + * cpu-powerpc.c (powerpc_compatible): New static function. + (arch_info_struct): Define various flavours of PowerPC. + (bfd_powerpc_arch): Use powerpc_compatible. Point at + arch_info_struct. + +Tue Oct 10 10:50:46 1995 Fred Fish <fnf@cygnus.com> + + * Makefile.in (FLAGS_TO_PASS): Remove BISON. + +Tue Oct 10 01:28:29 1995 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_link_add_object_symbols): Don't warn about + changing the size or type if the old definition was weak. + +Mon Oct 9 11:24:08 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (combined_entry_type): Add fix_line field. + (coff_slurp_line_table): Warn if we try to set the lineno field of + a symbol twice. + (coff_slurp_symbol_table): If RS6000COFF_C, handle C_BINCL and + C_EINCL by setting fix_line. Fix C_BSTAT symbol value. + * coffgen.c (coff_mangle_symbols): Handle fix_line. + (coff_write_symbol): Only use N_DEBUG if the symbol is in the + absolute section. + (coff_print_symbol): Print fix_value symbols in a useful fashion. + * libcoff.h: Rebuild. + + * libcoff-in.h (struct xcoff_tdata): Define. + (xcoff_data): Define. + * bfd.c (struct _bfd): Add xcoff_obj_data field to tdata union. + * bfd-in2.h, libcoff.h: Rebuild. + * coff-rs6000.c (xcoff_mkobject): New static function. + (coff_mkobject): Define. + (xcoff_copy_private_bfd_data): New static function. + (coff_bfd_copy_private_bfd_data): Define. + (rs6000coff_howto_table): Change R_TOC complain_on_overflow from + signed to bitfield. + (rs6000coff_vec): Add DYNAMIC to object_flags. + * coffcode.h (sec_to_styp_flags): If RS6000COFF_C, handle .pad and + .loader sections specially. + (coff_new_section_hook): If RS6000COFF_C, get the .text and .data + section alignment from the XCOFF tdata information. + (coff_mkobject_hook): If RS6000COFF_C, set DYNAMIC based on + F_SHROBJ, and copy the extra a.out header information into the + XCOFF tdata structure. + (coff_write_object_contents): If RS6000COFF_C, set F_SHROBJ, + F_DYNLOAD and the extra a.out header information. + (coff_slurp_symbol_table): Set BSF_NOT_AT_END for a C_EXT or + C_HIDEXT symbol with attached csect information. + * coffswap.h (coff_swap_aouthdr_in): If RS6000COFF_C, swap + in the o_maxdata field. + (coff_swap_aouthdr_out): If RS6000COFF_C, swap extra XCOFF fields. + * coffgen.c (coff_renumber_symbols): Don't move any symbol to the + end if BSF_NOT_AT_END is set. + + * targets.c (bfd_target): Rename _bfd_read_ar_hdr field to + _bfd_read_ar_hdr_fn. + * libbfd-in.h (_bfd_read_ar_hdr): Update accordingly. + * bfd-in2.h, libbfd.h: Rebuild. + * archive.c (_bfd_get_elt_at_filepos): Cast _bfd_read_ar_hdr + return value. + (do_slurp_bsd_armap, do_slurp_coff_armap): Likewise. + (bfd_slurp_bsd_armap_f2): Likewise. + (_bfd_slurp_extended_name_table): Likewise. + +Fri Oct 6 16:18:35 1995 Ken Raeburn <raeburn@cygnus.com> + + Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * archive.c (bfd_get_next_mapent): Return BFD_NO_MORE_SYMBOLS + when the symbol table is empty. + + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Don't reserve + space for section symbols, since we don't output them either. + (elf_m68k_adjust_dynindx): Removed. + + * ptrace-core.c (rawptr): Make it a local variable of + ptrace_unix_core_file_p. + +Fri Oct 6 12:24:47 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * coff-rs6000.c (xcoff_write_archive_contents): Return false, not + NULL. + + * config.bfd (powerpc{,le}-{elf,sysv4,eabi,solaris2}): Add NT, and + Mac object file formats. + +Fri Oct 6 12:04:02 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffgen.c (coff_fix_symbol_name): Don't try to set up file + auxent if there isn't one. + (coff_write_symbols): If there is no file auxent, use SYMNMLEN + rather than FILNMLEN as the maximum name length. + + * coffcode.h (bfd_coff_backend_data): Add new field + _bfd_coff_print_aux. + (bfd_coff_print_aux): New static function. + (coff_pointerize_aux_hook (RS6000COFF_C version)): Pointerize the + scnlen field of an XTY_LD csect aux entry. + (coff_print_aux): New static function. + (coff_slurp_symbol_table): Don't pointerize scnlen field; now done + in coff_pointerize_aux_hook. + (bfd_coff_std_swap_table): Initialize new field. + * coffgen.c (coff_print_symbol): Call bfd_coff_print_aux. + * libcoff.h: Rebuild. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + + * coffcode.h (coff_write_object_contents): On AIX, clear F_RELFLG + if there are symbols, for native AIX ld compatibility. + + * coffcode.h (bfd_coff_backend_data): Add new field + _bfd_coff_pointerize_aux_hook. + (coff_pointerize_aux_hook): Define as a function if RS6000COFF_C + or I960, and as 0 otherwise. + (bfd_coff_std_swap_table): Initialize new field. + * libcoff.h: Rebuild. + * coffgen.c (coff_pointerize_aux): Change parameters to take + symbol pointer instead of type and class, and to take aux index. + Call _bfd_coff_pointerize_aux_hook if it is defined. + (coff_get_normalized_symtab): Always call coff_pointerize_aux. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize all fields. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + + * coff-rs6000.c: Add full support for AIX archives. Rewrite old + read-only/host-only support. + + * coffcode.h (coff_slurp_symbol_table): Set C_HIDEXT symbols to be + BSF_LOCAL. + (OTHER_GLOBAL_CLASS): Do not define to be C_HIDEXT if + RS6000COFF_C. + + * targets.c (bfd_target): Add _bfd_read_ar_hdr field. Modify + BFD_JUMP_TABLE_ARCHIVE accordingly. + * libbfd-in.h (_bfd_snarf_ar_hdr): Don't declare. + (_bfd_compute_and_write_armap): Declare. + (_bfd_generic_read_ar_hdr): Declare. + (_bfd_read_ar_hdr): Define. + (_bfd_noarchive_read_ar_hdr): Define. + (_bfd_archive_bsd_read_ar_hdr): Define. + (_bfd_archive_coff_read_ar_hdr): Define. + * archive.c: Change all callers of _bfd_snarf_ar_hdr to call + _bfd_read_ar_hdr instead. + (_bfd_generic_read_ar_hdr): Rename from _bfd_snarf_ar_hdr. + (_bfd_compute_and_write_armap): Rename from + compute_and_write_armap. Make non-static. Change all callers. + * ecoff.c (_bfd_ecoff_slurp_armap): Call _bfd_read_ar_hdr rather + than _bfd_snarf_ar_hdr. + * aout-target.h (MY_read_ar_hdr): Define if not defined. + * ieee.c (ieee_read_ar_hdr): Define. + * libecoff.h (_bfd_ecoff_read_ar_hdr): Define. + * oasys.c (oasys_read_ar_hdr): Define. + * som.c (som_read_ar_hdr): Define. + * bfd-in2.h, libbfd.h: Rebuild. + +Thu Oct 5 14:04:07 1995 steve chamberlain <sac@slash.cygnus.com> + + * peicode.c (coff_swap_filehdr_in): If symptr is + zero, there aren't any symbols, even if nsyms is set. + +Thu Oct 5 11:45:02 1995 Ian Lance Taylor <ian@cygnus.com> + + * libecoff.h (struct ecoff_backend_data): Add adjust_headers + field. + * ecoff.c (ecoff_sec_to_styp_flags): Check for various Alpha + sections, and set styp correctly for them: .got, .hash, .dynamic, + .liblist, .rel.dyn, .conflic, .dynstr, .dynsym, .comment. + (_bfd_ecoff_styp_to_sec_flags): Check for various Alpha section + types. + (ecoff_sort_hdrs): New static function. + (ecoff_compute_section_file_positions): Return boolean, not void. + Sort the sections by VMA before looking through them. Put the + first non SEC_ALLOC section on a new page. Put every SEC_ALLOC + section on an appropriate boundary within the page. + (ecoff_compute_reloc_file_positions): Check return value of + ecoff_compute_section_file_positions. + (_bfd_ecoff_set_section_contents): Likewise. + (_bfd_ecoff_write_object_contents): Check for various Alpha + section types when incrementing text_size and data_size. Call + adjust_headers backend function if it exists. + * coff-alpha.c (alpha_adjust_headers): New static function. + (alpha_ecoff_backend_data): Initialize adjust_headers field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + + * hosts/i386bsd.h: Restore file incorrectly deleted on Sep 6. + +Wed Oct 4 18:15:02 1995 Jeff Law (law@hurl.cygnus.com) + + * rs6000-core.c (CORE_VERSION_1): Use CORE_VERSION_1 instead + of ALTERNATE_AIX_CORE_FORMAT. + * configure.in (aix4): No longer need CORE_FLAGS. + * configure: Updated. + +Wed Oct 4 15:36:36 1995 Ken Raeburn <raeburn@cygnus.com> + + NS32k changes from Ian Dall: + * aoutx.h (MY_final_link_relocate, MY_relocate_contents): New + macros. + (aout_link_input_section_std, aout_link_input_section_ext, + aout_link_reloc_link_order): Call them instead of _bfd_* + versions. + * aout-target.h (MY_exec_header_not_counted): New macro, defaults + to zero. + (backend_data): Use it instead of hardcoded zero. + + * aout-ns32k.c (CTOR_TABLE_RELOC_HOWTO): New macro. + (MY_swap_std_reloc_out): Use udata.i for KEEPIT, don't call stoi. + + * ns32knetbsd.c: Include bfd.h. + (MY_text_includes_header, MY_bfd_reloc_type_lookup): New macros. + (MY_bfd_reloc_type_lookup): Declare function too. + * pc532-mach.c (set_sizes): Don't declare. + (MY_text_includes_header, MY_exec_header_not_counted): Define. + (backend_data, MY_backend_data): Don't define. + + * config.bfd: Treat ns32k-pc532-ux* like ns32k-pc532-mach*, and + ns32k-*-lites* like ns32k-*-netbsd*. + + * hosts/nbsd.h: Swap order of sys/vmparam.h and sys/param.h, to + compile on lites. + +Wed Oct 4 14:15:52 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (coff_write_object_contents): Restore setting + f_timdat to 0, deleted on August 22. + +Tue Oct 3 16:28:32 1995 steve chamberlain <sac@slash.cygnus.com> + + * coffcode.h (coff_bfd_copy_private_symbol_data, + coff_bfd_copy_private_section_data, + coff_bfd_copy_private_bfd_data): ifdef to allow overrides. + * peicode.h (coff_bfd_copy_private_bfd_data): New + (pe_bfd_copy_private_bfd_data): New. + (coff_swap_scnhdr_in): Swap bss size into the right place. + (pe_print_private_bfd_data): Add some newlines. + +Tue Oct 3 11:53:04 1995 Jeff Law (law@hurl.cygnus.com) + + * som.c (setup_sections): Don't die if a space has no subspaces. + +Mon Oct 2 14:08:55 1995 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_link_add_object_symbols): Don't let a weak + dynamic symbol override a common symbol. Don't change the size or + type if they have been set and the new symbol is not a definition. + Warn if the size or type changes. + +Sun Oct 1 01:34:41 1995 Jeff Law (law@hurl.cygnus.com) + + * som.c (som_begin_writing): Don't write the symbol table or + symbol strings. + (som_finish_writing): Write them here. Place them after the + subspace data, but before the relocs. + +Fri Sep 29 11:01:55 1995 Ian Lance Taylor <ian@cygnus.com> + + * sunos.c (sunos_add_one_symbol): Just pass false, not + info->shared_library, to sunos_create_dynamic_sections. + (sunos_scan_ext_relocs): Don't warn about a reloc in the .text + section. + (sunos_check_dynamic_reloc): Remove .text section assertion. + +Thu Sep 28 18:48:47 1995 Stan Shebs <shebs@andros.cygnus.com> + + * config.bfd: Add powerpc-*-macos*, powerpc-*-mpw*. + * configure, configure.in: Add pmac_xcoff_vec case. + * Makefile.in (BFD32_BACKENDS): Add coff-pmac.o. + * coff-pmac.c: New file, PowerMac XCOFF support. + * coffcode.h (coff_set_arch_mach_hook): Add PowerMac case. + * targets.c (pmac_xcoff_vec): Declare. + + * mpw-config.in: Various changes to be compatible with the + autoconf-based configury. + * mpw-make.sed: New file, sed commands to translate Unix + makefile into MPW syntax. + * mpw-make.in: Remove. + * hosts/mpw.h: Remove. + * bfd-in.h, bfd-in2.h: If MPW, include the file that defines + true and false as enums, then define TRUE_FALSE_ALREADY_DEFINED. + +Thu Sep 28 17:06:23 1995 steve chamberlain <sac@slash.cygnus.com> + + * binary.c (binary_get_symtab): Return an empty string on error. + * opncls.c (bfd_fdpenr): Change WIN32 restriction to WINGDB. + +Thu Sep 28 15:30:44 1995 Kim Knuttila <krk@nellie> + + * coff-ppc.c: Reformatted according to gnu conventions + Removed irrelevant "if 0" code + +Thu Sep 28 11:19:53 1995 Ian Lance Taylor <ian@cygnus.com> + + * hp300hpux.c (convert_sym_type): Treat secondary symbols as weak + symbols rather than as indirect symbols. + (MY(slurp_symbol_table)): Don't do anything special about + secondary symbols. + + * coffcode.h (coff_new_section_hook): Make sure that the alignment + of .ctors and .dtors sections is no larger than 2. + + * sunos.c (sunos_add_one_symbol): Don't change + bfd_link_hash_common to bfd_link_hash_new, since it may be on the + undef list. + (bfd_sunos_record_link_assignment): Don't put __DYNAMIC in the + dynamic symbols when creating a shared library. + (sunos_scan_ext_relocs): Handle relocs correctly when creating a + shared library. + (sunos_scan_dynamic_symbol): Don't mark the __DYNAMIC symbol as + written even if it is not defined in a regular object. + (sunos_write_dynamic_symbol): Use plt_offset for the address of + the jump table reloc. Add an assertion. Use RELOC_JMP_SLOT + rather than the constant 22. + (sunos_check_dynamic_reloc): Handle creating a shared library. + (sunos_finish_dynamic_link): Set the first entry in the GOT to + zero when creating a shared library. + * aoutx.h (NAME(aout,final_link)): If there is a symbol __DYNAMIC, + write it out at the start of the symbol table. + + * Makefile.in (BFD32_BACKENDS): Add coff-arm.o. + +Thu Sep 28 00:58:05 1995 Doug Evans <dje@deneb.cygnus.com> + + * config.bfd: Add arm-*-coff. + * configure.in, configure: Add armcoff_{little,big}_vec. + * targets.c (armcoff_{little,big}_vec): Declare. + (bfd_target_vector): Add armcoff_{little,big}_vec. + * coff-arm.c (armcoff_{little,big}_vec): Always define. + +Wed Sep 27 10:37:14 1995 Ian Lance Taylor <ian@cygnus.com> + + * targets.c (bfd_find_target): Remove debugging code. + +Wed Sep 27 07:23:39 1995 Kim Knuttila <krk@nellie> + + * coff-ppc.c, pe-ppc.c, pei-ppc.c: Initial bfd for coff/PE + support on powerpc. + * Makefile.in: added *-ppc files + * coffcode.h: ppc MAGIC, and use peicode.h rather than coffswap.h to + allow pe based .o's to be shared with other tools on ppc/NT + * config.bfd: added powerpc[le]-[pe|winnt] config support + * configure, configure.in: added bfd_powerpc[le]_pe[i]_vec + * peicode.h: Added more section flags for PE on ppc + Added coff_swap_filehdr_out to allow peicode.h to be + used for non-image PE files on ppc. + Check for image, or not, before copying pe_opthdr + * targets.c: Added new bfd's + * targets.c: Removed two inactive bfds that shouldn't have made it this + far. + +Tue Sep 26 14:06:41 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_reloc_type): Rename from reloc_type, and use + explicit values to initialize all relocs. Change all users. + (ppc_elf_brtaken_inner): New function to handle branch predicition + relocs. + (ppc_elf_brtaken_reloc): Ditto. + (ppc_elf_howto_raw): Use new functions. Make sure all unsupported + relocs use ppc_elf_unsupported_reloc. + (ppc_elf_merge_private_bfd_data): Keep track of whether an error + needs to be reported. + (ppc_elf_relocate_section): Support branch prediction relocs. + +Tue Sep 26 12:48:05 1995 Ian Lance Taylor <ian@cygnus.com> + + * bfd.c (bfd_assert): Remove \n from string passed to + _bfd_error_handler. + + * coff-i386.c: (TWO_DATA_SECS): Don't define. + * coffcode.h (bfd_coff_backend_data): Remove _bfd_make_section_hook. + (bfd_coff_make_section_hook): Don't define. + (coff_make_section_hook): Remove. + (sec_to_styp_flags): Remove TWO_DATA_SECS case. + (styp_to_sec_flags): Likewise. + (coff_write_object_contents): Likewise. + (bfd_coff_std_swap_table): Don't initialize make_section_hook + field. + * libcoff.h: Rebuild. + * coffgen.c (make_a_section_from_file): Just call + bfd_make_section_anyway, not bfd_make_section or + bfd_coff_make_section_hook. + * ecoff.c (_bfd_ecoff_make_section_hook): Remove. + * libecoff.h (_bfd_ecoff_make_section_hook): Don't declare. + * coff-alpha.c (alpha_ecoff_backend_data): Don't initialize + make_section_hook field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + + * aoutx.h (translate_from_native_sym_flags): Don't try to stuff + pointers into value field for warning and indirect symbols; just + leave the value field alone. + * linker.c (generic_link_add_symbol_list): Use next symbol for + warning and indirect symbols, rather than looking in symbol value. + * ecoff.c (ecoff_set_symbol_info): Remove indirect_ptr_ptr + parameter. Change all callers. Remove support for indirect + symbols; it didn't work anyhow. + (_bfd_ecoff_slurp_symbol_table): Remove indirect_ptr variable. + * syms.c: Change comments about BSF_WARNING and BSF_INDIRECT. + * bfd-in2.h: Rebuild. + +Mon Sep 25 16:04:09 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_howto_raw): For all 14-bit branch relocs, + go back to telling the tools this reloc operates on 32 bits. + +Mon Sep 25 11:48:02 1995 Ian Lance Taylor <ian@cygnus.com> + + * aout-adobe.c (aout_adobe_callback): Use _bfd_error_handler + rather than a direct fprintf. + * archive.c (_bfd_write_archive_contents): Likewise. + * coffcode.h (coff_slurp_symbol_table): Likewise. + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Likewise. + (ppc_elf_unsupported_reloc): Likewise. + (ppc_elf_relocate_section): Likewise. + * i386linux.c (linux_tally_symbols): Likewise. + (linux_finish_dynamic_link): Likewise. + * osf-core.c (osf_core_core_file_p): Likewise. + * rs6000-core.c (rs6000coff_get_section_contents): Likewise. + * som.c (som_sizeof_headers): Likewise. + * srec.c (srec_bad_byte): Likewise. + * bfd.c (bfd_assert): Likewise. Also change file to be const. + * libbfd-in.h (bfd_assert): Declare first parameter const. + * libbfd.h: Rebuild. + * coff-a29k.c (a29k_reloc): Don't bother to fprintf; returning + bfd_reloc_overflow is enough. + * coff-h8300.c (rtype2howto): Don't bother to fprintf; just abort. + * coff-h8500.c (rtype2howto): Likewise. + * coff-z8k.c (rtype2howto): Likewise. + * coffcode.h (dummy_reloc16_extra_cases): Likewise. + * elf.c (_bfd_elf_get_lineno): Likewise. + (_bfd_elf_no_info_to_howto): Likewise. + (_bfd_elf_no_info_to_howto_rel): Likewise. + * hp300hpux.c (convert_sym_type): Likewise. + (MY(swap_std_reloc_in)): Likewise. + * elf.c (bfd_section_from_shdr): Remove #if 0 sections. + + * libaout.h (struct aoutdata): Add line_buf field. + * aoutx.h (NAME(aout,find_nearest_line)): Remove statics buffer + and filename_buffer. Instead, use a malloc buffer stored in the + new line_buf field. Remove length restrictions. + + * coffgen.c (string_size): Remove static variable. + (debug_string_size, debug_string_section): Likewise. + (coff_fix_symbol_name): Add string_size_p, debug_string_section_p, + and debug_string_size_p parameters. Use them instead of the + global variables. Change all callers. + (coff_write_symbol): Likewise. + (coff_write_alien_symbol, coff_write_native_symbol): Likewise. + (coff_write_symbols): Add local variables to replace removed + global variables. + + * libcoff-in.h (struct coff_section_tdata): Add offset, i, + function, and line_base fields. + * libcoff.h: Rebuild. + * coffgen.c (coff_find_nearest_line): Use section tdata to cache + information, rather than using static variables. + + * sunos.c (sunos_read_dynamic_info): Adjust offsets in an NMAGIC + file. From Peter DeWolf <pld@amt.tay1.dec.com>. + + * init.c (initialized): Remove static variable. + (bfd_init): Don't bother setting initialized. + (bfd_check_init): Remove. + * opncls.c (_bfd_new_bfd): Don't call bfd_check_init. + * libbfd.h: Rebuild. + +Sat Sep 23 01:22:23 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * rs6000-core.c (rs6000coff_core_p): Don't check the core file + size for full core dumps. Copy core file header to private data. + (rs6000coff_core_file_failing_command, + rs6000coff_core_file_failing_signal): New functions to extract + the file name and terminating signal from the core file. + * coff-rs6000.c: Use them. + +Fri Sep 22 17:44:47 1995 Ian Lance Taylor <ian@cygnus.com> + + Change arch info to be const, initialized at compile time. + * archures.c: Reindent many functions. Change CONST to const. + (bfd_arch_info_type): Make arch_name const. Remove disassemble; + nothing set it anyhow. Make next const. + (bfd_arch_info_list): Remove. + (bfd_archures_list): Rename from archures_init_table. Change from + a table of function pointers to a table of bfd_arch_info_type + structure addresses. + (bfd_scan_arch): Rewrite accordingly. Return a const pointer. + (bfd_lookup_arch): Likewise. + (bfd_set_arch_info): Rewrite accordingly. Change argument to be a + const pointer. + (bfd_default_arch_struct): Make const. + (bfd_arch_init, bfd_arch_linkin): Remove. + (bfd_get_arch_info): Return a const pointer. + * init.c (bfd_init): Don't call bfd_arch_init. + * bfd.c (struct _bfd): Make arch_info const. + * bfd-in2.h: Rebuild. + * libbfd.h: Rebuild. + * configure.in: Put & before everything in $selarchs. + * configure: Rebuild. + * cpu-*.c: Change bfd_*_arch from a function which calls + bfd_arch_linkin to a const structure. + * ieee.c (ieee_object_p): Make arch const. + +Fri Sep 22 16:23:18 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * reloc.c (bfd_reloc_code_type): Add relocations to support all of + PowerPC V.4. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + + * elf32-ppc.c (reloc_type): Update names to match current draft. + (ppc_elf_howto_raw): Mark 14 bit relocs as short sized and PC + relative. Update names to current V.4 draft. + (ppc_elf_reloc_type_lookup): Add support for more relocations. + (ppc_elf_relocate_section): Rename relocations to match draft. + +Thu Sep 21 21:53:18 1995 Michael Meissner <meissner@cygnus.com> + + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Allow modules + compiled with -mrelocatable-lib to be linked with either normal + modules or -mrelocatable modules. + +Wed Sep 20 12:03:26 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (coff_write_object_contents): Clear the vstamp field + in the a.out header. + + * aoutx.h (NAME(aout,swap_ext_reloc_out)): Don't set r_extern for + a reloc against a local symbol, even if it's not a section. + +Tue Sep 19 17:02:26 1995 Ian Lance Taylor <ian@cygnus.com> + + * targets.c (bfd_target): Remove unused align_power_min field. + * bfd-in2.h: Rebuild. + * All backends: Remove initialization of align_power_min. + +Tue Sep 19 14:02:21 1995 steve chamberlain <sac@slash.cygnus.com> + + * peicode.h (coff_swap_scnhdr_out): Get sizes for BSS right. + +Mon Sep 18 14:35:01 1995 Arne H. Juul <arnej@pvv.unit.no> + + * config.bfd (mips-dec-netbsd*): New target. + * configure.host (mips-dec-netbsd*): New host. + * configure.in (mips-dec-netbsd*): New native. + * configure: Rebuild. + +Fri Sep 15 10:24:36 1995 Ian Lance Taylor <ian@cygnus.com> + + Make the COFF backend linker merge common types: + * cofflink.c (struct coff_debug_merge_element): Define. + (struct coff_debug_merge_type): Define. + (struct coff_debug_merge_hash_entry): Define. + (struct coff_debug_merge_hash_table): Define. + (coff_debug_merge_hash_table_init): Define. + (coff_debug_merge_hash_table_free): Define. + (coff_debug_merge_hash_lookup): Define. + (struct coff_final_link_info): Add debug_merge field. + (coff_debug_merge_hash_newfunc): New static function. + (_bfd_coff_final_link): Allocate and free debug_merge table. + (coff_link_input_bfd): Merge identical enum, struct and union + types. + +Thu Sep 14 14:53:58 1995 Ian Lance Taylor <ian@cygnus.com> + + Convert i960 COFF to use COFF backend linker. + * coff-i960.c (coff_i960_relocate): Use a coff_section_data + structure to store the symbol being used. + (coff_i960_start_final_link): New static function. + (coff_i960_relocate_section): New static function. + (coff_i960_adjust_symndx): New static function. + (coff_start_final_link): Define. + (coff_relocate_section): Define. + (coff_adjust_symndx): Define. + * coffcode.h (bfd_coff_backend_data): Add new callback function + _bfd_coff_start_final_link. + (bfd_coff_start_final_link): Define. + (coff_start_final_link): Define if not defined. + (bfd_coff_std_swap_table): Add coff_start_final_link. + * cofflink.c (_bfd_coff_internal_syment_name): Make globally + visible. + (_bfd_coff_final_link): Call bfd_coff_start_final_link if the + function callback is not NULL. + * libcoff-in.h (struct coff_section_tdata): Add tdata field. + (_bfd_coff_internal_syment_name): Declare. + * libcoff.h: Rebuild. + * configure.in (icoff_big_vec): Add cofflink.o. + (icoff_little_vec): Likewise. + * configure: Rebuild. + +Wed Sep 13 17:38:23 1995 Fred Fish <fnf@rtl.cygnus.com> + + * Makefile.in (clean-info): Remove extraneous tab from line + following action. + +Wed Sep 13 13:27:53 1995 Ian Lance Taylor <ian@cygnus.com> + + * cofflink.c (coff_link_input_bfd): Fail if a section with no + contents has relocs. + +Thu Sep 12 12:45:34 1995 steve chamberlain <sac@slash.cygnus.com> + + * coffcode.h (coff_compute_section_file_positions): Keep the + raw size safe. + (coff_write_object_contents): Remember if it's a relocatable + file. + * libcoff-in.h (pe_data_type): New member 'has_reloc_section' + * peicode.h (coff_swap_filehdr_out): Clear not-reloc flag + if relocatable file. Swap out saved raw size. + +Tue Sep 12 12:14:33 1995 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.in (do_maintainer_clean): Rename from do_realclean. + (maintainer-clean): Rename from realclean, passing + maintainer-clean down to subdirectories, but leave realclean as a + synonym. + + * linker.c (_bfd_generic_link_add_one_symbol): Pass symbol name to + warning callback. + + * dep-in.sed: Remove config.h from generated dependencies. + + * sunos.c (sunos_slurp_dynamic_symtab): New static function, + broken out of sunos_canonicalize_dynamic_symtab. + (sunos_canonicalize_dynamic_symtab): Call new function + sunos_slurp_dynamic_symtab. + (sunos_add_dynamic_symbols): Add three new parameters. Return the + dynamic symbol table to the caller. + * aoutx.h (aout_link_add_symbols): Permit add_dynamic_symbols + callback to override the symbols being read. + * libaout.h (struct aout_backend_data): Add three new parameters + to add_dynamic_symbols callback. + + Extensive minor changes to avoid various gcc warnings. Also: + * Makefile.in (BFD32_BACKENDS): Remove coff-arm.o. + * archures.c (bfd_arch_info_type): Change mach field from long to + unsigned long. + (bfd_lookup_arch): Change machine parameter from long to unsigned + long. + +Mon Sep 11 10:55:47 1995 Ian Lance Taylor <ian@cygnus.com> + + * sunos.c (sunos_scan_std_relocs): Fix BFD_ASSERT: it's OK to find + a symbol with a non-zero plt_offset. + +Fri Sep 8 11:47:24 1995 Ian Lance Taylor <ian@cygnus.com> + + * elfcode.h (align_file_position): Remove; not used. + + * configure.in: Only check for <sys/procfs.h> on a native system, + and make sure it defines prstatus_t. + * configure: Rebuild. + +Thu Sep 7 12:48:01 1995 Ian Lance Taylor <ian@cygnus.com> + + * sunos.c (sunos_write_dynamic_symbol): Correct m68k abort test. + + * config.in: Rename from config.h.in. + * configure.in: Call AC_CONFIG_HEADER with config.h:config.in. + Check for config.h:config.in when creating stamp-h. + * configure: Rebuild. + * Makefile.in (stamp-h): Depend upon config.in rather than + config.h.in. Set CONFIG_HEADERS to config.h:config.in when + calling config.status. + + * Makefile.in (do_distclean): Remove config.h and stamp-h. + (Makefile): Just rebuild Makefile. + (config.h, stamp-h): New targets. + * configure.in: Create stamp-h when rebuilding config.h. + * configure: Rebuild. + +Wed Sep 6 15:00:33 1995 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Call AC_CONFIG_HEADER. Substitute + HOST_64BIT_LONG. Check that various header files exist. Check + that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc + and/or free need to be declared. Don't make a link to sysdep.h. + Define TRAD_HEADER for various hosts. + * configure: Rebuild. + * configure.host: Don't set my_host. Add definitions taken from + host header files for various entries. Remove entries which now + do nothing. + * acconfig.h: New file. + * config.h.in: New file, built by autoheader. + * sysdep.h: New file. + * Makefile.in (do_distclean): Don't remove sysdep.h. + (RECONFIG): Remove. + (LOCAL_H_DEPS): New variable. + ($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and + $(RECONFIG). + ($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise. + ($(OPTIONAL_BACKENDS)): Likewise. + (stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than + looking through sysdep.h. + * bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile. + (BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG. + (fprintf_vma, sprintf_vma): Likewise. + (int64_type, uint64_type): Don't define. + * bfd-in2.h: Rebuild. + * archures.c, bfd.c, srec.c: Include <ctype.h>. + * elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS. + * lynx-core.c: Include stuff from old hosts/lynx.h. + * opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL), + rather than NO_FCNTL. + * targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__ + rather than NATIVE_HPPAHPUX_COMPILER. + * trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it + is defined. + * hosts/*.h: Remove all header files which merely include, + declare, and define things. Leave header files which define + information needed by trad-core.c. + + * aclocal.m4 (BFD_BINARY_FOPEN): Define. + (BFD_CC_FOR_BUILD): Define. + * configure.in: Use BFD_CC_FOR_BUILD. + * configure: Rebuild. + +Tue Sep 5 19:35:28 1995 Ian Lance Taylor <ian@cygnus.com> + + * aclocal.m4: Don't try to grep ../Makefile if it doesn't exist. + * configure: Rebuild. + + * coff-sparc.c (CALC_ADDEND): Don't set the addend to the value of + a global symbol. + +Tue Sep 5 12:48:26 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * config.bfd: i386pe_ve -> i386pe_vec. + +Mon Sep 4 14:02:43 1995 Ian Lance Taylor <ian@cygnus.com> + + * configure.host: Incorporate host Makefile fragments by setting + shell variables. + * configure.in: Call AC_PROG_CC. Substitute CFLAGS, HDEFINES and + AR. Call AC_PROG_INSTALL. Substitute CC_FOR_BUILD, choosing a + value based on whether the code is being compiled by a cross + compiler. Don't substitute host_makefile_frag or frags. + * aclocal.m4: New file to define local AC_PROG_CC. + * configure: Rebuild. + * Makefile.in (INSTALL): Set to @INSTALL@. + (INSTALL_PROGRAM): Set to @INSTALL_PROGRAM@. + (INSTALL_DATA): Set to @INSTALL_DATA@. + (AR): Set to @AR@. + (CC): Define as @CC@. + (CFLAGS): Set to @CFLAGS@. + (CC_FOR_BUILD): Set to @CC_FOR_BUILD@. + (@host_makefile_frag@): Remove. + (ALL_CFLAGS): Change $(HDEFINES) to @HDEFINES@. Move $(CFLAGS) + after other options. + (config.status): Remove dependency upon @frags@. + * config/*.mh, config/README: Remove. + + * config.bfd: Rewrite to incorporate the contents of the Makefile + fragments by setting shell variables, rather than merely returning + the name of a Makefile fragment. + * configure.in: Use shell variables set by config.bfd rather than + looking at the target Makefile fragment files. Don't substitute + target_makefile_frag. Do substitute TDEFINES. + * configure: Rebuild. + * Makefile.in (@target_makefile_frag@): Remove. + (ALL_CFLAGS): Change $(TDEFINES) to @TDEFINES@. + * config/*.mt: Remove. + +Mon Sep 4 03:13:28 1995 Ken Raeburn <raeburn@cygnus.com> + + * configure.in: Put changequote lines around "i[345]86" patterns + section of core file support. + +Sun Sep 3 11:31:58 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_print_private_bfd_data): Define to use the + generic version. + +Fri Sep 1 17:08:40 1995 steve chamberlain <sac@slash.cygnus.com> + + * peicode.h (coff_swap_aouthdr_in): Add ImageBase to + entry, text_start and data_start. + +Fri Sep 1 18:06:28 1995 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.in (OFILES): Remove $(TDEPFILES). + * config/apollo.mt (TDEPFILES): Remove. + * config/README: Update. + + * configure.in: For a native configuration, set COREFILE and + COREFLAG based on the canonical host name. + * configure: Rebuild. + * Makefile.in: Rebuild dependencies. + (ALL_CFLAGS): Add @COREFLAG@. + (OFILES): Replace $(HDEPFILES) with @COREFILE@. + * coff-rs6000.c: Check AIX_CORE rather than HOST_AIX for core file + support routines. Check LYNX_CORE rather than HOST_LYNX. + * lynx-core.c: Check LYNX_CORE rather than HOST_LYNX. + * i386lynx.c: Likewise. + * m68klynx.c: Likewise. + * sparclynx.c: Likewise. + * rs6000-core.c: Check AIX_CORE rather than HOST_AIX. + * *-core.c: Comment changes. + * config/decstation.mh (HDEPFILES): Remove. + (HDEFINES): Remove -DTRAD_CORE. + * config/irix3.mh (RANLIB): Remove. + * config/irix4.mh (HDEPFILES, RANLIB): Remove. + (HDEFINES): Remove -DIRIX_CORE. + * config/riscos.mh (RANLIB, HDEPFILES): Remove. + (HDEFINES): Remove -DTRAD_CORE. + * config/ncr3000.mh (AR_FLAGS, RANLIB): Remove. + * config/ultra3.mh (RANLIB): Remove. + * config/aix4.mh, config/alphaosf.mh, config/amix.mh: Remove. + * config/apollo.mh, config/delta68.mh, config/delta88.mh: Remove. + * config/dpx2.mh, config/esix.mh, config/harris.mh: Remove. + * config/hp300.mh, config/hp300bsd.mh, config/hppabsd.mh: Remove. + * config/hppahpux.mh, config/hppaosf.mh: Remove. + * config/i386aix.mh, config/i386bsd.mh: Remove. + * config/i386linux.mh, config/i386mach3.mh: Remove. + * config/i386sco.mh, config/i386v.mh, config/i386v4.mh: Remove. + * config/irix5.mh, config/m88kmach3.mh, config/mipsbsd.mh: Remove. + * config/mipsmach3.mh, config/news-mips.mh: Remove. + * config/news.mh, config/pc532mach.mh, config/riscix.mh: Remove. + * config/rs600.mh, config/rs6000lynx.mh: Remove. + * config/solaris2.mh, config/stratus.mh: Remove. + * config/symmetry.mh, config/sysv4.mh, config/tahoe.mh: Remove. + * config/vaxbsd.mh, config/vaxult.mh, config/vaxult2.mh: Remove. + +Fri Sep 1 15:18:50 1995 Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp> + + * elflink.h (elf_bfd_final_link): Don't change a DT_INIT or + DT_FINI entry if the appropriate symbol is not in the hash table. + + * libelf.h (struct elf_backend_data): Add create_program_headers + and want_hdr_in_seg fields. + * elfxx-target.h (elf_backend_want_hdr_in_seg): Define if not + defined. + (elf_backend_create_program_headers): Likewise. + (elfNN_bed): Initialize create_program_headers and + want_hdr_in_seg. + * elf.c (get_program_header_size): Call create_program_headers + backend routine. + (map_program_segments): Check want_hdr_in_seg backend field. Call + create_program_headers backend routine. + + * elf.c (assign_file_positions_except_relocs): Align non allocated + sections when creating an executable. + + * elfcode.h (elf_swap_phdr_in): Make non static. + (elf_swap_phdr_out): Make non static. + * libelf.h (bfd_elf32_swap_phdr_in): Declare. + (bfd_elf32_swap_phdr_out): Declare. + (bfd_elf64_swap_phdr_in): Declare. + (bfd_elf64_swap_phdr_out): Declare. + + * ecofflink.c (ecoff_collect_shuffle): New static function. + (_bfd_ecoff_get_accumulated_pdr): New function. + (_bfd_ecoff_get_accumulated_sym): New function. + (_bfd_ecoff_get_accumulated_ss): New function. + * libbfd-in.h (_bfd_ecoff_get_accumulated_pdr): Declare. + (_bfd_ecoff_get_accumulated_sym): Declare. + (_bfd_ecoff_get_accumulated_ss): Declare. + * libbfd.h: Rebuild. + +Fri Sep 1 13:20:25 1995 Ian Lance Taylor <ian@cygnus.com> + + * libecoff.h (_bfd_ecoff_bfd_print_private_bfd_data): Fix typo. + + * elflink.h (elf_link_add_object_symbols): Handle indirect and + warning symbols. If any section is named .gnu.warning.XXX, treat + the contents as a warning to be issued if the symbol XXX is + referenced. + (elf_link_output_extsym): For an indirect or warning symbol, just + output the symbol it points to. + + * linker.c (_bfd_link_hash_newfunc): Don't bother to set bfd_error + if bfd_hash_allocate fails, since it will already be set. + (generic_link_hash_newfunc): Likewise. + (archive_hash_newfunc): Likewise. + (hash_entry_bfd): New static function. + (_bfd_generic_link_add_one_symbol): Pass new arguments to warning + callback. Allocate a new warning using the hash table newfunc. + Use bfd_hash_replace to update the entry in the hash table, rather + than assuming we can copy the fields with structure assignment. + + * hash.c (bfd_hash_replace): New function. + * bfd-in.h (bfd_hash_replace): Declare. + * bfd-in2.h: Rebuild. + +Fri Sep 1 08:12:50 1995 James G. Smith <jsmith@beauty.cygnus.com> + + * config.bfd: Add mips*vr4300-*-elf* target. + * config/mipsbvr4300.mt: Added. + +See file ChangeLog.2 + + +Local Variables: +mode: indented-text +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/gdb/bfd/ChangeLog.1 b/contrib/gdb/bfd/ChangeLog.1 new file mode 100644 index 0000000000000..f36ed3cd01c80 --- /dev/null +++ b/contrib/gdb/bfd/ChangeLog.1 @@ -0,0 +1,6951 @@ +Sun Oct 31 09:35:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * targets.c: Move enum target_flavour outside of struct and change + the name to enum bfd_flavour. This means bfd clients can use it. + * bfd-in.h: Add macro bfd_get_flavour. + * bfd-in2.h: Rebuilt. + + * som.c: Add comment about how abort() on corrupt executable is evil. + +Sat Oct 30 12:27:09 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (aout,slurp_reloc_table): Avoid a goto. + +Fri Oct 29 16:04:33 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * gen-aout.c, libbfd.c: exit(1) instead of exit(-1). + +Fri Oct 29 13:17:21 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bfd-in.h: Added commands for object file flag values. + * bfd-in2.h: Rebuilt. + * elfcode.h (elf_object_p): If type is ET_DYN, set DYNAMIC flag, + not EXEC_P. + * bout.c, coff-h8300.c, coff-sh.c: Add BFD_IS_RELAXABLE to + object_flags field for target vector. + * aix386-core.c, aout-adobe.c, aout-target.h, bout.c, coff-a29k.c, + coff-alpha.c, coff-apollo.c, coff-h8300.c, coff-h8500.c, + coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c, coff-mips.c, + coff-rs6000.c, coff-sh.c, coff-we32k.c, coff-z8k.c, hpux-core.c, + ieee.c, mipsbsd.c, nlm-target.h, oasys.c, osf-core.c, som.c, + srec.c, tekhex.c, trad-core.c: Remove DYNAMIC from object_flags + field for target vector. + +Thu Oct 28 20:02:31 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * hosts/std-host.h: Don't declare time; causes error on mach3. + * configure.in (i386mach3_vec): Require aout32.o stab-syms.o. + +Thu Oct 28 16:33:26 1993 Stan Shebs (shebs@rtl.cygnus.com) + + LynxOS and Sparc LynxOS changes: + * config.bfd: Recognize sparc-*-lynxos*. + * configure.host: Recognize sparc-*-lynxos*. + * configure.in: Recognize Sparc Lynx vectors. + * targets.c (sparclynx_aout_vec): Declare. + (sparclynx_coff_vec): Declare. + (target_vector): Add them. + * cf-i386lynx.c: New file, renamed from i386lynx-cf.c. + * cf-m68klynx.c: New file, renamed from m68klynx-cf.c. + * cf-sparclynx.c: New file, support for coff in Sparc LynxOS. + * coff-sparc.c: New file, basic Sparc coff support. + * sparclynx.c: New file, support for a.out in Sparc LynxOS. + * Makefile.in: Change filenames appropriately, add Sparc rules. + * coffcode.h (coff_set_arch_mach_hook): Recognize Sparc magic + number. + (coff_set_flags): Use LynxOS magic number for i386, m68k, and + Sparc LynxOS, set Sparc magic number for Sparcs. + * config/m68k-lynx.mt (SELECT_VECS): Remove redundant vector. + * config/sparc-lynx.mt: New file. + * hosts/i386lynx.h: Cosmetic improvements. + * hosts/m68klynx.h: Add ifdefs, #define of cfree. + * hosts/sparclynx.h: New file. + +Thu Oct 28 16:23:40 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + gcc -Wall lint: + * coff-h8300.c (h8300_reloc16_estimate): Declare return type. + Remove useless statement probably left by code copy. + * cpu-i960.c (compatible): Fully bracket matrix initializer. + * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): Use bfd_xmalloc + rather than xmalloc. Use realloc and check the return value + rather than xrealloc. + (hppa_elf_get_section_contents): Add some casts. + * elf32-i386.c (elf_i386_reloc_type_lookup): Remove unused + variable. Add default case to switch. + * hp300hpux.c: Declare aout_32_write_syms. + * i386bsd.c, i386linux.c, netbsd386.c (N_SHARED_LIB): Define as 0 + (definition from aout/aout64.h is always 0 anyhow). + * i386lynx.c (swap_std_reloc_in): Remove unused variable. + * ieee.c (ieee_write_id): length can never be negative. + (read_id): Likewise. + (ieee_archive_p): Remove unused variable. + * libcoff-in.h (bfd_perform_slip): Declare. + * libcoff.h: Rebuilt. + * oasys.c (oasys_write_sections): Remove zero initialization of + static structure. + * reloc16.c: Indentation change. + +Wed Oct 27 16:51:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in, config/i386-mach3.mt: Update for new configuration + (--with-targets and so on). + * hosts/i386mach3.h: Declare errno. + * targets.c: Declare i386mach3_vec. + +Wed Oct 27 12:18:07 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmcode.h (nlm_swap_auxiliary_headers_in, + nlm_swap_auxiliary_headers_out): Handle sharedDebugRecordOffset + and sharedDebugRecordCount fields. + +Tue Oct 26 16:21:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * targets.c (target_vector): Remove SCO_CORE. On Sep 11 1993, + we started using trad-core.c for SCO instead. + + * targets.c (target_vector): Re-enable generic ELF and NLM targets. + +Tue Oct 26 16:53:12 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (assign_file_position_for_section): Align sh_offset to + sh_addralign (this is what UnixWare does, and it shouldn't hurt). + +Tue Oct 26 10:16:54 1993 Ken Raeburn (raeburn@cygnus.com) + + From Jeff Law and Pete Hoogenboom at Utah: + + * elf32-hppa.h (hppa_elf_stub_finish): Add prototype. + (ELF32_HPPA_R_ARG_RELOC): Renamed without the ELF32 prefix + and moved into libhppa.h. All references changed. + (ELF32_HPPA_R_CONSTANT, ELF32_HPPA_R_ADDEND): Likewise. + (get_opcode and opcode defines): Move into libhppa.h + * elf32-hppa.c (hppa_elf_insn2fmt): Rename and move info + libhppa.h. + * libhppa.h (HPPA_R_*): Moved here. Reformatted slightly to make + for easier reading. + (get_opcode): Moved here. FIXME! this really should be a C function + inside the opcode library! + (bfd_hppa_insn2fmt): Likewise. + + * targets.c (target_vector): Enable elf32-hppa vector. + + * elf32-hppa.c (hppa_elf_get_section_contents): Add new comments + and clarify existing comments. Do not use DEFUN to declare this + function. Fix numerous indention problems. Correctly handle cases + where symbol extension section may need to be read from disk, + read from memory, or built then read from memory. + + * elf32-hppa.h: Reformat with gnu-indent and hand fix numerous + formatting and indention problems gnu-indent can not handle. + Clarify some comments about relocation types. Comment basic + relocation "classes". Group PARAM declarations together. + (HPPA_SXT_{NULL, SYMNDX, RG_RELOC}): Make members of a new + enumerated type rather than #defines. + +Tue Oct 26 02:40:46 1993 Stu Grossman (grossman at cygnus.com) + + * som.c (hppa_object_setup): Set SEC_CODE for .text section so + that GDB can figure out text_start and text_end. + +Mon Oct 25 16:05:23 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Fix up warnings from gcc -Wall: + * coffgen.c (coff_print_symbol): Use %lx and cast n_value to + unsigned long. Use %ld for tagndx. Use %lx for offset + vma and + cast it to unsigned long. + * ecoff.c (ecoff_emit_aggregate): Use %ld. + (ecoff_print_symbol): Use %ld, and cast indx and sym_base to long. + * coffcode.h (dummy_reloc16_estimate): Specify return type. + + * libbfd.c (bfd_write): If not everything is written out, set + bfd_error to system_call_error. If the return value is + non-negative, set errno to ENOSPC (if ENOSPC is defined). + (bfd_seek): If the seek fails, set bfd_error to system_call_error. + (bfd_generic_set_section_contents): For a bad offset + count, set + bfd_error to bad_value. + * seclet.c (rel): Don't abort. Instead, return false. + +Mon Oct 25 09:59:37 1993 Ken Raeburn (raeburn@cygnus.com) + + * aoutx.h (reloc_type_lookup): Handle BFD_RELOC_SPARC_WDISP22. + +Fri Oct 22 20:35:54 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * config.bfd: handle mips*-* instead of mips-*, use mips*el + instead of mips-*-*l + +Fri Oct 22 14:03:33 1993 Mark Eichin (eichin@cygnus.com) + + * m68k-lynx.mt, i386-lynx.mt (TDEFINES): set + FPRINTF_ALREADY_DECLARED because the objdump.c declaration of + fprintf collides with the native one. + +Fri Oct 22 11:50:25 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * targets.c (target_vector): Enable MIPS ELF vectors. + +Fri Oct 22 07:51:51 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Use bigmips for mips-sony-bsd*. + + * configure.host, config.bfd: Add * to end of all OS names. + +Thu Oct 21 12:16:26 1993 Ken Raeburn (raeburn@cygnus.com) + + * elfcode.h (FILE_ALIGN): Renamed from EALIGN, to avoid conflict + with Ultrix header files. + + * som.h (struct som_section_data_struct): Renamed from + som_section_data to avoid conflict with macro by that name. + + Changes from Jeff Law and Peter Hoogenboom at Utah: + + * elf32-hppa.c (hppa_elf_reloc): Target register for a 'jump + in delay slot' optimization in combination with a long call + stub should always be r31. + + * elf32-hppa.c: (hppa_elf_relocate_insn): To be consistent + across all relocation types, retrieve instruction addends from + the relocation entry rather than from the instruction itself. + + * elf32-hppa.c: (hppa_elf_relocate_insn): Fix a relocation + error that only occurred when the addend of an 'addil' or + 'ldil' was larger than 21 bits and very close to a 2K byte + boundary. + + * elf32-hppa.c: (hppa_elf_reloc): Handle the optimization in + which a jump is placed in the delay slot of a function call. + The jump was being accomplished via an adjustment to the + return pointer. This optimization would break the long call + stub code, if there was any. + + * elf32-hppa.c: (hppa_elf_build_long_branch_stub): Corrections + to long branch stubs to avoid use of general register 2. + + * hppa_stubs.h: New stub instructions. + + * elfcode.h: Declare bfd_elf_find_section. + + * som.h (som_section_data): Add new "subspace_index" field. + + * som.c (setup_sections): Save the original SOM subspace index + in the BFD section associated with that subspace. + (som_get_symtab_upper_bound): Implement. + (som_get_symtab): Implement. + (som_print_symbol): Implement. + (som_slurp_string_table): New function to read a string table + from a SOM object file. + (som_section_from_subspace_index): New function to return the + section which corresponds to a SOM subspace index. + (som_slurp_symbol_table): New function to read the symbol + table from a SOM object file. + (som_make_empty_symbol): Check for errors from bfd_zalloc. + (som_new_section_hook): Initialize subspace_index field to + -1 instead of 0. + + * som.c (som_object_setup): Fix polarity of test to set HAS_RELOC. + Set EXEC_P for executables. + (setup_sections): Correctly identify when a section has + relocations. + (log2): New function. + (setup_sections): Correctly convert between SOM alignments and BFD + alignments. + + * som.c (setup_sections): Do not set SEC_ALLOC or SEC_LOAD + for sections which correspond to SOM spaces, doing so confuses + many utilities. Set assorted SEC_* flags for SOM subspaces + which correspond to BFD sections. + + * elf32-hppa.c: (elf32_hppa_backend_fake_sections): The stab + string table should have sh_type == SHT_STRTAB. Add + processing to make it so. + + * elfcode.h: (bfd_section_from_shdr): String tables (other + than .strtab) were not getting the file offsets recorded, so + they could not be read from disk. + + * elfcode.h: (elf_make_sections): Leave the sh_addr field of + the section header and the vma field of a section at 0 if the + section is not part of the program execution image. (e.g., + .stab) + + * som.[hc]: Change target vector prefix from "hppa" to "som". + Consistently use obj_som prefix to access fields in backend data + structures. Fix all callers/references. + + * som.h: Do not include files only needed for core file reading here. + Include a.out for both HOST_HPPAHPUX and HOST_HPPABSD. Delete + forward structure declarations, they are unnecessary. + (struct somdata): Delete aux_hdr, and hp_symbol_entry_size fields. + Change "symbols" to "symtab". Add "stringtab" and "reloc_filepos" + fields for future use. Change obj_som_* macros as appropriate. + (som_section_data): New structure to keep SOM specific information + about BFD sections (for future use). + + * som.c: Provide PARAMS declarations for all functions currently + in this file. + (struct container): Delete unwanted structure definition. + (som_object_setup): Add comments. Use som_mkobject to allocate + SOM specific information in the BFD; use information from the + file and (possibly empty) auxiliary headers to initialize this + information. Delete redundant bfd_get_symcount (abfd) "calls". + (setup_sections): Return type is now boolean, fix return statements. + "Fix" handling of BSS like subspaces in the computation of the + containing space's size. If the subspace has relocations, set the + appropriate BFD section flags and record the index into and the + size of the fixup stream. Always return a value. + (som_object_p): Set bfd_error appropriately if errors are detected + from bfd_{read,seek} functions. Handle EXECLIBMAGIC type files. + Do not try to read a non-existant auxiliary header. + (som_mkobject): Flesh out. + (som_section_hook): Allocate space to hold SOM specific information + about sections. + +Thu Oct 21 12:41:34 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + gcc -Wall lint: + * coff-h8300.c, coffcode.h: Change shrink parameter + in *_reloc16_estimate to unsigned to match prototype. + * archive.c: Avoid "/*" in comment. + +Thu Oct 21 13:05:16 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * dep-in.sed: Create our own line breaks for a more aesthetic + Makefile. + * Makefile.in: Rebuilt dependencies. + + * elf32-mips.c: Include "seclet.h". + (mips_elf_fake_sections): Force size of .reginfo section to sizeof + Elf32_External_RegInfo. + (mips_elf_seclet_link): New function. Link the .reginfo section + specially, and pass everything else to the generic routine. + (bfd_elf32_bfd_seclet_link): Define macro. + * elf32-target.h: If bfd_elf32_bfd_seclet_link is already defined, + don't override it. + +Wed Oct 20 12:22:37 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libnlm.h (nlm_backend_data): Added signature field. + (nlm_signature): New macro. + * nlmcode.h (nlm_object_p, nlm_write_object_contents): Use the NLM + signature from the backend rather than the constant NLM_SIGNATURE. + * nlm32-i386.c (nlm32_i386_backend): Initialize signature field. + + * aoutf1.h (MACHTYPE_OK): Accept M_UNKNOWN. + (NAME(sunos,set_arch_mach)): Treat M_UNKNOWN as 68000, not 68020. + +Wed Oct 20 10:28:27 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/i386bsd.h [__bsdi__]: Define HOST_DATA_START_ADDR. + +Wed Oct 20 10:10:07 1993 Ken Raeburn (raeburn@cygnus.com) + + * Makefile.in (HFILES): New variable, for use in "make dep". + (.dep): Depend on $(CFILES) and $(HFILES). Delete .dep1 and + remake it, so that "$?" is complete. + (.dep1): Don't need to remove .dep1 first. + (dep.sed): Depend on config.status, not Makefile. + (CFILES): Add nlm.c. + +Tue Oct 19 15:26:26 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-alpha.c: Implemented reloc handling for the linker, made + various other related changes. + * libecoff.h (ecoff_backend_data): Added rdata_in_text field. + Renamed finish_reloc to adjust_reloc_in. Added adjust_reloc_out + field. + (ecoff_bfd_get_relocated_section_contents): Don't define. + * ecoff.c (ecoff_sec_to_styp_flags, ecoff_styp_to_sec_flags): + Handle .lita section. + (ecoff_slurp_reloc_table): Handle RELOC_SECTION_FINI. + finish_reloc backend field renamed to adjust_reloc_in. + (ecoff_bfd_seclet_link): Adjust number of aux entries to + debug_align boundary. + (ecoff_compute_section_file_positions): If rdata_in_text put + .rdata section in text segment, not data segment. Put .pdata + section in text segment. + (ecoff_write_object_contents): Likewise. Also, call + adjust_reloc_out, and handle .lita, .xdata, .pdata, .fini and + absolute sections when writing out relocs. + * coffswap.h (coff_swap_aouthdr_out): For ALPHAECOFF, output 2 for + bldrev field, as on Alpha OSF/1. Padding field is now 2 bytes. + * coff-mips.c (mips_ecoff_swap_reloc_out): Added assertion. + (mips_adjust_reloc_in): Renamed from mips_finish_reloc. + (mips_adjust_reloc_out): New function (does nothing). + (mips_ecoff_backend_data): Initialize new fields. + (ecoff_bfd_get_relocation_section_contents): Define to be + bfd_generic_get_relocated_section_contents. + + * reloc.c (bfd_perform_relocation): Added casts to avoid Alpha + OSF/1 cc bug. + +Thu Oct 14 01:10:35 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * reloc.c (bfd_perform_relocation): Add comments attempting to + explain PC relative relocations. + + * coffcode.h (styp_to_sec_flags): Don't set SEC_DEBUGGING until it + is made to work. + (coff_compute_section_file_positions): Remove check for + USE_DISCARDED_SECTIONS_COUNT. + * coff-i386.c: Don't define USE_DISCARDED_SECTIONS_COUNT. Basing + it on host defines is wrong. + + * ecoff.c (ecoff_bfd_seclet_link): Don't link a .reginfo section. + (ecoff_write_object_contents): Don't require the .reginfo section + to be a particular size. + +Wed Oct 13 18:39:03 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * Makefile.in (dep-in): New rule, for editing dependencies into + Makefile.in in $(srcdir). Use move-if-change. + (.dep1, dep): Use move-if-change. + (CFILES): Add coff-apollo.c. + + Sun Oct 10 18:02:56 1993 Troy Rollo (troy@cbme.unsw.EDU.AU) + + * Makefile.in: Recognise new file, coff-apollo.o + + * coff-apollo.c: New file + + * coffcode.h: Recognise apollo magic numbers and writable text + + * coffswap.h: Swap Apollo optional header entries + + * config.bfd: Add line for Apollo + + * configure.host: Replace apollo68b and apollo68v with Apollo + + * configure.in: Recognise apollocoff_vec + + * targets.c: Likewise + + * config/apollo.mh, config/apollo.mt: New files + + * hosts/apollo68.h: Remove inclusion of strings.h + +Wed Oct 13 14:28:17 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * coff-i386.c (i3coff_object_p): Now static. + + * Makefile.in: Updated dependencies. + (.dep, .dep1, dep.sed): New targets, to make "make dep" work + better. + * dep-in.sed: New file. + + * m68klynx-cf.c (ONLY_DECLARE_RELOCS): Define, to avoid name + conflicts when "--with-targets=all". + * coff-m68k.c (m68kcoff_howto_table, m68k_rtype2howto, + m68k_howto2rtype): Rename via macros to keep namespace clean. + * configure.in: For m68klynx_coff_vec, include coff-m68k.o for + now. + +Tue Oct 12 17:03:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-mips.c: Extensive additions to do relocations and to + handle MIPS specific sections. + * libelf.h (elf_backend_data): Pass fourth argument to + elf_backend_section_from_bfd_section to permit it to control the + section index to use. + (elf_obj_tdata): Add gp and gp_size fields. + (elf_gp, elf_gp_size): New accessor macros. + * elfcode.h: Removed a number of unused local variables. + (elf_fake_sections): Clear section header before calling + elf_backend_fake_sections, not after. + (prep_headers): Return true at end. + (elf_section_from_bfd_section): Pass retval argument to + elf_backend_section_from_bfd_section. + * elf32-hppa.c (elf32_hppa_backend_section_from_bfd_section): + Accept and ignore new retval argument. + * bfd.c: Include libelf.h. + (bfd_set_gp_size): Handle ELF targets. + * Makefile.in (bfd.o): Depends upon libelf.h. + (elf32-mips.o): Depends upon $(INCDIR)/elf/mips.h. + +Mon Oct 11 17:25:18 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_mkobject): Check bfd_make_section return value. + (ecoff_mkobject_hook): New function. + (ecoff_new_section_hook, ecoff_sizeof_headers, + ecoff_compute_section_file_positions, ecoff_set_section_contents, + ecoff_write_object_contents): Handle dummy REGINFO section. + (ecoff_get_section_contents): New function to handle reading + REGINFO section. + * libecoff.h (ecoff_get_section_contents): Change from macro + definition to function prototype. + (ecoff_mkobject_hook): New prototype. + * coff-alpha.c (alpha_ecoff_mkobject_hook): Removed. + (alpha_ecoff_backend_data): Use ecoff_mkobject_hook. + * coff-mips.c (mips_ecoff_mkobject_hook): Removed. + (mips_ecoff_backend_data): Use ecoff_mkobject_hook. + +Fri Oct 8 15:25:33 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * libbfd.c (bfd_get*32, bfd_get*64): Prevent ANSI sign extension + by casting the most significant byte to bfd_vma. + +Fri Oct 8 02:34:21 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * configure.in: Do not define SELECT_VECS, SELECT_ARCHITECTURES + if configuring --with-targets=all. + +Thu Oct 7 17:34:07 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * aoutx.h (howto_table_std): Correct the "size" field in some + entries. + + * reloc.c (reloc_howto_type): Change documentation to dispel any + notion that the "size" field is a power-of-two indicator. + +Thu Oct 7 10:50:38 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * coffswap.h: (bfd_swap_reloc_in): a symndx is signed. + + Make support for relaxing more generic. + * reloc16.c: Add new target entry - bfd_coff_reloc16_estimate, + fix bit rot. + * libcoff.h, libcoff-in.h: declarations. Prototypes + * coffcode.h (bfd_coff_std_swap_table): Add calls to + coff_reloc_16_extra_cases and coff_reloc16_estimate. + (dummy_reloc16_estimate): New function. + * coff-h8300.c (h8300_reloc16_estimate): New function + +Thu Oct 7 14:24:13 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elfcode.h (EALIGN): Define, dependent on ARCH_SIZE. + (align_file_position): New function. + (elf_locate_sh): Disabled function deleted. + (assign_file_positions_for_symtab_and_strtabs): Align position, + then place symtab, then do other sections. + (map_program_segments): Align program header. + (assign_file_positions_except_relocs): Align section headers. + (assign_file_positions_for_relocs): Align relocation sections. + +Tue Oct 5 10:44:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.host: Recognize hppa*-*-hiux* (currently synonym for hpux). + Change other hppa entries to use -*- not -hp-. + * config.bfd: Recognize hppa*-*-hiux* (currently synonym for hpux). + + * coff-rs6000.c, cpu-rs6000.c, rs6000-core.c: Change non-ASCII + characters in comment to octal escapes. + +Sun Oct 3 12:35:15 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * coff-i386lynx.c: Removed, name too long. + * i386lynx-cf.c: New file, was coff-i386lynx.c. + * configure.in: Reflect file name changes. + * Makefile.in: Mention Lynx-related files. + + * i386lynx.c (lynx_32_swap_ext_reloc_in): get reloc bits in i386 + Lynx-specific way. + + * m68klynx-cf.c: New file, defines coff format for M68K LynxOS. + * m68klynx.c: Remove coff vector definition, now in m68klynx-cf.c. + + * coffcode.h (sec_to_styp_flags): Set section flag to STYP_INFO + for .stab, .stabstr and .debug sections, and set SEC_DEBUGGING for + sections of type STYP_INFO. (from Minh Tran-Le) + (coff_compute_section_file_positions): Add discarded_sections_count + to abfd->section_count, which helps `strip' keep the size + of the executable header constant. + * coff-i386.c (discarded_sections_count): New variable, initialized + to zero. For use by `strip'. Currently being used only in aix386 + coff, but may be useful for other coff systems. (from Minh Tran-Le) + + * coffswap.h (coff_swap_filehdr_out): Added a missing cast. + + * archive.c: Cosmetic improvements. + * opncls.c: Cosmetic improvements. + (new_bfd): Removed redundant structure slot init. + +Sat Oct 2 18:48:17 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config/news-mips.mh, hosts/news-mips.h: New files. + * configure.host: Use news-mips for mips-sony-bsd*. + +Fri Oct 1 13:14:17 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * configure.in: i386lynx_coff_vec requires coff-i386lynx.o. + * coff-i386lynx.c: New file, defines Lynx target vector and name, + includes coff-i386.c. + * coff-i386.c (i386coff_vec): Allow redefinition of target vector + symbol and name, if TARGET_SYM and/or TARGET_NAME are defined. + * i386lynx.c: Remove coff vector definition entirely. + (lynx_32_swap_ext_reloc_in): Define. + (lynx_32_swap_std_reloc_in): Define, get reloc bits in i386 + Lynx-specific way. + (lynx_32_swap_ext_reloc_out): Define. + (lynx_32_swap_std_reloc_out): Define. + (lynx_32_slurp_reloc_table): Define, call Lynx swapping fns. + (lynx_32_squirt_out_relocs): Define, call Lynx swapping fns. + (lynx_32_canonicalize_reloc): Define, call Lynx swapping fns. + (WRITE_HEADERS): Define, call Lynx swapping fns. + + * config/i386-lynx.mt (SELECT_VECS): Remove redundant vector. + +Thu Sep 30 17:50:52 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * reloc.c (bfd_reloc_code_type): Add linkage-table relative + relocations of size 8, 16, 32. Sort generic relocs by type rather + than size. Added a little documentation too. + + * aoutx.h (howto_table_std): Add BASE16 and BASE32 relocs. + (TABLE_SIZE): New macro. + (reloc_type_lookup): Handle BFD_RELOC_{16,32}_BASEREL for std + relocs. + (swap_std_reloc_out): Write baserel relocs correctly. + (swap_std_reloc_in): Handle r_baserel field. Assert that + r_jmptable and r_relative fields are clear, and that the computed + index does refer to a defined entry of the howto table. + +Tue Sep 28 14:47:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * section.c (bfd_make_section_anyway): New function. + * section.c: Change comments to say several sections can have + the same name. + * bfd-in2.h: Re-generate to reflect above change. + * coffgen.c (make_a_section_from_file): Call bfd_make_section_anyway + if still no section after the bfd_coff_make_section_hook. + * coffcode.h: Add comment about TWO_DATA_SECS. + +Tue Sep 28 03:22:24 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * ecoff.c (ecoff_slurp_symbolic_info): Always determine raw_size + explicitly. + * ecoff.c (ecoff_sec_to_styp_flags, ecoff_styp_to_sec_flags): Handle + .fini section. + +Mon Sep 27 18:29:18 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * config.bfd configure.host: Match on *-lynxos* for LynxOS, + add m68*-*-lynxos*. + * configure.in : Replaced i386lynx_vec with i386lynx_aout_vec + and i386lynx_coff_vec. + Added m68klynx_aout_vec and m68klynx_coff_vec. + * targets.c (target_vector): Removed i386lynx_vec, added + {i386,m68k}lynx_{aout,coff}_vec. + * i386lynx.c: Added copy of i386coff.c, renamed bfd target to + i386lynx_coff_vec. + * m68klynx.c: New file. + * config/i386-lynx.mt: Replaced i386lynx_vec with i386lynx_aout_vec + and i386lynx_coff_vec. + * config/m68k-lynx.mt: New file. + * hosts/i386lynx.h: Added definition of cfree as free (from Eichin). + * hosts/m68klynx.h: New file. + +Mon Sep 27 18:00:41 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * archive.c: Define offsetof here. + * hosts/*.h: Don't define it here. + +Mon Sep 27 19:09:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (bfd_section_from_shdr): Set filepos for SHT_STRTAB + section. + +Fri Sep 24 15:47:40 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hpux-core.c: Add comment about hpux version 7. + +Fri Sep 24 16:50:26 1993 Stu Grossman (grossman at cygnus.com) + + * lynx-core.c (lynx_core_file_p): Change per-thread register + section names from .regXXX to .reg/XXX to avoid parsing ambiguity + in gdb/corelow.c. Create alias .reg section for the currently + running thread. + +Fri Sep 24 13:22:32 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libecoff.h (ecoff_backend_data): Removed big_magic and + little_magic fields. + * coff-alpha.c (alpha_ecoff_backend_data): Removed initialization + of big_magic and little_magic. + * coff-mips.c (mips_ecoff_bad_format_hook): Make sure magic number + matches endianess of bfd. + (mips_ecoff_backend_data): Removed initialization of big_magic and + little_magic. + * ecoff.c (ecoff_set_arch_mach_hook): Set MIPS machine number + based on magic number. Support r4000 magic numbers. + (ecoff_get_magic): New function. + (ecoff_write_object_contents): Use ecoff_get_magic, not fields in + the backend structure. + * cpu-mips.c (arch_info_struct): Added case for r6000. + + For MIPS configurations put both big and little endian versions in + the list of targets; the code is getting compiled in anyhow. + * bigmips.mt (SELECT_VECS): Define to be ecoff_little_vec. + * decstation.mt (SELECT_VECS): Define to be ecoff_big_vec. + * mipsbelf.mt (SELECT_VECS): Define to be bfd_elf32_littlemips_vec. + * mipslelf.mt (SELECT_VECS): Define to be bfd_elf32_bitmips_vec. + * riscos.mt (SELECT_VECS): Define to be ecoff_little_vec. + +Fri Sep 24 00:42:23 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * osf-core.c: New file for OSF/1 core file support. + * config/alphaosf.mh (HDEFINES): Add -DOSF_CORE. + (HDEPFILES): Set to osf-core.o. + * bfd-in2.h (union tdata): Add osf_core_data member. + * targets.c: If OSF_CORE is defined, add osf_core_vec to target list. + * Makefile.in (OPTIONAL_BACKENDS): Add osf-core.o. + (osf-core.o): New dependency. + +Thu Sep 23 21:04:53 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * TODO: Remove note about making --with-bfd-targets use canonical + target configuration name (already done); reword item about + separating reading and writing stuff to not refer to a + non-existent item. + + * ecoff.h (ecoff_set_arch_mach_hook): Accept MIPS_MAGIC_LITTLE2 + and MIPS_MAGIC_BIG2. + +Thu Sep 23 11:06:34 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * gen-aout.c (main): Output newline after end of comment, not + before. (Reported by Jonathan Stone, + jonathan@oscar.stanford.edu). + +Thu Sep 23 10:48:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * archive.c (compute_and_write_armap): Put weak symbols in the + armap. + + * elfcode.h (fix_up_strtabs): Set sh_entsize for the .stab + section, not the .stabstr section. Set the type of the .stabstr + section to SHT_STRTAB. + (elf_section_from_bfd_section): Handle SHT_STRTAB sections. + + * section.c (SEC_DEBUGGING): New section flag. + * elfcode.h (bfd_section_from_shdr): If section is SHT_PROGBITS, + and the name starts with .debug, .line or .stab, set + SEC_DEBUGGING. If SHT_STRTAB, check for .debug and .stab. + * elf32-target.h (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Added + SEC_DEBUGGING to section_flags. + * elf64-target.h (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Added + SEC_DEBUGGING and SEC_CODE to section_flags. + * bfd-in2.h: Updated. + +Wed Sep 22 16:34:14 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bfd.c (tdata): Add lynx_core_data. + + * ecoff.c (ecoff_compute_section_file_positions): Set filepos for + sections with SEC_LOAD set, even if SEC_HAS_CONTENTS is clear. + (ecoff_write_object_contents): Don't set scnptr to zero just + because size of section is zero. Needed for Irix 4.0.5F. + +Wed Sep 22 09:49:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Use i960-bout, not i960-coff for i960-*-nindy*. + +Wed Sep 22 07:34:09 1993 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (OPTIONAL_BACKENDS): Add lynx-core.o. + * bfd-in2.h (tdata): Add lynx_core_data; + * config.bfd configure.host: Get rid of superfluous netbsd and + lynxos entries. + * configure.in: Add lynx-core.o to Lynx config. + * i386lynx.c: Add defs for core file support. + * lynx-core.c: New file with Lynx core file support. + * hosts/i386lynx.h: Move lots of host specific includes to here. + Add def of HOST_LYNX. Remove unnecessary defs. + +Mon Sep 20 19:18:10 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (bfd_section_from_shdr): Only set SEC_DATA for a + SHF_PROGBITS or SHT_STRTAB section if SEC_ALLOC is set. Never set + SEC_DATA for a SHF_NOBITS section. + + * nlm32-i386.c (nlm_i386_mangle_relocs): Check SEC_LOAD rather + than SEC_CODE | SEC_DATA. Add some casts to avoid warnings. + * nlmcode.h: Add some casts to avoid warnings. + (nlm_write_object_contents): Ignore relocs for sections that are + neither code nor data. Just use the symbol value for debugging + symbols; don't offset by the section vma. + +Fri Sep 17 18:08:55 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * reloc.c (bfd_perform_relocation): Don't return an error when + performing a reloc against an undefined weak symbol. + * syms.c (bfd_print_symbol_vandf): Show value of BSF_WEAK rather + than obsolete BSF_EXPORT. + +Fri Sep 17 02:04:31 1993 John Gilmore (gnu@cygnus.com) + + * hosts/{alphaosf.h, amix.h, apollo68.h, apollov68.h, + decstation.h, delta88.h, dgux.h, dose.h, go32.h, harris.h, + hp300.h, hp300bsd.h, hppabsd.h, hppahpux.h, i386aix.h, i386bsd.h, + i386linux.h, i386lynx.h, i386v.h, i386v4.h, irix3.h, irix4.h, + mipsbsd.h, ncr3000.h, rs6000.h, rtbsd.h, solaris2.h, sparc-ll.h, + std-host.h, stratus.h, sun3.h, sysv4.h, tahoe.h, ultra3.h, + vaxult.h, vaxult2.h, we32k.h}: Make sure that "offsetof" is + defined on all hosts, now that archive.c uses it. + +Thu Sep 16 18:20:30 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_map_symbols): Create section symbols for all + sections, not just allocated sections; debugging sections can have + relocs. + (elf_symbol_from_bfd_symbol): If there is an output section, use + the section index from that rather than the input section. + +Thu Sep 16 12:20:50 1993 Ken Raeburn (raeburn@cygnus.com) + + * libbfd-in.h (bfd_flush, bfd_stat): Reflect John's changes to + libbfd.h, which is regenerated from this file. + + * bfd-in.h (symtype): Deleted typedef. + +Wed Sep 15 11:48:37 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libbfd.c (COERCExx): Cast x to bfd_signed_vma before doing the + xor and subtract. Otherwise it will not sign extend if the type + of bfd_vma is larger than int. + + * ecoffswap.h (ecoff_swap_pdr_in): Get regoffset, iopt, fregoffset + and frameoffset as signed numbers. From Peter Schauer. + +Tue Sep 14 18:20:36 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-i386.c (elf_howto_table): Add bfd_elf_generic_reloc + special function for all reloc entries. + * elf32-target.h (TARGET_LITTLE_SYM): Add SEC_CODE to + section_flags. + * libelf.h (elf_symbol_type): Remove desc, type and other fields. + * Makefile.in (elf32-*.o): These depend upon elf32-target.h. + +Tue Sep 14 14:34:45 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * libbfd-in.h (struct artdata): Add armap_timestamp and + armap_datepos here too. + +Mon Sep 13 21:03:18 1993 John Gilmore (gnu@cacophony.cygnus.com) + + Improve timestamp support in BSD archive files to avoid linker + warnings. + + * libbfd.h (struct artdata): Add armap_timestamp and armap_datepos. + (bfd_flush, bfd_stat): Add prototypes. + * libbfd.c (bfd_flush): Add, does fflush on a BFD. + (bfd_stat): Add, does fstat on a BFD. + + * archive.c (_bfd_write_archive_contents): At end of file writing, + verify and possibly update the timestamp in the armap, if a BSD + archive. FIXME! Kludge recognizes BSD archive, rather than + vectoring properly. Should add to xvec. + (compute_and_write_armap): Move prototype to top, avoid PROTO. + (bsd_write_armap): Save timestamp and file location thereof, when + writing the armap in a BSD file. + (bsd_update_armap_timestamp): New function to check and + rewrite the timestamp. + + * hosts/std-host.h (offsetof): Define, if not already, for archive.c. + +Sat Sep 11 18:13:42 1993 Jim Kingdon (kingdon@poseidon.cygnus.com) + + * hosts/i386sco.h: Define a bunch of stuff for core files. + * sco-core.c: Remove, replace by trad-core.c. + * trad-core.c: If HOST_STACK_START_ADDR is defined, use it. + * config/i386sco.mh: Use trad-core not sco-core. + * hosts/i386isc.h, config/i386isc.mh: Remove. + * configure.host: Use i386sco for isc. + * config/i386-sco.mt: Remove, identical to i386-coff.mt. + * config.bfd: Use i386-coff not i386-sco. + + * config.bfd: Recognize i[34]86-*-solaris2* specifically rather + than using *-*-solaris2* (i486-unknown-solaris2 is i386-elf, not + i486-elf which doesn't exist). + +Fri Sep 10 12:56:36 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffswap.h (coff_swap_aouthdr_out): For ALPHAECOFF, force + padding field to zero. + + * config.bfd (i[34]86-*-netbsd*): New target; use i386-netbsd. + * configure.in: Remove bogus netbsd386 handling. + + * coff-mips.c: Don't warn about overflow for MIPS_R_JMPADDR reloc. + Correct overflow detection requires matching the upper four bits + of the destination against the PC. + +Thu Sep 9 16:57:46 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in: Make 64-bit stuff work with "--with-targets=all". + +Tue Sep 7 14:17:02 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libbfd-in.h: Removed swapping routines declarations. + * bfd-in.h: Added swapping routine declarations, and renamed them + from _do_* to bfd_*. + * libbfd.c: Renamed swapping routines from _do_* to _bfd_*. + * Changed all callers. + * libbfd.h, bfd-in2.h: Rebuilt. + +Mon Sep 6 15:28:07 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-i386.c (elf_howto_table): Set pcrel_offset to true for + R_386_PC32. + +Fri Sep 3 13:06:12 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in: Reorganized setting of makefile variables so + 64-bit stuff works again. + + * libbfd-in.h (_do_get*, _do_put*): Renamed via macros to clean up + namespace. + + * libelf.h (elf32_symbol_type, elf64_symbol_type): Deleted + "native_elf_sym" field, merged to make new type "elf_symbol_type". + (struct elf_obj_tdata): Field symbols is now elf_symbol_type*. + Deleted field raw_syms. + (obj_symbols): Remove cast. + (obj_raw_syms): Deleted. + * elfcode.h (elf_slurp_symbol_table): Don't set raw_syms or + native_elf_sym fields. + * elf32-hppa.c: Changed uses of elf32_symbol_type to + elf_symbol_type. + + From Pete Hoogenboom and Jeff Law: + + * elf32-hppa.c (ELF_MAXPAGESIZE): Define. + + * elf32-hppa.c (elf_hppa_tc_symbol): If the argument relocation + bits are zero (e.g., they specify no relocations), then do not + even bother adding their entries to the symextn section. + + * elf32-hppa.c (elf_hppa_tc_symbol): Any function, regardless + of scope can have an argument relocation stub. + + * elf32-hppa.c: (Elf32_hppa_Stub_description): Rename this + structure and type to elf32_hppa_stub_description. This makes + it consistent with the GNU coding conventions. + (elf32_hppa_stub_description): Added a 'next' field to allow + linking of stub description structures. + (elf32_hppa_stub_description): Added a 'stub_listP' field to + keep track of individual stubs. + (Elf32_hppa_Stub_list, Elf32_hppa_Stub_list_struct): Removed. + Combined with the elf32_hppa_stub_description structure. + (elf32_hppa_stub_name_list): New type to keep track of + individual stubs. + (add_stub): Removed. + (add_stub_by_name): New function. + (find_stub_by_name): New function. + (hppa_elf_build_arg_reloc_stub): Allow reusing stubs that + already exist. + (hppa_elf_build_long_branch_stub): Allow reusing stubs that + already exist. + + * elf32-hppa.c: (retval_mismatches): The direction of argument + relocation was reversed. + (hppa_elf_build_arg_reloc_stub): Return address was not being + restored. + (hppa_elf_arg_reloc_needed_p): Add argument containing caller + argument relocation bits so this function can be used in the check + for plabel stubs. + (hppa_elf_stub_check): Pass caller argument relocation bits into + hppa_elf_arg_reloc_needed_p(). + (hppa_look_for_stubs_in_section): Add check for plabel stubs and + pass caller argument relocation bits into + hppa_elf_arg_reloc_needed_p(). + +Thu Sep 2 00:59:55 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * libhppa.h (hppa_field_adjust): Remove unused `init_value' variable. + + * hosts/delta88v4.h: New for SVR4. + * configure.hosts: Use it. + +Wed Sep 1 14:23:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * libaout.h, netbsd386.c: Change M_I386 to M_386_NETBSD. M_I386 + is an SCO pre-define. + +Tue Aug 31 12:50:19 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmcode.h (nlm_object_p): Set HAS_SYMS if there are external + references. + (nlm_swap_auxiliary_headers_{in,out}): The copyright length is + only one byte. + (nlm_get_symtab_upper_bound): Include debugging symbols in symbol + count. + (nlm_slurp_symbol_table): Make symlength unsigned. Read debugging + symbols as BFD local symbols. + (nlm_write_object_contents): Don't bother writing out exported + symbols more than once; they now appear in the symbol table more + than once (with and without a prefix) if necessary. Set offset + values to be non-zero as NLMLINK does. + +Tue Aug 31 12:07:43 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * libhppa.h: Restore #undefs of e_fsel and other e_* symbols. + +Fri Aug 27 16:43:35 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * section.c (struct sec): Move position of user_set_vma, and + document it. + (SEC_BALIGN): Disable for now. I don't think it's currently used. + + * elf32-hppa.c (elf_hppa_howto_table): Now static. + (symext_rootP, symext_lastP, global_value, GOT_value, + global_symbol, global_sym_defined, symextn_contents, + symextn_contents_real_size, elf_hppa_stub_rootP, + elf32_hppa_symextn_map, elf32_hppa_symextn_map_size): Rely on + default initialization. + (hppa_elf_gen_reloc_type): Macro "UNDEFINED" doesn't need a + trailing semicolon. + (hppa_look_for_stubs_in_section): Introduce temporaries to make + code more readable in 80 columns. + + * libhppa.h (all functions): Now inline under GNU C. + + More patches from Jeff Law: + + * elf32-hppa.c (AR_WARN): Give argument which caused the + invalid argument relocation. + (AR_UNIMP): Delete unused macro. + (hppa_elf_set_section_contents): Always return a value. + (elf32_hppa_backend_table_processing): Likewise. + (elf32_hppa_backend_section_processing: Likewise. + + * som.c: New file containing SOM specific code extracted + from hppa.c + + * som.h: New file containing SOM specific code extracted + from libhppa.h + + * hppa.c: Deleted. + + * libhppa.h: Delete SOM specific code. Add generic PA + code which can be shared by both SOM and ELF backends. + + * Makefile.in: Replace hppa.c with som.c. elf32-hppa.o + depends on libhppa.h now. + + * configure.in (hppa_vec): Needs som.o module instead of + hppa.o. + + * elf32-hppa.c: Include libhppa.h. Do not define + BYTES_IN_WORD. + + * elf32-hppa.h (hppa_reloc_field_selector_type): Delete + now lives in libhppa.h. + (hppa_reloc_field_selector_type_alt): Likewise. + + * hosts/hppabsd.h: Include <stdlib.h> and <unistd.h>. Do not + define malloc or free. + + * config/hppa-elf.mt (SELECT_ARCHITECTURES): Don't define + SELECT_VECS. + + * elf32-hppa.c (hppa_elf_relocate_unwind_table): Delete unused + variables. + (elf_hppa_reloc_type_lookup): Likewise. + (elf_hppa_tc_make_sections): Likewise. + (hppa_elf_arg_reloc_needed_p): Likewise. + (hppa_elf_build_long_branch_stub): Likewise. + (elf_reloc_map): Delete, no longer used. + (elf_hppa_reloc_map): Likewise. + (elf32_hppa_symextn_map_max_size): Likewise. + (elf32_hppa_get_sym_extn): Abort if type is bogus. + + * elf32-hppa.c (elf32_hppa_backend_fake_sections): Add processing + of the .hppa_unwind section. + +Wed Aug 25 16:13:49 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * config.bfd: recognize m88110. + +Tue Aug 24 16:32:35 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + Merged changes from Jeff Law and Pete Hoogenboom at Utah: + + * elfcode.h (elf_section_from_bfd_section): Add detection of + SHT_NOTE sections. + + * elf32-hppa.c: + (hppa_elf_build_long_branch_stub,hppa_elf_long_branch_needed_p): + New functions for support of long branch stubs. + (hppa_elf_stub_check,hppa_look_for_stubs_in_section): Add + check for long branch stubs. + (hppa_look_for_stubs): Unused function. Removed. + (hppa_elf_set_section_contents): Implement a PA/ELF-specific + version of bfd_set_section_contents. + (hppa_elf_long_branch_needed_p): Only output debugging diagnostics + when BFD is configured for debugging. + + * elf32-hppa.c: (elf32_hppa_get_symextn_chain): New function + to return a list of symbols that have non-zero argument + relocation bits. + (hppa_elf_stub_finish): Make sure stub generation is done only + once. + + * elf32-hppa.c: (hppa_elf_stub_reloc): New function for + generation relocation entries within a stub. + (hppa_elf_build_arg_reloc_stub): Corrections to argument + relocation stubs. + + * elf32-hppa.c: New #define's for argument relocation types. + (mismatches, retval_mismatches): Updated to reflect new + argument relocation types. + (CURRENT_STUB_OFFSET): New macro. + + * elfcode.h (map_program_segments): Set the PF_X bit for data + segments. + + * elf32-hppa.c: (elf_hppa_howto_table): Add + R_HPPA_STUB_CALL_17 for support of linker stub generation. + (hppa_elf_reloc): Add support of R_HPPA_STUB_CALL_17 + relocation type. + + * elf32-hppa.h: (elf32_hppa_reloc_type): Add + R_HPPA_STUB_CALL_17 for support of linker stub generation. + + * hppa_stubs.h: Add new instructions that are used in linker + stub generation. + + * elf32-hppa.c (hppa_elf_relocate_unwind_table): The offsets in an + unwind descriptor were incorrect. + + * libelf.h (bfd_elf_find_section): Declare. + + * elf32-hppa.c: (elf32_hppa_backend_symbol_processing): New + function in place of global_sym field in elf_backend_data + structure. + (elf32_hppa_backend_symbol_table_processing, + elf32_hppa_backend_section_processing, + elf32_hppa_backend_fake_sections, + elf32_hppa_backend_section_from_shdr, + elf32_hppa_backend_section_from_bfd_section): New functions to + provide support of symbol extension sections and argument + relocation stubs. + (elf_info_to_howto): Remove call to abort(). + + * elf32-target.h: Support for special processing by the backend. + (struct elf_backend_data): Added elf_backend_symbol_processing, + elf_backend_symbol_table_processing, + elf_backend_section_processing, elf_backend_section_from_shdr, + elf_backend_fake_sections, and + elf_backend_section_from_bfd_section fields. + * elfcode.h: (bfd_section_from_shdr): Add a check for + processor-specific section types. + (elf_fake_sections): Add a check for processor-specific + section types. + (bfd_elf32_write_object_contents): Add a check to see if + there is any final section processing to be done by the + backend. + (elf_section_from_bfd_section): Add a check for + processor-specific section types. + (elf_slurp_symbol_table): Remove reference to global_sym in the + elf_backend_data structure. Replace it with a call to + elf_backend_symbol_processing. + * libelf.h: Remove global_sym field in the elf_backend_data + structure. Replace it with a series of backend-specific + functions. + + * elf32-hppa.c (hppa_elf_stub_branch_reloc): The formal argument + stub_sym should be called target_sym. + (hppa_elf_build_arg_reloc_stub): Refer to the stub bfd (abfd) + rather than the output bfd (output_bfd). + (hppa_elf_reloc): Get rid of references to the global_sym field in + the elf_backend_data structure. + + * elfcode.h (elf_fake_sections): Check the correct condition for + .bss. Also, detect the existence of a .note section. + + * elf32-hppa.c (hppa_elf_relocate_insn): r_format argument should + have been r_field. + + * hosts/hppabsd.h (HOST_MACHINE_ARCH): Reference to bfd_arch_m68k + should be a reference to bfd_arch_hppa. + + * hppa.c (hppa_vec): Replace bfd_false with _bfd_dummy_target in + the bfd_check_format structure to avoid a type mismatch. + +Mon Aug 23 1993 Sean Fagan (sef@cygnus.com) + and Jim Kingdon (kingdon@cygnus.com) + + Add NetBSD support: + * netbsd386.c: New file. + * aoutx.h: Make sym_is_debugger_info true for N_FN. + * Makefile.in, aout-target.h, config.bfd, configure.host, configure.in, + libaout.h, targets.c: Other changes. + +Fri Aug 20 17:04:59 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config/m88k-elf.mt: New file. + * config.bfd: Use it for m88*-*-sysv4*. + +Fri Aug 20 15:16:58 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elfcode.h (elf_build_phdrs): Unused function deleted. + (bfd_shdr_from_section): Ditto. + (write_relocs): Don't change section contents for addend. + (elf_locate_sh): Return type is now always elf_internal_shdr, + since the other types were really aliases for this type anyways. + Don't compile this function, since it is static and doesn't appear + to be used in this file. + (sym_is_global): Return non-zero for weak symbols. Abort if + section pointer is null. + (swap_out_syms): Reorder tests so function symbols can be weak. + (elf_slurp_symbol_table): Don't use BSF_EXPORT. + (elf_slurp_reloca_table): Make RELOC_PROCESSING section smaller by + extracting out some common code. Abort if BFD section symbol has + null name. + (elf_slurp_reloc_table): Translate ELF section symbols into BFD + section symbols. Don't read section contents to fill in addend + field. + + * elf32-i386.c (elf_howto_table): All partial_inplace fields + should be "true". + + * Merged from OSF: + + Tue Jun 15 14:38:32 1993 Michael Meissner (meissner@osf.org) + + * libelf.h (struct Elf_Sym_Extra): New structure to contain ELF + specific information for a symbol. Put in elf_sym_num, which + gives the external symbol number in the elf object file, since + local symbols must come before global symbols. + (elf_sym_extra): New macro. + (elf_symtab_map): Delete, in favor of using Elf_Sym_Extra. + * elfcode.h (elf_map_symbols): Use Elf_Sym_Extra to map internal + symbol number to external number. Store the address of the + Elf_Sym_Extra field for the symbol in the udata field. + (elf_write_object_contents): Use Elf_Sym_Extra to map out symbols. + + Sun Jun 20 16:30:11 1993 Michael Meissner (meissner@osf.org) + + * elfcode.h (elf_obj_tdata): Add field to count the size of the + array of pointers to section symbols. + (elf_map_symbols): Bump the max index of the section symbols so + that we don't overwrite memory. Store the max index into the + elf_obj_tdata field. + + Sat Jun 19 10:12:27 1993 Michael Meissner (meissner@osf.org) + + * elfcode.h (elf_obj_tdata): Add pointer to an array of pointers + to the section symbols we created. Remove unused field + internal_syms. + (elf_map_symbols): Fill in array of pointers to section symbols. + Only create section symbols for sections that have SEC_ALLOC set, + and have non-zero size. + (elf_symbol_from_bfd_symbol): If udata is NULL, and this is a + section symbol, look up the section in the list of section + symbols, and set the udata pointer appropriately. Otherwise, if + udata is still NULL, fail an assertion, and use 0, instead of + dropping core. + +Fri Aug 20 12:18:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config.bfd (mips-*-elfl*, mips-*-elf*): New targets, using + mipslelf and mipsbelf respectively. + * config/mipslelf.mt, config/mipsbelf.mt: New files. + * elf32-mips.c: Added some reloc information. + * configure.in: Fixed error message. + + * ecoff.c (ECOFF_LONG_SIZE): Removed. Just use constants. + +Thu Aug 19 09:45:51 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * Makefile.in (BFD_LIBS, ALL_MACHINES, BFD32_BACKENDS, BFD64_BACKENDS, + OPTIONAL_BACKENDS): Alphabetize entries and add a few missing ones. + * archures.c: Alphabetize decls. + + * configure.in, targets.c: Add missing vectors to the tables. + * targets.c (target_vector) [!SELECT_VECS]: Add DEFAULT_VECTOR. + Remove hp300bsd_vec due to clash with sunos_big_vec. + +Tue Aug 17 18:12:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/i386{mach3,osf1mk}.h: New files, for Mach hosting. + * hosts/i386mach.h: removed, replaced by i386osf1mk.h. + * config/i386mach3.mt, i386mach3.c: New files, for Mach a.out format. + * Makefile.in, configure.host, config.bfd: Corresponding changes. + * hosts/decstation.h: Include <sys/param.h> not <machine/param.h>. + +Tue Aug 17 15:19:41 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffgen.c (coff_section_symbol): If section's output_section is + not yet set, point to itself. This is needed because this is + called on the output file, not the input file. + + * coff-rs6000.c (dummy_reloc, RTYPE2HOWTO): Set howto field to a + dummy value, rather than leaving it NULL. + + * archures.c (bfd_default_set_arch_mach): Set bfd_error on + failure. + * aoutx.h (NAME(aout,set_arch_mach)): Check return value of + bfd_default_set_arch_mach. + +Tue Aug 17 09:42:16 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * config.bfd (cpu): Extract from canonical name with sed. + * configure.in: Don't pass it. + +Sun Aug 15 20:45:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * bfd-in.h: Remove {BYTE,WORD,LONG}_SIZE; they are pointless and + BYTE_SIZE conflicts with a Mach header. + * ecoff.c: Change LONG_SIZE to ECOFF_LONG_SIZE and define it. + + * configure.host: Make sure all OS fields end in *. + +Fri Aug 13 16:33:33 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_slurp_reloc_table): Use bfd_abs_section for + RELOC_SECTION_NONE and RELOC_SECTION_ABS. If a reloc section + doesn't exist, don't try to create it. + + * nlmcode.h (nlm_write_object_contents): procedure offsets are + from start of code segment, not start of file. + * config/i386-nlm.mt (DEFAULT_VECTOR): It's nlm32_i386_vec, not + bfd_nlm32_i386_vec. + * configure.in (SELECT_VECS switch): Likewise. + +Thu Aug 12 10:32:47 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * format.c (bfd_check_format): If the target matches the default + target, set match_count to 1, to ignore any previous matches. + + * Makefile.in (BFD32_BACKENDS): Remove srec.o, add reloc16.o. + + * configure.in: Add reloc16.o when we add + coff-h8300.o, coff-h8500.o, coff-sh.o, coff-z8k.o. + Makefile.in (BFD_LIBS): Remove reloc16.o. + + * config/u68k-coff.mt: Fix typo, DEFAULT_TARGET for + DEFAULT_VECTOR. + + * config/h8300-coff.mt, h8500-coff.mt, sh-coff.mt, st2000.mt, + z8k-coff.mt (DEFAULT_VECTOR): Define. Don't explicitly add + S-records via SELECT_VECS. + + * targets.c (target_vector), Makefile.in (BFD_LIBS): Always + support S-records, for convenience. + +Thu Aug 12 08:30:05 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-alpha.c (alpha_howto_table, alpha_finish_reloc, + alpha_ecoff_swap_reloc_{in,out}, alpha_bfd_reloc_type_lookup): + Read and write Alpha relocs. Can't process them yet. + * ecoff.c (ecoff_slurp_reloc_table): Recognize new reloc sections. + If the section does not already exist, create it. + + * ecoffswap.h (ecoff_swap_pdr_{in,out}): Handle new fields defined + on the Alpha. + + * libecoff.h (ecoff_backend_data): Added constructor_reloc and + finish_reloc fields. + * ecoff.c: Move MIPS reloc support from here... + * coff-mips.c: to here. + * ecoff.c (ecoff_set_symbol_info): Get constructor reloc howto + from backend. + (ecoff_slurp_reloc_table): Removed MIPS specific stuff. Call + finish_reloc backend function. + (ecoff_write_object_contents): Removed MIPS specific assertions. + * coff-mips.c (mips_finish_reloc): New function. + (mips_ecoff_backend_data): Fill in new fields. + * coff-alpha.c (alpha_ecoff_backend_data): Use NULL for new + fields. + * targets.c: Added extern for ecoffalpha_little_vec. + + * bfd.c (_bfd_host_big_endian): Removed. + * bfd-in.h (HOST_BYTE_ORDER_BIG_P, bfd_header_twiddle_required): + Removed. + * bfd-in2.h: Regenerated. + +Wed Aug 11 12:11:23 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * config.bfd: New file, broken out of configure.in. + * configure.in: Use it, and use standard target names for + --with-targets, replacing --with-bfd-targets. + + * archures.c (archures_init_table): Add bfd_sh_arch. + + * configure.in: Include coff-m68k.o for m68kcoffun_vec. + Include nlm32.o and nlm.o for bfd_nlm32_i386_vec. + Fix error in error message. + + * oasys.c: Make bfd_error_vector extern. + + * configure.in: Include stab-syms.o for a.out/b.out targets + and hp300{bsd,hpux}. + +Wed Aug 11 06:40:51 1993 Ian Lance Taylor (ian@cygnus.com) + + * nlmcode.h (nlm_compute_section_file_positions): Add the .bss + section before setting output_has_begun. + (nlm_set_section_contents): Remove argument names from + mangle_relocs_func prototype. + (nlm_write_object_contents): Remove shadowing local variable. + Don't write out debugging symbols if debugInfoOffset is -1. Add + the codeImageOffset to the start, exit, and check procedure + offsets. + * nlm32-i386.c (nlm_i386_write_reloc, nlm_i386_mangle_relocs): + Don't check partial_inplace field; its value is irrelevant. + + * Base use of sco-core on host, not target. + * configure.host (i[34]86-*-sco*): Use i386sco rather than i386v. + * config/i386-sco.mt (TDEFINES): Removed. + * config/i386sco.mh: New file to use sco-core. + * hosts/i386sco.h: New file; just includes hosts/i386v.h. + + * ecoffswap.h (ecoff_swap_{hdr,ext}_{in,out}): Use signed + conversions for some fields. + +Tue Aug 10 13:32:23 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_gprel_reloc): If _gp is not defined, give an + error rather than aborting. + + * libnlm.h (struct nlm_backend_data): Added mach field. + (nlm_machine): New accessor macro. + * nlm.c (nlm_mkobject): Set architecture and machine from backend + information. + * nlm32-i386.c (nlm32_i386_backend): Initialize new mach field. + +Tue Aug 10 09:31:18 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * configure.in: Replace calls to sort with shell code + to uniq the lists. + +Tue Aug 10 06:23:16 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in: Include aout32.o for any a.out/b.out formats. + +Mon Aug 9 09:37:18 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * config/i386-linux.mt (SELECT_VECS): Support bfd_elf32_i386_vec. + * config/m68k-elf.mt (SELECT_VECS): Support m68kcoff_vec. + * config/i386-elf.mt (SELECT_VECS): Support i386coff_vec. + * config/hppa-elf.mt (SELECT_VECS): Support hppa_vec. + * config/sparc-elf.mt (SELECT_VECS): Support sunos_big_vec. + * config/i386-sco.mt (SELECT_VECS): Don't define; Ian says it was + just a hack. + +Mon Aug 9 13:15:00 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * config/m88k-coff.mt (DEFAULT_VEC -> DEFAULT_VECTOR): renamed. + +Mon Aug 9 14:26:45 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * syms.c (BSF_EXPORT): Now same as BSF_GLOBAL. + + * bfd.c (bfd_scan_vma): New function. + +Mon Aug 9 11:29:53 1993 Ian Lance Taylor (ian@cygnus.com) + + * bfd-in.h (bfd_get_architecture, bfd_get_machine): Removed + obsolete macros. + * bfd-in2.h: Updated. + + * ecoff.c (ecoff_slurp_armap): Correct bug in initialization of + stringbase. + +Sun Aug 8 12:21:13 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * configure.in: Remove unneeded test. + +Sun Aug 8 12:41:22 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in ({dist,real}clean): Use $(MAKE), not make. + +Sat Aug 7 09:14:21 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * config/st2000.mt (TDEFINES): Don't define MRI; not used. + + * PORTING, TODO, config/README: Update to reflect below changes. + + * configure.in: Replace MINIMIZE and --with-minimal-bfd with + --with-bfd-targets="target1,target2,..." and the special target + "all" to get the previous default behavior. + Figure out which architecture and backend .o files are needed from + DEFAULT_VECTOR, SELECT_VECS, and SELECT_ARCHITECTURES as set in + the .mt files. Define TDEFAULTS based on them, also. + + * Makefile.in: Remove references to MINIMIZE. + * archures.c, targets.c: Ditto. + + * config/*.mt: Define DEFAULT_VECTOR, SELECT_VECS, and + SELECT_ARCHITECTURES as variables rather than as -D arguments to + TDEFAULTS. + + * config/a29k-coff.mt,alphaosf.mt, i386-sco.mt, i960-bout.mt, + i960-coff.mt (TDEFAULTS): Don't put the default vector in + SELECT_VECS manually; it's automatic now. + + * config/i386-sco.mt (TDEFAULTS): Don't put &sco_core_vec in + SELECT_VECS manually; -DSCO_CORE does it automatically now. + + * config/h8300-coff.mt,h8500-coff.mt,sh-coff.mt,st2000.mt,z8k-coff.mt + (TDEFAULTS): Don't define BFD; not used. + + * config/hppaosf.mh (HDEFINES): Don't define SELECT_ARCHITECTURES; + this is a host, not a target. + +Sat Aug 7 05:28:03 1993 Fred Fish (fnf@deneb.cygnus.com) + + * elfcode.h (elf_object_p): Add comment about what this function + does and to watch out for side effects. Add FIXME for memory leaks. + Fix comment about checking for matching byte order. Preserve + pointer to old tdata (if any), and restore it if we don't match + file with target vector. If we are going to use goto's, use them + consistently and maintainably. + * nlmcode.h (nlm_object_p): Expand comments about leaked memory + to note that the problem is even more serious than just leaked + memory. Replace goto with more traditional return. + +Fri Aug 6 12:00:03 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + Fix incorrect or useless makefile variable definitions: + * config/news.mt, config/u68k-coff.mt (TDEFAULTS): Use this to + define DEFAULT_VECTOR, instead of TDEFINES. + * config/i386aix.mh (MINIMIZE): Don't define. + * config/hppaosf.mh (MINIMIZE): Don't conditionalize. + * config/rs6000.mh (ALLOCA), + * config/i386v.mh (ALLOCA), + * config/i386linux.mh (ALLOCA), + * config/i386isc.mh (ALLOCA), + * config/go32.mh (EXTRALIBS): Don't define; not used. + * config/solaris2.mh (HDEFINES): Renamed from H_DEFINES. + * config/alphaosf.mt (TDEFINES): Set it, not HDEFINES. + * config/z8k-coff.mt (CC): Don't define. It's a target, not a host. + + * config/README: New file, explaining the variables. + + * targets.c (target_vector): Add hp300_bsd_vec. + * Makefile.in (BFD32_BACKENDS, CFILES): Add hp300bsd. + (hp300bsd.o): New rule. + +Fri Aug 6 15:13:22 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * libelf.h (NAME): Provide a default definition, that's neither + for 32 bits nor for 64. + + Tue Jun 15 14:38:32 1993 Michael Meissner (meissner@osf.org) + + * libelf.h (elf_hash): Change declaration to bfd_elf_hash, since + that is what is in elf.c. + +Fri Aug 6 12:28:38 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_set_symbol_info): Removed special handling for + scBss and scSBss symbols, since it was wrong. + + * Makefile.in (coff-mips.o, coff-alpha.o): Don't depend on + coffcode.h. + + * coffcode.h (sec_to_styp_flags): Inspired by mb@tti.COM (Michael + Bloom): Only set STYP_BSS for SEC_ALLOC sections. + + * ecoff.c (ecoff_slurp_armap): From Arne Henrik Juul + <arnej@kari.fm.unit.no>: Handle a COFF style armap. + +Fri Aug 6 09:59:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hpux-core.c: Cast return value from bfd_zalloc. + +Thu Aug 5 13:22:44 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * aoutx.h (log2): Delete i387-specific code. + + * Makefile.in (BFD_LIBS): Always include elf.o. + (BFD32_BACKENDS): Don't include elf.o here. + (ofiles): Delete references to ofiles2 and ofiles3. + (do_clean): Delete ofiles. + (BFDIN_H): Changed references to $(srcdir)/bfd-in2.h. + (stmp-bfd.h): Use bfd.h-new as temporary name, not bfd.h2. + (headers): Use bfd-in2.h-new as temporary name, not bfd.h-new. + + * bfd-in.h: Reworded comment to make it clear that bfd-in2.h is a + generated file. + + * reloc.c (enum bfd_reloc_code_real): Added i386-elf reloc types + (from Meissner's additions to bfd-in2.h). + + * elf32-i386.c (ELF_MAXPAGESIZE): Define. + + Merged: + + Wed Jun 23 06:05:58 1993 Michael Meissner (meissner@osf.org) + + * elfcode.h (elf_write_object_contents): Don't drop core if + elf_symbol_from returns a NULL pointer when processing a non-elf + symbol, use a 0 size instead. + + Tue Jun 15 14:38:32 1993 Michael Meissner (meissner@osf.org) + + * elfcode.h (elf_hash): Delete macro mapping elf_hash to + bfd_elf32_hash, since the hash table is independent of the 32/64 + bit system. + + * libelf.h (elf_hash): Change declaration to bfd_elf_hash, since + that is what is in elf.c. + + Sat Jun 19 10:12:27 1993 Michael Meissner (meissner@osf.org) + + * elf32-i386.h (reloc_type): Reformat spacing. + (elf_howto_table): Add the rest of the 386/ELF relocations. + (elf_i386_reloc_type_lookup): Ditto. + (elf_i386_info_to_howto): Ditto. + (elf_i386_info_to_howto_rel): Ditto. + +Thu Aug 5 10:07:43 1993 Fred Fish (fnf@cygnus.com) + + * nlmcode.h (nlm_get_reloc_upper_bound): Test return value + of nlm_slurp_symbol_table as boolean, not pointer. + * nlmcode.h (nlm_canonicalize_reloc): Test return value + of nlm_slurp_reloc_fixups as boolean, not pointer. + +Wed Aug 4 16:22:55 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * config/go32.mh: remove HDEFINES; since __MSDOS__ and __GO32__ + are now predefined by GCC + +Wed Aug 4 16:06:29 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * coffgen.c (coff_print_symbol): Add the section offset to the + line number address, so it's printed the same way as the function + address. Only showed up for line numbers that aren't in the first + section (.text). + +Wed Aug 4 08:33:55 1993 Ian Lance Taylor (ian@cygnus.com) + + * libnlm.h (nlm_backend_data): Added nlm_mangle_relocs. + (nlm_mangle_relocs_func): New macro. + * nlm32-i386.c (nlm_i386_write_reloc): Rewrote correctly. + (nlm_i386_mangle_relocs): New function. + * nlmcode.h (nlm_compute_section_file_positions): Move all common + symbols into the .bss section. + (nlm_set_section_contents): Call the mangle_relocs function. + (nlm_write_object_contents): Treat a reloc against any defined + symbol as an internal reloc. Fix bug in external reloc counting. + Get the offset and debugging type right for .bss symbols. Only + output debugging symbols for defined symbols. + + * coff-h8500.c (rtype2howto): Do an fprintf to stderr rather than + using printf. + * coff-z8k.c (rtype2howto): Likewise. + * coffcode.h (dummy_reloc16_extra_cases): Likewise. + * elf32-i386.c (TRACE): Likewise. + * hp300hpux.c (convert_sym_type, swap_std_reloc_in): Likewise. + * rs6000-core.c (rs6000coff_get_section_contents): Likewise. + * coffgen.c (coff_print_symbol): Do an fprintf to the file + argument rather than using printf. + +Tue Aug 3 18:17:25 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffswap.h: Added macros used when accessing several fields; + default is the same as before. + (coff_swap_aouthdr_{in,out}): Handle the Alpha ECOFF fields. + * coff-alpha.c: Defined macros to use the right sizes in + coffswap.h. + * libecoff.h: Backend information is now in target vector, not + BFD. Start of backend information is COFF backend information. + * coff-alpha.c, coff-mips.c: Changed accordingly. + * ecoff.c (ecoff_mkobject): New function. + (ARMAP_START): Changed into backend information, since Alpha uses + a different name. + (ecoff_slurp_armap): Don't overlay archive header. + * bfd.c: Include libcoff.h. + +Tue Aug 3 16:33:11 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * Makefile.in (install): Fix sh syntax error. + + * aoutf1.h: Make bfd_error_trap extern; it's defined in bfd.c. + +Tue Aug 3 15:19:09 1993 Fred Fish (fnf@deneb.cygnus.com) + + * nlm_slurp_symbol_table: Don't use '&' on arrays. + +Tue Aug 3 11:06:28 1993 Ian Lance Taylor (ian@cygnus.com) + + * ecoff.c: New file for generic ECOFF functions. + * ecoffswap.h: New file for ECOFF swapping functions which differ + only slightly for different targets. + * libecoff.h: Added prototypes for ecoff.c functions. + (ecoff_backend_data): New structure. + (ecoff_tdata): Added backend_data field. Changed external data + pointers to be PTR rather than to a particular struct. + (ecoff_symbol_struct): Moved in from coff-mips.c. + * coff-alpha.c, coff-mips.c: Moved common functions into ecoff.c. + Added ECOFF backend structures. Include ecoffswap.h. + * coff-msym.c: Removed; superseded by ecoffswap.h. + * bfd.c: Include coff/internal.h. + * Makefile.in (BFD_LIBS): Removed coff-mips.o and coff-msym.o. + Added ecoff.o. + (BFD64_BACKENDS): Added coff-alpha.o. + (CFILES): Removed coff-msym.c. Added ecoff.c. + (bfd.o): Added dependency on $(INCDIR)/coff/sym.h. + (coff-mips.o): Added dependency on ecoffswap.h and coff/ecoff.h. + (ecoff.o, coff-alpha.o): New targets. + (coff-msym.o): Removed target. + +Mon Aug 2 23:33:38 1993 John Gilmore (gnu@cygnus.com) + + * elf32-hppa.h, hosts/*: Remove (one more time) all occurrances + of EXFUN in the BFD sources. Heave ho! + +Mon Aug 2 16:45:57 1993 Stu Grossman (grossman at cygnus.com) + + * coffcode.h (coff_set_arch_mach_hook): Add check for I386LYNXMAGIC. + +Mon Aug 2 12:18:03 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * hosts/sun3.h: remove some more conflicting decls + +Mon Aug 2 11:48:23 1993 Stu Grossman (grossman at cygnus.com) + + * i386lynx.c: Remove unnecessary def of N_HEADER_IN_TEXT, + redefine TEXT_START_ADDR to be 0. + +Sun Aug 1 22:54:08 1993 Stu Grossman (grossman at cygnus.com) + + * configure.host, configure.in, hosts/i386lynx.h: Lynx/386 + host and target info. + +Fri Jul 30 18:08:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlm32-i386.c: New file. First cut at i386 NLM code. + * libnlm.h: Added some more prototypes. + (struct nlm_relent): New structure. + (nlmNAME(symbol_type)): Added rcnt and relocs fields. + (struct nlm_obj_tdata): Added new fields: nlm_symbols, + nlm_text_low, nlm_data_low, nlm_reloc_fixups, + nlm_reloc_fixup_secs. + (struct nlm_backend_data): New structure, with accessor macros. + * nlmcode.h: Use NLM_HIBIT rather than MSB. + (nlm_object_p): Set SEC_RELOC for .text and .data. Don't set + SEC_DATA for .bss. Set HAS_RELOC and HAS_SYMS for abfd. Set the + architecture. + (nlm_swap_fixed_header_out, nlm_swap_variable_header_out, + find_nonzero, nlm_swap_auxiliary_headers_out): New outbound + swapping functions. + (nlm_get_symtab_upper_bound, nlm_slurp_symbol_table): Include + external references in symbol table as undefined symbols. + (nlm_get_symtab, nlm_slurp_symbol_table): Fill in alocation + argument in get_symtab rather than in slurp_symbol_table. + (nlm_slurp_symbol_table): Save symbol information in tdata. + (nlm_print_symbol): New function. + (nlm_slurp_reloc_fixups, nlm_get_reloc_upper_bound, + nlm_canonicalize_reloc): New functions to read relocs. + (nlm_compute_section_file_positions, nlm_set_section_contents, + nlm_external_reloc_compare, nlm_write_object_contents): New + functions to create NLM files. + * nlm-target.h: Define all the nlm functions here either as + default values or in terms of nlmNAME. Use JUMP_TABLE(nlm). Set + the backend_data field to TARGET_BACKEND_DATA. + * nlm32-gen.c, nlm64-gen.c: Don't define function macros here; + they are now in nlm-target.h. + (TARGET_BACKEND_DATA): Define as NULL. + * nlm.c (nlm_mkobject): Do allocate the tdata field. + (nlm_set_arch_mach): New function. + * targets.c: Added nlm32_i386_vec. + * Makefile.in (BFD32_BACKENDS): Added nlm32-i386.o. + (CFILES): Added nlm32-i386.c. + (nlm32-gen.o, nlm64-gen.o): Depend on nlm-target.h. + (nlm32-i386.o): New target. + +Thu Jul 29 20:20:39 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * hosts/sun3.h: remove some function decls that conflict w/ ANSI + C, and aren't needed anyway (return int) + +Wed Jul 28 15:46:38 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elfcode.h: Use casts with bfd_alloc and alloca. + +Tue Jul 27 12:51:43 1993 Fred Fish (fnf@deneb.cygnus.com) + + * nlm{32,64}-gen.c (JUMP_TABLE_PREFIX): Delete. + * nlm{32,64}-gen.c (JUMP_TABLE_INIT): New macro that works with + older cpp's, that don't do additional replacement on the JUMP_TABLE + macro's argument. + * nlm-target.h (JUMP_TABLE_INIT): Use new macro in place of + JUMP_TABLE macro. + +Mon Jul 26 17:39:01 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + Yet another trad-core variant: + * config/esix.mh, hosts/esix.h: New files. + * configure.hosts: Use them. + +Mon Jul 26 13:22:15 1993 Ian Lance Taylor (ian@cygnus.com) + + * reloc.c (bfd_perform_relocation): Handle the case of + complain_overflow_bitfield, rightshift > bitpos, and a negative + number. + +Mon Jul 26 14:40:10 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elfcode.h: Reimplement segment writing. + (elf_write_phdrs): Use precomputed e_phoff rather than making + assumptions. + (elf_build_phdrs): Disabled, for now. + (assign_file_position_for_section): Don't change file offset for + SHT_NOBITS. + (assign_file_positions_for_symtab_and_strtabs): New function. + (struct seg_info): New type. + (map_program_segments): New function. + (assign_file_positions_except_relocs): For executables, leave + section headers &c for last, and properly align all sections with + flag SHF_ALLOC set. + (prep_headers): No longer abort when EXEC_P is set. + (write_shdrs_and_ehdr): Deleted all code relating to program + segments. + + * elfcode.h (various): Deleted some unused code, and debugging + "malloc(0)" calls. + (write_relocs): Cache value of last symbol looked up, to save + time if the symbol is referred to repeatedly. + (elf_fake_sections): Check only SEC_RELOC flag, not number of + relocs. + (assign_section_numbers): Likewise. + + * Makefile.in (ofiles): Stars in wildcards belong outside quotes. + + * libelf.h (struct elf_backend_data): New field, maxpagesize. + (struct elf_obj_tdata): New field, phdr. + * elf32-target.h (elf32_bed): Initialize maxpagesize from + ELF_MAXPAGESIZE. + (ELF_MAXPAGESIZE): Default to 1. + * elf64-target.h (elf64_bed, ELF_MAXPAGESIZE): Likewise. + * elf32-sparc.c (ELF_MAXPAGESIZE): Define. + (elf_sparc_howto_table): All relocs should have pcrel_offset=true. + Most should have length field of `2'. + + * reloc.c (bfd_perform_relocation): Handle 64-bit relocs. + + * config/sparc-aout.mt (TARGET_BACKENDS): Define. + +Mon Jul 26 08:56:16 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: Don't look in ${srcdir} for ${target_makefile_frag}; + the top level script has already adjusted for it. + +Mon Jul 26 08:09:19 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * srec.c (srec_write_symbols): Get CR LF in the right order. + +Mon Jul 26 02:08:41 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/vaxbsd.h: Include std-host.h. Don't include <machine/param.h>. + +Sat Jul 24 16:13:01 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * reloc.c (bfd_perform_relocation): Handle case of rightshift != + bitpos when overflow checking. + +Fri Jul 23 10:20:27 1993 Doug Evans (dje@canuck.cygnus.com) + + * bfd.c (bfd_nonrepresentable_section, bfd_undefined_symbol, + bfd_reloc_value_truncated, bfd_reloc_is_dangerous, bfd_assert): + Send error messages to stderr. + +Thu Jul 22 15:57:29 1993 Fred Fish (fnf@deneb.cygnus.com) + + * nlm{32,64}-target.h: Remove. + * nlm-target.h: New file, merged from nlm{32,64}-target.h + * libnlm.h (NLM_ARCH_SIZE): Define to ARCH_SIZE. + * nlm.c (ARCH_SIZE): Remove define to zero. + * nlm32-gen.c (ARCH_SIZE): Define to 32. + * nlm32-gen.c (JUMP_TABLE_PREFIX): Define to nlm32. + * nlm{32,64}-gen.c (nlm-target.h): Include. + * targets.c, libnlm.h, nlm.c, nlm{32,64}-gen.c, nlm{32,64}.c, + nlmcode.h: Convert prefixes from bfd_nlm<size> to just + nlm<size>, and use macros select size. + +Thu Jul 22 15:40:14 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * Makefile.in (Makefile): add configure.in, drop redundant + $(srcdir), drop redundant ./ + +Thu Jul 22 13:34:57 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * hpux-core.c: New file; backend for HP/UX style core files. + * bfd.c (struct _bfd): Renamed hppa_core_data field to + hpux_core_data. + * bfd-in2.h: Updated. + * hppa.c (make_bfd_asection, hppa_core_file_p, + hppa_core_file_failing_command, hppa_core_file_failing_signal, + hppa_core_file_matches_executable_p): Moved into hpux-core.c. + Removed from target vector. + * libhppa.h (struct hppa_core_struct and accessor macros): Moved + into hpux-core.c. + * targets.c: If HPUX_CORE is defined, add hpux_core_vec to + target list. + * config/hp300.mh (HDEFINES): Set to -DHPUX_CORE. + (HDEPFILES): Set to hpux-core.o. + * config/hppabsd.mh, config/hppahpux.mh: Likewise. + * hosts/hp300.h (HOST_HP300HPUX): Define. + * Makefile.in (OPTIONAL_BACKENDS): Added sco-core.o, + aix386-core.o, hpux-core.o. + (sco-core.o, aix386-core.o, hpux-core.o): New dependencies. + + * reloc.c (enum complain_overflow): New enumeration with the + various flavours of overflow checking. + (srtuct reloc_howto_struct): Changed complain_on_overflow field + from boolean to emum complain_overflow. Removed obsolete absolute + field. + (HOWTO): Removed absolute argument. + (bfd_perform_relocation): Do overflow checking on all types of + fields. + * bfd-in2.h: Updated accordingly. + * all targets: Updated initialization of reloc howto tables. + +Wed Jul 21 20:34:34 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * opncls.c (bfd_create): Don't use C++ keyword "template" as a C + variable name. + +Tue Jul 20 15:02:23 1993 Fred Fish (fnf@deneb.cygnus.com) + + * coff-m68k.c (m68k_howto2rtype): Make arg CONST to match callers. + + * elfcode.h: Fix several illegal pointer combination warnings for + usages of bfd_alloc and alloca. + + * libnlm.h (nlm_obj_tdata): Rename hidden struct members to avoid + apparent Sun C preprocessor recursion. Fix access macros. + * nlmcode.h: Remove spurious '&' before several array references. + +Tue Jul 20 14:36:27 1993 Jim Kingdon (kingdon@deneb.cygnus.com) + + * Rename for DOS uniqueness: coff-m68k-un.c -> coff-u68k.c + config/m68k-coffun.mt -> u68k-coff.mt. + * Makefile.in, configure.in: Corresponding changes. + +Tue Jul 20 16:21:52 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf32-sparc.c (elf_sparc_howto_table): Don't use "&" before + function name; it's valid without, and some compilers give + warnings with it there. + +Tue Jul 20 08:21:15 1993 Fred Fish (fnf@deneb.cygnus.com) + + * bfd-in.h: Apply some of the changes that were made to bfd-in2.h. + * bfd.c (union tdata): Add nlm_obj_data; + * targets.c (enum target_flavour): Add bfd_target_nlm_flavour. + +Mon Jul 19 20:46:18 1993 Fred Fish (fnf@deneb.cygnus.com) + + * configure.in (*-*-netware, i[34]86-*-netware): New configs. + * Makefile.in (BFD32_BACKENDS): Add nlm.o, nlm32.o, nlm32-gen.o. + * Makefile.in (BFD64_BACKENDS): Add nlm64.o, nlm64-gen.o. + * Makefile.in (CFILES): Add nlm{32,64}.c, nlm{32,64}-gen.c. + * Makefile.in (nlm.o, nlm{32,64}.o, nlm{32,64}-gen.o: New targets. + * bfd-in2.h (INLINE): Defines moved here. + * {aoutx.h, elf.c, elfcode.h}: Move INLINE defines to bfd-in2.h. + * libelf.h (CAT4): Move define to bfd-in2.h. + * bfd-in2.h (CAT4): Merge CAT4 macro with other CAT macros. + * bfd-in2.h (union tdata): Add nlm_obj_data. + * bfd-in2.h (enum target_flavour): Add bfd_target_nlm_flavour. + * targets.c (bfd_nlm{32,64}_{big,little}_vec): Add prototypes. + * targets.c (target_vector): Add bfd_nlm{32,64}_{big,little}_vec. + * (libnlm.h, nlm.c, nlmcode.h, nlm{32,64}-gen.c, + nlm{32,64}-target.h, nlm{32,64}.c, config/i386-nlm.mt): New files + for NLM support. + +Mon Jul 19 15:09:01 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure.{hosts,in}: add i[34]86-*-lynxos* support + +Mon Jul 19 14:53:30 1993 Ken Raeburn (raeburn@rtl.cygnus.com) + + * elf.c, elfcode.h, libelf.h: Serious reorganization. + Deleted `thunk' structure, merged into tdata, duplicate data + eliminated. + Rearranged functions, grouping by functionality. + Broke up many functions in elfcode.h, re-ordered many parts of + file writing to handle unpredictable state of section relocation + table as provided by various applications. + Still needs cleanup: Merge functions back together, split out + data structure with only data that is used only when writing out + object file. + + * elf.c (bfd_elf_generic_reloc): New function, taken from + coff-mips.c. + * elf32-sparc.c (elf_sparc_howto_table): Use it, to work around + bfd_perform_relocation lossage. + + * Makefile.in (BFD_LIBS): Include coff-mips.o and coff-msym.o, so + that gdb will link. + (ofiles): Don't use sort or uniq; do it with sh constructs. + +Sun Jul 18 19:42:14 1993 Jim Kingdon (kingdon@rtl.cygnus.com) + + * coffcode.h: Recognize I386PTXMAGIC. + * aoutf1.h, libaout.h: Add M_386_DYNIX. + * trad-core.c (TRAD_CORE_USER_OFFSET, TRAD_CORE_STACK_FILEPOS): + New macros; use it if defined. + * config/symmetry.mh, hosts/symmetry.h: New files. + +Fri Jul 16 14:56:31 1993 Jim Kingdon (kingdon@rtl.cygnus.com) + + * Rename elf{32,64}-generic.c to *-gen.c for 14 char filenames. + * Makefile.in: Change accordingly. + (CFILES): Add elf64-gen.c. + +Fri Jul 16 09:53:23 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c: Use MIPS_AOUT_{OZ}MAGIC rather than {OZ}MAGIC. + +Thu Jul 15 16:02:07 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-m88k.c (howto_table): Corrected bitsize for R_PCR26L from + 16 to 26. + +Wed Jul 14 15:29:56 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hppa.c [HOST_HPPABSD]: Use hpux-style core files. + * libhppa.h [HOST_HPPABSD]: Include hpux version of core.h + +Wed Jul 14 09:30:48 1993 Doug Evans (dje@canuck.cygnus.com) + + * configure.in: Recognize h8300h-*-*. + +Tue Jul 13 12:03:00 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * coff-h8500.c (reloc_processing, rtype2howto): New relocation + type R_H8500_HIGH_16. + * coff-sh.c (r_imm32): Get the width of the reloc right. + +Tue Jul 13 16:48:56 1993 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr) + + * configure.in: Add new target m68k-coffun to the dpx/2. + * config/m68k-coffun.mt: New file, renamed from config/dpx2.mt. + +Mon Jul 12 10:42:49 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * reloc.c (enum bfd_reloc_code_real): Move SPARC_BASE13 reloc into + sparc-aout-specific list. + + * libelf.h (struct elf_obj_tdata): Add field `thunk'. + + * config/sparc-elf.mt (TARGET_BACKENDS): New make variable. + +Thu Jul 1 14:52:47 1993 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr) + and Jim Kingdon (kingdon@cygnus.com) + + * elfcode.h: Use memset not bzero. + * trad-core.c: Don't include <sys/file.h>. + * i386linux.h: Include <sys/file.h>. + * coff-m68k-un.c: new file to handle names with underscores on + svr3 machines. + * coff-m68k.c (m68k_rtype2howto): added #ifdef ONLY_DECLARE_RELOCS + to not duplicate the function in the executable. + (TARGET_SYM, TARGET_NAME, NAMES_HAVE_UNDERSCORE): new macros needed + by coff-m68k-un.c. + * coffcode.h (MC68KBCSMAGIC): case added. + * targets.c: Add m68kcoffun_vec. + * configure.host: added support for Bull dpx/2. + * config/dpx2.mh, hosts/dpx2.h: new files. + * Makefile.in: added target coff-m68k-un. + +Fri Jul 9 00:43:06 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aoutf1.h: Add definition of MACHTYPE_OK. + +Thu Jul 8 14:37:44 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * reloc.c (bfd_perform_relocation): Don't subtract the addend + again for coff. + + * syms.c, bfd-in2.h: Doc fix. + + * coffcode.h (CALC_ADDEND): Check for common section using the + section flag as well as the symbol flag. + +Thu Jul 8 13:43:52 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/i386bsd.h: Conditionalize HOST_STACK_END_ADDR on __bsdi__. + i386bsd.c: Remove defines of N_TXT*; the versions in aout64.h should + be sufficient. Define TEXT_START_ADDR. + +Wed Jul 7 10:56:21 1993 Ian Lance Taylor (ian@cygnus.com) + + * aoutx.h (translate_from_native_sym_flags): Removed statep + argument. Just let an indirect symbol point to the next symbol + without forcing the next symbol to be undefined. Changed all + callers. + * hp300hpux.c (slurp_symbol_table): Changed call to + translate_from_native_sym_flags. + * targets.c: Added hp300hpux_vec. + * Makefile.in (hp300hpux.o): Added dependencies. + +Tue Jul 6 13:24:55 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * reloc.c (enum bfd_reloc_code_real): Put simple power-of-two + relocs together, and add 64-bit versions. + (bfd_generic_get_relocated_section_contents): Argument to alloca + is size_t. + + * libbfd.c (bfd_xmalloc_by_size_t): New function. + * opncls.c (bfd_cache_init, bfd_open_file): Add prototypes to + declarations. + (obstack_chunk_alloc): Use bfd_xmalloc_by_size_t. + (new_bfd): Prototype-style definition, using DEFUN. + (bfd_alloc_grow, bfd_alloc, bfd_zalloc, bfd_realloc): Size + argument is type size_t, not bfd_size_type. + * ieee.c (obstack_chunk_alloc): Use bfd_xmalloc_by_size_t. + * bfd.c (bfd_default_error_trap, bfd_error_trap, + bfd_error_nonrepresentabltrap): Prototypes. + * libbfd-in.h (bfd_alloc, bfd_zalloc, bfd_realloc, + bfd_alloc_grow): Adjusted prototypes for arg type change. + * archive.c (get_elt_at_filepos, do_slurp_bsd_armap, normalize, + do_slurp_coff_armap, bfd_construct_extended_name_table): + Prototypes. + * elfcode.h (elf_string_from_elf_strtab): Prototypes. + * libelf.h (elf_string_from_elf_section, elf_get_str_section): + Prototypes. + + * Makefile.in (ALL_MACHINES): Renamed from BFD_MACHINES. + (ofiles): New target. Build a list of unique file names, in case + any got duplicated. + (TARGETLIB): Use list of files from ofiles. + * configure.in: Set BFD_MACHINES and BFD_BACKENDS depending on + minimal-bfd flag and target makefile frag contents. + + * elfcode.h (elf_read): Delete static declaration, since function + has moved. + (elf_map_symbols): Write out section symbols for all sections, for + now. + (elf_symbol_from_bfd_symbol): Allow match if both symbols are + section symbols for the same section. + (elf_find_nearest_line): Don't print message, just return false. + + * libelf.h (bfd_elf_locate_sh): Declaration deleted. + +Mon Jul 5 16:48:11 1993 Doug Evans (dje@canuck.cygnus.com) + + * cpu-h8300.c (h8300_scan): Fix parsing of architecture string. + +Fri Jul 2 18:27:00 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in (clean): Remove bfd.h and stmp-bfd.h. + (realclean): Remove generated headers. + +Fri Jul 2 14:51:51 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * section.c (bfd_set_section_content): Deny if file is not opened with + the proper mode, set output_has_begun if file is openened for update. + * aoutx.h (aout_*_set_section_content): Remove checks that are now + done in bfd_set_section_content. + +Fri Jul 2 09:25:20 1993 Ian Lance Taylor (ian@cygnus.com) + + * hosts/std-host.h: Removed declarations of printf, fprintf, + fcntl, fread and fwrite. They are all error prone for one reason + or another. Changed declaration of memchr from char * to PTR. + + * configure.in (mips-*-riscos*): New target; use riscos. + * configure.host (mips-*-riscos*): New host; use riscos. + * config/riscos.mh (HDEFINES): Add -G 4. + + * libaout.h (GET_SWORD): Use the bfd_h_get_signed entry points + rather than casting the result of bfd_h_get. + +Fri Jul 2 10:13:48 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in, hosts/delta68.h, config/delta68.mh: Add stuff for + Motorola Delta 68. + +Wed Jun 30 06:02:43 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * targets.c (bfd_elf64_{big,little}_generic_vec): Declare, and + include in search list if BFD64 is defined. + + * libelf.h (CAT4): Added a version for Saber-C, ANSI mode. + (bfd_elf64_*): Declarations for 64-bit versions of many routines. + +Tue Jun 29 22:50:59 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf64-target.h, elf64-generic.c: New files. + * Makefile.in (BFD64_BACKENDS): Include elf64-generic.o. + (elf64-generic.o): List dependencies. + + * Makefile.in: List target `all' explicitly before host/target + makefile fragments are included, in case they define any new + targets. + + * elfcode.h (ELF_R_INFO, ELF_R_SYM): Define as 32- or 64-bit + versions as appropriate. Uses updated. + (elf_debug_section): Declare before use. + (elf_debug_file): New function. + (bfd_section_from_shdr, bfd_shdr_from_section, elf_fake_sections): + Alignment value in section header is n_bytes, not log2. + (new_section_hook): Do nothing for now. + (bfd_section_from_shdr): Use Elf_External_Rel[a], not 32-bit + version explicitly. + (elf_core_file_p): Simplify check for correct class (word size). + (elf_make_sections, elf_fake_sections, elf_write_object_contents): + Initialize all fields when creating data structures. + (elf_locate_sh): Renamed from bfd_elfXX_locate_sh, made static. + (elf_compute_section_file_positions): Set correct class in output + file. + (elf_write_object_contents): Section symbols have empty names in + output file. + + * libbfd.c (bfd_xmalloc, zalloc): Be sure to cast malloc, memset + args to size_t before call. + (bfd_add_to_string_table): Cast zalloc arg to bfd_size_type. + +Tue Jun 29 10:49:42 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_find_nearest_line): If procedure has no line + number information, return 0 for line number. + +Mon Jun 28 10:45:02 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aoutx.h (some_aout_object_p): If *oldrawptr is non-NULL, copy it + into *rawptr. + +Sun Jun 27 09:05:19 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/riscos.h: Define NBPG and UPAGES. + +Sun Jun 27 16:28:26 1993 Ken Raeburn (raeburn@cygnus.com) + + * elfcode.h (elf_slurp_symbol_table): Don't use obj_raw_syms as + lvalue; it contains a cast. + +Fri Jun 25 17:09:55 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (hash, compare, struct stringtab_entry, add_to_stringtab): + Use unsigned hash values for better hashing. + (hash): Hash in the string length for long strings. + +Thu Jun 24 15:47:51 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (compare): Replace 3 if's with a subtraction. + (translate_to_native_sym_flags, add_to_stringtab): Reorder tests + in decreasing order of success, as an optimization. + (hash): Take a length arg; ignore chars after #25, for speed. + (add_to_stringtab): Pass length to hash. + +Thu Jun 24 17:25:51 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * elf32-sparc.c (sparc_reloc_map): Add SPARC_WDISP22 reloc. + + * elfcode.h (elf_new_section_hook): Do nothing for now. + (elf_write_object_contents): Output common symbols the way ELF + wants them. + +Wed Jun 23 16:20:07 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * libelf.h (struct elf_obj_tdata and associated macros): Moved + here from elfcode.h. A couple of size-specific structure pointers + were changed to PTR; uses fixed appropriately. + (elf32_symbol_type, elf64_symbol_type): Separated definitions. + (bfd_elf_mkobject): Renamed from bfd_elf32_mkobject. + (bfd_elf32_mkobject, bfd_elf64_mkobject, elf_mkobject): New + temporary macros to ease name change. + * elf.c (elf_read, elf_mkobject, elf_get_str_section, + elf_string_from_elf_section, bfd_elf_find_section): Moved here + from elfcode.h. + * doc/Makefile.in (libbfd.h): Process elf.c too. + * Makefile.in (elf.o): Note new dependencies. + + * elfcode.h: Lots of stuff moved elsewhere. Deleted some unused + code, tweaked some debug hooks. + (elf_slurp_reloca_table): Translate ELF section symbols into BFD + section symbols. + +Wed Jun 23 11:34:21 1993 Jim Kingdon (kingdon@cygnus.com) + + * hosts/riscos.h: New file. + +Tue Jun 22 14:35:20 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * elfcode.h (bfd_section_from_shdr, case SHT_PROGBITS): Even if + section already exists, use its pointer to fill in rawdata slot. + +Tue Jun 22 16:36:51 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/std-host.h: Return value of puts and fputs is int not void. + +Tue Jun 22 14:25:58 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (howto_table_ext): Comment the field names. + * reloc.c (bfd_perform_relocation): Fix max and min values. + +Mon Jun 21 18:19:14 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * elf32-target.h, elf32-hppa.c, elfcode.h: Use new + size-independent elf internal data structures. + * elfcode.h (put_word, get_word): Define as appropriate for + architecture word size. Structure swapping functions changed to + use them as appropriate. + + * configure.in: If compiling 64-bit back ends, do them before + 32-bit ones. + + * libelf.h: Use new size-independent versions of elf internal data + structures. + (symbol_type): Reordered to put any fields dependent on target + size at the end. + (elf_backend_data): Renamed from elf##_backend_data and made + size-independent. + (elf_sect_thunk): Now size-independent. + + * libbfd.c (bfd_log2): Now returns unsigned int. + +Mon Jun 21 12:30:47 1993 Jim Kingdon (kingdon@cygnus.com) + + * Rename config/m88k-aout.mt to config/noop.mt. + configure.in: Use it for mips-*-bsd*. + +Sun Jun 20 20:32:19 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * cpu-m68k.c (arch_info_struct): Eliminate "partially bracketed + initializer" warning from gcc. + * cpu-h8500.c (arch_info_struct): Likewise. + * cpu-sh.c (arch_info_struct): Likewise. + + * cpu-h8300.c (local_bfd_reloc_type_lookup, howto*_callback, + howto_*): Unused functions and variables commented out. + * cpu-z8k.c (local_bfd_reloc_type_lookup, howto*_callback, + howto_*): Likewise. + * cpu-h8500.c (compatible): Likewise. + * cpu-sh.c (compatible): Likewise. + + * hp300hpux.c (swap_std_reloc_in): Delete unused variables. + Always set a valid length value, even for invalid input. + + * srec.c (srec_write_symbols): Use sprintf_vma. + + * bfd-in.h (uint64_typeLOW, uint64_typeHIGH, int64_type, + uint64_type): Provide default definitions. + * hosts/std-host.h (int64 stuff): Remove them from here. + + * bfd-in.h (sprintf_vma): Define parallel to fprintf_vma. + + * elf32-i386.c (elf_i386_reloc_type_lookup): Delete unused + variable. Added default case to switch. + + * aoutx.h (translate_from_native_sym_flags): Before casting + pointers to integers, make sure the integer type is wide enough. + * coff-mips.c (ecoff_set_symbol_info): Ditto. + + * section.c (bfd_get_section_contents): Since `count' is unsigned, + don't bother comparing for less-than-zero. + (bfd_set_section_contents): Ditto. + + * elfcode.h (bfd_add_to_strtab): Now static. + (sym_is_global): New function. + (elf_map_symbols): Call it. Now returns void. Removed unused + local variable. + (bfd_section_from_shdr): Mark string tables other than for section + and symbol names as normal sections having contents. + (fix_up_strtabs): New function; fixes up ELF header fields for + stab sections with string tables associated. + (elf_write_object_contents): Map fix_up_strtabs over all BFD + sections. Reordered condition tests for symbol flags; default to + local-object value instead of global-object. + (elf_symbol_from_bfd_symbol): Hid conditionally-used variable + inside condition test. + (elf_print_symbol): Use fprintf_vma. + (elf_idx_of_sym, bfd_shdr_from_section): Unused functions + commented out. + + * bfd-in.h (int64_type, uint64_type): Define these if we fall + back to "long long" for HOST_64_BIT. + + * libelf.h (elfNAME, ElfNAME): New versions to get desired results + without using invalid ANSI C preprocessing tokens. + + * elf32-target.h (bfd_elf32_new_section_hook): Delete macro. + * libelf.h (bfd_elf32_new_section_hook): Declare. + * elfcode.h (new_section_hook): Define here. + + * hosts/sparc.h, hosts/std-host.h, hosts/i386bsd.h: Protect + against multiple inclusions. + + * hosts/news.h: Include hosts/std-host.h, not plain std-host.h. + + * Makefile.in (bfd.h): Generate into current directory by grabbing + 64-bit definition (if any) from sysdep.h. + * bfd-in.h: Put in marker for sysdep.h inclusion. + +Fri Jun 18 19:57:23 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * reloc.c (bfd_perform_relocation): Check for overflow on + pc-relative relocations if the howto asked for it. + +Fri Jun 18 16:00:20 1993 Jim Kingdon (kingdon@cygnus.com) + + * Makefile.in (stmp-bfd.h): Ignore nonzero exit status from grep. + +Fri Jun 18 16:54:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config/riscos.m{h,t}: New files. + * configure.{host,in}: Use them. + +Fri Jun 18 12:55:10 1993 K. Richard Pixley (rich@cygnus.com) + + * elf32-mips.c: comment change. This is a mips file, not 88k. + +Mon Jun 14 14:02:41 1993 Jim Kingdon (kingdon@cygnus.com) + + * cache.c (bfd_cache_init): Increment open_files and call close_one + if necessary. + (bfd_open_file): Don't increment open_files here. + +Fri Jun 18 10:00:14 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config/delta88.mh: Don't set CC. + + * Makefile.in: Add elf32-{mips,m88k,generic}. + elf32-{mips,m88k,generic}.c: New files. + targets.c (target_vector): Include bfd_elf32_{mips,m88k,generic}_vec. + elfcode.h (elf_object_p): Match elf32-generic for all machines which + don't match a different target. + +Fri Jun 18 03:12:12 1993 John Gilmore (gnu@cygnus.com) + + Eliminate "int8_type", "int16_type", "int32_type", and their + variants from the BFD universe. Leave the 64-bit types for now, + since they are in flux. + + * aoutx.h, hp300hpux.c: Eliminate needless (int32_type) casts. + * libaout.h (GET_SWORD): Convert (int32_type) to (int). + * ieee.c: Convert uint8e_type => unsigned char. + * oasys.c: Extensive changes to eliminate obsolete types. + These depend on changes in ../include/oasys.h as well. + * hosts/*.h: Remove declarations of all these types. + +Mon Jun 14 14:02:41 1993 Jim Kingdon (kingdon@cygnus.com) + + * hosts/delta88.h: #if 0 out some declarations which conflict with + system headers. + +Mon Jun 14 17:08:18 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com) + + * Makefile.in (install): remove parentdir cruft + +Mon Jun 14 19:04:09 1993 Stu Grossman (grossman@cygnus.com) + + * hppa.c (hppa_get_symbol_info): Remove redundant copy. + * Expurgate random DEFUNs that have crept in. + +Mon Jun 14 10:23:53 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_set_symbol_info): Constructor sections should + only be aligned to a 4 byte boundary. + +Sat Jun 12 16:13:17 1993 Jim Kingdon (kingdon@cygnus.com) + + * hosts/std-host.h (struct int64e_struct): Remove needless typedef + keyword. + +Fri Jun 11 14:25:34 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * aoutf1.h (sunos4_write_object_contents): set flags to 1, breaking + 1927 but fixing some other important things. + +Thu Jun 10 20:36:22 1993 Doug Evans (dje@canuck.cygnus.com) + + * hosts/std-host.h (int64e_type): Fix definition. + +Thu Jun 10 11:48:28 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_sec_to_styp_flags): Use STYP_MIPS_INIT for + section named _INIT. Don't set STYP_TEXT unless SEC_CODE is set. + (ecoff_styp_to_sec_flags): Treat a STYP_MIPS_INIT section like + a STYP_TEXT section. + +Wed Jun 9 16:48:13 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in (install, headers): don't put comments after a tab + in the actions section of a rule + +Wed Jun 9 15:00:01 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_mkobject_hook): Mark ZMAGIC files as D_PAGED. + (ecoff_write_object_contents): If not D_PAGED, don't add the + section headers to text_size. If not D_PAGED, set the magic + number to OMAGIC rather than ZMAGIC. If creating a D_PAGED + executable, the executable must fully occupy an even number of + pages. + (ecoff_set_symbol_info, make_bfd_asection, ecoff_little_vec, + ecoff_big_vec): Consistently set section alignment power to 4, + since ECOFF sections should be multiples of 16 bytes. + (ecoff_little_vec, ecoff_big_vec): Added D_PAGED to object_flags. + Made ar_pad_char and ar_max_namelen agree for both. + +Tue Jun 8 20:28:02 1993 Mark Eichin (eichin at tweedledumber) + + * elfcode.h (elf_slurp_symbol_table): subtract section vma from + symbol value, since bfd symbols are section relative, but ELF + symbols aren't. + +Tue Jun 8 12:08:27 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * cpu-i960.c, cpu-h8300.c (compatible): Make static. + +Tue Jun 8 14:27:56 1993 Jim Kingdon (kingdon@rtl.cygnus.com) + + * hosts/news.h, config/news.mh: New files. + +Tue Jun 8 12:08:27 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * bfd-in2.h, archures.c (bfd_mach_h8300[h]): new defines. + * coff-h8300.c: More addressing modes. + * coffcode.h (coff_set_arch_mach_hook): Cope with H8300 magic + number. + * cpu-h8300.c: Removed disassemble stuff. (h8300_scan): Recognise + H8/300H name. (compatible): New function. + * reloc16.c (bfd_coff_reloc16_get_relocated_sec): Cope with more + addressing modes. + +Tue Jun 8 10:30:13 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_compute_section_file_positions, + ecoff_write_object_contents): Only round to page boundaries if + D_PAGED flag is set for the output BFD. + +Fri Jun 4 15:47:52 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * coffcode.h (get_index, coff_slurp_symbol_table): Fix pointer + casts to work on machine where sizeof(long) != sizeof(int) != + sizeof(char *). + * coffgen.c (coff_get_normalized_symtab): Ditto. + * cpu-h8300.c coff-h8300.c: Support for H8/300-H. + +Fri Jun 4 15:24:27 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * coffgen.c (coff_write_symbols): For empty string table, write + out 4 in correct byte order. (from minyard@bnr.ca) + + * elf32-hppa.c: Don't include libhppa.h for now; define + BYTES_IN_WORD instead, until Utah sends a better fix. + (hppa_elf_build_arg_reloc_stub): Use xmalloc and xrealloc instead + of malloc and realloc. + +Fri Jun 4 07:49:01 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure.in (mips-*-ecoffl*): New target; use decstation. + (mips-*-ecoff*): Added trailing '*'. + + * coff-mips.c (ecoff_get_debug): Get the offset from the first PDR + for the FDR, not from the first PDR in the file. + +Thu Jun 3 16:41:10 1993 Stu Grossman (grossman@cygnus.com) + + * hppa.c (hppa_get_symbol_info): New func needed for JUMP_TABLE. + +Thu Jun 3 15:33:57 1993 David J. Mackenzie (djm@rtl.cygnus.com) + + * hppa.c (hppa_get_symbol_info): New function. + +Thu Jun 3 13:07:42 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elfcode.h (elf_map_symbols): Don't crash if no symbols have been + allocated yet. + + From Peter Hoogenboom (hoogen@schafer.cs.utah.edu): + * libhppa.h (MAXCOMLEN): Define unconditionally. + (_PA_RISC_ID): Only define if not already defined. + * elf32-hppa.c: Include libhppa.h. + + From Ralph Campbell: + * hosts/mipsbsd.h (HOST_DATA_START_ADDR): Delete definition. + + * elf32-hppa.h (symext_rootP, symext_lastP): Delete decls. + +Thu Jun 3 00:23:53 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config/go32.mh: define EXTRALIBES to -lm (for binutils), also + remove defines of __MSDOS__ and __GO32__ (these are in the + compiler now). + +Wed Jun 2 17:57:13 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + From Utah: + * hosts/hppabsd.h: Eliminate use of obsolete EXFUN. + * config/hppabsd.mh: Don't use ranlib. + +Tue Jun 1 04:15:57 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * elf.c: New file, for word-size independent code. + * elfcode.h (elf_hash): Moved to there, renamed bfd_elf_hash. + * Makefile.in: Include elf.o in standard objects. + + * bfd-in.h (CAT3): Define here. + * libaout.h, libelf.h: Not here. + + * libelf.h (struct strtab): Define here. + (bfd_elf_locate_sh): Declare here. + * elfcode.h (struct strtab): Definition deleted. + + * reloc.c (enum bfd_reloc_code_real): Added HPPA_PCREL_CALL_12. + + * Makefile.in: Make "all", not "bfd.h", be the default target. + (stmp-bfd.h): New target; prevents rebuilding world if bfd.h + hasn't really changed. + + Tue May 25 12:15:15 1993 Michael Meissner (meissner@osf.org) + + * elfcode.h (elf_hash): Provide elf standard hash function. + (various): Key off of the machines use_rela_p field to determine + whether to use REL or RELA relocations. + (elf_swap_reloc_out, elf_swap_reloc_in): New functions. + (elf_make_sections): Allocate a pointer to hold all data for a + given section, and copy each fragment into the data region. + Update the section's pointer with the REL implicit addends if the + machine uses REL relocation. + + * elf32-i386.c (elf_bfd_reloc_type_lookup): Rename to + elf_i386_bfd_reloc_type_lookup, and use cpp to map the name back + into was elf32-target.h expects. + (elf_info_to_howto): Rename to elf_i386_info_to_howto. + (elf_i386_bfd_reloc_type_lookup): Add relocation support. + (elf_i386_info_to_howto): Add minimal relocation support. + + * libelf.h (elf_backend_data): Add use_rela_p, elf_64_p, + elf_info_to_howto_rel fields. + + * elf32-target.h (elf_bed): Add support for new fields in + elf_backend_data. + + Sun May 30 16:38:24 1993 Peter Hoogenboom (hoogen@fast.cs.utah.edu) + + * elf32-hppa.c: Add symbol extension section support, fix + relocation howto table, add stub generation support. + + * elf32-hppa.h: Add symbol extension section support, fix + relocation howto table, add stub generation support. + + * elfcode.h (bfd_elf_locate_sh): New function to locate ELF + section header. + + * elfcode.h (bfd_add_to_strtab): Made non-static due to a call + from elf32-hppa.c. + + * elfcode.h (elf_idx_of_sym): Return STN_UNDEF instead of 0 when + the symbol is not found. + + * elfcode.h (elf_compute_section_file_positions): Not all section + file positions were computed. + + * elfcode.h (elf_get_sect_thunk): New function. + + * hppa.c (sign_ext): Reimplement. + + * hppa.c (round_down,round,round_up,L,R,LS,RS,LD,RD,LR,RR): Make + these functions static. + +Tue Jun 1 14:40:41 1993 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in (bfd.h): Move closer to headers - and after 'all'! + + * aoutx.h (translate_from_native_sym_flags): Don't set + BSF_DEBUGGING for constructor symbols, only BSF_CONSTRUCTOR. + * aoutx.h (translate_to_native_sym_flags): Translate + constructor symbols properly. + +Thu May 27 16:09:04 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * archures.c (bfd_default_arch_struct): use 4 byte alignment as a + minimum. + * aout-target.h (minimum_alignment): 8 byte alignment is right. + (fix ld/2680) + +Thu May 27 13:38:47 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in, Makefile.in: Build bfd-in2.h in source directory, + from bfd-in.h and .c files. Build bfd.h in build directory, + substituting in requested target word size. Insert word size into + makefile, and maybe enable 64-bit targets. + + * bfd-in.h, libbfd.c, demo64.c, targets.c: Define BFD64 if 64 bits + are available. Conditionalize on this. Assume HOST_64_BIT + will be defined if needed, so 64-bit targets are conditionalized + only in the Makefile. + +Tue May 25 14:03:56 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * libbfd.c (COERCE64): Rewrite to avoid out-of-range values. + + * coff-sh.c (rtype2howto): Put error message on stderr. + (extra_case): Delete unused variable. + + * coff-mips.c (ecoff_print_symbol): Cast bfd_vma values to long + before calling printf. + + * elfcode.h: New file, almost completely derived from old elf32.c. + * elf32.c: Now just define ARCH_SIZE and include elfcode.h. + * Makefile.in (elf64.o): List dependencies, don't build by + default. + (elf64.c): Add to list of sources. + (elf32.o): Update dependencies. + * elf32-*.c: Updated type/macro/structure names. Cleaned up + namespace pollution; rename vectors. + * targets.c, config/*-elf.mt: Updated. + * All uses of 32-bit versions of structures, routines, and macros + renamed. + + * Makefile.in (archures.o, targets.o): Depend on Makefile. + +Mon May 24 15:53:13 1993 Ken Raeburn (raeburn@cygnus.com) + + * elf32-i386.c (enum reloc_type): No comma after last enumerator. + + * elf32.c (elf_string_from_elf_section): Handle index of zero + specially. + (bfd_section_from_shdr, elf_slurp_symbol_table): Don't need to do + so here. + (elf_write_object_contents): Deleted one unused variable and + initialized another to avoid gcc warnings. + (elf_set_section_contents): Delete unused variable. + +Fri May 21 19:04:21 1993 Stu Grossman (grossman@cygnus.com) + + * i386lynx.c: New module for Lynx variant of a.out. + * Makefile.in (BFD_BACKENDS CFILES depends): Add i386lynx.c. + * gen-aout.c: Get rid of defunct endian stuff, print out true + pagesize. + * targets.c (target_vector): Add i386lynx_vec. + +Fri May 21 17:02:22 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * configure.in: Use i386-sco.mt for i[36]86-*-isc*. + +Fri May 21 13:44:18 1993 David J. Mackenzie (djm@rtl.cygnus.com) + + * aix386-core.c, aout-target.h, aoutx.h, coff-alpha.c, + coff-mips.c, coffgen.c, elf32.c, ieee.c, libaout.h, libcoff-in.h, + libelf.h, mipsbsd.c, oasys.c, sco-core.c, srec.c, tekhex.c, + trad-core.c: Define a TARGET_get_symbol_info function or macro. + Remove the bfd_print_symbol_nm case from TARGET_print_symbol. + + * bfd-in.h: Don't define bfd_print_symbol_nm. + Define symbol_info type. + (JUMP_TABLE): Set _get_symbol_info element. + + * syms.c (coff_section_type, bfd_symbol_info): New functions. + (bfd_decode_symclass): Use coff_section_type. + + * targets.c: Add bfd_get_symbol_info call. + +Wed May 19 15:30:52 1993 Stu Grossman (grossman@cygnus.com) + + * coff-i386.c (coff_i386_reloc): Use unsigned char to avoid + complaints from ancient gcc's. + +Wed May 19 15:51:19 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * trad-core.c: Check macro TRAD_CORE_EXTRA_SIZE_ALLOWED. + hosts/i386linux.h: Define it. + +Mon May 17 15:00:33 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * VERSION, bfd-in.h: Bump version number to 2.2. + + * hppa.c (assemble_3, dis_assemble_3, assemble_12, + dis_assemble_12, assemble_17, dis_assemble_17, assemble_21, + dis_assemble_21, sign_ext, ones, sign_unext, low_sign_ext, + low_sign_unext, round_down, round, round_up, L, R, LS, RS, LD, RD, + LR, RR, hppa_field_adjust): New functions. + +Mon May 17 10:04:16 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_set_symbol_info): Added support for indirect + stabs symbols, including new indirect_ptr_ptr argument. + (ecoff_slurp_symbol_table): Pass new argument in calls to + ecoff_set_symbol_info. + +Fri May 14 00:05:06 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in: For m68k sysv systems, use m68k-coff. + + * config/hppa-elf.mt (TDEFINES): Don't define DEFAULT_VECTOR here. + (TDEFAULTS): Define it here. Use the new name. + + * elf32-hppa.c (elf_hppa_backend_data): Delete; rely on default + values instead. + + * reloc.c (bfd_reloc_code_real_type): Add some HPPA reloc types. + + * aix386-core.c (NO_GETS): Fix PROTO invocation to have correct + number of arguments. + (aix386_core_file_p): Initialize core_size to correct value. + +Wed May 12 14:39:59 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (CC_FOR_BUILD): New variable, set to $(CC). + (FLAGS_TO_PASS): Pass down CC_FOR_BUILD. + + * bout.c (aout32_slurp_extended_name_table): Define to be + _bfd_slurp_extended_name_table rather than bfd_true. + + * coff-mips.c: Include libaout.h and aout/aout64.h to get + definitions for N_SET[ATDB]. + (ecoff_howto_table): Moved near top of file. + (ecoff_set_symbol_info): If a STABS symbol of type N_SET[ATDB] is + seen, cook up a constructor section of the same name and put in a + reloc pointing to the symbol. This lets the GNU linker build + global constructors and destructors without using collect. + +Tue May 11 00:33:31 1993 John Gilmore (gnu@cygnus.com) + + * coff-m88k.c (m88kbcs_vec): Symbols have underbars. + +Mon May 10 05:55:45 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * hosts/miniframe.h: New file. + * configure.host: Use it. + +Sun May 9 16:36:59 1993 Fred Fish (fnf@cygnus.com) + + * configure.in (hppa*-*-bsd): Change to hppa*-*-bsd* + * configure.in (hppa*-*-hpux): Change to hppa*-*-hpux* + * configure.in (m68*-hp-bsd): Change to m68*-hp-bsd* + * configure.in (m68*-*-hpux): Change to m68*-*-hpux* + * configure.in (*-*-bsd): Change to *-*-bsd* + +Wed May 5 16:08:32 1993 Per Bothner (bothner@cygnus.com) + + * elf32-hppa.c (elf_hppa_reloc_type_lookup): Cast enums to + int, for the sake of the old Portable C Compiler. + +Mon May 3 14:37:01 1993 Stu Grossman (grossman@cygnus.com) + + * Makefile.in (CFILES): Add cpu-sh.c and coff-sh.c. + +Mon May 3 14:03:21 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * configure.in: Get target name right for m68*-*-hpux. + +Sun May 2 11:39:44 1993 Fred Fish (fnf@cygnus.com) + + * trad-core.c (NO_SIGNED_GET): New macro. + * trad-core.c (trad_core_vec): Use new NO_SIGNED_GET instead of + signed NO_GET, where appropriate. + + * configure.in (i[34]86-*-linux*): Add; bfd_target = i386-linux. + * configure.in (*-*-linux*): Remove until linux port for a + non-i386/i486 system is actually available. + +Fri Apr 30 20:04:10 1993 Stu Grossman (grossman@cygnus.com) + + * libhppa.h: #undef e_* symbols which come from <machine/som.h> + when compiling under HPUX. + +Fri Apr 30 17:25:23 1993 Stu Grossman (grossman@cygnus.com) + + * The following patches are from Jeffrey Law <law@cs.utah.edu>. + * hppa.c (hppa_core_file_p): Provide a temporary dummy routine + for HOST_HPPABSD. + * bfd/hosts/hppabsd.h: Fix declarations of malloc and free. + * bfd/libhppa.h: Include sysdep here. Conditionalize + includes based on HOST_HPPAHPUX or HOST_HPPABSD. + Provide definitions for MAXCOMLEN and _PA_RISC_ID suitable + for BSD. + +Fri Apr 30 17:34:11 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf32-hppa.c: Don't include a.out.h. Apparently not even the + GNU version is needed. + +Fri Apr 30 09:38:59 1993 Jim Kingdon (kingdon@cygnus.com) + + * coffcode.h: use dummy_reloc16_extra_cases rather than casting abort. + +Thu Apr 29 11:30:32 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * Makefile.in: Build elf32-hppa.o. + + * syms.c (BSF_FUNCTION): New symbol flag. + + * elf32-hppa.c: Fixed to work with elf32-target.h. + + * hp300hpux.c (NAME, NAME_swap_exec_header_in): Fix for + traditional C. + * libaout.h (NAME): Don't define if already defined. + + * libelf.h: Protect against multiple inclusions. + (elf_symbol_type): Moved here, added new fields. + (struct elf_backend_data): New field `global_sym'; I suspect this + may be misplaced. + * elf32.c (elf_symbol_type): Deleted from here. + (struct elf_obj_tdata): New fields raw_syms and internal_syms, to + point to backend versions of symbols. + (obj_symbols, obj_raw_syms, obj_internal_syms): New macros. + (elf_swap_phdr_out, elf_build_phdrs, elf_write_phdrs): New + functions. + (elf_write_object_contents): Write program headers if appropriate. + (bfd_section_from_shdr): Unnamed sections get empty string for + name, not "unnamed". Handle SHT_NOBITS separately from + SHT_PROGBITS, and set some different flags. + (elf_file_p): New routine. + (elf_object_p, elf_core_file_p): Call it. + (elf_object_p): Handle EM_HPPA. + (elf_symbol_from, elf_idx_of_sym): New functions. + (elf_make_sections): Get symbol number right for relocations. Set + SHF_ALLOC, SHF_WRITE, SHF_EXECINSTR when appropriate. + (elf_fake_sections): BSS section should be SHT_NOBITS, not + SHT_PROGBITS. Always generate symtab and strtab, not only if + relocations are needed. Set SHF_* flags as appropriate. + (elf_compute_section_file_positions): Handle bfd_arch_hppa. + (elf_write_object_contents): Fix off-by-one error in symbol count. + Store a correct value for the symbol; write the size field + properly; make some guesses about the type field. Set section + type correctly for string tables. + (section_from_elf_index): Check for absolute and common sections + first. + (elf_section_from_bfd_section): Ditto. + (elf_slurp_symbol_table): Use elf_symbol_type instead of asymbol. + Use empty string instead of "unnamed" for nameless symbols. + Handle STTY_FUNC type, and weirdness with "$global$" symbol for + HPPA (only?). Don't free raw symbols; keep the pointer around for + later. + (elf_set_arch_mach): Handle bfd_arch_hppa. + (elf_find_nearest_line): Just return false. + (elf_write_object_contents, elf_set_section_contents): Set + output_has_begun field after computing file positions. + (elf_set_section_contents): Write section contents immediately, + rather than caching the whole file and writing it at close time. + + * libhppa.h (enum hppa_reloc_field_selector_type, enum + hppa_reloc_field_selector_typ_alt, enum hppa_reloc_expr_type, enum + hppa_reloc_expr_type_alt): New enumerator types. + + * config/hppa-elf.mt,. config/hppaosf.mh: HP PA/OSF support. + * configure.in, configure.host: Use them. + +Wed Apr 28 23:21:01 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf32-target.h: Allow overrides of armap defaults. + + * elf32-hppa.c, elf32-hppa.h: New files. + + * config/hp300hpux.mt: New file. + +Tue Apr 27 05:39:40 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * aix386-core.c (NO_GETS): New macro; NO_GET for signed values. + (aix386_core_vec): Update for new fields. + + * archive.c (bfd_generic_archive_p): Call target-specific + slurp_armap code, instead of bfd_slurp_armap. + (bfd_slurp_bsd_armap_f2): New function. + * libbfd-in.h (bfd_slurp_bsd_armap_f2): Declare it. + * aout-target.h (AR_PAD_CHAR): Define it if not already defined. + (vec): Use it. + * libaout.h (struct aoutdata): New field for subformat, for + differentiating between highly similar a.out formats. + * aoutx.h (NAME_swap_exec_header_in): New macro, defaults to local + version of function. + (swap_exec_header_in): Don't define if NAME_swap_exec_header_in is + already defined. + * hp300hpux.c: New file. + * Makefile.in: Include it. + +Mon Apr 26 13:24:43 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * Makefile.in, archures.c, coffcode.h, targets.c: Support for + Hitachi SH. + +Mon Apr 26 13:55:42 1993 Jim Kingdon (kingdon@cygnus.com) + + * trad-core.c (trad_unix_core_file_p): Check the file size. + +Mon Apr 26 13:24:43 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-alpha.c: Remove duplicate function and add warnings. + +Mon Apr 26 11:25:58 1993 Ian Lance Taylor (ian@cygnus.com) + + * sco-core.c (sco_core_vec): Add initializers for new target + fields. + +Sat Apr 24 21:33:45 1993 Jim Kingdon (kingdon@cygnus.com) + + * coffcode.h [_LIT]: Recognize .lit section. + +Fri Apr 23 19:00:36 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-alpha.c, cpu-alpha.c, config/alphaosf.mt, + config/alphaosf.mt, hosts/alphaosf.h: New files. + +Fri Apr 23 16:48:46 1993 Stu Grossman (grossman@cygnus.com) + + * Merge in HPPA/BSD changes from Utah. + * hppa.c: Use this for both HPUX & BSD. + * targets.c: Enable hppa_vec for both HPUX & BSD. + * config/hppabsd.mt: TDEFINES => TDEFAULTS. + * hosts/hppabsd.h: #define HOST_HPPABSD. + +Wed Apr 21 01:50:10 1993 John Gilmore (gnu@cygnus.com) + + * libbfd.c: Whitespace changes around byteswap macros. + * libbfd-in.h: Whitespace changes around byteswap declarations. + +Tue Apr 20 15:59:07 1993 Stu Grossman (grossman@cygnus.com) + + * aoutf1.h (sunos4_core_file_p): Don't default bfd_error to + system_error anymore. It confuses bfd_check_format(). + +Mon Apr 19 23:03:08 1993 Stu Grossman (grossman@cygnus.com) + + * bfd.c: Add sgi_core_data to tdata union. + * coff-mips.c: Add Irix 4.x core file support. + * hosts/irix4.h: #define HOST_IRIX4. + +Mon Apr 19 18:52:52 1993 Ken Raeburn (raeburn@deneb.cygnus.com) + + * aoutx.h (translate_from_native_sym_flags): Check that the + symbol's section does get set. + (slurp_symbol_table): Zero index means null-string name. + + * aoutx.h (struct stringtab_entry, struct stringtab_data): New + data structures. + (hash, stringtab_init, add_to_stringtab, emit_strtab, compare): + New functions. + (write_syms): Use them, to reduce string table size. + +Mon Apr 19 16:45:12 1993 Fred Fish (fnf@cygnus.com) + + * trad-core.c (trad_core_vec): Add 6 new initializers to match + new signed get/put fields. Minor reformatting to label + some fields. + +Mon Apr 19 06:09:41 1993 Jim Kingdon (kingdon@cygnus.com) + + * bfd-in.h: Insert comment about SVR3 compiler warnings. + + * hosts/{hp300,i386isc,i386v}.h: Remove unused #defines of {r,}index + (bfd uses strchr and the broken SVR3.2 cpp loses with the defines). + + * libbfd.c: bfd_put*: Remove casts to bfd_vma. + +Fri Apr 16 17:49:27 1993 Jim Kingdon (kingdon@cygnus.com) + + * aoutf1.h (internal_sunos_core): Make c_stacktop a bfd_vma. + (swapcore_sparc): Make sp a bfd_vma. + +Thu Apr 15 09:09:18 1993 Jim Kingdon (kingdon@cygnus.com) + + * libbfd.c: Add signed versions of bfd_{h_,}{get,put}_signed_<size>. + libbfd.c, libbfd-in.h: Add _do*signed*. + targets.c, all targets: Add bfd*signed*. + bfd-in.h: Add bfd_signed_vma. Add comments. + + * bfd-in.h (bfd_error), bfd.c (bfd_errmsgs): Add file_truncated. + + * format.c (bfd_check_error): Check error return from + _bfd_check_format routines. + +Wed Apr 14 23:48:25 1993 Jim Kingdon (kingdon@cygnus.com) + + * rs6000-core.c (rs6000coff_core_p): Improve error checking and + recognize .data section if present. + +Thu Apr 15 01:00:29 1993 John Gilmore (gnu@cygnus.com) + + * aoutx.h (aout_*_adjust_sizes_and_vmas): Avoid `sanity' + check for the case where the user sets the address of the BSS + section (and the file header can't specify this). Let the user + set it wherever they want, regardless of what goes in the header. + + * ieee.c (ieee_slurp_sections): Pass all ieee section names + straight through into BFD sections. Add comments. + +Wed Apr 14 20:34:54 1993 John Gilmore (gnu@cygnus.com) + + Cleanup in preparation for better 64-bit host support. + + * bfd-in.h (bfd_64_type): Remove. + * libbfd.c (_do_getb64, _do_putb64): Use bfd_vma, not bfd_64_type. + + * bfd-in.h (bfd_size): Remove. + + * bfd-in.h (bfd_offset): Remove, after fixing ld/ldlang.[ch]. + + * bfd-in.h (bfd_word): Remove. + * reloc.c (reloc_howto_type): Replace bfd_word with bfd_vma. + + * bfd-in.h (rawdata_offset): Remove. + * reloc.c (arelent): Replace rawdata_offset with bfd_size_type. + (bfd_perform_relocation): Lint. + (enum bfd_reloc_status): Comment cleanup. + + * aout-adobe.c, cpu-h8300.c, mipsbsd.c, srec.c: lint -Wall. + +Tue Apr 13 11:19:52 1993 Jim Kingdon (kingdon@cygnus.com) + + * aoutf1.h (swapcore_sparc): Guess the right value of USRSTACK. + +Mon Apr 12 14:18:00 1993 John Gilmore (gnu@cygnus.com) + + * elf32.c: Clean up old comments. + +Fri Apr 9 10:43:20 1993 Ian Lance Taylor (ian@cygnus.com) + + * config/sun3.h: String argument to fprintf is const. + + * coff-mips.c: Renamed PAGE_SIZE to ROUND_SIZE, to avoid confusion + on systems which define PAGE_SIZE in <limits.h>. + +Thu Apr 8 10:28:00 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * trad-core.c (trad_unix_core_file_failing_signal): Use new macro + TRAD_UNIX_CORE_FILE_FAILING_SIGNAL to allow host files to specify + the core file failing signal. + * hosts/decstation.h (TRAD_UNIX_CORE_FILE_FAILING_SIGNAL): Define + to supply the core file failing signal. + +Thu Apr 8 09:17:35 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (styp_to_sec_flags): Only set SEC_SHARED_LIBRARY for + a STYP_NOLOAD | STYP_BSS section if BSS_NOLOAD_IS_SHARED_LIBRARY + is defined. On many COFF targets STYP_BSS is always STYP_NOLOAD. + * coff-i386.h (BSS_NOLOAD_IS_SHARED_LIBRARY): Define. + +Wed Apr 7 11:33:06 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (PAGESIZE): Correct value. + +Tue Apr 6 12:05:44 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_find_nearest_line): Address of first PDR is + an offset (patch from Jean-Daniel Fekete <jdf@lri.lri.fr>). + +Mon Apr 5 12:07:12 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (styp_to_sec_flags): Set SEC_SHARED_LIBRARY for a + STYP_NOLOAD | STYP_BSS section. Don't set SEC_NEVER_LOAD for a + STYP_INFO section. + (coff_compute_section_file_positions): Force vma and lma of _LIB + section to be zero. + (coff_set_section_contents): Count number of entries in new lma + field, not in vma. + * coffgen.c (make_a_section_from_file): Force lineno_count of + SEC_SHARED_LIBRARY section to be zero, since it is non-zero on the + SCO 3.2v4 shared library. + * seclet.c (rel): Copy over any section with contents, not just + loadable sections. + + * coff-mips.c (ecoff_make_empty_symbol): Zero out newly allocated + symbol. + + * coff-i386.c (coff_i386_reloc): New function, to generate + relocateable output correctly. + (howto_table): Use coff_i386_reloc for all reloc types. + (CALC_ADDEND): Use a more efficient hack to get the correct addend + for a common symbol. + (i386comm_value): Removed; no longer needed. + +Sun Apr 4 15:08:48 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * coffcode.h (coff_set_section_contents): Don't write out + sections without a filepos. + +Fri Apr 2 14:35:05 1993 Ian Lance Taylor (ian@cygnus.com) + + * seclet.c (seclet_dump_seclet): Correct SEC_HAS_CONTENTS test. + +Wed Mar 31 17:41:05 1993 Ian Lance Taylor (ian@cygnus.com) + + * reloc.c (bfd_reloc_code_real_type): Added BFD_RELOC_MIPS_GPREL. + * libecoff.h (ecoff_data_type): Added gp_size field. + * coff-mips.c (ecoff_mkobject_hook): Initialize gp_size to 8. + (ecoff_set_symbol_info): Compare against gp_size, not hardcoded 8. + Set flags to 0 for large common symbols. + (ecoff_gprel_reloc): Handle non-zero addend for external symbols, + which can occur for gas-generated relocs. + (ecoff_bfd_reloc_type_lookup): Added BFD_RELOC_MIPS_GPREL case. + * bfd.c (bfd_get_gp_size, bfd_set_gp_size): New functions. + * Makefile.in (bfd.o): Now depends on coff/sym.h and libecoff.h. + +Tue Mar 30 09:33:16 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * srec.c (srec_set_section_contents): Use lma field for load + address. + * section.c: Add declaration of lma field to section structure. + * coffcode.h (coff_write_object_contents): Use lma field for load + address. + * bfd-in.h (bfd_set_section_vma): Set lma along with vma. + + * aoutx.h (translate_from_native_sym_flags): Now handles indirect + symbols in a better way. (translate_to_native_sym_flag): Set the + N_INDR bit when necessary. (aout<>slurp_symbol_table): Maintain + indirect state. + * section.c: Added BFD_IND_SECTION_NAME and bfd_ind_section. + (bfd_make_section): Cope with new builtin section. + * syms.c (bfd_decode_symclass): Can now print indirect section + info. + +Wed Mar 24 13:36:33 1993 Per Bothner (bothner@rtl.cygnus.com) + + * aout-target.h (MY(object_p)): Fail if MACHTYPE_OK is + defined, and yields false. + * aout-mipsbsd.c, i386bsd.c: Define MACHTYPE_OK appropriately. + + * archive.c (snarf_ar_hdr): Add support for reading (only, + so far) BSD-4.4-style extended headers. + * archive.c: Some more comments. + +Wed Mar 24 02:05:10 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com) + + * Makefile.in: fix rule for dvi and info, so that the recursive + makes does the right thing, instead of always info + +Wed Mar 24 02:56:44 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * libbfd.c (bfd_seek): Disable optimized handling for archives and + archive members; they need more special reatment. For now, verify + that computed and actual file positions correspond. + +Tue Mar 23 08:45:33 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * mipsbsd.c: Renamed from aout-mipsbsd.c. + (set_arch_mach): Delete non-MIPS code. + (reloc_howto_type_lookup): Ditto. + * Makefile.in: Adjusted. + + * libbfd.c (bfd_tell): Update `where' field. + (bfd_seek): Don't do anything if we're not changing the file + position. If FILE_OFFSET_IS_CHAR_INDEX is defined, check `where' + field against a SEEK_SET request. Call bfd_tell to re-update + `where' field when done. + (bfd_read, bfd_write) [FILE_OFFSET_IS_CHAR_INDEX]: Maintain + `where' field. + * hosts/sparc.h: Define FILE_OFFSET_IS_CHAR_INDEX. + +Mon Mar 22 23:18:10 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: added installcheck target + +Mon Mar 22 14:57:18 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_set_symbol_info): Relocate encapsulated stabs + if the type is not stNil. + +Tue Mar 16 10:35:27 1993 Ken Raeburn (raeburn@cygnus.com) + + * elf32.c (elf_little_vec, elf_big_vec): Delete now-invalid + forward declarations. + + * elf32-sparc.c (elf_sparc_howto_table): Don't use CONST here, + it's implied by the type. + +Fri Mar 12 18:58:08 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.host: recognize sparc-sun-solaris2* instead of sparc-sun-solaris* + +Tue Mar 9 09:23:12 1993 Jim Kingdon (kingdon@cygnus.com) + + * rs6000-core.c: Add .ldinfo section. + +Fri Mar 12 11:57:52 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (MAKEOVERRIDES): Define to be empty. + +Fri Mar 12 08:32:11 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * section.c (bfd_set_section_contents): whitespace + * seclet.c (seclet_dump_seclet): Don't try and fill sections with + no contents. + +Thu Mar 11 19:26:15 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * hosts/go32.h: don't define POSIX_UTIME + +Tue Mar 9 10:52:01 1993 Fred Fish (fnf@cygnus.com) + + * elf32.c (elf_object_p): Use ELF_ARCH stored in xvec to match + against machine architecture stored in the ELF header, to resolve + ambiguities. + * elf32.c (bfd_section_from_shdr): Bfd_make_section can return + NULL, so only use results when non-NULL. + * targets.c (elf32_m68k_vec, elf32_i860_vec): Add extern decls + and add to vector of targets. + +Mon Mar 8 15:13:44 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_set_symbol_info): Encapsulated STABS symbols + are always just debugging symbols. + + * coff-mips.c (ecoff_[gs]et_sym_index): Moved macros from here... + libecoff.h (ecoff_[gs]et_sym_index): ...to here. + +Mon Mar 8 14:55:13 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * hppa.c (_PA_RISC_ID): Defined if not already defined (e.g., for + hpux 7). Patch from friedman@gnu.ai.mit.edu. + (hppa_object_p): Only check for DL_MAGIC and SHL_MAGIC if they're + defined, which they aren't in hpux 7.0. + + * aix386-core.c: Include uinfo.h and coredump.h. Patch from Minh + Tran-Le, tranle@intellicorp.com. + +Fri Mar 5 14:54:21 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_generic_reloc): If the addend is non-zero, go + ahead and do the relocation. + (ecoff_refhi_reloc): Don't to the relocation here, just remember + what needs to be done. + (ecoff_reflo_reloc): Do the REFHI relocation here. + +Thu Mar 4 14:44:01 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_bfd_reloc_type_lookup): New function. + (ecoff_write_object_contents): Added BFD_ASSERT calls to ensure + relocs are reasonable. + * coff-msym.c: Eliminated uses of DEFUN. + (ecoff_swap_tir_out): New function. + +Tue Mar 2 17:52:58 1993 Fred Fish (fnf@cygnus.com) + + (Ultrix 2.2 support from Michael Rendell <michael@mercury.cs.mun.ca>) + * configure.host (vax-*-ultrix2*): Add triplet. + * hosts/vaxult2.h: New file. + * config/vaxult2.mh: New file. + + * aoutx.h (string.h): Include for strchr and friends. + * archive.c (string.h): Include for memchr and friends. + * elf32.c (string.h): Include for strrchr and friends. + +Sat Feb 27 00:44:24 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * aoutf1.c (sunos4_reloc_type_lookup): Unused; deleted. + (MY_set_sizes): Use sunos4_set_sizes. + + * elf32.c: Renamed from elf.c. Several CPU-specific functions + deleted, as well as elf-big and elf-little targets. + * libelf.h: New file. + * elf32-sparc.c, elf32-i386.c, elf32-i860.c, elf32-m68k.c: New + files, new targets. + * Makefile.in, config/*-elf.mt, targets.c: Adjusted. + + * i386linux.c (TARGETNAME): Use hyphens instead of parentheses. + + * coffcode.h (coff_compute_section_file_positions): Don't need + variable "old_sofar" if compiling for i960. + + * reloc.c (bfd_default_reloc_type_lookup): First argument is now a + bfd pointer. + * libbfd.h: Updated. + + * ieee.c (exten, envi): "static" belongs first in declaration. + +Fri Feb 26 17:37:34 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * srec.c: add support for symbolsrec, srecords with symbols in + them. + +Thu Feb 25 11:43:30 1993 John Gilmore (gnu@cacophony.cygnus.com) + + * ieee.c: cast all arguments of ieee_write_byte to bfd_byte + to avoid lint complaints. + +Thu Feb 25 02:15:52 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf.c (elf_write_object_contents): Section ".shstrtab" should be + type SHT_STRTAB. Don't alter file offset for section 0. + (reloc_type_names): Now an array instead of a macro. Still inside + "#if 0", since it's used only in debugging code also in "#if 0". + (struct elf_reloc_map_elt, struct elf_reloc_map): New types. + (sort_reloc_map): New function. + (sparc_reloc_map): New variable. + (elf_bfd_reloc_type_lookup): New function. + +Tue Feb 23 12:17:16 1993 Ian Lance Taylor (ian@cygnus.com) + + * bfd-in.h (JUMP_TABLE): Added bfd_reloc_type_lookup and + bfd_make_debug_symbol; they were already in the target structure. + * Adjusted all uses of JUMP_TABLE. + * coffgen.c, libcoff-in.h (coff_bfd_make_debug_symbol): Renamed + from coff_make_debug_symbol. + * libcoff.h: Updated accordingly. + + * Minor cleanups provoked by gcc warnings: + * aoutx.h (NAME(aout, reloc_type_lookup)), + cpu-h8300.c (local_bfd_reloc_type_lookup), + cpu-z8k.c (local_bfd_reloc_type_lookup): Added default case to + switches. + * archive.c (do_slurp_bsd_armap, do_slurp_coff_armap), + ieee.c (ieee_slurp_section_data), + elf.c (elf_make_sections, elf_fake_sections, + elf_compute_section_file_positions, elf_write_object_contents): + Removed unused variables. + * archures.c: Removed /* from within comment. + * bout.c (b_out_squirt_out_relocs): Initialize r_extern. + * oasys.c (oasys_write_data): Initialize i. + +Mon Feb 22 18:40:06 1993 Per Bothner (bothner@rtl.cygnus.com) + + * libcoff.h (obj_raw_syment_coun): New macro. + * coffgen.c (coff_get_normalized_symtab): Initialize + raw_syment_count. + * coffgen.c (coff_find_nearest_line): Numerous little fixes. + +Mon Feb 22 15:03:07 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (ecoff_set_symbol_info): stBlock symbols are always + debugging symbols. + (ecoff_get_debug): Offset the fdr adr by the adr of the first pdr, + for compatibility with tools from MIPS. + + * config/bigmips.mt: New file; default vector is ecoff_big_vec. + * config/irix3.mt, config/irix4.mt: Removed. + * configure.in (mips-*-ecoff): New target; uses bigmips.mt. + (mips-sgi-*, mips-big-*): Use bigmips rather than irix3. + +Wed Feb 17 23:40:41 1993 John Gilmore (gnu@cygnus.com) + + * hosts/hp300bsd.h: Add gross hack to determine whether we + are running on BSD 4.3 or BSD 4.4, and use appropriate include + files (and set other parameters) to match. + +Wed Feb 17 12:28:13 1993 K. Richard Pixley (rich@cygnus.com) + + * trad-core.c (trad_unix_make_empty_symbol): wrap PARAMS around an + ansi definition which otherwise confuses non-ansi compilers. + + * aout-adobe.c (aout_adobe_object_p): eliminate a warning from vax + ultrix cc by forward declaring getenv as is done in + bfd_find_target. + +Tue Feb 16 17:56:58 1993 K. Richard Pixley (rich@cygnus.com) + + * elf.c (elf_info_to_howto): cast an enum into unsigned char + avoiding a fatal error in vax ultrix 4.2 cc. + +Tue Feb 16 00:44:54 1993 John Gilmore (gnu@cygnus.com) + + * bfd-in.h, VERSION: Roll to version 2.1. + +Mon Feb 15 20:43:51 1993 John Gilmore (gnu@cygnus.com) + + * oasys.c (oasys_write_object_contents): Lint. + * srec.c: Whitespace cleanup. + +Fri Feb 12 14:23:07 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffgen.c (coff_print_symbol): Print correct tagndx value; + cleaned up output formatting a bit. + +Fri Feb 12 08:28:56 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * coffcode.h (coff_set_arch_mach_hook): *FIXME* the H8/300 is always + relaxable. Should be moved somewhere else. + +Thu Feb 11 14:09:42 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * aout-mipsbsd.c: Eliminated uses of DEFUN. + (aout_mips_*_vec): Added seclet_link element. + + * Makefile.in (BFD_BACKENDS, CFILES, aout-mipsbsd.o): Added + support for aout-mipsbsd target. + + * bout.c (get_value): Don't truncate 32-bit addend to 16 bits. + +Fri Feb 5 08:08:43 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * cpu-h8500.c (scan_mach): return false if it's not an H8/500 + +Thu Feb 4 12:52:40 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + Add support for the H8/500 + + * coff-h8500.c, cpu-h8500.c, archures.c, coffcode.h, targets.c + +Thu Feb 4 12:35:02 1993 Ian Lance Taylor (ian@cygnus.com) + + * libecoff.h: New file. Defines ECOFF backend data for gdb. + * coff-mips.c: Now includes libecoff.h. + (ecoff_data_type): Moved to libecoff.h. + (ecoff_slurp_symbolic_info): Made globally visible so that gdb can + call it. If there is ever another ECOFF target, this and the + swapping functions should be accessed via an ECOFF specific target + vector. + * Makefile.in (coff-mips.o): Depends on libecoff.h. + +Wed Feb 3 09:14:36 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h: Removed MIPS specific information, since coff-mips.c + no longer includes this file. + + * coff-msym.c (ecoff_swap_fdr_in, ecoff_swap_ext_in): Set reserved + bits to 0 to make comparison test useful. + + * config/irix3.mh, config/irix4.mh (HDEFINES): Set to -G 4 to + avoid overflowing GP accessible sections in binutils/objdump. + +Tue Feb 2 15:36:55 1993 Per Bothner (bothner@cygnus.com) + + * aoutx.h (NAME(aout,slurp_symbol_table)): Made symbol + reading more robust: Fail if string index is out of string + table range. + +Tue Feb 2 11:43:25 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * bout.c (b_out_get_relocated_section_contents, cases PCREL24 and + PCREL13): Don't take dst_address into account; the input file has + already taken care of that. + +Tue Feb 2 11:41:06 1993 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c: Completed support for linker and binutils. + +Mon Feb 1 14:45:38 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * bout.c (b_out_get_relocated_section_contents, case ABS32): Keep + original addend from section contents. + +Thu Jan 28 21:01:37 1993 John Gilmore (gnu@cygnus.com) + + Fix minor bugs reported by Carl Greco, <cgreco@parrot.creighton.edu>: + * hosts/delta88.h (strtol): Fix prototype. + * config/m88k-coff.mt (SELECT_ARCHITECTURES): Fix name. + +Wed Jan 27 17:16:51 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf.c: Get rid of "#ifdef sparc". + (RELOC_TYPE_NAMES): Never used (currently), so don't include it. + (elf_sparc_howto_table): Renamed from elf_howto_table, and always + used. + (elf_info_to_howto): Use runtime conditionals on CPU type, not + compile type conditionals on host CPU. + (elf_little_vec, elf_big_vec): Use bfd_default_reloc_type_lookup, + not null pointer. + (reloc_type, RELOC_TYPE_NAMES): Include i386 values. + +Tue Jan 26 11:43:14 1993 Ian Lance Taylor (ian@cygnus.com) + + * section.c (SEC_IS_COMMON): New section flag, needed for MIPS + ECOFF which has two common sections. + (bfd_com_section): Set SEC_IS_COMMON flag. + * bfd-in.h (bfd_is_com_section): New macro to test SEC_IS_COMMON. + * aoutx.h, archive.c, bout.c, coff-a29k.c, coff-m88k.c, + coff-mips.c, coffgen.c, ieee.c, oasys.c, reloc.c, syms.: Use + bfd_is_com_section macro rather than checking for equality to + bfd_com_section. + +Mon Jan 25 15:27:36 1993 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (_bfd_coff_mkobject_hook): Pass aouthdr argument. + (coff_mkobject_hook): Accept aouthdr argument. + * coffgen.c (coff_real_object_p): Pass aouthdr to mkobject_hook. + Handle NULL aouthdr argument. + (coff_object_p): If there is no aouthdr, pass it as NULL to + coff_real_object_p. + * libcoff.h: Rebuilt for mkobject_hook changes. + + * coffswap.h (coff_swap_aouthdr_in, coff_swap_aouthdr_in): Swap + additional MIPS ECOFF fields. + +Sat Jan 23 18:36:20 PST 1993 Ralph Campbell (ralphc@pyramid.com) + + * configure.host: added mips-dec-bsd* + * configure.in: added mips-dec-bsd* + * aout-mipsbsd.c: new file for mips-dec-bsd* + * aout-target.h: don't define '' if 'MY_BFD_TARGET' is defined. + * aoutx.h: added mips support. + * archures.c: added mips support to bfd_default_scan(). + * cpu-mips.c: added support for R4000 (untested). + * libaout.h: added MIPS1 & MIPS2 magic numbers. + * reloc.c: fix typo's in comments. Added BFD_RELOC entries which I + hope will make it into include/bfd.h. + * targets.c: added aout_mips_*_vec. + +Wed Jan 20 17:15:52 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config/decstation.mt: Set DEFAULT_VECTOR to ecoff_little_vec. + +Tue Jan 19 09:06:14 1993 Ian Lance Taylor (ian@cygnus.com) + + * bfd-in.h (bfd_asymbol_value): Add needed parentheses. + + * libcoff-in.h: Update prototype for coff_count_linenumbers. + +Fri Jan 15 18:13:17 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-msym.c (ecoff_swap_hdr_out, ecoff_swap_fdr_out, + ecoff_swap_pdr_out, ecoff_swap_sym_out, ecoff_swap_ext_out, + ecoff_swap_rndx_out, ecoff_swap_rfd_out, ecoff_swap_opt_in, + ecoff_swap_opt_out, ecoff_swap_dnr_in, ecoff_swap_dnr_out): New + functions. + * coffswap.h: If NO_COFF_RELOCS is defined, don't define + bfd_swap_reloc_in or coff_swap_reloc_out. + * coff-mips.c: Added code to link and write out symbolic debugging + information, and to swap relocs in and out. + +Thu Jan 14 15:51:58 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * libcoff.h, coffgen.c (coff_count_linenumbers), coffcode.h + (coff_write_object_contents): coff_count_linenumbers returns the + number of line number records it found. + + * coffgen.c (coff_write_linenumbers): only write out line numbers + in the section they belong to. + +Mon Jan 11 18:32:22 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * targets.c (bfd_target): Added relocateable argument to + _bfd_get_relocated_section_contents. Added _bfd_seclet_link + target vector for linker use. + * bfd.c (bfd_seclet_link): New macro. + * bfd-in.h (JUMP_TABLE): Added _bfd_seclet_link. + * seclet.c (rel, seclet_dump_seclet): Added relocateable argument + and boolean return value. Made static. + (bfd_generic_seclet_link): Renamed from seclet_dump. Added + relocateable argument. + * reloc.c (bfd_generic_get_relocated_section_contents): Added + relocateable argument (if relocateable, saves relocs). + * bout.c (b_out_get_relocated_section_contents), + reloc16.c (bfd_coff_reloc16_get_relocated_section_contents): Added + relocateable argument (if relocateable, just calls + bfd_generic_get_relocated_section_contents). + * libcoff-in.h (bfd_coff_reloc16_get_value): Added relocateable + argument to prototype. + * All targets: Set new _bfd_seclet_link vector to + bfd_generic_seclet_link. + +Sat Jan 9 21:29:32 1993 Stu Grossman (grossman at cygnus.com) + + * coffgen.c: #include seclet.h. + +Sat Jan 9 19:48:14 1993 Stu Grossman (grossman at cygnus.com) + + * hppa.c (hppa_object_setup): Get rid of all knowledge of stabs + debug info. Setup info about linker symbols only, and use + standard bfd fields to hold the info. + * (hppa_object_p): Remove unneeded decls. + * (hppa_new_section_hook): Get rid of most of this. + * libhppa.h (struct hppadata): Remove ten pounds of useless ugly + fat. Remove all knowledge of stabs, remove redundant knowledge of + linker symbols. + * Remove macros for accessing fields which are now gone. + +Fri Jan 8 15:20:00 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * coffcode.h (sec_to_styp_flags): allow SEC_NEVER_LOAD to turn on + STYP_NOLOAD bit. + * coff-z8k.c: delete unused reloc functions + +Fri Jan 8 15:47:53 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bfd.c (struct _bfd): Added ecoff_tdata to tdata union. + * targets.c (enum target_flavour): Added bfd_target_ecoff_flavour. + * coff-msym.c: Use DEFUN for function definitons. + * coff-mips.c: Added code to read and print symbols, and to find + line numbers. + + * coffcode.h: Moved many generic functions into coffgen.c. Moved + swapping functions into coffswap.h for ECOFF use. Moved + relocation functions, only used by h8300 and z8k, into reloc16.c. + Added hooks for coffgen.c functions to backend data structure, and + added hook functions. Still more could be done. + * coffswap.h: New file to hold COFF swapping routines. + * coffgen.c: New file to hold generic COFF functions. + * reloc16.c: New file to hold h8300 and z8k specific relocation + functions. + * libcoff-in.h: Added declarations for functions in coffgen.c. + * libcoff.h: Rebuilt to incorporate changes. + * coff-h8300.c: Function name changes. + * coff-z8k.c: Function name changes. Use coff_reloc16_extra_cases + hook rather than defining EXTRA_CASES. + * Makefile.in: Build new files coffgen and reloc16. Added + dependencies of coff-*.o on coffswap.h and seclet.h. + +Thu Jan 7 16:16:26 1993 Per Bothner (bothner@cygnus.com) + + * ieee.c (ieee_slurp_sections): Add cast to avoid warning + about discarding const. + +Wed Jan 6 00:16:49 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * archive.c, seclet.c, elf.c use bfd_xmalloc instead of malloc + +Tue Jan 5 09:35:57 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * configure.in (post-target): If --with-minimal-bfd is specified, + set MINIMIZE=1. + +Mon Jan 4 07:20:01 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * srec.c (srec_write_records): one of my boards wants a CR between + records. + +Wed Dec 30 12:46:30 1992 Ian Lance Taylor (ian@cygnus.com) + + * archive.c (do_slurp_coff_armap): set symdef_count correctly + (it broke a couple of weeks ago). + +Tue Dec 29 21:41:05 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * elf.c (bfd_elf_find_section): Switch back to "struct ..." for + return type, so libbfd.h doesn't reference undefined typedefnames. + +Tue Dec 29 13:54:35 1992 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (coff_real_object_p): use name I386AIXMAGIC rather + than I386SVMAGIC. + (coff_pointerize_aux): don't pointerize a negative tagndx + (sometimes generated by SCO 3.2v4 cc). + + * bout.c (calljx_callback, callj_callback, + b_out_get_relocated_section_contents): warn if relocating against + an undefined symbol. + +Mon Dec 28 14:30:55 1992 Stu Grossman (grossman at cygnus.com) + + * hppa.c: Get rid of DEFUN, use more conventional prolog stuff. + Make a bunch more routines be static. + * hppa.c (fill_spaces): Get rid of this, replace with much better + written setup_sections(). + * (setup_sections): New routine to create BFD sections for each + space and subspace in SOM files. + * (hppa_object_setup): Use BFD sections created by + setup_sections() to locate GDB symbol table info. + * (make_unique_section): New routine to create a BFD section. It + ensures that the given name is unique, and will generate a unique + one if necessary. + * (hppa_object_p): Become much more paranoid about file header. + * (make_bfd_asection): Call bfd_make_section to do the dirty + work. Simplify code somewhat. + * (hppa_core_file_p): Use proper name for stack section. + * libhppa.h: Remove millicode_start, millicode_end decls. + +Mon Dec 28 11:03:22 1992 Ken Raeburn (raeburn@cygnus.com) + + * Makefile.in (coff-we32k.o, coff-z8k.o): Note dependencies. + + * reloc.c (bfd_perform_relocation): For normal 2- or 4-byte + relocs, don't bother doing the adjustment if the value to add is + zero. + +Sun Dec 27 17:45:05 1992 Fred Fish (fnf@cygnus.com) + + * bfd.c (bfd_get_size): New function that gets an upper bound + on the possible size of any object in a bfd. + * elf.c (bfd_elf_find_section, elf_get_str_section, + elf_get_symtab_upper_bound): Rewrite to avoid NULL pointer + dereferences. + * elf.c (elf_big_vec, elf_little_vec): Document last three + members initialized to NULL. + +Thu Dec 24 17:49:09 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * hppa.c: change a 'const' to 'CONST', or else HP C compiler dies + +Mon Dec 21 16:33:34 1992 Per Bothner (bothner@rtl.cygnus.com) + + * hosts/std-host.h: New file. Attempt at a generic/default + set of definitions, to discourage porting to new hosts by copying. + * hosts/news.h: Removed. + * hosts/sparc.h: Use std-host.h. + * bfd-in.h: New macros bfd_asymbol_bfd and bfd_asymbol_flavour; + perhaps we can later remove the the_bfd field from each symbol. + * syms.c (struct symbol_cache_entry): Remove unused field + app_data. Add comment noting that the_bfd is almost redundant, + but not quite. + * aoutx.h, coff-a29k.c, coff-i386.c, coff-i960.c, coffcode.h: + Use new macros bfd_asymbol_bfd and bfd_asymbol_flavour. + * hppa.c (fill_spaces): Make slightly more rebust. + * configure.in: Allow std-host as the "default" host. + +Mon Dec 21 17:24:13 1992 Stu Grossman (grossman at cygnus.com) + + * bfd.c: Add struct hppa_core_data to tdata union. + * hppa.c: Conditionalize on HOST_HPPAHPUX instead of hp9000s800. + Get rid of HPPA/BSD specific code. That will go somewhere else + someday. + * (fill_spaces): Don't spin forever and die if you don't find + $MILLICODE$ subspace. + * (hppa_object_p): Make sure that we have a real honest-to-cthulu + exec file! + * (hppa_core_file_failing_signal, hppa_core_file_failing_command): + Make these work for HPUX. + * (make_bfd_asection): New routine to make section creation a + little easier. + * (hppa_core_file_p): Completely rewrite, leave out bugs. + * libhppa.h: #include the right system files. Redefine all of + the structs/macros for hacking core files to use more sensible + HPUX core file structures. + * targets.c (target_vector): Conditionalize hppa_vec on + HOST_HPPAHPUX, not hp9000s800. + * hosts/hppahpux.h: #include stdlib.h to get correct decls for + malloc and realloc. #define HOST_HPPAHPUX. + +Mon Dec 21 12:40:10 1992 Ian Lance Taylor (ian@cygnus.com) + + * Patches from Minh Tran-le <mtranle@paris.intellicorp.com>. + * configure.in (i386-*-isc*, i386-*-aix*): New targets. + * configure.host (i386-*-isc*, i386-*-aix*): New hosts. + * hosts/i386isc.h, config/i386isc.mh: New files for Interactive + Unix. + * hosts/i386aix.h, config/i386aix.mh: New files for AIX on PS/2. + * aix386-core.c: New file for handling core files on AIX on PS/2. + * targets.c: if AIX386_CORE, use aix386_core_vec. + * coffcode.h (coff_real_object_p): check for I386SVMAGIC as well + as I386MAGIC. + +Fri Dec 18 10:20:27 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * aoutf1.h (sunos4_write_object_contents): set flags to 0, fixing + 1927. + +Thu Dec 17 19:35:32 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: added dvi target + +Thu Dec 17 00:36:24 1992 John Gilmore (gnu@cygnus.com) + + * bfd.c: Use right name for tekhex tdata struct. + * tekhex.c: Insert leading_char (0) into bfd_target struct. Style. + * libcoff.h: Updated to get spacing change from coffcode.h. + * trad-core.c: leading_char is 0 (no symbols!), not '_'. + +Tue Dec 15 15:40:30 1992 Per Bothner (bothner@cygnus.com) + + * archive.c (do_slurp_bsd_armap, do_slurp_coff_armap): New + functions, with the "guts" of the old bfd_slurp_bsd_armap + and bfd_slurp_coff_armap, but assuming we've already checked + if the armap is present or not. + Also, rewrite a bit to avoid keeping around obstack data + that we don't need. + * archive.c (snarf_ar_header, _bfd_slurp_extended_name_table): + Various fixes to correctly handle COFF_style archives names. + (Note that because these have a trailing '/', the names can + have embedded spaces.) + * archive.c (bfd_slurp_armap): New function, replaces old + bfd_slurp_bsd_armap and bfd_slurp_coff_armap. Recognizes + _either_ format, and calls do_slurp_bsd_armap or + do_slurp_coff_armap if either form of map is seen. + * libbfd-in.h: Changed bfd_slurp_bsd_armap and + bfd_slurp_coff_armap into macro synonyms for bfd_slurp_armap. + * elf.c (elf_slurp_armap, elf_write_armap): Fix. + * Makefile.in (AR_FLAGS): Use rc instead of non-standard qc. + +Mon Dec 14 17:08:08 1992 Stu Grossman (grossman at cygnus.com) + + * hppa.c: #include "sysdep.h", not <sysdep.h>. + * libhppa.h: Make millicode_start and millicode_end be unsigned + int to be same type as CORE_ADDR in GDB. Why are these here? + +Sat Dec 12 15:54:36 1992 Ian Lance Taylor (ian@cygnus.com) + + * coff-i386.c (CALC_ADDEND): if reloc is PC relative, add the + vaddr of the section to the addend. + * targets.c: if MINIMIZE is 1, and SCO_CORE is defined, add + SCO_CORE to SELECT_VECS. + (target_vector): add sco_core_vec. + * sco-core.c (sco_core_vec): add leading underscore initializer. + * configure.in (i[34]86-*-sco*): use target i386-sco. + * config/i386-sco.mt: new file; define SCO_CORE. + +Thu Dec 10 02:13:15 1992 John Gilmore (gnu@cygnus.com) + + * aout-adobe.c (aout_adobe_object_p): Fix !strcmp thinko. + +Fri Dec 4 14:02:49 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * coffcode.h (bfd_coff_std_swap_table): Now static and const. + +Thu Dec 3 16:54:58 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * hosts/i386linux.h: Include unistd.h. + + * aoutx.h (print_symbol): aout_stab_name returns a constant + string. + * libaout.h (aout_stab_name): Fix prototype. + * stab-syms.c (aout_stab_names): Array is now const. + (aout_stab_name): Return value is now pointer to const. + + * aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, + syms.c: Doc fixes. + + * syms.c (asymbol): Added new field "app_data", for data + particular to the application. Some of the linker flags ought to + get moved to this field someday. + + * archures.c (bfd_default_scan): Recognize a few more numbers: + 80486, 80960, and 960. + + * bfd-in.h (COFF_SWAP_TABLE): New is just address of + bfd_coff_std_swap_table, cast to PTR. + * bfd.c (bfd_coff_swap_*): Deleted macros. + * targets.c (struct bfd_target): Deleted COFF-specific swapping + routine pointers. + * coffcode.h (type bfd_coff_backend_data): New structure type, + contains pointers to the COFF-specific swapping routines. + (bfd_coff_std_swap_table): New data structure, to be used when + NO_COFF_SYMBOLS and NO_COFF_LINENOS are not defined. + (bfd_coff_swap_*): New macros. + * coff-mips.c (mips_coff_swap_table): New data structure. + (ecoff_big_vec): Use it. + * All COFF targets: Moved COFF_SWAP_TABLE to target-specific data. + * All other targets: Deleted coff-specific vector entries. + + * trad-core.c: Fixed some `PARAMS' uses that were missing + parentheses. + +Sun Nov 29 08:37:13 1992 Fred Fish (fnf@cygnus.com) + + * aoutx.h (some_aout_object_p): Protect arg prototype in + callback_to_real_object_p with PARAMS macro for non-ANSI compilers. + +Sat Nov 28 04:01:21 1992 John Gilmore (gnu@cygnus.com) + + * aout-target.h, aoutf1.h, trad-core.c, coffcode.h, libaout.h, + libbfd-in.h, bfd-in.h: Eliminate all PROTO calls, replace with + PARAMS for readability. + + * aoutx.h: Add type to callback parameter. + * coff-mips.c: Don't call trad-core.h, not needed. + * trad-core.c: Incorporate trad-core.h declarations. Fix comments. + * trad-core.h: Eliminate, unused. + +Wed Nov 18 13:16:17 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * format.c (bfd_check_format): if default target isn't found + then look through the entire list rather than return early. + +Mon Nov 16 14:33:03 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config/i960-coff.mt: reorder vec to match bfd_check_format (from Per) + +Thu Nov 12 17:01:41 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: pass down prefix and exec_prefix in FLAGS_TO_PASS + +Thu Nov 12 09:46:47 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-z8k.c: checkpoint, more addressing modes handled + * coffcode.h (get_value): don't truncate reloc->addend field, it's + a long now. + +Wed Nov 11 23:57:55 1992 Brendan Kehoe (brendan@cygnus.com) + + * we32k.mt (TDEFAULTS): Use we32kcoff_vec, not i386coff_vec. + +Tue Nov 10 14:04:38 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: minor tweaks to make $(CC) command lines more consistent + +Mon Nov 9 23:58:17 1992 John Gilmore (gnu@cygnus.com) + + * opncls.c (bfd_fdopenr, bfd_close): Add doc about cacheing + and about when file descriptors are closed. + +Sat Nov 7 00:42:20 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * bout.c (b_out_squirt_out_relocs): Make sure alignment relocs get + written out correctly. + +Thu Nov 5 15:34:19 1992 Ian Lance Taylor (ian@cygnus.com) + + * section.c: New section bit SEC_SHARED_LIBRARY. + coffcode.h (styp_to_sec_flags): if STYP_NOLOAD && (STYP_TEXT || + STYP_DATA), set SEC_SHARED_LIBRARY. This seems to be correct for + i386-sysv. + +Thu Nov 5 04:43:09 1992 John Gilmore (gnu@cygnus.com) + + * target.c (struct bfd_target): Eliminate the SDEF and SDEF_FMT + macros; use PARAMS to declare the function pointers involved. + + * bfd-in.h, bfd.c, libbfd.h, reloc.c, seclet.h, section.c, + targets.c: Rename struct bfd_seclet_struct to struct bfd_seclet. + +Thu Nov 5 02:59:09 1992 John Gilmore (gnu@cygnus.com) + + Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS. + + * archures.c, reloc.c, section.c, tekhex.c: Use PARAMS in + declaring pointers to functions. + * cache.c, elf.c: Move static function decls to top, use PARAMS. + * seclet.h: Declare external function with PARAMS. + + * doc/chew.c (exfunstuff): Eliminate. + (paramstuff): Replace exfunstuff with function to generate PARAMS. + * doc/proto.str: Use paramstuff rather than exfunstuff. + + * libbfd.h: Update, based on changes in source code and chew. + +Wed Nov 4 22:47:29 1992 John Gilmore (gnu@cygnus.com) + + * libieee.h: Add FIXME about removing limit on number of sections. + * bfd-in.h: Improve comments to make it clear that bfd.h is + the wrong place to edit this file. + * Makefile.in (install): Install ansidecl.h and obstack.h in the + same places where we install bfd.h. + +Wed Nov 4 13:40:23 1992 Sean Eric Fagan (sef@cygnus.com) + + * coffcode.h (coff_swap_aux_out, coff_swap_aux_in): check for + symbol type before blindly modifying the auxent. Specifically, + only modify the endndx fields for types that need it, and don't + set the array information for non-arrays. + +Wed Nov 4 09:30:50 1992 Ken Raeburn (raeburn@cygnus.com) + + * aoutx.h (some_aout_object_p): Section list should be set up + correctly anyways; don't have to set up "next" pointers manually. + +Mon Nov 2 12:36:14 1992 Ian Lance Taylor (ian@cygnus.com) + + * config/delta88.mh, config/hp300.mh, config/hppahpux.mh, + config/i386v.mh: removed -DUSG from HDEFINES. + hosts/delta88.h, hosts/hp300.h, hosts/hppahpux.h, hosts/i386v.h: + defined USE_UTIME. + hosts/i386v.h: don't define POSIX_UTIME. + +Fri Oct 30 16:13:52 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * ieee.c (ieee_slurp_sections): make a private copy of the + section's name before truncating it. + +Thu Oct 29 08:30:50 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * hppa.c: add symbol_leading_char entry in transfer vec + +,Wed Oct 28 16:11:57 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * ieee.c (get_symbol): can now cope when two symbols of a + different class, but the same index number occur consecutively. + (get_section_entry): nicer name for sections being forward + referenced. (ieee_archive_p): don't free the filename string, + since it was never malloced. + +Wed Oct 28 13:42:09 1992 John Gilmore (gnu@cygnus.com) + + * coffcode.h (coff_write_object_contents): Zero timestamp field. + +Tue Oct 27 12:24:34 1992 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (coff_swap_aux_out): set the fcnary info before + optionally setting the dimen info, since they are in the same + memory locations. Also zero out external auxent. + (coff_write_symbol): don't zero external auxent; now done in + coff_swap_aux_out. + +Fri Oct 23 13:55:35 1992 Ian Lance Taylor (ian@cygnus.com) + + * Check fclose return value for errors. + libbfd.h: bfd_cache_close now returns a boolean. + cache.c (bfd_cache_delete): return fclose success value. + (bfd_cache_close): return bfd_cache_delete return value. + opncls.c (bfd_close, bfd_close_all_done): return result of + bfd_cache_close. + +Fri Oct 23 10:32:36 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * seclet.c (rel): don't load sections without the SEC_LOAD bit. + +Thu Oct 15 10:16:35 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-m68k.c (m68k_howto2type, SELECT_RELOC): new function to + work out a coff relocation type from a howto's attributes rather + than using the input r_type field. This fixes PR1677 and allows + conversion of a.out relocs to coff relocs. + + * coffcode.h (coff_write_relocs): if supplied a relocation + relative to an absolute symbol, use the right symbol index. + + * reloc.c (bfd_perform_relocation): do a partial link for coff + relocs right. + +Fri Oct 23 08:15:56 1992 Ian Lance Taylor (ian@cygnus.com) + + * changes to support i386-sysv with shared libraries: + * coffcode.h (sec_to_styp_flags): if TWO_DATA_SECS is defined, + check for .data2; if _LIB is defined, check for it; map + SEC_NEVER_LOAD to STYP_NOLOAD. + (styp_to_sec_flags): map STYP_NOLOAD to SEC_NEVER_LOAD. + (make_a_section_from_file): if TWO_DATA_SECS, accept .data2. + (coff_write_object_contents): force vaddr of .lib to 0; set scnptr + if section has contents, not just if it is loadable; if + TWO_DATA_SECS, check for .data2 + (coff_set_section_contents): set vma of .lib section to number of + .lib sections. + * coff-i386.c: define TWO_DATA_SECS; use a special CALC_ADDEND; + don't define coff_write_armap to bsd_write_armap. + * hosts/i386v.h: don't include <utime.h>, since it is not provided + by SVR3.2. + +Thu Oct 22 22:40:20 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * solaris2.h: Get the definition of alloca from alloca.h if we + aren't using gcc. + +Thu Oct 22 03:07:28 1992 John Gilmore (gnu@cygnus.com) + + * configure.in (i960-*-{aout,bout}): Support these. + +Wed Oct 21 03:46:34 1992 John Gilmore (gnu@cygnus.com) + + * config/a29k-aout.mt (DEFAULT_TARGET): Set to one that exists. + +Thu Oct 15 15:05:39 1992 Per Bothner (bothner@cygnus.com) + + * apollo68.h, apollov68.h, hp300.h, i386v.h, irix3.h: Remove + no-longer-used definitions of L_SET and L_INCR. + * i386linux.h: Tweaks to smooth Linux build. + +Thu Oct 15 01:32:22 1992 John Gilmore (gnu@cygnus.com) + + * seclet.h: Add enum tag to bfd_seclet_enum_type. + + * bfd-in.h (file_ptr): Update comments, make FIXME re off_t. + + * aout-adobe.c, aoutf1.h, archive.c, bout.c, coff-rs6000.c, + coffcode.h, elf.c, ieee.c, libaout.h, libbfd.c, oasys.c, + sco-core.c: Lint: Second argument of bfd_seek is always file_ptr. + Third argument is SEEK_SET or SEEK_CUR. Result is always 0 or -1. + + * aout-adobe.c, aoutf1.h, aoutx.h, bout.c coff-m68k.c, coff-z8k.c, + coffcode.h, elf.c, libaout.h, libbfd-in.h, srec.c: Lint. + +Fri Oct 9 03:46:37 1992 John Gilmore (gnu@cygnus.com) + + * configure.host: New file, contains mapping of host configs + to host support file names for bfd, binutils, opcodes. + * configure.in: Use it. + * i386aout.c: Cleanup, dump TARGET_IS_LITTLE_ENDIAN_P. + * i386bsd.c: Cleanup, reformat. + * config/i386-bsd.mt: Comment changes. + * config/i386bsd.mh: New file for core file support. + * hosts/i386bsd.h: Merge changes from Peter Schauer. + * bout.c (ALIGN): Rename to ALIGNER, since system header files + on BSD 4.4 define ALIGN (sigh!). + +Thu Oct 8 22:18:10 1992 Mark Eichin (eichin at tweedledumber.cygnus.com) + + * libaout.h (aout_backend_data): added exec_header_not_counted + field. For ZMAGIC files only, when text_includes_header is set, by + default the length of the exec header is counted in the text + section size. For go32, exec header is mapped in but does *not* + contribute to the size of section. + * aoutx.h (aout_adjust_sizes_and_vmas): if exec_header_not_counted + is not set, but ztih is, add the size of the exec header to the + recorded size of the text section. + * aoutf1.h (sunos4_aout_backend): clear exec_header_not_counted. + * i386aout.c (i386aout_backend_data): set exec_header_not_counted. + Also set text_includes_header. + * aout-target.h (*_backend_data): cleare exec_header_not_counted + by default in MY(backend_data). + +Thu Oct 8 18:12:49 1992 Ken Raeburn (raeburn@cygnus.com) + + * aout-target.h (callback): Don't define this function if it won't be + used. + + * aoutx.h (some_aout_object_p): Restore old aout_data value if this + type doesn't match. Don't lose if file sections have already been + created. + (set_arch_mach): Set reloc_entry_size. + (slurp_symbol_table): Use bfd_h_get_{16,8} for reaeding symbol data. + + * hosts/i386bsd.h: New file. + * configure.in: Recognize i[34]86-*-bsd host. + + * aout-target.h (callback, write_object_contents): Delete unused + variables. + + * aoutx.h (reloc_type_lookup): New function. + * aout-target.h (MY_reloc_howto_type_lookup): Use it as default. + * aoutf1.h (sunos4_reloc_type_lookup): Deleted. + (MY_reloc_howto_type_lookup): Don't define it. + + * aoutx.h (adjust_sizes_and_vmas): Don't bother with padding for + OMAGIC files. + (slurp_symbol_table): Use header byte order, not target byte + order, for reading symbol data. + +Thu Oct 8 17:33:39 1992 John Gilmore (gnu@cygnus.com) + + * configure.in: Undo some brain damage in the host section. + * configure.in: Reformat the target section, test many configs. + * Makefile.in (make): Remove obsolete `make make'. + * aoutx.h (some_aout_object_p): Make defines line up. + +Thu Oct 8 08:52:48 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + Now a bfd knows whether underscores are normally prepended + to symbols in its file format. + + * aout-adobe.c, aout-target.h, bout.c, coff-a29k.c, coff-h8300.c, + coff-z8k.c: targets set so they have leading underscore + * coff-i386.c, coff-i960.c, coff-m68k.c, coff-mips.c, coff-m88k.c, + coff-rs6000.c, coff-we32k.c, elf.c, ieee.c, srec.c: targets set + without leading underscore flag + * targets.c: add symbol leading char to xvec description + * bfd-in.h (bfd_get_symbol_leading_char): new macro. + +Mon Oct 5 14:32:55 1992 Per Bothner (bothner@cygnus.com) + + * archive.c: Make errno global. + * archive.c (_bfd_write_archive_contents): If read fails (and + errno!=0) set bfd_error to malformed_archive (since this probably + indicates a truncated archive), rather than system_call_error. + +Mon Oct 5 03:33:39 1992 Mark Eichin (eichin at tweedledumber.cygnus.com) + + * Makefile.in: added rules for i386bsd.c + * i386bsd.c: new file, supporting 386bsd. + * configure.in: recognize i386-*-bsd target. + * config/i386-bsd.mt: new file - 386bsd target configuration. + +Thu Oct 1 17:51:07 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: re-arrange host section to use *-*-* notation, + clean up some of the target section as well + + * seclet.c: cast result of bfd_get_relocated_section_contents to + avoid compiler warnings + +Tue Sep 29 13:24:09 1992 Ken Raeburn (raeburn@cygnus.com) + + * coffcode.h (coff_section_symbol): Create section if it doesn't + already exist. + + * bout.c: Removed some unused variables. + +Tue Sep 29 08:30:21 1992 Ian Lance Taylor (ian@cygnus.com) + + * Portability fixes from p3: + coffcode.h (coff_write_relocs): removed sanity check until it + works on all targets (per advice from sac). + config/hp9000.mh: new file to define USG. + hppa.c: #undef hppa before the JUMP_TABLE. + hosts/hppahpux.h: #define NATIVE_HPPAHPUX_COMPILER if not + __STDC__. + targets.c (bfd_target_list): if NATIVE_HPPAHPUX_COMPILER, make + local variable target volatile to avoid mysterious bug in + HP9000/700 cc. + +Sat Sep 26 03:58:49 1992 John Gilmore (gnu@cygnus.com) + + * config/hppabsd.mh, config.hppahpux.mh: Remove various bogosity. + * hosts/hppahpux.h: Remove bcopy and index circumventions. + +Fri Sep 25 22:36:52 1992 John Gilmore (gnu@cygnus.com) + + * coff-z8k.c (func_da, func_jr): Lint. + * coffcode.h: Use memset rather than bzero. + * elf.c: Use memcpy rather than bcopy. + * tekhex.c: Use memset rather than bzero. + +Fri Sep 25 19:14:48 1992 John Gilmore (gnu@cygnus.com) + + Add Adobe a.out support. + + * aout-adobe.c: New file. So far, only reads a.out.adobe. FIXME. + * config/adobe.mt: Add. + * configure.in (*-adobe-* target): Add. + * targets.c (a_out_adobe_vec): Add. + * Makefile.in: add aout-adobe.c. + + * configure.in: Put two dashes in all entries to be matched. + Add comments to remind people to do this. + Reorder all entries that match manufacturer names, to occur + last, so they will only be matched if no more specific match + occurs. Remove manufacturers `aout', `bout', `coff', and `elf'. + +Fri Sep 25 15:03:22 1992 Brendan Kehoe (brendan@rtl.cygnus.com) + + * elf.c (section_from_elf_index): Return bfd_abs_section, not 0, + since we should never have a NULL section. + (elf_slurp_symbol_table): If st_shndx doesn't match any of our + tests, set the section to bfd_abs_section. + +Fri Sep 25 11:11:57 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-z8k.c: getting closer + * coffcode.h (coff_get_relocated_section_contents): allow + EXTRA_CASES hooks for different arches to provide different reloc + types. + * seclet.h: #ifndef around it to allow multiple inclusion + * srec.c: minor doc fix + +Mon Sep 21 14:33:58 1992 Ian Lance Taylor (ian@cygnus.com) + + * hosts/hp9000.h, hosts/irix3.h: changes from WRS. + +Sun Sep 20 08:48:25 1992 Fred Fish (fnf@cygnus.com) + + * configure.in: Use i386-elf for all i386/i486 sysv4 hosts, not + just ncr. + +Thu Sep 17 06:40:46 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * bout.c (b_out_slurp_reloc_table): Clear howto field before + filling in reloc, in case immediately following code doesn't set + it. + +Fri Sep 11 15:37:06 1992 Ian Lance Taylor (ian@cygnus.com) + + * coffcode.h (coff_renumber_symbols): set the last renumbered + symbol pointer to NULL, as expected by coff_write_linenumbers. + (coff_write_relocs): apparently a non-zero addend is OK for reloc + type R_IHCONST used on the 29k. + +Thu Sep 10 13:28:24 1992 John Gilmore (gnu@cygnus.com) + + * opncls.c (bfd_fdopenr): Determine whether to fdopen for + update, based on how the underlying file was opened. Obsoletes + FASCIST_FDOPEN. + * hosts/rs6000.h, hosts/tahoe.h, hosts/vaxbsd.h: Remove + all FASCIST_FDOPEN config defines. + +Tue Sep 8 21:37:58 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * sparc-opc.c: Moved to opcodes library, now that we have one. + * Makefile: Don't compile it. + +Tue Sep 8 10:10:34 1992 Ian Lance Taylor (ian@cygnus.com) + + * aoutx.h: adjust_sizes_and_vmas did not return anything. + +Thu Sep 3 19:29:04 1992 Per Bothner (bothner@rtl.cygnus.com) + + * section.c (bfd_set_section_flags): Remove a sanity check. + It is unfortunately broken, and prevents strip from working. + +Thu Sep 3 16:14:40 1992 Jim Wilson (wilson@sphagnum.cygnus.com) + + * sparc-opc.c (condr): Remove extraneous, but harmless, backlash + created by last change. + +Thu Sep 3 13:52:38 1992 Per Bothner (bothner@rtl.cygnus.com) + + * reloc.c (reloc_howto_struct): Make size field be unsigned. + * bfd-in.h: Bump to version 2.0. + +Thu Sep 3 09:05:37 1992 Stu Grossman (grossman at cygnus.com) + + * bout.c, cpu-z8k.c: Use enums when initializing structs to keep + braindamaged HP/Apollo compiler happy. + +Wed Sep 2 02:53:29 1992 John Gilmore (gnu@cygnus.com) + + * format.c: Fix description of search for matching target. + * aoutx.h (some_aout_object_p): Set SEC_CODE and SEC_DATA. + * targets.c: Update description of search for matching target. + * Makefile.in (do_clean, clean): Fix infant mortality typo. + (docdir): Set to ./doc, not ${srcdir}/doc, which has no makefile. + (z8k and we32k files): `*.o: *.c': avoid Sun Make bug. + +Wed Sep 2 00:26:32 1992 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in: Added mostlyclean/clean/distclean rules. + +Tue Sep 1 13:38:40 1992 Per Bothner (bothner@cygnus.com) + + * targets.c (target_vector): Take out oasys (unless that is + the default): Because there is no magic number in archives, + there can be annoying target mis-matches. + +Mon Aug 31 10:11:37 1992 Jim Wilson (wilson@sphagnum.cygnus.com) + + * sparc-opc.c: Rigorously updated to match architecture manual. + +Mon Aug 31 08:07:58 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * aoutx.h (aout<n>swap_ext_reloc_out), bout.c + (b_out_squirt_out_relocs): fix bug 1506 where abs symbols attached + to the built-in abs_section were not written out correctly. + +Fri Aug 28 16:29:15 1992 Ian Lance Taylor (ian@cygnus.com) + + * archive.c (bfd_slurp_bsd_armap): if the symdef_count is too + large, assume we're using a swapped byte order and fail with + wrong_format rather than dumping core. + +Fri Aug 28 15:38:03 1992 Ken Raeburn (raeburn@cygnus.com) + + * Renamed opc-sparc.c to sparc-opc.c for systems with short + filename constraints. + * Makefile.in: Updated to reflect change. + +Thu Aug 27 13:05:28 1992 Brendan Kehoe (brendan@cygnus.com) + + Add preliminary support for the we32k: + + * Makefile.in, archures.c, coffocode.h, configure.in, targets.c: + Minor edits. + * coff-we32k.c, cpu-we32k.c, config/we32k.mt, hosts/we32k.h: New files. + +Wed Aug 26 14:20:16 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * bout.c: added support for relaxable alignment relocs. + + * seclet.c (rel, seclet_dump_seclet, seclet_dump): get the app to + pass down pointer to play area rather than use alloca + + * cpu-z8k.c (compatible): made static to reduce name space + polution. + +Tue Aug 25 08:39:10 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + Add basic support for the z8k: + + * Makefile.in, archures.c, coffcode.h, configure.in, reloc.c, + section.c, targets.c, + + * syms.c: move mis-inserted patch. + +Fri Aug 14 15:39:29 PDT 1992 Howard Chu (hyc@hanauma.jpl.nasa.gov) + + Documentation fixes: + * ctors.c, format.c, section.c, reloc.c: append " -" to item tags. + * reloc.c, section.c, syms.c, targets.c: add DOCDD before @node + comments. + * reloc.c: break out addend item from surrounding text. + + * doc.str (DOCDD): Defined. Adds text to output. + (bodytext): Put bulletize before kill_bogus_lines. + * chew.c (bulletize): End itemization after a blank line, to + prevent following text from being swallowed up in an item. + +Mon Aug 24 20:50:22 1992 Stu Grossman (grossman at cygnus.com) + + * configure.in: Add sparclite as a target. + +Mon Aug 24 12:06:31 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * ieee.c (ieee_get_symtab): always null terminate the symbol list, + lint. + + * coffcode.h (coff_add_missing_symbols): if symbols don't come + from a coff file (csym is null), dont deref them + + * ieee.c (parse_expression): get the answer right when adding an + abs+(sec+off), (ieee_generic_stat_arch_elt): call ieee_object_p + on elts so that filename is filled in. + +Thu Aug 20 19:05:48 1992 Ken Raeburn (raeburn@cygnus.com) + + * bout.c (howto_align_table): New set of relocs, with enough + data for "objdump -r" to work. + (b_out_reloc_type_lookup): Recognize alignment relocs. + +Tue Aug 18 12:57:45 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: added FLAGS_TO_PASS, and used it for all recursive + invocations of make. Also, always create installation + directories. + + * config/apollov68.mh: removed -g from CC definition. + +Mon Aug 17 13:40:08 1992 Ken Raeburn (raeburn@cygnus.com) + + * config/decstation.mh (HDEFINES): Specify "-G 4" to avoid + overflowing gp-offset range. + +Mon Aug 17 11:44:28 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * srec.c (srec_set_section_contents): don't write out sections + without the LOAD and ALLOC attributes + +Mon Aug 17 11:55:07 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * archures.c, cpu-m68k.c, cpu-sparc.c: Undo 16 June changes. + * libaout.h (struct aout_backend_data): New callback "set_sizes". + * aout-target.h (callback): Don't set page/seg sizes. + (mkobject): Ditto. + (set_sizes): New routine. + (backend_data): Point to it. + * aoutf1.h (sunos4_set_sizes): Heed architecture when setting sizes. + (sunos4_aout_backend): Point to it. + * aoutx.h (set_arch_mach): Call set_sizes callback. + +Fri Aug 14 19:22:18 1992 Per Bothner (bothner@cygnus.com) + + * aout-target.h: Make _bfd_slurp_extended_name_table be + the default. Given that we *write* the suckers (for long + archive member names), we really ought to be able to read them! + * trad-core.c: Don't include <machine/reg.h>. It doesn't + seem to be needed, and many machines don't have it. + +Thu Aug 13 09:53:39 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-m68k.c (vector): read and write archives in coff format. + +Tue Aug 11 12:19:42 1992 Ken Raeburn (raeburn@cygnus.com) + + * opc-sparc.c: New file. + +Sat Aug 8 23:15:35 1992 Fred Fish (fnf@cygnus.com) + + * bout.c (bfd_reloc_status_type, callj_callback): Cast void* + pointers to bfd_byte* before performing arithmetic on them. Such + use with bare void* pointers is a gcc extension. + * cache.c (bfd_cache_delete): Forward decl with prototype form. + * archive (normalize): Add to CONST to match actual usages with + CONST. + +Mon Aug 3 00:35:29 1992 Fred Fish (fnf@cygnus.com) + + * configure.in: Recognize i486 host cpu, and use i386-elf + for i486-ncr-sysv4. + +Sat Aug 1 13:49:59 1992 Fred Fish (fnf@cygnus.com) + + * config/stratus.mt (CC): Remove definition. + * elf.c (bfd_section_from_shdr): Test for the possibility that + section_from_elf_index returns NULL and don't dereference it. + +Mon Jul 20 02:46:09 1992 D. V. Henkel-Wallace (gumby@cygnus.com) + + * add hppa_data to bfd tdata (indirectly via sef). + + * config/hppahpux.mh: hpux is -DUSG (patch by sef) + +Sat Jul 18 15:50:11 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: error messages to stderr, not stdout + +Fri Jul 17 18:32:46 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * bfd.c, cache.c, coff-a29k.c, coff-i386.c, coff-i960.c, + coff-m68k.c, coff-m88k.c, demo64.c, libaout.h, libbfd.c, + oasys.c, opncls.c, sunos.c, targets.c: removed rcsid's. + +Fri Jul 17 17:06:56 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: recognize hppa* instead of hppa + +Thu Jul 16 16:39:25 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-m68k.c: added R_RELLONG_NEG reloc type, and changed + RTYPE2HOWTO to cope with same. + * reloc.c (bfd_perform_relocation): added support for size of -2 + (subtract a word reloc type). Updated doc. + +Thu Jul 16 16:28:09 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: merged changes from progressive, removed rcsid. + + * archures.c, archive.c, Makefile.dos: removed rcsid. + +Thu Jul 16 08:08:25 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * bfd-in.h : add BFD_IS_RELAXABLE flag + * bout.c (bout_swap_exec_header_[in_out]): new field in exec + header e_relaxable, major hackery in callbacks + * libaout.h : add space for a_relaxable. + * seclet.c (rel): don't relax empty sections + + +Wed Jul 15 07:57:46 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * section.c (STD_SECTION): add some casts to the initializers for + dumb compilers + +Tue Jul 14 14:06:28 1992 Stu Grossman (grossman at cygnus.com) + + * rs6000-core.c (rs6000coff_core_p): Greatly simplify expression, + and add appropriate casts to keep (picayune) aix-cc happy. + +Mon Jul 13 05:06:51 1992 John Gilmore (gnu at cygnus.com) + + * elf.c (elf_slurp_symbol_table): Now 2nd arg is where to write + symbol pointers. Punt expensive & useless bfd_realloc. Use + malloc for raw symbols, and free it before returning. + (bfd_section_from_shdr): Do not slurp symbol table until politely + asked. Do not even slurp string tables. + (elf_get_symtab_upper_bound): Count 'em without reading them. + (elf_get_symtab): This is how to politely ask. Schlurp! + This should probably just *become* elf_slurp_symbol_table, FIXME. + +Wed Jul 8 16:24:33 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * archive.c (bsd_write_armap): write the timestamp of the + archive header to be just a little bit later than the timestamp of + the file, otherwise the linker will complain that the index is + out of date. + +Tue Jul 7 00:23:23 1992 Fred Fish (fnf@cygnus.com) + + * configure.in: Add m68k-ericsson-*. + +Sat Jul 4 03:29:41 1992 John Gilmore (gnu at cygnus.com) + + * syms.h: Define BSF_FILE, update BSF_SECTION_SYM desc. + * elf.c: Remove unconditional debug printf's. + (elf_write_object_contents, elf_slurp_symbol_table): Handle + BSF_SECTION_SYM <=> STT_SECTION, BSF_FILE <=> STT_FILE. + (elf_slurp_symbol_table): Hand out symbols in forward, not + reverse order. Simplify duplicate code. + +Fri Jul 3 20:23:34 1992 Fred Fish (fnf@cygnus.com) + + * elf.c: Remove "(void)" casts from function calls where the + return value is ignored, in accordance with GNU coding standards. + +Tue Jun 30 16:49:12 1992 Fred Fish (fnf@cygnus.com) + + * hppa.c: Apply John's standard fix to avoid "empty translation + unit" warnings from some ANSI-C compilers. + +Thu Jun 25 04:39:25 1992 John Gilmore (gnu at cygnus.com) + + * hosts/solaris2.h: Configure same as sysv4. + +Tue Jun 23 21:54:44 1992 Fred Fish (fnf@cygnus.com) + + * libbfd.h, libbfd-in.h (bfd_seek): Make prototype match definition. + * reloc.c (bfd_default_reloc_type_lookup): Make cast on return + type match actual return type. + * elf_print_symbol (section_name): Make CONST. + +Mon Jun 22 17:35:24 1992 Per Bothner (bothner@cygnus.com) + + * i386linux.c, hosts/i386linux.h, config/i386-linux.mt: + New files, for Linux (a free Unix clone for 386 machines). + * Makefile.in, configure.in, targets.c: Update accordingly. + +Fri Jun 19 20:23:21 1992 Steve Chamberlain (sac@thepub.cygnus.com) + Lints for bfd_reloc_code_type->bfd_reloc_code_real_type, and + correct calling of howto special functions and fixes from Raeburn + for gas<>bfdness + * archures.c: nuke bfd_reloc_code_type + * bout.c, cpu-h8300.c, coff-i960.c, coff-m88k.c: special function lint + * coffcode.h (styp_to_sec_flags): STYP_INFO is marked as + SEC_NEVER_LOAD, various other bfdgas newness + * reloc.c->libbfd.h: change protype of bfd_default_reloc_type_lookup + * targets.c: change jump table vector to above + + +Fri Jun 19 19:00:45 1992 John Gilmore (gnu at cygnus.com) + + * elf.c (bfd_elf_find_section): Mark as INTERNAL_FUNCTION so + its prototype will be included in libbfd.h. Change result type + to struct * (rather than equivalent typedef) so it can be used in + the prototype, where they typedef won't be known. + * libbfd.h: Updated version. + +Fri Jun 19 15:21:56 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in, archures.c, configure.in, cpu-hppa.c, hppa.c, libhppa.h, + targets.c: HPPA merge. + +Fri Jun 19 12:21:38 1992 John Gilmore (gnu at cygnus.com) + + * configure.in: Separate Solaris2 from SYSV4 on SPARC. + * config/solaris2.mh: Kludge around Sun compiler bug. + +Wed Jun 17 14:02:46 1992 Stu Grossman (grossman at cygnus.com) + + * libaout.h (aout_backend_data): Change defs of two bitfields to + be unsigned chars instead to get around rs6000 compiler problem. + +Wed Jun 17 13:55:31 1992 Fred Fish (fnf@cygnus.com) + + * elf.c (bfd_section_from_shdr, elf_slurp_symbol_table): + Correct misconception that there can be only one symbol table. + Only call elf_slurp_symbol_table on the full symbol table, not + the dynamic one which is only a subset of the full one. + +Wed Jun 17 15:54:57 1992 Ken Raeburn (Raeburn@Cygnus.COM) + + * coffcode.h (coff_compute_section_file_positions): For I960, + don't align sections in file. + +Tue Jun 16 06:28:21 1992 Ken Raeburn (Raeburn@Cygnus.COM) + + * targets.c (struct bfd_target): Added field for target-specific + (but not file-specific) data, for distinguishing minor + characteristics between (e.g.) a.out formats. + + * section.c (struct sec): New field user_set_vma indicates vma + field should be heeded, not assumed to be unset. + (STD_SECTION): Initialize that field of standard sections to zero. + * bfd-in.h (bfd_set_section_vma): Set user_set_vma to true. + + * coffcode.h (coff_write_relocs): Write out swapped reloc, not + pre-swapped version. + + * archures.c (struct bfd_arch_info): Fixed order of comment and + field decl. New fields indicate size of page and segment for + architecture. + * cpu-m68k.c (N): Fill in values. + * cpu-sparc.c (arch_info_struct): Ditto. + + * libaout.h (struct aout_backend_data): Various bits of data (not + all used currently) with characteristics of a.out implementation. + Important field for now is text_includes_header, indicating that + the text section starts immediately after the file header, which + gets mapped in with it. + (struct aout_data): New fields indicate whether vma has been + adjusted yet (not yet used), and what magic number will be used in + the output file (should go away in favor of vma_adjusted). + (WRITE_HEADERS): Code for dealing with section sizes and related + header fields replaced with call to adjust_sizes_and_vmas. + * aoutx.h (some_aout_object_p): Fill in magic number field. + Set WP_TEXT flag for ZMAGIC as well as NMAGIC files. + (set_arch_mach): Set page size and segment size once CPU + type is known. + (adjust_sizes_and_vmas): New function; has much code moved + from set_section_contents and WRITE_HEADERS. Sets or adjusts vma + and size parameters, as well as many header fields, after deciding + on magic number for output file. Checks to ensure that this + adjustment has only been done once. + (set_section_contents): Call adjust_sizes_and_vmas instead of + doing much of the work here. + + * aout-target.h (MY_make_debug_symbol, MY_backend_data): Provide + default (null) values of these fields. + * aoutf1.h (sunos4_write_object_contents): Don't override a_text + value in exec header. + (sunos4_aout_backend, MY_backend_data): Define backend data + indicating file header is included in text section. + + * aoutf1.h (MY_reloc_howto_type_lookup): Fix typo. + + * hosts/sparc.h (abort, exit): Hide these names if compiling with + gcc version 2, to avoid warnings. + +Mon Jun 15 12:26:56 1992 Fred Fish (fnf@cygnus.com) + + * config/ncr3000.mh (INSTALL, RANLIB): Don't use /usr/ucb/install, + it's broken on ncr 3000's. Use simple "true" for RANLIB. + +Sat Jun 13 09:16:43 1992 Michael Tiemann (tiemann@rtl.cygnus.com) + + * configure.in (m680[01234]0-wrs-*): Fix typo in match pattern. + +Fri Jun 12 19:48:34 1992 John Gilmore (gnu at cygnus.com) + + * section.c (STD_SECTION): Remove extra semicolon in declarations. + * configure.in: Rewrite target parsing to use simple format. + Handle sparc-sun-solaris2 configuration. + * aout64.h: Avoid ANSI C brain death warning. + * elf.c: Avoid trigraph (???) or /* in comments. + +Fri Jun 12 14:51:14 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * config/sysv4.mh: new file, RANLIB=echo + + * configure.in: handle Solaris2 as -sysv4 or -solaris2 + +Thu Jun 11 00:52:03 1992 John Gilmore (gnu at cygnus.com) + + * elf.c (elf_obj_tdata): Merge elf_obj_tdata_struct and + elf_core_tdata_struct into a single common struct. Core files + wouldn't have worked at all without this. + (bfd_elf_find_section): New function for GDB's undercover use + to find string sections that BFD hides from it. + (elf_get_str_section): Avoid multiple alloc&reads for same data; + lint. + (elf_object_p, elf_core_file_p): Allocate internal file header + storage dynamically. + * bfd.c (union {...} tdata): Remove elf_core_tdata_struct. + * demo64.c: Prevent "empty translation unit" warnings from idiots. + +Tue Jun 9 17:15:26 1992 Fred Fish (fnf at cygnus.com) + + * config/{i386v4.mh, ncr3000.mh}: Update RANLIB, add INSTALL. + +Sat Jun 6 17:02:51 1992 John Gilmore (gnu at cygnus.com) + + * configure.in: Handle Solaris2 as *-sun-sysv4 or as *-sun-sunos5. + +Sun May 31 05:45:00 1992 david d `zoo' zuhn (zoo@cygnus.com) + + * configure.in: handle m680[01234]0 as aliases for m68k + +Tue May 26 16:50:59 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-a29k.c: do byte relocs correctly + * coffcode.h (styp_to_sec_flags): never load INFO sections + * seclet.c (rel): don't relocate INFO sections + +Wed May 20 08:18:18 1992 Ken Raeburn (Raeburn@Cygnus.COM) + + * section.c (bfd_*_symbol, bfd_*_section): Initialize statically. + Make the symbols unmodifiable. + (bfd_section_init): Deleted. + * init.c (bfd_init): Don't call bfd_section_init. + + * section.c (bfd_set_section_contents): Ensure that range to be + written is within section boundaries. + (bfd_get_section_contents): Likewise. Don't bother dispatching if + size is zero. + + * libbfd.c (bfd_xmalloc): Text of error message should be const. + + * coff-i960.c (howto_table): Deleted. + (howto_rellong, howto_iprmed, howto_optcall): New vars; + interesting entries from old howto_table. + (RTYPE2HOWTO): Adjusted to use switch. + (coff_i960_reloc_type_lookup): New function. + + * coffcode.h (coff_new_section_hook): Allocate storage for aux + records for section symbol. + (make_abs_section): Unused; deleted. + (renumber_symbols): Re-order symbols so undefined symbols come + last, as COFF format desires. + (coff_write_symbol): Put C_FILE symbols in debug section always. + (coff_section_symbol): New function; creates a symbol with the + same name as a section, and sets up aux records for it. + (coff_add_missing_symbols): New function; adds section symbols to + symbol table if they aren't there already. Should someday also + add a dummy C_FILE symbol if none is present. + (coff_write_object_contents): Add missing symbols before preparing + symbol table to be written. + (coff_slurp_reloc_table): Verify that symbol indices read in are + in a reasonable range. + * libcoff-in.h (struct coff_tdata): New field conv_table_size. + (obj_conv_table_size): Accessor macro. + + * bout.c (b_out_reloc_type_lookup): New function. Handles three + reloc types on i960. + + * bfd-in.h (bfd_get_section_name): New macro. Like + bfd_section_name, but returns rvalue, not lvalue. + (bfd_get_section_vma, bfd_get_section_alignment): Similar. + (bfd_get_section_flags): Now returns rvalue. + + * reloc.c (enum bfd_reloc_code_real): Add several new values, some + general, some specific to sparc or i960. + + * aoutx.h (set_section_contents): Set VMA for each section based + on previous section. If text section VMA doesn't appear to have + been set, make a best guess from the type of file. + + * aout-target.h (MY_reloc_howto_type_lookup): Define as zero if + not defined. + (MY(vec)): Initialize reloc_type_lookup field. + + * aoutx.h (howto_table_*): Export as aout_#_*_howto_table. + (bfd_error_trap, bfd_error_vector): Extern, not common. + + * aoutf1.h (sunos4_reloc_type_lookup): New function. Handles a + few types of relocs for sparc; will need enhancement. + + * bout.c (callj_callback): Use DEFUN macro in definition. + * coff-i960.c (optcall_callback): Likewise. + + * targets.c (bfd_target): Added fields reloc_type_lookup and + _bfd_make_debug_symbol. Also minor comment changes. + * syms.c (bfd_make_debug_symbol): New dispatching macro. + * reloc.c (bfd_reloc_type_lookup): Take a BFD ptr as arg rather + than arch info, and dispatch with BFD_SEND. Callers changed. + * archures.c (struct bfd_arch_info): Deleted field + reloc_type_lookup. + * cpu-*.c: Don't initialize that field. + + * bfd-in.h (enum bfd_error): Add new value "bad_value". + * bfd.c (bfd_errmsgs): Now const; added entry for bad_value. + (bfd_errmsg): Now returns ptr to const. + * bfd-in.h (bfd_errmsg): Fix prototype. + + * cache.c (BFD_CACHE_MAX_OPEN): Fix typo in doc. + * reloc.c (bfd_generic_relax_section): Ditto. + + * section.c (Section Output doc): Improve description of use of + output_section and output_offset. + +Tue May 19 23:42:10 1992 D. V. Henkel-Wallace (gumby@cygnus.com) + + * sco-core.c: new file from net. + * aoutx.h (translate_to_native_sym_flags): bugfix from net: + Now we have the hairy linker, it's possible to move symbols from + one section into another. Actually make that work! + +Sat May 16 17:57:59 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * hosts/sun3.h: fix declaration of free. + +Tue May 12 14:08:59 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-a29k.c (perform_reloc): fix bug in jmp/call evaluation + * coff-h8300.c (reloc_processing): all relocs are relative to + section start. + * opncls.c: don't use fdopen on DOS systems + + short patches from Glenn Kasten (glenn@ready.com) + * target.c: enabled oasys support + * oasys.c: Insert . when UNDERSCORE_HACK is enabled, + fix problem where a relocation which crossed a modification byte + boundary did not work. Fix problem where a relocation near the end + of a data record did not work. + + +Tue May 5 18:11:25 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * archive.c (bfd_slurp_coff_armap): old versions of BFD wrote + archvie header string counts the endian way, this heuristic sees + how big an archive string to read by trying it one way and if the + string table is unreasonably big, trying it the other. *FIXME*. + * opncls.c (bfd_fdopenr): can't do fdopens on VMS + +Tue May 5 14:18:24 1992 Per Bothner (bothner@rtl.cygnus.com) + + * bfd-in.h: Increase version number to 1.97, for consistency + with ../binutils. + * Makefile.in: docdir is ./doc, not ${srcdir}/doc. + +Mon May 4 11:49:15 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * bfd-in.h: bump version to 1.96 + Major change; changed calling convention for + bfd_get_relocated_section_contents so that caller allocates + memory for section data. + * coffcode.h (bfd_coff_get_relocated_section_contents), reloc.c, + seclet.c, targets.c, bfd.c: reflect new convention. + * coffcode.h (styp_to_sec_flags): if styp_flags is not a special + case, then use reasonable default values for SEC_* flags. + +Fri May 1 12:58:34 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coffcode.h (coff_write_object_contents): use RELSZ to work out + size of output reloc struct. + * targets.c, Makefile.in: comment out tekhex for the moment. + * ieee.c: if some places where null pointers were used instead of &bfd_abs_section. + * configure.in: tandem target is st2000 + * coff-m68k.c: rename static howto_table to global + m68kcoff_howto_table. + * bout.c: remove unnecessary abort + * coff-a29k.c: various changes to the way relocations work to cope + with the "new order" and latent bugs. + * coffcode.h: lint + +Wed Apr 29 12:37:07 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * aoutx.h (aout_swap_ext_reloc_out, aout_swap_std_reloc_out) + bout.c (b_out_squirt_out_relocs): treat abs sumbols the right way. + * reloc.c (bfd_perform-relocation): don't relocate refs to + absolute symbols if doing a partial link. + +Fri Apr 24 07:35:26 1992 Stu Grossman (grossman at cygnus.com) + + * configure.in: Add a29k-amd-udi. + +Thu Apr 23 18:37:55 1992 Fred Fish (fnf@cygnus.com) + + * aoutx.h (aout_<bits>_swap_exec_header_in): Zero out the + internal_exec structure before initializing the fields that + are used, so that the unused fields are in a known state. + +Wed Apr 22 09:36:08 1992 Fred Fish (fnf@cygnus.com) + + * tekhex.c (struct data_struct): Convert from typedef that + typedefs nothing to a normal structure declaration. + * tekhex.c (pass_over): Prototype args for function that + second arg points to. + +Mon Apr 20 22:22:51 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: remove old style staging. Do not print recursion + lines. + + * Makefile.in: rework CFLAGS so that CFLAGS can be passed from the + Makefile command line. Remove MINUS_G. Default CFLAGS to -g. + Pass CFLAGS. + +Fri Apr 17 09:15:31 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * bfd.c, Makefile.in: added tekhex + * aoutx.h (set_section_contents): pages should be padded to the + size of a page, not the size of a segment. + * configure.in: added go32 host and i386-aout target. + * i386aout.c, libaout.h: now works for go32 target + * ieee.c: fix bit rot. + * seclet.c: support for padding seclet type. + +Wed Apr 15 18:11:58 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: added .NOEXPORT: + +Tue Apr 14 14:34:42 1992 Fred Fish (fnf@cygnus.com) + + * elf.c (bfd_add_strtab, bfd_add_2_to_strtab): CONST spreads + like ooze. + * elf.c (elf_compute_section_file_positions, + elf_write_object_contents): Return boolean, not NULL (which + can be void *). + * elf.c (bfd_section_from_shdr): Ifdef-out debugging code. + Also ifdef-out code that aborts on unhandled section types. + +Fri Apr 10 22:29:18 1992 Fred Fish (fnf@cygnus.com) + + * configure.in: Recognize ncr3000 config + * Makefile.in (MINUS_G): Pass on to recursive makes. + * hosts/ncr3000.h, config/ncr3000.mh: Add host config files. + +Thu Apr 2 17:42:45 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Now that we have sym.h and symconst.h, compile + coff-msym.c on all systems. + * config/{decstation.mh, irix3.mh, irix4.mh}: Remove coff-msym.o dep. + * coff-msym.c: Update include files and comments; add weakext bit. + +Wed Apr 1 23:16:38 1992 John Gilmore (gnu at cygnus.com) + + * archive.c, bfd.c, bout.c, coffcode.h, init.c, reloc.c, + section.c, srec.c, syms.c, coff-h8300.c: Lint. + +Sun Mar 29 09:37:59 1992 John Gilmore (gnu at cygnus.com) + + * bout.c, coff-a29k.c, coff-i960.c: Lint. + * configure.in: Add new host and target configs. + * elf.c (bfd_prstatus, bfd_fpregset): Avoid typename of register + structs, which vary; just use member name. + (elf_object_p, elf_core_file_p): Lint, fix comments. + * config/sparc-elf.mt, hosts/sysv4.h: New config files. + +Sat Mar 28 13:07:02 1992 Fred Fish (fnf@cygnus.com) + + * elf.c (elf_object_p, elf_core_file_p): Fix to use only a single + local, disposable, copy of the external form of section header + table and program header table entries. + +Thu Mar 26 16:59:58 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Set MINIMIZE back to 0 for a real release. + +Tue Mar 24 15:57:03 1992 K. Richard Pixley (rich@cygnus.com) + + * configure.in: config/irix4.m[ht], hosts/irix4.h: add support for + irix4. + +Mon Mar 23 22:37:34 1992 Stu Grossman (grossman at cygnus.com) + + * coff-msym.c (ecoff_swap_rfd_in): remove & for array ref. + +Tue Mar 17 14:12:25 1992 Per Bothner (bothner@rtl.cygnus.com) + + * bout.c (b_out_slurp_reloc_table): Use BFD_ASSERT macro, + not internal bfd_assert function (twice). + +Tue Mar 17 10:45:12 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * aout-target.h: change ar_max_namelen to 15 (the right value) + * coff-a29k, coffcode.h: more hangovers from the bfd_abs_section + change + +Mon Mar 16 14:57:22 1992 Steve Chamberlain (sac@rtl.cygnus.com) + + * archive.c (bfd_generic_archive_p): check for bout archives too. + * bout.c: make it work again. + +Sat Mar 14 17:30:40 1992 Fred Fish (fnf@cygnus.com) + + * elf.c (elf_corefile_note): Call bfd_xmalloc() instead of bare + malloc(). + * reloc.c (bfd_generic_get_relocated_section_contents): Call + bfd_xmalloc() instead of bare malloc(). + +Fri Mar 13 15:44:37 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: pass down MAKEINFO on info. + +Fri Mar 13 07:41:13 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * config/mt-<foo> now <foo>.mt, config/mh-<foo> now <foo>.mh. + host/h-<foo> now just <foo>. + * configure.in: reflect changes + +Thu Mar 12 11:15:02 1992 Per Bothner (bothner@cygnus.com) + + * libbfd-in.h (set_tdata): Make change of Feb 27 in the + actual source file, not just the generated libbfd.h. + +Sat Mar 7 10:33:41 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * coff-i960.c (icoff_little_vec): add COFF_SWAP_TABLE so we can run + gdb on little-endian 960 code. + * archive.c (compute_and_write_armap): indirect symbols should go + into the archive header too. + +Fri Mar 6 21:55:16 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: added check target. + +Thu Mar 5 23:51:42 1992 John Gilmore (gnu at cygnus.com) + + * coff-msym.c: Move this file from gdb/ecoff.c. It + handles byte-swapping for ECOFF (MIPS symbol) files. + * config/mh-decstation, config/mh-irix3: Add coff-msym.o + to the files built on MIPS-based hosts. + * Makefile.in: Add rule for coff-msym. + +Thu Mar 5 21:36:05 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: added clean-info target. MINIMIZE=1. + +Sun Mar 1 22:32:58 1992 Per Bothner (bothner@cygnus.com) + + * coff-rs6000.c: Move core file functions into separate + new file rs6000-core.c. This is needed because reading + core files depends on native include files that conflict + with ../include/coff/rs6000.h. + * config/mh-rs6000: Add rs6000-core.o to HDEPFILES. + +Thu Feb 27 22:19:55 1992 Per Bothner (bothner@cygnus.com) + + * aoutx.h (NAME(aout,print_symbol)): Don't print + symbol addresss for undefined symbols. + * coff-rs6000.c: Various updates (due to target- + independent changes). + * libbfd.h: Ditto (tdata field is now a union). + * hosts/h-sparc.h: Removed prototype for bogus function + 'emset' (presumably should have been 'memset' - which is there). + +Thu Feb 27 11:46:33 1992 John Gilmore (gnu at cygnus.com) + + * configure.in (mips-big-* target): Same is Iris. + +Thu Feb 27 09:24:56 1992 Steve Chamberlain (sac at thepub.cygnus.com) + + * aoutx.h (translate_from_native_sym_flags): when creating an + alias symbol, fill in the section as undefined, rather than + leaving it blank. If an output section can't be found for a + symbol, then don't core dump. + +Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in, configure.in: removed traces of namesubdir, + -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced + copyrights to '92, changed some from Cygnus to FSF. + +Wed Feb 26 19:40:59 1992 Steve Chamberlain (sac at thepub.cygnus.com) + + * bfd.c: lint + * coff-h8300.c: fix stupid reloc subtraction bug + * coffcode.h (coff_swap_aux_out): only swap a tvndx by 2 bytes, + since that's how wide it is. (coff_slurp_symbol_table): always zero out + the symbol.flags and done_lineno fields. + +Tue Feb 25 14:29:24 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * coffcode.h (coff_write_symbol): write out the correct number of + auxents. + * cpu-h8300.c: fix disassembly bug + +Fri Feb 21 21:39:56 1992 John Gilmore (gnu at cygnus.com) + + * bfd-in.h (bfd_errmsg), coffcode.h (coff_swap_aux_in, + section_from_bfd_index), cpu-h8300.c (howto*_callback), + reloc.c, section.c (bfd_map_over_sections), targets.c + (bfd_target_list): Protolint. + * libbfd.h: Update to match a libbfd-in.h from a month ago. + +Fri Feb 21 10:57:54 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * coffcode.h (coff_swap_aux_in): lint, (coff_print_symbol): prints + out tagndx too. + * aoutx.h (swap_std_reloc_out, swap_ext_reloc_out): use the output + section of a symbol rather than the section of a reffed symbol to + determine the r_index of an emmitted reloc. + +Thu Feb 20 18:10:34 1992 Per Bothner (bothner at cygnus.com) + + * PORTING: New (preliminary) porting guide. + +Wed Feb 19 21:39:37 1992 John Gilmore (gnu at cygnus.com) + + * bout.c (callj_callback), coff-a29k.c (a29k_reloc), coff-m88k.c + (howto_hvrt16): lint. + +Mon Feb 17 12:02:17 1992 Per Bothner (bothner at cygnus.com) + + * hp300bsd.c (new), config/mt-hp300bsd: Make hp300bsd + a full configuration (with possible cross-development), + instead of using host-aout.c. + +Sun Feb 16 13:01:49 1992 Per Bothner (bothner at cygnus.com) + + * aout-target.h (MY(write_object_contents): + Set obj_reloc_entry_size (abfd). + * gen-aout.c: Change to emit a .c files, not a .h file. + +Thu Feb 13 20:11:47 1992 Fred Fish (fnf at cygnus.com) + + * elf.c (elf_slurp_symbol_table): Remove obsolete use of + BSF_ABSOLUTE and replace with bfd_abs_section reference. + +Thu Feb 13 17:22:44 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * coffcode.h (get_normalized_symtab): fixed bug where symbols + with more than one auxent can cause nasty core dumps. + + * coffcode.h, libcoff.c: added new fielded to coff_symbol_struct + "done_lineno" so that a symbol which appears twice in the symbol + table only gets it's linenumbers relocated once. Modifed + (coff_write_native_symbol) and (coff_make_empty_symbol) to make + use of it. + +Tue Feb 4 15:39:55 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * aoutx.h: (translate_from_native_sym_flags): fix constructor + stuff to use the New Order. + +Fri Jan 31 01:34:45 1992 Stu Grossman (grossman at cygnus.com) + + * ieee.c: Change type of envi[] to unsigned char. + + * configure.in: fix vax ultrix configuration. + + * elf.c (bfd_section_from_shdr): Deal with null return from + bfd_make_section(). (elf_object_p): Select endianess properly. + +Fri Jan 31 01:19:55 1992 John Gilmore (gnu at cygnus.com) + + * hosts/h-tahoe.h, h-vaxbsd.h: Fix stack in core files. + +Thu Jan 30 23:51:07 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in: host-aout.c doesn't depend on aout-params.h. + * aout-target.h: Use TARGET_BIG_ENDIAN_P to set up vector. + * host-aout.c: Don't use aout-params.h; configure these systems + in their xm files, not in a randomly generated file. + * hosts/h-hp300bsd.h, h-tahoe.h, h-vaxbsd.h, h-vaxult.h: + Specify byte order. + * hosts/h-vaxbsd.h: Define the form of exec and core files. + +Thu Jan 30 13:02:41 1992 Per Bothner (bothner at cygnus.com) + + * config/mt-tahoe, config/mt-vax: Change DEFAULT_VECTOR to + host_aout_vec here as well. + +Thu Jan 30 11:41:45 1992 Stu Grossman (grossman at cygnus.com) + + * host-aout.c: Change TARGETNAME to "a.out" to be compatible with + gdb. config/mt-hp300bsd: Change DEFAULT_VECTOR to host_aout_vec + to prevent undefined symbol. + +Thu Jan 30 07:26:53 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + Various lints found on PersSony + * aoutx.h: cast an enum + * coff-a29k.c: many ints in reloc structure turned to enum + * coffcode.h: more enums + * cpu-h8300.c: more enums + * opncls.c: more enums + +Thu Jan 30 01:19:56 1992 John Gilmore (gnu at cygnus.com) + + * configure.in: Make Tahoe configuration work again. + * bfd-in.h: Remove trailing comma from enum declaration. + * ieee.c: Can't put byte values >0x7F into a signed char. + +Tue Jan 28 21:10:51 1992 Fred Fish (fnf at cygnus.com) + + * Makefile.in: Add dependencies for various coff-*.o files. + + * elf.c: Remove extraneous paren from core_prpsinfo and + core_prpstatus macros, rename core_prpstatus to core_prstatus. + Replace references to old section "size" member with new + "_raw_size" member. Implement elf_make_empty_symbol, which + is now used. + +Tue Jan 28 14:51:40 1992 Stu Grossman (grossman at cygnus.com) + + * trad-core.c, bfd.c, ../include/bfd.h: Various fixes for PMAX + core reading. + +Tue Jan 28 10:46:32 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * coffcode.h (bfd_coff_relax_section): now static. + (bfd_coff_get_relocated_section_contents): various type lints. + +Mon Jan 27 19:44:08 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + New entry point in the transfer vector - bfd_relax_section. + + * aout-target.h: add to vector, call generic_relax + * bfd-in.h: add to vector + * bfd.c: add #define for vector + * bout.c: add to vector, call generic_relax + * coffcode.h: add to vector, also now has coff specific relax code + for the relaxable H8/300 relocs. Also clean up abs section cruft. + * elf.c: call generic_relax + * ieee.c: call new vector, clean up some bugs due to the creation + of bfd_abs_section + * libbfd.h: add bfd_generic_relax_section EXFUN + * oasys.c: call generic_relax + * reloc.c: implement generic_relax + * seclet.c: moved much of this into coffcode.h + * srec.c: call generic_relax + * targets.c: define new transfer vector + +Fri Jan 24 14:40:17 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * everything: now modified to use smaller reloc type. Self hosts + on sun3 & sun4. + +Sat Jan 18 17:00:16 1992 Fred Fish (fnf at cygnus.com) + + * config/mh-stratus, config/mt-i860-elf, hosts/h-stratus: + New files for stratus. + + * configure.in: Add configuration fragments for stratus. + +Wed Jan 15 10:02:43 1992 Fred Fish (fnf at cygnus.com) + + * aoutx.h (NAME(aout,find_nearest_line)): Declare various filename + variables as CONST since they are set to point to a const char + string. Fixes compiler complaints. + +Fri Jan 10 17:44:53 1992 Fred Fish (fnf at cygnus.com) + + * hosts/h-amix.h hosts/h-i386v4.h: Change abort() to a function + returning void. + +Fri Jan 10 14:33:32 1992 Per Bothner (bothner at cygnus.com) + + * aoutx.h (NAME(aout,find_nearest_line)): Recognize N_SOL + symbols, so that we can emit the correct file name even + if it's an include file. + +Thu Jan 2 16:43:34 1992 John Gilmore (gnu at cygnus.com) + + * coff-i960.c: Add COFF_SWAP_TABLE to little_vec as well as big_vec. + (Reported by john@labtam.labtam.oz.au (John Carey)). + +Wed Jan 1 04:23:06 1992 Fred Fish (fnf at cygnus.com) + + * elf.c: Change all '#if HAVE_PROCFS' to '#ifdef HAVE_PROCFS'. + + * config/mh-amix, config/mh-i386v4: Remove HDEFINES that was + being used to -DHAVE_PROCFS. + + * hosts/h-amix, hosts/h-i386v4: Add '#define HAVE_PROCFS'. Move + '#include "fopen-same.h"' to end of file to match other h-* files. + +Fri Dec 20 12:06:17 1991 Fred Fish (fnf at cygnus.com) + + * configure.in: Change svr4 references to sysv4. Add case + "unknown" for target vendor and infer some targets based + on the specified operating system. + +Wed Dec 18 17:17:59 1991 Stu Grossman (grossman at cygnus.com) + + * bfd-in.h, libaout.h: ANSIfy enums. + +Wed Dec 18 16:12:25 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * archive.c (normalize): created version for VMS which removes the + VMS directory crap from the front and end of a filename, eg turn + [-.foo]bar.obj;123 into bar.obj + (bfd_construct_extended_name_table): now writes index into an + extended name table in decimal - the same base used to read an + extended name table. + +Wed Dec 18 14:40:39 1991 Per Bothner (bothner at cygnus.com) + + * aout-encap.c: Fix to use aout-target.h. + * aoutf1.h: Use standard MY_object_p and MY_callback + in aout-target.h. Remove target-specific versions. + * host-aout.c: Re-write to use aout-target.h. + * gen-aout.c: New files use with host-aout.c to generate + host-specific a.out-related parameters. + * Makefile.in: host-aout.o depends on aout-params.h, which is + generated by gen-aout. + * aout-target.h: Make a little more flexible. + * libaout.h, aout-target.h: Removed WORK_OUT_FILE_POSTIONS + macro. Instead, inline it in aout-target.h. + * newsos3.c: Define N_SHARED_LIB(x) as 0 to avoid + a gcc -Wall warning. + * archive.c: Add missing commas in DEFUN macro (2 places). + * elf.c, coffcode.h, aoutf1.h: Use ANSI functions instead of + Berkeley ones, now that libiberty has them: + bcopy->memcpy, bzero->memset, bcmp->memcmp. + * aoutx.h: Various touch-ups: Re-formatting, fix a cast, + remove unused variable. + +Tue Dec 17 19:48:59 1991 Fred Fish (fnf at cygnus.com) + + * elf.c (elf_core_file_matches_executable_p): Enclose corename + and execname inside HAVE_PROCFS ifdef since they are unused + when it is not defined. + +Mon Dec 16 12:00:10 1991 Fred Fish (fnf at cygnus.com) + + * elf.c: Flag all sections as either code or data. We can't + be sure what they are anyway, since ELF doesn't fit the + traditional model of text+data+bss very well. Add new local + function elf_read() to simplify code. Record entry point in + the bfd structure. + +Thu Dec 12 21:01:22 1991 John Gilmore (gnu at cygnus.com) + + * hosts/h-*.h: Configure fopen using ../include/fopen-*.h + rather than N copies of the same lines. + +Wed Dec 11 16:39:45 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * cpu-h8300.c: disassemble branch displacements correctly + * coff-h8300.c: put reloc offsets out in 32bits + + * makefile.dos, configdj.bat: New files from DJ + * cache.c: fopen with new macros is needed for DOS. + * ieee.c: environ renamed to envi to stop an include file + conflict. + * opncls.c, coff-rs6000.c: more fopens with macros. + +Tue Dec 10 04:07:24 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: infodir belongs in datadir. + +Sat Dec 7 16:39:23 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * Makefile.in: fix where docdir lives + + * aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c, + coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c, + libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c, + srec.c, syms.c, targets.c : all new documentation and lint + removal. + + +Sat Dec 7 07:22:09 1991 John Gilmore (gnu at cygnus.com) + + * coffcode.h, srec.c: Lint. + +Fri Dec 6 22:58:48 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: install using INSTALL_DATA, added standards.text + support. + + * configure.in: mark directory as target dependent. configure + nows works in objdir always so make file existence checks + against ${srcdir}. + +Thu Dec 5 22:46:19 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: idestdir and ddestdir go away. Added copyrights + and shift gpl to v2. Added ChangeLog if it didn't exist. docdir + and mandir now keyed off datadir by default. + +Wed Dec 4 10:14:17 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * aoutf1.h (sunos_<size>_object_p, sunos4_callback): moved the + computation of arch and machine type so it's worked out before + some_aout_object_p is called. + * aoutx.h: (some_aout_object_p): don't set arch and mach to + unknown. + * archures.c: add extra field 'section_align_power' to hold + default section alignment in object files. + * cpu-a29k.c, cpu-h8300.c, cpu-i386.c, cpu-i960.c, cpu-m68k.c, + cpu-m88k.c, cpu-mips.c, cpu-rs6000.c, cpu-sparc.c, cpu-vax.c: + initialize the new field. + * bout.c (b_out_callback): replace the text size, since aout + fries them. + * aoutx.h: Documentation in the new style + +Wed Dec 4 02:00:30 1991 John Gilmore (gnu at cygnus.com) + + * bfd.c (bfd_get_mtime): Don't cache mtime any more; only + use the saved value if mtime_set is already set (intended + for archive files, though apparently not used yet). + +Tue Dec 3 22:54:50 1991 John Gilmore (gnu at cygnus.com) + + * targets.c: Revise comments about how to configure the target + vector, to match reality. Remove mention of obsolete methods. + Remove long lists of capitalized macros that turn into the same + thing in lowercase. Normal vector simply lists all known + lowercase xvec names; all other cases are handled by SELECT_VECS. + + * config/mt-i386-coff: Set DEFAULT_VECTOR to real identifier, + not macro name. + + * config/mt-i960-{coff,bout}: Use SELECT_VECS to make a short + list of supported targets. + +Tue Dec 3 14:06:15 1991 Per Bothner (bothner at cygnus.com) + + * archive.c (bsd_write_armap): The pad byte sometimes added to + the string table in a __.SYMDEF member is now + counted as part of the size of the string table. + This is compatible with the old ranlib, as well as Sun's. + +Tue Dec 3 10:53:30 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * srec.c: Rewrote to fix many bugs; now gets the record type + right, doesn't choke on input, sets the start address in an S9 and + fills in the filename on an S0. + +Sat Nov 30 21:19:15 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * cpu-h8300.c: Add support for MEMIND addressing mode + + * coff-a29k.c: defined RELOC_PROCESSING to take the #ifdef out of + coffcode.h + * coffcode.h: use the new macro if available + + * elf.c (elf_corefile_note): cast malloc to avoid warning. + * Makefile.in: Fixed dependencies due to file rename + + * aout-encap.c, aoutf1.h, aoutx.h, archive.c, bout.c, coff-a29k.c, + coff-h8300.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c, + coff-mips.c, coff-rs6000.c, cpu-h300.c, elf.c, i386aout.c, + newos3.c, stab-syms.c, syms.c: All these files have had their + #includes altered to point to the new places. + +Fri Nov 29 20:04:49 1991 Fred Fish (fnf at cygnus.com) + + * config/mh-i386v4, config/mh-i386-elf, hosts/h-i386v4.h: New files. + + * configure.in: Add vendor "ncr" as supported per-target vendor. + Add svr4 case for i386 per-host case. + + * elf.c (elf_object_p, elf_core_file_p): Add missing "break" to + ELFDATA2LSB cases. + +Fri Nov 29 12:16:51 1991 Per Bothner (bothner at cygnus.com) + + * syms.c (bfd_decode_symclass): Return 'A' + for symbols that are both absolute and global. + * archive.c (bfd_special_undocumented_glue): Return NULL + if bfd_ar_hdr_from_filesystem returns NULL. + +Tue Nov 26 09:10:55 1991 Steve Chamberlain (sac at cygnus.com) + + * Makefile.in: added coff-h8300 + * configure.in: now h8 is a coff target + * cpu-h8300.c: fix various disassembly problems + * libcoff.h: took out some code which has been #0ed for a long + time. + * targets.c: added h8 coff + * coff-a29k.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c + added new macro RTYPE2HOWTO to take a load of #ifdefs out of + coffcode.h + * coffcode.h: Started to change the way machine dependencies are + handled, from the nest of #ifdefs to macros defined in the + including coff-<foo>.c + +Fri Nov 22 08:11:42 1991 John Gilmore (gnu at cygnus.com) + + * aoutx.h (some_aout_object_p): Set the `executable' bit + if the entry point is contained in the text segment, even if the + text segment is at location 0. + + * coff-mips.c, coffcode.h: Peter Schauer's patch to kludge in + nonstandard MIPS sections (.rdata, .sdata, etc). + + * aoutx.h, bfd.c, coffcode.h, ieee.c, oasys.c, targets.c: CONST lint. + * libbfd-in.h, libbfd.h, aoutx.h, coffcode.h, elf.c, libaout.h: + Rename ALIGN to BFD_ALIGN to avoid conflict with BSD <sys/param.h>. + * libbfd.c: Lint. + * host-aout.c, trad-core.c: Fix write_armap prototypes. Lint. + +Thu Nov 21 19:56:40 1991 Per Bothner (bothner at cygnus.com) + + * stab-syms.c, syms.c: Moved bfd_stab_name() and bfd_stab_names[] + from syms.c to new file stab-syms.c. Also, since GNU extended + type codes such as N_SETT are no longer in ../include/stab.def, + include them manually. + * stab-syms.c, aoutx.h: Renamed bfd_stab_name() and + bfd_stab_names[] to aout_stab_name() and aout_stab_names[]. + * libaout.h: Added prototype for aout_stab_name(). + * Makefile.in: Update Makefile for new stab-syms.[co]. + +Thu Nov 21 11:50:49 1991 John Gilmore (gnu at cygnus.com) + + * libaout.h (WORK_OUT_FILE_POSITIONS): One more try at this + rather complicated seeming problem. Eliminate LOGICAL_ versions, + just make N_XXX work by excluding the header from the text segment. + * aoutx.h: Fix comments to match. + +Tue Nov 19 18:49:01 1991 Per Bothner (bothner at cygnus.com) + + * libaout.h (WORK_OUT_FILE_POSITIONS): Use new LOGICAL_TXTADDR, + LOGICAL_TXTOFF, LOGICAL_TXTSIZE macros to figure out numbers + for the "logical" text segment (i.e. never consider the exec + header to be part of the text segment). This change is + needed for consistency with various other parts of bfd and ld. + * aoutx.h (NAME(aout,soe_aout_object_p)): Fix comment, + and move calculation of obj_textsec(abfd)->size to libaout.h. + * bfd-in.h: Removed bogus ';'. + + * Makefile.in: Add MINIMIZE flag to select lean + or bloated target_vector. + * targets.c: Use new MINIMIZE macro, and add trad_core if needed. + * newsos3.c: Fixes to ../include/aout64.h remove need + for special N_TXTOFF macro, but require N_HEADER_IN_TEXT. + +Mon Nov 18 12:00:59 1991 Per Bothner (bothner at cygnus.com) + + * aout-target.h, aoutf1.h, newsos3.c: Make aout-target.h + handle both little and big-endian targets, with little + the default unless TARGET_IS_BIG_ENDIAN_P is defined. + * host-aout.c: Add FIXME note. + +Sun Nov 17 13:29:39 1991 Per Bothner (bothner at cygnus.com) + + * targets.c: Make the default target_vector contain + just &DEFAULT_VECTOR. This makes executables a lot smaller. + Old behavior can be gotten by defining ALL_TARGETS. + * aoutf1.h, demo64.c, i386aout.c, newsos3.c, sunos.c: + Factored out common code into new file aout-target.h. + Saves a lot of duplicate code for a.out variants. + +Fri Nov 15 13:00:43 1991 Per Bothner (bothner at cygnus.com) + + Get 'make headers' to work when configured with +subdirs. + * Makefile.in: Add $(subdir) to docdir path. + * doc/Makefile.in (protos): Add $(srcdir) prefix + to name of sed scripts. + +Thu Nov 14 19:49:10 1991 Per Bothner (bothner at cygnus.com) + + * aoutx.h (NAME(aout,print_symbol)): Fix thinko. + * syms.c (bfd_stab_names): Turn on new GNU_EXTRA_STABS macro + to include names of N_SETT etc. + +Thu Nov 14 19:11:13 1991 Fred Fish (fnf at cygnus.com) + + * elf.c: Add minimal support for ELF symbol tables. Generates + canonical bfd symbol tables from ELF symbol tables. Change the + name of some functions from bfd_<name> to elf_<name>. + + * syms.c: Trivial fix to comment to remove a redundant "to". + +Wed Nov 13 17:02:01 1991 John Gilmore (gnu at cygnus.com) + + * coff-{i386,m68k,m88k}.c: Change name of file format to standard + form that GDB recognizes as COFF. + +Wed Nov 13 09:09:41 1991 Steve Chamberlain (sac at cygnus.com) + + * ieee.c (ieee_object_p): cast NULL correctly. + * configure.in: added harris host + + * coff-a29k.c: Lots of changes, most from David Wood. + +Tue Nov 12 07:21:41 1991 John Gilmore (gnu at cygnus.com) + + * coff-m88k.c (coff_write_armap): Just #undef it. + +Mon Nov 11 20:30:18 1991 Steve Chamberlain (sac at cygnus.com) + + * Makefile.in: standardize on MINUS_G to disable debugging + * coff-m88k.c: create coff armaps instead of bsd ones. + * opncls.c (bfd_close_all_done), (bfd_close): Mask out random bits + when calling chmod. + +Mon Nov 11 19:07:32 1991 Fred Fish (fnf at cygnus.com) + + * elf.c: Additions to support ELF format core files. + * config/mh-amix: Add -DHAVE_PROCFS to HDEFINES, since host + has support for /proc (all the include files in particular). + +Mon Nov 11 18:36:47 1991 Per Bothner (bothner at cygnus.com) + + * aoutx.h (NAME(aout,find_nearest_line)): Handle the case + of two N_SO stabs, one for directory, and one for filename. + + * bfd-in.h (print_vma): Factor out duplicate definition. + + Exit a little more gracefully when malloc returns NULL. + * libbfd.c: New function bfd_xmalloc (malloc wrapper). + * opncls.c, syms.c, bout.c, aoutx.h: Replace malloc by bfd_xmalloc. + * libbfd.h: Rre-generated due to libbfd.c update. + +Sat Nov 9 13:45:01 1991 Fred Fish (fnf at cygnus.com) + + * config/mt-m68k-elf: Define DEFAULT_VECTOR as elf_big_vec. + + * elf.c (elf_object_p): Don't try to create a bfd section for + the first ELF section header. It is just a placeholder. + +Sat Nov 9 03:04:26 1991 John Gilmore (gnu at cygnus.com) + + * coff-rs6000.c, config/mh-rs6000: Make it work on archive and + core files, when compiling native. + * hosts/h-rs6000.h: Define FASCIST_FDOPEN for bfd_fdopenr. + + FIXME: The aoutf1.h change below needs to be reversed back + to the way it was. + +Thu Nov 7 11:03:55 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * coffcode.h: Defined new macros [PUT|GET]LINENO_LNNO for + manipulation of lnno fields in lineno structs in a coff-<f>.h + independent way. Override it in coff-<f>.h to your favourite + number if you don't have a 16bit lnno field. (coff_swap_lineno_in) + (coff_swap_lineno_out): modified to use the new macros. + +Mon Nov 4 11:38:33 1991 Steve Chamberlain (sac at cygnus.com) + + * aoutf1.h (sunos4_callback): Now defaults to 68020 rather than + unknown arch when the magic number doesn't specify the + architecture, since some OSs (eg old sun3s) don't set the number, and + 020 is probably the right answer anyway. + +Sun Nov 3 12:07:08 1991 Per Bothner (bothner at cygnus.com) + + * hosts/h-news.h, hosts/h-rtbsd.h: + Get rid of MISSING_VFPRINTF, since libiberty provides one. + * bfd-in.h (bfd_print_symbol_type_hopw enum): Add new option + bfd_print_symbol_nm, for use by nm. + * aoutx.h (NAME(aout,print_symbol)): Add code for new + bfd_print_symbol_nm option, to print in nm format. + * coffcode.h (coff_print_symbol), ieee.c (ieee_print_symbol) + oasys.c (oasys_print_symbol): Provide stub implementations + for bfd_print_symbol_nm. + * syms.c: New function bfd_decode_symclass, used by nm printer. + New function bfd_stab_name to look up string name of stab code. + +Sat Nov 2 14:26:03 1991 Steve Chamberlain (steve at cygnus.com) + + * Makefile.in: Added ctor.c + * archures.c (bfd_default_arch_struct) added + bfd_default_reloc_type_lookup. + * coffcode.h: removed a load of #if 0ed code. + (coff_compute_file_section_positions): now works out the section + alignment and size correctly in all cases. + (coff_get_symtab): looks for constructor symbols and calls the + right function when they're found. (coff_canonicalize_reloc): + knows when a section is full of constructors and does the right + thing. + * cpu-m88k.c: Added default_reloc_type lookup to the architecture + description. + * libbfd-in.h: (bfd_default_reloc_type_lookup) defun added. + * libcoff.h: removed #if 0ed code + * reloc.c: (bfd_reloc_code_real_type) added BFD_RELOC_CTOR for + arch independent constructor relocation type. + (bfd_reloc_type_lookup): removed the comment "this will go away" + since it won't. (bfd_howto_32): stolen from 88k, this is a 32bit + reloc which is used when BFD_RELOC_CTOR falls through to give a + default 32bit reloc for constructors. + (bfd_default_reloc_type_lookup): added. + * aoutf1.h: fixed SEGMENT_SIZE typo. + +Thu Oct 31 18:23:06 1991 John Gilmore (gnu at cygnus.com) + + * coff-rs6000.c: Change name to "aixcoff-rs6000", to avoid + matching prefix "coff". + * coffcode.h (coff_swap_aux_in, coff_swap_aux_out): Handle + rs/6000 csect records. + +Sun Oct 27 16:56:58 1991 Steve Chamberlain (steve at cygnus.com) + + * coff-m88k.c, targets.c: change name of m88k_bcs to m88kbcs + * configure.in: add motorola delta88 cases + * libbfd.h, libbfd-in.h, archive.c, ieee.c, elf.c, srec.c: fix + write_armap prototype + * libbfd.c: add doc on bfd_write_bigendian_4byte_int + +Fri Oct 25 02:48:19 1991 John Gilmore (gnu at cygnus.com) + + * Rename COFF-related files in `coff-ARCH.c' form. + coff-a29k.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c, + coff-mips.c, coff-rs6000.c to be exact. + + * Makefile.in: Only supply TARGET_DEFAULTS to targets.c, reducing + make output clutter. + * config/mt-*: Ditto. + +Thu Oct 24 22:40:07 1991 John Gilmore (gnu at cygnus.com) + + RS/6000 support, by Metin G. Ozisik, Mimi Phûông-Thåo Võ, and + John Gilmore. Archive support from Damon A. Permezel. + + * Makefile.in: Add cpu-rs6000.c and rs6000coff.c. + * configure.in: Add rs6000 case. + * targets.c: Add rs6000 vector. + * archures.c: Add rs6000, fix comment on romp. + * bfd-in.h (enum bfd_error): Add no_debug_section error. + * libcoff-in.h (struct coff_tdata): Remove unused string_table. + * bfd.c (bfd_errmsgs): Add no_debug_section error message. + * section.c (bfd_make_section): Return NULL on attempt to create + a section twice. + * coffcode.h (bfd_swap_reloc_in): Handle r_type and r_size. + (bfd_swap_aouthdr_in): Handle lots more members. + (make_a_section_from_file): If section has already been seen, + just return false rather than overwriting it. + (coff_real_object_p): Understand incoming magic numbers. + (coff_set_flags): Understand outgoing magic numbers. + (coff_compute_section_file_positions): outgoing aouthdr magic #. + (build_debug_section): Add fn for reading debug string section. + (get_normalized_symtab): Handle symbol names in debug string section. + Remove unused obj_string_table. + (coff_slurp_symbol_table): Handle rs6000-specific storage classes. + * aoutx.h (translate_from_native_sym_flags, N_SET*): Check for + existing section before making one. + * cpu-rs6000.c: New file. + * rs6000coff.c: New file. + +Thu Oct 24 02:03:24 1991 Fred Fish (fnf at cygnus.com) + + * elf.c: Add partial support for ELF format corefiles. Still needs + support for extracting registers from corefiles. + + * config/t-m68k-elf: Set DEFAULT_VECTOR to elf_big_vec. + + * config/{h-amix,h-dgux,h-irix3,h-ultra3}: For systems where + RANLIB is defined as echo, send the output to /dev/null to help + reduce clutter in the output from doing a make. + +Mon Oct 21 17:48:48 1991 John Gilmore (gnu at cygnus.com) + + * hosts/h-vaxult.h: Remove malloc/free decls covered in stdlib.h. + Fix HOST_PAGE_SIZE and HOST_SEGMENT_SIZE. From David Taylor. + +Mon Oct 21 09:34:11 1991 Steve Chamberlain (steve at rtl.cygnus.com) + + * coffcode.h (coff_compute_section_file_positions): make it pad + section size out if there are alignment restrictions so that the + image will be ok on a system where section positions are worked + out by accumulating sizes rather than from the section headers. + * targets.c (proto write_armap). Changed orl_count to unsigned. + * opncls.c (bfd_close_all_done). Added so that generative + programs like gas can close a bfd without causing bfd confusion. + * libbfd.h (changed becuase of protos) + * amdcoff.c: messed with the way that jmp displacements are + calcualated. This may not yet be totally correct. + * archive.c (coff_write_armap): rewrote the way that ranlibs are + written out. + * coffcode.h (fixup_symbol_value): now doesn't core dump if a non + abs symbol has no section (like a register symbol). + (coff_write_symbol) now zeros auxent before filling it up to help + with sensitive applications. + * libbfd.c (bfd_write_bigendian_4byte_int): added. + +Wed Oct 16 22:58:45 1991 John Gilmore (gnu at cygnus.com) + + * bfd.c: Make sure we don't get a macro strerror(). + * opncls.c (bfd_fdopenr): If FASCIST_FDOPEN, use "r", not "r+". + * trad-core.c (trad_unix_core_file_failing_command): Suppress + attempt to recover command, ifdef NO_CORE_COMMAND. + * hosts/h-tahoe.h: Add FASCIST_FDOPEN and NO_CORE_COMMAND; + revamp HOST_*, etc. + * hosts/h-i386v.h: Use <utime.h>, not <sys/utime.h>, unlike POSIX. + +Wed Oct 16 12:43:49 1991 Per Bothner (bothner at cygnus.com) + + * archive.c (bsd_write_argmap): The size of the ranlib structures + should not include the size field itself. + * aoutx.h, libaout.h (NAME(aout, sizeof_headers)): Use + adata(abfd)->exec_bytes_size field instead of constant macro, + because aoutx.h compiles to a simple .o file shared by + all 32-bits a.out targets. + +Wed Oct 16 11:11:05 1991 John Gilmore (gnu at cygnus.com) + + * configure.in: Allow i386-sco-sysv. + * bout.c: Remove unused i960_align; lint dummy core file handlers. + * cpu-h8300.c: lint. + + * host-aout.c: New strategy. We use common code, include files, + and data structures to handle the file, but set a few parameters + from the host's config file (page size, text start addr, etc). + * libaout.h: Define HP BSD machine types. + * aoutf1.h: Handle reading a.outs with these types. + + * trad-core.c: Pass the u.u_ar0 value as the negative of the + virtual-memory-address of the .reg section. We can't just make a + section for "all the regs and nothing else" because only GDB knows + exactly where the regs are (scattered around the upage and stack). + Clean up memory allocation. Remove big- and little-endian + vectors, replace with single vector; this only runs on the host, + in host byte order. Replace byteswap routines with aborts in case + anyone calls them. + * targets.c: There's only one trad_core_vec now. + * aoutf1.h (sunos_core_file_p): VMA of .reg* now needs to be 0. + +Tue Oct 15 08:29:03 1991 John Gilmore (gnu at cygnus.com) + + * hosts/h-amix.h (free): Fix prototype. + + * aoutx.h: Don't use NULL as an integer, for braindead systems + that declare it as (void *)0. (From Peter Schauer.) + +Mon Oct 14 17:20:47 1991 Per Bothner (bothner at cygnus.com) + + * opncls.c (bfd_fdopenr): Add parentheses to avoid reported + problem with bad Ultrix system headers. + * aoutx.h (NAME(aout,set_section_contents)): Try to handle the + various kinds of alignments for the various kinds of + magic numbers. + +Mon Oct 14 14:23:10 1991 John Gilmore (gnu at cygnus.com) + + * doc/Makefile: Don't assume . is on the path (from James Clark). + +Fri Oct 11 22:45:14 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Avoid Sun Make VPATH bugs. + * targets.c: Declare trad_core vectors extern. + +Fri Oct 11 13:03:02 1991 Per Bothner (bothner at cygnus.com) + + * coffcode.h: Moved ALIGN macro to libbfd.h. Removed i960_align. + * libbfd.h: Moved ALIGN macro here. + * bout.c (b_out_callback): Replace i960_align by align_power. + + * libaout.h (struct aoutdata): Added fields page_size, + segment_size and exec_bytes_size. These help generic code + (in aoutx.h and libaout.h) to figure out where to align + the various segments in a demand paged file. + * libaout.h (WRITE_HEADER): Use new (struct aoutdata) fields + to decide if the exec header counts in a_text (text segment size). + Also, assume D_PAGED flag is set; don't set it here. + * bout.c (b_out_callback): Add initialization of + adata fields page_size, segment_size, and exec_bytes_size. + * host-aout.c (NAME(host_aout, callback) and + NAME(host_aout,mkobject): Ditto. + * i386aout.c (aout386_callback) and new aout386_mkobject): Ditto. + * newos3.c (newsos3_callback) and new newsos_mkobject): Ditto. + * aoutf1.c (sunos4_callback) and new sunos_mkobject): Ditto. + * aoutx.h (NAME(aout,some_aout_object_p)): Don't subtract + EXEC_BYTES_SIZE from the a_test size; this is only appropriate + for some systems (mainly sunos), so do it in the callback instead. + Same routine: Add stuff to the THIS_IS_ONLY_DOCUMENTATION comment. + * aoutx.h (NAME(aout,set_section_contents): Change the way + filepos and size of sections are carried out to support + older styles of demand paged executables. + + +Fri Oct 11 12:33:36 1991 Steve Chamberlain (steve at cygnus.com) + + * bfd-in.h: Added more macros to COFF_SWAP_TABLE. + * bfd.c: Added macros to enable gas to swap coff records. + * coffcode.h: Make the coff_swap_*_out routines return the number + of bytes swapped, and cleaned up their prototypes. + * configure.in: Added ebmon/coff support + * ecoff.c: Changed null definitions of coff_swap_*_out to conform + to new prototypes + * targets.c: Added new entry points for coff swapping + +Fri Oct 11 03:01:52 1991 John Gilmore (gnu at cygnus.com) + + Restructure configuration scheme for bfd, binutils, ld. + + * include/sys/h-*.h: Move to bfd/hosts/h-*.h. + * configure.in: Revise to symlink sysdep.h to hosts/h-xxx.h. + Change some config names to match other dirs. + * *.c: Include bfd.h before sysdep.h, so ansidecl and PROTO() + get defined first. + * Makefile.in: Use -I. to get sysdep.h. Remove refs to + ../include/sysdep.h. + * cpu-i960.c: Strncmp needed a length arg. + * ecoff.c: Don't ever call trad_unix_core_file_p from here. + * i386aout.c: Remove dead N_TXTOFF override. + * trad-core.c: Don't disable the whole file if SUN4_SYS. + * config/: Rename some config files to match up h-*.h names. + Remove all the HOST_SYS definitions from the config files. + * hosts/h-amix.h, h-i386v.h: Define POSIX_UTIME, not USG. + * hosts/h-hp9000.h: Remove USG comment. + * hosts/h-rs6000.h: Include <stdlib.h> for malloc. + * hosts/h-news.h, h-sparc-64.h: New config files that had + previously been kludged in the <sysdep.h> file. + +Thu Oct 10 17:54:08 1991 John Gilmore (gnu at cygnus.com) + + * config/*: trad-core support is HOST dependent, not target + dependent. Target config files only set DEFAULT_VECTOR and/or + other vector elements. Exception: when host-aout.c is in use, + in which case we're forced to assume we're native (hp, vax, + tahoe). Rename XDEPFILES to HDEPFILES. + * Makefile.in: Rename XDEPFILES. + * config/h-sun*: Don't force static linking. + * trad-core.c: Document how to use it nowadays. + * i386aout.c, newsos3.c: Clean up. + * i386coff.c: Allow 386 coff files to be used as core files too + (for reading core files from embedded systems). + +Tue Oct 8 15:30:39 1991 John Gilmore (gnu at cygnus.com) + + * Add i386aout.c for a.out support on the i386. + +Tue Oct 8 12:18:54 1991 Roland H. Pesch (pesch at cygnus.com) + + * reloc.c, section.c, syms.c, targets.c: correct info-node + structure in *doc* comments. + doc/Makefile: stop hiding complaints from makeinfo. + +Sun Oct 6 19:10:06 1991 John Gilmore (gnu at cygnus.com) + + * aoutx.h (...some_aout_object_p): Take a third parameter, + the internal_exec struct, and avoid ever looking at an + external_exec. All callers changed to read the entire + external_exec struct, swap and check its magic number, + swap in the whole structure, and pass the swapped-in version to + some_aout_object_p. + * bout.c: Bring into modern era. Use single _object_p routine + for big- aand little-endian. Provide internal and external + exec header structs. Use separate swap-in and swap-out routines. + + * libaout.h: Move struct internal_exec from ../include/aout64.h + to here. Add obj_symbol_entry_size to struct aoutdata. + * aoutx.h (...some_aout_object_p): Set obj_symbol_entry_size. + + * ../include/aout64.h: Change EXTERNAL_LIST_SIZE to + EXTERNAL_NLIST_SIZE. Callers changed. + +Fri Oct 4 18:18:46 1991 John Gilmore (gnu at cygnus.com) + + * bfd.c: Remove strerror() to libiberty. + + * elf.c: Remove elf_set_section_contents, use generic one. Lint. + * libbfd-in.h, libbfd.c: Add bfd_generic_set_section_contents. + * libbfd.c (bfd_generic_{get,set}_section_contents): Check that + last byte of transfer, not first byte, is within the section. + + * host-aout.c: Remove `BSD' archive support. Lint. + + * archures.c: Rename `struct bfd_arch_info_struct' to `struct + bfd_arch_info'. Rename `typedef bfd_arch_info_struct_type' to + `bfd_arch_info_type'. All uses changed. + * reloc.c: Rename `bfd_reloc_status_enum_type' to + `bfd_reloc_status_type'. Rename `bfd_reloc_code_enum_real_type' + to `bfd_reloc_code_real_type'. (This seems to be a misnomer, + it needs a better name.) All uses changed. + * targets.c: Rename `enum target_flavour_enum' to `enum + target_flavour', and remove the `_enum' from all of the enum + values themselves. All uses changed. + + * configure.in, config/h-i386mach: i386 mach host. + * config/t-i386-aout: Use host-aout.c. + + * trad-core.c: Give it its own xvec's to make it independent + of other file formats. + * ecoff.c, host-aout.c: Remove refs to trad-core. + * config/t-dec3100, t-hp300bsd, t-tahoe, t-vax: Define TRAD_CORE. + * targets.c: #ifdef TRAD_CORE, include it in the vector. + +Fri Oct 4 17:38:03 1991 Steve Chamberlain (steve at cygnus.com) + + * reloc.c: Extended NEWHOWTO macro + * ieee.c: Changed the way 8bit pcrel is done + * cpu-h8300.c: got the registers in the right order + +Thu Oct 3 19:39:55 1991 John Gilmore (gnu at cygnus.com) + + * bfd-in.h: enum boolean => enum bfd_boolean for SVR4. Gumby's + prediction is vindicated! + + * bfd-in.h, libbfd-in.h, doc/Makefile, doc/tolibbfd, doc/intobfd: + Remove refs to howto.c, since Steve forgot. + +Thu Oct 3 07:49:21 1991 Steve Chamberlain (steve at cygnus.com) + + * elf.c: took the abort out of set_arch_mach so that objdump -i will + still work. Now allows any architecture/machine to be set. + +Wed Oct 2 13:50:35 1991 Steve Chamberlain (steve at cygnus.com) + + * howto.c deleted and moved code to reloc.c + + * libbfd.h, libbfd-in.h removed $id stuff for real + + * cpu-h8300.c Made it match various different spellings of h8300. + + * archures.c: Took out the first char filter which made it only + look for a cpu/arch match when the first chars of supplied and + tested names were the same. + + * targets.c removed oasys stuff, pending someone to fix the bugs + in it. + + +Tue Oct 1 12:29:44 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in, configure.in, targets.c, elf.c: Add preliminary + ELF support good enough for GDB. + * configure.in, config/h-amix, config/t-m68k-elf: Handle + m68k-cbm-svr4 host and target. + * config/t-m68k-coff, t-m88k-coff, t-m88k-aout: Make files nonempty + so `diff' and `patch' can cope. + +Tue Oct 1 11:24:31 1991 Steve Chamberlain (steve at cygnus.com) + + * archures.c: removed texinfo error + + * init.c: added texinfo hooks, and removed initialization error + message. + + * libcoff-in.h, libbfd-in.h removed $id field so cvs can merge + without complaints. + +Tue Oct 1 05:02:53 1991 John Gilmore (gnu at cygnus.com) + + * cpu-i960.c: Avoid numerical count of initializers. + + Vax Ultrix changes from David Taylor <taylor@think.com>: + * host-aout.c: Make little-endian vector really little-endian. + * configure.in: Separate vax and tahoe cases, handle ultrix. + * config/t-vax: Add trad-core.o. + * config/h-vaxult: New host system. + +Mon Sep 30 15:13:46 1991 Steve Chamberlain (steve at cygnus.com) + + * bfd-in.h VERSION, change version number to 0.18, this makes a + gap, but now is the same as the linker version number. + + * cpu-a29k.c, cpu-i386.c, cpu-m68k.c, cpu-mips.c, cpu-vax.c, + cpu-h8300.c, cpu-i960.c, cpu-m88k.c, cpu-sparc.c: added. These + files will eventually contain processor specific bits for bfd, + like strange relocation information and dis/assembly. So far only + the H8 has been even partially done. This work also ties in with + the change in handling architectures. + + * amdcoff.c: (a29k_reloc) fix error message. + + * aout-f1.h: (choose_reloc_size) now calls bfd_get_arch to + discover the architecture of the bfd. (sunos4_callback) calls the + function bfd_set_arch_mach rather than stuffing stuff directly + into the bfd. (sunos4_write_object_contents), changed names of + accessor functions. + + * aoutx.h: (set_arch_mach) now calls bfd_default_set_arch_mach to + setup the environment. + + * archive.c: (bfd_slurp_coff_armap) coff archives always have the + headers in big endian format, regardless of the endianess of the + host or target. + + * archures.c: totally changed. Now an architecture is represented + with a pointer to an info structure rather than an enumerated type + and a long. The old info is available as two elements in the + structure. Future enhancements to architecure support will + involve pointers to methods being placed into the info structure. + + * bfd.c: changed the definition of the bfd structure for the new + architecture stuff. + + * bout.c: (b_out_set_arch_mach) changed to use the new + architecture mechanism. + + * coffcode.h: (coff_set_arch_mach, coff_set_flags) changed to use + the new architecture mechanism. + + * configure.in: added h8 stuff. + + * ieee.c: too many changes to note. Now ieee files written with + bfd gas and ld can be read by gld and ieee only linkers and + simulators. + + * libbfd.c, libbfd.h: changed prototype of bfd_write. + + * newsos3.c: (newos3_callback) now calls bfd_set_arch_mach rather + than fixing the structure directly. + + * oasys.c: (oasys_object_p) now calls bfd_default_set_arch_mach rather + than fixing the structure directly. + + * opncls.c: (new_bfd) makes sure that bfd_init has been called + before opening a bfd. + + * srec.c: (srec_set_arch_mach) now calls bfd_default_set_arch_mach + rather than fixing the structure directly. + + * targets.c: (target_vector) now by defining SELECT_VECS (perhaps + in the t/hmake file) a user can select which backends they want + linked with bfd without changing the source. + + * init.c: new, looks after initializing modules. + + * howto.c: for future use, will allow an application to work out + what cookie to use as a handle on a relcoatio howto. + +Mon Sep 30 13:31:15 1991 John Gilmore (gnu at cygnus.com) + + * srec.c: Better error checking, partly from Peter Schauer. + (srec_object_p): Avoid assuming any file that starts with 'S' is + an S-record file! (Check for 3 uppercase-hex digits after it.) + (ISHEX): Define new macro for checking supposedly hex characters. + (pass_over): Treat as EOF any S-record line that: + * doesn't have hex in either size character + * produces a size larger than 0x7F + * has an unrecognized type number + +Thu Sep 26 15:27:29 1991 John Gilmore (gnu at cygnus.com) + + * aoutf1.h, aoutx.h, bout.c, coffcode.h, host-aout.c, oasys.c, + opncls.c: Lint (saber actually). + +Thu Sep 26 11:24:24 1991 Per Bothner (bothner at cygnus.com) + + * libaout.h (WRITE_HEADERS): Set header's a_text field always. + * newsos3.c: Fixed two types: newos3 -> newsos3. + * reloc.c (bfd_perform_relocation): Fix pc-relative relocation + to use correct segment. + +Mon Sep 23 18:24:34 1991 Per Bothner (bothner at cygnus.com) + + * aoutx.h (print_symbol): Handle missing symbol->name. + +Fri Sep 20 12:26:01 1991 Stu Grossman (grossman at cygnus.com) + + * aoutf1.h (swapcore_sparc): Change name of USRSTACK, fix comment + at top of routine. + +Tue Sep 17 17:23:49 1991 Stu Grossman (grossman at cygnus.com) + + * oasys.c, configure.in, config/h-irix3, config/t-irix3: + add sgi/irix support. + +Thu Sep 12 14:29:09 1991 John Gilmore (gnu at cygint.cygnus.com) + + Changes for the AMD 29000 Ultracomputer port from David Wood. + (wood@nyu.edu). + + * opncls.c (bfd_fdopenr): Handle NO_FCNTL. + + * Makefile.in: Make subdirs work by using $(INCDIR) in the + crude dependencies. + + * coffcode.h (coff_real_object_p): Pass information about the + current file's coff symbol format to BFD via the coff_data struct. + (coff_find_nearest_line): obj_icof => coff_data. + (coff_swap_sym_{in,out}): Check that SYMNMLEN == E_SYMNMLEN. + (coff_swap_aux_{in,out}): Check that FILNMLEN == E_FILNMLEN + and DIMNUM == E_DIMNUM. + * configure.in: Handle a29k-*-* hosts, and targets + a29k-*-coff, a29k-*-aout, and a29k-*-sym1. + * libcoff-in.h: Add local_n_btmask, local_n_btshft, + local_n_tmask, local_n_tshift, local_symesz, local_auxesz, + local_linesz to `coff_data' (tdata) struct. + (coff_data, coff_data_type, coff_tdata): Rename struct icofdata. + * config/h-ultra3: Handle a29k-*-* hosts as Ultracomputers. + +Thu Sep 12 14:07:22 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * Makefile.in: $(MAKE) for make, $(docdir) for doc + * doc/Makefile: redundant dependencies for Sun-make VPATH bug + +Tue Sep 10 20:34:12 1991 John Gilmore (gnu at cygint.cygnus.com) + + * aoutf1.h (sunos4_core_file_p): Release the right storage in + error case. + (sunos4_core_file_matches_executable_p): Fix header comparison. + * aoutx.h: Avoid shifts of 32 bits, undefined in C. Lint. + * bout.c, icoff.c, ieee.c, libbfd.c, oasys.c: gcc -O -W lint. + +Wed Sep 4 00:44:52 1991 John Gilmore (gnu at cygint.cygnus.com) + + Allow GDB to patch object files. + + * aoutf1.h (sunos_core_file_p): Set SEC_HAS_CONTENTS on all sections. + * trad-core.h (trad_unix_core_file_p): Ditto. + * aoutx.h (aout_set_section_contents): On first output, check + abfd->direction and complain if erroneous. + + * Makefile.in: Add crude dependencies. + +Tue Sep 3 13:46:19 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * config/* aoutx.h configure* shortened all the h/tmake-xxxx + to h/t-xxxx files so that everything will work on System V. + +Fri Aug 23 13:51:06 1991 John Gilmore (gnu at cygint.cygnus.com) + + * aoutx.h: Add information on host-aout.c and how to configure + to use it, to the manual. + * configure.in: Tix typo. + * ecoff.c: If compiling for DEC3100, use trad_unix core files, + else dummy out the core file support. + * trad-core.c (trad_unix_core_file_p): If HOST_DATA_START_ADDR is + specified, use it to locate the data section. + * coffcode.h (coff_write_symbols): Declare buffer as bfd_bytes + rather than as chars (lint). + +Thu Aug 22 22:20:19 1991 Stu Grossman (grossman at cygint.cygnus.com) + + * aoutx.h, coffcode.h: saberized. + +Thu Aug 22 11:27:06 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * bfd.texinfo: some cleanup, reincorporated more intro matter from + bfd.doc + bfd.c, targets.c: minor rewording of doc segments + + +Wed Aug 21 19:13:22 1991 John Gilmore (gnu at cygint.cygnus.com) + + * trad-core.c (trad_unix_core_file_p): Use HOST_TEXT_START_ADDR, + etc, rather than TEXT_START_ADDR. + * host-aout.c: Remove #if 0 around whole thing. + Update to modern (32/64-bit) a.out naming conventions. + Include a large chunk of ../include/a.out.gnu.h to get macros that + are not defined by the system include files. + (host_aout_{32,64}_write_object_contents): Use the WRITE_HEADERS + macro used by the other a.out implementations. + * Makefile.in: Give dependencies to OPTIONAL_BACKENDS. + +Wed Aug 21 14:33:06 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * Makefile.in: use targets "bfd.dvi" and "bfd.ps" instead of + texdoc and psdoc; make these depend on generated .texi's + + * scanit, (new) unPROTO: turn PROTO macros into ANSI declarations in + doc + + * bfd.c, reloc.c, syms.c: minor spelling/wording fixes in doc + portions + + * Makefile.in, awkscan-ip, awkscan-p, intobfd, + libbfd.h, libcoff.h, tolibcoff; new bfd-in.h, libbfd-in.h, + libcoff-in.h: (a) use separate files for invariant parts of bfd.h, + libbfd.h, and libcoff.h; (b) in generated parts of same, use less + obtrusive marks indicating .c origins. + + * bfd.texinfo: generalize most references to linker + +Tue Aug 20 15:18:02 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * Makefile.in: include core.p in PROTOS (building better bfd.h) + * archures.c: remove empty foo() definition (crept in at vn1.9) + +Mon Aug 19 13:48:22 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * bfd.texinfo: use @setchapternewpage on instead of lots of + @page's; minor rephrasing in Introduction. + + * aoutx.h, archive.c, archures.c, bfd.c, bfd.texinfo, cache.c, + coffcode.h, core.c, format.c, ieee.c, libbfd.c, libbfd.h, libcoff.h, + oasys.c, opncls.c, reloc.c, section.c, syms.c, targets.c (documentation + segments): used BFD (caps) more consistently as a name in + discourse, fixed a few other minor typos and uses of fonts + + +Thu Aug 8 16:47:43 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * coffcode.h: fixed bug where string table size wasn't being swapped. + +Thu Aug 1 16:35:28 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * section.c: added SEC_CONSTRUCTOR_TEXT|DATA|BSS flags + + * syms.c: added BSF_CONSTRUCTOR, BSF_WARNING and BSF_INDIRECT + flags. (bfd_print_symbol_vandf) now knows what to do with the + above flags. + + * aoutx.h: made translate_from_native_sym_flags and + translate_to_native_sym_flags produce the above flags. + + +Wed Jul 31 09:53:52 1991 John Gilmore (gnu at cygint.cygnus.com) + + * all files: update copyright notices for GPL version 2. + Install header comments and attribute most modules to their + authors. BFD's name is now officially "Binary File Descriptor", + so remove any conflicting pejoratives. + archures.h: Consists solely of comments; remove it. + +Fri Jul 26 18:11:34 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * Makefile.in, bfd.c: Made it compile again. + +Fri Jul 19 08:17:09 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * newsos3.c, targets.c, coffcode.h: new patches from David Wood + + +Mon Jul 15 16:27:42 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * aoutf1.h archive.c bfd.c coffcode.h core.c ecoff.c ieee.c + bfd.texinfo oasys.c opncls.c reloc.c srec.c: More documentation on + lint fixes. + + * amdcoff.c bfd.texinfo Makefile.in : Folded in changes for amd + 29k coff by David Wood (wood@lab.ultra.nyu.edu). + +Thu Jul 4 09:53:16 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * Everything: created some new files, core.c format.c, reloc.c, + section.c and syms.c to split the functionality a bit better. + Cleaned up the rest of the files a bit, and added some + documentation. + + +Mon Jul 1 13:29:47 1991 David Wood (wood at david.ultra.nya.edu) + + * opncls.c, ../include/sys/h-sun3.h ../include/sys/h-sun4.h: fcntl + really takes 3 arguments, patched code and ammended prototypes. + +Fri Jun 14 13:19:40 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * ../include/bfd.h (struct bfd_target): Added new field + "align_power_min" which contains the minimum alignment for a + section. This is used in coff_new_section_hook. The field + insertion necessitates an update of all backends.. + + * aoutf1.h jump table field inserted + + * archive.c(snarf_ar_hdr)(bfd_slurp_coff_armap) can now parse dgux style extended + filenames too. + + * bout.c(b_out_squirt_out_relocs) fix to assertion tests. Jump + table field inserted. + + * coffcode.h(just about everything) Now patches up symbol tables + using a different mechanism. The Intel major bug has been fixed, + and the linker can self host on the Aviion and be debugged with + gdb. + + * ecoff.c: new include and jump table patch, i386coff.c: new + include and jump table patch, icoff.c: new include and jump table + patch, ieee.c: can now read archives containing ieee modules., + libcoff.h: added (combined_entry_type), libieee.h: uped max + sections to 20, m68kcoff.c: new include and jump table patch, + m88kbcs.c: new include and jump table patch, oasys.c: various bugs + fixed. opncls.c: added bfd_alloc_grow and bfd_alloc_finish. + srec.c: jump table patch. trad-code.c fixed #IF typeo + +Fri Jun 7 12:35:46 1991 Sean Fagan (sef at cygint.cygnus.com) + + * coffcode.h (coff_swap_aux_in): added else case to deal with + filenames less than 9 characters. + + +Thu Jun 6 18:27:38 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * ../include/oasys.h oasys.c (oasys_archive_p): fixed so it works + + * srec.c: now allows any number of sections to be created in a + file. Outputs addresses of the right length. + +Thu May 30 15:30:10 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * bfd.c (bfd_check_format): Fixed problem where when a defaulted + target didn't match, the format got set to the attempted match, + breaking a future test. + + *../include/i386coff.h : fixed typo in type field with size + + * i386coff.c icoff.c m88k-bcs.c ecoff.c ../include/bfd.h : Added + support in the jump table for the swapping routines exported to + gdb. Now gdb works with the 386. + +Tue May 28 17:21:43 1991 John Gilmore (gnu at cygint.cygnus.com) + + * Merge in changes from gdb-3.95 release. + Makefile.in: Allow hmake and tmake files to add OFILES. + aoutf1.h: + bfd.c: support specific targets as well as searching. When + searching, take default target in preference to others. + bfd.doc: typos + ieee.c, oasys.c: Avoid using the "tdata" macros left of assignment. + liba.out.h: Don't hard-code file offsets; use N_ macros for them. + libbfd.h: Support specific targets as well as searching. + opncls.c: Support specific targets as well as searching. + targets.c: Search is short-circuited if default target matches. + liboasys.c, libieee.c: Undo bothner changes that make macros + work to the left of assignment, but which depend on the + representations of different pointer types being the same. + +Fri May 24 18:56:52 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * i386coff.c: created. + * coffcode.h: added support for 386. + * Makefile.in: added support for 386. + * ../include/i386coff.h: created + +Wed May 22 07:26:38 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * coffcode.h: removed all put_x_<sizes> + * libbfd.c: Changed #ifdef __GNUC__ to #ifdef HOST_64_BIT, Added + DEFUNS + + +Tue May 21 08:58:58 1991 Steve Chamberlain (steve at cygint.cygnus.com) + (bothner) + * opncls.c: Changed obstack_chunk_alloc use xmalloc + +Mon May 20 17:12:17 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * everything: Removed sysdep.h from bfd.h and put back into files + from which it was split out. Now 64 bit version is built with a + -DHOST_64_BIT="long long" on the compile line. + +Fri May 17 19:35:26 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + Changed all the [get|put][name] routines to use [get|put]_[size + in bytes]. + + Put in support for 64 bit work. Now two versions of bfd may be + generated, according to the state of TARGET_64_BIT, one which is + 32 bit only, and one which is 64/32 bits. + Created new back end 'demo64' to test 64 bit functionality. + + Renamed some files to work on DOS. + + * archive.c: lint * bfd.c: prototypes and lint. * ecoff.c: added + 64bit transfer * icoff.c: added 64bit transfer * ieee.c: name + chage, 64 bit transfer. * liba.out.h: Split out common code from + sunos and newsos into liba.out. Name changes and prototype mods. * + libbfd.c: lint and prototypes, extra 64bit swaps. * libbfd.h: + prototypes for new functions. * libcoff.h: lint * libieee.h: make + work on DOS * liboasys.h: make work on DOS * m88k-bcs.c: Name + change and 64bit stuff.* newsos3.c: common code removed, new jump + table. * oasys.c: Name change * opncls.c: Portability fixes * + srec.c: Name changes * sunos.c: Removed comon code. * targets.c: + Added demo * aout32, aout64.c include aoutx.h * bout.c: used to + be called b.out.c * coffcode.h: used to be called coff-code.h, now + 64bit ized. * demo64.c: 64 bit a.out back end + +Thu May 16 16:02:07 1991 Steve Chamberlain (steve at cygint.cygnus.com) + from bothner + * libieee.h: Make ieee_data and ieee_ar_data macros usable + on LHS of assignment, even when using old compilers. + * liboasys.h: Ditto for oasys_data and oasys_ar_data. + * m68kcoff.c: Add enum-to-int casts to accomodate old compilers. + * newsos3.c: Fix definitions of SEGMENT_SIZE and TEXT_START_ADDR. + * opncls.c: Define S_IXUSR, S_IXGRP, S_IXOTH if undefined. + * targets.c: Add declaration of newsos3_vec. + +Mon May 13 10:03:29 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * aout.c: fixxed some of the problems with filepos calculation. + (swap_ext_reloc): fixed problem with creation of relocs. + (aout_set_section_contents): fixed filepos problem + + * coff-code.h: (swap_filehdr_in, swap_filehdr_out) add. + (swap_filehdr) delete. Changed all the usage of bfd_h_put_x. + (swap_aouthdr_in, swap_aouthdr_out) add. (swap_aouthdr) delete. + (coff_real_object_p) cleaned up, added MIPS. (coff_object_p) + cleaned up. (coff_write_object_contents) cleaned up. + + * ecoff.c: Totally different. Now supports ecoff fully. + + * icoff.c: fixed problems in relocation callout. + + * libcoff.h: (struct icofdata) removed hdr structure from tdata. + + * m68kcoff.c: updated target vector. + + * sunos.c: (choose_reloc_size) added: (sunos4_callback) calls + choose_reloc_size. (sunos4_write_object_contents) now calls + choose_reloc_size so outputs relocs correctly, also calculates the + size of the sections correctly. + + + +Fri May 10 16:58:53 1991 John Gilmore (gnu at cygint.cygnus.com) + + Merge Per Bothner's changes to modularize BFD a.out a bit. + + * libbfd.h, libbfd.c (bfd_generic_get_section_contents): Add. + * ieee.c: Cast enums to int before comparing them, for brain- + dead compilers. + * coff-code.h: Remove coff_get_section_contents, and use the + generic one instead. + + * aout.c: Derive new module from sunos.c, containing generic + support code for all kinds of a.out files. + + * sunos.c: Remove all code that goes in aout.c. Split out + machine dependent followup in sunos4_object_p into + sunos4_callback. Use JUMP_TABLE(aout) for the transver vector, + and redefine only the names we CHANGE, not all the names. Drop + the little-endian vector, and rename the vector as sunos4 rather + than generic. + + * b.out.c: Use aout.c routines for most of the work. Slight + changes for the new regime. Remove close_and_cleanup and + get_section_contents in favor of generics. New transfer vector + regime. + + * newsos.c: New support for Sony NEWS, another a.out format. + + * ecoff.c: Remove close_and_cleanup. New tvec regime. + * icoff.c, m88k-bcs.c: Add write_contents to tvec. + * ieee.c, oasys.c: Remove close_and_cleanup, add write_contents + to tvec. + * opncls.c (bfd_close): Call format-dependent write_contents + routine, if writing, before calling target-dependent + close_and_cleanup routine (which is now always generic, I think). + * srec.c: Use bfd_alloc instead of malloc. Remove + close_and_cleanup and move code from it to + srec_write_object_contents. Add write_contents to tvec. + * targets.c: Remove a.out little vector, replace a.out big + vector with SunOS vector. FIXME: Need Vax support again now. + + * libbfd.h: Add write_contents format-dependent-vector to the + bfd_target vector. Supply a generic close_and_cleanup routine. + * liba.out.h: Handle the new aout.c split. Add prototypes for + all routines defined in aout.c. Rename "sunos" things to "aout" + things. Add a few fields where needed for various formats. + * Makefile.in: Add aout.c and newsos.c. + + * archive.c, ieee.c, oasys.c: Lint. + +Fri May 10 12:34:48 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * ../include/bfd.h + changed forward declaration struct stat; to reduce warnings. Changed + comment on bfd_h_<x>_x. + + * ../include/m68kcoff.h, ../include/intel-coff.h, + ../include/m88k-bcs.h + Now there are two incarnations of relocs, linenos and syments. One for + internal digestion, and one full of char arrays for I/O. The original + names have gone to detect errors. + + * Makefile.in, m68kcoff.c, targets.c + Test new structure code with a 68k coff implementaion + + * coff-code.h, icoff.c, coffswap.c, libcoff.h + Fixed all the places where there were problems with the size and + alignments of structures on disk and structures in memory. #ifed out + all the code in coffswap.c, since it should be done using the target + swap routines now. + +Thu May 9 11:00:45 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * ieee.c (do_one, ieee_slurp_section_data): now supports the load + multiple reloc command. + + * sunos.c (sunos4_set_section_contents): Made it so that sections + are always padded to their alignment size. + +Sat May 4 15:49:43 1991 John Gilmore (gnu at cygint.cygnus.com) + + * archive.c, bfd.c, coff-code.h, opncls.c, sunos.c, trad-core.c: + Clean up types and such (saber C problems). + * ecoff.c: Clean up types and such. Remove routines that are + not used. Fix up reading and swapping of shorts from files. + + Notes on bfd-0.5.2-patch1a, from Per Bothner: + + * a.out.vax.c: Remove two bogus "static" from prototypes. + + * ecoff.c: Got rid of lots of non-working junk (that had + been copied directly from coff-code.h). + Updated to be consistent with updates to icoff.c and coff-code.h. + + * libbfd.h: Added definitions for S_IXUSR, S_IXGRP, and S_IXOTH + if they're missing (as they are in (BDS-4.3-based) NewsOS-3). + + * sunos.c (n_txtoff): (Re-)Add support for sony. This is a kludge, + but until the target_vector is automatically generated, + it's as good as any. Note that the text offset is the only + difference between NewsOS and SunOs (including magic numbers). + (Most of the sunos_* routines should to renamed bsd_* + and move to a bsd.c file. Then (and when the target_vector + is automatically generated) it might make sense to create + a separate Sony target.) + + * sysdep.h: Don't declare fread and fwrite. Causes trouble + on some systems, and doesn't help on others. + Similarly, only define X_OK if not already defined. + + * trad-core.c: Don't include sys/stat.h - at least + on NewsOS 3, it has already been included. + +Tue Mar 5 01:47:57 1991 John Gilmore (gnu at cygint.cygnus.com) + + * coff-code.h (bfd_coff_swap_sym, bfd_coff_swap_aux, + bfd_coff_swap_lineno): Export the routines that byte-swap COFF + symbol tables if necessary when reading them in, so gdb can use + them. Add "bfd_coff_" to the names so they won't conflict with + names in calling programs. FIXME-soon: if coff-code.h is + included in two BFD modules, this will cause duplicate + definitions; the routines should be exported to a separate, + common, module (probably along with a mess of other ones). + +Sat Mar 2 12:11:26 1991 John Gilmore (gnu at cygint.cygnus.com) + + Improve modtime support. + + * bfd.h: Add boolean mtime_set, and declare bfd_get_mtime. + Remove #define for bfd_get_mtime. Remove gratuitous comment. + * bfd.c (bfd_get_mtime): New fn, caches mtime, gets if not cached. + BUG: archive members still do not get correct mod times. + + Improve floating point support for core files. + + * sunos.c (struct core): Change void *fpa_dummy to double fp_stuff. + (sunos4_core_file_p): Create a second registers section in the + core file, called ".reg2", for the float registers. + +Thu Feb 14 15:49:06 1991 Gumby Vinayak Wallace (gumby at cygint.cygnus.com) + + * many changes to improve archive handling; found a logic flaw in + bfd_check_format which only just happened to work by cooncidence. + +Thu Feb 14 07:53:16 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * bfd.c (bfd_perform_relocation): fixed to use output_offsets + correctly. + + * bfd.h: changed type of udata in asymbol to void *, like it + should be. Added bfd_reloc_dangerous enum member. + + * coff-code.h: Fixed it so that internally generated symbols get + their values relocated correctly in all cases. Removed calls to + xmalloc. + + * icoff.c: Not understanding the destination symbol of a reloc is + not a failure any more, just 'dangerous'. This allows linking of + b.out and coff images. + + * sunos.c: Cleaned up the way that ZMAGIC section sizes are + calculated. + + +Tue Feb 12 13:25:46 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * sunos.c (translate_to_native_sym_flags): fixed + sym_pointer->n_value so that symbols on the way out get their + section relative values calculated correctly. + + * coff-code.h (mangle_symbols): fixed problem where tags were not + being relocated for structs, enums, unions. Also various lints. + +Mon Feb 11 19:52:26 1991 Gumby Vinayak Wallace (gumby at cygint.cygnus.com) + + * archive.c (get_elt_at_filepos): system_call_error returned + incorrectly. + +Sun Feb 10 23:18:40 1991 Gumby Vinayak Wallace (gumby at cygint.cygnus.com) + + * Resolve the use of no_error and system_call_error. + The bfd library itself now will never set bfd_error to + no_error. + + The code still needs to be combed to make sure all the error + codes are correct. I suspect they are not always set correctly. + + * The names of all the messages have _ prepended because the sun + bundled compiler can't distinguish from a macro which takes an + argument and the same identifier in a non-macro context. + + * The reason for the above being that entry points which used to + be trampoline functions are now just macros which expand to a + direct call through the bfd's xfer vector. + + * (../include/intel-coff.h) F_AR32WR: fix this constant. Why + must gas have its own version of everything (the gas version + had the correct value) + +Tue Feb 5 11:46:53 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + * b.out.c: Added patches supplied by chrisb@mipon2.intel.com to + properly support i960 architecture and output correct reloc stuff. + + * bfd.h: added prototype for bfd_printable_arch_mach, added + BFD_FAIL + + * coff-code.h: Applied patches from chrisb to support i960 + architecture, zero relocs and swap them correcly and conditionally + compiled the timestamp. + + * sunos.c: Made the default section alignment 2^3 so that doubles + are done properly. Fixed the same reloc bug that was in b.out.c + + * sysdep.h: Now compiles on a Posix box + +Wed Jan 30 21:36:26 1991 John Gilmore (gnu at cygint.cygnus.com) + + * icoff.c: Fix comment on big-endian version. + * coff-code.h: Make HAS_RELOC really work (it's backwards from + F_RELFLG). Set F_AR32WR in output files if little endian + architecture. + +Tue Jan 29 20:56:10 PST 1991 steve@cygnus.com + + * archures.c fixed =/== typo + + * sunos.c added architecture stuff for output. Fixed + bug where files where vma(data) != size(text) + were processed wrong. + + * coff-code.h added a lint cast + + * (../include/a.out.sun4.h) fixed it so zmagic + worked + +Mon Jan 28 19:15:29 PST 1991 steve@cygnus.com + + * archive.c removed loads of includes, and fixed bug where string + table didn't have a null at the end. + + * bfd.c fixed includes, added symbols argument to + canonicalize_reloc entry point. + + * libbfd.c fixed includes and added some lint patches. + + * targets.c added both sorts of intel coff. + + * b.out.c fixed included, changed was the canonical + relocs were done. + + * icoff.c added support for callj and big and little + enidian tables. + + * opncls.c added chmod+xing for files with EXEC_P set. + + * sunos.c fixed includes. Changed default section + alignement to words. Fixed relocation stuff to work with + new scheme + + * bfd.h various new types added, prototype for new + reloc calls, changed bfd->iostream to a void * + to including files don't need stdio.h. + + * libcoff.h added conversion table to tie relocs to + canonical symbols + + * sysdep.h created + + * coff-code.h fixed includes. Added code to support + big and little endian formats. Various lints. Better + processing of symbols. Changed reloc stuff to new + order + + * libbfd.h fixed includes + + +Mon Jan 21 11:53:51 PST 1991 steve@cygnus.com + + * bfd.h changed name of alignment entry in sec_struct to + alignment_power, because of conflicting uses within bfd. + Now it should be obvious that it's a 2**n alignment + specifier. Removed start_pad, end_alignment, block, minsize, + output_file_alignment, subsection_alignment and original_vma fields. + Added align_power() macro. Fixed bfd_section_alignment + acessor macros. Added bfd_symbol_same_target macro. + + * b.out.c (b_out_write_object_contents) fixed to use + new alignment member. Fixed (callj_callback) to use section + relative symbols properly. + + * sunos.c (sunos4_object_p) fixed to use new alignment_power. + Fixed (translate_from_native_sym_flags) to correctly make + symbols section relative. + + * bfd.c (bfd_errmsg) fixed various enum cast problems. + (bfd_make_section) took out initialization of obsolete members. + (bfd_print_symbol_vandf) added + + * opncls.c (bfd_create) created. + + * coff-code.h (coff_new_section_hook) took away refs + to obsolete members. (make_a_section_from_file) added + conversion between alignment types. (coff_symbol_from) + added. (coff_count_linenumbers) only counts linenumbers + if symbol is of coff-type. (coff_mangle_symbols) only + heavily mangles symbols if symbol is coff-type. + (coff_write_symbols) various lints. (coff_write_object_contents) + various lints and modification for alignment conversion. + (coff_slurp_relocs) fixed for use with new asection shape. + +Sat Jan 19 16:10:42 PST 1991 steve@cygnus.com + + * archive.c lots of lint + + * b.out.c added callj relocation support, upgrated reloc howto. + Fixed so that asymbol and reloc records are output + correctly. + + * bfd.c lots of lint, support for new bfd entry point + bfd_print_symbol. + + * bfd.h changed definition of asymbol to contain pointer to + owning bfd, removed target dependencies. + + * cache.c took out print statements, put in BFD_ASSERT calls. + + * coff-code.h various lints, corrected linenumber output + functionality. Added support for new style asymbols and + bfd_print_symbol. Fixed so that asymbol and + reloc records are handled correctly. Added timestamp. + + * icoff.c Added support for new howto shape. + + * liba.out.h Added support for new asymbol shape + + * libbfd.c various lints + + * libbfd.h various lints + + * libcoff.h added support for new asymbol shape. + + * sunos.c various lints. Added support for new asymbol shape + and bfd_print_symbol. + +Wed Jan 16 21:38:09 PST 1991 steve@cygnus.com + + * b.out.c removed prototype of sunos4_ennativate_symtab, lots of + pointer lint. Added support for callj relocation. Fixed bug where + the last 32 bytes of the text section were overwritten by data. Fixed bug + where archives of b.out didn't work due bfd_slurp_extended_name_table + returning false. + + * sunos.c added support for n_other field. Braced the howto table so + that it won't be affected by any lengthing of the howto struct typedef. + Various lints + + * bfd.h added support for n_other field, added special_function + reloc type, modified bfd_perform_relocation prototype. Added bfd_h_get_x + macros. + + * bfd.c upgraded bfd_perform_relocation, various lints. + +Wed Jan 16 01:55:53 1991 John Gilmore (gnu at rtl) + + * ChangeLog: Started ChangeLog for BFD. + * ToDo: Create file for suggestions. + + * Makefile: Support easy loading into Saber C. + Add dependencies for icoff.o and bcs88kcoff.o. + Rename coff.c to coff-code.h. Change callers. + + * bfd.c (bfd_check_format): Allow the check_format routines + to return the desired target vector, rather than just a Boolean. + bfd.h (bfd_check_format): Change function pointer return type. + archive.c (bfd_generic_archive_p): change callee. + b.out.c (b_out_little_object_p, b_out_big_object_p, + b_out_real_object_p): change callee. + libbfd.c (_bfd_dummy_target): Dummy routine replacing bfd_false + in check_format transfer vectors that need a filler. + libbfd.h (bfd_generic_archive_p, _bfd_dummy_target): Fix decls. + bcs88kcoff.c: change callee. + coff-code.h (coff_real_object_p, coff_big_object_p): change callee. + icoff.c: change callee. + sunos.c (sunos4_object_p, sunos4_core_file_p): change callee. + + * libbfd.c (zalloc): It should actually zero the storage! + This was commented out for some reason. + + * libbfd.h: Add malloc, xmalloc, memcpy, and fatal decls. + This is so callers can avoid <stdlib.h> which doesn't exist + on older systems. + + * bfd.c (map_over_sections): Add debugging code, since I + noticed the section count for sunos core files was bad, but only + GDB had detected the problem. + (bfd_set_section_lineno_size, bfd_set_section_linenos, + bfd_get_section_linenos): Remove obsolete functions. + (bfd_apply_relocations): Use longs, not ints, for the math. + + * bfd.h: Declare enum boolean and struct bfd_target as well + as typedefs for them. Remove obsolete + bfd_get_section_lineno_size. + + * cache.c: Make the "fdopen" support work. Keep better track + of how many files are open. Centralize the opening of files + and be sure bfd_open[rw] actually try to open the file. Evade + linked list initialization problems. + + * b.out.c, coff-code.h, opncls.c, sunos.c: lint. + + * coff-code.h (coff_slurp_symbol_table): Null-terminate symtab names. + + * cplus-dem.c: Delete file, since it is not part of BFD. + + * opncls.c (bfd_openr): Eliminate misplaced #if 0 code. + (bfd_openr, bfd_openw): Actually open the file, give error now. + + * sunos.c (sunos4_core_file_p): Set section count. + (sunos4_set_section_linenos, stab_names, fprint_name): Eliminiate + obsolete definitions. + (_write_symbol_table): Initialize <idx> counter. + (foop): Eliminate debugging code. + +Local Variables: +mode: indented-text +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/gdb/bfd/ChangeLog.2 b/contrib/gdb/bfd/ChangeLog.2 new file mode 100644 index 0000000000000..a9ae8b04ded88 --- /dev/null +++ b/contrib/gdb/bfd/ChangeLog.2 @@ -0,0 +1,8842 @@ +Thu Aug 31 16:00:53 1995 steve chamberlain <sac@slash.cygnus.com> + + * Makefile.in: Update dependencies. + * aout-target.h (MY_bfd_print_private_bfd_data): New. + * bfd-in.h (PE STUFF): Deleted. + * bfd.c (tdata->pe_obj_data): New. + (bfd_print_private_bfd_data): New. + * coff-i386.c, coff-arm.c (coff_*-rtype_to_howto): Get image base from + new place. + * libcoff.h, libbfd.h, bfd-in2.h: Rebuilt. + * coffcode.h (pe_value): Delete + (coff_mkobject, coff_mkobject_hook): Conditionally build. + (coff_compute_section_file_positions): Look in new place. + (add_data_entry, fill_pe_header_info): Deleted. + (coff_write_object_contents): Remove PE stuff. + (coff_bfd_print_private_bfd_data): New. + * coffswap.h: Remove PE stuff. + * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): New. + * libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): New. + * libcoff-in.h (pe_data_type): New. + * libecoff.h (_bfd_ecoff_bfd_print_private_bfd_data): New. + * targets.c (_bfd_print_private_bfd_data): New. + * peicode.h: New file. + +Thu Aug 31 11:49:21 1995 Ian Lance Taylor <ian@cygnus.com> + + * bfd-in.h: Add extern "C" if __cplusplus. + * bfd-in2.h: Rebuild. + + * coff-mips.c (mips_relocate_section): Don't convert a reloc + against an absolute symbol into a reloc against a section. + +Thu Aug 31 08:00:14 1995 steve chamberlain <sac@slash.cygnus.com> + + * coff-arm.c (coff_arm_reloc): Fix common size problem. + (i3coff_object_p): Delete. + +Wed Aug 30 20:41:27 1995 steve chamberlain <sac@slash.cygnus.com> + + * coff-arm.c (deletemeacoff_arm_reloc): Deleted. + (arm26): Not partial inplace. + * coffcode.h (coff_compute_section_file_positions): Don't + do page aligning if COFF_PAGE_SIZE isn't defined. + * coffswap.h (coff_swap_scnhdr_in): Update image base correctly. + +Tue Aug 29 13:50:21 1995 steve chamberlain <sac@slash.cygnus.com> + + * coffcode.h (coff_compute_section_file_positions): + Compile even if COFF_PAGE_SIZE isn't defined. + * cofflink.c (_bfd_coff_generate_reloc_section): Write + base file info as rvas. + * coff-arm.c (coff_rtype_to_howto): Deal with reloc 11. + * coffcode.h (coff_write_object_contents): Remove #if0ed code + Only remove empty sections in PE inmage files. + * libbfd.h, bfd-in2.h: regenerated. + * coff-arm.c (aoutarm_std_relo): New entry at 11. + (arm_reloc_type_lookup) : Understand type 11. + * coff-i386.c (howto_table): fix name of rva type. + (coff-i386_rtype_to_howto): Understand R_IMAGEBASE type. + * coffcode.h (sec_to_styp_flags): .edata is data. + (coff_compute_section_file_positions): Get page size right for PE. + Pagesize info is only valid in PE image files. + (fill_pe_header_info): Fix fields. + (coff_write_object_contents): Remove end_of_image calc. + (_bfd_coff_generate_reloc_section): Remove orphaned comment. + * coffswap.h (coff_swap_scnhdr_in): Don't always add IMAGE_BASE. + Swap in PE header. + (coff_swap_scnhdr_out): Setup PE flags correctly. + * reloc.c (BFD_RELOC_RVA): New field. + +Thu Aug 24 17:49:59 1995 Ian Lance Taylor (ian@cygnus.com) + + * cofflink.c (coff_link_input_bfd): Don't include line numbers for + a section if its output section has no contents. + +Wed Aug 23 16:48:52 1995 Ian Lance Taylor (ian@cygnus.com) + + * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Add parentheses to FIX + expression to avoid compiler bug on HP-UX 9.01. + +Wed Aug 23 09:49:39 1995 Steve Chamberlain <sac@rtl.cygnus.com> + + * coffcode.h (pe_value): Unansify. + +Mon Aug 21 17:49:28 1995 steve chamberlain <sac@slash.cygnus.com> + + * bfd-in.h (bfd_link_subsystem): Turn enum into #defines. + (bfd_link_pe_info_dval): New + (bfd_link_stack_heap): Renamed and massaged into bfd_link_pe_info. + * bfd-in2.h: rebuilt. + * bfd.c (NT_subsystem, NT_stack_heap): Deleted. + * coffcode.h (pe_value): New function. + (fill_pe_header_info): New function. + (coff_write_object_contents): Use new function. + (coff_write_object_contents): Initialze link_data if not set. + * cofflink.c (coff_final_link_info): Remove pe randomness. + (dores_com): Update info in bfd_link_pe_info_dval. + (process_embedded_commands): Use the bfd_link_pe_info_dval. + (_bfd_coff_final_link): Remove PE stuff, initialize + coff_data->link_info. + * coffswap.h (coff_swap_[aout|filehdr]_out): Use indirect PE pointer. + (coff_swap_scnhdr_out): Use real imagebase. + * libcoff-in.h (coff_data_type.link_info): New field. + +Mon Aug 21 11:10:32 1995 Ian Lance Taylor <ian@cygnus.com> + + * linker.c (link_action): If an undefined reference follows an + undefined weak reference, change the type to undefined. + * elflink.h (elf_link_add_archive_symbols): Don't record an + undefined weak reference as defined, in case it turns into a real + undefined reference later in the same archive. + +Thu Aug 17 16:29:09 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com> + + * coff-sh.c (sh_relax_section): Cast value for used_by_bfd field + to PTR, not coff_section_tdata pointer, since PTR is the real type + of the field. + * cofflink.c (_bfd_coff_read_internal_relocs): Ditto. + +Thu Aug 17 14:44:26 1995 Ian Lance Taylor <ian@cygnus.com> + + Add support for linking SPARC SunOS PIC compiled code. + * sunos.c (SPARC_PLT_PIC_WORD0): Define. + (SPARC_PLT_PIC_WORD1, SPARC_PLT_PIC_WORD2): Define. + (struct sunos_link_hash_entry): Add got_offset and plt_offset + fields. + (struct sunos_link_hash_table): Add dynamic_sections_created and + dynamic_sections_needed fields. + (sunos_link_hash_newfunc): Initialize new fields. + (sunos_link_hash_table_create): Initialize new fields. + (sunos_create_dynamic_sections): New static function, broken out + of sunos_add_dynamic_symbols. + (sunos_add_dynamic_symbols): Call sunos_create_dynamic_sections. + (sunos_add_one_symbol): Call sunos_create_dynamic_sections. + (bfd_sunos_size_dynamic_sections): Call sunos_scan_relocs before + checking whether we need to set up the dynamic link information. + Define __GLOBAL_OFFSET_TABLE if anything referred to it. + (sunos_scan_std_relocs): Call sunos_create_dynamic_sections. Use + plt_offset field; only put symbol in .plt if it is not defined by + a regular object. + (sunos_scan_ext_relocs): Likewise. Handle base relative relocs. + (sunos_scan_dynamic_symbol): Store dynobj in local variable. + (sunos_write_dynamic_symbol): Check plt_offset rather than + checking whether symbol is in .plt section. If symbol is defined + in a regular object file, use SPARC_PLT_PIC_WORD[012], and don't + add a JMP_TBL reloc. + (sunos_check_dynamic_reloc): Add contents and relocationp fields. + If plt_offset is set, redirect relocation to PLT. If this is a + base relative reloc, redirect relocation to GOT. Check + dynamic_sections_needed field rather than whether dynobj is set. + (sunos_finish_dynamic_link): Check dynamic_sections_needed field + rather than whether dynobj is set. Don't die if .need and .rules + sections were not created. + * aoutx.h (howto_table_ext): Mark PC10, PC22, and JMP_TBL entries + PC relative. Mark PC10 complain_overflow_dont. Mark PC22 and + JMP_TBL complain_overflow_signed. + (NAME(aout,final_link)): If info->shared is set, set DYNAMIC. + (aout_link_input_section_std): Call check_dynamic_reloc for all + relocs. Pass contents and &relocation. Don't warn about an + undefined symbol until check_dynamic_reloc has been called. Don't + warn about an undefined symbol for a base relative reloc. + (aout_link_input_section_ext): Likewise. For a base relative + reloc, always treat r_index as an index into the symbol table. + * libaout.h (struct aout_backend_data): Add contents and + relocation argument to check_dynamic_reloc entry point. + (struct aoutdata): Add local_got_offsets field. + +Wed Aug 16 01:03:07 1995 Ian Lance Taylor <ian@cygnus.com> + + * elf32-i386.c (elf_i386_check_relocs): Fix bug in last change. + +Mon Aug 14 11:39:24 1995 Ian Lance Taylor <ian@cygnus.com> + + * aoutx.h (NAME(aout,machine_type)): Handle a machine of + bfd_mach_sparc or bfd_mach_sparc64. + + * elflink.h (elf_link_add_object_symbols): If a symbol is a weak + definition, add it to the dynamic symbol table if any dynamic + object mentions it. If we do add it, make sure we add the + corresponding real symbol. + (elf_adjust_dynamic_symbol): Adjust a weak defined symbol which we + put in the dynamic symbol table, even if no regular object refers + to it. + * elf32-i386.c (elf_i386_check_relocs): When creating a shared + library, don't allocate space for a PC relative reloc against a + local symbol. + * elf32-m68k.c (elf_m68k_check_relocs): Likewise. + * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Change assertion + to accept symbol with weakdef set. + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): When creating a shared + libary, don't copy over a PC relative reloc against a local + symbol. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + +Sun Aug 13 00:40:58 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.h (R_HPPA_BEGIN_BRTAB): Define. + (R_HPPA_END_BRTAB): Likewise. + * som.c (som_write_fixups): Handle R_BEGIN_BRTAB and R_END_BRTAB. + +Thu Aug 10 15:53:29 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffswap.h (coff_swap_aux_in): Swap the array dimensions + whenever x_fcnary is not being used for something else, rather + than only for an array. + (coff_swap_aux_out): Likewise. + +Tue Aug 8 16:34:57 1995 steve chamberlain <sac@slash.cygnus.com> + + * cofflink.c (_bfd_coff_generic_relocate_section): Remove most + of special case stuff for PE. Now handled by relocs. + * coff-i386.c (coff_i386_reloc): Special case of PE type 7s. + (howto_table): Type 7 is dir32-rva. + +Tue Aug 8 10:15:43 1995 Jeffrey A. Law <law@rtl.cygnus.com> + + * configure.host: Recognize aix4 explicitly. + * rs6000-core.c (CORE_DATA_SIZE_FIELD): New macro to get a the size + of a core dump's data section. Provide alternate definition for aix4. + (SAVE_FIELD): Similarly for save state field (register info). + (STACK_END_ADDR): Provide definition suitable for aix4. + * config/{aix4.mh,aix4.mt}: New configuration files. + * hosts/aix4.h: Likewise. + +Mon Aug 7 23:03:21 1995 Ian Lance Taylor <ian@cygnus.com> + + * som.c (som_bfd_copy_private_symbol_data): Cast initializations + to avoid warnings. + +Mon Aug 7 14:51:08 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_decode_symclass): Handle absolute symbols by checking + the SOM type (since they will rarely if ever be in the absolute + section). + +Wed Aug 6 09:12:50 1995 Doug Evans <dje@canuck.cygnus.com> + + * archures.c (bfd_mach_sparc, bfd_mach_sparc64): Define. + * bfd-in2.h: Regenerated. + * cpu-sparc.c (sparc_arch_info): Renamed from arch_info_struct. + (sparc64_arch_info): New static variable. + (bfd_sparc_arch): Link in sparc64_arch_info. + * elf64-sparc.c (sparc64_elf_xxx): Renamed from elf64_xxx. + (sparc64_elf_object_p): New static function. + (elf_backend_object_p): Define. + * config/sparc64-elf.mt (SELECT_VECS): Add bfd_elf32_sparc_vec. + +Sat Aug 5 00:04:08 1995 Jeff Law (law@snake.cs.utah.edu) + + * som (som_get_reloc_upper_bound): Return -1 on error. Compute + return value with sizeof (arelent *), not sizeof (arelent). + +Wed Aug 2 12:32:21 1995 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (bfd_section_from_shdr): If the section pointed to by the + sh_link field of a reloc section is not a symbol table, and the + file contains a single symbol table, clobber the sh_link field of + the reloc section to point to the symbol table. + +Tue Aug 1 10:09:01 1995 Doug Evans <dje@canuck.cygnus.com> + + * coff-arm.c (howto reloc ARM26): Change size from 3 to 2. + (howto reloc ARM26D): Likewise. + +Mon Jul 24 14:17:50 1995 Ian Lance Taylor <ian@cygnus.com> + + * aoutx.h (NAME(aout,find_nearest_line)): Use the line just before + the offset, not the one just after. Break out of the loop after + finding a function past the offset, not merely when finding a + function with a line defined. + + * ecofflink.c (_bfd_ecoff_locate_line): When handling stabs: + correct setting of sym_ptr_end to consider symbols skipped when + setting sym_ptr; don't leave loop early unless an N_FUN is found + with a larger value. + + * coff-sh.c (sh_coff_howtos): Mark R_SH_PCDISP8BY2 and R_SH_PCDISP + as PC relative. Describe R_SH_IMM16. Add entries for + R_SH_SWITCH16, R_SH_SWITCH32, R_SH_USES, R_SH_COUNT, and + R_SH_ALIGN. + (SWAP_IN_RELOC_OFFSET): Define. + (SWAP_OUT_RELOC_OFFSET): Define. + (CALC_ADDEND): Define. + (sh_reloc): Change sym_value and addr to type bfd_vma. Skip reloc + types other than R_SH_IMM32 and R_SH_PCDISP on an external symbol. + (coff_bfd_relax_section): Define. + (coff_bfd_get_relocated_section_contents): Define. + (sh_relax_section): New static function. + (sh_relax_delete_bytes): New static function. + (sh_relocate_section): Handle R_SH_PCDISP on an external symbol. + (sh_coff_get_relocated_section_contents): New static function. + + * cofflink.c (coff_link_add_object_symbols): Call + _bfd_coff_get_external_symbols, not coff_link_get_symbols. Call + _bfd_coff_free_symbols, not coff_link_free_symbols. Call + _bfd_coff_read_string_table, not coff_read_string_table. + (coff_link_check_archive_element): Likewise. + (coff_link_input_bfd): Likewise. + (coff_link_get_symbols): Move to coffgen.c. + (coff_read_string_table): Likewise. + (coff_link_free_symbols): Likewise. + (_bfd_coff_internal_syment_name): New static function. + (coff_link_check_ar_symbols): Use _bfd_coff_internal_syment_name. + (coff_link_add_symbols): Likewise. + (coff_link_input_bfd): Likewise. + (_bfd_coff_generic_relocate_section): Likewise. + (_bfd_coff_read_internal_relocs): New function. + (coff_link_input_bfd): Use cached section contents if available. + Use _bfd_coff_read_internal_relocs. + * coffcode.h (coff_slurp_symbol_table): Don't call bfd_seek. + (coff_bfd_get_relocated_section_contents): Only define if not + already defined. + (coff_bfd_relax_section): Likewise. + * coffgen.c (build_string_table): Remove. + (_bfd_coff_get_external_symbols): New function, moved in from old + coff_link_get_symbols in cofflink.c. + (_bfd_coff_read_string_table): New function, moved in from old + coff_read_string_table in cofflink.c. + (_bfd_coff_free_symbols): New function, moved in frmo old + coff_link_free_symbols in cofflink.c. + (coff_get_normalized_symtab): Use _bfd_coff_get_external_symbols + rather than reading the symbols directly. To free them, call + _bfd_coff_free_symbols. Use _bfd_coff_read_string_table rather + than build_string_table. + * libcoff-in.h (obj_coff_keep_syms): Define. + (obj_coff_keep_strings): Define. + (coff_data_type): Add fields keep_syms and keep_strings. + (coff_section_tdata): Define new structure. + (coff_section_data): Define. + (_bfd_coff_get_external_symbols): Declare. + (_bfd_coff_read_string_table): Declare. + (_bfd_coff_free_symbols): Declare. + (_bfd_coff_read_internal_relocs): Declare. + * libcoff.h: Rebuild. + +Fri Jul 21 22:32:54 1995 Michael Meissner <meissner@cygnus.com> + + * elf32-ppc.c (ppc_elf_howto_raw): Add support for R_PPC_SDAREL + relocation. + (ppc_elf_reloc_type_lookup): Ditto. + (ppc_elf_got16_inner): Ditto. + (ppc_elf_relocate_section): Ditto. + +Thu Jul 20 19:19:06 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (hppa_elf_gen_reloc_type): Add new (ignored) + argument. + * elf32-hppa.h: Corresponding change. + +Thu Jul 20 19:01:07 1995 Ken Raeburn <raeburn@cygnus.com> + + * libaout.h (set_aout_section_data): New macro. + * sunos.c (sunos_scan_relocs): Use it. + + * aout-ns32k.c (MY_swap_std_reloc_out): Undef KEEPIT before + defining it. + +Thu Jul 20 13:48:00 1995 Fred Fish <fnf@cygnus.com> + + * hosts/i386v4.h (getgid, getuid): Change prototypes to be + compatible with Unixware 1.x and Unixware 2.x, and probably other + i386 svr4 versions as well. + +Thu Jul 20 13:41:21 1995 Ken Raeburn <raeburn@cygnus.com> + + * targets.c (bfd_target_vector): Since armpe and armpei have been + split into big- and little-endian variants, list all of them, + instead of the now-nonexistant armpe[i]_vec. + +Thu Jul 20 00:06:39 1995 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (bfd_section_from_phdr): Set lma based on p_paddr. + (elf_fake_sections): Set sh_addr based on lma, not vma. + +Wed Jul 19 15:52:01 1995 Doug Evans <dje@canuck.cygnus.com> + + * coff-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM. + * configure.in (armpe_vec, armpei_vec): Add bi-endian support. + * configure: "regenerated". + * pe-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM. + (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Replaces TARGET_NAME. + * pei-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM. + (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Replaces TARGET_NAME. + * targets.c (armpe_vec, armpei_vec): Deleted. + (armpe_little_vec, armpe_big_vec, armpei_little_vec, armpei_big_vec): + Added. + * config/arm-pe.mt (DEFAULT_VECTOR): Default is armpe_little_vec. + (SELECT_VECS): Add bi-endian support. + +Wed Jul 19 10:47:25 1995 Ian Lance Taylor <ian@cygnus.com> + + * coff-sh.c: Clean up and comment. + (r_imm32): Remove. + (sh_coff_howtos): New static array. + (SH_COFF_HOWTO_COUNT): Define. + (get_symbol_value): Make relocation bfd_vma rather than long. + (RTYPE2HOWTO): Rewrite to use sh_coff_howtos. + (coff_relocate_section): Define to sh_relocate_section. + (sh_relocate_section): New static function. + +Sat Jul 15 01:02:53 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * configure.host: Add support for generic m68k SVR4 host. + +Fri Jul 14 13:13:55 1995 Ian Lance Taylor <ian@cygnus.com> + + * aoutx.h (KEEPIT): Change definition to udata.i. + (KEEPITTYPE): Remove. + (NAME(aout,reloc_type_lookup)): Add cases to the + extended reloc type switch: SPARC_GOT10, SPARC_GOT13, SPARC_GOT22, + SPARC_PC10, SPARC_PC22, SPARC_WPLT30. + (NAME(aout,swap_std_reloc_out)): Don't bother to use stoi when + retrieving KEEPIT value. + (NAME(aout,swap_ext_reloc_out)): Likewise. Also, only add in + output section VMA for section symbols, and check BSF_SECTION_SYM + to control whether to set r_extern to 1. + + * syms.c: Fix comments so that `make info' works. + + * elf32-mips.c (mips_elf_find_nearest_line): Set SEC_HAS_CONTENTS + in .mdebug section, in case backend linker has cleared it. + +Fri Jul 14 11:58:34 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_addr16_ha_inner): Rewrite to take just one + argument, the final relocated address. + (ppc_elf_addr16_ha_inner): Adjust ppc_elf_addr16_ha_inner caller. + (ppc_elf_relocate_section): Ditto. + +Thu Jul 13 17:22:03 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (hppa_som_gen_reloc_type): Choose a reasonable field + selector relocation for the difference of two symbols. + +Thu Jul 13 10:33:25 1995 Ian Lance Taylor <ian@cygnus.com> + + * aoutx.h (NAME(aout,slurp_reloc_table)): Cast argument to size_t + for malloc. + * coff-mips.c (mips_relocate_section): Likewise, for memmove. + (mips_relax_section): Likewise, for malloc. + * cofflink.c (process_embedded_commands): Likewise. + (_bfd_coff_final_link): Likewise. + * ecoff.c (_bfd_ecoff_write_object_contents): Likewise. + (ecoff_final_link_debug_accumulate): Likewise. + (ecoff_indirect_link_order): Likewise, for memcpy and malloc. + (ecoff_reloc_link_order): Likewise, for malloc. + * ecofflink.c (ecoff_align_debug): Likewise, for memset. + (ecoff_write_symhdr): Likewise, for malloc. + * elf32-hppa.c (elf32_hppa_read_symext_info): Likewise. + * elf.c (assign_file_positions_except_relocs): Likewise, for + qsort. + * elf32-mips.c (mips_elf_read_ecoff_info): Likewise, for malloc. + * elfcode.h (elf_slurp_reloc_table): Likewise. + * elfcore.h (elf_corefile_note): Likewise. + * elflink.h (elf_link_add_object_symbols): Likewise. + (elf_link_read_relocs): Likewise. + (NAME(bfd_elf,size_dynamic_sections)): Likewise, for memset. + * i386linux.c (bfd_linux_size_dynamic_sections): Likewise. + * ieee.c (do_with_relocs): Likewise. + * linker.c (default_indirect_link_order): Likewise, for malloc. + * nlmcode.h (nlm_object_p): Likewise. + (nlm_write_object_contents): Likewise. + * oasys.c (oasys_set_section_contents): Likewise, for memcpy. + * reloc.c (bfd_generic_get_relocated_section_contents): Likewise, + for malloc. + * section.c (bfd_get_section_contents): Likewise, for memcpy. + * srec.c (srec_get_section_contents): Likewise. + (srec_set_section_contents): Likewise. + * sunos.c (bfd_sunos_size_dynamic_sections): Likewise, for + realloc and memset. + (sunos_scan_relocs): Likewise, for malloc. + (sunos_scan_dynamic_symbol): Likewise, for realloc. + * syms.c (_bfd_generic_read_minisymbols): Likewise, for malloc. + * versados.c (versados_get_section_contents): Likewise, for + memcpy. + + * libbfd.c (real_read): Add prototype. Change argument types from + int to size_t. + (bfd_read): Cast real_read argument to size_t, not int. + (bfd_write): Cast fwrite argument to size_t, not int. + + * elf64-gen.c (elf_info_to_howto): Fix definition for recent elf.c + changes. + + * configure.in: Fix typo: change {$enableval} to ${enableval}. + * configure: Rebuild. + + * Makefile.in (BFD32_BACKENDS): Add elflink.o. + + * targets.c (bfd_target): Add fields _read_minisymbols and + _minisymbol_to_symbol. + (BFD_JUMP_TABLE_SYMBOLS): Add _read_minisymbols and + _minisymbol_to_symbol. + (bfd_read_minisymbols): Define. + (bfd_minisymbol_to_symbol): Define. + * syms.c (_bfd_generic_read_minisymbols): Define. + (_bfd_generic_minisymbol_to_symbol): Define. + * libbfd-in.h (_bfd_nosymbols_read_minisymbols): Define. + (_bfd_nosymbols_minisymbol_to_symbol): Define. + (_bfd_generic_read_minisymbols): Declare. + (_bfd_generic_minisymbol_to_symbol): Declare. + * bfd-in2.h: Rebuild. + * libbfd.h: Rebuild. + * aoutx.h (MINISYM_THRESHOLD): Define. + (NAME(aout,read_minisymbols)): New function. + (NAME(aout,minisymbol_to_symbol)): New function. + * libaout.h (NAME(aout,read_minisymbols)): Declare. + (NAME(aout,minisymbol_to_symbol)): Declare. + * aout-target.h (MY_read_minisymbols): Define. + (MY_minisymbol_to_symbol): Define. + * All targets: Define read_minisymbols and minisymbol_to_symbol. + +Wed Jul 12 17:55:55 1995 Ken Raeburn <raeburn@cygnus.com> + + * elflink.h (elf_link_add_object_symbols): Cast return value from + bfd_alloc. + + * elfcode.h (size_info): Don't use "&" before function names. + +Wed Jul 12 00:16:48 1995 Ken Raeburn <raeburn@kr-pc.cygnus.com> + + * libelf.h (elf_backend_data): Use unsigned, not unsigned char, + for bitfields. + +Tue Jul 11 15:19:53 1995 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (bfd_section_from_shdr): In case SHT_REL[A], only get the + BFD section for the sh_link section if it is a SYMTAB section. + + * aoutx.h (NAME(aout,link_add_symbols)): Don't bother to check + that archives hold a.out objects. + * cf-i386lynx.c (coff_bfd_link_add_symbols): Don't define. + (lynx_link_add_symbols): Remove. + * cf-m68klynx.c (coff_bfd_link_add_symbols): Don't define. + (lynx_link_add_symbols): Remove. + * elflink.h (elf_bfd_link_add_symbols): Don't bother to check that + archives hold ELF objects. + + * archive.c (bfd_generic_archive_p): If the archive has a map, and + the target was defaulted, but the first object in the archive can + not be matched with that target, then return a bad format error. + + * elf64-sparc.c (elf_sparc_howto_table): Set howto for WDISP16 to + elf64_wdisp16_reloc. + (elf64_wdisp16_reloc): New static function. + (elf64_sparc_relocate_section): New static function. + (elf_backend_relocate_section): Define. + + * libelf.h (struct elf_size_info): Change type of last argument to + swap_symbol_out from char * to PTR. + (bfd_elf32_swap_symbol_out): Update declaration. + (bfd_elf64_swap_symbol_out): Likewise. + * elfcode.h (elf_swap_symbol_out): Change type of cdst from char * + to PTR. + * elf.c (swap_out_syms): Cast to PTR, not char *, when calling + swap_symbol_out routine. + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Likewise. + (elf_link_output_sym): Likewise. + (elf_link_output_extsym): Likewise. + * elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Likewise. + +Tue Jul 11 12:29:49 1995 Rick Sladkey <jrs@world.std.com> + + * elf.c (_bfd_elf_find_nearest_line): Handle the simple case where + there is no debugging information. + +Mon Jul 10 11:45:55 1995 Ken Raeburn <raeburn@cygnus.com> + + * makefile.dos (OBJS): Add binary.o and tekhex.o. From DJ + Delorie. + +Mon Jul 10 11:09:58 1995 Ian Lance Taylor <ian@cygnus.com> + + * linker.c (set_symbol_from_hash): bfd_link_hash_new case: Don't + abort; it can happen for constructor symbols when not building + constructors. + + * coff-i960.c (coff_i960_relocate): Correct typo: use ! on strcmp, + not on string. + * cofflink.c (_bfd_coff_generic_relocate_section): Remove unused + local i. + * coff-arm.c (coff_arm_rtype_to_howto): Don't declare. + (PCRELOFFSET): Define if not already defined. + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add coff-arm.o + (CFILES): Add coff-arm.c, pe-arm.c, pei-arm.c. + + * aoutx.h (NAME(aout,link_hash_table_create)): Allocate hash table + using bfd_alloc, not malloc. + * cofflink.c (_bfd_coff_link_hash_table_create): Likewise. + * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise. + * i386linux.c (linux_link_hash_table_create): Likewise. + * linker.c (_bfd_generic_link_hash_table_create): Likewise. + * sunos.c (sunos_link_hash_table_create): Likewise. + + Based on patches from Eric Youngdale <eric@aib.com>: + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): If -Bsymbolic, + output a DT_SYMBOLIC dynamic entry. + (elf_adjust_dynamic_symbol): If -Bsymbolic, don't require a PLT + entry for a locally defined symbol. + * elf32-i386.c (elf_i386_relocate_section): If -Bsymbolic, do warn + about undefined symbols, and fill in the GOT entry for a symbol + defined in a regular object file. + (elf_i386_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE + reloc rather than a GLOB_DAT reloc for a symbol defined in a + regular object file. + * elf32-m68k.c (elf_m68k_relocate_section): If -Bsymbolic, do warn + about undefined symbols, and fill in the GOT entry for a symbol + defined in a regular object file. + (elf_m68k_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE + reloc rather than a GLOB_DAT reloc for a symbol defined in a + regular object file. + * elf32-sparc.c (elf32_sparc_relocate_section): If -Bsymbolic, do + warn about undefined symbols, and fill in the GOT entry for a + symbol defined in a regular object file. + (elf32_sparc_finish_dynamic_symbol): If -Bsymbolic, output a + RELATIVE reloc rather than a GLOB_DAT reloc for a symbol defined + in a regular object file. + + * config/m68k-coff.mt (SELECT_VECS): Rename from SELECT_VECTORS. + Correct elements to be actual BFD vector names. + + * Makefile.in (Makefile): Don't depend upon @frags@. + (config.status): Depend upon @frags@. + +Fri Jul 7 17:36:44 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffgen.c (coff_renumber_symbols): Sort defined symbols that are + neither BSF_FUNCTION not BSF_NOT_AT_END just before undefined + symbols. + * coffcode.h (coff_slurp_symbol_table): Set BSF_FUNCTION as well + as BSF_NOT_AT_END. + +Fri Jul 7 17:16:15 1995 Ken Raeburn <raeburn@cygnus.com> + + * Makefile.in (do_mostlyclean): Remove config.log. + (do_distclean): Remove config.cache. + +Thu Jul 6 14:37:43 1995 Ian Lance Taylor <ian@cygnus.com> + + * elf32-i386.c (elf_i386_relocate_section): Revert May 24 patch. + Don't copy PC32 reloc against section into shared object. + + * Makefile.in: Rebuild dependencies. + (CFILES): Added elflink.c. + (Makefile): Depend upon config.status, not configure.in. + (config.status): New target; depend upon configure configure.host + and config.bfd. + +Wed Jul 5 20:17:14 1995 Ken Raeburn <raeburn@cygnus.com> + + * elfcore.h, elflink.h, elfcode.h, elf.c, elflink.c: Moved some + primarily size-independent code from elfcode.h to elf.c and new + file elflink.c; moved out other core- or linker-related routines + into other new .h files for clarity. Renamed many routines to + start with bfd_elf or _bfd_elf. Added a structure of + size-dependent but target-independent info to elfcode.h. + * Makefile.in: Build elflink.o. Update dependencies. + * libelf.h: Updated some declarations. Added a definition for the + new structure in elfcode.h. Added more fields to elf backend data + structure. + * elfxx-target.h: Refer to the appropriate size-dependent info. + * elf32-*.c: Changed some function names. Moved common + create_dynamic_sections code from m68k, sparc, and i386 support + into elflink.c. Define some new macros to fill in new fields of + back end data. Also clean up some "gcc -Wall" warnings regarding + unused or uninitialized variables. + + * Makefile.in (BFD_LIBS): No, don't put elflink.o here. + * configure.in: Include it here whenever elf.o is specified. + +Wed Jul 5 10:31:47 1995 Ian Lance Taylor <ian@cygnus.com> + + * elf32-mips.c (mips_elf_object_p): Unconditionally set + elf_bad_symtab, since sometimes the symbol table is messed up and + the last symbol is global. + + * ecoff.c (_bfd_ecoff_bfd_is_local_label): New function. + * libecoff.h (_bfd_ecoff_bfd_is_local_label): Declare. + * elf32-mips.c (mips_elf_is_local_label): New static function. + (bfd_elf32_bfd_is_local_label): Define. + + * configure.in: Use $ac_config_sub, not $configsub. + * configure: Likewise. + + Permit --enable-targets=ieee: + * config.bfd (*-*-ieee*): New target. + * config/ieee.mt: New file. + +Wed Jul 5 04:16:35 1995 Ken Raeburn <raeburn@kr-pc.cygnus.com> + + * config/i386aix.mh (HDEFINES): Remove -DFASCIST_FDOPEN. + + Autoconfiscation: + * configure.in, Makefile.in, doc/Makefile.in: Switch from Cygnus + configure to autoconf ways of processing --enable arguments, + setting up symlinks, incorporating makefile fragments, printing + messages at configuration time, setting variables in Makefile. + Deleted some unused variables. Check for ranlib via autoconf. + For now, configure script removes doc/config.status. + * configure: New file. + * dep-in.sed: Use @SRCDIR@ instead of @srcdir@, so Makefile.in + line doesn't get broken by configure. + * doc/configure.in: Removed. + +Tue Jul 4 12:22:21 1995 Ian Lance Taylor <ian@cygnus.com> + + * archive.c (_bfd_construct_extended_name_table): If + BFD_TRADITIONAL_FORMAT is set, limit the length of all file names + to ar_max_namelen. + (bfd_dont_truncate_arname): If BFD_TRADITIONAL_FORMAT is set, call + bfd_bsd_truncate_arname. + (_bfd_write_archive_contents): Revert June 1 change. + + * elfcode.h (NAME(bfd_elf,record_link_assignment)): Add provide + argument. + * bfd-in.h (bfd_elf32_record_link_assignment): Update prototype. + (bfd_elf64_record_link_assignment): Likewise. + * bfd-in2.h: Rebuild. + + * libelf.h (struct elf_link_hash_table): Add needed field. Remove + saw_needed field. + * elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name + is an empty string, don't make a DT_NEEDED entry in the output + file. Record all DT_NEEDED entries found in input dynamic + objects. + (elf_link_output_extsym): Don't check saw_needed when issuing + warnings. + * elf.c (_bfd_elf_link_hash_table_init): Initialize needed, not + saw_needed. + (bfd_elf_get_needed_list): New function. + * bfd-in.h (struct bfd_elf_link_needed_list): Define. + (bfd_elf_get_needed_list): Define. + * bfd-in2.h: Rebuild. + + * ecoff.c (_bfd_ecoff_find_nearest_line): Also initialize + find_buffer and fdrtab_len fields of newly allocated + find_line_info structure. + +Mon Jul 3 17:03:52 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (hppa_som_gen_reloc_type): New argument "sym_diff", + nonzero when we're generating relocations for an expression + using the difference of two symbols. All callers changed. + Handle difference of symbols for both R_HPPA and R_COMPLEX + cases. + (som_write_fixups): Handle R_COMP1, R_COMP2 and R_CODE_EXPR + fixups. + +Mon Jul 3 13:55:18 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * config.bfd (win32): New configuration. + * configure.host (pe): Changed to i386win32. + * config/i386pe.mh: Deleted. + * config/i386win32.mh: New file. + +Mon Jul 3 11:30:45 1995 Ian Lance Taylor <ian@cygnus.com> + + * ecoff.c (_bfd_ecoff_find_nearest_line): If we allocate + find_line_info, clear the fdrtab field. + + * targets.c (enum bfd_flavour): Add bfd_target_msdos_flavour here, + rather than in bfd-in2.h. + + * bfd.c (enum bfd_error): Define bfd_error_no_armap. + (bfd_errmsgs): Add string for bfd_error_no_armap. + * bfd-in2.h: Rebuild. + * ecoff.c (ecoff_link_add_archive_symbols): If an archive has no + armap, set bfd_error_no_armap rather than bfd_error_no_symbols. + * elfcode.h (elf_link_add_archive_symbols): Likewise. + * linker.c (_bfd_generic_link_add_archive_symbols): Likewise. + + * elfcode.h (elf_link_add_object_symbols): Permit common and + indirect symbols in weakdefs BFD_ASSERT. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Simplify + BFD_ASSERT to permit some legal, but odd, cases. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. + + * Makefile.in: Rebuild dependencies. + (BFD32_BACKENDS): Add versados.o. + (CFILES): Add pe-i386.c, pei-i386.c, and versados.c. + +Sun Jul 2 17:49:32 1995 Ian Lance Taylor <ian@cygnus.com> + + * cofflink.c (_bfd_coff_generic_relocate_section): Cast base_file + to FILE * before using it. + * stab-syms.c: Revert yesterday's patch. + +Sat Jul 1 12:10:42 1995 Fred Fish <fnf@cygnus.com> + + * stab-syms.c (stdio.h): Include prior to libaout.h, which + includes bfdlink.h, which now uses FILE. + +Sat Jul 1 00:11:08 1995 Ken Raeburn <raeburn@cygnus.com> + + * elfxx-target.h: New file. + + * libelf.h (struct elf_backend_data): Remove elf_64_p field. + * elfxx-target.h (elfNN_bed): Don't set it. + + * elf32-target.h, elf64-target.h: Deleted. + * Makefile.in (elf32-target.h, elf64-target.h): Build them from + elfxx-target.h. + +Fri Jun 30 16:07:18 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * cofflink.c (_bfd_coff_generic_relocate_section): Compare + the full text of .reloc or .edata section names. + +Fri Jun 30 15:47:37 1995 Fred Fish <fnf@cygnus.com> + + * cofflink.c (_bfd_coff_generic_relocate_section): + Remove extra '+'. + +Thu Jun 29 17:24:52 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * coff-h8300.c (COFF_LONG_FILENAMES): Define. + +Wed Jun 28 18:04:42 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * Makefile.in: versados.o is now conditionally built. + * coffcode.h (add_data_entry): New function. + (coff_write_object_contents): Clean up. Calculate + data entries. + * cofflink.c (_bfd_coff_generic_relocate_section): + .reloc and .edata sections are IMAGE_BASED too. + If there's a base_file then write out base information. + * configure.host (i386-*-pe): New. + * syms.c (coff_section_type): Only scan prefixes. + * targets.c (bfd_target_vector): Versados is now conditionally + built. + * config/m68k-coff.mt: Build versados.o + * hosts/i386pe.h: New file. + +Mon Jun 26 13:53:49 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hpa.c (elf32_hppa_relocate_section): Close comment before + R_PARISC_DPREL21L handling. + +Thu Jun 22 19:28:36 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + Sun May 7 11:53:41 MDT 1995 Bryan Ford <baford@cs.utah.edu> + + * config/i386-moss.mt: created. + +Thu Jun 22 08:56:10 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * reloc.c (bfd_perform_relocation): Add case for -ve words. + +Wed Jun 21 13:13:49 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_relocate_section): Don't try to apply a + relocation against an undefined symbols. + +Wed Jun 21 10:16:10 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * versados.c: Second pass/rewrite. + +Mon Jun 19 08:40:45 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * syms.c (coff_section_type): Compare only the front part + of a section name. + +Sat Jun 17 09:40:44 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_size_stubs): Set the size of the stub + section if we get an error. + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Don't mess + with the operands of an R_PARISC_DPREL21L relocation if the insn + is not "addil <symbol>,%r27". + +Fri Jun 16 15:04:47 1995 Stan Shebs <shebs@andros.cygnus.com> + + * bfd-in.h (NT_subsystem, NT_stack_heap): Declare but don't + define. + * bfd-in2.h: Rebuilt. + * bfd.c (NT_subsystem, NT_stack_heap): Define. + +Fri Jun 16 00:07:25 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_bfd_link_link_relocate): Use the right + type field (there are two!) when checking to see if $global$ is + defined. + +Thu Jun 15 14:03:47 1995 Stan Shebs <shebs@andros.cygnus.com> + + * bfd-in.h, bfd-in2.h (bfd_boolean): Rename bfd_true, bfd_false + to bfd_tttrue, bfd_fffalse so as not to conflict with functions. + * coffswap.h (coff_swap_scnhdr_out): Remove version that was + hacked for MPW C. + * mpw-config.in: Set shell vars instead of pasting to makefile + for each configuration, edit coffswap.h to make MPW C not choke. + (i386-unknown-coff, sh-hitachi-hms): Recognize. + * mpw-make.in (BFD_LIBS): Add versados.c.o. + + * versados.c (versados_scan): Properly cast results from bfd_alloc. + +Wed Jun 14 15:27:32 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * cofflink.c (process_embedded_commands): New function + reads and handles .drectve sections for PE. + (coff_link_input_bfd): Call new function if PE. + +Mon Jun 12 12:09:39 1995 Jeff Law (law@snake.cs.utah.edu) + + * bfd-in.h (bfd_set_section_vma): Case true to a boolean. + (bfd_set_cacheable): Likewise. + * bfd-in2.h: Rebuilt. + +Fri Jun 9 12:20:28 1995 Steve Chamberlain <sac@rtl.cygnus.com> + + * elfcode.h (elf_sort_hdrs): Rewrite to be symmetrical. + +Fri Jun 9 12:49:00 1995 Jeff Law (law@snake.cs.utah.edu) + + * targets.c: Add copy_private_symbol_data and link_split_section + to the target vector. + * libbfd-in.h (_bfd_generic_bfd_copy_private_symbol_data): Define. + (_bfd_nolink_bfd_link_split_section): Likewise. + (bfd_generic_link_split_section): Declare. + * syms.c (bfd_copy_private_symbol_data): Define. + * linker.c (bf_link_split_section): Likewise. + * som.c (som_bfd_copy_private_symbol_data): New function + (som_bfd_link_split_section): Likewise. + * All other targets updated with default versions of new routines. + + * Take out my braindamaged bfd_true/bfd_false changes from earlier + today. Replace with just: + * bfd-in.h: (TRUE_FALSE_ALREADY_DEFINED): Define this if + compiling with g++-2.6 or later. + * bfd-in2.h: Rebuilt. + +Fri Jun 9 07:54:29 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * versados.c (struct esd, get_4): Lint; use unsigned chars. + + * coff-i960.c (coff_i960_relocate): Compare output section names + when converting for vxworks. + +Wed Jun 7 19:01:30 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + * elfcode.h (elf_fake_sections): Permit .scommon or COMMON + sections as random SHT_NOBITS sections, in case a linker script is + strange. + +Tue Jun 6 17:29:32 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * bfd-in.h (NT_subsystem, NT_stack_heap): Moved from pe.h + * coff-i386.c (coff_i386_rtype_to_howto): Get PE relocs right. + * coffcode.h (coff_mkobject): Set pe tdata bit when using PE. + * cofflink.c (COFF_WITH_PE code): Test on obj_pe bit rather + than conditional compile. + * configure.in: Fix PE dependencies. + * libcoff-in.h (obj_pe): New. + (coff_tdata): Added pe entry. + * libcoff.h: Regenerated. + +Mon Jun 5 09:07:13 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * coff-a29k.c (coff_a29k_adjust_symndx): Completely parenthesize + macro. + +Mon Jun 5 02:15:20 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com> + + Linker support for m68k-elf from Andreas Schwab + <schwab@issan.informatik.uni-dortmund.de>: + * elfcode.h (elf_link_add_object_symbols): Check for NULL when + looping through the symbol hashes. + (elf_bfd_final_link): When looking for _init and _fini don't use + the symbol if it is imported from another object. + * elf32-m68k.c: Relocation type changed from REL to RELA. Regular + and dynamic linking support functions added, similar to other elf + targets. + + * config.bfd (i[345]86-*-gnu*): Use ELF configuration. + +Fri Jun 2 18:54:59 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * versados.c: New file. + * bfd-in2.h (struct _bfd): New field. + * bfd.c (struct _bfd): New field. + * configure.in (versados_vec): New field. + * targets.c (bfd_flavor): Added versados. + +Thu Jun 1 13:51:49 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * coffcode.h (sec_to_styp_flags, styp_to_sec_flags, + coff_new_section_hook): Any section that starts ".stab" + is now marked as debugging. + +Thu Jun 1 16:15:16 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + * archive.c (_bfd_write_archive_contents): Disable extended name + table until it can be made optional, so that native AR has half a + chance on SunOS and HP/UX. + + * linker.c (_bfd_generic_link_output_symbols, case + bfd_link_hash_indirect): Add cast to correct pointer types. + +Sat May 27 21:37:31 1995 J.T. Conklin <jtc@rtl.cygnus.com> + + * config.bfd (m68k-bull-sysv*): Added strip_underscore=yes. + (m68k-est-coff): Removed. target does not effect object format. + +Wed May 24 10:52:01 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * linker.c (_bfd_generic_link_output_symbols): Cope with + indirect symbols. + + * elf32-i386.c (elf_i386_relocate_section): Give error + message when linking to a shared reloc which isn't there. + +Wed May 24 10:40:00 1995 Steve Chamberlain <sac@slash.cygnus.com> + + Support for ARM-PE. + + * Makefile.in, coffcode.h, config.bfd, configure.in, pe-arm.c, + pei-arm.c, coff-arm.c, reloc.c, targets.c, config/arm-pe.mt: + Support for ARM COFF/PE. + +Tue May 23 19:24:58 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + * bfd.c (bfd_get_relocated_section_contents): Now a function, + tries calling routine from input bfd target vector for + bfd_indirect_link_order. Put a declaration into the header file. + * bfd-in2.h: Regenerated. + * elf32-mips.c (gprel16_with_gp): New function, split out from + mips_elf_gprel16_reloc. + (mips_elf_gprel16_reloc): Call it. If output bfd target vector + isn't elf flavoured, abort, since it's assumed to be elf in some + of this code, including the code that looks up the gp value. + (elf32_mips_get_relocated_section_contents): New function, + modified from bfd_generic_get_relocated_section_contents to deal + with passing gp to gprel16_with_gp. + (bfd_elf32_bfd_get_relocated_section_contents): New macro. + * elf32-target.h (bfd_elf32_bfd_get_relocated_section_contents): + Don't define if already defined. + +Tue May 23 15:58:15 1995 Jeff Law (law@snake.cs.utah.edu) + + * Makefile.in: Install bfdlink.h too. + +Sun May 21 22:25:09 1995 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_relocate_section): Handle undefined and + notsupported return codes from final_link_relocate (used when + $global$ is undefined or nonexistant). + (elf32_hppa_bfd_link_link_relocate): If $global$ exists, but is + not defined,then return bfd_reloc_undefined. + +Fri May 19 10:00:14 1995 Steve Chamberlain <sac@rtl.cygnus.com> + + * coffswap.h: (IMAGE_BASE): Define to 0 if not. + +Thu May 18 04:24:01 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com> + + Wed May 10 14:28:16 1995 Richard Earnshaw (rearnsha@armltd.co.uk) + + * aoutx.h (aout_link_input_section_standard): If defined, call + MY_relocatable_reloc before doing a partial relocation. + + * aout-arm.c: (WRITE_HEADERS): Delete. + (NAME): Define version to override default in aoutx.h + (MY(howto_table)): Reformat. Alter some entries slightly. + (RELOC_ARM_BITS_NEG_{BIG,LITTLE}): Define. + (MY(reloc_howto), MY(put_reloc), MY(relocatable_reloc)): New functions. + (MY_reloc_howto, MY_put_reloc, MY_relocatable_reloc): Define. + (MY(fix_pcrel_26)): Renamed from aoutarm_fix_pcrel_26, return + bfd_reloc_ok not bfd_reloc_continue. + (MY(fix_pcrel_26_done)): Likewise. + (MY(bfd_reloc_type_lookup)): Renamed from aoutarm_reloc_type_lookup. + (MY_bfd_link_hash_table_create, MY_bfd_link_add_symbols, + MY_bfd_final_link): Delete. + (MY_swap_std_reloc_in, MY_swap_std_reloc_out, MY_get_section_contents): + Define. + (aoutx.h): Include it. + (MY(swap_std_reloc_{in,out})): New functions. + Use RELOC_ARM_BITS_NEG_{BIG,LITTLE} to extract negative reloc bit. + (aoutarm_squirt_out_relocs): Delete. + + From: David Taylor (dtaylor@armltd.co.uk) + * config/arm[lb]-aout.mt: New files. + * aout-arm.c: New file. + * config.bfd: Handle arm{,e[lb]}-*-aout + * configure.in: Add vetor for aout_arm_{big,little}_vec. + * reloc.c: New relocation types for the ARM. + * targets.c (aout_arm_{big,little}_vec): declare. + +Tue May 16 10:29:51 1995 Jim Kingdon <kingdon@deneb.cygnus.com> + + * libbfd.c (bfd_stat): If bfd_cache_lookup returns an error, + return an error to the caller. Call bfd_set_error on errors. + +Tue May 16 14:44:45 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + * libcoff-in.h (coff_renumber_symbols): Modified prototypes in + accordance with 11 May libcoff.h change. + +Thu May 11 16:43:14 1995 Steve Chamberlain <sac@slash.cygnus.com> + + tekhex.c (first_phase): Understand type 0 symbols. + (tekhex_write_object_contents): Fix typo in final record. + +Thu May 11 16:43:14 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * coff-i960.c (optcall_callback): don't try and optimize + undefined refs. + (coff_write_relocs): Search for broken relocs on the way + out and fix them up. + (coff_renumber_symbols): Calculate and return index of + first undefined symbol. + (coff_write_object_contents): Call coff_renumber_symbols + and coff_write_relocs with the new args. + * libcoff.h: (coff_renumber_symbols, coff_renumber_symbols): + Modified prototypes. + +Thu May 11 16:43:14 1995 Steve Chamberlain <sac@slash.cygnus.com> + Tom Griest <griest@cs.yale.edu> + + Initial support for PE format. + + * Makefile.in, targets.c, configure.in, config.bfd: + Add support for i386-*-winnt and i386-*-pe. + * archive.c (do_slurp_coff_armap): Understand NTPE format + archives. + (_bfd_slurp_extended_name_table): Turn \ in a filename + into /. + * bfd-in.h (bfd_link_subsystem, _bfd_link_stack_heap): New. + * coff-i386.c (howto_table): Conditionalize PCRELOFFSET. + * coffcode.h (IMAGE_BASE): New. + (coff_compute_section_file_positions): Throw away .junk + sections for PE, align symbols. + (coff_write_object_contents): Throw away .junk sections + for PE. Remember info on .idata and .rsrc sections. + Fill in the PE header. + (coff_slurp_symbol_table): PE uses C_SECTION class. + * cofflink.c (_bfd_coff_final_link): Keep PE info up to date. + (_bfd_coff_generic_relocate_section): Cope with PE relocs. + * coffswap.h (coff_swap_{aout/file/scn/sym}hdr_{in/out}): + New code for PE headers. + +Tue May 9 17:01:38 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * config.bfd: Add little endian PowerPC support. + * configure.in: Ditto. + * targets.c: Ditto. + * config/ppcle-elf.mt: New file, for little endian PowerPC + support. + * config/ppc-elf.mt: Add little endian powerpc to the BFD + selection vectors. + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Complain if + linking a different endian object than we expect. + (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define, to provide little + endian support. + +Tue May 2 16:32:24 1995 Jeff Law (law@snake.cs.utah.edu) + + * config.bfd (hppa*-*-lites*): Treat just like hppa*-*-*elf*. + +Tue Apr 25 19:38:43 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + * coffgen.c (make_a_section_from_file): Initialize lma same as + vma. + +Tue Apr 25 11:03:21 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * hosts/std-host.h: #include ansidecl.h 'cause PTR is used in + std-host.h. + +Mon Apr 24 23:56:44 1995 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * hosts/i386linux.h (HAVE_PROCFS): Don't define it. Added lengthy + comment explaining why. + +Mon Apr 24 10:34:02 1995 Michael Meissner <meissner@cygnus.com> + + * hosts/i386linux.h (HAVE_PROCFS): If NO_PROCFS is defined, don't + define HAVE_PROCFS. + +Mon Apr 24 08:33:12 1995 Michael Meissner <meissner@cygnus.com> + + * elf32-ppc.c (ppc_elf_relocate_section): Do not continue + processing unknown symbols to prevent a cascade of errors. + +Fri Apr 21 12:48:48 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + Patches from H.J. Lu for Linux ELF core file support. + * elfcode.h (elf_core_file_matches_executable_p) [HAVE_PROCFS]: + Use prpsinfo_t instead of struct prpsinfo, for consistency. + * hosts/i386linux.h (HAVE_PROCFS): Define. + +Thu Apr 20 09:07:39 1995 Steve Chamberlain <sac@slash.cygnus.com> + + * linker.c (link_action): Do the right thing when a undefined + strong symbol appears after an undefined weak symbol. + +Fri Apr 14 16:51:17 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (ppc_elf_relocate_section): New function to relocate + a whole section for the linker, bypassing bfd_perform_relocation. + (ppc_elf_reloc_type_lookup): New function to map the BFD + enumeration code into a howto structure. + (ppc_elf_howto_raw): Rename from ppc_elf_howto_table. + (ppc_elf_howto_table): New array that maps PowerPC relocation + numbers to howto structures without a linear search. Change from + using bfd_elf_generic_reloc to use ppc_elf_std_reloc. + (ppc_elf_howto_init): Initialize ppc_elf_howto_table from + ppc_elf_howto_raw. + (ppc_elf_reloc_type_lookup): Use a case statement instead of a + loop. + (ppc_elf_std_reloc): Replacement for bfd_elf_generic_reloc. + (ppc_elf_unsupported_reloc): Print a real error message, instead + of calling abort. + (ppc_elf_addr16_ha_inner): Abstract getting adjustment from + ppc_elf_addr16_ha_reloc, so ppc_elf_relocate_section can use it + too. + (ppc_elf_addr16_ha_reloc): Call it. + (ppc_elf_got16_inner): Abstract getting adjustment from + ppc_elf_got16_reloc, so ppc_elf_relocate_section can use it too. + (ppc_elf_got16_reloc): Call it. + (ppc_elf_info_to_howto): Rename from powerpc_info_to_howto. + + * elfcode.h (elf_symbol_from_bfd_symbol): Omit space in debugging + output. + (elf_symbol_flags): Add debug function to decode flags so that + defining DEBUG to be 4 will compile again. + (elf_debug_section): Fix typo in debug output. + +Fri Apr 14 16:03:04 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + * config.bfd: Add m68*-*-elf*. + * elf32-m68k.c: Filled out implementation, except for dynamic + linking support. + * reloc.c (enum bfd_reloc_code_real): Added *_GOT_PCREL, *_GOTOFF, + *_PLT_PCREL, *_PLTOFF, *_68K_* relocations for ELF. + * libbfd.h, bfd-in2.h: Regenerated. + +Thu Apr 13 14:28:04 1995 Torbjorn Granlund <tege@adder.cygnus.com> + + * coff-m68k.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Change from + 1 to 2. + (bfd_target): Change minimum section alignment from 1 to 2. + +Wed Apr 12 12:40:04 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + * aoutx.h (machine_type, case bfd_arch_mips): Treat R8000 like + R6000 and R4000 for now. + +Tue Apr 4 12:28:25 1995 Stan Shebs <shebs@andros.cygnus.com> + + * mpw-config.in: New file, MPW version of configure.in. + * mpw-make.in: New file, MPW version of Makefile.in. + * hosts/mpw.h: New file, MPW host definitions. + * ecoffswap.h (ecoff_swap_pdr_in, ecoff_swap_pdr_in) [MPW_C]: + Alternate versions without ECOFF_64 that chokes MPW C. + * coffswap.h (coff_swap_scnhdr_out): Add alternative version with + partly-expanded macros. + +Thu Mar 30 14:56:21 1995 Ian Lance Taylor <ian@cygnus.com> + + * reloc.c (bfd_perform_relocation): Don't bother to check for + overflow if the symbol is undefined. + +Thu Mar 30 14:32:26 1995 H.J. Lu (hjl@nynexst.com) + + * config.bfd: Change linux to default to elf. Using + i[345]86-*-linuxaout will build a library which defaults to a.out. + * config/i386-laout.mt: Rename from old config/i386-linux.mt. + * config/i386-linux.mt: Rename from old config/i386-lelf.mt. + Comment out EXTRALIBS. + * config/i386-lelf.mt: Remove. + +Wed Mar 29 12:01:30 1995 Ian Lance Taylor <ian@cygnus.com> + + * coff-i960.c (coff_i960_relocate): Cache the section symbol in + the used_by_bfd field of the section, to avoid looping for each + reloc. + + * cpu-h8500.c (arch_info_struct): Change name from "H8/300" to + "h8300" for consistency with other cpu-* files. + +Tue Mar 28 15:14:11 1995 Ian Lance Taylor <ian@cygnus.com> + + * bout.c (b_out_canonicalize_reloc): Handle SEC_CONSTRUCTOR + sections. + (b_out_get_reloc_upper_bound): Likewise. + + * linker.c (generic_link_add_symbol_list): Skip constructor + symbols which the main linker code did not do anything with. + (_bfd_generic_link_output_symbols): Use udata.p if it is set, + rather than looking the symbol up in the hash table. Just pass + through constructor symbols for which udata.p is not set. If the + linker defined the symbol, clear the constructor flag. + +Tue Mar 21 10:50:32 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_set_reloc_info): Sign extend constants from + R_DATA_OVERRIDE fixups. + * libhppa.h (sign_extend): Renamed from sign_ext. Fix. + (low_sign_extend): Likewise. + +Mon Mar 20 22:39:10 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_slurp_symbol_table): Tighten test to determine + what symbols are section symbols. + +Sat Mar 18 01:54:45 1995 Ian Lance Taylor <ian@cygnus.com> + + * elfcode.h (elf_bfd_link_add_symbols): An empty archive is OK. + +Fri Mar 17 16:29:02 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_copy_private_section_data): Just return true when + either the input or output section isn't attached to a SOM BFD. + (som_bfd_copy_private_bfd_data): Similarly for BFD private data. + +Fri Mar 17 11:50:34 1995 Ian Lance Taylor <ian@cygnus.com> + + * elfcode.h (elf_link_add_object_symbols): Check whether a dynamic + object has already been included, and ignore it the second time. + +Wed Mar 15 11:56:40 1995 Ian Lance Taylor <ian@cygnus.com> + + * elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT13 from + complain_overflow_bitfield to complain_overflow_signed. + + * libelf.h (bfd_elf32__write_relocs): Don't declare. + (bfd_elf64__write_relocs): Don't declare. + +Tue Mar 14 05:54:33 1995 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * stab-syms.c (aout_stab_name): Moved aout_stab_names to be local + to this function. Recoded function to stop using table, to + improve performance (on i486-netbsd host). Left old version + intact under "#if 0" for further performance testing. + +Mon Mar 13 13:48:49 1995 Ian Lance Taylor <ian@cygnus.com> + + * elfcode.h (write_relocs): Make static. Use PTR argument as a + pointer to a boolean variable set to true if something fails. + Cast to PTR rather than void *. + (sym_is_global): Rewrite for clarity. + (map_program_segments): If the program header size is too small, + call _bfd_error_handler and return failure rather than aborting. + (NAME(bfd_elf,write_object_contents)): Pass boolean variable when + calling write_relocs. + (elf_symbol_from_bfd_symbol): Use BFD_ASSERT rather than abort. + (struct elf_info_failed): Define. + (NAME(bfd_elf,size_dynamic_sections)): Declare variables in inner + blocks. Pass elf_info_failed structure when calling + elf_export_symbol and elf_adjust_dynamic_symbol. + (elf_export_symbol): Treat data argument as elf_info_failed rather + than bfd_link_info. Set failed field on error. + (elf_adjust_dynamic_symbol): Likewise. + (struct elf_finfo_failed): Define. + (elf_bfd_final_link): Pass elf_finfo_failed structure when calling + elf_link_output_extsym. Use BFD_ASSERT rather than abort. + (elf_link_output_extsym): Treat data argument as elf_finfo_failed + rather than elf_final_link_info. Set failed field on error. + (elf_link_input_bfd): Use BFD_ASSERT rather than abort. + (elf_reloc_link_order): Likewise. + + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Only write + out PLTRELSZ, PLTREL and JMPREL relocs if there is a .rela.plt + section. Solaris 2.4 apparently does not handle empty reloc + information correctly. + + * archive.c (bsd_write_armap): Cast getuid and getgid results to + long, and print with %ld. + + +Fri Mar 10 16:41:05 1995 Ian Lance Taylor <ian@cygnus.com> + + * aoutx.h (translate_to_native_sym_flags): Always use the output + section if it is not NULL. + +Thu Mar 9 15:06:25 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffswap.h (coff_swap_scnhdr_out): If the line number count or + the reloc count does not fit, print an error and return 0. + * coffcode.h (coff_write_object_contents): Check return value of + coff_swap_scnhdr_out. + * ecoff.c (_bfd_ecoff_write_object_contents): Check return value + of bfd_coff_swap_scnhdr_out. + + * bfd.c: Include <stdarg.h> or <varargs.h>, depending upon + ANSI_PROTOTYPES. + (bfd_error_handler_type): New global type. + (_bfd_error_program_name): New static variable. + (_bfd_default_error_handler): New static function. + (_bfd_error_handler): New BFD private global variable. + (bfd_set_error_handler): New globally visible function. + (bfd_set_error_program_name): New globally visible function. + * libbfd-in.h (_bfd_error_handler): Declare. + * bfd-in2.h, libbfd.h: Rebuild. + + * aoutx.h (NAME(aout,swap_ext_reloc_in)): Add symcount parameter, + and use it instead of bfd_get_symcount. Check r_index after + setting r_extern based on whether this is a base relative reloc. + (NAME(aout,swap_std_reloc_IN)): Add symcount parameter, and use it + instead of bfd_get_symcount. + (NAME(aout,slurp_reloc_table)): Pass bfd_get_symcount to reloc + swap routines. + * libaout.h (NAME(aout,swap_ext_reloc_in)): Add symcount parameter + to declaration. + (NAME(aout,swap_std_reloc_in)): Likewise. + * sunos.c (sunos_canonicalize_dynamic_reloc): Pass + info->dynsym_count to reloc swap routines. + * aout-ns32k.c (MY_swap_std_reloc_in): Add symcount parameter. + * hp300hpux.c (MY(swap_std_reloc_in)): Likewise. + (MY(slurp_reloc_table)): Pass bfd_get_symcount to reloc swap + routine. + * i386lynx.c (NAME(lynx,swap_ext_reloc_in)): Add symcount + parameter. + (NAME(lynx,swap_std_reloc_in)): Likewise. + (NAME(lynx,slurp_reloc_table)): Pass bfd_get_symcount to reloc + swap routines. + +Thu Mar 9 12:04:05 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * bfd.c (bfd_merge_private_bfd_data): New function vector to be + called by the linker to merge any private bfd data of the input + files and the output file. Used by the PowerPC ELF support to + check whether -mrelocatable is used for all modules. + (bfd_set_private_flags): New function vector to be called by the + assembler to set private flags. Used by the PowerPC ELF support + to set that a particular object file was assembled with the + -mrelocatable option. + + * targets.c (BFD_JUMP_TABLE_COPY): Add intiialization of the + bfd_merge_private_bfd_data and bfd_set_private_flags function + vectors. + + * bfd-in2.h, libbfd-in.h: Rebuild with bfd.c and targets.c + changes. + + * elf32-ppc.c (ppc_elf_set_private_flags): New function to set the + ELF e_flags field. + (ppc_elf_copy_private_bfd_data): Copy the e_flags field from the + input file to the output file. + (ppc_elf_merge_private_bfd_data): Check for a mismatch between the + e_flags field of all of the linker input files. + + * libelf.h (elf_obj_tdata): Add ppc_flags_init field so that the + PowerPC support can check if compataible e_flags are present. + + * aout-target.h: Add NOP for the bfd_merge_private_bfd_data + and bfd_set_private_flags function vectors. + * coffcode.h: Ditto. + * elf32-target.h: Ditto. + * elf64-target.h: Ditto. + * libbfd.h: Ditto. + * libecoff.h: Ditto. + * som.c: Ditto. + +Wed Mar 8 00:53:54 1995 Ian Lance Taylor <ian@cygnus.com> + + * cpu-mips.c (arch_info_struct): Add mips:8000 entry. + + * elfcode.h (swap_out_syms): Mark an undefined BSF_WEAK symbol as + STB_WEAK rather than STB_GLOBAL. + + +Tue Mar 7 12:23:47 1995 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (bfd_coff_backend_data): Add new field + _bfd_coff_adjust_symndx. + (bfd_coff_adjust_symndx): Define. + (coff_adjust_symndx): Define as NULL if not already defined. + (bfd_coff_std_swap_table): Initialize new field to + coff_adjust_symndx. + * cofflink.c (coff_link_input_bfd): Call coff_adjust_symndx if it + is defined. + * coff-a29k.c (coff_a29k_adjust_symndx): New static function. + (coff_adjust_symndx): Define before including coffcode.h. + * libcoff.h: Rebuild. + + * format.c (bfd_check_format_matches): Skip binary_vec when + searching through bfd_target_vector. + + * elfcode.h (elf_sort_hdrs): Check SHT_NOBITS before checking + sh_size. + +Mon Mar 6 23:31:36 1995 Doug Evans <dje@chestnut.cygnus.com> + + * elfcode.h (elf_sort_hdrs): Keep SHT_NOBITS sections after + !SHT_NOBITS ones. + +Mon Mar 6 09:53:08 1995 Jeff Law (law@snake.cs.utah.edu) + + * cpu-hppa.c (arch_info_struct): Support both PA1.0 and PA1.1 + machine types. + (bfd_hppa_arch): Link in both PA1.0 and PA1.1 architecture info + structures. + * libhppa.h (enum pa_arch): New enumeration to describe the + different variants of the PA architecture. + * som.c (som_object_setup): Use new enumeration to set machine + type. + (som_finish_writing): If the machine type is PA1.1, then use the + PA1.1 machine identifier in the output file. + +Thu Mar 2 15:58:24 1995 Ian Lance Taylor <ian@cygnus.com> + + * aoutx.h (NAME(aout,swap_ext_reloc_in)): Treat the index of a + base relative reloc as an index into the symbol table, regardless + of the setting of r_extern. + (NAME(aout,swap_std_reloc_in)): Likewise. + + * aoutx.h (NAME(aout,set_section_contents)): Double check that the + caller is writing to a valid section. + +Thu Mar 2 14:37:57 1995 Bryan Ford <baford@cs.utah.edu> + + * binary.c: Add support for reading binary files. Loads the raw + contents of the file into a data section and wraps some symbols + around it. The symbols `_binary_<filename>_start' and + `_binary_<filename>_end' indicate the start and end of the data, + while `_binary_<filename>_size' is an absolute symbol whose value + is the size of the data. <filename> is the name of the binary + input file, with all non-alphanumeric characters converted to + underscores. + + * archures.c (bfd_arch_get_compatible): Assume users knows what + they're doing if one of the architectures is bfd_arch_unknown. + +Wed Mar 1 17:30:46 1995 Michael Meissner <meissner@cygnus.com> + + * elf32-ppc.c (elf_powerpc_howto_table): For relocation + R_PPC_GOT16, change complain_on_overflow to be + complain_overflow_signed. + +Wed Mar 1 11:52:55 1995 Jason Molenda <crash@phydeaux.cygnus.com> + + * configure.host: Recognize powerpc-*-aix*. + +Wed Mar 1 11:57:39 1995 Ian Lance Taylor <ian@cygnus.com> + + * coff-i960.c (COFF_PAGE_SIZE): Define. + + * configure.in: Rewrite output of TDEFAULTS to avoid relying on + semantics of single quotes in parameter substitution. + +Tue Feb 28 12:53:09 1995 Ian Lance Taylor <ian@cygnus.com> + + * elfcode.h (elf_sort_hdrs): Sort empty sections before non-empty + sections, if they have the same VMA. + + * config.bfd (i[345]86-*-linuxelf*): New target. Use i386-lelf. + (i[345]86-*-gnuelf*): New target. Use i386-gelf. + * config/i386-lelf.mt: New file. + * config/i386-gelf.mt: New file. + +Mon Feb 27 12:58:25 1995 Kung Hsu <kung@mexican.cygnus.com> + + * config.bfd: add a29k-*-vxworks configuration. + +Wed Feb 22 14:40:26 1995 Ian Lance Taylor <ian@cygnus.com> + + * libaout.h (NAME(aout,slurp_reloc_table)): Change declaration to + use reloc_howto_type rather than const struct reloc_howto_struct. + +Tue Feb 21 18:19:22 1995 Ian Lance Taylor <ian@cygnus.com> + + * bout.c (b_out_slurp_reloc_table): Don't return an error if asked + for relocations for the .bss section. + +Tue Feb 21 15:13:05 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_ar_write_symbol_stuff): Handle objects with odd + lengths. + +Fri Feb 17 12:34:36 1995 Michael Meissner <meissner@cygnus.com> + + * elf32-ppc.c (ppc_elf_got16_reloc): Make GOT style relocs add + 32768, so the GOT pointer can point to 16384 pointers, instead of + 8192. + +Fri Feb 17 11:45:38 1995 Ian Lance Taylor <ian@cygnus.com> + + * hosts/sysv4.h: Include <unistd.h>, <stdlib.h>, and <time.h>. + Only define SEEK_SET and SEEK_CUR if they are not already defined. + Remove all external function declarations. + + * syms.c (bfd_decode_symclass): Return 'W' for a weak symbol. + + * coffgen.c (coff_real_object_p): Set start address and flags + before calling coff_mkobject_hook. Restore them on failure. + * ecoff.c (_bfd_ecoff_mkobject_hook): If not ECOFF_AOUT_ZMAGIC, + clear D_PAGED. + + * coffgen.c: Reindented. + +Thu Feb 16 14:37:23 1995 Doug Evans <dje@cygnus.com> + + * reloc.c (bfd_perform_relocation): Don't use bitpos in overflow + calculations. + (bfd_install_relocation): Likewise. + +Thu Feb 16 13:22:29 1995 Ian Lance Taylor <ian@cygnus.com> + + * hosts/std-host.h: Remove all function declarations which return + int or void, except the one for free. + +Wed Feb 15 14:54:18 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * elf32-ppc.c (elf_powerpc_howto_table): Use a destination mask of + 0xffffffff for R_PPC_REL32, not 0. + (powerpc_reloc_map): Add low 16 bit, high 16 bit, and high 16 bit + adjusted relocations. + +Tue Feb 14 17:47:17 1995 Ian Lance Taylor <ian@cygnus.com> + + * elf32-mips.c (struct mips_elf_find_line): Define. + (mips_elf_find_nearest_line): New static function. + (bfd_elf32_find_nearest_line): Define. + * libelf.h (struct elf_obj_tdata): Add find_line_info field. + + * ecoff.c (_bfd_ecoff_swap_tir_in): Move to ecofflink.c. + (_bfd_ecoff_swap_tir_out): Likewise. + (_bfd_ecoff_swap_rndx_in): Likewise. + (_bfd_ecoff_swap_rndx_out): Likewise. + (cmp_fdrtab_entry): Likewise. + (mk_fdrtab): Likewise. + (lookup): Likewise. + (_bfd_ecoff_find_nearest_line): Just call _bfd_ecoff_locate_line + to do most of the work. Allocate find_line_info if necessary. + * ecofflink.c: Include "aout/stab_gnu.h". + (_bfd_ecoff_swap_tir_in): Move in from ecoff.c. + (_bfd_ecoff_swap_tir_out): Likewise. + (_bfd_ecoff_swap_rndx_in): Likewise. + (_bfd_ecoff_swap_rndx_out): Likewise. + (cmp_fdrtab_entry): Likewise. Use PTR instead of void *. + (mk_fdrtab): Move in from ecoff.c. Add debug_info, debug_swap, + and line_info arguments, and use them instead of ecoff_data. + (fdrtab_lookup): Move in from lookup in ecoff.c. Remove abfd + argument, add line_info argument. Use it instead of ecoff_data. + (_bfd_ecoff_locate_line): New function, mostly from the old + _bfd_ecoff_find_nearest_line in ecoff.c. + * libecoff.h (ecoff_data_type): Remove find_buffer, fdrtab_len and + fdrtab fields, replacing them find_line_info field. + (_bfd_ecoff_swap_tir_in): Declare. + (_bfd_ecoff_swap_tir_out): Declare. + (_bfd_ecoff_swap_rndx_in): Declare. + (_bfd_ecoff_swap_rndx_out): Declare. + * libbfd-in.h (_bfd_ecoff_locate_line): Declare. + * libbfd.h: Rebuild. + * configure.in: Don't use ecoff.o for bfd_elf32_bigmips_vec or + bfd_elf32_littlemips_vec. + * Makefile.in: Rebuild dependencies. + +Tue Feb 14 14:04:22 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * libelf.h (elf_backend_data): Add fields elf_machine_alt1 and + elf_machine_alt2 which provide alternate versions of the machine + code. + + * elf32-ppc.c (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Define to + recognize old versions of the PowerPC machine code. + + * elf32-target.h (elf32_bed): Initialize alternate machine code + fields defined by ELF_MACHINE_ALT1 and ELF_MACHINE_ALT2. + + * elf64-target.h (elf64_bed): Initialize alternate machine code + fields defined by ELF_MACHINE_ALT1 and ELF_MACHINE_ALT2. + + * elfcode.h (elf_object_p, elf_core_file_p): In addition to the + main machine code field, check the two alternate machine code + fields. + +Tue Feb 14 12:46:48 1995 Ian Lance Taylor <ian@cygnus.com> + + * aoutf1.h (MACHTYPE_OK): Don't define if already defined. Don't + accept M_SPARC if bfd_arch_sparc is not in the list of supported + architectures, and don't accept a 680x0 machine type if + bfd_arch_m68k is not in the list of supported architectures. + * aout0.c (MACHTYPE_OK): Define. + +Mon Feb 13 23:25:38 1995 Ian Lance Taylor <ian@cygnus.com> + + * aoutx.h (NAME(aout,swap_ext_reloc_in)): Don't return a pointer + to garbage if the symbol index is out of range. + (NAME(aout,swap_std_reloc_in)): Likewise. + + +Thu Feb 9 18:36:52 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + * Makefile.in (BFD32_BACKENDS): Add i386msdos.o. + +Thu Feb 9 12:02:35 1995 Ian Lance Taylor <ian@cygnus.com> + + * i386linux.c (NEEDS_SHRLIB): Define. + (linux_tally_symbols): Crash if a NEEDS_SHRLIB symbol is + undefined. From hjl@nynexst.com (H.J. Lu). + +Wed Feb 8 17:26:00 1995 Ian Lance Taylor <ian@cygnus.com> + + * linker.c (generic_link_check_archive_element): Allocate common + symbol information structure. Don't bother to check for common + symbol size overflow. + (_bfd_generic_link_add_one_symbol): Likewise. + * aoutx.h (aout_link_check_ar_symbols): Likewise. + * linker.c (generic_link_check_archive_element): Adjust references + to common symbol information for new structure. + (_bfd_generic_link_add_one_symbol): Likewise. + * aoutx.h (aout_link_check_ar_symbols): Likewise. + (aout_link_add_symbols): Likewise. + * ecoff.c (ecoff_link_add_externals): Likewise. + * elfcode.h (elf_link_add_object_symbols): Likewise. + (elf_link_output_extsym): Likewise. + * sunos.c (sunos_add_one_symbol): Likewise. + +Wed Feb 8 09:53:42 1995 Doug Evans <dje@canuck.cygnus.com> + + * elfcode.h (elf_sort_hdrs): Put SHT_NOBITS sections after !SHT_NOBITS. + +Tue Feb 7 16:27:33 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_find_nearest_line): Just return false, don't + abort. + +Tue Feb 7 14:43:33 1995 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * ecoff.c: Reformatted some comments and brace constructs in + recent changes to GNU style. + (cmp_fdrtab_entry, mk_fdrtab, lookup): Use old-style function + definitions. + +Tue Feb 7 14:21:28 1995 Ian Lance Taylor <ian@cygnus.com> + + * ecoffswap.h (ecoff_swap_pdr_in): Zero out intern before setting + any of the fields. + +Mon Feb 6 20:01:24 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + Sat Feb 4 14:20:24 1995 David Mosberger-Tang <davidm@piston.cs.arizona.edu> + + * ecoffswap.h (ecoff_swap_pdr_in, ecoff_swap_pdr_out): added + internalizing/externalizing new "prof" field. + + * libecoff.h (ecoff_tdata): added fdrtab. + + * ecoff.c (_bfd_ecoff_find_nearest_line): Fixed. + +Mon Feb 6 14:25:24 1995 Ian Lance Taylor <ian@cygnus.com> + + * libelf.h (struct elf_link_hash_table): Add saw_needed field. + * elfcode.h (elf_link_add_object_symbols): Set saw_needed if + DT_NEEDED seen in .dynamic section. + (elf_link_output_extsym): Warn if an undefined symbol is + only referenced from a dynamic object, and not making a shared + object, and saw_needed is false. + * elf.c (_bfd_elf_link_hash_table_init): Initialize saw_needed. + + * libelf.h (ELF_LINK_HASH_DEFINED_WEAK): Don't define. + * elfcode.h (elf_link_add_object_symbols): Don't clear or set + ELF_LINK_HASH_DEFINED_WEAK. + (elf_link_output_extsym): Don't check ELF_LINK_HASH_DEFINED_WEAK. + + Distinguish a weak defined symbol from a regular defined symbol. + * linker.c (enum link_action): Add DEFW. + (link_action): Add bfd_link_hash_defweak column. + (_bfd_generic_link_add_one_symbol): Add DEFW case. Handle + bfd_link_hash_defweak in a few other cases. + * Many files (bfd_link_hash_undefweak): Renamed from + bfd_link_hash_weak. + * aoutx.h (aout_link_write_symbols): Handle bfd_link_hash_defweak. + (aout_link_write_other_symbol): Likewise. + (aout_link_input_section_std): Likewise. + (aout_link_input_section_ext): Likewise. + * bout.c (get_value): Likewise. + * coff-a29k.c (coff_a29k_relocate_section): Likewise. + * coff-alpha.c (alpha_convert_external_reloc): Likewise. + (alpha_relocate_section): Likewise. + * coff-mips.c (mips_relocate_section): Likewise. + (mips_relax_section): Likewise. + (bfd_mips_ecoff_create_embedded_relocs): Likewise. + * cofflink.c (coff_write_global_sym): Likewise. + (_bfd_coff_generic_relocate_section): Likewise. + * ecoff.c (ecoff_link_add_externals): Likewise. + (ecoff_link_write_external): LIkewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_size_stubs): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_finish_dynamic_symbol): Likewise. + * elf32-mips.c (mips_elf_output_extsym): Likewise. + (mips_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + (elf32_sparc_relocate_section): Likewise. + * elfcode.h (elf_link_add_object_symbols): Likewise. + (elf_adjust_dynamic_symbol): Likewise. + (elf_bfd_final_link): Likewise. + (elf_link_output_extsym): Likewise. + * i386linux.c (linux_add_one_symbol): Likewise. + (linux_tally_symbols): Likewise. + (linux_finish_dynamic_link): Likewise. + * linker.c (_bfd_generic_link_output_symbols): Likewise. + (set_symbol_from_hash): Likewise. + * reloc16.c (bfd_coff_reloc16_get_value): Likewise. + (bfd_perform_slip): Likewise. + * sunos.c (sunos_add_one_symbol): Likewise. + (sunos_scan_std_relocs): Likewise. + (sunos_scan_ext_relocs): Likewise. + (sunos_scan_dynamic_symbol): Likewise. + (sunos_write_dynamic_symbol): Likewise. + +Mon Feb 6 03:20:17 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + Changes from Bryan Ford, baford@schirf.cs.utah.edu: + * config.bfd (i[345]86-*-msdos*): New target. + * configure.in (i386msdos_vec): Handle it. + * i386msdos.c: New file. + * config/i386-msdos.mt: New file. + * bfd.c (enum bfd_error): Added new value bfd_error_file_too_big. + (bfd_errmsgs): Added string to table. + * libaout.h (reloc_type-lookup): Declare it. + * targets.c (enum bfd_flavour): Added bfd_target_msdos_flavour. + (i386msdos_vec): Declare. + (bfd_target_vector): Add it to the list. + * bfd-in2.h: Regenerated. + +Wed Feb 1 01:32:14 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_set_reloc_info, case R_DATA_ONE_SYMBOL): If there's + nothing in R_DATA_OVERRIDE, then try to find the addend in the + section's contents. + (som_write_fixups): Ignore the addend in a R_DATA_ONE_SYMBOL fixup. + + * som.c (som_object_setup): More heruistics to detect the + braindamaged HP OSF1 linker. + (setup_sections): Don't forget to free subspace_sections if we get + an error. + (som_slurp_string_table): Allocate strings on this bfd's obstack + rather than directly out of the heap. + (som_slurp_symbol_table): Likewise for the saved copy of the + canonical symbols. + (som_slurp_reloc_table): Likewise for the saved copy of the + canonical relocations. Free the native relocations when we're + done with them. + +Tue Jan 31 21:53:28 1995 Doug Evans <dje@canuck.cygnus.com> + + * libelf.h (struct elf_obj_tdata): New member program_header_size. + * elfcode.h (get_program_header_size): New parameters sorted_hdrs, + count, and maxpagesize. All callers updated. + If sorted_hdrs is non-NULL, use it to compute the number of segments. + Save result in case called again. + (assign_file_positions_except_relocs): Sort headers before calling + get_program_header_size. + +Tue Jan 31 15:27:53 1995 Ian Lance Taylor <ian@cygnus.com> + + * elfcode.h (map_program_segments): Add sorted_hdrs parameter. + Search through it rather than through unsorted section headers. + (assign_file_positions_except_relocs): Pass sorted_hdrs to + map_program_segments. + +Mon Jan 30 22:04:53 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + * ecoff.c (_bfd_ecoff_find_nearest_line): Fix problems in range + checking. Expect argument OFFSET to be section-relative. From + David Mosberger-Tang, davidm@piston.cs.arizona.edu. + +Mon Jan 30 11:22:11 1995 Ian Lance Taylor <ian@cygnus.com> + + * elfcode.h (NAME(bfd_elf,record_link_assignment)): Don't do + anything if we are not linking an ELF file. + (NAME(bfd_elf,size_dynamic_sections)): Likewise. + +Sat Jan 28 12:48:57 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (compare_subspaces): New function to sort subspaces by + their location in the object file. + (setup_sections): When computing the index for each subspace, + handle case where setup_sections reads the subspaces in a + different order that they appear in the object file. + (som_is_space): Also examine the output section for the containing + section. + (som_is_subspace, som_is_container): Likewise. + (som_begin_writing): Don't prepare or write fixups here. When + writing the symbol strings, use the unsorted symbol table. + (som_write_object_contents): Don't write the symbol table here. + (som_finish_writing): Prepare and write the fixups here. Likewise + for the symbol table. + (som_bfd_derive_misc_symbol_info): Undefined symbols always have + type SS_UNSAT regardless of BSF_EXPORT. + (som_set_reloc_info): Unpack and attach argument location + information for R_PCREL_CALL and R_ABS_CALL relocations. + + * som.c (som_object_setup): New heuristic to determine if the + entry and flags fields are switched in the exec header. + +Sat Jan 28 00:16:01 1995 Ian Lance Taylor <ian@cygnus.com> + + * elfcode.h (elf_link_add_object_symbols): Use *sym_hash instead + of h if we might not be doing an ELF link. + +Fri Jan 27 16:13:42 1995 Ian Lance Taylor <ian@cygnus.com> + + * elf32-mips.c (mips_elf_final_link): If the size of an input + .reginfo section is zero, force it to the correct size, since the + linker emulation code may have clobbered it. + + * elfcode.h (elf_sort_hdrs): Correct SHF_ALLOC test. + (assign_file_positions_except_relocs): Free sorted_hdrs. + +Thu Jan 26 09:00:12 1995 Steve Chamberlain <sac@splat> + + * srec.c (srec_set_section_contents): Fix off by + one end address calculation. + + * config.bfd: (m68*-est-coff): New configuration. + +Thu Jan 26 11:39:21 1995 Ian Lance Taylor <ian@cygnus.com> + + * elfcode.h (elf_link_add_object_symbols): Only examine weakdef if + we are using an ELF hash table. + + * aoutx.h (NAME(aout,some_aout_object_p)): Always set EXEC_P if + the start address is in the .text section, even if STAT_FOR_EXEC + is set. Just use STAT_FOR_EXEC as an additional test. + +Thu Jan 26 11:12:54 1995 Michael Meissner <meissner@cygnus.com> + + * elfcode.h (prep_headers): Use EM_PPC instead of + EM_CYGNUS_POWERPC. + + * elf32-ppc.c (reloc_type): Add all System V.4 and eABI + relocations currently defined. + (powerpc_reloc_map): Adjust to new relocation names. + (elf_powerpc_howto_table): Add most of the new relocations. + (ELF_MACHINE_CODE): Use EM_PPC instead of EM_CYGNUS_POWERPC. + + * config.bfd: Add support for powerpc-*-eabi. + + * config/ppc-elf.mt: Add rs6000 architecture support to the + PowerPC. Also add XCOFF support. + +Wed Jan 25 23:26:13 1995 Ian Lance Taylor <ian@cygnus.com> + + * coff-sh.c (CALC_ADDEND): Don't define. + (coff_sh_relocate_section): Remove. + (coff_relocate_section): Use _bfd_coff_generic_relocate_section. + +Tue Jan 24 14:22:47 1995 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * elf32-mips.c (mips_elf_output_extsym): Set the value of the + ECOFF symbol from the hash table entry. + +Mon Jan 23 14:53:35 1995 Steve Chamberlain <sac@splat> + + * coff-sh.c (coff_sh_relocate_section): Don't subtract + vma twice. + +Mon Jan 23 13:33:18 1995 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * coff-sh.c (sh_reloc): Don't ignore the previous contents of an + R_SH_IMM32 reloc. + + * config.bfd (i[345]86-*-gnu*): Set bfd_name to i386-gnu. + * config/i386-gnu.mt: New file. Include ELF support. + + * opncls.c (bfd_openstreamr): Call bfd_cache_init. + +Fri Jan 20 11:44:45 1995 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * sunos.c (sunos_add_one_symbol): Only set the sunos specific + fields if we are doing a sunos link. + +Wed Jan 18 12:28:17 1995 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * cpu-h8300.c (h8300_info_struct): Change name from "H8/300" to + "h8300" for consistency with other cpu-* files. + (h8300h_info_struct): Change name from "H8/300H" to "h8300h". + * coff-h8300.c (special): Remove unused variable diff. + +Tue Jan 17 10:52:32 1995 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * bfd-in.h (bfd_byte, reloc_howto_type): Define here, not... + * reloc.c (bfd_byte, reloc_howto_type): here. + * Changed all occurrences of ``const struct reloc_howto_struct'' + to be ``reloc_howto_type'' instead. + * bfd-in2.h, libbfd.h, libcoff.h: Rebuilt. + + * opncls.c (bfd_openstreamr): New function. + * bfd-in2.h: Rebuilt. + + * elf32-mips.c (enum reloc_type): Define new relocs used on Irix. + (elf_mips_howto_table): Add entries for new relocs. + (mips_elf_section_from_shdr): Handle SHT_MIPS_MSYM, + SHT_MIPS_DWARF, and SHT_MIPS_EVENTS. + (mips_elf_fake_sections): Handle sections named .msym, .debug_* + and .MIPS.events.*. + + * srec.c (srec_init): Remove unused local variable i. + +Sat Jan 14 19:09:48 1995 Steve Chamberlain <sac@jonny> + + * archures.c, Makefile.in, targets.c, bfd-in2.h, coffcode.h, + config.bfd, configure.in, config/w65.mt: Initial support for the W65. + +Sun Jan 15 13:57:45 1995 Steve Chamberlain <sac@splat> + + * opncls.c (bfd_fdopenr): Configure for WIN32. + +Thu Jan 12 16:30:47 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + * Makefile.in (diststuff): Include `headers'. + + * sunos.c (m68k_plt_first_entry, sparc_plt_first_entry): Now + const. + * tekhex.c (digs): Ditto. + * elf32-i386.c (elf_i386_plt0_entry, elf_i386_plt_entry): Ditto. + + * srec.c, tekhex.c: Include libiberty.h. Delete static array + hex_value and replace references to it with references to + hex_init, hex_p, and hex_value. + * Makefile.in: Updated dependencies. + + * archures.c (archures_init_table): Now const. + (bfd_arch_init): Adjusted type of local var `ptable'. + +Thu Jan 12 09:33:24 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * hosts/symmetry.h: Redefine `shared' to enable compilation + with the native Dynix cc compiler. + * i386dynix.c: Include aoutx.h instead of using routines + from aout32.c. + +Wed Jan 11 21:31:41 1995 Ken Raeburn <raeburn@cujo.cygnus.com> + + * reloc.c (reloc_howto_type): Make typedef include `const'. + * aout-ns32k.c, aoutx.h, bout.c, cf-m68klynx.c, coff-i386.c, + coff-i960.c, coff-m68k.c, cofflink.c, cpu-ns32k.c, ecoff.c, + elf32-hppa.c, elf32-i386.c, elf32-mips.c, elf32-sparc.c, + elfcode.h, libbfd-in.h, linker.c, mipsbsd.c, nlm32-ppc.c, oasys.c, + reloc.c, som.c: Don't use `const' in combination with + `reloc_howto_type'. + * bfd-in2.h, libbfd.h: Regenerated. + + * ecoff.c (ecoff_type_to_string): Local variable `buffer1' doesn't + need to be static. + +Wed Jan 11 14:36:41 1995 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * sunos.c (sunos_add_one_symbol): Don't core dump if a multiple + definition of an absolute symbol is encountered. + + * linker.c (_bfd_generic_link_add_one_symbol): Ignore + redefinitions of an absolute symbol to the same value. + +Mon Jan 9 15:51:32 1995 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * elfcode.h (elf_link_add_object_symbols): It's reasonable for no + flags to be set, so don't insist otherwise. + +Fri Jan 6 16:39:40 1995 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * elfcode.h (elf_slurp_symbol_table): Don't set BSF_GLOBAL for an + undefined or common symbol. + (elf_link_add_object_symbols): Likewise. + +Wed Jan 4 14:14:05 1995 Jeff Law (law@snake.cs.utah.edu) + + * som.c (bfd_section_from_som_symbol): Only return sections which + correspond to subspaces. + + * som.c (som_begin_writing): Don't forget to bump the + total_subspaces when writing the unloadable subspaces. + +Wed Dec 28 20:54:47 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_write_fixups): Use SEC_HAS_CONTENTS to identify + bss-like sections. + (som_get_section_contents): Likewise. + (som_set_section_contents): Likewise. + +Tue Dec 27 14:03:47 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (setup_sections): Turn off SEC_HAS_CONTENTS for bss-like + sections. + +Tue Dec 20 15:30:12 1994 Ken Raeburn <raeburn@cujo.cygnus.com> + + * coffgen.c (bfd_debug_section): Deleted. + (coff_section_from_bfd_index): Return absolute section for debug + symbol. + (coff_write_symbol): Set BSF_DEBUGGING for C_FILE symbols. If + BSF_DEBUGGING is set, set section to N_DEBUG. + (coff_bfd_make_debug_symbol): Use absolute section. + + * elfcode.h (assign_file_positions_except_relocs): In assertion, + force all values to the same type. + +Tue Dec 20 11:11:58 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * coff-h8300.c (howto_table): All relocs get a special function. + (special): Never do anything when linking -r. + +Tue Dec 20 13:58:01 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * i386linux.c (linux_add_one_symbol): Don't do anything Linux + specific if this is not a Linux hash table. From Eric Youngdale + <eric@aib.com>. + + Patches from kkojima@mix.or.jp (Kazumoto Kojima): + * mipsbsd.c (mips_howto_table_ext): Change sizes of memory relocs + apply to from two bytes to four bytes. + * MY(reloc_howto_type_lookup): Handle BFD_RELOC_CTOR. + + * elf32-i386.c (elf_i386_relocate_section): Correct and expand the + list of cases for which relocation need not be computed. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + + +Mon Dec 19 23:09:16 1994 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_read_symext_info): Delete do_locals and + do_globals arguments, always read symbol extension information for + globals and locals. All callers changed. + (elf32_hppa_size_stubs): Rework to only read symbol extension + information once for each input bfd. 10% improvement in linker + performance. + +Fri Dec 16 12:28:46 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * elfcode.h (elf_section_from_bfd_section): Check + bfd_is_abs_section, etc., only after checking for the section in + the BFD and after calling the backend routine. + +Wed Dec 14 20:21:58 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * elfcode.h (elf_map_symbols): Only use section symbols whose + value is the start of the section, checking output_offset when + using output_section. When creating a new symbol, set the value + to 0, since BFD symbol values are section relative. + +Tue Dec 13 13:31:06 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * cpu-z8k.c (arch_info_struct): Make z8002 the default + architecture. + +Fri Dec 9 12:43:05 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * elfcode.h (elf_bfd_link_add_symbols): If the first object in the + archive is not an ELF object, pass the archive to the add_symbols + entry point appropriate for the first object. From Eric Youngdale + <eric@aib.com>. + * aoutx.h (NAME(aout,link_add_symbols)): Similar change if the + first object is not an a.out object. + + * elf32-i386.c (elf_i386_relocate_section): Don't compute + relocation in cases where we won't use it. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + +Thu Dec 8 14:19:41 1994 Ken Raeburn <raeburn@cujo.cygnus.com> + + * pc532-mach.c (NAME): Define to use ns32kaout prefix. + * ns32knetbsd.c (NAME): Ditto. + (ns32kaout_32_get_section_contents): Define to standard aout-32 + version. + +Fri Dec 2 13:56:49 1994 Ian Lance Taylor <ian@rtl.cygnus.com> + + * coff-mips.c (mips_read_relocs): New static function, broken out + of mips_relax_section. + (mips_relax_section): Call mips_read_relocs. + (bfd_mips_ecoff_create_embedded_relocs): New function. + * bfd-in.h (bfd_mnips_ecoff_create_embedded_relocs): Declare. + * bfd-in2.h: Rebuild. + +Wed Nov 30 14:12:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-sh.c: Use _bfd_dummy_target instead of no_archive. + + +Tue Nov 29 14:00:19 1994 J.T. Conklin <jtc@.rtl.cygnus.com> + + * config.bfd (i[345]86-*-freebsd*): Use i386-bsd as bfd_name. + * configure.host (i[345]86-*-freebsd*): Use i386bsd as my_host. + +Mon Nov 28 15:36:04 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * config/m68k-nbsd.mt (DEFAULT_VECTOR): set to m68knetbsd_vec. + * Makefile.in: Rebuilt dependancies. + (CFILES): Added m68knetbsd.c. + (HFILES): Added netbsd.h. + +Wed Nov 23 19:21:41 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * coff-sh.c (shlcoff_vec): New target vector. + (no_archive): New function. + * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Handle + little endian SH. + * configure.in: Handle shl. + * targets.c (bfd_target_vector): Add shlcoff_vec. + * config/sh-coff.mt (SELECT_VECS): Handle shl_coff_vec. + +Wed Nov 23 10:50:13 1994 Jeff Law (law@snake.cs.utah.edu) + + * elfcode.h (write_relocs): Do not subtract the section's vma from + the reloc's offset when writing .o's. Instead add the section's + vma to the reloc's offset when writing an executable or shared + library. + +Tue Nov 22 23:34:37 1994 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Do not add + input_section->vma to the relocation's offset. + +Mon Nov 21 12:37:25 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * srec.c (srec_get_reloc_upper_bound): Define. + (srec_canonicalize_reloc): Define. + (srec_bfd_reloc_type_lookup): Define. + (srec_vec, symbolsrec_vec): Use BFD_JUMP_TABLE_RELOCS (srec). + +Sat Nov 19 03:10:51 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * configure.host (i[345]86-*-solaris*): Use solaris2 to + enable extraction of procfs info from core file for GDB. + +Thu Nov 17 17:37:39 1994 Ken Raeburn <raeburn@cujo.cygnus.com> + + * reloc.c (bfd_reloc_code_type): Add new value BFD_RELOC_12_PCREL. + * bfd-in2.h, libbfd.h: Rebuilt. + +Thu Nov 17 13:12:08 1994 Jeff Law (law@snake.cs.utah.edu) + + * bfd/elf32-hppa.c (elf32_hppa_bfd_final_link_relocated): Use the + vma from the output_section containing $global$ when computing + global_vlaue. + +Thu Nov 17 14:29:13 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * archive.c (_bfd_write_archive_contents): Round up the archive + header size of the extended name table to an even number. + +Wed Nov 16 16:08:06 1994 Ken Raeburn <raeburn@cujo.cygnus.com> + + * coff-sh.c: Deleted some code that was commented out or inside + "#if 0". + (COFF_LONG_FILENAMES): Define. + + * cpu-sh.c (arch_info_struct): Convert name to lowercase, for + consistency with other architectures. + +Sat Nov 12 23:50:10 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_export_symbol): Also export symbols which are + referenced by a regular file. + +Fri Nov 11 14:29:31 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add + export_dynamic argument, and handle it. + (elf_export_symbol): New function. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration. + (bfd_elf64_size_dynamic_sections): Update declaration. + * bfd-in2.h: Rebuild. + +Fri Nov 11 10:35:33 1994 Jeff Law (law@snake.cs.utah.edu) + + * hpux-core.c (hpux_core_struct): Delete handles for the + data, reg and stack sections. They're never used. Delete + accessor macros. + (make_bfd_asection): Use bfd_make_section_anyway since debugging + cores from dynamic executables may have several sections with the + same logical name. + (hpux_core_core_file_p): Don't save handles to data, reg and + stack sections. Handle CORE_TEXT, CORE_MMF and CORE_SHM. + +Tue Nov 8 13:03:30 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * bout.c (callj_callback): Add new argument shrinking. Change all + callers. Handle relocs against section symbols correctly. If not + shrinking, don't subtract out dstidx; the subtraction is already + in the object file. + +Sun Nov 6 12:52:00 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.h: Conditionally include <shl.h> and <dl.h>. + +Thu Nov 3 18:19:13 1994 Ken Raeburn <raeburn@cujo.cygnus.com> + + * Makefile.in (ALL_MACHINES): Include m68knetbsd.o. + + * config/i386linux.mh (EXTRALIBS): Include -lm. + + Patches from DJ Delorie: + * coff-go32.c: Replacement file, uses coff-i386.c with minor + changes. + * coff-i386.c (TARGET_UNDERSCORE): allow other files to override + underscore also + * makefile.dos: del ctor.o, add cofflink.o and elf32.o + + * aoutx.h (adjust_o_magic): If user set data section vma, use it + to determine the default bss vma. Patch from Takada Hiroaki, + hiro@is.s.u-tokyo.ac.jp. + (machine_type, case bfd_arch_vax): Set *unknown to false. Patch + from John David Anglin <dave@hiauly1.hia.nrc.ca>. + + * configure.in (tb): Rename ns32knetbsd_vec to pc532netbsd_vec, + since that's what it's called. + +Wed Nov 2 15:24:51 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * archive.c (normalize): Change to take a BFD as an argument. + Change VMS version to use bfd_alloc rather than malloc, so that we + don't lose the memory forever. + (_bfd_construct_extended_name_table): Check the name of an archive + entry which is not being extended, and correct it if it is wrong. + This is necessary in case the archive was constructed by another + program which put an entry in the extended name table which we + don't plan to put in ourselves. From jjc@jclark.com (James + Clark). + (bfd_dont_truncate_arname): Check return value of normalize. + +Mon Oct 31 14:19:08 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * elf32-hppa.c (ELF32_PARISC_SX_SIZE): Define. + (ELF32_PARISC_SX_GET, ELF32_PARISC_SX_PUT): Define. + (symextn_entry): Don't define. + (symext_chain_size): Change type to bfd_size_type. + (symextn_contents): Change type to bfd_byte *. + (elf32_hppa_backend_begin_write_processing): Use + ELF32_PARISC_SX_SIZE instead of sizeof (symext_entryS). + (elf32_hppa_size_symext): Likewise. Also, change type of sizep to + bfd_size_type *. + (elf_hppa_tc_make_sections): Cast symextn_contents assignment to + bfd_byte *. Use ELF32_PARISC_SX_PUT instead of direct assignment. + (elf32_hppa_backend_symbol_table_processing): Use + ELF32_PARISC_SX_SIZE instead of sizeof (symext_entryS). Use + ELF32_PARISC_SX_GET insetad of direct assignment. + (elf32_hppa_read_symext_info): Change type of contents, and its + assignment cast, to bfd_byte *. Use ELF32_PARISC_SX_SIZE instead + of sizeof (symextn_entry). Use symext_entryS instead of + symextn_entry. Use ELF32_PARISC_SX_GET instead of direct + assignment. + + * archive.c (bfd_dont_truncate_arname): Add the ar padding + character, if there is room for it, even if the name is the + maximum length. + + * elfcode.h (assign_file_positions_except_relocs): Sort the ELF + headers by section address when assigning file positions. + (elf_sort_hdrs): New static function. + +Sun Oct 30 18:56:58 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Create DT_INIT + and DT_FINI dynamic entries based on the existence of _init and + _fini symbols, not on the .init and .fini sections. This is + compatible with some SVR4 linkers. + (elf_bfd_final_link): Corresponding change. + +Sat Oct 29 12:18:10 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't move a + symbol with a PLT entry into the .plt section if it is defined in + a regular file. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + + * linker.c (_bfd_generic_link_add_archive_symbols): It's not an + error if an empty archive has no symbol table. + * ecoff.c (ecoff_link_add_archive_symbols): Likewise. + * elfcode.h (elf_link_add_archive_symbols): Likewise. + +Fri Oct 28 10:08:41 1994 J.T. Conklin (jtc@rtl.cygnus.com) + + NetBSD/m68k support, based on work by mikeb@snow.datametrics.com: + * config.bfd (m68*-*-netbsd*): Use m68k-nbsd as bfd_name. + * configure.in (m68knetbsd_vec): Added. + * targets.c (bfd_m68knetbsd_vec): Added. + * hosts/m68knbsd.h, config/m68k-nbsd.mt, m68knetbsd.c: New files. + * Makefile.in (BFD32_BACKENDS, CFILES): Add m68knetbsd.c. + + miscellaneous cleanup required by all netbsd targets, based on work + by Andrew Cagney <cagney@highland.com.au>: + * netbsd.h (N_MAGIC, N_SET_MAGIC, N_GETMAGIC, N_GETMAGIC2, N_TXTADDR, + N_TXTOFF, N_ALIGN, N_DATADDR, N_DATOFF): Removed. Generic a.out + definitions work. + * i386nbsd.c, ns32knbsd.c, sparcnbsd.c (__LDPGSZ): Removed. + (MY(write_object_contents)): Use NetBSD's magic numbers + +Thu Oct 27 16:59:52 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * libelf.h (struct bfd_elf_section_data): Add field dynindx. + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Don't finalize + the .dynsym, .dynstr or .hash sections until after the backend + size_dynamic_sections routine, so that it can add dynamic symbols + if it wants to. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't define the + symbol to be in the .plt section when generating a shared library + if it is a defined symbol. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + (elf32_sparc_size_dynamic_sections): When generating a shared + library, allocate space for a dynamic symbol for each output + section, storing the index in the dynindx field of the ELF section + data. Adjust the other dynindx fields to account for this. + (elf32_sparc_adjust_dynindx): New static function. + (elf32_sparc_relocate_section): When copying a reloc into a shared + library, use the original addend as appropriate. Convert an + R_SPARC_32 reloc into an R_SPARC_RELATIVE reloc. Use the dynamic + symbol index of the output section, not the normal symbol index. + (elf32_sparc_finish_dynamic_sections): Don't die if a section does + not exist when setting the value of the dynamic tags. Write out + a dynamic symbol for each output section. + +Wed Oct 26 01:15:51 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_input_section): Don't bother to read or write + the relocs if there aren't any. + +Tue Oct 25 11:44:38 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * Makefile.in (ALL_MACHINES): Add tekhex.o. + * targets.c (bfd_target_vector): If SELECT_VECS is not defined, + include tekhex_vec. + * tekhex.c (NIBBLE, ISHEX): Cast array arguments to unsigned char. + (getvalue, getsym, out): Likewise. + (find_chunk): Remove unused variable s. + (first_phase): Remove unused variable s. + (pass_over): Remove unused variable address. + (tekhex_object_p): Remove unused variable section. + (move_section_contents): Change return type from boolean to void. + (tekhex_write_object_contents): Remove unused variables tdata and + list. + + * linker.c (enum link_action): Add CIND. + (link_action): Change COMMON_ROW\indr from MDEF to CREF. Change + INDR_ROW\common from MDEF to CIND. + (_bfd_generic_link_add_one_symbol): In CREF case, handle an + existing symbol which is indirect rather than defined. Add new + CIND case. + +Mon Oct 24 15:33:16 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + Change S-record backend to use multiple sections to handle gaps in + file. + * srec.c (srec_data_list_struct): Move field next from last place + to first. Change type of data to bfd_byte *. + (struct srec_symbol): Define. + (tdata_type): Remove done_symbol_read, count, strings, symbol_idx, + string_size, string_idx. Change type of symbols to struct + srec_symbol *. Add symtail and csymbols. + (low, high): Remove. + (size_symbols, fillup_symbols, size_srec, fillup): Remove. + (white, skipwhite, pass_over, object_p): Remove. + (srec_mkobject): Call srec_init. Adjust tdata initialization for + field changes. + (srec_get_byte, srec_bad_byte): New static functions. + (srec_new_symbol, srec_scan): New static functions. + (srec_object_p): Change type of b to bfd_byte. Explicitly set + wrong_format error. Call srec_mkobject and srec_scan instead of + object_p. + (symbolsrec_object_p): Likewise. Also, change b to be only two + bytes. + (srec_read_section): New static function. + (srec_get_section_contents): Call srec_read_section rather than + pass_over. Handle zero length section correctly. + (set_set_arch_mach): Change from function to macro. + (srec_set_section_contents): Change data to bfd_byte *. + (srec_write_record): Change data, end and src to bfd_byte *. + (srec_write_header): Change buffer and dst to bfd_byte *. + (srec_write_section): Change location to bfd_byte *. + (srec_write_terminator): Change buffer to bfd_byte *. + (srec_get_symtab_upper_bound): Don't call + srec_get_section_contents. + (srec_get_symtab): Rewrite. + + * ecoff.c (ecoff_set_symbol_info): Set udata.i to 0, not NULL. + +Fri Oct 21 16:43:13 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * libaout.h (machine_type): added M_68K_NETBSD and M_SPARC_NETBSD. + * i386netbsd.c, ns32knetbsd.c, sparcnetbsd.c: removed RCS Id's. + changed how PAGE_SIZE and SEGMENT_SIZE are defined so they are + consistant with each other. + * netbsd.h (N_HEADER_IN_TEXT, TEXT_START_ADDR): NetBSD fits its + header into the start of its text segment. + +Fri Oct 21 17:13:07 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add case for + _construct_extended_name_table. + (bfd_target): Add _bfd_construct_extended_name_table. + * archive.c (_bfd_archive_bsd_construct_extended_name_table): New + function. + (_bfd_archive_coff_construct_extended_name_table): New function. + (_bfd_construct_extended_name_table): Renamed by adding a leading + underscore, and made externally visible. Added trailing_slash + argument, and used it instead of elf_style. Changed type of + tablen to bfd_size_type *. + (_bfd_write_archive_contents): Use BFD_SEND to call + construct_extended_name_table. Use the returned name. + * libbfd-in.h (_bfd_construct_extended_name_table): Declare. + (_bfd_noarchive_construct_extended_name_table): Define. + (_bfd_archive_bsd_construct_extended_name_table): Declare. + (_bfd_archive_coff_construct_extended_name_table): Declare. + * bfd-in2.h: Rebuild. + * libbfd.h: Rebuild. + * som.c (som_construct_extended_name_table): New static function. + * aout-target.h (MY_construct_extended_name_table): Define. + * coff-rs6000.c (rs6000coff_construct_extended_name_table): + Define. + * ieee.c (ieee_construct_extended_name_table): Define. + * libecoff.h (_bfd_ecoff_construct_extended_name_table): Define. + * oasys.c (oasys_construct_extended_name_table): Define. + + Fix the ELF linker to not require an interpreter if no dynamic + objects were seen, even when linking PIC code. + * libelf.h (ELF_LINK_HASH_NEEDS_PLT): Define. + (struct elf_link_hash_table): Add field dynamic_sections_created. + * elfcode.h (elf_link_record_dynamic_symbol): Create dynstr if it + doesn't already exist. + (elf_link_add_object_symbols): Create dynamic sections based on + dynamic_sections_created field, not dynobj field. Don't bother to + set dynobj. + (elf_link_create_dynamic_sections): If dynamic sections were + already created, don't do anything. If dynobj is already set, use + it; otherwise, set it to the bfd argument. Don't initialize + dynsymcount. Only create dynstr if it does not exist. Set + dynamic_sections_created to true. + (NAME(bfd_elf,size_dynamic_sections)): Skip most of this function + if no dynamic objects were seen. + (elf_adjust_dynamic_symbol): If a symbol has the + ELF_LINK_HASH_NEEDS_PLT flag set, let the backend adjust it. + (elf_bfd_final_link): Change most decisions based on dynobj to + check dynamic_sections_created instead. + (elf_link_output_extsym): Only handle dynamic symbols if a dynamic + object was seen. + * elf.c (_bfd_elf_link_hash_table_init): Initialize new field + dynamic_sections_created. Set dynsymcount to 1, not 0. + * elf32-i386.c (elf_i386_create_dynamic_sections): Call + elf_i386_create_got_section rather than creating the .got and + .got.plt sections. + (elf_i386_create_got_section): New static function. + (elf_i386_check_relocs): Just call elf_i386_create_got_section if + a GOT table is needed, not bfd_elf32_link_create_dynamic_sections. + Only create the .rel.got section, and only make space for a reloc, + for a global symbol or when generating a shared object. For a + R_386_PLT32 reloc, just set the ELF_LINK_HASH_NEEDS_PLT flag. + (elf_i386_adjust_dynamic_symbol): Rework initial assertion to + permit ELF_LINK_HASH_NEEDS_PLT non dynamic symbols. Create a + procedure linkage table entry for such symbols. But, if no + dynamic objects were seen, never create a PLT entry. + (elf_i386_size_dynamic_sections): If no dynamic objects were seen, + skip most of this function, and force the size of the .rel.got + section to zero. + (elf_i386_relocate_section): For a R_386_GOT32 reloc against a global + symbol when no dynamic object was seen, initialize the contents of + the .got section. For a R_386_GOT32 against a local symbol, only + create a R_386_RELATIVE reloc when generating a shared object. + Treat a R_386_PLT32 reloc against a symbol for which we did not + create a PLT entry as a R_386_PC32 reloc. + (elf_i386_finish_dynamic_sections): Only fiddle with the dynamic + entries and the PLT if we saw a dynamic object. + * elf32-sparc.c (elf_sparc_howto_table): Fix R_SPARC_PC22 by + setting rightshift to 10. Fix R_SPARC_WPLT20 by setting + rightshift to 2, size to 2, bitsize to 30, and dst_mask to + 0x3fffffff. + (elf32_sparc_create_dynamic_sections): Don't set the size of the + .plt section. Call elf32_sparc_create_got_section rather than + creating the .got section. + (elf32_sparc_check_relocs): Call elf32_sparc_create_got_section if + a GOT table is needed, not bfd_elf32_link_create_dynamic_sections. + Only create the .rela.got section, and only make space for a + reloc, for a global symbol or when generating a shared object. + Set the alignment of the .rela.got section to 2. For a + R_SPARC_WPLT30 reloc, just set the ELF_LINK_HASH_NEEDS_PLT flag. + (elf32_sparc_adjust_dynamic_symbol): Rework initial assertion to + permit ELF_LINK_HASH_NEDS_PLT non dynamic symbols. Create a + procedure linkage table for such symbols. But, if no dynamic + objects were seen, never create a PLT entry. Initialize the size + of the .plt section. + (elf32_sparc_size_dynamic_sections): If no dynamic objects were + seen, skip most of this function, and force the size of the + .rela.got section to zero. Strip empty reloc sections, and strip + an empty .plt section. + (elf32_sparc_relocate_section): For a GOT reloc against a global + symbol when no dynamic object was seen, initialize the contents of + the .got section. For a GOT reloc against a local symbol, only + create a R_SPARC_RELATIVE reloc when generating a shared object. + Treat a R_SPARC_WPLT30 reloc against a symbol for which we did not + create a PLT entry as a R_SPARC_WDISP30 reloc. + (elf32_sparc_finish_dynamic_sections): Only fiddle with the + dynamic entries and the PLT if we saw a dynamic object. + +Thu Oct 20 13:28:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_map_symbols): Don't worry about section symbols + in a section not owned by any BFD. + (elf_section_from_bfd_section): Separate out loop which calls + backend routine. Check bfd_section and call the backend routine + even for a section not owned by any BFD. + * elf32-mips.c (mips_elf_section_from_bfd_section): Handle + .acommon section. + +Wed Oct 19 13:28:29 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * coffgen.c (coff_print_symbol): Make names for section number and + storage class slightly more verbose. It's not clear how many + characters I can justify using up, but before this change they + both were abbreviated "sc" which is (IMHO) clearly unacceptable. + +Wed Oct 19 01:26:39 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * binary.c (binary_set_section_contents): Set the base file + position from the lowest section VMA, not the start address. + + * aoutx.h (NAME(aout,slurp_symbol_table)): Don't return an error + if there are no symbols. + * coffgen.c (coff_get_normalized_symtab): Likewise. + * hp300hpux.c (MY(slurp_symbol_table)): Likewise. + +Tue Oct 18 12:56:43 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * aout-target.h (MY_bfd_copy_private_section_data): Only copy + subformat to another bfd_target_aout_flavour file. + + * binary.c: New file for raw binary output format. + * Makefile.in (BFD_LIBS): Add binary.o. + (CFILES): Add binary.c. + * targets.c (binary_vec): Declare. + (bfd_target_vector): Include binary_vec. + + * srec.c (tdata_type): Add field tail. + (srec_mkobject): Initialize tail. + (srec_set_section_contents): Sort S record list by address. + +Mon Oct 17 11:38:16 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * elfcode.h (elf_map_symbols): Sort the symbols into a new array, + rather than messing with Elf_Sym_Extra. Store the symbol index in + the udata.i field. + (swap_out_syms): Use outbound_syms as a pointer rather than as an + array. Don't worry about elf_sym_num. + * libelf.h (struct elf_sym_extra): Don't define. + (Elf_Sym_Extra): Don't define. + (struct elf_obj_tdata): Remove sym_extra field. + (elf_sym_extra): Don't define. + * elf32-hppa.c (elf32_hppa_backend_final_write_processing): Use + udata.i rather than elf_sym_extra array. + + * syms.c (asymbol): Change udata field into a union. + * bfd-in2.h: Rebuild. + * aoutx.h (NAME(aout,translate_symbol_table)): Use udata.p rather + than just udata. + * bout.c (perform_slip): Likewise. + * hp300hpux.c (MY(slurp_symbol_table)): Likewise. + * ieee.c (ieee_slurp_external_symbols): Likewise. + * linker.c (generic_link_add_symbol_list): Likewise. + (default_indirect_link_order): Likewise. + * oasys.c (oasys_slurp_symbol_table): Likewise. + * reloc16.c (bfd_perform_slip): Likewise. + * srec.c (fillup_symbols): Likewise. + * coffcode.h (get_index): Use udata.i rather than just udata. + (coff_slurp_symbol_table): Likewise. + * coffgen.c (set_index): Likewise. + * ecoff.c (ecoff_set_symbol_info): Likewise. + * elfcode.h (elf_symbol_from_bfd_symbol): Likewise. + * libecoff.h (ecoff_get_sym_index, ecoff_set_sym_index): Likewise. + * som.c (compare_syms): Likewise. + (som_prep_for_fixups): Likewise. + (som_write_fixups): Likewise. + + Use a hash table when writing out ELF symbol names. + * elfcode.h (elf_stringtab_init): New static function. + (bfd_new_strtab, bfd_add_to_strtab, bfd_add_2_to_strtab): Remove. + Change all callers to use elf_stringtab_init or + _bfd_stringtab_add, and get stringtab lengths using + _bfd_stringtab_size. + (elf_fake_sections): Change ignored argument to pointer to + boolean, and set the boolean to true if an error occurs. If an + error has already occurred, don't do anything. + (assign_section_numbers): Just set sh_size, not contents. + (elf_compute_section_file_positions): Pass the address of a + boolean to elf_fake_sections. Pass the address of a + bfd_strtab_hash to swap_out_syms. Write out the .strtab section. + (prep_headers): Change shstrtab to bfd_strtab_hash. + (swap_out_syms): Take a pointer to a bfd_strtab_hash as an + argument. Set it to the symbol names. + (NAME(bfd_elf,write_object_contents)): Write out the section + header names using _bfd_stringtab_emit. + (elf_debug_section): Remove first argument; get the section name + via the bfd_section pointer. Change caller. + (elf_bfd_final_link): Write out the symbol names using + _bfd_stringtab_emit. Likewise for the .dynstr section contents. + Free the symbol names at the end of the function. + (elf_link_input_bfd): Remove the last argument, output_names, + from relocate_section. Save the old symbol contents before + calling elf_link_output_sym, and restore them afterward. + * libelf.h (struct elf_link_hash_table): Change dynstr field to + struct bfd_strtab_hash. + (struct elf_backend_data): Remove last argument, output_names, + from elf_backend_relocate_section field. + (struct strtab): Don't define. + (struct elf_obj_tdata): Change strtab_ptr field to struct + bfd_strtab_hash. + * elf32-hppa.c (elf32_hppa_relocate_section): Remove last + argument, output_names. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-mips.c (mips_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + + * libbfd-in.h (DEFAULT_STRING_SPACE_SIZE): Don't define. + (bfd_add_to_string_table): Don't declare. + * libbfd.h: Rebuild. + * libbfd.c (bfd_add_to_string_table): Remove. + + * elfcode.h (elf_swap_shdr_in): Use bfd_section, not rawdata. + Clear contents field. + (bfd_section_from_shdr): In SHT_STRTAB case, check bfd_section, + not rawdata. Don't set rawdata if e_shstrndx. Use bfd_section + rather than rawdata in commented out code. In SHT_REL[A] case, + don't bother to check elf_section_data of section returned by + section_from_elf_index. + (elf_fake_sections): Set bfd_section, not rawdata. Don't set + size. + (elf_map_symbols): Don't set elf_num_section_syms. Don't create + section symbols that already exist. + (assign_file_position_for_section): Use bfd_section, not rawdata. + (section_from_elf_index): Just check bfd_section field. + (elf_section_from_bfd_section): Likewise. + (elf_debug_section): Don't print rawdata, contents, or size. + (elf_link_add_object_symbols): Don't error out if + section_from_elf_index returns NULL. + (elf_bfd_final_link): Check return value from + section_from_elf_index against NULL, not bfd_is_abs_section. + (elf_link_input_bfd): Don't check section_from_elf_index return + value. + * libelf.h (struct elf_obj_tdata): Remove num_section_syms field. + (elf_num_section_syms): Don't define. + * elf.c (elf_get_str_section): Store section contents in contents + field rather than rawdata field. + (elf_string_from_elf_section): Likewise. + (_bfd_elf_make_section_from_shdr): Store BFD section pointer in + bfd_section field rather than rawdata field. + * elf32-hppa.c (elf32_hppa_read_symext_info): Use bfd_section + rather than rawdata. + (elf32_hppa_size_stubs): Likewise. + (elf32_hppa_backend_symbol_table_processing): Don't set + symextn_hdr->size; just use sh_size. + * elf32-mips.c (mips_elf_final_write_processing): Use bfd_section + rathern than rawdata. + (mips_elf_section_from_shdr): Likewise. + (mips_elf_section_processing): Likewise. + (mips_elf_section_from_bfd_section): Remove rawdata check. + + * srec.c (pass_over): Set the start address for S7, S8 or S9. + +Fri Oct 14 19:15:46 1994 Ken Raeburn <raeburn@cujo.cygnus.com> + + * VERSION: Updated to 2.5. + +Fri Oct 14 11:07:50 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * bfd.c (bfd_scan_vma): Cast end to be non const before passing it + to strtoul. + +Thu Oct 13 14:40:41 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * bfd.c (bfd_scan_vma): Pass end argument on to strtoul. + +Wed Oct 12 16:46:43 1994 Ken Raeburn <raeburn@cujo.cygnus.com> + + * opncls.c (bfd_realloc): Deleted, since it's broken and fixing it + would make it slow. Besides, it isn't used much. + * elfcode.h (elf_map_symbols): Always allocate new storage for the + symbol table. + +Wed Oct 12 11:54:37 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * ecoff.c (ecoff_set_symbol_info): Mark local stProc, stLabel or + stabs symbols as BSF_DEBUGGING. + + * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Make + str1 and str2 const pointers. + + * Makefile.in (INSTALL): Use top level install.sh script. + * config/README (INSTALL): Remove. + * config/delta88.mh (INSTALL): Remove. + * config/i386v4.mh (INSTALL): Remove. + * config/irix4.mh (INSTALL): Remove. + * config/irix5.mh (INSTALL): Remove. + * config/ncrt3000.mh (INSTALL): Remove. + +Tue Oct 11 13:57:56 1994 Eric Youngdale (eric@andante.aib.com) + + * elf32-i386.c (elf_i386_check_relocs): Make sure that a symbol + with a global offset table entry or a procedure linkage table + entry is added to the dynamic symbol table. + * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): If a symbol has + already gotten a procedure linkage table entry, change the + definition to the PLT entry. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + +Tue Oct 11 17:12:00 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * lynx-core.c (lynx_core_file_p): SPARC Lynx appears to start + dumping the .data section in a core file at a page boundary. + +Mon Oct 10 16:24:44 1994 Ken Raeburn <raeburn@cujo.cygnus.com> + + * cofflink.c (_bfd_coff_final_link): Cast argument to bfd_h_put_32 + to correct type. + (coff_read_string_table): Cast argument to bfd_h_get_32 to correct + type. + * elfcode.h (elf_link_output_extsym): Cast argument to + bfd_elf_hash to correct type. + + * elf32-sparc.c (elf_sparc_howto_table): The PC10, PC22, and + WPLT30 relocations are PC-relative. + +Thu Oct 6 12:57:26 1994 Richard Earnshaw (rwe@pegasus.esprit.ec.org) + + * aoutx.h (adjust_o_magic): Correctly initialize vma if the vma of + the text section was user-defined. + +Wed Oct 5 14:42:12 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * archive.c (bfd_construct_extended_name_table): SVR4 uses slash + newline at the end of the file name, not just newline. + +Tue Oct 4 11:23:12 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * ecoff.c (_bfd_ecoff_new_section_hook): Default section alignment + power to 4, rather than using align_power_min. + + * coffcode.h (coff_new_section_hook): Don't use align_power_min; + use COFF_DEFAULT_SECTION_ALIGNMENT_POWER instead. Force the .stab + and .stabstr sections to be aligned to no more than 2. Remove + COFF_SPARC special cases. + * coff-a29k.c: Define COFF_DEFAULT_SECTION_ALIGNMENT_POWER. + * coff-apollo.c, coff-go32.c, coff-h8300.c: Likewise. + * coff-h8500.c, coff-i386.c, coff-i960.c, coff-m68k.c: Likewise. + * coff-m88k.c, coff-rs6000.c, coff-sh.c, coff-sparc.c: Likewise. + * coff-we32k.c, coff-z8k.c: Likewise. + + * configure.in: Use ${config_shell} when running config.bfd. + + * cofflink.c (coff_link_input_bfd): Don't try to convert a long + filename if the offset field is zero. + + * elfcode.h (swap_out_syms): If the alignment of a common symbol + was not set, use a sensible default rather than zero. + +Mon Oct 3 16:04:29 1994 H.J. Lu (hjl@nynexst.com) + + * opncls.c (bfd_close): Honor umask when setting execution bits. + (bfd_close_all_done): Likewise. + +Mon Oct 3 04:41:49 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * rs6000-core.c (rs6000coff_core_p): Set SEC_HAS_CONTENTS flag + for .stack and .ldinfo sections. Cast coredata.c_tab to a + file_ptr to avoid warnings from gcc. + +Fri Sep 30 13:11:38 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * elfcode.h (elf_bfd_final_link): Remove assertion when a non + SEC_IN_MEMORY section is found in dynobj. This can happen when + linking PIC compiled code. + +Thu Sep 29 15:21:44 1994 Ken Raeburn <raeburn@cujo.cygnus.com> + + * reloc.c (bfd_install_relocation): Change type of "data" to + bfd_byte *, to go along with yesterday's change. + + * elf.c (bfd_elf_print_symbol): Moved here from elf_print_symbol + in elfcode.h. (case bfd_print_symbol_all): Print symbol's size + field, except for common symbols; print their alignment. + * elfcode.h (elf_print_symbol): Deleted. + * libelf.h (bfd_elf_print_symbol): Declare. + (bfd_elf{32,64}_print_symbol): Replace declarations with macros. + + * syms.c (bfd_print_symbol_vandf): Show BSF_LOCAL and BSF_GLOBAL + in one column. Use the column freed up to show BSF_FUNCTION and + BSF_FILE. + +Thu Sep 29 12:29:01 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * syms.c (stt): Add .rdata and .rodata. + +Wed Sep 28 13:35:05 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * reloc.c (bfd_install_relocation): Cast data_start to bfd_byte * + before trying to add values to it. + +Tue Sep 27 16:47:58 1994 Ken Raeburn <raeburn@cujo.cygnus.com> + + * elf32-hppa.c (elf32_hppa_backend_final_write_processing): Cast + return value from elf_sym_extra. + (elf32_hppa_build_stubs): Cast return value from bfd_zalloc. + (elf32_hppa_size_stubs): Cast return value from malloc. + + * gen-aout.c (main): Declare and initialize "arch". + + * cofflink.c (coff_link_add_symbols): Cast return value of + bfd_hash_allocate. + + * riscix.c (riscix_callback): Use PARAMS macro in prototype. + + * reloc.c (bfd_install_relocation): New function, mostly copied + from bfd_perform_relocation, adjusted for the assembler's needs. + * bfd-in2.h: Regenerated. + +Mon Sep 26 11:00:14 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (assign_file_positions_except_relocs): Align the + section VMA and the file position even if D_PAGED is not set. + + * bfd-in.h (bfd_seek): Change declaration to not mark fp const. + * bfd-in2.h: Rebuild. + * libbfd.c (bfd_seek): Don't mark parameters const, to avoid + conflicts with declaration. + +Fri Sep 23 15:15:31 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (map_program_segments): Don't abort if we allocated + too much space for the program header, only if we allocated too + little. + (assign_file_positions_except_relocs): Similar change. + +Tue Sep 20 13:17:07 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * libaout.h: Fix comment. + * ns32knbsd.h: Changed M_NS32K_NETBSD to M_532_NETBSD to match + libaout.h. + +Tue Sep 20 15:23:21 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * Makefile.in: Rebuilt dependencies. + (BFD32_BACKENDS): Add sparcnetbsd.o. + (CFILES): Add ns32knetbsd.c and sparcnetbsd.c. + * targets.c: ns32knetbsd_vec was renamed to pc532netbsd_vec. + + * coff-sh.c (rtype2howto): Remove; unused. + (coff_sh_relocate_section): Remove unused local variable rstat. + (reloc_processing): Comment out; unused. + +Fri Sep 16 12:12:27 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * aoutx.h (aout_link_write_other_symbol): If h->indx is -2, then + always write it out even if it would normally be stripped. + (aout_link_input_section_std): If we find a reloc against a + stripped global symbol, force it to be written out rather than + merely calling unattached_reloc. + (aout_link_input_section_ext): Likewise. + (aout_link_reloc_link_order): Likewise. + +Wed Sep 14 15:37:19 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.h (struct somdata): New field sorted_syms. + (obj_som_sorted_syms): Accessor macro. + * som.c (som_object_setup): Initialize sorted_syms to NULL. + (som_prep_for_fixups): Sort a copy of the BFD's symbol table; + store the sorted symbol table in sorted_syms. + (som_write_fixups): Initalize tmp_reloc to NULL to make GCC happy. + (som_begin_writing): Similarly for exec_header. Pass the sorted + symbol table to som_write_symbol_strings. + (som_build_and_write_symbol_table): Use the sorted symbols rather + than the canonical symbol table. + + * som.h (som_symbol_type): Add "stringtab_offset" field. + * som.c (som_write_symbol_strings): Use "stringtab_offset" + rather than destroying the "name" field in the BFD symbol. + (som_build_and_write_symbol_table): Likewise. + +Wed Sep 14 15:06:55 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * aoutx.h (aout_link_write_symbols): Rename skip_indirect to + skip_next. If we find an N_WARNING symbol which has already been + written out, set skip_next. + + * libecoff.h (struct ecoff_tdata): Add field find_buffer. + * ecoff.c: Include aout/stab_gnu.h. + (ecoff_find_nearest_line): Handle stabs debugging information. + + * elfcode.h (elf_link_output_extsym): Keep a symbol marked as weak + even if it is referenced by another object. + +Tue Sep 13 17:57:00 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_fixup_formats): Case R_ENTRY (0xb3), set both + 'T' and 'U' to grab all the unwind information. + (som_set_reloc_info): Make 'U' unwind bits persist across + multiple SOM relocations. Set the addend field of an R_ENTRY + relocation to the value in 'T'; set the addend field on an + R_EXIT relocation to the value in 'U'. + + * som.h (som_symbol_type): Delete unwind field. + + * som.c (som_write_fixups): For R_ENTRY fixups, get 32bits of + unwind information from the addend field of the R_ENTRY, get the + other 32bits from the addend field of the R_EXIT. + (bfd_som_attach_unwind_info): Delete function and all references. + + * som.h (som_symbol_type): Delete unused a.out-related fields. + + * som.c (bfd_section_from_som_symbol): Use bfd_abs_section_ptr + instead of &bfd_abs_section. + + * som.c (som_object_setup): Handle exec_entry and exec_flags being + switched in executables created by the OSF1 linker. + (som_write_fixups): Handle R_EXIT just like the R_{F,L,R}SEL + fixups. Support R_ALT_ENTRY (handle just like R_EXIT). + +Tue Sep 13 16:04:07 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * cofflink.c (coff_link_input_bfd): syment_base is unsigned + so can't compare -ve numbers with it. + +Mon Sep 12 20:31:17 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * configure.in (shcoff_vec): Use cofflink.o now. + * coff-sh.c: Rewritten to use new fast coff backend. + +Tue Sep 13 16:23:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * aoutx.h (NAME(aout,final_link)): Don't assume that all the input + files are a.out. + +Tue Sep 13 11:09:39 1994 J.T. Conklin (jtc@rtl.cygnus.com) + + * configure.host (sparc-*-netbsd): use sparcnbsd. + (ns32k-*-netbsd): use ns32knbsd. + + * hosts/{nbsd,i386nbsd,ns32knbsd,sparcnbsd}.h: New files, NetBSD + host support. + + * sparcnetbsd.c: New file, adds support for NetBSD/sparc. + * config/sparc-nbsd.mt: Likewise. + + * netbsd.h: New file, definitions common to all netbsd ports. + * i386netbsd.c: Use it. + * ns32knetbsd.c: Use it. + + * Makefile.in, configure.in, targets.c, config/i386-nbsd.mt, + config/ns32k-nbsd.mt: canonicalize netbsd targets to conform to + file/variable naming conventions. + * i386netbsd.c: New file, renamed from netbsd386.c. + * ns32knetbsd.c: New file, renamed from netbsd532.c. + +Mon Sep 12 21:56:20 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_reloc_skip): Correct off-by-one error for 4-byte + R_NO_RELOCATION fixups. + (bfd_section_from_som_symbol): Return the absolute section if the + symbol isn't contained in any section in the output file. + (som_slurp_symbol_table): ST_PRI_PROG and ST_SEC_PROG symbols are + not function symbols (they are magic code labels which *can* be the + targets of cross space branches). $START$ is not a section symbol. + +Mon Sep 12 11:43:08 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coff-alpha.c (ecoffalpha_little_vec): Add SEC_CODE and SEC_DATA + to section_flags. + * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise. + + * elfcode.h (swap_out_syms): Set the type of an undefined symbol + to STT_FUNC if the BSF_FUNCTION flag is set. + + * cofflink.c (coff_link_input_bfd): If r_symndx is -1, don't + change it. + (_bfd_coff_generic_relocate_section): If r_symndx is -1, it is an + absolute reloc. Don't dump core using r_symndx as an array index. + * cf-m68klynx.c (coff_bfd_link_add_symbols): Define. + (lynx_link_add_symbols): New static function (copy of function in + coff-i386.c). + (coff_m68k_lynxrtype_to_howto): sym argument may be NULL. + * coff-i386.c (coff_i386_rtype_to_howto): Likewise. + * coff-a29k.c (coff_a29k_relocate_section): Handle an r_symndx + value of -1, meaning an absolute reloc. + + * ctor.c: Remove; obsolete. + * Makefile.in: Rebuild dependencies. + (BFD_LIBS): Remove ctor.o. + (CFILES): Remove ctor.c. + * libbfd.h: Rebuild. + +Mon Sep 12 01:58:47 1994 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (elf32_hppa_relocate_section): If there was a link + error of some sort (for example, undefined symbols), then do not + apply any relocs, just notify the user of the errors. + (elf32_hppa_backend_begin_write_processing): Do not build a symbol + extension section for an executable (it's useless). + (elf32_hppa_link_output_symbol_hook): Do nothing if there was a + link error of some sort (for example, undefined symbols). + (elf32_hppa_read_symext_info): Kludge. Turn off SEC_HAS_CONTENTS + for all the input symbol extension sections to keep the generic + BFD code happy. Temporarily turn it on to read the contents of + the symbol extension section. + +Sun Sep 11 21:58:59 1994 Jeff Law (law@snake.cs.utah.edu) + + * config/hppaosf.mh (RANLIB): Do not set. + * config/hppabsd.mh (RANLIB): Likewise. + +Sun Sep 11 22:50:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * cf-i386lynx.c: Remove #if 0 code. + (i386_lynxos_coff_object_p): Remove unused function. + (coff_bfd_link_add_symbols): Define. + (lynx_link_add_symbols): New static function. + * coffcode.h (coff_bfd_link_hash_table_create): If + coff_relocate_section is defined, only define this if not already + defined. + (coff_bfd_link_add_symbols, coff_bfd_final_link): Likewise. + + * linker.c (_bfd_generic_final_link): Handle + bfd_indirect_link_order explicitly, rather than via + _bfd_default_link_order. + (set_symbol_from_hash): New static function, broken out of + _bfd_generic_link_write_global_symbol. + (_bfd_generic_link_write_global_symbol): Symbol setting code moved + to set_symbol_from_hash; call it. + (default_indirect_link_order): Add generic_linker argument. + Change all callers. If false, set the generic symbols based on + the hash table entries. + +Fri Sep 9 11:51:49 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coffgen.c (coff_get_symtab): Reindented. Removed commented out + call to bfd_constructor_entry. + + Convert m68k COFF to use new COFF backend linker. + * coff-m68k.c (coff_relocate_section): Define. + * cf-m68klynx.c (coff_rtype_to_howto): Define. + (coff_m68k_lynx_rtype_to_howto): New static function. + * configure.in (m68kcoff_vec): Build cofflink.o. + (m68kcoffun_vec, m68klynx_coff_vec): Likewise. + +Thu Sep 8 16:20:38 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * coff-h8300.c (h8300_reloc16_extra_cases, case RELBYTE): Flag + overflows correctly. + +Wed Sep 7 19:01:42 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * libelf.h (struct elf_backend_data): Change second argument of + elf_backend_final_write_processing hook to boolean. + (struct elf_obj_tdata): Add linker field. + * elfcode.h (NAME(bfd_elf,write_object_contents)): Pass value of + tdata linker field to final_write_processing, rather than NULL. + (elf_bfd_final_link): Don't call final_write_processing hook. Set + tdata linker field to true. + * elf32-mips.c (mips_elf_final_write_processing): Change type of + second argument to boolean. + * elf32-hppa.c (elf32_hppa_backend_final_write_processing): + Likewise. + + * coff-go32.c (RTYPE2HOWTO): Fully parenthesize arguments. + * coff-i960.c (RTYPE2HOWTO): Likewise. + * coff-m88k.c (RTYPE2HOWTO): Likewise. + * coff-we32k.c (RTYPE2HOWTO): Likewise. + + Make i386 COFF use new COFF backend linker. + * coff-i386.c (RTYPE2HOWTO): Fully parenthesize arguments. + (coff_relocate_section): Define. + (coff_i386_rtype_to_howto): New function. + * configure.in (i386coff_vec): Use cofflink.o. + (i386lynx_coff_vec): Likewise. + + * coffcode.h (bfd_coff_backend_data): Add new field + _bfd_coff_rtype_to_howto. + (bfd_coff_rtype_to_howto): Define. + (coff_rtype_to_howto): Define to use RTYPE2HOWTO, if not already + defined. + (bfd_coff_std_swap_table): Initialize new field. + * cofflink.c (_bfd_coff_final_link): Allocate section_count + 1 + section_info structures, since the target_index is 1 based. + (coff_link_input_bfd): Set *secpp to bfd_com_section_ptr for a + common symbol. Adjust rel_hash by the output reloc count. + (_bfd_coff_generic_relocate_section): New function. + * libcoff-in.h (_bfd_coff_generic_relocate_section): Declare. + * libcoff.h: Rebuild. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + +Tue Sep 6 23:28:52 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_derive_misc_symbol_info): Treat undefined code + symbols and undefined symbols which no type in the same manner + if the associated BFD symbol has BSF_FUNCTION set. For a defined + symbol which no type, select a SOM type based on the flags of the + section containing the symbol. + (som_slurp_symbol_type): Set BSF_FUNCTION for undefined ST_STUB + or ST_CODE symbols (importing a non-function code symbol is + meaningless in SOM). + (som_set_reloc_info): Don't set "offset" to the section's vma; it + should always start at zero. + +Tue Sep 6 14:51:11 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + Add new style linker support to COFF backend. a29k only for now. + * cofflink.c: New file. + * libcoff-in.h: Include bfdlink.h. + (obj_coff_external_syms, obj_coff_strings): Define accessor macro. + (obj_coff_sym_hashes): Define accessor macro. + (struct coff_tdata): Add fields external_syms, strings, and + sym_hashes. + (struct coff_link_hash_entry): Define. + (struct coff_link_hash_table): Define. + (coff_link_hash_lookup, coff_link_hash_traverse): Define. + (coff_hash_table): Define. + (_bfd_coff_link_hash_table_create): Declare. + (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. + * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, + _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, + _bfd_coff_compute_section_file_positions, + _bfd_coff_relocate_section. + (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. + (bfd_coff_sym_is_global): Define. + (bfd_coff_compute_section_file_positions): Define. + (bfd_coff_relocate_section): Define. + (coff_mkobject_hook): Initialize obj_raw_syment_count and + obj_conv_table_size. + (coff_compute_section_file_positions): Set target_index of all + sections. Set output_has_begun field. + (coff_write_object_contents): Don't set target_index; now done by + coff_compute_section_file_positions. Remove obsolete handling of + scn_base and data_base. Don't bother to check that target_index + is positive, since it always is. Remove use of pad, which is + always zero. Check obj_raw_syment_count, not bfd_get_symcount, + for the number of symbols, but only write them out if + bfd_get_symcount is non-zero. Don't check obj_raw_syment_count + until after coff_write_symbols is called. + (coff_slurp_symbol_table): Use obj_raw_syment_count, not + bfd_get_symcount for the number of symbols. Don't set + obj_conv_table_size. + (coff_sym_is_global): New static function or macro. + (coff_slurp_reloc_table): Call coff_swap_reloc_in, not + bfd_swap_reloc_in. + (coff_bfd_link_hash_table_create): If coff_relocate_section is + defined, define as _bfd_coff_link_hash_table_create. + (coff_bfd_link_add_symbols): Similar change. + (coff_bfd_final_link): Similar change. + (coff_relocate_section): Define as NULL if not defined. + (bfd_coff_std_swap_table): Initialize new fields. + * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count + and obj_conv_table_size here. + (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, + add up the line numbers from the sections. + (coff_write_symbols): Set obj_raw_syment_count, not + bfd_get_symcount. + (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx + field. + (coff_get_normalized_symtab): Use obj_raw_syment_count, not + bfd_get_symcount. + (coff_print_symbol): If auxp->fix_end, print x_endndx value. + * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. + Reindent. Change argument type to PTR. + * coff-a29k.c (coff_a29k_relocate_section): New static function. + (coff_relocate_section): Define. + * configure.in (a29kcoff_big_vec): Compile cofflink.o. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * libcoff.h: Rebuilt. + * Makefile.in: Rebuilt dependencies. + (BFD32_BACKENDS): Add cofflink.o. + (CFILES): Add cofflink.c. + +Tue Sep 6 14:00:45 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * coffgen.c (coff_print_symbol, case bfd_symbol_print_all): Check + for section symbol, and print its aux fields with appropriate + labels. + + * Makefile.in (ALL_MACHINES): Added cpu-arm.o. + +Sun Sep 04 17:58:10 1994 Richard Earnshaw (rwe@pegasus.esprit.ec.org) + + * aoutx.h (NAME(aout,machine_type)): Recognize the ARM processor. + * archures.c, config.bfd, configure.host, libaout.h, reloc.c, + targets.c: Add support for the ARM. + * cpu-arm.c, riscix.c, config/riscix.mh, config/riscix.mt: New files. + + * aoutx.h (add_to_stringtable): Check that str isn't a NULL pointer. + +Fri Sep 2 14:10:30 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * reloc.c (enum bfd_reloc_code_real): Rewrote definition to use + new "chew" commands for simultaneous definition of enumerator and + enumerator name table. + (bfd_get_reloc_code_name): New function, for retrieving a symbolic + name associated with an enumerator. + * libbfd.h, bfd-in2.h: Regenerated. + +Tue Aug 30 21:24:54 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_write_fixups, case R_ENTRY): Handle case where no + unwind descriptor information is available. + +Tue Aug 30 11:43:30 1994 Eric Youngdale (ericy@cais.cais.com) + + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add soname + argument, and use it to set DT_SONAME dynamic entry. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype. + (bfd_elf64_size_dynamic_sections): Update prototype. + * bfd-in2.h: Rebuilt. + +Fri Aug 26 15:47:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coffgen.c (coff_real_object_p): Set obj_raw_syment_count. + (coff_get_normalized_symtab): Verify obj_raw_syment_count, rather + than setting it. + +Thu Aug 25 10:44:53 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * archive.c (bsd_write_armap): Remove host dependencies. + + * aoutx.h (add_to_stringtab): Check for _bfd_stringtab_add error + before adding BYTES_IN_WORD. + + * coffgen.c (coff_find_nearest_line): Look for the best C_FILE, + not merely the first. + + * coffgen.c (coff_write_alien_symbol): If we are not using the + symbol, clear the name so that it is not put in the string table. + From Antti.Miettinen@ntc.nokia.com. + +Wed Aug 24 11:49:19 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coffgen.c (coff_print_symbol): Cast pointer different to long + and use %ld to print it. + * osf-core.c (osf_core_core_file_p): Remove unused variable + dseccnt. + * ecoffswap.h (ecoff_swap_ext_out): If ECOFF_64, clear remaining + bytes in bits2. + + * configure.host, config.bfd: Change i[34]86 to i[345]86. + * coffgen.c (coff_real_object_p): Set obj_conv_table_size here, + rather than waiting until coff_slurp_symbol_table. + (coff_write_alien_symbol): Just ignore BSF_DEBUGGING symbols. + From Antti.Miettinen@ntc.nokia.com. + + * section.c (bfd_make_section_anyway): Fix failure check of + bfd_make_empty_symbol. From Antti.Miettinen@ntc.nokia.com. + + * aoutx.h (translate_to_native_sym_flags): Use the output_section + (and output_offset) if there is one. + + * aoutx.h (aout_link_check_archive_element): Discard the symbols + if the archive element was not needed. + + * aoutx.h (aout_get_external_symbols): Ensure that a zero string + index yields an empty string. + (aout_link_write_symbols): If info->keep_memory is false, use name + from original hash table entry, not from entry in *sym_hash. + + * aoutx.h (struct aout_final_link_info): Add fields contents, + relocs, symbol_map and output_syms. + (NAME(aout,final_link)): Work out the largest section size, reloc + size, and number of symbols. Use them to preallocate buffers that + are large enough for all cases. + (aout_link_input_bfd): Use preallocated symbol_map. + (aout_link_write_symbols): Remove symbol_map argument; use + preallocated symbol_map instead. Change all callers. Use + preallocated output_syms. + (aout_link_input_section): Remove symbol_map argument. Change all + callers. Use preallocated contents and relocs. + (aout_link_input_section_std): Remove symbol_map argument; use + preallocated symbol_map instead. Change all callers. + (aout_link_input_section_ext): Likewise. + +Tue Aug 23 10:51:09 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * archive.c (_bfd_write_archive_contents): Don't update the + symbol map timestamp if there is no symbol map. From + schwab@issan.informatik.uni-dortmund.de (Andreas Schwab). + +Mon Aug 22 12:26:42 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add _update_armap_timestamp. + (bfd_target): Add field _bfd_update_armap_timestamp. + * bfd.c (bfd_update_armap_timestamp): Define. + * bfd-in2.h: Rebuilt. + * libbfd-in.h (_bfd_noarchive_update_armap_timestamp): Define. + (_bfd_archive_bsd_update_armap_timestamp): Declare. + (_bfd_archive_coff_update_armap_timestamp): Define. + * libbfd.h: Rebuilt. + * archive.c (_bfd_write_archive_contents): Call + bfd_update_armap_timestamp instead of checking for a BSD archive + and calling bsd_update_armap_timestamp. + (_bfd_archive_bsd_update_armap_timestamp): Rename from + _bsd_update_armap_timestamp. Don't assume that armap_datepos is + already set. + * aout-target.h (MY_update_armap_timestamp): Define if not already + defined. + * coff-rs6000.c (rs6000coff_update_armap_timestamp): Define. + * ieee.c (ieee_update_armap_timestamp): Define. + * libecoff.h (_bfd_ecoff_update_armap_timestamp): Define. + * oasys.c (oasys_update_armap_timestamp): Define. + * som.c (som_update_armap_timestamp): Define. + + * hash.c: Copy string hash functions from aoutx.h. + * aoutx.h: String hash functions moved to hash.c. Retain + simplified versions of add_to_stringtab and emit_stringtab. + Change all callers to use new function and structure names. + * libbfd-in.h (_bfd_stringtab_init, _bfd_stringtab_free): Declare. + (_bfd_stringtab_size, _bfd_stringtab_add): Declare. + (_bfd_stringtab_emit): Declare. + * libbfd.h: Rebuilt. + +Mon Aug 22 10:49:37 1994 Eric Youngdale (ericy@cais.cais.com) + + * i386linux.c (linux_add_one_symbol): Create a fixup for any + defined absolute symbol, not just GOT or PLT symbols. + (linux_tally_symbols): Correct handling of references to defined + symbols. + +Thu Aug 18 16:29:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + Get ld -x -r to handle a.out set symbols correctly. + * aoutx.h (adjust_o_magic): If the .bss VMA was set outside of + BFD, pad the .data section up to the VMA of the .bss section. + (aout_link_add_symbols): If a set symbol does not get modified, + treat it as a local symbol. + (aout_link_write_symbols): Set the value of set symbols + correctly. Don't discard set symbols even if discarding local + symbols. + (aout_link_write_other_symbol): Don't abort on bfd_link_hash_new, + since it can now happen for set symbols. + + * elfcode.h (elf_fake_sections): Just check for ".rela" and + ".rel", not ".rela." and ".rel."; make this work by checking + use_rela_p. + * elf32-i386.c (elf_i386_check_relocs): Just check for ".rel", not + ".rel." + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_check_relocs): Just check for + ".rela", not ".rela." + (elf32_sparc_size_dynamic_sections): Likewise. + (elf32_sparc_relocate_section): Likewise. + +Wed Aug 17 16:54:18 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * linker.c (_bfd_generic_link_add_archive_symbols): Initialize + PASS to the old value + 1. + + * coffgen.c (coff_get_normalized_symtab): If a C_FILE symbol has + no aux entries, use the symbol name as the file name. + (coff_find_nearest_line): Look for the right C_FILE symbol, rather + than always using the first one. If there is a debugging symbol + after a function symbol, skip it. Add the section VMA to the line + offset, since it was subtracted out in coff_slurp_line_table. + +Tue Aug 16 16:53:00 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_prep_headers): If writing some form of an executable, + allocate and attach an exec header to the BFD private data. + (som_begin_writing): Don't fill fields of the exec header based + on BFD private data here (like the exec flags). Do not write + the exec header here. + (som_write_headers): Instead do it here. + * som.h (struct somdata): New field "exec_hdr" for the executable + file header. + (obj_som_exec_hdr): New accessor macro. + +Tue Aug 16 00:12:31 1994 Eric Youngdale (ericy@cais.cais.com) + + * i386linux.c (linux_link_create_dynamic_sections): Create section + named .linux-dynamic, not .dynamic. + (linux_add_one_symbol): Use .linux-dynamic, not .dynamic. + (bfd_linux_size_dynamic_sections): Likewise. + (linux_finish_dynamic_link): Likewise. + +Mon Aug 15 12:16:56 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coffgen.c (STRING_SIZE_SIZE): Define. + (coff_fix_symbol_name): Use STRING_SIZE_SIZE, not 4. + (coff_write_symbols, build_string_table): Likewise. + (coff_get_normalized_symtab): Likewise. + + * libcoff-in.h (obj_symbol_slew): Don't define. + (struct coff_tdata): Remove unused fields index_slew, raw_linenos, + and flags. + * libcoff.h: Rebuilt. + * coffcode.h (coff_mkobject): Don't initialize raw_linenos. + (coff_mkobject_hook): Don't initialize flags. + + * aout-target.h (MY_zmagic_contiguous): Define as 0 if not already + defined. + (MY(backend_data)): Use MY_zmagic_contiguous, not hardcoded 0. + * i386linux.c (MY_zmagic_contiguous): Define. + + * elfcode.h (bfd_section_from_shdr): If a SHT_SYMTAB section in a + shared object has SHF_ALLOC set, create a BFD section for it. + (elf_section_from_bfd_section): There may be a BFD section for a + SHT_SYMTAB section. + + * coffcode.h (styp_to_sec_flags): Add name argument. If no flags + are recognized, chose section flags based on the name. + (bfd_coff_backend_data): _bfd_styp_to_sec_flags_hook field: Add + name argument. + (bfd_coff_styp_to_sec_flags_hook): Add name argument. + (coff_compute_section_file_positions): Don't adjust the section + position by COFF_PAGE_SIZE unless SEC_ALLOC is set. + * libcoff.h: Rebuilt. + * coffgen.c (make_a_section_from_file): Pass section name to + bfd_coff_styp_to_sec_flags_hook. + * ecoff.c (_bfd_ecoff_styp_to_sec_flags): Add unused name + argument. + * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Add name argument to + prototype. + +Fri Aug 12 11:22:40 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (section_from_elf_index): Correct check for invalid + section index. + + * elfcode.h (elf_link_add_object_symbols): If there is no symbol + table, try using the dynamic symbol table. From Eric Youngdale + <ericy@cais.cais.com>. + + * configure.host (sparc-*-solaris2*): Use solaris2, not sysv4. + The linker depends upon configuring for solaris2. + * hosts/solaris2.h: New file; include hosts/sysv4.h. + * config/solaris2.mh: New file; copy of config/sysv4.mh. + +Wed Aug 10 13:09:38 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * aoutx.h (adjust_z_magic): Make sure data section is padded to + page boundary when the VMA is set by the calling program. From + Eric Youngdale <ericy@cais.cais.com>. + +Mon Aug 8 17:18:49 1994 Stan Shebs (shebs@andros.cygnus.com) + + Update to ns32k support, from Ian Dall (dall@hfrd.dsto.gov.au). + * aout-ns32k.c: Add declarations that were in aout-ns32k.h, change + declarations to traditional form. + (MY_reloc_howto, MY_put_reloc): Change from macro to function. + (ns32k_relocate_contents): New function. + * aout-ns32k.h: Remove. + * cpu-ns32k.c: Add declarations that were in aout-ns32k.h, change + declarations to traditional form. + (ns32k_final_link_relocate): Call ns32k_relocate_contents. + * netbsd532.c: Reformat to standards, add copyright notice. + (ARCH): Don't define. + (aout-ns32k.h): Don't include. + * pc532-mach.c: Ditto. + +Mon Aug 8 17:55:52 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coff-i960.c (coff_i960_relocate): Don't try to convert relocs + against common symbols. + +Sat Aug 6 22:27:30 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * irix-core.c (irix_core_core_file_p): Ignore sections that + are not contained in the core file. + +Thu Aug 4 11:32:23 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coff-m68k.c (m68k_reloc_type_lookup): New function. + (coff_bfd_reloc_type_lookup): Define. + * cf-m68klynx.c (_bfd_m68kcoff_reloc_type_lookup): Define. + + * elfcode.h (elf_bfd_final_link): Force the vma of sections which + do not have SEC_ALLOC set to be 0. This is needed to handle + relocs against debugging sections. + +Wed Aug 3 16:45:41 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coff-i960.c (coff_i960_relocate): Rewrote to change relocs + against locally defined symbols into relocs against section + symbols, for VxWorks 5.1. + +Wed Aug 3 10:34:37 1994 Eric Youngdale (ericy@cais.cais.com) + + * i386linux.c (linux_add_one_symbol): Only handle + SHARABLE_CONFLICTS specially if BSF_CONSTRUCTOR is set. Set hashp + for a GOT or PLT symbol. Set jump field of fixup for a PLT symbol. + (linux_tally_symbols): Check section of real symbol. When looking + for a builtin fixup, check builtin and jump flags. Create no more + than one fixup, and always create one if the real symbol is in the + absolute section. Only strip absolute symbols. + +Wed Aug 3 05:08:24 1994 D. V. Henkel-Wallace (gumby@cygnus.com) + + * coffcode.h (coff_write_object_contents): set internal_a.magic to + LYNXCOFFMAGIC whenever 68k, SPARC or i386 LynxOS + (yes, they have the same magic number!) + +Tue Aug 2 10:43:21 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * hp300hpux.c (BMAGIC): Define as HPUX_DOT_O_MAGIC, to make test + in aoutx.h work correctly. + + * coff-i960.c (coff_i960_relocate): New function. + (howto_rellong, howto_iprmed): Use it as special_function. + + * libbfd-in.h: Move declarations of bfd_read, bfd_write, bfd_seek, + bfd_tell, bfd_flush, and bfd_stat from here... + * bfd-in.h: ...to here, to make them visible to programs which + know more about the object file format than BFD does. + * libbfd.h, bfd-in2.h: Rebuilt. + +Mon Aug 1 17:55:53 1994 Fred Fish (fnf@cygnus.com) + + * ptrace-core.c (ptrace_unix_core_file_p): Convert zalloc usage + to bfd_zalloc. + +Mon Aug 1 12:04:40 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elf64-sparc.c (ELF_MAXPAGESIZE): Define. + + ELF linker patches from Eric Youngdale <ericy@cais.cais.com>. + * elfcode.h (elf_link_create_dynamic_sections): Set type of + _DYNAMIC to STT_OBJECT. + (NAME(bfd_elf,record_link_assignment)): Always create hash table + entry. Set type to STT_OBJECT. + (elf_link_output_extsym): Don't set type of weak defined symbol to + STB_WEAK if symbol was referenced. + (map_program_segments): Check DYNAMIC as well as EXEC_P. + (assign_file_positions_except_relocs): Likewise. + * elf32-i386.c (elf_i386_create_dynamic_sections): Set type of + _GLOBAL_OFFSET_TABLE to STT_OBJECT. + (elf_i386_check_relocs): Ignore local PLT32 relocs. + (elf_i386_relocate_section): Treat local PLT32 relocs as PC32. + + * elfcode.h (elf_adjust_dynamic_symbol): Correct weak symbol + handling again. + + * elfcode.h (elf_slurp_reloc_table): Don't try to read the relocs + if there aren't any. + + * configure.host (sparc-*-solaris2*): Use sysv4, not solaris2. + * hosts/solaris2.h: Remove. + * config/solaris2.mh: Remove. + +Sun Jul 31 14:27:04 1994 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.c, elf32-hppa.h: Update comment reflecting which + HPPA ELF spec the code implements. + +Tue Jul 26 17:38:01 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * cpu-i960.c (MAX_ARCH): New macro. + (compatible): Use it in computing array bounds. Put comma after + last entry in array, for regularity. + (arch_info_struct): Adjust spacing for easier reading. + + * coff-i960.c (howto_rellong, howto_iprmed, howto_optcall): Use + HOWTO macro. + + * cpu-i960.c (JX): Define as bfd_mach_i960_jx. + (scan_960_mach): Recognize jx machine. + (MAX_ARCH): Define to be JX. + (compatible): Add JX row to array. + (arch_info_struct): Add JX entry. + + * archures.c (bfd_mach_i960_jx): New macro. + * bfd-in2.h: Regenerated. + + * coffcode.h (coff_set_arch_mach_hook): For F_I960JX, set machine + to bfd_mach_i960_jx. + (coff_set_flags): For bfd_mach_i960_jx, set F_I960JX. + +Tue Jul 26 11:04:00 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (elf_adjust_dynamic_symbol): When handling a weak + symbol, correct check to see whether the equivalent normal symbol + was referenced. + + Add support for creating shared libraries under i386 ELF and SPARC + ELF. Based on patches by Eric Youngdale <ericy@cais.cais.com>. + * libelf.h (struct elf_link_hash_entry): Remove copy_offset field. + Add got_offset and plt_offset fields. + (ELF_LINK_HASH_REF_DYNAMIC_MULTIPLE): Don't define. + (ELF_LINK_HASH_DEF_DYNAMIC_MULTIPLE): Don't define. + (ELF_LINK_HASH_NEEDS_COPY): Define. + (struct elf_backend_data): Add check_relocs field. + (struct bfd_elf_section_data): Change relocs from PTR to + Elf_Internal_Rela *. + (struct elf_obj_tdata): Add local_got_offsets field. + (elf_local_got_offsets): Define accessor macro. + (bfd_elf32_link_create_dynamic_sections): Declare. + (bfd_elf32_link_record_dynamic_symbol): Declare. + (bfd_elf64_link_create_dynamic_sections): Declare. + (bfd_elf64_link_record_dynamic_symbol): Declare. + * elfcode.h (elf_slurp_reloc_table): Don't use the section data + relocs field. + (elf_link_record_dynamic_symbol): Make globally visible. Use + macro to rename to NAME(bfd_elf,link_record_dynamic_symbol). + (elf_link_add_object_symbols): If creating a shared library, put + make all local symbols dynamic. Don't bother with the + DYNAMIC_MULTIPLE flags. Call the check_relocs backend function if + it is defined. + (elf_link_create_dynamic_sections): Make globally visible. Use + macro to rename to NAME(bfd_elf,link_create_dynamic_sections). If + creating a shared library, make sure that _DYNAMIC is added as a + dynamic symbol. + (elf_link_read_relocs): New function. + (NAME(bfd_elf,record_link_assignment)): If creating a shared + library, always create symbols, and always make them dynamic. + (elf_bfd_final_link): Permit creation of shared libraries. + (elf_link_input_bfd): Use elf_link_read_relocs to get the relocs. + * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize + copy_offset. Initialize got_offset and plt_offset. + * elf32-target.h (elf_backend_check_relocs): Define as 0 if not + defined. + (elf32_bed): Initialize check_relocs field. + * elf64-target.h (elf_backend_check_relocs): Define as 0 if not + defined. + (elf64_bed): Initialize check_relocs field. + * elf32-i386.c (elf_howto_table): Change R_386_PLT32 and + R_386_GOTPC to be pc_relative and pcrel_offset. + (elf_i386_pic_plt0_entry): Define. + (elf_i386_pic_plt_entry): Define. + (elf_i386_create_dynamic_sections): Create a .got.plt section, and + define _GLOBAL_OFFSET_TABLE_ at the start of it. If creating a + shared library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a + dynamic symbol. Don't create .rel.bss if creating a shared + library. + (elf_i386_check_relocs): New function. + (elf_i386_adjust_dynamic_symbol): Don't make a PLT entry if the + symbol already has one. When making a PLT entry, set plt_offset. + Don't create a copy reloc when creating a shared library. Don't + set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY. + (elf_i386_allocate_dynamic_section): Remove. + (elf_i386_size_dynamic_sections): Look through all the sections + rather than assuming we know their names. Remove any empty reloc + or plt sections. Only add a DT_DEBUG entry if not creating a + shared library. Only add a DT_PLTGOT entry if there is a PLT. + Add a DT_TEXTREL entry if required. + (elf_i386_relocate_section): Permit undefined symbols when + creating a shared library. Handle the special relocation types + specially. + (elf_i386_finish_dynamic_symbol): Create a PLT entry if plt_offset + is set. If creating a shared library, produce a PIC PLT entry. + Only mark a PLT symbol as undefined if it was not defined by a + regular object file. Create a GOT entry if got_offset is set. + Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set. + (elf_i386_finish_dynamic_sections): Change the handling of + DT_RELSZ to simply subtract out the size of .rel.plt. If creating + a shared library, produce PIC PLT code. + (elf_backend_check_relocs): Define. + * elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT10, + R_SPARC_GOT22, and R_SPARC_PC10 to not warn about reloc overflow. + (elf32_sparc_create_dynamic_sections): If creating a shared + library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a + dynamic symbol, and set the type to STT_OBJECT. Likewise for + _PROCEDURE_LINKAGE_TABLE_. Don't create .rel.bss if creating a + shared library. + (elf32_sparc_check_relocs): New function. + (elf32_sparc_adjust_dynamic_symbol): Don't make a PLT entry if the + symbol already has one. When making a PLT entry, set plt_offset. + Don't create a copy reloc when creating a shared library. Don't + set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY. + (elf32_sparc_allocate_dynamic_section): Remove. + (elf32_sparc_size_dynamic_sections): Look through all the sections + rather than assuming we know their names. Only add a DT_DEBUG + entry if not creating a shared library. Add a DT_TEXTREL entry if + required. + (elf32_sparc_relocate_section): Permit undefined symbols when + creating a shared library. Handle the special relocation types + specially. + (elf32_sparc_finish_dynamic_symbol): Create a PLT entry if plt_offset + is set. Only mark a PLT symbol as undefined if it was not defined + by a regular object file. Create a GOT entry if got_offset is + set. Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set. + (elf32_sparc_finish_dynamic_sections): Store dynobj in a local + variable. + (elf_backend_check_relocs): Define. + +Mon Jul 25 12:21:07 1994 Stan Shebs (shebs@andros.cygnus.com) + + * configure.in (pc532mach_vec): Change to pc532machaout_vec. + * config.bfd (ns32k-*-netbsd*): Use ns32k-nbsd as bfd_name. + * Makefile.in (ALL_MACHINES): Add cpu-ns32k.o. + (BFD32_BACKENDS): Add aout-ns32k.o, netbsd532.o, m88kmach3.o, + pc532-mach.o. + * targets.c (pc532machaout_vec): Use instead of pc532mach_vec. + * config/pc532-mach.mt (DEFAULT_VECTOR): Ditto. + (SELECT_VECS): Remove. + * config/ns32k-nbsd.mt: New file, was ns32k-netbsd.mt. + * config/ns32k-netbsd.mt: Remove, name too long. + +Fri Jul 22 11:07:14 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * linker.c (generic_link_check_archive_element): When changing a + symbol to common, set the alignment. + (_bfd_generic_link_add_one_symbol): When creating a common symbol, + set the alignment. + * aoutx.h (aout_link_check_ar_symbols): When changing a symbol to + common, set the alignment. + (aout_link_add_symbols): Restrict the alignment of a common symbol + to the alignment power given by the architecture. + * libelf.h (struct elf_link_hash_entry): Remove align field. Add + copy_offset field. + * elfcode.h (elf_link_add_object_symbols): Store alignment in + new bfd_link_hash_entry field, not in elf_link_hash_entry field. + (elf_link_output_extsym): Similar change when getting alignment. + * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize align. Do + initialize copy_offset. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use copy_offset + field rather than align field. Get alignment using bfd_log2 + rather than switch. + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use copy_offset, + not align. + * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Likewise. + + * aoutx.h (NAME(aout,some_aout_object_p)): Just check + STAT_FOR_EXEC, don't check MACH. + * m88kmach3.c (MACH): Don't define. + * config/i386-mach3.mt (TDEFINES): Define STAT_FOR_EXEC. + * config/m88k-mach3.mt (TDEFINES): Likewise. + * config/mips-mach3.mt (TDEFINES): Likewise. + +Thu Jul 21 17:24:31 1994 Stan Shebs (shebs@andros.cygnus.com) + + * i386mach3.c: Reverted to version from before Jul 5 1994 changes. + +Thu Jul 21 12:26:01 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * reloc.c (struct reloc_howto_struct): Remove special_function1. + It's the wrong way to do things. + (HOWTO): Change accordingly. + (HOWTO2): Remove. + (_bfd_final_link_relocate): Remove references to + special_function1. + * bfd-in2.h: Rebuilt. + * aoutx.h (aout_link_input_section_std): Remove references to + special_function1. + (aout_link_reloc_link_order): Likewise. + +Wed Jul 20 15:46:44 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add rpath + argument. If it is not NULL, use it to set DT_RPATH. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype. + (bfd_elf64_size_dynamic_sections): Likewise. + * bfd-in2.h: Rebuilt. + +Sat Jul 16 21:10:39 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (elf_get_dynamic_symtab_upper_bound): If there is no + dynamic symtab, return error. + + * libelf.h (ELF_LINK_HASH_DEFINED_WEAK): Define. + * elfcode.h (elf_link_add_object_symbols): If symbol is defined as + weak, set ELF_LINK_HASH_DEFINED_WEAK. + (elf_link_output_extsym): If symbol is defined as weak, mark it + STB_WEAK. + + * libelf.h (struct bfd_elf_section_data): Add relocs field. + (shdr_name): Remove; unused. + * elfcode.h (elf_slurp_reloc_table): Rewrote to handle both REL + and RELA relocs. Free up the unswapped relocs. Permit the relocs + to be cached in the section_data. Correct the reloc address. + (elf_slurp_reloca_table): Remove. + (elf_canonicalize_reloc): Rewrote. + (elf_link_input_bfd): Permit the relocs to be cached in the + section data. + +Sat Jul 16 13:55:38 1994 Stan Shebs (shebs@andros.cygnus.com) + + * config.bfd (m88*-harris-cxux*): Recognize. + * hosts/harris.h (POSIX_UTIME, HAVE_PROCFS): Define. + + * configure.host (m68*-atari-sysv4*): New host. + (m68*-cbm-sysv4*): Use m68kv4 instead of amix. + * hosts/amix.h: Remove. + * hosts/m68kv4.h: New file, was amix.h. + +Thu Jul 14 15:12:24 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * reloc.c (enum bfd_reloc_code_real, bfd_type, struct + reloc_howto_struct, reloc_howto_type, HOWTO, HOWTO2): Copied + changes over from bfd-in2.h so they get generated properly next + time someone runs "make headers". + * bfd-in2.h: Rebuilt. + + * targets.c (netbsd532_vec, pc532mach_vec): Declare const. + (m88kmach3_vec): Restore deleted declaration. + + * configure.in: Alphabetize target vector names. + + * config/pc532mach.mh: New file. + (HDEPFILES, HDEFINES): Define here. + * config/pc532-mach.mt (HDEPFILES, HDEFINES): Deleted. + * config/ns32k-netbsd.mt (HDEPFILES, HDEFINES): Deleted. + + Sun Jul 10 00:04:20 1994 Ian Dall (dall@hfrd.dsto.gov.au) + + * pc532-mach.c: New File. pc532-mach a.out format. + + * netbsd532.c: New file. pc532-netbsd532 a.out format. + + * hosts/pc532mach.h: New file. pc532-mach host support. + + * cpu-ns32k.c: New file. ns32k support cpu specific code rather + than format specific code. + + * config/pc532-mach.mt: New file. Support for pc532-mach target. + + * config/ns32k-netbsd.mt: New file. Support for netbsd532 target. + + * aout-ns32k.c, aout-ns32k.h: New files supporting aout format for + ns32k series. + + * targets.c: Add netbsd532_vec and pc532machaout_vec into + bfd_target_vector array. Move netbsd386_vec to alphabetic order + location. + + * reloc.c (_bfd_final_link_relocate) Add support for + special_function1 in howto. + + * libaout.h: add M_NS32032, M_NS32532, M_532_NETBSD entries in + machine_type enum. + + * configure.in: add pc532mach_vec and netbsd532_vec entries. + + * config.bfd: add pc532mach host entries. Use for both + ns32k-pc532-mach and ns32k-pc532-netbsd. + + * config.bfd: it doesn't work to use i386-mach3 for ns32k*-*-mach. + add ns32k-pc532-mach* and ns32k-*-netbsd* entries. + + * bfd-in2.h: Add ns32k specific relocations to bfd_reloc_code_real + enum. + + * bfd-in2.h: Add special_function1 to struct howto. Change HOWTO + and NEWHOWTO macros to make special_function1 NULL. Neww HOWTO2 + macro. + + * bfd-in2.h: Split definition of struct reloc_howto_struct + and corresponding typedef into two statements. + + * bfd-in2.h: Add entry bfd_arch_ns32k to bfd_architecture enum. + + * archures.c: Add bfd_ns32k_arch prototype, and entry in + archures_init_table. + + * aoutx.h (aout_link_reloc_link_order): Allow for target dependent + MY_put_reloc macro. Allow for target dependent special_function1 + to apply the relocation. + + * aoutx.h (aout_link_input_section_std): Allow for target + dependent determination of reloc howto. Allow for target dependent + special_function1 to apply the relocation. + + * aoutx.h (get_reloc_upper_bound): Detect bss and return 0. + + * aoutx.h (slurp_reloc_table): Detect bss and succesfully read + zero reloc entries. + + * aoutx.h (machine_type): Add bfd_arch_ns32k case. + + * aoutx.h: Stat to determine executable status if STAT_FOR_EXEC + is defined (not just MACH). Use fstat instead of stat and check + for fstat error. + + * aoutx.h: Allow target dependent swap_std_reloc_{in,out}. + + * aoutx.h: Allow CTORS reloc info to be in target dependent reloc + table. + + * aout-target.h: Apply SWAP_MAGIC (if defined) after + swap_exec_header_in, otherwise we have magic in the wrong order. + +Thu Jul 14 11:47:27 1994 Stan Shebs (shebs@andros.cygnus.com) + + * coff-sparc.c (sparccoff_vec): Have leading underscores. + +Tue Jul 12 12:08:10 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * aix386-core.c, aoutf1.h, cisco-core.c, elfcode.h, hppabsd-core.c, + hpux-core.c, irix-core.c, lynx-core.c, osf-core.c, ptrace-core.c, + rs6000-core.c, trad-core.c: Remove SEC_ALLOC flag from .reg + sections, .reg sections are not allocated and contain debug + information only. + * osf-core.c (make_bfd_asection, osf_core_core_file_p): Use + bfd_make_section_anyway instead of building unique section names. + +Tue Jul 12 11:41:22 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * libelf.h (bfd_elf32_swap_symbol_in): Declare. + (bfd_elf32_swap_symbol_out): Declare. + (bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out): Declare. + * elf32-hppa.c (elf32_hppa_args_hash_table_init): Correct cast. + + * aout-encap.c (ARCH): Don't define. Obsolete. + * aout0.c, aoutx.h, gen-aout.c, hp300bsd.c, hp300hpux.c: Likewise. + * i386aout.c, i386bsd.c, i386dynix.c, i386linux.c: Likewise. + * i386lynx.c, m68klynx.c, mipsbsd.c, netbsd386.c: Likewise. + * newsos3.c, sparclynx.c, sunos.c: Likewise. + +Mon Jul 11 20:08:23 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * section.c (STD_SECTION): Make the sixth argument boolean, not + the seventh. From gary@tuva.pacsemi.oz.au (gary kopff). + +Sun Jul 10 09:12:02 1994 D. V. Henkel-Wallace (gumby@cygnus.com) + + * aoutx.h (bfd_free_cached_info): Change name of FREE to BFCI_FREE + in order not to collide with LynxOS's definition of FREE in + /usr/include/sys/proc.h + +Thu Jul 7 14:18:06 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * reloc.c (bfd_perform_relocation): Don't clobber the relocation + value for coff-Intel-little or coff-Intel-big. Hack upon hack. + +Thu Jul 7 10:10:34 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * aoutx.h (howto_table_std): Add entry for GOT relocations + which are present in sun3 shared libraries, to avoid assertions + when reading the dynamic relocations. + +Thu Jul 7 10:19:20 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.h (R_HPPA_COMPLEX): Fix dumb typo. + +Wed Jul 6 19:21:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * hosts/sysv4.h (qsort, strtol): Don't declare. + + * elfcode.h (elf_link_output_sym): Don't call output_symbol_hook + if it is NULL. + + * elf32-mips.c (mips_elf_final_write_processing): Add ignored info + argument to correspond to recent libelf.h change. + +Wed Jul 6 00:48:57 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * coff-alpha.c (alpha_ecoff_mkobject_hook): New hook to + additionally copy object type information from the alpha file + header to the BFD flags. + (alpha_ecoff_backend_data): Use it. + (ecoffalpha_little_vec): Add DYNAMIC to object_flags. + * aout64.c: Fix typo in conditional QMAGIC definition. + +Wed Jul 6 00:13:17 1994 Jeff Law (law@snake.cs.utah.edu) + + * hppabsd-core.c (hppabsd_core_core_file_p): Sanity check the + value of clicksz to help weed out non HPPA BSD core files. + +Tue Jul 5 13:26:02 1994 Stan Shebs (shebs@andros.cygnus.com) + + Mach 3 support. + * config.bfd (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*): + New targets. + * configure.host (i[34]86-*-mach3*, ns32k-*-mach3*): Recognize + "mach3" instead of "mach". + (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*): New hosts. + * targets.c (m88kmach3_vec): New target vector. + (bfd_target_vector): Add i386mach3_vec and m88kmach3_vec, but + inside #if 0. + * aoutx.h (some_aout_object_p) [MACH]: Recognize executables by + checking for execute permission, instead of looking at entry + point. + * i386mach3.c: Update, define MACH, N_TXTOFF, N_TXTADDR, + N_SHARED_LIB, don't include aout/*.h files, etc. + * m88kmach3.c: New file, m88k Mach 3 target. + * config/m88k-mach3.mt, config/mips-mach3.mt: New files, target + makefile fragments. + * config/i386mach3.mh, config/m88kmach3.mh, config/mipsmach3.mh: + New files, host makefile fragments. + * hosts/m88kmach3.h, hosts/mipsmach3.h: New files, host definitions. + +Tue Jul 5 13:56:52 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * elfcode.h (swap_out_syms): Get alignment of common symbol from + st_value field of saved ELF symbol information, if there is any. + +Mon Jul 4 19:13:32 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.h (R_HPPA_COMPLEX): Define. + * elf32-hppa.h (R_HPPA_COMPLEX): Define. + (elf32_hppa_reloc_type): Delete R_PARISC_STUB_CALL_17. + +Fri Jul 1 12:07:41 1994 Jeff Law (law@snake.cs.utah.edu) + + * Support code for enabling the new style linker for PA ELF. + * elfcode.h (swap_symbol_in, swap_symbol_out): Externalize. + (elf_compute_section_file_positions): Pass link_info to + the begin_write_processing hook. + (bfd_elf_write_object_contents): Pass NULL for new link_info + argument to final_write_processing hook. + (elf_link_output_sym): Accept new "input_section" argument for + the symbols's input section. All callers changed. Call the + link_output_symbol_hook if it's defined. + (elf_bfd_final_link): Call the final_write_processing hook if + it's defined. + * libelf.h (elf_backend_link_output_symbol_hook): Declare. + (elf_backend_begin_write_processing): Add new "info" argument. + (elf_backend_final_write_processing): Likewise. + * elf32-target.h (elf_backend_link_output_symbol_hook): Provide + a default definition. + (elf32_bed): Add elf_backend_link_output_symbol_hook. + * elf64-target.h: Likewise. + + * Major rework of the PA ELF code. Uses the new style BFD + linker, major cleanups. + * hppa_stubs.h: Rewrite from scratch. Much smaller and simpler. + * elf32-hppa.h: Delete all symbol extension related code. + (hppa_look_for_stubs_in_section): Delete decl. + (elf32_hppa_size_stubs, elf32_hppa_build_stubs): New decls. + * elf32-hppa.c: Symbol extension stuff moved form elf32-hppa.h + into elf32-hppa.c. Do not include aout64.h. + (typdef hppa_stub_type): Delete. + (elf32_hppa_stub_name_list_struct): Delete. + (elf32_hppa_stub_description_struct): Delete. + (arg_reloc_type): Use simpler enumerations. All references changed. + (arg_location, arg_reloc_relocation): Likewise. + (elf32_hppa_symextn_map_struct): Delete. + (get_symbol_value): Delete. + (elf32_hppa_get_sym_extn): Delete. + (find_stubs, new_stubs, type_of_mismatch): Delete. + (find_stub_by_name, add_stub_by_name): Delete. + (hppa_elf_stub_finish, hppa_elf_stub_reloc): Delete. + (hppa_elf_arg_reloc_needed): Renamed. Simplify. + (hppa_elf_build_linker_stub, hppa_elf_create_stub_sec): Delete. + (hppa_elf_long_branch_needed_p): Delete. + (hppa_look_for_stubs_in_section): Delete. + (hppa_elf_get_section_contents): Delete. + (elf32_hppa_backend_symbol_processing): Delete. + (elf32_hppa_backend_section_processing): Delete. + (elf32_hppa_backend_section_from_shdr): Delete. + (elf32_hppa_backend_fake_sections): Delete. + (elf32_hppa_backend_section_from_bfd_section): Delete. + (NEW_INSTRUCTION): Delete. + (CURRENT_STUB_OFFSET): Delete. + (elf32_hppa_relocate_section): New function. + (elf32_hppa_bfd_final_link_relocate): New function. + (elf32_hppa_size_symext): New function. + (elf32_hppa_link_output_symbol_hook): New function. + (elf32_hppa_read_symext_info): New function. + (elf32_hppa_add_symbol_hook): New function. + (elf32_hppa_name_of_stub): New function. + (elf32_hppa_size_of_stub): New function. + (elf32_hppa_build_one_sub): New function. + (elf32_hppa_build_stubs): New function. + (elf32_hppa_size_stubs): New function. + (linker, stub and argument hash tables): Add appropriate + structures, definitions and functions to implement all three + hash tables. + (hppa_elf_relocate_insn): Don't need argument location information + in this function. + (add_entry_to_symext_chain): Accept a symbol's argument location + information rather than the symbol itself. All callers changed. + (hppa_elf_gen_reloc_type): Simplify. + (hppa_elf_set_section_contents): Stub section is no longer special. + (hppa_elf_reloc): Greatly simplify. + (elf32_hppa_begin_write_processing): Accept link_info argument. + Handle being called from the BFD backend linker. + (elf32_hppa_final_write_processing): Likewise. + (elf_hppa_tc_make_sections): No longer call stub_finish. + +Mon Jun 27 18:07:06 1994 Steve Chamberlain (sac@cirdan.cygnus.com) + + * section.c (bfd_get_section_contents): Put in parens to get + precedence right. + +Sun Jun 26 18:08:29 1994 Jeff Law (law@snake.cs.utah.edu) + + * libelf.h (relocate_section): New argument "output_names" added + to prototype. + * elfcode.h (elf_link_input_bfd): New argument "output_names" + added to prototype of relocate_section. Pass the output symbol + names to relocate_section. + * elf32-i386.c (elf_i386_relocate_section): Use "output_names" to + determine the name of a local symbol. + * elf32-mips.c (mips_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + +Fri Jun 24 08:15:42 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + Add Solaris BCP (the part of Solaris which allows it to run + SunOS4 a.out files) core file handling. + * aoutf1.h (external_solaris_bcp_core, swapcore_solaris_bcp): + New structure and its swap in function. + (internal_sunos_core): New member c_data_addr, to receive the + start address of the data section in the core file. + (swapcore_sun3, swapcore_sparc, sunos4_core_file_p): Use it. + (sunos4_core_file_p): Recognize Solaris BCP core file. + (sunos4_core_file_matches_executable_p): Always indicate match + for Solaris BCP core files. + +Thu Jun 23 15:31:28 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + Preliminary support for generating shared libraries, from Eric + Youngdale <ericy@cais.cais.com>. + * elfcode.h (prep_headers): If DYNAMIC, set e_type to ET_DYN. + (elf_link_add_object_symbols): If generating a shared library, + create dynamic sections for first input BFD with the right format. + (elf_link_create_dynamic_sections): Don't create .interp section + if creating a shared library. + (elf_link_input_bfd): Skip dynamic sections in input file. + (elf_bfd_final_link): If creating a shared library, it's OK for + dynobj to have sections which are not SEC_IN_MEMORY. + * elf32-i386.c (elf_i386_size_dynamic_sections): Only set .interp + section if not creating a shared library. + * elf32-sparc.c (elf_sparc_size_dynamic_sections): Likewise. + + * elfcode.h (elf_object_p): Don't set DYNAMIC just because there + is an SHT_DYNAMIC section. + + * cf-i386lynx.c (i386coff_vec): Don't include DYNAMIC in + object_flags. + * coff-sparc.c (sparccoff_vec): Likewise. + * hppabsd-core.c (hppabsd_core_vec): Likewise. + + * aoutx.h (NAME(aout,some_aout_object_p)): Don't set SEC_RELOC + just because DYNAMIC is set. + +Thu Jun 23 12:53:41 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * configure.in: Change --with-targets to --enable-targets and + --with-64-bit-bfd to --enable-64-bit-bfd. + * Makefile.in, mpw-make.in, targets.c: Change comments. + +Wed Jun 22 17:59:59 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * config.bfd (powerpc-*-elf*): New target, just like + powerpc-*-sysv4*. + + * linker.c (FAIL): Undefine macro before defining as enum. + +Wed Jun 22 10:52:47 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * linker.c (_bfd_generic_link_add_archive_symbols): Initialize + pass from abfd->archive_pass, and save it there as well. + + * hash.c (bfd_hash_allocate): Don't call bfd_set_error if + obstack_alloc returns NULL unless the size is non-zero. + + * linker.c (archive_hash_allocate): Define. + (_bfd_generic_link_add_archive_symbols): Use archive_hash_allocate + rather than obstack_alloc, for clarity. + + * elfcode.h (elf_get_reloc_upper_bound): Correct. + + * aout64.c (BMAGIC, QMAGIC): Define if not already defined. From + Peter Schauer <pes@regent.e-technik.tu-muenchen.de>. + + Linux ZMAGIC support from Eric Youngdale <ericy@cais.cais.com>. + * libaout.h (struct aoutdata): Add field zmagic_disk_block_size. + * aout-target.h (MY(callback)): Only set alignment according to + architecture if the section sizes are aligned to that alignment, + for backward compatibility. + (MY(set_sizes)): Initialize zmagic_disk_block_size field. + * aoutx.h (adjust_z_magic): Set ztih if using q_magic_format. Set + text section filepos to zmagic_disk_block_size if not ztih. Use a + different padding algorithm if not ztih. + * i386linux.c (MY_text_includes_header): Don't define. + + * aoutx.h (aout_link_check_ar_symbols): Just skip N_STAB and N_FN + symbols; don't look them up in the hash table. From + ralphc@pyramid.com (Ralph Campbell). + +Tue Jun 21 11:47:20 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * coff-go32.c (go32coff_archive_p): Remove unused function. + + * section.c (bfd_abs_section): Make const. + (bfd_abs_section_ptr, bfd_is_abs_section): Define. + (bfd_und_section): Make const. + (bfd_und_section_ptr, bfd_is_und_section): Define. + (bfd_com_section): Make const. + (bfd_com_section_ptr): Define. + (bfd_ind_section): Make const. + (bfd_ind_section_ptr, bfd_is_ind_section): Define. + (bfd_abs_symbol, bfd_com_symbol): Make const. + (bfd_und_symbol, bfd_ind_symbol): Likewise. + (global_syms): Cast initialization of section field. + (STD_SECTION): Define as const, and cast initializations. + * bfd-in2.h: Rebuilt. + * Many files: Change uses of bfd_abs_section, etc., to use + bfd_abs_section_ptr or bfd_is_abs_section, etc. + +Mon Jun 20 11:06:27 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * Many files: change all bfd_target vectors to be const. Change + all uses of bfd_target * to be const bfd_target *. Change + bfd_target_vector and bfd_default_vector arrays to be const + bfd_target * const *. + + * ecoff.c, libecoff.h, ecoffswap.h, coff-alpha.c, coff-mips.c, + elf32-mips.c: Renamed all externally visible ECOFF routines which + are local to BFD to start with _bfd_ecoff instead of just ecoff. + + * ecoff.c (ecoff_swap_tir_in): Change input argument to const. + (ecoff_swap_tir_out): Likewise. + (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Likewise. + (ecoff_slurp_symbolic_info): Add new arguments to correspond to + read_debug_info entry point in ecoff_debug_swap structure. + Change all calls. + * libecoff.h (ecoff_slurp_symbolic_info): Change declaration. + * ecoffswap.h (ecoff_swap_tir_in, ecoff_swap_tir_out): Declare. + (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Declare. + * coff-alpha.c (alpha_ecoff_backend_data): Initialize new + ecoff_debug_swap fields. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * elf32-mips.c (mips_elf_read_ecoff_info): Undefine READ. + (mips_elf_ecoff_debug_swap): Initialize new ecoff_debug_swap + fields. + * configure.in (bfd_elf32_bigmips_vec): Use ecoff.o and + ecofflink.o. + (bfd_elf32_littlemips_vec): Likewise. + (ecoff_big_vec, ecoff_little_vec): Likewise. + (ecoffalpha_little_vec): Likewise. + * Makefile.in (BFD_LIBS): Remove ecoff.o and ecofflink.o. + (BFD32_BACKENDS): Add ecoff.o and ecofflink.o. + + * aoutx.h (NAME(aout,final_link)): Check flavour of sub, not abfd, + when computing reloc sizes. From Eric Youngdale + <ericy@cais.cais.com>. + * elfcode.h (elf_bfd_final_link): Don't try to compute maximum + reloc count or size for a non-ELF file. + + * mipsbsd.c (MY_final_link_callback): Define to avoid warning. + + * hp300hpux.c (MY_final_link_callback): Define to avoid warning. + (BMAGIC, QMAGIC): Define; used by aoutx.h. + (MY(slurp_symbol_table)): Change translate_from_native_sym_flags + calls to use new parameters. + +Fri Jun 17 14:45:32 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aout-target.h (MY(callback)): Set the alignments of the text, + data and bss sections after determining the architecture. + + * sunos.c (sunos_add_one_symbol): Treat a common symbol from a + dynamic object as being in the .bss section of the object, rather + than as being undefined. + +Fri Jun 17 11:16:50 1994 Jeff Law (law@snake.cs.utah.edu) + + * libhppa.h (bfd_hppa_insn2fmt, hppa_rebuild_insn): Make INLINE. + + * elf32-hppa.h (elf_hppa_final_processing): Delete decl. + +Thu Jun 16 23:36:23 1994 Jeff Law (law@snake.cs.utah.edu) + + * elfcode.h (elf_link_input_bfd): Don't try to read local symbols + if there aren't any in the input file. + +Thu Jun 16 14:25:22 1994 Eric Youngdale (ericy@cais.cais.com) + + * i386linux.c: Many new functions and definitions for linker + support for Linux shared libraries. + * bfd-in.h (bfd_linux_size_dynamic_sections): Declare. + * bfd-in2.h: Rebuild. + +Thu Jun 16 14:23:46 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config.bfd: If second argument is ``_'', then, instead of + echoing config file name, echo whether target uses leading + underscores on symbol names. Add appropriate settings to + different cases. Used by binutils/configure.in to set default for + c++filt. + + * elfcode.h (elf_bfd_final_link): If trying to generate a shared + object, warn and return false. + + * aoutx.h (NAME(aout,some_aout_object_p)): Accept BMAGIC objects + and treat them as OMAGIC. + +Wed Jun 15 18:02:21 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + Enable sparc v9 support for release. Note that this is still a + work in progress, pending release of an ABI specification. + * config.bfd, configure.in: Include sparc v9 elf config. + * elfcode.h (prep_headers): Handle sparc v9 (64 bit). + * reloc.c (bfd_reloc_code_real): New reloc types. + * elf64-sparc.c: Implement elf64-sparc target. + * Makefile.in, targets.c: Updated. + +Wed Jun 15 01:34:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libelf.h (struct elf_obj_tdata): New field dt_needed_name. + (elf_dt_needed_name): New accessor macro. + * elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name + is set, use that instead of the filename for the DT_NEEDED dynamic + entry. + * elf.c (bfd_elf_set_dt_needed_name): New function. + * bfd-in.h (bfd_elf_set_dt_needed_name): Declare. + * bfd-in2.h: Rebuilt. + + * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add sinterpptr + argument, and set it to the .interp section. + * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype. + (bfd_elf64_size_dynamic_sections): Likewise. + * bfd-in2.h: Rebuilt. + + * coff-sparc.c (SWAP_OUT_RELOC_EXTRA): Define to clear the r_spare + field of the reloc rather than letting it be garbage. + + * archive.c (bfd_slurp_armap): Recognize __.SYMDEF/ as well as + __.SYMDEF; the former was used in old Linux archives. From + jrs@world.std.com (Rick Sladkey). + + * i386linux.c (i386linux_write_object_contents): Define; like + MY(write_object_contents) in aout-target.h, but set MACHTYPE to + M_386. From jrs@world.std.com (Rick Sladkey). + (MY_write_object_contents): Define. + + * aoutx.h (translate_from_native_sym_flags): Treat N_SETV symbols + as N_DATA symbols. + (aout_link_add_symbols): Likewise. + + * aoutx.h: Rewrite symbol duplicate elimination to use BFD hash + tables. + (struct stringtab_entry, struct stringtab_data): Remove. + (HASHMAXLEN, HASH_CHAR, hash, compare, log2, emit_strtab): Remove. + (struct strtab_hash_entry, struct strtab_hash): Define. + (strtab_hash_newfunc, strtab_hash_lookup): Define. + (stringtab_free, emit_stringtab): Define. + (stringtab_init, add_to_stringtab): Rewrite. + (NAME(aout,write_syms)): Use new stringtab code. + (struct aout_final_link_info, NAME(aout,final_link)): Likewise. + (aout_link_write_symbols, aout_link_write_other_symbol): Likewise. + + * bfd-in.h (BFD_TRADITIONAL_FORMAT): Define new BFD flag to + request BFD to write object in the traditional format, whatever + that means for the particular backend. + * bfd-in2.h: Rebuilt. + + * hash.c (bfd_hash_allocate): If obstack_alloc fails, set + bfd_error_no_memory. + +Tue Jun 14 13:00:04 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libaout.h (struct aoutdata): Add q_magic_format to subformat + enum. + * aout-target.h (MY_bfd_copy_private_bfd_data): Define as function + if not already defined. Copy subformat information. + (MY_text_includes_header): Define as 0 if not already defined. + (MY(backend_data)): Use MY_text_includes_header rather than 0. + (MY_final_link_callback): Rename from final_link_callback, and + define only if MY_final_link_callback is not already defined. + (MY_bfd_final_link): Rename use of final_link_callback to + MY_final_link_callback. + * aoutx.h (NAME(aout,some_aout_object_p)): Handle QMAGIC like + ZMAGIC, but set the subformat to q_magic_format. Abort if the + magic number if not recognized. + (adjust_z_magic): Use QMAGIC if q_magic_format. + * i386linux.c (MY_text_includes_header): Define as 1. + (i386linux_bfd_final_link): New static function. + (MY_bfd_final_link): Define as i386linux_bfd_final_link. + + * aoutx.h (translate_to_native_sym_flags): Check both section and + output_section against sections of abfd. + + * libecoff.h (struct ecoff_link_hash_entry): Change type of + written from boolean to char. Add new field small. + * ecoff.c (ecoff_link_hash_newfunc): Initialize written to 0 + rather than false. Initialize small to 0. + (ecoff_link_add_externals): If ECOFF type is scSUndefined, set + small. If small is set, and hash table type is common, force the + symbol into a section named SCOMMON and change the ECOFF type from + scCommon to scSCommon. + (ecoff_link_write_external): Set written to 1 rather than true. + * coff-mips.c (mips_relocate_section): Correct JMPADDR reloc + overflow check to consider section VMA of input file. + +Mon Jun 13 14:20:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutf1.h (aout_32_sunos4_write_object_contents): Handle a + machine type of 68000. + * aoutx.h (NAME(aout,machine_type)): Add new argument unknown. + Set *unknown to true if machine type is really unknown, as opposed + to M_UNKNOWN for the 68000. + (NAME(aout,set_arch_mach)): Change NAME(aout,machine_type) call + accordingly. + * libaout.h (NAME(aout,machine_type)): Add new argument to + prototype. + +Sun Jun 12 20:21:03 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (EXEC_AUX_ID): Define based on availablity of HPUX_AUX_ID + or HIUX_AUX_ID. + (som_begin_writing): Use EXEC_AUX_ID instead of HPUX_AUX_ID. + (som_write_armap): Use CPU_PA_RISC1_0 as the magic number. Note + som.c is careful to always define CPU_PA_RISC1_0. + +Sat Jun 11 16:32:30 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Add weak symbols as an extension to a.out. + * aoutx.h (sym_in_text_section): Don't define. + (sym_in_data_section, sym_in_bss_section): Likewise. + (sym_is_undefined, sym_is_global_defn): Likewise. + (sym_is_debugger_info, sym_is_fortrancommon): Likewise. + (sym_is_absolute, sym_is_indirect): Likewise. + (translate_from_native_sym_flags): Rewrite for clarity. Rearrange + arguments and change caller. Handle weak symbols. + (translate_to_native_sym_flags): Likewise. + (aout_link_check_ar_symbols): Don't ignore weak symbols. Pull + object in from archive if a weak defintion is found for an + existing undefined symbol. + (aout_link_add_symbols): Put all cases in switch. Set flags of an + undefined symbol to 0. Handle weak symbols. + (aout_link_write_symbols): Handle weak symbols. + (aout_link_write_other_symbol): Likewise. + (aout_link_input_section_std): Likewise. + (aout_link_input_section_ext): Likewise. + * sunos.c (sunos_write_dynamic_symbol): Likewise. + +Fri Jun 10 13:25:13 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (NAME(aout,canonicalize_reloc)): Handle .bss section. + (NAME(aout,get_reloc_upper_bound)): Likewise. + + * coff-i960.c (coff_i960_reloc_type_lookup): Add BFD_RELOC_CTOR. + * linker.c (_bfd_generic_link_write_global_symbol): Don't assume + the section of a common symbol is not NULL. + +Wed Jun 8 23:15:53 1994 Stu Grossman (grossman@cygnus.com) + + * nlmcode.h (nlm_object_p): Set EXEC_P and start address for GDB. + +Wed Jun 8 23:57:34 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_get_external_symbols): Don't try to read the + strings if there are no symbols. + (aout_link_write_other_symbol): Use the output section when + working out the type. + +Tue Jun 7 13:25:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (assign_section_numbers): Put shstrtab, symtab and + strtab sections at end of file. Avoids bug in some versions of + SVR4 strip. From Eric Youngdale <eric@tantalus.nrl.navy.mil>. + + * coffcode.h (styp_to_sec_flags): If COFF_PAGE_SIZE is defined, + set SEC_DEBUGGING for STYP_INFO sections. + (coff_compute_section_file_positions): If COFF_PAGE_SIZE is + defined, and D_PAGED is set, set the file position equal to the + section VMA modulo COFF_PAGE_SIZE. + * coffgen.c (coff_real_object_p): If F_EXEC is set, set D_PAGED. + * coff-i386.c: Set D_PAGED in BFD target. + (COFF_PAGE_SIZE): Define. + * coff-m68k.c, coff-sparc.c: Likewise. + +Mon Jun 6 10:57:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (bfd_section_from_shdr): Don't turn a reloc section + into a BFD section just because SHF_ALLOC is set; require that it + not use the normal symbol table. + (elf_section_from_bfd_section): Corresponding change. + + Better indirect and warning symbol handling inspired by Stuart + Quick <stuck@cs.man.ac.uk>. + * linker.c (enum link_action): Add REF, MIND, CWARN, REFC. + (link_action): Change UNDEF_ROW/def and UNDEFW_ROW/def from NOACT + to REF. Change UNDEF_ROW/indr and UNDEFW_ROW/indr from CYCLE to + REFC. Change DEF_ROW/indr and COMMON_ROW/indr from CYCLE to MDEF. + Change DEFW_ROW/indr from CYCLE to NOACT. Change INDR_ROW/indr + from MDEF to MIND. Change INDR_ROW/warn from WARNC to CYCLE. + Change WARN_ROW/def and WARN_ROW/indr from MWARN to CWARN. Change + WARN_ROW/com from MWARN to WARN. Change WARN_ROW/warn from NOACT + to CYCLE. Change SET_ROW/warn from WARNC to CYCLE> + (_bfd_generic_link_add_one_symbol): Handle REF, MIND, CWARN and + REFC. If a new indirect symbol has been referenced, push the + reference down to the symbol it points to. FIx handling of WARN. + * aoutx.h (translate_from_native_sym_flags): If N_WARNING, don't + clobber e_type of next symbol. + (translate_to_native_sym_flags): Likewise. + (aout_link_write_symbols): Loop on bfd_link_hash_warning as well + as bfd_link_hash_indirect. + + * libaout.h (struct aout_link_hash_entry): New field written. + * aoutx.h (NAME(aout,link_hash_newfunc)): Initialize written. + (aout_link_write_symbols): Use written, not root.written. + (aout_link_write_other_symbol): Likewise. + * sunos.c (sunos_scan_dynamic_symbol): Likewise. + * libecoff.h (struct ecoff_link_hash_entry): New field written. + * ecoff.c (ecoff_link_hash_newfunc): Initialize written. + (ecoff_link_write_external): use written, not root.written. + * genlink.h (struct generic_link_hash_entry): New field written. + * linker.c (_bfd_link_hash_newfunc): Don't initialize written. + (generic_link_hash_newfunc): Initialize written. + (_bfd_generic_link_output_symbols): Use written, not root.written. + (_bfd_generic_link_write_global_symbol): Likewise. + (_bfd_generic_reloc_link_order): Likewise. + + * libecoff.h (ecoff_data_type): Add linker field. + * ecoff.c (ecoff_write_object_contents): Check new tdata linker + field, rather than outsymbols being non-NULL, to decide whether to + output the symbols and relocs. + (ecoff_bfd_final_link): Set new tdata linker field to true. + + * ecoff.c (ecoff_bfd_copy_private_bfd_data): Don't try to copy + data to a non-ECOFF file. + + * libbfd-in.h: Add warning that libbfd.h is a generated file. + * libbfd.h: Rebuilt. + +Sun Jun 5 15:02:30 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Changes to support ELF strip and objcopy on dynamically linked + files. + * elfcode.h (elf_fake_sections): Add prototype. + (bfd_section_from_shdr): Make a BFD section from an SHT_HASH + section, and from an SHT_DYNSYM section, and from the dynamic + string table section. + (elf_object_p): Set D_PAGED if there is a program header. + (elf_make_sections): Remove. + (fix_up_strtabs): Remove. + (elf_fake_sections): Rewrite. Now sets sh_entsize. + (assign_section_numbers): Rewrite. Now sets sh_link and sh_info + for all sections. + (elf_compute_section_file_positions): Don't call obsolete + functions elf_make_sections or fix_up_strtabs. + (swap_out_syms): Set sh_addralign to FILE_ALIGN rather than 4. + (NAME(bfd_elf,write_object_contents)): Permit writing DYNAMIC + objects. + (elf_section_from_bfd_section): Treat SHT_DYNSYM like other normal + sections. If an SHT_REL or SHT_RELA section is allocated or uses + an unusual symbol table, permit a BFD section to map to it. + Permit most SHT_STRTAB sections to have a BFD section mapped to + them. + (elf_bfd_final_link): Don't set sh_link, sh_info or sh_entsize + fields of dynamic sections here; do it in assign_section_numbers. + * elf32-target.h, elf64-target.h: Add D_PAGED to permitted object + flags. + + * elf.c (_bfd_elf_make_section_from_shdr): Only set SEC_DATA if + SEC_LOAD is set, rather than checking SEC_ALLOC. + + * libbfd-in.h (bfd_realloc): Change last arg to "size_t size". + +Fri Jun 3 10:58:02 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_write_object_contents): Don't compute the file header's + checksum here. + (som_write_headers): Instead do it here. + + * libbfd.h (bfd_realloc): Change last arg to "size_t size". + +Thu Jun 2 17:39:22 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * hosts/sun3.h: Include <stdlib.h>. Don't declare free, exit or + getenv. + + Add linker support for SunOS shared libraries. + * sunos.c: Include bfdlink.h. Add many new functions and + definitions for SunOS shared library support. + * bfd-in.h (bfd_sunos_record_link_assignment): Declare. + (bfd_sunos_size_dynamic_sections): Declare. + * bfd-in2.h: Rebuilt. + * aoutx.h (struct aout_link_hash_entry): Move to libaout.h. + (struct aout_link_hash_table): Likewise. + (aout_link_hash_lookup, aout_link_hash_traverse): Likewise. + (aout_hash_table): Likewise. + (NAME(aout,link_hash_newfunc)): Rename from aout_link_hash_newfunc + and make externally visible. + (NAME(aout,link_hash_table_init)): New function. + (NAME(aout,link_hash_table_create)): Call + NAME(aout,link_hash_table_init), not _bfd_link_hash_table_init. + (aout_link_add_symbols): Don't fail if no symbols. If it exists, + call add_dynamic_symbols backend entry point for dynamic objects. + Use add_one_symbol backend entry point if it exists. + (NAME(aout,final_link)): Call finish_dynamic_link backend entry + point, if it exists. + (aout_link_input_bfd): For a dynamic object, call + link_dynamic_object backend entry point, if it exists. + (aout_link_write_other_symbol): Call write_dynamic_symbol backend + entry point, if it exists. + (aout_link_input_section): Don't read the relocs if they have + already been read. + (aout_link_input_section_std): When doing a final link, for a + reloc against an external symbol, call check_dynamic_reloc backend + entry point, if it exists. + (aout_link_input_section_ext): Likewise. + * libaout.h: Protect against multiple inclusion. Include + bfdlink.h. + (struct aout_link_hash_entry): Move in from aoutx.h. + (struct aout_link_hash_table): Likewise. + (aout_link_hash_lookup, aout_link_hash_traverse): Likewise. + (aout_hash_table): Likewise. + (struct aout_backend_data): Add fields add_dynamic_symbols, + add_one_symbol, link_dynamic_object, write_dynamic_symbol, + check_dynamic_reloc, and finish_dynamic_link. + (struct aout_section_data_struct): Define new structure. + (aout_section_data): Define new accessor macro. + (NAME(aout,link_hash_newfunc)): Declare. + (NAME(aout,link_hash_table_init)): Declare. + * aoutf1.h (sunos4_aout_backend): Initialize new aout_backend_data + fields. + * aout-target.h (MY(backend_data)): Likewise. + * i386aout.c (MY(backend_data)): Likewise. + * i386mach3.c (MY(backend_data)): Likewise. + * mipsbsd.c (MY(backend_data)): Likewise. + * sparclynx.c (sparclynx_aout_backend): Likewise. + + * aoutx.h (NAME(aout,slurp_symbol_table)): Don't zero out cached + until we know it is non-NULL. + (aout_link_write_symbols): Don't skip a warning symbol even if it + has already been written out. If skipping an indirect symbol, + skip the next symbol as well. + +Wed Jun 1 14:37:50 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * hosts/sun3.h: Don't declare qsort, malloc or realloc. + +Thu May 26 13:56:03 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * nlmcode.h (nlm_swap_auxiliary_headers_in): Cast bfd_byte pointer + to char pointer to avoid compiler warnings. + + * dep-in.sed: Remove spaces before colons. + + Merged changes back in from FSF gas release 2.3: + + * Makefile.in (stmp-bfd.h): Wrap `if' block around grep + invocation, to avoid a bug in BSD 4.4 make. + + From Ralph Campbell: + * mipsbsd.c (mips_fix_jmp_addr): If symbol is undefined, return an + error. + (mips_fix_hi16_s): Ditto. + + Fri May 13 21:21:00 1994 DJ Delorie (dj@ctron.com) + + * makefile.dos: define a default target, or archives won't work + due to multiple matches. + + Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) + + * configure.bat: update for latest files + * makefile.dos: update for correct targets and sources + * coff-go32.c: [new] go32's COFF format (i386coff with underscores) + * targets.c: add go32coff target + * makefile.in: add coff-go32.c support + +Thu May 26 10:10:21 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_prep_headers): Do not set the system_id here, private + bfd data has not been copied yet. + (som_write_headers): Instead do it here. + +Tue May 24 16:17:18 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Make MIPS ELF use new ELF backend linker. No shared library + support yet. + * elf32-mips.c (bfd_mips_elf32_swap_gptab_in): New function. + (bfd_mips_elf32_swap_gptab_out): New function. + (mips_elf_object_p): If last symbol is LOCAL, set elf_bad_symtab. + (mips_elf_final_write_processing): Set sh_info field for .gptab.* + sections. + (mips_elf_fake_sections): Set sh_entsize for .gptab.* sections. + (mips_elf_read_ecoff_info): Read and free external symbols last, + not first, for clarity. + (struct mips_elf_link_hash_entry): Define new structure. + (struct mips_elf_link_hash_table): Define new structure. + (mips_elf_link_hash_lookup): Define new macro. + (mips_elf_link_hash_traverse): Define new macro. + (mips_elf_hash_table): Define new macro. + (mips_elf_link_hash_newfunc): New static function. + (mips_elf_link_hash_table_create): New static function. + (mips_elf_add_symbol_hook): New static function. + (struct extsym_info): Define new structure. + (mips_elf_get_extr, mips_elf_set_index): Remove. + (mips_elf_output_extsym): New static function. + (gptab_compare): New static function. + (mips_elf_final_link): Rewrite to use ELF backend linker, and to + merge gptab information in input files. + (mips_elf_relocate_hi16): New static function. + (mips_elf_relocate_section): New static function. + (bfd_elf32_bfd_link_hash_table_create): Define as macro before + including elf32-target.h. + (elf_backend_relocate_section): Likewise. + (elf_backend_add_symbol_hook): Likewise. + * elf.c (_bfd_elf_link_hash_newfunc): Rename from + elf_link_hash_newfunc and make globally visible. Change caller. + (_bfd_elf_link_hash_table_init): New function, broken out of + _bfd_elf_link_hash_table_create. + (_bfd_elf_link_hash_table_create): Use + _bfd_elf_link_hash_table_init. + * libelf.h (struct elf_obj_tdata): Add new field bad_symtab. + (elf_bad_symtab): Define new accessor macro. + (_bfd_elf_link_hash_newfunc): Declare. + (_bew_elf_link_hash_table_init): Declare. + * elfcode.h (elf_object_p): Call backend object_p hook after + swapping in all the section headers. + (map_program_segments): Correct typo: Internal for External. + (elf_link_add_object_symbols): If elf_bad_symtab is set, read all + the symbols. Skip STB_LOCAL symbols rather than giving an error. + (elf_bfd_final_link): If elf_bad_symtab is set, allocate space for + all symbols, not just locals. + (elf_link_output_extsym): Only skip a symbol not mentioned by a + regular file if it is mentioned by a dynamic object. + (elf_link_input_bfd): If elf_bad_symtab is set, read all the + symbols. + +Fri May 20 13:38:23 1994 Jeff Law (law@snake.cs.utah.edu) + + * som.c (som_set_reloc_info): Do not set any relocation info + for SOM fixups which are never passed to BFD. + +Fri May 20 11:57:05 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-mips.c (mips_relocate_section): Add MIPS_R_JMPADDR overflow + checking. + + * elf32-i386.c (elf_i386_size_dynamic_sections): Add DT_DEBUG to + the dynamic linking information for the benefit of the debugger. + From Peter Schauer. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + + * elf.c (_bfd_elf_make_section_from_shdr): New function, based on + code repeated three times in bfd_section_from_shdr in elfcode.h. + * libelf.h (_bfd_elf_make_section_from_shdr): Declare. + * elfcode.h (bfd_section_from_shdr): Use new function + _bfd_elf_make_section_from_shdr to create BFD sections. If a + reloc section does not use the main symbol table, or it is part of + the process image, treat it as a normal section, not relocs. + * elf32-mips.c (mips_elf_section_from_shdr): Use new function + _bfd_elf_make_section_from_shdr. + +Thu May 19 11:37:11 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-target.h, elf64-target.h: Change ar_max_namelen value from + 15 to 14 to match SVR4 ar. + + Add support for ELF shared libraries. Loosely based on work by + Eric Youngdale <ericy@cais.com>. + * libelf.h (struct elf_backend_data): Add new fields for dynamic + linking: elf_backend_create_dynamic_sections, + elf_backend_adjust_dynamic_symbol, + elf_backend_size_dynamic_sections, + elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections. + (struct elf_link_hash_entry): Change type of align field to + bfd_size_type. Add fields dynindx, dynstr_index, weakdef, + elf_link_hash_flags. + (struct elf_link_hash_table): Add fields dynobj, dynsymcount, + dynstr, bucketcount. + (bfd_elf32_swap_reloc_in, bfd_elf32_swap_reloc_out): Declare. + (bfd_elf32_swap_reloca_in, bfd_elf32_swap_reloca_out): Declare. + (bfd_elf32_swap_dyn_in, bfd_elf32_swap_dyn_out): Declare. + (bfd_elf32_add_dynamic_entry): Declare. + (bfd_elf64_swap_reloc_in, bfd_elf64_swap_reloc_out): Declare. + (bfd_elf64_swap_reloca_in, bfd_elf64_swap_reloca_out): Declare. + (bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out): Declare. + (bfd_elf64_add_dynamic_entry): Declare. + * elfcode.h (Elf_External_Dyn): Define. + (elf_swap_reloc_in): Define as macro using NAME. Make externally + visible. + (elf_swap_reloc_out): Likewise. + (elf_swap_reloca_in, elf_swap_reloca_out): Likewise. + (elf_swap_dyn_in, elf_swap_dyn_out): Define as macro using NAME + and as new externally visible function. + (elf_fake_sections): Set section type of dynamic sections based on + section names. + (elf_write_phdrs): Remove. + (assign_file_position_for_section): Add new align argument. + Change all callers. + (get_program_header_size): New static function. + (struct seg_info): Remove. + (map_program_segments): Completely rewrite. + (assign_file_positions_except_relocs): Completely rewrite. + (assign_file_positions_for_relocs): Don't set a file position for + sections which already have one. Don't bother to align the file + position here. + (section_from_elf_index): Handle SHT_HASH and SHT_DYNAMIC + section types. + (elf_section_from_bfd_section): Likewise. + (elf_slurp_symbol_table): If section_from_elf_index fails, just + use bfd_abs_section rather than returning an error. + (elf_sizeof_headers): Make useful. + (elf_link_record_dynamic_symbol): New static function. + (elf_link_add_object_symbols): Handle dynamic objects. + (elf_link_create_dynamic_sections): New static function. + (elf_add_dynamic_entry): Define as macro using NAME and as new + externally visible function. + (NAME(bfd_elf,record_link_assignment)): New function. + (elf_buckets): New static variable. + (NAME(bfd_elf,size_dynamic_sections)): New function. + (struct elf_final_link_info): Add dynsym_sec and hash_sec fields. + (elf_bfd_final_link): Handle dynamic linking. Create a section + symbol for all ELF sections, not all BFD sections. Store section + symbol index in target_index field, not index field. Traverse + over global symbols even if stripping. + (elf_link_output_extsym): Output dynamic symbols. Mark symbols + defined by dynamic objects as undefined. + (elf_link_input_bfd): Ignore dynamic objects. Use target_index + field for section relocs, and make sure it is set. + (elf_reloc_link_order): Use target_index field for section relocs, + and make sure it is set. + * elf.c (elf_link_hash_newfunc): Initialize dynindx, dynstr_index, + weakdef and elf_link_hash_flags fields. + (_bfd_elf_link_hash_table_create): Initialize dynobj, dynsymcount, + dynstr and bucketcount fields. + * elf32-target.h: Initialize new dynamic linking fields. + * elf64-target.h: Likewise. + * elf32-i386.c: New functions for dynamic linking support. + * elf32-sparc.c: Likewise. + * bfd-in.h (bfd_elf32_record_link_assignment): Declare. + (bfd_elf64_record_link_assignment): Declare. + (bfd_elf32_size_dynamic_sections): Declare. + (bfd_elf64_size_dynamic_sections): Declare. + * bfd-in2.h: Rebuilt. + +Wed May 18 08:29:04 1994 Ian Lance Taylor (ian@cygnus.com) + + * som.c: Don't include <sys/dir.h> or <sys/user.h>. + (som_reloc_queue_find): Call memcmp instead of bcmp. + (som_bfd_reloc_type_lookup): Change first argument to bfd *. + (compare_syms): Change types of arguments to const void *. + (bfd_section_from_som_symbol): Removed unused local found. + (som_write_armap): Add elength, map, orl_count and int arguments. + (som_write_armap): Use %ld and cast to long for getuid result. + +Wed May 18 09:09:32 1994 Jeff Law (law@snake.cs.utah.edu) + + * elf32-hppa.h (R_HPPA_ABS_CALL): Define. + * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle absolute calls. + + * som.h (R_HPPA_ABS_CALL): Define. + * som.c (hppa_som_gen_reloc_type): Delete complex relocation types. + +Tue May 17 19:33:12 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * coff-i960.c (icoff_little_vec, icoff_big_vec): Indicate leading + underscore, for compatibility with Intel tool chain (gnu960v2). + +Mon May 16 10:09:22 1994 Jeff Law (law@snake.cs.utah.edu) + + * bfd-in2.h: Rebuilt. + + * elf32-hppa.c: Change .hppa_linker_stubs to .PARISC.stubs, + likewise for other PA specific sections. + (hppa_elf_relocate_unwind_table): Delete unused + function. + (elf_hppa_howto_table): Completely new table based on 94-02-02 + draft PA ELF spec. Change relocation tags appropriately + throughout elf32-hppa.c + (hppa_elf_gen_reloc_type): Rewrite and simplify based on 94-02-02 + spec. + (hppa_elf_reloc): Likewise. + (hppa_look_for_stubs_in_section): Likewise + (ELF_MACHINE_CODE): Change to EM_PARISC. + * elf32-hppa.h: Include "elf/hppa.h". Change relocation tags + appropriately throughout elf32-hppa.h. + (elf32_hppa_reloc_type): New table based on 94-02-02 draft PA ELF + spec. + (R_HPPA_ABS_CALL, R_HPPA_COMPLEX*, R_HPPA_UNWIND): Delete definitions. + * elfcode.h (prep_headers): Use EM_PARISC instead of EM_HPPA. + * reloc.c (bfd_reloc_code_real): Delete unused HPPA relocations. + * som.h (R_HPPA_ABS_CALL, R_HPPA_COMPLEX): Delete definitions. + + * libhppa.h (hppa_field_adjust): Avoid adding constant_value into + the final value twice for LR and RR field selectors. + +Sat May 14 09:09:19 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aoutx.h (add_to_stringtab): Use BFD_ASSERT not assert. This + avoids __eprintf troubles. + +Fri May 13 10:51:21 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bout.c (b_out_bfd_reloc_type_lookup): Handle BFD_RELOC_CTOR. + + * config/mipsbelf.mt (SELECT_VECS): Add ecoff_big_vec and + ecoff_little_vec since Irix 5 supports ECOFF executables. + +Wed May 11 00:31:57 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_find_nearest_line): Handle fdr.adr != pdr.adr + correctly. + + * Makefile.in (stmp-bfd.h): Use || instead of ; to force SunOS + make to invoke the shell. + +Tue May 10 14:23:43 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * section.c (SEC_COFF_SHARED_LIBRARY): Renamed from + SEC_SHARED_LIBRARY for clarity. Changed all uses. + * bfd-in2.h: Rebuilt. + * coffcode.h (sec_to_styp_flags): If SEC_COFF_SHARED_LIBRARY is + set, set STYP_NOLOAD. + * coffgen.c (coff_section_from_bfd_index): Don't get an assertion + failure because of a bad shared library. + +Mon May 9 18:53:40 1994 Bill Cox (bill@rtl.cygnus.com) + + * linker.c: Add missing comment terminator. + +Mon May 9 11:53:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * linker.c (_bfd_generic_link_add_one_symbol): If hashp and *hashp + are not NULL, assume the caller has already looked up the symbol + in the hash table and has stored the entry in *hashp. + (generic_link_add_symbol_list): Set h to NULL before calling + _bfd_generic_link_add_one_symbol. + * ecoff.c (ecoff_link_add_externals): Likewise. + + * elfcode.h (assign_file_positions_except_relocs): Don't require + page shared between .data and .bss segments to contain zeroes. + + * elfcode.h: Include bfdlink.h. Added several new functions to do + linking. + (ELF_R_TYPE): Define. + (bfd_add_to_strtab): Return unsigned long. Change check for + realloc failure. + (elf_fake_sections): Check return value of bfd_add_to_strtab. + (elf_compute_section_file_positions): Add link_info argument. + Call elf_backend_begin_write_processing hook and prep_headers + here. Only call swap_out_syms if link_info is NULL. Set up + .shstrtab section here. Pass dosyms argument to + assign_file_positions_except_relocs. Set output_has_begun flag. + (assign_file_positions_for_symtab_and_strtabs): Add dosyms + argument, and use it to control setting .symtab and .strtab file + positions. + (assign_file_positions_except_relocs): Add dosyms argument, and + pass it on. + (prep_headers): Check return value of bfd_add_to_strtab. + (swap_out_syms): Likewise. Also, don't set up .shstrtab here. + (NAME(bfd_elf,write_object_contents)): Some calls moved into + elf_compute_section_file_positions. + (elf_set_section_contents): Likewise. + (elf_slurp_symbol_table): SHN_LORESERV corrected to SHN_LORESERVE. + * libelf.h: Include bfdlink.h. + (struct elf_backend_data): Add fields collect, + elf_add_symbol_hook, elf_backend_relocate_section. + (struct bfd_elf_section_data): Add field rel_hashes. + (struct elf_obj_tdata): Remove fields internal_syms and symbols. + Add field sym_hashes. + (obj_symbols, obj_internal_syms): Remove definitions. + (elf_sym_hashes): Define. + (struct elf_link_hash_entry): Define. + (struct elf_link_hash_table): Define. + (elf_link_hash_lookup): Define. + (elf_link_hash_traverse): Define. + (elf_hash_table): Define. + (_bfd_elf_link_hash_table_create): Declare. + (bfd_elf32_bfd_link_add_symbols): Declare. + (bfd_elf32_bfd_final_link): Declare. + (bfd_elf64_bfd_link_add_symbols): Declare. + (bfd_elf64_bfd_final_link): Declare. + * elf.c: Include bfdlink.h. + (elf_link_hash_newfunc): New function. + (_bfd_elf_link_hash_table_create): New function. + * elf32-target.h (elf_backend_relocate_section): If not defined, + define as 0 and use generic linker. Otherwise, use ELF backend + linker. + (elf_backend_collect): If not defined, define as false. + (elf_backend_add_symbol_hook): If not defined, define as 0. + (elf32_bed): Initialize new fields. + * elf64-target.h: Same changes as elf32-target.h. + * elf32-i386.c: Include bfdlink.h. + (elf_i386_relocate_section): New function. + (elf_backend_relocate_section): Define. + * elf32-sparc.c: Include bfdlink.h. + (elf_info_to_howto): Change type of dst from Elf32_Internal_Rela + to Elf_Internal_Rela (they're the same type anyhow). + (elf_sparc_relocate_section): New function. + (elf_backend_relocate_section): Define. + * elf32-mips.c (elf_backend_collect): Define. + + * Makefile.in (stmp-bfd.h): Avoid useless make error message in a + different way; touch takes a numeric argument on some systems. + +Fri May 6 13:34:14 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmcode.h (nlm_swap_auxiliary_headers_in): Rework custom header + handling for latest suggested format. + (nlm_swap_auxiliary_headers_out): Likewise. + (nlm_compute_section_file_positions): Likewise. + +Fri May 6 11:11:50 1994 D. V. Henkel-Wallace (gumby@rtl.cygnus.com) + + * config.bfd: handle erricsson config (for OSE). + +Thu May 5 15:40:47 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + Patches from Ralph Campbell: + * mipsbsd.c (mips_fix_jmp_addr): New function. + (mips_fix_hi16_s): Use bfd_is_com_section. + (mips_howto_table_ext): Call mips_fix_jmp_addr for MIPS_RELOC_JMP. + +Fri May 6 11:48:55 1994 Steve Chamberlain (sac@cygnus.com) + + * config/go32.mh: XX support. + + From bill + * Makefile.in: Build sysdep.h without causing worrying but + harmless error message. + +Wed May 4 11:09:53 1994 Ian Lance Taylor (ian@cygnus.com) + + Changed m68k-aout to set flags to 0; m68k-sunos still uses 1. + * aout0.c: New file. + * targets.c (aout0_big_vec): Declare. + (bfd_target_vector): Add aout0_big_vec. + * config.bfd (m68*-*-aout*): Use m68k-0aout, not m68k-aout. + * config/m68k-aout.mt (SELECT_VECS): Removed. + * config/m68k-0aout.mt: New file. + * configure.in (aout0_big_vec): New target vector: use aout0.o, + aout32.o and stab-syms.o. + * Makefile.in: Rebuilt dependencies. + (BFD32_BACKENDS): Add aout0.o. + (CFILES): Add aout0.c. + + * libaout.h (struct aout_backend_data): Add field exec_hdr_flags. + * aout-target.h (MY_exec_hdr_flags): If not defined, define as 0. + MY(backend_data): Initialize exec_hdr_flags field. + * aoutf1.h (sunos_32_set_arch_mach): Make static. + (aout32_sunos4_write_object_contents): Set flags from backend + info. + (MY_exec_hdr_flags): If not defined, define as 1. + (sunos4_aout_backend): Initialize exec_hdr_flags field. + * aout-encap.c (encap_write_object_contents): Set flags from + backend info. + (MY_exec_hdr_flags): Define as N_FLAGS_COFF_ENCAPSULATE. + * hp300hpux.c (MY_exec_hdr_flags): Define as 0x2. + (MY(write_object_contents)): Set flags from backend info. + * i386aout.c (MY(backend_data)): Initialize exec_hdr_flags field. + * i386mach3.c (MY(backend_data)): Likewise. + * mipsbsd.c (MY(backend_data)): Likewise. + * sparclynx.c (NAME(aout,sparclynx_write_object_contents)): Set + flags from backend info. + (sparclynx_aout_backend): Initialize exec_hdr_flags field. + +Wed May 4 02:56:00 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * config.bfd (i386-*-gnu*): Treat like i386-*-mach*. + (m68*-apollo-*): Treat all Apollo configs the same, don't handle + BSD specially. + +Tue May 3 19:43:21 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * cache.c: Rewrote to work correctly. + * libbfd.h: Rebuilt. + * opncls.c (bfd_cache_init, bfd_open_file): Don't declare. + (bfd_fdopenr): Check return value of bfd_cache_init. + +Fri Apr 29 15:08:23 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * cf-m68klynx.c (CALC_ADDEND): Check for PC relative relocs by + enumerating them, since the reloc type can not serve as an index + into the m68k COFF howto_table. + +Fri Apr 29 09:42:39 1994 Steve Chamberlain (sac@cygnus.com) + + * config.bfd (*-go32): Changed to coff. + * coff-h8300.c (JMPL1): Get HOWTO right for 24bit branches. + * srec.c (srec_write_symbols): Write out the correct number of + symbols and don't stick in extra nulls. + +Tue Apr 26 15:07:24 1994 Stan Shebs (shebs@andros.cygnus.com) + + * cf-sparclynx.c (LYNXOS, COFF_LONG_FILENAMES): Define. + * coff-sparc.c (BADMAG): Recognize LYNXCOFFMAGIC. + (COFF_SPARC): Define. + * coffcode.h (coff_new_section_hook): If COFF_SPARC, set alignment + power of data and bss sections to 3. + * hosts/lynx.h (__LYNXOS): Define. + +Tue Apr 26 15:04:26 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (hppa_elf_reloc): Adjust the addend of relocations + against section symbols to avoid losing during ld -r. + +Tue Apr 26 12:16:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (shstrtab_length_fixed): Remove useless static + variable. + (struct elf_sect_data): Remove unused structure. + (elf_object_p): Free memory if error occurs. Check return value + of bfd_default_set_arch_mach. If elf_get_str_section fails, + preserve error code rather than setting wrong_format. + (null_shdr): Remove static variable. + (assign_section_numbers): Remove shstrtab_length_fixed assignment. + Allocate first section header on BFD obstack rather than using + null_shdr. + (bfd_prpsinfo): Remove unused local variable newsect. + +Mon Apr 25 15:31:04 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (write_relocs): Undo patch of Apr 10; breaks Solaris. + + * elfcode.h (bfd_section_from_shdr): Use bfd_make_section_anyway + to create sections. Check return value of recursive calls. + (bfd_section_from_phdr): Check return value of bfd_make_section. + (elf_symbol_from_bfd_symbol): Likewise. + (elf_object_p): Check return value of bfd_section_from_shdr. + (section_from_elf_index): Likewise. + (elf_slurp_symbol_table): Check return value of + section_from_elf_index. + (bfd_prstatus): Return boolean value. Check return value of + bfd_make_section. + (bfd_fpregset): Likewise. + (bfd_prpsinfo): Return boolean value. + (elf_corefile_note): Check return values of bfd_prstatus, + bfd_fpregset, and bfd_prpsinfo. + (elf_core_file_p): Check return value of elf_corefile_note. + +Fri Apr 22 11:08:38 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Get rid of the ECOFF .reginfo section hack. + * ecoff.c (ecoff_mkobject_hook): Don't create a .reginfo section. + (ecoff_new_section_hook): Don't handle the .reginfo section. + (ecoff_sizeof_headers): Likewise. + (ecoff_get_section_contents): Likewise. + (ecoff_compute_section_file_positions): Likewise. + (ecoff_compute_reloc_file_positions): Likewise. + (ecoff_set_section_contents): Likewise. + (ecoff_write_object_contents): Likewise. + (ecoff_bfd_final_link): Likewise. + (ecoff_bfd_copy_private_bfd_data): Copy the GP value and the + register masks. + (bfd_ecoff_get_gp_value): New function. + (bfd_ecoff_set_gp_value): New function. + (bfd_ecoff_set_regmasks): New function. + * bfd-in.h (bfd_ecoff_get_gp_value): Declare. + (bfd_ecoff_set_gp_value): Declare. + (bfd_ecoff_set_regmasks): Declare. + * bfd-in2.h: Rebuilt. + + Fix ECOFF objcopy to actually copy debugging information. + * ecoff.c (ecoff_bfd_copy_private_bfd_data): New function. + (ecoff_get_extr): Assume that any ECOFF symbol with local clear is + an external symbol, rather than checking the symbol flags. Only + check the flags for non-ECOFF symbols. + * ecofflink.c (bfd_ecoff_debug_externals): Don't crash if the + output_section field of the symbol section is NULL. + * libecoff.h (ecoff_bfd_copy_private_bfd_data): Declare as + function rather than defining as macro. + + * ieee.c (ieee_object_p): Set bfd_error_got_wrong_format if + appropriate. + + * targets.c (bfd_target_vector): Add bfd_elf32_powerpc_vec. + + * aout-adobe.c (aout_adobe_set_arch_mach): Check return value of + bfd_default_set_arch_mach. Accept bfd_arch_m68k as well as + bfd_arch_unknown. + * coffcode.h (coff_set_arch_mach): Check return value of + bfd_default_set_arch_mach. + * elfcode.h (elf_set_arch_mach): Don't check a list of ELF + architectures, just see if the desired architecture matches what + the ELF backend permits. + + * coffcode.h (coff_set_arch_mach_hook): Rename SHMAGIC to + SH_ARCH_MAGIC to match change in coff/sh.h. + (coff_set_flags): Likewise. + + Follow convention in which each NLM header has an 8 byte stamp + followed by a four byte length. + * libnlm.h (struct nlm_obj_tdata): Rename nlm_cygnus_section_hdr + to nlm_cygnus_ext_header, and change type to + Nlm_Internal_Cygnus_Ext_Header. + (nlm_cygnus_ext_header): Rename from nlm_cygnus_section_header. + * nlmcode.h (nlm_swap_auxiliary_headers_in): Use CyGnUsEx instead + of CyGnUsSeCs. Rename from cygnus_section to cygnus_ext. Require + length word to be 8. + (nlm_swap_auxiliary_headers_out): Rename from cygnus_section to + cygnus_ext. Set length word to 8. + (nlm_compute_section_file_positions): Rename from cygnus_section + to cygnus_ext. + +Thu Apr 21 22:54:22 1994 Stu Grossman (grossman at cygnus.com) + + * nlmcode.h (nlm_swap_auxiliary_headers_in): Keep section table + (from CyGnUsSeCs) in more permanent memory to keep section names + from getting trashed. + +Thu Apr 21 09:29:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * libelf.h (elf_obj_tdata): Add members for dynamic symbol table + handling. + * elfcode.h (bfd_section_from_shdr): Handle dynamic symbol table. + * elfcode.h (elf_slurp_symbol_table): Take additional parameter + to select static or dynamic symbol table and return number of + symbols slurped or -1 on error. + * elfcode.h (elf_get_symtab): Set bfd symcount from + elf_slurp_symbol_table result. + * elfcode.h (elf_get_dynamic_symtab_upper_bound, + elf_canonicalize_dynamic_symtab): New functions to handle dynamic + symbol table. + * elf32-target.h, elf64-target.h (BFD_JUMP_TABLE_DYNAMIC): + Change to handle dynamic symbol table, provide default definitions + for dynamic relocs. + * aoutx.h (howto_table_std, NAME(aout,swap_std_reloc_out), + NAME(aout,swap_std_reloc_in), aout_link_input_section_std, + aout_link_reloc_link_order): Handle r_jmptable and r_relative + relocations. + +Thu Apr 21 11:58:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Clean up uses of _bfd_dummy_target (from Peter Schauer). + * libbfd.c (_bfd_dummy_target): Set bfd_error_wrong_format. + * nlm-target.h (nlm_core_file_p): Define as _bfd_dummy_target, not + NULL. + * srec.c (srec_vec): Use _bfd_dummy_target, not NULL, in + _bfd_check_format. + (symbolsrec_vec): Likewise. + * tekhex.c (tekhex_vec): Likewise. + + * libnlm.h (struct nlm_obj_tdata): Add nlm_cygnus_section_hdr + field. + (nlm_cygnus_section_header): New accessor macro. + * nlmcode.h (nlm_object_p): Free new tdata structure if failure. + Add fixed sections before swapping in auxiliary headers. After + adding sections, treat errors as real, not as wrong format. + (nlm_swap_auxiliary_headers_in): Swap in the sections header; add + sections to the BFD for each section it describes. + (nlm_swap_auxiliary_headers_out): Swap out the sections header. + (nlm_compute_section_file_positions): Account for the size of the + sections header. + +Wed Apr 20 16:45:51 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * coff-sparc.c (sparccoff_vec): Change minimum alignment power to + 2, so that stab sections can be multiples of 4 bytes only. + + * hosts/i386aix.h: Changes to avoid prototypes conflicts with the + ones defined in stdlib.h. (From Minh Tran-Le.) + +Wed Apr 20 14:15:21 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlm32-ppc.c: Complete rewrite for new version of PowerPC + NetWare. Old code still present, but ifdeffed out. + + * nlmcode.h (nlm_swap_auxiliary_headers_in): Don't assume a + particular format for the customer header. Allocate a block of + memory and read it into that. + (nlm_swap_auxiliary_headers_out): Write out the block of memory. + (nlm_compute_section_file_positions): Include length of customer + header when computing its size. + +Mon Apr 18 14:27:17 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_prep_headers): Get the space's number from the + backend private section data rather than target_index. + (bfd_som_set_section_attributes): Store the space's number + in the backend private section data rather than target_index. + + * som.h (som_copyable_section_data_struct): Add space_number. + +Fri Apr 15 12:22:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-a29k.c (reloc_processing): Always set the address of a + R_IHCONST reloc to that of the immediately preceding R_IHIHALF. + gas does this anyhow, but some other assemblers seem to leave + garbage in the R_IHCONST address field. + + * bfd/archive.c: Consistently use ARFMAG; from + schwab@issan.informatik.uni-dortmund.de (Andreas Schwab). + (_bfd_write_archive_contents): Use ARFMAG rather than '`' and + '\012'. + (bsd_write_armap): Likewise. + (coff_write_armap): Likewise. + + * coff-mips.c (mips_relocate_section): When relaxing, adjust local + relocs against the .text section as required. + * ecofflink.c (bfd_ecoff_debug_accumulate): When relaxing, adjust + PDR addresses as required. + + * ecoff.c (ecoff_emit_aggregate): Take fdr argument. Map fdr + index through rfd map if it exists. Check for a couple of cases + which gdb handles specially. Change all callers. + (ecoff_type_to_string): Take fdr argument rather than aux_ptr and + bigendian argument. Change all callers. + (ecoff_print_symbol): Handle stStruct, stUnion and stEnum. + +Thu Apr 14 13:05:10 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-mips.c (mips_howto_table): Add dummy entries to account for + numbering changes in include/coff/mips.h. Add entries for + MIPS_R_RELHI and MIPS_R_RELLO. + (mips_ecoff_swap_reloc_in): Handle an extra bit for the reloc type + when little endian. Treat internal MIPS_R_RELLO or MIPS_R_RELHI + relocs like MIPS_R_SWITCH, and convert r_offset from 24 to 32 + bits. + (mips_ecoff_swap_reloc_out): Likewise. + (mips_adjust_reloc_in): Handle internal MIPS_R_RELLO or + MIPS_R_RELHI relocs like MIPS_R_SWITCH. + (mips_adjust_reloc_out): Likewise. + (mips_relhi_addr, mips_relhi_addend): New static variables. + (mips_relhi_reloc, mips_rello_reloc): New functions. + (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_PCREL_HI16_S into + MIPS_R_RELHI and turn BFD_RELOC_PCREL_LO16 into MIPS_R_RELLO. + (mips_relocate_hi): Rename from mips_relocate_refhi, and add pcrel + argument. Changed all callers. + (mips_relocate_section): Rename got_reflo to got_lo and + reflo_int_rel to lo_int_rel. Handle MIPS_R_RELLO and MIPS_R_RELHI + relocs. + (mips_relax_section): Adjust MIPS_R_RELHI/MIPS_R_RELLO pairs when + expanding a PC relative call. + + * reloc.c (bfd_reloc_code_real_type): Add BFD_RELOC_PCREL_HI16_S + and BFD_RELOC_PCREL_LO16. + * bfd-in2.h: Rebuilt. + +Wed Apr 13 11:50:07 1994 Stan Shebs (shebs@andros.cygnus.com) + + * coff-sparc.c (sparccoff_vec): Set minimum alignment power to 3. + +Tue Apr 12 13:36:20 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_write_fixups): Always emit at least + one relocation for any non-bss section. + +Mon Apr 11 14:41:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (assign_file_positions_except_relocs): Don't require + the file alignment to correspond to the page size when linking + with -N. + +Sun Apr 10 01:02:24 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elfcode.h (write_relocs): For rela relocations, adjust the + addend for relocations involving section symbols to account + for the lossage of 1:1 mapping from input section symbols to + output section symbols. + +Fri Apr 8 12:22:02 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (NAME(aout,make_sections)): New function. + (NAME(aout,some_aout_object_p)): Call NAME(aout,make_sections) + rather than making sections inline. + (NAME(aout,mkobject)): Don't make any sections. + (NAME(aout,adjust_sizes_and_vmas)): Call NAME(aout,make_sections). + (NAME(aout,final_link)): Don't dereference obj_textsec (abfd) or + obj_datasec (abfd) if they are NULL. + * libaout.h (NAME(aout,make_sections)): Declare. + * bout.c (b_out_mkobject): Don't make any sections. + (b_out_write_object_contents): Call aout_32_make_sections. + (b_out_set_section_contents): Likewise. + * i386os9k.c (os9k_mkobject): Don't make any sections. + (os9k_write_object_contents): Call aout_32_make_sections. + (os9k_set_section_contents): Likewise. + + * aoutx.h (NAME(aout,new_section_hook)): Don't set N_EXT in target + index. + +Wed Apr 6 20:44:56 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * config.bfd, configure.host: Add mips-*-sysv4* support. + +Thu Apr 7 14:23:05 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-mips.c (mips_howto_table): Add entry for MIPS_R_SWITCH. + (mips_ecoff_swap_reloc_in): For MIPS_R_SWTICH, copy r_symndx into + r_offset and set r_symndx to RELOC_SECTION_TEXT. + (mips_ecoff_swap_reloc_out): For MIPS_R_SWITCH, get the r_symndx + value from the r_offset field. + (mips_adjust_reloc_in): Maximum r_type value is now MIPS_R_SWITCH. + For MIPS_R_SWITCH, copy the r_offset field into the addend field. + (mips_adjust_reloc_out): For MIPS_R_SWITCH, copy the addend field + into the r_offset field. + (mips_switch_reloc): New function. + (mips_bfd_reloc_type_lookup): Translate BFD_RELOC_GPREL32 into + MIPS_R_SWITCH. + (mips_relocate_section): Handle MIPS_R_SWITCH. + (mips_relax_section): Adjust MIPS_R_SWITCH offset if necessary. + +Thu Apr 7 11:10:51 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elfcode.h (elf_set_section_contents): Support calling the backend + function elf_backend_begin_write_processing when just beginning to + write an object file. + + * libelf.h (elf_backend_begin_write_processing): Declare. + + * elf{32,64}-target.h (elf_backend_begin_write_processing): Provide + a default definition. + (elf{32,64}_bed): Add elf_backend_begin_write_processing. + + * elf32-hppa.h (elf_hppa_tc_symbol): Delete extern declaration. + (elf_hppa_tc_make_sections): Likewise. + + * elf32-hppa.c (symext_chain_built): Delete. + (symext_chain_size): Renamed from symextn_contents_real_size. + (elf32_hppa_backend_{begin,final}_write_processing): New functions. + (add_entry_to_symext_chain): New function. + (hppa_elf_set_section_contents): Ignore writes to the symbol extension + section until it's been rebuilt internally. + (hppa_elf_get_section_contents): Symbol extension section is no + longer special. + (elf_backend_{begin,final}_write_processing): Define. + (elf_hppa_tc_make_sections): Simplify now that much code has + migrated into elf32_hppa_backend_{being,final}_write_processing. + +Wed Apr 6 17:24:14 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Add new target vectors to read the dynamic symbols and dynamic + relocs. Change a.out to use these rather than reading the dynamic + symbols and relocs along with the normal symbols and relocs. + * targets.c (bfd_target): Add fields + _bfd_get_dynamic_symtab_upper_bound, + _bfd_canonicalize_dynamic_symtab, + _bfd_get_dynamic_reloc_upper_bound, + _bfd_canonicalize_dynamic_reloc. + (BFD_JUMP_TABLE_DYNAMIC): Define. + * libbfd-in.h (_bfd_nodynamic_get_dynamic_symtab_upper_bound): + Define. + (_bfd_nodynamic_canonicalize_dynamic_symtab): Define. + (_bfd_nodynamic_get_dynamic_reloc_upper_bound): Define. + (_bfd_nodynamic_canonicalize_dynamic_reloc): Define. + * bfd.c (bfd_get_dynamic_symtab_upper_bound): Define. + (bfd_canonicalize_dynamic_symtab): Define. + (bfd_get_dynamic_reloc_upper_bound): Define. + (bfd_canonicalize_dynamic_reloc): Define. + * sunos.c (MY_read_dynamic_symbols): Don't define. + (MY_read_dynamic_relocs): Don't define. + (MY_get_dynamic_symtab_upper_bound): Define. + (MY_canonicalize_dynamic_symtab): Define. + (MY_get_dynamic_reloc_upper_bound): Define. + (MY_canonicalize_dynamic_reloc): Define. + (struct sunos_dynamic_info): Change type of dynsym_count and + dynrel_count to long. Add fields canonical_dynsym and + canonical_dynrel. + (sunos_read_dynamic_info): Check that BFD had DYNAMIC flag set. + Clear info->canonical_dynsym and info->canonical_dynrel. + (MY(read_dynamic_symbols)): Removed. + (MY(read_dynamic_relocs)): Removed. + (sunos_get_dynamic_symtab_upper_bound): New function. + (sunos_canonicalize_dynamic_symtab): New function. + (sunos_get_dynamic_reloc_upper_bound): New function. + (sunos_canonicalize_dynamic_reloc): New function. + * libaout.h: Declare struct reloc_ext_external and + reloc_std_external to avoid prototype problems. + (struct aout_backend_data): Remove fields read_dynamic_symbols and + read_dynamic_relocs. + (NAME(aout,translate_symbol_table)): Declare. + (NAME(aout,swap_ext_reloc_in)): Declare. + (NAME(aout,swap_std_reloc_in)): Declare. + * aoutx.h (NAME(aout,translate_symbol_table)): Renamed from + translate_symbol_table and made non-static. Changed all callers. + (NAME(aout,slurp_symbol_table)): Don't read dynamic symbols. + (NAME(aout,slurp_reloc_table)): Don't read dynamic relocs. + (NAME(aout,get_reloc_upper_bound)): Don't count dynamic relocs. + * aoutf1.h (aout_32_sunos4_write_object_contents): Don't bother to + remove dynamic symbols and relocs. They will no longer be + present. + (MY_read_dynamic_symbols): Don't define. + (MY_read_dynamic_relocs): Don't define. + (sunos4_aout_backend): Don't initialize dynamic entry points. + * aout-target.h (MY_read_dynamic_symbols): Don't define. + (MY_read_dynamic_relocs): Don't define. + (MY(backend_data)): Don't initialize dynamic entry points. + (MY_get_dynamic_symtab_upper_bound): If not defined, define to + _bfd_nodynamic version. + (MY_canonicalize_dynamic_symtab): Likewise. + (MY_get_dynamic_reloc_upper_bound): Likewise. + (MY_canonicalize_dynamic_reloc): Likewise. + * All backends: Added BFD_JUMP_TABLE_DYNAMIC to target vector. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + + * cf-m68klynx.c: Include sysdep.h. + + * hp300hpux.c: Removed some spaces in uses of NAME to avoid + problems with traditional C compilers. + + * targets.c (bfd_target): Rearranged fields in target vector. + Removed _bfd_debug_info_start, _bfd_debug_info_end and + _bfd_debug_info_accumulate, which were never used. + (BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined. + (BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined. + (BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined. + (BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined. + * All backends: Changed to use the new BFD_JUMP_TABLE_* macros + rather than the single JUMP_TABLE macro. Removed many of the + weird macro definitions needed to support the monolithic + JUMP_TABLE. + * bfd-in.h (JUMP_TABLE): Removed. + * libbfd-in.h: Define a bunch of macros, and declare a few + functions, for use with the new BFD_JUMP_TABLE_* macros. + * libbfd.c (_bfd_dummy_new_section_hook): Removed. + (bfd_false): Set bfd_error_invalid_operation. + (bfd_nullvoidptr): Likewise. + (bfd_n1): New function. + (_bfd_nocore_core_file_matches_executable_p): Renamed from + _bfd_dummy_core_file_matches_executable_p. + (_bfd_nocore_core_file_failing_command): Similar rename. Set + bfd_error_invalid_operation. + (_bfd_nocore_core_file_failing_signal): Likewise. + (_bfd_generic_get_section_contents): Renamed from + bfd_generic_get_section_contents. Changed all callers. + (_bfd_generic_set_section_contents): Similar rename. + * ieee.c: #if 0 out ieee_bfd_debug_info_start, + ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They + were never called. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + +Tue Apr 5 22:10:04 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * Crude support for examining dynamic libraries. + * som.c (som_object_setup): Set DYNAMIC flag for SHL_MAGIC and + DL_MAGIC objects. + (som_prep_headers): Preserve the system_id for DYNAMIC objects. + Use SHL_MAGIC as the magic number of the DYNAMIC flag is set. + Write exec headers for DYNAMIC objects. + (som_begin_writing): DYNAMIC objects have the same alignment + restrictions as D_PAGED objects. + (bfd_section_from_som_symbol): Treat DYNAMIC objects like EXEC_P + objects. + (object_flags): Add DYNAMIC. + +Tue Apr 5 17:48:52 1994 Stan Shebs (shebs@andros.cygnus.com) + + * i386lynx.c, sparclynx.c (NAME): Remove embedded whitespace in + macro uses, confuses some non-ANSI compilers. + +Tue Apr 5 15:50:01 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_free_cached_info): Add missing PARAMS decl. + Don't free anything if we don't have a bfd_object. + (som_close_and_cleanup): Call som_bfd_free_cached_info. + +Tue Apr 5 11:22:38 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-mips.c (mips_elf_final_link): Don't remove empty sections. + It turns out not to be required on Irix 5, and it causes problems + if the sections happen to contain symbols. + + * elfcode.h (write_shdrs_and_ehdr): Correct bfd_write check. + + * aoutx.h (NAME(aout,canonicalize_reloc)): Don't error out if + section->relocation is NULL; malloc might have returned NULL when + given a zero size if there were no relocations. + * bout.c (b_out_canonicalize_reloc): Likewise. + * coffcode.h (coff_canonicalize_reloc): Likewise. + * ecoff.c (ecoff_canonicalize_reloc): Likewise. + * elfcode.h (elf_canonicalize_reloc): Likewise. + * mipsbsd.c (MY(canonicalize_reloc)): Likewise. + * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. + * nlmcode.h (nlm_canonicalize_reloc): Likewise. + * som.c (som_canonicalize_reloc): Likewise. + * hp300hpux.c (MY(slurp_reloc_table)): Likewise. Also, if malloc + returns NULL, don't report an error if we asked for zero bytes. + * i386lynx.c (NAME(lynx,slurp_reloc_table)): If malloc returns + NULL, don't report an error if we asked for zero bytes. + * nlmcode.h (nlm_slurp_reloc_fixups): Likewise. + +Mon Apr 4 15:30:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (NAME(aout,bfd_free_cached_info)): Don't free anything + if we don't have a bfd_object. + + Made sure that every call to bfd_read, bfd_write, and bfd_seek + checks the return value and handled bfd_error correctly. These + changes are not itemised. Also: + * aoutx.h (emit_strtab): Change return type to boolean, and return + errors. + (NAME(aout,write_syms)): Check emit_strtab return value. + (NAME(aout,final_link)): Likewise. + * coffcode.h (coff_write_relocs): Change return type to boolean, + and return errors. + (coff_write_object_contents): Check coff_write_relocs return + value. + * i386os9k.c (os9k_swap_exec_header_in): Change return type to + boolean. + (os9k_object_p): Check os9k_swap_exec_header_in return value. + * oasys.c (oasys_read_record): Change return type to boolean. + (oasys_slurp_symbol_table: Check oasys_read_record return value. + (oasys_object_p, oasys_slurp_section_data): Likewise. + (oasys_write_record): Change return type to boolean. + (oasys_write_syms): Likewise. Also, check oasys_write_record + return value. + (oasys_write_sections): Check oasys_write_record return value. + (oasys_write_header): Change return type to boolean. Check + oasys_write_record return value. + (oasys_write_end, oasys_write_data): Likewise. + (oasys_write_object_contents): Check return values of + oasys_write_header, oasys_write_syms, oasys_write_data, and + oasys_write_end. + * srec.c (srec_write_record): Change return type to boolean. + (srec_write_header): Likewise. Also, check srec_write_record + return value. + (srec_write_section, srec_write_terminator): Likewise. + (srec_write_symbols): Change return type to boolean. + (internal_srec_write_object_contents): Check return value of + srec_write_symbols, srec_write_header, srec_write_section, and + srec_write_terminator. + + * Makefile.in: Rebuilt dependencies. + +Mon Apr 4 10:56:45 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * aix386-core.c (aix386_bfd_is_local_label): Correct cast from + asection to asymbol. + * ptrace-core.c (ptrace_unix_bfd_is_local_label): Correct cast from + bfd to asymbol. + * trad-core.c (trad_unix_bfd_is_local_label): Correct cast from + asection to asymbol. + +Sun Apr 3 18:27:29 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_slurp_string_table): Use malloc to allocate space + for the cached copy of the native string table. + (som_slurp_symbol_table): Likewise for the native symbol table. + (som_slurp_reloc_table): Likewise for the native and generic + relocation tables. + (som_bfd_free_cached_info): Free the cached native strings, + symbols, and relocations. Also free the canonical cached + relocations. + +Fri Apr 1 12:40:58 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_write_symbols): If keep_memory is false, make + sure the symbol name is stored in permanent memory before adding + it to the string table. + + * archive.c (_bfd_write_archive_contents): Once we've found an + object, don't bother to look for more when deciding whether to + build a map. + (compute_and_write_armap): After adding the symbols for a BFD, + call bfd_free_cached_info on it. + + Add bfd_free_cached_info support to a.out backends. + * aoutx.h (aout_get_external_symbols): Renamed from + aout_link_get_symbols. Read strings even if symbols have been + read. Store string size in obj_aout_string_size. + (NAME(aout,slurp_symbol_table)): Call aout_get_external_symbols to + read the symbols. Allocate the cached symbols with malloc, not + bfd_alloc. + (NAME(aout,slurp_reloc_table)): Allocate the cached relocs with + malloc, not bfd_alloc. + (NAME(aout,bfd_free_cached_info)): New function; free cached + symbols and relocs. + * libaout.h (struct aoutdata): Add external_string_size field. + (obj_aout_external_string_size): New accessor macro. + (NAME(aout,close_and_cleanup)): Don't declare. + (NAME(aout,bfd_free_cached_info)): Declare. + (aout_32_close_and_cleanup): Don't define. + (aout_64_close_and_cleanup): Don't define. + * aout-target.h (MY_bfd_free_cached_info): If not already defined, + define as NAME(aout,free_cached_info). + (MY_close_and_cleanup): If not already defined, define as + MY_bfd_free_cached_info. + * aout-adobe.c (aout_32_close_and_cleanup): Define. + (aout_32_bfd_free_cached_info): Don't define. + * bout.c (aout_32_close_and_cleanup): Define. + (aout_32_bfd_free_cached_info): Don't define. + * hp300hpux.c (MY_bfd_free_cached_info): Define as bfd_true. + (MY_close_and_cleanup): Don't define. + * i386lynx.c (NAME(lynx,slurp_reloc_table)): Allocate the cached + relocs with malloc, not bfd_alloc. + * i386os9k.c (aout_32_close_and_cleanup): Define. + (aout_32_bfd_free_cached_info): Don't define. + + Add a new entry point to free memory cached by a BFD. + * targets.c (bfd_target): Add _bfd_free_cached_info field. + * bfd.c (bfd_free_cached_info): Define. + * bfd-in.h (JUMP_TABLE): Add _bfd_free_cached_info. + * bfd-in2.h: Rebuilt. + * All backends: Initialize bfd_free_cached_info entry point to + bfd_true. + + * elf32-hppa.c (elf_hppa_reloc_type_lookup): Correct type of + first, unused, argument. + (hppa_elf_is_local_label): Declare instead of + som_bfd_is_local_label. + + * coff-a29k.c (a29k_reloc): Add reloc_entry->address to value of + absolute R_IREL reloc. + +Thu Mar 31 11:52:15 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Added some support for Irix 4 shared libraries. + * ecoff.c (ecoff_new_section_hook): Set SEC_SHARED_LIBRARY for a + .lib section. + (ecoff_sec_to_styp_flags): Set SEC_SHARED_LIBRARY if + STYP_ECOFF_LIB bit is set. + (ecoff_compute_section_file_positions): Round the contents of a + .lib section up to the next page boundary. + (ecoff_set_section_contents): If we see a .lib section, increment + the vma by one to count the number of shared libraries we have. + (ecoff_write_object_contents): Don't crash if we see a + STYP_ECOFF_LIB section, and don't adjust text_start or data_start + or bss_size either. + + * coffcode.h (CALC_ADDEND): Change to fetch original symbol value + from original BFD, rather than using value of current BFD symbol. + Needed for new linker. + * coff-sparc.c (CALC_ADDEND): Likewise. + + * ecoff.c (ecoff_write_object_contents): Set the text_start and + data_start entries in the optional header correctly even if a text + or data section starts at location zero. + + * reloc.c (bfd_reloc_code_real_type): Added BFD_RELOC_26 (from sef + and raeburn). + * bfd-in2.h: Rebuilt. + + * nlm32-i386.c (nlm_i386_read_import): Null terminate the symbol + name. + * nlm32-alpha.c (nlm_alpha_read_import): Likewise. + * nlm32-sparc.c (nlm_sparc_read_import): Likewise. + + * coffgen.c (coff_write_symbol): Reindented. Changed to return + boolean, and changed written to unsigned int *. Check error + returns from called functions. + (coff_write_alien_symbol): Likewise. + (coff_write_native_symbol): Likewise. + (coff_write_symbols): Likewise. Reworked checks on whether to + write symbol name to string table for clarity and to avoid core + dumping when given a non COFF symbol. + * libcoff-in.h (coff_write_symbols): Declare as returning boolean. + * libcoff.h: Rebuilt. + * coffcode.h (coff_write_object_contents): Check return value of + coff_write_symbols. + +Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Changes to let BFD return an error indication from + get_symtab_upper_bound, bfd_canonicalize_symtab, + bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now + return long instead of unsigned int, and use -1 to indicate an + error. Along the way, rename get_symtab_upper_bound to + bfd_get_symtab_upper_bound. + * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on + errors. + (bfd_canonicalize_reloc): Likewise. + * syms.c (bfd_get_symtab_upper_bound): Renamed from + get_symtab_upper_bound. + * targets.c (bfd_target): Renamed _get_symtab_upper_bound to + _bfd_get_symtab_upper_bound, and changed it and + _bfd_canonicalize_symtab and _get_reloc_upper_bound and + _bfd_canonicalize_reloc to all return long. + * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. + (NAME(aout,canonicalize_reloc)): Likewise. + (NAME(aout,get_reloc_upper_bound)): Likewise. + (NAME(aout,get_symtab_upper_bound)): Likewise. + * bout.c (b_out_canonicalize_reloc): Likewise. + (b_out_get_reloc_upper_bound): Likewise. + * coffcode.h (coff_canonicalize_reloc): Likewise. + * coffgen.c (coff_get_symtab_upper_bound): Likewise. + (coff_get_symtab): Likewise. + (coff_get_reloc_upper_bound): Likewise. + * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. + (ecoff_get_symtab): Likewise. + (ecoff_canonicalize_reloc): Likewise. + * elfcode.h (elf_get_symtab_upper_bound): Likewise. + (elf_get_reloc_upper_bound): Likewise. + (elf_canonicalize_reloc): Likewise. + (elf_get_symtab): Likewise. + * hp300hpux.c (MY(get_symtab)): Likewise. + (MY(get_symtab_upper_bound)): Likewise. + (MY(canonicalize_reloc)): Likewise. + * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. + * ieee.c (ieee_slurp_external_symbols): Change return type to + boolean. Check for errors from get_symbol. + (ieee_slurp_symbol_table): Change return type to boolean. Check + for errors from ieee_slurp_external_symbols. + (ieee_get_symtab_upper_bound): Return long, and -1 on errors. + (ieee_get_symtab): Likewise. + (ieee_get_reloc_upper_bound): Likewise. + (ieee_canonicalize_reloc): Likewise. + * mipsbsd.c (MY(canonicalize_reloc)): Likewise. + * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. + (nlm_get_symtab): Likewise. + (nlm_get_reloc_upper_bound): Likewise. + (nlm_canonicalize_reloc): Likewise. + * oasys.c (oasys_get_symtab_upper_bound): Likewise. + (oasys_get_symtab): Likewise. + (oasys_get_reloc_upper_bound): Likewise. + (oasys_canonicalize_reloc): Likewise. + * som.c (som_get_symtab_upper_bound): Likewise. + (som_get_symtab): Likewise. + (som_get_reloc_upper_bound): Likewise. + (som_canonicalize_reloc): Likewise. + * srec.c (srec_get_symtab_upper_bound): Likewise. + (srec_get_symtab): Likewise. + (srec_get_reloc_upper_bound): Define as bfd_0l. + (srec_canonicalize_reloc): Likewise. + * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. + (tekhex_get_symtab_upper_bound): Likewise. + (tekhex_get_reloc_upper_bound): Define as bfd_0l. + (tekhex_canonicalize_reloc): Likewise. + * libaout.h (NAME(aout,get_symtab_upper_bound)): Change + declaration to return long. + (NAME(aout,get_symtab)): Likewise. + (NAME(aout,canonicalize_reloc)): Likewise. + (NAME(aout,get_reloc_upper_bound)): Likewise. + * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. + (coff_get_symtab): Likewise. + (coff_get_reloc_upper_bound): Likewise. + * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. + (ecoff_get_symtab): Likewise. + (ecoff_canonicalize_reloc): Likewise. + * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. + (bfd_elf32_get_symtab): Likewise. + (bfd_elf32_get_reloc_upper_bound): Likewise. + (bfd_elf32_canonicalize_reloc): Likewise. + (bfd_elf64_get_symtab_upper_bound): Likewise. + (bfd_elf64_get_symtab): Likewise. + (bfd_elf64_get_reloc_upper_bound): Likewise. + (bfd_elf64_canonicalize_reloc): Likewise. + * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. + (nlmNAME(get_symtab)): Likewise. + (nlmNAME(get_reloc_upper_bound)): Likewise. + (nlmNAME(canonicalize_reloc)): Likewise. + * archive.c (compute_and_write_armap): Use error_return and + no_memory_return labels rather than freeing information in various + places. Change storage, symcount and src_count to long. Check + errors from bfd_get_symtab_upper_bound and + bfd_canonicalize_symtab. + * bout.c (b_out_relax_section): Change reloc_size to long. Check + for errors from bfd_get_reloc_upper_bound and + bfd_canonicalize_reloc. + (b_out_get_relocated_section_contents): Likewise. + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): + Likewise. + * elf32-mips.c: Likewise. + * elf32-hppa.c (hppa_elf_stub_finish): Likewise. + (hppa_look_for_stubs_in_section): Check for errors from + bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and + bfd_canonicalize_reloc. + * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors + from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. + * linker.c (generic_link_read_symbols): Likewise. + (_bfd_generic_final_link): Check for errors from + bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. + * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. + * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. + (bfd_coff_reloc16_get_relocated_section_contents): Likewise. + * libbfd.c (bfd_0l): New function. + * libbfd-in.h (bfd_0l): Declare. + * aix386-core.c: Change get_symtab_upper_bound, get_symtab, + get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather + than bfd_0u. + * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. + * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + * libcoff.h: Rebuilt. + + * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables + temp and name. + +Wed Mar 30 08:33:04 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/dpx2.h: Define POSIX_UTIME. + +Wed Mar 30 00:31:49 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * i386dynix.c, config/i386-dynix.mt: New files, handling Dynix + variant of a.out. + * configure.in, config.bfd: Use them for Dynix. + * Makefile.in: Add dependencies for i386dynix.o. + * targets.c: Add definition for i386dynix_vec. + * hosts/symmetry.h: Do not define TRAD_CORE_USER_OFFSET for Dynix. + Define HOST_DATA_START_ADDR and TRAD_UNIX_CORE_FILE_FAILING_SIGNAL + for Dynix. Remove inclusion of dynix3.h, Dynix bfd is now handled by + i386dynix.c + +Mon Mar 28 12:53:27 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * Makefile.in (BFD32_BACKENDS): Add coff-sparc.o. + + * coffcode.h (coff_set_flags): Handle bfd_arch_powerpc like + bfd_arch_rs6000. + + * config.bfd (powerpc-*-aix*): New target; use rs6000.mt. + * config/rs6000.mt (SELECT_ARCHITECTURES): Add bfd_powerpc_arch. + + * aoutx.h (translate_from_native_sym_flags): Set SEC_RELOC flag + for generated constructor section. + +Sun Mar 27 16:25:22 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_begin_writing): New approach at dealing with holes + in executables left by the HP linker. Does not rely on subspace + alignments as subspaces are *NOT* guaranteed to be properly + aligned in an executable (can you believe that!). + +Sat Mar 26 10:25:43 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_get_section_contents): New function. Do not try + to actually read data from a section that doesn't have either + SEC_LOAD or SEC_DEBUGGING set (eg $BSS$) just return true. + + * libbfd.c (bfd_read): Set bfd_error as appropriate for a short + read. (bfd_error_system_call or bfd_error_file_truncated). + + * som.c: Do not blindly set bfd_error_system_call after a + failing bfd_read, bfd_write, or bfd_seek. In a few places + (like som_object_p) override the error status set by bfd_read. + + * aix386-core.c, aout-encap,c archive.c, bout.c: Likewise. + * coff-rs6000.c, coffgen.c ecoff.c, elf.c: Likewise. + * elf32-hppa.c, elfcode.h, hp300hpux.c, i386lynx.c: Likewise. + * nlm32-alpha.c, nlm32-i386.c, nlm32-sparc.c: Likewise. + + * som.c: Check return values from several bfd_{seek,read,write} + calls that we just assumed were not failing. + +Fri Mar 25 11:44:06 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * hosts/sysv4.h (HAVE_PROCFS): Add comments about ptx4. + * config/sysv4.mh: Add comment. + * config/symmetry.mh: Change comment. + * configure.host: Use sysv4, not symmetry, for i[34]86-sequent-sysv4*. + +Fri Mar 25 17:10:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Changes to support linker relaxing of embedded MIPS PIC code to + use a five instruction sequence for function calls which are out of + range of the bal instruction. + * libecoff.h (struct ecoff_section_tdata): Define. + (ecoff_section_data): Define. + (ecoff_bfd_relax_section): Don't define. + * ecoff.c (ecoff_final_link_debug_accumulate): Don't read or free + the debugging information if it has already been read. + (ecoff_indirect_link_order): Handle _cooked_size being different + from _raw_size. Don't reread the contents or the relocs if they + have already been read in. + * coff-mips.c (mips_howto_table): Change bitsize of PCREL16 from + 18 to 16. + (PCREL16_EXPANSION_ADJUSTMENT): Define. + (mips_relocate_refhi): Take adjust argument. + (mips_relocate_section): Handle reloc offsets stored in section + used_by_bfd field. Call mips_relax_pcrel16 to handle details of + expanding an out of range PCREL16. Keep trace of adjustments + required by expansions. Set s and unset h when converting a reloc + from undefined to section. Change handling of PC relative relocs: + if against a section, they are correct in the object file, if + against an external symbol they are pcrel_offset. + (mips_relax_section): New function. + (mips_relax_pcrel16): New function. + (ecoff_bfd_relax_section): Define. + * coff-alpha.c (ecoff_bfd_relax_section): Define. + * ecofflink.c (bfd_ecoff_debug_accumulate): Handle adjustments + built by mips_relax_section when writing out addresses. + * elf32-mips.c (mips_elf_read_ecoff_info): Clear adjust field. + + * aoutx.h (NAME(aout,find_nearest_line)): The caller expects + functionname_ptr to be set to a symbol name, so prepend + symbol_leading_char. + +Thu Mar 24 11:33:46 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * coff-h8300.c (h8300_reloc16_extra_cases): Add relaxing info + for 16bit relative branches. + * coff-h8500.c (r_high8, r_low16, r_high16): Don't complain on + overflow. + +Thu Mar 24 09:21:13 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_prep_for_ar_write): Ignore non-SOM objects. + (som_bfd_ar_write_symbol_stuff, som_write_armap): Likewise. + +Wed Mar 23 14:29:31 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * netbsd386.c (N_SET_FLAGS): Delete the old definition. + +Wed Mar 23 14:58:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Clean up the relaxing code for the new linker. + * targets.c (_bfd_relax_section): Take boolean *again argument + rather than asymbol list. + * bfd.c (bfd_relax_section): Change name of fourth argument from + symbols to again. + * reloc.c (bfd_generic_relax_section): Take boolean *again + argument rather than asymbol list. Always return true. + * bout.c: Include genlink.h. + (aligncode, perform_slip): Declare. + (perform_slip): Take BFD argument rather than asymbol list. + Changed all callers. Get the symbols from the BFD. Change the + hash table entry value as well as the symbol value. + (abs32code): Take BFD argument rather than asymbol list. Changed + all callers. + (aligncode): Likewise. + (b_out_relax_section): Take boolean *again argument rather than + asymbol list. Only return false if an error occurred. Set *again + to false. Get symbols from BFD. + * reloc16.c: Include genlink.h. + (bfd_perform_slip): Take BFD argument rather than asymbol list. + Get the symbols from the BFD. Change the hash table entry value + as well as the symbol value. + (bfd_coff_reloc16_relax_section): Take boolean *again argument + rather than asymbol list. Only return false if an error occurred. + Set *again to false. Get symbols from BFD. + * coffcode.h (bfd_coff_backend_data): Change + _bfd_coff_reloc16_estimate to take BFD argument rather than + asymbol list. + (bfd_coff_reloc16_estimate): Corresponding change. + (dummy_reloc16_estimate): Corresponding change. + * libcoff-in.h (bfd_coff_reloc16_relax_section): Change + declaration to take boolean * rather than asymbol list. + (bfd_perform_slip): Change declaration to take BFD rather than + asymbol list. + * coff-h8300.c (h300_reloc16_estimate): Take BFD argument rather + than asymbol list. Changed calls to bfd_perform_slip. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + * libcoff.h: Rebuilt. + * Makefile.in: Rebuilt dependencies. + + * genlink.h (_bfd_generic_link_get_symbols): Define. + (_bfd_generic_link_get_symcount): Define. + * linker.c (generic_link_read_symbols): New function. + (generic_link_add_object_symbols): Use it. Use + _bfd_generic_link_get_symbols and _bfd_generic_link_get_symcount + to get the symbols from the BFD. + (generic_link_check_archive_element): Likewise. + (_bfd_generic_final_link): Likewise. + (_bfd_generic_link_output_symbols): Likewise. + (default_indirect_link_order): Likewise. + (generic_link_add_symbol_list): Store pointer to hash table entry + in asymbol udata field. + +Tue Mar 22 13:09:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-mips.c (mips_howto_table): Add entry for new MIPS_R_PCREL16 + reloc, used in embedded PIC code. + (mips_adjust_reloc_in): Change sanity check to permit new reloc. + (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_16_PCREL_S2 into + MIPS_R_PCREL16. + + * elf32-mips.c (mips_elf_final_link): Account for link_order + relocs when allocating space for relocations. Set SEC_RELOC flag + for any section which has relocs. Handle link_order relocs in + link_order loop. Use _bfd_generic_link_add_symbols_collect for + add_symbls entry point. + + * linker.c (_bfd_generic_final_link): Set reloc_count to 0 before + counting relocs. Set SEC_RELOC flag for any section which has + relocs. + + * linker.c (_bfd_default_link_order): Handle bfd_data_link_order. + + * linker.c (_bfd_generic_link_add_symbols): Just call + generic_link_add_symbols. + (_bfd_generic_link_add_symbols_collect): New function, like + _bfd_generic_link_add_symbols but also collect constructors and + destructors by name as collect2 does. + (generic_link_add_symbols): New function, like old + _bfd_generic_link_add_symbols but with collect argument. + (generic_link_add_object_symbols): Take collect argument. + (generic_link_check_archive_element_no_collect): New function. + (generic_link_check_archive_element_collect): New function. + (generic_link_check_archive_element): Take collect argument. + (generic_link_add_symbol_list): Take collect argument. + (_bfd_generic_link_add_one_symbol): Rename constructor argument to + collect. + * libbfd-in.h (_bfd_generic_link_add_symbols_collect): Declare. + * libbfd.h: Rebuilt. + +Tue Mar 22 10:04:00 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * archive.c (bfd_construct_extended_name_table): Use ar_padchar + for first character in an extended name. + (_bfd_write_archive_contents): If ar_padchar == '/', then use + "//" as the name of the special archive member holding the + extended name table. + +Mon Mar 21 12:28:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Support for link_order types which generate relocs in order to + support -Ur in the linker. + * linker.c (generic_link_add_symbol_list): Remove bitsize argument + from call to _bfd_generic_link_add_one_symbol. + (_bfd_generic_link_add_one_symbol): Remove bitsize argument. + Don't pass bitsize to constructor call back. Pass BFD_RELOC_CTOR + instead of bitsize to add_to_set call back. + (_bfd_generic_final_link): Account for link_order relocs when + allocating space for relocations. Handle them in link_order loop. + (_bfd_generic_reloc_link_order): New function. + (_bfd_default_link_order): If a reloc_link_order is seen here, + abort. + (_bfd_count_link_order_relocs): New function. + * libbfd-in.h (_bfd_generic_link_add_one_symbol): Remove bitsize + argument from declaration. + (_bfd_generic_reloc_link_order): Declare. + (_bfd_count_link_order_relocs): Declare. + * libbfd.h: Rebuilt. + * aoutx.h (aout_link_add_symbols): Remove bitsize argument from + call to _bfd_generic_link_add_one_symbol. + (NAME(aout,final_link)): Account for link_order relocs when + allocating space for relocations. Handle them after handling all + input BFDs. + (aout_link_reloc_link_order): New function. + * ecoff.c (ecoff_link_add_externals): Remove bitsize argument from + call to _bfd_generic_link_add_one_symbol. + (ecoff_bfd_final_link): Account for link_order relocs when + allocating space for relocations. Handle them in link_order loop. + (ecoff_link_write_external): Set the storage class of a defined + linker created symbol based on the section it is in. Correct + bfd_link_hash_weak case to use .sc rather than .st. + (ecoff_reloc_link_order): New function. + * coff-alpha.c (alpha_bfd_reloc_type_lookup): Handle + BFD_RELOC_CTOR. + * coff-mips.c (mips_bfd_reloc_type_lookup): Likewise. + + * sunos.c (sunos_read_dynamic_info): Remove unused locals dynsym + and buf. + + * cisco-core.c (cisco_core_file_p): Only pass one argument to + bfd_zmalloc. Free a pointer, not a union. + (cisco_bfd_is_local_label): Correct cast from asection to asymbol. + +Sun Mar 20 09:24:36 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * bfd/som.c (som_begin_writing): Fix thinko (off by one error). + + * som.c (bfd_section_from_som_symbol): Only to do the value + comparison for function symbols within executables. + + * som.c (bfd_section_from_som_symbol): Renamed from + som_section_from_subspace_index. Pass in a native SOM symbol. + For executables, iterate through the sections to find out + which contains the symbol's address rather than using the + symbol_info field. (symbol_info has a different meaning for + dynamicly linked executables.) + + * trad-core.c (trad_unix_core_file_p): Don't pass abfd to + bfd_zmalloc. + + * som.c (som_begin_writing): Fix braino (one call to align + space/subspace data was done unconditionally rather than + just for executables.) + + * som.c (som_begin_writing): Align text in all executables to + make HPUX kernel happy. Fixes strip/objcopy for shared + executables. + +Sat Mar 19 07:06:59 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_begin_writing): Account for alignment needs of + subspaces too when writing executables. Never request a negative + bss size. Fixes some problems with demand paged executables, + still having problems with pure executables and shared executables. + +Fri Mar 18 19:12:47 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * trad-core.c (trad_unix_core_file_p): Call bfd_zmalloc not + bfd_zalloc for rawptr, because later on we may call free, not + bfd_release, on it. + + * bfd.c (struct _bfd): Add cisco_core_struct to tdata union. + * libbfd.c (bfd_read, bfd_seek): Add comments regarding errors. + * cisco-core.c: New file. + * Makefile.in: Change accordingly. + * configure.in: Recognize cisco_core_vec. + * config/m68k-aout.mt (SELECT_VECS): Add cisco_core_vec. + * targets.c: Add cisco_core_vec. + * bfd-in2.h: Rebuilt. + +Fri Mar 18 18:13:49 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.h (som_copyable_section_data_struct): New structure + containing all the private section information which needs + to be copied from input section to output section during + objcopy or strip. + (som_section_data_struct): Remove several fields now in + som_copyable_section_data_struct. Make the space and + subspace dictionaries be pointers (to save space when + only reading objects). + + * som.c (bfd_som_set_section_attributes): Now returns a boolean; + some references changed. Allocate a copyable data stucture if + none exists. Store info into the copyable data structure. + (bfd_som_set_subsection_attributes): Likewise. + (som_is_space, som_is_subspace, som_is_container): New functions. + Use these instead of directly accessing private data. + (som_prep_headers): Allocate space and subspace headers here. + Fill in some fields in the space/subspace headers from the + copyable data. + (som_bfd_copy_private_section_data): Only copy the stuff + that we really need to make objcopy and strip work. Allocate + the copy_data structure for the output bfd before copying. + + * som.h (struct som_exec_data): New structure to hold exec + info that must be preserved when running objcopy/strip. + (struct somdata): Add new "exec_data" field and accessor + macro. Add some comments on how the various fields are used. + (som_section_data_struct): Make is_space and is_subspace bitfields. + Delete unused subspace_index. All references now use the + target_index field within the section structure itself. + + * som.c (make_unique_section): Delete unused declaration. + (som_bfd_copy_private_bfd_data): New function. + (som_object_setup): Allocate space for and save exec information + that needs to be copied during objcopy/strip. + (som_mkobject): Do not allocate space for a file header here. + It is not used when only reading SOM objects. + (som_prep_headers): Allocate space for and attach a file header + to the output bfd. For executables, use the saved system_id + value rather than trying to guess the right value. Do not abort + wwhen setting file_hdr->entry* for executables. + (som_begin_writing): For executables, set the exec_entry and + exec_flags fields. + (som_copy_private_backend_section_data): Always return a value. + + * libhppa.h (PA_PAGESIZE): Define. + + * som.c (SOM_ALIGN): Define. + (som_begin_writing): If writing an executable, initialize all + fields in the exec header to zero. Update fields in the exec + header as sizes of loadable subspaces are computed. Carefully + preserve alignments when building executables. Actually write the + exec after all the fields are filled in. + + * Better long-filename handling. Reads SOM ABI compliant extended + names, but doesn't quite write compliant extended names yet. + * som.c (som_slurp_extended_name_table): Delete function. The + generic code will handle things correctly. + (som_slurp_armap): Seek to the beginning of the next member. + (normalize): New function. + (som_bfd_ar_write_symbol_stuff): Take the size of the extended + name table into account when computing the file offsets in the + SOM dictionary. Make sure to align to an even boundary. + (som_write_armap): Initialize the checksum to zero. + (ar_maxchars): Fix. Opps. + +Fri Mar 18 20:35:24 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * aoutx.h (reloc_type_lookup): Handle BFD_RELOC_CTOR on a 64-bit + machine. Handle BFD_RELOC_SPARC13 and BFD_RELOC_SPARC_BASE13. + +Thu Mar 17 18:26:46 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * bfd-in.h (BFD_VERSION): Use @VERSION@. + * Makefile.in (bfd.h): Replace it with contents of VERSION file. + * bfd-in2.h: Regenerated. + + * trad-core.c (trad_unix_bfd_is_local_label): Fixed typo where + this was also named trad_unix_bfd_copy_private_bfd_data. + +Thu Mar 17 10:37:07 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aoutx.h, elfcode.h, coff-alpha.c, bout.c, ecoff.c, ecofflink.c, + elf32-hppa.c, elf32-mips.c, linker.c, som.c, sunos.c: If malloc(0) + returns NULL, it is not an error. It's possible that some of + these checks are not necessary (because the size can never be + zero), but putting in the checks is the conservative thing to do + in light of the fact that some of these malloc calls replaced + unchecked alloca calls, in which a zero argument would work fine. + +Thu Mar 17 11:44:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * osf-core.c (osf_core_bfd_copy_private_bfd_data): Remove + duplicate definition. + (osf_core_bfd_is_local_label): Define. + + * reloc.c (bfd_generic_get_relocated_section_contents): Don't fail + if malloc (0) fails. bfd_canonicalize_reloc returning 0 is not a + failure indication, it merely means there are no relocs. + + * elfcode.h (NAME(bfd_elf,write_object_contents)): Don't use space + after NAME, since SunOS /bin/cc can't handle it. + +Wed Mar 16 16:43:33 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * netbsd386.c (N_SET_FLAGS): Don't nuke the machine id field. + From sukes@glue.umd.edu (Tasuki Hirata). + +Wed Mar 16 07:55:54 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aoutf1.h (4 places): Use a simple #if on ARCH_SIZE, rather than + all that convoluted stuff with NAME, CAT3, etc. The convoluted + stuff broke for SunOS4 /bin/cc (due to DEFUN elimination, I guess). + +Wed Mar 16 00:02:05 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_prep_for_fixups): Detect section symbols based + on either the lack of private data or the symbol flags. Do not + munge section symbol names anymore -- they no longer confuse GDB. + (som_begin_writing): Leave space for an exec header if writing + an executable. + (som_slurp_symbol_table): Recognize both forms of section symbol + names "L$0\002" and "$<FOO>$". Change the name of "L$0\002" + section symbols to be the name of the section they represent. + Debugging symbols begin with "L$0\001", not just "L$". + +Tue Mar 15 22:58:28 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * bfd-in2.h, libbfd.h, libcoff.h: Rebuilt. + + * bfd-in.h (JUMP_TABLE): Add new entries to the jump table + for bfd_copy_private_section_data, bfd_copy_private_bfd_data, + and bfd_is_local_label. + + * targets.c: Add new entries to the bfd_target structure. + + * bfd.c (bfd_copy_private_bfd_data): New definition. + + * section.c (bfd_copy_private_section_data): New definition. + + * syms.c (bfd_is_local_label): New definition. + + * libbfd-in.h (bfd_generic_is_local_label): Declare. + + * libbfd.c (bfd_generic_is_local_label): New function. + + * *-core.c: Provide default definitions for new functions in + the target vector which all point to bfd_false. + + * aout-target.h, coffcode.h, elf32-target.h elf64-target.h, ieee.c + libaout.h, libecoff.h, nlm-target.h, oasys.c, srec.c, tekhex.c + Default new vectors for copying private backend data to bfd_true. + Default new vector for determining if a symbol is a local label + to bfd_generic_is_local_label. + + * som.c (som_bfd_copy_private_section_data): New function. + (som_bfd_is_local_label): New function. + (som_bfd_copy_private_bfd_data): For now default to bfd_true. + + * elf32-hppa.c (hppa_elf_is_local_label): New function. + +Tue Mar 15 23:55:47 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * cf-m68klynx.c (CALC_ADDEND): Use _bfd_m68klynx_howto_table. + +Tue Mar 15 04:41:13 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * Most files: + Replace DEFUN and DEFUN_VOID with K&R-style function definition. + Indent some of them to GNU standards. + + * aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c, + cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c, + elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h, + libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c: + Update copyright years. + +Mon Mar 14 11:41:23 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_prep_for_fixups): A relocation involving the section + symbol for the *ABS* section is really a relocation involving + no symbol. + (som_slurp_symbol_table): Do not set BSF_GLOBAL or BSF_EXPORT for + undefined symbols. Correctly distinguish between debugger symbols + and section symbols. + + * som (setup_sections): Set SEC_DEBUGGING and the section attributes + for spaces and subspaces. + + * som.c (som_bfd_count_ar_symbols): Fix typo. + + * som.c (som_object_setup): Set EXEC_P, D_PAGED, WP_TEXT, and + HAS_RELOC based on the object's magic number. + (make_unique_section): Delete function. BFD and its users are + prepared to handle multiple sections with the same name. + (setup_sections): Allocate space on the BFD's obstack to hold + section names. Use bfd_make_setion_anyway rather than the + obsolete make_unique_section. + (som_prep_headers): Choose the correct SOM magic number based + on the BFD's flags. + (som_bfd_fill_in_ar_symbols): Return false, not NULL on error. + +Sat Mar 12 09:46:09 1994 Ian Lance Taylor (ian@cygnus.com) + + * elf32-ppc.c: Renamed from elf32-powerpc.c. + * nlm32-ppc.c: Renamed from nlm32-powerpc.c. + * Makefile.in, configure.in: Corresponding changes. + +Fri Mar 11 22:27:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf32-powerpc.c: Extensive changes to update to preliminary ABI. + +Fri Mar 11 00:34:59 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * sunos.c (sunos_read_dynamic_info): Assume that dynamic info + is always located at the start of the data section to allow + recovery of the dynamic info from a stripped executable. + * ecoff.c (ecoff_styp_to_sec_flags): Handle STYP_PDATA, STYP_XDATA + and STYP_COMMENT. + +Wed Mar 9 17:17:53 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * libbfd-in.h: Remove alloca cruft. It was missing some necessary + cruft (like the #pragma alloca for AIX). + In addition to that problem, the C alloca calls xmalloc, which + means checking for being out of memory can't work right. The + following changes remove all uses of alloca from BFD. + * hosts/solaris2.h: Remove alloca cruft. + * som.c: Replace alloca with a fixed size auto array. + * aoutx.h, elfcode.h, nlmcode.h, bout.c, coff-alpha.c, ecoff.c, + ecofflink.c, elf32-hppa.c, elf32-mips.c, linker.c, reloc.c, som.c, + sunos.c: Replace alloca with malloc and appropriate error checking and + freeing. + * linker.c: Replace alloca with obstack_alloc. + * libbfd.h: Rebuilt. + +Tue Mar 8 12:10:38 1994 Ian Lance Taylor (ian@cygnus.com) + + * coff-mips.c (mips_relocate_section): Handle MIPS_R_LITERAL like + MIPS_R_GPREL. + +Sat Mar 5 14:08:54 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * elf32-hppa.h, elfcode.h: Replace uses of Elf*_Half, Elf*_Word, + Elf*_Off typedefs by their expansion, the typedefs have been + removed from include/elf/internal.h. + * elfcode.h (bfd_section_from_shdr): Handle SHT_DYNAMIC section like + SHT_PROGBITS section. + +Thu Mar 3 20:03:39 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.h (_PA_RISC_ID): Treat HOST_HPPAOSF just like HOST_HPPABSD. + +Wed Mar 2 13:28:06 1994 Jim Kingdon (kingdon@deneb.cygnus.com) + + * configure.host: Recognize i[34]86-sequent-*. + + * trad-core.c (trad_unix_core_file_p): A non-zero, not zero, + return from bfd_seek indicates an error. + New macro TRAD_CORE_DSIZE_INCLUDES_TSIZE to replace + TRAD_CORE_STACK_OFFSET. + * hosts/symmetry.h: Define TRAD_CORE_DSIZE_INCLUDES_TSIZE and + TRAD_CORE_USER_OFFSET but not HOST_STACK_OFFSET. + +Wed Mar 2 11:57:03 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.[ch]: Do not include libhppa.h in som.c, instead include + it in som.h. + + * elf32-hppa.[ch]: Do not include libhppa.h in elf32-hppa.c, instead + include it in elf32-hppa.h. + + * som.c (log2): Return -1 on error rather than aborting. + (setup_sections): Bubble up an error from log2. + + * Changes to make HP C compiler happy in both traditional + and ANSI mode. + * som.c (hppa_som_gen_reloc_type): Use correct enum type for + field parameter. + (bfd_som_set_section_attributes): Use unsigned int rather than + unsigned char to avoid GNU-C extensions. + (bfd_som_attach_aux_hdr): Return a boolean to indicate success + or failure rather than aborting on failure. + + * som.h (bfd_som_set_section_attributes): Fix prototype to match + som.c changes. + (bfd_som_attach_aux_hdr): Add prototype. + (hppa_som-gen_reloc_type): Likewise. + + * elf32-hppa.c: Add a couple casts to make HP compiler happy. + (hppa_look_for_stubs_in_section): Do not return false on failure + until rest of code is ready to handle it. Abort for now. + +Tue Mar 1 18:33:59 1994 Jim Kingdon (kingdon@deneb.cygnus.com) + + * bfd-in2.h: Rebuilt. + +Tue Mar 1 13:06:53 1994 Kung Hsu (kung@mexican.cygnus.com) + + * i386os9k.c: use new functions bfd_set_error and bfd_get_error. + * Makefile.in: delete an extra blank. + * configure.in : Add i396os9k_vec. + +Mon Feb 28 15:41:01 1994 Kung Hsu (kung@mexican.cygnus.com) + + * config.bfd : Add i386-os9k. + * config/i386-os9k.mt : Newly add os9k target makefile. + + * i386os9k.c : new file to handle os9k format bfd. + * Makefile.in : Handle new file i386os9k.c + * targets.c : Add bfd_target_os9k_flavour and i386os9k_vec. + * cache.c : Initialize cache_sentinel to 0. + +Sun Feb 27 16:30:55 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (mismatches, retval_mismatches): Fix mismatch + action in case where caller specified no argument relocation. + (hppa_elf_build_linker_stub): Try again to get the sym_ptr_ptr + right in the original relocation and the stub's relocation. + + * elf32-hppa.h (hppa_look_for_stub_in_section): Fix typo. Delete + unused symbols argument. + + * elf32-hppa.c (hppa_elf_stub_reloc): Accept asymbol ** rather + than asymbol * for original target symbol. All callers changed. + Set reloc->sym_ptr_ptr appropriately. + (hppa_elf_build_linker_stub): Set reloc->sym_ptr_ptr correctly. + (hppa_elf_look_for_stubs_in_section): No longer need symbols + argument. Use the output symbols when canonicalizing the relocs, + creating them if necessary. + + * linker.c (_bfd_generic_link_output_symbols): Do not + rebuild/clobber the output symbols if they already exist. + +Sun Feb 27 15:22:36 1994 Stan Shebs (shebs@andros.cygnus.com) + + * targets.c (BFD_SEND, BFD_SEND_FMT): Add debugging versions that + check all the pointer dereferences. Enabled via DEBUG_BFD_SEND. + * bfd-in2.h: Rebuilt. + + * srec.c (hex_value): Always set to a size of 256 bytes. + (srec_init): Cosmetic changes. + +Sun Feb 27 11:18:47 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elf32-hppa.c: Second half of major cleanup. More comments, + PARAMize and staticize rest of functions. Delete unused + functions. Delete unused/unnecessary arguments to some functions. + Group static vars together. Abort for bad errors until we have + error code propogation working. Work on spacing and indention. + Add FIXMEs for unresolved problems. Use enums rather than + #defines for lots of things. Merge two functions which build + linker stubs into a single function (so they can easily share a + ton of common code). + +Sat Feb 26 10:00:45 1994 Ian Lance Taylor (ian@cygnus.com) + + * reloc.c (_bfd_relocate_contents): Adjust handling of overflow to + avoid depending upon right shifts of signed numbers, and to + correct handling of src_mask with lower bits zero. + + * aoutx.h, archive.c: Add casts to avoid warnings from SVR4 cc. + * ecoff.c, ecofflink.c, ecoffswap.h, srec.c: Likewise. + * elf32-i386.c: Likewise. + * elfcode.h (bfd_section_from_shdr): Make i unsigned; remove old + #if 0 code. + (elf_write_phdrs): Make i unsigned. + (map_program_segments): Make i and n_left unsigned. + (assign_file_positions_except_relocs): Make i unsigned. + (write_shdrs_and_ehdr): Make count unsigned. + (assign_file_positions_for_relocs): Make i unsigned. + (NAME(bfd,elf_write_object_contents)): Make count unsigned. + (section_from_elf_index): Make index argument unsigned. + +Fri Feb 25 21:34:58 1994 Ian Lance Taylor (ian@cygnus.com) + + * elfcode.h: Don't include assert.h. + (swap_out_syms): Use BFD_ASSERT rather than assert. + + * linker.c (_bfd_generic_link_write_global_symbol): Add missing + break in switch. + + * hosts/i386v4.h (qsort, strtol): Remove incorrect and useless + declarations. + +Fri Feb 25 16:35:57 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * libhppa.h (hppa_rebuild_insn): Moved here from elf32-hppa.c. + + * elf32-hppa.h (elf_hppa_tc_symbol): Add new arguments. + (elf_hppa_tc_make_sections): Likewise. + (elf_hppa_final_processing): Add extern decl. + + * elf32-hppa.c: First half of major cleanup. Add/cleanup lots of + comments. PARAMize some static functions. Delete unused functions. + Delete unused/unnecessary arguments to many functions. Group + static vars together. Collapse common case statements together + in many places. Use default case when possible instead of listing + each case separately. Abort for bad errors until we get error + code propogation working. Work on spacing and indention problems. + Add FIXMEs for some unresolved problems. Delete hopelessly broken + COMPLEX relocation support (it's never used anyway). + (hppa_elf_rebuild_insn): Delete. Moved into libhppa.h. + (elf_hppa_tc_symbol): Accept and use new arguments (symext chains). + (elf_hppa_tc_make_sections): Likewise. + + * format.c (bfd_check_format_matches): Initialize matching_vector + to keep gcc -Wall quiet. + + * elfcode.h (elf_slurp_reloca_table): Fix typo. + + * som.c (som_get_symtab_upper_bound): Use "sizeof (asymbol *)" + not "sizeof (som_symbol_type *)". + + * elfcode.h (elf_get_symtab_upper_bound): Use "sizeof (asymbol *)" + not "sizeof (asymbol"). Opps. + +Fri Feb 25 13:19:04 1994 Ted Lemon (mellon@pepper.ncd.com) + + * bfd.c (bfd_get_gp_size): Can't return gp value on an archive. + (bfd_set_gp_size): Can't set gp value on an archive. + +Fri Feb 25 12:57:00 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * srec.c (pass_over): Don't skip too many characters when + end of line seen. + +Fri Feb 25 11:41:57 1994 Ian Lance Taylor (ian@cygnus.com) + + * ecoff.c (ecoff_sizeof_headers): Align result to 16 byte + boundary. + +Thu Feb 24 07:13:22 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_derive_misc_symbol_info): Derive symbol_info + field for absolute symbols in the same manner as undefined + and common symbols. + +Thu Feb 24 04:29:19 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * elfcode.h (elf_core_file_p): Check for core file e_machine match + like in elf_object_p. + +Wed Feb 23 18:28:37 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elfcode.h (alloca): Delete declaration. + + * som.c (som_prep_headers): Use CPU_PA_RISC1_0 for magic + number rather than HP9000S800_ID. Note som.c is careful + to make sure CPU_PA_RISC1_0 is always defined. + +Mon Feb 21 10:12:02 1994 Stan Shebs (shebs@andros.cygnus.com) + + * Makefile.in (targets.o, archures.o): Use ALL_CFLAGS to supply + flags to explicit compile actions. + +Mon Feb 21 09:50:06 1994 Ian Lance Taylor (ian@lisa.cygnus.com) + + * ecofflink.c (ecoff_write_symhdr): Set symhdr->magic here. + * ecoff.c (ecoff_write_object_contents): Make sure .bss section + ends on a page boundary if there is no symbol table. + (ecoff_bfd_final_link): Don't set symhdr->magic here. + + * hosts/hp300.h: Include <stdlib.h>; don't declare free. + + * som.c (som_bfd_count_ar_symbols): Use a pointer and alloca + rather than an array of variable size. + (som_bfd_fill_in_ar_symbols): Likewise. + (som_bfd_ar_write_symbol_stuff): Likewise. + + * coff-alpha.c (alpha_relocate_section): Rewrite mask and shift + operation to avoid OSF 1.3 cc bug. + * ecoff.c (ecoff_write_object_contents): Make text_size, data_size + and bss_size bfd_size_type instead of unsigned long. Make + text_start and data_start bfd_vma instead of unsigned long. + * ecofflink.c (ecoff_add_string): Remove incorrect cast of return + value. + +Sun Feb 20 16:06:54 1994 Ian Lance Taylor (ian@lisa.cygnus.com) + + * linker.c (_bfd_generic_link_add_archive_symbols): Consider + symbols in the order they appear in the archive map. + +Sat Feb 19 03:17:32 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * coff-alpha.c (reloc_nil): Add forward declaration, add missing + error_message argument. + * coff-sparc.c (bfd_coff_generic_reloc): Add forward declaration, + add missing error_message argument. + * mipsbsd.c (mips_fix_hi16_s): Add forward declaration, add missing + error_message argument. + +Fri Feb 18 11:41:58 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Support for PowerPC NetWare. + * nlm32-powerpc.c: New file. + * config.bfd (powerpc-*-netware*): New target; use ppc-nlm. + * config/ppc-nlm.mt: New file. + * configure.in (nlm32_powerpc_vec): New target vector; use + nlm32-powerpc.o, nlm32.o, nlm.o. + * targets.c (nlm32_powerpc_vec): Declare. + * Makefile.in (BFD32_BACKENDS): Add nlm32-powerpc.o. + (CFILES): Add nlm32-powerpc.c. + + Initial support for PowerPC ELF. Done without an ABI, and + probably to be changed when I get an ABI. + * config.bfd (powerpc-*-sysv4*): New target; use ppc-elf. + * config/ppc-elf.mt: New file. + * configure.in (bfd_elf32_powerpc_vec): New target vector; use + elf32-powerpc.o, elf32.o, elf.o. + * elf32-powerpc.c: New file. + * elfcode.h (prep_headers): Add bfd_arch_powerpc case. + (elf_set_arch_mach): Likewise. + * targets.c (bfd_elf32_powerpc_vec): Declare. + * Makefile.in (BFD32_BACKENDS): Add elf32-powerpc.o. + (CFILES): Add elf32-powerpc.c. + Rebuilt dependencies. + +Thu Feb 17 15:29:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffgen.c (coff_write_linenumbers): Always return a value. + + * elfcode.h (elf_slurp_symbol_table): Handle zero symbols + reasonably. Allocate x_symp using alloca. + + * elfcode.h (map_program_segments): ELF program header entries + must be sorted by load address. This used to generate the entries + in reverse order. + + * section.c (SEC_IN_MEMORY): Define. + (asection): Rename unused field otheruserdata to contents, and + make it char *. + (bfd_make_section_anyway): Initialize contents field to NULL. + (bfd_get_section_contents): If SEC_IN_MEMORY is set, get section + contents from contents field rather than from file. + * bfd-in2.h: Rebuilt. + +Thu Feb 17 08:30:53 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * bfd.c (bfd_get_error, bfd_set_error): New functions. + (bfd_error): Make static. + (bfd_error_type): Renamed from bfd_ec. Prepend "bfd_error_" to + all values. + * bfd-in2.h: Regenerated. + * aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h, + aoutf1.h, aoutx.h, archive.c, archures.c, + bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c, + coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c, + ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c, + elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c, + i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c, + lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c, + nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c, + ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c, + srec.c, sunos.c, syms.c, targets.c, tekhex.c, + trad-core.c: Change callers. + +Tue Feb 15 22:27:27 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c: Remove FIXMEs for things which have been dealt with. + +Tue Feb 15 19:39:24 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * section.c (bfd_get_section_contents): Since this function reads + unrelocated contents, the section's raw size is always the one to + use for bounds checking. + + * linker.c (default_indirect_link_order): In assertion, compare + link_order size field against cooked size, not raw size, of input + section. + + * bout.c (b_out_get_reloc_upper_bound): For BSS section, just + return 0. + (aligncode): When shrinking, the addend should be set to the + current offset in the section plus the number of bytes of padding + that will actually be retained. + (b_out_relax_section): If a section contains no relocations, don't + bother processing them. + (b_out_get_relocated_section_contents): Set reloc_done. Assert + that bfd_get_section_contents returns true. Check that relocs are + properly ordered. + (b_out_get_relocated_section_contents, case ALIGNDONE): Assert + that reloc->addend falls between the current source offset and the + raw size of the input section. + + * config.bfd: Support i960 vxworks versions > 5.0 with coff, not + bout. Default with no version number is still bout. Support + explicit i960-coff target too. + + * bout.c: Changed some indentation, deleted trailing whitespace, + fixed some comments, removed some "#if 1" lines. + (output_addr): New macro. + (calljx_callback, callj_callback, get_value, abs32code, aligncode, + b_out_get_relocated_section_contents): Use it for readability. + +Tue Feb 15 09:00:16 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_prep_for_ar_write): Iterate through the SOM + symbols, not the BFD symbols. + (som_bfd_ar_write_symbol_stuff): Likewise. + +Mon Feb 14 22:55:20 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_slurp_symbol_table): Do not die if a BFD doesn't + have any symbols. + + * Finish basic read-write support for SOM archive libraries. Bugs + surely remain as this hasn't been tested all that much. + * som.c (SOM_LST_HASH_SIZE, SOM_LST_MODULE_LIMIT): Define. + (struct som_misc_symbol_info): New structure to hold info necessary + to build both normal and library symbol tables. + (som_derive_misc_symbol_info): New function to derive info necessary + to build both normal and library symbol tables. + (som_build_and_write_symbol_table): Use new function to derive misc + symbol information. + (som_slurp_symbol_table): Update backend private data for symbols + appropriately. + (som_bfd_prep_for_ar_write): New function. + (som_bfd_ar_symbol_hash): New function. + (som_bfd_ar_write_symbol_stuff): New function. + (som_write_armap): Flesh out. + (som_vec): Fix ar padding character. + + * som.c: Consistently use memset rather than bzero. + +Mon Feb 14 17:02:28 1994 Stu Grossman (grossman at cygnus.com) + + * coff-rs6000.c: Add Lynx core file support, use HOST_AIX, where + appropriate. + * rs6000-core.c: Use HOST_AIX instead of COREFILES_PLEASE. + * config/rs6000.mh: Remove defs of ARCHIVES_PLEASE and + COREFILES_PLEASE. + * config/rs6000lynx.mh: Turn on Lynx core file support. + * hosts/rs6000.h: #define HOST_AIX. + * hosts/rs6000lynx.h: Create this to enable Lynx host support. + +Sun Feb 13 14:30:00 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.h (som_symbol_data): Safely access backend private data + for BFD symbols. All callers changed. + + * Read-only SOM archive support. + * som.c (som_bfd_count_ar_symbols): New helper function. + (som_bfd_fill_in_ar_symbols): New helper function. + (som_slurp_armap): New function to read a SOM LST. + + * som.h: Include <lst.h> and <ar.h>. + +Sat Feb 12 22:34:14 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elfcode.h (elf_map_symbols): Fix typo. + (write_object_contents): Check return values from prep_headers and + elf_compute_section_file_positions. + (set_section_contents): Likewise. + +Fri Feb 11 16:56:50 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * archive.c (normalize) [VMS]: Call malloc, not bfd_xmalloc. + (bfd_construct_extended_name_table): Check result of normalize. + +Tue Feb 8 08:57:31 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + Make all callers of malloc or realloc (including via obstacks) + check the result for NULL. Most set bfd_error to no_memory and + return in that case; a few are harder to fix, and are marked + with "FIXME <return type>". + + * elf32-hppa.c (hppa_elf_build_arg_reloc_stub + hppa_elf_build_long_branch_stub): Check bfd_make_empty_symbol return. + * linker.c (_bfd_generic_link_output_symbols + _bfd_generic_link_write_global_symbol): Ditto + * section.c (bfd_make_section_anyway): Ditto. + + * tekhex.c (find_chunk tekhex_mkobject): Check bfd_alloc. + (first_phase): Ditto. FIXME void + (tekhex_make_empty_symbol): Check bfd_zalloc. + + * sunos.c (sunos_read_dynamic_info): Check bfd_zalloc. + (MY(read_dynamic_symbols) MY(read_dynamic_relocs)): Check bfd_alloc. + + * stringhash.c (_bfd_stringtab_hash_newfunc): Check bfd_hash_allocate. + + * srec.c: Indent. + (fillup_symbols): Check bfd_alloc. FIXME void + (srec_mkobject srec_get_section_contents + srec_set_section_contents): Check bfd_alloc. + (srec_make_empty_symbol): Check bfd_zalloc. + + * som.c (hppa_som_gen_reloc_type): Check bfd_alloc_by_size_t. + (make_unique_section): Check bfd_alloc. + (som_new_section_hook): Check bfd_zalloc. + (bfd_som_attach_aux_hdr): Ditto. FIXME void + + * rs6000-core.c (rs6000coff_core_p): Check bfd_zalloc. + + * osf-core.c (osf_core_make_empty_symbol): Check bfd_zalloc. + (osf_core_core_file_p): Check bfd_alloc. + + * oasys.c (oasys_slurp_symbol_table oasys_archive_p + oasys_mkobject oasys_object_p oasys_new_section_hook + oasys_set_section_contents): Check bfd_alloc. + (oasys_slurp_section_data): Check bfd_zalloc and bfd_alloc. + (oasys_make_empty_symbol): Check bfd_zalloc. + + * nlmcode.h (nlm_make_empty_symbol): Check bfd_zalloc. + (nlm_slurp_symbol_table): Check bfd_zalloc and bfd_alloc. + + * nlm32-sparc.c (nlm_sparc_read_import): Check bfd_alloc. + + * nlm32-i386.c (nlm_i386_read_import): Check bfd_alloc. + + * nlm32-alpha.c (nlm_alpha_read_import): Check bfd_alloc. + + * linker.c (_bfd_link_hash_newfunc + (generic_link_hash_newfunc + (archive_hash_newfunc + (_bfd_generic_link_add_one_symbol): Check bfd_hash_allocate. + (_bfd_generic_final_link + (_bfd_generic_link_output_symbols + (default_indirect_link_order): Check bfd_alloc. + (bfd_new_link_order): Check bfd_alloc_by_size_t. + + * irix-core.c (irix_core_make_empty_symbol): Check bfd_zalloc. + + * ieee.c: Indent. + (read_id get_symbol get_section_entry ieee_archive_p ieee_object_p + ieee_slurp_section_data ieee_new_section_hook): Check bfd_alloc. + (do_one): Check bfd_alloc. Return a boolean. + (ieee_slurp_section_data): Check it. + (init_for_output): Check bfd_alloc. Return a boolean. + (ieee_set_section_contents): Check it. + (do_with_relocs): Check bfd_alloc. Return a boolean. + (ieee_bfd_debug_info_accumulate): Ditto. FIXME void. + (ieee_mkobject): Check bfd_zalloc. + (ieee_make_empty_symbol): Check bfd_zmalloc. + + * hpux-core.c (hpux_core_make_empty_symbol): Check + bfd_zalloc. + + * hppabsd-core.c (hppabsd_core_make_empty_symbol): Check + bfd_zalloc. + (hppabsd_core_core_file_p): Check bfd_zalloc. + + * hp300hpux.c (MY(slurp_symbol_table)): Check bfd_alloc. + + * elfcode.h (elf_new_section_hook): Check bfd_alloc. + (bfd_section_from_phdr): Ditto. + (write_relocs): Ditto. FIXME void + (elf_map_symbols assign_section_numbers map_program_segments): + Ditto. Return a boolean. + (swap_out_syms): Ditto. Check elf_map_symbols. + (elf_slurp_symbol_table): Check bfd_zalloc. + (elf_slurp_reloca_table): Check bfd_alloc. + (elf_slurp_reloc_table): Ditto. + (elf_compute_section_file_positions): Check assign_section_numbers. + (assign_file_positions_except_relocs): Return a boolean. + Check map_program_segments. + (elf_compute_section_file_positions): Check it. + + * elf32-mips.c (mips_elf_final_link): Check bfd_alloc. + + * elf32-hppa.c (hppa_elf_stub_branch_reloc): Check bfd_zmalloc and + realloc. + (hppa_elf_stub_reloc): Ditto. + (hppa_elf_build_arg_reloc_stub): Check bfd_zalloc. + (hppa_elf_build_long_branch_stub): Ditto. + (elf32_hppa_backend_symbol_table_processing): Ditto. + + * ecoff.c (ecoff_set_symbol_info): Check bfd_alloc. Return a boolean. + (ecoff_slurp_symbol_table): Check it. + (ecoff_slurp_armap): Check bfd_alloc. + (ecoff_write_armap): Check bfd_zalloc. + (ecoff_link_hash_newfunc): Check bfd_hash_allocate and + _bfd_link_hash_newfunc. + (ecoff_link_add_externals): Check bfd_alloc. + + * ctor.c (bfd_constructor_entry): Check bfd_alloc. + + * coffgen.c (coff_real_object_p): Check bfd_alloc. + (coff_renumber_symbols): Check bfd_alloc_by_size_t. Return a boolean. + (coff_write_symbol): Check bfd_alloc. FIXME int + (coff_write_linenumbers): Check bfd_alloc. Return a boolean. + (coff_section_symbol): Check bfd_alloc_by_size_t. + (coff_get_normalized_symtab): Check bfd_alloc. + (coff_bfd_make_debug_symbol): Check bfd_zalloc. + * libcoff-in.h: Change decls of coff_renumber_symbols, + coff_write_linenumbers. + * libcoff.h: Rebuilt. + * coffcode.h (coff_write_object_contents): Check + coff_renumber_symbols, coff_write_linenumbers. + + * coffcode.h: Indent. + (coff_add_missing_symbols): Check bfd_alloc_by_size_t. Return a + boolean. + (coff_write_object_contents): Check it. + + * coff-alpha.c (alpha_relocate_section): Check bfd_alloc. + * coff-mips.c (mips_relocate_section): Ditto. + + * archive.c (bfd_slurp_bsd_armap_f2): Check bfd_alloc value. + (do_slurp_bsd_armap): Ditto. + (compute_and_write_armap): Check bfd_realloc value. + + * aoutx.h (translate_from_native_sym_flags): Check bfd_alloc + return value. Return boolean value. + (NAME(aout,make_empty_symbol)): Check bfd_zalloc return value. + (NAME(aout,slurp_symbol_table)): Check bf_alloc and bfd_zalloc + return value. + (add_to_stringtab): Ditto. FIXME void + (aout_link_hash_newfunc): Check bfd_hash_allocate return value. + (aout_link_add_symbols): Check bfd_alloc value. + (translate_symbol_table): Check translate_from_native_sym_flags. + * hp300hpux.c (MY(slurp_symbol_table)): Ditto. + * aoutx.h (aout_link_hash_newfunc): Check _bfd_link_hash_newfunc. + + * opncls.c (bfd_zalloc bfd_realloc): Check result of bfd_alloc. + + * opncls.c (obstack_chunk_alloc): Define as malloc, not + bfd_xmalloc_by_size_t. + (_bfd_new_bfd): Check obstack_begin for 0 return. + + * ieee.c (obstack_chunk_alloc): Define as malloc, not + bfd_xmalloc_by_size_t. + (ieee_archive_p): Check obstack_begin for 0 return and + obstack_finish for NULL return. + + * hash.c (obstack_chunk_alloc): Define as malloc, not + bfd_xmalloc_by_size_t. + (bfd_hash_table_init_n): Check obstack_begin for 0 return and + obstack_finish for NULL return. + (bfd_hash_lookup): Check obstack_alloc for NULL return. + + * ecofflink.c (obstack_chunk_alloc): Define as malloc, not + bfd_xmalloc_by_size_t. + bfd_ecoff_debug_accumulate + bfd_ecoff_debug_accumulate_other): Check obstack_alloc. + (add_file_shuffle add_memory_shuffle): Check obstack_alloc for + NULL return. Return boolean, not void. + (bfd_ecoff_debug_init): Check obstack_begin for 0 return. + (bfd_ecoff_debug_accumulate): Check add_file_shuffle + and add_memory_shuffle return. + (string_hash_newfunc): Check bfd_hash_allocate and bfd_hash_newfunc. + (bfd_ecoff_debug_accumulate): Check bfd_alloc. + (ecoff_add_string): Check add_memory_shuffle return. + + * libbfd-in.h (xmalloc, bfd_xmalloc, bfd_xmalloc_by_size_t): + Remove decls. + * libbfd.h: Rebuilt. + +Fri Feb 11 15:35:32 1994 Stu Grossman (grossman at cygnus.com) + + * configure.host: Add Lynx/rs6000 support. + * config/i386-nlm.mt: Enable a.out file support. + * config/rs6000lynx.mh: Lynx/rs6000 host support. + +Fri Feb 11 17:25:58 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * archive.c (compute_and_write_armap): Rewrite somewhat to improve + memory usage. + +Fri Feb 11 13:10:42 1994 Stan Shebs (shebs@andros.cygnus.com) + + * archive.c: Change all references to '\n' in archive magic + to '\012', for greater portability. + * ecoff.c (ecoff_write_armap): Ditto. + +Thu Feb 10 12:58:48 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_write_other_symbol): Check strip settings to + see whether symbol should be output. + * genlink.h (struct generic_write_global_symbol_info): Added info + field. + * linker.c (_bfd_generic_final_link): Initialize wginfo.info. + (_bfd_generic_link_write_global_symbol): Check strip settings to + see whether symbol should be output. + * elf32-mips.c (mips_elf_final_link): Initialize wginfo.info. + +Wed Feb 9 21:34:58 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_reloc_queue_find): Do not examine a NULL queue entry. + + * som.c: Cast return values from BFD memory allocation routines to + avoid warnings from the HP compiler. + +Wed Feb 9 12:55:02 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-alpha.c (alpha_relocate_section): Accept a LITERAL + reloc on an "ldl" instruction too. + + * archive.c (bfd_ar_hdr_from_filesystem): Cast status elements + when passing them to sprintf. Use %ld instead of %d. + + * coff-rs6000.c (rs6000coff_mkarchive): Return false. + (rs6000_coff_snarf_ar_hdr): Don't declare errno; it's not used. + Also removed unused variable namelen. + (rs6000coff_write_armap): Declare orl_count and stridx parameters. + +Tue Feb 8 18:00:34 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libbfd-in.h (xmalloc): Don't declare parameter type, to avoid + conflicts. + * libbfd.h: Rebuilt. + +Tue Feb 8 15:55:50 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * coff-alpha.c (reloc_nil): New function. + (alpha_howto_table): Use it as special_function to prevent certain + relocs from being adjusted by bfd_perform_relocation. IGNORE + reloc should be partial_inplace. + (alpha_ecoff_get_relocated_section_contents): Accept a LITERAL + reloc on an "ldl" instruction too. + +Tue Feb 8 00:32:28 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * elf32-hppa.c (CURRENT_STUB_OFFSET, hppa_elf_build_arg_reloc_stub, + hppa_elf_build_long_branch_stub): Cast to char * instead of int + before performing pointer arithmetic. + +Mon Feb 7 20:56:27 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * config.bfd (hppa*-*-osf*): Use bfd_name hppaosf for this + configuration. + (hppa*-*-*elf*): This configuration used hppa-elf now. + + * som.c: This file is also used for HOST_HPPAOSF. + + * targets.c (bfd_target_vector): Enable som_vec for HOST_HPPAOSF. + + * hosts/hppaosf.h: New host configuration file. + + * config/hppabsd.mt (SELECT_VECS): Add bfd_elf32_hppa_vec as + BSD handles both SOM and ELF object files. + + * config/hppaosf.mh (HDEFINES): Delete. No longer needed. + (RANLIB): Doesn't do anything, define it to be "echo". + + * config/hppaosf.mt: New target makefile fragment for a PA running + OSF1. + +Mon Feb 7 15:02:06 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * archures.c (enum bfd_architecture): Added bfd_arch_powerpc. + (archures_init_table): If SELECT_ARCHITECTURES is not defined, + added bfd_powerpc_arch. + * bfd-in2.h: Rebuilt. + * cpu-powerpc.c: New file. + * Makefile.in (ALL_MACHINES, CFILES): Added cpu-powerpc.c. + Rebuilt dependencies. + + * elfcode.h (bfd_section_from_shdr): Get vma and alignment_power + of an SHT_STRTAB section from sh_addr and sh_addralign, rather + than just setting them to zero. + +Sun Feb 6 20:04:10 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * elfcode.h (prep_headers, swap_out_syms): Check for NULL return + from bfd_new_strtab. + (elf_compute_section_file_positions): Check for false return from + swap_out_syms. + + * linker.c (default_indirect_link_order): Check for NULL return + from bfd_get_relocated_section_contents. + + * syms.c: Make example application in doc call xmalloc, not + bfd_xmalloc. + + * aoutx.h (NAME(aout,slurp_symbol_table), + aout_link_get_symbols, NAME(aout,link_hash_table_create)): + * bout.c (b_out_slurp_reloc_table, b_out_squirt_out_relocs): + * ecoff.c (ecoff_bfd_link_hash_table_create): + * ecofflink.c (bfd_ecoff_debug_init): + * format.c (bfd_check_format_matches): + * linker.c (_bfd_generic_link_hash_table_create): + (_bfd_generic_final_link): + * reloc16.c (bfd_coff_reloc16_relax_section): + (bfd_coff_reloc16_get_relocated_section_contents): + * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): + * elf32-mips.c (mips_elf_final_link): + * elfcode.h (bfd_new_strtab): + (bfd_add_2_to_strtab): + (elf_slurp_symbol_table): + (elf_corefile_note): + * libbfd.c (bfd_zmalloc): + Use malloc and check the result, instead of bfd_xmalloc. + +Sat Feb 5 12:39:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Put m68*-*-sysv* line after m68*-*-sysv4*. + +Sat Feb 5 05:32:44 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * srec.c (srec_write_record): Put CONST keyword for "src" before + "unsigned", some compilers don't like it after "unsigned". + * libcoff.h, libcoff-in.h (bfd_perform_slip): Rename "value" to + "val" in prototype declaration because some compilers don't like + arguments whose names are the same as types. + +Sat Feb 5 01:14:38 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_check_ar_symbols): Correct test for whether + object file defines symbol. Also, if skipping a symbol, skip the + second symbol of a N_WARNING or N_INDR symbol as well. + +Fri Feb 4 23:55:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Add basic support for writing RS/6000 XCOFF files. + * coff-rs6000.c (dummy_reloc): Removed. + (rs6000coff_howto_table): Defined XCOFF relocs. + (RTYPE2HOWTO): Defined to use rs6000coff_rtype2howto. + (rs6000coff_rtype2howto): New function. + (coff_bfd_reloc_type_lookup): Defined to use + rs6000coff_reloc_type_lookup. + (rs6000coff_reloc_type_lookup): New function. + (SELECT_RELOC): Defined to set r_type and r_size fields. + (COFF_LONG_FILENAMES): Defined. + * coffcode.h (combined_entry_type): Changed fix_tag and fix_end + fields to bitfields. Added fields fix_value and fix_scnlen. + (sec_to_styp_flags): If STYP_DEBUG is defined, use it rather than + STYP_INFO for the type of a section named .debug. + (coff_add_missing_symbols): Don't define if RS6000COFF_C. + (coff_write_object_contents): If RS6000COFF_C, don't call + coff_add_missing_symbols. + (coff_slurp_symbol_table): If RS6000COFF_C, then if the last aux + entry has type STY_LD change the x_scnlen into a pointer to a + symbol and set fix_scnlen. Also, for a C_BSTAT symbol, change the + value into a pointer to a symbol and set fix_value. + * libcoff.h: Rebuilt. + * coffgen.c (coff_mangle_symbols): Reindent. If fix_value is set, + get the symbol offset. Likewise for fix_scnlen. + (string_size): Change type to bfd_size_type. + (debug_string_size, debug_string_section): New static variables. + (coff_fix_symbol_name): If bfd_coff_symname_in_debug returns true, + write the symbol name into the .debug section; assume that the + section has already been created with the right size. + (coff_write_symbols): Initialize debug_string_size to 0. If + bfd_coff_symname_in_debug returns true, don't put symbol name in + usual string table. After writing out all symbols, if + debug_string_size is not 0, check that it matches the size of the + .debug section. + (coff_get_normalized_symtab): Clear new fix_value and fix_scnlen + fields. If the string offset is 0, always use an empty string as + the name. + (coff_make_empty_symbol): Zero out the symbol structure. + * reloc.c (bfd_perform_relocation): Work around one gross hack + with another: actually look at the target name to avoid the broken + COFF check. + (bfd_reloc_code_real_type): Add BFD_RELOC_PPC_B26, + BFD_RELOC_PPC_BA26 and BFD_RELOC_PPC_TOC16. + * bfd-in2.h: Rebuilt. + +Fri Feb 4 17:28:32 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * libbfd.c (bfd_zmalloc): Call bfd_xmalloc instead of malloc. + (bfd_xmalloc, bfd_xmalloc_by_size_t): Functions deleted. + * libbfd-in.h: Define them as macros calling xmalloc and declare + xmalloc. + * libbfd.h: Rebuilt. + +Thu Feb 3 16:49:35 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecofflink.c (bfd_ecoff_debug_externals): If a small undefined + symbol has a value in the ECOFF symbol but not in the BFD symbol, + keep the value in the ECOFF symbol. This helps gas. + + * linker.c (_bfd_generic_link_output_symbols, + _bfd_generic_link_write_global_symbol): Don't require that all + references to a common symbol be themselves common symbols. + + * aoutx.h (aout_reloc_index_to_section): Handle N_UNDF. + +Wed Feb 2 20:37:19 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * libbfd.c, bfd-in.h, hosts/alphaosf.h, hosts/sparc-ll.h, aoutf1.h, + sparclynx.c, Makefile.in: Change HOST_64_BIT to BFD_HOST_64_BIT. + * bfd-in2.h: Rebuilt. + +Wed Feb 2 12:30:13 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffswap.h (coff_swap_reloc_out): If RS6000COFF_C, handle type + and size correctly. + (coff_swap_aux_in): If RS6000COFF_C, change x_csect.x_scnlen to + x_csect.x_scnlen.l to match change in coff/internal.h. + (coff_swap_aux_out): Likewise. + + * coff-mips.c (mips_ecoff_backend_data), coff-alpha.c + (alpha_ecoff_backend_data): Change casts of aux_in and aux_out + fields to match yesterday's changes. + + * coffcode.h (coff_write_relocs): If SELECT_RELOC is defined, pass + in the internal_reloc itself, not the type. + * coff-apollo.c, coff-h8300.c, coff-h8500.c, coff-i386.c, + coff-m68k.c, coff-sh.c, coff-we32k.c, coff-z8k.c: Changed + definition of SELECT_RELOC accordingly. + +Tue Feb 1 12:05:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffcode.h (bfd_coff_backend_data): Added new arguments to + _bfd_coff_swap_aux_in and _bfd_coff_swap_aux_out: aux index number + and number of aux entries. + (bfd_coff_swap_aux_in, bfd_coff_swap_aux_out): Changed + accordingly. + * libcoff.h: Rebuilt. + * coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Accept new + arguments. If RS6000COFF_C, only treat C_EXT and C_HIDEXT + specially if this is the last aux entry. + * coffgen.c (coff_write_symbol, coff_get_normalized_symtab): Pass + new arguments to swap_aux functions. + +Sun Jan 30 15:14:36 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * gen-aout.c (main): Set DEFAULT_ARCH based on preprocessor macros + (only testing for m68k and vax at the moment); do verify that the + preprocessor didn't trash the arch name inside the string version. + Don't print out "pagesize =" line that prevents output from + compiling. Derive BYTES_IN_WORD and ARCH values from sizeof + results. + * Makefile.in (aout-params.h): Pass gen-aout a dummy target name. + (check, installcheck): Identify directory in "no testsuites" + message. + +Sun Jan 30 13:25:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_write_symbols): Write out correct value for + object file symbol. + +Fri Jan 28 18:34:05 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * hosts/vaxbsd.h (HOST_STACK_END_ADDR): Vax BSD doesn't define + KERNBASE, so hard-code 0x80000000 instead. + +Thu Jan 27 13:54:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * linker.c (generic_link_add_symbol_list): If symbol is common, + set the BSF_OLD_COMMON flag. + +Wed Jan 26 13:47:15 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * format.c (bfd_check_format_matches): Put the new entry in the + correct element of matching_vector. + +Tue Jan 25 11:43:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * som.c, som.h (bfd_som_set_section_attributes, + bfd_som_set_subsection_attributes): Change parameters from char + to int. Following a prototype with an old-style function definition + in the presence of widened parameters is a GCC-ism not supported + by the HP compiler in ANSI mode. + +Tue Jan 25 11:46:46 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * reloc.c (bfd_get_reloc_size): Size of type -2 is 4 bytes, not 2. + + * hp300hpux.c (MY(write_object_contents)): Write out the symbols + before writing out the relocs, so that the right symbol indices + are used. + + * archive.c (do_slurp_bsd_armap, bfd_slurp_bsd_armap_f2): Do not + try to overlay the internal carsyms on the external symdefs. That + can not work if the size of a host pointer is larger than 4 bytes. + + * format.c (bfd_check_format_matches): Cast result of + bfd_xmalloc_by_size_t. + * opncls.c (_bfd_new_bfd): Avoid ANSI C prototype. + + * archive.c: Reindented to GNU standards. + +Mon Jan 24 14:41:23 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * opncls.c (_bfd_new_bfd, _bfd_new_bfd_contained_in): Add + "_bfd_" to function names. + * archive.c (_bfd_create_empty_archive_element_shell), + libbfd-in.h: Change callers. + + * libbfd.c (bfd_zmalloc): Renamed from zalloc. + * libbfd.c (bfd_add_to_string_table), + trad-core.c (trad_unix_core_file_p), + targets.c (bfd_target_list), + ptrace-core.c (ptrace_unix_core_file_p), + opncls.c (new_bfd), libbfd-in.h, + ieee.c (ieee_make_empty_symbol), + elf32-hppa.c (hppa_elf_stub_branch_reloc), + (hppa_elf_stub_reloc): Change callers. + * libbfd.h: Regenerated. + + * archive.c (_bfd_look_for_bfd_in_cache): Add "_bfd_" to name. + (_bfd_get_elt_at_filepos), + coff-rs6000.c (rs6000coff_get_elt_at_filepos), libbfd-in.h: + Change callers. + + * format.c (bfd_check_format_matches), libbfd-in.h, targets.c, + elfcode.h (elf_object_p): Rename target_vector to bfd_target_vector + and default_vector to bfd_default_vector. + * libbfd.h: Regenerated. + + * format.c (bfd_check_format_matches): New function. + (bfd_check_format): Call it. + (bfd_matching_formats): Function removed. + * targets.c: Replace the vector added on Jan 21 with a count of + entries in default_vector. + * bfd-in2.h: Regenerated. + +Mon Jan 24 12:38:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-alpha.c (alpha_ecoff_object_p): New function. Set size of + .pdata section based on lnnoptr field, not section header. + (alpha_relocate_section): Don't bother to check if r_symndx >= 0, + since it is unsigned. + (ecoffalpha_little_vec): Use alpha_ecoff_object_p rather than + coff_object_p. + * ecoff.c (ecoff_new_section_hook): Set alignment_power field of + .pdata section to 3. + (ecoff_compute_section_file_positions): Save the size of the + .pdata section in the line_filepos field, and actually align the + .pdata section to an alignment power of 4. + (ecoff_compute_reloc_file_positions): Set output_has_begun after + calling ecoff_compute_section_file_positions. + (ecoff_write_object_contents): Set s_lnnoptr for the .pdata + section from the line_filepos field. Set vstamp for the optional + header from the vstamp of the symbolic header. + (ecoff_bfd_final_link): Set vstamp of the symbolic header to the + vstamp used by the first object file in the link. + + * ecofflink.c (ecoff_align_debug): Align RFDs to debug_align. + + * linker.c (generic_link_check_achive_element): Set SEC_ALLOC flag + for a created common section. + (_bfd_generic_link_add_one_symbol): Likewise. + + * elfcode.h (swap_out_syms): Use elf_section_from_bfd_section to + get the index of a common section, rather than always using + SHN_COMMON (MIPS has multiple common sections). + + * elf32-hppa.c (hppa_elf_gen_reloc_type): Typo (== for =). + + * bfd/aoutx.h (aout_link_input_section_std, + aout_link_input_section_ext): Pass additional arguments to + reloc_overflow callback. + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents, + alpha_relocat_section): Likewise. + * coff-h8300.c (h8300_reloc16_extra_cases): Likewise. + * coff-h8500.c (extra_case): Likewise. + * coff-mips.c (mips_relocate_section): Likewise. + * coff-z8k.c (extra_case): Likewise. + * elf32-hppa.c (hppa_elf_stub_finish): Likewise. + * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. + + * bout.c (calljx_callback, callj_callback): Use get_value to get + the symbol value and check for undefined symbols. + (get_value): If the symbol is undefined, look it up in the linker + hash table. + (b_out_get_relocated_section_contents): For PCREL24 and PCREL13 + use get_value to get the symbol value and check for undefined + symbols. + * reloc16.c (bfd_coff_reloc16_get_value): If the symbol is + undefined, look it up in the linker hash table. + + * aoutx.h (translate_symbol_table): The string index 0 has a + special meaning for normal symbols, but not for dynamic symbols. + +Sat Jan 22 12:26:01 1994 Stu Grossman (grossman at cygnus.com) + + * sparclynx.c: Setup appropriate macros to enable core file + support. + +Fri Jan 21 16:25:35 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * targets.c: Add a vector of matching format names. + * format.c (bfd_matching_formats): New function to return it. + (bfd_check_format): Set it. + * bfd-in2.h: Regenerated. + + * bfd-in.h: Remove decls of bfd_ec type and error printing functions. + Remove decl of type symclass; wasn't used. + * bfd.c: Document error handling, including code fragments + containing the error decls that were in bfd-in.h. + Remove DEFUNs. + * bfd-in2.h: Regenerated. + +Fri Jan 21 14:11:16 1994 Sean Fagan (sef@cygnus.com) + + * nlmcode.h, liblnm.h, nlm32-alpha.c nlm32-i386.c nlm32-sparc.c: + The sparc (and possibly other?) NLM format requires a different + way to write exports, so add a write_export field to the backend + data (and set it to NULL for everything but the sparc). + +Fri Jan 21 14:11:16 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * sunos.c (MY(read_dynamic_relocs)): Compare info->dynrel with NULL, + not (struct external_nlist *) NULL. info->dynrel is a PTR, not + a struct external_nlist *. + +Fri Jan 21 09:29:01 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * bfd.c: Remove error strings for errors removed below. + * aoutx.h (translate_to_native_sym_flags), bfd-in.h (bfd_ec), + oasys.c (oasys_write_sections): Rename + bfd_error_nonrepresentable_section to nonrepresentable_section. + None of the other bfd error names start with "bfd_error". + Remove errors symbol_not_found and no_relocation_info, which seem + to be unused. + * bfd-in2.h: Regenerated. + +Fri Jan 21 01:11:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bfd.c (bfd_get_gp_size): Added support for ELF. + + * syms.c (BSF_DYNAMIC): New symbol flag. + (bfd_print_symbol_vandf): Print it. + * bfd-in2.h: Rebuilt. + * libaout.h (struct aout_backend_data): New read_dynamic_symbols + and read_dynamic_relocs fields. + (struct aoutdata): New dynamic_info field. + (obj_aout_dynamic_info): New accessor macro. + * sunos.c (struct sunos_dynamic_info): New structure. + (sunos_read_dynamic_info, MY(read_dynamic_symbols), + MY(read_dynamic_relocs)): New functions to read dynamic symbols + and relocs. + * aoutx.h (NAME(aout,some_aout_object_p)): If the object is + dynamically linked, set SEC_RELOC for both the .text and .data + sections. + (translate_from_native_sym_flags): Don't set BSF_LOCAL for an + undefined symbol. + (translate_symbol_table): New function, split out of + slurp_symbol_table; set the BSF_DYNAMIC flag appropriately. + (NAME(aout,slurp_symbol_table)): Read dynamic symbols, if any. + (NAME(aout,slurp_reloc_table)): Read dynamic relocs, if any. + (NAME(aout,get_reloc_upper_bound)): Include dynamic reloc count in + return value. + * aoutf1.h (NAME(aout,sunos4_write_object_contents)): Don't write + out dynamic symbols or relocs against reloc symbols, since they + are already in the .text section and we wouldn't know where to + write them anyhow. + (sunos4_aout_backend): Initialize read_dynamic_symbols and + read_dynamic_relocs fields. + * aout-target.h (MY(backend_data)): Initialize + read_dynamic_symbols and read_dynamic_relocs fields. + +Thu Jan 20 20:57:27 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * hosts/alphaosf.h (uint64e_type, uint64_type, int64_type): Delete + typedefs, since HOST_64_BIT will take care of defining them in + bfd.h. + +Wed Jan 19 17:28:59 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * config/alphaosf.mh (HDEFINES): Don't define HOST_64_BIT here; + that's dealt with elsewhere. + * hosts/alphaosf.h (sprintf_vma, fprintf_vma): New macros. + (uint64_typeHIGH, uint64_typeLOW): Comment with HOST_64_BIT so + they get copied to bfd.h. + + * reloc.c (enum bfd_reloc_code_real): Add some Alpha relocation + types. Reorganized some of the existing ones. + * coff-alpha.c (alpha_howto_table): Construct 64-bit negative one + values in case of compilation on a 32-bit machine. Fix pcrel + fields of some reloc types. + (alpha_bfd_reloc_type_lookup): Handle more relocation types. + + * bfd-in.h (uint64_typeHIGH, uint64_typeLOW): Supply default + definitions when not defined, regardless of whether uint64_type is + a defined macro or not. + (fprintf_vma, sprintf_vma): Define only if fprintf_vma is not + already defined. + +Wed Jan 19 00:02:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (translate_to_native_sym_flags): Set the type of a + BSF_WARNING symbol to N_WARNING. + +Tue Jan 18 16:43:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (aout_link_add_symbols): Increment sym_hash as well as p + for an indirect or warning symbol. + (aout_link_write_symbols): Update sym_hash with the target of an + indirect or warning symbol. If an indirect symbol is defined, + output the calculated value and don't output the target symbol. + +Tue Jan 18 03:54:59 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (translate_from_native_sym_flags): Give warning symbols + an (unused) nonzero section value, needed for check below. + +Mon Jan 17 15:12:07 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (translate_from_native_sym_flags, + aout_link_add_symbols): Treat N_SET[ABDT] | N_EXT like + N_SET[ABDT]. + +Fri Jan 14 16:45:43 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_object_p): If there is a SHT_DYNAMIC section, set + the DYNAMIC flag for the BFD. + (NAME(bfd_elf,write_object_contents)): Don't try to write out a + BFD with the DYNAMIC flag set, since we don't generate the program + header table correctly. + +Fri Jan 14 01:04:36 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * elfcode.h (elf_slurp_symbol_table): Free x_symp at the end + of the function to avoid storage leak. + +Thu Jan 13 23:07:32 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_link_write_external): An ifd can be -1. + +Thu Jan 13 12:33:27 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_set_reloc_info): Provide a default symbol for + relocations which don't actually have an associated symbol. + + * som.c (hppa_som_reloc): Add new "error message" argument. + +Wed Jan 12 13:36:43 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + Enable gdb to write to core files on more core file readers. + * libbfd.c (bfd_generic_set_section_contents): Remove range check + for section size, it is already done in bfd_set_section_contents + with bfd_get_section_size_now. + * aix386-core.c, hppabsd-core.c, hpux-core.c, irix-core.c, + osf-core.c, ptrace-core.c, trad-core.c (*_set_section_contents): + Use bfd_generic_set_section_contents instead of bfd_false. + +Wed Jan 12 15:31:57 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * linker.c: Added initial documentation. + + * linker.c (default_indirect_link_order): Don't expect space for + output relocations if there aren't any input relocations. + +Tue Jan 11 14:37:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * aoutx.h (NAME(aout,final_link)): Set a_entry before computing + file offsets. + + * elfcode.h (swap_out_syms): A common symbol is STT_OBJECT, not + STT_NOTYPE. + +Tue Jan 11 09:10:56 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Use ELF, not COFF for m88*-*-dgux*. + Combine m88k-*-* and m88110-*-* cases into m88*-*-*. + +Tue Jan 11 00:07:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecofflink.c: Extensive changes to compress and merge debugging + information, and to write some of out directly rather than saving + it in memory. Several new functions and structures, and new + arguments to existing functions. + * ecoff.c (ecoff_compute_reloc_file_positions): Compute + sym_filepos as well. + (ecoff_get_extr): Use ifdmap instead of ifdbase. + (ecoff_write_object_contents): Don't compute sym_filepos here. + Only output symbols if outsymbols is not NULL. + (ecoff_bfd_final_link): Adjust for changes in ecoff_debug_info and + bfd_ecoff_debug functions. Write out debugging information here. + (ecoff_final_link_debug_accumulate): Adjust for changes in + bfd_ecoff_debug functions. + (ecoff_link_write_external): Use ifdmap rather than ifdbase. + * elf32-mips.c (mips_elf_read_ecoff_info): Read external symbols + first, to put them in the first memory buffer. Clear fdr field. + (mips_elf_get_extr): Use pointer to unswapped external symbol. + (mips_elf_final_link): Adjust for changes in bfd_ecoff functions. + Preserve .text, .data and .bss even if they are empty. Save + pointer to unswapped external symbol rather than copying it. + Don't free up the external symbols. + * libelf.h (elf_symbol_type): Change mips_extr to PTR. + * bfd-in.h (bfd_ecoff_debug_init, bfd_ecoff_debug_free): Declare. + (bfd_ecoff_debug_accumulate): Update declaration. + (bfd_ecoff_debug_accumulate_other): Rename declaration from + bfd_ecoff_debug_link_other and update. + (bfd_ecoff_write_accumulated_debug): Declare. + * bfd-in2.h: Rebuilt. + * Makefile.in: Rebuilt dependencies. + +Mon Jan 10 20:46:53 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in (install): Remove "@" which follows a backslash. In + this position it just causes errors, not suppresses echoes. + +Mon Jan 10 09:06:21 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (hppa_som_gen_reloc_type): Fix handling of LT and RT + field selectors. + +Sun Jan 9 04:32:25 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * config/i386-netbsd.mt (SELECT_VECS): Include i386bsd_vec. + +Fri Jan 7 10:27:27 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * aoutx.h (adjust_z_magic): Don't merge the start of bss with the + end of data if they are not contiguous. + + * aoutf1.h (sunos4_aout_backend): Comment the fields' meanings. + +Fri Jan 7 15:40:16 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_mkobject_hook): Don't set SEC_SHARED_LIBRARY flag + for .reginfo section here. + (ecoff_new_section_hook): Set it here instead. + +Fri Jan 7 10:29:27 1994 Stan Shebs (shebs@andros.cygnus.com) + + * bfd-in.h: (bfd_boolean): Add workaround for systems that also + define true and false as enums. + (ALMOST_STDC): Add as alternative to __STDC__. + * bfd-in2.h: Rebuilt. + * syms.c (bfd_print_symbol_vandf): Convert a PTR to FILE*. + +Thu Jan 6 14:24:44 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h (translate_to_native_sym_flags): Catch the case where + there is no output section. + +Thu Jan 6 14:37:42 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmcode.h (nlm_object_p): If we can't read the fixed header, + count it as a wrong format error, not a system call error, since + the object file might simply be too small. + + * targets.c (target_vector): Added nlm32_alpha_vec inside #ifdef + BFD64. + * Makefile.in (BFD32_BACKENDS): Remove nlm32-alpha.o. + (BFD64_BACKENDS): Add nlm32-alpha.o. It depends on 64 bit + support, even though it is for an Alpha in 32 bit mode. + * configure.in (nlm32_alpha_vec): Set target64 to true. + + * nlm32-gen.c, nlm64-gen.c: Removed. All nlm targets are + different, so there is no point to providing a generic one. + * libnlm.h: Don't bother to check for nlm_backend(bfd) being NULL + in the backend accessor macros; that should no longer be possible. + * targets.c (target_vector): Removed nlm32_big_generic_vec, + nlm64_big_generic_vec, nlm64_little_generic_vec. + * configure.in (nlm32_big_generic_vec, nlm32_little_generic_vec, + nlm64_big_generic_vec, nlm64_little_generic_vec): Removed. + * Makefile.in: Rebuilt dependencies, and + (BFD32_BACKENDS): Removed nlm32-gen.o. + (BFD64_BACKENDS): Removed nlm64-gen.o. + (CFILES): Removed nlm32-gen.c and nlm64-gen.c. + + * hp300hpux.c (ARCH_SIZE): Define before including aoutx.h. + + * linker.c (_bfd_generic_link_add_one_symbol): Add constructor and + bitsize arguments. Changed all callers (aoutx.h). + * libbfd-in.h (_bfd_generic_link_add_one_symbol): Add constructor + and bitsize arguments to declaration. + * libbfd.h: Rebuilt. + + * ecoff.c: First cut at new style of linker backend for + ECOFF--added a bunch of functions. Also: + (ecoff_sec_to_styp_flags): Set flags for .pdata and .xdata. + (ecoff_slurp_symbolic_header): New function. + (ecoff_slurp_symbolic_info): Call ecoff_slurp_symbolic_header. + (ecoff_compute_reloc_file_positions): New function. + (ecoff_set_section_contents): Get out quickly if count is zero. + Check errors better. + (ecoff_write_object_contents): Put .xdata section in data segment. + Call ecoff_compute_reloc_file_positions. Don't output relocs or + external symbols if outsymbols is NULL. + (ecoff_bfd_final_link): Completely rewritten. + * libecoff.h: Include bfdlink.h. + (struct ecoff_backend_data): Add relocate_section field. + (ecoff_data_type): Add sym_hashes and symndx_to_section fields. + (struct ecoff_link_hash_entry): Define. + (struct ecoff_link_hash_table): Define. + (ecoff_bfd_link_add_symbols): Declare as function, not macro. + (ecoff_bfd_link_hash_table_create): Likewise. + * ecofflink.c (bfd_ecoff_debug_one_external): New function. + (bfd_ecoff_debug_externals): Call bfd_ecoff_debug_one_external. + * bfd-in.h (bfd_ecoff_debug_one_external): Declare. + * bfd-in2.h: Rebuilt. + * coff-alpha.c (alpha_howto_table): Mark BRADDR as + partial_inplace, and set the src_mask to 0x1fffff. + (alpha_ecoff_get_relocated_section_contents): Remove unused + variable gp_warned. + (alpha_convert_external_reloc): New static function. + (alpha_relocate_section): New static function. + (alpha_ecoff_backend_data): Initialize relocate_section field. + * coff-mips.c (mips_relocate_refhi): New static function. + (mips_relocate_section): New static function. + (mips_ecoff_backend_data): Initialize relocate_section field. + + * reloc.c (_bfd_relocate_contents): Corrected signed overflow + checking when there is an addend. + + * aoutx.h (NAME(aout,final_link)): Don't abort when trying to link + a non a.out file, just pass it to _bfd_default_link_order. + (aout_link_input_section_std): When doing a final PC relative link + against a section symbol, subtract the VMA of the input section. + (aout_link_input_section_ext): Likewise. + + * linker.c (default_indirect_link_order): Renamed from + _bfd_generic_indirect_link_order and made static. + (_bfd_generic_final_link): Don't switch on link_order type, just + call _bfd_default_link_order. + (_bfd_default_link_order): Handle bfd_indirect_link_order type. + * genlink.h: Removed declaration of + _bfd_generic_indirect_link_order. + * elf32-mips.c (mips_elf_final_link): Don't switch on link_order + type, just call _bfd_default_link_order. + +Tue Jan 4 21:23:37 1994 Ian Lance Taylor (ian@cygnus.com) + + * linker.c (generic_link_check_archive_element): Base the name of + the created common section on the name of the section the symbol + came from. + (_bfd_generic_link_add_one_symbol): (case BIG): A common symbol + must have a section, so don't bother to create one. + +Mon Jan 3 15:32:16 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * aout-target.h (MY(vec)): Add DYNAMIC to mask of object flags. + * aoutf1.h (NAME(aout,sunos4_write_object_contents)): + If the DYNAMIC flag is set, set it in the exec header. + * aoutx.h (NAME(aout,some_aout_object_p)): If the object is + dynamically linked, set the DYNAMIC flag in the BFD. + * libaout.h (N_SET_DYNAMIC): New macro. + (N_DYNAMIC): Add missing 0 in mask. + +Mon Jan 3 11:41:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_get_extr): Don't output section symbols as + external symbols. + + * bfd-in.h, hash.c: Change bfd_hash_allocate argument from size_t + to unsigned int, because size_t may not be defined in bfd.h. + * bfd-in2.h: Rebuilt. + + * bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to + be a const pointer. + * bfd-in2.h: Rebuilt. + * libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to + be a const pointer. + * targets.c (bfd_target): Change swap function pointers + accordingly. + * archive.c (do_slurp_coff_armap): Change swap accordingly. + * aix386-core.c: Change NO_GET and NO_GETS accordingly. + * hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c, + ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET + accordingly. + + * libbfd-in.h (struct artdata): Added tdata field. + (_bfd_add_bfd_to_archive_cache): Declare. + (_bfd_get_elt_at_filepos): Declare. + (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr. + * libbfd.h: Rebuilt. + * archive.c: Cleaned up some more. + (_bfd_generic_mkarchive, bfd_generic_archive_p): Initialize + pointer elements of artdata. + (_bfd_add_bfd_to_archive_cache): Renamed from add_bfd_to_cache. + (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr. + (_bfd_get_elt_at_filepos): Renamed from get_elt_at_filepos. + (get_extended_arelt_filename, bfd_construct_extended_name_table, + bfd_ar_hdr_from_filesystem, compute_and_write_armap): Made static. + * ecoff.c: Some comment changes. + (ecoff_slurp_armap): Handle rename of snarf_ar_hdr. Set + ardata->tdata to raw_armap. + (ecoff_archive_p): Initialize pointer elements of artdata. + * coff-rs6000.c (rs6000coff_get_elt_at_filepos): Handle rename of + add_bfd_to_cache. + + * hash.c: Added some documentation. + +Mon Jan 3 11:09:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * aout-target.h, netbsd386.c: Replace NO_SWAP_MAGIC with SWAP_MAGIC, + and do the swapping here rather than calling ntohl from the N_* + macros. This cleans up assumptions about the size of a host long, + the existence to ntohl, etc. + +Sat Jan 1 13:50:05 1994 Rob Savoye (rob@darkstar.cygnus.com) + + * config.bfd: Add support for VSTa micro-kernel. It currently uses + i386-aout. + +Sat Jan 1 10:18:54 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * hosts/i386mach3.h (HOST_SEGMENT_SIZE): Fix value. + * i386mach3.c (SEGMENT_SIZE): Fix value. + +Fri Dec 31 16:23:43 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Minor cleanups suggested by CodeCenter. + * aoutx.h, coffgen.c, ecoff.c, ecofflink.c, elf.c, libbfd.c, + linker.c, reloc.c, section.c, srec.c: Added /*ARGSUSED*/ as + appropriate. + * aoutx.h (struct external_exec): Removed unnecessary declaration. + (NAME(aout,some_aout_object_p)): Set some tdata pointers to NULL. + (adjust_z_magic): Removed useless variable data_vma. + (stringtab_init): Initialize hash_zero. + (add_to_stringtab): Removed unused fourth argument. + (NAME(aout,swap_std_reloc_out)): Removed useless variable + r_addend. + (aout_link_input_section): Added some casts. + * archive.c (get_extended_arelt_filename, do_slurp_coff_armap, + bfd_ar_hdr_from_filesystem, bsd_write_armap, coff_write_armap): + Minor code rewriting to make it more C like. + (do_slurp_bsd_armap): Added some casts. + * ecoff.c (ecoff_write_object_contents): Removed useless variable + scn_base. + (ecoff_write_armap): Added some casts. Use "" rather than "\0". + * ecofflink.c (bfd_ecoff_write_debug): Added a cast. + * libaout.h (struct internal_exec): Removed unnecessary + declaration. + * linker.c (_bfd_generic_indirect_link_order): Added a cast. + * opncls.c (new_bfd): Removed a cast. + * reloc.c (bfd_generic_get_relocated_section_contents): Added + some casts. + * srec.c (internal_srec_write_object_contents): Removed useless + variable bytes_written. + +Fri Dec 31 11:46:13 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * i386mach3.c (N_TXTADDR): Don't define after all. + (TEXT_START_ADDR): Don't include exec header size in value. + +Thu Dec 30 15:47:54 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * i386mach3.c (N_TXTADDR): Define. + +Thu Dec 30 13:37:24 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Extensive changes to move the bulk of the linker into BFD so that + more efficient backend code can be written for specific object + files. Only existing efficient backend is a.out. + * seclet.c, seclet.h: Removed. + * hash.c, linker.c, genlink.h: New files. + * bfd-in.h: Removed bfd_error_vector. Declared hash table + structures and functions. + (JUMP_TABLE): Removed bfd_seclet_link, added + bfd_link_hash_table_create, bfd_link_add_symbols and + bfd_final_link. + * All backends: Changed accordingly. + * bfd-in2.h: Rebuilt. + * bfd.c (struct _bfd): Added link_next and archive_pass fields. + Removed ld_symbols field. + (bfd_nonrepresentable_section, bfd_undefined_symbol, + bfd_reloc_value_truncated, bfd_reloc_is_dangerous, + bfd_error_vector): Removed. + (bfd_default_error_trap, bfd_error_trap, + bfd_error_nonrepresentabltrap): Removed. + (bfd_get_relocated_section_contents): Pass link_info. Pass + link_order instead of seclet. Pass symbols. + (bfd_relax_section): Pass link_info. + (bfd_seclet_link): Removed. + (bfd_link_hash_table_create, bfd_link_add_symbols, + bfd_final_link): New macros. + * libbfd-in.h: If __GNUC__ is defined and alloca is not, define + alloca as __builtin_alloca. Declare internal linking functions. + * libbfd.h: Rebuilt. + * libbfd.c (bfd_seek): Comment out fseek assertion. It's worked + for months. + * reloc.c (reloc_howto_type): Added error_message argument to + special_function field. Changed all callers and all definitions. + (bfd_get_reloc_size): Make argument a const pointer. + (bfd_perform_relocation): Add error_message argument to hold + string set if return value if bfd_reloc_dangerous. Changed all + callers. + (_bfd_final_link_relocate, _bfd_relocate_contents): New functions. + * section.c (asection): Renamed seclets_head and seclets_tail to + link_order_head and link_order_tail. + * targets.c (bfd_target): Replaced seclet argument with link_info + and link_order and symbols arguments in + bfd_get_relocated_section_contents. Added symbols argument to + bfd_relax_section. Removed bfd_seclet_link. Added + bfd_link_hash_table_create, bfd_link_add_symbols and + bfd_final_link. + * libaout.h (struct aoutdata): Added external_syms, + external_sym_count, external_strings, sym_hashes fields. + (obj_aout_external_syms, obj_aout_external_sym_count, + obj_aout_external_strings, obj_aout_sym_hashes): New accessor + macros. + (WRITE_HEADERS): Only output symbols if outsymbols is not NULL. + * aoutx.h: Wrote new back end linker routines. + (translate_to_native_sym_flags): Return boolean value. Don't use + bfd_error_vector. + (NAME(aout,write_syms)): Return boolean value. Check return value + of translate_to_native_sym_flags and bfd_write. + * aout-target.h (final_link_callback): New function. + (MY_bfd_final_link): New function. + * aout-adobe.c (aout_adobe_write_object_contents): Check return + value of aout_32_write_syms. + * hp300hpux.c (MY(write_object_contents)): Likewise. + * i386lynx.c (WRITE_HEADERS): Likewise. + * libaout.h (WRITE_HEADERS): Likewise. + * bout.c: Changed functions to use link_info->callbacks rather + than bfd_error_vector, and link_orders rather than seclets. + * coff-alpha.c: Likewise. + * coff-h8300.c: Likewise. + * coff-h8500.c: Likewise. + * coff-sh.c: Likewise. + * coff-z8k.c: Likewise. + * elf32-hppa.c: Likewise. + * reloc16.c: Likewise. + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look + up _gp in the hash table rather than in outsymbols. + * coff-a29k.c (a29k_reloc): Pass errors back in new error_message + argument rather than printing them. + * coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and + link_order arguments rather than seclet. Changed all uses and + definitions. + (bfd_coff_reloc16_estimate): Pass link_info arguments. Changed + all uses and definitions. + * libcoff.h: Rebuilt. + * ecoff.c (ecoff_get_extr): If symbol is defined by linker, but + not by ECOFF, make it scAbs. + (ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and + rewritten. + * elf32-mips.c (mips_elf_final_link): Renamed from + mips_elf_seclet_link and rewritten. + * elf32-hppa.c (elf32_hppa_stub_description): Added link_info + field. + (new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub, + hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section): + Added link_info arguments. Changed all callers. + * elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is + not NULL. + * oasys.c (oasys_write_sections): Return boolean value rather than + using bfd_error_vector. + (oasys_write_object_contents): Check return value of + oasys_write_sections. + * hosts/std-host.h: Don't declare qsort or strtol. + * Makefile.in: Rebuild dependencies. + (BFD_LIBS): Removed seclet.o. Added hash.o and linker.o. + (CFILES): Removed seclet.c. Added hash.c and linker.c. + (HFILES): Removed seclet.h. Added genlink.h. + +Thu Dec 30 07:41:36 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * section.c (bfd_get_section_contents): Return zero filled buffer + if section has no contents. + +Tue Dec 28 12:43:54 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elf.c (bfd_elf_generic_reloc): If this is not an inplace reloc, + then skip bfd_perform_relocation even if the addend is non-zero. + +Tue Dec 21 09:22:19 1993 Ken Raeburn (raeburn@rtl.cygnus.com) + + * coffcode.h (coff_write_relocs) [SWAP_OUT_RELOC_OFFSET]: Copy + addend to r_offset field. + + * Makefile.in (CFILES): Added coff-sparc.c. Rebuild dependencies. + + * coff-sparc.c (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET, + CALC_ADDEND): Define. + + * aix386-core.c (aix386_core_file_p): Use cd_regs[0] for computing + the offsetof because AIX /bin/cc does not like to take the address + of an array. (From Minh Tran-Le.) + +Thu Dec 16 13:06:32 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * Thu Dec 16 15:41:06 1993 Peter Hoogenboom (hoogen@cs.utah.edu) + + * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): Make sure to copy + the return pointer into %r2 if no jump-in-call-delay-slot + optimization was done. + + * hosts/hp300bsd.h: Correctly identify 4.3BSD vs 4.4BSD. + +Wed Dec 15 08:04:16 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * hosts/std-host.h: (time): Don't declare; conflicts on Mach3. + + * hosts/i386mach3.h (HOST_PAGE_SIZE): Set to 1 to avoid padding. + (HOST_SEGMENT_SIZE): Set to 0 for same reason. + + * i386mach3.c (PAGE_SIZE, SEGMENT_SIZE): Same changes as above. + (TEXT_START_ADDR): Correct. + (MY_backend_data): Define. + + * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): + New functions; code moved from aout_<size>_adjust_sizes_and_vmas. + +Tue Dec 14 21:48:33 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_begin_writing): Fix thinkos in auxiliary header + support. + (bfd_som_attach_aux_hdr): Likewise. + +Mon Dec 13 23:34:48 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle 'T' field + selectors for PIC code. + + * som.c (hppa_som_gen_reloc_type): Handle 'T' field selectors. + (som_write_fixups): Handle R_DLT_REL, R_FSEL, R_RSEL, R_LSEL + relocations needed by PIC. + +Tue Dec 7 15:47:51 1993 Stu Grossman (grossman at cygnus.com) + + * nlmcode.h: Fixes to avoid compiler warnings... + +Tue Dec 7 15:10:54 1993 Ian Lance Taylor (ian@cygnus.com) + + * libnlm.h (nlm_backend_data): Removed macro definition. + (nlm_alpha_backend_data): Adjusted accordingly. + +Sun Dec 5 19:32:08 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_begin_writing): Flesh out code for handling simple + auxiliary headers. + (bfd_som_attach_aux_hdr): New function. + + * som.h (struct somdata): Add fields for attaching version and + copyright headers. Add accessor macros. + + * som.c (R_DLT_REL, R_AUX_UNWIND, R_SEC_STMT): Add protected + definitions for old versions of HPUX which fail to define them. + (som_hppa_howto_talbe): Add R_DLT_REL, R_AUX_UNWIND, and R_SEC_STMT + now that they're safe. Delete bogus R_STATEMENT relocations. + + * som.c (som_hppa_howto_table): Add missing R_END_TRY. Delete + extra R_DATA_OVERRIDE. + (hppa_som_gen_reloc_type): Generate a relocation for the rounding + mode selector if needed. + (som_write_fixups): Handle requests for a change in the default + rounding mode. Rounding modes do not consume input bytes, but + are just markers much like R_ENTRY and R_EXIT. + +Sat Dec 4 19:40:32 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + Fri Dec 3 09:55:17 1993 Pete Hoogenboom (hoogen@cs.utah.edu) + + * elf32-hppa.c: (hppa_elf_reloc): Do not do code reordering when + the branch instruction as originally been nullified. + hppa_elf_reloc): Avoid useless call to bfd_put_32 () in the + case of no code reordering due to an LDO instruction in the + delay slot of the branch. Make sure to relocate the correct + instruction. Do not perform instruction reordering for millicode + calls. + (hppa_elf_build_arg_reloc_stub): Change the relocation type + to R_HPPA_STUB_CALL_17 when special processing might be needed. + (hppa_elf_build_long_branch_stub): Prevent code reordering on + a call from a linker stub to another linker stub and for millicode + calls. Do not trash the return register for calls from one linker + stub to a second linker stub. + + * elf32-hppa.c: (elf_hppa_howto_table): PLABEL and DLT + relocations are not pc-relative. + + * hppa_stubs.h: (BLE_N_XXX_0_31): New instruction used in + linker stub code. + (COPY_2_31): Likewise. + +Fri Dec 3 18:40:58 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config/solaris2.mh (HDEFINES): Remove -Dconst= + * hosts/solaris.h: If not __GNUC__, define const as empty. + +Thu Dec 2 15:43:32 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c: Added various casts for 32/64 bit cross targeting. + (ecoff_mkobject_hook): Set SEC_SHARED_LIBRARY for the .reginfo + section so that the linker ignores it. + * ecofflink.c: Added various casts for 32/64 bit cross targeting. + (ecoff_add_bytes): Changed need argument to size_t. + (bfd_ecoff_debug_link_other): Check return value of + ecoff_add_string. + + * libbfd-in.h (new_bfd): Use void rather than an empty parameter + list. + * libbfd.h: Rebuilt. + + * libnlm.h (struct nlm_obj_tdata): New field backend_data. + (nlm_backend_data, nlm_alpha_backend_data): New accessor macros. + (struct nlm_backend_data): New field no_uninitialized_data. + (nlm_no_uninitialized_data): New accessor macro. + * nlmcode.h (nlm_compute_section_file_positions): Handle + no_uninitialized_data. + (nlm_external_reloc_compare): Sort relocs by address for a + particular symbol, to make the sort more stable. + (nlm_write_object_contents): Cast the arguments to qsort. Get the + value of a debugging symbol the same way we get the value of a + normal symbol. + * nlm32-alpha.c: Various changes. Write out GP and .lita relocs. + Set no_uninitialized_data to true. + * nlm32-i386.c (nlm32_i386_backend), nlm32-sparc.c + (nlm32_sparc_backend): Set no_uninitialized_data field false. + * nlmswap.h (nlm_swap_fixed_header_out): Zero out destination + before filling it in. + +Wed Dec 1 21:47:58 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_section_type, som_decode_symcalss): New functions. + (som_get_symbol_info): Use them. + (som_slurp_symbol_table): Set the section of common and undefined + symbols correctly. + +Wed Dec 1 14:15:10 1993 Ken Raeburn (raeburn@cygnus.com) + + * elfcode.h (write_relocs): Initialize local var LAST_SYM_IDX, to + make gcc happy. + + * mipsbsd.c: Changes from Ralph Campbell: + (mips_howto_table_ext): MIPS_RELOC_LO16 should use + complain_overflow_dont. + (aout_mips_*_vec): Make name use "a.out" instead of "aout", to + make gdb happy. + + * bfd.c (bfd_errmsgs): Reword invalid-target message. + + * config.bfd: For sparc*-*-coff, use sparc-coff. + * configure.in: Handle sparccoff_vec. + * targets.c (sparccoff_vec): Declare. + + * reloc.c (bfd_get_reloc_size): New function. + (struct reloc_howto_type): Update documentation of size field. + +Wed Dec 1 14:39:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlm32-alpha.c: New file; preliminary Alpha NetWare support. + * config.bfd (alpha-*-netware*): New target; use alpha-nlm. + * config/alpha-nlm.mt: New file. + * configure.in (nlm32_alpha_vec): New vector; use nlm32-alpha.o, + nlm32.o, and nlm.o. + * Makefile.in (BFD32_BACKENDS): Added nlm32-alpha.o. + (CFILES): Added nlm32-alpha.c. + Rebuilt dependencies. + * targets.c (nlm32_alpha_vec): Declare. + + * libnlm.h (struct nlm_backend_data): New fields + optional_prefix_size, nlm_backend_object_p, nlm_write_prefix, + nlm_set_public_section, nlm_get_public_offset. Removed unused + nlm_write_reloc field. Changed nlm_write_import to remove + unnecessary symbol argument. Renamed nlm_write_externals to + nlm_write_external, and changed cound argument from bfd_vma to + bfd_size_type. + (nlm_optional_prefix_size, nlm_backend_object_p_func, + nlm_write_prefix_func, nlm_set_public_section_func, + nlm_get_public_offset_func): New accessor macros. + (nlm_write_reloc_func): Removed. + (nlm_write_external_func): Adjusted for field renaming. + * nlm32-i386.c (nlm_i386_write_import): Renamed from + nlm_i386_write_reloc. Removed old nlm_i386_write_import which + just called old nlm_i386_write_reloc. + (nlm_i386_write_external): Renamed from nlm_i386_write_externals. + Declared. Changed second argument from bfd_vma to bfd_size_type. + (nlm32_i386_backend): Adjusted for changes to fields and names. + * nlm32-sparc.c (nlm_sparc_mangle_relocs): Removed unused, + ifdeffed out code. + (nlm_sparc_write_import): Removed second argument. + (nlm_sparc_write_external): Renamed from + nlm_sparc_write_externals. Changed second argument from bfd_vma + to bfd_size_type. + (nlm32_sparc_backend): Adjusted for changes to fields and names. + * nlmcode.h: Removed some unused code. + (nlm_object_p): Don't destroy tdata pointer. Call + backend_object_p function if it exists. + (nlm_slurp_symbol_table): Removed unused variable rcount. Call + set_public_section_func if it exists instead of checking + NLM_HIBIT. + (nlm_compute_section_file_positions): Account for + optional_prefix_size. + (nlm_write_object_contents): Account for optional_prefix_size. + Removed useless variable write_reloc_func. Changed declaration + and call of write_import_func. Call write_prefix_func if it + exists. Removed unused variables len and temp. Call + get_public_offset_func if it exists rather than setting NLM_HIBIT. + * nlmswap.h: Declare functions. + + * bfd-in.h (uint64_typeLOW, uint64_typeHIGH): Fully parenthesize + for clarity. + (fprintf_vma, sprintf_vma): Use %lx, not %x. + * bfd-in2.h: Rebuilt. + * hosts/alphaosf.h (uint64_typeLOW, uint64_typeHIGH): Cast results + to unsigned long. + + * config.bfd: Don't set target64 here, as the setting is ignored. + * configure.in (ecoffalpha_little_vec): Set target64. + + * config/alphaosf.mt (TDEFINES): Removed; setting host parameters + in TDEFINES is wrong. + + * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): + Remove unused variable output_section. + +Tue Nov 30 16:45:23 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * irix-core.c: New file for Irix 4 and Irix 5 core support. + Functions taken out of coff-mips.c. Handle vmap type VMAPFILE. + * coff-mips.c: Irix 4 core file support moved to irix-core.c. + * targets.c: If IRIX_CORE defined, include irix_core_vec in + target_vector. + * config/irix4.mh (HDEFINES): Add -DIRIX_CORE. + (HDEPFILES): Define to be irix-core.o. + * config/irix5.mh (HDEFINES): Define to be -DIRIX_CORE. + (HDEPFILES): Define to be irix-core.o. + * Makefile.in (OPTIONAL_BACKENDS): Added irix-core.o. Removed + sco-core.o, which no longer exists. + (CFILES): Added all *-core.c files. + Rebuilt dependencies. + +Wed Nov 24 02:02:41 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (map_program_segments): Restore check of file_size != + mem_size, but only if SHT_PROGBITS. + + * ecofflink.c: New file to hold ECOFF debug information linking + routines. + * ecoff.c (ecoff_clear_output_flags, ecoff_rel, ecoff_dump_seclet, + ecoff_add_string, ecoff_get_debug): Removed. Functionality now in + ecofflink.c. + (ecoff_get_extr, ecoff_set_index): New functions. + (ecoff_slurp_symbolic_info): Don't save raw_size. + (ecoff_bfd_seclet_link): Rewrote to use ecofflink.c functions. + (ecoff_compute_section_file_positions): Don't set EXEC_P just + because there is a start address. + (ecoff_write_object_contents): Handle external symbols here. Use + ecofflink.c functions to write out debugging information. + * elf32-mips.c (mips_elf_read_ecoff_info, mips_elf_get_extr, + mips_elf_set_index): New functions. + (mips_elf_seclet_link): Discard empty sections, the .options + section and .gptab sections. Handle linking .mdebug section. + * libecoff.h (ecoff_data_type): Removed raw_size and ifdbase. + * libelf.h (elf_symbol_type): Added mips_extr to tc_data union. + * bfd-in.h: Added prototypes for routines in ecofflink.c (some are + called by gas, so they are public). + * bfd-in2.h: Rebuilt. + * Makefile.in (BFD_LIBS): Added ecofflink.o. + (CFILES): Added ecofflink.c. + (ecofflink.o): New target. Rebuilt dependencies. + +Mon Nov 22 22:26:42 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (hppa_object_p): Also recognize SHARED_MAGIC_CNX as + a valid magic number if it's been defined. + +Mon Nov 22 14:17:36 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ecoff.c (ecoff_mkobject): Don't create .scommon section; linker + no longer requires it. + (ecoff_bfd_seclet_link, ecoff_sizeof_headers, + ecoff_write_object_contents): Don't treat .scommon section + specially. + +Mon Nov 22 10:54:27 1993 Fred Fish (fnf@cygnus.com) + + Merged changes from kev@spuds.geg.mot.com (Kevin A. Buettner): + * bfd/config/delta88.mh (HDEFINES): Define this to be -DPTRACE_CORE. + * bfd/config/delta88.mh (HDEPFILES): Defined to be ptrace-core.o. + * bfd/ptrace-core.c: New file for dealing with core files with + start with the ptrace_user structure found on BCS compliant systems. + * bfd/targets.c (ptrace_core_vec): New vector. + +Mon Nov 22 02:33:12 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * Minimal support for reading SOM fixup streams. Allows + objdump -r to do something reasonable. + * som.c (som_get_reloc_upper_bound): Implement. + (som_canonicalize_reloc): Implement. + (som_set_reloc_info, som_slurp_reloc_table): New functions. + +Sun Nov 21 13:46:55 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * hosts/lynx.h (FPRINTF_ALREADY_DECLARED): Define. + * hosts/sparclynx.h: Include lynx.h instead of duplicating it. + +Fri Nov 19 14:34:04 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coff-a29k.c (a29k_reloc): For R_IREL, don't left shift + signed_value before sign extending it. Don't subtract out + reloc_entry->address. This makes it compatible with what gas is + generating. + + * elfcode.h (elf_fake_sections): Accept .sbss as the name for a + SHT_NOBITS sections. + (map_program_segments): Don't leave the loop after the first + SHT_NOBITS section. + (assign_file_positions_except_relocs): Only force sh_offset and + sh_addr to match modulo maxpagesize for a section which is not + SHT_NOBITS. Changed the method used to force page alignment after + a SHT_NOBITS section to only do it for the last such consecutive + section, and to really force page alignment. + +Fri Nov 19 04:02:01 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * coffcode.h (coff_slurp_symbol_table): Print more verbose message + in the case of an unknown (or unhandled) storage class. + + * config/i386-lynx.mt (TDEFINES): FPRINTF_ALREADY_DECLARED should + not be defined here, since it is a host attribute, not a target + one. + * config/m68k-lynx.mt, config/sparc-lynx.mt: Ditto. + + * coffcode.h (coff_bfd_reloc_type_lookup): Don't define if already + defined. + + * coff-sparc.c: Define some relocations, based on ELF relocations. + (enum reloc_type, bfd_coff_generic_reloc, coff_sparc_howto_table, + struct coff_reloc_map, sparc_reloc_map, + coff_sparc_reloc_type_lookup): Borrowed from elf32-sparc.c and + elf.c, renamed. + (coff_bfd_reloc_type_lookup): Define to be coff_sparc_reloc_.... + (rtype2howto): Index into coff_sparc_howto_table using + dst->r_type. + +Thu Nov 18 11:45:39 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * config.bfd (mips*-*-irix5*): New target; use mipsbelf. + * configure.host (mips-sgi-irix5*) New host; use irix5 (no + hosts/irix5.h created; just use std-host.h). + * config/irix5.mh: New file; like irix4.mh, but don't use -G or + -lmalloc. + * Makefile.in: Rebuilt dependencies. + + * ecoffswap.h: Changed type of internal pointers for swap out + functions to const *. + + * elf32-mips.c (mips_elf_got16_reloc): New function. Handle GOT16 + correctly for assembler, but linker support not implemented. + (elf_mips_howto_table): Use mips_elf_got16_reloc for GOT16. + (mips_elf_sym_is_global): New function; at least on Irix 5, all + non section symbols are considered global. + (elf_backend_sym_is_global): Define. + (mips_elf_final_write_processing): New function. Set the MIPS + architecture level correctly. + (elf_backend_final_write_processing): Define. + (mips_elf_section_from_shdr): Handle SHT_MIPS_OPTIONS. + (mips_elf_fake_sections): Set entsize of .mdebug or .reginfo + section to 1. Handle .options section. + (mips_elf_acom_section, mips_elf_acom_symbol, + mips_elf_acom_symbol_ptr): New static variables, used to build a + generic .acommon section to hold SHN_MIPS_ACOMMON symbols. + (mips_elf_symbol_processing): Handle SHN_MIPS_ACOMMON symbols by + putting them all in a global .acommon section. + + * elfcode.h (bfd_section_from_shdr): Don't dump core if target + section has no ELF section data. + (elf_make_sections): Set addralign of reloc section to 4. + (elf_fake_sections): Likewise. + (map_program_segments): Don't consider section 0. + (assign_file_positions_except_relocs): Don't consider section 0. + In the main loop, skip the symtab and strtab sections, since their + positions are set elsewhere. + (swap_out_syms): Set addralign of symtab section to 4. Set + addralign of strtab sections to 1. + (assign_file_positions_for_relocs): Don't consider section 0. + (write_object_contents): Don't write out section 0. + + * libelf.h (struct elf_backend_data): Added fields + elf_backend_sym_is_global and elf_backend_final_write_processing. + * elf32-target.h (elf32_bed): Added corresponding initializers. + * elf64-target.h (elf64_bed): Likewise. + * elfcode.h (sym_is_global): Take abfd argument. Call + elf_backend_sym_is_global if it is not NULL. + (elf_map_symbols): Pass abfd to sym_is_global. + (write_object_contents): Call elf_backend_final_write_processing + if it is defined. + +Wed Nov 17 18:43:28 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libecoff.h: Include coff/ecoff.h. + (struct ecoff_backend_data): Move external debugging information + fields into a single field pointing to an ecoff_debug_swap + structure. + (ecoff_data_type): Move debugging information fields into a single + field pointing to an ecoff_debug_info structure. + * coff-alpha.c, coff-mips.c, ecoff.c: Corresponding changes. + +Wed Nov 17 17:38:58 1993 Sean Eric Fagan (sef@cygnus.com) + + * nlmswap.h: New file to swap fixed header. Included by NLM + backends. + * libnlm.h (struct reloc_and_sec): Define. + (struct nlm_backend_data): Add fields fixed_header_size, + nlm_read_import, nlm_write_import, nlm_swap_fhdr_in, + nlm_swap_fhdr_out. + (nlm_fixed_header_size, nlm_read_import_func, + nlm_write_import_func, nlm_swap_fixed_header_in_func, + nlm_swap_fixed_header_out_func, nlm_write_external_func): New + accessor macros. + * nlmcode.h: Use new functions. + * nlm32-i386.c: Provide new functions. + * nlm32-sparc.c: New file; SPARC NLM backend. + +Wed Nov 17 13:56:10 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * i386lynx.c (swap_std_reloc_in, swap_ext_reloc_in): Ignore + garbage bits appearing in the upper end of symbolnums. + + * config/sparc-lynx.mt (TDEFINES): Add -DFPRINTF_ALREADY_DECLARED. + +Tue Nov 16 17:03:41 1993 Stu Grossman (grossman at cygnus.com) + + * lynx-core.c (lynx_core_file_p): Change bfd_zalloc to bfd_alloc. + * m68klynx.c: Define core file macros. + * hosts/i386lynx.h, hosts/m68klynx.h, hosts/lynx.h: Move all + non-architecture specific stuff into lynx.h. + +Tue Nov 16 15:45:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * i386linux.c: Define new macro ZMAGIC_DISK_BLOCK_SIZE to 1024, and + change PAGE_SIZE to 4096. + +Mon Nov 15 11:48:08 1993 Ken Raeburn (raeburn@rtl.cygnus.com) + + * Makefile.in (diststuff): New target. + + * VERSION: Updated. + +Sun Nov 14 23:33:01 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_object_setup): Do not create dummy ".text", ".data", + and ".bss" sections. + (setup_sections): Do not set SEC_HAS_CONTENTS if a section's size + is zero. Recognize BSS type sections and turn off SEC_LOAD and + SEC_DATA (so binutils/size works). Set the correct value for + a section's _raw_size. + (som_slurp_symbol_table): Program entry points, and millicode are + also functions. Mark them as such. Also mark L$* symbols as + debugging symbols. + + * bfd-in2.h: Rebuilt. + +Sat Nov 13 15:27:15 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_bfd_reloc_type_lookup): Add missing prototype. Returns + a pointer to constant data. Delete bogus #define which made the + function useless. + + * som.c (som_prep_for_fixups): New function. + (som_write_fixups): New function. + (som_write_space_strings): New function. + (som_write_symbol_strings): New function. + (som_begin_writing): New function. + +Fri Nov 12 15:29:36 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * som.c (som_write_object_contents): Do not abort. Flesh out. + (som_set_section_contents): Do not abort. Flesh out. + + * som.c (som_write_headers): New function. + (som_prep_headers): New function. + (som_build_and_write_symbol_table): New function. + + * som.c (som_sizeof_headers): Add missing prototype. + (som_set_arch_mach): Do not abort. + + * som.c (som_count_spaces): New function. + (som_count_subspaces): New function. + (compare_syms): New function. + (som_compute_checksum): New function. + + * som.c (hppa_som_gen_reloc_type): New function. + (som_bfd_reloc_type_lookup): New function. + + * som.c (try_prev_fixup): New function. + (som_reloc_skip): New function. + (som_reloc_addend): New function. + (som_reloc_call): New function. + + * som.c (som_initialize_reloc_queue): New function. + (som_reloc_queue_insert): Likewise. + (som_reloc_queue_fix): Likewise. + (som_reloc_queue_find): Likewise. + + * som.c (som_hppa_howto_table): SOM howto relocation table. + (hppa_som_reloc): New function. + + * som.c (struct reloc_queue): New structure to keep track of + the last four multibyte relocations emitted. + (enum pa_symbol_type): Type to fully describe the symbol types + associated with .import/.export assembler directives. + + * som.c: Include libhppa.h + + * som.c (bfd_som_set_section_attributes): New function. + (bfd_som_set_subsection_attributes): Likewise. + (bfd_som_set_symboL_type): Likewise. + (bfd_som_attach_unwind_info): Likewise. + * som.h: Declare new exported functions. + + * som.h (struct som_symbol): Add new fields to hold additional + information needed to build/write symbol tables and fixup streams. + (struct som_section_data_struct): Add new fields to hold additional + information needed to build/write space and subspace headers. + (som_symbol_data): New accessor macro for SOM symbol information. + (R_HPPA_*): Basic relocation types to be used by the assembler. + +Fri Nov 12 11:00:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * trad-core.c (trad_unix_core_file_p): If new hook + TRAD_CORE_ALLOW_ANY_EXTRA_SIZE defined, then skip the check for the + corefile being too big. + * hosts/i386sco.h: Define it. + +Thu Nov 11 15:16:28 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * bfd.c (struct _bfd): Add hppabsd_core_data. + * targets.c (target_vector): Add hppabsd_core_vec. + * hpux-core.c (hpux_core_core_file_p): Fail if an unknown core + section is encountered during core section scanning. + * hppabsd-core.c: New file. + * config/hppabsd.mh: Enable HPPA BSD core files. + + * elf32-hppa.c (hppa_elf_reloc): Remove DEFUN crud. Remove code + which is either commented out or ifdef'd out. Add, update and + clean comments. Fix various indention and spacing problems. Handle + problems related to using "ble" to jump to a stub rather than "bl" + (%r31 is trashed by "ble", but not by "bl"). + (NEW_INSTRUCTION): Put inside curly braces. + (CURRENT_STUB_OFFSET): Fix indention problems. + (hppa_elf_build_arg_reloc_stub): Fix indention and spacing problems. + Add, update and clean comments. Handle "ble" %r31 lossage problems. + (hppa_elf_build_long_branch_stub): Likewise. + (hppa_look_for_stubs_in_section): Likewise. + (hppa_elf_stub_check): Remove obsolete function. + + * hppa_stubs.h: Add new instructions to deal with %r31 lossage + problems. Delete unused instructions. + +Tue Nov 9 11:40:27 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * m68klynx.c (TARGET_IS_BIG_ENDIAN_P): Define. + +Tue Nov 9 11:26:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_object_p): Rather than looking through an array + of architectures, get the ELF EM_xxx code from the backend + information. Let the generic ELF target match any EM_xxx code not + matched by another ELF target. Call elf_backend_object_p to let + the backend do more checks and set global information. + * libelf.h (struct elf_backend_data): Added elf_machine_code and + elf_backend_object_p fields. + (struct bfd_elf_arch_map): Removed. + (bfd_elf_arch_map, bfd_elf_arch_map_size): Don't declare. + * elf32-target.h, elf64-target.h: Initialize elf_machine_code + field with ELF_MACHINE_CODE. Initialize elf_backend_object_p + field with elf_backend_object_p (if it is defined). + * elf32-gen.c, elf32-hppa.c, elf32-i386.c, elf32-i860.c, + elf32-m68k.c, elf32-m88k.c, elf32-mips.c, elf32-sparc.c, + elf64-gen.c (ELF_MACHINE_CODE): Defined. + * elf32-mips.c: Include ecoffswap.h to get ECOFF swapping + routines. + (mips_elf_object_p): Set the right machine number. + (mips_elf_ecoff_debug_swap): Defined. + (elf_backend_object_p): Defined to be mips_elf_object_p. + (elf_backend_ecoff_debug_swap): Defined to be + mips_elf_ecoff_debug_swap. + * elf.c (bfd_elf_arch_map, bfd_elf_arch_map_size): Removed. + + * libbfd-in.h (target_vector, default_vector): Declare. + * libbfd.h: Rebuilt. + * format.c (target_vector, default_vector): Don't declare. + + * elf32-mips.c (elf_mips_howto_table): Don't complain on overflow + for R_MIPS_26. Correct overflow detection requires matching the + upper four bits of the destination against the PC. From Ted Lemon + <mellon@pepper.ncd.com>. + + * bout.c (b_out_reloc_type_lookup): Return type should point to + const data. + * coff-i960.c (coff_i960_reloc_type_lookup): Likewise. + * elf32-hppa.c (elf_hppa_reloc_type_lookup): Likewise. + * mipsbsd.c (MY(reloc_howto_type_lookup)): Likewise. + * coff-i386.c (coff_i386_reloc): Made howto const. + * oasys.c (oasys_write_data): Made how const. + + * libelf.h: Added some comments. + (struct elf_backend_data): Added elf_backend_ecoff_debug_swap + field. Removed unused write_relocs field. + * elf32-target.h: Adjusted elf_backend_data initialization + accordingly. + * elf64-target.h: Corrected elf_backend_data initialization to + fill in all fields and to set elf_64_p to 1. + +Mon Nov 8 18:13:14 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (bfd_section_from_shdr): Remove duplicate assignment + to filepos in SHT_STRTAB case. + (assign_file_position_for_section): Set BFD section filepos as + well as ELF section sh_offset. + + * reloc.c: Use const instead of CONST. + (bfd_perform_relocation): Make variable howto a const pointer. + * bfd-in2.h, libbfd.h: Rebuilt. + +Mon Nov 8 12:19:15 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * Makefile.in (realclean): Don't remove generated headers. Reverts + change of 2 Jul 1993. + +Mon Nov 8 06:08:31 1993 D. V. Henkel-Wallace (gumby@cirdan.cygnus.com) + + * configure.bfd: make unixware equivalent to sysv4. + + * config/i386-nlm.mt: bring in elf config; make it the default. + +Sun Nov 7 20:21:38 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * libbfd.c (bfd_put_8): Add parens around reference to "val" + argument. + +Fri Nov 5 21:45:09 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * hosts/i386mach3.h (HOST_SEGMENT_SIZE), + i386mach3.c (SEGMENT_SIZE, TEXT_START_ADDR): Correct values (?). + +Fri Nov 5 15:17:57 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * coffcode.h (coff_write_object_contents): Zero out internal_a. + +Fri Nov 5 10:41:07 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * aoutx.h, archive.c, archures.c, bfd.c, cache.c, coffcode.h, + core.c, ctor.c, format.c, init.c, libbfd.c, opncls.c, reloc.c, + section.c, syms.c, targets.c: + Doc cleanup (spelling, punctuation, grammar, formatting). + * bfd-in2.h, libbfd.h: Rebuild. + +Thu Nov 4 14:46:14 1993 John Gilmore (gnu@rtl.cygnus.com) + + * bfd-in.h (bfd_get_cacheable, bfd_set_cacheable): New accessors. + * bfd.c, opncls.c: Improve comments on file descriptor cacheing. + +Thu Nov 4 08:54:30 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * From Pete Hoogenboom (hoogen@cs.utah.edu) + * elf32-hppa.c (hppa_elf_get_section_contents): Fix logic error + in last change. Always rebuild symbol extension section the first + time though if output sections exist (fixes ld -r problems). + +Thu Nov 04 08:08:46 1993 Jeffrey Wheat (cassidy@cygnus.com) + + * Makefile.in: Add .PHONY for check and installcheck rules. + +Tue Nov 2 14:42:27 1993 Bill Cox (bill@tarkas.cygnus.com) + + * libbfd-in.h (artdata): Use long, not time_t for portability, at + least to HPUX. File below is a derived file. + +Tue Nov 2 14:42:27 1993 Bill Cox (bill@tarkas.cygnus.com) + + * libbfd.h (artdata): Use long, not time_t for portability, at + least to HPUX. + +Tue Nov 2 09:32:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Use bigmips for mips*-*-bsd*. + +Mon Nov 1 14:30:09 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (elf_slurp_reloca_table, elf_slurp_reloc_table): + Handle symbol number of zero. + + * reloc.c (enum bfd_reloc_code_real): Added + BFD_RELOC_MIPS_LITERAL, BFD_RELOC_MIPS_GOT16, + BFD_RELOC_MIPS_CALL16, BFD_RELOC_MIPS_GPREL32. + * bfd-in2.h: Rebuilt. + * coff-mips.c (mips_bfd_reloc_type_lookup): Handle + BFD_RELOC_MIPS_LITERAL. + * elf32-mips.c (mips_reloc_map): Handle new relocs. + (mips_elf_hi16_reloc, mips_elf_lo16_reloc): Rearrange _gp_disp + checks slightly. + + * aout-target.h (MY_bfd_debug_info_start, MY_bfd_debug_info_end, + MY_bfd_debug_info_accumulat [sic]): Remove unused definitions. + (MY_bfd_get_relocated_section_contents, MY_bfd_relax_section, + MY_bfd_seclet_link): Define. + (MY_bfd_reloc_type_lookup): Rename from + MY_reloc_howto_type_lookup. + (MY_bfd_make_debug_symbol): Rename from MY_make_debug_symbol. + (MY(vec)): Use JUMP_TABLE rather than listing functions. + * hp300hpux.c (MY_get_symtab, MY_get_symtab_upper_bound, + MY_canonicalize_reloc, MY_write_object_contents): Don't define in + terms of MY, because that causes a recusive invocation of CAT when + expanded within JUMP_TABLE, and ANSI compilers don't expand + recursive macros. + * mipsbsd.c (MY_bfd_reloc_type_lookup): Rename from + MY_reloc_howto_type_lookup, and don't define in terms of MY. + (MY_canonicalize_reloc): Don't define in terms of MY. + (aout_mips_little_vec, aout_mips_big_vec): Use JUMP_TABLE rather + than listing functions. + +Mon Nov 1 09:12:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * config.bfd: Use m68k-elf for m68*-*-sysv4*. + +See file ChangeLog.1 + + +Local Variables: +mode: indented-text +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/gdb/gdb/ChangeLog-3.x b/contrib/gdb/gdb/ChangeLog-3.x new file mode 100644 index 0000000000000..e8dbcd87bb0a2 --- /dev/null +++ b/contrib/gdb/gdb/ChangeLog-3.x @@ -0,0 +1,4846 @@ +Tue Jan 23 15:49:47 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * dbxread.c (define_symbol): Deal with deftype 'X'. + + * convex-dep.c (wait): Make it pid_t. + + * convex-dep.c (comm_registers_info): accept decimal comm register + specification, as "i comm 32768". + + * dbxread.c (process_one_symbol): Make VARIABLES_INSIDE_BLOCK + macro say by itself where variables are. Pass it desc. + m-convex.h (VARIABLES_INSIDE_BLOCK): Nonzero for native compiler. + + * m-convex.h (SET_STACK_LIMIT_HUGE): Define. + (IGNORE_SYMBOL): Take out #ifdef N_MONPT and put in 0xc4. + +Fri Jan 19 20:04:15 1990 Jim Kingdon (kingdon at albert.ai.mit.edu) + + * printcmd.c (print_frame_args): Always set highest_offset to + current_offset when former is -1. + + * dbxread.c (read_struct_type): Print nice error message + when encountering multiple inheritance. + +Thu Jan 18 13:43:30 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * dbxread.c (read_dbx_symtab): Always treat N_FN as a potential + source for a x.o or -lx symbol, ignoring OFILE_FN_FLAGGED. + + * printcmd.c (print_frame_args): Cast -1 to (CORE_ADDR). + + * hp300bsd-dep.c (_initialize_hp300_dep): Get kernel_u_addr. + m-hp300bsd.h (KERNEL_U_ADDR): Use kernel_u_addr. + + * infcmd.c (run_command): #if 0 out call to + breakpoint_clear_ignore_counts. + +Thu Jan 11 12:58:12 1990 Jim Kingdon (kingdon at mole) + + * printcmd.c (print_frame_args) [STRUCT_ARG_SYM_GARBAGE]: + Try looking up name of var before giving up & printing '?'. + +Wed Jan 10 14:00:14 1990 Jim Kingdon (kingdon at pogo) + + * many files: Move stdio.h before param.h. + + * sun3-dep.c (store_inferior_registers): Only try to write FP + regs #ifdef FP0_REGNUM. + +Mon Jan 8 17:56:15 1990 Jim Kingdon (kingdon at pogo) + + * symtab.c: #if 0 out "info methods" code. + +Sat Jan 6 12:33:04 1990 Jim Kingdon (kingdon at pogo) + + * dbxread.c (read_struct_type): Set TYPE_NFN_FIELDS_TOTAL + from all baseclasses; remove vestigial variable baseclass. + + * findvar.c (read_var_value): Check REG_STRUCT_HAS_ADDR. + printcmd.c (print_frame_args): Check STRUCT_ARG_SYM_GARBAGE. + m-sparc.h: Define REG_STRUCT_HAS_ADDR and STRUCT_ARG_SYM_GARBAGE. + + * blockframe.c (get_frame_block): Subtract one from pc if not + innermost frame. + +Fri Dec 29 15:26:33 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * printcmd.c (print_frame_args): check highest_offset != -1, not i. + +Thu Dec 28 16:21:02 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * valops.c (value_struct_elt): Clean up error msg. + + * breakpoint.c (describe_other_breakpoints): + Delete extra space before "also set at" and add period at end. + +Tue Dec 19 10:28:42 1989 Jim Kingdon (kingdon at pogo) + + * source.c (print_source_lines): Tell user which line number + was out of range when printing error message. + +Sun Dec 17 14:14:09 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * blockframe.c (find_pc_partial_function): Use + BLOCK_START (SYMBOL_BLOCK_VALUE (f)) instead of + SYMBOL_VALUE (f) to get start of function. + + * dbxread.c: Make xxmalloc just a #define for xmalloc. + +Thu Dec 14 16:13:16 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * m68k-opcode.h (fseq & following fp instructions): + Change @ to $. + +Fri Dec 8 19:06:44 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * breakpoint.c (breakpoint_clear_ignore_counts): New function. + infcmd.c (run_command): Call it. + +Wed Dec 6 15:03:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * valprint.c: Change it so "array-max 0" means there is + no limit. + + * expread.y (yylex): Change error message "invalid token in + expression" to "invalid character '%c' in expression". + +Mon Dec 4 16:12:54 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * blockframe.c (find_pc_partial_function): Always return 1 + for success, 0 for failure, and set *NAME and *ADDRESS to + match the return value. + + * dbxread.c (symbol_file_command): Use perror_with_name on + error from stat. + (psymtab_to_symtab, add_file_command), + core.c (validate_files), source.c (find_source_lines), + default-dep.c (exec_file_command): Check for errors from stat, + fstat, and myread. + +Fri Dec 1 05:16:42 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * valops.c (check_field): When following pointers, just get + their types; don't call value_ind. + +Thu Nov 30 14:45:29 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * config.gdb (pyr): New machine. + core.c [REG_STACK_SEGMENT]: New code. + dbxread.c (process_one_symbol): Cast return from copy_pending + to long before casting to enum namespace. + infrun.c: Split registers_info into DO_REGISTERS_INFO + and registers_info. + m-pyr.h, pyr-{dep.c,opcode.h,pinsn.c}: New files. + + * hp300bsd-dep.c: Stay in sync with default-dep.c. + + * m-hp300bsd.h (IN_SIGTRAMP): Define. + +Mon Nov 27 23:48:21 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * m-sparc.h (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE): + Return floating point values in %f0. + +Tue Nov 21 00:34:46 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * dbxread.c (read_type): #if 0 out code which skips to + comma following x-ref. + +Sat Nov 18 20:10:54 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * valprint.c (val_print): Undo changes of Nov 11 & 16. + (print_string): Add parameter force_ellipses. + (val_print): Pass force_ellipses true when we stop fetching string + before we get to the end, else pass false. + +Thu Nov 16 11:59:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * infrun.c (restore_inferior_status): Don't try to restore + selected frame if the inferior no longer exists. + + * valprint.c (val_print): Rewrite string printing code not to + call print_string. + + * Makefile.dist (clean): Remove xgdb and xgdb.o. + +Tue Nov 14 12:41:47 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * Makefile.dist (XGDB, bindir, xbindir, install, all): New stuff. + +Sat Nov 11 15:29:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * valprint.c (val_print): chars_to_get: New variable. + +Thu Nov 9 12:31:47 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * main.c (main): Process "-help" as a switch that doesn't + take an argument. + +Wed Nov 8 13:07:02 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * Makefile.dist (gdb.tar.Z): Add "else true". + +Tue Nov 7 12:25:14 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * infrun.c (restore_inferior_status): Don't dereference fid if NULL. + + * config.gdb (sun3, sun4): Accept "sun3" and "sun4". + +Mon Nov 6 09:49:23 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * Makefile.dist (Makefile): Move comments after commands. + + * *-dep.c [READ_COFF_SYMTAB]: Pass optional header size to + read_section_hdr(). + + * inflow.c: Include <fcntl.h> regardless of USG. + + * coffread.c (read_section_hdr): Add optional_header_size. + (symbol_file_command): Pass optional header size to + read_section_hdr(). + (read_coff_symtab): Initialize filestring. + + * version.c: Change version to 3.4.xxx. + + * GDB 3.4 released. + +Sun Nov 5 11:39:01 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * version.c: Change version to 3.4. + + * symtab.c (decode_line_1): Only skip past "struct" if it + is there. + + * valops.c (value_ind), eval.c (evaluate_subexp, case UNOP_IND): + Have "*" <int-valued-exp> return an int, not a LONGEST. + + * utils.c (fprintf_filtered): Pass arg{4,5,6} to sprintf. + + * printcmd.c (x_command): Use variable itself rather + than treating it as a pointer only if it is a function. + (See comment "this makes x/i main work"). + + * coffread.c (symbol_file_command): Use error for + "%s does not have a symbol-table.\n". + +Wed Nov 1 19:56:18 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * dbxread.c [BELIEVE_PCC_PROMOTION_TYPE]: New code. + m-sparc.h: Define BELIEVE_PCC_PROMOTION_TYPE. + +Thu Oct 26 12:45:00 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * infrun.c: Include <sys/dir.h>. + + * dbxread.c (read_dbx_symtab, case N_LSYM, case 'T'): + Check for enum types and put constants in psymtab. + +Mon Oct 23 15:02:25 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * dbxread.c (define_symbol, read_dbx_symtab): Handle enum + constants (e.g. "b:c=e6,0"). + +Thu Oct 19 14:57:26 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * stack.c (frame_info): Use FRAME_ARGS_ADDRESS_CORRECT + m-vax.h (FRAME_ARGS_ADDRESS_CORRECT): New macro. + (FRAME_ARGS_ADDRESS): Restore old meaning. + + * frame.h (Frame_unknown): New macro. + stack.c (frame_info): Check for Frame_unknown return from + FRAME_ARGS_ADDRESS. + m-vax.h (FRAME_ARGS_ADDRESS): Sometimes return Frame_unknown. + + * utils.c (fatal_dump_core): Add "internal error" to message. + + * infrun.c (IN_SIGTRAMP): New macro. + (wait_for_inferior): Use IN_SIGTRAMP. + m-vax.h (IN_SIGTRAMP): New macro. + +Wed Oct 18 15:09:22 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * config.gdb, Makefile.dist: Shorten m-i386-sv32.h. + + * coffread.c (symbol_file_command): Pass 0 to select_source_symtab. + +Tue Oct 17 12:24:41 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * i386-dep.c (i386_frame_num_args): Take function from m-i386.h + file. Check for pfi null. + m-i386.h (FRAME_NUM_ARGS): Use i386_frame_num_args. + + * infrun.c (wait_for_inferior): set stop_func_name to 0 + before calling find_pc_partial_function. + +Thu Oct 12 01:08:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * breakpoint.c (_initialize_breakpoint): Add "disa". + + * Makefile.dist: Add GLOBAL_CFLAGS and pass to readline. + + * config.gdb (various): "$machine =" -> "machine =". + +Wed Oct 11 11:54:31 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * inflow.c (try_writing_regs): #if 0 out this function. + + * main.c (main): Add "-help" option. + + * dbxread.c (read_dbx_symtab): Merge code for N_FUN with + N_STSYM, etc. + +Mon Oct 9 14:21:55 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * inflow.c (try_writing_regs_command): Don't write past end + of struct user. + + * dbxread.c (read_struct_type): #if 0 out code which checks for + bitpos and bitsize 0. + + * config.gdb: Accept sequent-i386 (not seq386). + (symmetry): Set depfile and paramfile. + + * m-convex.h (IGNORE_SYMBOL): Check for N_MONPT if defined. + +Thu Oct 5 10:14:26 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * default-dep.c (read_inferior_memory): Put #if 0'd out comment + within /* */. + +Wed Oct 4 18:44:41 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * config.gdb: Change /dev/null to m-i386.h for various + 386 machine "opcodefile" entries. + + * config.gdb: Accept seq386 for sequent symmetry. + +Mon Oct 2 09:59:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * hp300bsd-dep.c: Fix copyright notice. + +Sun Oct 1 16:25:30 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * Makefile.dist (DEPFILES): Add isi-dep.c. + + * default-dep.c (read_inferior_memory): Move #endif after else. + +Sat Sep 30 12:50:16 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * version.c: Change version number to 3.3.xxx. + + * GDB 3.3 released. + + * version.c: Change version number to 3.3. + + * Makefile.dist (READLINE): Add vi_mode.c + + * config.gdb (i386): Change /dev/null to m-i386.h + + * config.gdb: Add ';;' before 'esac'. + + * Makefile.dist (gdb.tar.Z): Move comment above dependency. + + * dbxread.c (read_ofile_symtab): Check symbol before start + of source file for GCC_COMPILED_FLAG_SYMBOL. + (start_symtab): Don't clear processing_gcc_compilation. + +Thu Sep 28 22:30:23 1989 Roland McGrath (roland at hobbes.ai.mit.edu) + + * valprint.c (print_string): If LENGTH is zero, print "". + +Wed Sep 27 10:15:10 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * config.gdb: "rm tmp.c" -> "rm -f tmp.c". + +Tue Sep 26 13:02:10 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * utils.c (_initialize_utils): Use termcap to set lines_per_page + and chars_per_line. + +Mon Sep 25 10:06:43 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * dbxread.c (read_dbx_symtab, N_SOL): Do not add the same file + more than once. + +Thu Sep 21 12:43:18 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * infcmd.c (unset_environment_command): Delete all variables + if called with no arg. + + * remote.c, inferior.h (remote_{read,write}_inferior_memory): + New functions. + core.c ({read,write}_memory): Use remote_{read,write}_inferior_memory. + + * valops.c (call_function): When reserving stack space for + arguments, call value_arg_coerce. + + * m-hp9k320.h: define BROKEN_LARGE_ALLOCA. + + * breakpoint.c (delete_command): Ask for confirmation only + when there are breakpoints. + + * dbxread.c (read_struct_type): If lookup_basetype_type has + copied a stub type, call add_undefined_type. + + * sparc_pinsn.c (compare_opcodes): Check for "1+i" anywhere + in args. + + * val_print.c (type_print_base): Print stub types as + "<incomplete type>". + +Wed Sep 20 07:32:00 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * sparc-opcode.h (swapa): Remove i bit from match. + (all alternate space instructions): Delete surplus "foo rs1+0" + patterns. + + * Makefile.dist (LDFLAGS): Set to $(CFLAGS). + + * remote-multi.shar (remote_utils.c, putpkt): Change csum to unsigned. + +Tue Sep 19 14:15:16 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * sparc-opcode.h: Set i bit in lose for many instructions which + aren't immediate. + + * stack.c (print_frame_info): add "func = 0". + +Mon Sep 18 16:19:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * sparc-opcode.h (mov): Add mov to/from %tbr, %psr, %wim. + + * sparc-opcode.h (rett): Fix notation to use suggested assembler + syntax from architecture manual. + + * symmetry-dep.c (I386_REGNO_TO_SYMMETRY): New macro. + (i386_frame_find_saved_regs): Use I386_REGNO_TO_SYMMETRY. + +Sat Sep 16 22:21:17 1989 Jim Kingdon (kingdon at spiff) + + * remote.c (remote_close): Set remote_desc to -1. + + * gdb.texinfo (Output): Fix description of echo to match + reality and ANSI C. + +Fri Sep 15 14:28:59 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * symtab.c (lookup_symbol): Add comment about "asm". + + * sparc-pinsn.c: Use NUMOPCODES. + + * sparc-opcode.h (NUMOPCODES): Use sparc_opcodes[0] not *sparc_opcodes. + +Thu Sep 14 15:25:20 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * dbxread.c (xxmalloc): Print error message before calling abort(). + + * infrun.c (wait_for_inferior): Check for {stop,prev}_func_name + null before passing to strcmp. + +Wed Sep 13 12:34:15 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * sparc-opcode.h: New field delayed. + sparc-pinsn.c (is_delayed_branch): New function. + (print_insn): Check for delayed branches. + + * stack.c (print_frame_info): Use misc_function_vector in + case where ar truncates file names. + +Tue Sep 12 00:16:14 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * convex-dep.c (psw_info): Move "struct pswbit *p" with declarations. + +Mon Sep 11 14:59:57 1989 Jim Kingdon (kingdon at spiff) + + * convex-dep.c (core_file_command): Delete redundant printing + of "Program %s". + + * m-convex.h (ENTRY_POINT): New macro. + + * m-convex.h (FRAME_CHAIN_VALID): Change outside_first_object_file + to outside_startup_file + + * main.c: #if 0 out catch_termination and related code. + + * command.c (lookup_cmd_1): Consider underscores part of + command names. + +Sun Sep 10 09:20:12 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * printcmd.c: Change asdump_command to disassemble_command + (_initialize_printcmd): Change asdump to diassemble. + + * main.c (main): Exit with code 0 if we hit the end of a batch + file. + + * Makefile.dist (libreadline.a): Fix syntax of "CC=${CC}". + +Sat Sep 9 01:07:18 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * values.c (history_info): Renamed to value_history_info. + Command renamed to "info value" (with "info history" still + accepted). + + * sparc-pinsn.c (print_insn): Extend symbolic address printing + to cover "sethi" following by an insn which uses 1+i. + +Fri Sep 8 14:24:01 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * m-hp9k320.h, m-hp300bsd.h, m-altos.h, m-sparc.h, m-sun3.h + (READ_GDB_SYMSEGS): Remove. + dbxread.c [READ_GDB_SYMSEGS]: Remove code to read symsegs. + + * sparc-pinsn.c (print_insn): Detect "sethi-or" pairs and + print symbolic address. + + * sparc-opcode.h (sethi, set): Change lose from 0xc0000000 to + 0xc0c00000000. + + * remote.c (remote_desc): Initialize to -1. + + * Makefile.dist (libreadline.a): Pass CC='${CC}' to readline makefile. + +Thu Sep 7 00:07:17 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * dbxread.c (read_struct_type): Check for static member functions. + values.c, eval.c, valarith.c, valprint.c, valops.c: Merge changes + from Tiemann for static member functions. + + * sparc-opcode.h (tst): Fix all 3 patterns. + + * Makefile.dist (gdb1): New rule. + + * sparc-opcode.h: Change comment about what the disassembler + does with the order of the opcodes. + + * sparc-pinsn.c (compare_opcodes): Put 1+i before i+1. + Also fix mistaken comment about preserving order of original table. + + * sparc-opcode.h (clr, mov): Fix incorrect lose entries. + + * m-symmetry.h (FRAME_NUM_ARGS): Add check to deal with code that + GCC sometimes generates. + + * config.gdb: Change all occurances of "skip" to "/dev/null". + + * README (about languages other than C): Update comments about + Pascal and FORTRAN. + + * sparc-opcode.h (nop): Change lose from 0xae3fffff to 0xfe3fffff. + + * values.c (value_virtual_fn_field): #if 0-out assignment to + VALUE_TYPE(vtbl). + +Wed Sep 6 12:19:22 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * utils.c (fatal_dump_core): New function. + Makefile.dist (MALLOC_FLAGS): use -Dbotch=fatal_dump_core + +Tue Sep 5 15:47:18 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * breakpoint.c (enable_command): With no arg, enable all bkpts. + + * Makefile.dist (Makefile): Remove \"'s around $(MD). + + * Makefile.dist: In "cd readline; make . . ." change first + SYSV_DEFINE to SYSV. + + * m68k-pinsn.c (_initialize_pinsn): Use alternate assembler + syntax #ifdef HPUX_ASM + +Sat Sep 2 23:24:43 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * values.c (history_info): Don't check num_exp[0] if num_exp + is nil (just like recent editing_info change). + +Fri Sep 1 19:19:01 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * gdb.texinfo (inc-history, inc-readline): Copy in the inc-* files + because people might not have makeinfo. + + * README (xgdb): Strengthen nasty comments. + + * gdb.texinfo: Change @setfilename to "gdb.info". + +Thu Aug 31 17:23:50 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * main.c (editing_info): Don't check arg[0] if arg is null. + + * m-vax.h: Add comment about known sigtramp bug. + + * sun3-dep.c, sparc-dep.c (IS_OBJECT_FILE, exec_file_command): + Get right text & data addresses for .o files. + +Wed Aug 30 13:54:19 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * utils.c (tilde_expand): Remove function (it's in readline). + + * sparc-opcode.h (call): Change "8" to "9" in first two + patterns (%g7->%o7). + +Tue Aug 29 16:44:41 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * printcmd.c (whatis_command): Change 4th arg to type_print + from 1 to -1. + +Mon Aug 28 12:22:41 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * dbxread.c (psymtab_to_symtab_1): In "and %s ..." change + pst->filename to pst->dependencies[i]->filename. + + * blockframe.c (FRAMELESS_LOOK_FOR_PROLOGUE): New macro + made from FRAMELESS_FUNCTION_INVOCATION from m-sun3.h except + that it checks for zero return from get_pc_function_start. + m-hp9k320.h, m-hp300bsd.h, m-i386.h, m-isi.h, m-altos.h, + m-news.h, m-sparc.h, m-sun2.h, m-sun3.h, m-symmetry.h + (FRAMELESS_FUNCTION_INVOCATION): Use FRAMELESS_LOOK_FOR_PROLOGUE. + + * dbxread.c (read_struct_type): Give warning and ignore field + if bitpos and bitsize are zero. + +Sun Aug 27 04:55:20 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * dbxread.c (psymtab_to_symtab{,_1}): Print message about + reading in symbols before reading stringtab, not after. + +Sat Aug 26 02:01:53 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * dbxread.c (IS_OBJECT_FILE, ADDR_OF_TEXT_SEGMENT): New macros. + (read_dbx_symtab): Use text_addr & text_size to set end_of_text_addr. + (symbol_file_command): pass text_addr & text_size to read_dbx_symtab. + +Fri Aug 25 23:08:13 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * valprint.c (value_print): Try to give the name of function + pointed to when printing a function pointer. + +Thu Aug 24 23:18:40 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * core.c (xfer_core_file): In cases where MEMADDR is above the + largest address that makes sense, set i to len. + +Thu Aug 24 16:04:17 1989 Roland McGrath (roland at hobbes.ai.mit.edu) + + * valprint.c (print_string): New function to print a character + string, doing array-max limiting and repeat count processing. + (val_print, value_print): Use print_string. + (REPEAT_COUNT_THRESHOLD): New #define, the max number of elts to print + without using a repeat count. Set to ten. + (value_print, val_print): Use REPEAT_COUNT_THRESHOLD. + + * utils.c (printchar): Use {fputs,fprintf}_filtered. + + * valprint.c (val_print): Pass the repeat count arg to the + fprintf_filtered call for "<repeats N times>" messages. + +Wed Aug 23 22:53:47 1989 Roland McGrath (roland at hobbes.ai.mit.edu) + + * utils.c: Include <pwd.h>. + + * main.c: Declare free. + +Wed Aug 23 05:05:59 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * utils.c, defs.h: Add tilde_expand. + source.c (directory_command), + main.c (cd_command), + main.c (set_history_filename), + dbxread.c (symbol_file_command), + coffread.c (symbol_file_command), + dbxread.c (add_file_command), + symmisc.c (print_symtabs), + *-dep.c (exec_file_command, core_file_command), + main.c (source_command): Use tilde_expand. + + * dbxread.c (read_type): When we get a cross-reference, resolve + it immediately if possible, only calling add_undefined_type if + necessary. + + * gdb.texinfo: Uncomment @includes and put comment at start + of file telling people to use makeinfo. + + * valprint.c (type_print_base): Print the right thing for + bitfields. + + * config.gdb (sun3os3): Set paramfile and depfile. + +Tue Aug 22 05:38:36 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * dbxread.c (symbol_file_command): Pass string table size to + read_dbx_symtab(). + (read_dbx_symtab): Before indexing into string table, check + string table index for reasonableness. + (psymtab_to_symtab{,_1}, read_ofile_symtab): Same. + +Tue Aug 22 04:04:39 1989 Roland McGrath (roland at hobbes.ai.mit.edu) + + * m68k-pinsn.c: Replaced many calls to fprintf and fputs with + calls to fprintf_filtered and fputs_filtered. + (print_insn_arg): Use normal MIT 68k syntax for postincrement, + predecrement, and register indirect addressing modes. + +Mon Aug 21 10:08:02 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * main.c (initialize_signals): Set signal handler for SIGQUIT + and SIGHUP to do_nothing. + + * ns32k-opcode.h (ord): Change 1D1D to 1D2D. + + * ns32k-pinsn.c (print_insn_arg, print_insn): Handle index + bytes correctly. + + * ns32k-opcode.h: Add comments. + + * dbxread.c (read_type): Put enum fields in type.fields in order + that they were found in the debugging symbols (not reverse order). + +Sun Aug 20 21:17:13 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * main.c (source_command): Read .gdbinit if run without argument. + + * source.c (directory_command): Only print "foo already in path" + if from_tty. + + * version.c: Change version number to 3.2.xxx + +Sat Aug 19 00:24:08 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * m-news.h: Define HAVE_WAIT_STRUCT. + + * m-isi.h, isi-dep.c: Replace with new version from Adam de Boor. + config.gdb: Remove isibsd43. + + * main.c (catch_termination): Don't say we have written + .gdb_history until after we really have. + + * convex-dep.c (attach): Add "sleep (1)". + (write_vector_register): Use "LL" with long long constant. + (wait): Close comment. + (wait): Change "unix 7.1 bug" to "unix 7.1 feature" & related + changes in comment. + (scan_stack): And fp with 0x80000000 in while loop test. + (core_file_command): Move code to set COREFILE. + (many places): Change printf to printf_filtered. + (psw_info): Allow argument giving value to print as a psw. + (_initialize_convex_dep): Update docstrings. + + * m-convex.h (WORDS_BIG_ENDIAN): Correct typo ("WRODS") + define NO_SIGINTERRUPT. + define SET_STACK_LIMIT_HUGE. + add "undef BUILTIN_TYPE_LONGEST" before defining it. + Use "LL" after constants in CALL_DUMMY. + + * dbxread.c: In the 3 places it says error "ridiculous string + table size"... delete extra parameter to error. + + * dbxread.c (scan_file_globals): Check for FORTRAN common block. + Allow multiple references for the sake of common blocks. + + * main.c (initialize_main): Set history_filename to include + current directory. + + * valprint.c (decode_format): Don't return a defaulted size + field if osize is zero. + + * gdb.texinfo (Compilation): Update information on -gg symbols. + Document problem with ar. + +Fri Aug 18 19:45:20 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * valprint.c (val_print, value_print): Add "<repeats %d times>" code. + Also put "..." outside quotes for strings. + + * main.c (initialize_main): Add comment about history output file + being different from history input file. + + * m-newsos3.h: Undefine NO_SIGINTERRUPT. Rearrange a few comments. + + * m-newsos3.h (REGISTER_U_ADDR): Use new version from Hikichi. + + * sparc-opcode.h: Add comment clarifying meaning of the order of + the entries in sparc_opcodes. + + * eval.c (evaluate_subexp, case UNOP_IND): Deal with deferencing + things that are not pointers. + + * valops.c (value_ind): Make dereferencing an int give a LONGEST. + + * expprint.c (print_subexp): Add (int) cast in OP_LAST case. + + * dbxread.c (read_array_type): Set lower and upper if adjustable. + + * symtab.c (lookup_symbol): Don't abort if symbol found in psymtab + but not in symtab. + +Thu Aug 17 15:51:20 1989 Randy Smith (randy at hobbes.ai.mit.edu) + + * config.gdb: Changed "Makefile.c" to "Makefile.dist". + +Thu Aug 17 01:58:04 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu) + + * sparc-opcode.h (or): Removed incorrect lose bit 0x08000000. + [many]: Changed many `lose' entries to have the 0x10 bit set, so + they don't think %l0 is %g0. + +Wed Aug 16 00:30:44 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * m-symmetry.h (STORE_STRUCT_RETURN): Also write reg 0. + (EXTRACT_RETURN_VALUE): Call symmetry_extract_return_value. + symmetry-dep.c (symmetry_extract_return_value): New fn. + + * main.c (symbol_completion_function): Deal with changed + result_list from lookup_cmd_1 for ambiguous return. + command.c (lookup_cmd): Same. + + * inflow.c [TIOCGETC]: Move #include "param.h" back before + system #includes. Change all #ifdef TIOCGETC to + #if defined(TIOCGETC) && !defined(TIOCGETC_BROKEN) + m-i386-sysv3.2.h, m-i386gas-sysv3.2.h: Remove "#undef TIOCGETC" + and add "#define TIOCGETC_BROKEN". + + * command.c (lookup_cmd_1): Give the correct result_list in the + case of an ambiguous return where there is a partial match + (e.g. "info a"). Add comment clarifying what is the correct + result_list. + + * gdb.texinfo (GDB History): Document the two changes below. + + * main.c (command_line_input): Make history expansion not + just occur at the beginning of a line. + + * main.c (initialize_main): Make history expansion off by default. + + * inflow.c: Move #include "param.h" after system #includes. + + * i386-dep.c (i386_float_info): Use U_FPSTATE macro. + + * m-i386-sysv3.2.h, m-i386gas-sysv3.2.h: New files. + Makefile.dist, config.gdb: Know about these new files. + +Tue Aug 15 21:36:11 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * symtab.c (lookup_struct_elt_type): Use type_print rather + than assuming type has a name. + +Tue Aug 15 02:25:43 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu) + + * sparc-opcode.h (mov): Removed bogus "or i,0,d" pattern. + + * sparc-opcode.h (mov, or): Fixed incorrect `lose' members. + + * sparc-dep.c: Don't include "sparc-opcode.h". + (skip_prologue, isanulled): Declare special types to recognize + instructions, and use them. + + * sparc-pinsn.c (print_insn): Sign-extend 13-bit immediate args. + If they are less than +9, print them in signed decimal instead + of unsigned hex. + + * sparc-opcode.h, sparc-pinsn.c: Completely rewritten to share an + opcode table with gas, and thus produce disassembly that looks + like what the assembler accepts. + +Tue Aug 15 16:20:52 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * symtab.c (find_pc_psymbol): Move best_pc=psymtab->textlow-1 + after test for psymtab null. + + * main.c (editing_info): Remove variable retval. + + * config.gdb (sun3, isi): Comment out obsolete message about telling + it whether you have an FPU (now that it detects it). + + * config.gdb (sun3): Accept sun3os3. + + * m68k-insn.h: Include <signal.h>. + + * m68k-pinsn.h (convert_{to,from}_68881): Add have_fpu code + + * m-newsos3.h: Undefine USE_PCB. That code didn't seem to work. + + * sparc-dep.c: Put in insn_fmt and other stuff from the old + sparc-opcode.h. + + * sparc-opcode.h, sparc-pinsn.c: Correct copyright notice. + + * sparc-opcode.h, sparc-pinsn.c: Replace the old ones with the new + ones by roland. + +Tue Aug 15 02:25:43 1989 Roland McGrath (roland at apple-gunkies.ai.mit.edu) + + * Makefile.dist: Don't define CC at all. + + * Makefile.dist (Makefile): Remove tmp.c after preprocessing. + Use $(MD) instead of M_MAKEDEFINE in the cc command. + + * Makefile.dist: Don't define RL_LIB as + "${READLINE}/libreadline.a", since READLINE is a list of files. + +Mon Aug 14 23:49:29 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * main.c (print_version): Change 1988 to 1989. + + * main.c (copying_info, initialize_main): Remove #if 0'd code. + +Tue Aug 1 14:44:56 1989 Hikichi (hikichi at sran203) + + * m-newsos3.h + (NO_SIGINTERRUPT): have SIGINTERRUPT on NEWS os 3. + + * m-news.h(FRAME_FIND_SAVED_REGS): use the sun3's instead of old + one. + +Mon Aug 14 15:27:01 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * m-news.h, m-newsos3.h, news-dep.c: Merge additional changes + by Hikichi (ChangeLog entries above). + + * Makefile.dist (READLINE): List readline files individually + so we don't accidently get random files from the readline + directory. + + * m-news.h (STORE_RETURN_VALUE, EXTRACT_RETURN_VALUE): + Expect floating point returns to be in fp0. + + * gdb.texinfo (Format options): New node. + + * gdb.texinfo: Comment out "@include"s until bfox fixes the + readline & history docs. + + * dbxread.c (read_addl_syms): Set startup_file_* if necessary at + the end (as well as when we hit ".o"). + + * printcmd.c (decode_format): Set val.format & val.size to '?' at + start and set defaults at end. + + * symtab.c (decode_line_1): Check for class_name null. + + * valops.c: Each place where it compares against field names, + check for null field names. (new t_field_name variables). + + * utils.c (fputs_filtered): Check for linebuffer null before + checking whether to call fputs. Remove later check for linebuffer + null. + +Sun Aug 13 15:56:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * m-isi.h, m-sun3.h ({PUSH,POP}_FP_REGS): New macros. + m-sun3.h (NUM_REGS): Conditionalize on FPU. + config.gdb (sun3, isi): Add message about support for machines + without FPU. + + * main.c (catch_termination, initialize_signals): new functions. + + * main.c (editing_info): Add "info editing n" and "info editing +". + Rewrite much of this function. + gdb.texinfo (GDB Readline): Document it. + + * values.c (history_info): Add "info history +". Also add code to + do "info history +" when command is repeated. + gdb.texinfo (Value History): Document "info history +". + + * expprint.c (print_subexp): Add OP_THIS to case stmt. + + * config.gdb (sun4os4): Put quotes around make define. + + * config.gdb: Canonicalize machine name at beginning. + +Sat Aug 12 00:50:59 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * config.gdb: define M_MAKEDEFINE + Makefile (Makefile, MD): Be able to re-make Makefile. + + * main.c (command_line_input): Add comments to + the command history. + + * Makefile.dist (Makefile): Add /bin/false. + +Fri Aug 11 14:35:33 1989 Jim Kingdon (kingdon at spiff) + + * Makefile.dist: Comment out .c.o rule and add TARGET_ARCH. + + * m-altos.h: Include sys/page.h & sys/net.h + + * m-altos.h (FRAME_CHAIN{,_VALID}): Use outside_startup_file. + + * config.gdb (altos, altosgas): Add M_SYSV & M_BSD_NM and remove + M_ALLOCA=alloca.o from makedefine. + + * coffread.c (complete_symtab): Change a_entry to entry. + + * m-altosgas.h: New file. + + * m-symmetry (REGISTER_BYTE): Fix dumb mistake. + +Fri Aug 11 06:39:49 1989 Roland McGrath (roland at hobbes.ai.mit.edu) + + * utils.c (set_screensize_command): Check for ARG being nil, since + that's what execute_command will pass if there's no argument. + + * expread.y (yylex): Recognize "0x" or "0X" as the beginning of a + number. + +Thu Aug 10 15:43:12 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * config.gdb, Makefile.dist: Rename Makefile.c to Makefile.dist. + + * m-altos.h: Add comment about porting to USGR2. + + * config.gdb (sparc): Add -Usparc. + +Wed Aug 9 14:20:39 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * m-sun3os4.h: Define BROKEN_LARGE_ALLOCA. + + * values.c (modify_field): Check for value too large to fit in + bitfield. + + * utils.c (fputs_filtered): Allow LINEBUFFER to be NULL. + + * breakpoint.c (condition_command): Check for attempt to specify + non-numeric breakpoint number. + + * config.gdb, Makefile, m-altos.h, altos-dep.c: Merge Altos + port. + + * README: Change message about editing Makefile. + + * config.gdb: Edit Makefile. + Copied Makefile to Makefile.c and changed to let config.gdb + run us through the C preprocessor. + + * expread.y (yylex): Test correctly for definition of number. + +Wed Aug 9 11:56:05 1989 Randy Smith (randy at hobbes.ai.mit.edu) + + * dbxread.c (read_dbx_symtab): Put bracketing of entry point in + test case for .o symbols so that it will be correct even without + debugging symbols. + (end_psymtab): Took bracketing out. + + * blockframe.c (outside_startup_file): Reverse the sense of the + return value to make the functionality implied by the name + correct. + +Tue Aug 8 11:48:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * coffread.c (symbol_file_command): Do not assume presence of a.out + header. + + * blockframe.c: Replace first_object_file_end with + startup_file_{start,end} + (outside_startup_file): New function. + dbxread.c (read_addl_syms, read_dbx_symtab, end_psymbol): set + startup_file_*. Delete first_object_file_end code. + Add entry_point and ENTRY_POINT + coffread.c (complete_symtab): Set startup_file_*. + (first_object_file_end): Add as static. + m-*.h (FRAME_CHAIN, FRAME_CHAIN_VALID): Call outside_startup_file + instead of comparing with first_object_file_end. + + * breakpoint.c (breakpoint_1): Change -1 to (CORE_ADDR)-1. + + * config.gdb (i386, i386gas): Add missing quotes at end of "echo" + + * source.c (directory_command): Add dont_repeat (); + +Mon Aug 7 18:03:51 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * dbxread.c (read_addl_syms): Change strcmp to strncmp and put 3rd + arg back. + + * command.h (struct cmd_list_element): Add comment clarifying + purpose of abbrev_flag. + +Mon Aug 7 12:51:03 1989 Randy Smith (randy at hobbes.ai.mit.edu) + + * printcmd.c (_initialize_printcmd): Changed "undisplay" not to + have abbrev flag set; it isn't an abbreviation of "delete + display", it's an alias. + +Mon Aug 7 00:25:15 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * symtab.c (lookup_symtab_1): Remove filematch (never used). + + * expread.y [type]: Add second argument to 2 calls to + lookup_member_type which were missing them. + + * dbxread.c (symbol_file_command): Add from_tty arg. + Check it before calling query. + + * infcmd.c (tty_command): Add from_tty arg. + + * eval.c (evaluate_subexp): Remove 3rd argument from + calls to value_x_unop. + + * dbxread.c (read_addl_syms): Remove 3rd argument from + call to strcmp. + + * gdb.texinfo (Command editing): @include inc-readline.texinfo + and inc-history.texinfo and reorganize GDB-specific stuff. + + * Makefile: Add line MAKE=make. + + * README (second paragraph): Fix trivial errors. + + * dbxread.c (read_struct_type): Make sure p is initialized. + + * main.c (symbol_completion_function): Complete correctly + on the empty string. + +Sun Aug 6 21:01:59 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * symmetry-dep.c: Remove "long" from definition of i386_follow_jump. + + * gdb.texinfo (Backtrace): Document "where" and "info stack". + + * dbxread.c (cleanup_undefined_types): Strip off "struct " + or "union " from type names before doing comparison + +Sat Aug 5 02:05:36 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * config.gdb (i386, i386gas): Improve makefile editing instructions. + + * Makefile: Fix typo in CLIBS for SYSV. + + * dbxread.c (read_dbx_symtab): Deal with N_GSYM typedefs. + + * dbxread.c (add_file_command): Do not free name. We didn't + allocate it; it just points into arg_string. + + * Makefile, m-*.h: Change LACK_VPRINTF to HAVE_VPRINTF. + +Fri Jul 28 00:07:48 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * valprint.c (val_print): Made sure that all returns returned a + value (usually 0, indicating no memory printed). + + * core.c (read_memory): Changed "return" to "return 0". + + * expread.y (parse_number): Handle scientific notation when the + string does not contain a '.'. + +Thu Jul 27 15:14:03 1989 Randy Smith (randy at hobbes.ai.mit.edu) + + * infrun.c (signals_info): Error if signal number passed is out of + bounds. + + * defs.h: Define alloca to be __builtin_alloca if compiling with + gcc and localized inclusion of alloca.h on the sparc with the + other alloca stuff. + * command.c: Doesn't need to include alloca.h on the sparc; defs.h + does it for you. + + * printcmd.c (print_frame_args): Changed test for call to + print_frame_nameless_args to check i to tell if any args had been + printed. + +Thu Jul 27 04:40:56 1989 Roland McGrath (roland at hobbes.ai.mit.edu) + + * blockframe.c (find_pc_partial_function): Always check that NAME + and/or ADDRESS are not nil before storing into them. + +Wed Jul 26 23:41:21 1989 Roland McGrath (roland at hobbes.ai.mit.edu) + + * m-newsos3.h: Define BROKEN_LARGE_ALLOCA. + * dbxread.c (symbol_file_command, psymtab_to_symtab): + Use xmalloc #ifdef BROKEN_LARGE_ALLOCA. + +Tue Jul 25 16:28:18 1989 Jay Fenlason (hack at apple-gunkies.ai.mit.edu) + + * m68k-opcode.h: moved some of the fmovem entries so they're + all consecutive. This way the assembler doesn't bomb. + +Mon Jul 24 22:45:54 1989 Randy Smith (randy at hobbes.ai.mit.edu) + + * symtab.c (lookup_symbol): Changed error to an informational (if + not very comforting) message about internal problems. This will + get a null symbol returned to decode_line_1, which should force + things to be looked up in the misc function vector. + +Wed Jul 19 13:47:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * symtab.c (lookup_symbol): Changed "fatal" to "error" in + external symbol not found in symtab in which it was supposed to be + found. This can be reached because of a bug in ar. + +Tue Jul 18 22:57:43 1989 Randy Smith (roland at hobbes.ai.mit.edu) + + * m-news.h [REGISTER_U_ADDR]: Decreased the assumed offset of fp0 + by 4 to bring it into (apparently) appropriate alignment with + reality. + +Tue Jul 18 18:14:42 1989 Randy Smith (randy at hobbes.ai.mit.edu) + + * Makefile: pinsn.o should depend on opcode.h + + * m68k-opcode.h: Moved fmovemx with register lists to before other + fmovemx. + +Tue Jul 18 11:21:42 1989 Jim Kingdon (kingdon at susie) + + * Makefile, m*.h: Only #define vprintf (to _doprnt or printf, + depends on the system) if the library lacks it (controlled by + LACK_VPRINTF_DEFINE in makefile). Unpleasant, but necessary to + make this work with the GNU C library. + +Mon Jul 17 15:17:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * breakpoint.c (breakpoint_1): Change addr-b->address to + b->address-addr. + +Sun Jul 16 16:23:39 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * eval.c (evaluate_subexp): Change error message printed when + right operand of '@' is not an integer to English. + + * infcmd.c (registers_info): Fix call to print_spaces_filtered + to specify right # of arguments. + + * gdb.texinfo (Command Editing): Document info editing command. + + * coffread.c (read_file_hdr): Add MC68MAGIC. + + * source.c (select_source_symtab): Change MAX to max. + +Fri Jul 14 21:19:11 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * infcmd.c (registers_info): Clean up display to look good with long + register names, to say "register" instead of "reg", and to put the + "relative to selected stack frame" bit at the top. + +Fri Jul 14 18:23:09 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (record_misc_function): Put parens around | to force + correct evaluation. + +Wed Jul 12 12:25:53 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * m-newsos3, m-news, infrun.c, Makefile, config.gdb, news-dep.c: + Merge in Hikichi's changes for Sony/News-OS 3 support. + +Tue Jul 11 21:41:32 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * utils.c (fputs_filtered): Don't do any filtering if output is + not to stdout, or if stdout is not a tty. + (fprintf_filtered): Rely on fputs_filtered's check for whether to + do filtering. + +Tue Jul 11 00:33:58 1989 Randy Smith (randy at hobbes.ai.mit.edu) + + * GDB 3.2 Released. + + * valprint.h: Deleted. + + * utils.c (fputs_filtered): Don't do any filtering if filtering is + disabled (lines_per_page == 0). + +Mon Jul 10 22:27:53 1989 Randy Smith (roland at hobbes.ai.mit.edu) + + * expread.y [typebase]: Added "unsigned long int" and "unsigned + short int" to specs. + +Mon Jul 10 21:44:55 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * main.c (main): Make -cd use cd_command to avoid + current_directory with non-absolute pathname. + +Mon Jul 10 00:34:29 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (symbol_file_command): Catch errors from stat (even + though they should never happen). + + * source.c (openp): If the path is null, use the current + directory. + + * dbxread.c (read_dbx_symtab): Put N_SETV symbols into the misc + function vector ... + (record_misc_function): ... as data symbols. + + * utils.c (fprintf_filtered): Return after printing if we aren't + going to do filtering. + + * Makefile: Added several things for make clean to take care of. + + * expread.y: Lowered "@" in precedence below +,-,*,/,%. + + * eval.c (evaluate_subexp): Return an error if the rhs of "@" + isn't integral. + + * Makefile: Added removal of core and gdb[0-9] files to clean + target. + + * Makefile: Made a new target "distclean", which cleans things up + correctly for making a distribution. + +Sun Jul 9 23:21:27 1989 Randy Smith (randy at hobbes.ai.mit.edu) + + * dbxread.c: Surrounded define of gnu symbols with an #ifndef + NO_GNU_STABS in case you don't want them on some machines. + * m-npl.h, m-pn.h: Defined NO_GNU_STABS. + +Sun Jul 9 19:25:22 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * utils.c (fputs_filtered): New function. + (fprintf_filtered): Use fputs_filtered. + utils.c (print_spaces_filtered), + command.c (help_cmd,help_cmd_list), + printcmd.c (print_frame_args), + stack.c (print_block_frame_locals, print_frame_arg_vars), + valprint.c (many functions): Use fputs_filtered instead of + fprintf_filtered to avoid arbitrary limit. + + * utils.c (fprintf_filtered): Fix incorrect comment. + +Sat Jul 8 18:12:01 1989 Randy Smith (randy at hobbes.ai.mit.edu) + + * valprint.c (val_print): Changed assignment of pretty to use + prettyprint as a conditional rather than rely on values of the + enum. + + * Projects: Cleaned up a little for release. + + * main.c (initialize_main): Initialize + rl_completion_entry_function instead of completion_entry_function. + + * Makefile: Modified to use the new readline library setup. + + * breakpoint.c (break_command_1, delete_breakpoint, + enable_breakpoint, disable_breakpoint): Put in new printouts for + xgdb usage triggered off of xgdb_verbose. + * main.c (main): Added check for flag to set xgdb_verbose. + * stack.c (frame_command): Set frame_changed when frame command + used. + +Fri Jul 7 16:20:58 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * Remove valprint.h and move contents to value.h (more logical). + +Fri Jul 7 02:28:06 1989 Randall Smith (randy at rice-chex) + + * m68k-pinsn.c (print_insn): Included a check for register list; + if there is one, make sure to start p after it. + + * breakpoint.c (break_command_1, delete_breakpoint, + enable_breakpoint, disable_breakpoint): #ifdef'd out changes + below; they produce unwanted output in gdb mode in gnu-emacs. + + * gdb.texinfo: Spelled. Also removed index references from + command editing section; the relevance/volume ratio was too low. + Removed all references to the function index. + + * ns32k-opcode.h, ns32k-pinsn.c: Backed out changes of June 24th; + haven't yet received legal papers. + + * .gdbinit: Included message telling the user what it is doing. + + * symmetry-dep.c: Added static decls for i386_get_frame_setup, + i386_follow_jump. + * values.c (unpack_double): Added a return (double)0 at the end to + silence a compiler warning. + + * printcmd.c (containing_function_bounds, asdump_command): Created + to dump the assembly code of a function (support for xgdb and a + useful hack). + (_initialize_printcmd): Added this to command list. + * gdb.texinfo [Memory]: Added documentation for the asdump + command. + * breakpoint.c (break_command_1, delete_breakpoint, + enable_breakpoint, disable_breakpoint): Added extra verbosity for + xgdb conditionalized on the new external frame_full_file_name. + * source.c (identify_source_line): Increase verbosity of fullname + prointout to include pc value. + * stack.c: Added a new variable; "frame_changed" to indicate when + a frame has been changed so that gdb can print out a frame change + message when the frame only changes implicitly. + (print_frame_info): Check the new variable in determining when to + print out a new message and set it to zero when done. + (up_command): Increment it. + (down_command): Decrement it. + + * m68k-pinsn.c (print_insn_arg [lL]): Modified cases for register + lists to reset the point to point to after the word from which the + list is grabbed *if* that would cause point to point farther than + it currently is. + +Thu Jul 6 14:28:11 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * valprint.c (val_print, value_print): Add parameter to control + prettyprinting. + valprint.h: New file containing constants used for passing + prettyprinting parameter to val{,ue}_print. + expprint.c, infcmd.c, printcmd.c, valprint.c, values.c: + Change all calls to val{,ue}_print to use new parameter. + +Mon Jul 3 22:38:11 1989 Randy Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (,process_one_symbol): Moved extern declaration for + index out of function to beginning of file. + +Mon Jul 3 18:40:14 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) + + * gdb.texinfo (Registers): Add "ps" to list of standard registers. + +Sun Jul 2 23:13:03 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * printcmd.c (enable_display): Change d->next to d = d->next so + that "enable display" without args works. + +Fri Jun 30 23:42:04 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * source.c (list_command): Made error message given when no + symtab is loaded clearer. + + * valops.c (value_assign): Make it so that when assigning to an + internal variable, the type of the assignment exp is the type of + the value being assigned. + +Fri Jun 30 12:12:43 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * main.c (verbose_info): Created. + (initialize_main): Put "info verbose" into command list. + + * utils.c (screensize_info): Created. + (_initialize_utils): Defined "info screensize" as a normal command. + + * valprint.c (format_info): Added information about maximum number + of array elements to function. + + * blockframe.c (find_pc_partial_function): Again. + + * blockframe.c (find_pc_partial_function): Replaced a "shouldn't + happen" (which does) with a zero return. + + * main.c (dont_repeat): Moved ahead of first use. + +Thu Jun 29 19:15:08 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * vax-opcode.h: Made minor modifications (moved an instruction and + removed a typo) to bring this into accord with gas' table; also + changed copyright to reflect it being part of both gdb and gas. + + * m68k-opcode.h: Added whole scads and bunches of new stuff for + the m68851 and changed the coptyrightto recognize that the file + was shared between gdb and gas. + + * main.c (stop_sig): Use "dont_repeat ()" instead of *line = 0; + + * core.c (read_memory): Don't do anything if length is 0. + + * Makefile: Added readline.c to the list of files screwed by + having the ansi ioctl.h compilation with gcc. + + * config.gdb: Added sun4os3 & sun4-os3 as availible options. + +Wed Jun 28 02:01:26 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu) + + * command.c (lookup_cmd): Add ignore_help_classes argument. + (lookup_cmd_1): Add ignore_help_classes argument. + command.c, main.c: Change callers of lookup_cmd{,_1} to supply + value for ignore_help_classes. + +Tue Jun 27 18:01:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * utils.c (print_spaces_filtered): Made more efficient. + * defs.h: Declaration. + * valprint.c (val_print): Used in a couple of new places. + +Mon Jun 26 18:27:28 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * m68k-pinsn.c (print_insn_arg ['#', '^']): Combined them into one + case which always gets the argument from the word immediately + following the instruction. + (print_insn_arg ["[lL]w"]): Make sure to always get the register + mask from the word immediately following the instruction. + +Sun Jun 25 19:14:56 1989 Randall Smith (randy at galapas.ai.mit.edu) + + * Makefile: Added hp-include back in as something to distribute. + + * stack.c (print_block_frame_locals): Return value changed from + void to int; return 1 if values printed. Use _filtered. + (print_frame_local_vars): Use return value from + print_block_frame_locals to mention if nothing printed; mention + lack of symbol table, use _filtered. + (print_frame_arg_vars): Tell the user if no symbol table + or no values printed. Use fprintf_filtered instead of fprintf. + * blockframe.c (get_prev_frame_info): Check for no inferior or + core file before crashing. + + * inflow.c (inferior_died): Set current frame to zero to keep from + looking like we're in start. + +Sat Jun 24 15:50:53 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * stack.c (frame_command): Added a check to make sure that there + was an inferior or a core file. + + * expread.y (yylex): Allow floating point numbers of the form ".5" + to be parsed. + + Changes by David Taylor at TMC: + * ns32k-pinsn.c: Added define for ?floating point coprocessor? and + tables for register names to be used for each of the possibilities. + (list_search): Created; searches a list of options for a specific + value. + (print_insn_arg): Added 'Q', 'b', 'M', 'P', 'g', and 'G' options + to the value location switch. + * ns32k-opcode.h: Added several new location flags. + [addr, enter, exit, ext[bwd], exts[bwd], lmr, lpr[bwd], restore, + rett, spr[bwd], smr]: Improved insn format output. + + * symtab.c (list_symbols): Rearrange printing to produce readable + output for "info types". + + * eval.c (evaluate_subexp_for_address): Fixed typo. + + * dbxread.c (read_type): Don't output an error message when + there isn't a ',' after a cross-reference. + + * dbxread.c (read_dbx_symtab): #if'd out N_FN case in + read_dbx_symtab if it has the EXT bit set (otherwise multiple + cases with the same value). + +Fri Jun 23 13:12:08 1989 Randall Smith (randy at plantaris.ai.mit.edu) + + * symmisc.c: Changed decl of print_spaces from static to extern + (since it's defined in utils.c). + + * remote.c (remote_open): Close remote_desc if it's already been + opened. + + * Remote_Makefile, remote_gutils.c, remote_inflow.c, + remote_server.c, remote_utils.c: Combined into remote-multi.shar. + * remote-multi.shar: Created (Vikram Koka's remote stub). + * remote-sa.m68k.shar: Created (Glenn Engel's remcom.c). + * README: Updated to reflect new organization of remote stubs. + + * dbxread.c (read_dbx_symtab): Put an N_FN in with N_FN | N_EXT to + account for those machines which don't use the external bit here. + Sigh. + + * m-symmetry.h: Defined NO_SIGINTERRUPT. + +Thu Jun 22 12:51:37 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * printcmd.c (decode_format): Make sure characters are printed + using a byte size. + + * utils.c (error): Added a terminal_ours here. + + * stack.c (locals_info): Added check for selected frame. + + * dbxread.c (read_type): Checked to make sure that a "," was + actually found in the symbol to end a cross reference. + +Wed Jun 21 10:30:01 1989 Randy Smith (randy at tartarus.uchicago.edu) + + * expread.y (parse_number, [exp]): Allowed for the return of a + number marked as unsigned; this will allow inclusion of unsigned + constants. + + * symtab.h: Put in default definitions for BUILTIN_TYPE_LONGEST + and BUILTIN_TYPE_UNSIGNED_LONGEST. + + * expread.y (parse_number): Will now accept integers suffixed with + a 'u' (though does nothing special with it). + + * valarith.c (value_binop): Added cases to deal with unsigned + arithmetic correctly. + +Tue Jun 20 14:25:54 1989 Randy Smith (randy at tartarus.uchicago.edu) + + * dbxread.c (psymtab_to_symtab_1): Changed reading in info message + to go through printf_filtered. + + * symtab.c (list_symbols): Placed header message after all calls + to psymtab_to_symtab. + + * symtab.c (smash_to_{function, reference, pointer}_type): Carried + attribute of permanence for the type being smashed over the bzero + and allowed any type to point at this one if it is permanent. + + * symtab.c (smash_to_{function, reference, pointer}_type): Fix + typo: check flags of to_type instead of type. + + * m-hp9k320.h: Changed check on __GNU__ predefine to __GNUC__. + + * Makefile: Made MUNCH_DEFINE seperate and based on SYSV_DEFINE; + they aren't the same on hp's. + +Mon Jun 19 17:10:16 1989 Randy Smith (randy at tartarus.uchicago.edu) + + * Makefile: Fixed typo. + + * valops.c (call_function): Error if the inferior has not been + started. + + * ns32k-opcode.h [check[wc], cmpm[bwd], movm[bwd], skpsb]: Fixed + typos. + +Fri Jun 9 16:23:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-news.h [NO_SIGINTERRUPT]: Defined. + + * dbxread.c (read_type): Start copy of undefined structure name + past [sue] defining type of cross ref. + + * dbxread.c (process_one_symbol): Changed strchr to index. + + * ns32k-opcode.h, ns32k-pinsn.c: More changes to number of + operands, addition of all of the set condition opcodes, addition + of several flag letters, all patterned after the gas code. + + * ns32k-opcode.h [mov{su,us}[bwd], or[bwd]]: Changed number of + operands from 1 to 2. + +Wed Jun 7 15:04:24 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * symseg.h [TYPE_FLAG_STUB]: Created. + * dbxread.c (read_type): Set flag bit if type is stub. + (cleanup_undefined_types): Don't mark it as a stub if it's been + defined since we first learned about it. + * valprint.c (val_print): Print out a message to that effect if + this type is encountered. + + * symseg.h, symtab.h: Moved the definition of TYPE_FLAG_PERM over + to symseg.h so that all such definitions would be in the same place. + + * valprint.c (val_print): Print out <No data fields> for a + structure if there aren't any. + + * dbxread.c (read_type): Set type name of a cross reference type + to "struct whatever" or something. + +Tue Jun 6 19:40:52 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * breakpoint.c (breakpoint_1): Print out symbolic location of + breakpoints for which there are no debugging symbols. + +Mon Jun 5 15:14:51 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * command.c (help_cmd_list): Made line_size static. + +Sat Jun 3 17:33:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * Makefile: Don't include the binutils hp-include directory in the + distribution anymore; refer the users to the binutils distribution. + +Thu Jun 1 16:33:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * printcmd.c (disable_display_command): Fixed loop iteration for + no arg case. + + * printcmd.c (disable_display_command): Added from_tty parameter + to function. + + * valops.c (value_of_variable): Call read_var_value with 0 cast to + FRAME instead of CORE_ADDR. + + * eval.c (evaluate_subexp): Corrected number of args passed to + value_subscript (to 2). + + * infrun.c (wait_for_inferior), symtab.c (decode_line_1), + m-convex.h: Changed name of FIRSTLINE_DEBUG_BROKEN to + PROLOGUE_FIRSTLINE_OVERLAP. + + * m-merlin.h: Fixed typo. + * ns32k-opcode.h: Added ns32381 opcodes and "cinv" insn, and fixed + errors in movm[wd], rett, and sfsr. + + * eval.c (evaluate_subexp, evaluate_subexp_for_address), valops.c + (value_zero): Change value_zero over to taking two arguments + instead of three. + + * eval.c (evaluate_subexp) + [OP_VAR_VALUE]: Get correct lval type for AVOID_SIDE_EFFECTS for + all types of symbols. + [BINOP_DIV]: Don't divide if avoiding side effects; just return + an object of the correct type. + [BINOP_REPEAT]: Don't call value_repeat, just allocate a + repeated value. + (evaluete_subexp_for_address) [OP_VAR_VALUE]: Just return a thing + of the right type (after checking to make sure that we are allowed + to take the address of whatever variable has been passed). + +Mon May 29 11:01:02 1989 Randall Smith (randy at galapas.ai.mit.edu) + + * breakpoint.c (until_break_command): Set the breakpoint with a + frame specification so that it won't trip in inferior calls to the + function. Also set things up so that it works based on selected + frame, not current one. + +Sun May 28 15:05:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * eval.c (evalue_subexp): Change subscript case to use value_zero + in EVAL_AVOID_SIDE_EFFECTS case. + +Fri May 26 12:03:56 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (read_addl_syms, psymtab_to_symtab): Removed + cleanup_undefined_types; this needs to be done on a symtab basis. + (end_symtab): Called cleanup_undefined_types from here. + (cleanup_undefined_types): No longer uses lookup_symbol (brain + dead idea; oh, well), now it searches through file_symbols. + +Wed May 24 15:52:43 1989 Randall Smith (randy at galapas) + + * source.c (select_source_symtab): Only run through + partial_symtab_list if it exists. + + * coffread.c (read_coff_symtab): Don't unrecord a misc function + when a function symbol is seen for it. + + * expread.y [variable]: Make sure to write a type for memvals if + you don't get a mft you recognize. + +Tue May 23 12:15:57 1989 Randall Smith (randy at plantaris.ai.mit.edu) + + * dbxread.c (read_ofile_symtab, psymtab_to_symtab): Moved cleanup + of undefined types to psymtab_to_symtab. That way it will be + called once for all readins (which will, among other things, + help reduce infinite loops). + + * symtab.h [misc_function_type]: Forced mf_unknown to 0. + * dbxread.c (record_misc_function): Cast enum to unsigned char (to + fit). + * expread.y [variable]: Cast unsigned char back to enum to test. + +Mon May 22 13:08:25 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + Patches by John Gilmore for dealing well with floating point: + * findvar.c (value_from_register, locate_var_value): Used + BYTES_BIG_ENDIAN instead of an inline test. + * m-sparc.h [IEEE_FLOAT]: Created to indicate that the sparc is + IEEE compatible. + * printcmd.c (print_scalar_formatted): Use BYTES_BIG_ENDIAN and + the stream argument for printing; also modify default type for + 'f'. Change handling of invalid floats; changed call syntax for + is_nan. + (print_command): Don't print out anything indicating that + something was recorded on the history list if it wasn't. + * valprint.c (val_print): Fixed to deal properley with new format + of is_nan and unpacking doubles without errors occuring. + (is_nan): Changed argument list and how it figures big endianness + (uses macros). + * values.c (record_latest_value): Return -1 and don't record if + it's an invalid float. + (value_as_double): Changed to use new unpack_double calling + convention. + (unpack_double): Changed not to call error if the float was + invalid; simply to set invp and return. Changed calling syntax. + (unpack_field_as_long, modify_field): Changed to use + BITS_BIG_ENDIAN to determine correct action. + + * m-hp9k320.h [HP_OS_BUG]: Created; deals with problem where a + trap happens after a continue. + * infrun.c (wait_for_inferior): Used. + + * m-convex.h [FIRSTLINE_DEBUG_BROKEN]: Defined a flag to indicate + that the debugging symbols output by the compiler for the first + line of a function were broken. + * infrun.c (wait_for_inferior), symtab.c (decode_line_1): Used. + + * gdb.texinfo [Data, Memory]: Minor cleanups of phrasing. + +Fri May 19 00:16:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (add_undefined_type, cleanup_undefined_types): Created + to keep a list of cross references to as yet undefined types. + (read_type): Call add_undefined_type when we run into such a case. + (read_addl_syms, read_ofile_symtab): Call cleanup_undefined_types + when we're done. + + * dbxread.c (psymtab_to_symtab, psymtab_to_symtab_1): Broke + psymtab_to_symtab out into two routines; made sure the string + table was only readin once and the globals were only scanned once, + for any number of dependencies. + +Thu May 18 19:59:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-*.h: Defined (or not, as appropriate per machine) + BITS_BIG_ENDIAN, BYTES_BIG_ENDIAN, and WORDS_BIG_ENDIAN. + +Wed May 17 13:37:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * main.c (symbol_completion_function): Always complete on result + command list, even if exact match found. If it's really an exact + match, it'll find it again; if there's something longer than it, + it'll get the right result. + + * symtab.c (make_symbol_completion_function): Fixed typo; strcmp + ==> strncmp. + + * dbxread.c (read_dbx_symtab): Change 'G' case to mark symbols as + LOC_EXTERNAL. + + * expread.y [variables]: Changed default type of text symbols to + function returning int so that one can use, eg. strcmp. + + * infrun.c (wait_for_inferior): Include a special flag indicating + that one shouldn't insert the breakpoints on the next step for + returning from a sigtramp and forcing at least one move forward. + + * infrun.c (wait_for_inferior): Change test for nexting into a + function to check for current stack pointer inner than previous + stack pointer. + + * infrun.c (wait_for_inferior): Check for step resume break + address before dealing with normal breakpoints. + + * infrun.c (wait_for_inferior): Added a case to deal with taking + and passing along a signal when single stepping past breakpoints + before inserting breakpoints. + + * infrun.c (wait_for_inferior): Inserted special case to keep + going after taking a signal we are supposed to be taking. + +Tue May 16 12:49:55 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * inflow.c (terminal_ours_1): Cast result of signal to (int + (*)()). + + * gdb.texinfo: Made sure that references to the program were in + upper case. Modify description of the "set prompt" command. + [Running]: Cleaned up introduction. + [Attach]: Cleaned up. + [Stepping]: Change "Proceed" to "Continue running" or "Execute". + Minor cleanup. + [Source Path]: Cleaned up intro. Cleared up distinction between + the executable search path and the source path. Restated effect + of the "directory" command with no arguments. + [Data]: Fixed typos and trivial details. + [Stepping]: Fixed up explanation of "until". + + * source.c (print_source_lines): Print through filter. + + * printcmd.c (x_command): If the format with which to print is + "i", use the address of anything that isn't a pointer instead of + the value. This is for, eg. "x/10i main". + + * gdb.texinfo: Updated last modification date on manual. + +Mon May 15 12:11:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * symtab.c (lookup_symtab): Fixed typo (name ==> copy) in call to + lookup_symtab_1. + + * gdb.texinfo: Added documentation for "break [+-]n" and for new + actions of "directory" command (taking multiple directory names at + the same time). + + * m68k-opcode.h: Replaced the version in gdb with an up-to-date + version from the assembler directory. + * m68k-pinsn.c (print_insn_arg): Added cases 'l' & 'L' to switch + to print register lists for movem instructions. + + * dbxread.c, m-convex.h: Moved convex dependent include files over + from dbxread.c to m-convex.h. + + * printcmd.c (disable_display, disable_display_command): Changed + name of first to second, and created first which takes an int as + arg rather than a char pointer. Changed second to use first. + (_initialize_printcmd): Changed to use second as command to call. + (delete_current_display, disable_current_display): Changed name of + first to second, and changed functionality to match. + * infrun.c (normal_stop), main.c (return_to_top_level): Changed to + call disable_current_display. + + * dbxread.c (process_one_symbol, read_dbx_symtab): Changed N_FN to + be N_FN | N_EXT to deal with new Berkeley define; this works with + either the old or the new. + + * Remote_Makefile, remote_gutils.c, remote_inflow.c, + remote_server.c, remote_utils.c: Created. + * Makefile: Included in tag and tar files. + * README: Included a note about them. + + * printcmd.c (print_address): Use find_pc_partial_function to + remove need to readin symtabs for symbolic addresses. + + * source.c (directory_command): Replaced function with new one + that can accept lists of directories seperated by spaces or :'s. + + * inflow.c (new_tty): Replaced calls to dup2 with calls to dup. + +Sun May 14 12:33:16 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * stack.c (args_info): Make sure that you have an inferior or core + file before taking action. + + * ns32k-opcode.h [deiw, deid]: Fixed machine code values for these + opcodes. + + * dbxread.c (scan_file_globals): Modified to use misc function + vector instead of file itself. Killed all arguments to the + funciton; no longer needed. + (psymtab_to_symtab): Changed call for above to reflect new (void) + argument list. + + * dbxread.c (read_dbx_symtab, ): Moved HASH_OFFSET define out of + read_dbx_symtab. + + * expread.y [variable]: Changed default type of misc function in + text space to be (void ()). + + * Makefile: Modified for proper number of s/r conflicts (order is + confusing; the mod that necessitated this change was on May 12th, + not today). + + * expread.y (yylex): Added SIGNED, LONG, SHORT, and INT keywords. + [typename]: Created. + [typebase]: Added rules for LONG, LONG INT, SHORT, SHORT INT, + SIGNED name, and UNSIGNED name (a good approximation of ansi + standard). + + * Makefile: Included .c.o rule to avoid sun's make from throwing + any curves at us. + + * blockframe.c: Included <obstack.h> + + * command.c (lookup_cmd): Clear out trailing whitespace. + + * command.c (lookup_cmd_1): Changed malloc to alloca. + +Fri May 12 12:13:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * printcmd.c (print_frame_args): Only print nameless args when you + know how many args there are supposed to be and when you've + printed fewer than them. Don't print nameless args between + printed args. + + * symtab.c (make_symbol_completion_function): Fixed typo (= ==> + ==). + + * remote.c (remote_open): ifdef'd out siginterrupt call by #ifndef + NO_SIGINTERRUPT. + * m-umax.h: Defined NO_SIGINTERRUPT. + + * expread.y [ptype, array_mod, func_mod, direct_abs_decl, + abs_decl]: Added rules for parsing and creating arbitrarily + strange types for casts and sizeofs. + + * symtab.c, symtab.h (create_array_type): Created. Some minor + misfeatures; see comments for details (main one being that you + might end up creating two arrays when you only needed one). + +Thu May 11 13:11:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * valops.c (value_zero): Add an argument for type of lval. + * eval.c (evaluate_subexp_for_address): Take address properly in + the avoid side affects case (ie. keep track of whether we have an + lval in memory and we can take the address). + (evaluate_subexp): Set the lval type of expressions created with + value_zero properley. + + * valops.c, value.h (value_zero): Created--will return a value of + any type with contents filled with zero. + * symtab.c, symtab.h (lookup_struct_elt_type): Created. + * eval.c (evaluate_subexp): Modified to not read memory when + called with EVAL_AVOID_SIDE_EFFECTS. + + * Makefile: Moved dbxread.c ahead of coffread.c in the list of + source files. + +Wed May 10 11:29:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * munch: Make sure that sysv version substitutes for the whole + line. + + * symtab.h: Created an enum misc_function_type to hold the type of + the misc function being recorded. + * dbxread.c (record_misc_function): Branched on dbx symbols to + decide which type to assign to a misc function. + * coffread.c (record_misc_function): Always assign type unknown. + * expread.y [variable]: Now tests based on new values. + +Tue May 9 13:03:54 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * symtab.c: Changed inclusion of <strings.h> (doesn't work on + SYSV) to declaration of index. + + * Makefile: Changed last couple of READLINE_FLAGS SYSV_DEFINE + + * source.c ({forward, reverse}_search_command): Made a default + search file similar to for the list command. + +Mon May 8 18:07:51 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * printcmd.c (print_frame_args): If we don't know how many + arguments there are to this function, don't print the nameless + arguments. We don't know enough to find them. + + * printcmd.c (print_frame_args): Call print_frame_nameless_args + with proper arguments (start & end as offsets from addr). + + * dbxread.c (read_addl_syms): Removed cases to deal with global + symbols; this should all be done in scan_global_symbols. + +Sun May 7 11:36:23 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * Makefile: Added copying.awk to ${OTHERS}. + +Fri May 5 16:49:01 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * valprint.c (type_print_varspec_prefix): Don't pass + passed_a_pointer onto children. + + * valprint.c (type_print_varspec_suffix): Print "array of" with + whatever the "of" is after tha array brackets. + + * valprint.c (type_print_varspec_{prefix,suffix}): Arrange to + parenthesisze pointers to arrays as well as pointers to other + objects. + + * valprint.c (type_print_varspec_suffix): Make sure to print + subscripts of multi-dimensional arrays in the right order. + + * infcmd.c (run_command): Fixed improper usages of variables + within remote debugging branch. + + * Makefile: Added Convex.notes to the list of extra files to carry + around. + + * dbxread.c (symbol_file_command): Made use of alloca or malloc + dependent on macro define. + +Thu May 4 15:47:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * Makefile: Changed READLINE_FLAGS to SYSV_DEFINE and called munch + with it also. + * munch: Check first argument for -DSYSV and be looser about + picking up init routines if you find it. + + * coffread.c: Made fclose be of type int. + + * breakpoint.c (_initialize_breakpoint): Put "unset" into class + alias. + +Wed May 3 14:09:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-sparc.h [STACK_END_ADDR]: Parameterized off of + machine/vmparam.h (as per John Gilmore's suggestion). + + * blockframe.c (get_prev_frame_info): Changed this function back + to checking frameless invocation first before checking frame + chain. This means that a backtrace up from start will produce the + wrong value, but that a backtrace from a frameless function called + in main will show up correctly. + + * breakpoint.c (_initialize_breakpoint): Added entry in help for + delete that indicates that unset is an alias for it. + + * main.c (symbol_completion_function): Modified recognition of + being within a single command. + +Tue May 2 15:13:45 1989 Randy Smith (randy at gnu) + + * expread.y [variable]: Add some parens to get checking of the + misc function vector right. + +Mon May 1 13:07:03 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * default-dep.c (core_file_command): Made reg_offset unsigned. + + * default-dep.c (core_file_command): Improved error messages for + reading in registers. + + * expread.y: Allowed a BLOCKNAME to be ok for a variable name (as + per C syntax). + + * dbxread.c (psymtab_to_symtab): Flushed stdout after printing + starting message about reading in symbols. + + * printcmd.c (print_frame_args): Switched starting place for + printing of frameless args to be sizeof int above last real arg + printed. + + * printcmd.c (print_frame_args): Modified final call to + print_nameless_args to not use frame slots used array if none had + been used. + + * infrun.c (wait_for_inferior): Take FUNCTION_START_OFFSET into + account when dealing with comparison of pc values to function + addresses. + + * Makefile: Added note about compiling gdb on a Vax running 4.3. + +Sun Apr 30 12:59:46 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * command.c (lookup_cmd): Got correct error message on bad + command. + + * m-sun3.h [ABOUT_TO_RETURN]: Modified to allow any of the return + instructions, including trapv and return from interupt. + + * command.c (lookup_cmd): If a command is found, use it's values + for error reporting and determination of needed subcommands. + + * command.c (lookup_cmd): Use null string for error if cmdtype is + null; pass *line to error instead of **. + + * command.c (lookup_cmd_1): End of command marked by anything but + alpha numeric or '-'. Included ctype.h. + +Fri Apr 28 18:30:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * source.c (select_source_symtab): Kept line number from ever + being less than 1 in main decode. + +Wed Apr 26 13:03:20 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * default-dep.c (core_file_command): Fixed typo. + + * utils.c (fprintf_filtered): Don't use return value from + numchars. + + * main.c, command.c (complete_on_cmdlist): Moved function to + command.c. + + * command.c (lookup_cmd): Modified to use my new routine. Old + version is still there, ifdef'd out. + + * command.c, command.h (lookup_cmd_1): Added a routine to do all + of the work of lookup_cmd with no error reporting and full return + of information garnered in search. + +Tue Apr 25 12:37:54 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * breakpoint.c (_initialize_breakpoint): Change "delete + breakpionts" to be in class alias and not have the abbrev flag + set. + + * main.c (symbol_completion_function): Fix to correctly complete + things that correspond to multiword aliases. + + * main.c (complete_on_cmdlist): Don't complete on something if it + isn't a command or prefix (ie. if it's just a help topic). + + * main.c (symbol_completion_function): Set list index to be 0 if + creating a list with just one element. + + * main.c (complete_on_cmdlist): Don't allow things with + abbrev_flag set to be completion values. + (symbol_completion_function): Don't accept an exact match if the + abbrev flag is set. + + * dbxread.c (read_type): Fixed typo in comparision to check if + type number existed. + + * dbxread.c (read_type): Made sure to only call dbx_lookup_type on + typenums if typenums were not -1. + +Mon Apr 24 17:52:12 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * symtab.c: Added strings.h as an include file. + +Fri Apr 21 15:28:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * symtab.c (lookup_partial_symtab): Changed to only return a match + if the name match is exact (which is what I want in all cases in + which this is currently used. + +Thu Apr 20 11:12:34 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * m-isi.h [REGISTER_U_ADDR]: Installed new version from net. + * default-dep.c: Deleted inclusion of fcntl.h; apparently not + necessary. + * Makefile: Added comment about compiling on isi under 4.3. + + * breakpoint.c (break_command_1): Only give decode_line_1 the + default_breakpoint_defaults if there's nothing better (ie. make + the default be off of the current_source notes if at all + possible). + + * blockframe.c (get_prev_frame_info): Clean up comments and + delete code ifdefed out around FRAMELESS_FUNCTION_INVOCATION test. + + * remote.c: Added a "?" message to protocol. + (remote_open): Used at startup. + (putpkt): Read whatever garbage comes over the line until we see a + '+' (ie. don't treat garbage as a timeout). + + * valops.c (call_function): Eliminated no longer appropriate + comment. + + * infrun.c (wait_for_inferior): Changed several convex conditional + compilations to be conditional on CANNOT_EXECUTE_STACK. + +Wed Apr 19 10:18:17 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * printcmd.c (print_frame_args): Added code to attempt to deal + with arguments that are bigger than an int. + + Continuation of Convex/Fortran changes: + * printcmd.c (print_scalar_formatted): Added leading zeros to + printing of large integers. + (address_info, print_frame_args): Added code to deal with + LOC_REF_ARG. + (print_nameless_args): Allow param file to specify a routine with + which to print typeless integers. + (printf_command): Deal with long long values well. + * stack.c (print_frame_arg_vars): Change to deal with LOC_REF_ARG. + * symmisc.c (print_symbol): Change to deal with LOC_REF_ARG. + * symseg.h: Added LOC_REF_ARG to enum address_class. + * symtab.c (lookup_block_symbol): Changed to deal with + LOC_REF_ARG. + * valarith.c (value_subscripted_rvalue): Created. + (value_subscript): Used above when app. + (value_less, value_equal): Change to cast to (char *) before doing + comparison, for machines where that casting does something. + * valops.c (call_function): Setup to deal with machines where you + cannot execute code on the stack segment. + * valprint.c (val_print): Make sure that array element size isn't + zero before printing. Set address of default array to address of + first element. Put in a couple of int cast. Removed some convex + specific code. Added check for endianness of machine in case of a + packed structure. Added code for printing typeless integers and + for LONG LONG's. + (set_maximum_command): Change to use parse_and_eval_address to get + argument (so can use expressions there). + * values.c (value_of_internalvar, set_internalvar_component, + set_internalvar, convenience_info): Add in hooks for trapped + internal vars. + (unpack_long): Deal with LONG_LONG. + (value_field): Remove LONGEST cast. + (using_struct_return): Fixed typo ENUM ==> UNION. + * xgdb.c (_initialize_xgdb): Make sure that specify_exec_file_hook + is not called unless we are setting up a windowing environ. + +Tue Apr 18 13:43:37 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + Various changes involved in 1) getting gdb to work on the convex, + and 2) Getting gdb to work with fortran (due to convex!csmith): + * convex-dep.c, convex-opcode.h, m-convex.h, convex-pinsn.c: + Created (or replaced with new files). + * Makefile: Add convex dependent files. Changed default flags to + gnu malloc to be CFLAGS. + * config.gdb: Added convex to list of machines. + * core.c (files_info): Added a FILES_INFO_HOOK to be used if + defined. + (xfer_core_file): Conditionalized compilation of xfer_core_file on + the macro XFER_CORE_FILE. + * coffread.c (record_misc_function): Made sure it zerod type field + (which is now being used; see next). + * dbxread.c: Included some convex dependent include files. + (copy_pending, fix_common_blocks): Created. + [STAB_REG_REGNUM, BELIEVE_PCC_PROMOTION]: Created default values; + may be overridden in m-*.h. + Included data structures for keeping track of common blocks. + (dbx_alloc_type): Modified; if called with negative 1's will + create a type without putting it into the type vector. + (read_dbx_symtab, read_addl_syms): Modified calls to + record_misc_function to include the new information. + (symbol_file_command, psymtab_to_symtab, add_file_command): + Modified reading in of string table to adapt to machines which + *don't* store the size of the string table in the first four bytes + of the string table. + (read_dbx_symtab, scan_file_globals, read_ofile_symtab, + read_addl_syms): Modified assignment of namestring to accept null + index into symtab as ok. + (read_addl_syms): Modified readin of a new object file to fiddle + with common blocks correctly. + (process_one_symbol): Fixed incorrect comment about convex. Get + symbols local to a lexical context from correct spot on a per + machine basis. Catch a bug in pcc which occaisionally puts an SO + where there should be an SOL. Seperate sections for N_BCOMM & + N_ECOMM. + (define_symbol): Ignore symbols with no ":". Use + STAB_REG_TO_REGNUM. Added support for function args calling by + reference. + (read_type): Only read type number if one is there. Remove old + (#if 0'd out) array code. + (read_array_type): Added code for dealing with adjustable (by + parameter) arrays half-heartedly. + (read_enum_type): Allow a ',' to end a list of values. + (read_range_type): Added code to check for long long. + * expread.y: Modified to use LONGEST instead of long where + necessary. Modified to use a default type of int for objects that + weren't in text space. + * findvar.c (locate_var_value, read_var_value): Modified to deal + with args passed by reference. + * inflow.c (create_inferior): Used CREATE_INFERIOR_HOOK if it + exists. + * infrun.c (attach_program): Run terminal inferior when attaching. + (wait_for_inferior): Removed several convex dependencies. + * main.c (float_handler): Created. + Made whatever signal indicates a stop configurable (via macro + STOP_SIGNAL). + (main): Setup use of above as a signal handler. Added check for + "-nw" in args already processed. + (command_line_input): SIGTSTP ==>STOP_SIGNAL. + + * expread.y: Added token BLOCKNAME to remove reduce/reduce + conflict. + * Makefile: Change message to reflect new grammar. + +Mon Apr 17 13:24:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * printcmd.c (compare_ints): Created. + (print_frame_args): Modified to always print arguments in the + order in which they were found in the symbol table. Figure out + what apots are missing on the fly. + + * stack.c (up_command): Error if no inferior or core file. + + * m-i386.h, m-symmetry.h [FRAMELESS_FUNCTION_INVOCATION]: Created; + same as m68k. + + * dbxread.c (define_symbol): Changed "desc==0" test to + "processing_gcc_compilation", which is the correct way to do it. + +Sat Apr 15 17:18:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * expread.y: Added precedence rules for arglists, ?:, and sizeof + to eliminate some shift-reduce conflicts. + * Makefile: Modified "Expect" message to conform to new results. + +Thu Apr 13 12:29:26 1989 Randall Smith (randy at plantaris.ai.mit.edu) + + * inflow.c (terminal_init_inferior): Fixed typo in recent diff + installation; TIOGETC ==> TIOCGETC. + + * m-vax.h, m-sun2.h, m-sun3.h, m-sparc.h, m-hp*.h, m-isi.h, + m-news.h [FRAMELESS_FUNCTION_INVOCATION]: Created macro with + appropriate definition. + +Wed Apr 12 15:30:29 1989 Randall Smith (randy at plantaris.ai.mit.edu) + + * blockframe.c (get_prev_frame_info): Added in a macro to specify + when a "frame" is called without a frame pointer being setup. + + * Makefile [clean]: Made sure to delete gnu malloc if it was being + used. + +Mon Apr 10 12:43:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (process_one_symbol): Reset within_function to 0 after + last RBRAC of a function. + + * dbxread.c (read_struct_type): Changed check for filling in of + TYPE_MAIN_VARIANT of type. + + * inflow.c (create_inferior): Conditionalized fork so that it + would be used if USG was defined and HAVE_VFORK was not defined. + + * defs.h: Added comment about enum command_class element + class_alias. + + * dbxread.c (process_one_symbol): Fixed a typo with interesting + implications for associative processing in the brain (':' ==> 'c'). + + * sparc-dep.c (isabranch): Changed name to isannulled, modified to + deal with coprocessor branches, and improved comment. + (single_step): Changed to trap at npc + 4 instead of pc +8 on + annulled branches. Changed name in call to isabranch as above. + + * m-sun4os4.h (STACK_END_ADDRESS): Changed it to 0xf8000000 under + os 4.0. + +Sat Apr 8 17:04:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (process_one_symbol): In the case N_FUN or N_FNAME the + value being refered to is sometimes just a text segment variable. + Catch this case. + + * infrun.c (wait_for_inferior), breakpoint.c + (breakpoint_stop_status): Move the selection of the frame to + inside breakpoint_stop_status so that the frame only gets selected + (and the symbols potentially read in) if the symbols are needed. + + * symtab.c (find_pc_psymbol): Fixed minor misthough (pc >= + fucntion start, not >). + + * breakpoint.c (_initialize_breakpoint): Change "delete" internal + help entry to simply refer to it being a prefix command (since the + list of subcommands is right there on a "help delete"). + +Fri Apr 7 15:22:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * blockframe.c (find_pc_partial_function): Created; figures out + what function pc is in (name and address) without reading in any + new symbols. + * symtab.h: Added decl for above. + * infrun.c (wait_for_inferior): Used instead of + find_pc_function_start. + * stack.c (print_frame_info): Used instead of hand coding for same + thing. + + * dbxread.c (psymtab_to_symtab): No longer patch readin pst's out + of the partial_symtab_list; need them there for some checks. + * blockframe.c (block_for_pc), source.c (select_source_symtab), + symtab.c (lookup_symbol, find_pc_symtab, list_symbols): Made extra + sure not to call psymtab_to_symtab with ->readin == 1, since these + psymtab now stay on the list. + * symtab.c (sources_info): Now distinguishes between psymtabs with + readin set and those with it not set. + + * symtab.c (lookup_symtab): Added check through partial symtabs + for name with .c appended. + + * source.c (select_source_symtab): Changed semantics a little so + that the argument means something. + * source.c (list_command), symtab.c (decode_line_1): Changed call + to select_source_symtab to match new conventions. + + * dbxread.c (add_file_command): This command no longer selects a + symbol table to list from. + + * infrun.c (wait_for_inferior): Only call find_pc_function (to + find out if we have debugging symbols for a function and hence if + we should step over or into it) if we are doing a "step". + +Thu Apr 6 12:42:28 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * main.c (command_line_input): Added a local buffer and only + copied information into the global main.c buffer when it is + appropriate for it to be saved (and repeated). + (dont_repeat): Only nail line when we are reading from stdin + (otherwise null lines won't repeat and what's in line needs to be + saved). + (read_command_lines): Fixed typo; you don't what to repeat when + reading command lines from the input stream unless it's standard + input. + + John Gilmore's (gnu@toad.com) mods for USG gdb: + * inflow.c: Removed inclusion of sys/user.h; no longer necessary. + (, terminal_init_inferior, terminal_inferior, terminal_ours_1, + term_status_command, _initialize_inflow) Seperated out declaration + and usage of terminal mode structures based on the existence of + the individual ioctls. + * utils.c (request_quit): Restore signal handler under USG. If + running under USG initialize sys_siglist at run time (too much + variation between systems). + +Wed Apr 5 13:47:24 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + John Gilmore's (gnu@toad.com) mods for USG gdb: + * default-dep.c: Moved include of sys/user.h to after include of + a.out.h. + (store_inferior_registers): Fixed error message. + (core_file_command): Improved error messages from reading in of + u area in core file. Changed calculation of offset of registers + to account for some machines putting it in as an offset rather + than an absolute address. Changed error messages for reading of + registers from core file. + + * coffread.c (read_file_hdr): Added final check for BADMAG macro + to use if couldn't recognize magic number. + * Makefile: Added explicit directions for alloca addition. + Included alloca.c in list of possible library files. Cleaned up + possible library usage. Included additional information on gcc + and include files. + + * source.c, remote.c, inflow.c, dbxread.c, core.c, coffread.c: + Changed include of sys/fcntl.h to an include of fcntl.h (as per + posix; presumably this will break fewer machines. I hopw). + * README: Added a pointer to comments at top of Makefile. + * Makefile: Added a comment about machines which need fcntl.h in + sys. + +Tue Apr 4 11:29:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * valprint.c (set_prettyprint_command, set_unionprint_command, + format_info): Created. + (_initialize_valprint): Added to lists of commands. + + * gdb.texinfo [Backtrace]: Added a section describing the format + if symbols have not yet been read in. + + * valprint.c (val_print): Added code to prettyprint structures if + "prettyprint" is set and only to print unions below the top level + if "unionprint" is set. + + * infcmd.c (registers_info), valprint.c (value_print, val_print): + Added argument to call to val_print indicating deptch of recursion. + + * symtab.[ch] (find_pc_psymbol): Created; finds static function + psymbol with value nearest to but under value passed. + * stack.c (print_frame_info): Used above to make sure I have best + fit to pc value. + + * symseg.h (struct partial_symbol): Added value field. + * dbxread.c (read_dbx_symtab): Set value field for partial symbols + saved (so that we can lookup static symbols). + + * symtab.[ch] (find_pc_symtab): Changed to external. + * stack.c (select_frame): Call above to make sure that symbols for + a selected frame is readin. + +Mon Apr 3 12:48:16 1989 Randall Smith (randy at plantaris.ai.mit.edu) + + * stack.c (print_frame_info): Modified to only print out full + stack frame info on symbols whose tables have been read in. + * symtab.c, symtab.h (find_pc_psymtab): Made function external; + above needed it. + + * main.c (,set_verbose_command, initialize_main): Created a + variable "info_verbose" which says to talk it up in various and + sundry places. Added command to set this variable. + * gdb.texinfo (GDB Output): Added documentation on "set verbose" + and changed the name of the "Screen Output" section to "GDB + Output". + * dbxread.c (psymtab_to_symtab): Added information message about + symbol readin. Conditionalized on above. + + * dbxread.c (define_symbol): Made an "i" constant be of class + LOC_CONST and an "r" constant be of class LOC_CONST_BYTES. + + * README: Made a note about modifications which may be necessary + to the manual for this version of gdb. + + * blockframe.c (get_prev_frame_info): Now we get saved address and + check for validity before we check for leafism. This means that + we will catch the fact that we are in start, but we will miss any + fns that start calls without an fp. This should be fine. + + * m-*.h (FRAME_CHAIN): Modified to return 0 if we are in start. + This is usually a test for within the first object file. + * m-sparc.h (FRAME_CHAIN): The test here is simply if the fp saved + off the the start sp is 0. + + * blockframe.c (get_prev_frame_info): Removed check to see if we + were in start. Screws up sparc. + + * m-sparc.h (FRAME_FIND_SAVED_REGISTERS): Changed test for dummy + frame to not need frame to be innermost. + + * gdb.texinfo: Added section on frameless invocations of functions + and when gdb can and can't deal with this. + + * stack.c (frame_info): Disallowed call if no inferior or core + file; fails gracefully if truely bad stack specfication has been + given (ie. parse_frame_specification returns 0). + +Fri Mar 31 13:59:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * infrun.c (normal_stop): Changed references to "unset-env" to + "delete env". + + * infcmd.c (_initialize_infcmd): Change reference to set-args in + help run to "set args". + + * remote.c (getpkt): Allow immediate quit when reading from + device; it could be hung. + + * coffread.c (process_coff_symbol): Modify handling of REG + parameter symbols. + +Thu Mar 30 15:27:23 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (symbol_file_command): Use malloc to allocate the + space for the string table in symbol_file_command (and setup a + cleanup for this). This allows a more graceful error failure if + there isn't any memory availible (and probably allows more memory + to be avail, depending on the machine). + + Additional mods for handling GNU C++ (from Tiemann): + * dbxread.c (read_type): Added case for '#' type (method type, I + believe). + (read_struct_type): If type code is undefined, make the main + variant for the type be itself. Allow recognition of bad format + in reading of structure fields. + * eval.c (evaluate_subexp): Modify evaluation of a member of a + structure and pointer to same to make sure that the syntax is + being used correctly and that the member is being accessed correctly. + * symseg.h: Added TYPE_CODE_METHOD to enum type_code. Add a + pointer to an array of argument types to the type structure. + * symtab.c (lookout_method_type, smash_to_method_type): Created. + * symtab.h (TYPE_ARG_TYPES): Created. + * valops.c (call_function): Modified handling of methods to be the + same as handling of functions; no longer check for members. + * valprint.c (val_print, type_print_varspec_{prefix,suffix}, + type_print_base): Added code to print method args correctly. + * values.c (value_virtual_fn_field): Modify access to virtual + function table. + +Wed Mar 29 13:19:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * findvar.c: Special cases for REGISTER_WINDOWS: 1) Return 0 if we + are the innermost frame, and 2) return the next frame in's value + if the SP is being looked for. + + * blockframe.c (get_next_frame): Created; returns the next (inner) + frame of the called frame. + * frame.h: Extern delcaration for above. + + * main.c (command_line_input): Stick null at end before doing + history expansion. + +Tue Mar 28 17:35:50 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (read_dbx_symtab): Added namestring assignment to + N_DATA/BSS/ABS case. Sigh. + +Sat Mar 25 17:49:07 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * expread.y: Defined YYDEBUG. + +Fri Mar 24 20:46:55 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * symtab.c (make_symbol_completion_list): Completely rewrote to + never call psymtab_to_symtab, to do a correct search (no + duplicates) through the visible symbols, and to include structure + and union fields in the things that it can match. + +Thu Mar 23 15:27:44 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (dbx_create_type): Created; allocates and inits space + for a type without putting it on the type vector lists. + (dbx_alloc_type): Uses above. + + * Makefile: xgdb.o now produced by default rules for .o.c. + +Fri Mar 17 14:27:50 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * infrun.c: Fixed up inclusion of aouthdr.h on UMAX_PTRACE. + + * Makefile, config.gdb: Added hp300bsd to potential + configurations. + * hp300bsd-dep.c, m-hp300bsd.h: Created. + + * infrun.c (wait_for_inferior): Rewrote to do no access to + inferior until we make sure it's still there. + + * inflow.c (inferior_died): Added a select to force the selected + frame to null when inferior dies. + + * dbxread.c (symbol_file_command): free and zero symfile when + discarding symbols. + + * core.c (xfer_core_file): Extended and cleaned up logic in + interpeting memory address. + + * core.c (xfer_core_file): Extended opening comment. + +Thu Mar 16 15:39:42 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * coffread.c (symbol_file_command): Free symfile name when freeing + contents. + + * blockframe.c (get_prev_frame_info): Added to fatal error message + to indicate that it should never happen. + + * stack.c (frame_info): Printed out value of "saved" sp seperately + to call attention to the fact that it isn't stored in memory + anywhere; the actual previous frames address is printed. + + * m-sparc.h (FRAME_FIND_SAVED_REGS): Set address of sp saved in + frame to value of fp (rather than value of sp in current frame). + + * expread.y: Allow "unsigned" as a type itself, as well as a type + modifier. + + * coffread.c: Added declaration for fclose + +Fri Mar 10 17:22:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * main.c (command_line_input): Checked for -1 return from + readline; indicates EOF. + +Fri Mar 3 00:31:27 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * remote.c (remote_open): Cast return from signal to (void (*)) to + avoid problems on machines where the return type of signal is (int + (*)). + + * Makefile: Removed deletion of version control from it (users + will need it for their changes). + +Thu Mar 2 15:32:21 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * symmetry-dep.c (print_1167_regs): Print out effective doubles on + even number regs. + (fetch_inferior_registers): Get the floating point regs also. + + * xgdb.c (do_command): Copied command before calling execute + command (so that execute_command wouldn't write into text space). + + * copying.awk: Created (will produce copying.c as output when + given COPYING as input). + * Makefile: Used above to create copying.c. + * main.c: Took out info_warranty and info_copying. + + * *.*: Changed copyright notice to use new GNU General Public + License (includes necessary changes to manual). + + * xgdb.c (create_text_widget): Created text_widget before I create + the source and sink. + (print_prompt): Added fflush (stdout). + + * Makefile: Added -lXmu to the compilation line for xgdb. Left + the old one there incase people still had R2. + + * README: Added note about -gg format. + + * remote.c (getpkt): Fixed typo; && ==> &. + + * Makefile: Added new variable READLINE_FLAGS so that I could + force compilation of readline.c and history.c with -DSYSV on + system V machines. Mentioned in Makefile comments at top. + +Wed Mar 1 17:01:01 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * hp9k320-dep.c (store_inferior_registers): Fixed typo. + +Fri Feb 24 14:58:45 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * hp9k320-dep.c (store_inferior_registers, + fetch_inferior_registers): Added support for remote debugging. + + * remote.c (remote_timer): Created. + (remote_open, readchar): Setup to timeout reads if they take + longer than "timeout". This allows one to debug how long such + things take. + (putpkt): Modified to print a debugging message (if such things + are enabled) each time it resends a packet. + (getpkt): Modified to make the variable CSUM unsigned and read it + CSUM with an & 0xff (presumably to deal with poor sign extension + on some machines). Also made c1 and c2 unsigned. + (remote_wait): Changed buffer to unsigned status. + (remote_store_registers, remote_write_bytes): Puts a null byte at + the end of the control string. + + * infcmd.c (attach_command, detach_command, _initialize_infcmd): + Made attach_command and detach_command always availible, but + modified them to only allow device file attaches if ATTACH_DETACH + is not defined. + + * gdb.texinfo: Added cross reference from attach command to remote + debugging. + +Thu Feb 23 12:37:59 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * remote.c (remote_close): Created to close the remote connection + and set the remote_debugging flag to 0. + * infcmd.c (detach_command): Now calls the above when appropriate. + + * gdb.texinfo: Removed references to the ``Distribution'' section + in the copyright. + + * main.c, utils.c (ISATTY): Created default defintions of this + macro which use isatty and fileno. + * utils.c (fprintf_filtered, print_spaces_filtered), main.c + (command_loop, command_line_input): Used this macro. + * m-news.h: Created a definition to override this one. + + * utils.c (fprintf_filtered): Made line_size static (clueless). + + * utils.c (fprintf_filtered): Changed max length of line printed + to be 255 chars or twice the format length. + + * symmetry-dep.c, m-symmetry: Fixed typo (^L ==> ). + + * printcmd.c (do_examine): Fixed typo (\n ==> \t). + +Wed Feb 22 16:00:33 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + Contributed by Jay Vosburgh (jay@mentor.cc.purdue.edu) + * m-symmetry.h, symmetry-dep.c: Created. + * Makefile: Added above in appropriate lists. + * config.gdb: Added "symmetry" target. + + * utils.c (prompt_for_continue): Zero'd chars_printed also. + + * utils.c (fprintf_filtered): Call prompt for continue instead of + doing it yourself. + + * dbxread.c (read_dbx_symtab): Added code to conditionalize what + symbol type holds to "x.o" or "-lx" symbol that indicates the + beginning of a new file. + +Tue Feb 21 16:22:13 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * gdb.texinfo: Deleted @ignore block at end of file. + + * findvar.c, stack.c: Changed comments that refered to "frame + address" to "frame id". + + * findvar.c (locate_var_value): Modified so that taking the + address of an array generates an object whose type is a pointer to + the elements of the array. + +Sat Feb 18 16:35:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * gdb.texinfo: Removed reference to "!" as a shell escape + character. Added a section on controling screen output + (pagination); changing "Input" section to "User Interface" + section. Changed many inappropriate subsubsection nodes into + subsections nodes (in the readline and history expansion + sections). + +Fri Feb 17 11:10:54 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * utils.c (set_screensize_command): Created. + (_initialize_utils): Added above to setlist. + + * main.c (main): Added check to see if ~/.gdbinit and .gdbinit + were the same file; only one gets read if so. Had to include + sys/stat.h for this. + + * valprint.c (type_print_base): Changed calls to print_spaces to + print_spaces_filtered. + + * main.c (command_line_input): Chaned test for command line + editing to check for stdin and isatty. + + * main.c (command_loop): Call reinitialize_more_filter before each + command (if reading from stdin and it's a tty). + utils.c (initialize_more_filter): Changed name to + reinitialize_more_filter; killed arguments. + utils.c (_initialize_utils): Created; initialized lines_per_page + and chars_per_line here. + + * utils.c (fprintf_filtered): Removed printing of "\\\n" after + printing linesize - 1 chars; assume that the screen display will + take care of that. Still watching that overflow. + + * main.c: Created the global variables linesize and pagesize to + describe the number of chars per line and lines per page. + +Thu Feb 16 17:27:43 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * printcmd.c (do_examine, print_scalar_formatted, print_address, + whatis_command, do_one_display, ptype_command), valprint.c + (value_print, val_print, type_print_method_args, type_print_1, + type_print_derivation_info, type_print_varspec_suffix, + type_print_base), breakpoint.c (breakpoints_info, breakpoint_1), + values.c (history_info), main.c (editing_info, warranty_info, + copying_info), infcmd.c (registers_info), inflow.c + (term_status_command), infrun.c (signals_info), stack.c + (backtrace_command, print_frame_info), symtab.c (list_symbols, + output_source_filename), command.c (help_cmd, help_list, + help_command_list): Replaced calls to printf, fprintf, and putc + with calls to [f]printf_filtered to handle more processing. + Killed local more emulations where I noticed them. + +Wed Feb 15 15:27:36 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * defs.h, utils.c (initialize_more_filter, fprintf_filtered, + printf_filtered): Created a printf that will also act as a more + filter, prompting the user for a <return> whenever the page length + is overflowed. + + * symtab.c (list_symbols): Elminated some code inside of an #if 0. + +Tue Feb 14 11:11:24 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * Makefile: Turned off backup versions for this file; it changes + too often. + + * command.c (lookup_cmd, _initialize_command): Changed '!' so that + it was no longer a shell escape. "sh" must be used. + + * main.c (command_line_input, set_history_expansion, + initialize_main): Turned history expansion on, made it the + default, and only execute it if the first character in the line is + a '!'. + + * version.c, gdb.texinfo: Moved version to 3.2 (as usual, jumping + the gun some time before release). + + * gdb.texinfo: Added sections (adapted from Brian's notes) on + command line editing and history expansion. + + * main.c (set_command_editing, initialize_main): Modified name to + set_editing and modified command to "set editing". + + * Makefile: Put in dependencies for READLINEOBJS. + + * main.c (history_info, command_info): Combined into new command + info; deleted history_info. + (initialize_main): Deleted "info history" command; it was + interfering with the value history. + + * coffread.c (enter_linenos): Modified to do bit copy instead of + pointer dereference, since the clipper machine can't handle having + longs on short boundaries. + (read_file_hdr): Added code to get number of syms for clipper. + + * stack.c (return_command): Fixed method for checking when all of + the necessary frames had been popped. + + * dbxread.c (read_dbx_symtab (ADD_PSYMBOL_TO_LIST)): Fixed typo in + allocation length. + +Mon Feb 13 10:03:27 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * dbxread.c (read_dbx_symtab): Split assignment to namestring into + several different assignments (so that it wouldn't be done except + when it had to be). Shortened switches and duplicated code to + produce the lowest possible execution time. Commented (at top of + switch) which code I duplicated. + + * dbxread.c (read_dbx_symtab): Modified which variables were + register and deleted several variables which weren't used. Also + eliminated 'F' choice from subswitch, broke out strcmp's, reversed + compare on line 1986, and elminated test for !namestring[0]; it is + caught by following test for null index of ':'. + +Sun Feb 12 12:57:56 1989 Randall Smith (randy at plantaris.ai.mit.edu) + + * main.c (gdb_completer_word_break_characters): Turned \~ into ~. + +Sat Feb 11 15:39:06 1989 Randall Smith (randy at plantaris.ai.mit.edu) + + * symtab.c (find_pc_psymtab): Created; checks all psymtab's till + it finds pc. + (find_pc_symtab): Used; fatal error if psymtab found is readin + (should have been caught in symtab loop). + (lookup_symbol): Added check before scan through partial symtab + list for symbol name to be on the misc function vector (only if in + VAR_NAMESPACE). Also made sure that psymtab's weren't fooled with + if they had already been read in. + (list_symbols): Checked through misc_function_vector for matching + names if we were looking for functions. + (make_symbol_completion_list): Checked through + misc_function_vector for matching names. + * dbxread.c (read_dbx_symtab): Don't bother to do processing on + global function types; this will be taken care of by the + misc_function hack. + + * symtab.h: Modified comment on misc_function structure. + +Fri Feb 10 18:09:33 1989 Randall Smith (randy at plantaris.ai.mit.edu) + + * symseg.h, dbxread.c (read_dbx_symtab, init_psymbol_list, + start_psymtab, end_psymtab), coffread.c (_initialize_coff), + symtab.c (lookup_partial_symbol, list_symbols, + make_symbol_completion_list): Changed separate variables for + description of partial symbol allocation into a specific kind of + structure. + + (read_dbx_symtab, process_symbol_for_psymtab): Moved most of + process_symbol_for_psymtab up into read_dbx_symtab, moved a couple + of symbol types down to the ingore section, streamlined (I hope) + code some, modularized access to psymbol lists. + +Thu Feb 9 13:21:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * main.c (command_line_input): Made sure that it could recognize + newlines as indications to repeat the last line. + + * symtab.c (_initialize_symtab): Changed size of builtin_type_void + to be 1 for compatibility with gcc. + + * main.c (initialize_main): Made history_expansion the default + when gdb is compiled with HISTORY_EXPANSION. + + * readline.c, readline.h, history.c, history.h, general.h, + emacs_keymap.c, vi_keymap.c, keymaps.c, funmap.c: Made all of + these links to /gp/gnu/bash/* to keep them updated. + * main.c (initialize_main): Made default be command editing on. + +Wed Feb 8 13:32:04 1989 & Smith (randy at hobbes) + + * dbxread.c (read_dbx_symtab): Ignore N_BSLINE on first + readthrough. + + * Makefile: Removed convex-dep.c from list of distribution files. + +Tue Feb 7 14:06:25 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * main.c: Added command lists sethistlist and unsethistlist to + accesible command lists. + (parse_binary_operation): Created to parse a on/1/yes vs. off/0/no + spec. + (set_command_edit, set_history, set_history_expansion, + set_history_write, set_history_size, set_history_filename, + command_info, history_info): Created to allow users to control + various aspects of command line editing. + + * main.c (symbol_creation_function): Created. + (command_line_input, initialize_main): Added rest of stuff + necessary for calling bfox' command editing routines under + run-time control. + * Makefile: Included readline and history source files for command + editing; also made arrangements to make sure that the termcap + library was available. + * symtab.c (make_symbol_completion_list): Created. + +Mon Feb 6 16:25:25 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * main.c: Invented variables to control command editing. + command_editing_p, history_expansion_p, history_size, + write_history_p, history_filename. Initialized them to default + values in initialize_main. + + * infcmd.c (registers_info), infrun.c (signals_info), + * main.c (gdb_read_line): Changed name to command_line_input. + (readline): Changed name to gdb_readline; added second argument + indicating that the read value shouldn't be saved (via malloc). + * infcmd.c (registers_info), infrun.c (signals_info), main.c + (copying_info), symtab.c (output_source_filename, MORE, + list_symbols): Converted to use gdb_readline in place of + gdb_read_line. + + +Sun Feb 5 17:34:38 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * blockframe.c (get_frame_saved_regs): Removed macro expansion + that had accidentally been left in the code. + +Sat Feb 4 17:54:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * main.c (gdb_read_line, readline): Added function readline and + converted gdb_read_line to use it. This was a conversion to the + line at a time style of input, in preparation for full command + editing. + +Fri Feb 3 12:39:03 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (read_dbx_symtab): Call end_psymtab at the end of + read_dbx_symtab if any psymtab still needs to be completed. + + * config.gdb, sun3-dep.c: Brought these into accord with the + actual sun2 status (no floating point period; sun3-dep.c unless + has os > 3.0). + * m-sun2os2.h: Deleted; not needed. + + * config.gdb: Added a couple of aliases for machines in the + script. + + * infrun.c: Added inclusion of aouthdr.h inside of #ifdef UMAX + because ptrace needs to know about the a.out header. + + * Makefile: Made dep.o depend on dep.c and config.status only. + + * expread.y: Added declarations of all of the new write_exp_elt + functions at the include section in the top. + + * Makefile: Added a YACC definition so that people can use bison + if they wish. + + * Makefile: Added rms' XGDB-README to the distribution. + + * Makefile: Added removal of init.o on a "make clean". + +Thu Feb 2 16:27:06 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * *-dep.c: Deleted definition of COFF_FORMAT if AOUTHDR was + defined since 1) We *may* (recent mail message) want to define + AOUTHDR under a basically BSD system, and 2) AOUTHDR is sometimes + a typedef in coff encapsulation setups. Also removed #define's of + AOUTHDR if AOUTHDR is already defined (inside of coff format). + * core.c, dbxread.c: Removed #define's of AOUTHDR if AOUTHDR is + already defined (inside of coff format). + +Tue Jan 31 12:56:01 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * GDB 3.1 released. + + * values.c (modify_field): Changed test for endianness to assign + to integer and reference character (so that all bits would be + defined). + +Mon Jan 30 11:41:21 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * news-dep.c: Deleted inclusion of fcntl.h; just duplicates stuff + found in sys/file.h. + + * i386-dep.c: Included default definition of N_SET_MAGIC for + COFF_FORMAT. + + * config.gdb: Added checks for several different operating + systems. + + * coffread.c (read_struct_type): Put in a flag variable so that + one could tell when you got to the end of a structure. + + * sun3-dep.c (core_file_command): Changed #ifdef based on SUNOS4 + to ifdef based on FPU. + + * infrun.c (restore_inferior_status): Changed error message to + "unable to restore previously selected frame". + + * dbxread.c (read_dbx_symtab): Used intermediate variable in error + message reporting a bad symbol type. (scan_file_globals, + read_ofile_symtab, read_addl_syms): Data type of "type" changed to + unsigned char (which is what it is). + * i386-dep.c: Removed define of COFF_FORMAT if AOUTHDR is defined. + Removed define of a_magic to magic (taken care of by N_MAGIC). + (core_file_command): Zero'd core_aouthdr instead of setting magic + to zero. + * i386-pinsn.c: Changed jcxz == jCcxz in jump table. + (putop): Added a case for 'C'. + (OP_J): Added code to handle possible masking of PC value on + certain kinds of data. + m-i386gas.h: Moved COFF_ENCAPSULATE to before inclusion of + m-i386.h and defined NAMES_HAVE_UNDERSCORE. + + * coffread.c (unrecrod_misc_function, read_coff_symtab): Added + symbol number on which error occured to error output. + +Fri Jan 27 11:55:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * Makefile: Removed init.c in make clean. Removed it without -f + and with leading - in make ?gdb. + +Thu Jan 26 15:08:03 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + Changes to get it to work on gould NP1. + * dbxread.c (read_dbx_symtab): Included cases for N_NBDATA and + N_NBBSS. + (psymtab_to_symtab): Changed declaration of hdr to + DECLARE_FILE_HEADERS. Changed access to use STRING_TABLE_SIZE and + SYMBOL_TABLE_SIZE. + * gld-pinsn.c (findframe): Added declaration of framechain() as + FRAME_ADDR. + + * coffread.c (read_coff_symtab): Avoided treating typedefs as + external symbol definitions. + +Wed Jan 25 14:45:43 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * Makefile: Removed reference to alloca.c. If they need it, they + can pull alloca.o from the gnu-emacs directory. + + * version.c, gdb.texinfo: Updated version to 3.1 (jumping the gun + a bit so that I won't forget when I release). + + * m-sun2.h, m-sun2os2.h, m-sun3os4.h, config.gdb: Modified code so + that default includes new sun core, ptrace, and attach-detach. + Added defaults for sun 2 os 2. + + Modifications to reset stack limit back to what it used to be just + before exec. All mods inside of #ifdef SET_STACK_LIMIT_HUGE. + * main.c: Added global variable original_stack_limit. + (main): Set original_stack_limit to original stack limit. + * inflow.c: Added inclusion of necessary files and external + reference to original_stack_limit. + (create_inferior): Reset stack limit to original_stack_limit. + + * dbxread.c (read_dbx_symtab): Killed PROFILE_SYMBOLS ifdef. + + * sparc-dep.c (isabranch): Multiplied offset by 4 before adding it + to addr to get target. + + * Makefile: Added definition of SHELL to Makefile. + + * m-sun2os4.h: Added code to define NEW_SUN_PTRACE, NEW_SUN_CORE, + and ATTACH_DETACH. + * sun3-dep.c: Added code to avoid fp regs if we are on a sun2. + +Tue Jan 24 17:59:14 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (read_array_type): Added function. + (read_type): Added call to above instead of inline code. + + * Makefile: Added ${GNU_MALLOC} to the list of dependencies for + the executables. + +Mon Jan 23 15:08:51 1989 Randall Smith (randy at plantaris.ai.mit.edu) + + * gdb.texinfo: Added paragraph to summary describing languages + with which gdb can be run. Also added descriptions of the + "info-methods" and "add-file" commands. + + * symseg.h: Commented a range type as having TYPE_TARGET_TYPE + pointing at the containing type for the range (often int). + * dbxread.c (read_range_type): Added code to do actual range types + if they are defined. Assumed that the length of a range type is + the length of the target type; this is a lie, but will do until + somebody gets back to me as to what these silly dbx symbols mean. + + * dbxread.c (read_range_type): Added code to be more picky about + recognizing builtins as range types, to treat types defined as + subranges of themselves to be subranges of int, and to recognize + the char type idiom from dbx as a special case. + +Sun Jan 22 01:00:13 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-vax.h: Removed definition of FUNCTION_HAS_FRAME_POINTER. + * blockframe.c (get_prev_frame_info): Removed default definition + and use of above. Instead conditionalized checking for leaf nodes + on FUNCTION_START_OFFSET (see comment in code). + +Sat Jan 21 16:59:19 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (read_range_type): Fixed assumption that integer was + always type 1. + + * gdb.texinfo: Fixed spelling mistake and added a note in the + running section making it clear that users may invoke subroutines + directly from gdb. + + * blockframe.c: Setup a default definition for the macro + FUNCTION_HAS_FRAME_POINTER. + (get_prev_frame_info): Used this macro instead of checking + SKIP_PROLOGUE directly. + * m-vax.h: Overroad definition; all functions on the vax have + frame pointers. + +Fri Jan 20 12:25:35 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * core.c: Added default definition of N_MAGIC for COFF_FORMAT. + + * xgdb.c: Installed a fix to keep the thing from dying when there + isn't any frame selected. + + * core.c: Made a change for the UMAX system; needs a different + file included if using that core format. + + * Makefile: Deleted duplicate obstack.h in dbxread.c dependency. + + * munch: Modified (much simpler) to cover (I hope) all cases. + + * utils.c (save_cleanups, restore_cleanups): Added functions to + allow you to push and pop the chain of cleanups to be done. + * defs.h: Declared the new functions. + * main.c (catch_errors): Made sure that the only cleanups which + would be done were the ones put on the chain *after* the current + location. + + * m-*.h (FRAME_CHAIN_VALID): Removed check on pc in the current + frame being valid. + * blockframe.c (get_prev_frame_info): Made the assumption that if + a frame's pc value was within the first object file (presumed to + be /lib/crt0.o), that we shouldn't go any higher. + + * infrun.c (wait_for_inferior): Do *not* execute check for stop pc + at step_resume_break if we are proceeding over a breakpoint (ie. + if trap_expected != 0). + + * Makefile: Added -g to LDFLAGS. + + * m-news.h (POP_FRAME) Fixed typo. + + * printcmd.c (print_frame_args): Modified to print out register + params in order by .stabs entry, not by register number. + + * sparc-opcode.h: Changed declaration of (struct + arith_imm_fmt).simm to be signed (as per architecture manual). + * sparc-pinsn.c (fprint_addr1, print_insn): Forced a cast to an + int, so that we really would get signed behaivior (default for sun + cc is unsigned). + + * i386-dep.c (i386_get_frame_setup): Replace function with new + function provided by pace to fix bug in recognizing prologue. + +Thu Jan 19 11:01:22 1989 Randall Smith (randy at plantaris.ai.mit.edu) + + * infcmd.c (run_command): Changed error message to "Program not + restarted." + + * value.h: Changed "frame" field in value structure to be a + FRAME_ADDR (actually CORE_ADDR) so that it could survive across + calls. + + * m-sun.h (FRAME_FIND_SAVED_REGS): Fixed a typo. + + * value.h: Added lval: "lval_reg_frame_relative" to indicate a + register that must be interpeted relative to a frame. Added + single entry to value structure: "frame", used to indicate which + frame a relative regnum is relative to. + * findvar.c (value_from_register): Modified to correctly setup + these fields when needed. Deleted section to fiddle with last + register copied on little endian machine; multi register + structures will always occupy an integral number of registers. + (find_saved_register): Made extern. + * values.c (allocate_value, allocate_repeat_value): Zero frame + field on creation. + * valops.c (value_assign): Added case for lval_reg_frame_relative; + copy value out, modify it, and copy it back. Desclared + find_saved_register as being external. + * value.h: Removed addition of kludgy structure; thoroughly + commented file. + * values.c (free_value, free_all_values, clear_value_history, + set_internalvar, clear_internavars): Killed free_value. + +Wed Jan 18 20:09:39 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * value.h: Deleted struct partial_storage; left over from + yesterday. + + * findvar.c (value_from_register): Added code to create a value of + type lval_reg_partsaved if a value is in seperate registers and + saved in different places. + +Tue Jan 17 13:50:18 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * value.h: Added lval_reg_partsaved to enum lval_type and + commented enum lval_type. Commented value structure. + Added "struct partial_register_saved" to value struct; added + macros to deal with structure to value.h. + * values.c (free_value): Created; special cases lval_reg_partsaved + (which has a pointer to an array which also needs to be free). + (free_all_values, clear_value_history, set_internalvar, + clear_internalvars): Modified to use free_values. + + * m-sunos4.h: Changed name to sun3os4.h. + * m-sun2os4.h, m-sun4os4.h: Created. + * config.gdb: Added configuration entries for each of the above. + * Makefile: Added into correct lists. + + * Makefile: Added dependencies on a.out.encap.h. Made + a.out.encap.h dependent on a.out.gnu.h and dbxread.c dependent on + stab.gnu.h. + + * infrun.c, remote.c: Removed inclusion of any a.out.h files in + these files; they aren't needed. + + * README: Added comment about bug reporting and comment about + xgdb. + + * Makefile: Added note to HPUX dependent section warning about + problems if compiled with gcc and mentioning the need to add + -Ihp-include to CFLAGS if you compile on those systems. Added a + note about needing the GNU nm with compilers *of gdb* that use the + coff encapsulate feature also. * hp-include: Made symbolic link + over to /gp/gnu/binutils. + + * Makefile: Added TSOBS NTSOBS OBSTACK and REGEX to list of things + to delete in "make clean". Also changed "squeakyclean" target as + "realclean". + + * findvar.c (value_from_register): Added assignment of VALUE_LVAL + to be lval_memory when that is appropriate (original code didn't + bother because it assumed that it was working with a pre lval + memoried value). + + * expread.y (yylex): Changed to only return type THIS if the + symbol "$this" is defined in some block superior or equal to the + current expression context block. + +Mon Jan 16 13:56:44 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-*.h (FRAME_CHAIN_VALID): On machines which check the relation + of FRAME_SAVED_PC (thisframe) to first_object_file_end (all except + gould), make sure that the pc of the current frame also passes (in + case someone stops in _start). + + * findvar.c (value_of_register): Changed error message in case of + no inferior or core file. + + * infcmd.c (registers_info): Added a check for inferior or core + file; error message if not. + + * main.c (gdb_read_line): Modified to take prompt as argument and + output it to stdout. + * infcmd.c (registers_info, signals_info), main.c (command_loop, + read_command_lines, copying_info), symtab.c (decode_line_2, + output_source_filename, MORE, list_symbols): Changed calling + convention used to call gdb_read_line. + + * infcmd.c, infrun.c, main.c, symtab.c: Changed the name of the + function "read_line" to "gdb_read_line". + * breakpoint.c: Deleted external referenced to function + "read_line" (not needed by code). + +Fri Jan 13 12:22:05 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * i386-dep.c: Include a.out.encap.h if COFF_ENCAPSULATE. + (N_SET_MAGIC): Defined if not defined by include file. + (core_file_command): Used N_SET_MAGIC instead of assignment to + a_magic. + (exec_file_command): Stuck in a HEADER_SEEK_FD. + + * config.gdb: Added i386-dep.c as depfile for i386gas choice. + + * munch: Added -I. to cc to pick up things included by the param + file. + + * stab.gnu.def: Changed name to stab.def (stab.gnu.h needs this name). + * Makefile: Changed name here also. + * dbxread.c: Changed name of gnu-stab.h to stab.gnu.h. + + * gnu-stab.h: Changed name to stab.gnu.h. + * stab.gnu.def: Added as link to binutils. + * Makefile: Put both in in the distribution. + +Thu Jan 12 11:33:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c: Made which stab.h is included dependent on + COFF_ENCAPSULATE; either <stab.h> or "gnu-stab.h". + * Makefile: Included gnu-stab.h in the list of files to include in + the distribution. + * gnu-stab.h: Made a link to /gp/gnu/binutils/stab.h + + * Makefile: Included a.out.gnu.h and m-i386gas.h in list of + distribution files. + * m-i386gas.h: Changed to include m-i386.h and fiddle with it + instead of being a whole new file. + * a.out.gnu.h: Made a link to /gp/gnu/binutils/a.out.gnu.h. + + Chris Hanson's changes to gdb for hp Unix. + * Makefile: Modified comments on hpux. + * hp9k320-dep.c: #define'd WOPR & moved inclusion of signal.h + * inflow.c: Moved around declaratiosn of <sys/fcntl.h> and + <sys/ioctl.h> inside of USG depends and deleted all SYSV ifdef's + (use USG instead). + * munch: Modified to accept any number of spaces between the T and + the symbol name. + + Pace's changes to gdb to work with COFF_ENCAPSULATE (robotussin): + * config.gdb: Added i386gas to targets. + * default-dep.c: Include a.out.encap.h if COFF_ENCAPSULATE. + (N_SET_MAGIC): Defined if not defined by include file. + (core_file_command): Used N_SET_MAGIC instead of assignment to a_magic. + (exec_file_command): Stuck in a HEADER_SEEK_FD. + * infrun.c, remote.c: Added an include of a.out.encap.h if + COFF_ENCAPSULATE defined. This is commented out in these two + files, I presume because the definitions aren't used. + * m-i386gas.h: Created. + * dbxread.c: Included defintions for USG. + (READ_FILE_HEADERS): Now uses HEADER_SEEK_FD if it exists. + (symbol_file_command): Deleted use of HEADER_SEEK_FD. + * core.c: Deleted extra definition of COFF_FORMAT. + (N_MAGIC): Defined to be a_magic if not already defined. + (validate_files): USed N_MAGIC instead of reading a_magic. + +Wed Jan 11 12:51:00 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * remote.c: Upped PBUFSIZ. + (getpkt): Added zeroing of c inside loop in case of error retry. + + * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Removed + code to not put stuff with debugging symbols in the misc function + list. Had been ifdef'd out. + + * gdb.texinfo: Added the fact that the return value for a function + is printed if you use return. + + * infrun.c (wait_for_inferior): Removed test in "Have we hit + step_resume_breakpoint" for sp values in proper orientation. Was + in there for recursive calls in functions without frame pointers + and it was screwing up calls to alloca. + + * dbxread.c: Added #ifdef COFF_ENCAPSULATE to include + a.out.encap.h. + (symbol_file_command): Do HEADER_SEEK_FD when defined. + * dbxread.c, core.c: Deleted #ifdef ROBOTUSSIN stuff. + * robotussin.h: Deleted local copy (was symlink). + * a.out.encap.h: Created symlink to + /gp/gnu/binutils/a.out.encap.h. + * Makefile: Removed robotussin.h and included a.out.encap.h in + list of files. + + * valprint.c (val_print, print_scalar_formatted): Changed default + precision of printing float value; now 6 for a float and 16 for a + double. + + * findvar.c (value_from_register): Added code to deal with the + case where a value is spread over several registers. Still don't + deal with the case when some registers are saved in memory and + some aren't. + +Tue Jan 10 17:04:04 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * xgdb.c (xgdb_create_window): Removed third arg (XtDepth) to + frameArgs. + + * infrun.c (handle_command): Error if signal number is less or + equal to 0 or greater or equal to NSIG or a signal number is not + provided. + + * command.c (lookup_cmd): Modified to not convert command section + of command line to lower case in place (in case it isn't a + subcommand, but an argument to a command). + +Fri Jan 6 17:57:34 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c: Changed "text area" to "data area" in comments on + N_SETV. + +Wed Jan 4 12:29:54 1989 Randall Smith (randy at gluteus.ai.mit.edu) + + * dbxread.c: Added definitions of gnu symbol types after inclusion + of a.out.h and stab.h. + +Mon Jan 2 20:38:31 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * eval.c (evaluate_subexp): Binary logical operations needed to + know type to determine whether second value should be evaluated. + Modified to discover type before binup_user_defined_p branch. + Also commented "enum noside". + + * Makefile: Changed invocations of munch to be "./munch". + + * gdb.texinfo: Updated to refer to current version of gdb with + January 1989 last update. + + * coffread.c (end_symtab): Zero context stack when finishing + lexical contexts. + (read_coff_symtab): error if context stack 0 in ".ef" else case. + + * m-*.h (FRAME_SAVED_PC): Changed name of argument from "frame" to + "FRAME" to avoid problems with replacement of "->frame" part of + macro. + + * i386-dep.c (i386_get_frame_setup): Added codestream_get() to + move codestream pointer up to the correct location in "subl $X, + %esp" case. + +Sun Jan 1 14:24:35 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * valprint.c (val_print): Rewrote routine to print string pointed + to by char pointer; was producing incorrect results when print_max + was 0. + +Fri Dec 30 12:13:35 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Put + everything on the misc function list. + + * Checkpointed distribution. + + * Makefile: Added expread.tab.c to the list of things slated for + distribution. + +Thu Dec 29 10:06:41 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * stack.c (set_backtrace_limit_command, backtrace_limit_info, + bactrace_command, _initialize_stack): Removed modifications for + limit on backtrace. Piping the backtrace through an interuptable + "more" emulation is a better way to do it. + +Wed Dec 28 11:43:09 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * stack.c + (set_backtrace_limit_command): Added command to set a limit to the + number of frames for a backtrace to print by default. + (backtrace_limit_info): To print the current limit. + (backtrace_command): To use the limit. + (_initialize_stack): To initialize the limit to its default value + (30), and add the set and info commands onto the appropriate + command lists. + + * gdb.texinfo: Documented changes to "backtrace" and "commands" + commands. + + * stack.c (backtrace_command): Altered so that a negative argument + would show the last few frames on the stack instead of the first + few. + (_initialize_stack): Modified help documentation. + + * breakpoint.c (commands_command): Altered so that "commands" with + no argument would refer to the last breakpoint set. + (_initialize_breakpoint): Modified help documentation. + + * infrun.c (wait_for_inferior): Removed ifdef on Sun4; now you can + single step through compiler generated sub calls and will die if + you next off of the end of a function. + + * sparc-dep.c (single_step): Fixed typo; "break_insn" ==> "sizeof + break_insn". + + * m-sparc.h (INIT_EXTRA_FRAME_INFO): Set the bottom of a stack + frame to be the bottom of the stack frame inner from this, if that + inner one is a leaf node. + + * dbxread.c (read_dbx_symtab): Check to make sure we don't add a + psymtab to it's own dependency list. + + * dbxread.c (read_dbx_symtab): Modified check for duplicate + dependencies to catch them correctly. + +Tue Dec 27 17:02:09 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-*.h (FRAME_SAVED_PC): Modified macro to take frame info + pointer as argument. + * stack.c (frame_info), blockframe.c (get_prev_frame_info), + gld-pinsn.c (findframe), m-*.h (SAVED_PC_AFTER_CALL, + FRAME_CHAIN_VALID, FRAME_NUM_ARGS): Changed usage of macros to + conform to above. + * m-sparc.h (FRAME_SAVED_PC), sparc-dep.c (frame_saved_pc): + Changed frame_saved_pc to have a frame info pointer as an + argument. + + * m-vax.h, m-umax.h, m-npl.h, infrun.c (wait_for_inferior), + blockframe.c (get_prev_frame_info): Modified SAVED_PC_AFTER_CALL + to take a frame info pointer as an argument. + + * blockframe.c (get_prev_frame_info): Altered the use of the + macros FRAME_CHAIN, FRAME_CHAIN_VALID, and FRAME_CHAIN_COMBINE to + use frame info pointers as arguments instead of frame addresses. + * m-vax.h, m-umax.h, m-sun3.h, m-sun3.h, m-sparc.h, m-pn.h, + m-npl.h, m-news.h, m-merlin.h, m-isi.h, m-hp9k320.h, m-i386.h: + Modified definitions of the above macros to suit. + * m-pn.h, m-npl.h, gould-dep.c (findframe): Modified findframe to + use a frame info argument; also fixed internals (wouldn't work + before). + + * m-sparc.h: Cosmetic changes; reordered some macros and made sure + that nothing went over 80 lines. + +Thu Dec 22 11:49:15 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * Version 3.0 released. + + * README: Deleted note about changing -lobstack to obstack.o. + +Wed Dec 21 11:12:47 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-vax.h (SKIP_PROLOGUE): Now recognizes gcc prologue also. + + * blockframe.c (get_prev_frame_info): Added FUNCTION_START_OFFSET + to result of get_pc_function_start. + * infrun.c (wait_for_inferior): Same. + + * gdb.texinfo: Documented new "step" and "next" behavior in + functions without line number information. + +Tue Dec 20 18:00:45 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * infcmd.c (step_1): Changed behavior of "step" or "next" in a + function witout line number information. It now sets the step + range around the function (to single step out of it) using the + misc function vector, warns the user, and continues. + + * symtab.c (find_pc_line): Zero "end" subsection of returned + symtab_and_line if no symtab found. + +Mon Dec 19 17:44:35 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * i386-pinsn.c (OP_REG): Added code from pace to streamline + disassembly and corrected types. + * i386-dep.c + (i386_follow_jump): Code added to follow byte and word offset + branches. + (i386_get_frame_setup): Expanded to deal with more wide ranging + function prologue. + (i386_frame_find_saved_regs, i386_skip_prologue): Changed to use + i386_get_frame_setup. + + +Sun Dec 18 11:15:03 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-sparc.h: Deleted definition of SUN4_COMPILER_BUG; was designed + to avoid something that I consider a bug in our code, not theirs, + and which I fixed earlier. Also deleted definition of + CANNOT_USE_ARBITRARY_FRAME; no longer used anywhere. + FRAME_SPECIFICATION_DYADIC used instead. + + * infrun.c (wait_for_inferior): On the sun 4, if a function + doesn't have a prologue, a next over it single steps into it. + This gets around the problem of a "call .stret4" at the end of + functions returning structures. + * m-sparc.h: Defined SUN4_COMPILER_FEATURE. + + * main.c (copying_info): Seperated the last printf into two + printfs. The 386 compiler will now handle it. + + * i386-pinsn.c, i386-dep.c: Moved print_387_control_word, + print_387_status_word, print_387_status, and i386_float_info to + dep.c Also included reg.h in dep.c. + +Sat Dec 17 15:31:38 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * main.c (source_command): Don't close instream if it's null + (indicating execution of a user-defined command). + (execute_command): Set instream to null before executing + commands and setup clean stuff to put it back on error. + + * inflow.c (terminal_inferior): Went back to not checking the + ioctl returns; there are some systems when this will simply fail. + It seems that, on most of these systems, nothing bad will happen + by that failure. + + * values.c (value_static_field): Fixed dereferencing of null + pointer. + + * i386-dep.c (i386_follow_jump): Modified to deal with + unconditional byte offsets also. + + * dbxread.c (read_type): Fixed typo in function type case of switch. + + * infcmd.c (run_command): Does not prompt to restart if command is + not from a tty. + +Fri Dec 16 15:21:58 1988 Randy Smith (randy at calvin) + + * gdb.texinfo: Added a third option under the "Cannot Insert + Breakpoints" workarounds. + + * printcmd.c (display_command): Don't do the display unless there + is an active inferior; only set it. + + * findvar.c (value_of_register): Added an error check for calling + this when the inferior isn't active and a core file isn't being + read. + + * config.gdb: Added reminder about modifying REGEX in the + makefile for the 386. + + * i386-pinsn.c, i386-dep.c: Moved m-i386.h helper functions over + to i386-dep.c.b + +Thu Dec 15 14:04:25 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * README: Added a couple of notes about compiling gdb with itself. + + * breakpoint.c (set_momentary_breakpoint): Only takes FRAME_FP of + frame if frame is non-zero. + + * printcmd.c (print_scalar_formatted): Implemented /g size for + hexadecimal format on machines without an 8 byte integer type. It + seems to be non-trivial to implement /g for other formats. + (decode_format): Allowed hexadecimal format to make it through /g + fileter. + +Wed Dec 14 13:27:04 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * expread.y: Converted all calls to write_exp_elt from the parser + to calls to one of write_exp_elt_{opcode, sym, longcst, dblcst, + char, type, intern}. Created all of these routines. This gets + around possible problems in passing one of these things in one ear + and getting something different out the other. Eliminated + SUN4_COMPILER_BUG ifdef's; they are now superfluous. + + * symmisc.c (free_all_psymtabs): Reinited partial_symtab_list to 0. + (_initialize_symmisc): Initialized both symtab_list and + partial_symtab_list. + + * dbxread.c (start_psymtab): Didn't allocate anything on + dependency list. + (end_psymtab): Allocate dependency list on psymbol obstack from + local list. + (add_psymtab_dependency): Deleted. + (read_dbx_symtab): Put dependency on local list if it isn't on it + already. + + * symtab.c: Added definition of psymbol_obstack. + * symtab.h: Added declaration of psymbol_obstack. + * symmisc.c (free_all_psymtabs): Added freeing and + reinitionaliztion of psymbol_obstack. + * dbxread.c (free_all_psymbols): Deleted. + (start_psymtab, end_psymtab, + process_symbol_for_psymtab): Changed most allocation + of partial symbol stuff to be off of psymbol_obstack. + + * symmisc.c (free_psymtab, free_all_psymtabs): Deleted + free_psymtab subroutine. + + * symtab.h: Removed num_includes and includes from partial_symtab + structure; no longer needed now that all include files have their + own psymtab. + * dbxread.c (start_psymtab): Eliminated initialization of above. + (end_psymtab): Eliminated finalization of above; get + includes from seperate list. + (read_dbx_symtab): Moved includes from psymtab list to + their own list; included in call to end_psymtab. + * symmisc.c (free_psymtab): Don't free includes. + +Tue Dec 13 14:48:14 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * i386-pinsn.c: Reformatted entire file to correspond to gnu + software indentation conventions. + + * sparc-dep.c (skip_prologue): Added capability of recognizign + stores of input register parameters into stack slots. + + * sparc-dep.c: Added an include of sparc-opcode.h. + * sparc-pinsn.c, sparc-opcode.h: Moved insn_fmt structures and + unions from pinsn.c to opcode.h. + * sparc-pinsn.c, sparc-dep.c (isabranch, skip_prologue): Moved + this function from pinsn.c to dep.c. + + * Makefile: Put in warnings about compiling with gcc (non-ansi + include files) and compiling with shared libs on Sunos 4.0 (can't + debug something that's been compiled that way). + + * sparc-pinsn.c: Put in a completely new file (provided by + Tiemann) to handle floating point disassembly, load and store + instructions, and etc. better. Made the modifications this file + (ChangeLog) list for sparc-pinsn.c again. + + * symtab.c (output_source_filename): Included "more" emulation hack. + + * symtab.c (output_source_filename): Initialized COLUMN to 0. + (sources_info): Modified to not print out a line for + all of the include files within a partial symtab (since + they have pst's of their own now). Also modified to + make a distinction between those pst's read in and + those not. + + * infrun.c: Included void declaration of single_step() if it's + going to be used. + * sparc-dep.c (single_step): Moved function previous to use of it. + + * Makefile: Took removal of expread.tab.c out of make clean entry + and put it into a new "squeakyclean" entry. + +Mon Dec 12 13:21:02 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * sparc-pinsn.c (skip_prologue): Changed a struct insn_fmt to a + union insn_fmt. + + * inflow.c (terminal_inferior): Checked *all* return codes from + ioctl's and fcntl's in routine. + + * inflow.c (terminal_inferior): Added check for sucess of + TIOCSPGRP ioctl call. Just notifies if bad. + + * dbxread.c (symbol_file_command): Close was getting called twice; + once directly and once through cleanup. Killed the direct call. + +Sun Dec 11 19:40:40 1988 & Smith (randy at hobbes.ai.mit.edu) + + * valprint.c (val_print): Deleted spurious printing of "=" from + TYPE_CODE_REF case. + +Sat Dec 10 16:41:07 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * dbxread.c: Changed allocation of psymbols from using malloc and + realloc to using obstacks. This means they aren't realloc'd out + from under the pointers to them. + +Fri Dec 9 10:33:24 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * sparc-dep.c inflow.c core.c expread.y command.c infrun.c + infcmd.c dbxread.c symmisc.c symtab.c printcmd.c valprint.c + values.c source.c stack.c findvar.c breakpoint.c blockframe.c + main.c: Various cleanups inspired by "gcc -Wall" (without checking + for implicit declarations). + + * Makefile: Cleaned up some more. + + * valops.c, m-*.h (FIX_CALL_DUMMY): Modified to take 5 arguments + as per what sparc needs (programming for a superset of needed + args). + + * dbxread.c (process_symbol_for_psymtab): Modified to be slightly + more picky about what it puts on the list of things *not* to be + put on the misc function list. When/if I shift everything over to + being placed on the misc_function_list, this will go away. + + * inferior.h, infrun.c: Added fields to save in inferior_status + structure. + + * maketarfile: Deleted; functionality is in Makefile now. + + * infrun.c (wait_for_inferior): Modified algorithm for determining + whether or not a single-step was through a subroutine call. See + comments at top of file. + + * dbxread.c (read_dbx_symtab): Made sure that the IGNORE_SYMBOL + macro would be checked during initial readin. + + * dbxread.c (read_ofile_symtab): Added macro GCC_COMPILED_FLAG_SYMBOL + into dbxread.c to indicate what string in a local text symbol will + indicate a file compiled with gcc. Defaults to "gcc_compiled.". + +Thu Dec 8 11:46:22 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-sparc.h (FRAME_FIND_SAVED_REGS): Cleaned up a little to take + advantage of the new frame cache system. + + * inferior.h, infrun.c, valops.c, valops.c, infcmd.c: Changed + mechanism to save inferior status over calls to inferior (eg. + call_function); implemented save_inferior_info and + restore_inferior_info. + + * blockframe.c (get_prev_frame): Simplified this by a direct call + to get_prev_frame_info. + + * frame.h, stack.c, printcmd.c, m-sparc.h, sparc-dep.c: Removed + all uses of frame_id_from_addr. There are short routines like it + still in frame_saved_pc (m-sparc.h) and parse_frame_spec + (stack.c). Eventually the one in frame_saved_pc will go away. + + * infcmd.c, sparc-dep.c: Implemented a new mechanism for + re-selecting the selected frame on return from a call. + + * blockframe.c, stack.c, findvar.c, printcmd.c, m-*.h: Changed + all routines and macros that took a "struct frame_info" as an + argument to take a "struct frame_info *". Routines: findarg, + framechain, print_frame_args, FRAME_ARGS_ADDRESS, + FRAME_STRUCT_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, + FRAME_FIND_SAVED_REGS. + + * frame.h, stack.c, printcmd.c, infcmd.c, findvar.c, breakpoint.c, + blockframe.c, xgdb.c, i386-pinsn.c, gld-pinsn.c, m-umax.h, + m-sun2.h, m-sun3.h, m-sparc.h, m-pn.h, m-npl.h, m-news.h, + m-merlin.h, m-isi.h, m-i386.h, m-hp9k320.h: Changed routines to + use "struct frame_info *" internally. + +Wed Dec 7 12:07:54 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * frame.h, blockframe.c, m-sparc.h, sparc-dep.c: Changed all calls + to get_[prev_]frame_cache_item to get_[prev_]frame_info. + + * blockframe.c: Elminated get_frame_cache_item and + get_prev_frame_cache_item; functionality now taken care of by + get_frame_info and get_prev_frame_info. + + * blockframe.c: Put allocation on an obstack and eliminated fancy + reallocation routines, several variables, and various nasty + things. + + * frame.h, stack.c, infrun.c, blockframe.c, sparc-dep.c: Changed + type FRAME to be a typedef to "struct frame_info *". Had to also + change routines that returned frame id's to return the pointer + instead of the cache index. + + * infcmd.c (finish_command): Used proper method of getting from + function symbol to start of function. Was treating a symbol as a + value. + + * blockframe.c, breakpoint.c, findvar.c, infcmd.c, stack.c, + xgdb.c, i386-pinsn.c, frame.h, m-hp9k320.h, m-i386.h, m-isi.h, + m-merlin.h, m-news.h, m-npl.h, m-pn.h, m-sparc.h, m-sun2.h, + m-sun3.h, m-umax.h: Changed get_frame_info and get_prev_frame_info + to return pointers instead of structures. + + * blockframe.c (get_pc_function_start): Modified to go to misc + function table instead of bombing if pc was in a block without a + containing function. + + * coffread.c: Dup'd descriptor passed to read_coff_symtab and + fdopen'd it so that there wouldn't be multiple closes on the same + fd. Also put (fclose, stream) on the cleanup list. + + * printcmd.c, stack.c: Changed print_frame_args to take a + frame_info struct as argument instead of the address of the args + to the frame. + + * m-i386.h (STORE_STRUCT_RETURN): Decremented sp by sizeof object + to store (an address) rather than 1. + + * dbxread.c (read_dbx_symtab): Set first_object_file_end in + read_dbx_symtab (oops). + + * coffread.c (fill_in_vptr_fieldno): Rewrote TYPE_BASECLASS as + necessary. + +Tue Dec 6 13:03:43 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * coffread.c: Added fake support for partial_symtabs to allow + compilation and execution without there use. + * inflow.c: Added a couple of minor USG mods. + * munch: Put in appropriate conditionals so that it would work on + USG systems. + * Makefile: Made regex.* handled same as obstack.*; made sure tar + file included everything I wanted it to include (including + malloc.c). + + * dbxread.c (end_psymtab): Create an entry in the + partial_symtab_list for each subfile of the .o file just read in. + This allows a "list expread.y:10" to work when we haven't read in + expread.o's symbol stuff yet. + + * symtab.h, dbxread.c (psymtab_to_symtab): Recognize pst->ldsymlen + == 0 as indicating a dummy psymtab, only in existence to cause the + dependency list to be read in. + + * dbxread.c (sort_symtab_syms): Elminated reversal of symbols to + make sure that register debug symbol decls always come before + parameter symbols. After mod below, this is not needed. + + * symtab.c (lookup_block_symbol): Take parameter type symbols + (LOC_ARG or LOC_REGPARM) after any other symbols which match. + + * dbxread.c (read_type): When defining a type in terms of some + other type and the other type is supposed to have a pointer back + to this specific kind of type (pointer, reference, or function), + check to see if *that* type has been created yet. If it has, use + it and fill in the appropriate slot with a pointer to it. + +Mon Dec 5 11:25:04 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * symmisc.c: Eliminated existence of free_inclink_symtabs and + init_free_inclink_symtabs; they aren't called from anywhere, and + if they were they could disrupt gdb's data structure badly + (elimination of struct type's which values that stick around past + elimination of inclink symtabs). + + * dbxread.c (symbol_file_command): Fixed a return pathway out of + the routine to do_cleanups before it left. + + * infcmd.c (set_environment_command), gdb.texinfo: Added + capability to set environmental variable values to null. + + * gdb.texinfo: Modified doc on "break" without args slightly. + +Sun Dec 4 17:03:16 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * dbxread.c (symbol_file_command): Added check; if there weren't + any debugging symbols in the file just read, the user is warned. + + * infcmd.c: Commented set_environment_command (a little). + + * createtags: Cleaned up and commented. + + * Makefile: Updated depen_memory and write_inferior_memory in that errno is + checked after each ptrace and returned to the caller. Used in + value_at to detect references to addresses which are out of + bounds. Also core.c (xfer_core_file): return 1 if invalid + address, 0 otherwise. + + * inflow.c, <machine>-infdep.c: removed all calls to ptrace from + inflo, m-sun3.h: Cleaned up dealings with + functions returning structu0 19:19:36 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * symmisc.c: (read_symsegs) Accept only format number 2. Since + the size of the type structure changed when C++ support was added, + format 1 can no longer be used. + + * core.c, m-sunos4.h: (core_file_command) support for SunOS 4.0. + Slight change in the core structure. #ifdef SUNOS4. New file + m-sunos4.h. May want to change config.gdb also. + +Fri Jul 8 19:59:49 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * breakpoint.c: (break_command_1) Allow `break if condition' + rather than parsing `if' as a function name and returning an + error. + +Thu Jul 7 22:22:47 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * C++: valops.c, valprint.c, value.h, values.c: merged code to deal + with C++ expressions. + +Wed Jul 6 03:28:18 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * C++: dbxread.c: (read_dbx_symtab, condense_misc_bunches, + add_file_command) Merged code to read symbol information from + an incrementally linked file. symmisc.c: + (init_free_inclink_symtabs, free_inclink_symtabs) Cleanup + routines. + +Tue Jul 5 02:50:41 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * C++: symtab.c, breakpoint.c, source.c: Merged code to deal with + ambiguous line specifications. In C++ one can have overloaded + function names, so that `list classname::overloadedfuncname' + refers to several different lines, possibly sure currently configured machine + dependent files come first in e at corn-chex.ai.mit.edu) + + * C++: symtab.c: replaced lookup_symtab_1 and lookup_symtab_2 with + a modified lookup_symbol which checks for fields of the current + implied argument `this'. printcmd.c, source.c, symtab.c, + valops.c: Need to change callers once callers are + installed. + +Wed Jun 29 01:26:56 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu) + + * C++: eval.c, expprint.c, expread.y, expression.h, valarith.c, + Merged code to deal with evaluation of user-defined operators, + member functions, and virtual functions. + binop_must_be_user_defined tests for user-defined binops, + value_x_binop calls the appropriate operator function. + +Tue Jun 28 02:56:42 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu) + + * C++: Makefile: changed the echo: expect 101 shift/reduce conflicts + and 1 reduce/reduce conflict. + + +Local Variables: +mode: indented-text +eval: (auto-fill-mode 1) +left-margin: 8 +fill-column: 74 +version-control: never +End: + + constructors, and flags being defined via public and via + virtual paths. Added fields NEXT_VARIANT, N_BASECLASSES, + and BASECLASSES to this type (tr: Changed types from + having to be derived from a single baseclass to a multiple + base class). + * symtab.h: Added macros to access new fields defined in symseg.h. + Added decl for lookup_basetype_type. + * dbxread.c + (condense_addl_misc_bunches): Function added to condense the misc + function bunches added by reading in a new .o file. + (read_addl_syms): Function added to read in symbols + from a new .o file (incremental linking). + (add_file_command): Command interface function to indicate + incrmental linking of a new .o file; this now calls + read_addl_syms and condense_addl_misc_bunches. + (define_symbol): Modified code to handle types defined from base + types which were not known when the derived class was + output. + (read_struct_type): Modified to better handle description of + struct types as derived types. Possibly derived from + several different base classes. Also added new code to + mark definitions via virtual paths or via public paths. + Killed seperate code to handle classes with destructors + but without constructors and improved marking of classes + as having destructors and constructors. + * infcmd.c: Modified call to val_print (one more argument). + * symtab.c (lookup_member_type): Modified to deal with new + structure in symseg.h. + (lookup_basetype_type): Function added to find or construct a type + ?derived? from the given type. + (decode_line_1): Modified to deal with new type data structures. + Modified to deal with new number of args for + decode_line_2. + (decode_line_2): Changed number of args (?why?). + (init_type): Added inits for new C++ fields from + symseg.h. + *valarith.c + (value_x_binop, value_binop): Added cases for BINOP_MIN & + BINOP_MAX. + * valops.c + (value_struct_elt, check_field, value_struct_elt_for_address): + Changed to deal with multiple possible baseclasses. + (value_of_this): Made SELECTED_FRAME an extern variable. + * valprint.c + (val_print): Added an argument DEREF_REF to dereference references + automatically, instead of printing them like pointers. + Changed number of arguments in recursive calls to itself. + Changed to deal with varibale numbers of base classes. + (value_print): Changed number of arguments to val_print. Print + type of value also if value is a reference. + (type_print_derivation_info): Added function to print out + derivation info a a type. + (type_print_base): Modified to use type_print_derivation_info and + to handle multiple baseclasses. + +Mon Nov 21 10:32:07 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * inflow.c (term_status_command): Add trailing newline to output. + + * sparc-dep.c (do_save_insn, do_restore_insn): Saved + "stop_registers" over the call for the sake of normal_stop and + run_stack_dummy. + + * m-sparc.h (EXTRACT_RETURN_VALUE): Put in parenthesis to force + addition of 8 to the int pointer, not the char pointer. + + * sparc-pinsn.c (print_addr1): Believe that I have gotten the + syntax right for loads and stores as adb does it. + + * symtab.c (list_symbols): Turned search for match on rexegp into + a single loop. + + * dbxread.c (psymtab_to_symtab): Don't read it in if it's already + been read in. + + * dbxread.c (psymtab_to_symtab): Changed error to fatal in + psymtab_to_symtab. + + * expread.y (parse_number): Fixed bug which treated 'l' at end of + number as '0'. + +Fri Nov 18 13:57:33 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Was + being foolish and using pointers into an array I could realloc. + Converted these pointers into integers. + +Wed Nov 16 11:43:10 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-sparc.h (POP_FRAME): Made the new frame be PC_ADJUST of the + old frame. + + * i386-pinsn.c, m-hp9k320.h, m-isi.h, m-merlin.h, m-news.h, + m-npl.h, m-pn.h, m-sparc.h, m-sun2.h, m-sun3.h, m-umax.h, m-vax.h: + Modified POP_FRAME to use the current frame instead of + read_register (FP_REGNUM) and to flush_cached_frames before + setting the current frame. Also added a call to set the current + frame in those POP_FRAMEs that didn't have it. + + * infrun.c (wait_for_inferior): Moved call to set_current_frame up + to guarrantee that the current frame will always be set when a + POP_FRAME is done. + + * infrun.c (normal_stop): Added something to reset the pc of the + current frame (was incorrect because of DECR_PC_AFTER_BREAK). + + * valprint.c (val_print): Changed to check to see if a string was + out of bounds when being printed and to indicate this if so. + + * convex-dep.c (read_inferior_memory): Changed to return the value + of errno if the call failed (which will be 0 if the call + suceeded). + +Tue Nov 15 10:17:15 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * infrun.c (wait_for_inferior): Two changes: 1) Added code to + not trigger the step breakpoint on recursive calls to functions + without frame info, and 2) Added calls to distinguish recursive + calls within a function without a frame (which next/nexti might + wish to step over) from jumps to the beginning of a function + (which it generally doesn't). + + * m-sparc.h (INIT_EXTRA_FRAME_INFO): Bottom set correctly for leaf + parents. + + * blockframe.c (get_prev_frame_cache_item): Put in mod to check + for a leaf node (by presence or lack of function prologue). If + there is a leaf node, it is assumed that SAVED_PC_AFTER_CALL is + valid. Otherwise, FRAME_SAVED_PC or read_pc is used. + + * blockframe.c, frame.h: Did final deletion of unused routines and + commented problems with getting a pointer into the frame cache in + the frame_info structure comment. + + * blockframe.c, frame.h, stack.c: Killed use of + frame_id_from_frame_info; used frame_id_from_addr instead. + + * blockframe.c, frame.h, stack.c, others (oops): Combined stack + cache and frame info structures. + + * blockframe.c, sparc-dep.c, stack.c: Created the function + create_new_frame and used it in place of bad calls to + frame_id_from_addr. + + * blockframe.c, inflow.c, infrun.c, i386-pinsn.c, m-hp9k320.h, + m-npl.h, m-pn.h, m-sparc.h, m-sun3.h, m-vax.h, default-dep.c, + convex-dep.c, gould-dep.c, hp9k320-dep.c, news-dep.c, sparc-dep.c, + sun3-dep.c, umax-dep.c: Killed use of + set_current_Frame_by_address. Used set_current_frame + (create_new_frame...) instead. + + * frame.h: Killed use of FRAME_FP_ID. + + * infrun.c, blockframe.c: Killed select_frame_by_address. Used + select_frame (get_current_frame (), 0) (which was correct in all + cases that we need to worry about. + +Mon Nov 14 14:19:32 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * frame.h, blockframe.c, stack.c, m-sparc.h, sparc-dep.c: Added + mechanisms to deal with possible specification of frames + dyadically. + +Sun Nov 13 16:03:32 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * ns32k-opcode.h: Add insns acbw, acbd. + +Sun Nov 13 15:09:58 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * breakpoint.c: Changed breakpoint structure to use the address of + a given frame (constant across inferior runs) as the criteria for + stopping instead of the frame ident (which varies across inferior + calls). + +Fri Nov 11 13:00:22 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * gld-pinsn.c (findframe): Modified to work with the new frame + id's. Actually, it looks as if this routine should be called with + an address anyway. + + * findvar.c (find_saved_register): Altered bactrace loop to work + off of frames and not frame infos. + + * frame.h, blockframe.c, stack.c, sparc-dep.c, m-sparc.h: Changed + FRAME from being the address of the frame to being a simple ident + which is an index into the frame_cache_item list. + * convex-dep.c, default-dep.c, gould-dep.c, hp9k320-dep.c, + i386-pinsn.c, inflow.c, infrun.c, news-dep.c, sparc-dep.c, + sun3-dep.c, umax-dep.c, m-hp9k320.h, m-npl.h, m-pn.h, m-sparc.h, + m-sun3.h, m-vax.h: Changed calls of the form set_current_frame + (read_register (FP_REGNUM)) to set_current_frame_by_address (...). + +Thu Nov 10 16:57:57 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * frame.h, blockframe.c, gld-pinsn.c, sparc-dep.c, stack.c, + infrun.c, findvar.c, m-sparc.h: Changed the FRAME type to be + purely an identifier, using FRAME_FP and FRAME_FP_ID to convert + back and forth between the two. The identifier is *currently* + still the frame pointer value for that frame. + +Wed Nov 9 17:28:14 1988 Chris Hanson (cph at kleph) + + * m-hp9k320.h (FP_REGISTER_ADDR): Redefine this to return + difference between address of given FP register, and beginning of + `struct user' that it occurs in. + + * hp9k320-dep.c (core_file_command): Fix sign error in size + argument to myread. Change buffer argument to pointer; was + copying entire structure. + (fetch_inferior_registers, store_inferior_registers): Replace + occurrences of `FP_REGISTER_ADDR_DIFF' with `FP_REGISTER_ADDR'. + Flush former definition. + +Wed Nov 9 12:11:37 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * xgdb.c: Killed include of initialize.h. + + * Pulled in xgdb.c from the net. + + * Checkpointed distribution (to provide to 3b2 guy). + + * coffread.c, dbxread.c, symmisc.c, symtab.c, symseg.h: Changed + format of table of line number--pc mapping information. Can + handle negative pc's now. + + * command.c: Deleted local copy of savestring; code in utils.c is + identical. + +Tue Nov 8 11:12:16 1988 Randall Smith (randy at plantaris.ai.mit.edu) + + * gdb.texinfo: Added documentation for shell escape. + +Mon Nov 7 12:27:16 1988 Randall Smith (randy at sugar-bombs.ai.mit.edu) + + * command.c: Added commands for shell escape. + + * core.c, dbxread.c: Added ROBOTUSSIN mods. + + * Checkpointed distribution. + + * printcmd.c (x_command): Yanked error if there is no memory to + examine (could be looking at executable straight). + + * sparc-pinsn.c (print_insn): Amount to leftshift sethi imm by is + now 10 (matches adb in output). + + * printcmd.c (x_command): Don't attempt to set $_ & $__ if there + is no last_examine_value (can happen if you did an x/0). + +Fri Nov 4 13:44:49 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * printcmd.c (x_command): Error if there is no memory to examine. + + * gdb.texinfo: Added "cont" to the command index. + + * sparc-dep.c (do_save_insn): Fixed typo in shift amount. + + * m68k-opcode.h: Fixed opcodes for 68881. + + * breakpoint.c, infcmd.c, source.c: Changed defaults in several + places for decode_line_1 to work off of the default_breakpoint_* + values instead of current_source_* values (the current_source_* + values are off by 5 or so because of listing defaults). + + * stack.c (frame_info): ifdef'd out FRAME_SPECIFCATION_DYADIC in + the stack.c module. If I can't do this right, I don't want to do + it at all. Read the comment there for more info. + +Mon Oct 31 16:23:06 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * gdb.texinfo: Added documentation on the "until" command. + +Sat Oct 29 17:47:10 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * breakpoint.c, infcmd.c: Added UNTIL_COMMAND and subroutines of + it. + + * breakpoint.c, infcmd.c, infrun.c: Added new field to breakpoint + structure (silent, indicating a silent breakpoint), and modified + breakpoint_stop_status and things that read it's return value to + understand it. + +Fri Oct 28 17:45:33 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * dbxread.c, symmisc.c: Assorted speedups for readin, including + special casing most common symbols, and doing buffering instead of + calling malloc. + +Thu Oct 27 11:11:15 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * stack.c, sparc-dep.c, m-sparc.h: Modified to allow "info frame" + to take two arguments on the sparc and do the right thing with + them. + + * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): Put + stuff to put only symbols that didn't have debugging info on the + misc functions list back in. + +Wed Oct 26 10:10:32 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * valprint.c (type_print_varspec_suffix): Added check for + TYPE_LENGTH(TYPE_TARGET_TYPE(type)) > 0 to prevent divide by 0. + + * printcmd.c (print_formatted): Added check for VALUE_REPEATED; + value_print needs to be called for that. + + * infrun.c (wait_for_inferior): Added break when you decide to + stop on a null function prologue rather than continue stepping. + + * m-sun3.h: Added explanatory comment to REGISTER_RAW_SIZE. + + * expread.y (parse_c_1): Initialized paren_depth for each parse. + +Tue Oct 25 14:19:38 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * valprint.c, coffread.c, dbxread.c: Enum constant values in enum + type now accessed through TYPE_FIELD_BITPOS. + + * dbxread.c (process_symbol_for_psymtab): Added code to deal with + possible lack of a ":" in a debugging symbol (do nothing). + + * symtab.c (decode_line_1): Added check in case of all numbers for + complete lack of symbols. + + * source.c (select_source_symtab): Made sure that this wouldn't + bomb on complete lack of symbols. + +Mon Oct 24 12:28:29 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-sparc.h, findvar.c: Ditched REGISTER_SAVED_UNIQUELY and based + code on REGISTER_IN_WINDOW_P and HAVE_REGISTER_WINDOWS. This will + break when we find a register window machine which saves the + window registers within the context of an inferior frame. + + * sparc-dep.c (frame_saved_pc): Put PC_ADJUST return back in for + frame_saved_pc. Seems correct. + + * findvar.c, m-sparc.h: Created the macro REGISTER_SAVED_UNIQUELY + to handle register window issues (ie. that find_saved_register + wasn't checking the selected frame itself for shit). + + * sparc-dep.c (core_file_command): Offset target of o & g register + bcopy by 1 to hit correct registers. + + * m-sparc.h: Changed STACK_END_ADDR. + +Sun Oct 23 19:41:51 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * sparc-dep.c (core_file_command): Added in code to get the i & l + registers from the stack in the corefile, and blew away some wrong + code to get i & l from inferior. + +Fri Oct 21 15:09:19 1988 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * m-sparc.h (PUSH_DUMMY_FRAME): Saved the value of the RP register + in the location reserved for i7 (in the created frame); this way + the rp value won't get lost. The pc (what we put into the rp in + this routine) gets saved seperately, so we loose no information. + + * sparc-dep.c (do_save_insn & do_restore_insn): Added a wrapper to + preserve the proceed status state variables around each call to + proceed (the current frame was getting munged because this wasn't + being done). + + * m-sparc.h (FRAME_FIND_SAVED_REGS): Fix bug: saved registers + addresses were being computed using absolute registers number, + rather than numbers relative to each group of regs. + + * m-sparc.h (POP_FRAME): Fixed a bug (I hope) in the context + within which saved reg numbers were being interpetted. The + values to be restored were being gotten in the inferior frame, and + the restoring was done in the superior frame. This means that i + registers must be restored into o registers. + + * sparc-dep.c (do_restore_insn): Modified to take a pc as an + argument, instead of a raw_buffer. This matches (at least it + appears to match) usage from POP_FRAME, which is the only place + from which do_restore_insn is called. + + * sparc-dep.c (do_save_insn and do_restore_insn): Added comments. + + * m-sparc.h (FRAME_FIND_SAVED_REGS): Modified my code to find the + save addresses of out registers to use the in regs off the stack + pointer when the current frame is 1 from the innermost. + +Thu Oct 20 13:56:15 1988 & Smith (randy at hobbes.ai.mit.edu) + + * blockframe.c, m-sparc.h: Removed code associated with + GET_PREV_FRAME_FROM_CACHE_ITEM. This code was not needed for the + sparc; you can always find the previous frames fp from the fp of + the current frame (which is the sp of the previous). It's getting + the information associated with a given frame (ie. saved + registers) that's a bitch, because that stuff is saved relative to + the stack pointer rather than the frame pointer. + + * m-sparc.h (GET_PREV_FRAME_FROM_CACHE_ITEM): Modified to return + the frame pointer of the previous frame instead of the stack + pointer of same. + + * blockframe.c (flush_cached_frames): Modified call to + obstack_free to free back to frame_cache instead of back to zero. + This leaves the obstack control structure in finite state (and + still frees the entry allocated at frame_cache). + +Sat Oct 15 16:30:47 1988 & Smith (randy at tartarus.uchicago.edu) + + * valops.c (call_function): Suicide material here. Fixed a typo; + CALL_DUMMY_STACK_ADJUST was spelled CAll_DUMMY_STACK_ADJUST on + line 530 of the file. This cost me three days. I'm giving up + typing for lent. + +Fri Oct 14 15:10:43 1988 & Smith (randy at tartarus.uchicago.edu) + + * m-sparc.h: Corrected a minor mistake in the dummy frame code + that was getting the 5th argument and the first argument from the + same place. + +Tue Oct 11 11:49:33 1988 & Smith (randy at tartarus.uchicago.edu) + + * infrun.c: Made stop_after_trap and stop_after_attach extern + instead of static so that code which used proceed from machine + dependent files could fiddle with them. + + * blockframe.c, frame.h, sparc-dep.c, m-sparc.h: Changed sense of + ->prev and ->next in struct frame_cache_item to fit usage in rest + of gdb (oops). + +Mon Oct 10 15:32:42 1988 Randy Smith (randy at gargoyle.uchicago.edu) + + * m-sparc.h, sparc-dep.c, blockframe.c, frame.h: Wrote + get_frame_cache_item. Modified FRAME_SAVED_PC and frame_saved_pc + to take only one argument and do the correct thing with it. Added + the two macros I recently defined in blockframe.c to m-sparc.h. + Have yet to compile this thing on a sparc, but I've now merged in + everything that I received from tiemann, either exactly, or simply + effectively. + + * source.c: Added code to allocated space to sals.sals in the case + where no line was specified. + + * blockframe.c, infrun.c: Modified to cache stack frames requested + to minimize accesses to subprocess. + +Tue Oct 4 15:10:39 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu) + + * config.gdb: Added sparc. + +Mon Oct 3 23:01:22 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu) + + * Makefile, blockframe.c, command.c, core.c, dbxread.c, defs.h, + expread.y, findvar.c, infcmd.c, inflow.c, infrun.c, sparc-pinsn.c, + m-sparc.h, sparc-def.c, printcmd.c, stack.c, symmisc.c, symseg.h, + valops.c, values.c: Did initial merge of sparc port. This will + not compile; have to do stack frame caching and finish port. + + * inflow.c, gdb.texinfo: `tty' now resets the controling terminal. + +Fri Sep 30 11:31:16 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * inferior.h, infcmd.c, infrun.c: Changed the variable + stop_random_signal to stopped_by_random signal to fit in better + with name conventions (variable is not a direction to the + proceed/resume set; it is information from it). + +Thu Sep 29 13:30:46 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu) + + * infcmd.c (finish_command): Value type of return value is now + whatever the function returns, not the type of the function (fixed + a bug in printing said value). + + * dbxread.c (read_dbx_symtab, process_symbol_for_psymtab): + Put *all* global symbols into misc_functions. This is what was + happening anyway, and we need it for find_pc_misc_function. + + ** This was eventually taken out, but I didn't mark it in the + ChangeLog. Oops. + + * dbxread.c (process_symbol_for_psymtab): Put every debugger + symbol which survives the top case except for constants on the + symchain. This means that all of these *won't* show up in misc + functions (this will be fixed once I make sure it's broken the way + it's supposed to be). + + * dbxread.c: Modified placement of debugger globals onto the hash + list; now we exclude the stuff after the colon and don't skip the + first character (debugger symbols don't have underscores). + + * dbxread.c: Killed debuginfo stuff with ifdef's. + +Wed Sep 28 14:31:51 1988 Randall Smith (randy at cream-of-wheat.ai.mit.edu) + + * symtab.h, dbxread.c: Modified to deal with BINCL, EINCL, and + EXCL symbols produced by the sun loader by adding a list of + pre-requisite partial_symtabs that each partial symtab needs. + + * symtab.h, dbxread.c, symtab.c, symmisc.c: Modified to avoid + doing a qsort on the local (static) psymbols for each file to + speed startup. This feature is not completely debugged, but it's + inclusion has forced the inclusion of another feature (dealing + with EINCL's, BINCL's and EXCL's) and so I'm going to go in and + deal with them. + + * dbxread.c (process_symbol_for_psymtab): Made sure that the class + of the symbol made it into the partial_symbol entry. + +Tue Sep 27 15:10:26 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * dbxread.c: Fixed bug; init_psymbol_list was not being called + with the right number of arguments (1). + + * dbxread.c: Put ifdef's around N_MAIN, N_M2C, and N_SCOPE to + allow compilation on a microvax. + + * config.gdb: Modified so that "config.gdb vax" would work. + + * dbxread.c, symtab.h, symmisc.h, symtab.c, source.c: Put in many + and varied hacks to speed up gdb startup including: A complete + rewrite of read_dbx_symtab, a modification of the partial_symtab + data type, deletion of select_source_symtab from + symbol_file_command, and optimiztion of the call to strcmp in + compare_psymbols. + +Thu Sep 22 11:08:54 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * dbxread.c (psymtab_to_symtab): Removed call to + init_misc_functions. + + * dbxread.c: Fixed enumeration type clash (used enum instead of + integer constant). + + * breakpoint.c: Fixed typo; lack of \ at end of line in middle of + string constant. + + * symseg.h: Fixed typo; lack of semicolon after structure + definition. + + * command.c, breakpoint.c, printcmd.c: Added cmdlist editing + functions to add commands with the abbrev flag set. Changed + help_cmd_list to recognize this flag and modified unset, + undisplay, and enable, disable, and delete breakpoints to have + this flag set. + +Wed Sep 21 13:34:19 1988 Randall Smith (randy at plantaris.ai.mit.edu) + + * breakpoint.c, infcmd.c, gdb.texinfo: Created "unset" as an alias + for delete, and changed "unset-environment" to be the + "environment" subcommand of "delete". + + * gdb.texinfo, valprint.c: Added documentation in the manual for + breaking the set-* commands into subcommands of set. Changed "set + maximum" to "set array-max". + + * main.c, printcmd.c, breakpoint.c: Moved the declaration of + command lists into main and setup a function in main initializing + them to guarrantee that they would be initialized before calling + any of the individual files initialize routines. + + * command.c (lookup_cmd): A null string subcommand is treated as + an unknown subcommand rather than an ambiguous one (eg. "set $x = + 1" will now work). + + * infrun.c (wait_for_inferior): Put in ifdef for Sony News in + check for trap by INNER_THAN macro. + + * eval.c (evaluate_subexp): Put in catch to keep the user from + attempting to call a non function as a function. + +Tue Sep 20 10:35:53 1988 Randall Smith (randy at oatmeal.ai.mit.edu) + + * dbxread.c (read_dbx_symtab): Installed code to keep track of + which global symbols did not have debugger symbols refering to + them, and recording these via record_misc_function. + + * dbxread.c: Killed code to check for extra global symbols in the + debugger symbol table. + + * printcmd.c, breakpoint.c: Modified help entries for several + commands to make sure that abbreviations were clearly marked and + that the right commands showed up in the help listings. + + * main.c, command.c, breakpoint.c, infcmd.c, printcmd.c, + valprint.c, defs.h: Modified help system to allow help on a class + name to show subcommands as well as commands and help on a command + to show *all* subcommands of that command. + +Fri Sep 16 16:51:19 1988 Randall Smith (randy at gluteus.ai.mit.edu) + + * breakpoint.c (_initialize_breakpoint): Made "breakpoints" + subcommands of enable, disable, and delete use class 0 (ie. they + show up when you do a help xxx now). + + * infcmd.c,printcmd,c,main.c,valprint.c: Changed the set-* + commands into subcommands of set. Created "set variable" for use + with variables whose names might conflict with other subcommands. + + * blockframe.c, dbxread.c, coffread.c, expread.y, source.c: + Fixed mostly minor (and one major one in block_for_pc) bugs + involving checking the partial_symtab_list when a scan through the + symtab_list fails. + +Wed Sep 14 12:02:05 1988 Randall Smith (randy at sugar-smacks.ai.mit.edu) + + * breakpoint.c, gdb.texinfo: Added enable breakpoints, disable + breakpoints and delete breakpoints as synonyms for enable, + disable, and delete. This seemed reasonable because of the + immeninent arrival of watchpoints & etc. + + * gdb.texinfo: Added enable display, disable display, and delete + display to manual. + +Tue Sep 13 16:53:56 1988 Randall Smith (randy at sugar-smacks.ai.mit.edu) + + * inferior.h, infrun.c, infcmd.c: Added variable + stop_random_signal to indicate when a proceed had been stopped by + an unexpected signal. Used this to determine (in normal_stop) + whether the current display point should be deleted. + + * valops.c: Fix to value_ind to check for reference before doing a + COERCE_ARRAY. + +Sun Jul 31 11:42:36 1988 Richard Stallman (rms at frosted-flakes.ai.mit.edu) + + * breakpoint.c (_initialize_breakpoint): Clean up doc for commands + that can now apply also to auto-displays. + + * coffread.c (record_line): Corrected a spazz in editing. + Also removed the two lines that assume line-numbers appear + only in increasing order. + +Tue Jul 26 22:19:06 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * expression.h, eval.c, expprint.c, printcmd.c, valarith.c, + valops.c, valprint.c, values.c, m-*.h: Changes for evaluating and + displaying 64-bit `long long' integers. Each machine must define + a LONGEST type, and a BUILTIN_TYPE_LONGEST. + + * symmisc.c: (print_symtab) check the status of the fopen and call + perror_with_name if needed. + +Thu Jul 21 00:56:11 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * Convex: core.c: changes required by Convex's SOFF format were + isolated in convex-dep.c. + +Wed Jul 20 21:26:10 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * coffread.c, core.c, expread.y, i386-pinsn.c, infcmd.c, inflow.c, + infrun.c, m-i386.h, main.c, remote.c, source.c, valops.c: + Improvements for the handling of the i386 and other machines + running USG. (Several of these files just needed extra header files + such as types.h.) utils.c: added bcopy, bcmp, bzero, getwd, list + of signals, and queue routines for USG systems. Added vfork macro + to i386 + + * printcmd.c, breakpoint.c: New commands to enable/disable + auto-displays. Also `delete display displaynumber' works like + `undisplay displaynumber'. + +Tue Jul 19 02:17:18 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * coffread.c: (coff_lookup_type) Wrong portion of type_vector was + being bzero'd after type_vector was reallocated. + + * printcmd.c: (delete_display) Check for a display chain before + attempting to delete a display. + + * core.c, *-dep.c (*-infdep moved to *-dep): machine-dependent + parts of core.c (core_file_command, exec_file_command) moved to + *-dep.c. + +Mon Jul 18 19:45:51 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * dbxread.c: typo in read_struct_type (missing '=') was causing a + C struct to be parsed as a C++ struct, resulting in a `invalid + character' message. + +Sun Jul 17 22:27:32 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * printcmd.c, symtab.c, valops.c, expread.y: When an expression is + read, the innermost block required to evaluate the expression is + saved in the global variable `innermost_block'. This information + is saved in the `block' field of an auto-display so that + expressions with inactive variables can be skipped. `info display' + tells the user which displays are active and which are not. New + fn `contained_in' returns nonzero if one block is contained within + another. + +Fri Jul 15 01:53:14 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * infrun.c, m-i386.h: Use macro TRAPS_EXPECTED to set number of + traps to skip when sh execs the program. Default is 2, m-i386.h + overrides this and sets to 4. + + * coffread.c, infrun.c: minor changes for the i386. May be able + to eliminate them with more general code. + + * default-infdep.c: #ifdef SYSTEMV, include header file types.h. + Also switched the order of signal.h and user.h, since System 5 + requires signal.h to come first. + + * core.c main.c, remote,c, source.c, inflow.c: #ifdef SYSTEMV, + include various header files. Usually types.h and fcntl.h. + + * utils.c: added queue routines needed by the i386 (and other sys + 5 machines). + + * sys5.c, regex.c, regex.h: new files for sys 5 systems. (The + regex files are simply links to /gp/gnu/lib.) + +Thu Jul 14 01:47:14 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * config.gdb, README: Provide a list of known machines when user + enters an invalid machine. New second arg is operating system, + currently only used with `sunos4' or `os4'. Entry for i386 added. + + * news-infdep.c: new file. + + * m-news.h: new version which deals with new bugs in news800's OS. + +Tue Jul 12 19:52:16 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * Makefile, *.c, munch, config.gdb, README: New initialization + scheme uses nm to find functions whose names begin with + `_initialize_'. Files `initialize.h', `firstfile.c', + `lastfile.c', `m-*init.h' no longer needed. + + * eval.c, symtab.c, valarith.c, valops.c, value.h, values.c: Bug + fixes from gdb+ 2.5.4. evaluate_subexp takes a new arg, type + expected. New fn value_virtual_fn_field. + +Mon Jul 11 00:48:49 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * core.c (read_memory): xfer_core_file was being called with an + extra argument (0) by read_memory. + + * core.c (read_memory), *-infdep.c (read_inferior_memory), + valops.c (value_at): read_memory and read_inferior_memory now work + like write_memory and write_inferior_memory in that errno is + checked after each ptrace and returned to the caller. Used in + value_at to detect references to addresses which are out of + bounds. Also core.c (xfer_core_file): return 1 if invalid + address, 0 otherwise. + + * inflow.c, <machine>-infdep.c: removed all calls to ptrace from + inflow.c and put them in machine-dependent files *-infdep.c. + +Sun Jul 10 19:19:36 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * symmisc.c: (read_symsegs) Accept only format number 2. Since + the size of the type structure changed when C++ support was added, + format 1 can no longer be used. + + * core.c, m-sunos4.h: (core_file_command) support for SunOS 4.0. + Slight change in the core structure. #ifdef SUNOS4. New file + m-sunos4.h. May want to change config.gdb also. + +Fri Jul 8 19:59:49 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * breakpoint.c: (break_command_1) Allow `break if condition' + rather than parsing `if' as a function name and returning an + error. + +Thu Jul 7 22:22:47 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * C++: valops.c, valprint.c, value.h, values.c: merged code to deal + with C++ expressions. + +Wed Jul 6 03:28:18 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * C++: dbxread.c: (read_dbx_symtab, condense_misc_bunches, + add_file_command) Merged code to read symbol information from + an incrementally linked file. symmisc.c: + (init_free_inclink_symtabs, free_inclink_symtabs) Cleanup + routines. + +Tue Jul 5 02:50:41 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * C++: symtab.c, breakpoint.c, source.c: Merged code to deal with + ambiguous line specifications. In C++ one can have overloaded + function names, so that `list classname::overloadedfuncname' + refers to several different lines, possibly in different files. + +Fri Jul 1 02:44:20 1988 Peter TerMaat (pete at corn-chex.ai.mit.edu) + + * C++: symtab.c: replaced lookup_symtab_1 and lookup_symtab_2 with + a modified lookup_symbol which checks for fields of the current + implied argument `this'. printcmd.c, source.c, symtab.c, + valops.c: Need to change callers once callers are + installed. + +Wed Jun 29 01:26:56 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu) + + * C++: eval.c, expprint.c, expread.y, expression.h, valarith.c, + Merged code to deal with evaluation of user-defined operators, + member functions, and virtual functions. + binop_must_be_user_defined tests for user-defined binops, + value_x_binop calls the appropriate operator function. + +Tue Jun 28 02:56:42 1988 Peter TerMaat (pete at frosted-flakes.ai.mit.edu) + + * C++: Makefile: changed the echo: expect 101 shift/reduce conflicts + and 1 reduce/reduce conflict. + +Local Variables: +mode: indented-text +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/gdb/gdb/ChangeLog-9091 b/contrib/gdb/gdb/ChangeLog-9091 new file mode 100644 index 0000000000000..42f8d0b4af810 --- /dev/null +++ b/contrib/gdb/gdb/ChangeLog-9091 @@ -0,0 +1,8322 @@ +Mon Dec 30 10:57:02 1991 Per Bothner (bothner at cygnus.com) + + Mainly stuff to improve handling of TYPE_CODE_REF values. + * valops.c (value_addr): If taking the addres of a + TYPE_CODE_REF, just cast the object to the corresponding + TYPE_CODE_PTR. This yields correct C++ semantics, and + preserves the location information, which has the nice effect + that &(&R) given the location containing R. + * values.c (value_copy): Make non-static (used by value_addr). + * eval.c (evaluate_subexp_for_address): Use the default + scheme (with value_addr) for a variable if it has TYPE_CODE_REF. + * valops.c (value_addr), eval.c (evaluate_subexp_for_address, + evaluate_subexp_with_coercion): Factor out some common + expressions into variables, for easier reading. + * findvar.c (locate_var_value): Remove code to handle + TYPE_CODE_REF - it should no longer be needed. + * valops.c (value_assign): Do a COERCE_REF on the + destination operand, for correct C++ semantics. + * valarith.c (value_x_binop): Ditto: De-reference C++ + references in the arguments. + * valops.c: ANSI-fy: bcopy->memcpy, bzero->memset. + +Sat Dec 28 11:30:26 1991 Per Bothner (bothner at cygnus.com) + + * dwarfread.c, coffread.c: Use INIT_CPLUS_SPECIFIC. + * symtab.c (gdb_mangle_name): Recognize and handle + constructors specially. + * symtab.c (check_stub_method): Test for failure from + cplus-demangle by calling error() instead of seg-faulting ... + +Fri Dec 27 22:21:30 1991 Fred Fish (fnf at cygnus.com) + + * defs.h: Add definition of null_cleanup() + + * procfs.c: Many small changes to add base support for a new + "info proc" command (currently only printing of the address + space mapping is implemented) and allow iteration over the + address space mapping, calling an arbitrary function for each + mapping (used for shared library support). + + * solib.c: Change all ifdefs that checked for "sun" to check + for "!SVR4_SHARED_LIBS" instead. Rewrite lookup_base() to + handle locating the debug base address even when not currently + stopped at the dynamic linker entry point. + + * utils.c: Add null_cleanup() as a known function that does + nothing to serve as a base for possibly long cleanup chains + with no specific "first cleanup" to serve as an anchor. + + * xm-sysv4.h: Add define of SVR4_SHARED_LIBS + +Fri Dec 27 10:11:33 1991 Per Bothner (bothner at cygnus.com) + + * arm-opcode.h, m88k-opcode.h, pn-opcode.h, np1-opcode.h, + pyr-opcode.h, tahoe-opcode, vax-opcode.h: Removed - + these are all essentially the same as the versions + in ../include/opcode. The remaining *-opcode.h here + are not quite so obviously the same, and need study. + * arm-pinsn.c, gould-pinsn.c, m88k-pinsn.c, pyr-pinsn.c, + tahoe-pinsn.c, vax-pinsn.c: Change so these include + opcode/FOO.h (actually ../include/opcode/FOO.h) + instead of the recenntly departed opcode-FOO.h files. + * sparc-pinsn.c: Now that we're using the much tighter + opcode table in ../include/opcode/sparc.h, we shouldn't + need to sort the opcodes before dis-assembly. + + * symtab.h, symmisc.c: Make cplus_struct_default be const. + * symtab.h, buildsym.c: Add and use INIT_CPLUS_SPECIFIC macro. + * symmisc.c: Remove unused 'nfields' variable. + * buildsym.h: Add extern decl of unknown_symtype_complaint, + since it used used by partial-stab.h (included two places). + * partial-stab.h: Re-arrange DBXREAD_ONLY #ifdefs so that + we should never hit the default case (until new stab codes + are added). Hence, we can leave the complaint in the + default case in even when DBXREAD_ONLY is off. + * partial_stab.h: Recognize a pair of N_SO stabs (one for the + directory, one for the filename proper) without peeking ahead. + * dbxread.c, mipsread.c: Because of previous change, don't need + ugly CHECK_SECOND_N_SO macro. + * buildsym.h, dbxread.c, mipsread.c: Make next_symbol_text a + macro that invokes a function pointer in next_symbol_text_func. + * mipsread.c: Added comments various places to + explain what is going on. + * mipsread.c (parse_symbol): Support the new (SGI-specific?) + symbol types stStruct, stUnion, and stEnum. + Also, some fixes in the code for dealing with tags. + * mipsread.c: Change handling of startup_file_start and _end + - now just use the textlow and texhigh of a psymtab + to check if we've found the startup-file. + * mipsread.c: Replace s_idx by global cur_sdx in many places. + This is so mips_next_symbol_text can get at it. + +Thu Dec 26 19:52:01 1991 Fred Fish (fnf at cygnus.com) + + * dbxread.c, symmisc.c: Move add_psymbol_to_plist() from + dbxread.c to symmisc and change name to add_psymbol_to_list. + Ditto for add_psymbol_addr_to_plist(). Also expand their + body to not use ADD_PSYMBOL_VT_TO_LIST. + + * dwarfread.c: Remove add_psymbol_to_list() and convert usages + to the ADD_PSYMBOL_TO_LIST macro. + + * ieee-float.c: Change "#ifdef DEBUG" to "#ifdef IEEE_DEBUG" + to avoid collision with the DEBUG for ADD_PSYMBOL_VT_TO_LIST. + + * partial-stab.h, symfile.h: Move definitions of the macros + ADD_PSYMBOL_TO_LIST and ADD_PSYMBOL_ADDR_TO_LIST from + partial-stab.h to symfile.h. They aren't stab specific. + Change ADD_PSYMBOL_VT_TO_LIST to use memcpy rather than strncpy. + +Tue Dec 24 11:38:08 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Roll VERSION to 4.3.2. + +Mon Dec 23 13:54:35 1991 Per Bothner (bothner at cygnus.com) + + * m68k-opcode.h, mips-opcode.h, sparc-opcode.h: Deleted. + * m68k-pinsn.c, mips-pinsn.c, sparc-pinsn.c: + Include <opcode/FOO.h> instead of <FOO-opcode.h>. + + * symtab.h, symtab.c, coffread.c, dwarfread.c, symmisc.c, + dbxread.c: The TYPE_CPLUS_SPECIFIC structure is now only + allocated when it is needed. Until it is needed, it points + to a shared statically allocated structure. + + * buildsym.h, buildsym.c, dbxread.c: Remove the kludgy code + in read_ofile_symtab to recognize two initial N_SO stabs, + and let process_on_symbol handle it. This is cleaner, more + efficient, and lets mipsread.c share the same code. + + * symfile.h, partial-stab.h: Move ADD_PSYMBOL_VT_TO_LIST + and related macros to here ... + * dbxread.c: ... from here. + * symmisc.c: Move the "overflow" handling from + ADD_PSYMBOL_VT_TO_LIST macro into new function extend_psymbol_list. + * dwarfread.c: Re-write add_psymbol_to_list to use + ADD_PSYMBOL_VT_TO_LIST macro. + + * mipsread.c: Extend mipsread.c to handle stabs-style symbols + encapsulated in ecoff symbols. This enable full g++ debugging. + * partial-stab.h: Move the code for pre-scanning symbols + and building psymtabs to an include file, out from dbxread.c. + This way, the same code can also be used by mipsread.c. + * dbxread.c, buildsym.h: Various changes to allow some functions + to be used by mipsread.c (also some arguable stylistic changes). + + * tm-mips.h: Define BLOCK_ADDRESS_ABSOLUTE, at least for now, + since mips-tfile puts relocatable addresses into LBRAC/RBRAC + stabs. + + * mipsread.c: Replace code to handle ambiguous tag blocks. + Instead of allocating a TYPE_CODE_UNDEF, guess (by looking + at types and offsets) if a tag is a struct, union, or enum. + Still patch it later if we find out for sure. + * mipsread.c: In various ways, replace Forin's + ideo-syncratic code by code that fits better with the + rest of gdb, for both stabs-based and ecoff-based symtabs. + E.g. use end_psymtab; don't do extra passes over FDR table to + pre-partition global data; don't use external symbols to + create static/global symbols (just put them in the + misc_vector); use ADD_PSYMBOL_TO_LIST macro; don't + sort psymtabs or symtabs; use obstacks more. + + * symtab.c, mipsread.c, dbxread.c, buildsym.c: + ANSIfy: Replace bcopy by memcpy, bzero by memset. + +Sun Dec 22 19:31:04 1991 Fred Fish (fnf at cygnus.com) + + * solib.c (locate_base): Fix uninitialized variable that was + causing return of random value to callee. + + * config/mh-amix, config/mh-i386v4: Change to find alloca by + compiling and linking alloca.c, even when it is not strictly + required. Also arrange to link with -ltermlib rather than + -ltermcap. + + * Makefile.in: Move TERMCAP definition to prior to inclusion + of host makefile fragments so it can be overridden. + +Fri Dec 20 16:33:39 1991 John Gilmore (gnu at cygnus.com) + + * xcoffread.c (read_symbol_lineno): Logic error in incrementing + symbol table entry number. (From Metin Ozisik.) + +Fri Dec 20 11:36:38 1991 Fred Fish (fnf at cygnus.com) + + * config/mh-i386v4: Change XM_CLIBS to "-lc /usr/ucblib/libucb.a" + so compiles with native compilers (without builtin alloca) can + pick up the version from the bsd emulation library. However, we + search the standard C library first so we don't pick up lots of + other broken stuff from libucb.a, that we *don't* want. + + * configure.in, tm-amix.h, tm-i386v4.h, xm-amix.h, xm-i386v4.h: + Change svr4 references to sysv4. + + * source.c: Move declaration of external function index to + front of file so it is in scope for all references. + + * utils.c (error, fatal): Make definitions consistent with + defs.h declarations (declared as "volatile void"). + +Fri Dec 20 10:55:36 1991 John Gilmore (gnu at cygnus.com) + + * rs6k-opcode.h: Bugfix sfe and stbrx. By Al Kossow. + +Wed Dec 18 17:09:06 1991 Stu Grossman (grossman at cygnus.com) + + * command.h, defs.h, eval.h, expression.h, remote-sa.sparc.c, + sparc-tdep.c, symtab.h, target.h, value.h, vx-share/ptrace.h, + vx-share/xdr_ptrace.h, vx-share/xdr_rdb.h: ANSIfy enums. + +Mon Dec 16 12:31:46 1991 Fred Fish (fnf at cygnus.com) + + * config/mt-amix, config/mt-i386v4: Add solib.o to TDEPFILES + for these SVR4 systems. + + * symfile.c (symbol_file_add): When verbose is set, print + the names of files from which symbols are being loaded, as + when from_tty is true. + + * solib.c: Completely reorganized (rewritten) to support + SVR4 shared libraries in a manner very close to the original + SunOS implementation. This support is expected to change and + become more general at some future time. The SVR4 version + does not yet work for attached processes, for example. + + * dwarfread.c: Arrange in dwarf_build_psymtabs() for the + relocation address to be valid whether or not symbols are + being read from a shared library or an executable. Use the + relocation address recorded in the psymtab when reading + full symbol tables (in read_ofile_symtab). Ensure that the + relocated address ranges are recorded in partial symtabs. + + * elfread.c: Add new function elf_interpreter() to return the + string from the ELF ".interp" section. This is the interpreter + that the kernel tries to run and feed the executable to. + Expand arguments to record_misc_function to include a type arg. + Modify elf_symtab_read() to supply the type arg, and to do symbol + relocations for symbols read in from shared libraries. + + * procfs.c: Add new functions proc_base_address() and + proc_address_to_fd(), used by shared library support. + + * tm-svr4.h: Add macros to support SVR4 shared libraries. + Definitions for SOLIB_ADD, SOLIB_CREATE_INFERIOR_HOOK, + CLEAR_SOLIB, and DISABLE_UNSETTABLE_BREAK. + +Fri Dec 13 20:11:26 1991 John Gilmore (gnu at cygnus.com) + + * infrun.c, remote-eb.c, remote-nindy.c, remote-vx.c: Remove + unused START_INFERIOR_HOOK. + + * remote-eb.c: Change timeout to 24 seconds (*10 fits in byte) + to account for slow loading from floppies. + (eb_create_inferior): New fn, from eb_start and + nindy_create_inferior. + (eb_close): Only use log_file if nonzero. + (eb_xfer_inferior_memory): If not writing, then read! + (eb_read_inferior_memory, eb_write_inferior_memory): Return length. + (eb_kill): A new no-op. + (eb_mourn_inferior): Remove breakpoints, then generically weep. + +Fri Dec 13 16:09:23 1991 Fred Fish (fnf at cygnus.com) + + * breakpoint.c, findvar.c, infrun.c, putenv.c, stack.c: Fix + miscellaneous comparisons of integer with NULL that elicit + compiler warnings about comparison of integer with pointer, when + NULL is ((void *) 0) rather than just a bare 0. + +Wed Dec 11 13:02:58 1991 John Gilmore (gnu at cygnus.com) + + * breakpoint.c (breakpoint_re_set_one): Disable each breakpoint + while we reset it, in case of problems. Print breakpoint number + in error messages. + + * buildsym.c (read_struct_type): Avoid sun3 compiler bug with + foo[--n]. + + * source.c (find_source_lines): If getting file mod time fails, + don't warn. + + * target.c (target_xfer_memory): If errno is set, return it, + rather than EIO. + +Tue Dec 10 04:07:22 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: infodir belongs in datadir. + +Sun Dec 8 21:13:33 1991 Michael Tiemann (tiemann at sphagnum.cygnus.com) + + * symtab.h (struct fn_field): Add new fields `is_private', + `is_protected', `is_stub', making room by reducing the size of + `voffset'. + (struct fn_fieldlist): Delete the fields `private_fn_field_bits' + and `protected_fn_field_bits'. + (TYPE_FN_{PRIVATE,PROTECTED}_BITS): Deleted. + (SET_TYPE_FN_{PRIVATE,PROTECTED}): Deleted. + (TYPE_FN_{PRIVATE,PROTECTED}): Deleted. + (TYPE_FN_FIELD_{STUB,PRIVATE,PROTECTED}): New macros. + * valops.c, valprint.c, symtab.c: All callers updated. + + * buildsym.c (read_struct_type): Delete the `visibility' field + from `struct next_fnfield', and rework code so that visibility + info is stored into the fn_field directly. Also, hacked to set + TYPE_FN_FIELD_STUB for both static and normal member functions. + +Sat Dec 7 18:13:11 1991 Fred Fish (fnf at cygnus.com) + + * i386-tdep.c: Fix a problem on i386 systems where buffered code + stream access was failing to take into account the minimum size + granularity of the code section. For now, the buffering is simply + disabled. There is a similar problem in the i386 disassember code + that has not yet been fixed (FIXME). + + * gmalloc.c: Use macros to hide some of the ugly casting required + in the previously applied fix for pointers with high bits set. + +Sat Dec 7 16:49:35 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Roll VERSION to 4.3.1. + +Sat Dec 7 04:12:35 1991 John Gilmore (gnu at cygnus.com) + + GDB-4.3 release! + + * Makefile.in: Roll VERSION to 4.3 + * README, TODO, WHATS.NEW, depend: Update. + + * inflow.c (terminal_inferior): Avoid error msg if attached. + + * gmalloc.c: Fix bug that causes malloc & free to + fail on systems where pointers have the high bit set (0x800efcf0 + for example). The problem is that the difference between two + pointers is a signed integer, so the computation + + (char *) 0x800efcf0 - (char *) 0 + + yields a negative value. The sign of the result of the modulus + operator is machine dependent for negative operands, thus it is + possible for it to end up negative. From Fred Fish. + +Sat Dec 7 00:00:15 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: install using INSTALL_PROGRAM and INSTALL_DATA. + added clean-info. added some standards.text support and made it + look like our other Makefiles. + + * configure.in: mark this directory target dependent. configure + now runs entirely in objdir so make existence tests and + references against ${srcdir}. + +Fri Dec 6 08:30:36 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread.c (enum_type, struct_type): Fixes for opaque and + anonymous enumerations, structures, and unions. Now passes all + the current gdb test suite tests. + +Thu Dec 5 22:46:13 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: idestdir and ddestdir go away. Added copyrights + and shift gpl to v2. Added ChangeLog if it didn't exist. docdir + and mandir now keyed off datadir by default. + +Thu Dec 5 21:53:21 1991 John Gilmore (gnu at cygnus.com) + + * symtab.c (decode_line_1): If SKIP_PROLOGUE leaves us in + mid-line, be more careful about possibly advancing to the next line. + +Thu Dec 5 18:59:51 1991 Michael Tiemann (tiemann at cygnus.com) + + * cplus-dem.c (cplus_demangle): Call `string_need' when + null-terminating a partially-computed string. + +Thu Dec 5 18:19:43 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread.c (enum_type): Build a correct TYPE_NAME, add a + symbol to the symbol table for each member of the enum. + + * dwarfread.c (struct_type): Build a correct TYPE_NAME. + + * dwarfread.c (add_enum_psymbol): New function to extract enum + member names and add them to the partial symbol table while + building partial symbol tables. + +Thu Dec 5 17:31:05 1991 John Gilmore (gnu at cygnus.com) + + * symtab.c (check_stub_method): Must allocate two extra argument + slots (one for `this', one for arglist terminator). + +Thu Dec 5 10:51:05 1991 Fred Fish (fnf at cygnus.com) + + * inflow.c (child_terminal_info): Supply missing '"' character. + + * buildsym.c (define_symbol): Supply missing parenthesis. + +Thu Dec 5 03:34:21 1991 John Gilmore (gnu at cygnus.com) + + * coredep.c (fetch_core_registers): Fencepost error. Fixed by + Jay Lepreau <lepreau@cs.utah.edu>. + + * inflow.c: Remember whether GDB has a terminal. Avoid switching + terminals back and forth if we don't have one. + + * c-exp.y (parse_number): Zero is not an unsigned int constant! + * dbxread.c (read_dbx_symtab): Enum type numbers can be in (1,2) form. + + Improve type parsing. + * buildsym.c (define_symbol, read_range_type): Add + long_kludge_name that passes the names of range types being + defined, down to where we must choose between 'int' and 'long' + variants. This fails on Sun C anyway since the compiler itself is + confused between int and long. + (read_array_type, cleanup_undefined_types): Correct the size of + array type whose element-type size isn't immediately known. + + Early preparation to blow away many builtin types, building them + on the fly as needed. Don't compare types to builtin types with + ==; examine the relevant fields instead. + * coffread.c (process_coff_symbol: C_ARG, C_REGPARM): Avoid ==. + * buildsym.c (define_symbol, case 'p'): Avoid ==. + * valops.c (value_arg_coerce): Avoid ==. Don't assume host and + target types are the same. + * valprint.c (val_print): I finally understand arrays, remove FIXME. + + * symmisc.c (printpsyms_command): Reduce redundancy, and put all + addresses in GDB itself into parens for easy cleanup and diffing. + +Wed Dec 4 21:05:30 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread (enum_type): Arrange for the order of enumeration + members to match the source code order; not the order in the + Dwarf information, which is explicitly reverse order. + +Wed Dec 4 18:24:39 1991 John Gilmore (gnu at cygnus.com) + + * main.c (input_from_terminal_p): Check whether GDB has a + terminal at all. + (initialize_main): Revise doc for `set editing'. + +Wed Dec 4 15:36:39 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread.c (struct_type): Handle structures and unions which + contain DIE's other than just member dies. + +Wed Dec 4 01:59:05 1991 John Gilmore (gnu at cygnus.com) + + * symfile.c (reread_symbols): Avoid kludging mtime_set, now that + BFD is fixed. + +Tue Dec 3 17:24:57 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: VERSION 4.2.96. + + * main.c (initialize_main): Revise command descriptions. + * command.c (show_user): `info user' -> `show user'. + * symtab.c (_initialize_symtab): Typo in `info types' desc. + + * coffread.c (coff_symfile_read): Avoid select_source_symtab, + since it is not needed and can cause errors when examining ".o"s. + (read_coff_symtab, decode_base_type): Use complain, not printf. + Print symbol name, not its number. + Remove "#if defined(clipper) #define BELIEVE_PCC_PROMOTION", which + someday should go in a clipper target config file. + + * symfile.c (compact_misc_function_vector): Handle empty vector. + (complain, clear_complaints, syms_from_objfile): Fix complaint + formatting. + * xcoffexec.c: Change syms_from_objfile caller. + + * sparc-xdep.c: Force tm-file as tm-sparc.h, to make it compile + when configured for cross debugging. FIXME, this needs a more + general solution. + +Mon Dec 2 11:04:05 1991 Per Bothner (bothner at cygnus.com) + + * mips-tdep.c (init_extra_frame_info): Float register + 'i' has gdb-internal number 'FP0+i', not '32+i'. + * mipsread.c (new_symbol): Translate g++ special + symbol "$t" to "this". + +Sat Nov 30 21:29:55 1991 Steve Chamberlain (sac at cygnus.com) + Changes due to include file renaming: + + * xcoffread.c: internalcoff.h ->coff/internal.c, + coff-rs6000.h ->coff/rs6000.h + * mipsread.c: coff-mips.h ->coff/mips.h + * elfread.c: elf-common.h ->elf/common.h + elf-external.h ->elf/external.h, + elf-internal.h ->elf/internal.h + * dwarfread.c dwarf.h ->elf/dwarf.h + * dbxread.c: aout64.h ->aout/aout64.h + stab.gnu.h ->aout/stab_gnu.h + + * coffread.c: internalcoff.h ->coff/internal.h + * buildsym.c: stab.gnu.h ->aout/stab_gnu.h + * depend Updated to take the above into account. + +Fri Nov 29 16:59:25 1991 Fred Fish (fnf at cygnus.com) + + * configure.in: Add SVR4 i386 configurations. + + * config/mh-i386v4, config/mt-i386v4, tm-i386v4.h, xm-i386v4.h: + New files for i386/SVR4. + + * tm-i386v.h: Allow START_INFERIOR_TRAPS_EXPECTED and + DECR_PC_AFTER_BREAK to be predefined by files including + tm-i386v.h. + + * i386-tdep.c: Add supply_gregset(), fill_gregset(), + supply_fpregset(), and fill_fpregset() functions, which are + target dependent support functions for the SVR4 /proc register + interface. + + * dwarfread.c (enum_type, struct_type): Expand recognized + compiler generated tags to include symbols beginning with '.' as + well as '~'. + + * symtab.c (sources_info): Change simple printf of error message + to call to error(). + +Fri Nov 29 16:04:21 1991 Roland H. Pesch (pesch at cygnus.com) + + * doc/gdb.texinfo: remove leading comments that survived M4 but + described its role in the doc; add one more font to colophon; + strengthen disclaimer about unsupported configs. + +Wed Nov 27 01:23:41 1991 John Gilmore (gnu at cygnus.com) + + Fix bugs in C++ debugging. + + * symtab.h: target_type is not used in record types. + Eliminate TYPE_MAIN_VARIANT and TYPE_NEXT_VARIANT. Eliminate + lookup_method_type. Add TYPE_TYPE_SPECIFIC macro. + + * symtab.c (lookup_member_type): Don't chain them up, just + allocate one in symbol_obstack when we need one. + (allocate_stub_method): Build stub in symbol_obstack. + (check_stub_method): Move here from values.c. Don't deallocate + stub; overwrite it. + (lookup_method_type): Gone now. + + * buildsym.c: Handle g++ v1 stabs a little bit better. + Change some C++ parsing error()s to complain()ts. + * buildsym.c, findvar.c, printcmd.c, symtab.c: Make unions and + structs have the same representation and work the same as far as + C++ is concerned. + * buildsym.c, symtab.c, values.c: Remove all references to + TYPE_MAIN_VARIANT and TYPE_NEXT_VARIANT. + + * valops.c: Improve comments and indentation. Only call + check_stub_method when the stub flag is on. + * valprint.c: Fix or mark minor bugs and unportabilities. + + * coffread.c (anonymous unions): Allocate a cplus structure. + + * mipsread.c: Eliminate "template" types. Build new, real + types whenever we need them. Allocate cplus structures as needed. + Bulletproof the type parsing a bit more. Mark storage leaks. + (parse_type): Copy TYPE_TYPE_SPECIFIC when copying a real type + on top of a partial type. + +Fri Nov 22 16:39:57 1991 John Gilmore (gnu at cygnus.com) + + * inflow.c (terminal_inferior): Check the results of ioctl's, and + print a message if any of them fail. + (terminal_ours_1): Store result of ioctl's for debugging, but + don't print (the terminal isn't ours...). + + * tm-tahoe.h (FRAME_ARGS_ADDRESS): No need to offset from frame + pointer. + + * m2-exp.y (MAX, MIN): Rename to MAX_FUNC, MIN_FUNC to avoid + conflicts with system header files. + +Fri Nov 22 08:27:40 1991 John Gilmore (gnu at cygnus.com) + + * Roll VERSION to 4.2.95. + + * buildsym.c, coredep.c, mem-break.c, xcoffread.c: Put <stdio.h> + first, before defs.h. + * config/mh-i386sco: Override compiler to gcc, print warning. + * configure.in: Handle i386-none-aout rather than i386-aout-none. + * infptrace.c, language.h, utils.c: Lint. + * m2-exp.y: #undef MAX and MIN in case system includes set them. + * xm-tahoe.h: Set HOST_BYTE_ORDER. Include system versions of + {BIG,LITTLE}_ENDIAN and the INT_MAX family first, to avoid + redefinition warnings. + * defs.h: Reorder things so that the xm-file gets first crack + at #define's, followed by defs.h and then the tm-file. + * Makefile.in: Remove spaces after 'ignore exit code' - flags. + Late-model BSD 'make's don't cope with them. + +Thu Nov 21 23:48:56 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Roll new files into various lists. + +Thu Nov 21 18:26:11 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread.c (struct_type): Must initialize the c++ specific + portion of union types as well as struct types, since gdb attempts + to reference the c++ specific info for both types. + +Thu Nov 21 10:23:52 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Roll VERSION to 4.2.90. + + * defs.h: Incorporate param.h into defs.h. All users changed. + * param-no-tm.h: Change users to define TM_FILE_OVERRIDE instead. + * param.h, param-no-tm.h: Removed. + * Update copyrights in all changed files. + * dbxread.c, dwarfread.c, inflow.c, infrun.c, m2-exp.y, putenv.c, + solib.c, symtab.h, tm-umax.h, valprint.c: Lint. + * tm-convex.h, tm-hp300hpux.h, tm-merlin.h, tm-sparc.h, + xm-merlin.h: Avoid host include files in target descriptions. + * getpagesize.h: Removed, libiberty copes now. + * Makefile.in: Remove getpagesize.h, param.h, param-no-tm.h. + + * exec.c (exec_files_info): If `verbose' is set, show file offset + as well. + + * main.c: Use getcwd rather than getwd. + * standalone.c: Fake getcwd rather than getwd. + * xm-*.h: Remove fake values of MAXPATHLEN. + + * xcoffexec.c: Add /* */ to #if 0'd thing to help ANSI. + +Wed Nov 20 18:35:56 1991 John Gilmore (gnu at cygnus.com) + + * Remove gdb/hp-include. Support for HP a.out oddities should be + in BFD, not in GDB. Move gdb/hp-include/a.out.h to include/a.out.hp.h. + + * infptrace.c, tm-sun386.h: Cashier <a.out.gnu.h>, remove refs. + + * configure.in, xconfig, tconfig, Makefile.in, doc/gdbint.texinfo: + Makefile fragments for various hosts and targets now come from + gdb/config/mh-* and gdb/config/mt-*. This is for consistency with + other config setups. + + * rs6000-pinsn.c, rs6k-opcode.h: Clean up. + * rs6k-opcode.def: Delete. + +Wed Nov 20 05:04:40 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread.c: Recognize obsolete form of AT_element_list + attribute still used by at least one AT&T compiler, and possibly + more. + +Tue Nov 19 07:53:55 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread.c (enum_type, struct_type): Ignore names invented by + helpful compilers for anonymous structs, unions, and enums. + + * c-exp.y, m2-exp.y: Add defines for yymaxdepth, yy_yys, and + yy_yyv, so multiple parsers produced by SVR4 versions of yacc + can coexist in the same executable without collision. + + * symtab.h: Add declaration for lookup_template_type() to kill + compiler warnings about conversions from int to pointer. + +Mon Nov 18 17:45:18 1991 Fred Fish (fnf at cygnus.com) + + * procfs.c: Move inclusion of defs.h to before param.h, as in + all the other source files that include both. This is required + to supply some typedefs that are used in files included by param.h. + + * m68k-tdep.c (m68k_skip_prologue): Add generic m68k support for + skipping function prologues, ala the other cpu families (i386, + mips, m88k, etc). Add the ability to skip movm and fmovm + instructions in the prologues. Still needs support for profile + (-p compiled) prologue sequences (FIXME). + + * tm-68k.h: Change SKIP_PROLOGUE macro to use the new generic + m68k prologue skipping function by default. + + * tm-altos.h, tm-isi.h: Continue to use the old definition of + SKIP_PROLOGUE. + +Mon Nov 18 15:12:45 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Remove tdesc stuff, and extra blanks before colons. + * blockframe.c: Remove tdesc-related code. Default + FRAME_CHAIN_COMBINE. + * infrun.c: Remove tdesc-related code. + * m88k-tdep.c (frame_chain_combine, init_frame_pc): Remove copies + of defaultable things. + * tm-m88k.h: New file, common to all Moto 88k target configs. + Derived from tm-delta88.h. + * tm-delta88.h: Use it. + * xm-m88k.h: Common file for 88K hosts. Remove obsolete stuff. + * xm-delta88.h: Use it. + * tm-*.h: Remove FRAME_CHAIN_COMBINE macros, since all are + default. + * coffread.c: Remove tdesc stuff. + * tconfig/delta88, tconfig/m88k: Remove tdesc stuff. + * xconfig/m88k: Rename tm-88k.h to tm-m88k.h. + +Mon Nov 18 13:51:37 1991 Per Bothner (bothner at cygnus.com) + + * source.c (open_source_file): If openp fails, try again + using just the base (non-directory) part of the filename. + This solves various annoying problems, such as when the + source was compiled with an absolute pathname - and the + source files have moved. Or if the source was compiled + using a relative pathname, it can be more convenient + to just specific the source directory to the dir command. + +Mon Nov 18 00:04:41 1991 Fred Fish (fnf at cygnus.com) + + * cplus-dem.c (munge_function_name): Add missing third arg to + instance of call to do_type(). + + * dwarfread.c: Changes to match new dwarf.h. Remove + AT_deriv_list, AT_loclist, AT_incomplete, AT_const_data, + and AT_is_external. + +Sun Nov 17 16:20:53 1991 Michael Tiemann (tiemann at rtl.cygnus.com) + + * symtab.h (struct type): Moved C++-specific fields into new type + `struct cplus_struct_type'. Now takes 10% less memory. Many + macros changed. + * symtab.c (init_type): Don't set fields belonging to + TYPE_CPLUS_SPECIFIC unless TYPE is TYPE_CODE_STRUCT. + * buildsym.c (read_type): Allocate TYPE_CPLUS_SPECIFIC for + TYPE_CODE_STRUCT. + (read_struct_type): Ditto. Also, add comments about how we can + deduce TYPE_VPTR_FIELDNO from inheritance info and fieldname info. + * coffread.c (decode_base_type): Allocate TYPE_CPLUS_SPECIFIC for + TYPE_CODE_STRUCT. + (read_struct_type): Ditto. + * dwarfread.c (struct_type): Ditto. + + * symtab.c (read_range_type): Don't set TYPE_MAIN_VARIANT. + (lookup_pointer_type): Don't use or set TYPE_MAIN_VARIANT. + (lookup_reference_type): Ditto. + + * cplus-dem.c: Many changes made to handle decoding of + ANSI-mangled names. + * symtab.c (gdb_mangle_name): Mangle/demangle ANSI-mangled names + as well. + +Fri Nov 15 17:57:59 1991 Stu Grossman (grossman at cygnus.com) + + * mipsread.c (parse_partial_symbols): patch to keep DEC C + compiler from making gdb bomb out. Thanks to Ed Santiago! + +Thu Nov 14 19:27:30 1991 Fred Fish (fnf at cygnus.com) + + * symfile.c: Add function compact_misc_function_vector() to + remove duplicate misc function vector entries. See comments + in source for why this is necessary/desirable. + + * dwarfread.c: Add misc function type parameter to internal + record_misc_function(). Remove calls to init_misc_bunches() + and condense_misc_bunches(), these are now done in elfread.c. + + * elfread.c: Add support for reading bfd canonical symbol tables + and generating misc function vector entries for global and + absolute symbols. Do calls to init_misc_bunches() and + condense_misc_bunches() where they will enclose all calls to + record_misc_function(), including those in dwarfread.c. + +Thu Nov 14 17:02:11 1991 Roland H. Pesch (pesch at cygnus.com) + + * doc/Makefile.in: new targets gdb.me, gdb.ms, gdb.mm + (roffable documentation). + * doc/gdb.texinfo: embedded hints (as comments) for better + texi2roff conversion. + +Thu Nov 14 13:18:25 1991 John Gilmore (gnu at cygnus.com) + + * m88k-tdep.c (examine_prologue): Deal with OR instructions + that shuffle parameters into other regs. + * symtab.c (decode_line_1): Fix bug introduced in Per's change + of Nov 12th. + +Wed Nov 13 19:51:11 1991 Steve Chamberlain (sac at cygnus.com) + + * Makefile.in, xconfig/delta88 made it install a sysV manual page; + gdb.z into the right place. + +Wed Nov 13 16:45:13 1991 John Gilmore (gnu at cygnus.com) + + Motorola 88000 port without tears, I mean without tdescs. + + * m88k-tdep.c: Blow away all tdesc stuff. + Provide functions for all the frame-related macros in + tm-delta88.h. Adopt i960-style EXTRA_FRAME_INFO. + (examine_prologue, frame_find_saved_regs, skip_prologue): borrow + from i960-tdep.c and adapt to the function prologues on the 88k. + (read_next_frame_reg): Borrow from mips-tdep.c. + FIXME: frame_locals_address should go away. + + * tm-delta88.h: Dump all the tdesc stuff. + Macros for all frame-related stuff call fns of same name. + Remove duplicated definitions. FP_REGNUM becomes same as + SP_REGNUM. + + * xm-88k.h: Eliminate lots of library dependencies, now handled + in libiberty. Eliminate KDB nonsupport. + + * doc/gdbint.texinfo: Add rudiments on frames. FIXME, add more. + + + * stack.c (frame_info): Mark frameless functions. + Print locals address (FIXME, remove if same). + * blockframe.c: Comment changes, FIXME after. + * coffread.c: Even without TDESC, need to zap "@" symbols. + Don't register for wierd format names; change the names in BFD. + + * alloca.c, language.c, tdesc.c: Lint. + * tdesc.c, tdesc-lib: FIXME: remove these. + +Tue Nov 12 19:30:22 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Add tdesc library support. Fixups to lint, + copying.c rules. + +Tue Nov 12 13:43:26 1991 Per Bothner (bothner at cygnus.com) + + * symtab.c (decode_line_1): Remove spurious call to operator_chars. + + Allow setting breakpoints on C++ destructors. + * valops.c (destructor_name_p): Don't check TYPE_HAS_DESTRUCTOR, + since it lies. Rely on callers to catch missing destructors. + * symtab.c (decode_line_1): For example (see above), here. + * buildsym.c, symtab.h: Remove TYPE_FLAGS_HAS{CON,DE}STRUCTOR + flags since they are no longer used. + + Fixes to support C++ methods with functional parameters. + * c-exp.y (func_mod rule): Allow (and ignore) list of parameter + types in a function type. + * eval.c (parse_and_eval_type), value.h: New function, + parse_and_eval_type, is based on old code from check_stub_method. + But don't actually evaluate the cast, since that calls + value_cast(), whcih may fail. Just extract the type + from the parsed expression. + * values.c (check_stub_method): While looping through the + arguments, adjust depth *after* parameter has been handled. + Replace call and setup of parse_and_eval with new function + parse_and_eval_type. + +Tue Nov 12 09:40:07 1991 Fred Fish (fnf at cygnus.com) + + * utils.c, rem-multi.shar: Remove fixed arg count version of + concat(). + + * altos-xdep.c, arm-xdep.c, coffread.c, command.c, convex-xdep.c, + core.c, dwarfread.c, gould-xdep.c, infcmd.c, language.c, + m88k-xdep.c, main.c, printcmd.c, pyr-xdep.c, source.c, + sun386-xdep.c, symm-xdep.c, umax-xdep.c, values.c, xcoffread.c: + Change all instances of use of fixed args concat() to variable + args concat() now located in libiberty. + +Tue Nov 12 07:23:46 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Add xcoffread.c, xcoffexec.c. + * xcoffread.c: New file for handling AIX mangled-coff files. + * xconfig/rs6000, tconfig/rs6000: New files. + * buildsym.c: Add hooks for xcoffread.c. + * rs6000-pinsn.c, rs6000-tdep.c, rs6000-xdep.c, tm-rs6000.h, + xm-rs6000.h, rs6k-opcode.def, rs6k-opcode.h: New files. + * xcoffexec.c: New file for handling AIX shared libraries. + +Mon Nov 11 19:14:31 1991 Fred Fish (fnf at cygnus.com) + + * core.c: Minor rewording of message to user containing name of + (and possibly arguments to) the program that generated a core + file. + + * elfread.c: Remove the register_addr() stub now that it is no + longer needed. + + * procfs.c: Move misplaced #endif for ATTACH_DETACH. Add new + fetch_core_registers() function for core file support. + +Sat Nov 9 13:37:57 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread.c (dwarf_psymtab_to_symtab): Remove leftover call + to do_cleanups() which resulted from a previous change. + + * elfread.c: Re-enable compilation of register_addr() stub + whenever it is not supplied by coredep.c + +Sat Nov 9 00:40:32 1991 John Gilmore (gnu at cygnus.com) + + Add tracking of object files (that contain symbols) to gdb. + This includes a "struct objfile" that owns symtabs and psymtabs + that were read in from that binary file. + + * symfile.h: Add struct objfile. Add pointer to the objfile + into the struct sym_fns. + Replace global `symfile' and `symfile_mtime' with + `symfile_objfile'. Add global object_files chain. + + * symfile.c: Move param.h above symtab.h. + (sort_misc_function_vector): Add. + (syms_from_objfile): Was syms_from_bfd. + (symfile_open): Now returns objfile. + (allocate_objfile): New. + (free_objfile): New, replacing free_all_.*symtabs. + (symfile_init): Takes objfile arg, puts it in sym_fns result. + (reread_symbols): Searches whole chain of objfiles. + (allocate_symtab): Takes objfile as new parameter, chains them. + Handle INIT_EXTRA_SYMTAB_INFO. + (free_all_psymtabs, free_all_symtabs): Move here from symmisc.c. + + * dbxread.c: Make more errors into complaints. + (push_subfile, pop_subfile): Move to buildsym.c. + (dbx_symfile_read, dbx_symfile_init, fill_symbuf, read_dbx_symtab, + start_psymtab, psymtab_to_symtab_1, read_ofile_symtab, + dbx_psymtab_to_symtab, ): Use bfd ops, don't use file descriptor. + Pass objfile. Change callers. + (fill_symbuf, SWAP_SYMBOL): Take bfd as arg. + (read_dbx_symtab): Just wipe out new symbols, not all, on error. + (end_psymtab): Blow away psymtab if empty. + (process_symbol_pair): Swallow into read_ofile_symtab. + (process_one_symbol): Use push_context and pop_context. + (virtual_context): Delete #if 0'd obsolete stuff. + + * buildsym.c (end_symtab): Pass objfile. + (dbx_lookup_type): Handle null typevector. + (dbx_alloc_type): Check file number, not sym number, for -1. + (find_symbol_in_list): Add for xcoffread. + (start_symtab): Default typevector is empty. Keep reusing same + context_stack. + (end_symtab): Take objfile argument and pass it to + allocate_symtab. Don't make a symtab if no blocks or symbols. + Handle empty typevector. + (push_context): New function for context stack nesting. + (read_type): Mark FIXME where we need to reintroduce type smashing. + + * buildsym.h (pop_context): Macro, paired with push_context. + (subfile_stack): Move here from dbxread.c. + + * coffread.c (end_symtab, read_coff_symtab): Take and use objfile arg. + (read_coff_symtab): Cleanup by freeing objfile, not all symtabs. + + * mipsread.c (read_mips_symtab, parse_partial_symbols, parse_fdr, + new_psymtab, new_symtab): Take and use objfile arg. + + * dwarfread.c (scan_compilation_units, start_psymtab, + process_dies, end_symtab, dwarf_build_psymtabs, + read_lexical_block_scope, read_func_scope, read_file_scope): Take + and use objfile argument. + (psymtab_to_symtab_1, read_ofile_symtab): Don't take or use file + descriptor. Use BFD internal functions instead. + (end_symtab): Call global allocate_symtab. + + * elfread.c, target.c: Minor changes to accommodate objfiles. + * symtab.h: partial_symbol_table has no symfile_name member now. + (fn_fieldlists voffset): avoid non-int bitfield. + (struct symtab): Add objfile * and objfile_chain * of symtabs. + (struct partial_symtab): Add objfile * and objfile_chain * of + psymtabs. Remove symfile_name. + + * symmisc.c: Lose free_all_symtabs, free_all_psymtabs. + (printsyms_command): Rename from print_symtabs. Add selective + listing if 2nd argument given. Print objfile info. + (printpsyms_command): Rename from print_partial_symtabs. Ditto all. + (printobjfiles_command): New; prints objfiles lists, and checks + for consistency of symtab, psymtab, and objfile lists. + + * symfile.h, symfile.c, symtab.h: Lint + +Fri Nov 8 23:38:48 1991 John Gilmore (gnu at cygnus.com) + + * command.c: Include param.h. + * defs.h (warning_setup, warning): Declare. + * expprint.c (print_subexp, UNOP_MEMVAL case): Lint. + * inflow.c (new_tty): Use USE_O_NOCTTY #define. + * language.c, printcmd.c (print_scalar_formatted), signame.c, + stack.c: lint. + +Thu Nov 7 18:26:15 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * Makefile.in: link with libiberty after libreadline, since + readline might want something in libiberty. + * m88k-xdep.c: Fixed the register offsets in the ptrace_user + struct for BCS 88k machines. + * xm-m88k.h: don't define USIZE if already defined. + * configure.in: Added delta88 target. + +Thu Nov 7 04:51:19 1991 John Gilmore (gnu at cygnus.com) + + * am29k-pinsn.c, am29k-opcode.h: Fix decoding of mtacc, dmac, fmac. + + * tm-*.h: Remove READ_DBX_FORMAT, COFF_FORMAT, and + READ_MIPS_FORMAT, which have been unused since BFD. Still + remaining is COFF_NO_LONG_FILE_NAMES. + * tm-sun3.h, tm-altos.h: Remove detritus accidentally left from + function calling code moved to m68k-tdep.c. + +Wed Nov 6 17:21:59 1991 John Gilmore (gnu at cygnus.com) + + * coffread.c: Eliminate c_nsyms in favor of c_naux. + Complain if no auxents on .bf and .ef FCN symbols, and assume + lots of line numbers. + (init_linenos, enter_linenos): Use a sentinel at the end of the + read-in linenos, to make for a fast, safe loop-end test. + +Wed Nov 6 02:54:08 1991 Steve Chamberlain (sac at cygnus.com) + + * coffread.c (read_coff_symtab): coffread used to rely on the + x_sym.x_misc.x_lnsz.x_lnno field giving the # of linnos in a + function. Two of the formats I'm using (29k and 88k) don't seem to + set it. Ths patch to fcn_last_line and (enter_linenos) is an + attempt to use the actual size of the linno table in the file to set + the number of linenos to process. + +Tue Nov 5 22:47:46 1991 Steve Chamberlain (sac at cygnus.com) + + * Makefile.in: put a - infront of the mv y.tab.c c-exp.tab.c and + mv y.tab.c m2-exp.tab.c, so that if bison is used, and the files + are created in place, so the mv fails, then the make continues. + +Tue Nov 5 16:47:47 1991 Per Bothner (bothner at cygnus.com) + + Add C++ as a separate language. + * defs.h (enum language): Add language_cplus. + * dwarfread.c (end_symtab): Support language_cplus. + * c-exp.y: Add new struct language_defn cplus_language_defn. + Don't set c to be the default language (see main.c). + * c-exp.y (yylex): Only look for field of this if + language is C++. (First difference from C!) + * language.c: Add case branches for C++ (currently, all + the same as C). Also, add c++ to "usage" note for "set lang". + * valprint.c (typedef_print). Add case branches for C++. + * main.c (main): New way to set initial language: Look at + file extension of psymtab containing main(). (Same as we + do for symtabs, but avoid loading the symtab yet.) + * symtab.c: New routine find_main_psymtab(), used by main() + to set initial language. + * symfile.c (allocate_symtab): Move code for mapping file + extensions-> languages to new deduce_language_from_filename(). + + Fix a C++ problem when looking for methods in super-classes. + There was confusion between base and derived types. + * valops.c (value_fn_field): Change function interface. + * values.c: Use new value_fn_field interface. + +Mon Nov 4 10:49:33 1991 Per Bothner (bothner at cygnus.com) + + * infrun.c: Fixed typo in comment. + * utils.c: All the v*fprintf emulation is now in libiberty, + so we can get rid of some junk. + * xm-sun3os4.h, xm-sun4os4.h, xconfig/decstation, xconfig/i386sco, + xconfig/sun3os4, xconfig/sun4os4: Don`t need HAVE_STRSTR any more. + * m68k-pinsn.c (print_insn_arg): Support BB/BW/BL + type operands, as used by branch instructions. + * gmalloc.c: Fix prototype of memcpy. + * elfread.c: Comment out register_addr, since it conflicts + with the one in coredep.c. + * buildsym.h: Remove extern declarations of two functions + that are really static in buildsym.c. + * tm-mips.h: Add symbolic names for more registers. + * mips-xdep.c (store_inferior_registers): Use new register names. + * xm-mips.h: Simplify REGISTER_U_ADDR, since it is now + only used for core files, not ptrace. Therefore, + the KERNEL_U_ADDR hack is no longer needed. + The mapping to ptrace number is now in in mips-xdep.c. + * mips-xdep.c: Define REGISTER_PTRACE_ADDR (using the + mapping from the old REGISTER_U_ADDR), and use it + in {fetch,store}_inferior_registers. + * mipsread.c: Rename #include ecoff.h to new name coff-mips.h. + * mips-tdep.c (mips_push_dummy_frame, mips_pop_frame): + Save/restore FP regs correctly (?). + * dbxread.c: Remove duplicate define_symbol and type_synonym_name + (these had been previously moved to buildsym.c). + Hence, define_symbol becomes extern instead of static. + * buildsym.c (read_struct_type): Comment out bogus handling + of C++ operator methods. Minor hacking of reading of class + contexts. Make define_symbol non-static, so dbxread.c can call it. + +Fri Nov 1 11:05:47 1991 John Gilmore (gnu at cygnus.com) + + * mipsread.c (read_mips_symtab, read_the_mips_symtab): Use real + filename with error messages. + * stack.c (frame_select_command): Rename to select_frame_command + to avoid "fr" and "fra" having nonunique completions. + * symfile.c (sort_symtab_syms): Ignore sort of zero symtab *. + (symfile_init): Print file format name when unable to handle it. + (free_named_symtabs): Use BLOCKVECTOR rather than obsolete BLOCKLIST. + * symmisc.c (free_symtab): Only free linetable if nonzero. + * symtab.h: Remove obsolete BLOCKLIST macros. + +Thu Oct 31 18:12:43 1991 Stu Grossman (grossman at cygnus.com) + + * infrun.c (wait_for_inferior): another stepi/nexti fix. Ensure + that stop_step is 1 at bottom of main loop. I don't know why this + needs to be done, but it helps me sleep better at night. + +Sun Oct 27 18:18:39 1991 Stu Grossman (grossman at cygnus.com) + + * main.c (initialize_history): Read history after reading all + init files. + +Sun Oct 27 14:09:25 1991 John Gilmore (gnu at cygnus.com) + + * buildsym.c: Break out initial malloc sizes. + (record_line): Record directly in a subfile. Alloc on demand. + (compare_line_numbers): Add from xcoffread.c. + (end_symtab): New params say whether to sort pendings and + linetable. Patch block stabs if defined. Shrink linetable before + allocating the symtab. + * buildsym.h: Delete line_vector* and prev_line_number. Add + global_stabs and file_stabs for xcoffread. + * dbxread.c (start_subfile): Move to buildsym. Change above calls. + * symtab.h: LINETABLE(symtab) can now be null. Zap LINELIST. + * symmisc.c, symtab.c: Cope with null LINETABLEs. + + * blockframe.c: Pass fromleaf to INIT_EXTRA_FRAME_INFO. + * tm-29k.h, tm-88k.h, tm-i960.h, tm-irix3.h, tm-mips.h, tm-pyr.h, + tm-sparc.h: Accept fromleaf parameter. + * c-exp.y (yyerror): Pass error message if given. + * configure.in: Add rs6000 host and target. + * inflow.c (new_tty): O_NOCTTY kludge for RS/6000. + * symfile.h (entry_point): Add. + +Sat Oct 26 00:16:32 1991 John Gilmore (gnu at cygus.com) + + * buildsym.c: New file. Breaks out symbol-table-building routines + from dbxread.c, so they can be shared with xcoffread.c. + * buildsym.h: New file. Declarations for buildsym.c users. + * dbxread.c: Remove large chunks into buildsym.c. + * Makefile.in: Add buildsym.c and buildsym.h. + + * symfile.c (syms_from_bfd): New routine. + (add_symbol_file): Call it to do the real work. + (syms_from_bfd): Initialize entry_point before calling symfile_init. + * symtab.h, symfile.c, coffread.c, mipsread.c, dwarfread.c: + Avoid declaring or setting entry_point (symfile.h & symfile.c cope). + +Fri Oct 25 10:58:16 1991 Mark Eichin (eichin at cygnus.com) + + * cplus-dem.c (cplus-demangle): added support for templates, static + data, and the new (correct) mangling for destructors. + + * dwarfread.c: (dwarfwarn): created a varargs version of + dwarfwarn, for non __STDC__ compilers. + + * c-exp.y: (yylex): added match for "template" token. + (typebase): added TEMPLATE name '<' type '>' clause, for explicit + specification of template types. + + * symtab.c: (lookup_template_type): new function for finding + templates in symbol table. + (type_name_no_tag): changed to explicitly check for s/u/e at the + beginning of the symbol - if it is a template, none of these will + be there (but the name will still contain spaces.) + +Fri Oct 25 18:59:32 1991 Per Bothner (bothner at cygnus.com) + + Various fixes to improve g++ debugging. + * symtab.h: Add is_const and is_volatile flags for each method. + These are bit fields - take their space from voffset, + which shrinks to 30 bits. Since voffset is now a bitfield, + make it unsigned for portability. This changes its interpretation + slightly: Static methods now have voffset 1 instead of -1, + and virtual offsets start at 2, not 1. + * symtab.c: Renamed gdb_mangle_typename to gdb_mangle_name, + since it now returns an entire magled method name, not just + the type part. This avoids some duplication. + It also allows us to correctly mangle const and volatile + methods (using the new is_const and is_volatile bit fields + mentioned above). + * valprint.c (type_print_base), values.c (check_stub_method): + Simplify by using new gdb_mangle_name. + * values.c (value_headof): Fix to correctly handle single + inheritance (actually two fixes, either of which suffices). + * dbxread.c (read_struct_type): Handle const and volatile + method specifiers. + * dbxread.c (read_struct_type): Yet one more place where + we must handle '\\' continuations. + * valprint.c (vtbl_ptr_name): Add final '\0'. + +Fri Oct 25 16:06:38 1991 Stu Grossman (grossman at cygnus.com) + + * tm-sparc.h, tm-68k.h (EXTRACT_RETURN_VALUE): fix output of + short return values for sparc and 68k. Patch from Paul Eggert. + + * coffread.c, coredep.c, i386-xdep.c: install patches for + SysV/386 3.2 from Mauro DePalma. + +Fri Oct 25 02:02:13 1991 John Gilmore (gnu at cygnus.com) + + * core.c (core_file_info), exec.c (exec_file_info): Print file + type. Use printf_filtered. + + * valops.c (value_fetch_lazy): Avoid 0-length fetches. + +Thu Oct 24 23:06:40 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread.c: Add casts to remove compiler warnings. + + * tm-3b1.h, tm-68k.h, tm-altos.h, tm-amix.h, tm-hp300bsd.h, + tm-hp300hpux.h, tm-isi.h, tm-news.h, tm-pn.h, tm-sun2.h, + tm-sun3.h: Remove locally duplicated code for calling functions + in the inferior. The only differences were in the specific trap + vectors used and whether or not an fpu was present. These are + now handled by appropriate definitions of BPT_VECTOR and + HAVE_68881 respectively. Other minor obvious cleanups. + + * valops.c: Correct a minor misspelling. + + * utils.c: Remove local BSD/USG hacks that are now in libiberty. + + * dwarfread.c: Remove prototype for dwarfwarn. Does not work + with <varargs.h>. + +Thu Oct 24 09:33:44 1991 John Gilmore (gnu at cygnus.com) + + * stack.c (frame_command): Always print. Use new + frame_select_command to select a frame without printing. + + * dwarfread.c: Use <varargs.h>, since <stdarg.h> is not portable. + +Thu Oct 24 01:32:51 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread.c: New file for DWARF debugging format support. + + * elfread.c: New file for ELF object file format support. + + * procfs.c: New file for SVR4 /proc (process file system) support. + + * tm-amix.h, xm-amix.h, tconfig/amix, xconfig/amix: New files for + Amiga UNIX support. + + * xm-svr4.h, tm-svr4.h: New files for SVR4 support. + + * xm-m68k.h: New file for host machines with m68k cpu. + + * Makefile.in: Add elfread.c and dwarfread.c to SFILES_MAINDIR. + Add elfread.o and dwarfread.o to OBS. + + * symfile.h: Add "elf" to list of supported formats in comment. + + * c-exp.y, defs.h, symtab.h, valprint.c: Add three new builtin + types to gdb, builtin_type_long_double, builtin_type_complex, and + builtin_type_double_complex. Add and use new TARGET_SHORT_BIT, + TARGET_INT_BIT, TARGET_LONG_BIT, TARGET_FLOAT_BIT, + TARGET_DOUBLE_BIT, TARGET_LONG_DOUBLE_BIT, TARGET_COMPLEX_BIT, and + TARGET_DOUBLE_COMPLEX_BIT, as the sizes in bits of the indicated + types on the target machine (ala the existing TARGET_LONG_LONG_BIT). + + * infrun.c: When using SVR4 /proc interface instead of ptrace(), + call proc_set_exec_trap() to setup child to stop at first instruction. + + * inftarg.c: When using SVR4 /proc interface, call proc_wait() + rather than wait(). + + * m68k-tdep.c: Add new routines supply_gregset(), fill_gregset(), + supply_fpregset(), and fill_fpregset(), which are machine + dependent support routines for SVR4 /proc interface. + + * utils.c: Add warning_setup() and warning(). Warning() behaves + the same as error() except that it returns normally rather than + jumping back to command level. Modules that don't want to call + warning() for some reason, but want to produce their own warnings, + can call warning_setup() to ensure compatibility with the way + warning() and error() deal with the terminal. + + * symtab.c: Make internal errors produce more useful messages. + + * tm-68k.h: Move code that is duplicated in almost every single + m68k based machine's configuration files to this common file. + Duplications in the configuration files still need to be removed + (FIXME). + + * infrun.c (child_create_inferior): System V versions must call + setpgrp() with no arguments, to comply with prototyping typically + in <unistd.h>. + + * munch: Add support for SVR4 style nm output. + + * dbxread.c, mipsread.c symmisc.c, symtab.c: Remove the object + file specific fields from the partial symbol table structure and + replace them with a pointer to private data for each different + flavor of object file reader to initialize appropriately. + +Wed Oct 23 09:38:20 1991 John Gilmore (gnu at cygnus.com) + + * xconfig/sun[34]os4: Add note about strstr botch on sunos4.0.3c + and previous. + + * mipsread.c (fixup_undef_type): New function. If a struct / + union / enum is defined in a header file but nowhere else used, + (by typedefing, pointer referencing or declaration) the mipsread code + builds the complete tree for the structure but leaves its code as + TYPE_CODE_UNDEF as it doesn't know what kind of aggregate it is. + Guess its type based on the details of the members. + +Tue Oct 22 18:04:32 1991 Stu Grossman (grossman at cygnus.com) + + * infrun.c (wait_for_inferior): Check return value from + find_pc_line. + +Mon Oct 21 17:47:03 1991 Stu Grossman (grossman at cygnus.com) + + * infrun.c (wait_for_inferior): fix stepi/nexti that was broken + by my last edit to this routine. + +Mon Oct 21 14:27:43 1991 John Gilmore (gnu at cygnus.com) + + * tm-sun3.h (FIX_CALL_DUMMY): problem with cross debugging. + FIX_CALL_DUMMY does unaligned accesses and/or forgets to byte swap + the values before putting them into the dummy code. (From Peter + Schauer) + +Mon Oct 21 10:04:39 1991 Steve Chamberlain (steve at rtl.cygnus.com) + + * configure.in: added ebmon target. + +Wed Oct 16 22:49:58 1991 John Gilmore (gnu at cygnus.com) + + GDB-4.2 release! + + * Makefile.in: Roll VERSION to 4.2. + * README, TODO, WHATS.NEW: Update. + + * core.c (core_open): Improve error message for bad file. + Pass .reg virtual memory address to fetch_core_registers to help + it find the registers in the core-file header. + * coredep.c (fetch_core_registers): Take new argument, use it, + and pass it to register_addr to locate the block of registers. + * xm-mips.h: Update KERNEL_U_ADDR for new scheme. Cleanup a bit. + + * dbxread.c (read_dbx_symtab, process_one_symbol): Handle + Sequent N_FN_SEQ like everybody else's N_FN. + + * main.c: Circumvent SCO cc bug with #if !!defined(USG). + * tm-i386v.h: #endif guck. + * xconfig/i386*: Remove -Dgetpagesize()=4096 kludge. + * xconfig/i386sco: Add HAVE_STRSTR to avoid ANSI bdeath. + * xconfig/tahoe: Add REGEX, which seems to be missing. + + * coredep.c: Add <sys/types.h> for SCOnix. + * dbxread.c (read_dbx_symntab): Avoid coredump on malformed file. + * printcmd.c (print_formatted): Flush output before disassembly. + +Tue Oct 15 20:12:32 1991 Roland H. Pesch (pesch at fowanton.cygnus.com) + + * doc/refcard.tex (sec "Working Files"): consistent metavars and + other improvements, due to comments by François Pinard + (pinard@iro.umontreal.ca) + + * doc/gdb.texinfo (appendix "Installing GDB"): changes in + configure, and improvenets related to Pinard's refcard comments + +Tue Oct 15 08:45:12 1991 John Gilmore (gnu at cygnus.com) + + Changes from Fred Fish: + * tm-68k.h (FPI_REGNUM): Add. + * infrun.c (child_create_inferior): flush stdout and stderr + before forking. + * configure.in: Handle amigados, amix hosts and targets. + * inflow.c: Handle TIOCGLTC_BROKEN for Amiga. + + From Andreas Schwab: + * values.c (show_convenience): Use printf_filtered. + * main.c (define_command): Check result of lookup_command for + exact match. + (echo_command): Use printf_filtered, and force output out. + + * dbxread.c (read_enum_type): Avoid Modula-2 kludge that breaks C + programs. + * i387-tdep.c (double_to_i387): Fix typo for double_to_ieee_extended. + * utils.c (_initialize_utils): If !ISATTY, don't paginate. + * configure.in, tconfig/decstation, xconfig/decstation: Rename + dec3100 to decstation. + +Mon Oct 14 13:37:50 1991 Roland H. Pesch (pesch at cygnus.com) + + * doc/gdb.texinfo: Catch up to changes recorded here in ChangeLog + (nodes Continuing and Stepping; Memory; Targets) clarifications + due to Larry Breed + +Fri Oct 11 23:27:06 1991 John Gilmore (gnu at cygnus.com) + + * tm-{irix3,mips,nindy960,pn,symmetry,vx960}.h: Move + REGISTER_U_ADDR to corresponding xm- file. Sugg. by Peter Schauer. + + * symmisc.c (print_partial_symtabs): Add printpsyms debug cmd. + + * m68k-tdep.c (m68k_push_dummy_frame, m68k_pop_frame): Add + generic routines for calling inferior functions. + + * blockframe.c (inside_main_scope, inside_entry_scope): New. + + * copying.awk: Filter formfeeds out of copying & warrantee. + Make them available as `show copying' and `show warrantee' also. + * main.c (print_gnu_advertisement): Advt `show' commands. + +Thu Oct 10 17:25:47 1991 John Gilmore (gnu at cygnus.com) + + * mach386-xdep.c: Even when cross-compiling, leave in the + core-file reading code. + * core.c (get_core_registers): Avoid coredump if no .reg section. + +Wed Oct 9 17:03:34 1991 John Gilmore (gnu at cygnus.com) + + * mipsread.c, coffread.c: initialise TYPE_VPTR_FIELDNO to -1. + This avoids coredumps under `set print object on' in value_headof + (called erroneously by value_from_vtable_info) for `p &struct' + or `p *struct'. From Peter Schauer. + +Mon Oct 7 00:06:52 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Roll version to 4.1.2. + * dbxread.c: Use aout64.h, not a.out.gnu.h. Get external symbol entry + size from BFD (but, FIXME, we don't yet read external nlists's and + convert them to internal nlists's before handling them -- we still + assume they have the same size and alignment.) Use SET_NAMESTRING + everywhere useful. + * exec.c (exec_file_command): Move dead coff-encapsulation code + to BFD. + * m88k-tdep.c, m88k-xdep.c: Remove encap test and #inc <a.out.h>. + +Fri Oct 4 22:30:06 1991 John Gilmore (gnu at cygnus.com) + + * configure.in, tm-i386v.h, xm-i386v.h: Intel 386 Mach host port. + * xm-i386mach.h, mach386-xdep.c, xconfig/i386mach: New files. + +Fri Oct 4 17:04:31 1991 Per Bothner (bothner at cygnus.com) + + More patches from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>: + * mips-xdep.c (store_inferior_registers): Don't try to + write the (pseudo) FP. + * mipsread.c (parse_partial_symbols): Improved algorithm for + setting pst->texthigh. + +Fri Oct 4 16:47:32 1991 Roland H. Pesch (pesch at cygnus.com) + + * doc/Makefile: make TEXINPUTS include . everywhere + +Fri Oct 4 00:35:56 1991 John Gilmore (gnu at cygnus.com) + + * coffread.c, dbxread.c, symfile.c, symmisc.c, symtab.h: Remove + vestiges of typevectors, which were for symsegs and are no longer + used. (From a question by Eliot Dresselhaus + <dresselh@RFT30.nas.nasa.gov>). + +Thu Oct 3 09:33:26 1991 John Gilmore (gnu at cygnus.com) + + * dbxread.c, coffread.c: static-ize functions that were + gratuitiously external. (From Fred Fish.) + + * c-exp.y: sym->class to SYMBOL_CLASS (sym). + + * dbxread.c (dbx_lookup_type): Keep doubling size of typevector + until it is large enough. + + * dbxread.c (read_type): Handle error case slightly better. + Make complaint message not C++-specific. + +Wed Oct 2 17:21:07 1991 Stu Grossman (grossman at cygnus.com) + + * infrun.c (wait_for_inferior): Fix step/next so that you only + stop at the beginning of a new line. This fixes various problems + with for loops, nested if-else's and switch statements. + +Tue Oct 1 06:33:55 1991 John Gilmore (gnu at cygnus.com) + + * symtab.c (lookup_symtab_1, lookup_symbol): "fatal" errors + between symtabs and psymtabs become ordinary error()s. + + * dbxread.c (read_dbx_symtab): Relocate end_of_text_addr + properly, making "end pc" correct in shared lib psymtabs. + (From Guy Harris <guy@auspex.com>.) + +Mon Sep 30 13:15:31 1991 John Gilmore (gnu at cygnus.com) + + * dbxread.c: Enable, but soften, const_vol_complaint. + (read_dbx_symtab): N_STSYM and N_LCSYM define static vars. + Ditto Gould N_NBSTS and N_NBLCS. Also, all types in the psymtab + should be file-scope, not global. + (read_struct_type): Remove ancient multiple-inheritance warning. + (read_range_type): Check base type, complain & patch if undefined. + * stack.c (frame_info): Demangle the function name in `info stack'. + (From Peter Schauer) + +Sat Sep 28 10:02:33 1991 John Gilmore (gnu at cygnus.com) + + * eval.c (evaluate_subexp_for_address): Don't use + TYPE_POINTER_TYPE directly (it might be zero if this type has + never had a pointer created before); use lookup_pointer_type. + * symtab.c (lookup_method_type): Arguments were swapped in all + callers, so fix it here. I'm amazed this worked at all! + +Fri Sep 27 18:09:31 1991 John Gilmore (gnu at cygnus.com) + + * c-exp.y, m2-exp.y: Define more yysymbols that happen to be + "bss" rather than "data" symbols, but which still conflict. + * m2-exp.y: Lint. + + * coffread.c (coff_symfile_read): Use xmalloc, not malloc. + * core.c (core_files_info): Shorten output. + * exec.c (exec_files_info): Ditto. + (build_section_table): Ignore zero-length sections. + * language.c, printcmd.c: Lint. + * language.h (get_frame_language): Declare. + * saber.suppress: update. + * stack.c (find_relative_frame): Remove complex code that was + #if 0'd, stick with simple code. Lint. + * saber.suppress: Update a bit. + * symfile.c (add_symbol_file_command): Add "?" to question. + * utils.c (parse_escape): Avoid \a due to bdead compilers. + * value.h: Declare typedef_print. + + * valprint.c (val_print, type_print_base): TYPE_CODE_RANGE less + kludgey. + + * nindy-tdep.c (nindy_frame_chain_valid): Use lookup_misc_func. + (Reported by Mark Peek <mark@imagen.com>.) + + * solib.c (solib_map_sections): Relocate all sections, even + though only the text section's size is tracked. Mark ld_text + for eventual elimination as we generalize to N sections. + + * infrun.c (wait_for_inferior): Don't check if the PC is in a + call_dummy if we were stopped by a random signal that is being + passed to the program. This produced wierd results when calling + functions in the inferior and signals (e.g. SIGALRM) were in use. + +Tue Sep 24 18:05:30 1991 John Gilmore (gnu at cygnus.com) + + * infrun.c (IN_SIGTRAMP): Not parenthesized properly. + Bugfix from Paul Eggert <eggert@twinsun.com>. + * tm-ultra3.h (IN_SIGTRAMP): Ditto. + * valprint.c (print_floating): Print 9 digits for IEEE floats. + From Paul Eggert. + +Mon Sep 23 15:50:07 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Roll VERSION to 4.1.1. + * source.c (line_info): Peter Schauer fixes a bug I introduced in + hex conversion. + +Fri Sep 20 16:10:52 1991 John Gilmore (gnu at cygnus.com) + + GDB-4.1 release! + + * Makefile.in (VERSION): Set to 4.1. + * language.c (set_language_command): Print useful help message, + and restore the language string after giving help. + * valprint.c (typedef_print): Print typedef in C or M2. + * symtab.c (list_symbols): Use it. + * main.c (main): Avoid any output before (gdb) prompt when -q. + * language.c (set_language_command): Handle errors by restoring + the language string to its current state (fix from A. Beers). + * doc/gdbint.texinfo: Roll in information from README. Rearrange + "how to install" and "how to print the doc" stuff so it drops + easier into README. + * configure.in: Rename rtpc CPU to romp to match config.sub. + * README, WHATS.NEW, TODO: Update for gdb-4.1. + +Fri Sep 20 17:39:14 1991 Roland H. Pesch (pesch at cygnus.com) + + * doc/gdb.texinfo: Updates from ChangeLog. set/show write, + autoloading shared libs, copyright etc on GDB startup, clean up $_ + and $__ index refs, set/show listsize and related updates to list + cmd. New host/target configs. + +Fri Sep 20 15:46:00 1991 Roland H. Pesch (pesch at cygnus.com) + + * doc/Makefile: generate aux version-no file doc/gdbVN.m4 + from main Makefile.in version definition + doc/gdb.texinfo: use version recorded in doc/gdbVN.m4 for current + GDB version no refs + Makefile.in (setup-to-dist): generate doc/gdbVN.m4 + + * doc/gdb.texinfo: merge new language-switching and lang-specific + doc by Andrew Beers + +Fri Sep 20 15:00:57 1991 Per Bothner (bothner at cygnus.com) + + * mcheck.c: Add __ONEFILE kludge to allow compilation by non-ANSI + compilers (which may lack stddef.h). + +Fri Sep 20 13:29:42 1991 John Gilmore (gnu at cygnus.com) + + * dbxread.c (read_dbx_symtab, process_one_symbol): N_FN and + N_WARNING are the same except for the N_EXT bit, so just use their + values alone, rather than OR-ing them with N_EXT. + +Fri Sep 20 12:27:55 1991 Stu Grossman (grossman at cygnus.com) + + * mipsread.c (parse_lines): Deal with negative extended line + offsets correctly. + + * c-exp.y, m2-exp.y: #define yyerrflag and yynerrs to avoid + global symbol conflicts. + +Fri Sep 20 02:28:15 1991 John Gilmore (gnu at cygnus.com) + + * .gdbinit: Move 'set complaints' to top, so it runs even in + case we aren't debugging GDB. + * language.c (_initialize_language): Fix type check and range + check documentation strings. + * utils.c (!HAVE_VPRINTF): Define vfprintf as a function, so + language.c can use it. (Though language.c should really not be + handling warnings/errors the way it does, FIXME.) + * symtab.c (lookup_primitive_type): const lint. + + Bugfix from Peter Schauer: + * source.c (lines_to_list): Make signed, to avoid comparison + going unsigned and complaining that -3 is too high for 21 lines. + * stack.c (lines_to_list): Ditto. + +Thu Sep 19 23:33:41 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in (HFILES): Add minimon.h. + (VERSION): Roll version number to 4.0.95. + (gdb.tar.Z, make-proto-gdb.dir, setup-to-dist, gdb-XXX.tar.Z): + New rules for building distributions. Normal distribution + is built by doing `make -f Makefile.in gdb.tar.Z' in the directory + one level up from here; it calls make-proto-gdb.dir to build a + directory `proto-gdb' which is an image of the release. The old + `gdb.tar.Z' rule still works too. + * config.sub, configure: Roll in latest from .. + +Thu Sep 19 17:41:24 1991 Roland H. Pesch (pesch at cygnus.com) + + * doc/gdbint.texinfo: Reorder contents; reorganize new-host, + new-target, and new-config chapters; fix minor typos; come closer + to usual GNU markup conventions for @file @samp @code @var. + +Thu Sep 19 17:04:12 1991 Per Bothner (bothner at cygnus.com) + + Patches from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>: + * mipsread.c (parse_partial_symbols): Enter the name of all + structs/unions... into the psymtab so we can access them if the + symtab is not read in. + * mips-tdep.c: Remove some unneeded #includes. + * xconfig/dec3100: Add HAVE_STRSTR. + +Thu Sep 19 15:14:23 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Circumvent Sun Make bug on *-exp.tab.o. + * c-exp.y, m2-exp.y: Lint. + * m2-exp.y: Avoid using yytname[] which is a Bison-ism. + * valprint.c (val_print_fields): Check for stub type. + * mipsread.c (_initialize_mipsread): Avoid using + builtin_type_void at initialize time. + (mipscoff_symfile_read): use it now. + +Wed Sep 18 15:55:51 1991 John Gilmore (gnu at cygnus.com) + + Merge multiple-language support, and partial Modula-2 support, + from Andrew Beers <beers@cs.buffalo.edu>. + + * i387-tdep.c: New file, consolidates most 80387 support, + and eliminates host dependency on double<->extended conversions. + * i386-xdep.c, symm-xdep.c: Remove most 387 support. + * xconfig/i386{sco,v,v-g,v32,v32-g}: Now need i387-tdep.o. + + * symfile.c (allocate_symtab): New fn, consolidates the work + of allocating and initializing a new struct symtab. Set the + language of the symtab based on its filename extension. + * symfile.h: Declare it. + * mipsread.c (new_symtab): Use it. Minor formatting changes. + * dbxread.c (end_symtab): Use it. + + * mipsread.c (parse_symbol, case stParam and stProc): Add #if 0'd + code for saving types of parameters with each function definition. + * dbxread.c (define_symbol, function and parameter cases): Ditto. + (read_dbx_symtab, case N_DEFD): Ignore. + (read_enum_type): Recognize FALSE/TRUE enum as Modula-2 BOOLEAN. + (read_range_type): Rename MAX_OF_TYPE to MAX_OF_C_TYPE, etc. + #if 0 out its uses, though, since they set a dead value. + * coffread.c (end_symtab): Use allocate_symtab. + (process_coff_symbol): #if 0'd for functions and params as above. + (read_enum_type): Recognize Modula-2 BOOLEAN. + * symtab.c (add_param_to_type): #if 0'd function to add a + parameter type to a function type's field list. + + * defs.h (local_hex_format, local_hex_string, *_custom): Add. + * i386-xdep.c, pyr-tdep.c, pyr-xdep.c, remote-vx.c, solib.c, + source.c, symfile.c, dbxread.c, breakpoint.c, core.c, exec.c, + i387-tdep.c, infcmd.c, mips-tdep.c, stack.c, printcmd.c: Output + hex with local_hex_string for Modula-2 support. + + * breakpoint.c (breakpoint_cond_eval): Use new value_true to test + breakpoint condition language-independently. + + * parse.c: New file with the common code remains of expread.y. + * parser-defs.h: New file with common declarations from expread.y. + * c-exp.y: New file with the C parser from expread.y, and other + language-specific information. + * m2-exp.y: New file with the Modula-2 parser and etc. + * expread.y, expread.tab.c: Remove. + * breakpoint.c, eval.c, printcmd.c, expression.h: Use + parse_expression and parse_exp_1 rather than parse_c_expression + and parse_c_1. + + * symtab.h (enum languages): Move to defs.h. + (enum type_code): Add TYPE_CODE_CHAR and TYPE_CODE_BOOL. + Declare Modula-2 builtin types. + Add MAX_OF_TYPE and MIN_OF_TYPE macros. + + * symtab.c (_initialize_symtab): Remove builtin type + definition and initialization to *-exp.y. + (lookup_primitive_typename): Use language-dependent vector. + (lookup_typename): Fix bug, make it work if primitive typename. + (lookup_unsigned_typename): Call above. + (create_array_type): Set up range type for array index. + (list_symbols): Call typedef_print to print typedefs. + + * values.c (unpack_long, value_from_longest): Handle + TYPE_CODE_BOOL and TYPE_CODE_CHAR. + + * expression.h (enum exp_opcode): Add Modula-2 specific opcodes. + * expprint.c: Look up expression opcodes in language-specific + table, based on expression's language. Handle some Modula-2 + specific opcodes. + + * stack.c (frame_info): Print language of stack frame. + (select_frame): Also select language, if in auto-mode. + (get_frame_language): New subroutine. + * main.c (execute_command): Warn as language changes automatically. + + * printcmd.c (ptype_command): Parse types using the language + parser, both for language-independence, and so that scopes can + be specified. + + * language.h, language.c: New files for language-specific macros, + declarations, and definitions. + + Misc fixes: + + * main.c (main): If error() is called during early + initialization, print its message and then exit(1) from GDB. + + * valprint.c (type_print_base): Avoid printing garbage for ints + of unusual sizes. + (_initialize_valprint): Warn about host/target size assumption; + improve long long support slightly. + + * convex-tdep.c (comm_registers_info): Avoid parsing decimal and + hex -- let parse_and_eval_address do it. + + * doc/gdbint.texinfo (Languages): Doc how to add a language. + + * Makefile.in: Cope with new files and removed files. + +Tue Sep 17 08:37:41 1991 John Gilmore (gnu at cygint.cygnus.com) + + Add Andrew Beers' changes for Modula-2 support. His ChangeLog + entries are enclosed herein. Not all of these changes + have been merged into the master GDB sources -- check the + ChangeLog above here for the merge log. + +Mon Jun 3 17:05:45 EDT 1991 + + m2-exp.y Created. Tested outside of GDB for a few days. Proper + operators were added, C specific operators and tokens + removed. yylex() revamped to some extent. Still things + missing from the grammar, such as sets. + Tested for two weeks in GDB v3.5. + +Tue Jun 11 17:23:48 EDT 1991 + + m2-exp.y Added boolean constants TRUE and FALSE to the grammar + so they are built-in. Sort of a hack. + +Fri Jun 14 12:53:51 EDT 1991 + + m2-exp.y Added range checking for numeric constants. Any numeric + constant is assumed to be of builtin type INTEGER unless: + (1) it is octal or hexadecimal, in which case it is a + CARDINAL; (2) it is too big to fit into an INTEGER, in + which case it is a CARDINAL. + eval.c Added simple range checking for +, -, and * on integers. + Doesn't work very well for *, since 6 * 1,000,000,000 = + 1,705,032,704, which fails the simple test of result >= + first_operand, no matter in what order the operands are. + +Tue Jun 18 14:11:30 EDT 1991 + + Broke the parser into parts, one containing the C grammar and the other + containing code to be shared by all of the grammars. + + The following files no longer exist: + + expread.y + expread.tab.c + + The following files were added: + + c-exp.y (The C grammar) + m2-exp.y (The Modula-2 grammar) + parser-code.c (Code that is shared by the above grammar) + parser-code.h + parser-defs.h + + Makefile.dist Changed to reflect the above dependencies. NOTE: It is + now necessary to use the Bison compiler compiler, since it + will generate function/variable prefixes other than yy. + +Tue Jun 18 16:47:49 EDT 1991 + + symtab.[ch] Added the external variable working_lang, than holds the + value of the current working language. + Added the ennumerated type language_mode, with the values + language_auto and language_manual, the former meaning that + GDB sets working_lang as needed, and the latter meaning + that the value of working_lang is totally under user + control. + symtab.[ch] Added the Modula-2 pervasive types INTEGER, CARDINAL, + REAL, BOOLEAN and CHAR. Also added the type codes + TYPE_CODE_BOOL and TYPE_CODE_CHAR. + utils.c Added set_language_command and show_language_command to + implement the GDB support commands "set language" and + "show language". + expression.h A number of identifiers were added to the type exp_opcode + to facilitate Modula-2 builtin functions, integer + division, and array indexing. + +Wed Jun 19 13:25:58 EDT 1991 + + language.h Added the macro STRICT_TYPE, which evaluates to non-zero + if the language specified by working_lang requires the use + of strict typing of expressions. Eventually, even this + will be able to be changed by the user. + Added the macro RANGE_CHECK, which evaluates to non-zero + if the language specified by working_lang requires the + checking of a value against the domain of its type. + Eventually, even this will be able to be changed by the + user. + language.[ch] Predicates involving types (simple_type, ordered_type, + same_type, integral_type, numeric_type, character_type, + boolean_type, float_type) are added. These predicates are + based on the current value of working_lang, and are handy + in type-checking. + +Wed Jun 19 15:39:34 EDT 1991 + + eval.c Added the function type_array_rank which computes the rank + of an array type. + valarith.c Added the funtion value_bool, which when given a integer + value.h value (ie. struct value *) as an argument, it returns a + boolean value (ie. struct value *) true if that integer + is non-zero, and a boolean value false otherwise. + valprint.c Added cases for TYPE_CODE_BOOL, so Modula-2 BOOLEAN values + will print out properly. + +Wed Jun 19 16:36:34 EDT 1991 + + valops.c Added the function value_capitalize, which returns it + value.h argument capitalized if its argument is a lowercase + letter, or the argument unchanged if its argument is not a + letter. + valarith.c Added the function range_check_p, which returns non-zero + value.h if its value argument is between the integral bounds upper + and lower. + Added the function range_check_enum_p, which makes sure + that its value argument is a valid member of the domain of + its type argument. + Added the function range_check_range_p, which makes sure + its value argument lies between the upper and lower bounds + of its type argument, which must be a ranged type. + Added the function check_array_index, which range and type + checks an index of an array. + Added the function value_multi_subscript, which computes + array[idx1,idx2...idxN], given a value array and an array + of values representing indicies. + values.c Changed value_from_long to work with TYPE_CODE_CHAR and + unpack_long to work with TYPE_CODE_BOOL and + TYPE_CODE_CHAR. + +Wed Jun 19 18:04:08 EDT 1991 + + symtab.c Stored pervasive types in a structure and make + lookup_pervasive_type() a lookup function that was based + on working_lang. If lookup_pervasive_type() returned + non-zero, then that value was returned (a fix, since + before it simply wouldn't return the pervasive type.) + language.h Added the macro CAST_IS_CONVERSION, which evaluates to + non-zero if the language specified by working_lang means + "conversion" when it says "cast". + valops.c Added the function value_real_cast(), which performs a + value.h *cast*, not a *conversion*, which is what value_cast() + does when it can. In particular, + value_cast(<float_type>,4) = 4.0, while + value_real_cast(<float_type>,4) = some mess. + eval.c Modula-2 builtin functions implemented: ABS, CAP, CHR, + parser-code.c FLOAT, HIGH, MAX, MIN, ODD, ORD, TRUNC, and VAL. + expression.h Added macros MAX_OF_TYPE and MIN_OF_TYPE to work with MAX + and MIN on integral types. *NOTE*: These are currently + hardcoded to work only if there are 8 bits per storage + unit. FIXME. + eval.c Made logical functions call value_bool to return a + properly typed boolean value, based on working_lang. + +Thu Jun 20 11:55:27 EDT 1991 + + valprint.c Types now print out in a Modula-2 fashion. This works for + the cases when the type is printed out step-by-step, that + is, it doesn't work when the name of a structured type + (which includes the keyword "struct", etc.) is simply + displayed. + FIXME: Perhaps this is bad. Parts of it seem to kludgey, + since type specifications in C and Modula-2 are very + different. The C printing of a type is very recursive, + whereas in Modula-2 it is generally very simple. C has + type prefixes and suffixes, which have no real analogue in + Modula-2. Maybe type_print() should call a language + specific type printer. This is also advantageous if we + compile GDB to exclude some of the languages. We'll just + leave those functions out. + +Thu Jun 20 16:57:10 EDT 1991 + + dbxread.c When reading the complete symbol table in (via + psymtab_to_symtab()), the number and types of function + arguments are added to a function type. define_symbol() + calls add_param_to_type() to accomplish this. + Assumption: when we come across a function definition + (N_FUN symbol with an 'f' or 'F' in the name), its + arguments will appear before another function definition. + When a function is found, a pointer to its type is placed + in the global in_function_type. Changes that + add_param_to_type() makes are to this global. + valprint.c The type of a function now includes (for Modula-2) the + types of its parameters. + eval.c Type checking and a check for the proper number of + arguments is now done for function calls. Not sure of the + impact this has on C++ member function yet. + +Thu Jun 20 19:58:48 EDT 1991 + + valprint.c Rewrote the type printer. Broke it into two language + specific parts, adding the functions type_print_m2() and + type_print_m2_1(). + An unfortunate consequence is this: if you debugging a C + program in Modula-2 mode (why?), info types does not work + well with regular expressions, since the types are printed + out in Modula-2 terminology, but stored in C terminology. + language.[ch] Added the functions new_type_last(), type_keyword(), and + type_sep() to aid in the printing of typedefs. + symtab.c Made the printing of typedefs as language independent as + possible through calls to new_type_last(), type_keyword(), + and type_sep(). + +Fri Jun 21 11:50:26 EDT 1991 + + dbxread.c Check all incoming ennumerated types. If it looks like + Modula-2's BOOLEAN type, then change the type_code of the + type to TYPE_CODE_BOOL so we can process it as a boolean + variable. + valprint.c Replaced some of the 0x%x with calls to sprintf and + hexformat() in val_print(). + language.[ch] Added the function hex_to_string(), which converts its + integral argument to a hexadecimal number (format is + language based) and returns the result as a string. + +Mon Jun 24 12:25:07 EDT 1991 + + valprint.c Some functions call type_print_1() directly, instead of + value.h using type_print(), so they can specify where (column) to + print things. Since type_print() takes care of language + dependence, that needs to be called first. Added a + parameter depth to type_print() (so it is now like + type_print_1). Changed type_print to type_print_at, and + made type_print a macro that passes a depth argument of + zero. + symmisc.c Changed all calls to type_print_1 to calls to + type_print_at. + Makefile.dist Made it possible to build GDB for a specific set of + depend languages. Do this by passing a definition for the macro + LANGS to make. LANGS should be a string containing a + space-separated list of language names (ie. LANGS="c m2"). + The default is to build all languages. Note that grammar + files must follow the naming convention of <lang>-exp.y. + gdb.lang This holds the current value of the LANGS macro. It is + examined every time make is called, and is updated if + necessary. + eval.c Added #ifdef _LANG_<lang> to these files. + expread.c Still need to add them to dbxread.c and coffread.c. + main.c + source.c + symtab.c + utils.c + valarith.c + valprint.c + +Mon Jun 24 16:33:11 EDT 1991 + + language.[ch] Added the functions hexformat_pre() and + hex_to_string_pre(), which take a prefix argument to + include in the format string. Thus, hexformat_pre("08") will + return "0x08x" (if the working language is language_c). + Made hexformat() and hex_to_string() calls to the above + with "" as the prefix argument. + + am29k-pinsn.c, arm-pinsn.c, breakpoint.c, convex-tdep.c, exec.c, core.c, + dbxread.c, i386-pinsn.c, i386-stub.c, i386-xdep.c, i960-pinsn.c, + infcmd.c, inflow.c, m68k-pinsn.c, m68k-stub.c, m88k-pinsn.c, + mips-pinsn.c, mips-tdep.c, ns32k-pinsn.c, printcmd.c, pyr-pinsn.c, + pyr-tdep.c, pyr-xdep.c, remote-vx.c, remote.c, solib.c, source.c, + stack.c, sun386-xdep.c, symfile.c, symm-xdep.c, symmisc.c, tahoe-pinsn.c, + valprint.c, vax-pinsn.c + + Changed all occurences of 0x%[0-9]*l*x in printf format strings to + calls to hexformat() and hex_to_string(). Format strings without + the leading "0x" were ignored. + + depend Updated to take the above into account. + + +Tue Jun 25 15:27:18 EDT 1991 + + symtab.h Added the types range_mode_t, range_check_t, type_mode_t, + and type_check_t to keep track of the current state of + range and type checking. + main.c Added the variables range_mode, range_check, type_mode, + and type_check to record the current state of range and + type checking. Added initialization code to main(). + language.h Changed the macros STRICT_TYPE and RANGE_CHECK to examine + the above variables. + + +Tue Jun 25 17:57:08 EDT 1991 + + dbxread.c process_one_symbol() updates the variable (enum language) + source_lang based on the extension of the filename + contained in the N_SO sybmol that started this symtab. + When end_symtab() is called, the value of source_lang is + put into the language field. + stack.c select_frame() sets working_lang (and possibly type_check + and range_check) to the language field of the symtab + associated with the frame that is selected if working_mode + is language_auto. If working_mode is language_manual, a + warning is printed and working_lang is not set. + language.c Added the function set_type_range(), which sets the value of + type_check and range_check (if their modes call for + automatic setting) based on the current value of + working_lang. A non-zero argument will cause the current + settings to be output. + + +Wed Jun 26 14:51:40 EDT 1991 + + eval.c Added range checks on assignment. + m2-exp.y Added the grammar for sets to the language. Currently, + these do not do anything except print an error message. + +Wed Jun 26 17:01:04 EDT 1991 + + m2-exp.y Added the ability for parse_number() to parse negative + numbers. A global flag is set upon encountering a unary + minus. This was done to make, for example, 1 parse as a + CARDINAL, and not as an integer, per Wirth's examples in + Programming in Modula-2 ed.4. + valprint.c Added support for "set radix 2" by then setting + output_format to 't'. + eval.c Implemented range checking on subrange types. Added calls + to range_check_range_p for BINOP_ASSIGN and BINOP_VAL. + Implemented MIN and MAX for ennumerated types. The + minimum value of an ennumerated type is defined by Wirth + as the first identifier, and the maximum as the last. + m2-exp.y Made octal numbers ending with "B" be characters and those + ending with "C" be numbers, per Wirth's book. (p. 34) + +Thu Jun 27 14:11:52 EDT 1991 + + stack.c select_frame() now only sets working_lang, it does not + notify the user. If working_mode is language_manual, then + a warning is issued once. + main.c At the end of each call to execute_command(), working_lang + is checked against the local static (enum language) + current. If they differ and working_mode is + language_auto, the new settings of language, type and + range checking are printed out. + stack.c Modified frame_info() to include the language of the + current frame in the output of "info frame". + language.[ch] Added the function language_str() which returns the name + of the current language. + +Fri Jun 28 15:33:14 EDT 1991 + + m2-exp.y Added the built-in procedures INC, INCL, DEC, and DECL to + the language. INCL and DECL currently cause an error, + since sets are not implemented yet. INC and DEC are + implemented as PREINCREMENT/PREDECREMENT with one + argument, and as ASSIGN_MODIFY with two arguments. + eval.c Added type checking to the above cases. + value.h Added not_lval_constant to the lval_type ennumerated type. + not_lval_constant means that the value is a constant + value; that is 3 or 'a' or TRUE, not as in a constant + identifier. This is used to help coerce numbers such as 3 + to either signed or unsigned numbers. + valops.c Added the function value_coerce_constants() which coerces + constant integers as following: if one is a constant and + the other is not, the constant's type is set to the type + of the other argument. If both are constants and one is + signed, the other is converted to a signed constant. + +Sat Jun 29 17:26:29 EDT 1991 + + valarith.c Added a better range checker. It now checks range + (successfully) on integral operations [+-] (signed and + unsigned) for any C sized type. Still does not work well + for multiplication.) + int_in_size() returns an integer that is coerced to fit into + specified number of bytes. + +Mon Jul 1 13:04:14 EDT 1991 + + language.[ch] Added the function binop_result_type(), which returns the + builtin (struct type *) type that would be the result of a + binop on the two values V1 and V2. + +Wed Jul 3 19:22:53 EDT 1991 + + source.c Extended source_info() to include the source language in + the output from "info source". + +Fri Jul 5 13:48:52 EDT 1991 + + utils.c Moved the support functions for the GDB set/show commands + dealing with language into language.c. + language.c Added the function language_info(), which displays info + about the current working language, type and range check + settings. Called via the GDB command "info language". + Added an initialization routine _initialize_language(), + that sets defaults for the language, type and range + variables and sets up the new GDB commands. + main.c Language setup moved to language.c. + depend Rebuilt. + +Mon Jul 8 10:10:22 EDT 1991 + + valarith.c Debugged the range checker for arithmetic. Still does not + work for multiplication very well. + +Mon Jul 8 12:40:37 EDT 1991 + + language.[ch] Added the function value_true() which returns non-zero if + its argument represents a boolean true value. + breakpoint.c Changed breakpoint_cond_eval() to call value_true() to + check the truth of an expression. + +Thu Jul 11 12:51:34 EDT 1991 + + language.[ch] Added the predicate structured_type(), which returns + non-zero if the argument is a structured type. + Added the predicate pointer_type(), which returns non-zero + if the argument is a pointer type. + eval.c Added the ability to do addition and substraction on + pointers and integers. This case simply bypasses the + type checker. + +Thu Jul 11 14:41:42 EDT 1991 + + include/stab.def + Added the symbol N_DEFD (0x4a) which is a definition + module dependency that is used by the GNU Modula-2 + compiler and the linker. It is not important to GDB, + except that [dbx|coff|mips]read.c should ignore these + symbols. + +Fri Jul 12 16:07:00 EDT 1991 + + valprint.c Changed the TYPE_LENGTH(type) >= 0 to TYPE_LENGTH(type) > + 0 in val_print(). Also added statements to the else part + to coerce type (argument to val_print) to a pointer type + if it is an "array of unspecified length". + valops.c Added the function value_m2_string(), which returns a + (value) value which is a constant string, whose type is + (ARRAY [0..n] OF CHAR). The length field of the type + structure is set to zero, so it will be interpreted as an + "array of unspecified length". + stack.c Moved the language/frame mismatch check to + main.c:execute_command(). + main.c The working language is recorded each time + execute_command() is executed. If working lang has + changed during its execution, then the new + language/type/range info is printed out for the user. If + the working language does not match the language of the + frame, a warning is issued. + +Sat Jul 13 16:16:39 EDT 1991 + + eval.c Moved all the type-checking stuff for operators to + language.[ch] language.c. This is so we can keep language-specific + stuff (like for what type operators are defined) in + language.c. + language.[ch] Added the function binop_type_check(), which checks to see + if its two (value) arguments are type-compatible with its + opcode argument. The opcode should represent an operation + involving an operator. Also added the macro function + unop_type_check, which calls binop_type_check with a + NULL second argument. + expprint.c Added Modula-2 operators to the op_print_tab, so info + expression.h break works correctly. Also added "op_string", which + returns the string corresponding to the (enum exp_opcode) + opcode that is its argument. + + +Sat Jul 13 18:26:18 EDT 1991 + + coffread.c Added code to record the type of function arguments with + each paricular function. Code is very similar to that + added to dbxread.c. + dbxread.c Moved add_param_to_type() to symtab.c + symtab.[ch] Added function add_param_to_type() from dbxread.c + + *** NOTE: The above additions have not been tested. + +Mon Jul 15 12:50:47 EDT 1991 + + langauge.[ch] Added the functions type_error and range_error, which work + like error() except if the type/range mode is set to + *_mode_warn, then they do not do a return_to_top_level(), + but merely print a warning. + Also changed [set|show]_[type|range]_command() to support + the new "warn" feature. + +Thu Jul 18 17:50:54 EDT 1991 + + mipsread.c Added code to record the type of function arguments with + each particular function. Code is very similar to that + added to dbxread.c. + + *** NOTE: The above additions have not been tested. + +Fri Jul 19 11:19:10 EDT 1991 + + defs.h Added macros MAX_OF_SIZE, MIN_OF_SIZE, UMAX_OF_SIZE, and + UMIN_OF_SIZE, which when given a size of a numeric type, + return the maximum and minimum value it can hold. UMAX... + and UMIN... return the result for unsigned types. + symtab.h Added the macros MAX_OF_TYPE and MIN_OF_TYPE to operate on + struct types. They call above macros. + dbxread.c Renamed the MAX and MIN_OF_TYPE macros to ..._OF_CTYPE to + avoid a name conlict with the above. + c-exp.y Added range checking on numeric constants in + parse_number() for completeness. + valarith.c Made binop_user_defined_p() and unop_user_defined_p() + return 0 if working_lang is not language_c. + +Thu Aug 8 14:17:22 EDT 1991 + + main.c + printcmd.c + breakpoint.c Documentation strings of some commands changed to + eliminate the references to the C language where + appropriate. + +Tue Aug 13 15:48:03 EDT 1991 + + m2-exp.y Added qualified identifiers to the grammar. The semantics + are slightly different from those of the GDB operator :: + c-exp.y + m2-exp.y Added a rule to each grammar of the form: start ::= exp | + type_exp, where type_exp is any valid type expression. + expression.h + eval.c Added the opcode OP_TYPE, and an error case in eval.c. + printcmd.c Modified ptype_command() so it actually parses the input + (necessary for type expressions with scope qualifiers). + Added the function ptype_eval() which expects an + expression composed of one OP_TYPE element. + *.[ch] Replaced all occurences of parse_c_expression with + parse_expression + *.[ch] Replaced all occurences of parse_c_1 with parse_exp_1 + +[End of ChangeLog entries from Andrew Beers for Modula-2 support.] + +Mon Sep 16 17:19:46 1991 John Gilmore (gnu at cygnus.com) + + Small fixes from Peter Schauer: + + * infrun.c (child_attach): Lint. + * solib.c (find_solib): Handle shared libs version 2. + + Small fixes from David Wood: + + * xm-ultra3.h (SYS_SIGLIST_MISSING): Typo. + + Small fixes: + + * remote-vx.c: Move <stdio.h> to top, for FILE. Fix from + John S <basrai%kanga.dnet@c3po.sm-alc.af.mil>. + + * utils.c (wrap_here): Avoid wrap action of fputs_filtered if + chars_per_line is at maximum (user typed `set width 0'). Fix + from Andreas Schwab <schwab@ls5.informatik.uni-dortmund.de>. + +Tue Sep 17 17:31:04 1991 Stu Grossman (grossman at cygnus.com) + + * coredep.c: include ptrace.h where necessary. + * mipsread.c(parse_lines): fix unsigned char problem that was + messing up line numbers on SGI's and possibly other MIPS based + platforms. + * infrun.c (child_create_inferior): use better test to check + return val from setpgrp(). + * tm-irix3.h, xm-irix3.h, tconfig/irix3, xconfig/irix3: add these + for sgi/irix support. + +Wed Sep 18 04:33:31 1991 Per Bothner (bothner at cygnus.com) + + * mipsread.c (parse_symbol): Put non-static procedures + in the global block. + +Fri Sep 13 00:14:52 1991 John Gilmore (gnu at cygnus.com) + + Patch together `text_start' and `text_end' for 29K port. + + * exec.c (exec_command): If NEED_TEXT_START_END, define the + variables and set them based on the exec file. + * am29k-tdep.c: declare text_start. + * valops.c (call_function_by_hand): declare text_end. + + * inferior.h: Eliminate CANNOT_EXECUTE_STACK in favor of + defining CALL_DUMMY_LOCATION as BEFORE_TEXT_END. This is + because machines that do this will also have to know to + set NEED_TEXT_START_END. Besides, it was a redundant way to + say the same thing. + * tm-29k.h, tm-convex.h, tm-np1.h: Eliminate + CANNOT_EXECUTE_STACK, define CALL_DUMMY_LOCATION and + NEED_TEXT_START_END. + +Thu Sep 12 00:22:24 1991 John Gilmore (gnu at cygint.cygnus.com) + + AMD 29000 changes from David Wood <wood@david.ultra.nyu.edu>: + + * Makefile.in (CLIBS): Put XM_CLIBS and TM_CLIBS at end. + Pass MUNCH_DEFINE to munch whenever we run it. + * am29k-pinsn.c (print_insn): Handle NOP specially. Avoid %#x + format string; use 0x%x instead. + * am29k-tdep.c: Use DUMMY_SAVE_GREGS and RETURN_REGNUM. + * ultra-xdep.c, xm-ultra.h: New files for Ultracomputer host system. + * xm-rtbsd.h: New host support for RT/PC running BSD Unix. + * inflow.c: Handle `short' process group IDs. + * infptrace.c (fetch_register): Support CANNOT_FETCH_REGISTER, + and check for ptrace errors. + * coffread.c (SDB_REG_TO_REGNUM): Define if not already. + (coff_symfile_init): Initialize text_bfd_scnum. + (read_coff_symtab): Use it to find the text [and absolute?] sections. + * ../config.sub: Add vendor nyu and os "sym[1-9]*". + * configure.in: Add hosts rtpc-*-* and a29k-*-*. + Merge target arm case with other "easy" cases. Add target + cases a29k-*-none (rehack of am29k), a29k-*-kern (remote to + Ultracomputer kernel), and a29k-*-sym1 (ultracomputer OS's user + process). + * minimon.h, remote-adapt.c, remote-mm.c: Add. + * munch: Cope with RT/PC putting fns in data segment. + Restore ability to override `nm' by specifying MUNCH_NM. + * xconfig/rtbsd, xconfig/ultra3: New host systems. + * tconfig/a29k: Rename from tconfig/am29k. Add remote-mm + and remote-adapt. Remove encapsulated coff #define's (the + support should go in BFD, and gdb shouldn't know or care). + * tconfig/a29k-kern: Same, but for remote kernel debugging. + * tconfig/ultra3: For debugging user processes on Ultra3/Sym1. + * tm-29k.h: Update BADMAG (though it should go away). + Allow the register definitions to be overridden in another + tm-file. Fix SR_REGNUM. Add a mess of _REGNUM's. Separate + RETURN_REGNUM from GR96_REGNUM and DUMMY_SAVE_GREGS from + DUMMY_SAVE_GR96, for handling kernel calling conventions + that use GR64+ rather than GR96+. + * tm-ultra3.h: New file, for use on Ultra3 Unix as well as for + remote debugging of Ultra3 kernel. Includes tm-29k.h and + overrides various things. + + * remote-mm.c (mm_attach, mm_wait): Handle attach like + child_attach does, making a clean stop in the newly attached + program. + * remote-eb.c: Lint. + + * coffread.c: Make coffread independent of any particular + variant of COFF. Avoid #include-ing any particular one except + internalcoff.h. BFD now passes key values for symbol reading + as part of its coff_data structure (LINESZ, SYMESZ, AUXESZ, + and the symbol masks and shifts); use them. + Remove obsolete end_of_text_addr. + + * exec.c: Remove unused include files. + +Wed Sep 11 19:38:44 1991 John Gilmore (gnu at cygint.cygnus.com) + + * Makefile.in (documentation targets): Pass $(M4). + Bugfix from eggert@twinsun.com (Paul Eggert). + + * stack.c (down_silently_command): Check for stack existence. + +Tue Sep 10 23:08:29 1991 John Gilmore (gnu at cygint.cygnus.com) + + * Makefile.in (VERSION): Update to 4.0.3. + +Tue Sep 10 09:19:29 1991 John Gilmore (gnu at cygint.cygnus.com) + + * core.c (core_file_command): Print frame at coredump with + its level number, by calling print_stack_frame. + * frame.h: Add selected_frame_level, print_stack_frame. + * frame.h, stack.c: Remove print_sel_frame, print_selected_frame. + * convex-tdep.c, convex-xdep.c, infcmd.c, inflow.c, infrun.c: + Change print_sel_frame and print_selected_frame callers to + print_stack_frame. + + * dbxread.c (read_ofile_symtab): Avoid empty else clause. + * symfile.c (free_named_symtabs): Ditto. + * main.c (main): wrap_here needs an arg. + * solib.c (find_solib): Avoid memory access if _DYNAMIC is zero. + (solib_add): Avoid noise. + (solib_create_inferior_hook): Lint. + (sharedlibrary_command): Move dont_repeat to here. + * utils.c (error): Call wrap_here to force buffered output. + + Small patches from Peter Schauer: + + * coffread.c (start_symtab): Free any existing line_vector before + malloc-ing new one. + (read_coff_symtab): Ditto for type_vector. + + * source.c (lines_to_list): New variable, replacing function. + (all uses): Use as variable. + (_initialize_source): Add 'set listsize' and 'show listsize'. + * utils.c (lines_to_list): Remove function. + * stack.c (print_frame_info): Use as variable. + * defs.h (lines_to_list): Remove declaration. + +Mon Sep 9 13:45:57 1991 John Gilmore (gnu at cygint.cygnus.com) + + * breakpoint.c (insert_breakpoints): Restore warning about + the program might be running in another process, but only for + systems with this brain death (#ifdef ONE_PROCESS_WRITETEXT). + * xm-hp300bsd.h, xm-mips.h, xm-vax.h: Define it. + + * utils.c (error): if error_pre_print is set, print the string + first. + * main.c (main, print_gnu_advertisement, print_gdb_version): + Reformat legalese so it always prints, but acts as an "I'm here" + message while symbols are being read. If any errors occur, + print a few newlines to set off the message and start it at the + left margin. Remove mention of "help" command, and don't yak + about symbol reading. + (catch_errors): Error string is now printed first in case of + error, not last. + * command.c (undef_cmd_error, lookup_cmd): On undefined command, + suggest the "help" command. + + * Makefile.in (VERSION): Set to 4.0.2. + +Thu Sep 5 23:49:48 1991 John Gilmore (gnu at cygint.cygnus.com) + + * .gdbinit: Remove useless "rr" command. Set complaints + to 1 for people debugging gdb. + + * breakpoint.c, remote-vx.c: Reword strings printed by + catch_errors callers. + +Wed Sep 4 11:07:50 1991 John Gilmore (gnu at cygint.cygnus.com) + + * WHATS.NEW: "history write -> history save". Doc "write on/off". + (Fix from kenc@viewlogic.com.) + + Fix some infrastructure to be able to cope with host and target + machines with different sized basic types (ints, ptrs, etc). + (Idea from pierre@la.tce.com (Pierre Willard).) + + * values.c (value_from_longest): Rename from value_from_long. + Handle pointer types as well as integers, so that targets with + different pointer sizes from the host can be accomodated. + * breakpoint.c, convex-tdep.c, eval.c, expprint.c, printcmd.c, + valarith.c, valops.c, valprint.c, value.h, values.c: Rename + uses of value_from_long to value_from_longest. + * eval.c, findvar.c, printcmd.c, valarith.c, valops.c: Pass + the correct pointer type to value_from_long{est}. + + * doc/gdb.texinfo ($_, $__): Describe types of these variables. + + * remote-vx.c: Remove obsolete code for calling functions via + vxworks kludge interface (it referenced value_from_long). + + * valops.c (value_string): Find malloc with lookup_misc_func, not + raw search. + +Tue Sep 3 18:37:46 1991 John Gilmore (gnu at cygint.cygnus.com) + + Make writing to files work properly. (Fixes to BFD are also needed.) + + * core.c (core_open): Open file ourselves, read or r/w, depending on + write_files. Use bfd_fdopenr. + * gdbcore.h (write_files): New variable. + * exec.c (write_files): Define variable, add set&show for it. + (exec_file_command): Use write_files to open for read or r/write. + + Make shared library reading happen automatically. These changes + are mostly from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>. + + * inferior.h (stop_soon_quietly): Add to exported variables. + * infrun.c (child_create_inferior): call solib hook, if defined. + (child_attach): call solib hook, if defined. + * solib.c: Include inferior.h. Add from_tty to so_list as kludge. + (find_solib): Use lookup_misc_func rather than hand-rolled. + (symbol_add_stub): New stub for catch_errors. + (solib_add): Avoid output if !from_tty. Catch errors rather + than just calling symbol_file_add and bombing. + (solib_create_inferior_hook): Interface with the target process + to let it read and alloc shared libs, then figure out what it did. + + * core.c (validate_files): Fix typo, soften warning. + (Fix from Hiroto Kagotani <kagotani@cs.titech.ac.jp>.) + + * utils.c (fputs_demangled): Avoid duplicate printing if + demangling is off. (Fix from J.T. Conklin <jtc@cayenne.com>.) + + * infrun.c (proceed): Cast -1 to (CORE_ADDR) before comparing. + (Fix from pierre@la.tce.com (Pierre Willard).) + + * main.c (catch_errors): Change argument to a char * from an int, + since a char * can point to a struct full of glop, but an int + is not guaranteed to be able to hold a pointer. + * breakpoint.c (breakpoint_cond_eval, bpstat_stop_status, + breakpoint_re_set_one, breakpoint_re_set): Adapt. + * core.c (core_open, solib_add_stub): Adapt. + * remote-vx.c (symbol_stub, add_symbol_stub, callers): Adapt. + +Wed Aug 28 18:18:05 1991 John Gilmore (gnu at cygint.cygnus.com) + + * Makefile.in: Update VERSION to 4.0.1. Evade GNU Make bug + by adding .NOEXPORT target. + +Fri Aug 23 17:14:25 1991 John Gilmore (gnu at cygint.cygnus.com) + + * GDB-4.0 release! + * Update README. + * Makefile.in (VERSION): Roll to 4.0. + (gdb.tar.Z): Make refcard.ps as well, for shipment. + +Fri Aug 23 14:07:09 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * doc/gdb.texinfo: minor rewordings, crossref to ptype from print, + more on printsyms. + + * doc/Makefile, Makefile.in: generate "gdb-all.texi" rather than + "gdb-all.texinfo" + + * doc/rdl-apps.texi: renamed from rdl-apps.texinfo + + * Makefile.in, doc/Makefile, doc/gdb.texinfo: + reflect above name change + + * WHATS.NEW: correct pointer to refcard. + + * doc/gdb.texinfo: update New Features, Installing + + * doc/gdbint.texinfo: add short description of configure +template + +Fri Aug 23 11:46:08 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * doc/gdb.texinfo: update, fix bugs in "Installing" appendix + +Fri Aug 23 01:02:00 1991 John Gilmore (gnu at cygint.cygnus.com) + + * Makefile.in: Add config.sub, make doc/rdl-apps.texinfo for + tar file, add dependencies for referenced doc files. + +Thu Aug 22 22:17:06 1991 Stu Grossman (grossman at cygint.cygnus.com) + + * coffread.c, symfile.c, stack.c: saberized. + +Thu Aug 22 16:20:27 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * doc/refcard.tex: permuted Essential Commands sec + + * doc/gdb.texinfo: new C++ chapter; revised installation appendix; + new doc for + set/show symbol-reloading + default set complaints 0 + info all-registers + RET-repeat disabled after prompted long displays + processID (attach) interpretation of 2nd GDB cmdline arg + +Thu Aug 22 14:05:47 1991 Stu Grossman (grossman at cygint.cygnus.com) + + * expread.y, coffread.c, dbxread.c, target.c, mem-break.c, + cplus-dem.c, values.c, valprint.c, symfile.c, remote.c, + breakpoint.c, main.c: lint. + +Thu Aug 22 02:02:26 1991 John Gilmore (gnu at cygint.cygnus.com) + + Install new configuration scheme for GDB and friends. + + * config.sub: Translate ordinary names to three-part names. + * configure: Use three-part names internally. + * configure.in: Translate three-part names to filenames. + + * README, WHATS.NEW: Update for gdb-4.0. + * Makefile.in: Roll VERSION to 3.99. + +Wed Aug 21 18:21:09 1991 John Gilmore (gnu at cygint.cygnus.com) + + * infptrace.c (KERNEL_U_ADDR_BSD): Include a.out.gnu.h. + * i960-tdep.c, m68k-tdep.c, sparc-tdep.c, tm-i960.h, + tm-m68k.h, remote-nindy.c: Change ext_format_XXX structs + to single structures rather than arrays; when passing + their address, use &. This avoids trouble with bdead compilers. + * mcheck.c: Don't include <stdlib.h>; just declare "void abort();" + instead. This avoids portability headaches. + * mips-tdep.c (mips_do_registers_info): Only print FP regs if + asked to. + * source.c (open_source_file): Avoid ANSI const bdeath by + skipping declaration and then casting result value. + * tm-hp300bsd.h: Clarify comment. + * utils.c (strstr): Result is const char *; ANSI bdeath. + * xm-hp300bsd.h: Define HOST_BYTE_ORDER. Redefine INT_MIN, + since system include file defines it differently from "defs.h", + though the two are equivalent for our purposes. + * tconfig/hp300bsd: Add m68k-tdep.o. + +Tue Aug 20 16:01:11 1991 John Gilmore (gnu at cygint.cygnus.com) + + * tconfig/sun*4: Remove warnings about system assembler. + +Mon Aug 19 13:44:46 1991 John Gilmore (gnu at cygint.cygnus.com) + + * mcheck.c: Avoid warning about undeclared abort fn. + * tm-sparc.h (PC_ADJUST): Avoid calling error() from this; + it causes recursive calls to error() when used in cleanups. + To do so requires that we make it a function, so we do. + * sparc-tdep.c (sparc_pc_adjust): New implem of PC_ADJUST. + * utils.c (do_cleanups): Remove the current cleanup from the + chain *before* calling it, in case error() is called from it. + The result won't be pretty, but won't be an infinite loop either. + +Mon Aug 19 00:41:04 1991 Michael Tiemann (tiemann at cygint.cygnus.com) + + * dbxread.c (read_struct_type): Grok anon structs for C++. + (vb_name, vptr_name): Null terminate these strings. + +Fri Aug 16 08:31:03 1991 John Gilmore (gnu at cygint.cygnus.com) + + Minor bug fixes from BSD Net2 gdb: + + * blockframe.c (get_prev_frame_info): If FRAME_CHAIN_COMBINE + returns 0, there is no previous frame. + * breakpoint.c (commands_command): If !from_tty, don't call + input_from_terminal_p(). + * dbxread.c (record_misc_function): Speed up slightly. + (compare_psymbols): Ditto. + * infcmd.c (do_registers_info): Take a second argument to + determine whether to print float registers. "info registers" + does not do so anymore. "info all-registers" does, now. + * mips-tdep.c, pyr-tdep.c (xxx_do_registers_info): Take second + arg and ignore it. + * tm-mips.h, tm-pyr.h (DO_REGISTERS_INFO): Pass second arg. + * inflow.c (initialize_inflow): Set tflags_ours correctly. + + Other fixes: + + * breakpoint.c (bpstat_do_actions): Use a cleanup to restore + executing_breakpoint_commands if we are interrupted by error. + * coffread.c (init_lineno): Avoid problem with zero-sized linetab + versus malloc/free. From: john@labtam.labtam.oz.au (John Carey). + * core.c (solib_add_stub, core_open): Call SOLIB_ADD inside a + catch_errors() so we can setup the frame regardless of whether + the shared libs work. + * ieee-float.c (double_to_ieee_extended): Get exponent from + right place in little-endian systems. From John Carey. + +Thu Aug 15 18:43:57 1991 John Gilmore (gnu at cygint.cygnus.com) + + * main.c: Remove unused terminating_signals and catch_termination(). + (long_options): Terminate with a zero element. + [Bugfix from Atsuo Kawaguchi <atsuo@hark86.harl.hitachi.co.jp>.] + (gdb_readline): Make call-compatible with readline. + (init_signals): Improve comments re vfork vs. signal. + + * utils.c (prompt_for_continue): Use new gdb_readline(). + If we prompt for continuation, we don't let CR repeat the previous + command, once we get back to a prompt. It's too easy to keep + hitting CR, expecting "--more--" prompts, and have some long + command start repeating on you. + +Tue Aug 13 16:17:56 1991 John Gilmore (gnu at cygint.cygnus.com) + + * blockframe.c (frameless_look_for_prologue): Speed up by + calling SKIP_PROLOGUE_FRAMELESS_P if it's defined. + * tm-sparc.h (SKIP_PROLOGUE, SKIP_PROLOGUE_FRAMELESS_P): + Define two variants, one faster. + * sparc-tdep.c (sparc_frame_chain): Use target_read_memory + and return zero, rather than giving an error. + (setup_arbitrary_frame): Initialize the PC in the new frame. + (skip_prologue): Add a second arg saying whether we're just + checking for a frameless function or not. + + * core.c (core_open, core_close, core_xfer_memory): Move + section table pointers and bfd* into the target_ops. + (core_open): Allow errors in shared lib reading, etc. + (core_files_info): Describe shared library sections. + + * exec.c (exec_open, exec_close, exec_xfer_memory, xfer_memory, + exec_files_info, set_section_command): Move section table + pointers and bfd* into the target_ops. + (add_to_section_table): Add BFD to section table. + + * target.c (target_xfer_memory, target_info): Pass target to + xfer_memory and target_info functions. + * target.h: '' + + * gdbcore.h: Move struct section_table. + * target.h: New home of struct section_table. + + * solib.c (solib_add): New argument is the target_ops whose + section list is to be added to, if any. Reallocate the + sections in that target to add any that come from shared libs. + (throughout) so_sections renamed to sections. + (solib_xfer_memory): Deleted. + * tm-sunos.h (SOLIB_ADD): Add target argument. + (SOLIB_XFER_MEMORY): Delete. + + * core.c, exec.c, inftarg.c, remote-eb.c, remote-nindy.c, + remote-vx.c, remote.c, target.c, target.h: Remove add_syms vector + from target_ops. It's the same on all targets. Add two section + pointers to target_ops. + + * stack.c (find_relative_frame): Dump ancient algorithm for + "down", just use handy "next" pointers. + (frame_command): Don't error if there is no stack; let user + set one. + + * inflow.c (new_tty_prefork, new_tty): New prefork routine + modifies static state in the parent process; new_tty itself + runs in the child and modifies the child's file descriptors + to match the saved static state. + * infrun.c (child_create_inferior): Call new_tty_prefork, + fork, then new_tty. + + * infptrace.c (child_xfer_memory): Add ignored target arg. + * remote-eb.c (eb_xfer_inferior_memory): '' + * remote-nindy.c (nindy_xfer_inferior_memory): '' + * remote-vx.c (vx_xfer_memory): '' + * remote.c (remote_xfer_memory): ''. Rename from + remote_xfer_inferior_memory. + + * main.c (main): Only try to attach "corefile" argument if + it starts with a digit. + + * symfile.c (symbol_reloading): New "set/show" variable. + (symbol_file_add): Shorten message about symbol reading. + (add_symbol_file_command): Merge with add_syms_addr_command, + since this should work on all targets now. + (stop_whining): Default to zero, to shut up complaints + about bad symbol tables on many systems. + (free_named_symtabs): Just exit unless symbol_reloading. + + * xm-sun3os4.h, xm-sun4os4.h: Define BROKEN_LARGE_ALLOCA, + and add comment explaining shared library screw. + + * source.c: #if defined => #ifdef. + +Thu Aug 8 12:23:19 1991 John Gilmore (gnu at cygint.cygnus.com) + + * doc/gdbint.texinfo: Improve doc on porting to new OS's. + +Tue Aug 6 17:16:15 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * doc/rdl-apps.texinfo: provide default readline-appendix finder + (doc/Makefile knows how to make one for local config) + + * Makefile.in: use doc/Makefile for doc targets + + * doc/Makefile: GDB documentation now has its own Makefile + doc/refcard.tex: renamed from "gdbrc.tex" + doc/gdbint.texinfo: add markup in "Cleanups" chapter + + +Fri Aug 2 00:13:06 1991 John Gilmore (gnu at cygint.cygnus.com) + + * values.c (baseclass_addr): When reading target memory, use the + length of the basetype, not the upper type. We've only malloc'd + enough space for the basetype, leading to errors in free(). + + * expprint.c (print_subexp): Print UNOP_MEMVAL of an OP_LONG that + ends up as a function specially, since we know the actual type of + the pointed-to address. This (somewhat) fixes display of + expressions that include misc_function_vector names. Try `cond 1 + !strcmp("a","b")' then `i b'. + + * infrun.c: Move DO_DEFERRED_STORES from proceed() to resume(). + The child can be proceeded from inside wait_for_inferior in + evaluating breakpoint conditions, and DO_DEFERRED_STORES was + getting skipped in that case. + + * expprint.c (print_subexp): Use filtered output, since the + subroutines we call use it, otherwise the output is horribly + mangled, since output of wrappable stuff comes out late. + + * Makefile.in: Bump VERSION to 3.98.1 + + * infrun.c (child_create_process): Use execlp to find the + shell to exec our target program. This requires some fiddling + with `environ' since there is no execlpe(). + +Thu Aug 1 15:35:17 1991 Roland H. Pesch (pesch at fowanton.cygnus.com) + + * Makefile.in, doc/gdbrc.tex, doc/rc-* (new files): + Minor rearrangement of refcard permits two new make targets-- + gdbrc.dvi DVI output for refcard, using CM fonts + gdbrc.ps PostScript refcard, using PS fonts + +Wed Jul 31 16:46:21 1991 John Gilmore (gnu at cygint.cygnus.com) + + * GDB-3.98 release. + + * TODO, Projects, WHATS.NEW, README: Update for gdb-3.98. + * Makefile.in (gdb-all.texinfo): Avoid touching file if M4 dies. + +Wed Jul 31 16:35:58 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * doc/gdb.texinfo: last changes for release. + Minor typo and formatting fixes; incorporated most fixes remaining from + filed mail commenting on earlier drafts. + + Added warnings: pipes don't work in run command; + conditions are converse of assertions; + step over fn without debug info goes to next fn; + vars may have "wrong" values near fn entrance, exit + + Added example from Kingston on printing repeated nonadjacent values + + Added explicit mention that in Emacs gdb mode C-c and C-z are like + shell mode for signals + + Renamed "Stepping and Continuing" to "Continuing and Stepping" so it + doesn't sound so much like its parent "Stopping and Continuing"; also + moved entries on continue to top of section, so they don't get lost. + + Improved installation directions in appendix, added manual formatting + instructions + +Tue Jul 30 17:26:39 1991 John Gilmore (gnu at cygint.cygnus.com) + + * configure.in: Remove xm.h and tm.h even if we aren't linking + new ones, so "./configure sun4; ./configure none" does the right + thing. Assume that alldeps.mak and depend are already built in + srcdir, and avoid running "make" (particularly "make depend", + which involves "gcc") from inside configure. Build Makefile + directly rather than building Makefile.conf first. + * configure: Regenerate with above changes. + * Makefile.in: Use $(BISON) to find bison. Roll VERSION + to 3.98. Revise gdb.tar.Z procedure to produce a file + called gdb-$(VERSION).tar.Z but which unpacks into a + directory called "gdb". Move non-source files out of + $(SFILES_SUBDIR). Pretty up alldeps.mak with comments. + (depend): Don't try to do "gcc expread.y". + (expread.o): Update dependencies by hand. + +Mon Jul 29 15:21:09 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * doc/gdb.texinfo: + Fixed a variety of small typos that prevented info from formatting + cleanly; altered too-long heading for GPL Appendix, as discussed + w/RMS; Changed date on cover to July 91. + +Fri Jul 26 13:20:02 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * doc/gdb.texinfo: + (1) Applied some fixes due to comments from Larry Breed (easier ones + through chapsec 5.2) + (2) Eliminated use of @footnote---had my doubts about it anyways, and + it's broken in latest texinfo + (3) Introduced *some* use of [] for optional arguments, where + explanation is not simpler by listing cmd w arg and cmd w/out arg + separately. Still not using @deffn. + (4) Dropped in GPL-2. NOTE: one of GPL-2 or texinfo is broken; a + couple of headings are too long. Need patches to texinfo or revision + to GPL-2. + + * Partial update to README (which still needs work for this + release!): (1) use of configure corrected for new script, + (2) "make gdb.dvi" and "make gdb.info" mentioned. + +Wed Jul 24 06:44:02 1991 John Gilmore (gnu at cygint.cygnus.com) + + * symtab.c (lookup_symbol): Don't complain right off about + no debug symbols; use the misc function vector first. + (list_symbols): Use misc function vector to find symbols + that don't have debug info, and print them. + (find_pc_symtab): Temporarily avoid fatal() when psymtab + PC range doesn't match symtab PC range, as it does on the + MIPS because our symtab reading isn't perfect. + + * dbxread.c (dbx_symfile_read): Make warning about + "no debug symbols" slightly nicer. + + * source.c (select_source_symtab): If "main" symbol exists, + but decode_line_spec can't find line info, don't just return + a zero; try other source symtabs or give an error. + + * mipsread.c (parse_partial_symbols): Sort the psymtabs by + their low addresses first, then rip through fixing high addrs. + + * ns32k-opcode.h (sfsr): Bugfix from Rune Nerg}rd, + <runene@ifi.uio.no>. + (NS32K_SVC_IMMED_OPERANDS): Reverse the #ifndef. + +Tue Jul 23 18:52:43 1991 Roland H. Pesch (pesch at cygint.cygnus.com) + + * Minor, mostly mechanical, cleanup of doc subdir for clean + makeinfo'ing and TeXing; also ensured gdb-all.texinfo (post-m4) + and gdb.info (post- texinfo2 makeinfo) generated for distribution. + +Sun Jul 21 03:54:52 1991 John Gilmore (gnu at cygint.cygnus.com) + + Mostly MIPS and general symbol-reading fixups. + + * doc/gdbint.texinfo: Add documentation on symbol-reading + interface. + + * mipsread.c: Remove kludges around #include "ecoff.h". + Remove redefinitions of a_magic, etc, no longer used. + (parse_symbol, ): Convert "Internal:" printfs to complain()ts. + Fix global overview comments to match symfile.c protocol. + (mipscoff_new_init): Eliminate cur_hdr if we have one. + (mipscoff_symfile_read): Eliminate unused code. Avoid + sorting all the symtabs, when all we have read here is psymtabs. + The symtabs are sorted as they are created anyway. Tell + condense_misc_bunches whether we're mainline. + (psymtab_to_symtab_1): Pass filename when recursing, to make + stack trace more informative. + (parse_partial_symbols): Assume cur_hdr as argument. + (read_mips_symtab): Don't clobber cur_hdr, so it can be freed. + Pass cur_hdr implicitly to parse_partial_symbols. Avoid checking + the TYPE_NAME of char *, since that's done in symfile.c. + (free_numargs, parse_symbol, add_symbol, add_block, + shrink_linetable): Declare these fns void. + (upgrade_type): Convert tree of if's to switch. Clean up + bogus "off == 0" handling with a complaint. Avoid setting + field bitpos and bitsize of array with lower and upper bounds. + Check specified bitsize of elements against their actual type's + bitsize, and complain if different. Complain about unknown + type qualifiers. + (parse_fdr): Don't assume sizeof(char *) == sizeof (struct *). + (psymtab_to_symtab_1): Print names of subsidiary files that + are being read in. FIXME, we read far too many files. This code + is not the problem, the problem is in parse_fdr where the psymtabs + are set up. + (cross_ref): Result should indicate that we used one aux entry + normally, or two if we encountered a "next" entry. This used + to leave the caller pointing at the wrong aux entry. + (add_symbol): If overflowed cur_block, reallocate it larger, + chase all pointers to it, and complain(), rather than clobber memory. + (shrink_block): Use xrealloc rather than xmalloc-and-copy. + (new_field): Only allocate one field initially, not two. + Pull ++ out of macro argument. Simplify. + (_initialize_mipsread): Avoid initialization of importd + global_psymbols and static_psymbols. + + * symfile.c (psymtab_to_symtab): Depend on XXX_psymtab_to_symtab + to properly set pst->symtab; avoid searching for it. + (symfile_fns): Improve comments, add a FIXME. + * dbxread.c: Update comments to reflect symfile protocol. + (read_ofile_symtab, end_symtab): Return the symtab. + (psymtab_to_symtab_1): Set pst->symtab. + + * coffread.c (coff_symfile_read): tell condense_misc_bunches + whether we're mainline. + + * symfile.h (sym_fns): Remove unused sym_discard member. + * coffread.c, mipsread.c, dbxread.c: Remove XXX_symfile_discard. + + * mtrace.c (mtrace): Take effect if mallwatch is set, even if + the environment variable is not. + * infcmd.c (finish_command): Use filtered printfs. + * cplus-dem.c: Add struct tags to a few unnamed structs. + * valops.c (value_coerce_array): Improve comments. + * valprint.c (type_print_varspec_suffix): Print array size only + if greater than zero. + * m88k-tdep.c: Shift some lines left by one space, that had + apparently been trashed at some point. + * TODO: More things to do, a few got done. + +Thu Jul 18 22:46:05 1991 John Gilmore (gnu at cygint.cygnus.com) + + * symtab.h (LOC_EXTERNAL): Eliminate in favor of LOC_STATIC. + (ldsymoff, ldsymlen, globals_offset, statics_offset): Improve + comments. + * dbxread.c (read_dbx_symtab): LOC_EXTERNAL -> LOC_STATIC. + * expread.y, findvar.c, symmisc.c: Ditto. + * printcmd.c (address_info): Update printed forms of LOC_ + symbols. Elim LOC_EXTERNAL. + (print_frame_args): Keep track of param stack offsets before + re-looking up to find the local register param is kept in. + + * mipsread.c: Use <symconst.h> and <sym.h> rather than <syms.h>. + Further integration of mipsread into gdb. Eliminate unused + routines, duplicate declarations. Handle static symbols in + psymtabs as well as external symbols. When reading symtabs, + insert symbols into the correct block (global, static, or a local + block). + (read_mips_symtab, parse_partial_symbols): Don't pass useless + "incremental" arg. + (mipscoff_symfile_read): Don't call select_source_symtab. + (parse_symbol): Use SYMBOL_VALUE_ADDRESS where appropriate, + rather than SYMBOL_VALUE. + (parse_external): Comment clobbering of top_stack. + (parse_partial_symbols): Update comments. Allocate and parse + static symbols as well as external symbols. FIXME, enum values + are not handled in this pass, but should be. Inline new_psymbol. + Use SYMBOL_VALUE_ADDRESS. + (psymtab_to_symtab_1): Read symbols into global static block + by default (until enter some function's local block context). + (sort_blocks): Clean up STATIC_BLOCK as well as GLOBAL_BLOCK. + (destroy_all_symtabs, new_psymbol): Eliminate, unused. + + * source.c (select_source_symtab): Select a source symtab + from either the symtabs or, failing that, the psymtabs. + (list_command): Update error message. + (forward_search_command, reverse_search_command): Use getc, not + fgetc, for speed. FIXME, add comment about buffers that die if + overrun by long line. + + * values.c (unpack_field_as_long, modify_field): Avoid shifting + by an entire word, which is not portable, if we have a 32-bit + field. (Code in dbxread.c already turns such bitfields, if + aligned, into ordinary ints, but fixing this will help for other + symbol formats and for future changes.) + * core.c (core_open): Handle ANSI const brain death. + * utils.c (vprintf): Fix varargs typo. + +Sun Jul 14 00:42:53 1991 John Gilmore (gnu at cygint.cygnus.com) + + * findvar.c (find_var_value): Handle &function better. + * TODO: Document work needed on &fn and &array. + * printcmd.c (print_address_symbolic): New arg is the prefix + to print if a name is printed. + (print_address_demangle): Honor "set print address" now. + Use new arg above to improve spacing of output. + * valprint.c (val_print): When printing function pointers, + print symbolic form too. + * breakpoint.c (breakpoint_1): Use new print_address_symbolic. + +Mon Jul 8 19:02:46 1991 John Gilmore (gnu at cygint.cygnus.com) + + * core.c (memory_error): Reword error msg to mislead less. + + * mips-pinsn.c (print_insn_arg 'd'): Print $ with reg name. + + * mipsread.c (read_mips_symtab, read_the_mips_symtab, + parse_partial_symbols): Use newer BFD internals (external_filehdr + and external_aouthdr), byte-swap the fields that we care about + before using them, and make the file header data local to + read_the_mips_symtab rather than global. + +Sat Jul 6 01:34:15 1991 John Gilmore (gnu at cygint.cygnus.com) + + * ns32k-opcode.h (movmw, movmd): Fix opcodes. Bug fix + from Rune Nerg}rd <runene@ifi.uio.no> on 5 Jul 1991. + + * main.c (command_line_input): Flush stdout and stderr + before every call to readline. This reportedly fixes a bug + that comes up in Sys V running emacs-gdb and/or xxgdb, + when stdin/out are pipes or sockets. + +Thu Jul 4 14:47:06 1991 John Gilmore (gnu at cygint.cygnus.com) + + * configure.in, Makefile.in: Avoid rebuilding "depend" as much. + Avoid declaring Makefile dependencies, because GNU Make stupidly + tries to update it if we do. + + * coffread.c: Revise for minor changes to bfd internal coff + indexes. + + * configure: If -template= is given a relative path, make it + absolute before recurring in subdirectories. + + * configure, configure.in, Makefile.in: Install "configure" script + as replacement for config.gdb. + * config.gdb, Makefile.dist, Makefile.sdir: Remove + * README: Update for configure, mostly. FIXME. + + * Add dec3100 as equivalent to littlemips. Indicate in all host & + target config files that they are for the host. When the lines + get copied into the Makefile, this makes it more obvious what's + up. + +Mon Jun 24 23:49:07 1991 John Gilmore (gnu at cygint.cygnus.com) + + * sparc-opcode.h (trap opcodes): Avoid leading spaces or + tabs, which end up in the disassembler output inadvertently. + +Wed May 29 23:01:03 1991 John Gilmore (gnu at cygint.cygnus.com) + + Make it compile cleanly in an ANSI GCC2 environment. + + * blockframe.c: <stdio.h> + * cplus-dem.c: free takes a void *, ifdef __STDC__ + * dbxread.c (read_huge_number): avoid gcc2 bug hoisting calc of + LONG_MAX/radix. + * defs.h (alloca): Avoid doing anything if alloca already def'd. + * stddef.h, stdlib.h: Remove these files. + * symtab.c: Avoid declaring qsort, close. + * symfile.c: Avoid declaring close. + * utils.c (vprintf): Declare "ap" arg as proper va_alist. + * sparc-tdep.c: Avoid including lots of Sun-host-specific files. + + Assorted other changes. + * dbxread.c: include "libaout.h", not "liba.out.h". + * printcmd.c (print_frame_args): Set recurse properly for + indentation of struct and array parameters. + * valops.c (value_cast): Allow cast to void. + * infrun.c (resume): If NO_SINGLE_STEP, call machine dependent + single_step() in a target-independent fashion. + * sparc-tdep.c (single_step): Don't call ptrace ourselves, just + set up to be ready to continue. This makes us target independent. + * infptrace.c (child_resume): Remove call to single_step; now + can single step a SPARC target of any kind. + +Wed May 22 18:18:24 1991 Roland H. Pesch (pesch at fowanton.cygnus.com) + + * Makefile.dist, doc/gdb.texinfo, doc/*-m4.texinfo: split up GDB + docn into separate sections---basically chapters, plus two loose + pieces that can be configured to go in different places. This + allows GNU m4 to preprocess the manual without coredumping. + + * Makefile.dist: tell TeX where to find texinfo. + +Mon May 20 12:15:04 1991 Roland H. Pesch (pesch at fowanton.cygnus.com) + + * Makefile.dist, doc/gdb.texinfo: respectively create, and use, + the new target "rdl-apps.texinfo" which captures the Makefile + variable that records where to find the Readline libraries. + +Sun May 19 05:36:59 1991 John Gilmore (gnu at cygint.cygnus.com) + + * tahoe-pinsn.c: #include "tahoe-opcode.h", not "opcode.h". + * tm-tahoe.h (FIX_CALL_DUMMY): Ignore more parameters. + * defs.h (const, volatile): Only define if not already defined. + * Makefile.dist (gdb.tar.Z): Create doc subdir w/out CVS/RCS crud. + + * README: Update for release 3.95. + * config.gdb: Don't create readline dir in subdir builds. + * main.c: Include with "..." form for non-system include files, + so "gcc -MM" for "make depend" works. + Include readline files with "...h" rather than <readline/...h>. + * mipsread.c: Include "ecoff.h" rather than "intel-coff.h". + + * coffread.c: Undo minor damage done by Rich Pixley. Use + different internal and external representations of COFF + data structures. Use new BFD routines for swapping them in and + out. + * symfile.c (free_named_symtabs): Avoid freeing file names that + are null or empty. Old i960 tools seem to produce files that + claim to have empty names, causing each successive file read + to blow away the previous one. + * sparc-xdep.c (deferred_stores): Repair minor damage by Rich. + Move deferred_stores to top of file, but don't separate its + #define's from its variable. Add commentary. + * Makefile.dist: Fix Rich damage; undo "configure" changes in + favor of keeping the (working) config.gdb. Move readline + library up a notch. + +Fri May 17 12:49:56 1991 Per Bothner (via gnu at cygint.cygnus.com) + + * dbxread.c (read_struct_type): Try to handle g++ version 1 MI + debug info. + * infptrace.c (fetch_registers): no result, since now void. + * tconfig/news: target depends on m68k-tdep too. + +Fri May 17 14:40:14 1991 Roland H. Pesch (pesch at fowanton.cygnus.com) + + * Makefile.dist: added readline/inc-*.texinfo to dependencies for + gdb.dvi target + + * readline/inc-history.texinfo, readline/inc-readline.texinfo: + applied various small fixes due to or inspired by RMS comments + + * doc/gdb.texinfo: finished using all RMS comments, save those for + appendices on readline and cmd history (which are in other source + files) + +Thu May 16 18:06:05 1991 Roland H. Pesch (pesch at fowanton.cygnus.com) + + * doc/gdb.texinfo: (1) Updated w/ref to RMS comments through + chapter 9; (2) documented 'break' command's menu mode for + overloaded names, in response to hgs problem report C++ p-31 + +Wed May 15 11:02:48 1991 Roland H. Pesch (pesch at fowanton.cygnus.com) + + * doc/gdb.texinfo: (1) better introductory example; (2) more + consistent use of @code, @samp, @file, @kbd throughout; small + cleanups to first three nodes; (3) new "Contributors" node; + (4) Appendix, Renamed Commands; (5) divert specialized startup + instructions to "Targets" chapter for generic manuals, while + leaving them up front for manuals specific to specialized + environments; (6) apply fixes from RMS comments through chapter 4. + + * pretex.m4: modify explanatory text slightly (and redefine + "regexp") to keep GNU m4 from complaining. (It still crashes + later, but one step at a time...) + +Wed May 15 10:32:12 1991 John Gilmore (gnu at cygint.cygnus.com) + + * readline/readline.c (update_line): Avoid dereferencing a pointer + before comparing it to its bounds. Saber caught this. + (init_terminal_io): Don't set BC from the "pc=" termcap variable, + and only set PC if tgetstr returned non-null. Saber caught this. + +Tue May 14 16:29:53 PDT 1991 Roland Pesch (pesch at cygint.cygnus.com) + + * Makefile.dist: put gdb.dvi stuff (updated to use M4 preprocessor + stuff for config manual) here where it counts; updated + to use new subdir structure (gdb/doc/). + + * Makefile: generated from above via + config.gdb none + before checkin + + * gdbint.texinfo: added instructions on generating gdb.info* files + locally for release. These are ordinary info + files, formatted from gdb.texinfo (via gdb-all.texinfo, see + Makefile)---but due to use of texinfo 2, can't count on makeinfo + to generate these, so we distribute them already formatted. + + * gdb.texinfo: included full Info node and menu crud (as generated + by C-u M-x texinfo-master-menu using the texinfo-2 elisp code). + + * Makefile: updated "gdb.dvi" target to use M4 preprocessor; + put in comments-for-future gdb.info target (one day makeinfo will + work again). + +Tue May 14 13:51:36 PDT 1991 Roland Pesch (pesch at cygint.cygnus.com) + + * gdb.texinfo: Updated to include new or old undocumented + commands, at least the following (perhaps some others I forgot to + record): info f, info float, info path, info program, info s, info + set, info source, info terminal, info types, info user, set/show + print object. + Also covered all recent GDB command renames for v4. + +Mon May 13 14:57:46 1991 John Gilmore (gnu at cygint.cygnus.com) + + * mipsread.c: Rather than keeping count of how many symtabs + and psymtabs we have, for sorting purposes, count them when + we need to sort. This fixes bug in rereading of symbol tables. + +Fri May 10 15:43:33 PDT 1991 Roland Pesch (pesch at cygint.cygnus.com) + + * infcmd.c: renamed "info path" to "show paths" + * gdbrc.tex: documented above. + +Wed May 8 04:51:11 1991 John Gilmore (gnu at cygint.cygnus.com) + + * remote.c: Fix comments. + * utils.c (error): Force out any pending wrap output. + +Sat May 4 11:11:07 1991 John Gilmore (gnu at cygint.cygnus.com) + + * Makefile.dist: Roll VERSION to 3.95. + Fix up "saber_gdb" to work again. + * saber.suppress: Update. + + * coffread.c, exec.c, infptrace.c, inftarg.c, remote.c, solib.c, + symtab.h, target.c, target.h: Lint. + * core.c: setup and select frame after reading shared libs, + else reading shared libs will clobber them. Lint. + * utils.c (error): Force out any buffered wrap text. + +Fri May 3 22:01:56 1991 John Gilmore (gnu at cygint.cygnus.com) + + * remote.c: Remove decls of memory_insert_breakpoint + and memory_remove_breakpoint, no longer used. (Suggestion of + Jan Norden). + + * Makefile.dist: use ${subdir} in paths of BFD and LIBIBERTY, + to make it easier to interface to "configure"'d libraries. + +Fri May 3 13:10:01 PDT 1991 Roland Pesch (pesch at fowanton.cygnus.com) + + * valprint.c: introduce "set p", "set pr", "show p" and "show pr" as + aliases for set/show print. + +Thu May 2 11:22:02 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * coffread.c (coff_sym_fns) [TDESC]: Make the type be m88kbcs. + + * m88k-tdep.c (IEEE_isNAN): New function. + + * infrun.c, m88k-tdep.c, m88k-xdep.c: Change + initialize_{tdesc,dcontext} to init_{tdesc,dcontext}. + + * infrun.c [TDESC]: Add a bunch of crud. + + * xm-88k.h [__GNUC__]: Don't define memset. + + * m88k-xdep.c: #if 0 out push_breakpoint. + + * tm-88k.h: Define GET_SAVED_REGISTER. + + * tm-88k.h: Define DGUX. + + * m88k-opcode.h (UEXT, SEXT, MAKE): Put parentheses around arguments. + + * m88k-pinsn.c (sprint_address): Declare at top of file. + + * m88k-xdep.c: #if 0 out core_file_command. + + * values.c ({unpack_,value_as_}pointer): Just call + {unpack_,value_as_}long (for now anyway). + + * m88k-tdep.c (get_saved_register): Make get_reg a dc_word_t (*)(). + (psr_register): Change return type to dc_word_t. + + * m88k-tdep.c (tdesc_read_function): Comment out call to ptrace. + + * m88k-tdep.c (get_saved_register): Add lvalp parameter. + + * gdbcore.h (write_memory): Don't prototype it. + + * tm-88k.h, m88k-tdep.c: Make stack_error, stack_jmp global. + m88k-xdep.c: Don't mention stack_error. + + * {x,t}config/m88k ({X,T}DEPFILES): Add missing files. + + * mtrace.c: Don't typedef things like size_t, just #define them. + + * coffread.c [TDESC]: #if 0 out references to coffsyn. + + * symtab.h (struct symtab): Include EXTRA_SYMTAB_INFO. + tm-88k.h: Define EXTRA_SYMTAB_INFO. + + * coffread.c [TDESC]: Include "tdesc.h" and make tdesc_handle + dc_dcontext_t not int. + + * coffread.c [TDESC]: Use system include files not <intel-coff.h>. + + * coffread.c [TDESC]: Move setting of debug_info from + coff_symfile_read to find_linenos and make it work with BFD. + + * cplus-dem.c [__STDC__]: Make x{m,re}alloc return void*. + + * signame.c: Cast const char* to char* when assigning to sys_siglist. + + * utils.c (strsave): Make arg const char* not char*. + + * infrun.c (wait_for_inferior) [SHIFT_INSN_REGS]: Use + bpstat_explains_signal (stop_bpstat) not stop_breakpoint. + + * tm-88k.h (START_INFERIOR_HOOK): Make tdesc_handle a dc_handle_t. + + * tm-88k.h (EXTRACT_RETURN_VALUE): Use char * not void *. + + * findvar.c (read_var_value, case LOC_CONST_BYTES): Put the address + in a char *, not a CORE_ADDR. Use SYMBOL_VALUE_BYTES. + + * tm-88k.h (INIT_EXTRA_FRAME_INFO): Use fci not prev (fci is + prev except from create_new_frame). Make next_frame a + local variable. + Declare get_prev_context. + {x,t}m-88k.h: Enclose USG and BCS defines in #if !defined. + m88k-{opcode.h,pinsn.c,xdep.c,tdep.c}: New files (same contents as + before; they had just been left out of the distribution for a long + time). + +Thu May 2 17:53:56 1991 John Gilmore (gnu at cygint.cygnus.com) + + Mips bringup and general cleanup + + * cplus-dem.c: Move CPLUS_MARKER define to after defs.h. + * infptrace.c (PT_WRITE_D, PT_READ_D): Use correct values. + (This still doesn't seem to make MIPS bkpts work.) + * mipsread.c: Remove dup "Reading symbol data..." msg. + (symbol_file_command, add_file_command): Remove, obsol. + * printcmd.c (ptype_command): Say "an enum" rather than "a enum". + Wrap output appropriately. + * stack.c (locals_info, catch_info, args_info): Check + selected_frame rather than target_has_stack or coredumping. + * valprint.c (type_print_varspec_suffix): Wrap "ptype" output of + enums appropriately. + +Wed May 1 14:10:22 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * signame.c: Include defs.h and param.h. + + * cplus-dem.c: Include defs.h and param.h. + Makefile.dist: Don't hack in the "param.h". + param.h: Don't include defs.h. + + * expread.y: Use a union to deal with the fact that type_stack + can have both ints and enum type_pieces in it. + ({push,pop}_type_int): New functions. + +Tue Apr 30 13:18:58 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * cplus-dem.c (cplus_mangle_opname): Don't call error. + values.c (check_stub_method): Call error if NULL return from + cplus_mangle_opname. + + * blockframe.c, breakpoint.c, core.c, command.c, findvar.c, + eval.c, expprint.c, infcmd.c, infrun.c, main.c, printcmd.c, + remote.c, source.c, stack.c, dbxread.c, coffread.c, symfile.h, + symfile.c, utils.c, valarith.c, values.c, valops.c, tm-68k.h, + target.c, inftarg.c, ieee-float.c, environ.c, defs.h, + command.h, inferior.h, gdbcore.h, symtab.h, expression.h, + symtab.c, cplus-dem.c, value.h, expread.y, valprint.c, + copying.awk, solib.c, inflow.c, symmisc.c + : Lint. Use read_memory not read_memory_integer on CORE_ADDR's. + Use {value_as,unpack}_pointer (added to values.c) + not {value_as,unpack}_long on CORE_ADDR's. + Use longest_to_int (added to defs.h) instead of cast to int. + Remove from_tty arg to mod_path. + Put symfile_bfd in {coff,dbx}read.c not symfile.h. + Use OP_NULL instead of 0 where dummy enum exp_opcode needed. + + * tm-sparc.h: Remove GET_RWINDOW_REG. + (FRAME_CHAIN): Call sparc_frame_chain. + sparc-tdep.c (sparc_frame_chain): New function. + tm-sparc.h (EXTRACT_STRUCT_VALUE_ADDRESS): call + sparc_extract_struct_value_address (added to sparc-tdep.c). + + * xm-sun386.h: Don't define SET_STACK_LIMIT_HUGE. + +Tue Apr 30 13:13:33 1991 Michael Tiemann (tiemann at cygint.cygnus.com) + + * valprint.c (type_print_base): If the type being printed is a + struct containing undefined types, print "<undefine type>" + as the type instead of crashing. + * values.c (value_headof): Get the vtable pointer taking + TYPE_VPTR_BASETYPE into account. + * symtab.c, symtab.h, dbxread.c: Fix various whitespace splotches. + +Mon Apr 29 13:22:51 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * Move BROKEN_LARGE_ALLOCA from tm-sun386.h to xm-sun386.h. + + * sun386-xdep.c [!GDB_TARGET_IS_SUN386]: Just provide empty + functions which don't do anything. + tm-sun386.h: Define GDB_TARGET_IS_SUN386. + + * Makefile.dist: Add comment about tm-sun3os4.h: tm-sun3.h, etc. + + * sun3-xdep.c, tm-sun3.h, tm-68k.h: Change TARGET_SUN3 to + GDB_TARGET_IS_SUN3. + + * infrun.c: Don't include sys/user.h and friends (wrong for + cross-debugging and not necessary anymore (see IN_SIGTRAMP in + xm-vax.h)). + [SET_STACK_LIMIT_HUGE]: Include <sys/{resource,time}.h>. + xm-tahoe.h: Don't define _DIRENT_. + + * xm-tahoe.h: Remove USE_OLD_TTY (not needed now that terminal.h + includes sgtty.h before sys/ioctl.h). + +Sun Apr 28 22:04:47 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * param-no-tm.h: Make BITS_BIG_ENDIAN defined to 0/1, not defined + or not defined. Don't define it based on TARGET_BYTE_ORDER if + it's already defined (in the tm.h file). + mips-opcode.h (BIT_FIELDS_*), + values.c (modify_field, unpack_field_as_long): + Use #if BITS_BIG_ENDIAN not #ifdef BITS_BIG_ENDIAN. + {x,t}m-tahoe.h, tahoe-pinsn.c, tahoe-opcode.h: New files. + +Fri Apr 26 12:02:06 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * tm-sparc.h: Add comments about gcc version 2 and structure passing. + + * xconfig/i386v{,32}{,-g}: Add XM_CFLAGS=-Dgetpagesize()=4096. + gmalloc.c: #if 0 out !HAVE_GETPAGESIZE code. + + * expread.y (abs_decl): Accept '&' and '&' abs_decl. + + * symtab.c, symtab.h: Have a builtin_type_{,unsigned_}long_long + regardless of LONG_LONG. + defs.h (TARGET_LONG_LONG_BIT): New macro. + expread.y (typebase): Add {unsigned,} long long {,int}. + +Thu Apr 25 12:31:22 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * valops.c (typecmp): If t2 == 0, return 1. + +Wed Apr 24 09:45:17 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + Changes from Tiemann: + * cplus-dem.c (optable): Add "nw", "dl", "compound". + (cplus_mangle_opname): New function. + (do_type): Add case 'Q'. + * values.c (check_stub_method): Do lookup_method_type and stuff + rather than smash_to_method_type. + symtab.c, symtab.h (allocate_stub_method): New function. + dbxread.c (read_type): If we get "##", don't lookup_function_type + and start clobbering it; allocate_stub_method instead. + * printcmd.c (x_command): Dereference references. + * valprint.c (type_print_varspec_prefix, case TYPE_CODE_METHOD): + Don't print " " type_print_base (...) "::" if !passed_a_ptr. + * dbxread.c (read_struct_type): Put "op$" instead of "operator" + in the symbol table. + * values.c (check_stub_method): Deal with operator names. + * valprint.c (cplus_val_print): Check for error in baseclass_addr. + * values.c: Move declaration of cplus_demangle to top of file. + * values.c (baseclass_addr): If can't read memory, set *ERRP + rather than calling error(). + * value.h: Remove redundant declaration of value_static_field. + * values.c (value_static_field): Recursively check all baseclasses. + Return NULL if not found. + * values.c, value.h: New functions value_{headof,from_vtable_info}. + * valprint.c (val_print): Print out first element of vtbl + specially. + * valprint.c: Move print controls to top and add objectprint. + Add command "set print object on/off". + * valprint.c (value_print, is_vtbl_member): Put things in local + variables rather than continually doing VALUE_TYPE (val), etc. + * valops.c (value_struct_elt_for_address): Call check_stub_method. + * valops.c (value_struct_elt): Remove found, arg1_as_ptr. + * valops.c (search_struct_method): Give error if j > 0 && args == 0. + * valops.c (search_struct_field): New argument looking_for_baseclass. + Give error if value_static_field or value_primitive_field + return NULL. + valops.c (various): Call search_struct_field with extra parameter. + * symtab.c (decode_line_1): Deal with operators specified as + "operator" <optional whitespace> <symbols for operator>. + (operator_chars): Help do it. + * symtab.c (lookup_struct_elt_type): Call check_stub_type. + Take additional argument noerr. + Don't dump core if TYPE_FIELD_NAME is NULL. + Check the baseclasses recursively. + * symfile.c (fill_in_vptr_fieldno): Don't call check_stub_type. + Return void not int. (also declarations in symfile.h and value.h). + Deal with multiple inheritance. + * printcmd.c (print_command_1): Add if (objectprint) code. + * expread.y (variable): Allow for destructor with foo::~name. + * eval.c (evaluate_subexp, case UNOP_LOGNOT): If following opcode + is OP_SCOPE, give an error. + * eval.c (evaluate_subexp): Pass third arg to lookup_struct_elt_type. + * eval.c (evaluate_subexp), values.c (value_virtual_fn_field): + Don't bother to do anything with + return value from fill_in_vptr_fieldno. + * eval.c (evaluate_subexp): If value_static_field returns NULL, + give an error. + * dbxread.c (read_struct_type): Set fcontext to 0 for normal member + function. + * dbxread.c (read_struct_type): Initialize name to 0. + * dbxread.c (read_ofile_symtab, N_CATCH): Add offset to bufp->n_value. + * dbxread.c (dbx_create_type): Zero TYPE_VPTR_BASETYPE. + (read_struct_type): Don't bother to set TYPE_VTPR_{BASETYPE,FIELDNO} + if it's just going to be {0,1}. + + * dbxread.c (virtual_context): Use TYPE_BASECLASS starting at 0 + (yes, it's #if 0, but just in case...). + + * vax-opcode.h, expread.y, expprint.c, cplus-dem.c: Declare some + things "const". + + * i386-stub.c: New file. + + * WHATS.NEW: Remove mention of readline and more paging (in 3.5). + Try to keep command names up to date with renaming. + + * gmalloc.c [!HAVE_GETPAGESIZE]: Try to figure out the pagesize. + + * infun.c (resume, resume_cleanups): New functions. + (wait_for_inferior, proceed, child_create_inferior): Use resume + not target_resume. + + * remote.c (getpkt): Don't set immediate_quit. + + * blockframe.c, frame.h (reinit_frame_cache): New function. + solib.c (solib_add), symfile.c ({,add_}symbol_file_command): + Use it. + +Tue Apr 23 10:38:41 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * symtab.c (lookup_symbol): Add 3 more of those loops through + the symtabs which we all know and love: (1) Look in the + STATIC_BLOCK for mangled symbols right after we check the blocks, + (2, 3) Look in the STATIC_BLOCK for all the symtabs and psymtabs + at the end. + + * main.c (cd_command): Call dont_repeat. + + * dbxread.c (read_struct_type): If const/volatile character is + missing, don't complain, just continue. + + * dbxread.c (read_struct_type): Only try to read the fcontext if + it is there. Also change "error_type " to "return error_type ". + values.c (value_virtual_fn_field): If there is no fcontext, + then do things the way GDB 3.x did. + valops.c (search_struct_method): Add type to value_virtual_fn_field + arguments. + + * dbxread.c (read_struct_type): Fix typo: *pp != '\0' -> **pp != '\0'. + +Mon Apr 22 00:02:43 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * printcmd.c (print_scalar_formatted): Add 't' for binary. + + * dbxread.c (end_psymtab): Initialize pst->symtab. + + * core.c (core_open): Call ADD_SOLIB. + + * tm-sparc.h: Include <sun4/reg.h> not <machine/reg.h>. + sparc-tdep.c: Don't include <machine/reg.h>. + + * sun3-xdep.c [!TARGET_SUN3]: Just provide empty functions which + don't do anything. + + * core.c (core_open): Add make_cleanup (unpush_target, &core_ops). + + * Shared library/corefile changes from Peter Schauer: + core.c (core_close): Call CLEAR_SOLIB. + (core_open): Remove comment about "should deal with shared lib". + (core_xfer_memory): If we can't xfer the usual way, try the + shared libraries. + solib.c (so_list): New fields so_bfd and so_sections{,_end}. + (find_solib): Use solib_map_sections to get ld_text. + (solib_map_sections, solib_xfer_memory): New functions. + (clear_solib): Free so_sections and close so_bfd. + tm-sunos.h: Add solib_xfer_memory, solib_add. + + * sparc-tdep.c (skip_prologue): Don't skip anything unless there + is a "save" instruction in there somewhere. + + * symfile.c (symbol_file_add): Add comment. + solib.c (solib_add): Don't malloc name passed to symbol_file_add. + + * exec.c (build_section_table): If *start isn't NULL, free it. + + * stack.c (parse_frame_specification): Error if NULL selected_frame. + infcmd.c (finish_command): Error if NULL selected_frame. + inflow.c (kill_command): Deal with NULL selected_frame. + stack.c (record_selected_frame): Set *FRAMEP to NULL if there + is no selected frame. + infrun.c (restore_inferior_status): Add comment. + findvar.c (read_var_value): Check for NULL frame where we need + a frame. + breakpoint.c (get_catch_sals): Check for NULL selected_frame. + + * breakpoint.c (bpstat_print): Try all elements on the bpstat + chain before giving up with an internal error. + +Sun Apr 21 21:43:10 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * value.h, values.c (value_{,free_to_}mark): New functions. + breakpoint.c (bpstat_stop_status): Use them. + + * tm-i386v{,-g}.h: Remove N_SET_MAGIC define. + +Sat Apr 20 21:42:47 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * i386-tdep.c: Remove unnecessary #includes. + + * symtab.c (various): Change error return of find_line_common to -1. + + * coffread.c (find_linenos): Use LINESZ not sizeof (struct lineno). + + * coffread.c (end_symtab): Initialize language, dirname, and + fullname fields. + +Fri Apr 19 18:18:31 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * mips-tdep.c (mips_frame_chain): Don't chain if saved_pc == 0. + + * stddef.h (size_t): Let either _SIZE_T or _SIZE_T_ guard it. + + * mipsread.c (parse_symbol): Set startup_file_{start,end} if + entry_point is in current file. + + * findvar.c (read_register_gen): Add "target byte-order" comment. + +Wed Apr 17 17:09:48 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * i386-tdep.c (i386_get_frame_setup): Use SWAP_TARGET_AND_HOST + before returning locals or slocals. + + * i386-tdep.c (i386_follow_jump): Do not add data16 to pos in + call to codestream_seek; add one to pos if (and only if) + we are dealing with a jump with data16 == 1 (i.e. 0x66, 0xe9). + +Mon Apr 15 12:04:32 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * valops.c (call_function_by_hand): Put dummy1 in target order + before FIX_CALL_DUMMY. + + * tm-i386v.h (FIX_CALL_DUMMY): Don't depend on host byte order. + +Sun Apr 14 11:55:19 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * valops.c (push_word): Add SWAP_TARGET_AND_HOST. + + * remote.c (remote_open): Send '+' before calling putpkt(). + + * tm-i386v.h (REGISTER_VIRTUAL_TYPE): Return pointer to void, + not int, for pc, fp, and sp. + + * remote.c (remote_open): Call start_remote after putpkt("?"); + infrun.c (start_remote): Also call wait_for_inferior & normal_stop. + +Sat Apr 13 22:11:42 1991 Jim Kingdon (kingdon at spiff.cygnus.com) + + * exec.c: Include <ctype.h>. + + * sun3-xdep.c (fetch_core_registers): Add #ifdef FP0_REGNUM. + +Fri Apr 19 09:36:50 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * tm-68k.h (NUM_REGS): Conditionalize on TARGET_SUN3 not sun. + tm-sun3.h: Define TARGET_SUN3. + + * utils.c: Use CPLUS_MARKER not '$'. + + * cplus-dem.c: Use CPLUS_MARKER not '$'. If CPLUS_MARKER isn't + defined, define it to '$'. + + * arm-opcode.h: New file (same contents as before; it had + just been left out of the distribution for a long time). + + * tm-68k.h: Put declaration of ext_format_68881 outside the macros. + + * main.c: New HAVE_SIGSETMASK #ifdefs. + + * coffread.c (read_coff_symtab): Check for "LF%" with all the + other L*% things. + + * coffread.c (SDB_TYPE): New macro. + various: Use it instead of checking against T_NULL. + + * Makefile.dist (cplus-dem.o): Hack in an #include "param.h" + before we compile it. + defs.h: Protect against multiple inclusion. + param.h: Include defs.h. + signame.c: Change #ifdef SYS_SIGLIST_MISSING to #if. + param-no-tm.h: Define SYS_SIGLIST_MISSING from USG. + +Thu Apr 18 19:49:10 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * i386-pinsn.c (OP_E): Change %d to 0x%x for consistency. + + * putenv.c: New file + Makefile.dist: Add it to $(OBS). + + * mipsread.c [!CMUCS]: #include <syms.h>. + + * mips-xdep.c (fetch_core_registers): #if 0 out the whole function. + + * Move read_memory_nobpt from mem-break.c to breakpoint.c. + +Mon Apr 15 21:45:35 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * utils.c (_initialize_utils): Rename "set demangle" to + "set print demangle", "set asm-demangle" to "set print + asm-demangle" and "set sevenbit-strings" to "set print + sevenbit-strings". + + * main.c (initialize_main): Rename "set history write" to + "set history save". + + * main.c (initialize_main): Rename "set caution" to + "set confirm". + + * values.c (_initialize_values): Remove "info history" alias + for (what is now) "show values". + + * infcmd.c, gdbcmd.h: Add unsetlist. + infcmd.c: Add unset_command. + (_initialize_infcmd): Add "unset" and use it for "unset env". + + * breakpoint.c (_initialize_breakpoint): Remove "unset". + + * valprint.c: Add "set/show print", {set,show}_print. + Rename "set addressprint" to "set print address". + Rename "set arrayprint" to "set print array". + Rename "set array-max" to "set print elements". + Rename "set prettyprint" to "set print pretty". + Rename "set unionprint" to "set print union". + Rename "set vtblprint" to "set print vtbl". + + * main.c: Rename version_info to show_version. + (_initialize_main): Rename "info version" to "show version". + + * values.c: Rename value_history_info to show_values. + (_initialize_values): Rename "info values" to "show values". + +Sun Apr 14 23:08:34 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * inftarg.c (child_open), remote-vx{,.68}.c (vx_proc_open): + New function to give correct error message. + +Thu Apr 11 17:19:41 1991 Jim Kingdon (kingdon at cygint.cygnus.com) + + * target.h: Add to_doc and target_preopen. + target.c: Add target_preopen and target_command. + Remove target_info. + (add_target): Call add_cmd and mess with targetlist->doc. + core.c, exec.c, remote-eb.c, remote-nindy.c, remote-vx.c, + remote-vx.68.c, inftarg.c, remote.c: Add doc field to target struct. + Call target_preopen from open routine. + + * main.c: Rename editing_info to show_commands. + (_initialize_main): Rename "info editing" to "show commands". + + * source.c: Rename directories_info to show_directories. + (_initialize_values): Rename "info directories" to "show directories". + + * values.c: Rename convenience_info to show_convenience. + (_initialize_values): Rename "info convenience" to "show convenience". + + * copying.awk (_initialize_copying): Rename "info copying" to + "show copying" and "info warranty" to "show warranty". + Rename {copying,warranty}_info to show_{copying,warranty}. + + * symfile.c: Rename add_syms_command to add_symbol_file_command. + (_initialize_symfile, add_syms_addr_command): + Rename add-syms to add-symbol-file. + +Thu Apr 18 18:08:30 1991 John Gilmore (gnu at cygint.cygnus.com) + + * symfile.h (free_named_symtabs): Rename from free_named_symtab. + * symfile.c (clear_symtab_users_once, cashier_psymtab, + free_named_symtabs): Move these routines from symmisc.c. + * symmisc.c (same): same. + (free_symtab): Make non-static. + * symtab.h (free_symtab): Declare as exported void fn now. + * dbxread.c (end_symtab, end_psymtab): Change comments. + (initialize_dbxread): Call dbx_new_init() in case the first + command is add-symbols. + * target.c (dummy_target): Permit add_syms_addr_command. + +Sat Apr 13 14:46:07 1991 John Gilmore (gnu at cygint.cygnus.com) + + Permit symbols to be superseded when new symbol files have + been read in, particularly for VxWorks. + + * dbxread.c (read_dbx_symtab): Allow N_SOL to cleanly take us back + to the main file, as well as to include files. Also, put global + functions into the global psymtab, to make "i fun" work. + (end_psymtab): Free named symtabs and psymtabs for a file, once a + new psymtab for it has been read. + * coffread.c (end_psymtab): Free named symtabs and psymtabs for + a file, once a new symtab has been read for it. + * mipsread.c: FIXME. We need to do the same for MIPS, but it + looks harder to determine the top-level block before it's been + queued to the psymtab list. + + * symfile.c (symbol_file_add): Use filtered printing and wrap it. + If we have wiped out any old symbol tables, clean up at end of + symbol reading. + (symbol_file_command): Don't reference symfile_fns if it's zero. + + * symtab.h (GLOBAL_BLOCK, STATIC_BLOCK, FIRST_LOCAL_BLOCK): New + defines for the blocks of a blockvector that contain global and + file-static symbols and the first of the smaller scope contours. + * symtab.c (lookup_symbol, find_pc_symtab, find_pc_line, + decode_line_1, make_symbol_completion_list): Use the above. + * coffread.c (end_symtab, patch_opaque_types): Ditto. + * dbxread.c (end_symtab): Ditto. + * expread.y (block): Ditto. + * mipsread.c (throughout): Ditto. + * symmisc.c (free_named_symtabs): Ditto. + + * symtab.c (list_symbols): Process the first symbol of the + static psymbols list. + (types_info): Restore this function from its untimely #if 0. + It's not perfect, but it is better than nothing. + (_initialize_symtab): Restore "info types". + +Thu Apr 11 05:23:19 1991 John Gilmore (gnu at cygint.cygnus.com) + + * m68k-stub.c: Remote stub for 680x0's, created from + rem-m68k.shar (which is removed). + * nindy-share/{Makefile,Onindy.c,blout.h,env.h,nindy.c,ttyflush.c}: + Remove RCS log stuff now that we use CVS and it blows our diffs. + +Wed Apr 10 14:18:06 1991 John Gilmore (gnu at cygint.cygnus.com) + + * symmisc.c (free_named_symtab): Make it work, in its current + kludgy fashion. Change result to indicate if we blew away bkpts. + * dbxread.c (end_symtab): Accumulate result from + free_named_symtab and print warning if we blew user's state. + * symfile.h: free_named_symtab now returns an int. + +Mon Apr 8 23:57:43 1991 John Gilmore (gnu at cygint.cygnus.com) + + * dbxread.c (dbx_symfile_read): Initialize psymbol list if this + is the first symbol read, even if not mainline. + (dbx_psymtab_to_symtab): symfile might be zero, cope. + * exec.c (exec_ops): Add_syms_addr is valid in our tvec. + (set_section_command): New command ("section xxx yyy" -- should + be renamed to "set section xxx yyy" FIXME) which sets the + base address of a section of the exec file, overriding the + virtual address that BFD reports. + +Fri Apr 5 17:14:39 1991 John Gilmore (gnu at cygint.cygnus.com) + + * exec.c: Add add_syms_addr_command to exec_ops, so you can + load symbols at any address while examining an exec file. + +Thu Apr 4 10:09:35 1991 John Gilmore (gnu at cygint.cygnus.com) + + * tm-i386v.h (FLOAT_INFO): Don't define it, since the code + for printing the float info is host-dependent, not + target-dependent. FIXME. + * i386-pinsn.c: Move #includes to top, remove useless ones. + * i386-tdep.c: Don't bother including <.../reg.h> since we + don't use it (and it doesn't exist on host systems). + + * ieee-float.c (ieee_extended_to_double): Convert NaN to Inf. + Convert negative numbers properly. + (ieee_test): Make numbers really random; fix format arg. + + * infcmd.c (attach_command, detach_command): Don't repeat on CR. + * core.c (core_detach): Unpush core_ops, which might not be on + top. We used to just pop the top, which broke things. Don't + need dont_repeat() any more. + (core_file_command): Psst! Don't repeat it. + * remote-nindy.c (nindy_detach): Don't need dont_repeat() now. + * expprint.c (print_subexp): Avoid switch fallthru on + BINOP_ASSIGN_MODIFY, so we can print += and such. + * frame.h: Fix typo. + * inflow.c (kill_command): After killing inferior, print our + current frame in the core file, if we have one. + (generic_mourn_inferior): When inferior dies, either select + the current frame (in the new target, e.g. core file), or + set both the current and selected frames to NULL. + + Changes from Peter Schauer. + + * infptrace.c: Avoid <sys/ptrace.h> on USG. + + * Make all file names fit in 14 characters (sigh and damn!): + mv hp300hpux-xdep.c hp300ux-xdep.c + mv symmetry-xdep.c symm-xdep.c + mv symmetry-tdep.c symm-tdep.c + mv convex-opcode.h convx-opcode.h + mv tm-vxworks960.h tm-vx960.h + mv tm-vxworks68.h tm-vx68.h + mv Makefile.srcdir Makefile.sdir + mv gdb-int.texinfo gdbint.texinfo + mv remote-sa.m68k.shar rem-m68k.shar + mv remote-multi.shar rem-multi.shar + * Makefile.dist, README, config.gdb, convex-pinsn.c, + tconfig/symmetry, tconfig/vxworks960, tconfig/vxworks68, + xconfig/hp300hpux, xconfig/symmetry: Change names to shorter + names. + + * command.c (user_info_1, user_info): New command for listing + the user-defined commands. + +Wed Apr 3 15:00:26 1991 John Gilmore (gnu at cygint.cygnus.com) + + * dbxread.c (really_free_pendings): Clear file_symbols + and global_symbols after freeing them; otherwise, running + this function twice (if it appears twice on the cleanup + chain), we try to free things twice. + + * dbxread.c (read_dbx_symtab): Calculate end_of_text_addr + based on text_addr (the address of text in core), not on addr (the + offset between text in the .o file and in core). This change + is from Peter Schauer. + + * main.c: Define ALL_CLEANUPS as a cast of zero. + (return_to_top_level): Use it. + (main): Do all cleanups after each command run as part + of the gdb startup sequence. Also do all cleanups before + entering the command loop, and every time we exit the command + loop and reenter. Before, the cleanups from the startup sequence + were being left undone until the first error! + (command_loop): Rename do_nothing cleanup to command_loop_marker + so we can see it easily when examining the cleanup chain. + (init_signals): Add another do_nothing for signal handling. + (quit_command): Only try to kill target if it has execution. + Problems in the target stack got us into a state where + inferior_pid was nonzero but none of the targets had execution. + In this state you couldn't exit gdb. + + * dbxread.c: Two changes from Peter Schauer. + (echo_command): Fflush output after an echo command. + (show_history): Pass all args to cmd_show_list. + + * utils.c (init_malloc): Call mtrace to turn on tracing + if the environment variable MALLOC_TRACE is set to a file name. + * mtrace.c: Add source file which provides a log of every malloc, + free, and realloc to a trace file. + * mtrace.awk: Add source file which analyzes the trace file. + * Makefile.dist (GNU_MALLOC, MALLOCSRC): Add mtrace.{c,o,awk}. + (VERSION): Roll to 3.94.3. + + * breakpoint.c (breakpoint_1): Add a space to "i watch" output. + (check_duplicates): Don't bother with watchpoints. + (set_raw_breakpoint): Comment about danger of this routine. + (watch_command): Parse and eval all args before calling + set_raw_breakpoint. + + * solib.c (find_solib): Avoid error in referencing memory to + see if any more shared libraries have been added. This is + particularly useful if the target has terminated. Bug reported + by Peter Schauer. + + Changes from Peter Schauer <pesrem@regent.e-technik.tu-muenchen.de> + in bringing up 3.94.2 on the Sun-3. + + * Makefile.dist: Include CFLAGS in rule for cplus-dem.o. + * breakpoint.c (enable_breakpoint): Check for valid watchpoint + expression (in scope) before reenabling watchpoint. + * signame.c (init_sigs): Add missing declaration of i, fix + sys_siglist declaration. + * source.c (list_command): Fixed range computation to use + lines_to_list (). + * stack.c (backtrace_command): Do not allow command if target has + no stack, print informative error message. + * target.c (target_command): Do not write into command line + because this fails if the target command is used in a user defined + command. [This change was enhanced by gnu to support any- + unique-prefix matching on target names.] + * valops.c (value_struct_elt): Avoid infinite loop on an + erroneous attempt to print the member of function (try p main.p). + +Mon Apr 1 17:05:45 1991 John Gilmore (gnu at cygint.cygnus.com) + + * expread.y (name_no_typename): Avoid reduce/reduce errors + caused by ambiguity in handling NAME_OR_INT and NAME_OR_UINT. + Since the GDB parser really doesn't use name_no_typename in a + name-only context, the parser can't tell the diff between + names and numbers here. Avoid allowing a name_no_typename + to be a NAME_OR_*INT to resolve the conflict. + +Sun Mar 31 20:12:07 1991 John Gilmore (gnu at cygint.cygnus.com) + + Bugfixes from Mark Fox (markf@wrs.com) (test=testField.c): + + * valprint.c (val_print_fields): bitfield printing didn't handle + byte order. Indirect through a few more fns to cope. + + * values.c (modify_field): also cope with byte order. + +Sat Mar 23 10:02:21 1991 John Gilmore (gnu at cygint.cygnus.com) + + Cleanup for release 3.94.2: + + * Makefile.dist: Pull REMOTE_OBS. Fix saber includes for BFD + include files. Roll version to 3.94.2. + + * coffread.c (init_stringtab): Read length into unsigned char + array before swapping; don't assume 32-bit longs. + + * target.c (target_info): Don't bother with get_sym_file, just use + the symfile global variable. + * symtab.h, symfile.c (get_sym_file): Delete it. + + * dbxread.c (dbx_symfile_init): Don't depend on long == 4 bytes. + (define_symbol): Set symbol line number to 0 if not gcc-compiled. + (read_type): Replace one more error() with complain(). + + * mipsread.c (parse_partial_symbols): Replace printf with complain. + + * i960-tdep.c: Fix copyright attribution. + + * config.gdb: Quote all backquotes in doublequotes. You can + quote me on that. BSD 4.4 shell found this one. + + * infptrace.c (throughout): The third argument to ptrace is an + int *, not an int. + + * infrun.c (wait_for_inferior): When program has terminated, we + have to call target_terminal_ours before we pop that target off + the stack (e.g. before a call to target_kill or + target_mourn_inferior). This fixes problem where a program + terminates, then GDB stops for (tty output) and you have to type + "fg" to the shell to resume it. FIXME: This code for what to + do after termination really should be in normal_stop instead. + + * gdbcore.h (read_memory_check): Change declaration; it changed + names months ago. + + * terminal.h: Include <sgtty.h> before <sys/ioctl.h>, since in BSD + 4.4 prereleases, this avoids a bug in their sgtty compatability + support. + * remote.c: Use terminal.h rather than hand-rolling the same. + + * signame.c, signame.h (psignal): Arg is unsigned, not int. + * utils.c (strsave, strstr): Fix arg types. + * valprint.c (val_print): lint + + MIPS symbol table support from Per Bothner: + + * symfile.c (symtab_fns): Remove initializer table that needs to + be hacked for each new symbol file format supported. + (add_symtab_fns): New function, chains symbol table + handlers into the global list. + (symfile_init): Search this list. + * symfile.h: Add next pointer, declare add_symtab_fns. + * coffread.c (_initialize_coffread): Call add_symtab_fns. + * dbxread.c (_initialize_dbxread): Call add_symtab_fns. + + * mipsread.c (psymtab_to_symtab_1): return void instead of (struct + symbol *). Thus, we no longer need the hack to trash + pst->filename. Good, since that hack confused code in symfile.c! + + (reorder_symtabs, destroy_all_symtabs): Removed static + all_symtabs, which was used to qsort symtabs in reorder_symtabs. + Instead, the latter now uses a temporary array (stack-allocated + from an obstack, and then freed). + + (parse_symbol): Added a hack to fix up BLOCK_{START,END} if they + haven't been set in the outermost stBlock of a procedure. This was + a problem with f77 binaries on Ultrix 4.?. + + (new_symtab, new_symbol, new_type): Continue changing code to use + obstacks more and otherwise conform to dbxread internal style. + Made the free_code of symtabs be free_linetable (as in dbxread) + instead of free_contents. This implies memory leaks when reading + a new symbol table, until the conversion is finished. Did change + (struct symbol) and (struct type) to be allocated on the + symbol_obstack. Blocks and blockvectors are among the things + still "leaking." + + * mipsread.c (parse_partial_symbols, parse_fdr): It hasn't been + tested much, but it solved one problem (reported by Meissner), and + cleans up some other things. The problem happened when an + included file contains actual code (functions) and not just + definitions. The mips coff is a little inconvenient there, since + it may cause a procedure to be mapped to the wrong psymtab. + + * mips-tdep.c (heuristic_proc_desc): Minor cleanup. + * mips-xdep.c (fetch_core_registers): Minor cleanup. FIXME, + this will need work for the new core paradigm. + + Opcode patches from the net: + + * mips-opcode.h: fix incorrect disassembly of the mfc1, cfc1, and + ctc1 instructions. Also, the cvt.d.w and cvt.s.w instructions were + missing altogether - they are added here. From Bruce Bauman. + * mips-opcode.h: The low mask for C0 instructions was too small. + From Garrett Lau. I modified the fix to check the entire 32-bit + opcode. + + * ns32k-opcode.h: Fix opcodes for deiw and deid. From Bruce + Bauman. + +Thu Mar 21 12:56:46 1991 John Gilmore (gnu at cygint.cygnus.com) + + Roll in changes from Per Bothner (Tue, 25 Sep 90 11:11:04): + + * dbxread.c (read_type): Pointer subtraction (value_sub in + valarith.c) sometimes failed because the types of the + pointers being subtracted were not identical. + These differed because dbxread.c was allocating pointer types + using dbx_alloc_type+smash_to_pointer_type instead of + lookup_pointer_type. I failed to find a justification for the + former, so I changed it to use the latter. Similarly, I + replaced smash_to_function_type by lookup_function_type, + and smash_to_reference_type by lookup_reference_type. + + * mipsread.c (parse_symbol, upgrade_type, parse_procedure, + _initialize_mipsread): corresponding changes. + + * symtab.c (smash_to_{pointer,reference,function}_type): eliminate. + + * source.c (mod_path): Do tilde_expand on each component of the path, + rather than on the (list of) paths as a whole. + (print_source_lines): Set first_line_listed in addition to + current_source_symtab and current_source_line. If the source was + not findable, after a "dir" command to fix the problem, + a "list" would get the wrong lines. + + While I was there... (gnu): + + * dbxread.c (read_type): Change error to complaint. + +Thu Mar 21 12:56:46 1991 John Gilmore (gnu at cygint.cygnus.com) + + First attempt at detailed understanding of symbol table memory alloc. + + * dbxread.c (dbx_symfile_read): Free our string table if we + aren't the mainline. Free the "info" struct since we're done with + it. + (init_psymbol_list): Free any previously allocated psymbol lists. + (): FIXME: Should realloc-down the psymbol lists when done reading + the main symbol file? + + * symmisc.c (free_symtab): Free fullname field too. + + * xm-hp300hpux.h (USG): #undef then #define so Makefile can -D. + (REGISTER_ADDR): Make result type unsigned int. + + * xconfig/{i386*,hp300hpux,altosgas,altos}: All config files that + define REGEX must also define REGEX1 (its dependency). + +Tue Mar 19 21:28:57 1991 John Gilmore (gnu at cygint.cygnus.com) + + * tconfig/i960: No longer works, points you at vxworks960 or + nindy960. + + * xgdb.c, XGDB-README: Remove file. Users can get the much + better xxgdb. + * Makefile.dist: Remove all trace of xgdb. + + * breakpoint.c (breakpoint_1): Pass demangle arg to + print_address_symbolic. + (clear_breakpoints): Remove unused function. + (breakpoint_re_set_one): Guts of breakpoint_re_set. + (breakpoint_re_set): Use catch_errors to do them all anyway. + + * gdb-int.texinfo (Host versus Target): Add section on what is + a "host" feature versus what is a "target" feature. + + * infcmd.c (path_command, path_info): Handle the PATH variable + (object search path) as conveniently as the source search path. + * environ.c (set_in_environ): Set some vars in GDB's environment, + in addition to the child's. PATH, G960BASE, G960BIN for starters. + * source.c (mod_path): New function, from guts of + directory_command, modifies a path. Used by path_command. + (directory_command): Call it. + * defs.h (strsave): Declare. + + * utils.c (sevenbit_strings): Add new printing option. + (printchar): Use it. + (strsave): Provide this handy helper routine. + (set_width_command): Rename set_screen_width_command. + (_initialize_utils): "set screen-width" => "set width"; + "set screen-height" => "set height"; add sevenbit-strings. + + * infcmd.c (do_registers_info): Print floating point registers + in raw hex as well as float format, regardless of whether it is + a "virtual" convertible register. + * tm-sparc.h (PRINT_REGISTER_HOOK): Print every pair of float + regs as a double, just in case it's being used that way. + * values.c (unpack_long): Comment on array/function coercion. + (unpack_double): Argument is in target byte order now. For + integer arguments, just call unpack_long and float the result. + * m68k-tdep.c: include defs.h for "const" handling. + * remote-nindy.c: Use ieee-float stuff. + (nindy_fetch_registers): Unpack double regs to host double, then + to extended. + (nindy_store_registers): Pack extendeds to host double, flip + around by misusing unpack_double, send as target double. + + * tm-vxworks68.h (FRAME_CHAIN): Handle current frame pointer of + zero, as when stopped at the first instruction of a process. + + * blockframe.c: Fix filename in comment (param.h => tm.h). + * sparc-tdep.c (skip_prologue): More explicit nudging comments. + * tm-68k.h: Fix typos. + +Fri Mar 15 01:09:34 1991 John Gilmore (gnu at cygint.cygnus.com) + + Changes from a bringup on the DEC Vax under Ultrix 4.0. + + * coredep.c (fetch_core_registers): Pass end-address of register + section to register_addr as expected. Don't call supply_register + if we'd just pass it garbage. + + * dbxread.c (read_dbx_symtab): Skip N_NSYMS on Ultrix. + + * exec.c (xfer_memory): Use boolean xfer_fn result, not int. + + * target.c (push_target, target_info): Cast enums to int for < or + > comparison. + + * stack.c (print_frame_info): Identify source file & line + even if we can't print it. + + * xm-vax.h (MISSING_VPRINTF): No longer missing in Ultrix V4.0. + +Sat Mar 9 10:08:20 1991 John Gilmore (gnu at cygint.cygnus.com) + + Clean up IEEE floating point support. + + * ieee-float.h: New file. + * ieee-float.c: Write real routines to convert between host + doubles and various target IEEE extendeds. + * m68k-xdep.c: Eliminate assembler code for extended floats. + * xconfig/{3b1,altos,altosgas,hp300bsd,isi,news,news1000,sun2os3, + sun2os4,sun3,sun3os3,sun3os4}: Eliminate use of m68k-xdep.o. + * tm-i960.h, tm-68k.h (REGISTER_CONVERT_TO_VIRTUAL, + REGISTER_CONVERT_TO_RAW): Use ieee_extended_to_double and + double_to_ieee_extended. + * i960-tdep.c: Define ext_format_i960. + * m68k-tdep.c: Define ext_format_68881. + * sparc-tdep.c: Define ext_format_sparc, though unused. + * Makefile.dist (HFILES): Add ieee-float.h. + * inftarg.c: #include "ieee-float.h" for the REGISTER_CONVERT + macros. + + Obsolete the "coffstrip" program in favor of using BFD's strip. + + * nindy-share/coffstrip.c: Remove file. + * nindy-share/nindy.c (coffstrip): Routine to run bfd_strip. + * Makefile.dist: Remove references to nindy-share/coffstrip.c. + * tconfig/nindy960: Remove reference to coffstrip.o. + + * Makefile.dist: Roll version number to 3.94.1 (not yet final). + +Wed Mar 6 09:56:45 1991 John Gilmore (gnu at cygint.cygnus.com) + + * symfile.h: Add symfile_bfd, common between dbxread and coffread. + * dbxread.c: Remove static symfile_bfd. + * infcmd.c (do_registers_info): Add PRINT_REGISTER_HOOK, though + it is not used yet. + * inftarg.c (child_detach): Pop the child_ops vector if the + detach is successful. + * remote-nindy.c (nindy_create_inferior): Don't push a new + nindy_ops since nindy uses the same one for execution and memory + examination anyway. + * core.c (core_ops): Use child_attach and child_create_inferior + rather than default attach and create_inferior functions. + + Handle floating point registers in core files. + + * sparc-xdep.c (fetch_core_registers): Rewrite for float support. + * sun3-xdep.c (fetch_core_registers): Rewrite for float support. + This version untested since BFD doesn't yet support sun3 core + files. + * hp300hpux-xdep.c: Rewrite fetch_core_registers to new calling + conventions. Fix comments and style. This version has not + been compiled yet, since we have no HP inhouse. + * core.c (get_core_registers): Look for two sections, ".reg" + and ".reg2", and pass both to fetch_core_registers sequentially. + + Revise directory path yet again. + + * source.c (forget_cached_source_info): Not static any more. + (init_source_path): New default source path is "$cdir:$cwd". + (dir_command): Handle variable arguments ($cdir, $cwd). + (source_info): Print "Compilation directory" rather than + "Originally compiled in" to remind people of $cdir. + (openp): If the path contains $cwd, use current directory. + (open_source_file): If compilation directory is known, replace + first $cdir in path with the compilation directory. + (print_source_lines): Even if we can't print the lines, set the + current symtab and line for future commands like "info source" or + "breakpoint". Also, error message now contains the file name, + line number, and file access error message. + (_initialize_source): Fix help text to describe changes. + * main.c (cd_command): Forget cached source info when we chdir. + * utils.c (strstr): Add simple implementation. + +Tue Mar 5 01:41:40 1991 John Gilmore (gnu at fowanton.cygnus.com) + + * coffread.c (read_one_sym, init_linetable, init_stringtab): + Byte-swap COFF symbol tables if necessary when reading them in. + Use complain() to replace error message in one spot. Needs + corresponding change in bfd/coff-code.h to make some symbol + swapping routines non-static. + +Mon Mar 4 00:53:40 1991 John Gilmore (gnu at cygint.cygnus.com) + + Merge changes from Eirik Fuller, for UTek. + + * defs.h (errno): Add declaration. + * altos-xdep.c, arm-xdep.c, convex-xdep.c, gould-xdep.c, + hp300hpux-xdep.c, infrun.c, inflow.c, infptrace.c, i386-tdep.c, + i386-xdep.c, pyr-xdep.c, mips-xdep.c, remote-eb.c, remote-nindy.c, + remote-vx.c, source.c, standalone.c, stuff.c, sun386-xdep.c, + symmetry-tdep.c, symmetry-xdep.c, umax-xdep.c, utils.c: Eliminate + declarations of errno. + + * remote-eb.c: Define B19200 and B38400 as EXTA and EXTB. + + * remote-vx.c: Include <sys/time.h> for UTek; Sun gets it via + <rpc/rpc.h> and <rpc/types.h>. + +Sat Mar 2 15:47:55 1991 John Gilmore (gnu at cygint.cygnus.com) + + * i960-tdep.c (examine_prologue): Add new argument limit, + which stops the scan at the end of the prologue, or at the PC. + This fixes a problem where it walks down into the code for the + user's statements if that code looks like function prologues. + Mark Fox and I have been bouncing this code back and forth, making + small changes to it. Callers changed to match. + +Tue Feb 26 01:47:07 1991 Cygnus John Gilmore (cygnus at yuba) + + Cleanup for gdb-3.94 release final: + + * Makefile.dist: Remove remote-vx.c, remote-nindy.c, and all + the .c files from vx-share and nindy-share, from the various + macros, since they are not found via ALLDEPFILES. + (SFILES): Add tm-i960.h. + (alldeps.mak rule): Break out ALLDEPFILES_MAINDIR and + ALLDEPFILES_SUBDIR. List all the nindy and vxworks subdir files + in the SUBDIR list. + (TAGFILES_MAINDIR): Change ALLDEPFILES to ALLDEPFILES_MAINDIR. + (gdb.tar.Z): Use ALLDEPFILES_SUBDIR as well as SFILES_SUBDIR. + +Mon Feb 25 16:02:35 1991 Cygnus John Gilmore (cygnus at oldman) + + * am29k-tdep.c: Add contribution line. + (examine_prologue): Cache information about function prologues in + the misc-function-vector to avoid lots of references over the + serial line while examining instructions. + + * core.c (core_close): New function made from cleanup_core. + + * core.c, exec.c, inftarg.c, remote-eb.c, remote-nindy.c, + remote-vx.c, remote.c, target.c, target.h, + Update target_ops vector to add attach, close, and load entries. + Use add_syms_addr_command, not add_file_addr_command, for + add_file. Break out close routine from existing code. + + * dbxread.c (really_free_pendings): Don't free pending_blocks; + they are in an obstack. + (read_dbx_symtab): Relocate end_of_text_addr in the psymtab. + Lint. + (define_symbol): Add symbol type parameter; change callers; + pass type parameter to DBX_PARM_SYMBOL_CLASS macro to allow + it to influence the symbol class on the i960. + (define_symbol): Swap LOC_CONST's into target byte order. + + * exec.c (exec_close): New function. + (exec_file_command): Call it. + + * findvar.c (read_relative_register_raw_bytes): Doc byte order, + Fix byte order of frame pointer. + (read_var_value): Result of 0 if var's value can't be found, + e.g. missing FRAME_ARGS_ADDRESS. Byte-swap LOC_CONST and + LOC_LABEL values to target order. Add LOC_LOCAL_ARG. + (locate_var_value): Use read_var_value and use its lazy address + as the location of the var's value. Lint. + + * i960-pinsn.c (next_insn): Add routine from vxgdb for scanning + instructions. + + * i960-tdep.c (arg_address, i960_frame_find_saved_regs): Remove + obsolete Intel versions in favor of vxgdb versions. + (check_host, byteswap, byteswap_val, reorder_val): Eliminate + code dealing with byte order of values, which Intel did in host byte + order rather than gdb-4's target byte order. + (i960_frame_chain_valid): Move to nindy-tdep.c. + (examine_prologue, skip_prologue, frame_find_saved_regs, + frame_args_address, leafproc_return, saved_pc_after_call, + pop_frame): Add vxgdb versions from Mark Fox. + (examine_prologue, frame_struct_result_address): Add code + to deal with the saved value of G13 (struct return address + pointer). + (frame_args_address): Modify Mark's version to prefer the + saved value over the current value in the topmost frame. + Cache result in the frame info to avoid performance hair in + callers. + (print_fault): Add gdb960 code for printing faults. + (_initialize_i960): Actually call check_host. + + * ieee-float.c (ieee_extended_to_double, ieee_double_to_extended): + add stub routines. FIXME, these currently just return zero! + + * infcmd.c (program_info): Use PRINT_RANDOM_SIGNAL. + (attach_command): Call target_attach, not target_open, now. + + * infrun.c (normal_stop): Make global, not static, for vx_attach. + (child_attach): Rename from child_open. + (wait_for_inferior): Use PRINT_RANDOM_SIGNAL. If stop_pc is zero, + don't confuse it with a zero step_resume_break_address. + + * inftarg.c (child_detach): Eliminate inferior_pid test. + (child_files_info): Clean up message a bit. + (child_ops): Use child_attach, not child_open, to attach. + + * mem-break.c: #ifdef out the whole file if BREAKPOINT is not + set (e.g. on VxWorks or NINDY). Move read_memory_nobpt from + findvar.c to here, since it depends on the contents of the + shadow_contents of breakpoints, but keep if #if 0 since it is + never called. + + * nindy-tdep.c: New file, contains nindy_frame_chain_valid, moved + from i960-tdep.c. + + * printcmd.c (address_info): Handle LOC_LOCAL_ARG. Lint. + (ptype_command, display_command): Eliminate have_inferior_p and + have_core_file_p in favor of target_has_stack or + target_has_execution. + (print_frame_args): Handle LOC_LOCAL_ARG. Eliminate duplicate + code for actually finding the values of arguments, though we still + keep track of the maximum stack offset for use in printing unnamed + arguments. Handle missing FRAME_ARGS_ADDRESS. + + * remote-nindy.c (i960_print_fault): Move to i960-tdep.c. + (struct nindy_regs): Define registers passed to/from nindy. + (nindy_fetch_registers, nindy_store-registers): Translate between + nindy and GDB formats for the registers. + (dcache_init): Statically allocate the cache, since it was being + allocated by a malloc that was never freed anyway. + (nindy_create_inferior): Error, not core dump, if no exec file. + (nindy_before_main_loop): Use target_load, not target_add_file. + + * remote-vx.c (net_load): Specify large timeout for load + requests. Allow user to break out with INTERRUPT. + (net_break): Remove useless code, clean up. Change callers. + (parse-args, skip_white_space, find_white_space): Clean up arg + parsing to cope with quoted strings. + (net_wait, net_quit): Never call error, just return status. + (vx_read_register, vx_write_register): Cleanup status checking. + #ifdef the code based on which CPU we are using (960 or 68k), + FIXME, this should be completely general but it isn't yet. + (vx_xfer_memory, vx_resume): Cleanup status checking. + (vx_run_files_info): Improve message. + (vx_load_command): Renamed from vx_add_file_command. Allow load + to be interrupted. + (net_ptrace): Remove unused routine. + (vx_wait): Adopt code from vxgdb960 to cope with broken + connections to target machine and prompt to disconnect. Remove + debug printouts. Map some EVENT_'s to SIGnals. + (add_symbol_stub, vx_open): Print names of object files we found, + and "ok" if we read their symbols OK. Clarify output in general. + (vx_attach, vx_detach, vx_kill): Add these commands. + (vx_convert_from_virtual, vx_convert_to_virtual): Simplify. + (vx_run_ops): Turn off all_mem, to avoid spurious msg in the + "info files" output, and create_inferior, since we already have + an inferior. + + * stack.c (frame_info): Replace Frame_unknown with 0. + (print_frame_arg_vars): Handle LOC_LOCAL_ARG. + (return_command): Pop until the PC matches as well as the FP, + so it works even if the FP is shared with another function, + as in "frameless" or "leaf" procedures. + + * symfile.c (load_command): renamed from add_file_target_command. + (add_syms_addr_command): renamed from add_file_addr_command. + (add_syms_command): Stub to call target_add_syms. + (_initialize_symfile): Change command names and descriptions, + add-file => add-syms, and load from alias to its own command. + + * target.c (kill_or_be_killed, maybe_kill_then_attach, + maybe_kill_then_create_inferior): Default for attempts to start + a process, if one is already running, is to ask about killing + it and retry if yes. + (upstack_create_inferior): #if-0 it, strata obsolete it. + (push_target, unpush_target, pop_target): to_close() a target + before unstacking it. + (target_info): Renamed from target_files_info. + (_initialize_targets): Rename "i files" as "i target", accessible + under both names. + + * target.h: Improve comments about the target_ vectored routines. + + * tm-i960.h: Remove NINDY-specific stuff to tm-nindy960.h. + Convert commenting style to standard GNU style. + (DBX_PARM_SYMBOL_CLASS): allow LOC_LOCAL_ARG's to be recognized. + (SKIP_PROLOGUE): No longer a no-op. + (SAVED_PC_AFTER_CALL): Now handles leaf procedures. + (*_REGNUM): Sort register numbers. + (REGISTER_BYTES, REGISTER_BYTE, REGISTER_RAW_SIZE, + MAX_REGISTER_RAW_SIZE, REGISTER_CONVERTIBLE, + REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Float regs + are now 10 byte extendeds, not 8 byte doubles. + (FRAME_CHAIN_VALID): Make this config-dependent, since it differs + for nindy versus vxworks targets. FIXME, this should possibly go + in the target vector. + (EXTRA_FRAME_INFO, INIT_EXTRA_FRAME_INFO): Cache both + frame_saved_regs and arg pointer with each frame. + (FRAMELESS_FUNCTION_INVOCATION): New leafproc support. + (FRAME_ARGS_ADDRESS): Use cached result. + (FRAME_ARGS_ADDRESS_CORRECT): New, avoids g14 guessing. + (FRAME_FIND_SAVED_REGS): Change arg to subsidiary fn. + (PRINT_RAMDON_SIGNAL): Call print_fault. + (POP_FRAME): Now works. + + * tm-nindy960.h: Break this off tm-i960.h. NINDY-specific + option parsing and startup; STACK_END_ADDR, FRAME_CHAIN_VALID, + BREAKPOINT, and DECR_PC_AFTER_BREAK are here. + (ADDITIONAL_OPTION_HANDLER): use target_load, not + target_add_file. + + * tm-vxworks960.h: Break this off tm-i960.h. VxGDB specific + startup; DECR_PC_AFTER_BREAK, and FRAME_CHAIN_VALID are here. + + * valarith.c (value_subscripted_rvalue): Avoid handling + floats and doubles specially; it gave alignment errors. Lint. + + * valops.c (value_of_variable, value_of_this): Error if unknown + value. + + * valprint.c (print_floating): Bcopy rather than pointer-deref, + to avoid alignment problems. + (value_print): Handle unknown value address. + (cplus_val_print): Two args are ignored; remove them. Change caller. + (val_print): Use unpack_long rather than pointer-deref. + + * values.c: Lint. + (unpack_long, unpack_double): Use bcopy rather than pointer-deref + to avoid alignment problems. + (value_being_returned): Error if return value unknown. + (set_return_value): Add bogosity warning, FIXME. * + + * TODO: A woman's work is never done. + + * Makefile.dist: Distribute REMOTE_OBS into tconfig files. + Separate INCLUDE_CFLAGS for use with lint. Add LINTFILES. + Add ieee-float.o to OBS. + * tconfig/{nindy960,vxworks68,vxworks960}: Include the desired + REMOTE_OBS remote-interface files in the TDEPFILES and TM_FILE. + * tconfig/i960: FIXME. Half-merge, produce warning if config'd. + + Changes to generalize the VxWorks RPC protocol slightly, to handle + i960 as well as 68000. + + * vx-share/dbgRpcLib.h (VX_SOURCE_STEP): Add. + * vx-share/reg.h: Produce i960 regs #ifdef I80960 + * vx-share/xdr_ptrace.c: Skip FPA registers if 960. + * vx-share/xdr_rdb.h: Add SOURCE_STEP struct and xdr decl. + * vx-share/xdr_rdb.c: Add xdr_SOURCE_STEP routine. + * vx-share/xdr_regs.c: Add xdr_regs, xdr_fp_status, xdr_ext_fp + for i960. Change xdr_vectors to xdr_opaques for 68k registers, + so they will move in target byte order rather than network + byte order (happens to be the same). + +Mon Feb 25 03:41:44 1991 John Gilmore (gnu at cygint.cygnus.com) + + * tm-convex.h (END_OF_TEXT_DEFAULT): Remove #if 0'd block. + +Sun Feb 24 00:55:53 1991 John Gilmore (gnu at cygint.cygnus.com) + + * am29k-pinsn.c, + Add contribution lines to various files, showing where they + came from. + + * breakpoint.c (break_insn, check_break_insn_size, + read_memory_nobpt): Remove to mem-break.c. + + * xm-*.h, param-no-tm.h, tm-29k.h, valprint.c: Change BYTE_ORDER to + HOST_BYTE_ORDER. + + * tm-29k.h (STAB_REG_TO_REGNUM): Warn user if symbol table + entry has bad register number. This change is not + tested in this release, FIXME. + + * frame.h: Eliminate Frame_unknown in favor of a simple zero. + tm-vax.h: Ditto. + + * value.h: Force value's contents field to be aligned to hold + at least a double or a long long (if supported). This avoids + doing bcopy's in and out of the contents field. + + (step_1): Avoid coredump under obscure circumstances when we + have no frame. + + * symtab.h (misc_info): Add field to misc function vector for + any kind of cached information the target code desires. AMD + 29000 uses this to avoid repeating examine_function_prologue's. + + * coffread.c: Lint. Remove static symfile, read_section_header. + core.c (have_core_file_p): Lint: remove. + expprint.c (print_subexp): Lint. + infptrace.c, valops.c, valprint.c: lint. + + Roll in changes from vxgdb-5.0.1: + + * symtab.h: Comment byte order of each address class. Add + LOC_LOCAL_ARG for frame-relative args (960). + expread.y: Use LOC_LOCAL_ARG where LOC_ARG is used. + symtab.c, symmisc.c: ditto. + + * infrun.c (init_wait_for_inferior): Clear stop_signal. + + * remote.c (remote_resume): Error if resume with a signal. + + * symfile.c (prim_record_misc_function): Clear misc_info. + (fill_in_vptr_fieldno): Check stub type of arg. + + * valops.c (value_cast): Avoid looking up names of types whose + name we don't know, to prevent coredump. Sun CC produces typedef + rtx and the name of *rtx is zero... + +Mon Feb 18 21:16:25 1991 John Gilmore (gnu at cygint.cygnus.com) + + Roll in changes from final AMD 29000 port (Tiemann). + + tconfig/am29k: Add COFF_ENCAPSULATE and TARGET=TARGET_AM29K + for ../include/a.out.encap.h. This might not work now that BFD + is separately compiled. Instead, BFD support for encap will have + to translate machine type 29k into the right COFF_MAGIC. + + * infcmd.c: Remove references to inferior_pid that aren't used + in actual ptrace calls; use target_has_execution, etc. + (have_inferior_p): Remove function. + (program_info): Print target info rather than "process number"; + avoid gratuitous messages unless from_tty. + (run_stack_dummy, finish_command): Set proceed_to_finish. + infrun.c: Remove inferior_pid refs. Decl & init proceed_to_finish. + main.c: Lint. Lose have_inferior_p(). + inferior.h (have_inferior_p): Remove, lint. + (proceed_to_finish): Add flag to ask that all regs be saved + by normal_stop, for the few commands that need it, speeding up + serial I/O. Add comments to stop_registers. + + * remote-eb.c: Remove newline from breakpoint message we grep + for. Never time out when running the user program. + + + +Wed Feb 13 15:34:40 1991 John Gilmore (gnu at cygint.cygnus.com) + + Roll in changes from vxgdb-5.0.1: + + * dbxread.c (read_dbx_symtab): If we encounter a "FORTRAN COMMON" + symbol in its raw form, we are processing an unlinked ".o" file. + See if the target environment has assigned it an address, using + target_lookup_symbol (VxWorks does), and enter it into the symtab + that way. + + * tm-vxworks.h (FRAME_CHAIN, FRAME_CHAIN_VALID): Override usual + 68k versions for a simpler version that assumes zero FP at bottom. + Fixes bug of truncated stack reports. + + * target.h (target_lookup_symbol): Define this routine's args + and result, finally. + + * target.c (nosymbol): Default routine for target_lookup_symbol. + (target_default): Default lookup_symbol and call_function too. + (files_info): Only print has_all_memory warning if a non-dummy + target follows. + + * remote-vx.c (vx_read_register, vx_convert_to_virtual, + vx_convert_from_virtual): If target does not have floating point, + zero register "values", and avoid doing cross-net conversions. + (vx_lookup_symbol): Rename net_lookup_symbol, add to vectors. + (vx_open): Rearrange code that attaches to target and reads + symbols for all loaded modules, to work if some of the modules + are not accessible. Add symbol_stub() and add_symbol_stub() + as callbacks from catch_errors(). Allow connect attempt to be + interrupted painlessly with ^C (FIXME, there are still some bugs + if the interrupt happens during symbol reading.). Print + final message with puts_filtered, since symbol messages are + now filtered too. + + Misc cleanup: + + * main.c (catch_errors): Only print errstring if non-null. + (command_loop): Avoid an ioctl per command to test ISATTY. + + * remote-vx.c (net_load): make static; avoid sophomoric msg. + (vx_xfer_memory): Return correct result! + (vx_files_info): Indicate whether target has float or not. + (vx_lookup_symbol): Complain, not error, if target gone. + (vx_open): Print "Connected" msg before disabling immediate-quit. + [FIXME: lookup_symbol and vx_open changes need testing.] + + target.c, remote-eb.c, inftarg.c, am29k-opcode.h, target.h, + tm-29k.h, tmm-vxworks68.h, symfile.c, gdb-int.texinfo: Add + contributor lines and update copyrights to 1991. + + Changes from an attempted H-PUX host port: + + * infptrace.c (PT_ATTACH, PT_DETACH): Handle HP/UX, which + defines PT_ATTACH and PT_DETACH but not PT_KILL. + * remote-eb.c (eb_open): Misplaced endif kills sysv H/PUX. + * remote-vx.c: include <sys/time.h> for HPUX. + * hp300hpux-xdep.c (fetch_core_registers): Rewrite old + "core_file_command" routine to BFD regime. May not work yet. + + Attempted port of "gdb-3.4 Van Jacobson xgdb" to modern gdb. + + * xgdb.c: Replace X10 version with some VJ version. + (FIXME: Its copyright assignment is not on record.) + * xgdb.c: Update include files to X11R4 (Xaw crud). + (xgdb_display_source, create_text_widget): fix call to + get_filename_and_charpos. Rewack source window stuff for X11R4 + (gleaned from include files, and "nm's" of binary libraries, since + I had no doc available). + (append_selection, append_selection_word): Disable with FIXME + since R4 changed interface here. + (create_buttons): Add back the old set of buttons. + (xgdb_create_window): Fix call to XtInitialize (&argc not argc). + + * Makefile.dist (xgdb, xgdb-init.c): Update for X11R4 on Suns. + Roll VERSION to 3.94 (not yet final though). + +Sat Feb 9 09:46:25 1991 John Gilmore (gnu at cygint.cygnus.com) + + * obstack.h (obstack_ptr_grow, obstack_ptr_grow_fast, + obstack_int_grow, obstack_int_grow_fast): Eliminate + cast on left of assignment, which gives MIPS cc fits and is + not Standard C. + + * sparc-pinsn.c (print_insn): Eliminate 'set' test, subsumed by + F_ALIAS. Use printf, not fprintf, when not passing a file + pointer... + (compare_opcodes): Check that identical instructions have + identical opcodes, complain otherwise. + + * sparc-opcode.h (st %fsr): Fix opcode "lose" mask. This + was reported by Roland McGrath. + (unimp): Only match if exactly zero instruction. (Roland) + (branches and traps): Generate all variations of these + instructions with macros, based on a single call that defines + each condition name and its binary representation. + (set): Turn on alias bit, to avoid test in sparc-pinsn.c. + + * valprint.c (val_print_fields): Take, and use, format parameter. + This means that "p/x struct" again prints the elements in the + desired format. Changed callers. + + * stack.c (frame_info): Use filtered output, and indicate wrap + points. Remove kludgy formatting designed to avoid line wrap. + + * utils.c (wrap_here): If the line is already full (because + we had printed a long indent or long wrapped string), do an + immediate newline-and-indent. + + * m68k-pinsn.c (print_insn_arg): Bugfix from + ntmtv!thompson@ames.arc.nasa.gov (Mike Thompson): 'bkpt #0' + instruction is incorrectly disassembled as bkpt #8. + + * dbxread.c (end_psymtab): Bugfix from Peter Schauer + <pesrem@regent.e-technik.tu-muenchen.de>: If you want to set a + breakpoint in a *.y file gdb will say Reading in symbols for *.y... + and then will dump core (sometimes). I traced it back to an + uninitialized symfile_name in psymtab_to_symtab. + (const_vol_complaint): Add quotes to message. + (define_symbol): Only believe line number if gcc_compiled. + Avoid allocating symbol if we will not return it. + + Add target strata support so that newly established targets go + into their right place in the target stack (e.g. a new exec file + doesn't wipe out the ability to access the running process). + + * target.h, core.c, exec.c, inftarg.c, remote-eb.c, + remote-nindy.c, remote-vx.c, remote.c, target.c: Add to_stratum + and initialize it properly in all the targets. + + * target.h: Document strata. Change return type of push_target. + + * target.c (nomemory): new function for dummy memory access. + (tcomplain): Rename complain, now also used in symfile.c. + (push_target): Push targets within strata. New return value shows + whether new target is on top of stack or not. Always keep dummy + target on stack. + (target_files_info): Ignore dummy target. + + * core.c (core_open): Warn user, and skip accessing file, if the + core target is not the topmost target in the stack. + * remote-nindy.c (nindy_create_inferior): Avoid unpush_target, now + already handled. + + * remote-vx.c: Remove vx_prepare_to_store from vxworks memory + target_ops, it doesn't belong there since we have no regs there. + Change name of target from machine => memory to clarify. + +Thu Feb 7 16:32:09 1991 John Gilmore (gnu at spiff.cygnus.com) + + * Freeze version 3.93 for release. + + * Makefile.dist: Handle vx-share and nindy-share subdirs + properly when building gdb.tar.Z. + + * symtab.c: lint; add no_symtab_msg to consolidate the messages + printed in various places, so I could change just one copy. + + * dbxread.c, coffread.c: Change references to bfd->iostream + to cast to FILE *, now that BFD avoids needing types defined + in other header files. + +Tue Feb 5 21:39:35 1991 John Gilmore (gnu at cygint.cygnus.com) + + * command.c, dbxread.c, expprint.c, infcmd.c, infptrace.c, + infrun.c, printcmd.c, remote-nindy.c, source.c, sparc-tdep.c, + sparc-xdep.c, symfile.h, symmisc.c, utils.c, valprint.c: Lint + (actually gcc -Wall). + + * dbxread.c: Remove first_global_sym, last_global_sym, since + they are never referenced. + + * defs.h (baud_rate): Declare. + main.c: Define it, and add the -b option to set it. + + * gdb-int.texinfo: Add text on how to define a new host or target + architecture, prompted by Per Bothner's questions about MIPS + support. + + * gdb.texinfo: Document "complaints". Change doc of -q since + gdb no longer prints the copyright and blurb if you specify a file + name to be debugged (just like Emacs). Add doc for Nindy-specific + command line flags for specifying target serial port and such. + Update copyright to 1991. + + * gdbcore.h: Remove a large mass of now-useless crud, since BFD + has taken over for us the job of ripping up executable files. The + crud caused Per Bothner's port to not compile. + + * infrun.c (normal_stop): Avoid printing "Program exited + normally" if we are in batch mode. This allows a GDB which + executes a program on a target system, to behave like a Unix + command (input from stdin, output to stdout, no extraneous + output). + + * main.c (main): Allow additional machine-dependent command line + options to be specified with the ADDITIONAL_OPTIONS, + ADDITIONAL_OPTION_CASES, ADDITIONAL_OPTION_HELP, and + ADDITIONAL_OPTION_HANDLER macros. Also allow machine-dependent + processing to occur just before the main loop with + BEFORE_MAIN_LOOP_HOOK. + (main): If a "core file" argument is specified, and it is not a + core file, try it as a process ID to attach. + (symbol_completion_function): Attempt to cope with + "show screen-" TAB, not very successfully. This needs more work, + FIXME. + (batch_file): New function, returns whether we are reading + commands from an interactive tty on stdin, or from somewhere else. + Called by normal_stop since it doesn't get from_tty passed down + to it like many commands do. + + * remote-nindy.c: Handle command line options for nindy + connection. + (nindy_before_main_loop): Prompt user for tty name if they + don't specify it before getting to the interactive command loop. + + * tm-i960.c: Add ADDITIONAL_OPTIONS, etc, to handle -O, -brk, + and -r command line options. Also add hook before main loop + to make it easy to specify a tty. + + * TODO: More things to do, one done. + +Mon Feb 4 23:57:39 1991 John Gilmore and Mike Tiemann (at cygint.cygnus.com) + + * dbxread.c: Make complaint() calls pass pointer, not struct. + Add complaints about badly formatted C++ type information + (const/volatile indicator, and parse errors resulting in + error_type). Fix C++ virtual member fn comment. + (read_struct_type): Avoid bumping pointer if we got a parse + error; this prevents our walking beyond the end of a string. + Terminate loop on null char as well as semicolon. + (process_one_symbol): Fix the LBRAC fix so that it uses the + last previous SLINE, FUN, or SO record's PC address. C++ debug + symbols did not have SLINE records in a useful order compared + to the LBRAC records. + (define_symbol): Handle "catch" records. + + * symtab.c (check_stub_type): Added new complain + `stub_noname_complain' and added a consistency check to + keep the debugger from crashing when finishing from an + exception frame. A real fix will be needed later. + +Sat Feb 2 10:43:05 1991 John Gilmore (gnu at cygint.cygnus.com) + + * infcmd.c (attach_command): Make global. + + * Makefile.dist (REMOTE_OBS): Make these compile by default, + but make them easy to comment out. Perhaps later they should + be enabled by what CPU you configure for? FIXME. + (VERSION): Roll to 3.93. + (pinsn.o): Remove rule for obsolete file. + (dbxread.o,coffread.o,mipsread.o): Use ${srcdir} explicitly. + + Run down a problem that manifested by printing the wrong function + name in stack traces of read_ofile_symtab. Turned out that the + problem was the SunOS 4.1.1 (and previous) C compiler outputs + the LBRAC symbol with an address in the *data* segment, which + blew our binary search through the blocks. + + * dbxread.c: Use the complain() facility consistently to bitch + about problems in the symbol file we are reading. + (finish_block): Add code to check the nesting of the blocks; + complain and Procrust them to fit if wrong. + (make_blockvector): Check the order of the blocks, complain + [but don't cope] if wrong. + (process_one_symbol): ifndef SUN_FIXED_LBRAC_BUG, check LBRAC + symbols to be sure their PC value is greater than the last SLINE + (line number) symbol we've seen, complaining and adopting the + SLINE PC value if wrong. + + * symfile.h (struct complaint, complaint_root, complain, + clear_complaints): Add. + * symfile.c (complain, complaint_root, clear_complaints): Add + facility to deal with non-fatal complaints and to regularize their + suppression. + (symbol_file_add): Clear complaint counters to allow new complaints. + (initialize_symfile): Add 'set complaints' and 'show complaints'. + + * dbxread.c (dbx_symfile_read): Remember the address and size + of the string table for the main symbol file, so we won't read it + more than once. + (dbx_psymtab_to_symtab): Fix the check for main symbol file, + to avoid reading the string table yet again. Lint. + (throughout): Improve filtered output, including word wrap. + (read_range_type): Improve Bothner's fix to handle other types too. + + * utils.c: Improve line wrap implementation. Handle unlimited + width by making chars_per_line unsigned. + (puts_filtered): New, easy, function. + + * defs.h (puts_filtered): add. + + * mipsread.c (compare_symbols, sort_symtab): Remove these fns, + call the identical sort_symtab_syms() in symfile.c instead. + + * expread.y: Suggest the `file' command rather than `symbol-file'. + + * command.h (enum var_types): Add zinteger for seroable + unsigned integer. + * command.c (do_setshow_command): Handle var_zinteger. Restructure + nested if's into a switch. + + * breakpoint.c (bpstat_print): If bpstat "print" flag is not set, + we did not stop because of a breakpoint (it must have been for + some other reason, like a "stepi"), so don't print anything. + + * symtab.c: Include <sys/types.h> all the time. Now that BFD + doesn't include <sys/types.h>, old SunOS's require it for + <sys/stat.h>. + +Sat Feb 2 10:39:15 1991 Per Bothner (bothner@cs.wisc.edu) + + A test port of gdb-3.92.6 to the Sony NEWS. + + * Makefile.dist + Don't normally link in remote- or vx stuff. + Some of it doesn't compile, and it wastes space for 99% of the users. + Remove reference to no-longer-used HAVE_VPRINTF. + Fixed BFD_DEP typo to BFD_DIR. + * dbxread.c + Fix cast in arg to bfd_h_getlong. + Make char *prefix be const. + Fix how certain range types are mapped into builtin unsigned int types. + * infrun.c + Remove 2 #includes. They cause errors (on Sony, at least), + and aren't needed (they wern't in earlier versions). + * printcmd.c + print_address_symbolic should never demangle labels + (since it prints *assembler-level* labels). + + [This was superseded by the change to printcmd below.] + + * utils.c + Add some "volatile" return types to avoid warnings. + If MISSING_VPRINTF add vprintf function and not just macro + (since vprintf is used in printcmd.c). + * valprint.c + Unless __GNUC__, use obstack_grow instead of obstack_ptr_grow. + (The latter isn't grokked by some PCC-based compilers.) + + [This change is in abeyance, we prefer to fix obstack_ptr_grow.] + + Make chunk size of dont_print_obstack 32*4 instead of default 4096. + * nindy-share/coffstrip.c + Added some forward declarations (otherwise, gcc complains + about implicit extern redefined as static). + +Sun Jan 20 02:38:19 1991 John Gilmore (gnu at cygint.cygnus.com) + + Changes inspired by Per Bothner: + * printcmd.c (print_address_symbolic): Take additional parameter + specifying whether to demangle. + (print_address): Pass in asm_demangle to control demangling. + (print_address_demangle): New fn, takes explicit arg to control + demangling. + * utils.c: Add new vars demangle and asm_demangle, and let them + be set and shown. + (fputs_demangled): If !demangle, just print the argument. + (fprint_symbol): If !demangle, just print raw symbol. + * valprint.c (val_print): Call print_address_demangle rather than + print_address, to cause demangling to depend on the global + rather than assembler-level demangling setting. + * WHATS.NEW, gdb.texinfo: Document. + + * main.c (show_command): Show all settings if no arg. + (initialize_main): Make "info set" the same as naked "show". + * command.c (cmd_show_list): Handle prefix commands in the + list, and print the name of the setting as well as its English + description and value. + + Allow gdb functions to specify where a line should wrap if it + exceeds the size of a terminal line. Use it to make the output + prettier. + * utils.c (set_screen_width_command): New fn, mallocs a buffer + of the right size when screen width changes. + (set_screensize_command, screensize_info): Remove #if 0'd fns. + (wrap_here): New fn, indicates a point in the output where we + should wrap the line rather than just letting it overflow at a + random place. + (fputs_filtered): Implement wrapping. + (n_spaces): New fn, returns a pointer to N spaces. + (print_spaces_filtered): Use n_spaces. + * defs.h (n_spaces): Declare. + * stack.c (print_frame_info): Wrap with 4-space indent after + fn name and before filename and line number. + * printcmd.c (print_frame_args): Wrap with 4-space indent + before each argument name is printed. + * valprint.c (value_print): Wrap with no indentation before + each repetition. + (val_print_fields): Wrap with indentation relative to nesting + level before each field name. + (val_print): Wrap with nesting indentation before array elements. + * command.c (do_setshow_command): Avoid extra newlines, + wrap with 4-space indent around values printed, end with period. + * WHATS.NEW, gdb.texinfo, gdb-int.texinfo: Document. + + * breakpoint.c (breakpoint_1): Implement addressprint for + "info breakpoints" display. Change file name and line number + format to " at file:nnn" rather than " (file line nnn)". + * gdb.texinfo: Document. + + +Fri Jan 18 07:21:25 1991 John Gilmore (gnu at cygint.cygnus.com) + + Frozen for gdb-3.92.6 release. + + README, WHATS.NEW: Update for 3.92.6 release. + + tconfig/{altos, i386v, i386v32, m88k, umax}: Eliminate + coffread.o from configs since it is now built by default. + tconfig/{3b1, altosgas, arm, convex, hp300bsd, hp300hpux, + i386v-g, i386v32-g, isi, merlin, news, news1000, np1, pn, + pyramid, symmetry, vax, vxworks68}: Eliminate dbxread.o + from configs since it is now built by default. + + Makefile.dist: Update for release 3.92.6. Handle files that + have been moved to ../include, ../getopt, or ../bfd. Add + saber.suppress and tests directory. Add config.status to + the release (it will say "none"). + + coredep.c: Minor formatting fixes. + + These changes were made in early December but only checked in now: + * nindy-share/Onindy.c, nindy-share/coffstrip.c, + nindy-share/nindy.c: lint + * nindy-share/nindy.c (ninStopWhy): Don't byteswap the + register values coming back from the target; we store values + in target byte order everywhere. + +Wed Jan 16 19:01:37 1991 John Gilmore (gnu at cygint.cygnus.com) + + * am29k-opcode.h, am29k-pinsn.c: Add 29050 opcodes. + + * valprint.c (cplus_val_print, val_print_fields): New functions, + which print C++ objects. They conspire to avoid printing a + virtual base class more than once, following all the twists and + turns of C++ virtual base rules. + (val_print): Call the above rather than do it by hand. + + * symfile.c (symbol_file_add): Only reset symfile_mtime for main + symbol file, not for added files like shared libs. This really + needs to be generalized to a timestamp per file. + + * core.c (cleanup_core): Avoid coredump if no core file. + + * config.gdb: Accept -host or -target in place of +host or + +target. + + * coffread.c (find_linenos): Avoid desupported BFD interface + to line numbers. We still read them manually rather than using + BFD's "generic" features. + + * gdbrc.tex, threecol.tex: Add GDB reference card and its + formatting code. + Makefile.dist: Add refcard to OTHERS list for creating tar files. + + * Makefile.dist: Eliminate use of $< in explicit targets. + + * readline/Makefile: Use $< rather than $*.c, which does not + include the VPATH in GNU Make. + + * tconfig/i960-bout, tconfig/i960-coff: These are identical + copies of tconfig/i960, added for global configuration + compatability. All i960 versions can read both coff and b.out. + + * tm-88k.h: Fix multiline macro that lacked \'s. Remove + COFF_FORMAT and COFF_CHECK_X_ZEROES since these are now handled + automaticaly. + + * TODO: Think of more things to do. + +Wed Jan 2 19:09:29 1991 John Gilmore (gnu at spiff.cygnus.com) + + tconfig/{am29k,i960,sun2*,sun3*,sun4*}: Eliminate config + of sdb versus dbx debug symbols. Add kludge for 68881 80-bit to + 64-bit float conversion. + + tconfig/sun4, tconfig/sun3, xconfig/sun4, xconfig/sun3: Make + equivalent to sun?os4 so global config works. + +Wed Jan 2 18:20:51 1991 John Gilmore (gnu at spiff.cygnus.com) + + Fix from Eberhard Mattes <mattes@azu.informatik.uni-stuttgart.de> + + * main.c: Only declare linesize once; declare pagesize not at + all, since it is never used. + (main): Clear newly allocated line before it is used. + +Fri Dec 28 00:13:42 1990 John Gilmore (gnu at cygint) + + Further stabilization for the Intel 960. + + * Makefile.dist: Parameterize the location of the "include" + and "bfd" directories, as well as "getopt". Add symfile.c. + Link in both dbxread and coffread. Fix up "make depend" to + rewack the locations of include, bfd, and getopt in its output. + + * README: Document moving include files, improve some of + the other doc. + + * coffread.c: Move common code out to symfile.c. Change + symbol_file_command style interface to use new *_symfile_init + and *_symfile_read interface under BFD. Use BFD internal + info to locate line table, symbols, etc. + + * core.c (core_fetch_registers): Rename to get_core_registers + to avoid confusion with fetch_core_registers. + (register_addr): Move to coredep.c, which is already machine + dependent. This leaves core.c pretty clean of dependencies. + + * coredep.c (register_addr): Accept this routine from core.c. + + * dbxread.c: Move common code (with coffread.c, etc) into new + symfile.c. Each psymtab now contains a pointer to the + format-dependent function that knows how to read it in. Make + some things static. + (dbx_psymtab_to_symtab): Renamed from psymtab_to_symtab_2. + (process_one_symbol): Add code to complain about a "compiler bug + we muzzle here", if we actually see it. + + * eval.c (evaluate_subexp): Insert missing "break" statements + in code that determines whether a variable is an lvalue in + memory, register, or whatever. I detected this via a compiler + bug in which it *almost* mashed out the whole switch statement. + + * gdb-int.texinfo: Add minor sections on configuring gdb for + release, and about the README file. + + * infcmd.c (registers_info): Fix formatting somewhat. Still + not as pretty as before, but it handles byte swapping. + + * remote-nindy.c: If data cache routines are interrupted while + waiting for the remote end, be sure that any uninitialized cache + blocks are on the free list, not on the valid list! + + * symfile.h: Flesh out this header file with all the various + routines and variables that have been merged in from dbxread.c + coffread.c, and symtab.c to symfile.c. + + * symfile.c: New file, containing code common to dbxread.c, + coffread.c, and some code from symtab.c. All generic code for + reading symbol files should be in here now. + (unrecord_misc_function): Remove unused function. + + * symtab.h: Remove file-reading things to symfile.h. + + * symtab.c: Remove file-reading things to symfile.c. + + * tm-i960.h: Fix FRAME_CHAIN types; define PRINT_RANDOM_SIGNAL + to decode i960 fault types. + + * target.h, remote.c, remote-eb.c, remote-vx.c, remote-nindy.c, + target.c: Change type of the "resume" function from int to void, + since its result was never used. + +Sat Dec 22 02:51:40 1990 John Gilmore (gnu at cygint) + + * main.c: Replace "stupid" with "caution"; you now "set caution + on or off". + + * printcmd.c (print_scalar_formatted): Fix typo in 'g' format + + * infcmd.c (do_registers_info): Call val_print to deal with the + byte order of the registers being printed. FIXME, this makes + the formatting of the output uglier. + + * infcmd.c (wait_for_inferior): If PRINT_RANDOM_SIGNAL is + defined, call it for signals the debugger doesn't itself use. + The i960 uses this for more detailed fault information. + + * remote.c (remote_open): If arg is null, print help rather than + dumping core. + + * sparc-xdep.c (register_valid): Avoid declaring size, since + various modules will think of various sizes depending on the + architecture of their tm-file. FIXME, we need protection against + actually entering one of those modules, which would clobber + storage if not for the target architecture compiled into gdb. + + * stack.c (up_command, down_command): Always print the frame + you arrive at. + (up_silently_command, down_silently_command): New commands + for use in scripts. + + * i960-pinsn.c (reg), i960-tdep.c: Lint. + + * i960-tdep.c (i960_frame_chain_valid): Lookup_symbol now takes + more parameters than it used to. + + * findvar.c (registers): Increase slop to 256 bytes, which should + protect us against even most RISC machines with large register + sets. + (locate_var_value): Move declaration inside related ifdef. + + * remote-nindy.c (): Use TIOCSETN rather than TIOCSETP + throughout, to avoid throwing away buffered input from the board. + (nindy_wait): Supply_register takes addr_of_value, not value. + (i960_print_fault): Renamed from i80960_fault. + (nindy_fetch_registers): Avoid have_regs stuff, just get them. + (nindy_store_registers): Avoid regs_changed stuff, just stuff + them. + (nindy_create_inferior): Don't bother to write PC_REGNUM since + we can set the PC in the call to proceed(). Unpush nindy_ops + before pushing it on top, to avoid message to user. Eliminate + commentary from Unix machines that just misleads here. + (reset_command): Fix error message to suggest target command. + +Wed Dec 19 11:03:56 1990 John Gilmore (gnu at cygint) + + Release 3.92.5 as frozen. + + Stabilize the merged release...with help from lint, Saber C, + gcc -W, etc. + + Everywhere: Add include files needed to declare return types + of functions called. + + * gdb.texinfo: Roland Pesch is documenting gdb, glory be! + + * breakpoint.h: Add undeclared breakpoint functions, and some + functions for display handling since I couldn't think of a better + .h to put them in. + + * breakpoint.c (insert_breakpoints): Make code for disabling + shared library bkpts more likely to work. It's used when we + rerun a program and stop before the shared library has been + mapped in. + (breakpoint_cond_eval, bpstat_stop_status): Pass arg as int, + cast from pointer, so it squeezes through catch_errors. + (bpstat_stop_status): Fix logic broken some time ago. We now + always create a bpstat if the stop address matches a breakpoint, + even if we don't stop there -- just like the old code used to do + before I got my fingers into it (sigh). + (breakpoint_1): Print "ignore count" after "stop only if" + condition, since that's how it actually works. + (mention): Handle watchpoints as well as breakpoints. + (watch_command): use set_raw_breakpoint and mention to do most + of the work (and initialize all the fields!). Only pass one + arg to parse_c_expression, since that's all it takes. + + * command.c (not_just_help_class_command): Rename arg to args + since we ignore "unused argument" warnings on vars named "args". + inflow.c (child_terminal_info): ditto. + infptrace.c (kill_inferior): ditto + main.c (catch_errors, version_info, quit_command, pwd_command, + source_command, dump_me_command, editing_info, + set_history_size_command, set_history, show_history, + set_verbose): ditto + stack.c (locals_info): ditto + target.c (target_files_info): ditto + valprint.c (set_input_radix, set_output_radix): ditto + + * core.c: Remove old variables for handling core and exec file + sections (data_start, data_end, stack_start, stack_end, + reg_stack_start, reg_stack_end, reg_stack_offset, text_start, + text_end, exec_data_start, exec_data_end, text_offset, + exec_data_offset, data_offset, stack_offset). They're + superseded the more general build_section_table and + xfer_memory. + (get_exec_file): Mention the `file' command. + (read_memory_check): Rename to memory_error, and only call it + in the case of an actual error. + (read_memory, write_memory): call memory_error. + (core_fetch_registers): Register section name is ".reg". + + coredep.c: Remove a bunch of crud now that all this file does + is pull the registers out of a core file. + (fetch_core_registers): Rewrite to actually work, I hope. + + dbxread.c: Use a.out.gnu.h, not system a.out, now. + Replace index() with strchr(). Remove all the pre-BFD macro + definitions for accessing the symbol file. + (struct dbx_symfile_info): Encapsulate the information that + dbx_symfile_init needs to pass to dbx_symfile_read in this + struct. + + (dbx_new_init, dbx_symfile_init, dbx_symfile_read, + dbx_symfile_discard): Rearrange symbol file reading to divide + the format-specific part from the format-independent part, + leaving the format-independent part such as file name expansion + and opening in symtab.c. This replaces + partial_symbol_file_open and partial_symbol_file_read. + Symbol_file_read, add_file, add_file_target_command, + add_file_addr_command move to symtab.c. Pass an explicit + "mainline" flag for when reading the main symbol table, rather + than relying on the offset address to be zero or nonzero. + + (dbx_symfile_read): Don't allow void *'s to be printed as + typedefs. + (SWAP_SYMBOL): Use bfd routines to byte-swap the symbols. + (ADD_PSYMBOL_TO_LIST): Make the "function call rather than + macro" debug version really work. + (read_dbx_symtab): Remove unref'd parameter inclink. + Avoid swapping N_SLINE symbols, for speed. + Merge N_TEXT!N_EXT case with the other external symbol + definitions' case. Add comments. + (start_psymtab): Allocate the symfile name in the psymtab on + the psymbol_obstack, rather than using the caller's storage. + (end_psymtab): Only allocate a dependencies list if there are + more than zero. + (psymtab_to_symtab_2): Use BFD when reopening file to read + its symbols for real. + (read_struct_type): Add FIXME comments where it needs work + for C++ bogosity. + (read_huge_number): Add FIXME about overflows. + (read_range_type): Add FIXME about comparing a long to 1<<32. + + * coffread.c: Minor changes to move things closer to the new + regime with symtab.c and dbxread.c Major work is still needed + here. + + * exec.c (exec_file_command): Remove old variables (see core.c + above). + (xfer_memory): If memory transfer is right at the end of a + section, don't lose. + + * findvar.c (get_saved_register): If value is in a real + register, LVAL is lval_register, not lval_memory. + + frame.h: Declare print_sel_frame and record_selected_frame. + + gdb-int.texinfo: New file, for GDB internals documentation. + Very simple, unformatted doc of cleanups is there for now. + + gdbcore.h: Remove obsolete variables that described a.out + section addresses and offsets. (See core.c above.) + Declare fetch_core_registers and registers_fetched. + + getopt.c: Declare char *alloca(); even on SPARC. + + infcmd.c (run_command): Call target_kill rather than + kill_inferior. + (step_command, next_command, stepi_command, nexti_command): + Declare from_tty parameter even though we don't use it. + (run_stack_dummy): argument BUFFER is a char array, not + a pointer to REGISTER_TYPE. + (finish_command): using_struct_return needed a value *, + not a struct symbol *. + + * infptrace.c (child_xfer_memory): To avoid dependency on + where sections are in memory, try PT_WRITE_D and if that fails, + try PT_WRITE_I. Most Unixes don't care which you use. + + * infrun.c (step_resume_break_shadow): Change to array to + match other breakpoint shadow storage. + (clear_proceed_status): Pass address of bpstat to + bpstat_clear, not the bpstat itself. + (child_create_inferior): FIXME comment about if the child + exits. + (start_inferior): Remove old function. + (child_open): Use target_kill rather than kill_inferior. + (wait_for_inferior): Ditto. + (insert_step_breakpoint, remote_step_breakpoint): Use + new step_resume_break_shadow. + + * inftarg.c (child_wait): If all child processes die, + pretend that the one being waited for exited with signal 42. + + * main.c (command_line_input): When scanning for comments, + don't coredump on unclosed quotes. + (quit_command): Use target_kill rther than kill_inferior. + (_initialize_main): Rename class_user from "user" to + "user-defined". + + * printcmd.c (print_command_1): Initialize "fmt" if no format + is specified by the user. + (print_frame_args): Only add to args_printed if we are + actually fetching args from the stack (avoiding undefined + arg_size). + (_initialize_printcmd): Remove bogus \{ from string. + + * remote-eb.c (eb_open): Avoid coredump on no argument. + + * remote-nindy.c: Bring out of Intel environment into new + target environment. Remove all conditional compilation on + I80960. Massive hacking throughout. + (nindy_xfer_inferior_memory): New routine stolen from + infptrace.c. + (nindy_create_inferior): New routine pieced together, probably + not quite working yet. + (nindy_ops): New target_ops struct for nindy. + + * remote-vx.c: Use write_memory rather than target_write_memory + to get error checking. + (vx_add_file_command, vx_open): Use symbol_file_add rather than + add_file. + (vx_create_inferior): Use target_terminal_ours... + + * signame.c (_initialize_signame): Always initialize, since + we need the table for things other than psignal. + + * solib.c (solib_add): Use symbol_file_add, not add_file. + (solib_address): Return boolean result rather than struct + pointer which nobody else knows the type of. + + * sparc-tdep.c, valops.c: Use write_memory rather than + target_write_memory, to get error checking. + + * stack.c (locals_info, catch_info, args_info, + get_selected_block, frame_command, up_command): Use + target_has_stack, rather than have_inferior_p or + have_core_file_p. + + * sun3-xdep.c (fetch_core_registers): Rewrite for new BFD regime. + + * symfile.h: New file, defining the interface between the + generic and object-file-specific symbol reading code. + + * symtab.c: Move generic symbol-reading interface to symtab.c, + from dbxread.c, coffread.c, mipsread.c, etc. Add symtab_fns + table to map BFD targets to symbol-reading modules in GDB. + Change index to strchr. + (lookup_struct_elt_type): Use error() rather than hand-made + simulations thereof. + (lookup_partial_symbol): Speedup slightly when length == 0. + (symbol_file_add): New function. + (symbol_file_command): Call it. + (symfile_open, symfile_init): New function. + (add_file_target_command, add_file_addr_command): moved from + dbxread.c. + + * target.c (target_command): use target_kill. + + * target.h (target_files_info): Don't declare, never called + from outside. + + * tm-sun2.h, tm-sun3.h (STACK_END_ADDR): Use system include + files to determine stack end address. + + * valarith.c (value_x_binop, value_x_unop): Change error message + to be more useful. Pass proper argument to value_struct_elt. + + * valops.c (value_assign): FIXME comment that long long + bitfields will break here. + + * Makefile.dist: Add symfile.h, remote-nindy.c, remote-eb.c. + Update `make saber_gdb' to work better. + + * TODO: A woman's work is never done. + + * cplus-dem.c, environ.c, inferior.h, infrun.c, inftarg.c, + main.c, obstack.c, printcmd.c, remote-eb.c, remote-nindy.c, + remote-vx.c, remote.c, solib.c, source.c, sparc-pinsn.c, + sparc-tdep.c, sparc-xdep.c, symmisc.c, symtab.c, symtab.h + target.c, terminal.h, tm-sparc.h, tm-sunos.h, utils.c, + valops.c, valprint.c, exec.c: Lint. + + +Wed Dec 12 23:44:15 1990 John Gilmore (gnu at cygnus.com) + + Continuing Intel 960 port merge of GDB. + + * Makefile.dist: Merge i960 "nindy-share" files. Rename + malloc.h to gmalloc.h to avoid name conflicts in /usr/include. + Don't ship gdb.dvi in tar file. Link gdb with init.o, not init.c. + Wack over "make depend" so it handles files in subdirectories + vx-share, nindy-share, bfd, and in the current directory. + + * blockframe.c (get_prev_frame_info): Remove fatal error + if stack not defined. + + * core.c (core_open, core_detach): New functions that handle + the old "core-file" command as "target core" and "detach" instead. + (core_file_command): Call them. + (core_xfer_memory): Use common routine xfer_memory. + + * dbxread.c: Include a.out.gnu.h, not system a.out.h. + dbxread now uses bfd for everything but symbol reading itself. + BFD internals are used to drag out the relevant file offsets. + (partial_symbol_file_open): Change args all around for BFD. + + * symtab.c: Rename "value" to "val" everywhere, so we can + #include "value.h". + (symbol_file_command): New command, moved from dbxread.c + and coffread.c. It uses BFD to read the file, then vectors + based on its type, to dbx or coff symbol readers. + * symtab.h: Extern a few vars for symbol_file_command. + + * target.h: Breakpoint takes a char * save area, not a char **. + + * valprint.c (val_print): When unpacking bitfields, offset + the address in gdb of the value, if it is declared with a shorter + type. Remove the last "runtime kludge test" of host byte order. + + * utils.c: Remove old my_bfd_read routine. + + * stack.c (frame_info): Use target_has_stack. Print program counter + register's actual name rather than "pc", since it's called the + "ip" (instruction pointer) on the i960 (sigh). + + * target.c (target_command): Add command for selecting a target + type and calling its open routine. This is used for initiating + communication with a particular target, in a generic way. + + * tm-i960.h: Update for modern gdb. Remove semicolons from + various macros. Handle reading struct return convention, and + error-out attempts to return structs with the "return" command. + Be sure gdb doesn't think we know how to call functions in the + inferior. + + * i960-tdep.c: Rename FRAME_CHAIN_VALID and FRAME_FIND_SAVED_REGS + to i960_xxx in lower case. + (arg_address): Circumvent errors due to LOC_ARG_BLOCK + not being defined yet. + + * remote.c (remote_open): Call start_remote to initialize + wait_for_inferior during open. + (remote_xfer_inferior_memory): Return length written rather + than errno value. + + * remote-vx.c (target_command -> vx_open): Use new generic + target command. + * remote-eb.c, inftarg.c, exec.c: ditto. + + * infrun.c: Fix comments. + (attach_program -> child_open): Use new generic target command. + (wait_for_inferior): Clear saved register values before target_wait, + so target_wait can set some of them if convenient. + + * infptrace.c (fetch_inferior_registers, store_inferior_registers): + Return success indicator, not void. + (child_xfer_memory): Avoid fetching initial word if we'll + overwrite it anyway. + + * infcmd.c (attach_command): Use new generic target open routine. + (_initialize_infcmd): Update doc on attach and detach commands. + (do_registers_info): Merge in a byte-order problem as a FIXME + comment. + + * findvar.c (find_saved_register): Avoid problem in current frame. + (read_relative_register): Ditto. + (write_register): Convert byte order on the way out. + + * exec.c (file_command): Add. + (add_to_section_table, exec_command): Use new bfd_map_over_sections. + (xfer_memory): Common function between core_xfer_memory and + exec_xfer_memory. + (exec_xfer_memory): Use it. + + * pn-opcode.h: Document that a "PN" is a Gould PowerNode. + + * breakpoint.c, breakpoint.h, symtab.h, value.h, frame.h, utils.c, + valops.c, stack.c, target.c, sparc-xdep.c, source.c, printcmd.c, + infcmd.c, i960-pinsn.c, eval.c, defs.h: lint and gcc -Wall. + +Sun Dec 2 16:45:06 1990 John Gilmore (gnu at cygnus.com) + + Merge Intel 960 port of gdb, continuing... + + * dbxread.c (partial_symbol_file_open, partial_symbol_file_read, + symbol_file_command): Pass from_tty arg to hush 'em up. + + * coffread.c (symbol_file_command): Avoid output if from_tty != 1. + Add magic numbers for 960 COFF format. + +Fri Nov 30 09:18:20 1990 John Gilmore (gnu at cygnus.com) + + Merge Intel 960 port of gdb, from Intel "1.2" release. + + CHANGE_LOG entries from their port, which was based on + gdb+-2.8.0: + + Thu Sep 6 11:02:22 PDT 1990 + Remove temp file if download is interrupted. + + Wed Aug 1 09:08:33 PDT 1990 + Now uses binary protocol to talk to NINDY. + Old hex protocol (NINDY 2.13 and older) supported with -O switch. + Times out after 5 seconds when trying to talk to NINDY. + + Tue May 29 12:54:49 PDT 1990 + Added variable baud rate (-b switch). + Source code reorganization. + + Thu Apr 26 11:09:55 PDT 1990 + More cleanup of batch mode; specifically, execute "-s", "-e", and + "-se" switches as soon as they are encountered on the invocation line. + + Fri Apr 20 13:47:15 PDT 1990 + Add -brk switch. + + Thu Apr 19 09:54:28 PDT 1990 + Add 'reset' command. + + Wed Apr 18 09:48:07 PDT 1990 + After opening remote tty, wait for 1 second to go by without input + from it before trying to talk to NINDY (fixes problems with the + Heurikon HK80/V960E). + + Mon Apr 4 16:33:05 PDT 1990 + Some output was not being suppressed in 'batch' mode. + + Thu Mar 22 15:31:11 PST 1990 + Ask user if old symbol table should be deleted when new file is + downloaded. + + Allow user to run a program downloaded before gdb960 was brought up. + + Correct "exec-file" help message for i80960 context. + + Correct bug in calculating user space address: could occasionally + corrupt user program. + + Make sure to zero low-order bits in rip's because of bug in 960CA + A-step part: could cause operation faults when "next"ing across + a function call. + + Correct bug that made it impossible to get source line numbers for + code loaded at addresses higher than 0x7fffffff. + + Wed Jan 10 12:43:22 PST 1990 + Open remote tty for exclusive use. + + Fri Jan 5 12:14:42 PST 1990 + Correct disassembly (CA manual was right after all): + opcode for sysctl is 0x659 + + Mon Oct 23 12:03:04 PDT 1989 + Use G960BASE and G960BIN environment variables to find 'sx' utility. + + Mon Oct 16 14:15:09 PDT 1989 + "sfr0"-"sfr31" should have been named "sf0"-"sf31" + + Mon Oct 2 15:56:31 PDT 1989 + + Added 960CA disassembly support. + + To simplify maintenance: + - eliminated use of symblic links on pinsn.c: use i960-pinsn.c + directly instead. + - eliminated opcode.h: incorporates tables into i960-pinsn.c + - moved 960-specific routines from i960-pinsn.c to i960-md.c + - made disassembly interface identical to that in gdmp960. + + + +Wed Nov 28 21:32:48 1990 John Gilmore (gnu at cygint) + + * target.h: Allow targets to stack. Add target_has_memory, + _registers, etc. Restructure memory access and "info files" + to walk the target stack. + * exec.c, core.c, inftarg.c, remote.c, remote-vx.c, remote-eb.c, + target.c: Change tables to match target.h. + * inflow.c (child_mourn_inferior): pop child_ops. + (generic_mourn_inferior): Use new has_stack flag. + * infptrace.c (child_xfer_memory): New memory regime. + * inftarg.c (child_files_info): New "info files" regime. + * remote-eb.c: New memory regime, new info files. + * remote-vx.c: New memory regime, new info files. Now use + separate targets for VxWorks attachment to machine, and + actually running a process under VxWorks, since one has + stack & execution & regs and the other doesn't. + * remote.c: New memory regime, new info files. + * sparc-xdep.c (fetch_core-registers): New memory regime. + * target.c: New routines and support for stacked targets, + new memory regime, new info files regime. + + + Generalize section handling for an arbitrary number of sections, + including use of the new BFD (binary file) library. + * gdbcore.h: Add struct section_table. + * exec.c (build_section_table): Iterate all sections and + record what gdb needs to know about them. + (exec_command): Use it. + (exec_xfer_memory): Use the table. + (exec_files_info): Print the table. + * core.c (core_file_command, core_xfer_memory, core_files_info): + Likewise. + * source.c (find_source_lines): Use bfd_get_mtime. + * dbxread.c: Quick changes to make it compile with new BFD. + * utils.c (error): Avoid using bfd_error in generic routines. + + * core.c (core_fetch_registers): Get from the ".regs" section of + the BFD core file. + * sparc-xdep.c (fetch_core_registers): Use the .regs info. + + * inferior.h (attach_flag): Export. + * infcmd.c (run_command): use new target_create_inferior. + * infrun.c (child_create_inferior): Don't return result. + * Makefile.dist (VERSION): 3.91.4. + +Fri Nov 23 28:15:38 1990 John Gilmore (gnu at cygint) + + * breakpoint.c (bpstat_num): Handle breakpoints which have + since been deleted, such as temporary breakpoints. + infcmd.c (program_info): ditto. + + * core.c (core_file_command): Display the frame where the core + dump occurred. + + * main.c: lint. + + * remote-vx.c (target_command): Merge in target command from + targ-vx.c. A few other cleanups. + + * TODO, Projects: Lots more stuff to do... + +Fri Nov 23 18:15:38 1990 John Gilmore (gnu at cygint) + + Massive changes to wall off the remote-debugging interface + behind a function vector. The port to handle VxWorks targets + is also part of this. + + All files: Replace references to renamed functions, + remove references to remote_debugging, remove references to + have_include_file, have_core_file in favor of target_has_stack, + target_has_memory, etc. + + * Modularize the breakpoint interface. + breakpoint.h (BREAKPOINT_MAX): New define sets max length of + a breakpoint instruction. + breakpoint.c: struct breakpoint's shadow_contents now sized as + BREAKPOINT_MAX. + (insert_breakpoints): Vector to target to install breakpoints. + (remove_breakpoints): Vector to target here too. + Remove REMOTE_SA_SPARC kludges and other remote_debugging. + sparc-tdep.c (single_step): Use new breakpoint interface for + the single-step breakpoints. + mem-break.c (memory_insert_breakpoint, memory_remove_breakpoint): + New file, contains routines to insert and remove breakpoints by + reading out the old contents and later replacing them. This is + how ptrace breakpoints work, and many remote systems as well. + + * tm-vxworks68.h: New config file, overrides a few things for + Wind River's preferences. + + * target.h: New file, for transfer vector used to talk to the + inferior (child, attached, core, exec, remote, etc). All accesses + to the thing being debugged should come through these vectors. + target.c: New file, routines to handle transfer vector. + (various files): Add transfer vectors XXX_ops for the various + targets and pseudo-targets (core files, etc) we support. + + * breakpoint.c (bpstat_stop_status): Further explorations of + watchpoints and why things don't work all the time. + (bpstat_alloc): New fn to allocate a bpstat and chain it. + + * config.gdb: Only add "source ${srcdir}/.gdbinit" to + the local gdbinit if it doesn't already have it. + + * core.c (core_ops): add and install. + Allow core debugging without exec file. + + * dbxread.c (free_and_init_header_files): Merge two fns. + (end_symtab): Free named symbol table when a new version comes in. + (read_dbx_symtab): Relocate all kinds of symbols with base + address. First step toward handling different text, data, bss + reloc. + (add_file_addr_command): Renamed add_file_command. + (add_file_command): Vector to remote handler. + Add "load" as an alias for "add-file" command. + + * defs.h: Allow "volatile" to be used in non-ANSI; use it for + non-returning functions. + + * exec.c: Add exec_ops, and push it as a target when an exec + file is specified. + + * infcmd.c (run_command): Pass executable file name and arg list + separately when starting an inferior. Permit "run" when no exec + file is specified, for VxWorks. + (detach_command): Move to child_detach in inftarg.c. + + * inftarg.c: New file. Unix-child-specific routines, and the + child_ops structure. + + * inferior.h (registers): Export "registers" as the way for + target dependent register handlers to find gdb's local copy of + the registers. Rename "stop_after_attach" to "stop_soon_quietly" + since it is now used by places that want wait_for_inferior to + handle the grunge but want to see every trap from the inferior. + + * inflow.c (create_inferior): Pull out, and merge into infrun.c. + Eliminate remote_debugging hooks in terminal handling. + + * infrun.c: Replace start_inferior with child_create_inferior. + Move all the hair of Unix shells and ptrace idiosyncracies into + child_create_inferior, so remote handlers don't have to deal. + Remove running_in_shell. Rename stop_after_attach to + stop_soon_quietly, and use it in a few other places where we want + to just call wait_for_inferior and get control back on the first + trap. trap_expected now never takes a value > 1. + (init_wait_for_inferior): Initialize static vars when a new + process is created. + + main.c (gdbinit): Add new hook for .gdbinit file name, let + it be overridden by config files as GDBINIT_FILENAME. + (DEFAULT_PROMPT): Add new hook for overriding (gdb) prompt. + Both of these are used for VxWorks gdb. + + mcheck.c: rename include file "gmalloc.c" to avoid problems + with system include file "malloc.c". + + param-no-tm.h: New include file, same as param.h but does not + include the default "tm.h" file. This is used in files where + the target is known, e.g. remote-eb.c or sparc-xdep.c. + + param.h: Now just a shell that includes tm.h and param-no-tm.h. + + remote-vx.c: New file, VxWorks remote debugging support. Uses + RPC routines that are shared with the target system, in directory + ${srcdir}/vx-share. + + remote.c: Vectorize remote interface. + + source.c: Globalize source_path, and make an alias "l" for "list" + since we now have the "load" command. + + sparc-xdep.c: Use new param-no-tm.h. + + symmisc.c (free_named_symtab): Add new function from Wind River. + However, ifdef it out for now while we think about what it should + really be doing. + + tm-sun3.h, xm-sparc.h, xm-sun3.h, xm-symmetry.h: Move + PREPARE_TO_STORE to + the xm- file, and change its name to CHILD_PREPARE_TO_STORE, since + non-Unix-children handle this with their own code in the target + transfer vector. + + Makefile.dist: Roll version to 3.92.3. Add vx-share stuff to + source and target lists. Add vx-share to default list of include + directories. Add new files to src and target lists: mem-break, + target, inftarg, remote-eb, remote-vx, targ-vx. Be sure the + ${srcdir} versions of munch and createtags are used. + + * valops.c (find_function_addr): Split out of call_function. + (call_function_by_hand): Rename call_function; this function + calls functions in the target by laboriously patching the target + word-by-word with the right stack, args, regs, etc. + + +Mon Nov 5 17:29:10 1990 John Gilmore (gnu at cygint) + + Handle AMD 29000 a bit better. + + * remote-eb.c (readchar): Mask received char log to make it readable. + (remote_start): Pass arguments down to executing program. + Make startaddr unsigned. + infrun.c (start_inferior): Accept args, pass them to + remote_start. + infcmd.c (run_command): Pass args down to start_inferior. + + * tconfig/am29k-aout, tconfig/am29k-coff: New files specifying + the target object file format. + tm-29k.h: Pay heed to COFF_ENCAPSULATE. + + * am29k-pinsn.c (print_insn): Print 0x on hex numbers in disassembly. + am29k-tdep.c (examine_prologue): Better checking of function prefixes. + +Sun Oct 7 18:20:45 1990 John Gilmore (gnu at cygint) + + * Makefile.dist (VERSION): Roll version to 3.91.9 and freeze. + * TODO: We did a few things, we have more to do though. + + * xm-sparc.h (CLEAR_DEFERRED_STORES): Define. + * inflow.c (inferior_died): Clear deferred stores. + + * Debug problems with dummy frames and calls to the inferior. + * tm-sparc.h (PUSH_DUMMY_FRAME, POP_FRAME): Move to sparc-tdep.c. + * sparc-tdep.c (do_restore_insn): Simplify. + (sparc_frame_find_saved_regs): Simplify and fix what we find. + (sparc_push_dummy_frame): Simplify and fix what we push. + (sparc_pop_frame): Slightly more hair here, deciding whether + we are restoring a saved PC or returning to a return address in %i7. + * sparc-xdep.c (read_inferior_registers): Debug if valid reg is read. + + * utils.c (xmalloc, xrealloc): Return type depends on __STDC__. + * symtab.h (xmalloc): ditto, for obstack_chunk_alloc. + * obstack.h (chunkfun): ditto. + * defs.h (xmalloc, xrealloc): ditto + + * utils.c (quit): Grab the terminal from the child if necessary. + + * inflow.c (term_status_command): Rename to term_info, change + to "info terminal". + + * sparc-pinsn.c (print_insn): Disassembly prefers real instructions. + (is_delayed_branch): Speed up. + * sparc-opcode.h: Add ALIAS bit to aliases. Fix up opcode tables. + Still missing some float ops, and needs testing. + + * Support for input and output radixes other than base 10 + * defs.h (input_radix, output_radix): Declare. + * expread.y (yyparse, parse_number): Handle changes of input + radix, and ambiguous names-or-numbers in radixes >10. + * printcmd.c (print_scalar_formatted): Print formatted hex + numbers in varying column widths. + * valprint.c (val_print): Use output_format to print scalar ints. + (set_input_radix, set_output_radix, set_radix): Create. + (set_output_radix): Set output_format from output_radix. + (_initialize_valprint): add `set radix' but leave the others off. + + * main.c (execute_command): Let stupid questions be turned off. + (_initialize_main): Handle "set stupidity", etc. + + * main.c, inflow.c, inferior.h, frame.h, command.c, defs.h, + sparc-pinsn.c, sparc-xdep.c, value.h, valops.c, values.c: Lint. + +Tue Oct 2 11:20:02 1990 John Gilmore (gnu at cygint) + + * TODO, Makefile.dist, ChangeLog: Freeze for 3.91.8 release. + bfd stuff is still screwed up, but with some manual work, it + compiles. + + * breakpoint.c (bpstat_do_actions): Start over if a command + proceeds the inferior, since the inferior will have stopped and + will need to have its new stop-actions taken care of. + + * dbxread.c (read_struct_type): Expression gives Sun3 4.0.3 + compiler fits, simplify it. + + * gdb.texinfo (directory command): Doc new dir command. + source.c (directory_command): "dir" now puts things on the front + of the path, moves dups up front, and handles multiple names + on the command line, inserting each one in order. It also + blows away cached line and full_filename info. + + * stack.c (backtrace_command): Skip "more stack frames follow" + unless interactive. + + * Change #ifndef HAVE_VPRINTF to #define MISSING_VPRINTF in + xm-convex.h, xm-hp300bsd.h, xm-isi.h, xm-merlin.h, xm-news.h, + xm-np1.h, xm-pn.h, xm-pyr.h, xm-symmetry.h, xm-umax.h, xm-vax.h. + The only odd one was Gould NP1, which had defined vprintf to + "printf"!!! + + * Merge Ted Goldstein <tedg@Eng.sun.com>'s changes for epoch. + printcmd.c (print_command_1): Pass 'inspect' flag down as a global + variable, inspect_it. + valprint.c (print_string, val_print): Use the global inspect_it + to indicate whether to print in Epoch style or normal style. + +Mon Oct 1 23:55:26 1990 John Gilmore (gnu at cygint) + + * printcmd.c (call_command): add an alias for the "print" command + which runs expressions and doesn't print the result if void. + (print_command_1): implement it. + + * command.c: Remove #if 0'd code. Initialize all the fields + in add_cmd (). Rename do_nothing_command to + not_just_help_class_command, and make it externally visible. + command.h: add user_commands to struct. + * main.c (define_command): Don't overload c->function with a char + string as well as a function pointer. + + * eval.c (evaluate_subexp): Reinstall tiemann changes to + calling convention of value_struct_elt () that got dropped in + merge. + + * tm-sparc.h (FRAME_FIND_SAVED_REGS): move to sparc-xdep.c. + sparc-tdep.c (sparc_frame_find_saved_regs): ditto. + + * tm-sparc.h (POP_FRAME): replace some constants with defines. + + * sparc-xdep.c (store_inferior_registers): defer stores to regs + until a good time (e.g. when we are about to run the child), + saving ptrace calls. + * infrun.c (proceed): handle DO_DEFERRED_STORES. + * tm-sparc.h: define DO_DEFERRED_STORES. + + * sparc-xdep.c (store_inferior_registers): when storing float + registers, don't store stack regs too. When storing the SP, + however, DO store the stack regs too. This fixes a bug in which + the dummy frame is not recognized when a call_function finishes, + because its frame pointer (in the stack regs) was never + initialized. + (read_inferior_registers): Mark WIM and TBR and FPS and CPS valid + even though we don't know how to read them from an inferior. + valops.c (call_function): Comment about storing SP. + + * infrun.c (save_inferior_status): Save away the original bpstat + chain so it can be restored later. Install the copied version for + use by whoever saved the status. It will be blow away by + restore_inferior_status, and the original chain restored. This is + important for people who have pointers into the original. + + * breakpoint.c, command.h, copying.awk, dbxread.c, defs.h, + findvar.c, frame.h, obstack.h, obstack.c, inflow.c, value.h, + main.c, printcmd.c, sparc-tdep.c, symtab.c, valprint.c: lint + + +Fri Sep 28 20:32:46 1990 John Gilmore (gnu at cygnus.com) + + * Makefile.dist: Roll version to 3.91.8. Add bfd.h and bfdconfig.h + temporarily to the makefile. Add am29k-opcode.h and WHATS.NEW. + Add stuff.c and kdb-start.c to the OTHERS list for tar files. + +Fri Sep 28 19:12:12 1990 John Gilmore (gnu at cygint) + + * Merge Mike Tiemann's multiple inheritance changes from Sun. + Store the baseclasses in a type struct starting from array element + 0 rather than from the unusual array element 1. + + dbxread.c: the above. + (virtual_context): Add + Read new debug information about which virtual function table + a virtual function is from, and store it in fn_field.fcontext. + + symtab.h: Add fcontextt. Fix baseclass indices. Typo in + TYPE_FN_FIELD_STATIC_P. + + symtab.c: the above. + valops.c: the above. Handle pointer casts of object *'s. + (search_struct_method): Add. + (value_struct_elt): First arg is now a pointer to a value, and is + modified on return. + + valprint.c: the above. + values.c (value_virtual_fn_field): Add type arg. Handle + offsetting to the proper object when calling virtual fns. + The above. + (baseclass_addr): Add valuep arg. + + * README: Document the current state of BFD config (missing). + * TODO, ChangeLog, Makefile.dist: Roll version. + * WHATS.NEW: Add summary of changes since 3.5. + +Thu Sep 27 16:23:12 1990 John Gilmore (gnu at cygint) + + * dbxread.c (read_struct_type): Clear bit vectors whenever + we allocate one. + symtab.c (B_CLRALL): define. + + * tm-sparc.h (STORE_RETURN_VALUE): Avoid clobbering types by + using == rather than =. Huh... This fixes the dreaded problem + wherein builtin_type_int becomes TYPE_CODE_FLT. + + * core.c (info_files): Show the inferior pid. + + * config.gdb: Avoid putting "dir" command into .gdbinit. GDB + already knows how to look in the source directory. + + * Remove psymtab hair from many places. Remove duplicated code + for searching symbol tables. Hide psymtabs from most places. + Make it fast to get from a psymtab to its symtab. + + blockframe.c (blockvector_for_pc): Remove psymtab hair. + coffread.c (psymtab_to_symtab): Rename to psymtab_to_symtab2. + mipsread.c (psymtab_to_symtab): Rename to psymtab_to_symtab2. + dbxread.c: export psymtab_to_symtab, make it work if called N times. + (psymtab_to_symtab): Rename to psymtab_to_symtab2. Initialize + new symtab completely. New psymtabs get symtab pointer + initialized to zero. Remove MI warning printf. + symtab.h: Comments. Add psymtab to symtab pointer. + (PSYMTAB_TO_SYMTAB): New macro. + symtab.c: use PSYMTAB_TO_SYMTAB. Add psymtab_to_symtab and export it. + source.c: use PSYMTAB_TO_SYMTAB. Remove symtab version and + compilation fields. + stack.c (backtrace_command): Avoid pre-pass to read symbols, if + verbose is not set. + (print_frame_info): Avoid special-casing symbols that have not yet + been read in. + + * source.c (open_source_file): Quick path if we have already + located the source file by its full name. + + * symtab.c (lookup_symbol): Use find_pc_symtab rather than + find_pc_psymtab. When a name is found in the misc function + vector, search the symbol table for its mangled name, not the + name that the user typed. + + * bfd.h: Fix missing comment terminators, make #endifs match. + + * valarith.c (value_less): Handle unsigned int comparisons. + Add FIXME about pointer compares, which assume host and target + pointers are the same. + + * command.c (do_nothing_command): lint + dbxread.c: lint. Remove sort_syms. Document C++ visibility info, + fix comments on debug symbol format for visibility. Actually set + visibility of symbols. + main.c (echo_command): lint; use <readline/history.h>. + tm-sparc.h (FRAME_FIND_SAVED_REGS): lint + obstack.h (_obstack_blank): Rearrange pointer math to avoid + pointing past end of allocated memory; saber complains. + obstack.h: Declare the external functions that we use. + valarith.h: use <string.h> + solib.c (solib_add): lint. + +Fri Sep 21 17:05:19 1990 John Gilmore (gnu at cygint) + + * main.c (initialize_main): Default info_verbose to off, now that + symbol reading is fast. + (quit_command): Avoid clobbering exec_bfd while quitting. + + * Initial BFD (binary file diddling library) merger: + coffread.c: Change AOUTHDR to struct exe_hdr. + dbxread.c: ditto. + core.c: initialize initialized data at compile time. + (core_file_command): Move from coredep.c, convert to bfd. + (xfer_core_file): Convert to bfd. + exec.c (exec_file_command): use bfd routines. + gdbcore.h: BFD. + mips-tdep.c: Remove exec_file_command and friends. + source.c: bfd. + + * coredep.c: (fetch_core_registers) Convert core_file_command to + fetch_core_registers. + mips-xdep.c, sparc-xdep.c, sun3-xdep.c: ditto. + + * utils.c: (error): Bogus crap, FIXME, to print bfd errors. + (my_bfd_read): More bogosity, which I don't think we call. + (program_name): Remove this atrocity asap! + +Wed Sep 19 13:36:41 1990 John Gilmore (gnu at cygint) + + * From Per Bothner: + values.c: allocate_repeat_value was not clearing the + optimized_out field. + (value_static_field): minor stylistic fix (wrong macro was used). + valops.c (value_struct_elt_for_address): didn't work for C++ + static fields. + + * signame.c (_initialize_signame): Initialize signal names once. + + * breakpoint.h, command.c, copying.awk, defs.h, environ.c, + exec.c, frame.h, infcmd.c, inferior.h, main.c, munch, sun3-xdep.c, + symtab.h, tm-29k.h, valprint.c, value.h, values.c: Lint. + + * remote-eb.c: Support user-settable baud rates on the serial port. + + * tm-sun3.h (PREPARE_TO_STORE): fix typo. + +Fri Sep 14 13:28:29 1990 John Gilmore (gnu at cygint) + + * tconfig/sun3os4: Remove warning about native assembler, + since it also occurs in the xconfig file. + + * findvar.c (registers): Allocate some slop after `registers' + to prevent stray accesses from trashing the next variable. + + * tm-68k.h (REGISTER_BYTES): Allocate the right number of bytes + on the sun-3, by changing the #ifdef from `sun3' (which is not + defined by cc) to `sun'. Symptom was trashed builtin_type_XXX + vars, which happened to follow `registers' in the executable. + + * readline/history.c (history_search): Heed gcc-2's advice + and parenthesize && inside ||). + + * am29k-opcode.h, am29k-pinsn.c, am29k-tdep.c, remote-eb.c, + tm-29k.c: Insert FSF copyright headers. + + * remote-eb.c: Better comments. + + * Makefile.dist: Update to 3.91.6. + * TODO: note PREPARE_TO_STORE problem. + +Thu Sep 13 09:52:33 1990 Jim Kingdon (kingdon at cygint) + + * stack.c (frame_info): Only use FRAME_FIND_SAVED_REGS if defined. + + * remote.c: Wrap the whole file in #if !defined (SPECIAL_REMOTE). + + * infrun.c (wait_for_inferior, at end): Don't set up + prev_* if the inferior no longer exists. + + * inferior.h (CALL_DUMMY_LOCATION): New macro, to replace + CANNOT_EXECUTE_STACK. + valops.c (call_function): Use it. + + * tm-convex.h: Add CALL_DUMMY_LENGTH for use by PC_IN_CALL_DUMMY. + + * inferior.h (PC_IN_CALL_DUMMY): New macro. + infrun.c (wait_for_inferior, 2 places): Use it. + + * values.c (value_being_returned): Only use + EXTRACT_STRUCT_VALUE_ADDRESS if defined. + + * Move PREPARE_TO_STORE from xm-sun3.h to tm-sun3.h to do the + right thing for remote-eb.c. + + * sun3-xdep.c: Remove extraneous call to remote_store_registers. + * sun386-xdep.c, hp300hpux-xdep.c, sparc-xdep.c: Ditto. + + * blockframe.c: Put get_frame_saved_regs inside #if !defined + (FRAME_FIND_SAVED_REGS). + + * findvar.c ({fetch,store}_registers): Check for + REMOTE_{FETCH_STORE}_REGISTER macro. + + * findvar.c (get_saved_register): Add argument lval and + change meaning of argument addr. + findvar.c: Change calls to get_saved_register to reflect + new calling convention. + valops.c (value_assign): Use get_saved_register instead of + find_saved_register. + +Sun Sep 2 12:40:20 1990 Jim Kingdon (kingdon at cygint.cygnus.com) + + * coffread.c (read_one_sym): Make temp_aux an AUXENT, not + an (uninitialized) pointer to one. Use "&" when passing it + to fread. + +Fri Aug 31 22:57:54 1990 Jim Kingdon (kingdon at cygint.cygnus.com) + + * coffread.c (getfilename): Use DGUX x_offset and x_name if + defined. + + * coffread.c (symbol_file_command): Put semicolon after + "int from_tty". + Put safe_to_init_tdesc_context in #if defined (TDESC). + Put #ifdef TDESCs in 1st column for non-ANSI cpp's. + coffread.c: #include <sys/stat.h>. + (read_coff_symtab): Typo: in_source_files -> in_source_file. + Add missing ')' in check for "lc%" and friends. Remove + extraneous '}'. + Declare read_one_sym() at top of file. + (read_file_hdr): Put in extra #ifdefs so MC68MAGIC and + MC68WRMAGIC can have the same value without causing a duplicate + case. + +Thu Sep 13 15:55:36 1990 John Gilmore (gnu at cygint) + + * Allow a Makefile to be built without building the + tm and xm file links that screw up builds in subdirectories. + This is done with `config.gdb none', then you can do things + like `make gdb.tar.Z'. + * tconfig/none: Config file for no target system + * xconfig/none: Config file for no host system + * config.gdb: If no TM or XM files are called out by the + host or target file, don't make links for them. + + * cplus-dem.c: Add documentation. + + * dbxread.c (read_ofile_symtab): Turn a fatal error into a + simple error, so the user's gdb doesn't crash due to some object + file problem (e.g. somebody is rebuilding the file out from under + gdb). + + * printcmd.c (print_address_symbolic): demangle the symbol. + + * Makefile.dist (OTHERS): Remove tdesc-lib because it has + Motorola copyrights in it. Make "make gdb.tar.Z" work. + (alldeps.mak): sort and uniq all results from this; duplicates + hose gdb.tar.Z link building. Remove RCS files from + tconfig and xconfig. Add config files for sun386. Add + a few odd files to OTHERS and HFILES. + +Mon Sep 10 21:20:24 1990 John Gilmore (gnu at cygint) + + * Makefile.dist: Pull solib.c to tconfig/sun?os4. + Roll version number to 3.91.5. Make lint work in bindir. + + * README: Document cross-debugging and new file structure. + + * blockframe.c: Lint. Include "value.h" to declare read_register. + (find_pc_partial_function): remove duplicate line. + + * command.h: Lint. Declare error_no_arg and dont_repeat. + + * tm-news.h: Remove inadvertently duplicated stuff. + + * mipsread.c: Remove cache_pc_function stuff, now done cleanly. + Clean up usage of misc_function_type. Declare some CORE_ADDRs. + + * config.gdb: Allow `config.gdb host target' form. Clean + up previous change that printed bogus messages when you just said + `config.gdb'. + + * core.c: #include "command.h" for lint. + * dbxread.c: lint + * eval.c: lint + * main.c: Remove some casts of enums. Lint. + * source.c: lint + * symtab.c: lint + * symtab.h: lint + * expread.y: lint + * valarith.c: lint + + * printcmd.c (initialize_printcmd): Fix thinko in inspect cmd. + + * sparc-tdep.c (isannulled): Take instruction as parameter, don't + read it from memory. This will allow us to save ptrace calls + eventually. Changed caller single_step too. + + * sparc-xdep.c (fetch_inferior_registers): Avoid reading regs + that we aren't going to use, saving many ptrace calls, especially + when watchpointing or single stepping. Use some #define's for + constants. + (store_inferior_registers): Ditto. + (core_file_command): Use some #define's for constants. + + * tm-sparc.h: Add #define's for some register numbers, so we + can eliminate the use of random constants in sparc-xdep.c. + + * stack.c (frame_command, print_frame_info, up_command, + down_command) Remove frame_changed, since it + causes a bug and doesn't seem to do anything useful. In some + places it was used as a flag, in others as a stack level (?). + + * utils.c: Use MISSING_VPRINTF rather than HAVE_VPRINTF, so the + default is to use the portable (vprintf) version rather than the + kludge version. + * xm-news.h (MISSING_VPRINTF): Add. + + * valprint.c (val_print): Demangle fancy vtbl printouts. Lint. + +Sat Sep 8 00:24:12 1990 John Gilmore (gnu at cygint) + + * Remove stuff that forces -Bstatic linking of gdb, and warnings + about linking debugged programs -Bstatic in the sun?os4 config + files in tconfig and xconfig subdirectories. + + * main.c (main): Remove unreached exit(0) now that we exit + via quit_command(). + + * Create TODO file for online bug list. There are too many + "little" bugs to keep track of on paper. + + * Change Projects file to refer to bug-gdb@cygnus.com + rather than kingdon@ai. + +Fri Sep 7 23:35:15 1990 John Gilmore (gnu at cygint) + + * Makefile.dist (VERSION): 3.91.4 now. + + * symtab.c (init_misc_bunches): Rename from init_misc_functions. + (condense_misc_bunches): Add sanity check that misc_count is + the same as the number of symbols in the bunch. + + * coffread.c: rename init_misc_bunches. Pass an argument + to condense_misc_bunches (a zero). + + * dbxread.c (partial_symbol_file_read): Call init_misc_bunches + every time we are called; don't rely on our caller to do it. + (add_file): Remove call to init_misc_bunches. + + * mipsread.c: Only warn, don't error, if unknown symbol types. + This keeps an old gdb from falling on its face if it sees newly + extended symbol info. Rename init_misc_bunches. + +Fri Sep 7 22:58:15 1990 John Gilmore (gnu at cygint) + + * Merge in changes from Per Bothner for DECstations and other + MIPS stuff. The rest is Bothner speaking: + + The next message is a merger of Alessando Forin's mips port with + mine. I've tried to use my good if biased judgment to get + the best of both. It *does* need testing. + + Some of the changes are general, *not* mips-specific. + + param.h: + Didn't believe in little-endian bit order. + There are still inconsistencies about whether flags + like BITS_BIG_ENDIAN are integer (#if ...) or + boolean (#ifdef ...). I tried to paper over them. + + dbxread.c,coffread.c,mipsread.c,symtab.c,symtab.h: + Moved some misc_function code that was common to + {dbx,coff,mips}read.c to symtab.c. + In the process, I think I cleaned things up a bit. + At the same time, moved obsavestring and obconcat to symtab.c. + + dbxread.c: + Removed obsolete condense_addl_misc_bunches (use + condense_misc_bunches(1) instead). + + exec.c: + Needed to include <sys/dir>, at least on DECstations. + + valops.c, mips-tdep.c, tm-mips.h: + Added PUSH_ARGUMENTS macro to support funny argument-pushing + conventions (when STACK_ALIGN is insufficient). + Needed on mips, where doubles need 8-byte alignment, + but ints only need 4. + + mips-opcode.h: + Removed cruft that was not being used. + Merged in many fixes (most from Frank Yellin, fy@lucid.com). + + mips-pinsn.c: + Print $ before register-names (I think that makes things a little + more consistent). + Never print two instructions, even if one delays. + Removed hex-disassemble set_cmd. (This is not mips-specific, + so I think the argument is whether it is generally worthwhile or not. + I'm inclined to think not, given how easy it is to + convert between radixes in gdb.) + + mipsread.c: + This is basically Alessando's code. + It doesn't use obstacks; I changed it to use obstacks + in a few minor places where using malloc causes a + memory leak. (Probably, more places could/should be changed.) + I added record_misc_function where it was missing. + In symbol_file_command and add_file_command, I tried + to make the code consistent with more recent versions. + Minor sylistic changes in parse_procedure. + Make a .gdbinfo. psuedo-symbol point back to the real + procedure symbol (using the isym field). + + mips-tdep.c: + This is basically from my port, but with a lot of details + and a number of routines merged in from Alessando's version. + I basically used my code "raw" backtrace (use heuristics + from the actual code, rather than symbol table info) - though + the idea is Alessandro's. I feel my code is a little cleaner + here, particularly in being a little more flexible, such as being + able to handle gcc-produced code (which it now can). + It also doesn't do frame caching (which is not useful + more recent gdb versions). + I also used my code for push_/pop_dummy, more or less. + I tried to incorporate AF's code for testing sigtramp + while backtracing; I probably got it wrong. + Added mips_print_register, which tries to scrunch as much + information as possible on a screen... + Removed the skip-prologue set_cmd. As with hex-disassemble (see + under mips-pinsn.c), I don't see anything mips-specific here, + and I don't see it being all that useful anyway. + + tm-mips.h: + Added a $fp psuedo-reg distinct from $fp (nice for gcc). + Use more register names (rather than hard-cases numbers). + +Thu Sep 6 18:33:15 1990 John Gilmore (gnu at cygint) + + * Hack up 3.90.11 changes: + + * Makefile.dist (depend): parameterize $(GCC). + Add solib.c and solib.o. + (readline): Fix vpath for both absolute or relative SRCDIR. + + * blockframe.c: Fix from Schaefer@asc.slb.com for shared libs. + Also, let the part I didn't understand at least compile so + I can test the rest. FIXME. + + * dbxread.c: Fix thinko using strcmp. + (init_psymbol_list): declare static. + (partial_symbol_file_open): Comment cleanups better, avoid + cleaning up the string table since the caller will do that. + Move the stat for mod time into symbol_file_command, temporarily. + (There should be a mod time for each symbol file, eventually, + to control its rereading. FIXME.) + + * infptrace.c (PT_WRITE_D): use same value as PT_WRITE_I for + SunOS, which gives error for shared libs otherwise. (From + Schaefer, probably FIXME needs work for portability.) + + * solib.c: Move #include "param.h" to work. + Lowercase all the Uppercase Letters In the Messages. + (find_solib): Clean up inferior_so_name for debug printouts. + Allow no argument, to mean all shared libraries. + + * symmisc.c: include param.h to get CLEAR_SOLIB. + +Wed Sep 5 18:00:08 1990 John Gilmore (gnu at cygint) + + * Merge in Kingdon's changes from FSF: the diffs from 3.90.9 + to 3.90.11. ChangeLog entries below are from this. + +Wed Jun 13 09:17:39 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * Version 3.90.11. + + * Makefile.dist (HFILES): Add tm-sunos.h. + +Tue Jun 12 16:15:26 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Version 3.90.10. + + * Makefile.dist (gdb.tar.Z): Change linking of config so it works. + +Thu Jun 7 16:22:27 EDT 1990 Jay Fenlason (hack@ai.mit.edu) + + * sparc-opcode.h Added single-operand version of rett. + +Mon Jun 4 18:12:31 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * m-sparc.h (REG_STRUCT_HAS_ADDR, STRUCT_ARG_SYM_GARBAGE): + Put parens around gcc_p in expansion. + +Thu May 24 15:44:51 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * utils.c (lines_to_list): Return 10 if lines_per_page == 0. + +Wed May 23 16:36:04 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Changes for Sun shared libraries: + blockframe.c (find_pc_partial_function): If a non-text symbol + is found, set *address = pc - FUNCTION_START_OFFSET. + breakpoint.c (insert_breakpoints) [DISABLE_UNSETTABLE_BREAK]: + Disable breakpoints instead of giving an error. + source.c (select_source_symtab): Initialize cs_pst. + symmisc.c: Call CLEAR_SOLIB if defined. + symtab.h: Make text{low,high} CORE_ADDR not int. + (psymtab): New field addr. + solib.c: New file. + dbxread.c: Move DECLARE_FILE_HEADERS outside functions. + (record_misc_function): Give correct type for N_DATA symbols. + (condense_misc_bunches): do "misc_function_count = j" regardless + of inclink. + Take code which is shared between symbol_file_command and + add_file_command and put it into partial_symbol_file_{open,read}. + Split add_file_command into add_file_command and add_file. + Make psymtab_to_symtab read in the string table if the file + is not symfile. + Two new parameters to read_dbx_symtab and start_psymtab. + tm-sunos.h: New file. + +Tue May 22 17:43:03 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * infcmd.c: Change cont_command to continue_command and "cont" + to "continue". + +Mon May 21 14:41:41 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * breakpoint.c (enable_breakpoint): Get value of watchpoint. + + * defs.h [sparc]: Use <alloca.h> regardless of __GNUC__. + + * values.c (USE_STRUCT_CONVENTION): Check for structures of + size 1,2,4,8 rather than size < 8. + + * dbxread.c (dbx_lookup_type): Do f->length *= 2 as many times + as necessary, not just once. + + * sparc-opcode.h: Add a bunch of new opcodes which Sun as supports. + +Thu May 17 15:04:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * {t,x}m-sun386.h, sun386-xdep.c, {x,t}config/sun386 + + * tm-news.h: Add CALL_DUMMY_*. + + * tm-68k.h: Remove duplicate comment at FRAME_FIND_SAVED_REGS. + + * config.gdb: In list_host, list_target, use ${i}, not $i. + +Tue May 15 21:27:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * source.c (find_source_lines) [BROKEN_LARGE_ALLOCA]: Use xmalloc. + + * sparc-opcode.h: Change all store floating-point state register + instructions to have the right match & lose fields. + +Sat May 5 12:39:18 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Makefile.dist: Move -I${srcdir} to GLOBAL_CFLAGS and pass + VPATH to readline. + config.gdb: If srcdir != ., create readline directory and + copy a makefile into it. + + * wait.h, infrun.c: Change WRETCODE to WEXITSTATUS for + consistency with POSIX. + + * breakpoint.c (bpstat_stop_status): Disable watchpoint + when we exit its exp_valid_block. + +Tue Sep 4 11:46:46 1990 John Gilmore (gnu at cygint) + + * Makefile.dist: Bump version to 3.91.3. + + * Clean up handling of breakpoint commands (somewhat). + Prompted by Tiemann bug report "cont 10" doesn't work any more. + + inferior.h: Add breakpoint_proceeded to inferior status struct + and globals; save it and restore it. + (clear_breakpoint_commands): Cleanup, remove old #define. + + infrun.c (clear_proceed_status): Set breakpoint_proceeded. + (save_inferior_status, restore_inferior_status): handle it also. + (proceed): Remove earlier code that set breakpoint_proceeded. + It is now set only in clear_proceed_status. + (clear_proceed_status): Cleanup, use bpstat_clear rather + than clear_breakpoint_commands. No callers need the stop_bpstat + between clear_proceed_status and proceed. + + infcmd.c: Add breakpoint_proceeded definition and comment. + (cont_command, jump_command, signal_command): Move call to + clear_proceed_status right next to call to proceed. + + breakpoint.c (bpstat_do_actions): Avoid clobbering our + caller's argument while running down the chain of breakpoints. + Use new variable "breakpoint_proceeded" to determine when + a command that it executes moves the inferior past the + breakpoint. + (bpstat_clear): Handle NULL argument. + (bpstat_clear_actions): Avoid useless call to + breakpoint_auto_delete. + (delete_breakpoint): Clean up bpstat's that are pointing to + the deleted breakpoint from the stop_bpstat chain. + (breakpoint_auto_delete): Simplify. + + * Clean up handling of EOF, error on stdin, etc. This was + prompted by a network problem that caused gdb to go into an + infinite loop filling up its malloc'd memory. + + main.c (return_to_top_level): Cleanup: call bpstat_clear_actions, + not clear_breakpoints_commands, which is now gone. + (main): If command_loop returns (e.g. from EOF on stdin), do + a quit_command (looping back to command_loop if quit_command + doesn't really quit). + (command_loop): check result from command_line_input and + exit if it returns NULL, rather than passing the NULL to + execute_command. + (gdb_readline): Free malloc'd result space before returning + NULL for EOF. + + * utils.c (query): Handle C-d to mean "yes", just as if the + input was not a terminal. Also avoid infinite loop if EOF + occurs in mid-input-line before newline. This allows + query to be used at EOF on stdin with reasonable results. + + * infrun.c (proceed): Set breakpoint_proceeded. + + * values.c (value_as_long): Avoid infinite recursion for enums. + (_initialize_values): Fix typo in help msg (kingdon). + + * Makefile.dist (RL_LIB): Use RL_LIB_DEP for dependencies, + RL_LIB for linking. This allows -lreadline for linking + and nothing for dependencies, once readline is a real library. + + * config.gdb: Jim Kingdon: give useful error message if the + host or target type is not recognized. + + * defs.h (alloca): SPARC <alloca.h> does not declare alloca, + it just defines it. Dumb, but deal with it. + + * Jim Kingdon suggests: + in xconfig/sun3os4, CFLAGS should be XM_CFLAGS. + +Wed Aug 29 18:03:27 1990 John Gilmore (gnu at cygint) + + * Makefile.dist (VERSION): Bump version # to 3.91.2. + + * Clean up Bothner's changes. + + * blockframe.c (clear_pc_function_cache): New function. + * blockframe.c: remake cache_pc_function_* static. + * dbxread.c (symbol_file_command): remove references to + cache_pc_function_* variables. + * dbxread.c (read_struct_type): Use VOFFSET_STATIC. + * printcmd.c: Avoid kludging a global variable (addressprint) + to avoid printing the address of a string twice. Instead, + pass the format letter 's' down low enough that it can be seen + to avoid this problem. + (print_formatted): Pass format arg to value_print. + (restore_addressprint): Remove function. + (do_examine): Avoid hacking addressprint, cleanups and such. + (print_frame_args): Add a comment to a Bothner change. + * symtab.h: define VOFFSET_STATIC and use it instead of "-1". + * symmisc.c (free_all_symtabs): Call clear_pc_function_cache + to wipe out the values cached in blockframe.c. + * symtab.c (find_method): Add comment saying how big you must + allocate to be "big enough". Per being terse again. + * valprint.c (val_print): Handle format letter "s" to print + strings without addresses. Add comment to vtbl printing code + which casts with wild abandon. Rearrange reference-printing + code so it prints: + @0xaddr: value (print w/addressprint) + value (print w/~addressprint) + @0xaddr (parameter lists w/addressprint) + or nothing (parameter lists w/o addressprint) + +Tue Aug 28 10:47:18 1990 John Gilmore (gnu at cygint) + + * Merge more changes from Per Bothner: + +Gdb's handling of TYPE_CODE_REF was so counter-C++ (and otherwise +annoying) that I tried to improve it. Here are my suggestions. + + These patches all attempt to handle TYPE_CODE_REF (as in C++) better. + + findvar.c: + Do automatic de-reference when taking the address of a reference. + printcmd.c: + Don't deref_ref when printing parameter lists. + valops.c: + More attempts at treating refernences properly. + valprint.c: + In val_print, if deref_ref==0, don't print dangling " = ". + value.h: + Add COERCE_REF macro, which de-references an REF. + + * Merge changes from Per Bothner: + +* Fixed (Sony news)-specific configuration problems. +* Fixed other problems with using vanilla pcc and libc (enum problems; +assumption that vsprintf exists). +* Some major speed-ups (finc_pc_partial_function now caches a match; +parsing avoids duplicate symbol_lookup calls). +* Changed handling of baseclasses (no longer use baseclasses field +of struct type, use the first n_baseclasses fields instead). +* Various minor changes/fixes, most C++-related. + +blockframe.c: +Cache the most previous match from find_pc_partial_function. +(Save both low and high ends of matching function's pc range.) +This speeds up the loop of infrun.c:wait_for_inferior quite +a bit, and makes step/next commands much zippier. +command.c: +Added an enum->int cast (otherwise, some compilers barf). +dbxread.c: +No longer set baseclass offset to 0, since multiple +inheritance now mostly works. +Added a number of casts, to shut up compiler warnings +(after stabs where made enums, not ints). +When discarding a symbol table (in symbol_file_command), +must clear the cache introduced in blockframe.c. +Don't convert $vtbl_ptr_type to vtbl any more. +Get rid of TYPE_BASECLASEES and baseclass_vec (see also symtab.h). +Mask off sign bit emitted by g++ for virtual table offset. +Set voffset to -1 (not 1) for static member functions. +expread.y: +Changed parsing/lexing of names to avoid doing symbol lookup twice +(once when lexing to determine symbol class, once for real). +Now only call symbol_lookup once. Fields of 'this' win especially big. +printcmd.c: +Subpress printing addr twice in the case of 'x/s addr'. +symtab.c: +lookup_basetype_type is no longer used. +Add find_methods as recursive helper function to decode_line_1. +This allows multiple inheritance to work. +Also, once one or more matches has been found, do not look in +base-classes. (Baseclass methods would be overridden, anyway.) +symtab.h: +Removed baseclasses array in struct type. +Instead of using baseclasses[i], use fields[i-1]. +Added virtual_field_bits[i] to indicate if the i'th baseclass is virtual. +Changed sign convention of voffset (previous was inconsistent). +tm-news.h: +Some macros (CALL_DUMMY and relatives) were missing. Put them back. +utils.c: +Used to assume existence of vsprintf. Re-written to not need it +if HAVE_VPRINTF is undefined. +valops.c: +typecmp was too pessimistic. Made it less so. +valprint.c: +Don't print space after address. +If vtable points to a misc symbol (with 0 offset), print it, +since that indicates the actual class of the object. +Changed ype_print_derivation_info to use new inheritance +scheme (without baseclasses vector). +values.c: +In value_primitive_field, fixed some bugs left over from previous set of fixes. +Also, changes needed because TYPE_BASECLASSES were removed. +xm-news.h: +REGISTER_U_ADDR didn't work for PC. Rewrote to use an array. + +Tue Aug 21 20:08:54 1990 John Gilmore (gnu at cygint) + + * source.c: + If there is no path set, and the symbols don't indicate what directory + a file was compiled in, look in the current directory. But either + a path or a known compilation directory will prevent this. + + * dbxread.c: + Three independent bug fixes: + * Remove the #if 0 block that breaks some stuff. + * SunOS 4.1 fixed the promoted-parameter-wrong-addr bug in Sun C; + adapt gdb to either SunOS 4.0.* or 4.1. + * MAX_OF_TYPE and MIN_OF_TYPE thinko. By tedg@sun, I think. + + * symtab.c: + Instantiate the class T when looking for methods in it. (Tiemann@sun) + + * valprint.c: + (type_print) Demangle the name being printed. + (type_print_base) Handle botched demangling without coredump (tiemann). + + * values.c: + (check_stub_method): Document routine. + (tiemann) fix bug for no-arg functions + Avoid clobbering beyond end of malloc'd storage. + Terminate the argument list properly. + +Sat Aug 18 01:29:59 1990 Per Bothner (bothner@cs.wisc.edu) + + * Changes merged by John Gilmore: + +breakpoint.c: + In breakpoint_1, use new print_address_symbolic instead + of find_pc_partial_function. (This forces use of assembler-level + addresses, and avoids misleading non-mangled source-level names.) +cplus-dem.c: + Generalize ansi argument such that -1 means skip arglist totally. + Removed global variable print_ansi_qualifiers (which made + code non-reentrant), in favor of extra explicit arguments + to internal routines. +printcmd.c: + Add new helper function print_address_symbolic. + Use find_pc_misc_function instead of find_pc_partial_function + (since we want assembler-level symbols here). +stack.c: + Print unknown function as just "f (...)", not "f (...) (...)". + Use new fputs_demangled explicitly. +symtab.c: + Fixed a typing violation (problem: value.h cannot be imported + without renaming many variable in this file). + lookup_symbol: If no matching misc_func, look for a C++-mangled name. + decode_line_1: Moved forward some never-reached code. + Made decode_line_2 skip function prologues correctly. +utils.c: + fputs_filtered should not demangle by default. + Add new fputs_demangled to demangle on demand.. +valops.c: + Change value_struct_elt to use value_primitive_field (using recursive + utility function search_struct_field). This allows foo.bar to work + for multiple inheritance (so far only for data fields). + Change check_field in the same way (recursive helper function + to support multiple inheritance). + (Note: there are more of these problems that I haven't fixed. + Any code that says TYPE_BASECLASS (t, 1) is probably wrong.) + value_of_this: 'this' symbol name is now just "this", note "$this". +valprint.c: + Don't print static members. + Avoid printing "members of <type>" if there are none. + Simplified type_print_derivation_info by merging duplicate code. + Remove useless blank lines in type_print_base (ptype command). +value.h: + Added declaration of new routine value_primitive_field. +values.c: + Added value_primitive_field which is generalized version of + value_field that can handle multiple inheritance (non-zero offsets etc). + Re-implemented value_field to call value_primitive_field. + +Fri Aug 17 23:33:44 1990 John Gilmore (gnu at cygint) + + * infcmd.c -- insert else to avoid 'delete env' coredump when you + delete the whole environment. Karl Berry reported the bug. + * source.c - fix openp to avoid //'s in filenames, which + trigger an Emacs bug causing it to not be able to find files + when running gdb in a window. + * dbxread.c - zap the #if 0 that botches the add-file code. + It seems to work a lot better without all the code commented out. + +Fri Jul 20 16:58:46 1990 John Gilmore (gnu at cygnus.com) + + * Merge Tiemann's and Ted Goldstein's changes, detailed below, + into gdb-3.90.9. + +Tue Jul 17 19:34:33 1990 Ted Goldstein (tedg at golem) + + * Makefile - added a ${CFLAGS} to a couple of entries, + added remote-sa.sparc.c + * added remote.sa-sparc.c, a modification of remote.c + which conducts a dialog directly with the SparcStation prom. + * breakpoint.c, infrun.c, sparcdep.c added + remote_insert_breakpoint(), and remote_remove_breakpoint() + to breakpoint.c instead of directly writing breakpoint instructions. + * sparcdep.c on remote_debugging,there is no need + to remove signle step breakpoint instructions. + * main.c added "-epoch" flag and "int epoch_interface" to main.c + global variable + * printcmd.c - epoch interface sends lisp expressions to open up + epoch windows on inspection. + * valprint.c - added arrayprint, and addressprint and made adding + format controls easier + * wait.h added a couple of undef's because we were getting + complaints about WSTOPSIG and WTERMSIG begin redefined. + + +Wed Jul 4 05:27:51 1990 Michael Tiemann (tiemann at masham) + + * symtab.c (decode_line_1): Add support for handling method stubs + in the type information. + +Tue Jul 3 09:39:18 1990 Michael Tiemann (tiemann at masham) + + * values.c (baseclass_addr): Run loop from INDEX+1 to + N_BASECLASSES; otherwise, we can still get into a loop. + @@ This should be restructured to use a cleaner search strategy. + +Sun Jul 1 12:28:51 1990 Michael Tiemann (tiemann at masham) + + * dbxread.c (define_symbol,read_type): Grok GNU C++'s new + abbreviation "Tt" for tags which have the same name as their + typedecls. + +Fri Jun 29 01:03:46 1990 Michael Tiemann (tiemann at masham) + + * symtab.c (list_symbols): add ability to set breakpoints on all + the functions which match a particular regular expression. + +Tue Jun 26 04:26:29 1990 Michael Tiemann (tiemann at masham) + + * cplus-dem.c (cplus_demangle): New parameter ANSI says whether we + should print ANSI qualifiers (such as `const' and `volatile'). + All callers changed to call with ANSI == 1, except from + `check_method_stub', which uses old-style syntax. + + * symseg.h (struct fn_field): Remove unneccessary `args' field. + * symtab.h (TYPE_FN_FIELD_ARGS): Redefined. + + * values.c (check_stub_method): New function. + + * cplus-dem.c (do_type): Handle "long long" (encoded as 'x'). + + * dbxread.c (read_type): Handle new GNU C++ method type stubs. + * valprint (type_print_base): Ditto. + + * symtab.c (gdb_mangle_typename): New function. + +Tue Jun 5 00:18:43 1990 Michael Tiemann (tiemann at gzilla) + + * breakpoint.c (catch_command): New function. Provides a + mechanism to set breakpoints based on catch clauses. + (disable_catch): Similar, but disables breakpoints on catch + clauses. + (delete_catch): Similar, but deleted breakpoints on catch clauses. + +Sun Jun 3 22:54:08 1990 Michael Tiemann (tiemann at gzilla) + + * blockframe.c (blockvector_for_pc): New function. + * blockframe.c (block_for_pc): Changed to call + `blockvector_for_pc' and get the block itself. + + * stack.c (catch_info): New function. Prints info about + exceptions which can be caught in the current frame. + * stack.c (print_frame_label_vars): New function. Similar to + `print_frame_local_vars'. + * stack.c (print_block_frame_labels): Prints out labels that are + defined in this frame. These labels are exceptions that can be + caught. + + * dbxread.c: Updated to handle N_CATCH symtab types. + +Thu May 3 22:10:00 1990 Michael Tiemann (tiemann at teacake) + + * valprint.c (everywhere): TYPE_NAME (TYPE) no longer comes in the + form "struct ..." for GNU C++. Don't flush any part of TYPE_NAME + when printing the type. + +Wed May 2 22:43:04 1990 Michael Tiemann (tiemann at teacake) + + * valprint.c (val_print): Use `baseclass_addr' to access the + baseclasses pointed to via the derived class object at VALADDR. + + * values.c (baseclass_addr): New function. Casts derived pointers + to baseclass pointers taking virtual baseclasses and multiple + inheritance into account. + +Sat May 5 12:39:18 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Version 3.90.9. + +Fri May 4 12:12:55 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * breakpoint.c (watch_command, bpstat_stop_status): Deal with + exp_valid_block field correctly. + + * infrun.c (wait_for_inferior): When checking "don't even think + about breakpoints" if stop_signal == SIGTRAP && trap_expected, + also check step_resume_breakpoint. + Insert breakpoints and continue (not step) if + step_resume_break_address != NULL, even if another_trap. + If trap_expected and we enter sigtramp, then set up a + step_resume_break. + If trap_expected is set when we hit the step_resume_break, + set another_trap. + When calling resume and trap_expected says tell resume to step + (2 places), also check step_resume_break_address. + + * infrun.c (wait_for_inferior): Don't set + prev_{pc,sp,func_{start,name}} before calling wait (). + Do set them after exiting loop. + Move their declarations outside functions. + (start_inferior): Initialize them. + +Thu May 3 00:15:11 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * infrun.c (wait_for_inferior, after check for trap_expected > 1): + Restore old code which distinguishes between trap_expected and + running_in_shell, just make the latter take any non-TRAP signal, + not just SEGV. + + * values.c (allocate_value): Zero VALUE_OPTIMIZED_OUT flag. + + * Makefile.dist (pinsn.o): Use PINSN_CC to compile. + xconfig/3b1 (CC,PINSN_CC): Define. + + * xconfig/altos, altos-dep.c: Rename altos-dep.c to altos-xdep.c. + + * Version 3.90.8 + + * breakpoint.c (bpstat_stop_status), + infrun.c (wait_for_inferior) [SHIFT_INST_REGS]: New code. + + * param.h, tm-88k.h: Define ADDR_BITS_*. + infcmd.c (jump_command, read_pc), infrun.c (wait_for_inferior), + printcmd.c (do_one_display): Use them. + + * utils.c: Split #ifdef USG into a USG_UTILS and a QUEUE_MISSING. + xm-88k.h: Define USG_UTILS. + +Wed May 2 00:05:33 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * printcmd.c (printf_command) [__INT_VARARGS_H]: New code. + (printf_command): Add from_tty parameter. + + * valprint.c (value_print): Check VALUE_OPTIMIZED_OUT flag. + + * value.h: Add optimized_out field and change lazy field to + char. Add macro VALUE_OPTIMIZED_OUT. + + * i386-pinsn.c: Change from Eirik Fuller to write to stream directly + instead of stuffing things in buffers (oappend, etc). + + * breakpoint.c (bpstat_do_actions): If *BSP is set to NULL by + execute_command, exit both loops. + + * Makefile.dist: Don't set TARGET_ARCH. Add .c.o rule. + +Tue May 1 17:07:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Makefile.dist (RAPP_OBS, rapp), + rgdb.c, rserial.c, rudp.c, serial.c, udp.c, xdep.h, + remote.h: Added. + m68k-xdep.c, coredep.c: Wrap in #if !defined (RDB). + + * valops.c (value_struct_elt), values.c (value_static_field): + Change error messages to remove references to `info methods'. + +Tue Apr 24 10:25:10 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * More 88k changes: + infrun.c (start_inferior): Add START_INFERIOR_HOOK. + infcmd.c [SHIFT_INST_REGS]: New code. + findvar.c (read_relative_register_raw_bytes): Return a value. + infcmd.c (do_registers_info): Check value from + read_relative_register_raw_bytes. + + * command.c (delete_cmd): Free the struct cmd_list_element(s) + we are removing. + +Mon Apr 23 10:42:21 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * More 88k changes: + findvar.c (get_saved_register): New function. + findvar.c: Rewrite code which called find_saved_register to + call get_saved_register instead. + +Sun Apr 22 14:47:51 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * valprint.c (val_print): Change error message printed when + the type has TYPE_FLAG_STUB set. + + * valprint.c (val_print): Check for TYPE_CODE_UNDEF. + + * findvar.c (write_register): Set register_valid (regno). + + * valops.c (call_function): Check for NULL return from block_for_pc. + +Fri Apr 20 11:31:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * findvar.c (write_register): Add PREPARE_TO_STORE. + {sun3,sparc,symmetry}-xdep.c (PREPARE_TO_STORE): Add. + infptrace.c, {mips,pyr,symmetry,sun3,arm,hp300hpux}-xdep.c + (store_inferior_registers): Don't call read_register_bytes. + symmetry-xdep.c (store_inferior_registers): + #if 0 out code to fetch registers. + + * values.c (value_as_long): Call COERCE_ARRAY. + + * tm-sun3.h: Include tm-68k.h not m-68k.h + + * sparc-tdep.c (single_step): Set next_pc, npc4 within + if (!one_stepped), not outside it. + + * Changes from Data General for 88k: + * coffread.c (read_file_hdr): Add *88*MAGIC. + * coffread.c (have_symbol_file_p): New function. + * coffread.c [COFF_CHECK_X_ZEROES] [TDESC]: New code. + * coffread.c (read_one_sym): If there is more than one + aux entry, don't give an error message, just ignore the + extra ones. + * coffread.c (process_coff_symbol): Replace clipper with + BELIEVE_PCC_PROMOTION in #ifdef's. + * coffread.c: Define L_LNNO32 if not defined. + (enter_linenos): Use it. + * blockframe.c: Add INIT_FRAME_PC hook and use it in + get_prev_frame_info. + m-m88k.h: Use INIT_{FRAME_PC,EXTRA_FRAME_INFO} to do tdesc stuff. + Use dummy versions of FRAME_CHAIN_*. + * Makefile.dist, xconfig/i386*: Rename M_CLIBS to XM_CLIBS and add + TM_CLIBS and CDEPS. + tdesc/libdc.o: New target. + tdesc.{c,h}, tdesc/*, {t,x}config/m88k: New files. + +Thu Apr 12 15:47:00 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * m68k-opcode.h (bras, bsrs): Use "Bw" not "Bg". + +Tue Apr 10 20:50:25 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Version 3.90.7. + + * xm-mips.h (BYTE_ORDER): If not defined, make it LITTLE_ENDIAN. + + * mips-xdep.c ({fetch,store}_inferior_registers): Remove variable + offset and just use register_addr (regno, 1). + (core_file_command): Remove variable reg_offset and just use + register_addr (regno, 0). + + * gdbcore.h [COFF_FORMAT]: #undef a_magic before redefining it. + + * infrun.c ("if (trap_expected && stop_signal != SIGTRAP)", near end + of wait_for_inferior): Always pass 0 as first arg to resume. + #if 0 out "SIGSEGV in shell" test right above it (now redundant). + + * i386-pinsn.c (oappend_address): New function. + (oappend): Make it "static void" and declare at top of file. + (OP_J, OP_DIR): Use oappend_address. + +Mon Apr 9 15:22:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * mips-xdep.c: Include <mips/inst.h> not "mips/inst.h". + + * wait.h [HAVE_WAIT_STRUCT]: Put #defines in #if !defined so that + it's OK if they are defined in <sys/wait.h>. + + * findvar.c (fetch_registers): Pass "registers", not "®isters", + to remote_fetch_registers. + + * mips-tdep.c (_initialize_mipsdep): Remove hex_disassembler + and re-write skip_prologue to use add_set_cmd. + + * Makefile.dist (alldeps.mak): Don't put \ after the last + filename in each list. + +Sun Apr 8 01:59:19 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Version 3.90.6. + + * Makefile.dist (alldeps.mak): "XM_FILE" -> "XM_FILE=". + + * valarith.c (value_x_{un,bin}op): use "operator" not "operator " + to match dbxread.c change of 16 Mar 90. + + * valarith.c (value_x_unop): Pass &static_memfuncp, + not static_memfuncp. + + * breakpoint.c: Add watchpoint stuff. + breakpoint.h: Add bpstat_should_step. + infrun.c (proceed, wait_for_inferior): Use it. + breakpoint.h: Add bpstat_print (and rename old bpstat_print + to bpstat_should_print). + infrun.c (normal_stop): Use it. + + * value.h: Add value_free. Declare a few functions. + +Sat Apr 7 21:43:43 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * dbxread.c (read_dbx_symtab): Remove PROFILE_TYPES code and + insert comment suggesting easy shell script equivalents. + + * values.c (unpack_long): Give better error messages for + unrecognized sizes of ints and floats. + +Fri Apr 6 00:32:21 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * dbxread.c, gdbcore.h (IS_OBJECT_FILE): Check for a_drsize + nonzero as well as a_trsize. + + * More places: Use SWAP_TARGET_AND_HOST. + + * valops.c (destructor_name_p): Only skip "struct " if present. + + * main.c (gdb_readline): Return NULL on end of file. + + * sparc-opcode.h: Add jmp 1+2, jmp 1+i, jmp i+1. + + * Makefile.dist: Make expread.tab.c unambiguously be in srcdir. + + * main.c: Split source_command into source_command and + read_command_file. + (main): Accept "-" as arg to +command for stdin. + + * dbxread.c (psymtab_to_symtab): Don't read string table. + (symbol_file_command): Save string table size. + + * Version 3.90.5 + + * symtab.c: Remove declaration of lookup_misc_func. + + * mips-pinsn.c: Add use_hex_p stuff (re-worked from Forin stuff). + + * mips-opcode.h: Add bdelay field. + mips-pinsn.c: Various changes from Forin, I think to make it look + like the MIPS assembler format. + mips-tdep.c, mips-xdep.c, mipsread.c: Various changes from Forin. + + * gdbcore.h: Declare register_addr. + + * gdbcore.h: Include <a.out.h>, before trying to redefine N_TXTADDR + and friends. + various: Don't include both a.out.h and gdbcore.h. + + * Makefile.dist (HFILES): Add param.h + + * utils.c (init_malloc): Moved here from mcheck.c and modified + to use the standard mcheck.c + Makefile.dist: Modify to reflect new mcheck. + +Thu Apr 5 16:38:28 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * valprint.c (val_print, print_hex_chars): Print integers + larger than LONGEST. + + * valarith.c (value_sub): Give error message if attempt to + subtract something of the wrong type from a pointer. + + * breakpoint.c (bpstat_stop_status): Initialize retval to NULL. + + * i386-tdep.c (i386_pop_frame): Change addr to adr. + +Wed Apr 4 05:21:50 1990 Jim Kingdon (kingdon at teenage-mutant) + + * main.c (command_line_input): return NULL on end of file. + (execute_command): If p is NULL, return almost right away. + (read_command_lines): Treat end of file like "end". + + * printcmd.c (print_frame_args): Change it so num is number + of ints of args, not number of args. + + * xm-*.h: Make sure BYTE_ORDER is defined. + Also fix various #includes of old names of things. + + * main.c (command_line_input): Fix comment code of 2 Apr. + + * values.c (value_from_long, unpack_long): SWAP_TARGET_AND_HOST. + various: Replace {BYTES,WORDS}_BIG_ENDIAN with TARGET_BYTE_ORDER. + valarith.c various: SWAP_TARGET_AND_HOST. + dbxread.c (READ_FILE_HEADERS): SWAP_TARGET_AND_HOST. + (SWAP_SYMBOL): New macro. Use it wherever symbuf_idx is incremented. + exec.c (exec_file_command): SWAP_TARGET_AND_HOST. + + * valarith.c (value_subscripted_rvalue): Just bcopy() the + appropriate bytes rather than playing strange games with + value_from_long. + + * param.h (SWAP_TARGET_AND_HOST): New macro. + + * tm-np1.h (V7_REGNUM): Change from 27 to 26. + (REGISTER_VIRTUAL_TYPE): Return correct result for vector regs. + gould-tdep.c: New file. + + * Move reading of register before store from + findvar.c (write_register) to + infptrace.c, *-xdep.c (store_inferior_register). + + * findvar.c (fetch_registers, store_registers): New functions. + write_register{,_bytes}: Use store_registers regardless of + have_inferior_p. + registers_valid: New variable. + (supply_register, read_register, etc.): Use it. + (read_register_gen): New variable. + various: Use read_register_gen rather than read_register_bytes + where appropriate. + *-xdep.c (fetch_inferior_registers): Remove remote_debugging check. + infrun.c (wait_for_inferior, start_inferior): Call registers_changed + not fetch_inferior_registers. + *-xdep.c (fetch_inferior_registers): Call registers_fetched if + not setting registers via supply_register, and if fetching + all registers. + infptrace.c, *-xdep.c (fetch_inferior_registers): Add param, + # of register to fetch (-1 for all). + infptrace.c, hp300hpux-xdep.c (fetch_inferior_registers): + Actually fetch only those registers needed. + value.h: Declare all the extern register functions from findvar.c. + + * coffread.c (read_coff_symtab): Test for specific kinds of GCC + labels (LI%.*, LPB%.*, etc), not just ??%.*. + + * coffread.c (record_misc_function): Use mf_text not mf_unknown. + + * utils.c,defs.h (lines_to_list): New function. + source.c (select_source_symtab, list_command, forward_search_command, + reverse_search_command), stack.c (print_frame_info): + Use it instead of 10. + + * munch: If MUNCH_NM variable exists, use it. + + * main.c (initialize_main): Set rl_readline_name. + main.c: #include readline.h and #undef savestring. + Remove declarations of things declared in readline.h. + + * main.c (gdb_readline): If instream == 0, read from stdin. + + * main.c (main): Only call clearerr if ISATTY. Exit loop if + feof (instream). + + * infcmd.c (detach_command): Set inferior_pid to 0 after + calling remote_close. + + * main.c (main): If exec and sym files are the same, and there + is an error reading execfile, don't try to read sym file. + + * infcmd.c (detach_command) [ATTACH_DETACH]: Don't try to detach + from inferior when remote debugging. + + * source.c (reverse_search_command): Change while test from 1 to + line > 1. + +Tue Apr 3 18:14:14 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Version 3.90.4. + + * Makefile.dist (gdb.tar.Z): Use -z option to tar rather than + creating gdb.tar and calling compress separately. + + * breakpoint.c (read_memory_nobpt): Do not treat bcopy as if it + returned an "errno" value. + + * various: Make sure gdbcore.h is not included before a.out.h. + + * Makefile.dist (OPCODES): Add mips-opcode.h. + + * config.gdb: Print lists of {hosts,targets} after finding srcdir. + When parsing +{host,target}=, strip off +{host,target}=, not +{x,t}m=. + + * Makefile.dist (gdb.tar): Do {t,x}config not just config. + +Mon Apr 2 02:42:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * sparc-opcode.h (inc): Fix incorrect lose field. + + * valarith.c (value_subscripted_rvalue): Use TARGET_BYTE_ORDER, + rather than checking endianness at runtime. + + * main.c (comand_line_input): Accept comments anywhere, not + just at starts of lines. + +Sat Mar 31 21:59:35 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * symtab.c (check_stub_type): Call lookup_symbol with 5 args. + +Fri Mar 30 15:23:52 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * frame.h: #include param.h. + param.h: Protect against multiple inclusion. + + * i386-tdep.c (i386_get_frame_setup): Fix comment about what + opcode 0x55 is. + If 0x81 or 0x83 is followed by something besides 0xec, + put codestream back where it was and return 0. + [USE_MACHINE_REG_H]: Include <machine/reg.h> not <sys/reg.h> + Move include of a.out.h above <sys/user.h>. + (i386_frame_find_saved_regs): Make locals signed. + (i386_frame_find_saved_regs, i386_push_dummy_frame, i386_pop_frame): + Use REGISTER_BYTES, REGISTER_RAW_SIZE, etc. to deal with floating + point registers. + +Wed Mar 28 18:33:40 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * Makefile.dist (OTHERS): Add gdb.dvi. + (gdb.dvi): New rule. + + * breakpoint.c (_initialize_breakpoint): Clean up docstrings so + as not to mention subcommands (e.g. auto-display). + Call add_cmd not add_abbrev_cmd for "disable breakpoint" and + put it in class_alias. + + * breakpoint.c (set_breakpoint_count): New function. + (set_breakpoint, break_command_1): Use it. + + * breakpoint.c (get_number): New function. + (*_command, map_breakpoint_numbers): Use it. + + * infptrace.c (write_inferior_memory): Remove remote_debugging + stuff (is handled in core.c). + (read_inferior_memory): Remove #if 0'd out remote_debugging code. + +Tue Mar 27 16:51:27 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * inferior.h: Include frame.h. + + * findvar.c (write_register): Replace sun4 #ifdef with + check of CANNOT_STORE_REGISTER. + xm-sparc.h: Define CANNOT_STORE_REGISTER. + + * sparc-tdep.c: Remove superfluous declaration of + get_breakpoint_commands. + + * breakpoint.{c,h}: Add bpstat stuff. + bpstat_do_action: Re-work do_breakpoint_commands into this. + main.c (command_loop): Call bpstat_do_action not + do_breakpoint_commands. + inferior.h, infrun.c, breakpoint.c, infcmd.c: + Rework breakpoint_commands and stop_breakpoint + stuff to use bpstat instead. + + * infcmd.c (program_info): "info reg"->"info registers". + + * np1-opcode.h: Renamed from npl-opcode.h. + gould-pinsn.c: Include np1-opcode.h. + Makefile.dist (OPCODES): Change npl-opcode.h to np1-opcode.h + + * coffread.c (read_enum_type): Stop reading when we hit .eos. + +Mon Mar 26 15:52:35 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Version 3.90.3. + + * breakpoint.c (read_memory_nobpt): New function. + gdbcore.h: Declare read_memory_{nobpt,check}. + mips-tdep.c: Use read_memory_nobpt not breakpoint_shadow_val. + +Fri Mar 23 14:26:38 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * inflow.c (terminal_inferior): Reenable commented out + inferior_thisrun_terminal check. + (terminal_ours_1): If inferior_thisrun_terminal is nonzero, + return immediately. + + * Makefile.dist: Rewrite DEPFILES, M_FILE, etc. stuff to deal + with host & target separation. + + * config/*: Split into xconfig/* and tconfig/*. + *-dep.c: Split into *-xdep.c and *-tdep.c. + + * main.c (main): Always pass two args to xrealloc. + +Thu Mar 22 20:29:25 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * Makefile.dist ({,dist}clean): rm {x,t}m.h not param.h + xgdb.o: Remove obsolete dependency (now in depend). + + * arm-pinsn.c: Include arm-opcode.h not opcode.h. + + * mips-pinsn.c, mips-opcode.h: New files from Bothner (from + release of 24 Jan 90 with mips-opcode.h patch from 1 Feb 90). + + * utils.c (xmalloc): Return NULL on request for 0 bytes. + +Wed Mar 21 13:30:08 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * config.gdb: Re-write machine stuff to deal with host & target. + + * xm-altos.h: Don't define HAVE_WAIT_STRUCT. + + * m-*.h: Split into xm-*.h and tm-*.h. + + * infrun.c (wait_for_inferior): Put #ifdef sony_news code + in regardless of machine. + + * symtab.c (decode_line_1): Add quotes and capitalize error + message "no class, struct, or union named". + + * Makefile.dist (cplus-dem.o): Compile with -Dnounderscore. + + * stack.c (print_frame_info): Use print_symbol to print function name. + + * symtab.c (output_source_filename): Don't print a comma if + we are skipping a filename already printed. + +Tue Mar 20 10:48:54 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * symtab.c (output_source_filename): Don't print a filename + more than once. + + * utils.c (fprint_symbol): New function. + defs.h: Decalare it. + various: Use fprint_symbol to print symbol names. + Makefile.dist (SFILES, OBS): Add cplus-dem.{c,o}. + +Mon Mar 19 17:11:03 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * coffread.c (read_file_hdr): Add MC68K??MAGIC. + + * coffread.c (read_coff_symtab): Ignore swbeg and string label + symbols. + + * coffread.c (read_coff_symtab): Increment num_object_files + in case C_STAT not C_FILE. + New variable in_source_file. Set it in case C_FILE. + Check it in case C_STAT. + + * coffread.c [FUNCTION_EPILOGUE_SIZE]: New code. + m-umax.h (FUNCTION_EPILOGUE_SIZE): Define. + + * config/3b1: New file. + + * config/sun*: Print message warning people to use GAS with GCC. + +Sun Mar 18 02:56:40 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * infcmd.c (run_stack_dummy): Change error message. + + * m-68k.h (REGISTER_VIRTUAL_TYPE): Make pc, fp, sp char *. + + * m-mips.h (LONGEST, BUILTIN_TYPE_LONGEST): Remove. + +Sat Mar 17 21:27:49 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * mips-dep.c: Remove infptrace.c stuff. + + * m-bigmips.h: New file. + m-mips.h [MIPSEB]: Remove *_BIG_ENDIAN stuff. + + * m-sparc.h (FIX_CALL_DUMMY): Do not insert unimp instruction + if function was compiled with gcc. + + * m-mips.h: Remove FIX_CALL_DUMMY_ALIGNED and make FIX_CALL_DUMMY + use new args. + + * valops.c (call_function): New args to FIX_CALL_DUMMY. + m-*.h (FIX_CALL_DUMMY): Take new args. + + * values.c (using_struct_return): New parameter gcc_p. + valops.c (call_function): New variable using_gcc. + valops.c (call_function) [REG_STRUCT_HAS_ADDR]: New code. + + * m-mips.h, mips-dep.c: New files from Forin. + m-mips.h: Replace RETURN_STRUCT_BY_REF with USE_STRUCT_CONVENTION. + +Fri Mar 16 13:17:19 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Makefile.dist: Add some dependencies of m-*.h files. + (HFILES): Add m-68k.h. + + * dbxread.c (read_struct_type): Put "operator+" not "operator +" + in symtab. + + * core.c: Split read_memory into read_memory_check and read_memory. + breakpoint.c (insert_breakpoints): If can't read memory, + tell user that error was due to seting breakpoints. + +Thu Mar 15 11:47:19 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * infrun.c [COFF_ENCAPSULATE]: Include a.out.encap.h. + + * blockframe.c (FRAMELESS_LOOK_FOR_PROLOGUE): Make it a function. + various m-*.h: Call function not macro. + frame.h: Declare the function. + +Wed Mar 14 02:44:51 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * sparc-dep.c: Include signame.h. + + * sparc-pinsn.c (print_insn): When looking for sethi before + delayed branch, call read_memory_noerr not read_memory. + + * m-isi.h, m-sun3.h, m-news.h, m-hp300bsd.h, m-altos.h, + m-hp300hpux.h, m-sun2.h: Merge machine stuff except inferior + function call stuff into new file m-68k.h. Create m-3b1.h. + +Tue Mar 13 21:34:33 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * inflow.c (new_tty): If can't open tty, print error message + before exiting. + + * blockframe.c: Remove declaration of psymtab_to_symtab. + symtab.h: Declare psymtab_to_symtab. + blockframe.c: Remove declarations of block_for_pc and + find_pc_function_start. + frame.h: Add declarations of block_for_pc and find_pc_function_start. + Remove declaration of nonexistent function find_pc_function. + values.c: include frame.h instead of declaring block_for_pc. + + * Version 3.90.2. + +Mon Mar 12 14:20:06 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * main.c (main): Delete superfluous "e" from long_options. + +Sat Mar 10 15:47:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * valprint.c (val_print): Print <%d bit integer> not just + <large integer>. + + * dbxread.c (error_type): Fix loop that finds '\0' so that on + exit, *pp points to the '\0', not the character after. + (read_type): Make sure that places which call read_type and then + try to read more input stop immediately with another error + upon encountering '\0'. + + * dbxread.c (read_range_type): Fix check for large signed + integral type to match comment and reality. Set TYPE_LENGTH based + on n2bits for signed, n3bits for unsigned. + + * infcmd.c (cont_command): Print warning message if we + decide to ignore the argument. + + * gdb.texinfo (attach): @xref{Attach} -> @xref{Remote}. + +Fri Mar 9 16:26:47 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * symtab.h (address_class): Reinstate LOC_EXTERNAL with rewritten + comment. + + * expread.y (yyerror, parse_c_1): Make yyerror take a char * arg. + + * main.c (symbol_completion_function): Don't call error() on + "info jkldskf". + + * m-npl.h (USE_STRUCT_CONVENTION): Change >= to >. + +Thu Mar 8 00:19:01 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * symseg.h: Nuke more symseg references including LOC_EXTERNAL. + Put contents of symseg.h into symtab.h and remove symseg.h. + +Wed Mar 7 18:02:15 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * symtab.h (SYMBOL_LINE): New macro. + symtab.c (decode_line_1): Accept variable as well as function. + Lookup variable/function in selected block if no file specified. + printcmd.c: #if 0 out whereis_command. + + * command.c (do_setshow_command): Call function with additional + argument C. + main.c (set_history_size_command): Take argument C. + (set_verbose): New function to set docstring. + (initialize_main): Put set_verbose in command list. + command.c (lookup_cmd_1): Accept result_list NULL. + + * valprint.c (_initialize_valprint): Change docstring for + "set unionprint" to normal set/show form. + + * command.c (add_show_from_set): Check that docstring starts with + "Set " before assuming it does. + + * main.c (show_history): Call cmd_show_list. + command.{c,h} (cmd_show_list): New function. + command.h: Declare do_setshow_command. + + * command.h (cmd_list_element): New field completer. + main.c (symbol_completion_function): Use it. + symtab.h: Declare make_symbol_completion_list. + command.c (add_cmd): Set completer. + main.c, gdbcmd.h (noop_completer): New function. + infcmd.c: Set completer for environment functions. + + * symtab.c (types_info, _initialize_symtab): #if 0 out. + various: Use fputs_filtered, not fprintf_filtered(%s). + + * valprint.c (type_print_base): Check for integers larger than + LONGEST. + + * sun3-dep.c: Include "signame.h" instead of directly declaring + sys_siglist. + +Tue Mar 6 14:59:34 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * infrun.c (signals_info): Allow argument to be a signal name + as well as an expression. + (handle_command): Check for error from sig_number. + + * main.c (float_handler): Change error message. + + * inflow.c (create_inferior): If getenv ("SHELL") exists, use it + instead of /bin/sh. + + * dbxread.c (read_dbx_symtab, case N_SO): New variable first_symnum. + Pass it to {start,end}_psymtab. + + * dbxread.c (read_ofile_symtab): Increment symbuf_idx and symnum + when calling process_symbol_pair. + + * symtab.c (sources_info, output_source_filename): + Re-write so output_source_filename takes a first parameter + instead of a next one. + + * dbxread.c (read_dbx_symtab, case N_SO): When incrementing + symbuf_idx, increment symnum also. + + * values.c (set_internalvar_component): Use VALUE_CONTENTS, + not VALUE_CONTENTS_RAW. + + * symmisc.c (free_symtab): Don't free filename (now in symbol_obstack). + + * environ.c (init_environ): Copy entire string, including + terminating '\0'. + + * value.h, values.c: Rename value_lazy to value_fetch_lazy. + values.c (value_of_internalvar): Call value_fetch_lazy. + + * dbxread.c (read_huge_number): Return an error on encountering + a large decimal number. + + * dbxread.c (read_huge_number): Reverse sense of overflow test. + + * valprint.c (val_print, case TYPE_CODE_INT): Check for integers + larger than LONGEST. + + * dbxread.c (read_ofile_symtab): When calling process_one_symbol, + call it with desc and value rather than with bufp->n_{desc,value}. + + * defs.h (LONG_MAX): Define. + + * sun3-dep.c: Declare sys_siglist. + + * infptrace.c: Move include of gdbcore.h after a.out.h + + * Makefile.dist (expread.o, mcheck.o): Remove leading "./" not + leading ".". + + * m-hp300hpux.h [!HPUX_VERSION_5]: Define KERNEL_U_ADDR_HPUX. + infptrace.c [KERNEL_U_ADDR_HPUX] [KERNEL_U_ADDR_BSD]: + Set kernel_u_addr using nlist(). + m-hp300bsd.h: Define KERNEL_U_ADDR_BSD. + +Mon Mar 5 16:52:41 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * dbxread.c (read_dbx_symtab): If value of .o symbol is crazy, + don't end psymtab. + + * dbxread.c (read_dbx_symtab): Ignore first of a pair of N_SO + when both appear. + (start_subfile, start_symtab): Extra parameter dirname. + (start_subfile): Use obsavestring, not savestring, for name. + various: Call start_{subfile,symtab} with extra argument. + (end_symtab): Set dirname field in symtab. + (read_ofile_symtab): Call process_symbol_pair on pair of N_SO. + (process_symbol_pair): New function. + symtab.h (symtab): New field dirname. + source.c (open_source_file): New function. + source.c: Use open_source_file instead of openp where appropriate. + + * defs.h (TARGET_CHAR_BIT): Define. + +Sun Mar 4 13:11:48 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * dbxread.c (fill_symbuf): Print error messages nicely. + + * Makefile.dist (SFILES): Put standalone.c at end. + + * Makefile.dist (alldeps.mak): Put out backslash after arm-convert.s. + + * symtab.{c,h} (builtin_type_error): New type. + symseg.h (type_code): Add TYPE_CODE_ERROR. + valprint.c (val_print, type_print_base), + values.c (using_struct_return, set_return_value): + Check for and deal with TYPE_CODE_ERROR. + dbxread.c (error_type): New function + (read_type and subroutines): Call error_type instead of error. + + * dbxread.c (read_huge_number): New function. + (read_range_type): Use read_huge_number and check results + to see if it is a large integral type. + + * symmisc.c: Remove symseg stuff. + + * Gould NP1 changes from (or inspired by) chpmjd@gdr.bath.ac.uk + dbxread.c (read_dbx_symtab) [N_NBSTS]: + Treat this and N_NBLCS like N_LCSYM, etc. + (process_one_symbol) [BLOCK_ADDRESS_ABSOLUTE]: New code. + m-npl.h (USE_STRUCT_CONVENTION): Add. + (IGNORE_SYMBOL): Add 0xa4. + (END_OF_TEXT_DEFAULT): Remove. + (STRING_TABLE_OFFSET): don't add sizeof(int). + [!HAVE_VPRINTF]: Define vprintf to be doprnt, not printf. + (BLOCK_ADDRESS_ABSOLUTE): Define. + (BREAKPOINT): Pad to size of machine word. + (SAVED_PC_AFTER_CALL): Remove ` at start of line (!). + (R2_REGNUM): Define. + (SP_REGNUM, FP_REGNUM): Switch definitions. + (REGISTER_U_ADDR): Use FP_REGNUM in place of SP_REGNUM. + (STORE_STRUCT_RETURN, EXTACT_RETURN_VALUE, STORE_RETURN_VALUE, + call function stuff): + Replace bogus definitions with correct ones for NP1. + (CANNOT_EXECUTE_STACK): Define. + (FRAME_LOCALS_ADDRESS): Don't add 80. + (FRAME_FIND_SAVED_REGS): Also get SP. + gould-pinsn.c (findframe): Move framechain declaration outside #if 0. + infptrace.c (write_inferior_memory): Check addr against text_end + and use PT_WRITE_I or PT_WRITE_D as appropriate. + (store_inferior_registers): Don't try to write registers in + CANNOT_STORE_REGISTER. + m-npl.h (CANNOT_STORE_REGISTER): Define. + npl-opcode.h (lil): 0xf8080000 -> 0xf80b0000. + + * munch: Distinguish between BSD and System V nm by actually + seeing what output from nm looks like. + +Fri Mar 2 13:43:36 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * printcmd.c (print_frame_args): Change highest_offset to point + to next unprinted arg. + + * main.c (main): Print "type help for list of commands" along + with the version. Follow it with a blank line. + +Thu Mar 1 14:49:26 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * valprint.c: Move print_address for function from value_print + to val_print. + +Wed Feb 28 15:06:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Makefile.dist (m-sun4os4.h): Depend on m-sparc.h + + * Makefile.dist (version.c): Depend on Makefile.dist, not Makefile. + + * Makefile.dist: Change MAKEFILES to Makefiles. + + * symtab.h: Declare get_sym_file. + core.c: Include symtab.h. + + * Move signal name stuff from utils.c to signame.c + Move signal name stuff from defs.h to signame.h. + Makefile.dist (SFILES, HFILES, OBS): Add signame.{c,h,o}. + +Mon Feb 26 12:03:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * command.c (add_cmd): Don't call savestring on name. + +Sun Feb 25 15:52:18 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * printcmd.c (print_frame_args): Make highest_offset an int. + New variable args_printed. + (print_frame_nameless_args): Remove parameter end and add num + and first. + (print_frame_args): Change call to print_frame_nameless_args. + +Fri Feb 23 21:40:15 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * stack.c (up_command, down_command): + Only print stack frame if from_tty. + +Thu Feb 22 12:01:36 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * expread.y: Inlcude value.h and don't cast return value from + lookup_internalvar. + + * infrun.c: Remove code in #ifdef UMAX_PTRACE. + + * values.c (convenience_info): Print in form "$foo = 5". + Don't print "Debugger convenience variables:" before first one. + + * Makefile.dist: Remove ADD_FILES from CLIBS. + (gdb, kdb, xgdb): Put in ADD_FILES as well as CLIBS. + + * m-pyr.h: #if 0 out call dummy stuff. + Put in POP_FRAME which just calls error(). + valops.c: If CALL_DUMMY is not defined, put in dummy call_function + which just prints an error message. + +Tue Feb 20 22:11:40 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * breakpoint.c (commands_command): Add arg from_tty. + + * main.c (main): Put if (!setjmp (to_top_level)) around calls + to *_command made in response to command line arguments. + +Mon Feb 19 13:58:28 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * main.c (main): Use getopt_long_only. Move one-character options + to long_options. Remove entries which are just unambiguous + abbreviations of other options. + + * command.h: Add types cmd_types and var_types. + Add fields type, var_type, and var to struct cmd_list_element. + command.c (add_set_cmd, add_set_from_show): New functions. + (add_cmd): Set c->var_type. + (add_abbrev_cmd): Call add_cmd instead of duplicating code. + main.c: Add showlist. + Move parse_binary_operation from main.c to command.c. + command.c (do_setshow_command): New function. + gdbcmd.h: New file. + Makefile.dist: Add gdbcmd.h. + many files: Include gdbcmd.h, use add_set_cmd and add_show_from_set. + Replace info * with show * where appropriate. + utils.c (fputs_filtered): Use UINT_MAX in lines_per_page to mean + no paging. + defs.h: Define UINT_MAX. + infcmd.c (run_command): Use execute_command, not set_args_command. + main.c (execute_command): Call do_setshow_command if necessary. + main.c (show_command, show_history): New functions. + main.c (initialize_main): Call add_prefix_cmd + for show and show history. + + * coffread.c (enter_linenos): Print error if + file_offset < linetab_offset. + +Sun Feb 18 15:37:05 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * convex-dep.c (comm_registers_info): Fix typo. ("argc"->"arg"). + +Wed Feb 14 20:45:14 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * config.gdb: Create Makefile with make. + + * Makefile.dist, config.gdb: Move "srcdir=" line from Makefile.dist + to new file Makefile.srcdir. + + * valprint.c: Include <errno.h>. + + * value.h: Declare value_coerce_function. + + * findvar.c: Add missing " after #include "gdbcore.h + + * main.c (main): Re-write command parsing to use getopt. + On "gdb +help" print options with '+' not '-'. + Makefile.dist: Add getopt. + +Tue Feb 13 00:08:27 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Makefile.dist: Add "srcdir=." + config.gdb: Edit srcdir= rather than adding it to the beginning. + + * pyr-dep.c: Make global_reg_offset, last_frame_offset not static. + Move definition of reg_stack_offset to core.c [REG_STACK_SEGMENT]. + + * config/pyramid: Print message about alloca. + + * breakpoint.c (clear_command): When printing "no breakpoint" + error, only use arg if non-NULL. + + * core.c (read_memory): Rename to read_memory_noerr. + (read_memory): New function which calls read_memory and checks for err. + gdbcore.h: Declare all extern core.c functions. + move myread from core.c to utils.c. + declare it in defs.h. + (read_memory_integer): move from infcmd.c to core.c. + gdbcore.h: Declare it. + Many places: Remove error checking on read_memory, or call + read_memory_noerr instead. Include "gdbcore.h" if calling either. + + * value.h (COERCE_ARRAY): Coerce functions to function pointers. + valops.c (value_coerce_function): New function. + + * core.c, convex-dep.c, arm-dep.c (xfer_core_file): Return EIO + if address out of bounds. + + * m-arm.h, arm-dep.c arm-pinsn.c arm-opcode.h: New files. + dbxread.c, m-convex.h (VARIABLES_INSIDE_BLOCK): Add gcc_p parameter. + Makefile.dist (alldeps.mak): Special case for arm-convert.s. + dbxread.c (define_symbol): Check for local based on it not + being any one of the known deftypes. + values.c (using_struct_return): Use new macro USE_STRUCT_CONVENTION. + + * Makefile.dist, config.gdb: Put in srcdir stuff. + +Mon Feb 12 22:46:16 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * breakpoint.c: Add addr_string and cond_string fields to + struct breakpoint. + (break_command_1): Set them. Use mention (). + (mention): Create with code from break_command_1. + (breakpoint_re_set): New function. + (breakpoint_clear): Remove. + (condition_command): Set cond_string. + (breakpoint_delete): Free cond_string and addr_string. + Declare parse_c_1's type and remove casts to struct expression *. + symmisc.c (free_all_symtabs): Don't call breakpoint_clear. + dbxread.c, coffread.c (reread_symbols): Call breakpoint_re_set, + Include breakpoint.h. + breakpoint.h: New file. + dbxread.c: Move declaration of symmisc.c functions to symtab.h. + +Sun Feb 11 17:29:23 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * symtab.c: Make lookup_block_symtab extern. + symtab.h: Declare it. + valops.c (value_of_this): Use it. + +Fri Feb 9 08:59:37 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * config/hp300hpux: Print message telling people to use gcc. + + * value.h: Declare print_floating. + printcmd.c (print_scalar_formatted, case 'f'): Use print_floating. + valprint.c (val_print, case TYPE_CODE_FLT): Use print_floating. + valprint.c (print_floating): Make this function out of is_nan + and the code which was in val_print. + Put parentheses around high & 0xfffff. + Print sign and fraction for NaN's. + Print 17 digits not 16 for doubles. + (is_nan): Remove. + m-news.h, m-sun3.h: Define IEEE_FLOAT. + + * Rename gld-pinsn.c to gould-pinsn.c. + config/{pn,npl}: Change name of gld-pinsn.c + +Tue Feb 6 00:25:36 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * infptrace.c: Define PT_ATTACH if not defined. + m-hp300hpux.h: Define ATTACH_DETACH. + + * main.c (initialize_main): Change alias class to aliases. + + * dbxread.c: Search and destroy references to symsegs. + Also remove some #if 0'd code. + + * core.c: Remove reread_exec. + dbxread.c (reread_symbols): New function. + dbxread.c (symbol_file_command): Set symfile_mtime. + coffread.c: Same. + infcmd.c (run_command): Call reread_symbols not reread_exec. + + * valprint.c (val_print): When printing string after char *, print + it for "" just like any other string. + + * core.c (reread_exec): New procedure. + infcmd.c (run_command): Call reread_exec. + + * coffread.c (symbol_file_command): Add from_tty. + + * dbxread.c (symbol_file_command): Only ask about loading new + symbol table if from_tty. + +Mon Feb 5 02:25:25 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * inflow.c (inferior_died): Call breakpoint_clear_ignore_counts. + + * Makefile.dist (OBS): Remove dbxread.o and coffread.o. + + * config.gdb: Ignore files ending in '#' in config. + + * stack.c (backtrace_command): Add QUIT to get_prev_frame loops. + +Sat Feb 3 22:25:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * Makefile.dist (YACC): Don't use -v. + +Fri Feb 2 19:26:50 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * createtags: Only change .o to .c at end of name. + + * Makefile.dist (alldeps.mak): new target. + (Makefile): add alldeps.mak. + (SOURCES): remove PINSNS. + (TAGFILES: use ALLPARAM. + (gdb.tar): add config/. + + * config.gdb: Check for M_FILE= not #param.h + config/*: Make sure M_FILE= exists with space after M_FILE=. + Makefile.dist (TAGS): Pass M_FILE and DEPFILES. + createtags: Change .o to .c. Remove special tests for dep.c etc. + + * dbxread.c, coffread.c: Don't check COFF_FORMAT and READ_DBX_FORMAT. + Makefile.dist: Move {dbx,coff}read.c from SFILES to ALLDEPFILES. + config/*: add dbxread.o or coffread.o to depfiles. + + * Makefile.dist (depend): Depend on $(SOURCES), not force. + +Thu Feb 1 17:43:54 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * symmisc.c (print_symbol): Print newline after label. + +Wed Jan 31 22:35:38 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * dbxread.c (read_addl_syms): Remove code that checks for + _etext. + Move end_of_text_addr into read_dbx_symtab. + (read_dbx_symtab): #if 0 out code which checks for _etext. + +Tue Jan 30 15:40:19 1990 Jim Kingdon (kingdon at albert.ai.mit.edu) + + * Makefile.dist (gdb.tar): Use readline's "make readline.tar" + instead of having a list of readline files. + + * infrun.c (normal_stop): #if 0 out "you have found a bug in sh". + + * munch (-DSYSV): Check for .text at end of name. + Optionally allow extra underscore before initialize. + Remove space between #! and /bin/sh. + + * m-merlin.h: Put in clarifying comments about SHELL_FILE. + Makefile.dist (install): Execute M_INSTALL. + config/merlin: Define M_INSTALL. + +Mon Jan 29 04:32:09 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * inflow.c: Change all references to signal handlers from + int (*)() to void (*)(). + + * main.c: Declare init_signals before use & make it void. + Declare initialize_all_files. + + * Makefile.dist (config.status): New target. + +Sat Jan 27 00:19:50 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * defs.h (enum command_class): Remove comma after last element. + + * Makefile.dist (gdb.tar.Z): Use compress <foo >bar rather + than deleting gdb.tar.Z before starting. + + * dbxread.c (process_one_symbol): Compare context_stack_depth + with !VARIABLES_INSIDE_BLOCK, not VARIABLES_INSIDE_BLOCK. + + * mcheck.c: Put whole file in #if defined MALLOC_RANGE_CHECK. + + * mcheck.c (checkhdr): Call fatal_dump_core not abort. + + * mcheck.c: Copy from malloc distribution. + + * main.c (main): Call init_malloc (). + + * main.c (initialize_signals): Rename to init_signals. + +Fri Jan 26 00:53:23 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * *dep.c: Make core_file_command return void. + + * gdbcore.h [!KERNEL_U_ADDR]: Declare kernel_u_addr. + infptrace.c [!KERNEL_U_ADDR]: Make it extern. + + * altos-dep.c (NBPG, UPAGES): Wrap #define in #if !defined. + + * m-pn.h (GOULD_PN): Define. + *-pinsn.c: Include actual opcode table not just opcode.h + + * main.c [ALIGN_STACK_ON_STARTUP]: New code. + m-i386.h: Define ALIGN_STACK_ON_STARTUP. + + * m-merlin.h (NO_SIGINTERRUPT, SHELL_FILE): Define. + + * Move code from infptrace [USE_PTRACE_GETREGS] to sun3-dep.c. + m-sun{2,3}.h, m-sparc.h: Define FETCH_INFERIOR_REGISTERS. + + * Makefile.dist, config.gdb, config/*: + Re-write to use machine-dependent makefiles instead of cpp. + + * m-hp300hpux.h: Define FETCH_INFERIOR_REGISTERS. + infptrace.c: Put {fetch,store}_inferior_registers inside + #if !defined FETCH_INFERIOR_REGISTERS. + + * Split execcore.c into exec.c and coredep.c. + Move a bunch of stuff from coredep.c and *dep.c to gdbcore.h. + + * infptrace.c ({fetch,store}_inferior_registers): + Use U_REGS_OFFSET to set offset. + m-umax.h: Define U_REGS_OFFSET. + + * m-umax.h: Define PTRACE_{ATTACH,DETACH}. + + * m-i386.h (N_SET_MAGIC): Define. + m-i386gas.h: add #undef N_SET_MAGIC. + +Thu Jan 25 18:39:45 1990 Jim Kingdon (kingdon at mole.ai.mit.edu) + + * m-hp300bsd.h: Remove KERNEL_U_ADDR. + + * infptrace.c [!KERNEL_U_ADDR]: Get address of kernel u area + at runtime. + + * infptrace.c: Replace numbers with PT_KILL, etc. + (store_inferior_registers): Loop for as many words are in the register. + + * infptrace.c [NO_SINGLE_STEP]: Call single_step(). + + * kill_inferior{,_fast}: Declare as returning void. + + * m-sun3.h (USE_PTRACE_GETREGS): Define. + + * execcore.c: Add IS_OBJECT_FILE & related stuff. + + * infptrace.c: Include <sys/ptrace.h>. + [ATTACH_DETACH] [USE_PTRACE_GETREGS]: New code. + + * Split default-dep.c into infptrace.c and execcore.c. + + * valprint.c [IEEE_FLOAT]: Change void * to char *. + + * breakpoint.c: Change printf_filtered(%s) to fputs_filtered. + +Wed Jan 24 00:35:52 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * dbxread.c (symbol_file_command): When freeing everything, free + the string table too. + + * Makefile.dist (gdb1): add "rm -f gdb1". + + * printcmd.c (print_scalar_formatted): If size is 0, use 'b' + 'h', 'w', or 'g' depending on the type. + + * stack.c (backtrace_command): Read in symbols for frames we'll + print before printing them. + + * valops.c (value_at): Don't print "I/O error" on EIO from + ptrace. Don't print "out of bounds" for any ptrace error + except EIO. + + * valprint.c (type_print_base, case TYPE_CODE_ENUM): + Print "FOO = 5" not "FOO : 5". + + * symtab.{c,h}: Make lookup_misc_func extern. + + * Makefile.dist: Define VERSION in makefile, and generate + version.c automatically. + (gdb.tar): Use gdb-$(VERSION), not dist-gdb. + + * expread.y (yylex): Use lookup_primitive_typename to + cut down on calls to lookup_symbol. + symtab.{c,h} (lookup_primitive_typename): New function. + (lookup_typename): Use it. + + * symtab.{c,h} (check_stub_type): New function. + valprint.c (type_print_base, val_print, type_print_derivation_info), + values.c (allocate_value): Call it. + + * printcmd.c (whereis_command): New function. + symtab.c (lookup_symbol): Add symtab parameter. + various: Pass additional argument to lookup_symbol. + symseg.h (struct symbol): Add line field. + dbxread.c (define_symbol): Set sym->line. + + * dbxread.c (symbol_file_command): Read string table into + malloc'd memory (symfile_string_table) and leave it there. + (psymtab_to_symtab): Use symfile_string_table. + + * utils.c (sig_abbrev): Return NULL if not found. + infrun.c (sig_print_{header,info}): Consolidate duplicated + code from handle_command, signals_info. + (sig_print_info): Just print number if no name from sig_abbrev. + + * Makefile.dist (OTHERS): Add ChangeLog-3.x + + * infrun.c (restore_inferior_status): #if 0 out + "Unable to restore previously selected frame" error message. + + * infrun.c (signals_info, handle_command): Print signal + abbrevs along with numbers. + + * infrun.c (handle_command): Accept symbol signal names. + + * utils.c (sig_{number,abbrev}, init_sig): New functions. + _initialize_utils: Call init_sig for each signal. + defs.h: Declare them. + + * default-dep.c (read_inferior_memory): Check quit_flag in + fetch loop. + + * Changes for lazy fetching (speeds things up for big objects): + value.h (struct value): New field lazy. + VALUE_CONTENTS_RAW, VALUE_LAZY, value_at_lazy: New. + findvar.c (read_var_value): Set lazy instead of fetching. + various: Copy into VALUE_CONTENTS_RAW, not VALUE_CONTENTS. + valops.c: Add value_at_lazy, value_lazy. + various: Call value_at_lazy instead of value_at. + + * symtab.h (LONGEST): Define. + + * m-*.h (LONGEST, BUILTIN_TYPE_LONGEST): Delete (in symtab.h). + + * infrun.c (wait_for_inferior): #if 0 out stop if ABOUT_TO_RETURN + + * version.c: Change version number to 4.0development + +For older changes see ChangeLog-3.x + +Local Variables: +mode: indented-text +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/gdb/gdb/ChangeLog-92 b/contrib/gdb/gdb/ChangeLog-92 new file mode 100644 index 0000000000000..098c13177023d --- /dev/null +++ b/contrib/gdb/gdb/ChangeLog-92 @@ -0,0 +1,6285 @@ +Thu Dec 31 11:06:38 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (BISON): Add comment that when bison is used, it + must include the "-y" option. + * c-exp.y, m2-exp.y (yyrule, yyname, yyss, yyssp, yyvs, yyvsp): + Remove defines to remap non-yacc symbols, thus backing out of + previous recent changes. Standard policy is that non-yacc parser + generators get fixed, rather than adding bug workarounds in gdb + for each new one that pops up. Expand comment to note this. + * c-exp.y, m2-exp.y (YYDEBUG): Revert back to disabled by default. + +Thu Dec 31 09:03:02 1992 Stu Grossman (grossman at cygnus.com) + + * partial-stab.h (near N_BINCL): Remove redundant code in N_BINCL + case. Use code in N_SOL. + + * paread.c: New file that contains all HPPA/HPUX symbol reading + code. + * dbxread.c: Remove almost all HPPA/HPUX symbol reading code. + * (dbx_symfile_init): Use sizeof(long) instead of 4. + * (dbx_symfile_offsets): Make static. + * (pastab_build_psymtabs): New interface routine for paread to + send stabs into dbxread. + * gdb-stabs.h: Remove gobs of HPPA cruft. + +Wed Dec 30 19:47:13 1992 Fred Fish (fnf@cygnus.com) + + * c-exp.y, m2-exp.y (yyrule, yyname): Remap like other yy* names + for byacc. + * ch-exp.y (yyrule, yyname): Remap like other yy* names for byacc. + + * c-exp.y, m2-exp.y (yyreds, yytoks): Remap like other yy* names. + * c-exp.y, m2-exp.y (YYDEBUG): Define if MAINTENANCE_CMDS is defined + and YYDEBUG is not already defined. + * c-exp.y (strncmp): Replace throughout with STREQN, missed + them during the previous replacements. + * printcmd.c (_initialize_printcmd): Update internal documentation + for "set" command to note that the assignment syntax is language + dependent. + * ch-exp.y (yyreds, yytoks): Remap like other yy* names. + * ch-exp.y (YYDEBUG): Define if MAINTENANCE_CMDS is defined + and YYDEBUG is not already defined. + * ch-exp.y (GDB_REGNAME, GDB_LAST, GDB_VARIABLE, GDB_ASSIGNMENT, + single_assignment_action): New terminals and nonterminal for gdb + extensions to chill expression grammer. + * ch-exp.y (match_dollar_tokens): Lexer routine to match all + tokens that start with '$' (register names, convenience vars, etc). + * ch-exp.y (tokentab2): Add GDB_ASSIGNMENT. + * ch-exp.y (yylex): Call match_dollar_tokens. + +Mon Dec 28 15:00:01 1992 Stu Grossman (grossman at cygnus.com) + + * hppah-tdep.c (skip_trampoline_code): Use new macros for + accessing minimal symbol data. + * infcmd.c (read_pc): Use #ifdef, not #if. + * symfile.c (syms_from_objfile): Add CONST to decl for targets. + * tm-hppa.h (FIX_CALL_DUMMY): Use new macros for accessing + minimal symbol data. + + * hppah-tdep.c (frame_saved_pc): Use better test for outermost + frame. Use find_return_regnum to find the caller. + * (find_unwind_entry): New routine to locate stack frame info + associated with a procedure. This looks in the $UNWIND_START$ + section in the SOM file. + * (find_return_regnum): New routine. Uses find_unwind_entry() to + figure out where the caller's return address is stored. + * (find_proc_framesize): New routine. Uses find_unwind_entry() + to figure out the frame size for a procedure. + * (saved_pc_after_call): New routine, moved from tm-hppa.h. + * (init_extra_frame_info): New routine. Corrects PC and FP for + outermost frame if necessary. + * (frame_chain): New routine, moved from tm-hppa.h. + * (skip_trampoline_code): Handle computed function calls (ie: + calls from $$dyncall). + * (unwind_command): Temporary support function to allow user + to control/observe aspects of the unwind (stack frame) info. + * infcmd.c (read_pc): (Temporary), put a hack in to see if the PC + was in a system call, if so, then read the PC from r31. + * tm-hppah.h (SKIP_TRAMPOLINE_CODE, IN_SOLIB_TRAMPOLINE): Deal + with extra arg for skip_trampoline_code(). + * (INIT_EXTRA_FRAME_INFO): Define to point at subr (see above). + * (FRAME_CHAIN, FRAME_CHAIN_VALID): Turn into real subroutines. + * tm-hppa.h (SAVED_PC_AFTER_CALL): Turn into real subroutine. + +Sun Dec 27 17:34:15 1992 Fred Fish (fnf@cygnus.com) + + * dbxread.c (dbx_symfile_init, elfstab_build_psymtabs): + Call new bfd_get_size() and verify that string table is no larger + than the file that is supposed to contain it. + * symfile.c (syms_from_objfile): Only complain about configured + NAMES_HAVE_UNDERSCORE differences between gdb and bfd if the + current target is the default BFD target. + +Sat Dec 26 20:51:41 1992 Fred Fish (fnf@cygnus.com) + + * solib.c (BKPT_AT_MAIN): Change to BKPT_AT_SYMBOL. + * solib.c (bkpt_names): New array of symbol names to try to + use for the "mapping complete" breakpoint. Configurable + define SOLIB_BKPT_NAME is first one to try. + * solib.c (find_solib): Test debug_base for nonzero rather + than just greater than zero. + * solib.c (enable_break): Use bkpt_names to look up address + at which to set "mapping complete" breakpoint. + +Tue Dec 22 20:33:38 1992 Fred Fish (fnf@cygnus.com) + + * defs.h (STRCMP, STREQ, STREQN): New macros. + * defs.h (demangle_and_match): Remove prototype. + * dwarfread.c (STREQ, STREQN): Remove macros, replaced with STREQ + and STREQN defined in defs.h. + * dwarfread.c (set_cu_language): For completely unknown languages, + try to deduce the language from the filename. Retain behavior + that for known languages we don't know how to handle, we use + language_unknown. + * dwarfread.c (enum_type, symthesize_typedef): Initialize language + and demangled name fields in symbol. + * dwarfread.c, mipsread.c, partial-stab.h: For all usages of + ADD_PSYMBOL_TO_LIST, add language and objfile parameters. + * dwarfread.c (new_symbol): Attempt to demangle C++ symbol names + and cache the results in SYMBOL_DEMANGLED_NAME for the symbol. + * elfread.c (STREQ): Remove macro, use STREQ defined in defs.h. + Replace usages throughout. + * elfread.c (demangle.h): Include. + * elfread.c (record_minimal_symbol): Remove prototype and function. + * gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES, + B_CLRALL): Moved from symtab.h to gdbtypes.h. + * infcmd.c (jump_command): Remove code to demangle name and add + it to a cleanup list. Now just use SYMBOL_DEMANGLED_NAME. + * minsyms.c (demangle.h): Include. + * minsyms.c (lookup_minimal_symbol): Indent comment to match code. + * minsyms.c (install_minimal_symbols): Attempt to demangle symbol + names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME. + * mipsread.c (psymtab_language): Add static variable. + * stabsread.c (demangle.h): Include. + * stabsread.c (define_symbol): Attempt to demangle C++ symbol + names and cache them in the SYMBOL_DEMANGLED_NAME field. + * stack.c (return_command): Remove explicit demangling of name + and use of cleanups. Just use SYMBOL_DEMANGLED_NAME. + * symfile.c (demangle.h): Include. + * symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): Fix + to match macros in symfile.h and allow them to be compiled + if INLINE_ADD_PSYMBOL is not true. + * symfile.h (INLINE_ADD_PSYMBOL): Default to true if not set. + * symfile.h (ADD_PSYMBOL_*): Add language and objfile parameters. + Add code to demangle and cache C++ symbol names. Use macro form + if INLINE_ADD_PSYMBOL is true, otherwise use C function form. + * symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list): + Remove, also defined in symfile.c, which we already fixed. + * symtab.c (expensive_mangler): Remove prototype and function. + * symtab.c (find_methods): Remove physnames parameter and fix + prototype to match. + * symtab.c (completion_list_add_symbol): Name changed to + completion_list_add_name. + * symtab.c (COMPLETION_LIST_ADD_SYMBOL): New macro, adds both + the normal symbol name and the cached C++ demangled name. + * symtab.c (lookup_demangled_partial_symbol, + lookup_demangled_block_symbol): Remove prototypes and functions. + * symtab.c (lookup_symbol): Remove use of expensive_mangler, + use lookup_block_symbol instead of lookup_demangled_block_symbol. + Remove code to try demangling names and matching them. + * symtab.c (lookup_partial_symbol, lookup_block_symbol): + Fix to try matching the cached demangled name if no match is + found using the regular symbol name. + * symtab.c (find_methods): Remove unused physnames array. + * symtab.c (name_match, NAME_MATCH): Remove function and macro, + replaced with SYMBOL_MATCHES_REGEXP from symtab.h. + * symtab.c (completion_list_add_symbol): Rewrite to use cached + C++ demangled symbol names. + * symtab.h: Much reformatting of structures and such to add + whitespace to make them more readable, and make them more + consistent with other gdb structure definitions. + * symtab.h (general_symbol_info): New struct containing fields + common to all symbols. + * symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME, + SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME, + SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE): New macros. + * symtab. (struct minimal_symbol, struct partial_symbol, struct + symbol): Use general_symbol_info struct. + * utils.c (demangle_and_match): Remove, no longer used. + * valops.c (demangle.h): Include. + * xcoffexec.c (eq): Remove macro, replace usages with STREQ. + * blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c, + infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c, + symmisc.c, symtab.c, valops.c: Replace references to minimal + symbol fields with appropriate macros. + * breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c, + coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c, + demangle.c, elfread.c, energize.c, environ.c, exec.c, + gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c, + main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c, + remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c, + sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c, + symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h, + tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c: Replace strcmp + and strncmp usages with STREQ, STREQN, or STRCMP as appropriate. + * breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c, + mipsread.c, printcmd.c, source.c, stabsread.c, stack.c, + symmisc.c, tm-29k.h, valops.c, values.c: Replace SYMBOL_NAME + references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as + appropriate. + * buildsym.c (start_subfile, patch_subfile_names): Default the + source language to what can be deduced from the filename. + * buildsym.c (end_symtab): Update the source language in the + allocated symtab to match what we have been using. + * buildsym.h (struct subfile): Add a language field. + * c-typeprint.c (c_print_type): Remove code to do explicit + demangling. + * dbxread.c (psymtab_language): Add static variable. + * dbxread.c (start_psymtab): Initialize psymtab_language using + deduce_language_from_filename. + +Mon Dec 21 22:24:33 1992 Fred Fish (fnf@cygnus.com) + + * valprint.c (val_print): Reorganize comment and add note + about dependency on target byte ordering. + * ch-exp.y (value_array_slice): Fix typo. + * ch-valprint.c (chill_val_print): Remove C'ism that arrays of + byte sized ints are assumed to be char strings and printed with + string syntax. In chill, arrays of chars and arrays of + bytes/ubytes are distinquishable, and printed appropriately. + +Mon Dec 21 18:02:35 1992 Stu Grossman (grossman at cygnus.com) + + * tm-hppah.h: #define NEED_TEXT_START_END for target memory + read/write routines for HPUX. + + * hppa-pinsn.c (print_insn): Improve handling of be and ble + branch targets to compute target address using const from previous + instruction if necessary. + * Add `Q' operator to print out bit position field various + instructions. + * hppah-nat.c: #include sys/param.h, and sys/user.h. General + cleanups, use new code from Utah. + * (store_inferior_registers): Update to new code from Utah. + * (initialize_kernel_u_addr): Re-enable decl of struct user u. + * (fetch_register): Clear out priv level when reading PCs. + * hppah-tdep.c: Get rid of gobs of KERNELDEBUG stuff. + * Remove decl of errno, #include wait.h and target.h. + * (frame_saved_pc): Check `flags' pseudo-register to see if we + were inside of a kernel call. If so, then PC is in a different + register. Also, mask out bottom two bits of all PCs so as not to + confuse higher level code. + * (push_dummy_frame): Create from #define in tm-hppa.h. + * (find_dummy_frame_regs): Update from Utah. + * (hp_pop_frame): Create from #define in tm-hppa.h. + * (hp_restore_pc_queue): New, from Utah. + * (hp_push_arguments): Big fixes from Utah. + * (pa_do_registers_info, pa_print_registers): Only print out fp + regs upon request. + * (skip_trampoline_code): New routine to deal with stubs that + live in nowhereland between callers and callees. + * i860-tdep.c: Remove decl of attach_flag. + * infrun.c (wait_for_inferior): Add new macro + INSTRUCTION_NULLIFIED, which can tell if the instruction pointed + at by PC will be nullified. If so, then step the target once more + so as to avoid confusing the user. + * (just before step_over_function:): Use stop_func_start, not + stop_pc when checking for the existance of line number info. + stop_func_start will reflect the proper address of the target + routine, not of the stub that we may be traversing to get there. + * tm-hppa.h: define SKIP_TRAMPOLINE_CODE and IN_SOLIB_TRAMPOLINE + to deal with the stubs that PA compilers sometimes stick between + callers and callees. Also, define FLAGS_REGNUM for access to the + `flags' pseudo-reg. + * (REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Use + memcpy, not bcopy. + * (CANNOT_STORE_REGISTER): New from Utah. Says that we can't + write gr0, PC regs, and PSW! + * (FRAME_FIND_SAVED_REGS): Bug fixes from Utah. + * (PUSH_DUMMY_FRAME, POP_FRAME): Make into real routines in + hppah-nat.c. + * (CALL_DUMMY, FIX_CALL_DUMMY): Fixes from Utah. + * Define struct unwind_table_entry. + * valops.c (call_function_by_hand): Add another arg to + FIX_CALL_DUMMY (under #ifdef GDB_TARGET_IS_HPPA). Why is this + necessary? + +Mon Dec 21 02:17:57 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * remote-vx.c: remove include of "symfile.h", replace it with "complaints.h" + +Fri Dec 18 10:32:25 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (VERSION): Bump to 4.7.4. + * Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c, + m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c. + * Makefile.in (HFILES): Add valprint.h. + * Makefile.in (OBS): Add typeprint.o, c-typeprint.o, + m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o. + * typeprint.c, typeprint.h: New files for language independent + type printing functions. + * c-typeprint.c, m2-typeprint.c: New files for language dependent + type printing functions and definitions. + * valprint.h: New include file for language independent value + printing definitions. + * c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language + dependent value printing functions. + * c-exp.y (production ptype): Add range_type variable and use new + create_range_type function. + * c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab), + infcmd.c (path_var_name), language.c (unk_op_print_tab), + m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent + "const static" to ANSI-conformant "static const". + * c-exp.y (c_create_fundamental_type): Remove unused nbytes. + * c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type, + and c_val_print. + * c-lang.h (c_print_type, c_val_print): Add prototypes. + * coffread.c (decode_type): Add range_type variable and call to + new create_range_type function. + * complaints.c (complain): Remove unused val variable. + * complaints.c (_initialize_complaints): Make it void. + * convex-tdep.c (value_of_trapped_internalvar): Add range_type + variable and call new create_range_type function. + * defs.h (enum val_prettyprint): Move enum from value.h to here + so we can avoid having to include value.h just for prototypes that + need the enum (thanks ANSI). + * dwarfread.c (struct_type): Local anonymous_size variable is + only used if !BITS_BIG_ENDIAN. + * dwarfread.c (decode_subscript_data_item): Add rangetype + variable and call new create_range_type function. + * elfread.c (elf_symfile_read): Remove unused dbx and text_sect + variables. + * eval.c (evaluate_subexp): Remove unused local variable name + and the statement with no side effects that initializes it. + * expprint.c (print_subexp): Change local_printstr to + LA_PRINT_STRING. + * gdbtypes.c (create_range_type): New function that creates + a range type using code fragments from object file readers as + an example of what has to be initialized. + * gdbtypes.c (create_array_type): Removed index_type, low_bound, + and high_bound parameters, replaced with a single range_type + parameter. Change function body to use passed in range_type + rather than handcrafting one. + * gdbtypes.h (create_range_type): Add prototype. + * gdbtypes.h (create_array_type): Change prototype parameters. + * infrun.c (normal_stop): Remove unused local variables tem and c. + * infrun.c (hook_stop_stub): Return 0 rather than random value. + * language.c (unk_lang_print_type, unk_lang_val_print): Add + stub functions that call error if called. + * language.c (unknown_language_defn, auto_language_defn, + local_language_defn): Add initializers unk_lang_print_type and + unk_lang_val_print. + * language.h (struct language_defn): Reformat for larger + comments, add la_print_type and la_val_print members. Add + LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar + to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING. + * m2-lang.c (m2_create_fundamental_type): Remove unused local + variable nbytes. + * m2-lang.c (m2_language_defn): Add initializers m2_print_type + and m2_val_print. + * m2-lang.h (m2_print_type, m2_val_print): Add prototypes. + * main.c (execute_command): Remove unused local variable cmdlines. + * main.c (echo_command), stabsread.c (read_type), printcmd.c + (clear_displays), symmisc.c (block_depth), values.c + (clear_value_history): + Make testing of truth value of assignment result explicit. + * mipsread.c (upgrade_type): Update FIXME to include future use + of create_range_type. + * printcmd.c (ptype_command, ptype_eval, whatis_command, + whatis_exp, maintenance_print_type): Move prototypes and functions + to new typeprint.c. + * printcmd.c (_initialize_printcmd): Move add_com calls for + ptype_command and whatis_command to new typeprint.c. + * ser-bsd.c (serial_open): Remove unused variable sgttyb. + * source.c (find_source_lines): Local variable c only used + when LSEEK_NOT_LINEAR is defined. + * stabsread.c (read_array_type): Use new create_range_type + function. + * stabsread.c (read_range_type): Add new index_type variable and + call new create_range_type function rather than handcrafting + range types. + * symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE. + * symtab.c (typedef_print usages): Use c_typedef_print, renamed. + * symtab.c (type_print_base usages): Use c_type_print_base. + * symtab.c (type_print_varspec_prefix usages): Use + c_type_print_varspec_prefix. + * symtab.c (type_print_method_args usages): Use + cp_type_print_method_args. + * valprint.c: Completely ripped apart and the fragments used + to create c-valprint.c, cp-valprint.c, m2-valprint.c, and + valprint.h. Remaining stuff is language independent. + * value.h (struct fn_field): Forward declare for prototypes. + * value.h (type_print_1): Remove prototype. + * value.h (enum val_prettyprint): Moved to defs.h. + * value.h (typedef_print): Prototype renamed to c_typedef_print. + * value.h (baseclass_offset): Add prototype. + * Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c. + * Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o. + * ch-typeprint.c: New file for language dependent type printing. + * ch-valprint.c: New file for language dependent value printing. + * ch-exp.y (parse_number): Remove prototype and stub function. + * ch-exp.y (decode_integer_literal): Removed unused digits and + temp variables. + * ch-exp.y (convert_float): Completely ifdef out for now. + * ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5), + ch-lang.c (chill_op_print_tab): + Change from ANSI-obsolescent "const static" to ANSI-conformant + "static const". + * ch-exp.y (yylex): Add unhandled storage class enumeration + literals to switch statement for completeness. + * ch-lang.c (chill_create_fundamental_types): Remove unused + nbytes variable. Change dummy type to 2 bytes to match int. + Handle FT_VOID types gratuituously added to chill DWARF by + compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR + type rather than a one byte TYPE_CODE_INT type. + * ch-lang.c (chill_language_defn): Add chill_print_type and + chill_val_print. + * ch-lang.h (chill_print_type, chill_val_print): Add prototypes. + +Thu Dec 17 00:44:57 1992 John Gilmore (gnu@cygnus.com) + + Eliminate uses of NAMES_HAVE_UNDERSCORE, using + bfd_get_symbol_leading_char instead. + + * coffread.c (EXTERNAL_NAME): New macro for removing possible + leading character from names. + (read_coff_symtab): Use BFD's FILE *, don't open a second one. + (process_coff_symbol, coff_read_struct_type, coff_read_enum_type): + Replace NAMES_HAVE_UNDERSCORE with EXTERNAL_NAME. + + * kdb-start.c (main): Remove NAMES_HAVE_UNDERSCORE. + * minsyms.c (install_minimal_symbols): Replace NAMES_HAVE_UNDERSCORE. + Remove SOME_NAMES_HAVE_DOT support (apparently unused). + * partial-stab.h: Replace NAMES_HAVE_UNDERSCORE. + * solib.c: Replace NAMES_HAVE_UNDERSCORE. + * stabsread.h: Remove NAMES_HAVE_UNDERSCORE and HASH_OFFSET. + * symfile.c (syms_from_objfile): Insert debugging check to test + NAMES_HAVE_UNDERSCORE setting against the BFD support. + + * doc/gdbint.texinfo (Host Conditionals): Remove + NAMES_HAVE_UNDERSCORE, SOME_NAMES_HAVE_DOT, document + MEM_FNS_DECLARED. + (Target Conditionals): Remove all of the above. + + * xm-rs6000.h (MEM_FNS_DECLARED): Update comments. + + * coffread.c (read_coff_symtab, C_BLOCK): Use complain() rather + than error() for .bb/.eb. Bug found by Eddie Fung, <efung@cs.uq.oz.au>. + +Tue Dec 15 10:05:56 1992 Ian Lance Taylor (ian@cygnus.com) + + * coffread.c (decode_type): catch negative tagndx fields generated + by SCO 3.2v4 cc. + * exec.c: comment out string following #endif. + * configure.in (i[34]86-*-sco3.2v4*): use host i386sco4. + * xm-i386sco.h: include <sys/types.h> and <sys/dir.h>, required by + <sys/user.h>. + * config/i386sco4.mh: new file; like i386sco.mh, but don't require + gcc, and define const to empty to avoid SCO 3.2v4 cc bug. + +Tue Dec 15 04:14:24 1992 Fred Fish (fnf@cygnus.com) + + * complaints.c: New file, code moved from utils.c. + * complaints.c (complain): Made into a varargs function. + * complaints.h: New file, code moved from symfile.h. + * Makefile.in (SFILES_MAINDIR): Add complaints.c. + * Makefile.in (HFILES): Add complaints.h. + * Makefile.in (OBS): Add complaints.o. + * symfile.c (complaint_root, stop_whining, complaint_series, + complain, clear_complaints, add_show_from_set for stop_whining): + Moved to complaints.c. + * symfile.h (struct complaint, complaint_root decl, complain + prototype, clear_complaints prototype): Moved to complaints.h. + * buildsym.c, coffread.c, dbxread.c, dwarfread.c, elfread.c, + gdbtypes.c, mipsread.c, stbsread.c, symfile.c: Include + complaints.h. Remove casts from arguments to complain(), + which is now a varargs function, and remove unnecessary + placeholder zero args. + * defs.h (begin_line): Add prototype. + * defs.h (vprintf_filtered): Add prototype. + * dwarfread.c (varargs.h): Remove, no longer needed. + * dwarfread.c (dwarfwarn): Remove prototype and function. + * dwarfread.c (complaints): Define a bunch of complaints. + * dwarfread.c (SQUAWK): Remove macro defs, convert all + usages to standard complain() calls. + * utils.c (begin_line): New function that ensures that + whatever gets filter-printed next starts on its own line. + * utils.c (vprintf_filtered): New func, like vfprintf_filtered, + but to stdout (calls vfprintf_filtered internally). + +Tue Dec 15 02:01:00 1992 John Gilmore (gnu@cygnus.com) + + * remote.c: Avoid printf_filtered line limit. Suggested by + Robert R. Henry, <rrh@tera.com>. + * infcmd.c (environment_info): Ditto, for Don Allen <allen@think.com>. + + * main.c (main): Accept --silent as well as --quiet. Change +help + to --help. Suggested by Karl Berry, <karl@cs.umb.edu>. + + * doc/gdbint.texinfo: SWAP_HOST_AND_TARGET => SWAP_TARGET_AND_HOST. + Noticed by Andy Jackson, <arj@cam-orl.co.uk>. + +Mon Dec 14 23:28:15 1992 John Gilmore (gnu@cygnus.com) + + * tm-nindy960.h, remote-nindy.c: Lint. + +Mon Dec 14 18:48:52 1992 Fred Fish (fnf@cygnus.com) + + * gdbtypes.c (create_array_type): Complete rewrite. Now requires + a optional type to decorate as an array type, the type of the + index, and the bounds of the array. Records this additional info + in the array type for use with languages with nonzero array + bounds. + * gdbtypes.h (enum type_code): Update comment for TYPE_CODE_ARRAY + to note that arrays may have bounds. + * gdbtypes.h (create_array_type): Update prototype. + * c-exp.y (ptype production): Adjust for new create_array_type + calling conventions. + * coffread.c (decode_type): Call create_array_type rather than + handcrafting array types. + * convex-tdep.c (value_type): Remove, now use create_array_type. + * convex-tdep.c (value_of_trapped_internalvar): Convert calls to + vector_type into calls to create_array_type. + * dwarfread.c (decode_subscr_data): Name changed to + decode_subscript_data_item throughout. + * dwarfread.c (decode_subscript_data_item): Rewrite to use + create_array_type. Now records index type and range as well. + * dwarfread.c (dwarf_read_array_type): Rewrite as part of + change to use create_array_type. + * dwarfread.c (read_subroutine_type): Test existing user defined + types before decorating them, to ensure they are blank, and + complain about it if they are not. + * dwarfread.c (decode_fund_type): For unrecognized types, always + return some valid type (type integer). If the unrecognized type + cannot be an implementation defined type, complain as well. + * m88k-tdep.c (pushed_size): Update comment for TYPE_CODE_ARRAY. + * m88k-tdep.c (store_param): Update comment for TYPE_CODE_ARRAY. + * mipsread.c (upgrade_type): Add FIXME comment that code to + handcraft arrays should be replaced with call to create_array_type. + * stabsread.c (read_array_type): Replace code to handcraft + array types with call to create_array_type. + * valprint.c (type_print_varspec_prefix): Minor formatting + change, join lines that don't need to be split. + +Mon Dec 14 17:18:42 1992 Stu Grossman (grossman at cygnus.com) + + * convex-xdep.c, hppab-nat.c, infptrace.c: Remove + decl for attach_flag, it now lives in inferior.h. + * hppa-pinsn.c: Reformat opcode tables. Add function prototypes. + Make most functions static. + * hppah-nat.c: General cleanups, remove BSD specific code (since + that all lives in hppab-nat.c). + * hppah-tdep.c (frame_chain_valid), tm-hppa.h (FRAME_CHAIN): + Change sense of test against inside_entry_file(). This fix is + from U. of Utah. + * tm-hppa.h (PUSH_DUMMY_FRAME, POP_FRAME): Use char * for 2nd arg + to read/write_register_bytes(). + * gdbtypes.h: Remove const from decl for cplus_struct_default to + work around PA-GAS assembler bug. Also, add trailing */ to some + comments. + * gdbtypes.c: Remove const from decl for cplus_struct_default. + Same reason as above. + +Wed Dec 9 19:53:25 1992 John Gilmore (gnu@cygnus.com) + + * mipsread.c (parse_symbol): When checking whether a structured + type is an enum, check qualifiers of its first member, as well as + the base type of the member. Bug found and fixed by John M. + Farrell, <farrell@fjord.reo.dec.com>. + + * vx-share/{reg.h,xdr_regs.h,xdr_regs.c}: Remove, unused. + * remote-vx.c: Don't include vx-share/reg.h. + * vx-share/ptrace.h: Reproduce from scratch. + * config/{vxworks68,vxworks960}: Don't include xdr_regs.o. + * Makefile.in: Remove references to removed files, and to removed + 29k-share directories. + +Tue Dec 8 13:30:58 1992 Fred Fish (fnf@cygnus.com) + + * c-lang.c (_initialize_c_language): Name changed from + _initialize_c_exp. + * m2-lang.c (_initialize_m2_language): Name changed from + _initialize_m2_exp. + * m2-lang.c (_initialize_m2_language): Change malloc to xmalloc since + it is no longer inside m2-exp.y, where it was remapped by Makefile. + * c-exp.y, m2-exp.y: Migrate code that has nothing to do with + expression parsing into c-lang.c and m2-lang.c respectively. + * c-lang.c, m2-lang.c: New files, code migrated from c-exp.y and + m2-exp.y respectively. + * c-lang.h, m2-lang.h: New files, internal interfaces between c-* + and m2-* files respectively. + * Makefile.in (SFILES_MAINDIR): Add c-lang.c, m2-lang.c. + * Makefile.in (HFILES): Add c-lang.h, m2-lang.h. + * Makefile.in (OBS): Add c-lang.o, m2-lang.o. + * expression.h (struct block): Forward declaration for prototypes. + * language.h (struct objfile): Forward declaration for prototypes. + * Makefile.in (SFILES_MAINDIR): Add ch-lang.c. + * Makefile.in (HFILES): Add ch-lang.h. + * Makefile.in (OBS): Add ch-lang.o. + * ch-exp.y: Migrate code that has nothing to do with expression + parsing into ch-lang.c. + * ch-lang.c: New file, code migrated from c-exp.y. + * ch-lang.h: New file, internal interface between ch-* files. + * ch-lang.c (_initialize_chill_language): Name changed from + _initialize_chill_exp. + + Changes for Amiga Unix from rhealey@ub.d.umn.edu. + * config/amix.mh (NAT_FILE): Add, set to nm-sysv4.h. + * config/amix.mh (NATDEPFILES): Add. + * config/amix.mh (XDEPFILES): Move procfs.o and fork-child.o + to NATDEPFILES. + + * dwarfread.c (decode_subscr_data): Remove spurious test that + accepted only integer subscript types. We don't do anything + with the type at the moment anyway. + +Fri Dec 4 06:56:56 1992 Fred Fish (fnf@cygnus.com) + + * ch-exp.y (match_character_literal): Fix case where no + match at all is found. + * ch-exp.y (chill_create_fundamental_type): Chill uses fixed + width types. For example, "INT" is always 2 bytes regardless + of the values of any TARGET_*_BIT macros. So use explicit + numeric sizes for the types. + +Thu Dec 3 12:00:06 1992 Fred Fish (fnf@cygnus.com) + + * c-exp.y (c_create_fundamental_type): New function to create + language specific fundamental types for C. + * m2-exp.y (m2_create_fundamental_type): New function to create + language specific fundamental types for Modula 2. + * c-exp.y (c_language_defn, cplus_language_defn): Add + c_create_fundamental_type to language struct initializers. + * m2-exp.y (m2_language_defn): Add m2_create_fundamental_type + to language struct initializers. + * dwarfread.c (expression.h, language.h): Include. + * dwarfread.c (ftypes): New array to hold fundamental types + for current compilation unit. + * dwarfread.c (cu_language_defn): New pointer to language + struct for language of current compilation unit. + * dwarfread.c (dwarf_fundamental_type): New function to + create/lookup fundamental types. + * dwarfread.c (set_cu_language): Initialize cu_language_defn. + * dwarfread.c (throughout): Replace lookup_fundamental_type + with dwarf_fundamental_type. + * dwarfread.c (read_file_scope): Zero out ftypes for each new + compilation unit (may be different language or different objfile). + * gdbtypes.c (lookup_fundamental_type): Move actual type + creations into language specific fundamental type creation + functions and call via create_fundamental_type. Add comment + about this function being obsolescent. + * gdbtypes.h (FT_BYTE, FT_UNSIGNED_BYTE): New types, true byte + sized signed and unsigned integers. + * gdbtypes.h (FT_NUM_MEMBERS): Increment, new types added. + * language.c (language_def): New function to lookup a language + struct given it's enumeration. + * language.h (struct language_defn): Add la_fund_type, a pointer + to a function that creates fundamental types for this language. + * language.h (create_fundamental_type): New macro to create + fundamental types based on the current language. + * language.h (language_def): Add prototype. + * language.c (unk_lang_create_fundamental_type): New function + for initializing language structs, calls error if called. + * language.c (unk_language_defn, auto_language_defn, + local_language_defn): Use unk_lang_create_fundamental_type. + ch-exp.y (chill_create_fundamental_type): New function. + ch-exp.y (chill_language_defn): Add chill_create_fundamental_type. + ch-exp.y (_initialize_chill_exp): BOOL types are only one byte. + +Tue Dec 1 17:07:31 1992 Fred Fish (fnf@cygnus.com) + + * dwarfread.c (CHILL_PRODUCER): Add producer string for + GNU chill. + * dwarfread.c (handle_producer): Test CHILL_PRODUCER as well + as GCC_PRODUCER and GPLUS_PRODUCER. + +Mon Nov 30 18:46:58 1992 Stu Grossman (grossman at cygnus.com) + + * remote-udi.c (udi_wait): Don't stop if TIP says that remote is + still running. + +Mon Nov 30 12:00:25 1992 Fred Fish (fnf@cygnus.com) + + * tm-sun4sol2.h: Add CPLUS_MARKER. Solaris 2.0 requires '.' + rather than '$'. This particular piece of braindamage is + spreading like ooze. It's now infected libiberty, deja-gnu, + gdb, and gcc. + * values.c (baseclass_addr): Use CPLUS_MARKER rather than + hardwired '$' character. + +Sun Nov 29 15:22:42 1992 Fred Fish (fnf@cygnus.com) + + (Changes to break incredibly ugly, unmaintainable 750 line + read_struct_type function up into managable pieces.) + * Makefile.in (VERSION): Bump to 4.7.3. + * stabsread.c (struct field_info): Local struct definition. + * stabsread.c (read_member_functions, read_struct_fields, + read_baseclasses, read_tilde_fields, attach_fn_fields_to_type, + attach_fields_to_type, read_cpp_abbrev): Prototypes and new + functions from fragmented read_struct_type. + * stabsread.c (stabs_general_complaint): Catchall complaint. + * stabsread.c (STABS_CONTINUE): Macro'ize cretinous stabs + symbol name continuation code. Use macro throughout. + * stabsread.c (various places): Replace add-one-to-pointer + with pointer increment. + * stabsread.c (read_type): Retain function local copy of type + descriptor. Rearrange code calling read_struct_type() to match + new conventions. + * stabsread.c (define_symbol): For the sake of dbx, gcc emits + a single blank as the name of nameless enumerations. Recognize + this special case and set nameless flag. + * ch-exp.y (GENERAL_PROCEDURE_NAME, LOCATION_NAME): New + terminal tokens. + * ch-exp.y (access_name): New non-terminal token and + production. + * ch-exp.y (general_procedure_name): Now a terminal token. + * ch-exp.y (location): Expand production. + * ch-exp.y (match_simple_name_string): New function. + * ch-exp.y (yylex): Call match_simple_name_string and return + GENERAL_PROCEDURE_NAME or LOCATION_NAME as appropriate. + +Wed Nov 25 07:17:13 1992 Fred Fish (fnf@cygnus.com) + + * munch: Backslash escape vertical bar characters inside + grep patterns since they have special meaning for some greps. + * parse.c (write_exp_string): Complete rewrite to store string + contants as a leading explicit length, followed by the string data, + followed by a trailing explicit length. + * eval.c (evaluate_subexp), expprint.c (print_subexp), + parse.c (length_of_subexp), parse.c (prefixify_subexp): + Use recorded explicit length of strings in expression elements, + rather than strlen. Adjust code to skip over strings stored in + expression elements, and code to access strings, to account for + new leading explicit size expression element. + * parse.c (length_of_subexp): Test for minimum endpos of 1, not + 0, to avoid negative expression element indices. + * valops.c (search_struct_method): Minor whitespace change. + +Mon Nov 23 11:14:15 1992 Fred Fish (fnf@cygnus.com) + + * c-exp.y (yylex): Add tempbuf, tempbufindex, and tempbufsize, + which together maintain a dynamically expandable static buffer + for the lexer to use when translating C strings to their internal + form (other future uses possible). Fix parsing of C style strings + to do the normal C style input conversions of escaped character + sequences. + * valops.c (value_string): Remove translation of escaped + character sequences, now done in C expression parser. + * language.h (PRINT_LITERAL_FORM): New macro that takes character + and decides if it should be printed in literal form or some other + form, based on it's ASCII value and setting of sevenbit_strings. + * {c-exp.y, m2-exp.y} (emit_char): Use new PRINT_LITERAL_FORM + macro, change indentation style. + * ch-exp.y (chill_printchar): Use new PRINT_LITERAL_FORM macro. + * ch-exp.y (chill_printstr): First cut at real function instead + of error stub. + +Sun Nov 22 16:21:41 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * nindy-share/stop.h: fixed bogus comment-end in copyright message + + * i960-pinsn.c: fixed two calls of fputs_filtered that had 3 arguments + +Fri Nov 20 21:35:57 1992 Fred Fish (fnf@cygnus.com) + + * defs.h (sevenbit_strings): Add declaration. + * defs.h (printchar): Replace with gdb_printchar. + * language.h (language_defn): Add new function pointers + la_printchar and la_printstr, to do language dependent + printing of characters and strings. + * language.h (local_printchar, local_printstr): New macros + to call language dependent functions pointed to by la_printchar + and la_printstr respectively. + * c-exp.y (emit_char, c_printchar, c_printstr): New language + dependent functions for printing characters and strings. + * c-exp.y (c_language_defn, cplus_language_defn): Add + c_printchar and c_printstr. + * command.c (do_setshow_command): Rename printchar use to + gdb_printchar. + * expprint.c (print_subexp): Replace C style string output + with call to local_printstr. + * language.c (unk_lang_printchar, unk_lang_printstr): + New stubs, currently errors. + * language.c (unknown_language_defn, auto_language_defn, + local_language_defn): Add unk_lang_printchar and + unk_lang_printstr. + * m2-exp.y (emit_char, m2_printchar, m2_printstr): New + language dependent functions to print characters and strings. + * m2-exp.y (m2_language_defn): Add m2_printchar and m2_printstr. + * utils.c (printchar): Renamed to gdb_printchar. + * valprint.c (print_string): Remove prototype, function moved + to c-exp.y, where it becomes c_printstr. + * valprint.c (print_max): Made global for reference from the + language dependent printing routines in *-exp.y. + * valprint.c (repeat_count_threshold): New variable with function + of old REPEAT_COUNT_THREHOLD define, but now settable by user. + Change all references to old macro to references to new variable. + * valprint.c (value_print, val_print): Replace calls to + print_string with calls to local_printstr. + * valprint.c (val_print): Replace C style character printing + with call to local_printchar. + * valprint.c (val_print): Add case for TYPE_CODE_CHAR. + * valprint.c (_initialize_valprint): Add add_show_from_set + call for setting up repeat_count_threshold as print variable. + * ch-exp.y (decode_integer_value): New function. + * ch-exp.y (decode_integer_literal): Use decode_integer_value. + * ch-exp.y (chill_printchar, chill_printstr): New language + dependent functions for printing characters and strings. + * ch-exp.y (chill_language_defn): Add chill_printchar and + chill_printstr. + +Thu Nov 19 21:22:21 1992 John Gilmore (gnu@cygnus.com) + + * main.c (main): Print GDB version number in gdb -help; doc pid arg. + Suggested by Marty Leisner, <leisner@eso.mc.xerox.com>. + (print_gdb_version): New arg is stdout or stderr. Callers changed. + +Wed Nov 18 15:05:45 1992 Ian Lance Taylor (ian@cygnus.com) + + * remote-vx.c (vx_kill): just warn if we can't contact the board, + and assume the process has been killed. + +Wed Nov 18 14:39:57 1992 Stu Grossman (grossman at cygnus.com) + + * remote-udi.c (udi_open): Reset vars so that user can re-run + programs without leaving GDB. + * (many routines): Slightly improve error handling. + * (download): Zero out BSS by longs instead of bytes to avoid + timeouts in real hardware. + * 29k-share/udi/udip2soc.c (UDIDisconnect, UDIKill): Indicate + that connection is no longer in use after shutdown() of socket. + This keeps GDB from dying of a SIGPIPE when you issue multiple + `target udi' commands. + +Wed Nov 18 14:27:47 1992 Fred Fish (fnf@cygnus.com) + + * language.h (language_format_info): New structure to bundle + local formatting information. + * language.h (language_defn): Replace individual format info + with language_format_info structs. + * language.h (local_*_format, local_*_format_prefix, + local_*_format_specifier, local_*_format_suffix): New macros + for binary/octal/decimal/hex formats to access info elements. + * c-exp.y (c_language_defn): Update for new format handling. + * m2-exp.y (m2_language_defn): Update for new format handling. + * dbxread.c (language.h): Include for partial-stab.h use. + * mipsread.c (expression.h, language.h): Include for + partial-stab.h use. + * defs.h (local_hex_format, local_hex_format_custom, + local_hex_string, local_hex_string_custom): Move to language.h. + * language.c (local_hex_format_custom, local_hex_string, + local_hex_string_custom, local_octal_format_custom): Use new + format handling. + * language.c (unknown_language_defn, auto_language_defn, + local_language_defn): Update for new format handling. + * printcmd.c (print_scalar_formatted): Use new macros + to access decimal and binary format info for printing. + * c-exp.y (chill_language_defn): Update for new format handling. + * ch-exp.y (CHARACTER_LITERAL): Add support to yylex. + * ch-exp.y (decode_integer_literal): Add function + * ch-exp.y (match_integer_literal): Use decode_integer_literal. + * ch-exp.y (builtin_type_chill_char): Add definition. + * gdbtypes.h (builtin_type_chill_char): Add declaration. + +Tue Nov 17 11:17:06 1992 Ian Lance Taylor (ian@cygnus.com) + + * tm-rs6000.h (BELIEVE_PCC_PROMOTION): Define, since AIX cc gets + it right. + (aix_framedata): added nosavedpc field. + (SAVED_PC_AFTER_CALL): Don't try to optimize; just call + read_register. + (FRAMELESS_FUNCTION_INVOCATION): Pass second argument of 0. + (FRAME_SAVED_PC): If PC not saved, use SAVED_PC_AFTER_CALL. + * rs6000-tdep.c (skip_prologue): Handle gcc generated stfd + instructions as function_frame_info does. Expand special case of + st r31,-4(r1) to be st r31,NUM(r1), since gcc can generate offsets + other than -4. + (pop_frame): Add 4 rather than sizeof (int) to avoid host + dependence. + (function_frame_info): Set frameless if the function has no frame, + and set nosavedpc if the PC was not saved. Handle gcc generated + stfd 31,-4(31); st 31, -12(31) correctly. + (frameless_function_invocation): New second argument pcsaved; if 0 + return whether the function has a frame, if 1 return whether the + function saved PC. + (frame_initial_stack_address): Correct typo: cache registers for + callee_fi, not for fi, (avoids reading garbage memory locations). + +Mon Nov 16 15:58:07 1992 Stu Grossman (grossman at cygnus.com) + + * infrun.c (wait_for_inferior (just before step_over_function + label)): Change test for stepping into subroutine to check for the + presence of line number info. This makes stuff compiled with -g1 + cause GDB to not lose control when stepping. + + * symtab.c (find_pc_line): Improve code per gnu's suggestions. + Improve comments as well. + +Sun Nov 15 09:22:09 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (VERSION): Bump to 4.7.2 + * symtab.c (find_pc_symtab): Fix return of random value + to caller. + * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on + Makefile since it contains sed patterns used in generation. + Add sed pattern to also delete #include of any malloc.h. + * c-exp.y, expr.c, expression.h, language.c, m2-exp.y, + parser-defs.h, valarith.c, valops.c, value.h: Remap macros and + function names to conform to K&R terminology with respect to + logical and bitwise operators: + UNOP_ZEROP => UNOP_LOGICAL_NOT + UNOP_LOGNOT => UNOP_COMPLEMENT + BINOP_LOGAND => BINOP_BITWISE_AND + BINOP_LOGXOR => BINOP_BITWISE_XOR + BINOP_LOGIOR => BINOP_BITWISE_IOR + BINOP_AND => BINOP_LOGICAL_AND + BINOP_OR => BINOP_LOGICAL_OR + PREC_OR => PREC_LOGICAL_OR + PREC_AND => PREC_LOGICAL_AND + PREC_LOGIOR => PREC_BITWISE_IOR + PREC_LOGXOR => PREC_BITWISE_XOR + PREC_LOGAND => PREC_BITWISE_AND + value_zerop() => value_logical_not() + value_lognot() => value_complement() + * c-exp.y (c_op_print_tab): Add explicit empty terminator. + * m2-exp.y (m2_op_print_tab): Add explicit empty terminator. + * i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary + and is nonexistant in some SVR4 based systems. + * language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4. + * m2-exp.y (number_sign, modblock): Make static, #ifdef out + unused modblock. + * m2-exp.y (ANDAND): Rename to LOGICAL_AND. + * source.c (source_info): Fix minor nits, print "1 line" rather + than "1 lines", and "language is <lang>". + * valarith.c (value_binop): Handle TYPE_CODE_BOOL as well + as TYPE_CODE_INT and TYPE_CODE_FLOAT. + * valprint.c (val_print): Print TYPE_CODE_BOOL type values as + "TRUE" or "FALSE". + * values.c (value_from_longest): Handle TYPE_CODE_BOOL. + * ch-exp.y: New expression parser, for GNU-Chill. + * defs.h (enum language): Add language_chill. + * dwarfread.c (set_cu_language): Add LANG_CHILL case and make + LANG_MODULA2 a recognized language. + * gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for + Chill as well as Modula-2. + * gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long, + builtin_type_chill_ulong, builtin_type_chill_real): Add. + * language.c (set_language_command): Add chill. + * language.c (binop_result_type, integral_type, character_type, + boolean_type, structured_type, value_true, binop_type_check): + Add language_chill cases. + * language.h (_LANG_chill): Define. + * symfile.c (deduce_language_from_filename): Recognize the + filename extensions ".chill", ".c186", and ".c286" for Chill. + * valprint.c (typedef_print): Add case for language_chill. + * Makefile.in (SFILES_MAINDIR): Add ch-exp.y. + * Makefile.in (YYFILES): Add ch-exp.tab.c. + * Makefile.in (YYOBJ): Add ch-exp.tab.o. + * Makefile.in (saber_gdb): Add unload of ch-exp.y and load + of ch-exp.tab.c. + * Makefile.in (distclean): Add target ch-exp.tab.c. + * Makefile.in (realclean): Add rm of ch-exp.tab.c. + * Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets. + * eval.c (evaluate_subexp): Add OP_BOOL case. + * expprint.c (print_subexp): Add OP_BOOL case. + +Fri Nov 13 20:36:28 1992 John Gilmore (gnu@cygnus.com) + + * infcmd.c (set_environment_command): Avoid skipping first + char of env value if an '=' appears in it. Bug report and fix + by Mark Jungerman, <maj@lucid.com>. + +Fri Nov 13 20:24:10 1992 Stu Grossman (grossman at cygnus.com) + + * infcmd.c (step_over_calls): Improve comments. + * symtab.c (find_pc_psymtab): Clean up a bit. + * (find_pc_symtab): Fix comments, clean up code. + * (find_pc_line): General cleanups, efficiency improvements. + Also, don't return garbage when some line info exists, but there + was no good match. + +Thu Nov 5 23:04:38 1992 Rob Ryan (rr2b@andrew.cmu.edu) + + * xcoffexec.c (vmap_symtab): fixed a bug where if a object has no + member, and the stat pointer passed to vmap_symtab was NULL, the + wrong vmap entries would be modified. Fixes behavior where + attempting to load symbols for a module with no member would mess + up already read in symbols. + +Wed Nov 11 17:09:17 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in: Remove dependancies for 29k-share/dfe/yank.o and + 29k-share/dfe/mini2udi.o. + * config/a29k-udi.mt: Remove yank.o and mini2udi.o. + * alldeps.mak, depend: Update to deal with removal of + aforementioned files. + * remote-udi.c: Major cleanups. Clean up udi_open and drop + requirement for useless 'program' argument. Clean up + udi_create_inferior, and udi_load to call common download() + routine. Create download routine to load remote hosts directly + (with the help of BFD) so that we don't need yank.c and + mini2udi.c. + Fix udi_detach to call UDIDisconnect with + the right arguments. Clean up udi_resume, don't assign tip_error + twice. Clean up udi_wait, straighten out status codes. Make + udi_kill really work. + +Fri Nov 6 10:26:01 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * c-exp.y: separated host/target idea of integer type size, + removed redundant parse rules. (YYSTYPE): added typed_val, removed + UINT and CHAR rules. (parse_number): work out the targetwise type + of a number based upon it's size and qualifiers. (yylex): chars + are now treated the same way as ints. + + * source.c (indentify_source_line): don't core dump if wanted + line is larger than number of lines in source. (can happen when + coff gets confused about #included source). + +Fri Nov 6 03:00:39 1992 John Gilmore (gnu@cygnus.com) + + Fix problems noticed by Allan Steel, <allan@maths.su.oz.au>, + when debugging a program with 100 shared libraries. + + * solib.c (solib_map_sections): Always close the BFD we open. + Free all malloc'd storage we allocate, too, including error cases. + (struct so_list): Remove unused so_bfd member. + (clear_solib): Don't bother closing so_bfd. + + * symfile.c (symfile_bfd_open): Mark newly opened BFD as + cacheable. `So many symbol files, so little file descriptors.' + +Fri Nov 6 00:14:38 1992 John Gilmore (gnu@cygnus.com) + + * m68k-stub.c: Remove ansidecl.h and the few uses of it. + Stubs should stand alone as much as possible. + + * source.c (show_directories): Avoid printf_filtered length prob + pointed out by Jonathan Stone. + + * i960-pinsn.c (MEM_MAX, MEM_SIZ): Set upper limit properly to + avoid accesses beyond end of table. Fix by Lee W. Cooprider, + <Lee_Cooprider@vos.stratus.com>. + +Thu Nov 5 17:33:08 1992 Fred Fish (fnf@cygnus.com) + + * {ser-bsd.c, ser-termios.c} (serial_close): Pass address of + struct, not struct itself. + * serial.h (serial_restore): Fix prototype, takes pointer not + struct. + +Thu Nov 5 17:12:42 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (depend): Add nm.h to the list of things to fixup. + * depend: Redo, to fixup nm.h problems with *-tab.c files. + +Thu Nov 5 00:19:51 1992 John Gilmore (gnu@cygnus.com) + + * i386-stub.c: Remove ansidecl.h and the few uses of it. + Stubs should stand alone as much as possible. + + * README: Add remote-es1800.c and remote-st2000.c to table. + * go32-nat.c: Remove, there is no native go32 support. + * go32-xdep.c: Remove unused fork, fvork, wait, execlp, kill_inferior. + +Wed Nov 4 15:27:31 1992 Stu Grossman (grossman at cygnus.com) + + * inflow.c (pass_signal, set_sigint_trap, clear_sigint_trap): Add + new routines to deal with sending SIGINTs to attached processes + when the user interrupts the controlling GDB. + * inftarg.c (child_wait), procfs.c (procfs_wait): Add calls to + the aforementioned routines when waiting for the attached process. + + * elfread.c, mipsread.c: Include <string.h>. + * i386-stub.c: Include "ansidecl.h" to deal with prototypes. + * serial.h: Add prototype for serial_restore(). + +Wed Nov 4 11:13:25 1992 Ian Lance Taylor (ian@cygnus.com) + + * minsyms.c (lookup_minimal_symbol_by_pc): subtract 1, not 2, from + minimal_symbol_count, because the NULL symbol is not included in + the count. This prevented this function from finding the last + symbol in the table. + +Tue Nov 3 11:29:17 1992 Ian Lance Taylor (ian@cygnus.com) + + * dbxread.c (process_one_symbol): if not defined + (BLOCK_ADDRESS_FUNCTION_RELATIVE), set function_start_offset at + the start of the function, not just after N_FUN. + +Fri Oct 30 16:33:02 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add sed patterns to + remap all malloc's to xmalloc's and all realloc's to xrealloc's. + * c-exp.y, m2-exp.y: Add comment about how malloc/realloc are + remapped to xmalloc/xrealloc, use only malloc/realloc in grammer + file. Remove preprocessor defines that previously did remapping. + +Fri Oct 30 00:58:18 1992 John Gilmore (gnu@cygnus.com) + + * infcmd.c (run_command): Avoid long calls to printf_filtered. + Bug fix courtesy of Alexander Klaiber. + +Tue Oct 27 17:08:45 1992 K. Richard Pixley (rich@cygnus.com) + + hp300 native support (hp300hpux untested). + + * hp300ux-xdep.c: removed. + * xm-hp300bsd.h (REGISTER_U_ADDR): removed. + * xm-hp300hpux.h: updated copyright. + (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): removed. + * nm-hp300bsd.h, nm-hp300hpux.h, hp300ux-nat.c: new files. + * Makefile.in (HFILES): added nm-hp300bsd.h and nm-hp300hpux.h. + * config/hp300bsd.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o coredep.o corelow.o. + (NAT_FILE, NATDEPFILES): new macros. + * config/hp300bsd.mt (TDEPFILES): removed exec.o. + * config/hp300hpux.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o. + (NAT_FILE, NATDEPFILES): new macros. + * config/hp300hpux.mt (TDEPFILES): removed exec.o. + + Vax ultrix native support. + + * nm-vax.h: new file. + * Makefile.in (HFILES): added nm-vax.h. + * config/vaxult.mh (XDEPFILES): infptrace.o inftarg.o fork-child.o + coredep.o corelow.o removed. + (NAT_FILE, NATDEPFILES): new macros. + * xm-vax.h: updated copyright. + (REGISTER_U_ADDR): removed. + + Apollo native support (untested). + + * Makefile.in (HFILES): added nm-apollo68[bv].h. + * a68v-nat.c, nm-apollo68[bv].h: new files. + * xm-apollo68[bv].h (FETCH_INFERIOR_REGISTERS): removed. + * xm-apollo68b.h (PTRACE_IN_WRONG_PLACE): removed. + * a68v-xdep.c: removed. + * config/apollo68[bv].mh (XDEPFILES): removed infptrace.o + inftarg.o fork-child.o a68v-xdep.o. + (NAT_FILE, NATDEPFILES): new macros. + + * defs.h: include nm.h. + * coredep.c, infptrace.c, procfs.c, rs6000-nat.c, sparc-nat.c, + sparc-tdep.c, : do not include nm.h. + * doc/gdbint.texinfo: nm.h now included in defs.h. + +Fri Oct 23 04:47:17 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (VERSION): 4.7.1 post release! + + * config/hppahpux.mh (NATDEPFILES): Add hppah-nat.o. + +Fri Oct 23 00:48:08 1992 John Gilmore (gnu@cygnus.com) + + * Makefile.in (VERSION): gdb-4.7 release. + * README: Update for gdb-4.7. + +Thu Oct 22 11:24:18 1992 Stu Grossman (grossman at cygnus.com) + + * sparc-tdep.c: include nm.h (for now) so that we get USE_PROC_FS + when necessary. + + * alldeps.mak, depend: Update. + +Thu Oct 22 03:14:36 1992 John Gilmore (gnu@cygnus.com) + + * partial-stab.h ('f', 'F'): Don't reference pst->textlow if pst + is null. + * tm-sun4sol2.h (PROLOGUE_FIRSTLINE_OVERLAP): Remove -- it + causes problems in setting breakpoint in the right place in + functions with `float' args which are passed as doubles. + * xm-vaxbsd.h (MEM_FNS_DECLARED): Avoid erroneous redecl's. + * config/rs6000.mh (NATDEPFILES): Add corelow.o. + +Thu Oct 22 01:01:24 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (HFILES): Add nm-i386sco.h. + * dwarfread.c: include <sys/types.h> for SCO. + * infptrace.c: Don't include ptrace.h under SCO. + * config/i386sco.mh: Use -D_POSIX_SOURCE instead of -posix for + gcc. + * config/i386v.mt: Add exec.o to TDEPFILES. + +Wed Oct 21 19:08:20 1992 Stu Grossman (grossman at cygnus.com) + + * i386v-nat.c: Remove space from front of #endif. + * irix4-nat.c: Remove externs of registers[], include inferior.h + instead. + * mips-nat.c: Explicitly initialize zerobuf to 0! + * mips-tdep.c (init_extra_frame_info): Undo John's last change. + Always setup fci->frame, even if it's non-zero. Too many places + depend upon this behavior (and I have to get a release out the + door)! + * mipsread.c (parse_partial_symbols, psymtab_to_symtab_1): Set + processing_gcc_compilation if we find the embedded stabs marker. + This fixes several bugs with finding the location of short or char + function parameters passed on the stack. + +Wed Oct 21 17:46:07 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + Native support for sun4sol2. + + * xm-sysv4.h (USE_PROC_FS, ATTACH_DETACH): removed to nm-sysv4.h. + * nm-sysv4.h: new file. + * Makefile.in (HFILES): added nm-sysv4.h. + * config/sun4sol2.mh (XDEPFILES): removed procfs.o fork-child.o. + (NAT_FILE, NATDEPFILES): new macros. + * config/sun4sol2.mt (TDEPFILES): removed exec.o and solib.o. + +Wed Oct 21 03:51:01 1992 John Gilmore (gnu@cygnus.com) + + * coredep.c: Include "nm.h" to get REGISTER_U_ADDR. + * doc/gdbint.texinfo: Improve REGISTER_U_ADDR and USE_PROC_FS doc. + + * Makefile.in (VERSION): Tick to 4.6.9. + +Tue Oct 20 23:27:56 1992 John Gilmore (gnu@cygnus.com) + + * mipsread.c (UNSAFE_DATA_ADDR): Remove MIPS-host-specific + definition, replace with portable one. + * remote-nindy.c: Lint. + (nindy_wait): Return type is int, result is inferior_pid. + * symmisc.c (dump_psymtab): Only print section_offsets if set. + (initialize_symmisc): Remove empty function. + * tm-spc-noun.h, tm-sun4os4.h, tm-sun4sol2.h (STACK_END_ADDRESS): + Remove obsolete, misspelled macro. + * doc/gdbint.texinfo: Document obsolete STACK_END_ADDR. + (all @node commands): Use new form to avoid nitpicking errors. + * doc/gdbint.texinfo: Document host/native/target split. + +Wed Oct 21 00:14:34 1992 Stu Grossman (grossman at cygnus.com) + + * mips-nat.c (zerobuf): Get rid of const to avoid gcc warnings. + + * xm-mips.h (offsetof): Don't define this if __STDC__. + +Tue Oct 20 21:32:18 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + umax native support (untested). + + * config/umax.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o. + (NAT_FILE, NATDEPFILES): new macros. + * config/umax.mt (TDEPFILES): removed exec.o. + * xm-umax.h (U_REGS_OFFSET, ATTACH_DETACH, REGISTER_U_ADDR): + removed to nm-umax.h. + * nm-umax.h: new file. + * Makefile.in (HFILES): added nm-umax.h. + + hppa native support (untested). + + * config/hppahpux.mh, config/hppabsd.mh (XDEPFILES): now empty. + (NAT_FILE, NATDEPFILES): new macros. + * config/hppabsd.mt (TDEPFILES): removed exec.o and hppab-core.o. + * config/hppahpux.mt (TDEPFILES): removed exec.o. + * xm-hppa[bh].h (REGISTER_U_ADDR, U_REGS_OFFSET): removed. + * nm-hppa[bh].h, hppa[bh]-nat.c: new files. + * hppa[bh]-xdep.c: removed. + * hppa[bh]h-tdep.c: do not include ptrace.h. + * Makefile.in (HFILES): added nm-hppa[bh].h. + + * doc/gdbint.texinfo: add PUSH_DUMMY_FRAME, POP_FRAME. + +Tue Oct 20 00:01:46 1992 Stu Grossman (grossman at cygnus.com) + + * mips-nat.c: Straighten out include files. Work around + conflicting defs of JB_xxx syms in <setjmp.h> and <machine/pcb.h> + for Ultrix-4.2. + +Mon Oct 19 15:09:57 1992 Stu Grossman (grossman at cygnus.com) + + * mips-nat.c (fetch_core_registers, register_addr): Copy from + coredep.c, but zero out FP_REGNUM & ZERO_REGNUM so that stack + backtraces from core files work. + * config/decstation.mh, config/irix3.mh: Remove coredep.o. + Functions are now defined in mips-nat.c. + + * tm-irix3.h: Put MIPS_EFI_SYMBOL_NAME in here too. + + * remote-hms.c: Disable all uses of serial_nextbaudrate and + serial_default_name(). + + * remote-hms.c, ser-go32.c, serial.h: Change from + serial_timedreadchar() to new serial_readchar(). + + * Makefile.in (HFILES): Fixup list of nm-*.h files. Add missing ones. + +Mon Oct 19 12:45:23 1992 Per Bothner (bothner@cygnus.com) + + * c-exp.y: Moved handling of 'const' and 'volatile' from + <type> to <typebase>. This removes 2 conflicts. + +Sun Oct 18 00:36:30 1992 Fred Fish (fnf@cygnus.com) + + * breakpoint.c (breakpoint_re_set_one): Don't delete watchpoints + from breakpoint table when reseting breakpoints. + +Sat Oct 17 00:59:23 1992 Fred Fish (fnf@cygnus.com) + + Native support cleanup and corefile fixes for i386 SVR4 systems. + + * i386-tdep.c (supply_gregset, fill_gregset, supply_fpregset, + fill_fpregset): Moved to i386v4-nat.c + * i386v4-nat.c, nm-i386v4.h, : New files. + * i386sol2.mh, i386v4.mh, ncr3000.mh (NAT_FILE): Use nm-i386v4.h. + * i386sol2.mh, i386v4.mh, ncr3000.mh (NATDEPFILES): Add corelow.o, + change i386v-nat.o to i386v4-nat.o. + +Fri Oct 16 13:06:08 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + Miscellaneous 386 configs updated. + + * config/i386aout.mt (TDEPFILES): removed exec.o. + * config/i386sol2.mh, config/ncr3000.mh, config/i386v4.mh + (XDEPFILES): removed procfs.o fork-child.o i386-xdep.o. + (NAT_FILE, NATDEPFILES): new macros. + * config/i386aout.mt, config/i386sol2.mt, config/ncr3000.mt, + config/i386v4.mt (TDEPFILES): removed exec.o. + * config/i386v32.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o coredep.o corelow.o i386-xdep.o i387-tdep.o. + (NAT_FILE, NATDEPFILES): new macros. + * config/i386sco.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o coredep.o corelow.o i386-xdep.o. + (NAT_FILE, NATDEPFILES): new macros. + + Native support cleanup for i386bsd (untested). + + * config/i386bsd.mt (NATDEPFILES): exec.o removed. + * config/i386bsd.mh (NATDEPFILES): added exec.o + * tm-i386bsd.h (FLOAT_INFO): removed. + * nm-i386bsd.h (FLOAT_INFO): added. + + Native support for i386v (untested). + + * config/i386v.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o coredep.o corelow.o i386-xdep.o i387-tdep.o. + (NAT_FILE, NATDEPFILES): new macros. + * config/i386v.mt (TDEPFILES): removed exec.o, added i387-tdep.o. + * i386-xdep.c: removed. + * Makefile.in (HFILES): added nm-i386v.h + * i386v-nat.c, nm-i386v.h: new file. + * xm-i386v.h: (REGISTER_U_ADDR, i386_register_u_addr): removed to + nm-i386v.h. + * tm-i386v.h (FLOAT_INFO): removed. + + Native support for linux (untested). + + * config/linux.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o coredep.o corelow.o i387-tdep.o i386-xdep.o. + (NAT_FILE, NATDEPFILES): new macros. + * config/linux.mt (TDEPFILES): removed exec.o, added i387-tdep.o. + * Makefile.in (HFILES): added nm-linux.h. + * nm-linux.h: new file. + * xm-linux.h: updated copyright. cleaned up formatting. + (ATTACH_DETACH, U_REGS_OFFSET): removed to nm-linux.h. + + Native support for sun386 (untested). + + * config/sun386.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o sun386-xdep.o. + (NAT_FILE, NATDEPFILES): new macros. + * config/sun386.mt (TDEPFILES): removed exec.o. + * Makefile.in (HFILES): added nm-sun386.h. + * sun386-nat.c, nm-sun386.h: new file. + * sun386-xdep.c: removed. + * xm-sun386.h: updated comment and copyright. + (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): removed to + nm-sun386.h. + + Native support for i386mach (untested). + + * config/i386mach.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o mach386-xdep.o. + (NAT_FILE, NATDEPFILES): new macros. + * Makefile.in (HFILES): added nm-i386mach.h. + * nm-i386mach.h, i386mach-nat.c: new files. + * mach386-xdep.c: removed. + * xm-i386mach.h: updated copyright. + (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): removed to + nm-i386mach.h. + + Native separation for go32 (untested). + + * config/go32.mh (NAT_FILE, NATDEPFILES): new macros. + * go32-nat.c: new file. + * go32-xdep.c (call_ptrace, child_resume, + fetch_inferior_registers, store_inferior_registers, + child_xfer_memory, fetch_core_registers): removed to go32-nat.c. + + Native support for m88k (untested). + + * Makefile.in (HFILES): added nm-m88k.h + * xm-delta88.h, xm-m88k.h (REGISTER_U_ADDR, + FETCH_INFERIOR_REGISTERS): removed. + * config/m88k.mh, config/delta88.mh (XDEPFILES): infptrace.o + inftarg.o fork-child.o m88k-xdep.o removed to NATDEPFILES. + (NAT_FILE, NATDEPFILES): new macros. + * config/m88k.mt, config/delta88.mt (TDEPFILES): removed exec.o. + * m88k-nat.c, nm-m88k.h, nm-delta88.h: new files.o. + * m88k-xdep.c: removed. + +Fri Oct 16 04:16:30 1992 John Gilmore (gnu@cygnus.com) + + * i386b-nat.c: Comment changes. + * nm-i386bsd.h, xm-i386bsd.h: Split native dependent pieces out + into new nm-file. + * config/i386bsd.mh (NAT_FILE): Point to new nm-file. + +Fri Oct 16 03:34:01 1992 John Gilmore (gnu@cygnus.com) + + Avoid longjmp()-catching compilation errors in cross-ports. + + * doc/gdbint.texinfo: Update GET_LONGJMP_TARGET, L_SET doc. + * irix4-nat.c, mips-nat.c (JB_ELEMENT_SIZE, get_longjmp_target): + Move from mips-tdep.c and tm-{irix3,mips}.h. + * mips-nat.c: Remove a bunch of code that was ifdef'd out of + native MIPS ports. + * nm-irix3.h, nm-mips.h (GET_LONGJMP_TARGET): Move from tm-irix3.h + and tm-mips.h. + + * ultra3-nat.c (register_addr): Move from ultra3-xdep.c. + (fetch_core_registers): Fix bfd_seek arguments. + +Fri Oct 16 03:02:28 1992 John Gilmore (gnu@cygnus.com) + + Make core files work again (add back the `core' target). + + * config/decstation.mh, news.mh, sun2os3.mh, sun2os4.mh + (NATDEPFILES): Add corelow.o. + * config/delta88.mt, m88k.mt (TDEPFILES): Remove coredep.o, it's + native dependent. + + * config/3b1.mh, bigmips.mh, hp300bsd.mh, hppabsd.mh, hppahpux.mh, + i386sco.mh, i386v.mh, i386v32.mh, irix3.mh, isi.mh, linux.mh, + littlemips.mh, merlin.mh, news1000.mh, pn.mh, rtbsd.mh, tahoe.mh, + vaxbsd.mh, vaxult.mh (XDEPFILES): Add corelow.o whenever coredep.o + appears. FIXME, these should be moved to NATDEPFILES for native + use only. + +Thu Oct 15 21:53:53 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + Ultra3 host/target/native split. (untested). + + * ultra3-xdep.c: updated copyright. Do not include sys/ptrace.h. + (fetch_register, fetch_inferior_registers, + store_inferior_registers, fetch_core_registers): removed to + ultra3-nat.c. + * xm-ultra3.h (FETCH_INFERIOR_REGISTERS, U_REGS_OFFSET): removed + to nm-ultra3.h. + * Makefile.in (HFILES): added nm-ultra3.h. + * nm-ultra3.h, ultra3-nat.c: new files for native support. + * config/ultra3.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o. + (NAT_FILE, NATDEPFILES): new macros for native support. + * config/ultra3.mt (TDEPFILES): exec.o removed. + + * xm-vaxult.h: add MEM_FNS_DECLARED. + +Thu Oct 15 02:59:30 1992 John Gilmore (gnu@cygnus.com) + + * Makefile.in (VERSION): Roll to 4.6.8. + (OBS): Put version.o first, so Makefile rebuild happens early. + + * command.h: Publicize prototype for not_just_help_class_command. + * command.c: Remove proto. + * maint.c: Mark "mt" as an abbrev, to avoid duplicated help + output. Move "maint info" from class info to class maintenance, + and improve text. + * infrun.c: Move "stop" to class_obscure, and give it a + function so it will not be seen as a global help topic. FIXME, + it should be possible to set these attributes independently. + + * core.c (core_command): Make nicer error message for no core support. + + Lint around file_ptr's (bfd's off_t's) and bfd_seek. + + * dbxread.c (read_dbx_symtab): Use L_SET as bfd_seek arg. + (elfstab_build_psymtabs): staboffset and stabstroffset args are + file_ptr's. + * dwarfread.c (struct dwfinfo): Convert dbfoff, lnfoff to file_ptr. + (scan_compilation_units): Punt unused filename arg. dbfoff, + lnoffset, and curlnoffset are file_ptr's now. + (dwarf_build_psymtabs): Drop desc and filename args; use + objfile. dbfoff and lnoffset are file_ptr's now. + (read_ofile_symtab): foffset is now file_ptr. Use L_SET in bfd_seek. + * elfread.c (struct elfinfo): dboffset and lnoffset are file_ptr's. + (elf_symfile_read): Skip desc and filename args to + dwarf_build_psymtabs. Pass file_ptr's to elfstab_build_psymtabs. + * gdb-stabs.h: Use file_ptr rather than off_t. + * mipsread.c (fixup_symtab): f_ptr is a file_ptr. Re-enable + compile-time debug check that someone turned off as "unused". + (read_the_mips_symtab): st_filptr is a file_ptr. Fix bfd_seek call. + * symfile.h: Update dwarf_build_psymtabs and + elfstab_build_psymtabs prototypes. + * xcoffread.c (init_stringtab, init_lineno, xcoff_symfile_read): + Use file_ptr offsets. bfd_seeks use L_SET. + +Thu Oct 15 01:27:32 1992 Stu Grossman (grossman at cygnus.com) + + * mips-tdep.c, mipsread.c, tm-mips.h: Get rid of ".gdbinfo." + symbol. #define MIPS_EFI_SYMBOL_NAME instead. Use different + value so that demangler won't be invoked. This greatly speeds up + stepping. + * mips-tdep.c (mips_pop_frame): Rewrite handling of + linked_proc_info so that it properly deallocates the appropriate + item after it is done with it instead of before. + * Don't pass bogus frame pointer to create_new_frame(). Just + leave it as zero so that lower level code will figure out the + correct value. + +Wed Oct 14 18:56:28 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + Sony News native support. + + * Makefile.in (HFILES): added nm-news.h. + * nm-news.h: new file. + * config/news.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o coredep.o to NATDEPFILES. + (NAT_FILE, NATDEPFILES): new macros for native support. + * config/news.mt (TDEPFILES): removed exec.o. + + * remote-vx.c: remove redundant include of sys/time.h. + + * infrun.c: include ctype.h. Otherwise some machines result in + undefined for isdigit. + +Tue Oct 13 01:27:14 1992 John Gilmore (gnu@cygnus.com) + + * configure.in: Convert m68k entries to m68* entries to handle + all the various m68xxx hosts and targets. + * config/news1000.mt: No longer needed, same as news.mt. + +Fri Oct 9 18:54:37 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + * config/sun3os[34].mh (NATDEPFILES): remove duplicate inftarg.o. + +Fri Oct 9 14:20:08 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (HFILES): Add all nm-irix3.h, nm-irix4.h, + nm-sun2.h, nm-mips.h. + + * config/irix3.mh (NATDEPFILES): nat-mips.o => mips-nat.o. + + * Makefile.in (alldeps.mak): Add = sign after NATDEPFILES. + + * config/bigmips.mh config/littlemips.mh: Remove mips-xdep.o. + +Fri Oct 9 08:41:11 1992 Ian Lance Taylor (ian@cygnus.com) + + * xm-hppah.h: if __STDC__ is not defined, define + HPPA_COMPILER_BUG. + symtab.c (decode_line_1): avoid a bug in the HP9000/700 native + compiler; see the comment in the file. + +Fri Oct 9 04:43:43 1992 John Gilmore (gnu@cygnus.com) + + First cut at support for all BSD variants on 386. + + * tm-i386bsd.h, xm-i386bsd.h: New config files. + * i386b-nat.c: New native support file. + * configure.in: Add host and target for i[34]86-*-bsd*. + * config/i386bsd.mh, config/i386bsd.mt: New config files. + +Fri Oct 9 00:31:33 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + Sun2 native support (untested). + + * xm-sun2.h (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS, + REGISTER_U_ADDR): removed to nm-sun2.h. + * nm-sun2.h: new file. + * config/sun2os[34].mh (XDEPFILES): infptrace.o inftarg.o + fork-child.o sun3-xdep.o removed. + (NAT_FILE, NATDEPFILES): new macros. + + Mips native support. Decstation and iris4 have been tested. + Iris3 has not. + + * mips-tdep.c (supply_gregset, fill_gregset, supply_fpregset, + fill_fpregset): removed to irix4-nat.c + * mips-xdep.c: removed. + * irix4-nat.c, mips-nat.c, nm-irix3.h, nm-irix4.h, nm-mips.h: new + files. + * procfs.c: include nm.h. + * xm-irix3.h (U_REGS_OFFSET, FETCH_INFERIOR_REGISTERS): removed. + * xm-irix4.h: bump copyright. + (U_REGS_OFFSET, FETCH_INFERIOR_REGISTERS, USE_PROC_FS, + PROC_NAME_FMT): removed. + * xm-mips.h (FETCH_INFERIOR_REGISTERS): removed. + * config/irix4.mh (XDEPFILES): removed procfs.o fork-child.o. + (NAT_FILE, NATDEPFILES): new macros for native support. + (CC): supply default compiler switches. + * config/irix3.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o coredep.o. + (NAT_FILE, NATDEPFILES): new macros for native support. Note that + irix3 is untested. + * config/decstation.mh (XDEPFILES): removed infptrace.o inftarg.o + fork-child.o mips-xdep.o coredep.o. + (NAT_FILE, NATDEPFILES): new macros for native support. + +Thu Oct 8 23:50:51 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + * config/rs6000.mh (XDEPFILES): removed fork-child.o. + (NATDEPFILES): added fork-child.o + * config/sun3os3.mh (XDEPFILES): removed fork-child.o. + (NATDEPFILES): added fork-child.o + * config/sun3os4.mh (XDEPFILES): removed fork-child.o. + (NATDEPFILES): added fork-child.o + +Thu Oct 8 23:19:25 1992 John Gilmore (gnu@cygnus.com) + + * infcmd.c (path_info): Avoid 250-char limit on printf_filtered, + by using puts_filtered instead. + +Fri Oct 9 00:28:25 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * remote-nindy.c (nindy_load): Replacement version from Steve + Chamberlain, doesn't require forking to run "strip" or "sx". + +Thu Oct 8 18:27:35 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (HFILES): Add nm-*.h files. + +Thu Oct 8 16:27:45 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + * config/sun4os4.mh (XDEPFILES): fork-child.o removed. + (NATDEPFILES): added fork-child.o. + + * doc/gdbint.texinfo: document a few more macros, create new + section for native macros. + +Thu Oct 8 13:52:46 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in alldeps.mak depend: Rip out 29k/udi pending + resolution of copyright issues. + +Wed Oct 7 20:08:53 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (setup-to-dist): Remove -norecursion so that doc + subdir gets configured. + +Wed Oct 7 12:24:01 1992 Ken Raeburn (raeburn@cygnus.com) + + * Makefile.in (nindy.o): Define "STRIP" as pathname of strip + program. + * nindy-share/nindy.c (coffstrip): Use that pathname, instead of + searching for a "bfd_strip" program. Also, fixed up arguments + passed to that program. + + * tm-nindy960.h (ADDITIONAL_OPTIONS): Use "-ser" rather than "-r", + which is now used for something else. Rewrite description of + associated parameters to match how gdb does it now. + (ADDITIONAL_OPTION_HELP): Fix message accordingly. + + * m68k-pinsn.c (print_insn_arg): Handle new "`" operand type. + +Tue Oct 6 14:47:11 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + NOTICE_SIGNAL_HANDLING_CHANGE macro added to the target vector as + to_notice_signals. + + * inferior.h (proc_signal_handling_change): prototype removed. + * infrun.c (NOTICE_SIGNAL_HANDLING_CHANGE): default removed. + (handle_command): now calls target_notice_signals. + * procfs.c (proc_signal_handling_change): renamed to + procfs_notice_signals. Now static. Add prototype. All callers + changed. + * target.h (struct target_ops): new field, to_notice_signals. + (target_notice_signals): new macro to cover new field. + * target.c (cleanup_target): default to_notice_signals to ignore. + * corelow.c (core_ops), + exec.c (exec_ops), + inftarg.c (child_ops), + procfs.c (procfs_ops), + remote-adapt.c (adapt-ops), + remote-eb.c (eb_ops), + remote-es1800.c (es1800_ops, es1800_child_ops), + remote-hms.c (hms_ops), + remote-mm.c (mm_ops), + remote-nindy.c (nindy_ops), + remote-st2000.c (st2000_ops), + remote-udi.c (udi_ops), + remote-vx.c (vx_ops, vx_run_ops), + remote.c (remote_ops), + target.c (dummy_target), + xcoffexec.c (exec_ops): added static initializer for + to_notice_signals. + * xm-irix4.h, xm-sysv4.h (NOTICE_SIGNAL_HANDLING_CHANGE): removed. + +Tue Oct 6 12:13:08 1992 John Gilmore (gnu@cygnus.com) + + * main.c (define_command): Add forgotten initializer. + +Tue Oct 6 02:23:17 1992 John Gilmore (gnu@cygnus.com) + + * language.c, language.h: Move saved_language out to global + expected_language. Set expected_language when user expectation + changes. + * language.c (language_info): Don't print type/range checking gub. + * main.c (main): Set expected language. + (execute_command): Check against expected language. + * symfile.c (set_initial_language): Set expected language. + + * configure.in, config/i386sol2.{mh,mt}: Preliminary Solaris-x86 conf. + +Fri Sep 4 00:34:30 1992 Per Bothner (bothner@rtl.cygnus.com) + + A bunch of changes mostly to improve debugging of C++ programs. + Specifically, the calling of inferiors methods is improved. + + * value.h: New macros METHOD_PTR_IS_VIRTUAL, + METHOD_PTR_FROM_VOFFSET, METHOD_PTR_TO_VOFFSET to partially + hide the implementation details of pointer-to-method objects. + How to tell if the pointer points to a virtual method is + still very dependent on the particular compiler, but this + should make it easier to find the places to change. + * eval.c (evaluate_subexp [case OP_FUNCALL]), valprint.c + (val_print [case TYPE_CODE_PTR]): Use the new METHOD_PTR_* + macros, instead of a hard-wired-in code that incorrectly + assumed a no-longerused representation of pointer-to-method + values. And otherwise fix the relevant bit-rotted code. + + * valprint.c (type_print_base [case TYPE_CODE_STRUCT]): + If there are both fields and methods, put a space between. + + * stabsread.c (read_struct_type): Fix bug in handling of + GNU C++ anonymous type (indicated by CPLUS_MARKER followed + by '_'). (It used to prematurely exit the loop reading in + the fields, so it would think it should start reading + methods while still in the fields. This could crash gdb + given a gcc that can emit nested type information.) + + * valops.c (search_struct_method): Pass 'this' value by + reference instead of by value. This provides a more + consistent interface through a recursive search where the + "bottom" functions may need to adjust offsets (due to multiple + inheritance). + * valops.c, value.h, values.c: Pass extra parameters to + value_fn_field and value_virtual_fn_field so we can + correctly adjust offset for multiple inheritance. + * eval.c (evaluate_subexp [case OP_FUNCALL]): Simplify + virtual function calls by using value_virtual_fn_field(). + * values.c: New function baseclass_offset, derived from + baseclass_addr (which perhaps can be made obsolete?). + It returns an offset rather than an address. This is a + cleaner interface since it doesn't mess around allocating + new values. + * valops.c (search_struct_method): Use baseclass_offset + rather than baseclass_addr. + +Mon Oct 5 16:02:04 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in: Re-install 29K/UDI stuff. + * remote-udi.c (udi_resume): Clean up. + * (udi_wait): Rewrite, leave out bugs. + * Add debugging code to print out all register fetches and stores. + * Straighten out target_ops. + * tm-29k.h (DUMMY_FRAME_RSIZE): Pad out to doubleword. + +Mon Oct 5 09:46:44 1992 Ian Lance Taylor (ian@cygnus.com) + + * remote-udi.c (udi_create_inferior): run with no arguments should + not pass the program name as an argument, since the UDI code + already handles that. + (udi_load): get the symbols from prog_name, not arg_string (the + load command should really use arg_string as the program name, not + prog_name, but at least the run command works now). + + * munch: HP9000/300 nm puts an extra space between T and symbol + name. + + * config/irix4.mh: added -lsun to XM_CLIBS to get RPC functions + needed for vxworks targets. + +Fri Oct 2 22:04:42 1992 John Gilmore (gnu@cygnus.com) + + * am29k-tdep.c (_initialize_29k): Make it possible for the + user to set and query the address where function calls into the + inferior write a small scratch routine. `set call_scratch_address' + * inferior.h (PC_IN_CALL_DUMMY): Fix fencepost error. + * remote.c (remote_prepare_to_store): Only fetch regs if they are + not already cached validly. + +Thu Oct 1 14:36:42 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + Rs6000 native support. + + * infptrace.c: remove #ifdef USG from around include ptrace.h. + machines without this header should not be compiling this file. + * nm-rs6000.h, rs6000-nat.c: new files for native support. + * rs6000-tdep.c: do not include sys/ptrace.h or sys/reg.h. + * rs6000-xdep.c: removed. all code now in rs6000-nat.c. + * xm-rs6000.h: do not include ptrace.h. + (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): moved to nm-rs6000.h. + * config/rs6000.mh (XDEPFILES): removed rs6000-xdep.o. + infptrace.o and inftarg.o move to NATDEPFIES. + (NAT_FILE, NATDEPFILES): new macro for native support. + + Sun3 native support. + + * config/sun3os3.mh, config/sun3os4.mh (NAT_FILE, NATDEPFILES): + new macros for native support. + (XDEPFILES): moved infptrace.o and inftarg.o to NATDEPFILES, + removed sun3-xdep.o. + * xm-sun3.h (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): moved to + nm-sun3.h. + * sun3-xdep.c: removed. All code is now in sun3-nat.c. + * sun3-nat.c, nm-sun3.h: new files for native support. + +Thu Oct 1 10:30:54 1992 Fred Fish (fnf@cygnus.com) + + * dwarfread.c (dbsize): New variable to hold size of dwarf info. + * dwarfread.c (dwarf_build_psymtabs): Rename dbsize parameter to + dbfsize and use it to initialize new local file scope dbsize. + * dwarfread.c (read_ofile_symtab): Initialize dbsize and use it. + * dwarfread.c (basicdieinfo): Use dbsize to check for oversize + DIEs as well as the current check for undersize DIEs. This helps + to gracefully detect and reject corrupted DIE information. + +Thu Oct 1 01:57:56 1992 John Gilmore (gnu@cygnus.com) + + Add `command hooks' and a hook for inferior program stopping. + + * command.h (struct cmd_list_element): Remove unused `aux' + field. Add new `hook', `hookee', and `cmd_pointer' fields. + * command.c (add_cmd): Initialize new fields, elim old. + (add_alias_cmd): Clone new fields. + (delete_cmd): Un-hook hookee if we're deleting hook. + (help_cmd): Tell user the command is hooked, if it is. + (lookup_cmd_1): Abbreviations return the original command + instead of themselves, so that hooks on the original cmd will be + run. + * defs.h (enum command_class): Add class_pseudo and comments. + * gdbcmd.h (execute_user_command): Add prototype. + * infrun.c (normal_stop): If the stop command is hooked, + run the hook whenever we stop. + (hook_stop_stub): Stub for catch_errors. + (_initialize_infrun): Set up pseudo "stop" command. + * main.c (execute_user_command): Code extracted from execute_command. + (execute_command): If hooked, run the hook before the command. + (define_command): If defining a new hook, check the command it + is hooking, and warn if none. Install the hook. + * source.c (_initialize_source): "l" is an abbrev for "list". + * doc/gdb.texinfo: Document command hooks. + + * Makefile.in (VERSION): Roll to 4.6.7. + * config/sun4os4.mh: Remove dup inftarg.o from NATDEPFILES. + * infrun.c (breakpoints_inserted): Make it static again. + * tm-symmetry.h (FLOAT_INFO): #if 0 it for cross-ptrace abuse. + +Wed Sep 30 15:33:22 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + Native file renaming. + + * nat-sparc.c -> sparc-nat.c + * nat-sun4os4.h -> nm-sun4os4.h + * nat-trash.h -> nm-trash.h + * config/sun4os4.mh: track file renaming. + * configure.in: link to nm.h rather than nat.h. + * infptrace.c: include nm.h rather than nat.h. + +Tue Sep 29 14:35:00 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + Host/target/native split for sun4. + + * Makefile.in (TSOBS): removed corelow.o. + * infptrace.c: included nat.h. + * nat-trash.h: temporary header file. This should be removed once + all hosts have the native/host/target split. + * configure.in: add a symlink from nat-trash.h to nat.h if no + other nat file exists for this configuration. + * sparc-tdep.c: no longer include sys/ptrace.h. + * sparc-xdep.c: removed. contents have been moved to nat-sparc.c. + * xm-sparc.h (ATTACH_DETACH, FETCH_INFERIOR_REGISTERS): moved to + nat-sun4os4.h. + * nat-sparc.c, nat-sun4os4.h: new files for sun4 native support. + * config/sun4os4.mh (XDEPFILES): moved infptrace.o and inftarg.o + to NATDEPFILES. removed sparc-xdep.o. + (NATDEPFILES, NAT_FILE): new macros for native support. + + Break the direct connection from core_file_command to any + particular type of core file support. + + * target.h (find_core_target): new prototype. + * target.c (find_core_target): new function. Walks the target + list looking for the core target. + * core.c (core_file_command): replace calls to core_detach and + core_open with find_core_target and direct calls. + +Tue Sep 29 10:19:00 1992 Ian Lance Taylor (ian@cygnus.com) + + * xm-hp300hpux.h: define MEM_FNS_DECLARED; include <sys/ptrace.h> + for infptrace.c. + config/hp300hpux.mh: ALLOCA1 was not defined. + +Mon Sep 28 22:03:41 1992 Stu Grossman (grossman at cygnus.com) + + * breakpoint.c, exec.c, language.c, main.c, printcmd.c, symfile.c, + target.c, valprint.c: Use unfiltered forms of f/printf, et. al. + until we can figure out a better way to do paging. + +Sat Sep 26 02:07:31 1992 John Gilmore (gnu@cygnus.com) + + * findvar.c (supply_register): Add CLEAN_UP_REGISTER_VALUE hook. + * tm-hppa.h (CLEAN_UP_REGISTER_VALUE): Use it. + * hppa-coredep.c: Remove, now that we use the hook. + * config/hppab.mh, config/hppah.mh: Use standard coredep.o. + * hppab-xdep.c, hppah-xdep.c: Remove custom code, use hook. + + * dbxread.c, partial-stab.h: Replace all #ifdef hp9000s800's with + GDB_TARGET_IS_HPPA's. This is a SERIOUS KLUDGE. The code needs to all + be ripped out and reimplemented right (see elfread.c). + * tm-hppa.h (GDB_TARGET_IS_HPPA): Define. + + Rename all HPPA files to fit into unique DOS filenames: + * *hppabsd* => *hppab* + * *hppahpux* => *hppah* + +Sat Sep 26 00:25:15 1992 John Gilmore (gnu@cygnus.com) + + Make the /proc support a target-struct in its own right. + + * Makefile.in: Remove inftarg.[co], since it is now included via + config/*.mh files. + * config/*.mh: Add inftarg.o and fork-child.o to all *.mh that + reference infptrace.o. Add fork-child.o to all *.mh that + reference procfs.o. + + * inferior.h (proc_wait, inferior_proc_init, proc_set_exec_trap): + No longer global functions. + (fork_inferior): New global function from fork-child.c. + * inftarg.c (child_wait): Remove USE_PROC_FS conditional. + (ptrace_me, ptrace_him): New stub functions for fork_inferior(). + (child_create_inferior): Moved to fork-child.c as fork_inferior. + (child_create_inferior): New tiny function that calls fork_inferior. + * fork-child.c: New file, containing fork_inferior, which is + built from slight mods to inftarg.c's child_create_inferior. + + * procfs.c (procfs_ops): Add target vector. + (attach): Rename as static do_attach. + (procfs_create_inferior): New tiny function that calls fork_inferior. + (child_xfer_memory): Rename to static procfs_xfer_memory. + (store_inferior_registers): Rename to static procfs_store_registers. + (inferior_proc_init): Rename to static procfs_init_inferior. + (procfs_attach, procfs_detach, procfs_prepare_to_store, + procfs_files_info, procfs_open, procfs_mourn_inferior, + procfs_can_run): Slightly mangled copies of the corresponding + child_XXX routines from inftarg.c. + (proc_wait): Renamed to static procfs_wait. + (child_resume): Rename to static procfs_resume. + (fetch_inferior_registers): Rename to static procfs_fetch_registers. + (initialize_proc_fs): Rename to initialize_procfs. Set up + procfs_ops, too. + + * putenv.c: index -> strchr. + * regex.c: Always rename bcopy to memcpy, etc. + FIXME: Eventually do the renames rather than use #define's. + * sparc-tdep.c (deferred_stores): Moved from sparc-xdep.c. + Fix bcopy->memcpy. + * sparc-xdep.c: Move deferred_stores to target dependent. + * xm-irix4.h, xm-sysv4.h (CREATE_INFERIOR_HOOK): No longer needed. + +Fri Sep 25 21:59:27 1992 John Gilmore (gnu@cygnus.com) + + Split non-target-dependent code out of target_attach routines. + + * target.h: Comments on target_attach args and results. + * infcmd.c (attach_command): Check for existing execution, call + target_attach, set up terminal status and wait_for_inferior, wait + for the attach status, and do normal_stop. + * inftarg.c (child_attach): Remove target independent stuff. + * remote-adapt.c (adapt_attach): Ditto. + * remote-mm.c (mm_attach): Ditto. + * remote-udi.c (udi_attach): Ditto. + * remote-vx.c (vx_attach): Ditto. + + Cleanup. + + * remote-hms.c (hms_attach): Remove completely, it was useless. + * remote-mm.c, remote-hms.c, remote-udi.c, remote-adapt.c: Remove + commented-out start_remote calls. + * remote-hms.c, remote-adapt.c, remote-mm.c, remote-udi.c: Remove + DENTER and DEXIT macros and their calls. Use a real debugger -- + like gdb -- to see what functions are being called when. + * utils.c (strcmp_iw): Make nonstatic, for lint. + +Fri Sep 25 18:48:20 1992 John Gilmore (gnu@cygnus.com) + + * infrun.c, inftarg.c, inferior.h: Comment and lint cleanups. + +Fri Sep 25 15:13:44 1992 Stu Grossman (grossman at cygnus.com) + + * tm-sparc.h, dbxread.c (read_ofile_symtab): Install Jim Wilson's + fix to differentiate between gcc1 & gcc2 compiled files so that we + can debug calls that pass structs as args correctly. + * symmisc.c (dump_symtab): If block was compiled with gcc, say + so, and what version. + + * remote.c (remote_wait): Make regs be char to avoid picayune + ANSI compiler warnings. + + * energize.h: Move all external struct decls to inside of + __STDC__, add prototype for energize_shell_wait(). + * energize.c (getpty): Clean up, make us really get a controlling + terminal. + * (energize_initialize): Disable SIGIO prior to setting up for + I/O interrupts. Move setsid(), et. al. to getpty(). + * (energize_shell_wait): New routine to wait for things started + via the shell command, uses wait() instead of /dev/proc. + * Also, add prototype for execute_command_1(). + +Fri Sep 25 12:09:33 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + * inftarg.c (child_create_inferior, child_attach, + child_mourn_inferior): collect unix child process stratum + functions which live below the target vector into this file to + facilitate host/target/native split. Also, make them static. + * inflow.c (child_mourn_inferior): removed. + * infrun.c (child_create_inferior, child_attach): removed. + (resume): becomes global so that functions below the + target vector can find it. + * inferior.h (resume): add prototype. + (child_mourn_inferior, child_create_inferior, child_attach): + remove prototypes. + + * xcoffexec.c (exec_ops): child_attach and child_create_inferior + replaced with find_default_attach and + find_default_create_inferior. + +Fri Sep 25 10:21:04 1992 Ken Raeburn (raeburn@rtl.cygnus.com) + + * i960-pinsn.c: Use _filtered routines for printing, so symbolic + addresses don't get displayed in the wrong positions. + +Fri Sep 25 09:52:47 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + Separate core functions along target vector in preparation for + native support. Functions above vector now live in core.c. Those + below in corelow.c. + + * core.c (solib_add_stub, core_close, core_open, core_detach, + get_core_registers, core_files_info, core_ops): moved to corelow.c + (_initialize_core): removed addition of core_ops target. + * corelow.c: new file. + (solib_add_stub, core_close, core_open, core_detach, + get_core_registers, core_files_info, core_ops): moved from core.c + (_initialize_corelow): new function. + * gdbcore.h (core_open, core_detach): added prototypes. + (core_ops): add forward declaration. + * Makefile.in (SFILES_MAINDIR): add core.c + (OBS): add core.o + (TSOBS): change core.o to corelow.o + +Wed Sep 23 11:14:53 1992 Stu Grossman (grossman at cygnus.com) + + * m68k-tdep.c (m68k_saved_pc_after_call): Use 'GDB_TARGET_IS_SUN3' + instead of 'sun' predefined symbol so that trap analysis code is + enabled only when the TARGET is a sun3. + +Tue Sep 22 17:13:19 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * tm-i960.h (ext_format_i960): Add top-level declaration. + (REGISTER_CONVERT_TO_{VIRTUAL,RAW}): Don't declare it in nested + blocks, else Sun4 compiler complains. + +Tue Sep 22 00:43:51 1992 John Gilmore (gnu@cygnus.com) + + * mips-pinsn.c (print_insn_arg, case 'B'): Disassemble `break' + instruction's argument. Patch from jonathan@cs.stanford.edu + (Jonathan Stone). + +Mon Sep 21 18:16:30 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + Break the thread of control that implies that a unix child + process will be the default target. + + * target.c (find_default_run_target, find_default_attach, + find_default_create_inferior, return_zero): new functions. + (cleanup_target): Make return_zero the default for to_can_run. + + * exec.c (exec_ops), core.c (core_ops): Replace child_attach and + child_create_inferior references with find_default_XXX instead. + + * target.h (struct target_ops): new field, to_can_run. + (find_default_attach, find_default_create_inferior): new prototypes. + (target_can_run): new macro. + + * Also added a zero (default) to_can_run element to all static + struct target_ops initializations throughout GDB, except: + * inftarg.c (child_ops): Use new child_can_run() to enable child runs. + + * infrun.c (child_create_inferior): Clean up error handling when + no exec file is specified. + (child_attach): Don't require exec file. + +Mon Sep 21 19:43:13 1992 John Gilmore and K. Richard Pixley (gnu@cygnus.com) + + Remove kill_inferior_fast, in favor of target_kill, which goes + through the target vector. + + * inferior.h (kill_inferior_fast): remove declaration. + + * main.c (disconnect): call quit_cover using catch_errors rather + than calling kill_inferior_fast directly. New way goes through + the target vector, handles attached processes, and writes + command history if appropriate. + (quit_cover): new function, wrapper for quit_command. + + * convex-xdep.c, go32-xdep.c, hppabsd-xdep.c, hppahpux-xdep.c, + infptrace.c, procfs.c: Removed all instances of kill_inferior_fast, + inlining them into the local kill_inferior when needed. + +Mon Sep 21 19:23:05 1992 John Gilmore (gnu@cygnus.com) + + * infrun.c (_initialize_infrun): Alias `i handle' == `i signals'. + * stabsread.c (read_struct_type): Simplify complicated expression + for dumb DECstation compiler. + +Mon Sep 21 14:54:35 1992 Ian Lance Taylor (ian@cygnus.com) + + * m68k-pinsn (print_insn_arg, fetch_arg): added support for + operands to memory management instructions, from WRS. + +Sep 20 08:42:12 1992 Fred Fish (fnf@cygnus.com) + + * main.c (main): Back out previous language setting changes. + Replace with simple default to C before processing any init + files. There MUST be a language set, even in the absence of + init files or executables, or expression parsing fails. + +Sat Sep 19 09:52:26 1992 Fred Fish (fnf@cygnus.com) + + * main.c (main): Move code that sets initial language to + symfile.c. Fixup places where command files are processed to + be consistent in setting a default language if none has been + previously set. + * symfile.c (set_initial_language): Add code moved from + main() that sets an initial default language when a new + symbol file is read. + * symfile.c (symbol_file_command): Call set_initial_language. + * symtab.c (find_main_psymtab): Add FIXME comment. + +Wed Sep 16 22:31:55 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + * breakpoint.c, sparc-tdep.c: comment changes. + * configure.in: removed target_dependent line. + + * remote-mm.c (mm_attach): change printf to error to prevent + fallthrough bug. + * remote-udi.c (udi_attach): change printf to error to prevent + fallthrough bug. + + * rs6000-tdep.c (push_dummy_frame, pop_dummy_frame): replace + calls to {fetch|store}_inferior_registers with calls to + target_{fetch|store}_registers, for remote-target independence. + +Sat Sep 19 04:23:54 1992 John Gilmore (gnu@cygnus.com) + + * Makefile.in: Fix bug I introduced in merging Rich's change. + * infrun.c (child_create_inferior): Use proceed() rather than + doing all the same stuff by hand. + +Thu Sep 17 17:35:37 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + * Makefile.in, configure.in: add support for files used only when + configured native, that is, when host = target. + +Wed Sep 16 23:03:23 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + * tm-sparc.h, xm-sparc.h: externs and macros relating to deferred + stores are target dependent and were moved from xm to tm. + +Sat Sep 19 03:14:37 1992 John Gilmore (gnu@cygnus.com) + + * Makefile.in (gdb-all.texi): Build in objdir, not $srcdir. + + * config/decstation.mh: Add MMALLOC_LIB and MMALLOC_DISABLE + overrides, to avoid problem in xdr_bytes with malloc(0) => 0. + +Wed Sep 16 20:04:54 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + * target.h (struct target_ops): removed to_convert_to_virtual and + to_convert_from_virtual elements. Initializations removed from + all static initializations. + (target_convert_to_virtual, target_convert_from_virtual): + removed. + (host_convert_to_virtual, host_convert_from_virtual): Removed + forward declarations. + * target.c (cleanup_target): removed default assignments for + to_convert_to_virtual and to_convert_from_virtual. + * inftarg.c (host_convert_to_virtual, host_convert_from_virtual): + removed. + * findvar.c (value_of_register, value_from_register): + target_convert_to_virtual inlined. + * infcmd.c (do_registers_info): target_convert_to_virtual inlined. + * valops.c (value_assign): target_convert_from_virtual inlined. + +Fri Sep 18 02:07:39 1992 John Gilmore (gnu@cygnus.com) + + * main.c (gdb_readline): Avoid printf_filtered, which sets char + position wrong if used for the prompt. + * utils.c (puts_filtered): Comment: NOT a puts() replacement! + + Support for accessing arbitrary MIPS stack frames in memory. + + * blockframe.c (get_prev_frame_info): If INIT_FRAME_PC_FIRST is + set, run it before INIT_EXTRA_FRAME_INFO. + * stack.c (frame_info): If PRINT_EXTRA_FRAME_INFO defined, call it. + + * mips-tdep.c (init_extra_frame_info): Only clobber the `frame' + (FP) value in the frame_info struct if it is zero (as from top of + execution stack). + (setup_arbitrary_frame): Implement FRAME_SPECIFICATION_DYADIC. + + * mips-xdep.c (fetch_inferior_registers): ZERO_REGNUM always + comes back as zero. So does FP_REGNUM, as a trigger for + init_extra_frame_info. + + * tm-mips.h (INIT_FRAME_PC_FIRST): Kludge, FIXME, defined to get + the program counter set before INIT_EXTRA_FRAME_INFO is run. + (INIT_FRAME_PC): Defined to null. + (PRINT_EXTRA_FRAME_INFO): print frame pointer location via symtab. + (FRAME_SPECIFICATION_DYADIC): Ask for two args in frame command. + Briefly explain MIPS stacks in GDB. + +Thu Sep 17 03:49:59 1992 John Gilmore (gnu@cygnus.com) + + * copying.awk, copying.c (show_copying_command, + show_warranty_command): Rename from copying_info, warranty_info, + to match command function conventions. + + * utils.c (prompt_for_continue): Reinitialize more-counts + before printing anything, and again afterward. Fix comments. + (vfprintf_filtered): Eliminate static buffer; use auto buffer, + or alloca() if needed. + + * rs6000-xdep.c: Use correct conditional (IBM6000_TARGET) to + detect native versus cross-host. + +Wed Sep 16 21:57:14 1992 Stu Grossman (grossman at cygnus.com) + + * m68k-tdep.c (sun3_saved_pc_after_call): Only do trap check for + Suns. Rename to m68k_saved_pc_after_call. + * tm-68k-noun.h, tm-sun3.h (SAVED_PC_AFTER_CALL): Use + m68k_saved... instead of sun3_saved... + +Wed Sep 16 17:00:07 1992 John Gilmore (gnu@cygnus.com) + + * Makefile.in (update-depend, update-alldeps): Split out of + setup-to-dist, for convenience in rebuilding the depend and + alldeps.mak files. + (assorted): Update to catch straggler files when building gdb.tar.Z. + +Tue Sep 15 01:18:50 1992 John Gilmore (gnu@cygnus.com) + + Preliminary cleanup for splitting host/native/target. + + * infptrace.c (child_resume): Don't deal with NO_SINGLE_STEP + here; it is dealt with at a gdb-target-independent level. + * rs6000-tdep.c (single_step): Don't call ptrace, we are a + high toned routine. Fix return type to void. + * tm-rs6000.h (AIX_BUGGY_PTRACE_CALL): Zap, we think we fixed it. + Rich and I believe the "real problem" was that both single_step + and target_resume were issuing PT_CONTINUE calls. This would + cause the second PT_CONTINUE to sometimes fail because the process + was already running. + * infptrace.c (child_resume): Remove AIX_BUGGY_PTRACE_CALL kludge. + +Mon Sep 14 19:20:43 1992 Stu Grossman (grossman at cygnus.com) + + * energize.c (pty_to_kernel): Must check for EAGAIN as + termination condition. + (full_filename): Don't prepend dirname if filename begins with /. + (breakpoint_notify, kernel_dispatch): Deal with DynamicLoad + messages properly!! + (getpty (NCR)): Lotsa bug fixes... + (kernel_dispatch (case StopRType)): Use kill() instead of + killpg() so we can deal with losing systems... + (wait_for_events): Work around NCR select() lossage. It doesn't + zero out readfds when select() returns zero. + (energize_initialize): Use I_SETSIG to get SIGIO interrupts. Use + getcwd() instead of getwd() (NCR getwd() seg faults). + (energize_wait): Use sigaction() for NCR. Their version of signal() + is unreliable by default. + + * procfs.c (proc_wait): Call print_sys_errmsg() if we get an + error from PIOCSWSTOP. + + * breakpoint.c, core.c, exec.c, language.c, main.c, printcmd.c, + symfile.c, target.c, valprint.c: Use _filtered form of *printf. + defs.h, utils.c: Make vfprintf_filtered global. + + * energize.c (send_location): New routine to consolidate all + places where we must notify kernel of where the given pc is. + (cplus_demangle): Put single-quotes around demangled names. + (energize_call_command): Call send_location() after doing up, + down, and frame commands. + +Fri Sep 11 18:28:28 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) + + * doc/gdb.texinfo, doc/gdbinv-m.m4.in, doc/gdbinv-s.m4.in: first + pass at doc for two new remote targets---29K using UDI, and Tandem + ST2000 using STDBUG. + + * doc/all.m4, doc/none.m4: new m4 switch, _ST2000__ + + * doc/all.m4: turn on H8/300 stuff for generic manual + + * doc/gdbinv-s.m4.in: remove text on special procedures to continue + after explicit call to breakpoint() in serial stubs. + +Fri Sep 11 01:34:25 1992 John Gilmore (gnu@sphagnum.cygnus.com) + + * mipsread.c: Clean up some white space. + (parse_symbol): Handle stEnd of stFile. + (parse_partial_symbols): Remove old #if 0'd code. Handle stLocal. + + * mips-xdep.c (REGISTER_PTRACE_ADDR, fetch_inferior_registers, + store_inferior_registers): Replace unexplained numbers + with manifest constants from a DECstation header file. + * xm-mips.h (KERNEL_U_ADDR): Get from <machine/param.h>. + (REGISTER_U_ADDR): Fix up for Ultrix 4.2. + + * tm-tahoe.h, xm-tahoe.h (KERNEL_U_ADDR): Move macro to xm-tahoe.h. + + * stack.c (_initialize_stack): "dow" should be a valid abbreviation + for "down". Suggested by Richard Stallman. + +Thu Sep 10 15:26:07 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * remote-vx.c: Rename realloc for inclusion of rpc/rpc.h, to avoid + redeclaration bug on SunOS 4. + +Wed Sep 9 17:36:53 1992 John Gilmore (gnu@cygnus.com) + + * i386-stub.c, sparc-stub.c (getpacket): Actually check checksums. + * m68k-stub.c: Remove a few extraneous ANSI-isms. + * remote-nindy.c (nindy_prepare_to_store): Only fetch regs if + they aren't already there. + * remote-vx.c (vx_prepare_to_store): Ditto. + * xcoffread.c: Surround forward struct defns with #ifdef __STDC__. + +Wed Sep 9 16:50:22 1992 John Gilmore (gnu@cygnus.com) + + Removed a large number of changes inserted by Per Bothner + for C++ support. These will go back in when they've been + examined. + +Tue Sep 8 21:05:18 1992 Stu Grossman (grossman at cygnus.com) + + * serial.h: Fix prototye for serial_raw(). + * ser-bsd.c, ser-termios.c: Fix args for serial_open() & + serial_write() to match prototypes. + * remote-st2000.c (get_reg_name): Make *p be const. + +Tue Sep 8 17:24:52 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * remote-nindy.c (nindy_fetch_registers): Make return type void, + to agree with target structure field type. + (nindy_store_registers): Ditto. + + * Makefile (OPCODES): New var, pointing to opcodes library. + (CLIBS, CDEPS): Include it. + (saber_gdb): Load opcodes library. + +Tue Sep 8 15:22:06 1992 Stu Grossman (grossman at cygnus.com) + + * a68v-xdep.c (store_inferior_registers): declare as void. + * infptrace.c: HP/Apollos have ptrace.h in the wrong place. + * remote-st2000.c: Massive changes to use new serial package. + Also added 'connect' command to transparantly connect to serial + port. + * ser-termios.c: Big cleanup, use nicer coding conventions. + * ser-bsd.c: New module, serial stuff for BSD systems. + * serial.h: Define struct ttystate properly using HAVE_TERMIO. + * xm-apollo68b.h: #define PTRACE_IN_WRONG_PLACE... + +Fri Sep 4 18:53:57 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) + + * doc/gdb.texinfo: fix shameful error of agreement reported by + jimb@occs.cs.oberlin.edu (Jim Blandy) + * doc/gdb.texinfo: remove old partial discussion of remote serial + protocol (via serial debug stubs) + * doc/gdbinv-m.m4.in, doc/gdbinv-s.m4.in: new section discussing + use of serial debug stubs + +Fri Sep 4 00:34:30 1992 Per Bothner (bothner@rtl.cygnus.com) + + * symfile.h: Declaration of set_demangling_style() moved + here from demangle.h (which is now in ../include). + * i386-xdep.c: Update comment. + +Thu Sep 3 13:44:46 1992 K. Richard Pixley (rich@sendai.cygnus.com) + + * symtab.c (completion_list_add_symbol): restructured to optimize + for time. First clip names that cannot match. Then clip any + names we've already considered. Drop a redundant strncpy. Drop + a redundant malloc and associated free for demangled names. + +Thu Sep 3 09:17:05 1992 Stu Grossman (grossman at cygnus.com) + + * a68v-xdep.c (store_inferior_registers): Define as type void. + * configure.in: Add host m68k-apollo*-bsd*. + * demangle.c (struct demanglers): Use enum instead of constant + value to keep braindamaged HP/Apollo compiler happy. + +Wed Sep 2 20:45:31 1992 Per Bothner (bothner@rtl.cygnus.com) + + * utils.c (strcmp_iw): Add a hack to allow "FOO(ARGS)" to + match "FOO". This allows 'break Foo' to work when Foo is + a mangled C++ function. (See comment before function.) + +Wed Sep 2 13:45:27 1992 John Gilmore (gnu@cygnus.com) + + * config/rs6000.mh (MH_CFLAGS): Circumvent IBM <rpc/rpc.h> bug, + for files in vx-share/*.c. + * xm-rs6000.h (fd_set): Circumvent the rs6000.mh circumvention, + for normal GDB source files. + + * Makefile.in (VERSION): Roll to 4.6.6. + + * tm-vx68.h, tm-es1800.h: Use tm-68k.h rather than tm-sun3.h. + * tm-sun3.h: Remove STACK_END_ADDR, no longer used. + * tm-sun3os4.h: Update comments. + * xm-delta88.h: Remove STACK_END_ADDR. + +Wed Sep 2 01:18:31 1992 John Gilmore (gnu@cygnus.com) + + * Makefile.in (VERSION): Roll to 4.6.5. + + * infrun.c: Lint for recent `handle' changes. + + * ser-termios.c, ser-go32.c: Remove DEFUN crap, clean up. + * serial.h (EXFUN): Remove all uses, convert to PARAMS. + * config/sun4os4.mh: Include ser-termios.o. FIXME, all .mh files + should include a ser-XXX.o module. + + * dbxread.c (elfstab_build_psymtabs): Remove DEFUN crap. + * defs.h, i960-pinsn.c, remote-hms.c: Replace CONST with simple const. + + * configure.in: Map unrecognized sun 68k's, sun sparcs, into + known suns in configure.in, rather than mapping them to unique + config files that happen to duplicate other config files. + * config/sun3.{mh,mt}: Remove (use identical sun3os4.*). + * config/sun4.{mh,mt}: Remove (use identical sun4os4.*). + +Wed Sep 2 00:10:43 1992 John Gilmore (gnu@cygnus.com) + + * configure.in (*-*-sunos*): Use trailing * to match all + sub-variants of SunOS, e.g. sunos4* to match sunos4.1.1. + (sparc-*-sunos3): Remove host & target. Sunos3 never shipped + in production on Sun-4. + ({a29k,i[34]86,i960}-*-elf): Add targets, equivalent to coff. + (m68k-*-{aout,coff,elf}): Add targets, w/new config and tm files. + (sparc-*-{aout,coff,elf}): Add targets, w/new config and tm files. + + * config/m68k-un.mt, config/m68k-noun.mt, config/sparc-un.mt, + config/sparc-noun.mt: New target configs for embedded. + * config/sun4os3.{mh,mt}: Remove, never existed in production. + + * tm-68k-un.h, tm-68k-noun.h, tm-spc-un.h, tm-spc-noun.h: New + target definitions for embedded with and without underlines on + identifiers. + + * tm-sparc.h, tm-sun2.h, tm-sun3.h: Delete NAMES_HAVE_UNDERSCORE: + not a parameter of the CPU, but of the development environment. + * tm-es1800.h, tm-sunos.h, tm-vx68.h: Add NAMES_HAVE_UNDERSCORE. + +Tue Sep 1 17:31:45 1992 John Gilmore (gnu@cygnus.com) + + * breakpoint.c (breakpoint_re_set): Avoid setting source symtab + (which involves reading in main's symtab) if we have no breakpoints. + +Mon Aug 31 13:47:45 1992 Fred Fish (fnf@cygnus.com) + + * dwarfread.c (cu_language): New local variable to record + language for current compilation unit being processed. + * dwarfread.c (set_cu_language): New local function to decode + and record language for current compilation unit being processed. + * dwarfread.c (synthesize_typedef): Add local function to + synthesize a typedef for C++ classes, structs, unions, and + enumerations. + * dwarfread.c (read_structure_scope): Synthesize typedefs + for C++ classes, structs and unions. + * dwarfread.c (read_enumeration): Synthesize typedefs for + C++ enumerations. + * dwarfread.c (read_file_scope): Call set_cu_language to + record language for current compilation unit. After symtab + is built, save this recorded language. + * dwarfread.c (process_dies, add_partial_symbol, struct_type, + scan_partial_symbols, new_symbol): Recognize TAG_class_type. + * dwarfread.c (add_partial_symbol): Synthesize partial symbol + typedefs for C++ classes, structs, unions, and enumerations. + * dwarfread.c (scan_compilation_units): Call set_cu_language + to record language for current compilation unit. + * dwarfread.c (scan_partial_symbols): Call add_enum_psymbol here + for TAG_enumeration_types, rather than in add_partial_symbol. + * dwarfread.c (add_partial_symbol): Combine TAG_enumeration_type + case with class, struct, and union type cases, now that they are + the same. Remove tests for non-NULL name attributes, now done + by callers. + * gdbtypes.h (TYPE_CODE_CLASS): Add type for C++ classes, but + treat as alias for TYPE_CODE_STRUCT for now. + +Sun Aug 30 21:32:17 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: map "gdb" through program_transform_name when + installing. + +Sun Aug 30 21:18:51 1992 Fred Fish (fnf@cygnus.com) + + * {i386-tdep.c, m68k-tdep.c, mips-tdep.c, sparc-tdep.c} + (supply_gregset, fill_gregset, supply_fpregset, fill_fpregset): + Use "regi" for local indexing through register numbers, reserving + "regno" for the name of a specific register passed as an input + parameter. Fix bug propagated through all versions that sometimes + used regno as an index when it should have been regi, thus using + -1 as an index in some cases. + +Sun Aug 30 18:15:17 1992 Per Bothner (bothner@rtl.cygnus.com) + + * cplus-dem.c, demangle.h: Moved to ../libiberty and ../include, + respectively, so same demangler can be used by other programs. + * Makefile.in: Remove demangler stuff. + * Makefile.in (depend): Pass -I../readline (needed for main.c). + * demangle.c (_initialize_demangler): Tell demangler which + CPLUS_MARKER to assume. + +Fri Aug 28 13:13:33 1992 John Gilmore (gnu@cygnus.com) + + RS/6000 portability changes (for hosting cross-debuggers). + + * breakpoint.c (fixup_breakpoints): Re-kludge to IBM6000_TARGET. + * buildsym.c, rs6000-xdep.c, rs6000-tdep.c, tm-rs6000.h, + xcoffexec.c, xcoffread.c: Rename aixcoff to xcoff everywhere. + * printcmd.c (print_frame_args): Remove an RS/6000 dependency. + * stabsread.c (define_symbol): Remove RS/6000 dependencies. + * tm-rs6000.h (ATTACH_DETACH): Remove: host-dependent. + (PTRACE_ATTACH, PTRACE_DETACH): Remove: host-dep. + (NO_SINGLE_STEP): Add, target-dependent. + (loadinfotextindex): Lowercase, remove "aix_". + * xm-rs6000.h: Add <sys/ptrace.h> for infptrace.c. + (NO_SINGLE_STEP): Remove, target-dependent. + * xcoffexec.c (vmap_symtab): Cleanup #if 0'd code. + * xcoffread.c: Only build file if RS/6000 native GDB. + (build_function_symbol): Remove #if 0'd code. + * rs6000-tdep.c: Cleanup. Add static fn protos. + Use CORE_ADDR for addresses throughout. Make void fns void. + (pop_dummy_frame): Add FIXME about bogosity of design here. + (rs6000_struct_return_address): Ditto. + (frameless_function_invocation, frame_get_cache_fsr, + frame_initial_stack_address, xcoff_relocate_symtab, + xcoff_init_loadinfo, free_loadinfo, xcoff_add_toc_to_loadinfo, + add_text_to_loadinfo, find_toc_address): Move from xdep file. + Use CORE_ADDRs. Change identifiers to lowercase. + + * rs6000-xdep.c: Make whole file conditional on native RS/6000, + supplying dummy routines if non-native. Add prototype for + static exec_one_dummy_insn. Move a mess of functions to + rs6000-tdep.c (as above). Remove #if 0'd code. + + * config/rs6000.mh (XDEPFILES): Move xcoffexec.o to target side. + (XM_CLIBS): Add -lm to circumvent AIX 3.2 libc ldexp bug. + * config/rs6000.mt (TDEPFILES): Adopt xcoffexec.o. + + * gdbtypes.h (TYPE_ALLOC): Parenthesize result to avoid problems + for callers. + + * vx-share/README, nindy-share/README: New files describing + how these directories' code is shared, and with whom. + +Thu Aug 27 20:04:56 1992 John Gilmore (gnu@cygnus.com) + + * configure.in (target configurations): Reformat into table. + Remove unsupp. Amigados host and target. Ditto Mach 386 target. + + * tm-altosgas.h, tm-i386v-g.h: Remove ancient coff encap configs. + * config/{altosgas.mt, i386v-g.mt, i386v32-g.mt}: Ditto. + * config/{i386sco.mt,i386v32.mt}: Remove; identical to i386v.mt. + * config/{go32.mt,i960.mt}: Remove; they only printed error msgs. + * config/nindy960.mt: Remove useless MT_CFLAGS setting. + * config/i386aout.mt: Use tm-i386v.h, not tm-i386v-g.h. + + * Makefile.in (config-check): Add command to check whether + configure.in is consistent with config/*. + +Wed Aug 26 21:10:52 1992 John Gilmore (gnu@cygnus.com) + + * configure.in (host configurations): Reformat nested cases into + easy-to-maintain table. + (m68k-altos-*, i386v*): We don't care whether coff encap is used. + config/{altosgas.mh, i386v-g.mh, i386v32-g.mh}: Remove. + +Wed Aug 26 16:02:01 1992 Fred Fish (fnf@cygnus.com) + + * cplus-dem.c: Reorder args to most local functions to make them + follow the consistent pattern of struct work_stuff pointer first, + followed by pointer into string being demangled, followed by + pointer to the string where the result is being stored, followed + by other args. Also generally replace most variables of name + "type" with "mangled" for consistency. They all pointed to the + same string but half were one name and half the other. + * cplus-dem.c (LONGERNAMES): Remove #ifndef's. + * cplus-dem.c (demangle_qualified): Rewrite to clean up and allow + use whenever a qualified name is being demangled. + * cplus-dem.c (do_type): Qualified names are treated similarly + to fundamental types, not as modifiers of fundamental types. + +Mon Aug 24 20:44:38 1992 Stu Grossman (grossman at cygnus.com) + + * configure.in: Add sparclite as a target. + + * sparc-stub.c (handle_exception): Flush instruction cache just + before returning to the user. (hexToInt): Fix overzealous cleanup. + +Mon Aug 24 11:57:13 1992 Fred Fish (fnf@cygnus.com) + + * infrun.c (handle_command): Rewrite to allow multiple signal + numbers, signal number ranges, and to recognize "all" to mean all + signals except those used by the debugger. + * infrun.c (SET_SIGS, UNSET_SIGS): Macros used in handle_command + to set or reset actions for specific signals. + +Sun Aug 23 17:10:07 1992 Fred Fish (fnf@cygnus.com) + + * coffread.c (decode_type): Call alloc_type to alloc new + types. + * stabsread.c (read_array_type, read_range_type, define_symbol): + Call alloc_type to alloc new types. + * stabsread.c (define_symbol): Move dbl_valu symbol field data + from type_obstack to symbol_obstack. + * stabsread.c (define_symbol): Move typedef_sym from type_obstack + to symbol_obstack. + * gdbtypes.h (TYPE_ALLOC): New macro to allocate space for data + associated with a type, using the same mechanism as was used to + allocate space for the type structure itself. + * coffread.c (patch_type, coff_read_struct_type, + coff_read_enum_type): Use TYPE_ALLOC. + * dwarfread.c (struct_type): Use TYPE_ALLOC. + * gdbtypes.c (create_array_type, check_stub_method, + allocate_cplus_struct_type): Use TYPE_ALLOC. + * mipsread.c (parse_symbol, parse_type): Use TYPE_ALLOC. + * stabsread.c (read_struct_type, read_array_type, read_enum_type, + read_range_type): Use TYPE_ALLOC. + +Sun Aug 23 11:04:08 1992 Fred Fish (fnf@cygnus.com) + + * breakpoint.c (breakpoint_re_set): Select a default source + symtab if one is not currently selected. + * utils.c (query): Call wrap_here before building the output + query string, to turn off wrapping and flush any buffered output. + Otherwise our query may end up in the wrap buffer and never be + seen by the user. + * eval.c (evaluate_subexp): Report error when attempting to + evaluate subscript for types without a target type, rather + than dumping core by using the NULL pointer. + * symfile.c (symbol_file_command): Forget current_source_symtab + and current_source_line when discarding symbol table. + +Sat Aug 22 22:33:20 1992 John Gilmore (gnu@cygnus.com) + + Bug fixes from Andrew Heybey <ath@lcs.mit.edu>. + + * tm-mips.h (REGISTER_VIRTUAL_TYPE): Float regs are float type. + * mips-tdep.c (mips_print_register): Alloc enough space for two regs. + +Fri Aug 21 15:17:03 1992 Stu Grossman (grossman at cygnus.com) + + * remote.c (remote_open): Fix baud rate setting to make -b flag + work. (remote_wait): Change 'T' message parser to deal with new + improved format which allows stub to send an arbitrary bunch of + registers. + * sparc-stub.c: General cleanups. (trap_low, handle_exception): + make all this re-entrant by storing all state on the stack. Clean + up memory error trapping. (computeSignal, set_debug_traps): + make it all table driven. Make a start at a baud rate setting command. + +Wed Aug 19 10:23:27 1992 Ian Lance Taylor (ian@cygnus.com) + + * m68k-pinsn.c: handle new operand type 'r', introduced for cas2. + + * remote-vx.c: redefine malloc to avoid buggy declaration on + RS/6000 <rpc/types.h>. + xm-rs6000.h: include <sys/select.h> to define fd_set for + <rpc/svc.h> on RS/6000. + +Tue Aug 18 14:48:24 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: added FLAGS_TO_PASS variable, and passed it to + recursive invocations of make. Always create installation + directories. + +Mon Aug 17 18:29:58 1992 Per Bothner (bothner@rtl.cygnus.com) + + * m68k-pinsn.c: Minor fix in style of output (don't use + range to indicate floating point control registers). + +Sat Aug 15 02:58:03 1992 John Gilmore (gnu@cygnus.com) + + * m68k-pinsn.c: Surround extended support with #ifdef HAVE_68881. + + * infcmd.c (registers_info): Handle multiple register names. + Changes inspired by Roland McGrath. + +Sat Aug 15 02:28:52 1992 Stu Grossman (grossman at cygnus.com) + + * sparc-stub.c: New file. Mix it with your SPARClite + application, and it will speak GDB remote protocol! + * remote.c (remote_wait): Change 'T' (expedited reply) message to + deal with arbitrary registers. Needed for sparc-stub. + +Fri Aug 14 12:11:25 1992 Fred Fish (fnf@cygnus.com) + + * cplus-dem.c (cplus_markers): Add table for gnu style and + use throughout, in place of compile time constant CPLUS_MARKER. + * cplus-dem.c (ARM_VTABLE_STRING, ARM_VTABLE_STRLEN): Add. + * cplus-dem.c (cfront_special): New function, as suggested + by pfieland@stratus.com. + * cplus-dem.c (forget_types): New function. + * cplus-dem.c (cplus_demangle): Call gnu_special, moved from + demangle_prefix(). + * cplus-dem.c (mop_up): Call forget_types(). + * cplus-dem.c (AUTO_DEMANGLING, GNU_DEMANGLING, LUCID_DEMANGLING): + Use throughout, instead of checking current_demangling_style. + * cplus-dem.c (demangle_signature): When finding an explicit + start of function args, forget all remembered types for + lucid/cfront style demangling. + * cplus-dem.c (demangle_prefix): In a sequence of two or more + underbar characters, use last pair as the delimiter. Hoist + gnu_special() call up to cplus_demangle(). Call cfront_special() + when appropriate. + * cplus-dem.c (cplus_special): Fix virtual table name demangling + for inherited classes. + * cplus-dem.c (demangle_args): Document quirks of numbered + references to previously seen types. + * dbxread.c (read_ofile_symtab, process_one_symbol): + Use AUTO_DEMANGLING rather than explicitly checking + current_demangling_style. + * demangle.h: Add some comments. + * demangle.h (AUTO_DEMANGLING, GNU_DEMANGLING, LUCID_DEMANGLING, + CFRONT_DEMANGLING): New macros. + * dwarfread.c (LCC_PRODUCER): Remove trailing space, which is + not found in the actual producer string produced by lcc. + * dwarfread.c (handle_producer): Use AUTO_DEMANGLING rather + than explicitly checking current_demangling_style. + +Thu Aug 13 11:54:46 1992 John Gilmore (gnu at cygnus.com) + + * breakpoint.c (enable_longjmp_breakpoint, + disable_longjmp_breakpoint, set_longjmp_resume_breakpoint): + Check for duplicate breakpoints at the same address. Bug report + and preliminary fix from Dave Morrison, <drmorris@us.oracle.com>. + +Wed Aug 12 11:14:58 1992 Fred Fish (fnf@cygnus.com) + + * buildsym.c (end_symtab): Document that end_symtab can return + NULL under non-error conditions. + * dwarfread.c (read_file_scope): Guard against dereferencing NULL + returned from end_symtab for empty compilation units. + +Tue Aug 11 02:49:39 1992 John Gilmore (gnu at cygnus.com) + + * am29k-tdep.c: Lint from DECstation compiler. + * mem-break.c: Restore test of BREAKPOINT size that Fred removed. + As the man page says, "Sometimes you just can't get lint to shut + up". That doesn't mean you should blow away the code it won't + shut up about. + * mips-xdep.c: Revise stubbing-out of code until Rich cleans + it up over the next few weeks. Make mips x 29k build. + * tm-29k.h (CALL_DUMMY): Make it work on cross-endian hosts. + (FIX_CALL_DUMMY): Comment in the patching of the breakpoint, + but leave it as a comment because the breakpoint instruction + is not easily accessible at this moment (it's static, and if + we define one here, it goes into every file compiled). + +Mon Aug 10 22:27:19 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (VERSION): Bump to 4.6.3. + * dwarfread.c (scan_partial_symbols): Skip over DIE's within + function scopes when building partial symbol tables. + * objfiles.c (open_existing_mapped_file): Make it clear in + warning message that out of date mapped files are ignored. + * symtab.c (lookup_symtab_1, lookup_symbol): Print compilation + unit source file name in error message. + +Sat Aug 8 23:12:22 1992 Fred Fish (fnf@cygnus.com) + + * dwarfread.c (struct dieinfo): Add has_at_byte_size. + * dwarfread.c (struct_type): In absence of AT_byte_size for + bitfield, use size of object of member's type for the size of + the anonymous object containing the bit field. + * dwarfread.c (completedieinfo): Set has_at_byte_size when + an AT_byte_size attribute is seen. + * mipsread.c (psymtab_to_symtab_1): Fix misspelled cast to + union aux_ext (was aux_ent). + * i386-pinsn.c (print_insn): Cast 2'nd arg to read_memory from + unsigned char* to char*, for Lucid compiler. + * i386-tdep.c (codestream_fill): Fix cast of 2'nd arg to read_memory + to be correct type (from unsigned char* to char*). + * valprint.c (type_print_derivation_info): Minor tweak to placement + of commas in derived class printing. + * xcoffread.c (builtin_type): Fix misspelling in fatal message. + +Fri Aug 7 11:18:23 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * xm-go32.h: Define LSEEK_NOT_LINEAR + * source.c (find_source_lines): if LSEEK_NOT_LINEAR is defined + then work out the lseek positions of newlines by running through + the file and `tell'ing. This makes source file listing work on + OS's where the relationship between physical position in file and + canonical position is indeterminate, eg VMS and DOS. + +Thu Aug 6 10:56:01 1992 Fred Fish (fnf@cygnus.com) + + * stabsread.c: Ensure that all members of all allocated structures + are initialized to known state to avoid hard to find bugs with gdb + using fields containing random data. + * buildsym.c (start_subfile): Compact dirname initialization. + * buildsym.c (patch_subfile_names): New function. + * buildsym.c (end_symtab): Make copy of dirname on symbol obstack. + * buildsym.c (end_symtab): Free all malloc'd subfile fields. + * buildsym.h (patch_subfile_names): Add prototype. + * dbxread.c (process_one_symbol): Call patch_subfile_names. + +Wed Aug 5 01:42:40 1992 John Gilmore (gnu at cygnus.com) + + * remote-udi.c: Update comments. + + * remote.c (getpkt): Only force retransmission ten times; + after that, assume bug in target code, and handle pkt anyway. + +Mon Aug 3 17:06:20 1992 Stu Grossman (grossman at cygnus.com) + + * configure.in: Add support for apollo 68k under BSD environment. + * xm-apollo68b.h: New file to support above. + +Mon Aug 3 00:25:56 1992 Fred Fish (fnf@cygnus.com) + + * configure.in: Recognize i486 host cpu. + * valprint.c (type_print_derivation_info): Print derivation info + in same form as class declarations in source. + * valprint.c (type_print_varspec_suffix): Split arg printing + code out to type_print_args function. + +Sat Aug 1 13:32:58 1992 Fred Fish (fnf@cygnus.com) + + * dwarfread.c (struct dieinfo): Remove obsolete at_visibility, + at_import, at_frame_base. + * dwarfread.c (completedieinfo): Remove cases for obsolete + AT_visibility, AT_import, and AT_frame_base attributes. + * breakpoint.h (BREAKPOINT_MAX): Increase from 10 to 16 for + i860, which can keep up to 4 shadow breakpoints. + * tm-stratus.h (USG): Define. + * tm-stratus.h (TARGET_BYTE_ORDER): Define to BIG_ENDIAN. + * xm-stratus.h (HOST_BYTE_ORDER): Define to BIG_ENDIAN. + * xm-stratus.h (xm-sysv4.h): Include, name changed from xm-svr4.h. + * xm-stratus.h (NO_JOB_CONTROL): Remove define. + * config/stratus.mt (TDEPFILES): Include files available from + stratus that are not yet in release pending receipt of paperwork + at FSF. + * buildsym.c (finish_block): Minor code format change. + * gdbtypes.h (struct field): Add to comments. + * gdbtypes.h (virtual_field_bits): Add to comments. + * objfiles.c (allocate_objfile): Change obstack interface to + match FSF merging efforts. + +Mon Jul 27 21:14:44 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (VERSION): Bump to 4.6.2. + * Makefile.in (SFILES_MAINDIR): Add stabsread.c + * Makefile.in (OBS): Add stabsread.o + * Makefile.in (stabsread.o): Add build rule. + * stabsread.c, stabsread.h: New files. + * buildsym.c: Split out stabs specific support to stabsread.c. + * buildsym.h: Split out stabs specific support to stabsread.h. + * dbxread.c (stabsread.h): Include + * dbxread.c (dbx_new_init): Call stabsread_new_init. + * dbxread.c (dbx_psymtab_to_symtab_1): Call stabsread_init. + * dbxread.c (read_ofile_symtab): Call end_stabs. + * dbxread.c (process_one_symbol): Call end_stabs and start_stabs. + * dbxread.c (elfstab_build_psymtabs): Call stabsread_new_init. + * dwarfread.c (psymtab_to_symtab_1): Call buildsym_init, add + really_free_pendings to cleanups. + * elfread.c (elf_new_init): Call stabsread_new_init. + * gdbtypes.c: Small changes to maintenance commands. + * mipsread.c (stabsread.h): Include. + * mipsread.c (psymtab_to_symtab_1): Call end_stabs. + * xcoffread.c (stabsread.h): Include. + * xcoffread.c (global_stabs): Remove redundant def. + * xcoffread.c (read_xcoff_symtab): Call start_stabs and end_stabs. + +Wed Jul 22 21:39:33 1992 Fred Fish (fnf@cygnus.com) + + * lmode_inferior_valid, lmode_ours_valid: New static vars. + * inflow.c (terminal_init_inferior, terminal_inferior, + terminal_ours_1, initialize_inflow): Record and use state + of lmode_inferior_valid and lmode_ours_valid. + +Wed Jul 22 04:23:03 1992 D. V. Henkel-Wallace (gumby@cygnus.com) + + * es1800.c: use FREAD|FWRITE rather than _FREAD|_FWRITE. + include <sgtty.h> on USG. (from sef). + + * depend: es1800 dependency needed here. + +Mon Jul 20 21:09:53 1992 Fred Fish (fnf@cygnus.com) + + * buildsym.c (read_struct_type): Initialize structs allocated + with alloca, to avoid using random values from stack later on. + * defs.h (fprintf_filtered): Add prototype. + * gdbtypes.c (check_stub_method): Fix misleading comments. + * gdbtypes.c (print_arg_types, dump_fn_fieldlists): New maint + support functions. + * gdbtypes.c (print_cplus_stuff, recursive_dump_type): Many + small changes to maint support functions. + * gdbtypes.h (cplus_struct_type): Reorganize member ordering + for some fields and expand comments. + * objfiles.c (allocate_objfile): Use new obstack_alloc_arg + macro and track change to obstack_full_begin macro. + * utils.c (fprintfi_filtered): New function. + * valprint.c (type_print_base): Fixup field printing to not + print extraneous lines and not print bogus "no data fields" + messages for C++ classes with no data members. Also use new + fprintfi_filtered function. + +Mon Jul 20 11:25:18 1992 D. V. Henkel-Wallace (gumby@cygnus.com) + + * configure.in: es1800 ok for 68000 too. + +Sat Jul 18 15:48:58 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: echo error messages to stderr, not stdout + +Fri Jul 17 17:07:24 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: recognize hppa* instead of hppa + +Fri Jul 17 16:52:04 1992 Stu Grossman (grossman at cygnus.com) + + * energize.c: Second cut at DynamicLoad message handling. + + * energize.c: Relativize pathnames in #include statements. + * (kernel_dispatch): Better error messages for unknown protocol + messages. + * (kernel_dispatch): First cut at DynamicLoad message handling. + + * Makefile.in: Remove -I../readline from all compilations, + include a special case for main.o instead. + +Fri Jul 17 10:14:56 1992 Fred Fish (fnf@cygnus.com) + + * eval.c (evaluate_subexp): Ask lookup_struct_elt_type to call + error if it fails to find a member type, rather than return NULL + and trigger a coredump. + * symtab.c (lookup_symbol, lookup_demangled_block_symbol, + lookup_demangled_partial_symbol,): Ask demangle_and_match to + match on complete demanglings, including argument lists for member + functions, rather than just accepting the first demangling that + matches the class and function name. + * dwarfread.c (read_file_scope): Pass contents of AT_comp_dir + to start_symtab as the directory name. + * dwarfread.c (completedieinfo): Strip off any leading hostname + portion of the AT_comp_dir attribute string. Gdb doesn't know + what to do with them (FIXME). + +Thu Jul 16 13:37:09 1992 Stu Grossman (grossman at cygnus.com) + + * breakpoint.c (commands_command): Simplify code a bit, remove + unnecessary fflush(). + + * Makefile.in (OTHERS): Add gcc.patch. + * partial-stab.h (N_SO): Fix handling of redundant SOs (again...) + +Thu Jul 16 12:07:40 1992 Fred Fish (fnf@cygnus.com) + + * dwarfread.c (LCC_PRODUCER): Change to match current NCR + lcc producer string. + +Thu Jul 16 11:40:55 1992 Stu Grossman (grossman at cygnus.com) + + * WHATS.NEW renamed to NEWS. + +Wed Jul 15 11:37:31 1992 Fred Fish (fnf@cygnus.com) + + * dbxread.c, dwarfread.c: Re-enable experimental code to + automatically select demangling style. + * demangle.c (DEFAULT_DEMANGLING_STYLE): Rename from simply + DEMANGLING_STYLE, to make more descriptive. Revert back to + "auto" as default. Comment use. + * Makefile.in (DEMANGLING_STYLE, DEMANGLE_OPTS): Remove. + * Makefile.in (${DEMANGLER}.o) Remove target and special + compilation rule. + +Tue Jul 14 23:05:14 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (VERSION): Bump to 4.6.1 (post-release versions). + +Tue Jul 14 19:26:54 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in, demangle.c: Change default demangling style to + gnu. + * Makefile.in: Update version to 4.6 !!! + * README, WHATS.NEW: Update for 4.6. + +Tue Jul 14 16:59:46 1992 Ken Raeburn (raeburn@cygnus.com) + + * i960-tdep.c (frame_args_address): If arg pointer can't be found, + use frame address. + + * buildsym.c (read_struct_type): Don't die on TYPE_CODE_UNDEF + nodes as base classes. + +Tue Jul 14 00:12:30 1992 Stu Grossman (grossman at cygnus.com) + + * alldeps.mak, depend: Update. + + * xcoffread.c: Add decl for section_offset to keep prototype happy. + + * Makefile.in (VERSION): 4.5.9. + + * xm-hp300bsd.h: Add decl for strdup(). + * mips-tdep.c (heuristic_proc_desc): Fill in proc start addr in + PDR. Cleanup a few things, fix compilation warnings. + +Mon Jul 13 19:06:54 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (DEMANGLING_STYLE): New define to set default + demangling style for C++. Defaults to "auto". + * Makefile.in (DEMANGLE_OPTS): Use DEMANGLING_STYLE. + * Makefile.in (SFILES_MAINDIR): Add demangle.c + * Makefile.in (OBS): Add demangle.o + * cplus-dem.c (GNU_DEMANGLING, ARM_DEMANGLING, LUCID_DEMANGLING): + Remove compile time decisions about demangling style and replace + with runtime decisions using current_demangling_style. + * cplus-dem.c (main): Expand code included during building of + standalone demangler to recognize demangling style options. + * dbxread.c (demangle.h): Include. + * dbxread.c (read_ofile_symtab, process_one_symbol): Set GNU C++ + demangling style if processing g++ code and current demangling style + is auto (Note: this feature currently disabled.) + * demangle.c: New file, generic demangling control. + * demangle.h (demangling_styles): New enumeration to select one + of several demangling styles. Also define string names for each + style. + * demangle.h (set_demangling_style): Add prototype. + * dwarfread.c (demangle.h): Include. + * dwarfread.c (GPLUS_PRODUCER, LCC_PRODUCER, CFRONT_PRODUCER): + New producer string prefixes to recognize. + * dwarfread.c (handle_producer): Consolidate actions for specific + producers. Set demangling style based on producer string if + current style is auto. (Note: this feature currently disabled.) + * config/ncr3000.mt (DEMANGLE_OPTS): Remove. + +Sat Jul 11 18:23:58 1992 John Gilmore (gnu at cygnus.com) + + * config/sun4sol2.mh: Remove -xs flag, default INSTALL to cp. + +Fri Jul 10 13:58:34 1992 Per Bothner (bothner@rtl.cygnus.com) + + * gdbtypes.c, gdbtypes.h: New function lookup_signed_typename. + * c-exp.y: Call lookup_signed_typename() after seeing + "signed". This handles "signed char" correctly. + * c-exp.y: Recognize (but ignore) 'const' and 'volatile' + keywords before a type specifier. + +Fri Jul 10 10:19:52 1992 Fred Fish (fnf@cygnus.com) + + * command.c (lookup_cmd_1): Clarify descriptive comments. + * gdbcmd.h (maintenanceprintlist): Add declaration. + * main.c (maintenanceprintlist): Add definition. + * main.c (gdb_completer_command_word_break_characters): Add. + * main.c (symbol_completion_function): Switch completer word + break character sets dynamically, based on whether completion is + being done on commands or on something else. + * main.c (initialize_cmd_lists): Init maintenanceprintlist. + * maint.c: Include demangle.h. + * maint.c (maintenance_demangle): New function. + * maint.c (maintenance_print_command): New function. + * maint.c (_initialize_maint_cmds): Reorganize some commands + under new maintenance print subcommand. + +Thu Jul 9 19:05:27 1992 Per Bothner (bothner@rtl.cygnus.com) + + * gdbtypes.c (lookup_struct_elt_type): If the input type is + TYPE_CODE_PTR or TYPE_CODE_REF, dereference it to get the + target type. Otherwise, 'whatis this.field' wouldn't work, + which would be inconsistent, since 'print this.field' works. + * buildsym.c (read_struct_type, read_enum_type): Clear + TYPE_FLAG_STUB flag. + * buildsym.c (cleanup_undefined_types): Don't rely on a + flawed "Reasonable test to see if" a type has been defined + since it was referred to; now we can just see if the + TYPE_FLAG_STUB flag has been cleared. + * valprint.c (print_type_base): Emit public/protected/private + labels for methods as well as fields. Also, indent these labels + 2 spaces instead of 4, for a more conventional "look". + * symtab.c (gdb_mangle_name): Undo Fred's change, unless + GCC_MANGLE_BUG is defined. Also, handle destructors specially. + * gcc.patch: New file. Contains patch for gcc (so people + with gdb-2.2.x won't have to wait for a new gcc release). + +Thu Jul 9 18:44:26 1992 Ken Raeburn (raeburn@cygnus.com) + + * i960-pinsn.c (mem): Variables reg[123] should point to CONST. + (print_addr): Call print_address to show symbolic version as well. + + * remote-vx.c (vx_kill): Don't look for arguments; they aren't + being passed. + (vx_read_register): Declare inferior_fp_regs. Delete code for + copying "inferior_registers" around; the values are already in var + "registers". Use correct size for register set. + + * remote-vx.c (vx_write_register): Don't try writing FP regs; the + target doesn't support it. + (vx_read_register): Don't try reading them either. + + * tm-i960.h (IP_REGNUM): Move to end of non-FP list, since the + VxWorks back end reads them in one contiguous set except for this + one. + (register_names): Change "pc" to "pcw" to avoid confusion printing + "$pc". + * tm-vx960.h (PC_REGNUM): Use RIP_REGNUM, since that's where we + find the PC under VxWorks. + +Wed Jul 8 21:34:30 1992 Fred Fish (fnf@cygnus.com) + + * dwarfread.c (alloc_utype, decode_subscr_data): Call alloc_type + to create new blank types, instead of handcrafting them. + * defs.h (printfi_filtered): Add prototype. + * utils.c (printfi_filtered): New function. + * gdbtypes.c (recursive_dump_type): Use printfi_filtered to + to simplify the code. Other cleanups. + * gdbtypes.c (check_stub_method): Demangle using DMGL_ANSI. + * gdbtypes.h (struct cplus_struct_type): Add comments describing + use of various fields. + * gdbtypes.c (print_bit_vector, print_cplus_stuff): New functions. + * c-exp.y (%token): Add CLASS as a token for C++, add grammar + production that currently treats it exactly the same as STRUCT. + * c-exp.y (yylex): Recognize "class" as token CLASS. + * symtab.c (gdb_mangle_name): Rewrite to match current g++ stabs. + * symtab.c (decode_line_1): Fix to pass quoted args on down to + general symbol handling code. Call cplus_mangle_opname with + DMGL_ANSI. + * symtab.c (decode_line_2): Print demangled function names in + breakpoint menus, instead of just file and line number. + * symtab.c (name_match): Call cplus_demangle with DMGL_ANSI. + * valprint.c (type_print_base): Print "class" for C++ classes, + rather than "struct". Print section labels for public, protected + and private members of C++ classes. + * values.c: Include demangle.h. + * values.c (value_headof): Call cplus_demangle with DMGL_ANSI. + +Wed Jul 8 17:23:07 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (VERSION): Update to 4.5.8. + + Wed Jul 8 00:11:02 1992 Stu Grossman (grossman at cygnus.com) + + * dbxread.c (dbx_symfile_init): Init stab_section_info to NULL to + prevent crashes when examining cross-targets. + * dbxread.c (process_one_symbol): Include directory name when + calling start_subfile for SOL & BINCL symbols. This allows gdb to + find include files, and yacc/lex sources when the cwd doesn't match + that in which the object was compiled. + * objfiles.h (ALL_MSYMBOLS): Don't seg fault when there are no + msymbols. + * symtab.c (lookup_symtab_1): Rewrite. It now handles include + files. + +Tue Jul 7 09:00:42 1992 Fred Fish (fnf@cygnus.com) + + * maint.c (maintenance_command, maintenance_info_command): + Install with allow_unknown as 0 and call help_list to show + list of possibilities when no subcommand is specified. + +Tue Jul 7 00:20:29 1992 Fred Fish (fnf@cygnus.com) + + * configure.in: Add m68k-ericsson-*. + * remote-es1800.c, tm-es1800.h, config/es1800.mt: New files. + +Sun Jul 5 17:17:16 1992 Fred Fish (fnf@cygnus.com) + + * maint.c: New file. + * Makefile.in (SFILES_MAINDIR): Add new file maint.c. + * Makefile.in (OBS): Add new file maint.o. + * defs.h (command_class): Add class_maintenance. + * defs.h (MAINTENANCE_CMDS): Default to including maintenance + commands. Allow for them (and other nonessential parts of gdb) + to be selectively left out under special circumstances. + * gdbtypes.c (recursive_dump_type): New function; supports + maintenance print-type command. + * gdbtypes.h (recursive_dump_type, maintenance_print_type): + Add prototypes. + * main.c (maintenancelist, maintenanceinfolist): Add maintenance + command lists. + * main.c (initialize_cmd_lists): Eliminate unnecessary casts on + initializers. Add initializations for setprintlist, showprintlist, + setchecklist, showchecklist, maintenancelist, and maintenanceinfolist. + * printcmd.c (maintenance_print_type): New maintenance cmd. + * valprint.c (setprintlist, showprintlist): Move to main.c, as + implied by comment that all cmd lists are owned by main.c. + * infcmd.c (unsetlist): Move to main.c, as implied by comment + that all cmd lists are owned by main.c. + * language.c (setchecklist, showchecklist): Move to main.c, as + implied by comment that all cmd lists are owned by main.c + * breakpoint.c (enablelist, enablebreaklist, disablelist, cmdlist, + deletelist): Remove redundant declarations (also in gdbcmd.h). + * symmisc.c (printsyms_command): Now maintenance_print_symbols. + * symmisc.c (printmsyms_command): Now maintenance_print_msymbols. + * symmisc.c (printpsyms_command): Now maintenance_print_psymbols. + * symmisc.c (printobjfiles_command): Now maintenance_print_objfiles. + * symtab.h (maintenance_print_symbols, maintenance_print_psymbols, + maintenance_print_msymbols, maintenance_print_objfiles): + Add prototypes. + * symmisc.c (printsyms_command, printpsyms_command, + printmsyms_command, printobjfiles_command): Removed from + _initialize_symmisc. + * main.c (dump_me_command): Moved to maint.c and renamed to + maintenance_dump_me. + * breakpoint.c (all_breakpoints_info): Rename to + maintenance_info_breakpoints. + * breakpoint.c (_initialize_breakpoint): Convert add_info of + all_breakpoints_info to add maintenance_info_breakpoints to the + maintenanceinfolist instead. + main.c (initialize_main): Set up maintenance class commands. + +Sun Jul 5 11:03:53 1992 Stu Grossman (grossman at cygnus.com) + + * energize-patches: Fix minor problems with building energize lib. + + * energize-patches: Change names of all cadillac procedure calls + to be energize procedure calls. Simplify many hooks by moving + tests energize.c. Configure energize, and build it automatically now. + +Sun Jul 5 09:43:28 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (VERSION): Bump to 4.5.7. + * cplus-dem.c (demangle_args): Validate index for previously + seen type to guard against bogus values from malformed manglings. + * valops.c (value_struct_elt_for_reference): Guard against + blindly using NULL return value from lookup_symbol. + +Sun Jul 5 09:46:43 1992 Stu Grossman (grossman at cygnus.com) + + * cadillac.c, cadillac-patches: Rename to energize.c and + energize-patches. Change all routines and variables named + 'cadillac*' to 'energize*'. Create new file called energize.h to + hold all interface declarations. + + * deblib/connection/*: Move all of this stuff into energize/, but + delete unneeded files. + +Sun Jul 5 03:06:39 1992 John Gilmore (gnu at cygnus.com) + + * tm-sysv4.h (NAMES_HAVE_UNDERSCORE): SVR4 systems don't. + + * buildsym.c (finish_block): Fix thinko `inner block' complaints. + * dbxread.c (process_one_symbol): Parse N_OPT "gcc2_compiled.". + * procfs.c (proc_set_exec_trap): Set run-on-last-close flag on + child processes, to avoid dead ones "hanging around" after GDB exits. + (attach): Always stop the process if it needs it. Set RLC flag + when attaching running processes, so it will continue if we detach + it, quit, or are killed. + (detach): Clear faults and set RLC flag to make process run + when we close it. + (open_proc_file): New `mode' argument for O_RDONLY or O_RDWR. + Callers changed. + (info_proc): Open process O_RDONLY, so we can see any process, + even those controlled by debuggers. + * tm-sun4sol2.h (SUN_FIXED_LBRAC_BUG): They did (in Sol 2). + +Sat Jul 4 03:43:38 1992 John Gilmore (gnu at cygnus.com) + + Relocate symbols using an array of section_offsets, rather than a + single `addr' or `offset'. This makes Solaris-2 support work, and + permits better VxWorks (and maybe xcoff) support later. + + * symtab.h (struct section_offsets): New structure for keeping + a set of offsets, rather than a single one. + (struct objfile): Replace addr with section_offsets member. + * symfile.h: Add sym_offsets to struct sym_fns. Conforming changes. + * gdb-stabs.h: New include file with `symbol type specific' + parameters for psymtabs and objfiles. + * Makefile.in (HFILES): Add gdb-stabs.h. + * buildsym.h (start_psymtab, process_one_symbol): Fix prototypes. + * coffread.c: Conforming changes. Fake offset array always 0. + * dbxread.c: Conforming changes. + (struct dbx_symfile_info): Move to gdb-stabs.h. + (start_psymtab): Call elfstab_offset_sections to calculate good + offsets for this source file, based on the ELF symbol table info. + (read_ofile_symtab): Yank N_CATCH, which is dead. + (process_one_symbol, N_CATCH): Yank. + (", N_FUN, N_FNAME, N_FN, N_FN_SEQ, N_SO, N_SOL, N_ENTRY): + Relocate with SECT_OFF_TEXT. + (", N_STSYM, N_LCSYM, N_ROSYM): Grope around in the stab string + to distinguish relocatable from absolute symbols. Then, if not + absolute, do: + (", N_STSYM, N_DSLINE): SECT_OFF_DATA. + (", N_LCSYM, N_BSLINE): SECT_OFF_BSS. + (", N_ROSYM): SECT_OFF_RODATA. + (elfstab_build_psymtabs): Caller has allocated dbx_symfile_info. + (dbx_symfile_offsets): Add to translate addr to offset. + * dwarfread.c: Conforming changes. Single offset currently used. + * elfread.c: Add various complaints about elf/stab stuff. + #include gdb-stabs.h. Conforming changes, using a single offset. + (elf_symtab_read): Record info from BSF_FILE symbols, and local + variables called "Bbss.bss", "Ddata.data", and "Drodata.rodata", + for later use in building psymtabs. + (elf_symfile_read): Allocate dbx_symfile_info here, to keep + the info collected in elf_symtab_read. Cleanup calls free_elfinfo. + (free_elfinfo): New fn, frees all chained stab_section_infos + in an objfile, and zaps the start-of-chain pointer. + (elfstab_offset_sections): New fn, looks in stab_section_info + chain to determine section bases to relocate a psymtab's worth + of symbols, as they are being read. + * mipsread.c: Conforming changes. Stabs-reading will relocate + using one offset. MIPS-reading will not relocate at all. + * partial-stab.h: Relocate different symbol types using different + offsets from section_offsets. + * symfile.c: Conforming changes. + (find_lowest_section): Unused function to use later + to free us from the Tyranny of the Text Section. + (syms_from_objfile): Translate absolute arg ADDR to offsets used + in all lower layers of symbol reading. Call format-specific + sym_offsets function to initialize offsets for high speed symbol + reading. + (symbol_file_add): Call reinit_frame_cache so callers don't have to. + (symbol_file_command, add_symbol_file_command): Callers changed. + * symmisc.c (dump_psymtab): Print new relocation parameters. + * xcoffread.c: Corresponding changes. + + * buildsym.c: Tidy innerblock_complaint and blockvector_complaint. + * main.c (main): Read the $HOME/.gdbinit file before processing + the argv arguments (e.g. reading symbol files or core + files). This allows global parameters to be set, which will apply + during the symbol reading. The ./.gdbinit is still read after + argv processing. + * symtab.c (list_symbols): `i variables' shouldn't show enum values. + * xcoffexec.c: Clean up quote inside comment. + +Fri Jul 3 20:18:26 1992 Fred Fish (fnf@cygnus.com) + + * breakpoint.c, buildsym.c, c-exp.y, coffread.c, command.c, + core.c, cplus-dem.c, dbxread.c, dwarfread.c, elfread.c, environ.c, + eval.c, findvar.c, gdbtypes.c, hppabsd-tdep.c, hppahpux-tdep.c, + i386-tdep.c, ieee-float.c, infcmd.c, inflow.c, infptrace.c, + infrun.c, m2-exp.y, mipsread.c, objfiles.c, parse.c, procfs.c, + putenv.c, remote-mm.c, remote-vx.c, solib.c, sparc-tdep.c, + sparc-xdep.c, stack.c, symfile.c, symtab.c, symtab.h, target.c, + tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c, + values.c, xcoffread.c: + Remove "(void)" casts from function calls where the return value + is ignored, in accordance with GNU coding standards. + +Fri Jul 3 00:00:49 1992 John Gilmore (gnu at cygnus.com) + + * dbxread.c (process_one_symbol): Ignore N_MAIN, N_ENDM for Solaris. + * partial-stab.h: Ignore N_ENDM. + * elfread.c (elf_symtab_read): Ignore symbols that don't have a + CODE or DATA section attachment. This eliminates a lot of random + values from shared libraries, which screw up the ordinary symbols + in the address ranges they happen to overlap. + * buildsym.c (define_symbol): Eliminate special tests + for function types; move into "function" cases in switch statement. + (define_symbol: 'f', 'F', 'P'): Process all parameter types + in case they define new type numbers. But ignore them (FIXME). + ('k', 'B'): Ignore const and volatile if we see them (FIXME). + (read_sun_builtin_type): Add commentary. + +Wed Jul 1 00:47:02 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * xm-rs6000.h: define MEM_FNS_DECLARED + +Tue Jun 30 02:25:10 1992 John Gilmore (gnu at cygnus.com) + + * tm-mips.h (GDB_TARGET_IS_MIPS): Define for mips-xdep.c. + (READ_MIPS_FORMAT, COFF_FORMAT): Remove, unused now. + * mips-xdep.c: Remove most include files (unused, caused errs). + (fetch_core_registers): Use right parameters in dummy fn. + +Mon Jun 29 18:30:57 1992 John Gilmore (gnu at cygnus.com) + + * buildsym.c (scan_file_globals): Beware the null file. + Fix from Jim Williams. + + * stack.c (return_command): Evaluate expression *before* popping + off the stack frames! Fix inspired by Jim Williams. + (up_silently_command, down_silently_command): No sel frame is error. + + * defs.h (memcpy, memset): Conditionalize decls on + #ifndef MEM_FNS_DECLARED, since DECstation differs. + (alloca): Break out the STDC and non-STDC alloca cases, to make + it work on old preprocessors as well as "picky ANSI" ones. + * xm-mips.h (memcpy, memset): Declare, and set MEM_FNS_DECLARED. + + * mips-tdep.c (heuristic_proc_start): Zero arg produces zero. + * utils.c (fputs_demangled): Rename SLOP since DECstation system + header files define it! + + * tm-29k.h (BREAKPOINT): Allow it to be overridden with -D. + +Mon Jun 29 16:30:25 1992 Fred Fish (fnf@cygnus.com) + + * dbxread.c, i386-pinsn.c, i386-tdep.c, regex.c, solib.c, symmisc.c, + symtab.h, tm-i386v4.h, valprint.c, values.c: Lint. + * breakpoint.c, c-exp.y, coffread.c, command.c, environ.c, eval.c, + findvar.c, infcmd.c, infptrace.c, infrun.c, m2-exp.y, parse.c, + putenv.c, solib.c, sparc-xdep.c, symtab.c, tm-i386v.h, tm-sparc.h, + utils.c, valarith.c, valops.c, valprint.c, values.c: + Replace bcopy() use with memcpy(), which is more standard and can + take advantage of gcc's builtin functions for increased performance. + * breakpoint.c, buildsym.c, coffread.c, dbxread.c, i386-tdep.c, + ieee-float.c, infcmd.c, sparc-tdep.c, stack.c, symtab.c, symtab.h, + target.c, values.c: + Replace bzero() use with memset(), which is more standard and can + take advantage of gcc's builtin functions for increased performance. + * i386-tdep.c, main.c, valprint.c: + Replace bcmp() use with memcmp(), which is more standard and can + take advantage of gcc's builtin functions for increased performance. + +Sun Jun 28 13:30:22 1992 Fred Fish (fnf@cygnus.com) + + * remote.c (remote_wait): Fix cast on signal() call. + * defs.h (alloca): More diddling with alloca. Have to ensure + that it has a prototype, so that if alloca is defined as a macro + that takes an arg, the definition is seen as a use of a macro + that takes an arg, to satisfy picky ANSI preprocessors. + +Sat Jun 27 12:12:20 1992 Fred Fish (fnf@cygnus.com) + + * sparc-pinsn.c: Use <string.h> rather than "string.h", for + consistency with all other gdb files. + * cadillac.c: Use <string.h> rather than <strings.h>. + * cadillac.c (kernel_dispatch): Convert rindex usage to strrchr. + * Makefile.in (MAKE): Remove definition for consistency with + other Makefile.in files and to fix problem with recursive makes. + +Fri Jun 26 19:03:23 1992 John Gilmore (gnu at cygnus.com) + + * hppahpux-xdep.c (child_xfer_memory): Avoid PT_WDUSER because it + crashes H-PUX. + +Fri Jun 26 11:09:10 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * source.c (print_source_lines): for DOS interoperability; don't + print CR (013) as ^M. + +Thu Jun 25 15:18:42 1992 Stu Grossman (grossman at cygnus.com) + + * dbxread.c (dbx_symfile_init): Move more code under hp9000s800 + conditional. + * hppabsd-core.c: Don't include "param.h", include <sys/param.h> + instead. + * remote.c (remote_wait): Cast signal to void * to avoid warning + from busted HP compiler. + + * partial-stab.h (N_SO): Rearrange code a little so that all SO + stabs cause end_psymtab to be called. + + * buildsym.c (read_sun_builtin_type): Handle new FCS Sun CC + compiler feature of putting 'c' into basic type descriptors for + all forms of char. + + * procfs.c (child_resume): Work around Solaris (on Sparc) lossage + where there is no place for nPC in prrun struct. + +Thu Jun 25 12:06:00 1992 Fred Fish (fnf@cygnus.com) + + * mipsread.c: Pass NULL name pointer to init_type, not 0. + * gdbtypes.c (init_type): Use copy of typename on type_obstack. + * dwarfread.c (enum_type): Save enum names on type_obstack. + * dwarfread.c (struct_type): Save member name on type_obstack. + * symtab.c (_initialize_symtab): Fix misspelling. + * regex.c (store_jump, insert_jump): Return void. + +Thu Jun 25 04:00:10 1992 John Gilmore (gnu at cygnus.com) + + * defs.h (PARAMS): Move to ../include/ansidecl.h. + (alloca): Declare return type on SPARC, since Sun doesn't. + (*_BYTE_ORDER): Improve comment: *must* be defined. + + * tm-hppa.h: New file, architectural definition of HP PA. + * tm-hppabsd.h, tm-hppahpux.h: Shrink to deltas from tm-hppa.h. + + * am29k-pinsn.c, am29k-tdep.c, copying.awk, copying.c, + hppa-coredep.c, hppa-pinsn.c, hppabsd-core.c, hppabsd-tdep.c, + hppabsd-xdep.c, hppahpux-tdep.c, hppahpux-xdep.c, remote-udi.c, + ser-go32.c, xcoffsolib.c: Remove <stdio.h> which is already in + "defs.h". + + * hppa-coredep.c, hppa-pinsn.c, hppabsd-core.c, hppabsd-tdep.c, + hppabsd-xdep.c, hppahpux-tdep.c, hppahpux-xdep.c, xcoffsolib.c, + xcoffsolib.h, xm-go32.h, xm-hppabsd.h, xm-hppahpux.h: Copyrights. + +Wed Jun 24 12:53:20 1992 John Gilmore (gnu at cygnus.com) + + * printcmd.c (output_command): Thinko. + (x_command): Only set remembered size/format if cmd succeeds. + + * dbxread.c (read_ofile_symtab): Remove N_CATCH special case, + since it is no longer used and burns time for every symbol read. + (process_one_symbol): Treat N_CATCH like default (complain). + +Wed Jun 24 00:26:56 1992 Stu Grossman (grossman at cygnus.com) + + * partial-stab.h (case N_TEXT): Fix fencepost error when + detecting start of new symbol info after reading symtab for a + module with a zero length TEXT segment. + +Tue Jun 23 21:46:26 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (VERSION): Bump to 4.5.6. + * coffread.c (coff_end_symtab): Cast 2nd arg of complain() to + correct type. + * defs.h (NORETURN): Define away for Lucid compiler. + * remote.c (remote_timer, remote_interrupt): Signal handlers + take one int arg. + * ser-termios.c (serial_write, serial_close): Return whatever + value the write/close call returns, rather than falling off end. + * inferior.h (PTRACE_ARG3_TYPE): Third arg to ptrace is int on + more systems than it is "char *". Define PTRACE_ARG3_TYPE to + default to int. + * infptrace.c, hppabsd-xdep.c, hppahpux-xdep.c, i386-xdep.c, + inferior.h (call_ptrace): Use PTRACE_ARG3_TYPE to declare type + of third arg. + * a68v-xdep.c, arm-xdep.c, convex-xdep.c, hp300ux-xdep.c, infrun.c, + m88k-xdep.c, mach386-xdep.c, mips-xdep.c, os68k-xdep.c, pyr-tdep.c, + pyr-xdep.c, rs6000-xdep.c, sparc-xdep.c, sun3-xdep.c, sun386-xdep.c, + symm-xdep.c, ultra3-xdep.c: Use PTRACE_ARG3_TYPE to cast ptrace + argument 3. + * sparc-xdep.c, a68v-xdep.c (fetch_inferior_registers, + store_inferior_registers): Supply missing fourth argument to + ptrace(). + * cadillac.c (kernel_dispatch): Make return type void. + * cadillac.c (iosig): Signal handlers take one int arg. + * valprint.c (val_print_fields): Call fprint_symbol to get + automatic C++ demangling for mangled field names. + +Mon Jun 22 20:18:06 1992 Fred Fish (fnf@cygnus.com) + + * command.c (add_abbrev_prefix_cmd): Fix misspelling in comment. + * dwarfread.c (enum_type): Fix misspelling in comment. + * valprint.c (val_print_fields, cplus_val_print): Minor + adjustment to printing of C++ class structures to more closely + match format for printing C structures, with and without setting + pretty print. + +Mon Jun 22 17:19:02 1992 Per Bothner (bothner@cygnus.com) + + * infrun.c (wait_for_inferior): Don't test for SIGEMT + (which is not a Posix signal) if it isn't defined. + * tm-linux.h, xm-linux.h, config/linux.m[ht], configure.in: + New port to Linux (a free Unix clone for 386 machines). + +Sat Jun 20 19:19:52 1992 John Gilmore (gnu at cygnus.com) + + COFF changes for dealing better with EPI 29K C compiler output. + + * coffread.c (record_minimal_symbol): Pass the minsym type to it. + Callers changed. + (coff_end_symtab): Sort blocks if needed. Complain if misordered. + (read_coff_symtab): Move patch_opaque_types call from + coff_symfile_read. Restrict it to symtabs from this objfile. + (process_coff_symbol: C_TPDEF): Don't put ordinary foward + references on opaque type chain; just let coff_lookup_type handle 'em. + (decode_type): Complain about tagndx values on + non-struct/union/enum types, which the EPI compiler tends to produce. + + * symtab.c (list_symbols): Make minimal symbol variable-finding work. + + * tm-68k.h (FIX_CALL_DUMMY): Avoid alignment and byte order + dependency. + + * elfread.c (elf_symfile_read): Update bfd_elf_find_section + usage to match new prototype. Include libbfd.h to get prototype. + + * source.c (find_source_lines): Handle large st_size fields. + +Sat Jun 20 16:28:39 1992 Fred Fish (fnf@cygnus.com) + + * infcmd.c (jump_command): Use cleanups to avoid memory leaks. + * stack.c (return_command): Use cleanups to avoid memory leaks. + +Fri Jun 19 19:06:41 1992 John Gilmore (gnu at cygnus.com) + + * remote-adapt.c, remote-eb.c, remote-mm.c: Lint. Fix + INT_REGNUM to INTE_REGNUM. + + * tm-29k.h (SDB_REG_TO_REGNUM): Add for EPI 29K C compiler. + +Fri Jun 19 15:30:15 1992 Stu Grossman (grossman at cygnus.com) + + * configure.in, dbxread.c, hppa-coredep.c, hppa-pinsn.c, + hppabsd-core.c, hppabsd-tdep.c, hppabsd-xdep.c, hppahpux-tdep.c, + hppahpux-xdep.c, munch, partial-stab.h, tm-hppabsd.h, + tm-hppahpux.h, xm-hppabsd.h, xm-hppahpux.h: HPPA merge. + + * Makefile.in (c-exp.tab.c, m2-exp.tab.c): Filter out bogus extern + declarations of malloc/realloc/free that are inserted by some + versions of yacc. + * m2-exp.y: Prevent conflicts with TRUE and FALSE tokens by + #undeffing them. + * xm-rs6000.h: Declare malloc/realloc/free appropriately. Yet + another decl of strdup (this really ought to come from libiberty.h!). + +Fri Jun 19 10:28:05 1992 John Gilmore (gnu at cygnus.com) + + * remote.c (getpkt): Error if input exceeds buffer size. + (_initialize_remote): `set remotedebug' enables packet trace. + + * dbxread.c (process_one_symbol:N_FUN): GCC now produces relative + N_SLINE's, etc, just like Sun cc on Solaris2. + + * am29k-tdep.c (read_register_stack, write_register_stack): + Change RSTACK_HIGH_ADDR to rstack_high_address, a user-settable + variable. Add `set' and `show' commands for it. + * doc/gdb.texinfo: Document it. + +Thu Jun 18 19:35:22 1992 Fred Fish (fnf@cygnus.com) + + * valprint.c (type_print_1): Plug memory leak. Print all + C++ syms as demangled, not just functions. + * buildsym.c (read_range_type): When we find a signed char + type, do a lookup of signed char, not plain char. Plain char's + still get looked up as plain char's elsewhere. + +Thu Jun 18 18:59:04 1992 John Gilmore (gnu at cygnus.com) + + * eval.c: Avoid residue-by-zero when evaluating without side effects. + (Bug and fix found by Pierre Willard.) + +Wed Jun 17 13:08:33 1992 Stu Grossman (grossman at cygnus.com) + + * xm-rs6000.h: Fix decls for malloc, realloc, and free. + + * xm-rs6000.h: Add decl for strdup(). + + * tm-rs6000.h: Remove #include of inferior.h. Fixes many + compilation errors. + + * breakpoint.c (enable_command, disable_command): Without args, + should only affect normal breakpoints and watchpoints. + + * m68k-pinsn.c (print_insn_arg): Make register be const. + * xcoffexec.c: Remove ' from comment. + * xm-sun3os4.h: Define MALLOC_INCOMPATIBLE to avoid conflicts + with decls of malloc in c-exp.tab.c (as produced by yacc). + There's got to be a better way to do this... + +Wed Jun 17 11:10:40 1992 Fred Fish (fnf@cygnus.com) + + * partial-stab.h: Convert single rindex use to strrchr. + * mipsread.c, dbxread.c: Remove troublesome inclusion of non- + standard <strings.h> file, now that the only single use of + rindex in the gdb source files is gone. + +Tue Jun 16 22:17:49 1992 Fred Fish (fnf@cygnus.com) + + * mipsread.c: Undo ill effects from including <strings.h>, + which #defines index to be strchr. Unfortunately, index is + a member of a symbol table structure that can't be changed. + * mipsread.c: tm-mips.h includes coff/symconst.h and coff/sym.h, + remove redundant #include's. + +Tue Jun 16 14:15:51 1992 Stu Grossman (grossman at cygnus.com) + + * mipsread.c: #include <strings.h> for rindex(). + +Tue Jun 16 09:01:49 1992 Fred Fish (fnf@cygnus.com) + + * xcoffexec.c (map_vmap): Turn comment into a real C comment. + +Mon Jun 15 18:41:23 1992 Stu Grossman (grossman at cygnus.com) + + * dbxread.c (process_one_symbol), partial-stab.h: Ignore + extraneous SO stabs from busted C++ compilers. + +Mon Jun 15 12:21:45 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (VERSION): Bump to 4.5.5. + * symtab.c (decode_line_1): Until C++ support stabilizes, when + C++ lookups fail, print possibly helpful hint about completion. + * cplus-dem.c (demangle_signature): Fix ARM style demangling + for static data members. + * dbxread.c (dbx_psymtab_to_symtab_1): Fix prototype. + * config/ncr3000.mh (INSTALL): Don't use /usr/ucb/install, + it's broken on ncr3000's. + +Mon Jun 15 07:21:00 1992 Fred Fish (fnf@cygnus.com) + + * dwarfread.c (decode_modified_type): Change type of first arg. + Change 'modifier' to char from unsigned char. Cast single use + that needs to be unsigned char. + * symtab.h (SYMBOL_BASEREG_VALID): Explain disabling. + * utils.c (strdup_demangled): Add function. + * defs.h (strdup_demangled): Add prototype. + * stack.c (return_command): Demangle C++ function names for query. + * infcmd.c (jump_command): Demangle C++ function names for query. + * cplus-dem.c (consume_count): New function and prototype. + * cplus-dem.c (demangle_class, gnu_special, demangle_func_type, + do_type): Replace conversion code with consume_count(). + * cplus-dem.c (gnu_special): Fix demangled of static members. + * source.c (list_command): Print demangled function names + when appropriate. Fix supplied by Peter Schauer. + +Mon Jun 15 01:45:48 1992 John Gilmore (gnu at cygnus.com) + + * sparc-tdep.c: Clean up slightly for Solaris2. + + * buildsym.c (define_symbol): Nameless types are now on several + platforms; generalize them and un-ifdef them to make Solaris 2 + work. + +Sun Jun 14 10:55:51 1992 John Gilmore (gnu at cygnus.com) + + * infcmd.c: Fix typo (reported by Rob Savoye). + * xm-sun4sol2.h (gregset_t): Thinko in register set definition. + * symtab.h: Disable SYMBOL_BASEREG_VALID until it works. + * dbxread.c (dbx_psymtab_to_symtab_1): Renamed from + psymtab_to_symtab_1. Use current psymtab's sym_offset and symbol_size, + rather than the one for the first file in the dependency chain. + + * dbxread.c (end_psymtab): Only reset texthigh if it's not already + set. Don't reset our own texthigh, or dependency-only pst's, in + scanning all the rest of the psymtabs. + (process_one_symbol): Fix comments around N_OBJ, N_OPT, N_UNDF. + + * buildsym.h (N_UNDF): Improve comments. + (N_LSYM, etc): Skip types without names (":T(0,3)=sfoob..."). + +Sat Jun 13 11:16:45 1992 Fred Fish (fnf at cygnus.com) + + * symtab.h (struct symbol): Add aux_value union for preserving + an additional per-symbol value. + * symtab.h (SYMBOL_BASEREG, SYMBOL_BASEREG_VALID): Add defines. + * frame.h (FRAME_GET_BASEREG_VALUE): Provide default definition. + * findvar.c (read_var_value): Use SYMBOL_BASEREG if valid. + * printcmd.c (address_info): Use SYMBOL_BASEREG if valid. + * symmisc.c (print_symbol): Use SYMBOL_BASEREG if valid. + +Sat Jun 13 09:18:46 1992 Michael Tiemann (tiemann@rtl.cygnus.com) + + * symfile.c (clear_symtab_users_once): Now non-static (for + objfiles.c). + +Fri Jun 12 18:54:40 1992 John Gilmore (gnu at cygnus.com) + + * arm-pinsn.c, i960-pinsn.c, m68k-pinsn.c, mips-pinsn.c, + ns32k-pinsn.c, pyr-pinsn.c, sparc-pinsn.c, tahoe-pinsn.c, + vax-pinsn.c: Remove reg_names decl (now in defs.h). + + Solaris-2 support on SPARC: + + * dbxread.c: Add symbol_size to struct dbx_symfile_info. + Add symbol_size and file offsets to struct symloc. + Add static symbol_table_offset, string_table_offset, + file_string_table_offset, next_file_string_table_offset, + last_function_name. + (add_old_header_file): Convert error() to complain()t. + (dbx_symfile_read): Get symbol size via the objfile. + Also get symbol_table_offset. + (dbx_symfile_init): Record symbol size and count via the objfile. + (dbx_next_symbol_text): Always add file_string_table_offset when + accessing string table. + (read_dbx_symtab): Initialize file_string_table_offset to 0. + (SET_NAMESTRING): Use the offset. + (end_psymtab): Large kludge to determine addresses where source + files start and end (for the psymtab header). + (psymtab_to_symtab_1): Set file_string_table_offset before reading. + Get this, symbol size, and symbol offset, from psymtab. + (read_ofile_symtab): Don't back up one symbol for Solaris2. + Patch up last_source_start_addr if zero in N_SO. + (process_one_symbol): Add variable function_start_offset. + ( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE): Add ifdef for + BLOCK_ADDRESS_FUNCTION_RELATIVE. + ( "", N_OBJ, N_OPT): Ignore. + (elfstab_build_psymtabs): New function to read stabs out of + an ELF file. + + * Makefile.in: Accept $(BISON) even though we really want $(YACC). + (gdb): use GLOBAL_CFLAGS when linking, too. + * partial-stab.h (N_UNDF): Deal with Sol2 relative stringtab offsets. + (N_OBJ, N_OPT): Ignore. + ('f', 'F'): Save last function name. + + * elfread.c (record_minimal_symbol_and_info): Kludged to put + extra info in the minimal symbol. + (elf_symtab_read): The extra info is the size of an ELF object, + which was kludged to us in the `udata' field of the BFD symbol. + Gag me with a crowbar... + (elf_symfile_read): Keep track of both the absolute load address, + and the offset between load addr and symbols. Handle STABS as + well as DWARF sections, passing the absolute load address to + elfstab_build_psymtabs. + + * symfile.h: Prototype elfstab_build_psymtabs. + * symfile.c: Add almost-OK debug versions of add_psymbol_*to_list. + + * xm-sysv4.h: Add <limits.h> to avoid conflicting defns in defs.h. + + * buildsym.h: Add processing_acc_compilation flag. + * buildsym.c (read_sun_builtin_type, read_sun_floating_type): New. + (define_symbol): Skip arg types in function entries. Resolve + overloaded 'P' which acc uses for prototypes of functions called + by this file. + (read_type: 'b', 'r'): Handle Solaris2 builtin types. + + * minsyms.c (prim_record_minimal_symbol_and_info): Hack to + save size of ELF symbols. FIXME. + * tm-sun4os5.h: Rename to tm-sun4sol2.h. Update defines for Sol2. + * xm-sun4os5.h: Rename to xm-sun4sol2.h. Hack more defines. + + * configure.in: Solaris config is sparc-sun-solaris2. + * config/sun4os5.m[ht]: Rename to config/sun4sol2.m[ht]; new xm, tm. + + * objfiles.c (free_objfile): Eliminate storage leaks. Contributed + by <Peter.Schauer@regent.e-technik.tu-muenchen.dbp.de>. + * symfile.c (symfile_bfd_open): Comment where name is freed. + * symmisc.c (extend_psymbol_list): Comment where list is freed. + +Fri Jun 12 08:24:36 1992 Fred Fish (fnf at cygnus.com) + + * expprint.c (print_subexp): Add missing ']'. + * defs.h (reg_names): Fix declaration to match that in infcmd.c + * stack.c (reg_names): Delete redundant (and inconsistent) decl. + * WHATS.NEW: Point out improved C++ function name handling. + * gdbtypes.c (lookup_fundamental_type): For now, use the same + type names for both implicitly and explicitly signed integral + types. See comment in the source code. + +Thu Jun 11 12:31:50 1992 John Gilmore (gnu at cygnus.com) + + Two `long long' fixes from Robert R. Henry (rrh@dino.tera.com): + * defs.h (longest_to_int): Avoid void arm of ?: in error case. + * expprint.c (print_subexp): Fix printing of register names. + +Thu Jun 11 01:33:40 1992 John Gilmore (gnu at cygnus.com) + + * inferior.h (register_valid): Declare. + * remote-udi.c, rs6000-xdep.c, sparc-xdep.c, tm-rs6000.h: Remove decl. + * objfiles.h (ALL_OBJFILE_{SYMTABS,PSYMTABS,MSYMBOLS}): Add + macros for traversing the data structures in a single objfile. + * tm-m88k.h, tm-sparc.h (REGISTER_NAMES): Remove extra semicolon. + * tm-i960.h (REGISTER_NAMES): Cosmetic change. + * infcmd.c: Lint. + +Tue Jun 9 17:19:45 1992 Fred Fish (fnf at cygnus.com) + + * c-exp.y, m2-exp.y: Move remapping defines for malloc and + realloc. Add remapping defines for {yyss, yyssp, yyvs, yyvsp}. + * config/{amix.mh, i386v4.mh, ncr3000.mh, stratus.mh, + sun4os5.mh}: Add definition for INSTALL using /usr/ucb/install. + +Tue Jun 9 16:29:19 1992 Stu Grossman (grossman at cygnus.com) + + * depend: rebuild to account for remote-st2000.c. + * remote-st2000.c: Almost works now. + * tm-st2000.h: Need to turn on HAVE_68881, else things won't compile. + +Mon Jun 8 23:05:51 1992 Fred Fish (fnf@cygnus.com) + + * c-exp.y (yylex): Recognize single-quoted strings that specify + tokens with embedded whitespace, such as C++ demangled names. + * defs.h (demangle_and_match, strcmp_iw, skip_quoted): Prototypes. + * main.c (gdb_completer_quote_characters): Add global variable. + * main.c (symbol_completion_function): Total rewrite for C++ + demangled name handling. + * main.c (skip_quoted): New function. + * main.c (main): Set rl_completer_quote_characters. + * symmisc.c (dump_symtab): Print source language for symtab. + * symtab.c (expensive_mangler): Add prototype and function. + * symtab.c (completion_list_add_symbol): Total rewrite for new + C++ demangled name handling. + * symtab.c (lookup_symbol): Check for demangled C++ symbol first, + other changes for demangled C++ symbol handling. + * symtab.c (lookup_demangled_block_symbol): Use demangle_and_match. + * symtab.c (lookup_demangled_partial_symbol): Use demangle_and_match. + * symtab.c (decode_line_1): Recognize C++ demangled names on input. + * symtab.c (completion_list_add_symbol): Total rewrite for new + C++ demangled name handling. + * symtab.c (expensive_mangler): New function. + * utils.c (strcmp_iw, demangle_and_match): New functions. + * xcoffread.c (aixcoff_symfile_read): Fix prototype. + +Mon Jun 8 21:59:08 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Roll VERSION to 4.5.4. + * Makefile.in, config/*.mh, config/*.mt: Rename TM_CFLAGS + to MT_CFLAGS, XM_CFLAGS to MH_CFLAGS to match file names. + * config/sun4os5.mh: Add MH_CFLAGS=-xs to save debug info. + +Mon Jun 8 14:17:42 1992 Stu Grossman (grossman at cygnus.com) + + * alldeps.mak: Rebuild to account for new files. + * config/st2000.mt: Use tm-st2000.h, not tm-68k.h. + * tm-st2000.h: New file. + * configure.in: Tandem debug monitor (st2000) support. + * remote-st2000.c, config/st2000.mt: ditto. + +Fri Jun 5 11:51:01 1992 John Gilmore (gnu at cygnus.com) + + * blockframe.c (inside_entry_file, inside_main_func, + inside_entry_func): Return 0 if no symbols; avoid crashing. + +Wed Jun 3 17:48:04 1992 John Gilmore (gnu@cygnus.com) + + * xcoffread.c (read_xcoff_symtab): Set c_sclass from n_sclass + without masking, since it is signed and will later be compared + against signed quantities. The right fix is probably to make + it all unsigned, but this is a small, safe fix for this release. + FIXME -- make the real change sometime soon. + +Mon Jun 1 16:16:12 1992 Michael Tiemann (tiemann@cygnus.com) + + * remote-vx.c (vx_load_command,add_symbol_stub): Default READNOW + parameter in call to `symbol_file_add' to 0. + + * xm-sun4os4.h (MALLOC_INCOMPATIBLE): Define it. + +Sun May 31 06:38:27 1992 Michael Tiemann (tiemann@cygnus.com) + + * configure.in: Handle -m680[01234]0-wrs. + +Fri May 29 22:16:02 1992 Michael Tiemann (tiemann@rtl.cygnus.com) + + * m68k-pinsn.c (print_insn_arg): Pass &EXT_FORMAT_68881 to + `ieee_extended_to_double'. + +Wed May 27 09:27:57 1992 John Gilmore (gnu at cygnus.com) + + * valops.c (value_assign): Lint, by Pierre Willard. + +Tue May 19 19:38:10 1992 John Gilmore (gnu at cygnus.com) + + * coredep.c (fetch_core_registers): Remove premature warning, + which triggers on DECstation even though all regs are accessible. + + * m68k-pinsn.c (print_insn_arg): Use new macros to get + sign-extension of instruction fields even on unsigned-char hosts. + Bug found by Fred J Roeber, fjr@sgfb.ssd.ray.com. + + 88K changes inspired by Ted Lemon (uunet!lupine!mellon): + * tm-m88k.h, tm-umax.h: Avoid sizeof() in REGISTER_xxx macros, + since they define the target, not the host. + * m88k-pinsn.c: Fix typo. + +Thu May 14 01:16:48 1992 John Gilmore (gnu at cygnus.com) + + * valarith.c (value_zerop): -0.0 is still zero. + * eval.c (evaluate_subexp): Avoid NaN anomalies in float compares. + Patches by Paul Eggert <eggert@twinsun.com>. + +Mon May 18 13:53:51 1992 Stu Grossman (grossman at cygnus.com) + + * alldeps.mak, depend: re-make to account for ser-*.c. + +Sun May 17 16:51:20 1992 Fred Fish (fnf@cygnus.com) + + * inflow.c (new_tty): Temporarily ignore SIGTTOU when + disconnecting from controlling terminal, to avoid gdb hanging + on SVR4. Fixes bug reported by Oliver Okrongli. + * procfs.c (PROC_NAME_FMT): Change format to match default used + by system, as suggested by Oliver Okrongli. + * tm-68k.h (FRAME_FIND_SAVED_REGS): Apply missing parentheses + bug fix from Brent Townshend (bst%tt@cam.ORG). + * c-exp.y (nonempty_typelist): Fix memory overrun bug reported + by turlais@rechser.total.fr. + * dwarfread.c (decode_subscr_data): Fix bug in calculation of + length of non-zero lowerbound arrays. Bug fix from Peggy Fieland. + * objfiles.h (unlink_objfile): Add prototype. + * objfiles.c (unlink_objfile): Add function. + * objfiles.c (free_objfile): Call unlink_objfile. + * objfiles.c (allocate_objfile): Call unlink_objfile on newly + remapped objfiles. Bug reported by hahn@sunshine.labs.tek.com. + Also, discard old possibly bogus sf struct. + * symfile.c (symbol_file_add): Call init_entry_point_info() and + find_sym_fns() for remapped symbol files, in case of any changes + since the last mapping. + +Wed May 13 18:28:20 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * findvar.c (read_relative_register_raw_bytes): use the raw size + of a register to bcopy, rather than the host's sizeof(CORE_ADDR). + +Tue May 12 17:44:39 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + Changes to support GDB running on DOS using GO32 and H8 support + + * defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h", + allowing hosts with different text and binary file formats to + work. + * coffread.c (read_coff_symtab): changed calling convention and + operation - now it opens its own file with FOPEN_RB rather than + duping and fdopening the provided handle. + * dbxread.c, cplus-dem.c: #include mangling. + * exec.c: If O_BINARY isn't defined, set it to 0, call openp for + binary files oring in the right bit. + * utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals. + * remote-hms.c: cleanup to use the new remote serial stuff + * serial.h, ser-termios.c, ser-go32.c: newfiles to provide host + independent remote terminal I/O. + * remote.c: if DONT_USE_REMOTE not defined, then don't use it. + * source.c (openp): fix off by one problem removing / - can now + open a source file in the root directory with DOS. + * values.c (value_as_pointer): remove bogus address bits from + long. (unpack_long): unpack into unsigned long/short if pointer. + +Tue May 12 14:15:48 1992 Stu Grossman (grossman at cygnus.com) + + * infrun.c (child_attach): Don't allow gdb to attach to itself. + It gets permanently stuck in many OSes. + * breakpoint.c, infcmd.c, infrun.c, utils.c: Change many printfs + to printf_filtered. + * breakpoint.c: Improve help text for info breakpoints. + +Mon May 11 14:17:18 1992 John Gilmore (gnu at cygnus.com) + + * README: Add pointer to internals doc, and describe reading + info files. + * utils.c (print_sys_errmsg): Use stderr. Reported by Pierre Willard. + * symtab.c (output_source_filename): Remove old glop for wrapping + lines, use wrap_here. Reported by Pierre Willard (pierre@la.tce.com). + +Thu May 7 11:45:03 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in: version.c should depend on Makefile, not Makefile.in. + * munch: Add sort -u to avoid duplications. + * symtab.c (lookup_symbol): Improve Stu's fix of 22 April. + Improved fix by hahn@sunshine.labs.tek.com (Doug Hahn). + +Mon May 11 13:27:46 1992 Fred Fish (fnf@cygnus.com) + + * cplus-dem.c (demangle_signature): Recognize misplaced '_' to + avoid infinite loops while demangling bogus mangled names. + * valprint.c (type_print_base): Minor fix for GNU style guide + conformance. + +Sat May 9 18:02:17 1992 Fred Fish (fnf at fishpond) + + * Makefile.in (VERSION): Bump to 4.5.3 + * Makefile.in (DEMANGLE_OPTS): Remove obsolete -Dnounderscore + * Makefile.in (demangle): New target to create standalone + demangler with same code and options as internal demangler. + * cplus-dem.c: Massive restructuring, rewriting, cleanups, etc + to support ARM style and Lucid style demangling, improve + maintainability, fix several demangling bugs. More changes + to follow. + * defs.h (strstr): Add ANSI compatible prototype. + * valprint.c (type_print_1): Demangle using ansi option. + * config/ncr3000.mt (DEMANGLE_OPTS): Remove -Dnounderscore. + +Sat May 9 14:47:28 1992 Stu Grossman (grossman at cygnus.com) + + * xcoffexec.c (vmap_exec): Don't assume .text and .data are the + first two sections. + +Fri May 8 11:42:15 1992 Per Bothner (bothner@rtl.cygnus.com) + + * mipsread.c (parse_procedure): Return rather than using + uninitialized variable 'b'. + +Fri May 8 07:48:27 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in, remote-udi.c, remote-vx.c, 29k-share/dfe/mini2udi.c, + 29k-share/dfe/yank.c, vx-share/xdr_ptrace.c, vx-share/xdr_regs.c: + Remove -I29k-share, -Ivx-share from Makefile.in. Make #includes + relative to each source file. + +Fri May 8 07:48:27 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: propogate INSTALL, INSTALL_DATA, INSTALL_PROGRAM on + recursions. + +Thu May 7 10:00:52 1992 Stu Grossman (grossman at cygnus.com) + + * am29k-pinsn.c: Use new opcode table in "opcode/a29k.h". + * am29k-tdep.c: Update to latest code from AMD. + (get_saved_register) don't crap out if no frame. + * remote-udi.c: Set/clear inferior_pid as appropriate. + (udi_open) call target_preopen, don't close fd 0!!!, clean up + error handling. Fixup end-of-debugging messages. + (udi_fetch_registers) clean up big time, mainly don't multiply + register_valid indices by 4, and use proper Offset when reading + gr96-gr127. (udi_store_registers) general cleanup. + (fetch_register) cleanup, simplify. (regnum_to_srnum) + INT_REGNUM->INTE_REGNUM. + * tm-29k.h: Upgrade to latest code from AMD. + * 29k-share/udi/udip2soc.c: Get rid of useless errmsg_m macro. + (UDIConnect) Clean up error processing (like, don't do exit() if + execlp fails), make code restartable, make more attractive. + (UDIStop) Use SIGINT instead of SIGUSR1, as isstip won't stop + otherwise. + +Wed May 6 14:34:18 1992 Per Bothner (bothner@rtl.cygnus.com) + + * tm-irix3.h: Re-define CPLUS_MARKER to '.'. + * xm-rs6000.h, tm-rs6000.h: Move re-definition of CPLUS_MARKER + from former to latter. + +Wed May 6 14:12:35 1992 Fred Fish (fnf@cygnus.com) + + * cplus-dem.c (do_args): Handle void args the same as others. + * objfiles.c (free_objfile): Only try to unmap files when + reusable objfiles are supported. + * valprint.c (type_print_varspec_suffix): Add parameter that + specifies if C++ demangling included function arguments. Use + it to suppress printing extra pair of ()'s. + * valprint.c (type_print_1): Fix problem with printing demangled + C++ function types where demangled type includes the function + args. + +Tue May 5 11:10:27 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (DEMANGLER): Define and default to cplus-dem. + Allows selection of C++ demangler to be a configuration option + until multiple demanglers are supported. + * demangle.h: New include file for extended demangler support. + * breakpoint.c, gdbtypes.c, printcmd.c, stack.c, symtab.c, + utils.c, valprint.c: Include "demangle.h" and change all calls + to cplus_demangle() or fputs_demangled() to use individual + demangling options. + * valprint.c (type_print_1): Change options to cplus_demangle + to print demangled function args. Still broken, but now less so. + * cplus-dem.c: Include demangle.h, reorganize and update some + comments to reflect reality. + * cplus-dem.c (cplus_demangle, cplus_mangle_opname): Change + second arg from fixed integer to bit based multiple options. + * cplus-dem.c (optable): Reformat and replace ansi members with + bit based options. + * cplus-dem.c (do_type): Fix bug with parsing missing return type. + +Mon May 4 22:26:59 1992 John Gilmore (gnu at cygnus.com) + + * values.c (set_internalvar): Force evaluation of lazy values. + Bug reported by RMS. + +Sun May 3 15:47:45 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (VERSION): Bump to 4.5.2. + * Makefile.in (DEMANGLE_OPTS): Add, default to -Dnounderscore. + * configure.in: Simplify ncr3000 gdb_host logic, add gdb_target. + * dwarfread.c (struct_type): Apply fix from Peggy Fieland for + proper handling of bit fields. + * gdbtypes.h (struct type): Clarify use of field.bitpos. + * symtab.h: Fix couple of misspellings in comments. + * value.h (struct value): Clarify use of bitpos. + * value.h (unpack_field_as_long): Change prototype, returns + LONGEST. + * values.c (unpack_field_as_long): Change return type to LONGEST, + sign extend unpacked fields that are signed, other rewriting. + * config/ncr3000.mt: New target config file. + +Fri May 1 01:53:26 1992 John Gilmore (gnu at cygnus.com) + + * utils.c (printchar): Print 0x7F and 0x80-0x9F in \nnn notation + even when printing 8-bit characters. + + * gdbtypes.c (make_{reference,pointer,function}_type): New + functions which handle overwriting of forward-referenced types + for stabs file reading. + (lookup_{reference,pointer,function}_type): These just call + the make_*_type functions with a null storage alloc parameter. + * gdbtypes.h (make_{reference,pointer,function}_type): Declare. + * xcoffread.c (smash_to_pointer_type): Remove, no longer used. + + * buildsym.c (dbx_lookup_type): Zero result for (-1,-1) arg. + (dbx_alloc_type): Make it easier to understand. No funct change. + (define_symbol: 't'): Don't put the typedef name into the name of + the struct, union, or enum. Bugfix. + (read_type: '*', '&', 'f'): Add comments. Use make_XXX_type + routines to properly handle overwriting preallocated types so that + forward references will work. + (read_enum_type): Force enum values to file scope, due to bug in + Sun compiler output. FIXME, fix later. + + Remove unused header_file_prev_index mechanism. It was already + obsolete in gdb-3.5. These comments appeared in 3.5: + /* This code was used before I knew about the instance codes. + My first hypothesis is that it is not necessary now + that instance codes are handled. */ + * dbxread.c (add_new_header_file): Remove header_file_prev_index. + * buildsym.h: Remove it and prev_index that saves it. + * buildsym.c (push_subfile, pop_subfile, start_symtab): Remove it. + + * solib.c (special_symbol_handling): When called from core files, + must set up debug_addr. Don't print error messages, just return. + * symmisc.c (print_symbol): Less ascii diarrhea for enums, please. + +Wed Apr 29 15:26:51 1992 Per Bothner (bothner@rtl.cygnus.com) + + * cplus-dem.c: Allow nested class names (as in + Foo::Bar::method()). + Allow the cleaner cfront style of nested class names + (Q2_3Foo3Bar as well as Q23Foo3Bar). + Make cplus_demangle re-entrant by removing use of global + variables. Instead, place all shared variables in a + stack-allocated structure, and pass around its address. + +Fri Apr 24 07:41:19 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (make-proto-gdb-1): 1st cut at packaging + 29k-share/* subdirs... + + * remote-udi.c (udi_insert/remove_breakpoint): Completely + rewrite, only leave out the bugs. + + * Makefile.in: Add 29k/UDI support. Improve depend. + * alldeps.mak, configure.in, depend: Add 29k/UDI support. + + * am29k-tdep.c: Update to use new calling conventions, and misc + symbol elements. + + * m68k-pinsn.c (print_insn_arg): Make branch offsets be signed. + +Thu Apr 23 18:43:17 1992 Fred Fish (fnf@cygnus.com) + + * tm-29k.h: Set DECR_PC_AFTER_BREAK to 0, as 29ks have nice + breakpoint instructions that leave PC pointing at the right place. + + * core.c (core_open): Call warning() to print warnings. + +Wed Apr 22 09:55:42 1992 Stu Grossman (grossman at cygnus.com) + + * symtab.c (lookup_symbol): Need to check if msymbol->name is + NULL, as ALL_MSYMBOLS will never return a NULL msymbol pointer. + This prevents a crash when trying to lookup the value of a + non-existent symbol. + +Wed Apr 22 09:42:15 1992 Fred Fish (fnf@cygnus.com) + + * signame.c, signame.h: Remove, replaced by strsignal.c in + libiberty. + * i960-tdep.c, infrun.c, mach386-xdep.c, procfs.c, sparc-tdep.c, + sun386-xdep.c: Remove include of signame.h + * Makefile.in (SFILES_MAINDIR): Remove signame.c + * Makefile.in (HFILES): Remove signame.h + * Makefile.in (OBS): Remove signame.o + * defs.h (safe_strerror, safe_strsignal, strerrno, strsigno, + errno_max, signo_max, strtoerrno, strtosigno, strsignal, + psignal, perror): Add prototypes. + * defs.h, xm-apollo68v.h, xm-ultra3.h (SYS_SIGLIST_MISSING): + Remove define. + * depend: Manually remove signame.[cho] references. + * convex-tdep.c (subsig_name): Replace use of sys_siglist with + strsignal. + * convex-xdep.c (core_file_command): Replace use of sys_siglist + with safe_strsignal. + * core.c (core_open): Replace use of sys_siglist with + safe_strsignal. + * core.c (memory_error): Replace use of sys_errlist with + safe_strerror. + * i960-tdep.c (print_fault): Replace use of sys_siglist with + safe_strsignal. + * infcmd.c (program_info): Replace use of sys_siglist with + safe_strsignal. + * infrun.c (signal_stop, signal_print, signal_program): + Allocate dynamically based on dynamic determination of number + of signals to support. + * infrun.c (child_create_inferior): Replace use of sys_errlist + with safe_strerror. + * infrun.c (wait_for_inferior): Replace use of sys_siglist with + safe_strsignal. + * infrun.c (sig_print_info): Replace use of sig_abbrev with + strsigno and sys_siglist with safe_strsignal. + * infrun.c (handle_command): Call signo_max to find number of + signals. Replace sig_number with strtosigno and sig_abbrev with + strsigno. + * infrun.c (signals_info): Replace sig_number with strtosigno. + * infrun.c (_initialize_infrun): Call signo_max to find number of + signals. Dynamically allocate signal_{stop,print,program}. + * procfs.c (errno_table): Remove, now in libiberty/strerror.c. + * procfs.c (errnoname): Add function and prototype. + * procfs.c (info_proc_siginfo): Call errnoname, replace use + of sys_siglist with safe_strsignal. + * procfs.c (info_proc_stop, info_proc_signals): Replace use of + sys_siglist with safe_strsignal. + * procfs.c (info_proc_stop): Call errnoname. + * procfs.c (signalname): Replace sig_abbrev with strsigno. + * stuff.c (main, get_offset): Replace use of sys_errlist with + strerror. + * sun386-xdep.c (core_file_command): Replace use of sys_siglist + with safe_strsignal. + * umax-xdep.c (core_file_command): Replace use of sys_siglist + with safe_strsignal. + * utils.c (safe_strerror, safe_strsignal): Add functions that + call strerror and strsignal respectively, and deal with NULL + returns. + * utils.c (perror_with_name, print_sys_errmsg): Replace use of + sys_errlist with safe_strerror. + * valprint.c (val_print): Replace use of sys_errlist with + safe_strerror. + +Tue Apr 21 12:00:47 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: rework CFLAGS so that they can be set from the + command line to make. CFLAGS -> INTERNAL_CFLAGS. + USER_CFLAGS -> CFLAGS. Remove MINUS_G. Default CFLAGS to -g. + Pass CFLAGS on recusions. + +Fri Apr 17 19:25:57 1992 Fred Fish (fnf@cygnus.com) + + * gdbtypes.h, c-exp.y, m2-exp.y, mipsread.c, gdbtypes.c: Back + out of change on 4/14/92 and remove TYPE_FLAG_FUND_TYPE. It was + overkill for the problem it solved. + * valprint.c (type_print_base): Remove TYPE_FLAG_FUND_TYPE test + and default to simply printing type names as appropriate. + * main.c (main): Remove one of the leading newlines from + warning_pre_print initialization. + * objfiles.c (open_existing_mapped_file): Add function and + prototype. + * objfiles.c (open_mapped_file): Rewrite to use new function + open_existing_mapped_file. + +Thu Apr 16 23:50:12 1992 John Gilmore (gnu at cygnus.com) + + * sun3-xdep.c (fetch_core_registers): Lint. + * tm-sun3.h: Prototype lint. + * value.h: Typo. + +Thu Apr 16 19:56:50 1992 Fred Fish (fnf@cygnus.com) + + * dwarfread.c (TARGET_FT_POINTER_SIZE, TARGET_FT_LONG_SIZE): + Define using TARGET_PTR_BIT and TARGET_LONG_BIT for now. + * objfiles.c: Cast calls to close() with unused returns to void. + * objfiles.c (allocate_objfile): Initialize objfile's mmfd, free + old objfile's name before updating it. + * objfiles.c (free_objfile): Major rewrite for mapped objfiles. + * objfiles.h (objfile struct): Add mmfd member. + * symfile.c (syms_from_objfile): Move some code to + new_symfile_objfile. + * symfile.c (new_symfile_objfile): Add new function, common code + from syms_from_objfile. + * symfile.c (symbol_file_add): Call new_symfile_objfile for both + mapped and unmapped symbol files. + * symfile.c (symbol_file_command): Print "No symbol file now" + message, ala exec_file_command for the exec file. + * symfile.h (new_symfile_objfile): Add prototype. + * xcoffexec.c (map_vmap): Add call to new_symfile_objfile. + * xcoffsolib.c (solib_add): Add call to new_symfile_objfile. + +Thu Apr 16 18:26:34 1992 Per Bothner (bothner@cygnus.com) + + * rs6000-pinsn.c: New version from IBM (Metin). + * m2-exp.y: Re-write string initializers ("<>" => {'<', '>'}) + to avoid warnings from some compilers. + +Tue Apr 14 22:33:55 1992 Fred Fish (fnf@cygnus.com) + + * gdbtypes.h (FT_FIXED_DECIMAL, FT_FLOAT_DECIMAL): Add defines. + * gdbtypes.h (TYPE_FLAG_FUND_TYPE): Add define for bit in a + type's flag word that marks it as a fundamental type. + * c-exp.y (_initialize_c_exp): Add TYPE_FLAG_FUND_TYPE bit to + flags argument for all calls to init_type(). + * m2-exp.y (_initialize_m2_exp): Add TYPE_FLAG_FUND_TYPE bit to + flags argument for all calls to init_type(). Also remove + dependency on host sizes for ints, floats, etc. + * mipsread.c (_initialize_mipsread): Add TYPE_FLAG_FUND_TYPE bit to + flags argument for all calls to init_type(). Also remove + dependency on host sizes for ints, floats, etc. + * gdbtypes.c (lookup_fundamental_type): Add TYPE_FLAG_FUND_TYPE + bit to flags argument for all calls to init_type(). Add types + FT_FIXED_DECIMAL and FT_FLOAT_DECIMAL. + * valprint.c (unsigned_type_table, signed_type_table, + float_type_table): Remove. + * valprint.c (type_print_base): Test new TYPE_FLAG_FUND_TYPE + bit when printing fundamental types, and print the actual name + for such types, rather than inventing one. Remove code that + invented fundamental type names. + * valprint.c (_initialize_valprint): Remove initializations + for now removed unsigned_type_table, signed_type_table, and + float_type_table. + +Tue Apr 14 14:30:46 1992 Stu Grossman (grossman at cygnus.com) + + * remote-vx.c, vx-share/xdr_ptrace.c, vx-share/xdr_ptrace.h, + vx-share/xdr_rdb.h: Update for new remote protocol under VxWorks + 5.0.2. + +Mon Apr 13 20:59:21 1992 Fred Fish (fnf@cygnus.com) + + * dwarfread.c (target_to_host): New function similar to previous + swapin function. + * dwarfread.c (SWAPIN, swapin): Remove macro and support function. + Extensive changes to convert all previous usages to use new + target_to_host() function. + * dwarfread.c (struct dieinfo): Change types of most integral + members to be unsigned. + +Mon Apr 13 15:59:10 1992 John Gilmore (gnu at cygnus.com) + + * WHATS.NEW: Revise -mapped doc. + +Sat Apr 11 23:14:36 1992 John Gilmore (gnu at cygnus.com) + + * mipsread.c (parse_partial_symbols): Complain when sh->index is + too high or when skipping `forwards' moves us backwards. + (parse_type): Print mis-guessed tag name in complaint. + (parse_external): Eliminate cur_stab and obscure top_stack clobbers. + (parse_procedure): Do not attempt to create symbols; just fill in + the SYMBOL_VALUE field of a .gdbinfo. symbol if we can find one. + (psymtab_to_symtab_1): Split up `stabs' from `native ecoff' code + for clarity. Set top_stack before calling parse_external. In + stabs, sort symbols before calling parse_procedure. + * mipsread.c: Lint. + * symmisc.c (std_in, std_out, std_err): Add vars to access std + FILE *'s when debugging GDB (e.g. as args to dump_symtab). + * Makefile.in: Remove stage* targets. Avoid echo on recursive + makes. Eliminate doc/Makefile from tar.Z file if doc/Makefile.in + exists. + +Fri Apr 10 23:47:37 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in (VERSION): Set to 4.5.1. + * xcoffread.c (NO_TYPEDEFS): Fix typo in commented-out #define. + * sparc-tdep.c (supply_gregset, fill_gregset, supply_fpregset, + fill_gregset): New functions for SVR4 /proc support. + * mipsread.c: Cleanup. Add more complaints for unhandled cases. + Remove new symbol types and such to ../include/coff/symconst.h. + (parse_symbol): Simplify code for parsing struct/enum/unions. + (parse_type): Handle `long long' types. + (upgrade_type): Handle `const' qualifier. + (parse_partial_symbols): fix indentation, clean a bit. + +Fri Apr 10 22:41:03 1992 Fred Fish (fnf@cygnus.com) + + * dwarfread.c (SWAPIN,swapin): New macro and function to call to + copy in data from raw read buffers, calling bfd byteswapping + routines as appropriate. Use to replace most existing memcpy + calls. + * dwarfread.c (basicdieinfo, completedieinfo): Add objfile arg. + * configure.in: Recognize new ncr3000 config. + * config/ncr3000.mh: New config file. + +Fri Apr 10 08:30:58 1992 Stu Grossman (grossman at cygnus.com) + + GDB-4.5 release! + + * README: Update for release. + * Makefile.in: Update version to 4.5. + * WHATS.NEW: The obvious. + + * depend: Generate new depend file for this release. + + * Makefile.in (depend): Fix dependancy generation so that it does + not include gcc 'fixincluded' files, which are usually in a system + specific location. + +Thu Apr 9 13:35:00 1992 Per Bothner (bothner@rtl.cygnus.com) + + Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik). + * buildsym.c (#ifdef RS6000_TARGET): Don't create unnecessary + symbols for nameless types. And, handle `R' (register parameter + type) for AIX. (an extension to existing stabstring grammar). + * rs6000-xdep.c: Fix typo (= should have been ==). + +Thu Apr 9 12:10:06 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in: version=4.4.88, add xm-vax.h to HFILES. + +Thu Apr 9 02:29:03 1992 John Gilmore (gnu at cygnus.com) + + * xm-sun4os5.h (DO_DEFERRED_STORES, CLEAR_DEFERRED_STORES): Zap. + * signame.c (SIGWAITING, SIGLWP): Add. + +Tue Apr 7 16:34:07 1992 Per Bothner (bothner@cygnus.com) + + * xm-i386mach.h: add decls for errno and strdup(). + + * breakpoint.c (breakpoint_1): Add (int) casts for enums + used in array index context (otherwise, some compilers barf). + +Tue Apr 7 08:45:46 1992 Stu Grossman (grossman at cygnus.com) + + * m68k-tdep.c, tm-sun3.h: #ifdef around get_longjmp_target(). + Change def of SAVED_PC_AFTER_CALL to call routine to see if we are + in a system call, and provide better backtrace if so. + + * Makefile.in (HFILES): Add xcoffsolib.h. + * rs6k-opcode.h: Move to ../include/opcode/rs6k.h. + * rs6000-pinsn.c: #include "opcode/rs6k.h" + + * mipsread.c (read_mips_symtab, read_the_mips_symtab, + mipscoff_symfile_read): Convert to BFD to do file I/O. + + * symfile.c: #include <ctype.h> to get proper def if isspace(). + + * i386-tdep.c (get_longjmp_target): #ifdef GET_LONGJMP_TARGET. + +Mon Apr 6 17:25:45 1992 Per Bothner (bothner@cygnus.com) + + * mipsread.c: Create a .gdbinfo pseudo-symbol for each + function also when parsing embedded stabs. + +Mon Apr 6 15:25:03 1992 Stu Grossman (grossman at cygnus.com) + + * mipsread.c: Fix more declarations. + + * mipsread.c: Fix many invocations of complain. Use enum + type_code where appropriate. + + * xm-vaxult.h: Add decl for strdup(). + + * Makefile.in: Add dependancies for xm-vaxbsd.h and xm-vaxult.h + for xm-vax.h. + +Fri Apr 3 17:41:29 1992 Stu Grossman (grossman at cygnus.com) + + * buildsym.h, dbxread.c, mipsread.c: Add objfile arg to + process_one_symbol. + +Fri Apr 3 12:17:14 1992 Per Bothner (bothner@cygnus.com) + + * munch: Must pre-pend "_" to "initialize" for SYSV style nm. + * tm-rs6000.h, xcoffexec.c, xcoffread.c, xm-rs6000.h: + Merge in more patches for rs6000 from Metin Ozisik. + * utils.c: Fix typo in comment. + +Fri Apr 3 11:23:03 1992 Fred Fish (fnf@cygnus.com) + + * procfs.c (procinfo struct): Add nopass_next_sigstop member. + * procfs.c (attach): Set nopass_next_sigstop if attached + process is forcibly stopped. + * procfs.c (child_resume): Use nopass_next_sigstop to suppress + resending SIGSTOP to attached process on first resume. + +Fri Apr 3 01:37:26 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (SFILES_MAINDIR): add mipsread.c + +Thu Apr 2 20:20:54 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in (OBS): Compile mipsread.c for all targets now. + (VERSION): Bump to 4.4.85. + * mipsread.c: Update for new include files. Lint. + * tm-irix3.h, tm-mips.h: Use new include files for ECOFF symtab. + * config/{bigmips.mt, littlemips.mt, irix3.mt, decstation.mt}: + Don't need to bring in mipsread.o specially any more. + +Thu Apr 2 19:38:31 1992 Stu Grossman (grossman at cygnus.com) + + * mipsread.c (fixup_sigtramp): Also look for _sigtramp as a real + routine (for Irix-4.x). Make many funcs static and void. + * mips-tdep.c (mips-frame-chain): Clean up, simplify. + * (init_extra_frame_info): Don't trash cached value of frame + pointer register. This fixes backtracing through routines that use + alloca(). Generally clean up declarations of functions, and use + typedefs and macros to reference data structures as appropriate. + * tm-irix3.h, tm-mips.h (EXTRA_FRAME_INFO): use proper type for + proc_desc element. + +Thu Apr 2 09:47:11 1992 Fred Fish (fnf@cygnus.com) + + * values.c (unpack_long): Fix unpacking error for signed chars + on hosts where the default character type is unsigned. + * procfs.c (pr_flag_table, pr_why_table): Add some entries + for newer SVR4 variants. + * procfs.c (proc_set_exec_trap): Reorder tests for ioctl's that + turn off trace inherit-on-fork flag to favor latest SVR4 method. + * procfs.c (mappingflags): Add support for MA_PHYS + +Thu Apr 2 00:55:56 1992 John Gilmore (gnu at cygnus.com) + + * buildsym.c (read_struct_type): Avoid coredump when C++ + abbreviated type name is messed up. Reported by Joe Buck. + FIXME, we need to determine whether GDB or GCC needs to be + smarter to correctly locate this type name. + + * c-exp.y, coffread.c, command.c, command.h, copying.awk, + dbxread.c, gdbtypes.c, infcmd.c, inferior.h, infrun.c, + m2-exp.y, printcmd.c, remote.c, solib.c, source.c, stack.c, + symtab.c, tm-sun4os4.h, tm-sun4os5.h, values.c: Lint. + * symfile.c (add_symbol_file_command): Initialize mapped/readnow. + +Wed Apr 1 11:39:52 1992 Fred Fish (fnf@cygnus.com) + + * breakpoint.h (bpdisp, bptype): Remove trailing comma. + * symtab.h (current_source_symtab): Make extern + * symtab.h (current_source_line): Make extern + * inferior.h: Move all procfs.c prototypes to one place, add + prototype for proc_signal_handling_change. Add prototypes for + signal_stop_state, signal_print_state, and signal_pass_state. + * inferior.h (stop_soon_quietly): Make extern + * inferior.h (attach_flag): Make extern + * infrun.c (NOTICE_SIGNAL_HANDLING_CHANGE): Default is null. + * infrun.c (signal_stop_state, signal_print_state, + signal_pass_state): New functions to query specific signal + handling flags. + * infrun.c (handle_command): Minor error message change, add + NOTICE_SIGNAL_HANDLING_CHANGE. + * procfs.c (open_proc_file): Remove iris specific reset of + inherit-on-fork flag, moved to proc_set_exec_trap(). + * procfs.c (proc_set_exec_trap): Add SVR4 and iris code + to reset inherit-on-fork flag, bash comment to GNU form. + * procfs.c (proc_base_address, set_proc_siginfo, + fetch_core_registers): Conform to code style. + * procfs.c (signame.h): Include. + * procfs.c (MAX_SYSCALLS, syscall_table[], init_syscalltable(), + syscallname(), info_proc_syscalls()): New macros, tables, and + functions to organize and report system call information. + * procfs.c (saved_fltset, saved_trace, saved_sighold, + saved_exitset, saved_entryset): Add to procinfo struct. + * procfs.c (struct trans): Add. + * procfs.c (pr_flag_table, pr_why_table, faults_table, + siginfo_table, errno_table): Tables to translate numeric values + to symbolic names and short descriptions. + * procfs.c (signalname, info_proc_signals): Add function and + prototype. + * procfs.c (proc_info): Now info_proc. + * procfs.c (proc_info_address_map): Now info_proc_mappings. + * procfs.c (info_proc_flags, info_proc_stop, info_proc_siginfo, + info_proc_faults, lookupname, lookupdesc, sigcodename, + sigcodedesc): New functions. + * procfs.c (proc_signal_handling_change): New function to set + the trace flags based on the state of gdb's signal handling flags. + * procfs.c (inferior_proc_init): Call proc_signal_handling_change + and remove code to do PIOCSTRACE ioctl. + * procfs.c (attach, detach): Preserve and restore process flags + using saved_* fields in procinfo struct. + * procfs.c (attach): Call proc_signal_handling_change. + * procfs.c (info_proc): Major rework to expand "info proc" cmd. + * procfs.c (proc_desc): Update for latest changes. + * xm-irix4.h (CREATE_INFERIOR_HOOK): Protect by USE_PROC_FS. + * xm-irix4.h (NOTICE_SIGNAL_HANDLING_CHANGE): Add definition. + * xm-sysv4.h (NOTICE_SIGNAL_HANDLING_CHANGE): Add definition. + +Tue Mar 31 18:38:28 1992 Fred Fish (fnf@cygnus.com) + + * procfs.c (set_proc_siginfo): Add prototype and new function. + * procfs.c (detach, child_resume): Call set_proc_siginfo to set + up inferior siginfo struct. + * elfread.c (elf_symfile_read): Compute the relocation amount + by subtracting off the address of the ".text" section. + * solib.c: Add pointer to ".text" section to so_list struct. + * solib.c (solib_map_sections): Initialize pointer to ".text" + section in so_list struct. + * solib.c (symbol_add_stub): Pass base address of ".text" + section to symbol_file_add, rather than the load address of + the shared library. On SunOS they are the same. On SVR4 they + are not. + +Tue Mar 31 17:48:15 1992 Stu Grossman (grossman at cygnus.com) + + * mipsread.c (parse_procedure): PDR.isym should get pointer to + function name, not .gdbinfo. symbol. + +Tue Mar 31 17:05:04 1992 John Gilmore (gnu at cygnus.com) + + * breakpoint.c (breakpoint_1): Fix prototype, this time for sure! + +Tue Mar 31 11:01:06 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (VERSION): 4.4.8 + + * procfs.c (open_proc_file): Disable inherit-on-fork flag so that + commands in .cshrc/.profile won't get traced. + +Tue Mar 31 08:11:58 1992 John Gilmore (gnu at cygnus.com) + + * elfread.c (elf_symtab_read): Use xmalloc, not bfd_xmalloc. + * exec.c (build_section_table): Don't abort if no sections. + * sparc-tdep.c (single_step): Lint. + * utils.c (mrealloc): Handle realloc (0, size) case here. + +Mon Mar 30 16:50:43 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (alldeps.mak): Config files are now *.m[ht] as + opposed to m[ht]-*! + + * config/irix4.mh: Don't use coredep.o. It doesn't work with procfs. + + * mipsread.c (parse_symbol, parse_procedure): Re-do the way that + .gdbinfo. symbols are created. Move creation from parse_procedure + to parse_symbol, where it is fairly easy to grow the symtab. This + also fixes a symtab trashing bug on all mips-based systems. + * (got_numargs, lookup_numargs, free_numargs): Delete. Not + needed anymore. + * tm-mips.h, tm-iris3.h, mips-tdep.c, mipsread.c: Re-do struct + mips_extra_func_info, and all the PROC_xxx macros that look at it. + +Mon Mar 30 14:17:53 1992 Per Bothner (bothner@cygnus.com) + + * c-exp.y: Add missing return type to yyparse() prototype. + +Sat Mar 28 22:22:06 1992 John Gilmore (gnu at cygnus.com) + + Create and use macros for iterating on symtabs, psymtabs, msymbols. + + * minsyms.c (iterate_over_msymbols): Remove; clunky and slow. + * symfile.h, symtab.h (iterate_over_msymbols): Remove prototype + * coffread.c (coff_symfile_read): iterate_over_symtabs => ALL_SYMTABS. + (patch_opaque_types): Avoid dummy args and result. + * objfiles.c (have_partial_symbols, have_full_symbols, + have_minimal_symbols): explicit iteration => ALL_OBJFILES; simplify. + (iterate_over_objfiles, iterate_over_symtabs, + iterate_over_psymtabs): Remove, clunky and slow. + * objfiles.h: Replace iterate_over_* prototypes with ALL_SYMTABS, + ALL_PSYMTABS, and ALL_MSYMBOLS macros. + * symmisc.c (dump_symtab, dump_psymtab, dump_msymbols, + dump_objfile): Remove dummy args and results. Move filename + comparisons to callers. + (printsyms_command, printpsyms_command, printmsyms_command, + printobjfiles_command): iterate_over_* => ALL_*. Compare filenames. + * symtab.c (lookup_symtab_1, lookup_symtab, lookup_partial_symtab, + lookup_symbol, find_main_psymtab, find_pc_symtab, sources_info, + list_symbols, make_symbol_completion_list): Replace explicit + iteration with ALL_SYMTABS, ALL_PSYMTABS, or ALL_MSYMBOLS. + Eliminate Dijkstra flag crap, break out of loops with gotos. + (lookup_symtab_1): Protect '/' tests from short filenames. + (cplus_mangled_symbol): Move inline into lookup_symbol. + * xcoffexec.c (relocate_objfile_msymbols): Remove poor hack. + (relocate_minimal_symbol): Move inline to vmap_symtab. + (vmap_symtab): Replace iteration with ALL_OBJFILES, + iterate_over_msymbols with ALL_MSYMBOLS. + + Misc cleanup prior to release. + + * Makefile.in (VERSION): Roll to 4.4.7. + (HFILES): Add call-cmds.h. + * call-cmds.h: New header for command fns called by other files. + * breakpoint.c (watchpoints_info): Remove, same as breakpoints_info. + (breakpoint_1): Remove unused type arg. Change callers. + + * dwarfread.c (dwarf_build_psymtabs): Remove mainline test. + * mipsread.c (compare_symtabs, compare_psymtabs): Remove, unused. + * mipsread.c: Add prototypes for all static functions. + + * symmisc.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, + dump_blockvector, dump_block, dump_addrchass, dump_namespace, + dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove, unused. + * xcoffread.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, + dump_blockvector, dump_block, dump_addrchass, dump_namespace, + dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove 2nd + unused copy! + + * buildsym.c (define_symbol): Handle global register variables + (from Pierre Willard). Complain if register numbers are too large. + * target.c (nomemory): Now that higher levels examine errno, give EIO. + * tm-sparc.h: Don't #include <sun4/reg.h>. + * sparc-tdep.c (sparc_frame_chain, frame_saved_pc): Remove + dependency on <sun4/reg.h>. Start to handle cross-byte-order. + + * language.h: Avoid forward enum declaration. + * configure.in, tm-sun4os5.h, xm-sun4os5.h, config/sun4os5.mh, + config/sun4os5.mt: New host and target. + * defs.h (errno): #include <errno.h> rather than assuming int. + From Pierre Willard. + + * breakpoint.c, breakpoint.h, buildsym.c, coffread.c, cplus-dem.c, + dbxread.c, dwarfread.c, elfread.c, infcmd.c, infrun.c, inftarg.c, + language.c, main.c, mem-break.c, mips-tdep.c, mipsread.c, + partial-stab.h, remote.c, saber.suppress, symfile.c, symtab.c, + valops.c, valprint.c, xcoffread.c, c-exp.y, m2-exp.y, blockframe.c, + command.c, core.c, exec.c, gdbtypes.h, parse.c, printcmd.c, solib.c, + sparc-xdep.c, utils.c, value.h, values.c: Lint. + +Sat Mar 28 02:43:26 1992 John Gilmore (gnu at cygnus.com) + + * buildsym.c (read_range_type): Avoid int overflow by using unsigned. + * dbxread.c (dbx_symfile_init): Remove bogus `lvalue cast'. + * language.h (enum exp_opcode): Avoid forward enum def. + * main.c (define_command, user_defined_command): Lint. + * mem-break.c, xcoffread.c: Lint. + * solib.c: Only #include <a.out.h> on SunOS, not SVR4. + +Sun Mar 29 14:16:22 1992 Per Bothner (bothner@cygnus.com) + + * Merged in latest RS6000 diffs from Metin G. Ozisik. + * xcoffsolib.c, xcoffsolib.h: New files, from Metin. + * Various files: Changed #ifdef IBM6000 to IBM6000_HOST + or IBM6000_TARGET as (approximately) appropriate. + +Sat Mar 28 13:00:10 1992 Fred Fish (fnf@cygnus.com) + + * objfiles.h (OBJF_SYMS): Define flag bit for objfile flags. + * symfile.c (symbol_file_add): Use OBJF_SYMS to decide whether + or not to try reading symbols from a mapped objfile. Plugs memory + leak due to shared libraries generating no psymtabs or symtabs. + +Fri Mar 27 15:44:55 1992 John Gilmore (gnu at cygnus.com) + + * buildsym.c (MAX_OF_C_TYPE, MIN_OF_C_TYPE): Unused, remove. + * copying.awk: Lint. Make stronger warning at top of copying.c. + * elfread.c (elf_symtab_read): Eliminate check of mainline. + * gdbtypes.c (smash_to_*): Remove FIXME comments. + (lookup_pointer_type): Add FIXME comment. + * main.c (set_history_size_command): Disallow negative size. + * partial-stab.h: Update copyright. + * rs6000-tdep.c (skip_trampoline_code): Better comments. + +Wed Mar 25 10:45:38 1992 John Gilmore (gnu at cygnus.com) + + * main.c (set_history_size_command): Negative size is error. + (Reported by Peggy Fieland.) + +Thu Mar 26 17:01:18 1992 Fred Fish (fnf@cygnus.com) + + * coffread.c (coff_symfile_init): Update comment. + * dbxread.c (DBX_SYMFILE_INFO, DBX_TEXT_SECT, DBX_SYMCOUNT, + DBX_STRINGTAB, DBX_STRINGTAB_SIZE, DBX_SYMTAB_OFFSET): Define + macros to access the dbx specific objfile information. + * dbxread.c (symfile_string_table, symfile_string_table_size): + Remove these local variables. + * dbxread.c (read_ofile_symtab, psymtab_to_symtab_1, + read_dbx_symtab): Remove the stringtab and stringtab_size params + from the function prototypes, the function definition, and the + function calls. These are now available via DBX_STRINGTAB and + DBX_STRINGTAB_SIZE using the objfile pointer. + * dbxread.c (dbx_symfile_read): Relocate addr before using as + an arg to read_dbx_symtab. + * dbxread.c (dbx_symfile_read): Remove code that free'd the + stringtab and the dbx specific per-objfile private info. + * dbxread.c (init_psymbol_list): Remove symbol count from passed + args in prototype, function definition, and function calls. It is + now available via the DBX_SYMCOUNT macro using the objfile + pointer. + * dbxread.c (dbx_symfile_read, dbx_symfile_init): Remove the + local instance of struct dbx_symfile_info and replace with DBX_* + macros. + * dbxread.c (dbx_symfile_read): Remove init's of now deleted + symfile_string_table and symfile_string_table_size. + * dbxread.c (dbx_symfile_finish): Remove now obsolete free of + symfile_string_table. + * dbxread.c (init_psymbol_list): Use DBX_SYMCOUNT. + * dbxread.c (dbx_psymtab_to_symtab): Remove local stringtab and + stringtab size variables. Remove all code that used to reread + the stringtab. + * objfiles.c (allocate_objfile): Move calls to init_malloc() + to prior to any calls to mmalloc for the objfile specific heap. + * utils.c (init_malloc): Document the requirement that for each + heap for which corruption checking is desired, that init_mmalloc + must be called prior to any mmalloc calls on the heap. + +Thu Mar 26 13:20:06 1992 Per Bothner (bothner@cygnus.com) + + * rs6000-pinsn.c: Make dis-assembly output more like + other targets: Don't print instruction in hex before + the assembly; use print_address to print out jump + destinations. + +Wed Mar 25 16:52:35 1992 Per Bothner (bothner@cygnus.com) + + * c-exp.y, gdbtypes.h: Add builtin_type_signed_char. + * cplus-dem.c: Support "Sc" meaning "signed char". + +Wed Mar 25 15:21:44 1992 Stu Grossman (grossman at cygnus.com) + + * configure.in: fix iris/iris3. + +Wed Mar 25 14:55:48 1992 Per Bothner (bothner@cygnus.com) + + * command.c, main.c (various places): Use ctype.h macros + (such as isupper(x)), instead of hard-wiring in ASCII-isms + (such as (x >= 'A' && x <= 'Z')). + (There are still more of these in other files.) + * main.c (defined_command): Lower-case the user's + new command before entering it. Needed because + command lookup is case-insensitive (and also lower-cases). + (Based on Metin's earlier patch.) + +Tue Mar 24 23:27:01 1992 K. Richard Pixley (rich@cygnus.com) + + * config/irix4.mh: new file. + +Tue Mar 24 14:17:48 1992 Stu Grossman (grossman@cygnus.com) + + * infcmd.c (step_1): Call disable_longjmp_breakpoint at the right + time. + + * xm-mips.h: Declare strdup for ultrix. + + * mipsread.c (fixup_sigtramp): Make sure that current_objfile is setup + when calling new_symbol. + * mips-tdep.c (mips_frame_chain): Use symfile_objfile instead of + current_objfile. + +Tue Mar 24 13:26:25 1992 Per Bothner (bothner@rtl.cygnus.com) + + * config/rs6000.mh: Update (for Fred's new mmalloc) + flags to disable use of GNU malloc/mmalloc. + * munch: Change SYSV rule to allow .text before the label, + as well as after, to work for AIX. + * gdbtypes.h: Minor clarifiction. + +Tue Mar 24 07:26:19 1992 Michael Tiemann (tiemann@cygnus.com) + + * buildsym.c (read_struct_type): Handle cretinous dbx symbol name + continuation in yet another place (between method declarations). + +Mon Mar 23 23:01:41 1992 Stu Grossman (grossman at cygnus.com) + + * mips-tdep.c: include symfile.h and objfiles.h to fix + compilation errors. + +Mon Mar 23 15:49:14 1992 Per Bothner (bothner@cygnus.com) + + * valops.c (value_struct_elt_for_reference): Added 'offset' + parameter to handle multiple inheritance. + * eval.c, value.h: Update accordingly. + +Fri Mar 20 17:43:27 1992 Fred Fish (fnf@cygnus.com) + + * objfiles.h: New file + * Makefile.in (HFILES): Add objfiles.h + * blockframe.c: Remove entry_scope_lowpc, entry_scope_highpc, + main_scope_lowpc, main_scope_highpc. + * blockframe.c, buildsym.c, coffread.c, dbxread.c, dwarfread.c, + elfread.c, gdbtypes.h, minsyms.c, mipsread.c, objfiles.c, solib.c, + source.c, symfile.c, symmisc.c, symtab.c, target.c, xcoffexec.c, + xcoffread.c, : Include objfiles.h. + * tm-29k.h, tm-i386v.h, tm-merlin.h, tm-rs6000.h, tm-sun386.h, + tm-symmetry.h, tm-tahoe.h, tm-umax.h, tm-vax.h, m88k-tdep.c, + mips-tdep.c (FRAME_CHAIN): Renamed outside_startup_file to + inside_entry_file() and logic changed appropriately. + * blockframe.c (outside_startup_file): Renamed to + inside_entry_file() and logic changed appropriately. + * blockframe.c (inside_main_scope): Renamed to inside_main_func() + and logic changed to use per-objfile specific fields. + * blockframe.c (inside_entry_scope): Renamed to + inside_entry_func() and logic changed to use per-objfile specific + fields. + * blockframe.c, buildsym.h, coffread.c, dwarfread.c, mipsread.c, + symfile.c, mips-tdep.c (startup_file_start, startup_file_end): + Remove extern decls. + * symfile.c, symfile.h (entry_point): Remove extern decl. + * coffread.c (coff_symfile_init): Common entry point init code + moved to symfiles.c, call init_entry_point_info(). + * coffread.c (complete_symtab): Use new per-objfile entry info. + * mip-tdep.c (mips_frame_chain): Use new per-objfile entry info. + * mipsread.c (parse_partial_symbols): Use new per-objfile entry + info. + * dbxread.c (read_dbx_symtab): Use new per-objfile entry info. + * defs.h (inside_entry_scope, outside_startup_file, + inside_main_scope): Prototypes changed for renames to + inside_entry_func, inside_entry_file, inside_main_func, + respectively. + * symfile.c (syms_from_objfile): Common entry point init code + moved to init_entry_point_info() and call init_entry_point_info(). + * symfile.h (init_entry_point_info): Include prototype. + * xcoffread.c (aixcoff_symfile_init): Common entry point init code + moved to symfiles.c and call init_entry_point_info(). + * dwarfread.c (entry_scope_lowpc, entry_scope_highpc, + main_scope_lowpc, main_scope_highpc): Remove extern decls. + * dwarfread.c (read_func_scope, read_file_scope): Use new per- + objfile entry info. + * frame.h (FRAME_CHAIN_VALID): Provide default definition that + works for the majority of targets. + * tm-68k.h, tm-convex.h, tm-h8300.h, tm-i386v.h, tm-irix3.h, + tm-merlin.h, tm-mips.h, tm-pyr.h, tm-rs6000.h, tm-sparc.h, + tm-sun386.h, tm-tahoe.h, tm-umax.h, tm-vax.h (FRAME_CHAIN_VALID): + Use default definition in frame.h. + * frame.h (selected_frame_level): Make decl extern. + * objfiles.c, symfile.c (current_objfile): Moved to objfiles.c + * objfiles.c, symfile.c (symfile_objfile): Moved to objfiles.c + * partial-stab.h: Use new per-objfile entry info. + * symfile.h (struct objfile): Removed, moved to objfiles.h. + * symfile.h, objfiles.h (allocate_objfile, free_objfile, + free_all_objfiles, iterate_over_objfiles, iterate_over_symtabs, + iterate_over_psymtabs, have_partial_symbols, have_full_symbols, + have_minimal_symbols): Prototypes moved to objfiles.h. + * symfile.h, objfiles.h (ALL_OBJFILES, ALL_OBJFILES_SAFE): + Macros moved to objfiles.h. + * tm-h8300.h, tm-i386v4.h (FRAME_CHAIN_VALID_ALTERNATE): Define. + +Thu Mar 19 18:49:45 1992 Per Bothner (bothner@cygnus.com) + + More C++ improvements (pointers to members, qualified names). + * c-exp.y: Support exp.type::name and exp->type::name + syntaxes. (Unfortunately, doesn't work for static members.) + * c-exp.y, eval.c: Make type::~type work better. + * eval.c (evaluate_subexp: OP_SCOPE): Replace use of + value_static_field by value_struct_elt_for_reference. + * eval.c (evaluate_subexp): Merge code for STRUCTOP_MEMBER + and STRUCTOP_MPTR; cast arg1 to domain-type of arg2. + * eval.c (evaluate_subexp): Remove special case for UNOP_ADDR + for OP_SCOPE operand; no point in it now that we use lazy + reading of values, and use "reference to member" objects. + * gdbtypes.h: Clarify comment. + * valops.c: Change value_struct_elt_for_address to return + a reference (or variable), rather than a pointer. Change + the name to value_struct_elt_for_reference to reflect this. + Returning a reference instead of a address provides a + generalization, since we can use the routine for both + class::name as well as &class::name. + Also, recurse to handle multiple inheritance properly. + * valprint.c: Moved code to print pointer-to-members + to new function point_class_member. This allows a + "reference-to-member" to be printed using the same code. + * valprint.c (type_print_varspec_prefix): Avoid printing + "struct " for domains of class-member types. + * valops.c (search_struct_field): Inline code for simplified + version of value_static_field (which can then be deleted). + * value.h: Rename value_struct_elt_for_address to + value_struct_elt_for_reference. Delete value_static_field. + * values.c: Remove no longer used function value_static_field. + +Thu Mar 19 13:54:11 1992 Fred Fish (fnf@cygnus.com) + + * coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c, + elfread.c (coff_symfile_finish): Add function, prototype, and + add to the xxxx_sym_fns struct for each file type. Also reformat + the xxxx_sym_fns vector to a standard format and add comments. + * coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c, + elfread.c (xxx_symfile_new_init, xxx_symfile_init, xxx_symfile_read): + Pass pointer to struct objfile rather than pointer to sym_fns. + Change references inside each function accordingly. Allocate any + symbol file specific info in the per-objfile memory region. + * dbxread.c (free_and_init_header_files): Break function into + free_header_files(), called from dbx_symfile_finish(), and + init_header_files(), called from dbx_new_init(). + * dbxread.c (dbx_new_init): Move deallocation things to new + dbx_symfile_finish function. + * elfread.c (elf_new_init): Call buildsym_new_init(). + * objfiles.c (free_objfile): Call the appropriate symfile_finish() + routine for the objfile before deallocating other stuff. + * sparc-tdep.c (get_longjmp_target): Cast target_read_memory arg. + * symfile.h: Move struct sym_fns to before struct objfile def. + Add sym_finish function pointer and change prototypes of other + function pointers to reflect passing struct objfile pointer rather + than struct sym_fns pointer. + * symfile.c: Remove now obsolete symtab_fns pointer. + * symfile.c (symfile_init): Renamed to find_sym_fns, and now only + locates the correct sym_fns struct for the given objfile. + * symfile.c (syms_from_objfile, symbol_file_add): Restructured + for better support of mapped symbol tables. + * symfile.c (symbol_file_command): Remove obsolete code using + symfile_fns. + * symfile.h: Remove duplicate declarations for symfile_objfile, + entry_point, and object_files. + * target.c (target_info): Compare symfile_objfile to NULL. + * xcoffread.c (aixcoff_new_init): Move deallocation stuff to + aixcoff_symfile_finish(). + +Wed Mar 18 18:22:46 1992 Fred Fish (fnf@cygnus.com) + + * infrun.c (IN_SOLIB_TRAMPOLINE): Add default definition. + * infrun.c (wait_for_inferior): Use IN_SOLIB_TRAMPOLINE. + * tm-sysv4.h (IN_SOLIB_TRAMPOLINE): Add SVR4 definition. + +Wed Mar 18 15:51:15 1992 Per Bothner (bothner@cygnus.com) + + Some improvements to g++ debugging. + * symtab.c (list_symbols): demangle before pattern matching. + * symtab.c: Other fixes to improve handing of operators. + * valprint.c (type_print_base): Fix test for constructor. + * values.c (value_static_field): Allow evaluation of + CLASS::METHOD, returning a function pointer. + +Wed Mar 18 08:39:52 1992 Fred Fish (fnf@cygnus.com) + + * Makefile.in (VERSION): Roll 4.4.6. + * exec.c (exec_file_command): Add code to ignore optional args + passed in by file_command() for use in symbol_file_command(). + * main.c (main): Document -mapped and -readnow in help summary. + * objfiles.c (open_mapped_file): Cosmetic change, arg renamed. + * objfiles.c (allocate_objfile): Filename arg removed. Changes + to get filename from bfd with bfd_get_filename(). Test mapto + against 0, not NULL. Use mstrsave() to make copy of filename. + * remote-mm.c (mm_load): Symbol_file_add() takes an additional + arg. + * remote-vx.c (vx_load_command, add_symbol_stub): + Symbol_file_add() takes an additional arg. + * solib.c (symbol_add_stub): Symbol_file_add() takes an + additional arg. + * symfile.c (symfile_open): Renamed to symfile_bfd_open and + changed to return a bfd not an objfile pointer. + * symfile.c (syms_from_objfile): Eliminate local copy of bfd. + * symfile.c (symbol_file_add): Takes an additional arg (readnow). + Change to eliminate local bfd and use symfile_bfd_open() plus + allocate_objfile(). Add code to implement readnow option. + * symfile.c (symbol_file_command): Changes to option handling, + readnow functionality moved to symbol_file_add(). + * symfile.c (symfile_init): Eliminate local copy of bfd. + * symfile.c (add_symbol_file_command): Changes to parse mapped + and readnow options. + * symfile.h (allocate_objfile): Arg removed from prototype. + * symtab.h (symbol_file_add): Arg added to prototype. + * xcoffexec.c (map_vmap): Allocate_objfile() takes an additional + arg. + +Sat Mar 14 16:38:47 1992 Fred Fish (fnf@cygnus.com) + + * gmalloc.c, gmalloc.h mcheck.c mmap-alloc.c mmap-sbrk.c mtrace.c, + mtrace.awk, state.c, state.h: Removed. + * .gdbinit: Add ../malloc, ../libiberty, and ../bfd to list of + directories searched for source files. + * Makefile.in (GNU_MALLOC, MALLOC_CFLAGS, MALLOCSRC): Removed + * Makefile.in (MMALLOC_DIR, MMALLOC_DEP, MMALLOC_LIB, + MMALLOC_DISABLE, MMALLOC_CHECK, MMALLOC_CFLAGS): Add + * Makefile.in (CFLAGS): Replace MALLOC_CFLAGS with MMALLOC_CFLAGS. + * Makefile.in (CLIBS, CDEPS): Add MMALLOC_LIB + * Makefile.in (ADD_FILES, ADD_DEPS): Remove GNU_MALLOC. + * Makefile.in (SFILES_MAINDIR): Remove stat.c mmap-alloc.c, mmap- + sbrk.c + * Makefile.in (HFILES): Remove state.h + * Makefile.in (POSSLIBS_MAINDIR): Remove MALLOCSRC. + * Makefile.in (OBS): Remove state.o mmap-alloc.o mmap-sbrk.o + * Makefile.in (saber_gdb): Remove mcheck, mtrace. Add MMALLOC_DIR. + * Makefile.in (clean): Remove all object files. + * c-exp.y: Define malloc to xmalloc and realloc to xrealloc. + * cplus-dem.c: Remove prototypes definitions that are now done in + def.h. + * dbxread.c (throughout): Change from using per-objfile + xmalloc/xrealloc/free functions to xmmalloc/xmrealloc/mfree. + * defs.h: Remove prototypes for mmap_* functions. Add prototypes + for xmmalloc, xmrealloc, mfree, mmcheck, mmtrace, mmalloc_attach, + mmalloc_detach, mmalloc_setkey, msavestring, and mstrsave, nomem. + * depend: Remove dependencies for state.o, state.h. + * dwarfread.c: Add declaration for warning_pre_print. + * dwarfread.c (dwarfwarn): Use warning_pre_print. + * dwarfread.c (throughout): Change from using per-objfile + xmalloc/xrealloc/free functions to xmmalloc/xmrealloc/mfree. + * gdbtypes.c (lookup_fundamental_type): Fix init_type calls to + use supplied objfile. + * i386-xdep.c (print_387_status): Change to use warning() rather + than printfs. + * i387-tdep.c (print_387_control_word): Change to use warning() + rather than printfs. + * infrun.c (wait_for_inferior): Remove unreachable abort() call + that some compilers grumble about. + * language.c (throughout): Add declaration for warning_pre_print + and using warning() instead of printfs. + * m2-exp.y: Define malloc to xmalloc and realloc to xrealloc. + * main.c (main): Add declaration for warning_pre_print and set it + similarly to error_pre_print. Add declarations for + mapped_symbol_files and readnow_symbol_files. Add appropriate + definitions to long_options[]. + * minsyms.c: Trivial fix to comment. + * objfiles.c (allocate_objfile): Substantially rewritten for + using mapped symbol files. + * objfiles.c (throughout): Change from using per-objfile + xmalloc/xrealloc/free functions to xmmalloc/xmrealloc/mfree. + * objfiles.c (open_mapped_file, mapped_to_address): Add functions. + * source.c (throughout): Change from using per-objfile + xmalloc/xrealloc/free functions to xmmalloc/xmrealloc/mfree. + * source.c (open_source_file): Use mstrsave to save file name in + mapped symbol region for objfile. + * symfile.c: Remove include for state.h. + include to local form. + * symfile.c (symbol_file_add_digested): Remove. + * symfile.c (symbol_file_add): Substantially rewritten for mapped + symbol files. + * symfile.h: Remove malloc/xrealloc/xmalloc/xrealloc/free members + from objfile structure. Add malloc descriptor pointer (md). + * symfile.h (OBJF_DUMPABLE): Changed name to OBJF_MAPPED. + * symm-xdep.c (print_fpu_status): Use warning() rather than + printfs. + * symmisc.c (free_symtab_block): Now takes and uses current + objfile pointer. + * symmisc.c (throughout): Change from using per-objfile + xmalloc/xrealloc/free functions to xmmalloc/xmrealloc/mfree. + * symtab.c (cplus_mangled_symbol): Cast return value to avoid + Sun compiler grumblings when PTR is char *. + * symtab.c (lookup_symbol): Cast return value of iterate_over_ + msymbols() to correct pointer type. + * utils.c (warning_pre_print): Initialize to "\nwarning: ". + * utils.c (fatal, fatal_dump_core): Ensure that the fatal + error always starts on a line of it's own. + * utils.c (init_malloc, malloc_botch, xmalloc, xrealloc): + Rewrite for new mapped malloc package use. + * utils.c (mmalloc, mrealloc, mfree): Stubs for configurations + that don't want to use the mapped malloc package; pass arguments + on to traditional malloc package functions. + * utils.c (nomem): Add for fatal virtual memory exhausted aborts. + * utils.c (xmmalloc, xmrealloc, xmalloc, xrealloc): Like mmalloc, + mrealloc, malloc, and realloc but get fatal error if runs out + of memory. + * utils.c (msavestring, mstrsave): Save a string in a specific + mapped malloc region. + * utils.c (print_spaces): Use xmalloc to get the buffer. + * xm-amix.h, xm-i386v4.h, xm-sun3os4.h, xm-sun4os4.h: Add defines + for MMAP_BASE_ADDRESS and MMAP_INCREMENT. + * config/i386v4.mh: Insignificant reorganization. + +Sat Mar 14 11:44:47 1992 Fred Fish (fnf@cygnus.com) + + * xcoffread.c: Only enable compilation of debugging functions + if IBM6000 is defined. Fails to compile otherwise. + +Fri Mar 13 15:51:11 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: pass MAKEINFO down on info. + +Fri Mar 13 12:56:36 1992 John Gilmore (gnu at cygnus.com) + + * mipsread.c (mipscoff_symfile_read): Eliminate a lot of + useless code, including an lseek to an uninitialized variable. + Reported by Jim Williams <jimbo@wrs.com>. + +Thu Mar 12 11:56:46 1992 Per Bothner (bothner@cygnus.com) + + Merged in patches from metin@ibmpa.awdpa.ibm.com (Metin G. + Ozisik) (dated Fri, 6 Mar 92 17:51) for the rs6000. + * minsyms.c, symfile.c: Changes that may be generally + applicable, but are #ifdef IBM6000 for now. + * rs6000-xdep.c: Fixed typo in comment. + * rs6000-tdep.c: Non-substatial changes. + * xoffread.c: The main change here is addition of some + debugging functions. + * xoffexec.c: More changes. + + * xcoffread.c: Fixed two too-few-parameters bugs. + + * solib.h, infrun.c, tm-rs6000.h: Add a PID parameter + to SOLIB_CREATE_INFERIOR_HOOK macro. + +Sun Mar 8 21:17:48 1992 Fred Fish (fnf@cygnus.com) + + * symfile.h: Add prototype for iterate_over_msymbols(). + * symtab.c (cplus_mangled_symbol): Add function. + * symtab.c (lookup_symbol): Call cplus_mangled_symbol via + iterate_over_msymbols to find demangled C++ symbol. + * xcoffexec.c (relocate_minimal_symbol): Return meaningful + value to iterate_over_msymbols(). + * xcoffexec.c (vmap_symtab): Ignore return from iterate_over_ + msymbols(). + +Fri Mar 6 21:59:34 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: added check target. + +Thu Mar 5 23:56:01 1992 John Gilmore (gnu at cygnus.com) + + * ecoff.c: Move to ../bfd/coff-msym.c. + * config/mt-*mips: Remove ecoff.o from the configuration. + * remote.c (): Add newline to initial +. + (remote_resume): Mention how to cope with signals. + (remote_interrupt): Add debug msg. + (remote-wait): Implement new 'T' reply, which includes + status, PC, and FP all in a single short message. + (putpkt): Add further debugging of packet acks. + * mipsread.c (fixup_symtab): Also swap RFD's. + (parse_partial_symbols): Avoid bug on unknown symbol types. + * Makefile.in (VERSION): Roll to 4.4.5. + * mips-tdep.c (heuristic_proc_start): Avoid long delays + for remote MIPS by limiting heuristic to 200 byte search. + (heuristic_proc_desc): Byte-swapping. + (mips_print_register): Cope with failure of + read_relative_register_raw_bytes. Byte-swap integers for + printing. + * mips-pinsn.c (print_insn): Byte-swap instruction. + +Thu Mar 5 12:32:09 1992 Stu Grossman (grossman at cygnus.com) + + * config.sub configure.in config/mh-irix4 + gdb/configure.in gdb/mips-tdep.c gdb/mipsread.c + gdb/procfs.c gdb/signame.h gdb/tm-irix3.h gdb/tm-mips.h + gdb/xm-irix4.h gdb/config/mt-irix3 + gdb/config/mh-irix4 texinfo/configure.in: Port to SGI Irix-4.x. + +Wed Mar 4 11:56:42 1992 Fred Fish (fnf@cygnus.com) + + * defs.h, utils.c: xrealloc takes PTR as first arg. + * defs.h: Reword confusing comment about ANSI prototypes. + * defs.h: Some minor whitespace changes. + * infrun.c (wait_for_inferior): Compare int tmp to int 0, + not NULL, which can be (void *). + * tm-amix.h, tm-i386v4.h: Add defines for setjmp/longjmp handling. + * tm-i386v.h (SP_ARG0): Define + * xm-sysv4.h: Back out of change for missing prototypes. + * i386-tdep.c (get_longjmp_target): Add function. + +Wed Mar 4 05:46:11 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: install man page too. + +Tue Mar 3 15:11:52 1992 Michael Tiemann (tiemann@cygnus.com) + + * All GDB files that #include defs.h: Removed stdio.h. + (defs.h): #include stdio.h. + +Mon Mar 2 23:00:12 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * gdbtypes.c (lookup_pointer_type): initialize the TYPE_LENGTH of + a ptype to reflect the setting of TARGET_PTR_BIT. Set the + TYPE_FLAGS of a ptype to TYPE_FLAG_UNSIGNED. + * tm-h8300.h, h8300-tdep.c, remote-hms.c: personal checkpoint + * printcmd.c (print_address): if ADDR_BITS_REMOVE is defined, use + it before printing out the hex shape of an address. + +Sun Mar 1 17:41:09 1992 Per Bothner (bothner@cygnus.com) + + * rs6000-xdep.c (frame_initial_stack_address): Move + code to set frame->cache_fsr into new separate function + frame_get_cacahe_fsr. This allows fixing a fatal error. + * xcoffexec.c: Turn previously suppressed error + message back on, after cleaning up BFD. + + * breakpoint.c (breakpoint_re_set): Removed (at least for now) + printing of blank line, since it cases printing of an + extra blank line. Is this intended? It does mess up + gdb test suite. + * defs.h: Put back declarations of malloc and realloc, + but protected by #ifndef MALLOC_INCOMPATIBLE. + * objfiles.c: Undo previous change: Use malloc/realloc + for objfile malloc/realloc fields (but add a cast). + * xcoffexec.c: Suppress an error message (for now). + +Sat Feb 29 14:43:02 1992 Per Bothner (bothner@cygnus.com) + + Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik) + [Mail dated Fri, 21 Feb 92 13:14:54 -0800] + * buildsym.c: Use smash_to_pointer_type() to handle forward type + references. + * xcoffread.c: Modifications to C_DECL storage class handling, and + introduction of an old smash_to_pointer_type() routine. + + Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik) + [Mail dated Thu, 20 Feb 92 13:57:16 -0800] + * rs6000-xdep.c, rs6000-tdep.c, tm-rs6000.h: function_frame_info() + parameters have been modified. + + Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik) + [Mail dated Thu, 20 Feb 92 10:10:05 -0800] + * rs6000-tdep.c: Before Feb 5 92, register_valid[] array was not used, + and fetch_inferior_registers() always fetched all the registers + resulting valid register values at hand all the time. Pushing a dummy + frame did not require validating all register values first. After + putting the above mechanism into action, we didn't have valid registers + values always ready. Thus, all registers need to be fetched before + pushing a dummy frame now. + + Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik) + [Mail dated Thu, 13 Feb 92 16:22:44 -0800] + * rs6000-xdep.c: frame_initial_stack_address() function to calculate + the starting address (actual frame address) of a frame. + * rs6000-tdep.c: modifications to function_frame_info() to see if + function reserves a frame pointer register (alloca register) + * tm-rs6000.h: EXTRA_FRAME_INFO, FRAME_ARGS_ADDRESS and + FRAME_LOCALS_ADDRESS has been updated to support debugging of + functions with alloca() calls. + +Sun Mar 1 13:13:39 1992 Fred Fish (fnf@cygnus.com) + + * xm-sysv4.h: Provide definitions/prototypes for host environment + functions for which no definitions or prototypes are provided in + any currently included gdb or host environment header files. + For SVR4, this currently includes malloc and realloc, which cannot + be portably prototyped in any gdb include file. + +Sat Feb 29 14:43:02 1992 Per Bothner (bothner@cygnus.com) + + * buildsym.h: Remove obsolete variable file_stabs. + + * Makefile.in: Move place where configure merges in host- + and target-dependent fragments later, so the latter + can override (say) GNU_MALLOC. + * config/mh-rs6000: Use system malloc. Otherwise, I + ended up with *two* incompatible versions of malloc + (functions in libc would call the malloc in libc). + I assume this is a shared library problem. + + * remote.c: Fix (presumed) typo. + * objfiles.c: Use xmalloc/xrealloc instead of + malloc/realloc (since the latter are no longer declared). + + Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik) + [Mail dated Thu, 6 Feb 1992 10:22:02 -0800] + * rs6000-xdep.c: Improvements to fetch_inferior_registers() to + handle individual registers. + * tm-rs6000.h: Fix SAVED_PC_AFTER_CALL macro to handle pc value + correctly in case it wasn't cached yet. (A problem showed up + after fetching individual registers.) + * buildsym.c: Disable type_synonym_name's type name overwriting + in cases it is unnecesary. rs6000 portation doesn't use + type_synonym_name, and it used to nullify type names + * xcoffread.c: to handle g++'s typename abbreviation, fill in a + type's name as soon as space for that type is allocated. + * xcoffread.c: ignore a section's lineno information if it is + not `.text'. (In rs6000 bfd portation integration, skipping over + `.pad' sections are ignored since it was in machine independent + part of the code. Thus, a problem of fake sections with invalid + lineno information arised.) + + Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik) + [Mail dated Thu, 6 Feb 1992 13:26:22 -0800] + * rs6000-tdep.c: make function_frame_info() work whether or not + reading from a core file. + * tm-rs6000.h: Implementation of FRAME_FIND_SAVED_REGS macro. + + * infrun.c. main.c, printcmd.c. symtab.c: + More changes from IBM for rs6000. + + +Thu Feb 27 22:57:19 1992 Per Bothner (bothner@cygnus.com) + + * rs6k-opcode.h, tm-rs6000.h, xm-rs6000.h, rs6000-tdep.c, + rs6000-xdep.c, xcoffexec.c, xcoffread.c: + Merge in changes (mostly from IBM) for RS6000. + * breakpoint.c, buildsym.c, infptrace.c, stack.c, symtab.c: + More changes from IBM for RS6000. These are in machine- + independent code, and probably could do with some cleaning + up. The most questionable of these are #ifdef IBM6000. + * infrun.c, sparc-tdep.c: Pass a parameter (signal number) + to single_step() (for consistency with rs6000 and i860). + * utils.c: Allow the 1st arg to xrealloc to be NULL + (in which case do malloc). This removes the need for + some tests in xcoff code (and perhaps other places?). + * coffread.c: Removed variables last_source_file, + type_vector, and type_vector_length as these are now + defined by buildsym.[ch]. + * defs.h: Remove prototypes for malloc and realloc, since + these should only be used to implement xmalloc and xrealloc, + and they conflict with <stdlib.h> in AIX - where they + return void* even when __STDC__ isn't defined. Sigh. + * munch: Recognize *initialize* in data as well as text + (AIX uses data). Also, incorporate a patch from Garrett + Wollman <wollman@uvm-gen.uvm.edu> to make the sed script + much more sensible, by only trying to match the name of + the initialize_foo function, and not the junk before it. + +Thu Feb 27 20:07:43 1992 Stu Grossman (grossman at cygnus.com) + + * breakpoint.c (breakpoint_re_set_one): Don't reset breakpoint + unless symbol table indicates that something has changed. + +Thu Feb 27 11:48:47 1992 John Gilmore (gnu at cygnus.com) + + * remote.c: Make it work for embedded MIPS. Increase buffer + size, and use throughout. Round buffer size up if too many regs. + Support baud rate setting and try for an 8-bit path. If + interrupted while waiting for target, send a ^C down the wire. + Avoid single-byte reads. + * tm-mips.h: Add more embedded-system registers to REGISTER_NAMES + and NUM_REGS. + * mips-xdep.h: Avoid the embedded regs when on Unix. + + * mipsread.c: Byte-swap the symbol table structures, using + routines from ecoff.c, to read a symbol table written in any + of the four possible byte orders. + * configure.in (mips-big-* target): Same as Sony News. + * config/mt-bigmips, config/mt-littlemips: Add ecoff.o. + * ecoff.c: New file for symbol swapping routines. + +Thu Feb 27 09:26:38 1992 Stu Grossman (grossman at cygnus.com) + + * breakpoint.c (all_breakpoints_info, breakpoint_1): Add 'info + all-breakpoints' command. + * (get_number): Allow users to enter negative breakpoint numbers. + * (breakpoint_1): Reformat display of 'info break' to show new + fields. + * (create_longjmp_breakpoint, breakpoint_re_set, + breakpoint_re_set_one, enable/disable_longjmp_breakpoint), + symfile.c (syms_from_objfile): Re-do + insertion of longjmp breakpoints. Move all code into + breakpoint_re_set, and call that instead of + create_longjmp_breakpoint in symfile.c. + +Thu Feb 27 06:11:05 1992 John Gilmore (gnu at cygnus.com) + + * breakpoint.h (ALL_BREAKPOINTS_SAFE): Add. + * breakpoint.c (breakpoint_re_set): Use ALL_BREAKPOINTS_SAFE. + * symtab.c (find_pc_symtab): Handle having no objfiles. + * infcmd.c: Fix comment. + * objfiles.c (free_all_objfiles): Add. + * symfile.h (ALL_OBJFILES, ALL_OBJFILES_SAFE): Add. + * symfile.c (symbol_file_command): free all objfiles when + specifying a new symbol file. + (reread_symbols): Stat the file name, don't fstat the descriptor. + +Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in, configure.in: removed traces of namesubdir, + -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced + copyrights to '92, changed some from Cygnus to FSF. + +Tue Feb 25 19:31:19 1992 Stu Grossman (grossman at cygnus.com) + + * dbxread.c (end_psymtab): Delete empty psymtabs. + * symfile.c (allocate_psymtab): Recycle empty psymtabs. + * symfile.h (struct objfile): Add free_psymtabs. + +Sat Feb 22 02:00:32 1992 John Gilmore (gnu at cygnus.com) + + * Makefile.in (VERSION): Roll to gdb-4.4.4. + + * symfile.c (symbol_file_command): strcmp => !strcmp. + * breakpoint.h: Move prototypes to follow enum definition they need. + * breakpoint.c, infrun.c: Lint. + * printcmd.c: Use `enum enable' rather than `enum + display_status'. + * mipsread.c: First pass at making it compile with the new + objfile changes. Probably seriously broken still, but it + compiles. FIXME. + +Sat Feb 22 00:56:39 1992 Stu Grossman (grossman at cygnus.com) + + * infrun.c, infcmd.c, breakpoint.c, main.c, symfile.c, + breakpoint.h, tm-sun4os4.h, tm-sparc.h, sparc-tdep.c, tm-mips.h, + mips-tdep.h, tm-sun3.h, tm-68k.h, m68k-tdep.h: Add support for + stepping (and nexting) through longjmp(). Also, cleanup + breakpoint handling quite a bit by creating explicit breakpoint + types instead of using magic breakpoint numbers. + Makefile.in: Update version to 4.4.3 + +Sat Feb 22 00:08:50 1992 John Gilmore (gnu at cygnus.com) + + * buildsym.c, dwarfread.c, gdbtypes.c, inflow.c, main.c, + minsyms.c, printcmd.c, remote.c, saber.suppress: Saberlint. + * symmisc.c, xcoffread.c: Move debug functions to symmisc.c. + + * xm-sun3os4.h, xm-sun4os4.h: Enable HAVE_MMAP. + + * minsyms.c (install_minimal_symbols): Add bunches to any + existing minsyms in the objfile. Avoid extra mallocation + by working directly in the obstack. Remove ignored `mainline' parm. + * coffread.c, dbxread.c, elfread.c, mipsread.c, solib.c, symtab.h, + xcoffread.c: Change all callers. + * FIXME: We should be able to eliminate MAINLINE from all the + symbol readers now, with a small bit of work. + + * valops.c, value.h: Lint. + * remote-vx.c: Add missing break; statement. Bugfix by + Michael Sclafani, <sclafani@src.dec.com>. + +Fri Feb 21 17:29:54 1992 Fred Fish (fnf at cygnus.com) + + * Makefile.in (VERSION): Update version to 4.4.2 + * Makefile.in (SFILES_MAINDIR): Add gdbtypes.c, state.c, objfiles.c, + minsyms.c, mmap-alloc.c, mmap-sbrk.c + * Makefile.in (HFILES): Add gdbtypes.h, state.h, solib.h + * Makefile.in (OBS): Add gdbtypes.o, state.o, objfiles.o, minsyms.o, + mmap-alloc.o, mmap-sbrk.o + + * altos-xdep.c: Minor whitespace change. + * am29k-tdep.c (examine_prologue): Convert from misc function vector + use to new minimal symbol table use. + * arm-xdep.c (fetch_inferior_registers): Document unused argument. + * arm-xdep.c (store_inferior_registers): Returns void. + * blockframe.c (get_pc_function_start, find_pc_partial_function): + Convert from misc function vector use to new minimal symbol table use. + Remove find_pc_misc_function(). Ifdef out block_innermost_frame(). + * breakpoint.c: Add prototypes for local functions. + * breakpoint.c (catch_command_1): Change to static and remove unused + local "pc". + * breakpoint.c (map_breakpoint_numbers): Prototype arg "function". + * breakpoint.h: Change function decls to prototype form. + * buildsym.c: Add prototypes for local functions. + * buildsym.c: Moved hashname() function here from dbxread.c. + * buildsym.c (dbx_lookup_type): Cast args to xrealloc(). + * buildsym.c: Remove dbx_create_type(), uses changed to alloc_type(). + * buildsym.c (dbx_alloc_type): Change to static. + * buildsym.c (finish_block): Add objfile parameter. + * buildsym.c (misc): Change symbol_obstack to objfile version. + * buildsym.c (make_blockvector): Change to static. + * buildsym.c (start_subfile): Use strdup instead of obsavestring. + * buildsym.c (compare_line_numbers): Change to static, args are const, + cast args when used. + * buildsym.c (start_symtab): Inline new_object_header_files() call. + * buildsym.c (patch_block_stabs): Moved to this file from xcoffread + and made static. Add objfile parameter. + * buildsym.c (end_symtab): Simplify code using line table size. + Realloc the linetable on the objfile symbol_obstack and copy there. + * buildsym.c (scan_file_globals): Convert from misc function vector + use to new minimal symbol use. + * buildsym.c (define_symbol): Add objfile parameter. Make sure + strings get allocated in objfile's symbol_obstack. Convert references + to builtin types to lookup_fundamental_type(). + * buildsym.c (read_type): Make static, add objfile parameter, convert + references to buildin types to lookup_fundamental_type(). + * buildsym.c (read_struct_type): Add objfile parameter. + * buildsym.c (read_array_type): Make static, add objfile parameter. + * buildsym.c (read_enum_type): Make static, add objfile parameter. + * buildsym.c (read_huge_number): Make static. + * buildsym.c (read_range_type): Make static, add objfile parameter, + convert references to buildin types to lookup_fundamental_type (). + * buildsym.c (read_args): Make static, add objfile parameter. + * buildsym.h: Convert function decl's to prototype form. + * c-exp.y: Add prototypes for local functions, convert uses of misc + function vector to minimal symbol table. Reformat all builtin type + initializations and pass a NULL objfile to init_type() for them. + * coffread.c: Change context_stack ref's to coff_context_stack, + add local function prototypes. Cast uses of xrealloc arg 1. + * coffread.c (coff_alloc_type): Call alloc_type instead of hand- + crafting a new type. + * coffread.c (add_symbol_to_list): Change to coff_add_symbol_to_list. + * coffread.c (finish_block): Change name to coff_finish_block. + * coffread.c (make_blockvector): Add and use objfile parameter. + * coffread.c (record_line): Change name to coff_record_line. + * coffread.c (start_symtab): Change name to coff_start_symtab. + * coffread.c (end_symtab): Change name to coff_end_symtab. + * coffread.c (record_misc_function): Change name to record_minimal_ + symbol and change to minimal symbol table use from misc func tbl. + * coffread.c (coff_symfile_read): Convert from misc function vector + use to minimal symbol table use. + * coffread.c (hashname): Remove; use common version in buildsym.c. + * coffread.c (decode_base_type): Change references to builtin types + to calls to lookup_fundamental_type(). + * coffread.c (read_struct_type): Change name to coff_read_struct_type. + * coffread.c (read_enum_type): Change name to coff_read_enum_type. + * command.c: Add prototypes for local functions. + * command.c (add_cmd): Prototype the 'fun' parameter and use the + appropriate member of the function union for that type. + * command.c (add_abbrev_cmd): Prototype the 'fun' parameter and + ifdef out the function since it isn't currently used. + * command.c (add_alias_cmd): Pass correct function type to add_cmd. + * command.c (add_prefix_cmd): Prototype the 'fun' parameter. + * command.c (add_abbrev_prefix_cmd): Prototype the 'fun' parameter. + * command.c (help_cmd): Compare function pointer to NULL. + * command.c (help_cmd_list): Compare function pointer to NULL. + * command.c (lookup_cmd_1): Use correct member of function union. + * command.c (undef_cmd_error): Make static. + * command.c (complete_on_cmdlist): Use correct member of func union. + * command.c (do_setshow_command): Use correct member of func union. + * command.c (shell_escape): Convert rindex use to strrchr. + * command.h (COMMAND_H): Define if already included. + * command.h (cmd_list_element struct): Change 'function' to a union + and prototype args. Prototype completer function. + * command.h: Convert decl's to prototype form. + * convex-xdep.c (store_inferior_registers): Returns void. + * copying.c: Prototype local functions. + * coredep.c: Minor whitespace change. + * cplus-dem.c: Remove hack to use BSD equivalents of mem* and str*. + * cplus-dem.c: Prototype local functions. + * dbxread.c (hashname): Remove; moved to buildsym.c. + * dbxread.c (free_and_init_header_files): Make static. + * dbxread.c: Add prototypes for local functions. + * dbxread.c (new_object_header_files): Remove; inlined usages. + * dbxread.c (xrealloc usages): Cast args. + * dbxread.c (record_misc_function): Change to record_minimal_symbol + and change usages accordingly. + * dbxread.c (static_psymbols usages): Change to use per-objfile copy. + * dbxread.c (xmalloc usages): Use per-objfile copy when appropriate. + * dbxread.c (dbx_next_symbol_text): Make static. + * dbxread.c (init_psymbol_list): Convert to use per-objfile data. + * dbxread.c (init_bincl_list): Add and use objfile parameter. + * dbxread.c (free_bincl_list): Add and use objfile parameter. + * dbxread.c (compare_psymbols): Remove; use common symfile.c version. + * dbxread.c (end_psymtab): Convert to use per-objfile data. + * dwarfread.c (DEFUN/EXFUN): Remove all usages. Use PARAMS for + prototypes. + * dwarfread.c (record_misc_function): Change name to record_minimal_ + symbol and use minimal symbol table throughout. + * dwarfread.c (compare_psymbols): Remove; use common symtab.c version. + * dwarfread.c: Convert all references to builtin types to use the new + lookup_fundamental_type function. + * dwarfread.c (read_enumeration): Add and use objfile parameter. + * elfread.c (DEFUN/EXFUN): Remove all usages. Use PARAMS for proto- + types. + * elfread.c (record_misc_function): Convert to use record_minimal_ + symbol. + * elfread.c (elf_symtab_read): Add objfile parameter. + * eval.c: Add prototypes for local functions and move some decls + around to accomodate prototypes. + * expprint.c: Add prototypes for local functions. Change references + to misc function vector to minimal symbol table. + * findvar.c (read_memory usages): Cast args. + * gdbtypes.h: New file, type info from symfile.h and symtab.h. + * gmalloc.c: Use NOARGS where prototypes used hardwired void. + * gmalloc.c (BLOCKSIZE): Constant to be shifted is unsigned. + * gmalloc.h: Use NOARGS where prototypes used hardwired void. + * gould-xdep.c: Minor whitespace change. + * hp300ux-xdep.c (fetch_inferior_registers): Remove unused regno var. + * hp300ux-xdep.c (store_inferior_registers): Returns void. + * hp300ux-xdep.c (fetch_core_registers): Takes unused arg reg_addr. + * i386-stub.c: Add prototypes, change "volatile" to NORETURN. + * i386-tdep.c: Add prototypes for local functions. + * i386-tdep.c (codestream_fill, codestream_seek, codestream_read, + i386_get_frame_setup, i386_skip_prologue): Explicitly declare params + that defaulted to int. + * i386-tdep.c (i386_follow_jump, i386_frame_find_saved_regs, + i386_push_dummy_frame): Returns void. + * i386-xdep.c (i386_register_u_addr): Declare params that default to + int and explicitly declare return type as int. + * i387-tdep.c: Minor formatting changes. + * i960-tdep.c (leafproc_return): Convert from misc function vector + use to minimal symbol table use. + * infcmd.c: Add prototypes for local functions. + * infcmd.c (continue_command, until_next_command, until_command, + path_info, path_command): Make static. + * infcmd.c (step_1, until_next_command): Convert from misc func + vector to minimal symbol table use. + * inflow.c: Add prototypes for local functions. + * infptrace.c (store_inferior_registers): Returns void, not int. + * language.c (_initialize_language): Use proper member of function + union. + * m2-exp.y: Add prototypes for local functions, convert misc function + vector uses to minimal symbol table uses. + * m2-exp.y (make_qualname, yyerror): Make static. + * m2-exp.y (_initialize_m2_exp): Call init_types with NULL objfile. + * m68k-pinsn.c: Add prototypes for local functions. + * m68k-pinsn.c (print_insn): Cast args to read_memory. + * m68k-pinsn.c (fetch_arg): Make parameter 'code' and int. + * m68k-stub.c: Add prototypes. + * m88k-pinsn.c (sprint_address): Convert from misc function vector + use to minimal symbol table use. + * m88k-xdep.c (fetch_inferior_registers): Takes an unused parameter. + * m88k-xdep.c (store_inferior_registers): Returns void. + * mach386-xdep.c (fetch_inferior_registers): Takes an unused param. + * mach386-xdep.c (store_inferior_registers): Returns void. + * mach386-xdep.c (fetch_core_registers): Takes an unused parameter. + * main.c: Add prototypes for local functions. + * main.c (return_to_top_level): Is type NORETURN (volatile). Cast + longjmp() result to (NORETURN void). + * main.c (catch_errors): Prototype the 'func' parameter. + * main.c (disconnect, stop_sig, do_nothin, float_handler): + Takes an unused arg. + * main.c (execute_command): Call the right member of the func union. + * main.c (command_loop_marker, symbol_completion_function, + command_loop): Make static. + * main.c (command_line_input): Make linelength unsigned, cast arg + to command_line_input(). + * main.c (add_info, add_com): Prototype the 'fun' parameter. + * main.c (initialize_main): Call right member of function union. + * mcheck.c (NOARGS): Change hardwired void in prototypes to NOARGS. + * mem-break.c: Include symtab.h + * mips-xdep.c (fetch_inferior_registers): Takes unused param. + * mips-xdep.c (store_inferior_registers): Returns void. + * mipsread.c (mipscoff_symfile_read): Change from misc function vector + use to minimal symbol table use. + * mipsread.c (symbol_obstack usages): Convert all to use per-objfile + version. + * mipsread.c (make_type): Remove, convert usages to init_type. + * mipsread.c (_initialize_mipsread): Call init_type with NULL objfile. + * nindy-tdep.c (nindy_frame_chain_valid): Convert from misc function + vector use to minimal symbol table use. + * parse.c: Add prototypes for local functions. + * parse.c (xrealloc usages): Cast args. + * parse.c (prefixify_expression, length_of_subexp): Make static. + * parser-defs.h (PARSER_DEFS_H): Define when first included. + * parser-defs.h: Convert function decls to prototype form. + * partial-stab.h: Convert from misc function vector use to new minimal + symbol table use. + * partial-stab.h (global_psymbols, static_psymbols usages): Reference + the per-objfile copies. + * printcmd.c: Add prototypes for local functions. Move some struct + definitions around to accomodate prototypes. + * printcmd.c (decode_format): Make static, change args oformat and + osize to int from char. + * printcmd.c (print_formatted): Change 'format' and 'size' to int. + * printcmd.c (print_scalar_formatted): Change arg 'format' to int. + * printcmd.c (print_address_symbolic): Convert from misc function + vector use to minimal symbol table use. + * printcmd.c (address_info): Convert from misc function vector use + to minimal symbol table use. + * printcmd.c (delete_display, enable_display, disable_display_command): + Make static. + * procfs.c (EXFUN/DEFUN): Remove all usages, convert to PARAMS. + * procfs.c (fetch_core_registers): Add unused param reg_addr. + * pyr-xdep.c (fetch_inferior_registers): Add unused param regno. + * pyr-xdep.c (store_inferior_registers): Returns void. + * remote-mm.c (mm_load): symbol_file_add return value unused. + * remote-nindy.c: Minor format change. + * remote-vx.c (vx_load_command): symbol_file_add result unused. + * rs6000-xdep.c (fetch_inferior_registers): Add unused param regno. + * rs6000-xdep.c (store_inferior_registers): Returns void. + * rs6000-xdep.c (fetch_core_registers): add unused param reg_addr + * rs6000-xdep.c (aixcoff_relocate_symtab): Convert from misc function + vector use to minimal symbol table use. + * solib.c: Add prototypes for local functions. + * solib.c (solib_add_common_symbols, locate_base): Convert from misc + function vector use to minimal symbol table use. + * solib.c (EXFUN/DEFUN): Remove all usages, convert to PARAMS. + * solib.c (find_solib, shared_library_command): Make static + * solib.c (read_memory, write_memory usages): Cast args. + * solib.c (special_symbol_handling): Add function + * source.c: Add prototypes for local functions. + * source.c (select_source_symtab): Convert to scan objfiles. + * source.c (open_source_file): Make static. + * source.c (xrealloc usages): Cast args. + * source.c (source_line_charpos): ifdef out, unused. + * source.c (get_filename_and_charpos): Make static. + * stack.c: Add prototypes for local functions. + * stack.c (print_frame_info, frame_info): Convert from misc function + vector use to minimal symbol table use. + * symfile.c: Add prototypes for local functions. + * symfile.c (compare_symbols): Make args const PTR's. + * symfile.c (compare_psymbols, sort_pst_symbols) add. + * symfile.c (sort_all_symtab_syms): Scan objfile list. + * symfile.c (obsavestring): Add objfile parameter. + * symfile.c (init_misc_bunches, prim_record_misc_function, + compare_misc_functions, discard_misc_bunches, condense_misc_bunches, + sort_misc_function_vector, compact_misc_function_vector): Remove + * symfile.c (symbol_file_add_digested): Add function. + * symfile.c (symbol_file_add): Returns struct objfile *. + * symfile.c (symbol_file_command): Modify for state file use. + * symfile.c (symfile_open): Add parameter "dumpable". + * symfile.c (allocate_objfile, free_objfile): Moved to objfiles.c + * symfile.c (load_command, add_symbol_file_command): Make static. + * symfile.c (fill_in_vptr_fieldno): Moved to gdbtypes.c + * symfile.c (rindex usages): Converted to strrchr. + * symfile.c (allocate_psymtab): New + * symfile.c (free_named_symtabs): Ifdef out code that needs to be + converted to minimal symbol table usage, but no obvious conversion. + * symfile.c (free_all_symtabs): Remove. + * symfile.c (_initialize_symfile): Use per-objfile info. + * symfile.h: Rework the objfile structure to add per-objfile data + objects (psymbol_obstack, symbol_obstack, type_obstack, + global_psymbols, static_psymbols, msymbols, minimal_symbol_count, + fundamental_types, malloc, realloc, free, xmalloc, xrealloc, etc). + Add prototypes to function declarations. + * symm-tdep.c (symmetry_extract_return_value): Convert from misc + function vector usage to minimal symbol table usage. + * symmisc.c (DEV_TTY): Define if not defined. + * symmisc.c: Add local function prototypes. + * symmisc.c (dump_objfile, dump_msymbols, dump-symtab, print_syms, + printpsyms_command, print_objfiles, print_objfiles_command): + Rework to use iterate_over_* + * symtab.c: Add prototypes for local functions. + * symtab.c (lookup_symtab_1): Convert to look through objfiles. + * symtab.c (lookup_partial_symtab): Scan through objfiles. + * symtab.c (lookup_primitive_typename, lookup_typename, lookup_ + unsigned_typename, lookup_struct, lookup_union, lookup_enum, + lookup_template_type, lookup_struct_elt_type, lookup_pointer_type, + lookup_reference_type, lookup_member_type, allocate_stub_method, + check_stub_method, create_array_type, smash_to_member_type,): + Moved to gdbtypes.c + * symtab.c (lookup_symbol): Some args are const. + * symtab.h: All type related defs and structs moved to gdbtypes.h + * symtab.h: Convert decls to prototypes. + * target.c (noprocess): Make static. + * target.h: Change decl's to prototypes. + * tm-sunos.h: (CLEAR_SOLIB, SOLIB_ADD, SOLIB_CREATE_INFERIOR_HOOK, + DISABLE_UNSETTABLE_BREAK) Moved to solib.h. + * utils.c (_initialize_utils): Use correct member of function union. + * valarith.c: include gdbtypes.h + * valops.c: include gdbtypes.h, add prototypes for local functions. + * valops.c (value_push, value_arg_push, find_function_addr): + Make static. + * valops.c (value_string): Convert from misc function vector use + to minimal symbol table use. + * valops.c (check_field_in): Make arg const. + * valprint.c: Add prototypes for local functions. + * valprint.c (print_string): Make static + * valprint.c (value_print, val_print_fields, val_print): Make arg int. + * values.c: Add prototypes for local functions. + * values.c (value_headof): Convert from misc function vector to + minimal symbol table. + * xcoffexec.c: Add prototypes for local functions. + * xcoffexec.c (exec_close, file_command, add_to_section_table): + Make static. + * xcoffexec.c (relocate_minimal_symbol): Add. + * xcoffread.c (patch_block_stabs): Moved to buildsyms.c. + * xcoffread.c: Add prototypes for local functions. + * xcoffread.c (sort_syms): Convert to scan objfiles. + * xcoffread.c (read_xcoff_symtab): Make static. + * xcoffread.c (various): Replace references to builtin types with + calls to lookup_fundamental_type. Replace references to symbol_obstack + and psymbol_obstack with pointers to the per-objfile copies. + * xcoffread.c (dump_linetable, dump_type, dump_symbol, dump_namespace, + dump_block, dump_blockvector, dump_last_symtab, dump_symtabs): + Make static. + * xcoffread.c (init_stringtab): Add objfile parameter. + * gdbtypes.c: New file + * minsyms.c: New file + * mmap-alloc.c: New file + * mmap-sbrk.c: New file + * objfiles.c: New file + * state.c: New file + * state.h: New file + +Fri Feb 21 17:29:54 1992 John Gilmore (gnu at cygnus.com) + + * Check in Fred Fish's changes in these modules. Fred + will make ChangeLog entries for all of them. Update VERSION + to 4.4.2. + +Thu Feb 20 18:10:17 1992 Fred Fish (fnf at cygnus.com) + + * tm-sparc.h, tm-sysv4.h, solib.h: Move shared lib definitions + into solib.h. + * sparc-pinsn.c, sparc-tdep.c, standalonec, sun3-xdep.c, + sun386-xdep.c, symm-xdep.c, target.c, ultra3-xdep.c, utils.c, + value.h: Prototypes for static functions; lint. + * gdbtypes.h: Empty file to ease transition. + +Thu Feb 20 16:43:13 1992 Fred Fish (fnf at cygnus.com) + + * environ.h, expression.h, frame.h, gdbcmd.h, gdbcore.h, + inferior.h, language.h, signame.h, target.h, terminal.h, + tm-68k.h, tm-i386v.h, tm-sparc.h, tm-sun386.h, tm-symmetry.h, + xm-i386v.h, xm-sparc.h: Prototypes for all external functions. + Lint. + * core.c, exec.c, infrun.c, inftarg.c, language.c, remote.c, + signame.c, sparc-xdep.c: Prototypes for all static functions. + Lint. + * core.c, eval.c, exec.c, inftarg.c, remote-adapt.c, remote-eb.c, + remote-hms.c, remote-mm.c, remote-nindy.c, remote-vx.c, remote.c, + target.c, target.h, valarith.c, valops.c, value.h, xcoffexec.c: + Remove to_call_function and target_call_function, since it + always calls the same thing (call_function_by_hand). + * core.c, exec.c, solib.c: Rename target_ops sections => + to_sections, etc. + * infcmd.c, inflow.c, infptrace.c, infrun.c, main.c, target.c, + target.h: target_kill takes no args. + * language.c (language_info): Scaffolding to allow briefer + messages when the current language changes. FIXME. + * xm-amix.h, xm-i386v4.h, xm-stratus.h: Define NORETURN to avoid + complaints about volatile functions. + * xm-sysv4.h (HAVE_MMAP): Define. + +Thu Feb 20 09:04:18 1992 Fred Fish (fnf at cygnus.com) + + * defs.h: Include ansidecl.h and PARAMS macro. Use PARAMS + to make prototypes for all functions declared here. + * cplus-dem.c: Avoid declaring xmalloc and xrealloc. + * c-exp.y: Rename SIGNED, OR, and AND to avoid conflict. + * environ.c: Include <stdio.h> before defs.h. Minor cleanup. + * ieee-float.h: Use PARAMS for prototypes; make some params const. + * ieee-float.c, valarith.c: Include <stdio.h>. Lint. b*=>mem*. + * m2-exp.y: Remove unused CONST; Rename OR and AND. + * utils.c: Avoid declaring malloc and realloc. Lint. + (request_quit): Accept signal-number parameter. + +Mon Feb 17 07:13:27 1992 Fred Fish (fnf at cygnus.com) + + * dwarfread.c (process_dies): Add case to handle TAG_pointer_type + DIE's. Add new function read_tag_pointer_type() to read them. + + * dwarfread.c (dwarf_read_array_type, read_subroutine_type): + When creating a new user defined type, check to see if a partial + type already exists, and if so, bash it to fit. + +Fri Feb 14 19:00:17 1992 John Gilmore (gnu at cygnus.com) + + * coffread.c (decode_base_type): Pass long, not union. + Fix by Eric Valette, ev@chorus.fr. + +Thu Feb 13 17:14:28 1992 Fred Fish (fnf at cygnus.com) + + * elfread.c (elf_symtab_read): Fix code to correctly track + changes in bfd for absolute symbols. + +Thu Feb 13 12:43:29 1992 Stu Grossman (grossman at cygnus.com) + + * xm-vaxbsd.h: Close off comment. + +Thu Feb 13 07:45:19 1992 Fred Fish (fnf at cygnus.com) + + * xm-sysv4.h: Define NEED_POSIX_SETPGID. + +Fri Feb 7 11:51:12 1992 Per Bothner (bothner at cygnus.com) + + * mips-tdep.c (mips_print_registers): Print correct register + number for double pseudo-registers. + +Fri Feb 7 07:56:05 1992 John Gilmore (gnu at cygnus.com) + + * buildsym.c (read_struct_type): Avoid double-bump of parse ptr + in the op$::OPERATOR. case. From Steven McCanne, + <mccanne@horse.ee.lbl.gov>. + + * exec.c (set_section_name): Pass arg to exec_files_info; + only call it if interactive. From Francis Kauth <fk@tv.tv.tek.com>. + +Thu Feb 6 17:41:32 1992 John Gilmore (gnu at cygnus.com) + + * main.c (print_gdb_version): Copyright msg: only this year. + (cd_command): Avoid changing current_directory on error. + +Thu Feb 6 15:14:01 1992 Per Bothner (bothner at cygnus.com) + + * mipsread.c (parse_partial_symbols): Handle dependencies + between partial symbol tables (when not doing stabs-in-ecoff). + (This used to be handled by parse_fdr, but parse_fdr was + incompatible with handling stabs-in-ecoff, so the code + was re-written to not use parse_fdr. Unfortunately, + the logic to handle dependencies was overlooked.) + +Thu Feb 6 11:51:39 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * coffread.c (read_enum_type): Use the size of a target int when + describing enum. + * defs.h: added new #define for TARGET_PTR_BIT, defaults to size + of target int. + * h8300-tdep.c, remote-hms.c, tm-h8300.h: too many changes to count + * symtab.c (lookup_reference_type, lookup_ptr_type): use + TARGET_PTR_BIT to determine size of a pointer + * values.c (unpack_long): when unpacking a REF or a PTR don't + assume the size of the type. + +Wed Feb 5 22:29:59 1992 John Gilmore (gnu at cygnus.com) + + * mipsread.c (parse_symbol): Avoid clobbering enum pointer when + looking at its members. Improve guess between struct and union, + only assuming union if multiple members have offsets of zero. + +Tue Feb 4 18:05:44 1992 Per Bothner (bothner at cygnus.com) + + * mipsread.c: Use (FP0_REGNUM-32) instead of magic number 6. + (This is just for clarity - and one day permitting us to + change FP0_REGNUM from 38 to 32, which would make more sense.) + * tm-mips.h: Added STAB_REG_TO_REGNUM macro, so that + register numbers in stabs-in-ecoff get handled correctly. + +Sat Feb 1 04:45:10 1992 Stu Grossman (grossman at cygnus.com) + + * xm-vax.h, xm-vaxult.h, xm-vaxbsd.h, config/mh-vaxult, + config/mh-vaxbsd, configure.in: Split up config stuff for Vaxen + into BSD and Ultrix. + +Sat Feb 1 04:39:41 1992 John Gilmore (gnu at cygnus.com) + + * dbxread.c (dbx_symfile_init): Call malloc, not xmalloc. + +Sat Feb 1 04:15:41 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in: Increment version to 4.4.1. + * main.c (print_gdb_version): Update copyright notice. + +Sat Feb 1 01:43:11 1992 Per Bothner (bothner at cygnus.com) + + * mipsread.c: Prepend "struct " to the names of structure + types, and similarly for enums and unions. (This used + to be done, but got lost in the re-write to "guess" the + difference between enum/struct/union.) + Also, guess that a tag is an enum if the first member + has type btNil. + +Fri Jan 31 21:45:51 1992 Stu Grossman (grossman at cygnus.com) + + * xm-vax.h: #ifndef ultrix around #include of endian.h and + limits.h (sigh). + +Fri Jan 31 00:05:01 1992 John Gilmore (gnu at cygnus.com) + + * Projects: Patching executables is done. + * Makefile.in (VERSION): Roll to gdb-4.4. + * README, WHATS.NEW: Update for gdb-4.4. + + * symfile.c (reread_symbols): Whenever we reread one object + file's symbols, we must restart the scan, because the object_files + chain has been permuted. + + * exec.c (exec_files_info): Split out into print_section_info. + Print BFD filename of each section if it's not the default one. + * core.c (core_files_info): Call print_section_info. + + * xm-vax.h: Include a few system header files whose definitions + must precede defs.h. + * language.c, language.h: Make some things const. + * expression.h, main.c: const spreads like ooze. + + * mem-break.c (break_insn, break_insn_size): Use unsigned chars, + since BREAKPOINT values can be >0x80. + +Thu Jan 30 17:21:14 1992 Stu Grossman (grossman at cygnus.com) + + * infrun.c, xm-i386sco.h: SCO needs to use setpgid(). + +Thu Jan 30 01:04:23 1992 John Gilmore (gnu at cygnus.com) + + * sparc-pinsn.c: Remove kludge for preferring architectures. + Remove #ifdef's for SORT_NEEDED. We need to sort the table, now + and forever. Add `add' instruction to the set that get checked + for a preceding `sethi' in order to print an absolute address. + Corresponding changes in ../include/opcode/sparc.h needed + to eliminate garbage instructions. + +Wed Jan 29 19:24:34 1992 Per Bothner (bothner at cygnus.com) + + * mipsread.c (parse_partial_symbols): Make sure partial + symbols are created for external symbols (as used to be + the case). This is a bit of a pain with the mips-coff. + It uses a table which points to all of the external + symbols belonging to a particular FDR or psymtab. + Once we've generated this table, we might as well save + it, and then use it in psymtab_to_symtab_1 to find + the symbols to pass to parse_external(). + * symfile.c, symfile.c: New function start_psymtab_common + to share the common parts of allocating a new psymtab + for dbxread, mipsread (and later dwarfread). Its code + was pulled out from start_psymtab in dbxread.c. + * dbxread.c (start_psymtab): Use start_psymtab_common(). + + * valprint.c (val_print): If there is an error when trying + to print a string, check to see if there really is a problem + by reading just one character. If that works, assume + things are ok. + +Wed Jan 29 18:58:43 1992 Stu Grossman (grossman at cygnus.com) + + * sparc-pinsn.c (compare_opcodes): Make it prefer v6, v7, + cypress, v8 mnemonics in that order. + +Tue Jan 28 17:32:13 1992 Per Bothner (bothner at cygnus.com) + + * sparc-pinsn.c: Put the qsort() back in. + +Mon Jan 27 18:51:03 1992 John Gilmore (gnu at cygnus.com) + + * findvar.c (read_register, write_register): Handle machines + where REGISTER_TYPE is not the same size as "int". + + Handle debug symbols in dynamically loaded (relocated) code: + + * dbxread.c (read_ofile_symtab): Fix up N_CATCH better. Pass + offset to process_one_symbol. + (process_one_symbol): Take new offset parameter. Add it into + appropriate symbol types to relocate symbols to loaded addresses. + Handle all possible symbol types, and complain() about types that + we don't expect to see. + * mipsread.c (psymtab_to_symtab_1): Pass offset of zero to + process_one_symbol (FIXME, should pass real offset). + + Misc bugfixes: + + * breakpoint.c (resolve_sal_pc): Split out code to resolve a + sal's PC value. + (set_breakpoint, break_command_1, until_break_command, + catch_command_1, breakpoint_re_set_one): Use it. + * symtab.h (resolve_sal_pc): Declare. + * infcmd.c (jump_command): Use resolve_sal_pc. + + * source.c (list_command): Shorten "FILE, line N" to "FILE:N". + + * putenv.c (putenv): Avoid unportably casting pointers to unsigneds. + + * c-exp.y (yylex): `this' and `template' are only tokens in C++. + + * xm-convex.h, xm-hp300bsd.h, xm-isi.h, xm-merlin.h, xm-news.h, + xm-np1.h, xm-pn.h, xm-pyr.h, xm-rtbsd.h, xm-symmetry.h, xm-umax.h: + Remove MISSING_VPRINTF declaration, and superfluous "kgdb" defines. + +Mon Jan 27 15:46:21 1992 Stu Grossman (grossman at cygnus.com) + + * dbxread.c (process_one_symbol): Make a first cut at handling + symbol tables generated by Sun's acc. (#ifdef'd out, FIXME.) + + * symtab.c (find_pc_line): Fix stepping into and out of #included + files. + +Mon Jan 27 13:00:55 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (OPCODES): Remove OPCODES defs and refs. There is + no longer any need to copy ../include/opcode/* into gdb. + +Mon Jan 27 12:30:38 1992 John Gilmore (gnu at cygnus.com) + + * ChangeLog, ChangeLog-9091: Split ChangeLog at 1992. + +Sun Jan 26 19:05:40 1992 Per Bothner (bothner at cygnus.com) + + * valprint.c (type_print_base, type_print_method_args): + Print C++ constructor methods without bogus "return type." + +Sat Jan 25 15:57:59 1992 Fred Fish (fnf at cygnus.com) + + * infptrace.c (child_xfer_memory): Parameter "target" should + be a pointer to a structure, not the entire structure. + +Fri Jan 24 01:30:27 1992 Fred Fish (fnf at cygnus.com) + + * depend: Convert the couple of references to ansidecl.h that + used the local gdb version to use the ../include version. + +Thu Jan 23 22:24:43 1992 Fred Fish (fnf at cygnus.com) + + * procfs.c + (child_xfer_memory): Takes pointer to a struct, not entire struct. + (inferior_proc_init): Fix non-ANSI version of args. + (attach): Call print_sys_errmsg with correct number of args. + (mappingflags): Make static, does not need to be global. + + * i386-tdep.c (i386_frame_num_args): Takes a pointer to a struct + not the entire struct itself. + + * valops.c (value_assign): Cast some args to modify_field() and + {read,write}_register_bytes() correctly. + + * ansidecl.h: Removed, is duplicate of ../include/ansidecl.h + + * Makefile.in (MALLOCSRC): Removed reference to removed local + copy of ansidecl.h. + + * dwarfread.c (list_in_scope): Needs an initial value, use file + scope. + +Mon Jan 20 19:06:28 1992 Stu Grossman (grossman at cygnus.com) + + * main.c (main): Make option_index local to keep new getopt happy. + main.c, solib.c, Makefile.in: Update copyright notices. + +Mon Jan 20 08:54:00 1992 Michael Tiemann (tiemann at cygnus.com) + + * cplus-dem.c (cplus_demangle): Correctly demangle destructors. + +Sat Jan 18 17:17:45 1992 Stu Grossman (grossman at cygnus.com) + + * Makefile.in (HFILES): Add partial-stab.h. + +Sat Jan 18 16:45:01 1992 Fred Fish (fnf at cygnus.com) + + * config/mh-stratus, config/mt-stratus, tm-stratus.h, xm-stratus.h: + New files for stratus. Not complete enough to actually build + on the Stratus machine; that awaits copyright assignment for + i860 changes. + + * Makefile.in (USER_CFLAGS): Add macro specifically reserved + for getting custom flags into CFLAGS when doing makes. + + * configure.in: Add config information for stratus. + +Thu Jan 16 00:51:46 1992 Fred Fish (fnf at cygnus.com) + + * dbxread.c (process_one_symbol): Pass address of structure + to complain(), rather than the whole structure. + +Wed Jan 15 09:56:16 1992 Fred Fish (fnf at cygnus.com) + + * solib.c (solib_add_common_symbols): Only compile in when not + using SVR4 style shared libraries. + +Tue Jan 14 22:34:00 1992 Fred Fish (fnf at cygnus.com) + + * dwarfread.c (locval): Add offreg flag to indicate location + values that are computed off a base register. + + * dwarfread.c (new_symbol): Rework TAG_global_variable and + TAG_local_variable cases to account for static variables + within function scopes. + +Tue Jan 14 12:28:52 1992 Stu Grossman (grossman at cygnus.com) + + * inflow.c: remove #include <sys/dir.h>. Not necessary, and + doesn't exist on some systems. + + * infrun.c (wait_for_inferior!!!!): Prevent gdb from hanging when + nexting over recursive function calls. + + * target.c (target_read_string): Create this routine to read null + terminated strings from the target. It deals with running off the + end of memory elegantly as well. solib.c (find_solib): Use + target_read_string() to avoid problems with running off the end of + memory. + + * inflow.c (child_terminal_info): #ifdef TIOCPGRP around lines + that reference pgrp_inferior. + +Mon Jan 13 14:57:11 1992 Per Bothner (bothner at cygnus.com) + + * tm-mips.h: Removed BLOCK_ADDRESS_ABSOLUTE, now that + mips-tfile has been hacked to act more "traditionally." + * dbxread.c: Fixed typo in comment. + +Sun Jan 12 13:08:36 1992 Per Bothner (bothner at cygnus.com) + + * mips-tdep.c (mips_skip_prologue): Add some number of + 'sw' instructions before 'addiu' adjusts the stack. + +Fri Jan 10 13:47:06 1992 Fred Fish (fnf at cygnus.com) + + * dwarfread.c (start_symtab, end_symtab, scopecount, openscope, + freescope, buildblock closescope, record_line, add_symbol_to_list, + gatherblocks, make_blockvector): Extensive changes to switch + to generic symbol table building code in buildsym.c. Remove + scope tree structures and functions, symbol table building + functions, and lots of other small changes. + + * dwarfread.c: Add new macros GCC_PRODUCER and STREQN. Remove + GCC_COMPILED_FLAG_SYMBOL and GCC2_COMPILED_FLAG_SYMBOL. + +Tue Jan 7 13:09:57 1992 Stu Grossman (grossman at cygnus.com) + + * buildsym.c (cleanup_undefined_types): Add support for enums. + This fixes the 'GDB internal error. cleanup_undefined_types with + bad type' problem. + +Sun Jan 5 09:47:50 1992 Stu Grossman (grossman at cygnus.com) + + * dbxread.c: detect gcc2 compilations. + +Thu Jan 2 15:07:41 1992 John Gilmore (gnu at cygnus.com) + + * sparc-pinsn.c: Rename bitfields that overlap with macro names + in ../include/opcode/sparc.h. + +Wed Jan 1 04:29:00 1992 Fred Fish (fnf at cygnus.com) + + * Makefile.in: Change tm-svr4.h to tm-sysv4.h. Change xm-svr4.h + to xm-sysv4.h. Split OPCODE_DIR into OPCODE_DIR1 and OPCODE_DIR2 + to reflect actual locations of opcode files, so TAGS target will + be buildable. + + * i386-tdep.c: Change an erroneous 'm68k' reference to 'i386'. + + * i386-tdep.c (supply_fpregset, fill_fpregset): Remove m68k + code. + + * m68k-tdep.c (supply_fpregset, fill_fpregset): Fix array + dereferencing to access the correct elements. + + * valops.c (value_addr): Declare return type of external func + value_copy(). + + * xcoffread.c: Undefine next_symbol_text before redefining it. + +For older changes see ChangeLog-9091 + +Local Variables: +mode: indented-text +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/gdb/gdb/a29k-tdep.c b/contrib/gdb/gdb/a29k-tdep.c new file mode 100644 index 0000000000000..1ef7971606c2c --- /dev/null +++ b/contrib/gdb/gdb/a29k-tdep.c @@ -0,0 +1,1028 @@ +/* Target-machine dependent code for the AMD 29000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995 + Free Software Foundation, Inc. + Contributed by Cygnus Support. Written by Jim Kingdon. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "gdbcore.h" +#include "frame.h" +#include "value.h" +#include "symtab.h" +#include "inferior.h" +#include "gdbcmd.h" + +/* If all these bits in an instruction word are zero, it is a "tag word" + which precedes a function entry point and gives stack traceback info. + This used to be defined as 0xff000000, but that treated 0x00000deb as + a tag word, while it is really used as a breakpoint. */ +#define TAGWORD_ZERO_MASK 0xff00f800 + +extern CORE_ADDR text_start; /* FIXME, kludge... */ + +/* The user-settable top of the register stack in virtual memory. We + won't attempt to access any stored registers above this address, if set + nonzero. */ + +static CORE_ADDR rstack_high_address = UINT_MAX; + +/* Structure to hold cached info about function prologues. */ + +struct prologue_info +{ + CORE_ADDR pc; /* First addr after fn prologue */ + unsigned rsize, msize; /* register stack frame size, mem stack ditto */ + unsigned mfp_used : 1; /* memory frame pointer used */ + unsigned rsize_valid : 1; /* Validity bits for the above */ + unsigned msize_valid : 1; + unsigned mfp_valid : 1; +}; + +/* Examine the prologue of a function which starts at PC. Return + the first addess past the prologue. If MSIZE is non-NULL, then + set *MSIZE to the memory stack frame size. If RSIZE is non-NULL, + then set *RSIZE to the register stack frame size (not including + incoming arguments and the return address & frame pointer stored + with them). If no prologue is found, *RSIZE is set to zero. + If no prologue is found, or a prologue which doesn't involve + allocating a memory stack frame, then set *MSIZE to zero. + + Note that both msize and rsize are in bytes. This is not consistent + with the _User's Manual_ with respect to rsize, but it is much more + convenient. + + If MFP_USED is non-NULL, *MFP_USED is set to nonzero if a memory + frame pointer is being used. */ + +CORE_ADDR +examine_prologue (pc, rsize, msize, mfp_used) + CORE_ADDR pc; + unsigned *msize; + unsigned *rsize; + int *mfp_used; +{ + long insn; + CORE_ADDR p = pc; + struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (pc); + struct prologue_info *mi = 0; + + if (msymbol != NULL) + mi = (struct prologue_info *) msymbol -> info; + + if (mi != 0) + { + int valid = 1; + if (rsize != NULL) + { + *rsize = mi->rsize; + valid &= mi->rsize_valid; + } + if (msize != NULL) + { + *msize = mi->msize; + valid &= mi->msize_valid; + } + if (mfp_used != NULL) + { + *mfp_used = mi->mfp_used; + valid &= mi->mfp_valid; + } + if (valid) + return mi->pc; + } + + if (rsize != NULL) + *rsize = 0; + if (msize != NULL) + *msize = 0; + if (mfp_used != NULL) + *mfp_used = 0; + + /* Prologue must start with subtracting a constant from gr1. + Normally this is sub gr1,gr1,<rsize * 4>. */ + insn = read_memory_integer (p, 4); + if ((insn & 0xffffff00) != 0x25010100) + { + /* If the frame is large, instead of a single instruction it + might be a pair of instructions: + const <reg>, <rsize * 4> + sub gr1,gr1,<reg> + */ + int reg; + /* Possible value for rsize. */ + unsigned int rsize0; + + if ((insn & 0xff000000) != 0x03000000) + { + p = pc; + goto done; + } + reg = (insn >> 8) & 0xff; + rsize0 = (((insn >> 8) & 0xff00) | (insn & 0xff)); + p += 4; + insn = read_memory_integer (p, 4); + if ((insn & 0xffffff00) != 0x24010100 + || (insn & 0xff) != reg) + { + p = pc; + goto done; + } + if (rsize != NULL) + *rsize = rsize0; + } + else + { + if (rsize != NULL) + *rsize = (insn & 0xff); + } + p += 4; + + /* Next instruction ought to be asgeu V_SPILL,gr1,rab. + * We don't check the vector number to allow for kernel debugging. The + * kernel will use a different trap number. + * If this insn is missing, we just keep going; Metaware R2.3u compiler + * generates prologue that intermixes initializations and puts the asgeu + * way down. + */ + insn = read_memory_integer (p, 4); + if ((insn & 0xff00ffff) == (0x5e000100|RAB_HW_REGNUM)) + { + p += 4; + } + + /* Next instruction usually sets the frame pointer (lr1) by adding + <size * 4> from gr1. However, this can (and high C does) be + deferred until anytime before the first function call. So it is + OK if we don't see anything which sets lr1. + To allow for alternate register sets (gcc -mkernel-registers) the msp + register number is a compile time constant. */ + + /* Normally this is just add lr1,gr1,<size * 4>. */ + insn = read_memory_integer (p, 4); + if ((insn & 0xffffff00) == 0x15810100) + p += 4; + else + { + /* However, for large frames it can be + const <reg>, <size *4> + add lr1,gr1,<reg> + */ + int reg; + CORE_ADDR q; + + if ((insn & 0xff000000) == 0x03000000) + { + reg = (insn >> 8) & 0xff; + q = p + 4; + insn = read_memory_integer (q, 4); + if ((insn & 0xffffff00) == 0x14810100 + && (insn & 0xff) == reg) + p = q; + } + } + + /* Next comes "add lr{<rsize-1>},msp,0", but only if a memory + frame pointer is in use. We just check for add lr<anything>,msp,0; + we don't check this rsize against the first instruction, and + we don't check that the trace-back tag indicates a memory frame pointer + is in use. + To allow for alternate register sets (gcc -mkernel-registers) the msp + register number is a compile time constant. + + The recommended instruction is actually "sll lr<whatever>,msp,0". + We check for that, too. Originally Jim Kingdon's code seemed + to be looking for a "sub" instruction here, but the mask was set + up to lose all the time. */ + insn = read_memory_integer (p, 4); + if (((insn & 0xff80ffff) == (0x15800000|(MSP_HW_REGNUM<<8))) /* add */ + || ((insn & 0xff80ffff) == (0x81800000|(MSP_HW_REGNUM<<8)))) /* sll */ + { + p += 4; + if (mfp_used != NULL) + *mfp_used = 1; + } + + /* Next comes a subtraction from msp to allocate a memory frame, + but only if a memory frame is + being used. We don't check msize against the trace-back tag. + + To allow for alternate register sets (gcc -mkernel-registers) the msp + register number is a compile time constant. + + Normally this is just + sub msp,msp,<msize> + */ + insn = read_memory_integer (p, 4); + if ((insn & 0xffffff00) == + (0x25000000|(MSP_HW_REGNUM<<16)|(MSP_HW_REGNUM<<8))) + { + p += 4; + if (msize != NULL) + *msize = insn & 0xff; + } + else + { + /* For large frames, instead of a single instruction it might + be + + const <reg>, <msize> + consth <reg>, <msize> ; optional + sub msp,msp,<reg> + */ + int reg; + unsigned msize0; + CORE_ADDR q = p; + + if ((insn & 0xff000000) == 0x03000000) + { + reg = (insn >> 8) & 0xff; + msize0 = ((insn >> 8) & 0xff00) | (insn & 0xff); + q += 4; + insn = read_memory_integer (q, 4); + /* Check for consth. */ + if ((insn & 0xff000000) == 0x02000000 + && (insn & 0x0000ff00) == reg) + { + msize0 |= (insn << 8) & 0xff000000; + msize0 |= (insn << 16) & 0x00ff0000; + q += 4; + insn = read_memory_integer (q, 4); + } + /* Check for sub msp,msp,<reg>. */ + if ((insn & 0xffffff00) == + (0x24000000|(MSP_HW_REGNUM<<16)|(MSP_HW_REGNUM<<8)) + && (insn & 0xff) == reg) + { + p = q + 4; + if (msize != NULL) + *msize = msize0; + } + } + } + + /* Next instruction might be asgeu V_SPILL,gr1,rab. + * We don't check the vector number to allow for kernel debugging. The + * kernel will use a different trap number. + * Metaware R2.3u compiler + * generates prologue that intermixes initializations and puts the asgeu + * way down after everything else. + */ + insn = read_memory_integer (p, 4); + if ((insn & 0xff00ffff) == (0x5e000100|RAB_HW_REGNUM)) + { + p += 4; + } + + done: + if (msymbol != NULL) + { + if (mi == 0) + { + /* Add a new cache entry. */ + mi = (struct prologue_info *)xmalloc (sizeof (struct prologue_info)); + msymbol -> info = (char *)mi; + mi->rsize_valid = 0; + mi->msize_valid = 0; + mi->mfp_valid = 0; + } + /* else, cache entry exists, but info is incomplete. */ + mi->pc = p; + if (rsize != NULL) + { + mi->rsize = *rsize; + mi->rsize_valid = 1; + } + if (msize != NULL) + { + mi->msize = *msize; + mi->msize_valid = 1; + } + if (mfp_used != NULL) + { + mi->mfp_used = *mfp_used; + mi->mfp_valid = 1; + } + } + return p; +} + +/* Advance PC across any function entry prologue instructions + to reach some "real" code. */ + +CORE_ADDR +skip_prologue (pc) + CORE_ADDR pc; +{ + return examine_prologue (pc, NULL, NULL, NULL); +} + +/* + * Examine the one or two word tag at the beginning of a function. + * The tag word is expect to be at 'p', if it is not there, we fail + * by returning 0. The documentation for the tag word was taken from + * page 7-15 of the 29050 User's Manual. We are assuming that the + * m bit is in bit 22 of the tag word, which seems to be the agreed upon + * convention today (1/15/92). + * msize is return in bytes. + */ + +static int /* 0/1 - failure/success of finding the tag word */ +examine_tag (p, is_trans, argcount, msize, mfp_used) + CORE_ADDR p; + int *is_trans; + int *argcount; + unsigned *msize; + int *mfp_used; +{ + unsigned int tag1, tag2; + + tag1 = read_memory_integer (p, 4); + if ((tag1 & TAGWORD_ZERO_MASK) != 0) /* Not a tag word */ + return 0; + if (tag1 & (1<<23)) /* A two word tag */ + { + tag2 = read_memory_integer (p-4, 4); + if (msize) + *msize = tag2 * 2; + } + else /* A one word tag */ + { + if (msize) + *msize = tag1 & 0x7ff; + } + if (is_trans) + *is_trans = ((tag1 & (1<<21)) ? 1 : 0); + /* Note that this includes the frame pointer and the return address + register, so the actual number of registers of arguments is two less. + argcount can be zero, however, sometimes, for strange assembler + routines. */ + if (argcount) + *argcount = (tag1 >> 16) & 0x1f; + if (mfp_used) + *mfp_used = ((tag1 & (1<<22)) ? 1 : 0); + return 1; +} + +/* Initialize the frame. In addition to setting "extra" frame info, + we also set ->frame because we use it in a nonstandard way, and ->pc + because we need to know it to get the other stuff. See the diagram + of stacks and the frame cache in tm-a29k.h for more detail. */ + +static void +init_frame_info (innermost_frame, frame) + int innermost_frame; + struct frame_info *frame; +{ + CORE_ADDR p; + long insn; + unsigned rsize; + unsigned msize; + int mfp_used, trans; + struct symbol *func; + + p = frame->pc; + + if (innermost_frame) + frame->frame = read_register (GR1_REGNUM); + else + frame->frame = frame->next->frame + frame->next->rsize; + +#if 0 /* CALL_DUMMY_LOCATION == ON_STACK */ + This wont work; +#else + if (PC_IN_CALL_DUMMY (p, 0, 0)) +#endif + { + frame->rsize = DUMMY_FRAME_RSIZE; + /* This doesn't matter since we never try to get locals or args + from a dummy frame. */ + frame->msize = 0; + /* Dummy frames always use a memory frame pointer. */ + frame->saved_msp = + read_register_stack_integer (frame->frame + DUMMY_FRAME_RSIZE - 4, 4); + frame->flags |= (TRANSPARENT|MFP_USED); + return; + } + + func = find_pc_function (p); + if (func != NULL) + p = BLOCK_START (SYMBOL_BLOCK_VALUE (func)); + else + { + /* Search backward to find the trace-back tag. However, + do not trace back beyond the start of the text segment + (just as a sanity check to avoid going into never-never land). */ +#if 1 + while (p >= text_start + && ((insn = read_memory_integer (p, 4)) & TAGWORD_ZERO_MASK) != 0) + p -= 4; +#else /* 0 */ + char pat[4] = {0, 0, 0, 0}; + char mask[4]; + char insn_raw[4]; + store_unsigned_integer (mask, 4, TAGWORD_ZERO_MASK); + /* Enable this once target_search is enabled and tested. */ + target_search (4, pat, mask, p, -4, text_start, p+1, &p, &insn_raw); + insn = extract_unsigned_integer (insn_raw, 4); +#endif /* 0 */ + + if (p < text_start) + { + /* Couldn't find the trace-back tag. + Something strange is going on. */ + frame->saved_msp = 0; + frame->rsize = 0; + frame->msize = 0; + frame->flags = TRANSPARENT; + return; + } + else + /* Advance to the first word of the function, i.e. the word + after the trace-back tag. */ + p += 4; + } + + /* We've found the start of the function. + Try looking for a tag word that indicates whether there is a + memory frame pointer and what the memory stack allocation is. + If one doesn't exist, try using a more exhaustive search of + the prologue. */ + + if (examine_tag(p-4,&trans,(int *)NULL,&msize,&mfp_used)) /* Found good tag */ + examine_prologue (p, &rsize, 0, 0); + else /* No tag try prologue */ + examine_prologue (p, &rsize, &msize, &mfp_used); + + frame->rsize = rsize; + frame->msize = msize; + frame->flags = 0; + if (mfp_used) + frame->flags |= MFP_USED; + if (trans) + frame->flags |= TRANSPARENT; + if (innermost_frame) + { + frame->saved_msp = read_register (MSP_REGNUM) + msize; + } + else + { + if (mfp_used) + frame->saved_msp = + read_register_stack_integer (frame->frame + rsize - 4, 4); + else + frame->saved_msp = frame->next->saved_msp + msize; + } +} + +void +init_extra_frame_info (frame) + struct frame_info *frame; +{ + if (frame->next == 0) + /* Assume innermost frame. May produce strange results for "info frame" + but there isn't any way to tell the difference. */ + init_frame_info (1, frame); + else { + /* We're in get_prev_frame_info. + Take care of everything in init_frame_pc. */ + ; + } +} + +void +init_frame_pc (fromleaf, frame) + int fromleaf; + struct frame_info *frame; +{ + frame->pc = (fromleaf ? SAVED_PC_AFTER_CALL (frame->next) : + frame->next ? FRAME_SAVED_PC (frame->next) : read_pc ()); + init_frame_info (fromleaf, frame); +} + +/* Local variables (i.e. LOC_LOCAL) are on the memory stack, with their + offsets being relative to the memory stack pointer (high C) or + saved_msp (gcc). */ + +CORE_ADDR +frame_locals_address (fi) + struct frame_info *fi; +{ + if (fi->flags & MFP_USED) + return fi->saved_msp; + else + return fi->saved_msp - fi->msize; +} + +/* Routines for reading the register stack. The caller gets to treat + the register stack as a uniform stack in memory, from address $gr1 + straight through $rfb and beyond. */ + +/* Analogous to read_memory except the length is understood to be 4. + Also, myaddr can be NULL (meaning don't bother to read), and + if actual_mem_addr is non-NULL, store there the address that it + was fetched from (or if from a register the offset within + registers). Set *LVAL to lval_memory or lval_register, depending + on where it came from. The contents written into MYADDR are in + target format. */ +void +read_register_stack (memaddr, myaddr, actual_mem_addr, lval) + CORE_ADDR memaddr; + char *myaddr; + CORE_ADDR *actual_mem_addr; + enum lval_type *lval; +{ + long rfb = read_register (RFB_REGNUM); + long rsp = read_register (RSP_REGNUM); + + /* If we don't do this 'info register' stops in the middle. */ + if (memaddr >= rstack_high_address) + { + /* a bogus value */ + static char val[] = {~0, ~0, ~0, ~0}; + /* It's in a local register, but off the end of the stack. */ + int regnum = (memaddr - rsp) / 4 + LR0_REGNUM; + if (myaddr != NULL) + { + /* Provide bogusness */ + memcpy (myaddr, val, 4); + } + supply_register(regnum, val); /* More bogusness */ + if (lval != NULL) + *lval = lval_register; + if (actual_mem_addr != NULL) + *actual_mem_addr = REGISTER_BYTE (regnum); + } + /* If it's in the part of the register stack that's in real registers, + get the value from the registers. If it's anywhere else in memory + (e.g. in another thread's saved stack), skip this part and get + it from real live memory. */ + else if (memaddr < rfb && memaddr >= rsp) + { + /* It's in a register. */ + int regnum = (memaddr - rsp) / 4 + LR0_REGNUM; + if (regnum > LR0_REGNUM + 127) + error ("Attempt to read register stack out of range."); + if (myaddr != NULL) + read_register_gen (regnum, myaddr); + if (lval != NULL) + *lval = lval_register; + if (actual_mem_addr != NULL) + *actual_mem_addr = REGISTER_BYTE (regnum); + } + else + { + /* It's in the memory portion of the register stack. */ + if (myaddr != NULL) + read_memory (memaddr, myaddr, 4); + if (lval != NULL) + *lval = lval_memory; + if (actual_mem_addr != NULL) + *actual_mem_addr = memaddr; + } +} + +/* Analogous to read_memory_integer + except the length is understood to be 4. */ +long +read_register_stack_integer (memaddr, len) + CORE_ADDR memaddr; + int len; +{ + char buf[4]; + read_register_stack (memaddr, buf, NULL, NULL); + return extract_signed_integer (buf, 4); +} + +/* Copy 4 bytes from GDB memory at MYADDR into inferior memory + at MEMADDR and put the actual address written into in + *ACTUAL_MEM_ADDR. */ +static void +write_register_stack (memaddr, myaddr, actual_mem_addr) + CORE_ADDR memaddr; + char *myaddr; + CORE_ADDR *actual_mem_addr; +{ + long rfb = read_register (RFB_REGNUM); + long rsp = read_register (RSP_REGNUM); + /* If we don't do this 'info register' stops in the middle. */ + if (memaddr >= rstack_high_address) + { + /* It's in a register, but off the end of the stack. */ + if (actual_mem_addr != NULL) + *actual_mem_addr = 0; + } + else if (memaddr < rfb) + { + /* It's in a register. */ + int regnum = (memaddr - rsp) / 4 + LR0_REGNUM; + if (regnum < LR0_REGNUM || regnum > LR0_REGNUM + 127) + error ("Attempt to read register stack out of range."); + if (myaddr != NULL) + write_register (regnum, *(long *)myaddr); + if (actual_mem_addr != NULL) + *actual_mem_addr = 0; + } + else + { + /* It's in the memory portion of the register stack. */ + if (myaddr != NULL) + write_memory (memaddr, myaddr, 4); + if (actual_mem_addr != NULL) + *actual_mem_addr = memaddr; + } +} + +/* Find register number REGNUM relative to FRAME and put its + (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable + was optimized out (and thus can't be fetched). If the variable + was fetched from memory, set *ADDRP to where it was fetched from, + otherwise it was fetched from a register. + + The argument RAW_BUFFER must point to aligned memory. */ + +void +get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp) + char *raw_buffer; + int *optimized; + CORE_ADDR *addrp; + struct frame_info *frame; + int regnum; + enum lval_type *lvalp; +{ + struct frame_info *fi; + CORE_ADDR addr; + enum lval_type lval; + + if (!target_has_registers) + error ("No registers."); + + /* Probably now redundant with the target_has_registers check. */ + if (frame == 0) + return; + + /* Once something has a register number, it doesn't get optimized out. */ + if (optimized != NULL) + *optimized = 0; + if (regnum == RSP_REGNUM) + { + if (raw_buffer != NULL) + { + store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->frame); + } + if (lvalp != NULL) + *lvalp = not_lval; + return; + } + else if (regnum == PC_REGNUM) + { + if (raw_buffer != NULL) + { + store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->pc); + } + + /* Not sure we have to do this. */ + if (lvalp != NULL) + *lvalp = not_lval; + + return; + } + else if (regnum == MSP_REGNUM) + { + if (raw_buffer != NULL) + { + if (frame->next != NULL) + { + store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), + frame->next->saved_msp); + } + else + read_register_gen (MSP_REGNUM, raw_buffer); + } + /* The value may have been computed, not fetched. */ + if (lvalp != NULL) + *lvalp = not_lval; + return; + } + else if (regnum < LR0_REGNUM || regnum >= LR0_REGNUM + 128) + { + /* These registers are not saved over procedure calls, + so just print out the current values. */ + if (raw_buffer != NULL) + read_register_gen (regnum, raw_buffer); + if (lvalp != NULL) + *lvalp = lval_register; + if (addrp != NULL) + *addrp = REGISTER_BYTE (regnum); + return; + } + + addr = frame->frame + (regnum - LR0_REGNUM) * 4; + if (raw_buffer != NULL) + read_register_stack (addr, raw_buffer, &addr, &lval); + if (lvalp != NULL) + *lvalp = lval; + if (addrp != NULL) + *addrp = addr; +} + + +/* Discard from the stack the innermost frame, + restoring all saved registers. */ + +void +pop_frame () +{ + struct frame_info *frame = get_current_frame (); + CORE_ADDR rfb = read_register (RFB_REGNUM); + CORE_ADDR gr1 = frame->frame + frame->rsize; + CORE_ADDR lr1; + CORE_ADDR original_lr0; + int must_fix_lr0 = 0; + int i; + + /* If popping a dummy frame, need to restore registers. */ + if (PC_IN_CALL_DUMMY (read_register (PC_REGNUM), + read_register (SP_REGNUM), + FRAME_FP (frame))) + { + int lrnum = LR0_REGNUM + DUMMY_ARG/4; + for (i = 0; i < DUMMY_SAVE_SR128; ++i) + write_register (SR_REGNUM (i + 128),read_register (lrnum++)); + for (i = 0; i < DUMMY_SAVE_SR160; ++i) + write_register (SR_REGNUM(i+160), read_register (lrnum++)); + for (i = 0; i < DUMMY_SAVE_GREGS; ++i) + write_register (RETURN_REGNUM + i, read_register (lrnum++)); + /* Restore the PCs and prepare to restore LR0. */ + write_register(PC_REGNUM, read_register (lrnum++)); + write_register(NPC_REGNUM, read_register (lrnum++)); + write_register(PC2_REGNUM, read_register (lrnum++)); + original_lr0 = read_register (lrnum++); + must_fix_lr0 = 1; + } + + /* Restore the memory stack pointer. */ + write_register (MSP_REGNUM, frame->saved_msp); + /* Restore the register stack pointer. */ + write_register (GR1_REGNUM, gr1); + + /* If we popped a dummy frame, restore lr0 now that gr1 has been restored. */ + if (must_fix_lr0) + write_register (LR0_REGNUM, original_lr0); + + /* Check whether we need to fill registers. */ + lr1 = read_register (LR0_REGNUM + 1); + if (lr1 > rfb) + { + /* Fill. */ + int num_bytes = lr1 - rfb; + int i; + long word; + + write_register (RAB_REGNUM, read_register (RAB_REGNUM) + num_bytes); + write_register (RFB_REGNUM, lr1); + for (i = 0; i < num_bytes; i += 4) + { + /* Note: word is in host byte order. */ + word = read_memory_integer (rfb + i, 4); + write_register (LR0_REGNUM + ((rfb - gr1) % 0x80) + i / 4, word); + } + } + flush_cached_frames (); +} + +/* Push an empty stack frame, to record the current PC, etc. */ + +void +push_dummy_frame () +{ + long w; + CORE_ADDR rab, gr1; + CORE_ADDR msp = read_register (MSP_REGNUM); + int lrnum, i; + CORE_ADDR original_lr0; + + /* Read original lr0 before changing gr1. This order isn't really needed + since GDB happens to have a snapshot of all the regs and doesn't toss + it when gr1 is changed. But it's The Right Thing To Do. */ + original_lr0 = read_register (LR0_REGNUM); + + /* Allocate the new frame. */ + gr1 = read_register (GR1_REGNUM) - DUMMY_FRAME_RSIZE; + write_register (GR1_REGNUM, gr1); + +#ifdef VXWORKS_TARGET + /* We force re-reading all registers to get the new local registers set + after gr1 has been modified. This fix is due to the lack of single + register read/write operation in the RPC interface between VxGDB and + VxWorks. This really must be changed ! */ + + vx_read_register (-1); + +#endif /* VXWORK_TARGET */ + + rab = read_register (RAB_REGNUM); + if (gr1 < rab) + { + /* We need to spill registers. */ + int num_bytes = rab - gr1; + CORE_ADDR rfb = read_register (RFB_REGNUM); + int i; + long word; + + write_register (RFB_REGNUM, rfb - num_bytes); + write_register (RAB_REGNUM, gr1); + for (i = 0; i < num_bytes; i += 4) + { + /* Note: word is in target byte order. */ + read_register_gen (LR0_REGNUM + i / 4, (char *) &word); + write_memory (rfb - num_bytes + i, (char *) &word, 4); + } + } + + /* There are no arguments in to the dummy frame, so we don't need + more than rsize plus the return address and lr1. */ + write_register (LR0_REGNUM + 1, gr1 + DUMMY_FRAME_RSIZE + 2 * 4); + + /* Set the memory frame pointer. */ + write_register (LR0_REGNUM + DUMMY_FRAME_RSIZE / 4 - 1, msp); + + /* Allocate arg_slop. */ + write_register (MSP_REGNUM, msp - 16 * 4); + + /* Save registers. */ + lrnum = LR0_REGNUM + DUMMY_ARG/4; + for (i = 0; i < DUMMY_SAVE_SR128; ++i) + write_register (lrnum++, read_register (SR_REGNUM (i + 128))); + for (i = 0; i < DUMMY_SAVE_SR160; ++i) + write_register (lrnum++, read_register (SR_REGNUM (i + 160))); + for (i = 0; i < DUMMY_SAVE_GREGS; ++i) + write_register (lrnum++, read_register (RETURN_REGNUM + i)); + /* Save the PCs and LR0. */ + write_register (lrnum++, read_register (PC_REGNUM)); + write_register (lrnum++, read_register (NPC_REGNUM)); + write_register (lrnum++, read_register (PC2_REGNUM)); + + /* Why are we saving LR0? What would clobber it? (the dummy frame should + be below it on the register stack, no?). */ + write_register (lrnum++, original_lr0); +} + + + +/* + This routine takes three arguments and makes the cached frames look + as if these arguments defined a frame on the cache. This allows the + rest of `info frame' to extract the important arguments without much + difficulty. Since an individual frame on the 29K is determined by + three values (FP, PC, and MSP), we really need all three to do a + good job. */ + +struct frame_info * +setup_arbitrary_frame (argc, argv) + int argc; + CORE_ADDR *argv; +{ + struct frame_info *frame; + + if (argc != 3) + error ("AMD 29k frame specifications require three arguments: rsp pc msp"); + + frame = create_new_frame (argv[0], argv[1]); + + if (!frame) + fatal ("internal: create_new_frame returned invalid frame id"); + + /* Creating a new frame munges the `frame' value from the current + GR1, so we restore it again here. FIXME, untangle all this + 29K frame stuff... */ + frame->frame = argv[0]; + + /* Our MSP is in argv[2]. It'd be intelligent if we could just + save this value in the FRAME. But the way it's set up (FIXME), + we must save our caller's MSP. We compute that by adding our + memory stack frame size to our MSP. */ + frame->saved_msp = argv[2] + frame->msize; + + return frame; +} + +int +gdb_print_insn_a29k (memaddr, info) + bfd_vma memaddr; + disassemble_info *info; +{ + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + return print_insn_big_a29k (memaddr, info); + else + return print_insn_little_a29k (memaddr, info); +} + +enum a29k_processor_types processor_type = a29k_unknown; + +void +a29k_get_processor_type () +{ + unsigned int cfg_reg = (unsigned int) read_register (CFG_REGNUM); + + /* Most of these don't have freeze mode. */ + processor_type = a29k_no_freeze_mode; + + switch ((cfg_reg >> 28) & 0xf) + { + case 0: + fprintf_filtered (gdb_stderr, "Remote debugging an Am29000"); + break; + case 1: + fprintf_filtered (gdb_stderr, "Remote debugging an Am29005"); + break; + case 2: + fprintf_filtered (gdb_stderr, "Remote debugging an Am29050"); + processor_type = a29k_freeze_mode; + break; + case 3: + fprintf_filtered (gdb_stderr, "Remote debugging an Am29035"); + break; + case 4: + fprintf_filtered (gdb_stderr, "Remote debugging an Am29030"); + break; + case 5: + fprintf_filtered (gdb_stderr, "Remote debugging an Am2920*"); + break; + case 6: + fprintf_filtered (gdb_stderr, "Remote debugging an Am2924*"); + break; + case 7: + fprintf_filtered (gdb_stderr, "Remote debugging an Am29040"); + break; + default: + fprintf_filtered (gdb_stderr, "Remote debugging an unknown Am29k\n"); + /* Don't bother to print the revision. */ + return; + } + fprintf_filtered (gdb_stderr, " revision %c\n", 'A' + ((cfg_reg >> 24) & 0x0f)); +} + +#ifdef GET_LONGJMP_TARGET +/* Figure out where the longjmp will land. We expect that we have just entered + longjmp and haven't yet setup the stack frame, so the args are still in the + output regs. lr2 (LR2_REGNUM) points at the jmp_buf structure from which we + extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. + This routine returns true on success */ + +int +get_longjmp_target(pc) + CORE_ADDR *pc; +{ + CORE_ADDR jb_addr; + char buf[sizeof(CORE_ADDR)]; + + jb_addr = read_register(LR2_REGNUM); + + if (target_read_memory(jb_addr + JB_PC * JB_ELEMENT_SIZE, (char *) buf, + sizeof(CORE_ADDR))) + return 0; + + *pc = extract_address ((PTR) buf, sizeof(CORE_ADDR)); + return 1; +} +#endif /* GET_LONGJMP_TARGET */ + +void +_initialize_a29k_tdep () +{ + extern CORE_ADDR text_end; + + tm_print_insn = gdb_print_insn_a29k; + + /* FIXME, there should be a way to make a CORE_ADDR variable settable. */ + add_show_from_set + (add_set_cmd ("rstack_high_address", class_support, var_uinteger, + (char *)&rstack_high_address, + "Set top address in memory of the register stack.\n\ +Attempts to access registers saved above this address will be ignored\n\ +or will produce the value -1.", &setlist), + &showlist); + + /* FIXME, there should be a way to make a CORE_ADDR variable settable. */ + add_show_from_set + (add_set_cmd ("call_scratch_address", class_support, var_uinteger, + (char *)&text_end, +"Set address in memory where small amounts of RAM can be used\n\ +when making function calls into the inferior.", &setlist), + &showlist); +} diff --git a/contrib/gdb/gdb/a68v-nat.c b/contrib/gdb/gdb/a68v-nat.c new file mode 100644 index 0000000000000..95bb3c83716bb --- /dev/null +++ b/contrib/gdb/gdb/a68v-nat.c @@ -0,0 +1,123 @@ +/* Host-dependent code for Apollo-68ks for GDB, the GNU debugger. + Copyright 1986, 1987, 1989, 1991 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "inferior.h" + +#ifndef _ISP__M68K +#define _ISP__M68K 1 +#endif + +#include <ptrace.h> + +extern int errno; + +void +fetch_inferior_registers (ignored) + int ignored; +{ + struct ptrace_$data_regs_m68k inferior_registers; + struct ptrace_$floating_regs_m68k inferior_fp_registers; + struct ptrace_$control_regs_m68k inferior_control_registers; + extern char registers[]; + + ptrace_$init_control(&inferior_control_registers); + inferior_fp_registers.size = sizeof(inferior_fp_registers); + + registers_fetched (); + + ptrace (PTRACE_GETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_registers, + ptrace_$data_set, + (PTRACE_ARG3_TYPE) &inferior_registers, + ptrace_$data_set); + + ptrace (PTRACE_GETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_fp_registers, + ptrace_$floating_set_m68k, + (PTRACE_ARG3_TYPE) &inferior_fp_registers, + ptrace_$floating_set_m68k); + + ptrace (PTRACE_GETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_control_registers, + ptrace_$control_set_m68k, + (PTRACE_ARG3_TYPE) &inferior_control_registers, + ptrace_$control_set_m68k); + + bcopy (&inferior_registers, registers, 16 * 4); + bcopy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], + sizeof inferior_fp_registers.regs); + *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_control_registers.sr; + *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_control_registers.pc; +} + +/* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +void +store_inferior_registers (regno) + int regno; +{ + struct ptrace_$data_regs_m68k inferior_registers; + struct ptrace_$floating_regs_m68k inferior_fp_registers; + struct ptrace_$control_regs_m68k inferior_control_registers; + extern char registers[]; + + ptrace_$init_control(&inferior_control_registers); + inferior_fp_registers.size = sizeof(inferior_fp_registers); + + ptrace (PTRACE_GETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_fp_registers, + ptrace_$floating_set_m68k, + (PTRACE_ARG3_TYPE) &inferior_fp_registers, + ptrace_$floating_set_m68k); + + ptrace (PTRACE_GETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_control_registers, + ptrace_$control_set_m68k, + (PTRACE_ARG3_TYPE) &inferior_control_registers, + ptrace_$control_set_m68k); + + bcopy (registers, &inferior_registers, sizeof(inferior_registers)); + + bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)], inferior_fp_registers.regs, + sizeof inferior_fp_registers.regs); + + inferior_control_registers.sr = *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; + inferior_control_registers.pc = *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; + + ptrace (PTRACE_SETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_registers, + ptrace_$data_set_m68k, + (PTRACE_ARG3_TYPE) &inferior_registers, + ptrace_$data_set_m68k); + + ptrace (PTRACE_SETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_fp_registers, + ptrace_$floating_set_m68k, + (PTRACE_ARG3_TYPE) &inferior_fp_registers, + ptrace_$floating_set_m68k); + + ptrace (PTRACE_SETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_control_registers, + ptrace_$control_set_m68k, + (PTRACE_ARG3_TYPE) &inferior_control_registers, + ptrace_$control_set_m68k); +} diff --git a/contrib/gdb/gdb/altos-xdep.c b/contrib/gdb/gdb/altos-xdep.c new file mode 100644 index 0000000000000..e7b652c18369d --- /dev/null +++ b/contrib/gdb/gdb/altos-xdep.c @@ -0,0 +1,164 @@ +/* Low level interface to ptrace, for GDB when running under m68k SVR2 Unix + on Altos 3068. Report bugs to Jyrki Kuoppala <jkp@cs.hut.fi> + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "frame.h" +#include "inferior.h" + +#ifdef USG +#include <sys/types.h> +#endif + +#include <sys/param.h> +#include <sys/dir.h> +#include <signal.h> +#include <sys/ioctl.h> +#include <fcntl.h> +#ifdef USG +#include <sys/page.h> +#ifdef ALTOS +#include <sys/net.h> +#include <errno.h> +#endif +#endif + +#include "gdbcore.h" +#include <sys/user.h> /* After a.out.h */ +#include <sys/file.h> +#include "gdb_stat.h" + + +/* Work with core dump and executable files, for GDB. + This code would be in corefile.c if it weren't machine-dependent. */ + +void +core_file_command (filename, from_tty) + char *filename; + int from_tty; +{ + int val; + extern char registers[]; + + /* Discard all vestiges of any previous core file + and mark data and stack spaces as empty. */ + + if (corefile) + free (corefile); + corefile = 0; + + if (corechan >= 0) + close (corechan); + corechan = -1; + + data_start = 0; + data_end = 0; + stack_start = STACK_END_ADDR; + stack_end = STACK_END_ADDR; + + /* Now, if a new core file was specified, open it and digest it. */ + + if (filename) + { + filename = tilde_expand (filename); + make_cleanup (free, filename); + + if (have_inferior_p ()) + error ("To look at a core file, you must kill the program with \"kill\"."); + corechan = open (filename, O_RDONLY, 0); + if (corechan < 0) + perror_with_name (filename); + /* 4.2-style (and perhaps also sysV-style) core dump file. */ + { + struct user u; + + unsigned int reg_offset; + + val = myread (corechan, &u, sizeof u); + if (val < 0) + perror_with_name ("Not a core file: reading upage"); + if (val != sizeof u) + error ("Not a core file: could only read %d bytes", val); + data_start = exec_data_start; + +#if !defined (NBPG) +#define NBPG NBPP +#endif +#if !defined (UPAGES) +#define UPAGES USIZE +#endif + + data_end = data_start + NBPG * u.u_dsize; + stack_start = stack_end - NBPG * u.u_ssize; + data_offset = NBPG * UPAGES + exec_data_start % NBPG /* Not sure about this //jkp */; + stack_offset = NBPG * (UPAGES + u.u_dsize); + + /* Some machines put an absolute address in here and some put + the offset in the upage of the regs. */ + reg_offset = (int) u.u_state; + if (reg_offset > NBPG * UPAGES) + reg_offset -= KERNEL_U_ADDR; + + memcpy (&core_aouthdr, &u.u_exdata, sizeof (AOUTHDR)); + printf_unfiltered ("Core file is from \"%s\".\n", u.u_comm); + + /* I don't know where to find this info. + So, for now, mark it as not available. */ + N_SET_MAGIC (core_aouthdr, 0); + + /* Read the register values out of the core file and store + them where `read_register' will find them. */ + + { + register int regno; + + for (regno = 0; regno < NUM_REGS; regno++) + { + char buf[MAX_REGISTER_RAW_SIZE]; + + val = lseek (corechan, register_addr (regno, reg_offset), 0); + if (val < 0 + || (val = myread (corechan, buf, sizeof buf)) < 0) + { + char * buffer = (char *) alloca (strlen (reg_names[regno]) + + 30); + strcpy (buffer, "Reading register "); + strcat (buffer, reg_names[regno]); + + perror_with_name (buffer); + } + + supply_register (regno, buf); + } + } + } + if (filename[0] == '/') + corefile = savestring (filename, strlen (filename)); + else + { + corefile = concat (current_directory, "/", filename, NULL); + } + + flush_cached_frames (); + select_frame (get_current_frame (), 0); + validate_files (); + } + else if (from_tty) + printf_unfiltered ("No core file now.\n"); +} diff --git a/contrib/gdb/gdb/config/a29k/a29k-kern.mt b/contrib/gdb/gdb/config/a29k/a29k-kern.mt new file mode 100644 index 0000000000000..f1a2e521b0bec --- /dev/null +++ b/contrib/gdb/gdb/config/a29k/a29k-kern.mt @@ -0,0 +1,13 @@ +# Target: Remote AMD 29000 that runs Unix kernel on NYU Ultra3 processor board + +# This builds a gdb that should run on a host (we use sun3os4) that +# then communicates over the serial line to either an Adapt or MiniMon, +# for use in debugging Unix kernels. +# As compared to ordinary remote 29K debugging, this changes the register +# numbering a bit, to hold kernel regs, and adds support for looking at +# the upage. + +TDEPFILES= a29k-tdep.o remote-mm.o remote-adapt.o +TM_FILE= tm-ultra3.h + +MT_CFLAGS = -DKERNEL_DEBUGGING -DNO_HIF_SUPPORT diff --git a/contrib/gdb/gdb/config/a29k/a29k-udi.mt b/contrib/gdb/gdb/config/a29k/a29k-udi.mt new file mode 100644 index 0000000000000..6d5d27b701dd9 --- /dev/null +++ b/contrib/gdb/gdb/config/a29k/a29k-udi.mt @@ -0,0 +1,8 @@ +# Target: AMD 29000 on EB29K board over a serial line +TDEPFILES= a29k-tdep.o remote-udi.o udip2soc.o udr.o udi2go32.o +TM_FILE= tm-a29k.h + +# Disable standard remote support. +REMOTE_OBS= + +MT_CFLAGS = $(HOST_IPC) diff --git a/contrib/gdb/gdb/config/a29k/a29k.mt b/contrib/gdb/gdb/config/a29k/a29k.mt new file mode 100644 index 0000000000000..a3f5910b18fe0 --- /dev/null +++ b/contrib/gdb/gdb/config/a29k/a29k.mt @@ -0,0 +1,5 @@ +# Target: AMD 29000 +TDEPFILES= a29k-tdep.o remote-eb.o remote-adapt.o +TM_FILE= tm-a29k.h + +MT_CFLAGS = -DNO_HIF_SUPPORT diff --git a/contrib/gdb/gdb/config/a29k/nm-ultra3.h b/contrib/gdb/gdb/config/a29k/nm-ultra3.h new file mode 100644 index 0000000000000..a3bc47452c4bd --- /dev/null +++ b/contrib/gdb/gdb/config/a29k/nm-ultra3.h @@ -0,0 +1,26 @@ +/* Host definitions for GDB running on an a29k NYU Ultracomputer + Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc. + Contributed by David Wood (wood@lab.ultra.nyu.edu). + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* If we ever *do* end up using the standard fetch_inferior_registers, + this is the right value for U_REGS_OFFSET. */ +#define U_REGS_OFFSET 0 + +/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ +#define FETCH_INFERIOR_REGISTERS diff --git a/contrib/gdb/gdb/config/a29k/tm-a29k.h b/contrib/gdb/gdb/config/a29k/tm-a29k.h new file mode 100644 index 0000000000000..24a3e08a79783 --- /dev/null +++ b/contrib/gdb/gdb/config/a29k/tm-a29k.h @@ -0,0 +1,708 @@ +/* Parameters for target machine AMD 29000, for GDB, the GNU debugger. + Copyright 1990, 1991, 1993, 1994 Free Software Foundation, Inc. + Contributed by Cygnus Support. Written by Jim Kingdon. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Parameters for an EB29K (a board which plugs into a PC and is + accessed through EBMON software running on the PC, which we + use as we'd use a remote stub (see remote-eb.c). + + If gdb is ported to other a29k machines/systems, the + machine/system-specific parts should be removed from this file (a + la tm-m68k.h). */ + +/* Byte order is configurable, but this machine runs big-endian. */ +#define TARGET_BYTE_ORDER BIG_ENDIAN + +/* Floating point uses IEEE representations. */ +#define IEEE_FLOAT + +/* Recognize our magic number. */ +#define BADMAG(x) ((x).f_magic != 0572) + +/* Offset from address of function to start of its code. + Zero on most machines. */ + +#define FUNCTION_START_OFFSET 0 + +/* Advance PC across any function entry prologue instructions + to reach some "real" code. */ + +#define SKIP_PROLOGUE(pc) \ + { pc = skip_prologue (pc); } +CORE_ADDR skip_prologue (); + +/* Immediately after a function call, return the saved pc. + Can't go through the frames for this because on some machines + the new frame is not set up until the new function executes + some instructions. */ + +#define SAVED_PC_AFTER_CALL(frame) ((frame->flags & TRANSPARENT) \ + ? read_register (TPC_REGNUM) \ + : read_register (LR0_REGNUM)) + +/* Stack grows downward. */ + +#define INNER_THAN < + +/* Stack must be aligned on 32-bit word boundaries. */ +#define STACK_ALIGN(ADDR) (((ADDR) + 3) & ~3) + +/* Sequence of bytes for breakpoint instruction. */ +/* ASNEQ 0x50, gr1, gr1 + The trap number 0x50 is chosen arbitrarily. + We let the command line (or previously included files) override this + setting. */ +#ifndef BREAKPOINT +#if TARGET_BYTE_ORDER == BIG_ENDIAN +#define BREAKPOINT {0x72, 0x50, 0x01, 0x01} +#else /* Target is little-endian. */ +#define BREAKPOINT {0x01, 0x01, 0x50, 0x72} +#endif /* Target is little-endian. */ +#endif /* BREAKPOINT */ + +/* Amount PC must be decremented by after a breakpoint. + This is often the number of bytes in BREAKPOINT + but not always. */ + +#define DECR_PC_AFTER_BREAK 0 + +/* Nonzero if instruction at PC is a return instruction. + On the a29k, this is a "jmpi l0" instruction. */ + +#define ABOUT_TO_RETURN(pc) \ + ((read_memory_integer (pc, 4) & 0xff0000ff) == 0xc0000080) + +/* Say how long (ordinary) registers are. This is a piece of bogosity + used in push_word and a few other places; REGISTER_RAW_SIZE is the + real way to know how big a register is. */ + +#define REGISTER_SIZE 4 + +/* Allow the register declarations here to be overridden for remote + kernel debugging. */ +#if !defined (REGISTER_NAMES) + +/* Number of machine registers */ + +#define NUM_REGS 205 + +/* Initializer for an array of names of registers. + There should be NUM_REGS strings in this initializer. + + FIXME, add floating point registers and support here. + + Also note that this list does not attempt to deal with kernel + debugging (in which the first 32 registers are gr64-gr95). */ + +#define REGISTER_NAMES \ +{"gr96", "gr97", "gr98", "gr99", "gr100", "gr101", "gr102", "gr103", "gr104", \ + "gr105", "gr106", "gr107", "gr108", "gr109", "gr110", "gr111", "gr112", \ + "gr113", "gr114", "gr115", "gr116", "gr117", "gr118", "gr119", "gr120", \ + "gr121", "gr122", "gr123", "gr124", "gr125", "gr126", "gr127", \ + "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", "lr8", "lr9", \ + "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", "lr16", "lr17", "lr18", \ + "lr19", "lr20", "lr21", "lr22", "lr23", "lr24", "lr25", "lr26", "lr27", \ + "lr28", "lr29", "lr30", "lr31", "lr32", "lr33", "lr34", "lr35", "lr36", \ + "lr37", "lr38", "lr39", "lr40", "lr41", "lr42", "lr43", "lr44", "lr45", \ + "lr46", "lr47", "lr48", "lr49", "lr50", "lr51", "lr52", "lr53", "lr54", \ + "lr55", "lr56", "lr57", "lr58", "lr59", "lr60", "lr61", "lr62", "lr63", \ + "lr64", "lr65", "lr66", "lr67", "lr68", "lr69", "lr70", "lr71", "lr72", \ + "lr73", "lr74", "lr75", "lr76", "lr77", "lr78", "lr79", "lr80", "lr81", \ + "lr82", "lr83", "lr84", "lr85", "lr86", "lr87", "lr88", "lr89", "lr90", \ + "lr91", "lr92", "lr93", "lr94", "lr95", "lr96", "lr97", "lr98", "lr99", \ + "lr100", "lr101", "lr102", "lr103", "lr104", "lr105", "lr106", "lr107", \ + "lr108", "lr109", "lr110", "lr111", "lr112", "lr113", "lr114", "lr115", \ + "lr116", "lr117", "lr118", "lr119", "lr120", "lr121", "lr122", "lr123", \ + "lr124", "lr125", "lr126", "lr127", \ + "AI0", "AI1", "AI2", "AI3", "AI4", "AI5", "AI6", "AI7", "AI8", "AI9", \ + "AI10", "AI11", "AI12", "AI13", "AI14", "AI15", "FP", \ + "bp", "fc", "cr", "q", \ + "vab", "ops", "cps", "cfg", "cha", "chd", "chc", "rbp", "tmc", "tmr", \ + "pc0", "pc1", "pc2", "mmu", "lru", "fpe", "inte", "fps", "exo", "gr1", \ + "alu", "ipc", "ipa", "ipb" } + +/* + * Converts an sdb register number to an internal gdb register number. + * Currently under epi, gr96->0...gr127->31...lr0->32...lr127->159, or... + * gr64->0...gr95->31, lr0->32...lr127->159. + */ +#define SDB_REG_TO_REGNUM(value) \ + (((value) >= 96 && (value) <= 127) ? ((value) - 96) : \ + ((value) >= 128 && (value) <= 255) ? ((value) - 128 + LR0_REGNUM) : \ + (value)) + +/* + * Provide the processor register numbers of some registers that are + * expected/written in instructions that might change under different + * register sets. Namely, gcc can compile (-mkernel-registers) so that + * it uses gr64-gr95 in stead of gr96-gr127. + */ +#define MSP_HW_REGNUM 125 /* gr125 */ +#define RAB_HW_REGNUM 126 /* gr126 */ + +/* Convert Processor Special register #x to REGISTER_NAMES register # */ +#define SR_REGNUM(x) \ + ((x) < 15 ? VAB_REGNUM + (x) \ + : (x) >= 128 && (x) < 131 ? IPC_REGNUM + (x) - 128 \ + : (x) == 131 ? Q_REGNUM \ + : (x) == 132 ? ALU_REGNUM \ + : (x) >= 133 && (x) < 136 ? BP_REGNUM + (x) - 133 \ + : (x) >= 160 && (x) < 163 ? FPE_REGNUM + (x) - 160 \ + : (x) == 164 ? EXO_REGNUM \ + : (error ("Internal error in SR_REGNUM"), 0)) +#define GR96_REGNUM 0 + +/* Define the return register separately, so it can be overridden for + kernel procedure calling conventions. */ +#define RETURN_REGNUM GR96_REGNUM +#define GR1_REGNUM 200 +/* This needs to be the memory stack pointer, not the register stack pointer, + to make call_function work right. */ +#define SP_REGNUM MSP_REGNUM +#define FP_REGNUM 33 /* lr1 */ + +/* Return register for transparent calling convention (gr122). */ +#define TPC_REGNUM (122 - 96 + GR96_REGNUM) + +/* Large Return Pointer (gr123). */ +#define LRP_REGNUM (123 - 96 + GR96_REGNUM) + +/* Static link pointer (gr124). */ +#define SLP_REGNUM (124 - 96 + GR96_REGNUM) + +/* Memory Stack Pointer (gr125). */ +#define MSP_REGNUM (125 - 96 + GR96_REGNUM) + +/* Register allocate bound (gr126). */ +#define RAB_REGNUM (126 - 96 + GR96_REGNUM) + +/* Register Free Bound (gr127). */ +#define RFB_REGNUM (127 - 96 + GR96_REGNUM) + +/* Register Stack Pointer. */ +#define RSP_REGNUM GR1_REGNUM +#define LR0_REGNUM 32 +#define BP_REGNUM 177 +#define FC_REGNUM 178 +#define CR_REGNUM 179 +#define Q_REGNUM 180 +#define VAB_REGNUM 181 +#define OPS_REGNUM (VAB_REGNUM + 1) +#define CPS_REGNUM (VAB_REGNUM + 2) +#define CFG_REGNUM (VAB_REGNUM + 3) +#define CHA_REGNUM (VAB_REGNUM + 4) +#define CHD_REGNUM (VAB_REGNUM + 5) +#define CHC_REGNUM (VAB_REGNUM + 6) +#define RBP_REGNUM (VAB_REGNUM + 7) +#define TMC_REGNUM (VAB_REGNUM + 8) +#define TMR_REGNUM (VAB_REGNUM + 9) +#define NPC_REGNUM (VAB_REGNUM + 10) /* pc0 */ +#define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */ +#define PC2_REGNUM (VAB_REGNUM + 12) +#define MMU_REGNUM (VAB_REGNUM + 13) +#define LRU_REGNUM (VAB_REGNUM + 14) +#define FPE_REGNUM (VAB_REGNUM + 15) +#define INTE_REGNUM (VAB_REGNUM + 16) +#define FPS_REGNUM (VAB_REGNUM + 17) +#define EXO_REGNUM (VAB_REGNUM + 18) +/* gr1 is defined above as 200 = VAB_REGNUM + 19 */ +#define ALU_REGNUM (VAB_REGNUM + 20) +#define PS_REGNUM ALU_REGNUM +#define IPC_REGNUM (VAB_REGNUM + 21) +#define IPA_REGNUM (VAB_REGNUM + 22) +#define IPB_REGNUM (VAB_REGNUM + 23) + +#endif /* !defined(REGISTER_NAMES) */ + +/* Total amount of space needed to store our copies of the machine's + register state, the array `registers'. */ +#define REGISTER_BYTES (NUM_REGS * 4) + +/* Index within `registers' of the first byte of the space for + register N. */ +#define REGISTER_BYTE(N) ((N)*4) + +/* Number of bytes of storage in the actual machine representation + for register N. */ + +/* All regs are 4 bytes. */ + +#define REGISTER_RAW_SIZE(N) (4) + +/* Number of bytes of storage in the program's representation + for register N. */ + +/* All regs are 4 bytes. */ + +#define REGISTER_VIRTUAL_SIZE(N) (4) + +/* Largest value REGISTER_RAW_SIZE can have. */ + +#define MAX_REGISTER_RAW_SIZE (4) + +/* Largest value REGISTER_VIRTUAL_SIZE can have. */ + +#define MAX_REGISTER_VIRTUAL_SIZE (4) + +/* Return the GDB type object for the "standard" data type + of data in register N. */ + +#define REGISTER_VIRTUAL_TYPE(N) \ + (((N) == PC_REGNUM || (N) == LRP_REGNUM || (N) == SLP_REGNUM \ + || (N) == MSP_REGNUM || (N) == RAB_REGNUM || (N) == RFB_REGNUM \ + || (N) == GR1_REGNUM || (N) == FP_REGNUM || (N) == LR0_REGNUM \ + || (N) == NPC_REGNUM || (N) == PC2_REGNUM) \ + ? lookup_pointer_type (builtin_type_void) : builtin_type_int) + +/* Store the address of the place in which to copy the structure the + subroutine will return. This is called from call_function. */ +/* On the a29k the LRP points to the part of the structure beyond the first + 16 words. */ +#define STORE_STRUCT_RETURN(ADDR, SP) \ + write_register (LRP_REGNUM, (ADDR) + 16 * 4); + +/* Should call_function allocate stack space for a struct return? */ +/* On the a29k objects over 16 words require the caller to allocate space. */ +#define USE_STRUCT_CONVENTION(gcc_p, type) (TYPE_LENGTH (type) > 16 * 4) + +/* Extract from an array REGBUF containing the (raw) register state + a function return value of type TYPE, and copy that, in virtual format, + into VALBUF. */ + +#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ + { \ + int reg_length = TYPE_LENGTH (TYPE); \ + if (reg_length > 16 * 4) \ + { \ + reg_length = 16 * 4; \ + read_memory (*((int *)(REGBUF) + LRP_REGNUM), (VALBUF) + 16 * 4, \ + TYPE_LENGTH (TYPE) - 16 * 4); \ + } \ + memcpy ((VALBUF), ((int *)(REGBUF))+RETURN_REGNUM, reg_length); \ + } + +/* Write into appropriate registers a function return value + of type TYPE, given in virtual format. */ + +#define STORE_RETURN_VALUE(TYPE,VALBUF) \ + { \ + int reg_length = TYPE_LENGTH (TYPE); \ + if (reg_length > 16 * 4) \ + { \ + reg_length = 16 * 4; \ + write_memory (read_register (LRP_REGNUM), \ + (char *)(VALBUF) + 16 * 4, \ + TYPE_LENGTH (TYPE) - 16 * 4); \ + } \ + write_register_bytes (REGISTER_BYTE (RETURN_REGNUM), (char *)(VALBUF), \ + TYPE_LENGTH (TYPE)); \ + } + +/* The a29k user's guide documents well what the stacks look like. + But what isn't so clear there is how this interracts with the + symbols, or with GDB. + In the following saved_msp, saved memory stack pointer (which functions + as a memory frame pointer), means either + a register containing the memory frame pointer or, in the case of + functions with fixed size memory frames (i.e. those who don't use + alloca()), the result of the calculation msp + msize. + + LOC_ARG, LOC_LOCAL - For GCC, these are relative to saved_msp. + For high C, these are relative to msp (making alloca impossible). + LOC_REGISTER, LOC_REGPARM - The register number is the number at the + time the function is running (after the prologue), or in the case + of LOC_REGPARM, may be a register number in the range 160-175. + + The compilers do things like store an argument into memory, and then put out + a LOC_ARG for it, or put it into global registers and put out a + LOC_REGPARM. Thus is it important to execute the first line of + code (i.e. the line of the open brace, i.e. the prologue) of a function + before trying to print arguments or anything. + + The following diagram attempts to depict what is going on in memory + (see also the _a29k user's guide_) and also how that interacts with + GDB frames. We arbitrarily pick fci->frame to point the same place + as the register stack pointer; since we set it ourself in + INIT_EXTRA_FRAME_INFO, and access it only through the FRAME_* + macros, it doesn't really matter exactly how we + do it. However, note that FRAME_FP is used in two ways in GDB: + (1) as a "magic cookie" which uniquely identifies frames (even over + calls to the inferior), (2) (in PC_IN_CALL_DUMMY [ON_STACK]) + as the value of SP_REGNUM before the dummy frame was pushed. These + two meanings would be incompatible for the a29k if we defined + CALL_DUMMY_LOCATION == ON_STACK (but we don't, so don't worry about it). + Also note that "lr1" below, while called a frame pointer + in the user's guide, has only one function: To determine whether + registers need to be filled in the function epilogue. + + Consider the code: + < call bar> + loc1: . . . + bar: sub gr1,gr1,rsize_b + . . . + add mfp,msp,0 + sub msp,msp,msize_b + . . . + < call foo > + loc2: . . . + foo: sub gr1,gr1,rsize_f + . . . + add mfp,msp,0 + sub msp,msp,msize_f + . . . + loc3: < suppose the inferior stops here > + + memory stack register stack + | | |____________| + | | |____loc1____| + +------->|___________| | | ^ + | | ^ | | locals_b | | + | | | | |____________| | + | | | | | | | rsize_b + | | | msize_b | | args_to_f | | + | | | | |____________| | + | | | | |____lr1_____| V + | | V | |____loc2____|<----------------+ + | +--->|___________|<---------mfp | ^ | + | | | ^ | | locals_f | | | + | | | | msize_f | |____________| | | + | | | | | | | | rsize_f | + | | | V | | args | | | + | | |___________|<msp |____________| | | + | | |_____lr1____| V | + | | |___garbage__| <- gr1 <----+ | + | | | | + | | | | + | | pc=loc3 | | + | | | | + | | | | + | | frame cache | | + | | |_________________| | | + | | |rsize=rsize_b | | | + | | |msize=msize_b | | | + +---|--------saved_msp | | | + | |frame------------------------------------|---+ + | |pc=loc2 | | + | |_________________| | + | |rsize=rsize_f | | + | |msize=msize_f | | + +--------saved_msp | | + |frame------------------------------------+ + |pc=loc3 | + |_________________| + + So, is that sufficiently confusing? Welcome to the 29000. + Notes: + * The frame for foo uses a memory frame pointer but the frame for + bar does not. In the latter case the saved_msp is + computed by adding msize to the saved_msp of the + next frame. + * msize is in the frame cache only for high C's sake. */ + +void read_register_stack (); +long read_register_stack_integer (); + +#define EXTRA_FRAME_INFO \ + CORE_ADDR saved_msp; \ + unsigned int rsize; \ + unsigned int msize; \ + unsigned char flags; + +/* Bits for flags in EXTRA_FRAME_INFO */ +#define TRANSPARENT 0x1 /* This is a transparent frame */ +#define MFP_USED 0x2 /* A memory frame pointer is used */ + +/* Because INIT_FRAME_PC gets passed fromleaf, that's where we init + not only ->pc and ->frame, but all the extra stuff, when called from + get_prev_frame_info, that is. */ +#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci) +void init_extra_frame_info (); + +#define INIT_FRAME_PC(fromleaf, fci) init_frame_pc(fromleaf, fci) +void init_frame_pc (); + + +/* FRAME_CHAIN takes a FRAME + and produces the frame's chain-pointer. + + However, if FRAME_CHAIN_VALID returns zero, + it means the given frame is the outermost one and has no caller. */ + +/* On the a29k, the nominal address of a frame is the address on the + register stack of the return address (the one next to the incoming + arguments, not down at the bottom so nominal address == stack pointer). + + GDB expects "nominal address" to equal contents of FP_REGNUM, + at least when it comes time to create the innermost frame. + However, that doesn't work for us, so when creating the innermost + frame we set ->frame ourselves in INIT_EXTRA_FRAME_INFO. */ + +/* These are mostly dummies for the a29k because INIT_FRAME_PC + sets prev->frame instead. */ +/* If rsize is zero, we must be at end of stack (or otherwise hosed). + If we don't check rsize, we loop forever if we see rsize == 0. */ +#define FRAME_CHAIN(thisframe) \ + ((thisframe)->rsize == 0 \ + ? 0 \ + : (thisframe)->frame + (thisframe)->rsize) + +/* Determine if the frame has a 'previous' and back-traceable frame. */ +#define FRAME_IS_UNCHAINED(frame) ((frame)->flags & TRANSPARENT) + +/* Find the previous frame of a transparent routine. + * For now lets not try and trace through a transparent routine (we might + * have to assume that all transparent routines are traps). + */ +#define FIND_PREV_UNCHAINED_FRAME(frame) 0 + +/* Define other aspects of the stack frame. */ + +/* A macro that tells us whether the function invocation represented + by FI does not have a frame on the stack associated with it. If it + does not, FRAMELESS is set to 1, else 0. */ +#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \ + (FRAMELESS) = frameless_look_for_prologue(FI) + +/* Saved pc (i.e. return address). */ +#define FRAME_SAVED_PC(fraim) \ + (read_register_stack_integer ((fraim)->frame + (fraim)->rsize, 4)) + +/* Local variables (i.e. LOC_LOCAL) are on the memory stack, with their + offsets being relative to the memory stack pointer (high C) or + saved_msp (gcc). */ + +#define FRAME_LOCALS_ADDRESS(fi) frame_locals_address (fi) +extern CORE_ADDR frame_locals_address (); + +/* Return number of args passed to a frame. + Can return -1, meaning no way to tell. */ +/* We tried going to the effort of finding the tags word and getting + the argcount field from it, to support debugging assembler code. + Problem was, the "argcount" field never did hold the argument + count. */ +#define FRAME_NUM_ARGS(numargs, fi) ((numargs) = -1) + +#define FRAME_ARGS_ADDRESS(fi) FRAME_LOCALS_ADDRESS (fi) + +/* Return number of bytes at start of arglist that are not really args. */ + +#define FRAME_ARGS_SKIP 0 + +/* Provide our own get_saved_register. HAVE_REGISTER_WINDOWS is insufficient + because registers get renumbered on the a29k without getting saved. */ + +#define GET_SAVED_REGISTER + +/* Call function stuff. */ + +/* The dummy frame looks like this (see also the general frame picture + above): + + register stack + + | | frame for function + | locals_sproc | executing at time + |________________| of call_function. + | | We must not disturb + | args_out_sproc | it. + memory stack |________________| + |____lr1_sproc___|<-+ + | | |__retaddr_sproc_| | <-- gr1 (at start) + |____________|<-msp 0 <-----------mfp_dummy_____| | + | | (at start) | save regs | | + | arg_slop | | pc0,pc1 | | + | | | pc2,lr0 sproc | | + | (16 words) | | gr96-gr124 | | + |____________|<-msp 1--after | sr160-sr162 | | + | | PUSH_DUMMY_FRAME| sr128-sr135 | | + | struct ret | |________________| | + | 17+ | | | | + |____________|<- lrp | args_out_dummy | | + | struct ret | | (16 words) | | + | 16 | |________________| | + | (16 words) | |____lr1_dummy___|--+ + |____________|<- msp 2--after |_retaddr_dummy__|<- gr1 after + | | struct ret | | PUSH_DUMMY_FRAME + | margs17+ | area allocated | locals_inf | + | | |________________| called + |____________|<- msp 4--when | | function's + | | inf called | args_out_inf | frame (set up + | margs16 | |________________| by called + | (16 words) | |_____lr1_inf____| function). + |____________|<- msp 3--after | . | + | | args pushed | . | + | | | . | + | | + + arg_slop: This area is so that when the call dummy adds 16 words to + the msp, it won't end up larger than mfp_dummy (it is needed in the + case where margs and struct_ret do not add up to at least 16 words). + struct ret: This area is allocated by GDB if the return value is more + than 16 words. struct ret_16 is not used on the a29k. + margs: Pushed by GDB. The call dummy copies the first 16 words to + args_out_dummy. + retaddr_sproc: Contains the PC at the time we call the function. + set by PUSH_DUMMY_FRAME and read by POP_FRAME. + retaddr_dummy: This points to a breakpoint instruction in the dummy. */ + +/* Rsize for dummy frame, in bytes. */ + +/* Bytes for outgoing args, lr1, and retaddr. */ +#define DUMMY_ARG (2 * 4 + 16 * 4) + +/* Number of special registers (sr128-) to save. */ +#define DUMMY_SAVE_SR128 8 +/* Number of special registers (sr160-) to save. */ +#define DUMMY_SAVE_SR160 3 +/* Number of general (gr96- or gr64-) registers to save. */ +#define DUMMY_SAVE_GREGS 29 + +#define DUMMY_FRAME_RSIZE \ +(4 /* mfp_dummy */ \ + + 4 * 4 /* pc0, pc1, pc2, lr0 */ \ + + DUMMY_SAVE_GREGS * 4 \ + + DUMMY_SAVE_SR160 * 4 \ + + DUMMY_SAVE_SR128 * 4 \ + + DUMMY_ARG \ + + 4 /* pad to doubleword */ ) + +/* Push an empty stack frame, to record the current PC, etc. */ + +#define PUSH_DUMMY_FRAME push_dummy_frame() +extern void push_dummy_frame (); + +/* Discard from the stack the innermost frame, + restoring all saved registers. */ + +#define POP_FRAME pop_frame() +extern void pop_frame (); + +/* This sequence of words is the instructions + mtsrim cr, 15 + loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers + add msp, msp, 16 * 4 ; point to the remaining arguments + CONST_INSN: + const lr0,inf ; (replaced by half of target addr) + consth lr0,inf ; (replaced by other half of target addr) + calli lr0, lr0 + aseq 0x40,gr1,gr1 ; nop + BREAKPT_INSN: + asneq 0x50,gr1,gr1 ; breakpoint (replaced by local breakpoint insn) + */ + +#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER +#define BS(const) const +#else +#define BS(const) (((const) & 0xff) << 24) | \ + (((const) & 0xff00) << 8) | \ + (((const) & 0xff0000) >> 8) | \ + (((const) & 0xff000000) >> 24) +#endif + +/* Position of the "const" and blkt instructions within CALL_DUMMY in bytes. */ +#define CONST_INSN (3 * 4) +#define BREAKPT_INSN (7 * 4) +#define CALL_DUMMY { \ + BS(0x0400870f),\ + BS(0x36008200|(MSP_HW_REGNUM)), \ + BS(0x15000040|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16)), \ + BS(0x03ff80ff), \ + BS(0x02ff80ff), \ + BS(0xc8008080), \ + BS(0x70400101), \ + BS(0x72500101)} +#define CALL_DUMMY_LENGTH (8 * 4) + +#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */ + +/* Helper macro for FIX_CALL_DUMMY. WORDP is a long * which points to a + word in target byte order; bits 0-7 and 16-23 of *WORDP are replaced with + bits 0-7 and 8-15 of DATA (which is in host byte order). */ + +#if TARGET_BYTE_ORDER == BIG_ENDIAN +#define STUFF_I16(WORDP, DATA) \ + { \ + *((char *)(WORDP) + 3) = ((DATA) & 0xff);\ + *((char *)(WORDP) + 1) = (((DATA) >> 8) & 0xff);\ + } +#else /* Target is little endian. */ +#define STUFF_I16(WORDP, DATA) \ + { + *(char *)(WORDP) = ((DATA) & 0xff); + *((char *)(WORDP) + 2) = (((DATA) >> 8) & 0xff); + } +#endif /* Target is little endian. */ + +/* Insert the specified number of args and function address + into a call sequence of the above form stored at DUMMYNAME. */ + +/* Currently this stuffs in the address of the function that we are calling. + Since different a29k systems use different breakpoint instructions, it + also stuffs BREAKPOINT in the right place (to avoid having to + duplicate CALL_DUMMY in each tm-*.h file). */ + +#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ + {\ + STUFF_I16((char *)dummyname + CONST_INSN, fun); \ + STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16); \ + /* FIXME memcpy ((char *)(dummyname) + BREAKPT_INSN, break_insn, 4); */ \ + } + +/* a29k architecture has separate data & instruction memories -- wired to + different pins on the chip -- and can't execute the data memory. + Also, there should be space after text_end; + we won't get a SIGSEGV or scribble on data space. */ + +#define CALL_DUMMY_LOCATION AFTER_TEXT_END + +/* Because of this, we need (as a kludge) to know the addresses of the + text section. */ + +#define NEED_TEXT_START_END + +/* How to translate register numbers in the .stab's into gdb's internal register + numbers. We don't translate them, but we warn if an invalid register + number is seen. Note that FIXME, we use the value "sym" as an implicit + argument in printing the error message. It happens to be available where + this macro is used. (This macro definition appeared in a late revision + of gdb-3.91.6 and is not well tested. Also, it should be a "complaint".) */ + +#define STAB_REG_TO_REGNUM(num) \ + (((num) > LR0_REGNUM + 127) \ + ? fprintf(stderr, \ + "Invalid register number %d in symbol table entry for %s\n", \ + (num), SYMBOL_SOURCE_NAME (sym)), (num) \ + : (num)) + +extern enum a29k_processor_types { + a29k_unknown, + + /* Bit 0x400 of the CPS does *not* identify freeze mode, i.e. 29000, + 29030, etc. */ + a29k_no_freeze_mode, + + /* Bit 0x400 of the CPS does identify freeze mode, i.e. 29050. */ + a29k_freeze_mode +} processor_type; + +/* We need three arguments for a general frame specification for the + "frame" or "info frame" command. */ + +#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) +extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *)); diff --git a/contrib/gdb/gdb/config/a29k/tm-ultra3.h b/contrib/gdb/gdb/config/a29k/tm-ultra3.h new file mode 100644 index 0000000000000..8b96210e475ea --- /dev/null +++ b/contrib/gdb/gdb/config/a29k/tm-ultra3.h @@ -0,0 +1,226 @@ +/* Parameters for NYU Ultracomputer 29000 target, for GDB, the GNU debugger. + Copyright 1990, 1991 Free Software Foundation, Inc. + Contributed by David Wood @ New York University (wood@nyu.edu). + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* This file includes tm-a29k.h, but predefines REGISTER_NAMES and + related macros. The file supports a a29k running our flavor of + Unix on our Ultra3 PE Boards. */ + +/* Byte order is configurable, but this machine runs big-endian. */ +#define TARGET_BYTE_ORDER BIG_ENDIAN + +/* Initializer for an array of names of registers. + There should be NUM_REGS strings in this initializer. + */ +#define NUM_REGS (EXO_REGNUM + 1) + +#define REGISTER_NAMES { \ + "gr1", \ + "gr64", "gr65", "gr66", "gr67", "gr68", "gr69", "gr70", "gr71", "gr72", \ + "gr73", "gr74", "gr75", "gr76", "gr77", "gr78", "gr79", "gr80", "gr81", \ + "gr82", "gr83", "gr84", "gr85", "gr86", "gr87", "gr88", "gr89", "gr90", \ + "gr91", "gr92", "gr93", "gr94", "gr95", \ + "gr96", "gr97", "gr98", "gr99", "gr100", "gr101", "gr102", "gr103", "gr104", \ + "gr105", "gr106", "gr107", "gr108", "gr109", "gr110", "gr111", "gr112", \ + "gr113", "gr114", "gr115", "gr116", "gr117", "gr118", "gr119", "gr120", \ + "gr121", "gr122", "gr123", "gr124", "gr125", "gr126", "gr127", \ + "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", "lr8", "lr9", \ + "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", "lr16", "lr17", "lr18", \ + "lr19", "lr20", "lr21", "lr22", "lr23", "lr24", "lr25", "lr26", "lr27", \ + "lr28", "lr29", "lr30", "lr31", "lr32", "lr33", "lr34", "lr35", "lr36", \ + "lr37", "lr38", "lr39", "lr40", "lr41", "lr42", "lr43", "lr44", "lr45", \ + "lr46", "lr47", "lr48", "lr49", "lr50", "lr51", "lr52", "lr53", "lr54", \ + "lr55", "lr56", "lr57", "lr58", "lr59", "lr60", "lr61", "lr62", "lr63", \ + "lr64", "lr65", "lr66", "lr67", "lr68", "lr69", "lr70", "lr71", "lr72", \ + "lr73", "lr74", "lr75", "lr76", "lr77", "lr78", "lr79", "lr80", "lr81", \ + "lr82", "lr83", "lr84", "lr85", "lr86", "lr87", "lr88", "lr89", "lr90", \ + "lr91", "lr92", "lr93", "lr94", "lr95", "lr96", "lr97", "lr98", "lr99", \ + "lr100", "lr101", "lr102", "lr103", "lr104", "lr105", "lr106", "lr107", \ + "lr108", "lr109", "lr110", "lr111", "lr112", "lr113", "lr114", "lr115", \ + "lr116", "lr117", "lr118", "lr119", "lr120", "lr121", "lr122", "lr123", \ + "lr124", "lr125", "lr126", "lr127", \ + "vab", "ops", "cps", "cfg", "cha", "chd", "chc", "rbp", "tmc", "tmr", \ + "pc0", "pc1", "pc2", "mmu", "lru", \ + "ipc", "ipa", "ipb", "q", "alu", "bp", "fc", "cr", \ + "fpe", "int", "fps", "exo" } + + +#ifdef KERNEL_DEBUGGING +# define PADDR_U_REGNUM 22 /* gr86 */ +# define RETURN_REGNUM GR64_REGNUM +#else +# define RETURN_REGNUM GR96_REGNUM +#endif /* KERNEL_DEBUGGING */ + + +/* Should rename all GR96_REGNUM to RETURN_REGNUM */ +#define GR1_REGNUM (0) +#define GR64_REGNUM 1 +#define GR96_REGNUM (GR64_REGNUM + 32) +/* This needs to be the memory stack pointer, not the register stack pointer, + to make call_function work right. */ +#define SP_REGNUM MSP_REGNUM + +#define FP_REGNUM (LR0_REGNUM + 1) /* lr1 */ +/* Large Return Pointer */ +#define LRP_REGNUM (123 - 96 + RETURN_REGNUM) +/* Static link pointer */ +#define SLP_REGNUM (124 - 96 + RETURN_REGNUM) +/* Memory Stack Pointer. */ +#define MSP_REGNUM (125 - 96 + RETURN_REGNUM) +/* Register allocate bound. */ +#define RAB_REGNUM (126 - 96 + RETURN_REGNUM) +/* Register Free Bound. */ +#define RFB_REGNUM (127 - 96 + RETURN_REGNUM) +/* Register Stack Pointer. */ +#define RSP_REGNUM GR1_REGNUM +#define LR0_REGNUM ( 32 + GR96_REGNUM) + +/* Protected Special registers */ +#define VAB_REGNUM (LR0_REGNUM + 128) +#define OPS_REGNUM (VAB_REGNUM + 1) +#define CPS_REGNUM (VAB_REGNUM + 2) +#define CFG_REGNUM (VAB_REGNUM + 3) +#define CHA_REGNUM (VAB_REGNUM + 4) +#define CHD_REGNUM (VAB_REGNUM + 5) +#define CHC_REGNUM (VAB_REGNUM + 6) +#define RBP_REGNUM (VAB_REGNUM + 7) +#define TMC_REGNUM (VAB_REGNUM + 8) +#define TMR_REGNUM (VAB_REGNUM + 9) +#define NPC_REGNUM (VAB_REGNUM + 10) /* pc0 */ +#define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */ +#define PC2_REGNUM (VAB_REGNUM + 12) /* pc2 */ +#define MMU_REGNUM (VAB_REGNUM + 13) +#define LRU_REGNUM (VAB_REGNUM + 14) + /* Register sequence gap */ +/* Unprotected Special registers */ +#define IPC_REGNUM (LRU_REGNUM + 1) +#define IPA_REGNUM (IPC_REGNUM + 1) +#define IPB_REGNUM (IPC_REGNUM + 2) +#define Q_REGNUM (IPC_REGNUM + 3) +#define ALU_REGNUM (IPC_REGNUM + 4) +#define PS_REGNUM ALU_REGNUM +#define BP_REGNUM (IPC_REGNUM + 5) +#define FC_REGNUM (IPC_REGNUM + 6) +#define CR_REGNUM (IPC_REGNUM + 7) + /* Register sequence gap */ +#define FPE_REGNUM (CR_REGNUM + 1) +#define INT_REGNUM (FPE_REGNUM + 1) +#define FPS_REGNUM (FPE_REGNUM + 2) + /* Register sequence gap */ +#define EXO_REGNUM (FPS_REGNUM + 1) + +/* Special register #x. */ +#define SR_REGNUM(x) \ + ((x) < 15 ? VAB_REGNUM + (x) \ + : (x) >= 128 && (x) < 136 ? IPC_REGNUM + (x-128) \ + : (x) >= 160 && (x) < 163 ? FPE_REGNUM + (x-160) \ + : (x) == 164 ? EXO_REGNUM \ + : (error ("Internal error in SR_REGNUM"), 0)) + +#ifndef KERNEL_DEBUGGING +/* + * This macro defines the register numbers (from REGISTER_NAMES) that + * are effectively unavailable to the user through ptrace(). It allows + * us to include the whole register set in REGISTER_NAMES (inorder to + * better support remote debugging). If it is used in + * fetch/store_inferior_registers() gdb will not complain about I/O errors + * on fetching these registers. If all registers in REGISTER_NAMES + * are available, then return false (0). + */ +#define CANNOT_STORE_REGISTER(regno) \ + (((regno)>=GR64_REGNUM && (regno)<GR64_REGNUM+32) || \ + ((regno)==VAB_REGNUM) || \ + ((regno)==OPS_REGNUM) || \ + ((regno)>=CFG_REGNUM && (regno)<=TMR_REGNUM) || \ + ((regno)==MMU_REGNUM) || \ + ((regno)==LRU_REGNUM) || \ + ((regno)>=ALU_REGNUM) || \ + ((regno)==CR_REGNUM) || \ + ((regno)==EXO_REGNUM)) +#define CANNOT_FETCH_REGISTER(regno) CANNOT_STORE_REGISTER(regno) +#endif /* KERNEL_DEBUGGING */ + +/* + * Converts an sdb register number to an internal gdb register number. + * Currently under gcc, gr96->0...gr128->31...lr0->32...lr127->159, or... + * gr64->0...gr95->31, lr0->32...lr127->159. + */ +#define SDB_REG_TO_REGNUM(value) (((value)<32) ? ((value)+RETURN_REGNUM) : \ + ((value)-32+LR0_REGNUM)) + +#ifdef KERNEL_DEBUGGING + /* ublock virtual address as defined in our sys/param.h */ + /* FIXME: Should get this from sys/param.h */ +# define UVADDR ((32*0x100000)-8192) +#endif + +/* + * Are we in sigtramp(), needed in infrun.c. Specific to ultra3, because + * we take off the leading '_'. + */ +#if !defined(KERNEL_DEBUGGING) +#ifdef SYM1 +# define IN_SIGTRAMP(pc, name) (name && STREQ ("sigtramp", name)) +#else + Need to define IN_SIGTRAMP() for sym2. +#endif +#endif /* !KERNEL_DEBUGGING */ + +#include "a29k/tm-a29k.h" + +/**** The following are definitions that override those in tm-a29k.h ****/ + +/* This sequence of words is the instructions + mtsrim cr, 15 + loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers + add msp, msp, 16 * 4 ; point to the remaining arguments + CONST_INSN: + const gr96,inf + consth gr96,inf + calli lr0, gr96 + aseq 0x40,gr1,gr1 ; nop + asneq 0x50,gr1,gr1 ; breakpoint + When KERNEL_DEBUGGIN is defined, msp -> gr93, gr96 -> gr64, + 7d -> 5d, 60 -> 40 + */ + +/* Position of the "const" instruction within CALL_DUMMY in bytes. */ +#undef CALL_DUMMY +#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER +#ifdef KERNEL_DEBUGGING /* gr96 -> gr64 */ +# define CALL_DUMMY {0x0400870f, 0x3600825d, 0x155d5d40, 0x03ff40ff, \ + 0x02ff40ff, 0xc8008040, 0x70400101, 0x72500101} +#else +# define CALL_DUMMY {0x0400870f, 0x3600827d, 0x157d7d40, 0x03ff60ff, \ + 0x02ff60ff, 0xc8008060, 0x70400101, 0x72500101} +#endif /* KERNEL_DEBUGGING */ +#else /* Byte order differs. */ + you lose +#endif /* Byte order differs. */ + +#if !defined(KERNEL_DEBUGGING) +# ifdef SYM1 +# undef DECR_PC_AFTER_BREAK +# define DECR_PC_AFTER_BREAK 0 /* Sym1 kernel does the decrement */ +# else + ->"ULTRA3 running other than sym1 OS"!; +# endif +#endif /* !KERNEL_DEBUGGING */ + diff --git a/contrib/gdb/gdb/config/a29k/tm-vx29k.h b/contrib/gdb/gdb/config/a29k/tm-vx29k.h new file mode 100644 index 0000000000000..d85d9b2f0ce21 --- /dev/null +++ b/contrib/gdb/gdb/config/a29k/tm-vx29k.h @@ -0,0 +1,233 @@ +/* Target machine description for VxWorks on the 29k, for GDB, the GNU debugger. + Copyright 1994 Free Software Foundation, Inc. + Contributed by Cygnus Support. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "a29k/tm-a29k.h" + +#define GDBINIT_FILENAME ".vxgdbinit" + +#define DEFAULT_PROMPT "(vxgdb) " + +/* Number of registers in a ptrace_getregs call. */ + +#define VX_NUM_REGS (NUM_REGS) + +/* Number of registers in a ptrace_getfpregs call. */ + +/* #define VX_SIZE_FPREGS */ + +/* This is almost certainly the wrong place for this: */ +#define LR2_REGNUM 34 + + +/* Vxworks has its own CALL_DUMMY since it manages breakpoints in the kernel */ + +#undef CALL_DUMMY + +/* Replace the breakpoint instruction in the CALL_DUMMY with a nop. + For Vxworks, the breakpoint is set and deleted by calls to + CALL_DUMMY_BREAK_SET and CALL_DUMMY_BREAK_DELETE. */ + +#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER +#define CALL_DUMMY {0x0400870f,\ + 0x36008200|(MSP_HW_REGNUM), \ + 0x15000040|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16), \ + 0x03ff80ff, 0x02ff80ff, 0xc8008080, 0x70400101, 0x70400101} +#else /* Byte order differs. */ +#define CALL_DUMMY {0x0f870004,\ + 0x00820036|(MSP_HW_REGNUM << 24), \ + 0x40000015|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16), \ + 0xff80ff03, 0xff80ff02, 0x808000c8, 0x01014070, 0x01014070} +#endif /* Byte order differs. */ + + +/* For the basic CALL_DUMMY definitions, see "tm-29k.h." We use the + same CALL_DUMMY code, but define FIX_CALL_DUMMY (and related macros) + locally to handle remote debugging of VxWorks targets. The difference + is in the setting and clearing of the breakpoint at the end of the + CALL_DUMMY code fragment; under VxWorks, we can't simply insert a + breakpoint instruction into the code, since that would interfere with + the breakpoint management mechanism on the target. + Note that CALL_DUMMY is a piece of code that is used to call any C function + thru VxGDB */ + +/* The offset of the instruction within the CALL_DUMMY code where we + want the inferior to stop after the function call has completed. + call_function_by_hand () sets a breakpoint here (via CALL_DUMMY_BREAK_SET), + which POP_FRAME later deletes (via CALL_DUMMY_BREAK_DELETE). */ + +#define CALL_DUMMY_STOP_OFFSET (7 * 4) + +/* The offset of the first instruction of the CALL_DUMMY code fragment + relative to the frame pointer for a dummy frame. This is equal to + the size of the CALL_DUMMY plus the arg_slop area size (see the diagram + in "tm-29k.h"). */ +/* PAD : the arg_slop area size doesn't appear to me to be useful since, the + call dummy code no longer modify the msp. See below. This must be checked. */ + +#define CALL_DUMMY_OFFSET_IN_FRAME (CALL_DUMMY_LENGTH + 16 * 4) + +/* Insert the specified number of args and function address + into a CALL_DUMMY sequence stored at DUMMYNAME, replace the third + instruction (add msp, msp, 16*4) with a nop, and leave the final nop. + We can't keep using a CALL_DUMMY that modify the msp since, for VxWorks, + CALL_DUMMY is stored in the Memory Stack. Adding 16 words to the msp + would then make possible for the inferior to overwrite the CALL_DUMMY code, + thus creating a lot of trouble when exiting the inferior to come back in + a CALL_DUMMY code that no longer exists... Furthermore, ESF are also stored + from the msp in the memory stack. If msp is set higher than the dummy code, + an ESF may clobber this code. */ + +#if TARGET_BYTE_ORDER == BIG_ENDIAN +#define NOP_INSTR 0x70400101 +#else /* Target is little endian */ +#define NOP_INSTR 0x01014070 +#endif + +#undef FIX_CALL_DUMMY +#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ + { \ + *(int *)((char *)dummyname + 8) = NOP_INSTR; \ + STUFF_I16((char *)dummyname + CONST_INSN, fun); \ + STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16); \ + } + +/* For VxWorks, CALL_DUMMY must be stored in the stack of the task that is + being debugged and executed "in the context of" this task */ + +#undef CALL_DUMMY_LOCATION +#define CALL_DUMMY_LOCATION ON_STACK + +/* Set or delete a breakpoint at the location within a CALL_DUMMY code + fragment where we want the target program to stop after the function + call is complete. CALL_DUMMY_ADDR is the address of the first + instruction in the CALL_DUMMY. DUMMY_FRAME_ADDR is the value of the + frame pointer in the dummy frame. + + NOTE: in the both of the following definitions, we take advantage of + knowledge of the implementation of the target breakpoint operation, + in that we pass a null pointer as the second argument. It seems + reasonable to assume that any target requiring the use of + CALL_DUMMY_BREAK_{SET,DELETE} will not store the breakpoint + shadow contents in GDB; in any case, this assumption is vaild + for all VxWorks-related targets. */ + +#define CALL_DUMMY_BREAK_SET(call_dummy_addr) \ + target_insert_breakpoint ((call_dummy_addr) + CALL_DUMMY_STOP_OFFSET, \ + (char *) 0) + +#define CALL_DUMMY_BREAK_DELETE(dummy_frame_addr) \ + target_remove_breakpoint ((dummy_frame_addr) - (CALL_DUMMY_OFFSET_IN_FRAME \ + - CALL_DUMMY_STOP_OFFSET), \ + (char *) 0) + +/* Return nonzero if the pc is executing within a CALL_DUMMY frame. */ + +#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \ + ((pc) >= (sp) \ + && (pc) <= (sp) + CALL_DUMMY_OFFSET_IN_FRAME + CALL_DUMMY_LENGTH) + +/* Defining this prevents us from trying to pass a structure-valued argument + to a function called via the CALL_DUMMY mechanism. This is not handled + properly in call_function_by_hand (), and the fix might require re-writing + the CALL_DUMMY handling for all targets (at least, a clean solution + would probably require this). Arguably, this should go in "tm-29k.h" + rather than here. */ + +#define STRUCT_VAL_ARGS_UNSUPPORTED + +#define BKPT_OFFSET (7 * 4) +#define BKPT_INSTR 0x72500101 + +#undef FIX_CALL_DUMMY +#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ + {\ + STUFF_I16((char *)dummyname + CONST_INSN, fun);\ + STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16);\ + *(int *)((char *)dummyname + BKPT_OFFSET) = BKPT_INSTR;\ + } + + +/* Offsets into jmp_buf. They are derived from VxWorks' REG_SET struct + (see VxWorks' setjmp.h). Note that Sun2, Sun3 and SunOS4 and VxWorks have + different REG_SET structs, hence different layouts for the jmp_buf struct. + Only JB_PC is needed for getting the saved PC value. */ + +#define JB_ELEMENT_SIZE 4 /* size of each element in jmp_buf */ +#define JB_PC 3 /* offset of pc (pc1) in jmp_buf */ + +/* Figure out where the longjmp will land. We expect that we have just entered + longjmp and haven't yet setup the stack frame, so the args are still in the + output regs. lr2 (LR2_REGNUM) points at the jmp_buf structure from which we + extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. + This routine returns true on success */ + +#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) +extern int get_longjmp_target PARAMS ((CORE_ADDR *)); + +/* VxWorks adjusts the PC after a breakpoint has been hit. */ + +#undef DECR_PC_AFTER_BREAK +#define DECR_PC_AFTER_BREAK 0 + +/* Do whatever promotions are appropriate on a value being returned + from a function. VAL is the user-supplied value, and FUNC_TYPE + is the return type of the function if known, else 0. + + For the Am29k, as far as I understand, if the function return type is known, + cast the value to that type; otherwise, ensure that integer return values + fill all of gr96. + + This definition really belongs in "tm-29k.h", since it applies + to most Am29K-based systems; but once moved into that file, it might + need to be redefined for all Am29K-based targets that also redefine + STORE_RETURN_VALUE. For now, to be safe, we define it here. */ + +#define PROMOTE_RETURN_VALUE(val, func_type) \ + do { \ + if (func_type) \ + val = value_cast (func_type, val); \ + if ((TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT \ + || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_ENUM) \ + && TYPE_LENGTH (VALUE_TYPE (val)) < REGISTER_RAW_SIZE (0)) \ + val = value_cast (builtin_type_int, val); \ + } while (0) + +#define SPECIAL_FRAME_CHAIN_FP get_fp_contents +#undef FRAME_CHAIN_VALID +#define FRAME_CHAIN_VALID(chain, thisframe) \ + (SPECIAL_FRAME_CHAIN_FP (chain, thisframe)) + +extern int SPECIAL_FRAME_CHAIN_FP (); + +extern CORE_ADDR frame_saved_call_site (); + +#undef PREPARE_TO_INIT_FRAME_INFO +#define PREPARE_TO_INIT_FRAME_INFO(fci) do { \ + long current_msp = read_register (MSP_REGNUM); \ + if (PC_IN_CALL_DUMMY (fci->pc, current_msp, 0)) \ + { \ + fci->rsize = DUMMY_FRAME_RSIZE; \ + fci->msize = 0; \ + fci->saved_msp = \ + read_register_stack_integer (fci->frame + DUMMY_FRAME_RSIZE - 4, 4); \ + fci->flags |= (TRANSPARENT|MFP_USED); \ + return; \ + } \ + } while (0) diff --git a/contrib/gdb/gdb/config/a29k/ultra3.mh b/contrib/gdb/gdb/config/a29k/ultra3.mh new file mode 100644 index 0000000000000..2f211c5226b80 --- /dev/null +++ b/contrib/gdb/gdb/config/a29k/ultra3.mh @@ -0,0 +1,13 @@ +# Host: NYU Ultracomputer (AMD 29000 running Unix) + +CC=u3cc + +XM_FILE= xm-ultra3.h +XDEPFILES= ultra3-xdep.o + +MH_CFLAGS = -DSYM1 +XM_CLIBS = -lsysv -ljobs -ltermlib + +NAT_FILE= nm-ultra3.h +NATDEPFILES= infptrace.o inftarg.o fork-child.o ultra3-nat.o + diff --git a/contrib/gdb/gdb/config/a29k/ultra3.mt b/contrib/gdb/gdb/config/a29k/ultra3.mt new file mode 100644 index 0000000000000..1f5fd2f12e4a1 --- /dev/null +++ b/contrib/gdb/gdb/config/a29k/ultra3.mt @@ -0,0 +1,6 @@ +# Target: AMD 29000 running Unix on New York University processor board +TDEPFILES= a29k-tdep.o +TM_FILE= tm-ultra3.h + +# SYM1 is some OS they have. +MT_CFLAGS = -DSYM1 diff --git a/contrib/gdb/gdb/config/a29k/vx29k.mt b/contrib/gdb/gdb/config/a29k/vx29k.mt new file mode 100644 index 0000000000000..4d6f5cc1e4bbb --- /dev/null +++ b/contrib/gdb/gdb/config/a29k/vx29k.mt @@ -0,0 +1,4 @@ +# Target: AMD 29k running VxWorks +TDEPFILES= a29k-tdep.o remote-vx.o remote-vx29k.o xdr_ld.o xdr_ptrace.o xdr_rdb.o +TM_FILE= tm-vx29k.h +MT_CFLAGS = -DNO_HIF_SUPPORT diff --git a/contrib/gdb/gdb/config/a29k/xm-ultra3.h b/contrib/gdb/gdb/config/a29k/xm-ultra3.h new file mode 100644 index 0000000000000..ec0b1081cf2d3 --- /dev/null +++ b/contrib/gdb/gdb/config/a29k/xm-ultra3.h @@ -0,0 +1,52 @@ +/* Host definitions for GDB running on an a29k NYU Ultracomputer + Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc. + Contributed by David Wood (wood@lab.ultra.nyu.edu). + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Here at NYU we have what we call an ULTRA3 PE board. So + ifdefs for ULTRA3 are my doing. At this point in time, + I don't know of any other Unixi running on the a29k. */ + +#define HOST_BYTE_ORDER BIG_ENDIAN + +#define HAVE_WAIT_STRUCT + +#ifndef L_SET +# define L_SET 0 /* set the seek pointer */ +# define L_INCR 1 /* increment the seek pointer */ +# define L_XTND 2 /* extend the file size */ +#endif + +#ifndef O_RDONLY +# define O_RDONLY 0 +# define O_WRONLY 1 +# define O_RDWR 2 +#endif + +#ifndef F_OK +# define R_OK 4 +# define W_OK 2 +# define X_OK 1 +# define F_OK 0 +#endif + +/* System doesn't provide siginterrupt(). */ +#define NO_SIGINTERRUPT + +/* System uses a `short' to hold a process group ID. */ +#define SHORT_PGRP diff --git a/contrib/gdb/gdb/config/mips/bigmips.mt b/contrib/gdb/gdb/config/mips/bigmips.mt new file mode 100644 index 0000000000000..38f03f2f8e410 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/bigmips.mt @@ -0,0 +1,3 @@ +# Target: Big-endian MIPS machine such as Sony News +TDEPFILES= mips-tdep.o +TM_FILE= tm-bigmips.h diff --git a/contrib/gdb/gdb/config/mips/bigmips64.mt b/contrib/gdb/gdb/config/mips/bigmips64.mt new file mode 100644 index 0000000000000..fcb7b21dae576 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/bigmips64.mt @@ -0,0 +1,3 @@ +# Target: Big-endian MIPS machine such as Sony News +TDEPFILES= mips-tdep.o +TM_FILE= tm-bigmips64.h diff --git a/contrib/gdb/gdb/config/mips/decstation.mh b/contrib/gdb/gdb/config/mips/decstation.mh new file mode 100644 index 0000000000000..dc55b5b87db86 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/decstation.mh @@ -0,0 +1,11 @@ +# Host: Little-endian MIPS machine such as DECstation. +XDEPFILES= +XM_FILE= xm-mips.h +NAT_FILE= nm-mips.h +NATDEPFILES= infptrace.o inftarg.o corelow.o mips-nat.o fork-child.o + +# We can't use MMALLOC because the DECstation RPC library can't cope +# with a malloc(0) that returns 0. Besides, it's useless on a machine +# without a real mmap(). +MMALLOC = +MMALLOC_DISABLE = -DNO_MMALLOC diff --git a/contrib/gdb/gdb/config/mips/decstation.mt b/contrib/gdb/gdb/config/mips/decstation.mt new file mode 100644 index 0000000000000..19847224d2f29 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/decstation.mt @@ -0,0 +1,3 @@ +# Target: Little-endian MIPS machine such as DECstation. +TDEPFILES= mips-tdep.o +TM_FILE= tm-mips.h diff --git a/contrib/gdb/gdb/config/mips/embed.mt b/contrib/gdb/gdb/config/mips/embed.mt new file mode 100644 index 0000000000000..7f57a4864c91f --- /dev/null +++ b/contrib/gdb/gdb/config/mips/embed.mt @@ -0,0 +1,3 @@ +# Target: Big-endian mips board, typically an IDT. +TDEPFILES= mips-tdep.o remote-mips.o remote-array.o +TM_FILE= tm-embed.h diff --git a/contrib/gdb/gdb/config/mips/embed64.mt b/contrib/gdb/gdb/config/mips/embed64.mt new file mode 100644 index 0000000000000..273d33bdaae08 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/embed64.mt @@ -0,0 +1,3 @@ +# Target: Big-endian mips board, typically an IDT. +TDEPFILES= mips-tdep.o remote-mips.o remote-array.o +TM_FILE= tm-embed64.h diff --git a/contrib/gdb/gdb/config/mips/embedl.mt b/contrib/gdb/gdb/config/mips/embedl.mt new file mode 100644 index 0000000000000..867b1fe5def96 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/embedl.mt @@ -0,0 +1,3 @@ +# Target: Big-endian mips board, typically an IDT. +TDEPFILES= mips-tdep.o remote-mips.o remote-array.o +TM_FILE= tm-embedl.h diff --git a/contrib/gdb/gdb/config/mips/embedl64.mt b/contrib/gdb/gdb/config/mips/embedl64.mt new file mode 100644 index 0000000000000..89e3f9378a239 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/embedl64.mt @@ -0,0 +1,3 @@ +# Target: Big-endian mips board, typically an IDT. +TDEPFILES= mips-tdep.o remote-mips.o remote-array.o +TM_FILE= tm-embedl64.h diff --git a/contrib/gdb/gdb/config/mips/irix3.mh b/contrib/gdb/gdb/config/mips/irix3.mh new file mode 100644 index 0000000000000..311d697cb58cd --- /dev/null +++ b/contrib/gdb/gdb/config/mips/irix3.mh @@ -0,0 +1,6 @@ +# Host: SGI Iris running irix 3.x +XDEPFILES= +XM_FILE= xm-irix3.h +NAT_FILE= nm-irix3.h +NATDEPFILES= fork-child.o corelow.o infptrace.o inftarg.o mips-nat.o +XM_CLIBS=-lbsd diff --git a/contrib/gdb/gdb/config/mips/irix3.mt b/contrib/gdb/gdb/config/mips/irix3.mt new file mode 100644 index 0000000000000..b3fa4dda384a0 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/irix3.mt @@ -0,0 +1,3 @@ +# Target: MIPS SGI running Irix 3 +TDEPFILES= mips-tdep.o +TM_FILE= tm-irix3.h diff --git a/contrib/gdb/gdb/config/mips/irix4.mh b/contrib/gdb/gdb/config/mips/irix4.mh new file mode 100644 index 0000000000000..68511e6b9a43b --- /dev/null +++ b/contrib/gdb/gdb/config/mips/irix4.mh @@ -0,0 +1,8 @@ +# Host: SGI Iris running irix 4.x +XDEPFILES= ser-tcp.o +XM_FILE= xm-irix4.h +NAT_FILE= nm-irix4.h +NATDEPFILES= fork-child.o procfs.o irix4-nat.o corelow.o +XM_CLIBS=-lbsd -lsun +# use cc in K&R mode, bump up some static compiler tables. +CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh1100 diff --git a/contrib/gdb/gdb/config/mips/irix5.mh b/contrib/gdb/gdb/config/mips/irix5.mh new file mode 100644 index 0000000000000..0e276864800ac --- /dev/null +++ b/contrib/gdb/gdb/config/mips/irix5.mh @@ -0,0 +1,6 @@ +# Host: SGI Iris running irix 5.x +XDEPFILES= ser-tcp.o +XM_FILE= xm-irix5.h +NAT_FILE= nm-irix5.h +NATDEPFILES= fork-child.o procfs.o irix5-nat.o corelow.o +XM_CLIBS=-lbsd -lsun diff --git a/contrib/gdb/gdb/config/mips/irix5.mt b/contrib/gdb/gdb/config/mips/irix5.mt new file mode 100644 index 0000000000000..5b17bcdf1dd1a --- /dev/null +++ b/contrib/gdb/gdb/config/mips/irix5.mt @@ -0,0 +1,3 @@ +# Target: MIPS SGI running Irix 5 +TDEPFILES= mips-tdep.o +TM_FILE= tm-irix5.h diff --git a/contrib/gdb/gdb/config/mips/littlemips.mh b/contrib/gdb/gdb/config/mips/littlemips.mh new file mode 100644 index 0000000000000..103919d230e74 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/littlemips.mh @@ -0,0 +1,3 @@ +# Host: Little-endian MIPS machine such as DECstation. +XDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o +XM_FILE= xm-mips.h diff --git a/contrib/gdb/gdb/config/mips/littlemips.mt b/contrib/gdb/gdb/config/mips/littlemips.mt new file mode 100644 index 0000000000000..19847224d2f29 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/littlemips.mt @@ -0,0 +1,3 @@ +# Target: Little-endian MIPS machine such as DECstation. +TDEPFILES= mips-tdep.o +TM_FILE= tm-mips.h diff --git a/contrib/gdb/gdb/config/mips/mipsel64.mt b/contrib/gdb/gdb/config/mips/mipsel64.mt new file mode 100644 index 0000000000000..0187c24aaad35 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/mipsel64.mt @@ -0,0 +1,3 @@ +# Target: Little-endian MIPS machine such as DECstation. +TDEPFILES= mips-tdep.o +TM_FILE= tm-mips64.h diff --git a/contrib/gdb/gdb/config/mips/mipsm3.mh b/contrib/gdb/gdb/config/mips/mipsm3.mh new file mode 100644 index 0000000000000..77279bd8237ac --- /dev/null +++ b/contrib/gdb/gdb/config/mips/mipsm3.mh @@ -0,0 +1,11 @@ +# Host: Little endian MIPS machine such as pmax +# running Mach 3.0 operating system + +XDEPFILES= core-aout.o +NATDEPFILES= mipsm3-nat.o m3-nat.o +XM_FILE= xm-mipsm3.h +NAT_FILE= ../nm-m3.h + +# Don't use the mmalloc library in Mach 3. +MMALLOC = +MMALLOC_DISABLE = -DNO_MMALLOC diff --git a/contrib/gdb/gdb/config/mips/mipsm3.mt b/contrib/gdb/gdb/config/mips/mipsm3.mt new file mode 100644 index 0000000000000..d122be1004e27 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/mipsm3.mt @@ -0,0 +1,4 @@ +# Target: Little-endian MIPS machine such as pmax +# running Mach 3.0 operating system +TDEPFILES= mips-tdep.o mipsread.o +TM_FILE= tm-mipsm3.h diff --git a/contrib/gdb/gdb/config/mips/mipsv4.mh b/contrib/gdb/gdb/config/mips/mipsv4.mh new file mode 100644 index 0000000000000..87cb7e4239326 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/mipsv4.mh @@ -0,0 +1,4 @@ +# Host: Mips running SVR4 +XM_FILE= xm-mipsv4.h +NAT_FILE= ../nm-sysv4.h +NATDEPFILES= fork-child.o procfs.o mipsv4-nat.o corelow.o core-regset.o solib.o diff --git a/contrib/gdb/gdb/config/mips/mipsv4.mt b/contrib/gdb/gdb/config/mips/mipsv4.mt new file mode 100644 index 0000000000000..6d3b47d024a69 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/mipsv4.mt @@ -0,0 +1,3 @@ +# Target: MIPS running SVR4 +TDEPFILES= mips-tdep.o +TM_FILE= tm-mipsv4.h diff --git a/contrib/gdb/gdb/config/mips/news-mips.mh b/contrib/gdb/gdb/config/mips/news-mips.mh new file mode 100644 index 0000000000000..620fbaad7c0c6 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/news-mips.mh @@ -0,0 +1,4 @@ +# Host: Big-endian MIPS machine such as Sony News +NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o mips-nat.o +XM_FILE= xm-news-mips.h +NAT_FILE= nm-news-mips.h diff --git a/contrib/gdb/gdb/config/mips/nm-irix3.h b/contrib/gdb/gdb/config/mips/nm-irix3.h new file mode 100644 index 0000000000000..4df2da3129b58 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/nm-irix3.h @@ -0,0 +1,36 @@ +/* Definitions for SGI irix3 native support. + Copyright 1991, 1992 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Don't need special routines for Irix v3 -- we can use infptrace.c */ +#undef FETCH_INFERIOR_REGISTERS + +#define U_REGS_OFFSET 0 + +/* Figure out where the longjmp will land. We expect that we have just entered + longjmp and haven't yet setup the stack frame, so the args are still in the + argument regs. a0 (CALL_ARG0) points at the jmp_buf structure from which we + extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. + This routine returns true on success */ + +#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) + +/* Is this really true or is this just a leftover from a DECstation + config file? */ + +#define ONE_PROCESS_WRITETEXT diff --git a/contrib/gdb/gdb/config/mips/nm-irix4.h b/contrib/gdb/gdb/config/mips/nm-irix4.h new file mode 100644 index 0000000000000..78b88dfe76233 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/nm-irix4.h @@ -0,0 +1,56 @@ +/* Definitions for native support of irix4. + +Copyright (C) 1991, 1992 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* + * Let's use /debug instead of all this dangerous mucking about + * with ptrace(), which seems *extremely* fragile, anyway. + */ +#define USE_PROC_FS +#define PROC_NAME_FMT "/debug/%d" + +/* Don't need special routines for the SGI -- we can use infptrace.c */ +#undef FETCH_INFERIOR_REGISTERS + +#define U_REGS_OFFSET 0 + +/* Is this really true or is this just a leftover from a DECstation + config file? */ + +#define ONE_PROCESS_WRITETEXT + +#define TARGET_HAS_HARDWARE_WATCHPOINTS + +/* Temporary new watchpoint stuff */ +#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \ + ((type) == bp_hardware_watchpoint) + +/* When a hardware watchpoint fires off the PC will be left at the + instruction which caused the watchpoint. It will be necessary for + GDB to step over the watchpoint. */ + +#define STOPPED_BY_WATCHPOINT(W) \ + procfs_stopped_by_watchpoint(inferior_pid) + +#define HAVE_NONSTEPPABLE_WATCHPOINT + +/* Use these macros for watchpoint insertion/deletion. */ +/* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */ +#define target_insert_watchpoint(addr, len, type) procfs_set_watchpoint (inferior_pid, addr, len, 2) +#define target_remove_watchpoint(addr, len, type) procfs_set_watchpoint (inferior_pid, addr, 0, 0) diff --git a/contrib/gdb/gdb/config/mips/nm-irix5.h b/contrib/gdb/gdb/config/mips/nm-irix5.h new file mode 100644 index 0000000000000..e35e8666e0903 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/nm-irix5.h @@ -0,0 +1,41 @@ +/* Definitions for native support of irix5. + +Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "nm-sysv4.h" + +#define TARGET_HAS_HARDWARE_WATCHPOINTS + +/* Temporary new watchpoint stuff */ +#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \ + ((type) == bp_hardware_watchpoint) + +/* When a hardware watchpoint fires off the PC will be left at the + instruction which caused the watchpoint. It will be necessary for + GDB to step over the watchpoint. */ + +#define STOPPED_BY_WATCHPOINT(W) \ + procfs_stopped_by_watchpoint(inferior_pid) + +#define HAVE_NONSTEPPABLE_WATCHPOINT + +/* Use these macros for watchpoint insertion/deletion. */ +/* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */ +#define target_insert_watchpoint(addr, len, type) procfs_set_watchpoint (inferior_pid, addr, len, 2) +#define target_remove_watchpoint(addr, len, type) procfs_set_watchpoint (inferior_pid, addr, 0, 0) diff --git a/contrib/gdb/gdb/config/mips/nm-mips.h b/contrib/gdb/gdb/config/mips/nm-mips.h new file mode 100644 index 0000000000000..0f49e34246687 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/nm-mips.h @@ -0,0 +1,31 @@ +/* Native definitions for GDB on DECstations, Sony News. and MIPS Riscos systems + Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc. + Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin + and by Alessandro Forin(af@cs.cmu.edu) at CMU + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ +#define FETCH_INFERIOR_REGISTERS + +/* Figure out where the longjmp will land. We expect that we have just entered + longjmp and haven't yet setup the stack frame, so the args are still in the + argument regs. a0 (CALL_ARG0) points at the jmp_buf structure from which we + extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. + This routine returns true on success */ + +#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) diff --git a/contrib/gdb/gdb/config/mips/nm-news-mips.h b/contrib/gdb/gdb/config/mips/nm-news-mips.h new file mode 100644 index 0000000000000..1ab63ba2b121c --- /dev/null +++ b/contrib/gdb/gdb/config/mips/nm-news-mips.h @@ -0,0 +1,42 @@ +/* Definitions to make GDB run on a mips box under 4.3bsd. + Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc. + Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin + and by Alessandro Forin(af@cs.cmu.edu) at CMU + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef NM_NEWS_MIPS_H +#define NM_NEWS_MIPS_H 1 + +/* Needed for RISC NEWS core files. */ +#include <machine/machparam.h> +#include <sys/types.h> +#define KERNEL_U_ADDR UADDR + +#define REGISTER_U_ADDR(addr, blockend, regno) \ + if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\ + else addr = 0; /* ..somewhere in the pcb */ + +/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ +#define ONE_PROCESS_WRITETEXT + +#include "mips/nm-mips.h" + +/* Apparently not in <sys/types.h> */ +typedef int pid_t; + +#endif /* NM_NEWS_MIPS_H */ diff --git a/contrib/gdb/gdb/config/mips/nm-riscos.h b/contrib/gdb/gdb/config/mips/nm-riscos.h new file mode 100644 index 0000000000000..2d54345582743 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/nm-riscos.h @@ -0,0 +1,59 @@ +/* This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* MIPS running RISC/os 4.52C. */ + +#define PCB_OFFSET(FIELD) ((int)&((struct user*)0)->u_pcb.FIELD) + +/* RISC/os 5.0 defines this in machparam.h. */ +#include <bsd43/machine/machparam.h> +#define NBPG BSD43_NBPG +#define UPAGES BSD43_UPAGES + +/* Where is this used? I don't see any uses in mips-nat.c, and I don't think + the uses in infptrace.c are used if FETCH_INFERIOR_REGISTERS is defined. + Does the compiler react badly to "extern CORE_ADDR kernel_u_addr" (even + if never referenced)? */ +#define KERNEL_U_ADDR BSD43_UADDR + +#define REGISTER_U_ADDR(addr, blockend, regno) \ + if (regno < FP0_REGNUM) \ + addr = UPAGES*NBPG-EF_SIZE+4*((regno)+EF_AT-1); \ + else if (regno < PC_REGNUM) \ + addr = PCB_OFFSET(pcb_fpregs[0]) + 4*(regno-FP0_REGNUM); \ + else if (regno == PS_REGNUM) \ + addr = UPAGES*NBPG-EF_SIZE+4*EF_SR; \ + else if (regno == BADVADDR_REGNUM) \ + addr = UPAGES*NBPG-EF_SIZE+4*EF_BADVADDR; \ + else if (regno == LO_REGNUM) \ + addr = UPAGES*NBPG-EF_SIZE+4*EF_MDLO; \ + else if (regno == HI_REGNUM) \ + addr = UPAGES*NBPG-EF_SIZE+4*EF_MDHI; \ + else if (regno == CAUSE_REGNUM) \ + addr = UPAGES*NBPG-EF_SIZE+4*EF_CAUSE; \ + else if (regno == PC_REGNUM) \ + addr = UPAGES*NBPG-EF_SIZE+4*EF_EPC; \ + else if (regno < FCRCS_REGNUM) \ + addr = PCB_OFFSET(pcb_fpregs[0]) + 4*(regno-FP0_REGNUM); \ + else if (regno == FCRCS_REGNUM) \ + addr = PCB_OFFSET(pcb_fpc_csr); \ + else if (regno == FCRIR_REGNUM) \ + addr = PCB_OFFSET(pcb_fpc_eir); \ + else \ + addr = 0; + +#include "mips/nm-mips.h" + +/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ +#define FETCH_INFERIOR_REGISTERS diff --git a/contrib/gdb/gdb/config/mips/riscos.mh b/contrib/gdb/gdb/config/mips/riscos.mh new file mode 100644 index 0000000000000..6a3192f382b60 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/riscos.mh @@ -0,0 +1,16 @@ +# Host: MIPS running RISC/os + +XM_FILE= xm-riscos.h + +NAT_FILE= nm-riscos.h +NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o mips-nat.o + +MH_CFLAGS=-Wf,-XNh10000 + +# ptrace(2) apparently has problems in the BSD environment. No workaround is +# known except to select the sysv environment. Could we use /proc instead? +# These "sysv environments" and "bsd environments" often end up being a pain. +# +# This is not part of CFLAGS because perhaps not all C compilers have this +# option. +CC= cc -systype sysv diff --git a/contrib/gdb/gdb/config/mips/tm-bigmips.h b/contrib/gdb/gdb/config/mips/tm-bigmips.h new file mode 100644 index 0000000000000..0669c268967d3 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-bigmips.h @@ -0,0 +1,21 @@ +/* Copyright (C) 1990 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define TARGET_BYTE_ORDER BIG_ENDIAN + +#include "mips/tm-mips.h" diff --git a/contrib/gdb/gdb/config/mips/tm-bigmips64.h b/contrib/gdb/gdb/config/mips/tm-bigmips64.h new file mode 100644 index 0000000000000..3d49d4ddf91c8 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-bigmips64.h @@ -0,0 +1,23 @@ +/* Target machine parameters for MIPS r4000 + Copyright 1994 Free Software Foundation, Inc. + Contributed by Ian Lance Taylor (ian@cygnus.com) + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define TARGET_BYTE_ORDER BIG_ENDIAN + +#include "mips/tm-mips64.h" diff --git a/contrib/gdb/gdb/config/mips/tm-embed.h b/contrib/gdb/gdb/config/mips/tm-embed.h new file mode 100644 index 0000000000000..b5de9e1d2d614 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-embed.h @@ -0,0 +1,25 @@ +/* Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define TARGET_BYTE_ORDER_SELECTABLE + +#include "mips/tm-bigmips.h" + +#undef DEFAULT_MIPS_TYPE +#define DEFAULT_MIPS_TYPE "r3051" + diff --git a/contrib/gdb/gdb/config/mips/tm-embed64.h b/contrib/gdb/gdb/config/mips/tm-embed64.h new file mode 100644 index 0000000000000..63296bb6c3df0 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-embed64.h @@ -0,0 +1,21 @@ +/* Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define TARGET_BYTE_ORDER_SELECTABLE + +#include "mips/tm-bigmips64.h" diff --git a/contrib/gdb/gdb/config/mips/tm-embedl.h b/contrib/gdb/gdb/config/mips/tm-embedl.h new file mode 100644 index 0000000000000..361c9f9282216 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-embedl.h @@ -0,0 +1,21 @@ +/* Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define TARGET_BYTE_ORDER_SELECTABLE + +#include "mips/tm-mips.h" diff --git a/contrib/gdb/gdb/config/mips/tm-embedl64.h b/contrib/gdb/gdb/config/mips/tm-embedl64.h new file mode 100644 index 0000000000000..112ddd4fa3e9b --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-embedl64.h @@ -0,0 +1,21 @@ +/* Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define TARGET_BYTE_ORDER_SELECTABLE + +#include "mips/tm-mips64.h" diff --git a/contrib/gdb/gdb/config/mips/tm-irix3.h b/contrib/gdb/gdb/config/mips/tm-irix3.h new file mode 100644 index 0000000000000..7e8e53eb326c3 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-irix3.h @@ -0,0 +1,81 @@ +/* Target machine description for SGI Iris under Irix, for GDB. + Copyright 1990, 1991, 1992, 1993, 1995 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "mips/tm-bigmips.h" + +/* SGI's assembler doesn't grok dollar signs in identifiers. + So we use dots instead. This item must be coordinated with G++. */ +#undef CPLUS_MARKER +#define CPLUS_MARKER '.' + +/* Redefine register numbers for SGI. */ + +#undef NUM_REGS +#undef REGISTER_NAMES +#undef FP0_REGNUM +#undef PC_REGNUM +#undef PS_REGNUM +#undef HI_REGNUM +#undef LO_REGNUM +#undef CAUSE_REGNUM +#undef BADVADDR_REGNUM +#undef FCRCS_REGNUM +#undef FCRIR_REGNUM + +/* Number of machine registers */ + +#define NUM_REGS 71 + +/* Initializer for an array of names of registers. + There should be NUM_REGS strings in this initializer. */ + +#define REGISTER_NAMES \ + { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \ + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \ + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ + "t8", "t9", "k0", "k1", "gp", "sp", "fp", "ra", \ + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\ + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\ + "pc", "cause", "bad", "hi", "lo", "fsr", "fir" \ + } + +/* Register numbers of various important registers. + Note that some of these values are "real" register numbers, + and correspond to the general registers of the machine, + and some are "phony" register numbers which are too large + to be actual register numbers as far as the user is concerned + but do serve to get the desired values when passed to read_register. */ + +#define FP0_REGNUM 32 /* Floating point register 0 (single float) */ +#define PC_REGNUM 64 /* Contains program counter */ +#define CAUSE_REGNUM 65 /* describes last exception */ +#define BADVADDR_REGNUM 66 /* bad vaddr for addressing exception */ +#define HI_REGNUM 67 /* Multiple/divide temp */ +#define LO_REGNUM 68 /* ... */ +#define FCRCS_REGNUM 69 /* FP control/status */ +#define FCRIR_REGNUM 70 /* FP implementation/revision */ + +/* Offsets for register values in _sigtramp frame. + sigcontext is immediately above the _sigtramp frame on Irix. */ +#define SIGFRAME_BASE 0x0 +#define SIGFRAME_PC_OFF (SIGFRAME_BASE + 2 * 4) +#define SIGFRAME_REGSAVE_OFF (SIGFRAME_BASE + 3 * 4) +#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 3 * 4 + 32 * 4 + 4) diff --git a/contrib/gdb/gdb/config/mips/tm-irix5.h b/contrib/gdb/gdb/config/mips/tm-irix5.h new file mode 100644 index 0000000000000..638a658655a43 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-irix5.h @@ -0,0 +1,47 @@ +/* Target machine description for SGI Iris under Irix 5, for GDB. + Copyright 1990, 1991, 1992, 1993, 1995 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "mips/tm-irix3.h" + +#define FORCE_LONG_LONG + +/* When calling functions on Irix 5 (or any MIPS SVR4 ABI compliant + platform) $25 must hold the function address. Dest_Reg is a macro + used in CALL_DUMMY in tm-mips.h. */ +#undef Dest_Reg +#define Dest_Reg 25 + +/* The signal handler trampoline is called _sigtramp. */ +#undef IN_SIGTRAMP +#define IN_SIGTRAMP(pc, name) ((name) && STREQ ("_sigtramp", name)) + +/* Irix 5 saves a full 64 bits for each register. We skip 2 * 4 to + get to the saved PC (the register mask and status register are both + 32 bits) and then another 4 to get to the lower 32 bits. We skip + the same 4 bytes, plus the 8 bytes for the PC to get to the + registers, and add another 4 to get to the lower 32 bits. We skip + 8 bytes per register. */ +#undef SIGFRAME_PC_OFF +#define SIGFRAME_PC_OFF (SIGFRAME_BASE + 2 * 4 + 4) +#undef SIGFRAME_REGSAVE_OFF +#define SIGFRAME_REGSAVE_OFF (SIGFRAME_BASE + 2 * 4 + 8 + 4) +#undef SIGFRAME_FPREGSAVE_OFF +#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 2 * 4 + 8 + 32 * 8 + 4) +#define SIGFRAME_REG_SIZE 8 + diff --git a/contrib/gdb/gdb/config/mips/tm-mips.h b/contrib/gdb/gdb/config/mips/tm-mips.h new file mode 100644 index 0000000000000..499750f714902 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-mips.h @@ -0,0 +1,512 @@ +/* Definitions to make GDB run on a mips box under 4.3bsd. + Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995 + Free Software Foundation, Inc. + Contributed by Per Bothner (bothner@cs.wisc.edu) at U.Wisconsin + and by Alessandro Forin (af@cs.cmu.edu) at CMU.. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include <bfd.h> +#include "coff/sym.h" /* Needed for PDR below. */ +#include "coff/symconst.h" + +#if !defined (TARGET_BYTE_ORDER) +#define TARGET_BYTE_ORDER LITTLE_ENDIAN +#endif + +#if !defined (GDB_TARGET_IS_MIPS64) +#define GDB_TARGET_IS_MIPS64 0 +#endif + +#if !defined (TARGET_MONITOR_PROMPT) +#define TARGET_MONITOR_PROMPT "<IDT>" +#endif + +/* Floating point is IEEE compliant */ +#define IEEE_FLOAT + +/* Some MIPS boards are provided both with and without a floating + point coprocessor. The MIPS R4650 chip has only single precision + floating point. We provide a user settable variable to tell gdb + what type of floating point to use. */ + +enum mips_fpu_type +{ + MIPS_FPU_DOUBLE, /* Full double precision floating point. */ + MIPS_FPU_SINGLE, /* Single precision floating point (R4650). */ + MIPS_FPU_NONE /* No floating point. */ +}; + +extern enum mips_fpu_type mips_fpu; + +/* The name of the usual type of MIPS processor that is in the target + system. */ + +#define DEFAULT_MIPS_TYPE "generic" + +/* Offset from address of function to start of its code. + Zero on most machines. */ + +#define FUNCTION_START_OFFSET 0 + +/* Advance PC across any function entry prologue instructions + to reach some "real" code. */ + +#define SKIP_PROLOGUE(pc) pc = mips_skip_prologue (pc, 0) +extern CORE_ADDR mips_skip_prologue PARAMS ((CORE_ADDR addr, int lenient)); + +/* Return non-zero if PC points to an instruction which will cause a step + to execute both the instruction at PC and an instruction at PC+4. */ +#define STEP_SKIPS_DELAY(pc) (mips_step_skips_delay (pc)) + +/* Immediately after a function call, return the saved pc. + Can't always go through the frames for this because on some machines + the new frame is not set up until the new function executes + some instructions. */ + +#define SAVED_PC_AFTER_CALL(frame) read_register(RA_REGNUM) + +/* Are we currently handling a signal */ + +extern int in_sigtramp PARAMS ((CORE_ADDR, char *)); +#define IN_SIGTRAMP(pc, name) in_sigtramp(pc, name) + +/* Stack grows downward. */ + +#define INNER_THAN < + +#define BIG_ENDIAN 4321 +#if TARGET_BYTE_ORDER == BIG_ENDIAN +#define BREAKPOINT {0, 0x5, 0, 0xd} +#else +#define BREAKPOINT {0xd, 0, 0x5, 0} +#endif + +/* Amount PC must be decremented by after a breakpoint. + This is often the number of bytes in BREAKPOINT + but not always. */ + +#define DECR_PC_AFTER_BREAK 0 + +/* Nonzero if instruction at PC is a return instruction. "j ra" on mips. */ + +#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 4) == 0x3e00008) + +/* Say how long (ordinary) registers are. This is a piece of bogosity + used in push_word and a few other places; REGISTER_RAW_SIZE is the + real way to know how big a register is. */ + +#define REGISTER_SIZE 4 + +/* The size of a register. This is predefined in tm-mips64.h. We + can't use REGISTER_SIZE because that is used for various other + things. */ + +#ifndef MIPS_REGSIZE +#define MIPS_REGSIZE 4 +#endif + +/* Number of machine registers */ + +#define NUM_REGS 90 + +/* Initializer for an array of names of registers. + There should be NUM_REGS strings in this initializer. */ + +#define REGISTER_NAMES \ + { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \ + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \ + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ + "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", \ + "sr", "lo", "hi", "bad", "cause","pc", \ + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\ + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\ + "fsr", "fir", "fp", "", \ + "", "", "", "", "", "", "", "", \ + "", "", "", "", "", "", "", "", \ + } + +/* Register numbers of various important registers. + Note that some of these values are "real" register numbers, + and correspond to the general registers of the machine, + and some are "phony" register numbers which are too large + to be actual register numbers as far as the user is concerned + but do serve to get the desired values when passed to read_register. */ + +#define ZERO_REGNUM 0 /* read-only register, always 0 */ +#define V0_REGNUM 2 /* Function integer return value */ +#define A0_REGNUM 4 /* Loc of first arg during a subr call */ +#define SP_REGNUM 29 /* Contains address of top of stack */ +#define RA_REGNUM 31 /* Contains return address value */ +#define PS_REGNUM 32 /* Contains processor status */ +#define HI_REGNUM 34 /* Multiple/divide temp */ +#define LO_REGNUM 33 /* ... */ +#define BADVADDR_REGNUM 35 /* bad vaddr for addressing exception */ +#define CAUSE_REGNUM 36 /* describes last exception */ +#define PC_REGNUM 37 /* Contains program counter */ +#define FP0_REGNUM 38 /* Floating point register 0 (single float) */ +#define FCRCS_REGNUM 70 /* FP control/status */ +#define FCRIR_REGNUM 71 /* FP implementation/revision */ +#define FP_REGNUM 72 /* Pseudo register that contains true address of executing stack frame */ +#define UNUSED_REGNUM 73 /* Never used, FIXME */ +#define FIRST_EMBED_REGNUM 74 /* First CP0 register for embedded use */ +#define PRID_REGNUM 89 /* Processor ID */ +#define LAST_EMBED_REGNUM 89 /* Last one */ + +/* Define DO_REGISTERS_INFO() to do machine-specific formatting + of register dumps. */ + +#define DO_REGISTERS_INFO(_regnum, fp) mips_do_registers_info(_regnum, fp) + +/* Total amount of space needed to store our copies of the machine's + register state, the array `registers'. */ + +#define REGISTER_BYTES (NUM_REGS*MIPS_REGSIZE) + +/* Index within `registers' of the first byte of the space for + register N. */ + +#define REGISTER_BYTE(N) ((N) * MIPS_REGSIZE) + +/* Number of bytes of storage in the actual machine representation + for register N. On mips, all regs are the same size. */ + +#define REGISTER_RAW_SIZE(N) MIPS_REGSIZE + +/* Number of bytes of storage in the program's representation + for register N. On mips, all regs are the same size. */ + +#define REGISTER_VIRTUAL_SIZE(N) MIPS_REGSIZE + +/* Largest value REGISTER_RAW_SIZE can have. */ + +#define MAX_REGISTER_RAW_SIZE 8 + +/* Largest value REGISTER_VIRTUAL_SIZE can have. */ + +#define MAX_REGISTER_VIRTUAL_SIZE 8 + +/* Return the GDB type object for the "standard" data type + of data in register N. */ + +#ifndef REGISTER_VIRTUAL_TYPE +#define REGISTER_VIRTUAL_TYPE(N) \ + (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) \ + ? builtin_type_float : builtin_type_int) +#endif + +#if HOST_BYTE_ORDER == BIG_ENDIAN +/* All mips targets store doubles in a register pair with the least + significant register in the lower numbered register. + If the host is big endian, double register values need conversion between + memory and register formats. */ + +#define REGISTER_CONVERT_TO_TYPE(n, type, buffer) \ + do {if ((n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 && \ + TYPE_CODE(type) == TYPE_CODE_FLT && TYPE_LENGTH(type) == 8) { \ + char __temp[4]; \ + memcpy (__temp, ((char *)(buffer))+4, 4); \ + memcpy (((char *)(buffer))+4, (buffer), 4); \ + memcpy (((char *)(buffer)), __temp, 4); }} while (0) + +#define REGISTER_CONVERT_FROM_TYPE(n, type, buffer) \ + do {if ((n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 && \ + TYPE_CODE(type) == TYPE_CODE_FLT && TYPE_LENGTH(type) == 8) { \ + char __temp[4]; \ + memcpy (__temp, ((char *)(buffer))+4, 4); \ + memcpy (((char *)(buffer))+4, (buffer), 4); \ + memcpy (((char *)(buffer)), __temp, 4); }} while (0) +#endif + +/* Store the address of the place in which to copy the structure the + subroutine will return. Handled by mips_push_arguments. */ + +#define STORE_STRUCT_RETURN(addr, sp) /**/ + +/* Extract from an array REGBUF containing the (raw) register state + a function return value of type TYPE, and copy that, in virtual format, + into VALBUF. XXX floats */ + +#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ + mips_extract_return_value(TYPE, REGBUF, VALBUF) + +/* Write into appropriate registers a function return value + of type TYPE, given in virtual format. */ + +#define STORE_RETURN_VALUE(TYPE,VALBUF) \ + mips_store_return_value(TYPE, VALBUF) + +/* Extract from an array REGBUF containing the (raw) register state + the address in which a function should return its structure value, + as a CORE_ADDR (or an expression that can be used as one). */ +/* The address is passed in a0 upon entry to the function, but when + the function exits, the compiler has copied the value to v0. This + convention is specified by the System V ABI, so I think we can rely + on it. */ + +#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ + (extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \ + REGISTER_RAW_SIZE (V0_REGNUM))) + +/* Structures are returned by ref in extra arg0 */ +#define USE_STRUCT_CONVENTION(gcc_p, type) 1 + + +/* Describe the pointer in each stack frame to the previous stack frame + (its caller). */ + +/* FRAME_CHAIN takes a frame's nominal address + and produces the frame's chain-pointer. */ + +#define FRAME_CHAIN(thisframe) (CORE_ADDR) mips_frame_chain (thisframe) + +/* Define other aspects of the stack frame. */ + + +/* A macro that tells us whether the function invocation represented + by FI does not have a frame on the stack associated with it. If it + does not, FRAMELESS is set to 1, else 0. */ +/* We handle this differently for mips, and maybe we should not */ + +#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) {(FRAMELESS) = 0;} + +/* Saved Pc. */ + +#define FRAME_SAVED_PC(FRAME) (mips_frame_saved_pc(FRAME)) + +#define FRAME_ARGS_ADDRESS(fi) (fi)->frame + +#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame + +/* Return number of args passed to a frame. + Can return -1, meaning no way to tell. */ + +#define FRAME_NUM_ARGS(num, fi) (num = mips_frame_num_args(fi)) + +/* Return number of bytes at start of arglist that are not really args. */ + +#define FRAME_ARGS_SKIP 0 + +/* Put here the code to store, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. */ + +#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ + do { \ + if ((frame_info)->saved_regs == NULL) \ + mips_find_saved_regs (frame_info); \ + (frame_saved_regs) = *(frame_info)->saved_regs; \ + (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame; \ + } while (0) + + +/* Things needed for making the inferior call functions. */ + +/* Stack has strict alignment. However, use PUSH_ARGUMENTS + to take care of it. */ +/*#define STACK_ALIGN(addr) (((addr)+3)&~3)*/ + +#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ + sp = mips_push_arguments(nargs, args, sp, struct_return, struct_addr) + +/* Push an empty stack frame, to record the current PC, etc. */ + +#define PUSH_DUMMY_FRAME mips_push_dummy_frame() + +/* Discard from the stack the innermost frame, restoring all registers. */ + +#define POP_FRAME mips_pop_frame() + +#define MK_OP(op,rs,rt,offset) (((op)<<26)|((rs)<<21)|((rt)<<16)|(offset)) +#ifndef OP_LDFPR +#define OP_LDFPR 061 /* lwc1 */ +#endif +#ifndef OP_LDGPR +#define OP_LDGPR 043 /* lw */ +#endif +#define CALL_DUMMY_SIZE (16*4) +#define Dest_Reg 2 +#define CALL_DUMMY {\ + MK_OP(0,RA_REGNUM,0,8), /* jr $ra # Fake ABOUT_TO_RETURN ...*/\ + 0, /* nop # ... to stop raw backtrace*/\ + 0x27bd0000, /* addu sp,?0 # Pseudo prologue */\ +/* Start here; reload FP regs, then GP regs: */\ + MK_OP(OP_LDFPR,SP_REGNUM,12,0 ), /* l[wd]c1 $f12,0(sp) */\ + MK_OP(OP_LDFPR,SP_REGNUM,13, MIPS_REGSIZE), /* l[wd]c1 $f13,{4,8}(sp) */\ + MK_OP(OP_LDFPR,SP_REGNUM,14,2*MIPS_REGSIZE), /* l[wd]c1 $f14,{8,16}(sp) */\ + MK_OP(OP_LDFPR,SP_REGNUM,15,3*MIPS_REGSIZE), /* l[wd]c1 $f15,{12,24}(sp) */\ + MK_OP(OP_LDGPR,SP_REGNUM, 4,0 ), /* l[wd] $r4,0(sp) */\ + MK_OP(OP_LDGPR,SP_REGNUM, 5, MIPS_REGSIZE), /* l[wd] $r5,{4,8}(sp) */\ + MK_OP(OP_LDGPR,SP_REGNUM, 6,2*MIPS_REGSIZE), /* l[wd] $r6,{8,16}(sp) */\ + MK_OP(OP_LDGPR,SP_REGNUM, 7,3*MIPS_REGSIZE), /* l[wd] $r7,{12,24}(sp) */\ + (017<<26)| (Dest_Reg << 16), /* lui $r31,<target upper 16 bits>*/\ + MK_OP(13,Dest_Reg,Dest_Reg,0), /* ori $r31,$r31,<lower 16 bits>*/ \ + (Dest_Reg<<21) | (31<<11) | 9, /* jalr $r31 */\ + MK_OP(OP_LDGPR,SP_REGNUM, 7,3*MIPS_REGSIZE), /* l[wd] $r7,{12,24}(sp) */\ + 0x5000d, /* bpt */\ +} + +#define CALL_DUMMY_START_OFFSET 12 + +#define CALL_DUMMY_BREAKPOINT_OFFSET (CALL_DUMMY_START_OFFSET + (12 * 4)) + +/* Insert the specified number of args and function address + into a call sequence of the above form stored at DUMMYNAME. */ + +/* For big endian mips machines we need to switch the order of the + words with a floating-point value (it was already coerced to a double + by mips_push_arguments). */ +#define FIX_CALL_DUMMY(dummyname, start_sp, fun, nargs, args, rettype, gcc_p) \ + do \ + { \ + store_unsigned_integer \ + (dummyname + 11 * 4, 4, \ + (extract_unsigned_integer (dummyname + 11 * 4, 4) \ + | (((fun) >> 16) & 0xffff))); \ + store_unsigned_integer \ + (dummyname + 12 * 4, 4, \ + (extract_unsigned_integer (dummyname + 12 * 4, 4) \ + | ((fun) & 0xffff))); \ + if (mips_fpu == MIPS_FPU_NONE) \ + { \ + store_unsigned_integer (dummyname + 3 * 4, 4, \ + (unsigned LONGEST) 0); \ + store_unsigned_integer (dummyname + 4 * 4, 4, \ + (unsigned LONGEST) 0); \ + store_unsigned_integer (dummyname + 5 * 4, 4, \ + (unsigned LONGEST) 0); \ + store_unsigned_integer (dummyname + 6 * 4, 4, \ + (unsigned LONGEST) 0); \ + } \ + else if (mips_fpu == MIPS_FPU_SINGLE) \ + { \ + /* This isn't right. mips_push_arguments will call \ + value_arg_coerce, which will convert all float arguments \ + to doubles. If the function prototype is float, though, \ + it will be expecting a float argument in a float \ + register. */ \ + store_unsigned_integer (dummyname + 4 * 4, 4, \ + (unsigned LONGEST) 0); \ + store_unsigned_integer (dummyname + 6 * 4, 4, \ + (unsigned LONGEST) 0); \ + } \ + else if (TARGET_BYTE_ORDER == BIG_ENDIAN \ + && ! GDB_TARGET_IS_MIPS64) \ + { \ + if (nargs > 0 \ + && TYPE_CODE (VALUE_TYPE (args[0])) == TYPE_CODE_FLT) \ + { \ + if (TYPE_LENGTH (VALUE_TYPE (args[0])) > 8) \ + error ("floating point value too large to pass to function");\ + store_unsigned_integer \ + (dummyname + 3 * 4, 4, MK_OP (OP_LDFPR, SP_REGNUM, 12, 4));\ + store_unsigned_integer \ + (dummyname + 4 * 4, 4, MK_OP (OP_LDFPR, SP_REGNUM, 13, 0));\ + } \ + if (nargs > 1 \ + && TYPE_CODE (VALUE_TYPE (args[1])) == TYPE_CODE_FLT) \ + { \ + if (TYPE_LENGTH (VALUE_TYPE (args[1])) > 8) \ + error ("floating point value too large to pass to function");\ + store_unsigned_integer \ + (dummyname + 5 * 4, 4, MK_OP (OP_LDFPR, SP_REGNUM, 14, 12));\ + store_unsigned_integer \ + (dummyname + 6 * 4, 4, MK_OP (OP_LDFPR, SP_REGNUM, 15, 8));\ + } \ + } \ + } \ + while (0) + +/* There's a mess in stack frame creation. See comments in blockframe.c + near reference to INIT_FRAME_PC_FIRST. */ + +#define INIT_FRAME_PC(fromleaf, prev) /* nada */ + +#define INIT_FRAME_PC_FIRST(fromleaf, prev) \ + (prev)->pc = ((fromleaf) ? SAVED_PC_AFTER_CALL ((prev)->next) : \ + (prev)->next ? FRAME_SAVED_PC ((prev)->next) : read_pc ()); + +/* Special symbol found in blocks associated with routines. We can hang + mips_extra_func_info_t's off of this. */ + +#define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__" + +/* Specific information about a procedure. + This overlays the MIPS's PDR records, + mipsread.c (ab)uses this to save memory */ + +typedef struct mips_extra_func_info { + long numargs; /* number of args to procedure (was iopt) */ + PDR pdr; /* Procedure descriptor record */ +} *mips_extra_func_info_t; + +#define EXTRA_FRAME_INFO \ + mips_extra_func_info_t proc_desc; \ + int num_args;\ + struct frame_saved_regs *saved_regs; + +#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci) + +#define PRINT_EXTRA_FRAME_INFO(fi) \ + { \ + if (fi && fi->proc_desc && fi->proc_desc->pdr.framereg < NUM_REGS) \ + printf_filtered (" frame pointer is at %s+%d\n", \ + reg_names[fi->proc_desc->pdr.framereg], \ + fi->proc_desc->pdr.frameoffset); \ + } + +/* It takes two values to specify a frame on the MIPS. + + In fact, the *PC* is the primary value that sets up a frame. The + PC is looked up to see what function it's in; symbol information + from that function tells us which register is the frame pointer + base, and what offset from there is the "virtual frame pointer". + (This is usually an offset from SP.) On most non-MIPS machines, + the primary value is the SP, and the PC, if needed, disambiguates + multiple functions with the same SP. But on the MIPS we can't do + that since the PC is not stored in the same part of the frame every + time. This does not seem to be a very clever way to set up frames, + but there is nothing we can do about that). */ + +#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) +extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *)); + +/* Convert a dbx stab register number (from `r' declaration) to a gdb REGNUM */ + +#define STAB_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-38) + +/* Convert a ecoff register number to a gdb REGNUM */ + +#define ECOFF_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32) + +/* If the current gcc for for this target does not produce correct debugging + information for float parameters, both prototyped and unprototyped, then + define this macro. This forces gdb to always assume that floats are + passed as doubles and then converted in the callee. + + For the mips chip, it appears that the debug info marks the parameters as + floats regardless of whether the function is prototyped, but the actual + values are passed as doubles for the non-prototyped case and floats for + the prototyped case. Thus we choose to make the non-prototyped case work + for C and break the prototyped case, since the non-prototyped case is + probably much more common. (FIXME). */ + +#define COERCE_FLOAT_TO_DOUBLE (current_language -> la_language == language_c) diff --git a/contrib/gdb/gdb/config/mips/tm-mips64.h b/contrib/gdb/gdb/config/mips/tm-mips64.h new file mode 100644 index 0000000000000..4265ab658d528 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-mips64.h @@ -0,0 +1,39 @@ +/* Target machine parameters for MIPS r4000 + Copyright 1994 Free Software Foundation, Inc. + Contributed by Ian Lance Taylor (ian@cygnus.com) + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define GDB_TARGET_IS_MIPS64 1 + +/* force LONGEST to be long long in gdb */ +#define FORCE_LONG_LONG + +/* Use eight byte registers. */ +#define MIPS_REGSIZE 8 + +/* define 8 byte register type */ +#define REGISTER_VIRTUAL_TYPE(N) \ + (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) \ + ? builtin_type_double : builtin_type_long_long) \ + +/* Load double words in CALL_DUMMY. */ +#define OP_LDFPR 065 /* ldc1 */ +#define OP_LDGPR 067 /* ld */ + +/* Get the basic MIPS definitions. */ +#include "tm-mips.h" diff --git a/contrib/gdb/gdb/config/mips/tm-mipsm3.h b/contrib/gdb/gdb/config/mips/tm-mipsm3.h new file mode 100644 index 0000000000000..22057b4fad77a --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-mipsm3.h @@ -0,0 +1,71 @@ +/* Definitions to make GDB run on a mips box under Mach 3.0 + Copyright (C) 1992 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Mach specific definitions for little endian mips (e.g. pmax) + * running Mach 3.0 + * + * Author: Jukka Virtanen <jtv@hut.fi> + */ + +/* Include common definitions for Mach3 systems */ +#include "nm-m3.h" + +/* Define offsets to access CPROC stack when it does not have + * a kernel thread. + */ + +/* From mk/user/threads/mips/csw.s */ +#define SAVED_FP (12*4) +#define SAVED_PC (13*4) +#define SAVED_BYTES (14*4) + +/* Using these, define our offsets to items strored in + * cproc_switch in csw.s + */ +#define MACHINE_CPROC_SP_OFFSET SAVED_BYTES +#define MACHINE_CPROC_PC_OFFSET SAVED_PC +#define MACHINE_CPROC_FP_OFFSET SAVED_FP + +/* Thread flavors used in setting the Trace state. + * + * In <mach/machine/thread_status.h> + */ +#define TRACE_FLAVOR MIPS_EXC_STATE +#define TRACE_FLAVOR_SIZE MIPS_EXC_STATE_COUNT +#define TRACE_SET(x,state) ((struct mips_exc_state *)state)->cause = EXC_SST; +#define TRACE_CLEAR(x,state) 0 + +/* Mach supports attach/detach */ +#define ATTACH_DETACH 1 + +#include "mips/tm-mips.h" + +/* Address of end of user stack space. + * for MACH, see <machine/vmparam.h> + */ +#undef STACK_END_ADDR +#define STACK_END_ADDR USRSTACK + +/* Don't output r?? names for registers, since they + * can't be used as reg names anyway + */ +#define NUMERIC_REG_NAMES + +/* Output registers in tabular format */ +#define TABULAR_REGISTER_OUTPUT diff --git a/contrib/gdb/gdb/config/mips/tm-mipsv4.h b/contrib/gdb/gdb/config/mips/tm-mipsv4.h new file mode 100644 index 0000000000000..1a4a070b2aa71 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-mipsv4.h @@ -0,0 +1,45 @@ +/* Target machine description for MIPS running SVR4, for GDB. + Copyright 1994, 1995 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "mips/tm-bigmips.h" +#include "tm-sysv4.h" + +/* When calling functions on a MIPS SVR4 ABI compliant platform + $25 must hold the function address. Dest_Reg is a macro + used in CALL_DUMMY in tm-mips.h. */ +#undef Dest_Reg +#define Dest_Reg 25 + +/* The signal handler trampoline is called _sigtramp. */ +#undef IN_SIGTRAMP +#define IN_SIGTRAMP(pc, name) ((name) && STREQ ("_sigtramp", name)) + +/* On entry to the signal handler trampoline, an ucontext is already + pushed on the stack. We can get at the saved registers via the + mcontext which is contained within the ucontext. */ +#define SIGFRAME_BASE 0 +#define SIGFRAME_REGSAVE_OFF (SIGFRAME_BASE + 40) +#define SIGFRAME_PC_OFF (SIGFRAME_BASE + 40 + 35 * 4) +#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 40 + 36 * 4) + +/* Use the alternate method of determining valid frame chains. */ +#define FRAME_CHAIN_VALID_ALTERNATE + +/* Convert a DWARF register number to a gdb REGNUM. */ +#define DWARF_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32) diff --git a/contrib/gdb/gdb/config/mips/tm-vr4300.h b/contrib/gdb/gdb/config/mips/tm-vr4300.h new file mode 100644 index 0000000000000..201174ae2c60a --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-vr4300.h @@ -0,0 +1,25 @@ +/* Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define TARGET_BYTE_ORDER_SELECTABLE +#define TARGET_MONITOR_PROMPT "<RISQ> " + +/* Hack to allow 64bit register reads, from 32bit BFD world */ +#define CC_HAS_LONG_LONG 1 + +#include "mips/tm-bigmips64.h" diff --git a/contrib/gdb/gdb/config/mips/tm-vr4300el.h b/contrib/gdb/gdb/config/mips/tm-vr4300el.h new file mode 100644 index 0000000000000..3148f9f492eca --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-vr4300el.h @@ -0,0 +1,25 @@ +/* Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define TARGET_BYTE_ORDER_SELECTABLE +#define TARGET_MONITOR_PROMPT "<RISQ> " + +/* Hack to allow 64bit register reads, from 32bit BFD world */ +#define CC_HAS_LONG_LONG 1 + +#include "mips/tm-mips64.h" diff --git a/contrib/gdb/gdb/config/mips/tm-vxmips.h b/contrib/gdb/gdb/config/mips/tm-vxmips.h new file mode 100644 index 0000000000000..392a929c20005 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/tm-vxmips.h @@ -0,0 +1,31 @@ +/* Target machine description for VxWorks MIPS's, for GDB, the GNU debugger. + Copyright 1996 Free Software Foundation, Inc. + Contributed by Cygnus Support. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define GDBINIT_FILENAME ".vxgdbinit" + +#define DEFAULT_PROMPT "(vxgdb) " + +#include "mips/tm-mips.h" + +/* FIXME: These are almost certainly wrong. */ + +/* Number of registers in a ptrace_getregs call. */ + +#define VX_NUM_REGS (NUM_REGS) diff --git a/contrib/gdb/gdb/config/mips/vr4300.mt b/contrib/gdb/gdb/config/mips/vr4300.mt new file mode 100644 index 0000000000000..22cb25eb4259a --- /dev/null +++ b/contrib/gdb/gdb/config/mips/vr4300.mt @@ -0,0 +1,5 @@ +# Target: Big-endian SIM monitor board. +TDEPFILES= mips-tdep.o remote-mips.o +TM_FILE= tm-vr4300.h +SIM_OBS = remote-sim.o +SIM = ../sim/mips/libsim.a diff --git a/contrib/gdb/gdb/config/mips/vr4300el.mt b/contrib/gdb/gdb/config/mips/vr4300el.mt new file mode 100644 index 0000000000000..9ba2a24d4672b --- /dev/null +++ b/contrib/gdb/gdb/config/mips/vr4300el.mt @@ -0,0 +1,3 @@ +# Target: Little-endian SIM monitor board. +TDEPFILES= mips-tdep.o remote-mips.o +TM_FILE= tm-vr4300el.h diff --git a/contrib/gdb/gdb/config/mips/vxmips.mt b/contrib/gdb/gdb/config/mips/vxmips.mt new file mode 100644 index 0000000000000..a20cf96ab726a --- /dev/null +++ b/contrib/gdb/gdb/config/mips/vxmips.mt @@ -0,0 +1,3 @@ +# Target: MIPS running VxWorks +TDEPFILES= mips-tdep.o remote-vx.o remote-vxmips.o xdr_ld.o xdr_ptrace.o xdr_rdb.o +TM_FILE= tm-vxmips.h diff --git a/contrib/gdb/gdb/config/mips/xm-irix3.h b/contrib/gdb/gdb/config/mips/xm-irix3.h new file mode 100644 index 0000000000000..d096594c6be03 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/xm-irix3.h @@ -0,0 +1,31 @@ +/* Copyright (C) 1991 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* This is for the iris. */ + +#define HAVE_TERMIO + +#define HOST_BYTE_ORDER BIG_ENDIAN + +/* Override register locations in upage for SGI machines */ +#undef REGISTER_U_ADDR +#define REGISTER_U_ADDR(addr, blockend, regno) \ + if (regno < PC_REGNUM) \ + addr = regno; \ + else \ + addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */ diff --git a/contrib/gdb/gdb/config/mips/xm-irix4.h b/contrib/gdb/gdb/config/mips/xm-irix4.h new file mode 100644 index 0000000000000..14d21f04fea6d --- /dev/null +++ b/contrib/gdb/gdb/config/mips/xm-irix4.h @@ -0,0 +1,33 @@ +/* Definitions for irix4 hosting support. + +Copyright (C) 1991, 1992 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* This is for the iris. */ + +#include "mips/xm-irix3.h" + +#define BROKEN_SIGINFO_H /* <sys/siginfo.h> si_pid & si_uid are bogus */ + +/* Irix 4.0.1 and later have termios. Not sure about earlier versions. */ +#undef HAVE_TERMIO +#define HAVE_TERMIOS + +/* This enables reliable signals (and the associated setjmp/longjmp), and gives + bsdish prototypes for getpgrp/setpgrg/setgroups and initgroups. */ +#define _BSD_COMPAT diff --git a/contrib/gdb/gdb/config/mips/xm-irix5.h b/contrib/gdb/gdb/config/mips/xm-irix5.h new file mode 100644 index 0000000000000..c3d339b1f5e37 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/xm-irix5.h @@ -0,0 +1,37 @@ +/* Definitions for irix5 hosting support. + +Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "xm-sysv4.h" + +#define CC_HAS_LONG_LONG 1 +#define PRINTF_HAS_LONG_LONG 1 +#define HOST_BYTE_ORDER BIG_ENDIAN + +/* Override register locations in upage for SGI machines */ +#undef REGISTER_U_ADDR +#define REGISTER_U_ADDR(addr, blockend, regno) \ + if (regno < PC_REGNUM) \ + addr = regno; \ + else \ + addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */ + +/* This enables reliable signals (and the associated setjmp/longjmp), and gives + bsdish prototypes for getpgrp/setpgrg/setgroups and initgroups. */ +#define _BSD_COMPAT diff --git a/contrib/gdb/gdb/config/mips/xm-mips.h b/contrib/gdb/gdb/config/mips/xm-mips.h new file mode 100644 index 0000000000000..b90d03e8d7df9 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/xm-mips.h @@ -0,0 +1,60 @@ +/* Definitions to make GDB run on a mips box under 4.3bsd. + Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc. + Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin + and by Alessandro Forin(af@cs.cmu.edu) at CMU + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if !defined (HOST_BYTE_ORDER) +#define HOST_BYTE_ORDER LITTLE_ENDIAN +#endif + +#ifdef ultrix +/* Needed for DECstation core files. */ +#include <machine/param.h> +#define KERNEL_U_ADDR UADDR +#endif + +#ifdef ultrix +extern char *strdup(); +#endif + +#if ! defined (__STDC__) && ! defined (offsetof) +# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) +#endif + +/* Only used for core files on DECstations. + First four registers at u.u_ar0 are saved arguments, and + there is no r0 saved. Float registers are saved + in u_pcb.pcb_fpregs, not relative to u.u_ar0. */ + +#define REGISTER_U_ADDR(addr, blockend, regno) \ + { \ + if (regno < FP0_REGNUM) \ + addr = blockend + sizeof(int) * (4 + regno - 1); \ + else \ + addr = offsetof (struct user, u_pcb.pcb_fpregs[0]) + \ + sizeof (int) * (regno - FP0_REGNUM); \ + } + +/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ +#define ONE_PROCESS_WRITETEXT + +/* HAVE_SGTTY also works, last we tried. + + But we have termios, at least as of Ultrix 4.2A, so use it. */ +#define HAVE_TERMIOS diff --git a/contrib/gdb/gdb/config/mips/xm-mipsm3.h b/contrib/gdb/gdb/config/mips/xm-mipsm3.h new file mode 100644 index 0000000000000..6a5a73cd83347 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/xm-mipsm3.h @@ -0,0 +1,32 @@ +/* Definitions to make GDB run on a mips box under 4.3bsd. + Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc. + Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin + and by Alessandro Forin(af@cs.cmu.edu) at CMU + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if !defined (HOST_BYTE_ORDER) +#define HOST_BYTE_ORDER LITTLE_ENDIAN +#endif + +#define KERNEL_U_ADDR 0 /* Not needed. */ + +/* Only used for core files on DECstations. */ + +#define REGISTER_U_ADDR(addr, blockend, regno) \ + if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\ + else addr = 0; /* ..somewhere in the pcb */ diff --git a/contrib/gdb/gdb/config/mips/xm-mipsv4.h b/contrib/gdb/gdb/config/mips/xm-mipsv4.h new file mode 100644 index 0000000000000..d80ba433e293e --- /dev/null +++ b/contrib/gdb/gdb/config/mips/xm-mipsv4.h @@ -0,0 +1,23 @@ +/* Definitions for MIPS running SVR4 hosting support. + +Copyright (C) 1994 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "xm-sysv4.h" + +#define HOST_BYTE_ORDER BIG_ENDIAN diff --git a/contrib/gdb/gdb/config/mips/xm-news-mips.h b/contrib/gdb/gdb/config/mips/xm-news-mips.h new file mode 100644 index 0000000000000..06aac1ad3b784 --- /dev/null +++ b/contrib/gdb/gdb/config/mips/xm-news-mips.h @@ -0,0 +1,24 @@ +/* Definitions to make GDB run on a mips box under 4.3bsd. + Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc. + Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin + and by Alessandro Forin(af@cs.cmu.edu) at CMU + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if !defined (HOST_BYTE_ORDER) +#define HOST_BYTE_ORDER BIG_ENDIAN +#endif diff --git a/contrib/gdb/gdb/config/mips/xm-riscos.h b/contrib/gdb/gdb/config/mips/xm-riscos.h new file mode 100644 index 0000000000000..467f32ac11bed --- /dev/null +++ b/contrib/gdb/gdb/config/mips/xm-riscos.h @@ -0,0 +1,28 @@ +/* Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define HAVE_TERMIO + +#if !defined (HOST_BYTE_ORDER) +#define HOST_BYTE_ORDER BIG_ENDIAN +#endif + +#define USG 1 + +/* setjmp.h requires uid_t. */ +#include <sys/types.h> diff --git a/contrib/gdb/gdb/config/none/nm-none.h b/contrib/gdb/gdb/config/none/nm-none.h new file mode 100644 index 0000000000000..9d630f36e4ea2 --- /dev/null +++ b/contrib/gdb/gdb/config/none/nm-none.h @@ -0,0 +1,18 @@ +/* Defines needed when configuring for "none". + Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/contrib/gdb/gdb/config/none/none.mh b/contrib/gdb/gdb/config/none/none.mh new file mode 100644 index 0000000000000..33d5e4a3768ee --- /dev/null +++ b/contrib/gdb/gdb/config/none/none.mh @@ -0,0 +1,5 @@ +# Host: "no target". This can be used to build you +# a Makefile that only runs administrative commands like 'clean', +# 'gdb.tar.Z', etc. +NAT_FILE= nm-none.h +XM_FILE= xm-none.h diff --git a/contrib/gdb/gdb/config/none/none.mt b/contrib/gdb/gdb/config/none/none.mt new file mode 100644 index 0000000000000..300e2dcd05fd2 --- /dev/null +++ b/contrib/gdb/gdb/config/none/none.mt @@ -0,0 +1,4 @@ +# Target: "no target". +# This can be used to build you a Makefile that only runs administrative +# commands like 'clean', 'gdb.tar.Z', etc. +TM_FILE= tm-none.h diff --git a/contrib/gdb/gdb/config/none/tm-none.h b/contrib/gdb/gdb/config/none/tm-none.h new file mode 100644 index 0000000000000..7f7e7d88c9201 --- /dev/null +++ b/contrib/gdb/gdb/config/none/tm-none.h @@ -0,0 +1,23 @@ +/* Defines needed when configuring for "none". + Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* This define is needed so that "gcc -MM" doesn't get errors and fail on + source files that use the value of INNER_THAN in preprocessor lines. */ + +#define INNER_THAN < diff --git a/contrib/gdb/gdb/config/none/xm-none.h b/contrib/gdb/gdb/config/none/xm-none.h new file mode 100644 index 0000000000000..9d630f36e4ea2 --- /dev/null +++ b/contrib/gdb/gdb/config/none/xm-none.h @@ -0,0 +1,18 @@ +/* Defines needed when configuring for "none". + Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/contrib/gdb/gdb/config/sh/sh.mt b/contrib/gdb/gdb/config/sh/sh.mt new file mode 100644 index 0000000000000..71d6083b80ab8 --- /dev/null +++ b/contrib/gdb/gdb/config/sh/sh.mt @@ -0,0 +1,6 @@ +# Target: Hitachi Super-H with ICE and simulator +TDEPFILES= sh-tdep.o monitor.o sh3-rom.o remote-e7000.o ser-e7kpc.o dsrec.o +TM_FILE= tm-sh.h + +SIM_OBS = remote-sim.o +SIM = ../sim/sh/libsim.a -lm diff --git a/contrib/gdb/gdb/config/sh/stub.c b/contrib/gdb/gdb/config/sh/stub.c new file mode 100644 index 0000000000000..86c3f0b5876a8 --- /dev/null +++ b/contrib/gdb/gdb/config/sh/stub.c @@ -0,0 +1,1553 @@ +/* sh-stub.c -- debugging stub for the Hitachi-SH. + + NOTE!! This code has to be compiled with optimization, otherwise the + function inlining which generates the exception handlers won't work. + +*/ + +/* This is originally based on an m68k software stub written by Glenn + Engel at HP, but has changed quite a bit. + + Modifications for the SH by Ben Lee and Steve Chamberlain + +*/ + +/**************************************************************************** + + THIS SOFTWARE IS NOT COPYRIGHTED + + HP offers the following for use in the public domain. HP makes no + warranty with regard to the software or it's performance and the + user accepts the software "AS IS" with all faults. + + HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD + TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +****************************************************************************/ + + +/* Remote communication protocol. + + A debug packet whose contents are <data> + is encapsulated for transmission in the form: + + $ <data> # CSUM1 CSUM2 + + <data> must be ASCII alphanumeric and cannot include characters + '$' or '#'. If <data> starts with two characters followed by + ':', then the existing stubs interpret this as a sequence number. + + CSUM1 and CSUM2 are ascii hex representation of an 8-bit + checksum of <data>, the most significant nibble is sent first. + the hex digits 0-9,a-f are used. + + Receiver responds with: + + + - if CSUM is correct and ready for next packet + - - if CSUM is incorrect + + <data> is as follows: + All values are encoded in ascii hex digits. + + Request Packet + + read registers g + reply XX....X Each byte of register data + is described by two hex digits. + Registers are in the internal order + for GDB, and the bytes in a register + are in the same order the machine uses. + or ENN for an error. + + write regs GXX..XX Each byte of register data + is described by two hex digits. + reply OK for success + ENN for an error + + write reg Pn...=r... Write register n... with value r..., + which contains two hex digits for each + byte in the register (target byte + order). + reply OK for success + ENN for an error + (not supported by all stubs). + + read mem mAA..AA,LLLL AA..AA is address, LLLL is length. + reply XX..XX XX..XX is mem contents + Can be fewer bytes than requested + if able to read only part of the data. + or ENN NN is errno + + write mem MAA..AA,LLLL:XX..XX + AA..AA is address, + LLLL is number of bytes, + XX..XX is data + reply OK for success + ENN for an error (this includes the case + where only part of the data was + written). + + cont cAA..AA AA..AA is address to resume + If AA..AA is omitted, + resume at same address. + + step sAA..AA AA..AA is address to resume + If AA..AA is omitted, + resume at same address. + + last signal ? Reply the current reason for stopping. + This is the same reply as is generated + for step or cont : SAA where AA is the + signal number. + + There is no immediate reply to step or cont. + The reply comes when the machine stops. + It is SAA AA is the "signal number" + + or... TAAn...:r...;n:r...;n...:r...; + AA = signal number + n... = register number + r... = register contents + or... WAA The process exited, and AA is + the exit status. This is only + applicable for certains sorts of + targets. + kill request k + + toggle debug d toggle debug flag (see 386 & 68k stubs) + reset r reset -- see sparc stub. + reserved <other> On other requests, the stub should + ignore the request and send an empty + response ($#<checksum>). This way + we can extend the protocol and GDB + can tell whether the stub it is + talking to uses the old or the new. + search tAA:PP,MM Search backwards starting at address + AA for a match with pattern PP and + mask MM. PP and MM are 4 bytes. + Not supported by all stubs. + + general query qXXXX Request info about XXXX. + general set QXXXX=yyyy Set value of XXXX to yyyy. + query sect offs qOffsets Get section offsets. Reply is + Text=xxx;Data=yyy;Bss=zzz + console output Otext Send text to stdout. Only comes from + remote target. + + Responses can be run-length encoded to save space. A '*' means that + the next character is an ASCII encoding giving a repeat count which + stands for that many repititions of the character preceding the '*'. + The encoding is n+29, yielding a printable character where n >=3 + (which is where rle starts to win). Don't use an n > 126. + + So + "0* " means the same as "0000". */ + +#include <string.h> +#include <setjmp.h> + + + +#define COND_BR_MASK 0xff00 +#define UCOND_DBR_MASK 0xe000 +#define UCOND_RBR_MASK 0xf0df +#define TRAPA_MASK 0xff00 + +#define COND_DISP 0x00ff +#define UCOND_DISP 0x0fff +#define UCOND_REG 0x0f00 + +#define BF_INSTR 0x8b00 +#define BT_INSTR 0x8900 +#define BRA_INSTR 0xa000 +#define BSR_INSTR 0xb000 +#define JMP_INSTR 0x402b +#define JSR_INSTR 0x400b +#define RTS_INSTR 0x000b +#define RTE_INSTR 0x002b +#define TRAPA_INSTR 0xc300 + +#define SSTEP_INSTR 0xc3ff + +#define T_BIT_MASK 0x0001 +/* + * BUFMAX defines the maximum number of characters in inbound/outbound + * buffers at least NUMREGBYTES*2 are needed for register packets + */ +#define BUFMAX 1024 + +/* + * Number of bytes for registers + */ +#define NUMREGBYTES 112 /* 92 */ + +/* + * typedef + */ +typedef void (*Function) (); + +/* + * Forward declarations + */ + +static int hex (char); +static char *mem2hex (char *, char *, int); +static char *hex2mem (char *, char *, int); +static int hexToInt (char **, int *); +static void getpacket (char *); +static void putpacket (char *); +static void handle_buserror (void); +static int computeSignal (int exceptionVector); +static void handle_exception (int exceptionVector); +void init_serial(); + + +int putDebugChar (char); +char getDebugChar (void); + +/* These are in the file but in asm statements so the compiler can't see them */ +void catch_exception_4 (void); +void catch_exception_6 (void); +void catch_exception_9 (void); +void catch_exception_10 (void); +void catch_exception_11 (void); +void catch_exception_32 (void); +void catch_exception_33 (void); +void catch_exception_255 (void); + + + +#define catch_exception_random catch_exception_255 /* Treat all odd ones like 255 */ + +void breakpoint (void); + + +#define init_stack_size 8*1024 /* if you change this you should also modify BINIT */ +#define stub_stack_size 8*1024 + +int init_stack[init_stack_size] __attribute__ ((section ("stack"))) = {0}; +int stub_stack[stub_stack_size] __attribute__ ((section ("stack"))) = {0}; + +typedef struct + { + void (*func_cold) (); + int *stack_cold; + void (*func_warm) (); + int *stack_warm; + void (*(handler[256 - 4])) (); + } +vec_type; + + +void INIT (); +void BINIT (); + +/* When you link take care that this is at address 0 - + or wherever your vbr points */ + +#define CPU_BUS_ERROR_VEC 9 +#define DMA_BUS_ERROR_VEC 10 +#define NMI_VEC 11 +#define INVALID_INSN_VEC 4 +#define INVALID_SLOT_VEC 6 +#define TRAP_VEC 32 +#define IO_VEC 33 +#define USER_VEC 255 + + +#define BCR (*(volatile short *)(0x05FFFFA0)) /* Bus control register */ +#define BAS (0x800) /* Byte access select */ +#define WCR1 (*(volatile short *)(0x05ffffA2)) /* Wait state control register */ + +const vec_type vectable = +{ + &BINIT, /* 0: Power-on reset PC */ + init_stack + init_stack_size, /* 1: Power-on reset SP */ + &BINIT, /* 2: Manual reset PC */ + init_stack + init_stack_size, /* 3: Manual reset SP */ +{ + &catch_exception_4, /* 4: General invalid instruction */ + &catch_exception_random, /* 5: Reserved for system */ + &catch_exception_6, /* 6: Invalid slot instruction */ + &catch_exception_random, /* 7: Reserved for system */ + &catch_exception_random, /* 8: Reserved for system */ + &catch_exception_9, /* 9: CPU bus error */ + &catch_exception_10, /* 10: DMA bus error */ + &catch_exception_11, /* 11: NMI */ + &catch_exception_random, /* 12: User break */ + &catch_exception_random, /* 13: Reserved for system */ + &catch_exception_random, /* 14: Reserved for system */ + &catch_exception_random, /* 15: Reserved for system */ + &catch_exception_random, /* 16: Reserved for system */ + &catch_exception_random, /* 17: Reserved for system */ + &catch_exception_random, /* 18: Reserved for system */ + &catch_exception_random, /* 19: Reserved for system */ + &catch_exception_random, /* 20: Reserved for system */ + &catch_exception_random, /* 21: Reserved for system */ + &catch_exception_random, /* 22: Reserved for system */ + &catch_exception_random, /* 23: Reserved for system */ + &catch_exception_random, /* 24: Reserved for system */ + &catch_exception_random, /* 25: Reserved for system */ + &catch_exception_random, /* 26: Reserved for system */ + &catch_exception_random, /* 27: Reserved for system */ + &catch_exception_random, /* 28: Reserved for system */ + &catch_exception_random, /* 29: Reserved for system */ + &catch_exception_random, /* 30: Reserved for system */ + &catch_exception_random, /* 31: Reserved for system */ + &catch_exception_32, /* 32: Trap instr (user vectors) */ + &catch_exception_33, /* 33: Trap instr (user vectors) */ + &catch_exception_random, /* 34: Trap instr (user vectors) */ + &catch_exception_random, /* 35: Trap instr (user vectors) */ + &catch_exception_random, /* 36: Trap instr (user vectors) */ + &catch_exception_random, /* 37: Trap instr (user vectors) */ + &catch_exception_random, /* 38: Trap instr (user vectors) */ + &catch_exception_random, /* 39: Trap instr (user vectors) */ + &catch_exception_random, /* 40: Trap instr (user vectors) */ + &catch_exception_random, /* 41: Trap instr (user vectors) */ + &catch_exception_random, /* 42: Trap instr (user vectors) */ + &catch_exception_random, /* 43: Trap instr (user vectors) */ + &catch_exception_random, /* 44: Trap instr (user vectors) */ + &catch_exception_random, /* 45: Trap instr (user vectors) */ + &catch_exception_random, /* 46: Trap instr (user vectors) */ + &catch_exception_random, /* 47: Trap instr (user vectors) */ + &catch_exception_random, /* 48: Trap instr (user vectors) */ + &catch_exception_random, /* 49: Trap instr (user vectors) */ + &catch_exception_random, /* 50: Trap instr (user vectors) */ + &catch_exception_random, /* 51: Trap instr (user vectors) */ + &catch_exception_random, /* 52: Trap instr (user vectors) */ + &catch_exception_random, /* 53: Trap instr (user vectors) */ + &catch_exception_random, /* 54: Trap instr (user vectors) */ + &catch_exception_random, /* 55: Trap instr (user vectors) */ + &catch_exception_random, /* 56: Trap instr (user vectors) */ + &catch_exception_random, /* 57: Trap instr (user vectors) */ + &catch_exception_random, /* 58: Trap instr (user vectors) */ + &catch_exception_random, /* 59: Trap instr (user vectors) */ + &catch_exception_random, /* 60: Trap instr (user vectors) */ + &catch_exception_random, /* 61: Trap instr (user vectors) */ + &catch_exception_random, /* 62: Trap instr (user vectors) */ + &catch_exception_random, /* 63: Trap instr (user vectors) */ + &catch_exception_random, /* 64: IRQ0 */ + &catch_exception_random, /* 65: IRQ1 */ + &catch_exception_random, /* 66: IRQ2 */ + &catch_exception_random, /* 67: IRQ3 */ + &catch_exception_random, /* 68: IRQ4 */ + &catch_exception_random, /* 69: IRQ5 */ + &catch_exception_random, /* 70: IRQ6 */ + &catch_exception_random, /* 71: IRQ7 */ + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_random, + &catch_exception_255}}; + + +char in_nmi; /* Set when handling an NMI, so we don't reenter */ +int dofault; /* Non zero, bus errors will raise exception */ + +int *stub_sp; + +/* debug > 0 prints ill-formed commands in valid packets & checksum errors */ +int remote_debug; + +/* jump buffer used for setjmp/longjmp */ +jmp_buf remcomEnv; + +enum regnames + { + R0, R1, R2, R3, R4, R5, R6, R7, + R8, R9, R10, R11, R12, R13, R14, + R15, PC, PR, GBR, VBR, MACH, MACL, SR, + TICKS, STALLS, CYCLES, INSTS, PLR + }; + +typedef struct + { + short *memAddr; + short oldInstr; + } +stepData; + +int registers[NUMREGBYTES / 4]; +stepData instrBuffer; +char stepped; +static const char hexchars[] = "0123456789abcdef"; +char remcomInBuffer[BUFMAX]; +char remcomOutBuffer[BUFMAX]; + +char highhex(int x) +{ + return hexchars[(x >> 4) & 0xf]; +} + +char lowhex(int x) +{ + return hexchars[x & 0xf]; +} + +/* + * Assembly macros + */ + +#define BREAKPOINT() asm("trapa #0x20"::); + + +/* + * Routines to handle hex data + */ + +static int +hex (char ch) +{ + if ((ch >= 'a') && (ch <= 'f')) + return (ch - 'a' + 10); + if ((ch >= '0') && (ch <= '9')) + return (ch - '0'); + if ((ch >= 'A') && (ch <= 'F')) + return (ch - 'A' + 10); + return (-1); +} + +/* convert the memory, pointed to by mem into hex, placing result in buf */ +/* return a pointer to the last char put in buf (null) */ +static char * +mem2hex (char *mem, char *buf, int count) +{ + int i; + int ch; + for (i = 0; i < count; i++) + { + ch = *mem++; + *buf++ = highhex (ch); + *buf++ = lowhex (ch); + } + *buf = 0; + return (buf); +} + +/* convert the hex array pointed to by buf into binary, to be placed in mem */ +/* return a pointer to the character after the last byte written */ + +static char * +hex2mem (char *buf, char *mem, int count) +{ + int i; + unsigned char ch; + for (i = 0; i < count; i++) + { + ch = hex (*buf++) << 4; + ch = ch + hex (*buf++); + *mem++ = ch; + } + return (mem); +} + +/**********************************************/ +/* WHILE WE FIND NICE HEX CHARS, BUILD AN INT */ +/* RETURN NUMBER OF CHARS PROCESSED */ +/**********************************************/ +static int +hexToInt (char **ptr, int *intValue) +{ + int numChars = 0; + int hexValue; + + *intValue = 0; + + while (**ptr) + { + hexValue = hex (**ptr); + if (hexValue >= 0) + { + *intValue = (*intValue << 4) | hexValue; + numChars++; + } + else + break; + + (*ptr)++; + } + + return (numChars); +} + +/* + * Routines to get and put packets + */ + +/* scan for the sequence $<data>#<checksum> */ + +static +void +getpacket (char *buffer) +{ + unsigned char checksum; + unsigned char xmitcsum; + int i; + int count; + char ch; + do + { + /* wait around for the start character, ignore all other characters */ + while ((ch = getDebugChar ()) != '$'); + checksum = 0; + xmitcsum = -1; + + count = 0; + + /* now, read until a # or end of buffer is found */ + while (count < BUFMAX) + { + ch = getDebugChar (); + if (ch == '#') + break; + checksum = checksum + ch; + buffer[count] = ch; + count = count + 1; + } + buffer[count] = 0; + + if (ch == '#') + { + xmitcsum = hex (getDebugChar ()) << 4; + xmitcsum += hex (getDebugChar ()); + if (checksum != xmitcsum) + putDebugChar ('-'); /* failed checksum */ + else + { + putDebugChar ('+'); /* successful transfer */ + /* if a sequence char is present, reply the sequence ID */ + if (buffer[2] == ':') + { + putDebugChar (buffer[0]); + putDebugChar (buffer[1]); + /* remove sequence chars from buffer */ + count = strlen (buffer); + for (i = 3; i <= count; i++) + buffer[i - 3] = buffer[i]; + } + } + } + } + while (checksum != xmitcsum); + +} + + +/* send the packet in buffer. The host get's one chance to read it. + This routine does not wait for a positive acknowledge. */ + +static void +putpacket (register char *buffer) +{ + register int checksum; + register int count; + + /* $<packet info>#<checksum>. */ + do + { + char *src = buffer; + putDebugChar ('$'); + checksum = 0; + + while (*src) + { + int runlen; + + /* Do run length encoding */ + for (runlen = 0; runlen < 100; runlen ++) + { + if (src[0] != src[runlen]) + { + if (runlen > 3) + { + int encode; + /* Got a useful amount */ + putDebugChar (*src); + checksum += *src; + putDebugChar ('*'); + checksum += '*'; + checksum += (encode = runlen + ' ' - 4); + putDebugChar (encode); + src += runlen; + } + else + { + putDebugChar (*src); + checksum += *src; + src++; + } + break; + } + } + } + + + putDebugChar ('#'); + putDebugChar (highhex(checksum)); + putDebugChar (lowhex(checksum)); + } + while (getDebugChar() != '+'); + +} + + +/* a bus error has occurred, perform a longjmp + to return execution and allow handling of the error */ + +void +handle_buserror (void) +{ + longjmp (remcomEnv, 1); +} + +/* + * this function takes the SH-1 exception number and attempts to + * translate this number into a unix compatible signal value + */ +static int +computeSignal (int exceptionVector) +{ + int sigval; + switch (exceptionVector) + { + case INVALID_INSN_VEC: + sigval = 4; + break; + case INVALID_SLOT_VEC: + sigval = 4; + break; + case CPU_BUS_ERROR_VEC: + sigval = 10; + break; + case DMA_BUS_ERROR_VEC: + sigval = 10; + break; + case NMI_VEC: + sigval = 2; + break; + + case TRAP_VEC: + case USER_VEC: + sigval = 5; + break; + + default: + sigval = 7; /* "software generated"*/ + break; + } + return (sigval); +} + +void +doSStep (void) +{ + short *instrMem; + int displacement; + int reg; + unsigned short opcode; + + instrMem = (short *) registers[PC]; + + opcode = *instrMem; + stepped = 1; + + if ((opcode & COND_BR_MASK) == BT_INSTR) + { + if (registers[SR] & T_BIT_MASK) + { + displacement = (opcode & COND_DISP) << 1; + if (displacement & 0x80) + displacement |= 0xffffff00; + /* + * Remember PC points to second instr. + * after PC of branch ... so add 4 + */ + instrMem = (short *) (registers[PC] + displacement + 4); + } + else + instrMem += 1; + } + else if ((opcode & COND_BR_MASK) == BF_INSTR) + { + if (registers[SR] & T_BIT_MASK) + instrMem += 1; + else + { + displacement = (opcode & COND_DISP) << 1; + if (displacement & 0x80) + displacement |= 0xffffff00; + /* + * Remember PC points to second instr. + * after PC of branch ... so add 4 + */ + instrMem = (short *) (registers[PC] + displacement + 4); + } + } + else if ((opcode & UCOND_DBR_MASK) == BRA_INSTR) + { + displacement = (opcode & UCOND_DISP) << 1; + if (displacement & 0x0800) + displacement |= 0xfffff000; + + /* + * Remember PC points to second instr. + * after PC of branch ... so add 4 + */ + instrMem = (short *) (registers[PC] + displacement + 4); + } + else if ((opcode & UCOND_RBR_MASK) == JSR_INSTR) + { + reg = (char) ((opcode & UCOND_REG) >> 8); + + instrMem = (short *) registers[reg]; + } + else if (opcode == RTS_INSTR) + instrMem = (short *) registers[PR]; + else if (opcode == RTE_INSTR) + instrMem = (short *) registers[15]; + else if ((opcode & TRAPA_MASK) == TRAPA_INSTR) + instrMem = (short *) ((opcode & ~TRAPA_MASK) << 2); + else + instrMem += 1; + + instrBuffer.memAddr = instrMem; + instrBuffer.oldInstr = *instrMem; + *instrMem = SSTEP_INSTR; +} + +void +undoSStep (void) +{ + /* + If we single stepped, + restore the old instruction! +*/ + if (stepped) + { short *instrMem; + instrMem = instrBuffer.memAddr; + *instrMem = instrBuffer.oldInstr; + } + stepped = 0; +} + +/* +This function does all exception handling. It only does two things - +it figures out why it was called and tells gdb, and then it reacts +to gdb's requests. + +When in the monitor mode we talk a human on the serial line rather than gdb. + +*/ + + +void +gdb_handle_exception (int exceptionVector) +{ + int sigval; + int addr, length; + char *ptr; + + /* reply to host that an exception has occurred */ + sigval = computeSignal (exceptionVector); + remcomOutBuffer[0] = 'S'; + remcomOutBuffer[1] = highhex(sigval); + remcomOutBuffer[2] = lowhex (sigval); + remcomOutBuffer[3] = 0; + + putpacket (remcomOutBuffer); + + /* + * exception 255 indicates a software trap + * inserted in place of code ... so back up + * PC by one instruction, since this instruction + * will later be replaced by its original one! + */ + if (exceptionVector == 0xff + || exceptionVector == 0x20) + registers[PC] -= 2; + + /* + * Do the thangs needed to undo + * any stepping we may have done! + */ + undoSStep (); + + while (1) + { + remcomOutBuffer[0] = 0; + getpacket (remcomInBuffer); + + switch (remcomInBuffer[0]) + { + case '?': + remcomOutBuffer[0] = 'S'; + remcomOutBuffer[1] = highhex (sigval); + remcomOutBuffer[2] = lowhex (sigval); + remcomOutBuffer[3] = 0; + break; + case 'd': + remote_debug = !(remote_debug); /* toggle debug flag */ + break; + case 'g': /* return the value of the CPU registers */ + mem2hex ((char *) registers, remcomOutBuffer, NUMREGBYTES); + break; + case 'G': /* set the value of the CPU registers - return OK */ + hex2mem (&remcomInBuffer[1], (char *) registers, NUMREGBYTES); + strcpy (remcomOutBuffer, "OK"); + break; + + /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */ + case 'm': + if (setjmp (remcomEnv) == 0) + { + dofault = 0; + /* TRY, TO READ %x,%x. IF SUCCEED, SET PTR = 0 */ + ptr = &remcomInBuffer[1]; + if (hexToInt (&ptr, &addr)) + if (*(ptr++) == ',') + if (hexToInt (&ptr, &length)) + { + ptr = 0; + mem2hex ((char *) addr, remcomOutBuffer, length); + } + if (ptr) + strcpy (remcomOutBuffer, "E01"); + } + else + strcpy (remcomOutBuffer, "E03"); + + /* restore handler for bus error */ + dofault = 1; + break; + + /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */ + case 'M': + if (setjmp (remcomEnv) == 0) + { + dofault = 0; + + /* TRY, TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */ + ptr = &remcomInBuffer[1]; + if (hexToInt (&ptr, &addr)) + if (*(ptr++) == ',') + if (hexToInt (&ptr, &length)) + if (*(ptr++) == ':') + { + hex2mem (ptr, (char *) addr, length); + ptr = 0; + strcpy (remcomOutBuffer, "OK"); + } + if (ptr) + strcpy (remcomOutBuffer, "E02"); + } + else + strcpy (remcomOutBuffer, "E03"); + + /* restore handler for bus error */ + dofault = 1; + break; + + /* cAA..AA Continue at address AA..AA(optional) */ + /* sAA..AA Step one instruction from AA..AA(optional) */ + case 'c': + case 's': + { + /* tRY, to read optional parameter, pc unchanged if no parm */ + ptr = &remcomInBuffer[1]; + if (hexToInt (&ptr, &addr)) + registers[PC] = addr; + + if (remcomInBuffer[0] == 's') + doSStep (); + } + return; + break; + + /* kill the program */ + case 'k': /* do nothing */ + break; + } /* switch */ + + /* reply to the request */ + putpacket (remcomOutBuffer); + } +} + + +#define GDBCOOKIE 0x5ac +static int ingdbmode; +/* We've had an exception - choose to go into the monitor or + the gdb stub */ +void handle_exception(int exceptionVector) +{ +#ifdef MONITOR + if (ingdbmode != GDBCOOKIE) + monitor_handle_exception (exceptionVector); + else +#endif + gdb_handle_exception (exceptionVector); + +} + +void +gdb_mode() +{ + ingdbmode = GDBCOOKIE; + breakpoint(); +} +/* This function will generate a breakpoint exception. It is used at the + beginning of a program to sync up with a debugger and can be used + otherwise as a quick means to stop program execution and "break" into + the debugger. */ + +void +breakpoint (void) +{ + BREAKPOINT (); +} + +asm ("_BINIT: mov.l L1,r15"); +asm ("bra _INIT"); +asm ("nop"); +asm ("L1: .long _init_stack + 8*1024*4"); +void +INIT (void) +{ + /* First turn on the ram */ + WCR1 = 0; /* Never sample wait */ + BCR = BAS; /* use lowbyte/high byte */ + + init_serial(); + +#ifdef MONITOR + reset_hook (); +#endif + + + in_nmi = 0; + dofault = 1; + stepped = 0; + + stub_sp = stub_stack + stub_stack_size; + breakpoint (); + + while (1) + ; +} + + +static void sr() +{ + + + /* Calling Reset does the same as pressing the button */ + asm (".global _Reset + .global _WarmReset +_Reset: +_WarmReset: + mov.l L_sp,r15 + bra _INIT + nop + .align 2 +L_sp: .long _init_stack + 8000"); + + asm("saveRegisters: + mov.l @(L_reg, pc), r0 + mov.l @r15+, r1 ! pop R0 + mov.l r2, @(0x08, r0) ! save R2 + mov.l r1, @r0 ! save R0 + mov.l @r15+, r1 ! pop R1 + mov.l r3, @(0x0c, r0) ! save R3 + mov.l r1, @(0x04, r0) ! save R1 + mov.l r4, @(0x10, r0) ! save R4 + mov.l r5, @(0x14, r0) ! save R5 + mov.l r6, @(0x18, r0) ! save R6 + mov.l r7, @(0x1c, r0) ! save R7 + mov.l r8, @(0x20, r0) ! save R8 + mov.l r9, @(0x24, r0) ! save R9 + mov.l r10, @(0x28, r0) ! save R10 + mov.l r11, @(0x2c, r0) ! save R11 + mov.l r12, @(0x30, r0) ! save R12 + mov.l r13, @(0x34, r0) ! save R13 + mov.l r14, @(0x38, r0) ! save R14 + mov.l @r15+, r4 ! save arg to handleException + add #8, r15 ! hide PC/SR values on stack + mov.l r15, @(0x3c, r0) ! save R15 + add #-8, r15 ! save still needs old SP value + add #92, r0 ! readjust register pointer + mov r15, r2 + add #4, r2 + mov.l @r2, r2 ! R2 has SR + mov.l @r15, r1 ! R1 has PC + mov.l r2, @-r0 ! save SR + sts.l macl, @-r0 ! save MACL + sts.l mach, @-r0 ! save MACH + stc.l vbr, @-r0 ! save VBR + stc.l gbr, @-r0 ! save GBR + sts.l pr, @-r0 ! save PR + mov.l @(L_stubstack, pc), r2 + mov.l @(L_hdl_except, pc), r3 + mov.l @r2, r15 + jsr @r3 + mov.l r1, @-r0 ! save PC + mov.l @(L_stubstack, pc), r0 + mov.l @(L_reg, pc), r1 + bra restoreRegisters + mov.l r15, @r0 ! save __stub_stack + + .align 2 +L_reg: + .long _registers +L_stubstack: + .long _stub_sp +L_hdl_except: + .long _handle_exception"); + +} + +static void rr() +{ +asm(" + .align 2 + .global _resume +_resume: + mov r4,r1 +restoreRegisters: + add #8, r1 ! skip to R2 + mov.l @r1+, r2 ! restore R2 + mov.l @r1+, r3 ! restore R3 + mov.l @r1+, r4 ! restore R4 + mov.l @r1+, r5 ! restore R5 + mov.l @r1+, r6 ! restore R6 + mov.l @r1+, r7 ! restore R7 + mov.l @r1+, r8 ! restore R8 + mov.l @r1+, r9 ! restore R9 + mov.l @r1+, r10 ! restore R10 + mov.l @r1+, r11 ! restore R11 + mov.l @r1+, r12 ! restore R12 + mov.l @r1+, r13 ! restore R13 + mov.l @r1+, r14 ! restore R14 + mov.l @r1+, r15 ! restore programs stack + mov.l @r1+, r0 + add #-8, r15 ! uncover PC/SR on stack + mov.l r0, @r15 ! restore PC onto stack + lds.l @r1+, pr ! restore PR + ldc.l @r1+, gbr ! restore GBR + ldc.l @r1+, vbr ! restore VBR + lds.l @r1+, mach ! restore MACH + lds.l @r1+, macl ! restore MACL + mov.l @r1, r0 + add #-88, r1 ! readjust reg pointer to R1 + mov.l r0, @(4, r15) ! restore SR onto stack+4 + mov.l r2, @-r15 + mov.l L_in_nmi, r0 + mov #0, r2 + mov.b r2, @r0 + mov.l @r15+, r2 + mov.l @r1+, r0 ! restore R0 + rte + mov.l @r1, r1 ! restore R1 + +"); +} + + +static __inline__ void code_for_catch_exception(int n) +{ + asm(" .globl _catch_exception_%O0" : : "i" (n) ); + asm(" _catch_exception_%O0:" :: "i" (n) ); + + asm(" add #-4, r15 ! reserve spot on stack "); + asm(" mov.l r1, @-r15 ! push R1 "); + + if (n == NMI_VEC) + { + /* Special case for NMI - make sure that they don't nest */ + asm(" mov.l r0, @-r15 ! push R0"); + asm(" mov.l L_in_nmi, r0"); + asm(" tas.b @r0 ! Fend off against addtnl NMIs"); + asm(" bt noNMI"); + asm(" mov.l @r15+, r0"); + asm(" mov.l @r15+, r1"); + asm(" add #4, r15"); + asm(" rte"); + asm(" nop"); + asm(".align 2"); + asm("L_in_nmi: .long _in_nmi"); + asm("noNMI:"); + } + else + { + + if (n == CPU_BUS_ERROR_VEC) + { + /* Exception 9 (bus errors) are disasbleable - so that you + can probe memory and get zero instead of a fault. + Because the vector table may be in ROM we don't revector + the interrupt like all the other stubs, we check in here + */ + asm("mov.l L_dofault,r1"); + asm("mov.l @r1,r1"); + asm("tst r1,r1"); + asm("bf faultaway"); + asm("bsr _handle_buserror"); + asm(".align 2"); + asm("L_dofault: .long _dofault"); + asm("faultaway:"); + } + asm(" mov #15<<4, r1 "); + asm(" ldc r1, sr ! disable interrupts "); + asm(" mov.l r0, @-r15 ! push R0 "); + } + + /* Prepare for saving context, we've already pushed r0 and r1, stick exception number + into the frame */ + asm(" mov r15, r0 "); + asm(" add #8, r0 "); + asm(" mov %0,r1" :: "i" (n) ); + asm(" extu.b r1,r1 "); + asm(" bra saveRegisters ! save register values "); + asm(" mov.l r1, @r0 ! save exception # "); +} + + +static void +exceptions() +{ + code_for_catch_exception (CPU_BUS_ERROR_VEC); + code_for_catch_exception (DMA_BUS_ERROR_VEC); + code_for_catch_exception (INVALID_INSN_VEC); + code_for_catch_exception (INVALID_SLOT_VEC); + code_for_catch_exception (NMI_VEC); + code_for_catch_exception (TRAP_VEC); + code_for_catch_exception (USER_VEC); + code_for_catch_exception (IO_VEC); +} + + + + + + +/* Support for Serial I/O using on chip uart */ + +#define SMR0 (*(volatile char *)(0x05FFFEC0)) /* Channel 0 serial mode register */ +#define BRR0 (*(volatile char *)(0x05FFFEC1)) /* Channel 0 bit rate register */ +#define SCR0 (*(volatile char *)(0x05FFFEC2)) /* Channel 0 serial control register */ +#define TDR0 (*(volatile char *)(0x05FFFEC3)) /* Channel 0 transmit data register */ +#define SSR0 (*(volatile char *)(0x05FFFEC4)) /* Channel 0 serial status register */ +#define RDR0 (*(volatile char *)(0x05FFFEC5)) /* Channel 0 receive data register */ + +#define SMR1 (*(volatile char *)(0x05FFFEC8)) /* Channel 1 serial mode register */ +#define BRR1 (*(volatile char *)(0x05FFFEC9)) /* Channel 1 bit rate register */ +#define SCR1 (*(volatile char *)(0x05FFFECA)) /* Channel 1 serial control register */ +#define TDR1 (*(volatile char *)(0x05FFFECB)) /* Channel 1 transmit data register */ +#define SSR1 (*(volatile char *)(0x05FFFECC)) /* Channel 1 serial status register */ +#define RDR1 (*(volatile char *)(0x05FFFECD)) /* Channel 1 receive data register */ + +/* + * Serial mode register bits + */ + +#define SYNC_MODE 0x80 +#define SEVEN_BIT_DATA 0x40 +#define PARITY_ON 0x20 +#define ODD_PARITY 0x10 +#define STOP_BITS_2 0x08 +#define ENABLE_MULTIP 0x04 +#define PHI_64 0x03 +#define PHI_16 0x02 +#define PHI_4 0x01 + +/* + * Serial control register bits + */ +#define SCI_TIE 0x80 /* Transmit interrupt enable */ +#define SCI_RIE 0x40 /* Receive interrupt enable */ +#define SCI_TE 0x20 /* Transmit enable */ +#define SCI_RE 0x10 /* Receive enable */ +#define SCI_MPIE 0x08 /* Multiprocessor interrupt enable */ +#define SCI_TEIE 0x04 /* Transmit end interrupt enable */ +#define SCI_CKE1 0x02 /* Clock enable 1 */ +#define SCI_CKE0 0x01 /* Clock enable 0 */ + +/* + * Serial status register bits + */ +#define SCI_TDRE 0x80 /* Transmit data register empty */ +#define SCI_RDRF 0x40 /* Receive data register full */ +#define SCI_ORER 0x20 /* Overrun error */ +#define SCI_FER 0x10 /* Framing error */ +#define SCI_PER 0x08 /* Parity error */ +#define SCI_TEND 0x04 /* Transmit end */ +#define SCI_MPB 0x02 /* Multiprocessor bit */ +#define SCI_MPBT 0x01 /* Multiprocessor bit transfer */ + + +/* + * Port B IO Register (PBIOR) + */ +#define PBIOR (*(volatile char *)(0x05FFFFC6)) +#define PB15IOR 0x8000 +#define PB14IOR 0x4000 +#define PB13IOR 0x2000 +#define PB12IOR 0x1000 +#define PB11IOR 0x0800 +#define PB10IOR 0x0400 +#define PB9IOR 0x0200 +#define PB8IOR 0x0100 +#define PB7IOR 0x0080 +#define PB6IOR 0x0040 +#define PB5IOR 0x0020 +#define PB4IOR 0x0010 +#define PB3IOR 0x0008 +#define PB2IOR 0x0004 +#define PB1IOR 0x0002 +#define PB0IOR 0x0001 + +/* + * Port B Control Register (PBCR1) + */ +#define PBCR1 (*(volatile short *)(0x05FFFFCC)) +#define PB15MD1 0x8000 +#define PB15MD0 0x4000 +#define PB14MD1 0x2000 +#define PB14MD0 0x1000 +#define PB13MD1 0x0800 +#define PB13MD0 0x0400 +#define PB12MD1 0x0200 +#define PB12MD0 0x0100 +#define PB11MD1 0x0080 +#define PB11MD0 0x0040 +#define PB10MD1 0x0020 +#define PB10MD0 0x0010 +#define PB9MD1 0x0008 +#define PB9MD0 0x0004 +#define PB8MD1 0x0002 +#define PB8MD0 0x0001 + +#define PB15MD PB15MD1|PB14MD0 +#define PB14MD PB14MD1|PB14MD0 +#define PB13MD PB13MD1|PB13MD0 +#define PB12MD PB12MD1|PB12MD0 +#define PB11MD PB11MD1|PB11MD0 +#define PB10MD PB10MD1|PB10MD0 +#define PB9MD PB9MD1|PB9MD0 +#define PB8MD PB8MD1|PB8MD0 + +#define PB_TXD1 PB11MD1 +#define PB_RXD1 PB10MD1 +#define PB_TXD0 PB9MD1 +#define PB_RXD0 PB8MD1 + +/* + * Port B Control Register (PBCR2) + */ +#define PBCR2 0x05FFFFCE +#define PB7MD1 0x8000 +#define PB7MD0 0x4000 +#define PB6MD1 0x2000 +#define PB6MD0 0x1000 +#define PB5MD1 0x0800 +#define PB5MD0 0x0400 +#define PB4MD1 0x0200 +#define PB4MD0 0x0100 +#define PB3MD1 0x0080 +#define PB3MD0 0x0040 +#define PB2MD1 0x0020 +#define PB2MD0 0x0010 +#define PB1MD1 0x0008 +#define PB1MD0 0x0004 +#define PB0MD1 0x0002 +#define PB0MD0 0x0001 + +#define PB7MD PB7MD1|PB7MD0 +#define PB6MD PB6MD1|PB6MD0 +#define PB5MD PB5MD1|PB5MD0 +#define PB4MD PB4MD1|PB4MD0 +#define PB3MD PB3MD1|PB3MD0 +#define PB2MD PB2MD1|PB2MD0 +#define PB1MD PB1MD1|PB1MD0 +#define PB0MD PB0MD1|PB0MD0 + + +#ifdef MHZ +#define BPS 32 * 9600 * MHZ / ( BAUD * 10) +#else +#define BPS 32 /* 9600 for 10 Mhz */ +#endif + +char getDebugChar (void); +int putDebugChar (char); +void handleError (char theSSR); + +void +nop () +{ + +} +void +init_serial() +{ + int i; + + /* Clear TE and RE in Channel 1's SCR */ + SCR1 &= ~(SCI_TE | SCI_RE); + + /* Set communication to be async, 8-bit data, no parity, 1 stop bit and use internal clock */ + + SMR1 = 0; + BRR1 = BPS; + + SCR1 &= ~(SCI_CKE1 | SCI_CKE0); + + /* let the hardware settle */ + + for (i = 0; i < 1000; i++) + nop (); + + /* Turn on in and out */ + SCR1 |= SCI_RE | SCI_TE; + + /* Set the PFC to make RXD1 (pin PB8) an input pin and TXD1 (pin PB9) an output pin */ + PBCR1 &= ~(PB_TXD1 | PB_RXD1); + PBCR1 |= PB_TXD1 | PB_RXD1; +} + + +int +getDebugCharReady (void) +{ + char mySSR; + mySSR = SSR1 & ( SCI_PER | SCI_FER | SCI_ORER ); + if ( mySSR ) + handleError ( mySSR ); + return SSR1 & SCI_RDRF ; +} + +char +getDebugChar (void) +{ + char ch; + char mySSR; + + while ( ! getDebugCharReady()) + ; + + ch = RDR1; + SSR1 &= ~SCI_RDRF; + + mySSR = SSR1 & (SCI_PER | SCI_FER | SCI_ORER); + + if (mySSR) + handleError (mySSR); + + return ch; +} + +int +putDebugCharReady() +{ + return (SSR1 & SCI_TDRE); +} + +int +putDebugChar (char ch) +{ + while (!putDebugCharReady()) + ; + + /* + * Write data into TDR and clear TDRE + */ + TDR1 = ch; + SSR1 &= ~SCI_TDRE; + return 1; +} + +void +handleError (char theSSR) +{ + SSR1 &= ~(SCI_ORER | SCI_PER | SCI_FER); +} + diff --git a/contrib/gdb/gdb/config/sh/tm-sh.h b/contrib/gdb/gdb/config/sh/tm-sh.h new file mode 100644 index 0000000000000..0a57192bec989 --- /dev/null +++ b/contrib/gdb/gdb/config/sh/tm-sh.h @@ -0,0 +1,239 @@ +/* Target-specific definition for a Hitachi Super-H. + Copyright (C) 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Contributed by Steve Chamberlain sac@cygnus.com */ + +#define GDB_TARGET_IS_SH + +#define IEEE_FLOAT 1 + +/* Define the bit, byte, and word ordering of the machine. */ + +#define TARGET_BYTE_ORDER_SELECTABLE + + +/* Offset from address of function to start of its code. + Zero on most machines. */ + +#define FUNCTION_START_OFFSET 0 + +/* Advance PC across any function entry prologue instructions + to reach some "real" code. */ + +extern CORE_ADDR sh_skip_prologue (); +#define SKIP_PROLOGUE(ip) \ + {(ip) = sh_skip_prologue(ip);} + + +/* Immediately after a function call, return the saved pc. + Can't always go through the frames for this because on some machines + the new frame is not set up until the new function executes + some instructions. + + The return address is the value saved in the PR register + 4 */ + +#define SAVED_PC_AFTER_CALL(frame) \ + (ADDR_BITS_REMOVE(read_register(PR_REGNUM))) + +/* Stack grows downward. */ + +#define INNER_THAN < + +/* Illegal instruction - used by the simulator for breakpoint + detection */ + +#define BREAKPOINT {0xc3, 0xc3} /* 0xc3c3 is trapa #c3, and it works in big + and little endian modes */ +#define REMOTE_BREAKPOINT { 0xc3, 0x20} + +/* If your kernel resets the pc after the trap happens you may need to + define this before including this file. */ +#define DECR_PC_AFTER_BREAK 0 + +/* Nonzero if instruction at PC is a return instruction. */ +#define ABOUT_TO_RETURN(pc) (read_memory_integer(pc,2) == 0x000b) + +/* Say how long registers are. */ +#define REGISTER_TYPE long + +/* Say how much memory is needed to store a copy of the register set */ +#define REGISTER_BYTES (NUM_REGS*4) + +/* Index within `registers' of the first byte of the space for + register N. */ + +#define REGISTER_BYTE(N) ((N)*4) + +/* Number of bytes of storage in the actual machine representation + for register N. */ + +#define REGISTER_RAW_SIZE(N) 4 + +#define REGISTER_VIRTUAL_SIZE(N) 4 + +/* Largest value REGISTER_RAW_SIZE can have. */ + +#define MAX_REGISTER_RAW_SIZE 4 + +/* Largest value REGISTER_VIRTUAL_SIZE can have. */ + +#define MAX_REGISTER_VIRTUAL_SIZE 4 + +/* Return the GDB type object for the "standard" data type + of data in register N. */ + +#define REGISTER_VIRTUAL_TYPE(N) \ + ((((N) >= FP0_REGNUM && (N) < FP15_REGNUM) \ + || (N) == FPUL_REGNUM) \ + ? builtin_type_float : builtin_type_int) + +/* Initializer for an array of names of registers. + Entries beyond the first NUM_REGS are ignored. */ + +#define REGISTER_NAMES \ + {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ + "r8", "r9", "r10","r11","r12", "r13", "r14","r15",\ + "pc", "pr", "gbr","vbr","mach","macl","sr", \ + "fpul","fpscr", \ + "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", \ + "fr8", "fr9", "fr10","fr11","fr12","fr13","fr14","fr15",\ + "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0", \ + "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1" \ + } + +#define NUM_REGS 57 + +/* Register numbers of various important registers. + Note that some of these values are "real" register numbers, + and correspond to the general registers of the machine, + and some are "phony" register numbers which are too large + to be actual register numbers as far as the user is concerned + but do serve to get the desired values when passed to read_register. */ + +#define R0_REGNUM 0 +#define FP_REGNUM 14 +#define SP_REGNUM 15 +#define PC_REGNUM 16 +#define PR_REGNUM 17 +#define GBR_REGNUM 18 +#define VBR_REGNUM 19 +#define MACH_REGNUM 20 +#define MACL_REGNUM 21 +#define SR_REGNUM 22 +#define NUM_REALREGS 23 +#define FPUL_REGNUM 23 +#define FP0_REGNUM 25 +#define FP15_REGNUM 41 +#undef NUM_REALREGS +#define NUM_REALREGS 57 + +/* Store the address of the place in which to copy the structure the + subroutine will return. This is called from call_function. + + We store structs through a pointer passed in R4 */ + +#define STORE_STRUCT_RETURN(ADDR, SP) \ + { write_register (4, (ADDR)); } + +/* Extract from an array REGBUF containing the (raw) register state + a function return value of type TYPE, and copy that, in virtual format, + into VALBUF. */ + +#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ + memcpy (VALBUF, (char *)(REGBUF), TYPE_LENGTH(TYPE)) + + +/* Write into appropriate registers a function return value + of type TYPE, given in virtual format. + + Things always get returned in R4/R5 */ + +#define STORE_RETURN_VALUE(TYPE,VALBUF) \ + write_register_bytes (REGISTER_BYTE(4), VALBUF, TYPE_LENGTH (TYPE)) + + +/* Extract from an array REGBUF containing the (raw) register state + the address in which a function should return its structure value, + as a CORE_ADDR (or an expression that can be used as one). */ + +#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(CORE_ADDR *)(REGBUF)) + + +/* Define other aspects of the stack frame. + we keep a copy of the worked out return pc lying around, since it + is a useful bit of info */ + +#define EXTRA_FRAME_INFO \ + CORE_ADDR return_pc; \ + int leaf_function; \ + int f_offset; + +#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \ + init_extra_frame_info(fromleaf, fi) + +/* A macro that tells us whether the function invocation represented + by FI does not have a frame on the stack associated with it. If it + does not, FRAMELESS is set to 1, else 0. */ + +#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \ + (FRAMELESS) = frameless_look_for_prologue(FI) + +#define FRAME_CHAIN(FRAME) sh_frame_chain(FRAME) +#define FRAME_SAVED_PC(FRAME) ((FRAME)->return_pc) +#define FRAME_ARGS_ADDRESS(fi) (fi)->frame +#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame + +/* Set VAL to the number of args passed to frame described by FI. + Can set VAL to -1, meaning no way to tell. */ + +/* We can't tell how many args there are */ + +#define FRAME_NUM_ARGS(val,fi) (val = -1) + +/* Return number of bytes at start of arglist that are not really args. */ + +#define FRAME_ARGS_SKIP 0 + +/* Put here the code to store, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. */ + +#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ + frame_find_saved_regs(frame_info, &(frame_saved_regs)) + +#define NAMES_HAVE_UNDERSCORE + +typedef unsigned short INSN_WORD; + +#define ADDR_BITS_REMOVE(addr) ((addr)) + +#define CALL_DUMMY_LENGTH 10 + +/* Discard from the stack the innermost frame, + restoring all saved registers. */ + +#define POP_FRAME pop_frame(); + + +#define NOP {0x20, 0x0b} + +#define REGISTER_SIZE 4 + diff --git a/contrib/gdb/gdb/convex-tdep.c b/contrib/gdb/gdb/convex-tdep.c new file mode 100644 index 0000000000000..1cc4736575039 --- /dev/null +++ b/contrib/gdb/gdb/convex-tdep.c @@ -0,0 +1,1223 @@ +/* Convex stuff for GDB. + Copyright (C) 1990, 1991 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "command.h" +#include "symtab.h" +#include "value.h" +#include "frame.h" +#include "inferior.h" +#include "wait.h" + +#include <signal.h> +#include <fcntl.h> + +#include "gdbcore.h" +#include <sys/param.h> +#include <sys/dir.h> +#include <sys/user.h> +#include <sys/ioctl.h> +#include <sys/pcntl.h> +#include <sys/thread.h> +#include <sys/proc.h> +#include <sys/file.h> +#include "gdb_stat.h" +#include <sys/mman.h> + +#include "gdbcmd.h" + +exec_file_command (filename, from_tty) + char *filename; + int from_tty; +{ + int val; + int n; + struct stat st_exec; + + /* Eliminate all traces of old exec file. + Mark text segment as empty. */ + + if (execfile) + free (execfile); + execfile = 0; + data_start = 0; + data_end = 0; + text_start = 0; + text_end = 0; + exec_data_start = 0; + exec_data_end = 0; + if (execchan >= 0) + close (execchan); + execchan = -1; + + n_exec = 0; + + /* Now open and digest the file the user requested, if any. */ + + if (filename) + { + filename = tilde_expand (filename); + make_cleanup (free, filename); + + execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0, + &execfile); + if (execchan < 0) + perror_with_name (filename); + + if (myread (execchan, &filehdr, sizeof filehdr) < 0) + perror_with_name (filename); + + if (! IS_SOFF_MAGIC (filehdr.h_magic)) + error ("%s: not an executable file.", filename); + + if (myread (execchan, &opthdr, filehdr.h_opthdr) <= 0) + perror_with_name (filename); + + /* Read through the section headers. + For text, data, etc, record an entry in the exec file map. + Record text_start and text_end. */ + + lseek (execchan, (long) filehdr.h_scnptr, 0); + + for (n = 0; n < filehdr.h_nscns; n++) + { + if (myread (execchan, &scnhdr, sizeof scnhdr) < 0) + perror_with_name (filename); + + if ((scnhdr.s_flags & S_TYPMASK) >= S_TEXT + && (scnhdr.s_flags & S_TYPMASK) <= S_COMON) + { + exec_map[n_exec].mem_addr = scnhdr.s_vaddr; + exec_map[n_exec].mem_end = scnhdr.s_vaddr + scnhdr.s_size; + exec_map[n_exec].file_addr = scnhdr.s_scnptr; + exec_map[n_exec].type = scnhdr.s_flags & S_TYPMASK; + n_exec++; + + if ((scnhdr.s_flags & S_TYPMASK) == S_TEXT) + { + text_start = scnhdr.s_vaddr; + text_end = scnhdr.s_vaddr + scnhdr.s_size; + } + } + } + + fstat (execchan, &st_exec); + exec_mtime = st_exec.st_mtime; + + validate_files (); + } + else if (from_tty) + printf_filtered ("No exec file now.\n"); + + /* Tell display code (if any) about the changed file name. */ + if (exec_file_display_hook) + (*exec_file_display_hook) (filename); +} + +#if 0 +/* Read data from SOFF exec or core file. + Return 0 on success, EIO if address out of bounds. */ + +int +xfer_core_file (memaddr, myaddr, len) + CORE_ADDR memaddr; + char *myaddr; + int len; +{ + register int i; + register int n; + register int val; + int xferchan; + char **xferfile; + int fileptr; + int returnval = 0; + + while (len > 0) + { + xferfile = 0; + xferchan = 0; + + /* Determine which file the next bunch of addresses reside in, + and where in the file. Set the file's read/write pointer + to point at the proper place for the desired address + and set xferfile and xferchan for the correct file. + If desired address is nonexistent, leave them zero. + i is set to the number of bytes that can be handled + along with the next address. */ + + i = len; + + for (n = 0; n < n_core; n++) + { + if (memaddr >= core_map[n].mem_addr && memaddr < core_map[n].mem_end + && (core_map[n].thread == -1 + || core_map[n].thread == inferior_thread)) + { + i = min (len, core_map[n].mem_end - memaddr); + fileptr = core_map[n].file_addr + memaddr - core_map[n].mem_addr; + if (core_map[n].file_addr) + { + xferfile = &corefile; + xferchan = corechan; + } + break; + } + else if (core_map[n].mem_addr >= memaddr + && core_map[n].mem_addr < memaddr + i) + i = core_map[n].mem_addr - memaddr; + } + + if (!xferfile) + for (n = 0; n < n_exec; n++) + { + if (memaddr >= exec_map[n].mem_addr + && memaddr < exec_map[n].mem_end) + { + i = min (len, exec_map[n].mem_end - memaddr); + fileptr = exec_map[n].file_addr + memaddr + - exec_map[n].mem_addr; + if (exec_map[n].file_addr) + { + xferfile = &execfile; + xferchan = execchan; + } + break; + } + else if (exec_map[n].mem_addr >= memaddr + && exec_map[n].mem_addr < memaddr + i) + i = exec_map[n].mem_addr - memaddr; + } + + /* Now we know which file to use. + Set up its pointer and transfer the data. */ + if (xferfile) + { + if (*xferfile == 0) + if (xferfile == &execfile) + error ("No program file to examine."); + else + error ("No core dump file or running program to examine."); + val = lseek (xferchan, fileptr, 0); + if (val < 0) + perror_with_name (*xferfile); + val = myread (xferchan, myaddr, i); + if (val < 0) + perror_with_name (*xferfile); + } + /* If this address is for nonexistent memory, + read zeros if reading, or do nothing if writing. */ + else + { + memset (myaddr, '\0', i); + returnval = EIO; + } + + memaddr += i; + myaddr += i; + len -= i; + } + return returnval; +} +#endif + +/* Here from info files command to print an address map. */ + +print_maps () +{ + struct pmap ptrs[200]; + int n; + + /* ID strings for core and executable file sections */ + + static char *idstr[] = + { + "0", "text", "data", "tdata", "bss", "tbss", + "common", "ttext", "ctx", "tctx", "10", "11", "12", + }; + + for (n = 0; n < n_core; n++) + { + core_map[n].which = 0; + ptrs[n] = core_map[n]; + } + for (n = 0; n < n_exec; n++) + { + exec_map[n].which = 1; + ptrs[n_core+n] = exec_map[n]; + } + + qsort (ptrs, n_core + n_exec, sizeof *ptrs, ptr_cmp); + + for (n = 0; n < n_core + n_exec; n++) + { + struct pmap *p = &ptrs[n]; + if (n > 0) + { + if (p->mem_addr < ptrs[n-1].mem_end) + p->mem_addr = ptrs[n-1].mem_end; + if (p->mem_addr >= p->mem_end) + continue; + } + printf_filtered ("%08x .. %08x %-6s %s\n", + p->mem_addr, p->mem_end, idstr[p->type], + p->which ? execfile : corefile); + } +} + +/* Compare routine to put file sections in order. + Sort into increasing order on address, and put core file sections + before exec file sections if both files contain the same addresses. */ + +static ptr_cmp (a, b) + struct pmap *a, *b; +{ + if (a->mem_addr != b->mem_addr) return a->mem_addr - b->mem_addr; + return a->which - b->which; +} + +/* Trapped internal variables are used to handle special registers. + A trapped i.v. calls a hook here every time it is dereferenced, + to provide a new value for the variable, and it calls a hook here + when a new value is assigned, to do something with the value. + + The vector registers are $vl, $vs, $vm, $vN, $VN (N in 0..7). + The communication registers are $cN, $CN (N in 0..63). + They not handled as regular registers because it's expensive to + read them, and their size varies, and they have too many names. */ + + +/* Return 1 if NAME is a trapped internal variable, else 0. */ + +int +is_trapped_internalvar (name) + char *name; +{ + if ((name[0] == 'c' || name[0] == 'C') + && name[1] >= '0' && name[1] <= '9' + && (name[2] == '\0' + || (name[2] >= '0' && name[2] <= '9' + && name[3] == '\0' && name[1] != '0')) + && atoi (&name[1]) < 64) return 1; + + if ((name[0] == 'v' || name[0] == 'V') + && (((name[1] & -8) == '0' && name[2] == '\0') + || STREQ (name, "vl") + || STREQ (name, "vs") + || STREQ (name, "vm"))) + return 1; + else return 0; +} + +/* Return the value of trapped internal variable VAR */ + +value +value_of_trapped_internalvar (var) + struct internalvar *var; +{ + char *name = var->name; + value val; + struct type *type; + struct type *range_type; + long len = *read_vector_register (VL_REGNUM); + if (len <= 0 || len > 128) len = 128; + + if (STREQ (name, "vl")) + { + val = value_from_longest (builtin_type_int, + (LONGEST) *read_vector_register_1 (VL_REGNUM)); + } + else if (STREQ (name, "vs")) + { + val = value_from_longest (builtin_type_int, + (LONGEST) *read_vector_register_1 (VS_REGNUM)); + } + else if (STREQ (name, "vm")) + { + long vm[4]; + long i, *p; + memcpy (vm, read_vector_register_1 (VM_REGNUM), sizeof vm); + range_type = + create_range_type ((struct type *) NULL, builtin_type_int, 0, len - 1); + type = + create_array_type ((struct type *) NULL, builtin_type_int, range_type); + val = allocate_value (type); + p = (long *) VALUE_CONTENTS (val); + for (i = 0; i < len; i++) + *p++ = !! (vm[3 - (i >> 5)] & (1 << (i & 037))); + } + else if (name[0] == 'V') + { + range_type = + create_range_type ((struct type *) NULL, builtin_type_int 0, len - 1); + type = + create_array_type ((struct type *) NULL, builtin_type_long_long, + range_type); + val = allocate_value (type); + memcpy (VALUE_CONTENTS (val), + read_vector_register_1 (name[1] - '0'), + TYPE_LENGTH (type)); + } + else if (name[0] == 'v') + { + long *p1, *p2; + range_type = + create_range_type ((struct type *) NULL, builtin_type_int 0, len - 1); + type = + create_array_type ((struct type *) NULL, builtin_type_long, + range_type); + val = allocate_value (type); + p1 = read_vector_register_1 (name[1] - '0'); + p2 = (long *) VALUE_CONTENTS (val); + while (--len >= 0) {p1++; *p2++ = *p1++;} + } + + else if (name[0] == 'c') + val = value_from_longest (builtin_type_int, + read_comm_register (atoi (&name[1]))); + else if (name[0] == 'C') + val = value_from_longest (builtin_type_long_long, + read_comm_register (atoi (&name[1]))); + + VALUE_LVAL (val) = lval_internalvar; + VALUE_INTERNALVAR (val) = var; + return val; +} + +/* Handle a new value assigned to a trapped internal variable */ + +void +set_trapped_internalvar (var, val, bitpos, bitsize, offset) + struct internalvar *var; + value val; + int bitpos, bitsize, offset; +{ + char *name = var->name; + long long newval = value_as_long (val); + + if (STREQ (name, "vl")) + write_vector_register (VL_REGNUM, 0, newval); + else if (STREQ (name, "vs")) + write_vector_register (VS_REGNUM, 0, newval); + else if (name[0] == 'c' || name[0] == 'C') + write_comm_register (atoi (&name[1]), newval); + else if (STREQ (name, "vm")) + error ("can't assign to $vm"); + else + { + offset /= bitsize / 8; + write_vector_register (name[1] - '0', offset, newval); + } +} + +/* Print an integer value when no format was specified. gdb normally + prints these values in decimal, but the the leading 0x80000000 of + pointers produces intolerable 10-digit negative numbers. + If it looks like an address, print it in hex instead. */ + +decout (stream, type, val) + FILE *stream; + struct type *type; + LONGEST val; +{ + long lv = val; + + switch (output_radix) + { + case 0: + if ((lv == val || (unsigned) lv == val) + && ((lv & 0xf0000000) == 0x80000000 + || ((lv & 0xf0000000) == 0xf0000000 && lv < STACK_END_ADDR))) + { + fprintf_filtered (stream, "%#x", lv); + return; + } + + case 10: + fprintf_filtered (stream, TYPE_UNSIGNED (type) ? "%llu" : "%lld", val); + return; + + case 8: + if (TYPE_LENGTH (type) <= sizeof lv) + fprintf_filtered (stream, "%#o", lv); + else + fprintf_filtered (stream, "%#llo", val); + return; + + case 16: + if (TYPE_LENGTH (type) <= sizeof lv) + fprintf_filtered (stream, "%#x", lv); + else + fprintf_filtered (stream, "%#llx", val); + return; + } +} + +/* Change the default output radix to 10 or 16, or set it to 0 (heuristic). + This command is mostly obsolete now that the print command allows + formats to apply to aggregates, but is still handy occasionally. */ + +static void +set_base_command (arg) + char *arg; +{ + int new_radix; + + if (!arg) + output_radix = 0; + else + { + new_radix = atoi (arg); + if (new_radix != 10 && new_radix != 16 && new_radix != 8) + error ("base must be 8, 10 or 16, or null"); + else output_radix = new_radix; + } +} + +/* Turn pipelining on or off in the inferior. */ + +static void +set_pipelining_command (arg) + char *arg; +{ + if (!arg) + { + sequential = !sequential; + printf_filtered ("%s\n", sequential ? "off" : "on"); + } + else if (STREQ (arg, "on")) + sequential = 0; + else if (STREQ (arg, "off")) + sequential = 1; + else error ("valid args are `on', to allow instructions to overlap, or\n\ +`off', to prevent it and thereby pinpoint exceptions."); +} + +/* Enable, disable, or force parallel execution in the inferior. */ + +static void +set_parallel_command (arg) + char *arg; +{ + struct rlimit rl; + int prevparallel = parallel; + + if (!strncmp (arg, "fixed", strlen (arg))) + parallel = 2; + else if (STREQ (arg, "on")) + parallel = 1; + else if (STREQ (arg, "off")) + parallel = 0; + else error ("valid args are `on', to allow multiple threads, or\n\ +`fixed', to force multiple threads, or\n\ +`off', to run with one thread only."); + + if ((prevparallel == 0) != (parallel == 0) && inferior_pid) + printf_filtered ("will take effect at next run.\n"); + + getrlimit (RLIMIT_CONCUR, &rl); + rl.rlim_cur = parallel ? rl.rlim_max : 1; + setrlimit (RLIMIT_CONCUR, &rl); + + if (inferior_pid) + set_fixed_scheduling (inferior_pid, parallel == 2); +} + +/* Add a new name for an existing command. */ + +static void +alias_command (arg) + char *arg; +{ + static char *aliaserr = "usage is `alias NEW OLD', no args allowed"; + char *newname = arg; + struct cmd_list_element *new, *old; + + if (!arg) + error_no_arg ("newname oldname"); + + new = lookup_cmd (&arg, cmdlist, "", -1); + if (new && !strncmp (newname, new->name, strlen (new->name))) + { + newname = new->name; + if (!(*arg == '-' + || (*arg >= 'a' && *arg <= 'z') + || (*arg >= 'A' && *arg <= 'Z') + || (*arg >= '0' && *arg <= '9'))) + error (aliaserr); + } + else + { + arg = newname; + while (*arg == '-' + || (*arg >= 'a' && *arg <= 'z') + || (*arg >= 'A' && *arg <= 'Z') + || (*arg >= '0' && *arg <= '9')) + arg++; + if (*arg != ' ' && *arg != '\t') + error (aliaserr); + *arg = '\0'; + arg++; + } + + old = lookup_cmd (&arg, cmdlist, "", 0); + + if (*arg != '\0') + error (aliaserr); + + if (new && !strncmp (newname, new->name, strlen (new->name))) + { + char *tem; + if (new->class == (int) class_user || new->class == (int) class_alias) + tem = "Redefine command \"%s\"? "; + else + tem = "Really redefine built-in command \"%s\"? "; + if (!query (tem, new->name)) + error ("Command \"%s\" not redefined.", new->name); + } + + add_com (newname, class_alias, old->function, old->doc); +} + + + +/* Print the current thread number, and any threads with signals in the + queue. */ + +thread_info () +{ + struct threadpid *p; + + if (have_inferior_p ()) + { + ps.pi_buffer = (char *) &comm_registers; + ps.pi_nbytes = sizeof comm_registers; + ps.pi_offset = 0; + ps.pi_thread = inferior_thread; + ioctl (inferior_fd, PIXRDCREGS, &ps); + } + + /* FIXME: stop_signal is from target.h but stop_sigcode is a + convex-specific thing. */ + printf_filtered ("Current thread %d stopped with signal %d.%d (%s).\n", + inferior_thread, stop_signal, stop_sigcode, + subsig_name (stop_signal, stop_sigcode)); + + for (p = signal_stack; p->pid; p--) + printf_filtered ("Thread %d stopped with signal %d.%d (%s).\n", + p->thread, p->signo, p->subsig, + subsig_name (p->signo, p->subsig)); + + if (iscrlbit (comm_registers.crctl.lbits.cc, 64+13)) + printf_filtered ("New thread start pc %#x\n", + (long) (comm_registers.crreg.pcpsw >> 32)); +} + +/* Return string describing a signal.subcode number */ + +static char * +subsig_name (signo, subcode) + int signo, subcode; +{ + static char *subsig4[] = { + "error exit", "privileged instruction", "unknown", + "unknown", "undefined opcode", + 0}; + static char *subsig5[] = {0, + "breakpoint", "single step", "fork trap", "exec trap", "pfork trap", + "join trap", "idle trap", "last thread", "wfork trap", + "process breakpoint", "trap instruction", + 0}; + static char *subsig8[] = {0, + "int overflow", "int divide check", "float overflow", + "float divide check", "float underflow", "reserved operand", + "sqrt error", "exp error", "ln error", "sin error", "cos error", + 0}; + static char *subsig10[] = {0, + "invalid inward ring address", "invalid outward ring call", + "invalid inward ring return", "invalid syscall gate", + "invalid rtn frame length", "invalid comm reg address", + "invalid trap gate", + 0}; + static char *subsig11[] = {0, + "read access denied", "write access denied", "execute access denied", + "segment descriptor fault", "page table fault", "data reference fault", + "i/o access denied", "levt pte invalid", + 0}; + + static char **subsig_list[] = + {0, 0, 0, 0, subsig4, subsig5, 0, 0, subsig8, 0, subsig10, subsig11, 0}; + + int i; + char *p; + + if ((p = strsignal (signo)) == NULL) + p = "unknown"; + if (signo >= (sizeof subsig_list / sizeof *subsig_list) + || !subsig_list[signo]) + return p; + for (i = 1; subsig_list[signo][i]; i++) + if (i == subcode) + return subsig_list[signo][subcode]; + return p; +} + + +/* Print a compact display of thread status, essentially x/i $pc + for all active threads. */ + +static void +threadstat () +{ + int t; + + for (t = 0; t < n_threads; t++) + if (thread_state[t] == PI_TALIVE) + { + printf_filtered ("%d%c %08x%c %d.%d ", t, + (t == inferior_thread ? '*' : ' '), thread_pc[t], + (thread_is_in_kernel[t] ? '#' : ' '), + thread_signal[t], thread_sigcode[t]); + print_insn (thread_pc[t], stdout); + printf_filtered ("\n"); + } +} + +/* Change the current thread to ARG. */ + +set_thread_command (arg) + char *arg; +{ + int thread; + + if (!arg) + { + threadstat (); + return; + } + + thread = parse_and_eval_address (arg); + + if (thread < 0 || thread > n_threads || thread_state[thread] != PI_TALIVE) + error ("no such thread."); + + select_thread (thread); + + stop_pc = read_pc (); + flush_cached_frames (); + select_frame (get_current_frame (), 0); + print_stack_frame (selected_frame, selected_frame_level, -1); +} + +/* Here on CONT command; gdb's dispatch address is changed to come here. + Set global variable ALL_CONTINUE to tell resume() that it should + start up all threads, and that a thread switch will not blow gdb's + mind. */ + +static void +convex_cont_command (proc_count_exp, from_tty) + char *proc_count_exp; + int from_tty; +{ + all_continue = 1; + cont_command (proc_count_exp, from_tty); +} + +/* Here on 1CONT command. Resume only the current thread. */ + +one_cont_command (proc_count_exp, from_tty) + char *proc_count_exp; + int from_tty; +{ + cont_command (proc_count_exp, from_tty); +} + +/* Print the contents and lock bits of all communication registers, + or just register ARG if ARG is a communication register, + or the 3-word resource structure in memory at address ARG. */ + +comm_registers_info (arg) + char *arg; +{ + int i, regnum; + + if (arg) + { + if (sscanf (arg, "$c%d", ®num) == 1) { + ; + } else if (sscanf (arg, "$C%d", ®num) == 1) { + ; + } else { + regnum = parse_and_eval_address (arg); + if (regnum > 0) + regnum &= ~0x8000; + } + + if (regnum >= 64) + error ("%s: invalid register name.", arg); + + /* if we got a (user) address, examine the resource struct there */ + + if (regnum < 0) + { + static int buf[3]; + read_memory (regnum, buf, sizeof buf); + printf_filtered ("%08x %08x%08x%s\n", regnum, buf[1], buf[2], + buf[0] & 0xff ? " locked" : ""); + return; + } + } + + ps.pi_buffer = (char *) &comm_registers; + ps.pi_nbytes = sizeof comm_registers; + ps.pi_offset = 0; + ps.pi_thread = inferior_thread; + ioctl (inferior_fd, PIXRDCREGS, &ps); + + for (i = 0; i < 64; i++) + if (!arg || i == regnum) + printf_filtered ("%2d 0x8%03x %016llx%s\n", i, i, + comm_registers.crreg.r4[i], + (iscrlbit (comm_registers.crctl.lbits.cc, i) + ? " locked" : "")); +} + +/* Print the psw */ + +static void +psw_info (arg) + char *arg; +{ + struct pswbit + { + int bit; + int pos; + char *text; + }; + + static struct pswbit pswbit[] = + { + { 0x80000000, -1, "A carry" }, + { 0x40000000, -1, "A integer overflow" }, + { 0x20000000, -1, "A zero divide" }, + { 0x10000000, -1, "Integer overflow enable" }, + { 0x08000000, -1, "Trace" }, + { 0x06000000, 25, "Frame length" }, + { 0x01000000, -1, "Sequential" }, + { 0x00800000, -1, "S carry" }, + { 0x00400000, -1, "S integer overflow" }, + { 0x00200000, -1, "S zero divide" }, + { 0x00100000, -1, "Zero divide enable" }, + { 0x00080000, -1, "Floating underflow" }, + { 0x00040000, -1, "Floating overflow" }, + { 0x00020000, -1, "Floating reserved operand" }, + { 0x00010000, -1, "Floating zero divide" }, + { 0x00008000, -1, "Floating error enable" }, + { 0x00004000, -1, "Floating underflow enable" }, + { 0x00002000, -1, "IEEE" }, + { 0x00001000, -1, "Sequential stores" }, + { 0x00000800, -1, "Intrinsic error" }, + { 0x00000400, -1, "Intrinsic error enable" }, + { 0x00000200, -1, "Trace thread creates" }, + { 0x00000100, -1, "Thread init trap" }, + { 0x000000e0, 5, "Reserved" }, + { 0x0000001f, 0, "Intrinsic error code" }, + {0, 0, 0}, + }; + + long psw; + struct pswbit *p; + + if (arg) + psw = parse_and_eval_address (arg); + else + psw = read_register (PS_REGNUM); + + for (p = pswbit; p->bit; p++) + { + if (p->pos < 0) + printf_filtered ("%08x %s %s\n", p->bit, + (psw & p->bit) ? "yes" : "no ", p->text); + else + printf_filtered ("%08x %3d %s\n", p->bit, + (psw & p->bit) >> p->pos, p->text); + } +} + +#include "symtab.h" + +/* reg (fmt_field, inst_field) -- + the {first,second,third} operand of instruction as fmt_field = [ijk] + gets the value of the field from the [ijk] position of the instruction */ + +#define reg(a,b) ((char (*)[3])(op[fmt->a]))[inst.f0.b] + +/* lit (fmt_field) -- field [ijk] is a literal (PSW, VL, eg) */ + +#define lit(i) op[fmt->i] + +/* aj[j] -- name for A register j */ + +#define aj ((char (*)[3])(op[A])) + +union inst { + struct { + unsigned : 7; + unsigned i : 3; + unsigned j : 3; + unsigned k : 3; + unsigned : 16; + unsigned : 32; + } f0; + struct { + unsigned : 8; + unsigned indir : 1; + unsigned len : 1; + unsigned j : 3; + unsigned k : 3; + unsigned : 16; + unsigned : 32; + } f1; + unsigned char byte[8]; + unsigned short half[4]; + char signed_byte[8]; + short signed_half[4]; +}; + +struct opform { + int mask; /* opcode mask */ + int shift; /* opcode align */ + struct formstr *formstr[3]; /* ST, E0, E1 */ +}; + +struct formstr { + unsigned lop:8, rop:5; /* opcode */ + unsigned fmt:5; /* inst format */ + unsigned i:5, j:5, k:2; /* operand formats */ +}; + +#include "opcode/convex.h" + +CONST unsigned char formdecode [] = { + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 4,4,4,4,4,4,4,4,5,5,5,5,6,6,7,8, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +CONST struct opform opdecode[] = { + 0x7e00, 9, format0, e0_format0, e1_format0, + 0x3f00, 8, format1, e0_format1, e1_format1, + 0x1fc0, 6, format2, e0_format2, e1_format2, + 0x0fc0, 6, format3, e0_format3, e1_format3, + 0x0700, 8, format4, e0_format4, e1_format4, + 0x03c0, 6, format5, e0_format5, e1_format5, + 0x01f8, 3, format6, e0_format6, e1_format6, + 0x00f8, 3, format7, e0_format7, e1_format7, + 0x0000, 0, formatx, formatx, formatx, + 0x0f80, 7, formatx, formatx, formatx, + 0x0f80, 7, formatx, formatx, formatx, +}; + +/* Print the instruction at address MEMADDR in debugged memory, + on STREAM. Returns length of the instruction, in bytes. */ + +int +convex_print_insn (memaddr, stream) + CORE_ADDR memaddr; + FILE *stream; +{ + union inst inst; + struct formstr *fmt; + register int format, op1, pfx; + int l; + + read_memory (memaddr, &inst, sizeof inst); + + /* Remove and note prefix, if present */ + + pfx = inst.half[0]; + if ((pfx & 0xfff0) == 0x7ef0) + { + pfx = ((pfx >> 3) & 1) + 1; + *(long long *) &inst = *(long long *) &inst.half[1]; + } + else pfx = 0; + + /* Split opcode into format.op1 and look up in appropriate table */ + + format = formdecode[inst.byte[0]]; + op1 = (inst.half[0] & opdecode[format].mask) >> opdecode[format].shift; + if (format == 9) + { + if (pfx) + fmt = formatx; + else if (inst.f1.j == 0) + fmt = &format1a[op1]; + else if (inst.f1.j == 1) + fmt = &format1b[op1]; + else + fmt = formatx; + } + else + fmt = &opdecode[format].formstr[pfx][op1]; + + /* Print it */ + + if (fmt->fmt == xxx) + { + /* noninstruction */ + fprintf (stream, "0x%04x", pfx ? pfx : inst.half[0]); + return 2; + } + + if (pfx) + pfx = 2; + + fprintf (stream, "%s%s%s", lop[fmt->lop], rop[fmt->rop], + &" "[strlen(lop[fmt->lop]) + strlen(rop[fmt->rop])]); + + switch (fmt->fmt) + { + case rrr: /* three register */ + fprintf (stream, "%s,%s,%s", reg(i,i), reg(j,j), reg(k,k)); + return pfx + 2; + + case rr: /* two register */ + fprintf (stream, "%s,%s", reg(i,j), reg(j,k)); + return pfx + 2; + + case rxr: /* two register, reversed i and j fields */ + fprintf (stream, "%s,%s", reg(i,k), reg(j,j)); + return pfx + 2; + + case r: /* one register */ + fprintf (stream, "%s", reg(i,k)); + return pfx + 2; + + case nops: /* no operands */ + return pfx + 2; + + case nr: /* short immediate, one register */ + fprintf (stream, "#%d,%s", inst.f0.j, reg(i,k)); + return pfx + 2; + + case pcrel: /* pc relative */ + print_address (memaddr + 2 * inst.signed_byte[1], stream); + return pfx + 2; + + case lr: /* literal, one register */ + fprintf (stream, "%s,%s", lit(i), reg(j,k)); + return pfx + 2; + + case rxl: /* one register, literal */ + fprintf (stream, "%s,%s", reg(i,k), lit(j)); + return pfx + 2; + + case rlr: /* register, literal, register */ + fprintf (stream, "%s,%s,%s", reg(i,j), lit(j), reg(k,k)); + return pfx + 2; + + case rrl: /* register, register, literal */ + fprintf (stream, "%s,%s,%s", reg(i,j), reg(j,k), lit(k)); + return pfx + 2; + + case iml: /* immediate, literal */ + if (inst.f1.len) + { + fprintf (stream, "#%#x,%s", + (inst.signed_half[1] << 16) + inst.half[2], lit(i)); + return pfx + 6; + } + else + { + fprintf (stream, "#%d,%s", inst.signed_half[1], lit(i)); + return pfx + 4; + } + + case imr: /* immediate, register */ + if (inst.f1.len) + { + fprintf (stream, "#%#x,%s", + (inst.signed_half[1] << 16) + inst.half[2], reg(i,k)); + return pfx + 6; + } + else + { + fprintf (stream, "#%d,%s", inst.signed_half[1], reg(i,k)); + return pfx + 4; + } + + case a1r: /* memory, register */ + l = print_effa (inst, stream); + fprintf (stream, ",%s", reg(i,k)); + return pfx + l; + + case a1l: /* memory, literal */ + l = print_effa (inst, stream); + fprintf (stream, ",%s", lit(i)); + return pfx + l; + + case a2r: /* register, memory */ + fprintf (stream, "%s,", reg(i,k)); + return pfx + print_effa (inst, stream); + + case a2l: /* literal, memory */ + fprintf (stream, "%s,", lit(i)); + return pfx + print_effa (inst, stream); + + case a3: /* memory */ + return pfx + print_effa (inst, stream); + + case a4: /* system call */ + l = 29; goto a4a5; + case a5: /* trap */ + l = 27; + a4a5: + if (inst.f1.len) + { + unsigned int m = (inst.signed_half[1] << 16) + inst.half[2]; + fprintf (stream, "#%d,#%d", m >> l, m & (-1 >> (32-l))); + return pfx + 6; + } + else + { + unsigned int m = inst.signed_half[1]; + fprintf (stream, "#%d,#%d", m >> l, m & (-1 >> (32-l))); + return pfx + 4; + } + } +} + + +/* print effective address @nnn(aj), return instruction length */ + +int print_effa (inst, stream) + union inst inst; + FILE *stream; +{ + int n, l; + + if (inst.f1.len) + { + n = (inst.signed_half[1] << 16) + inst.half[2]; + l = 6; + } + else + { + n = inst.signed_half[1]; + l = 4; + } + + if (inst.f1.indir) + printf ("@"); + + if (!inst.f1.j) + { + print_address (n, stream); + return l; + } + + fprintf (stream, (n & 0xf0000000) == 0x80000000 ? "%#x(%s)" : "%d(%s)", + n, aj[inst.f1.j]); + + return l; +} + + +void +_initialize_convex_dep () +{ + add_com ("alias", class_support, alias_command, + "Add a new name for an existing command."); + + add_cmd ("base", class_vars, set_base_command, + "Change the integer output radix to 8, 10 or 16\n\ +or use just `set base' with no args to return to the ad-hoc default,\n\ +which is 16 for integers that look like addresses, 10 otherwise.", + &setlist); + + add_cmd ("pipeline", class_run, set_pipelining_command, + "Enable or disable overlapped execution of instructions.\n\ +With `set pipe off', exceptions are reported with\n\ +$pc pointing at the instruction after the faulting one.\n\ +The default is `set pipe on', which runs faster.", + &setlist); + + add_cmd ("parallel", class_run, set_parallel_command, + "Enable or disable multi-threaded execution of parallel code.\n\ +`set parallel off' means run the program on a single CPU.\n\ +`set parallel fixed' means run the program with all CPUs assigned to it.\n\ +`set parallel on' means run the program on any CPUs that are available.", + &setlist); + + add_com ("1cont", class_run, one_cont_command, + "Continue the program, activating only the current thread.\n\ +Args are the same as the `cont' command."); + + add_com ("thread", class_run, set_thread_command, + "Change the current thread, the one under scrutiny and control.\n\ +With no arg, show the active threads, the current one marked with *."); + + add_info ("threads", thread_info, + "List status of active threads."); + + add_info ("comm-registers", comm_registers_info, + "List communication registers and their contents.\n\ +A communication register name as argument means describe only that register.\n\ +An address as argument means describe the resource structure at that address.\n\ +`Locked' means that the register has been sent to but not yet received from."); + + add_info ("psw", psw_info, + "Display $ps, the processor status word, bit by bit.\n\ +An argument means display that value's interpretation as a psw."); + + add_cmd ("convex", no_class, 0, "Convex-specific commands.\n\ +32-bit registers $pc $ps $sp $ap $fp $a1-5 $s0-7 $v0-7 $vl $vs $vm $c0-63\n\ +64-bit registers $S0-7 $V0-7 $C0-63\n\ +\n\ +info threads display info on stopped threads waiting to signal\n\ +thread display list of active threads\n\ +thread N select thread N (its registers, stack, memory, etc.)\n\ +step, next, etc step selected thread only\n\ +1cont continue selected thread only\n\ +cont continue all threads\n\ +info comm-registers display contents of comm register(s) or a resource struct\n\ +info psw display processor status word $ps\n\ +set base N change integer radix used by `print' without a format\n\ +set pipeline off exceptions are precise, $pc points after the faulting insn\n\ +set pipeline on normal mode, $pc is somewhere ahead of faulting insn\n\ +set parallel off program runs on a single CPU\n\ +set parallel fixed all CPUs are assigned to the program\n\ +set parallel on normal mode, parallel execution on random available CPUs\n\ +", + &cmdlist); + +} diff --git a/contrib/gdb/gdb/convex-xdep.c b/contrib/gdb/gdb/convex-xdep.c new file mode 100644 index 0000000000000..9a3d99552ede7 --- /dev/null +++ b/contrib/gdb/gdb/convex-xdep.c @@ -0,0 +1,966 @@ +/* Convex host-dependent code for GDB. + Copyright 1990, 1991, 1992 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "command.h" +#include "symtab.h" +#include "value.h" +#include "frame.h" +#include "inferior.h" +#include "wait.h" + +#include <signal.h> +#include <fcntl.h> +#include "gdbcore.h" + +#include <sys/param.h> +#include <sys/dir.h> +#include <sys/user.h> +#include <sys/ioctl.h> +#include <sys/pcntl.h> +#include <sys/thread.h> +#include <sys/proc.h> +#include <sys/file.h> +#include "gdb_stat.h" +#include <sys/mman.h> + +#include <convex/vmparam.h> +#include <convex/filehdr.h> +#include <convex/opthdr.h> +#include <convex/scnhdr.h> +#include <convex/core.h> + +/* Per-thread data, read from the inferior at each stop and written + back at each resume. */ + +/* Number of active threads. + Tables are valid for thread numbers less than this. */ + +static int n_threads; + +#define MAXTHREADS 8 + +/* Thread state. The remaining data is valid only if this is PI_TALIVE. */ + +static int thread_state[MAXTHREADS]; + +/* Stop pc, signal, signal subcode */ + +static int thread_pc[MAXTHREADS]; +static int thread_signal[MAXTHREADS]; +static int thread_sigcode[MAXTHREADS]; + +/* Thread registers. + If thread is selected, the regs are in registers[] instead. */ + +static char thread_regs[MAXTHREADS][REGISTER_BYTES]; + +/* 1 if the top frame on the thread's stack was a context frame, + meaning that the kernel is up to something and we should not + touch the thread at all except to resume it. */ + +static char thread_is_in_kernel[MAXTHREADS]; + +/* The currently selected thread's number. */ + +static int inferior_thread; + +/* Inferior process's file handle and a process control block + to feed args to ioctl with. */ + +static int inferior_fd; +static struct pcntl ps; + +/* SOFF file headers for exec or core file. */ + +static FILEHDR filehdr; +static OPTHDR opthdr; +static SCNHDR scnhdr; + +/* Address maps constructed from section headers of exec and core files. + Defines process address -> file address translation. */ + +struct pmap +{ + long mem_addr; /* process start address */ + long mem_end; /* process end+1 address */ + long file_addr; /* file start address */ + long thread; /* -1 shared; 0,1,... thread-local */ + long type; /* S_TEXT S_DATA S_BSS S_TBSS etc */ + long which; /* used to sort map for info files */ +}; + +static int n_exec, n_core; +static struct pmap exec_map[100]; +static struct pmap core_map[100]; + +/* Offsets in the core file of core_context and core_tcontext blocks. */ + +static int context_offset; +static int tcontext_offset[MAXTHREADS]; + +/* Core file control blocks. */ + +static struct core_context_v70 c; +static struct core_tcontext_v70 tc; +static struct user u; +static thread_t th; +static proc_t pr; + +/* The registers of the currently selected thread. */ + +extern char registers[REGISTER_BYTES]; + +/* Vector and communication registers from core dump or from inferior. + These are read on demand, ie, not normally valid. */ + +static struct vecst vector_registers; +static struct creg_ctx comm_registers; + +/* Flag, set on a vanilla CONT command and cleared when the inferior + is continued. */ + +static int all_continue; + +/* Flag, set when the inferior is continued by a vanilla CONT command, + cleared if it is continued for any other purpose. */ + +static int thread_switch_ok; + +/* Stack of signals recieved from threads but not yet delivered to gdb. */ + +struct threadpid +{ + int pid; + int thread; + int signo; + int subsig; + int pc; +}; + +static struct threadpid signal_stack_bot[100]; +static struct threadpid *signal_stack = signal_stack_bot; + +/* How to detect empty stack -- bottom frame is all zero. */ + +#define signal_stack_is_empty() (signal_stack->pid == 0) + +/* Mode controlled by SET PIPE command, controls the psw SEQ bit + which forces each instruction to complete before the next one starts. */ + +static int sequential = 0; + +/* Mode controlled by the SET PARALLEL command. Values are: + 0 concurrency limit 1 thread, dynamic scheduling + 1 no concurrency limit, dynamic scheduling + 2 no concurrency limit, fixed scheduling */ + +static int parallel = 1; + +/* Mode controlled by SET BASE command, output radix for unformatted + integer typeout, as in argument lists, aggregates, and so on. + Zero means guess whether it's an address (hex) or not (decimal). */ + +static int output_radix = 0; + +/* Signal subcode at last thread stop. */ + +static int stop_sigcode; + +/* Hack, see wait() below. */ + +static int exec_trap_timer; + +#include "gdbcmd.h" + +static struct type *vector_type (); +static long *read_vector_register (); +static long *read_vector_register_1 (); +static void write_vector_register (); +static unsigned LONGEST read_comm_register (); +static void write_comm_register (); +static void convex_cont_command (); +static void thread_continue (); +static void select_thread (); +static void scan_stack (); +static void set_fixed_scheduling (); +static char *subsig_name (); +static void psw_info (); +static sig_noop (); +static ptr_cmp (); + + +/* Execute ptrace. Convex V7 replaced ptrace with pattach. + Allow ptrace (0) as a no-op. */ + +int +call_ptrace (request, pid, procaddr, buf) + int request, pid; + PTRACE_ARG3_TYPE procaddr; + int buf; +{ + if (request == 0) + return; + error ("no ptrace"); +} + +/* Replacement for system execle routine. + Convert it to an equivalent exect, which pattach insists on. */ + +execle (name, argv) + char *name, *argv; +{ + char ***envp = (char ***) &argv; + while (*envp++) ; + + signal (SIGTRAP, sig_noop); + exect (name, &argv, *envp); +} + +/* Stupid handler for stupid trace trap that otherwise causes + startup to stupidly hang. */ + +static sig_noop () +{} + +/* Read registers from inferior into registers[] array. + For convex, they are already there, read in when the inferior stops. */ + +void +fetch_inferior_registers (regno) + int regno; +{ +} + +/* Store our register values back into the inferior. + For Convex, do this only once, right before resuming inferior. */ + +void +store_inferior_registers (regno) + int regno; +{ +} + +/* Copy LEN bytes from inferior's memory starting at MEMADDR + to debugger memory starting at MYADDR. + On failure (cannot read from inferior, usually because address is out + of bounds) returns the value of errno. */ + +int +read_inferior_memory (memaddr, myaddr, len) + CORE_ADDR memaddr; + char *myaddr; + int len; +{ + errno = 0; + while (len > 0) + { + /* little-known undocumented max request size */ + int i = (len < 12288) ? len : 12288; + + lseek (inferior_fd, memaddr, 0); + read (inferior_fd, myaddr, i); + + memaddr += i; + myaddr += i; + len -= i; + } + if (errno) + memset (myaddr, '\0', len); + return errno; +} + +/* Copy LEN bytes of data from debugger memory at MYADDR + to inferior's memory at MEMADDR. + Returns errno on failure (cannot write the inferior) */ + +int +write_inferior_memory (memaddr, myaddr, len) + CORE_ADDR memaddr; + char *myaddr; + int len; +{ + errno = 0; + lseek (inferior_fd, memaddr, 0); + write (inferior_fd, myaddr, len); + return errno; +} + +/* Here from create_inferior when the inferior process has been created + and started up. We must do a pattach to grab it for debugging. + + Also, intercept the CONT command by altering its dispatch address. */ +/* FIXME: This used to be called from a macro CREATE_INFERIOR_HOOK. + But now init_trace_fun is in the same place. So re-write this to + use the init_trace_fun (making convex a debugging target). */ + +create_inferior_hook (pid) + int pid; +{ + static char cont[] = "cont"; + static char cont1[] = "c"; + char *linep = cont; + char *linep1 = cont1; + char **line = &linep; + char **line1 = &linep1; + struct cmd_list_element *c; + + c = lookup_cmd (line, cmdlist, "", 0); + c->function = convex_cont_command; + c = lookup_cmd (line1, cmdlist, "", 0); + c->function = convex_cont_command; + + inferior_fd = pattach (pid, O_EXCL); + if (inferior_fd < 0) + perror_with_name ("pattach"); + inferior_thread = 0; + set_fixed_scheduling (pid, parallel == 2); +} + +/* Attach process PID for debugging. */ + +attach (pid) + int pid; +{ + int fd = pattach (pid, O_EXCL); + if (fd < 0) + perror_with_name ("pattach"); + attach_flag = 1; + /* wait for strange kernel reverberations to go away */ + sleep (1); + + setpgrp (pid, pid); + + inferior_fd = fd; + inferior_thread = 0; + return pid; +} + +/* Stop debugging the process whose number is PID + and continue it with signal number SIGNAL. + SIGNAL = 0 means just continue it. */ + +void +detach (signal) + int signal; +{ + signal_stack = signal_stack_bot; + thread_continue (-1, 0, signal); + ioctl (inferior_fd, PIXDETACH, &ps); + close (inferior_fd); + inferior_fd = 0; + attach_flag = 0; +} + +/* Kill off the inferior process. */ + +kill_inferior () +{ + if (inferior_pid == 0) + return; + ioctl (inferior_fd, PIXTERMINATE, 0); + wait (0); + target_mourn_inferior (); +} + +/* Read vector register REG, and return a pointer to the value. */ + +static long * +read_vector_register (reg) + int reg; +{ + if (have_inferior_p ()) + { + errno = 0; + ps.pi_buffer = (char *) &vector_registers; + ps.pi_nbytes = sizeof vector_registers; + ps.pi_offset = 0; + ps.pi_thread = inferior_thread; + ioctl (inferior_fd, PIXRDVREGS, &ps); + if (errno) + memset (&vector_registers, '\0', sizeof vector_registers); + } + else if (corechan >= 0) + { + lseek (corechan, tcontext_offset[inferior_thread], 0); + if (myread (corechan, &tc, sizeof tc) < 0) + perror_with_name (corefile); + lseek (corechan, tc.core_thread_p, 0); + if (myread (corechan, &th, sizeof th) < 0) + perror_with_name (corefile); + lseek (corechan, tc.core_vregs_p, 0); + if (myread (corechan, &vector_registers, 16*128) < 0) + perror_with_name (corefile); + vector_registers.vm[0] = th.t_vect_ctx.vc_vm[0]; + vector_registers.vm[1] = th.t_vect_ctx.vc_vm[1]; + vector_registers.vls = th.t_vect_ctx.vc_vls; + } + + return read_vector_register_1 (reg); +} + +/* Return a pointer to vector register REG, which must already have been + fetched from the inferior or core file. */ + +static long * +read_vector_register_1 (reg) + int reg; +{ + switch (reg) + { + case VM_REGNUM: + return (long *) vector_registers.vm; + case VS_REGNUM: + return (long *) &vector_registers.vls; + case VL_REGNUM: + return 1 + (long *) &vector_registers.vls; + default: + return (long *) &vector_registers.vr[reg]; + } +} + +/* Write vector register REG, element ELEMENT, new value VAL. + NB: must use read-modify-write on the entire vector state, + since pattach does not do offsetted writes correctly. */ + +static void +write_vector_register (reg, element, val) + int reg, element; + unsigned LONGEST val; +{ + if (have_inferior_p ()) + { + errno = 0; + ps.pi_thread = inferior_thread; + ps.pi_offset = 0; + ps.pi_buffer = (char *) &vector_registers; + ps.pi_nbytes = sizeof vector_registers; + + ioctl (inferior_fd, PIXRDVREGS, &ps); + + switch (reg) + { + case VL_REGNUM: + vector_registers.vls = + (vector_registers.vls & 0xffffffff00000000LL) + + (unsigned long) val; + break; + + case VS_REGNUM: + vector_registers.vls = + (val << 32) + (unsigned long) vector_registers.vls; + break; + + default: + vector_registers.vr[reg].el[element] = val; + break; + } + + ioctl (inferior_fd, PIXWRVREGS, &ps); + + if (errno) + perror_with_name ("writing vector register"); + } +} + +/* Return the contents of communication register NUM. */ + +static unsigned LONGEST +read_comm_register (num) + int num; +{ + if (have_inferior_p ()) + { + ps.pi_buffer = (char *) &comm_registers; + ps.pi_nbytes = sizeof comm_registers; + ps.pi_offset = 0; + ps.pi_thread = inferior_thread; + ioctl (inferior_fd, PIXRDCREGS, &ps); + } + return comm_registers.crreg.r4[num]; +} + +/* Store a new value VAL into communication register NUM. + NB: Must use read-modify-write on the whole comm register set + since pattach does not do offsetted writes correctly. */ + +static void +write_comm_register (num, val) + int num; + unsigned LONGEST val; +{ + if (have_inferior_p ()) + { + ps.pi_buffer = (char *) &comm_registers; + ps.pi_nbytes = sizeof comm_registers; + ps.pi_offset = 0; + ps.pi_thread = inferior_thread; + ioctl (inferior_fd, PIXRDCREGS, &ps); + comm_registers.crreg.r4[num] = val; + ioctl (inferior_fd, PIXWRCREGS, &ps); + } +} + +/* Resume execution of the inferior process. + If STEP is nonzero, single-step it. + If SIGNAL is nonzero, give it that signal. */ + +void +resume (step, signal) + int step; + int signal; +{ + errno = 0; + if (step || signal) + thread_continue (inferior_thread, step, signal); + else + thread_continue (-1, 0, 0); +} + +/* Maybe resume some threads. + THREAD is which thread to resume, or -1 to resume them all. + STEP and SIGNAL are as in resume. + + Global variable ALL_CONTINUE is set when we are here to do a + `cont' command; otherwise we may be doing `finish' or a call or + something else that will not tolerate an automatic thread switch. + + If there are stopped threads waiting to deliver signals, and + ALL_CONTINUE, do not actually resume anything. gdb will do a wait + and see one of the stopped threads in the queue. */ + +static void +thread_continue (thread, step, signal) + int thread, step, signal; +{ + int n; + + /* If we are to continue all threads, but not for the CONTINUE command, + pay no attention and continue only the selected thread. */ + + if (thread < 0 && ! all_continue) + thread = inferior_thread; + + /* If we are not stepping, we have now executed the continue part + of a CONTINUE command. */ + + if (! step) + all_continue = 0; + + /* Allow wait() to switch threads if this is an all-out continue. */ + + thread_switch_ok = thread < 0; + + /* If there are threads queued up, don't resume. */ + + if (thread_switch_ok && ! signal_stack_is_empty ()) + return; + + /* OK, do it. */ + + for (n = 0; n < n_threads; n++) + if (thread_state[n] == PI_TALIVE) + { + select_thread (n); + + if ((thread < 0 || n == thread) && ! thread_is_in_kernel[n]) + { + /* Blam the trace bits in the stack's saved psws to match + the desired step mode. This is required so that + single-stepping a return doesn't restore a psw with a + clear trace bit and fly away, and conversely, + proceeding through a return in a routine that was + stepped into doesn't cause a phantom break by restoring + a psw with the trace bit set. */ + scan_stack (PSW_T_BIT, step); + scan_stack (PSW_S_BIT, sequential); + } + + ps.pi_buffer = registers; + ps.pi_nbytes = REGISTER_BYTES; + ps.pi_offset = 0; + ps.pi_thread = n; + if (! thread_is_in_kernel[n]) + if (ioctl (inferior_fd, PIXWRREGS, &ps)) + perror_with_name ("PIXWRREGS"); + + if (thread < 0 || n == thread) + { + ps.pi_pc = 1; + ps.pi_signo = signal; + if (ioctl (inferior_fd, step ? PIXSTEP : PIXCONTINUE, &ps) < 0) + perror_with_name ("PIXCONTINUE"); + } + } + + if (ioctl (inferior_fd, PIXRUN, &ps) < 0) + perror_with_name ("PIXRUN"); +} + +/* Replacement for system wait routine. + + The system wait returns with one or more threads stopped by + signals. Put stopped threads on a stack and return them one by + one, so that it appears that wait returns one thread at a time. + + Global variable THREAD_SWITCH_OK is set when gdb can tolerate wait + returning a new thread. If it is false, then only one thread is + running; we will do a real wait, the thread will do something, and + we will return that. */ + +pid_t +wait (w) + union wait *w; +{ + int pid; + + if (!w) + return wait3 (0, 0, 0); + + /* Do a real wait if we were told to, or if there are no queued threads. */ + + if (! thread_switch_ok || signal_stack_is_empty ()) + { + int thread; + + pid = wait3 (w, 0, 0); + + if (!WIFSTOPPED (*w) || pid != inferior_pid) + return pid; + + /* The inferior has done something and stopped. Read in all the + threads' registers, and queue up any signals that happened. */ + + if (ioctl (inferior_fd, PIXGETTHCOUNT, &ps) < 0) + perror_with_name ("PIXGETTHCOUNT"); + + n_threads = ps.pi_othdcnt; + for (thread = 0; thread < n_threads; thread++) + { + ps.pi_thread = thread; + if (ioctl (inferior_fd, PIXGETSUBCODE, &ps) < 0) + perror_with_name ("PIXGETSUBCODE"); + thread_state[thread] = ps.pi_otstate; + + if (ps.pi_otstate == PI_TALIVE) + { + select_thread (thread); + ps.pi_buffer = registers; + ps.pi_nbytes = REGISTER_BYTES; + ps.pi_offset = 0; + ps.pi_thread = thread; + if (ioctl (inferior_fd, PIXRDREGS, &ps) < 0) + perror_with_name ("PIXRDREGS"); + + registers_fetched (); + + thread_pc[thread] = read_pc (); + thread_signal[thread] = ps.pi_osigno; + thread_sigcode[thread] = ps.pi_osigcode; + + /* If the thread's stack has a context frame + on top, something fucked is going on. I do not + know what, but do I know this: the only thing you + can do with such a thread is continue it. */ + + thread_is_in_kernel[thread] = + ((read_register (PS_REGNUM) >> 25) & 3) == 0; + + /* Signals push an extended frame and then fault + with a ridiculous pc. Pop the frame. */ + + if (thread_pc[thread] > STACK_END_ADDR) + { + POP_FRAME; + if (is_break_pc (thread_pc[thread])) + thread_pc[thread] = read_pc () - 2; + else + thread_pc[thread] = read_pc (); + write_register (PC_REGNUM, thread_pc[thread]); + } + + if (ps.pi_osigno || ps.pi_osigcode) + { + signal_stack++; + signal_stack->pid = pid; + signal_stack->thread = thread; + signal_stack->signo = thread_signal[thread]; + signal_stack->subsig = thread_sigcode[thread]; + signal_stack->pc = thread_pc[thread]; + } + + /* The following hackery is caused by a unix 7.1 feature: + the inferior's fixed scheduling mode is cleared when + it execs the shell (since the shell is not a parallel + program). So, note the 5.4 trap we get when + the shell does its exec, then catch the 5.0 trap + that occurs when the debuggee starts, and set fixed + scheduling mode properly. */ + + if (ps.pi_osigno == 5 && ps.pi_osigcode == 4) + exec_trap_timer = 1; + else + exec_trap_timer--; + + if (ps.pi_osigno == 5 && exec_trap_timer == 0) + set_fixed_scheduling (pid, parallel == 2); + } + } + + if (signal_stack_is_empty ()) + error ("no active threads?!"); + } + + /* Select the thread that stopped, and return *w saying why. */ + + select_thread (signal_stack->thread); + + FIXME: need to convert from host sig. + stop_signal = signal_stack->signo; + stop_sigcode = signal_stack->subsig; + + WSETSTOP (*w, signal_stack->signo); + w->w_thread = signal_stack->thread; + return (signal_stack--)->pid; +} + +/* Select thread THREAD -- its registers, stack, per-thread memory. + This is the only routine that may assign to inferior_thread + or thread_regs[]. */ + +static void +select_thread (thread) + int thread; +{ + if (thread == inferior_thread) + return; + + memcpy (thread_regs[inferior_thread], registers, REGISTER_BYTES); + ps.pi_thread = inferior_thread = thread; + if (have_inferior_p ()) + ioctl (inferior_fd, PISETRWTID, &ps); + memcpy (registers, thread_regs[thread], REGISTER_BYTES); +} + +/* Routine to set or clear a psw bit in the psw and also all psws + saved on the stack. Quits when we get to a frame in which the + saved psw is correct. */ + +static void +scan_stack (bit, val) + long bit, val; +{ + long ps = read_register (PS_REGNUM); + long fp; + if (val ? !(ps & bit) : (ps & bit)) + { + ps ^= bit; + write_register (PS_REGNUM, ps); + + fp = read_register (FP_REGNUM); + while (fp & 0x80000000) + { + ps = read_memory_integer (fp + 4, 4); + if (val ? (ps & bit) : !(ps & bit)) + break; + ps ^= bit; + write_memory (fp + 4, &ps, 4); + fp = read_memory_integer (fp + 8, 4); + } + } +} + +/* Set fixed scheduling (alliant mode) of process PID to ARG (0 or 1). */ + +static void +set_fixed_scheduling (pid, arg) + int arg; +{ + struct pattributes pattr; + getpattr (pid, &pattr); + pattr.pattr_pfixed = arg; + setpattr (pid, &pattr); +} + +void +core_file_command (filename, from_tty) + char *filename; + int from_tty; +{ + int n; + + /* Discard all vestiges of any previous core file + and mark data and stack spaces as empty. */ + + if (corefile) + free (corefile); + corefile = 0; + + if (corechan >= 0) + close (corechan); + corechan = -1; + + data_start = 0; + data_end = 0; + stack_start = STACK_END_ADDR; + stack_end = STACK_END_ADDR; + n_core = 0; + + /* Now, if a new core file was specified, open it and digest it. */ + + if (filename) + { + filename = tilde_expand (filename); + make_cleanup (free, filename); + + if (have_inferior_p ()) + error ("To look at a core file, you must kill the program with \"kill\"."); + corechan = open (filename, O_RDONLY, 0); + if (corechan < 0) + perror_with_name (filename); + + if (myread (corechan, &filehdr, sizeof filehdr) < 0) + perror_with_name (filename); + + if (!IS_CORE_SOFF_MAGIC (filehdr.h_magic)) + error ("%s: not a core file.\n", filename); + + if (myread (corechan, &opthdr, filehdr.h_opthdr) < 0) + perror_with_name (filename); + + /* Read through the section headers. + For text, data, etc, record an entry in the core file map. + For context and tcontext, record the file address of + the context blocks. */ + + lseek (corechan, (long) filehdr.h_scnptr, 0); + + n_threads = 0; + for (n = 0; n < filehdr.h_nscns; n++) + { + if (myread (corechan, &scnhdr, sizeof scnhdr) < 0) + perror_with_name (filename); + if ((scnhdr.s_flags & S_TYPMASK) >= S_TEXT + && (scnhdr.s_flags & S_TYPMASK) <= S_COMON) + { + core_map[n_core].mem_addr = scnhdr.s_vaddr; + core_map[n_core].mem_end = scnhdr.s_vaddr + scnhdr.s_size; + core_map[n_core].file_addr = scnhdr.s_scnptr; + core_map[n_core].type = scnhdr.s_flags & S_TYPMASK; + if (core_map[n_core].type != S_TBSS + && core_map[n_core].type != S_TDATA + && core_map[n_core].type != S_TTEXT) + core_map[n_core].thread = -1; + else if (n_core == 0 + || core_map[n_core-1].mem_addr != scnhdr.s_vaddr) + core_map[n_core].thread = 0; + else + core_map[n_core].thread = core_map[n_core-1].thread + 1; + n_core++; + } + else if ((scnhdr.s_flags & S_TYPMASK) == S_CONTEXT) + context_offset = scnhdr.s_scnptr; + else if ((scnhdr.s_flags & S_TYPMASK) == S_TCONTEXT) + tcontext_offset[n_threads++] = scnhdr.s_scnptr; + } + + /* Read the context block, struct user, struct proc, + and the comm regs. */ + + lseek (corechan, context_offset, 0); + if (myread (corechan, &c, sizeof c) < 0) + perror_with_name (filename); + lseek (corechan, c.core_user_p, 0); + if (myread (corechan, &u, sizeof u) < 0) + perror_with_name (filename); + lseek (corechan, c.core_proc_p, 0); + if (myread (corechan, &pr, sizeof pr) < 0) + perror_with_name (filename); + comm_registers = pr.p_creg; + + /* Core file apparently is really there. Make it really exist + for xfer_core_file so we can do read_memory on it. */ + + if (filename[0] == '/') + corefile = savestring (filename, strlen (filename)); + else + corefile = concat (current_directory, "/", filename, NULL); + + printf_filtered ("Program %s ", u.u_comm); + + /* Read the thread registers and fill in the thread_xxx[] data. */ + + for (n = 0; n < n_threads; n++) + { + select_thread (n); + + lseek (corechan, tcontext_offset[n], 0); + if (myread (corechan, &tc, sizeof tc) < 0) + perror_with_name (corefile); + lseek (corechan, tc.core_thread_p, 0); + if (myread (corechan, &th, sizeof th) < 0) + perror_with_name (corefile); + + lseek (corechan, tc.core_syscall_context_p, 0); + if (myread (corechan, registers, REGISTER_BYTES) < 0) + perror_with_name (corefile); + + thread_signal[n] = th.t_cursig; + thread_sigcode[n] = th.t_code; + thread_state[n] = th.t_state; + thread_pc[n] = read_pc (); + + if (thread_pc[n] > STACK_END_ADDR) + { + POP_FRAME; + if (is_break_pc (thread_pc[n])) + thread_pc[n] = read_pc () - 2; + else + thread_pc[n] = read_pc (); + write_register (PC_REGNUM, thread_pc[n]); + } + + printf_filtered ("thread %d received signal %d, %s\n", + n, thread_signal[n], + safe_strsignal (thread_signal[n])); + } + + /* Select an interesting thread -- also-rans died with SIGKILL, + so find one that didn't. */ + + for (n = 0; n < n_threads; n++) + if (thread_signal[n] != 0 && thread_signal[n] != SIGKILL) + { + select_thread (n); + stop_signal = thread_signal[n]; + stop_sigcode = thread_sigcode[n]; + break; + } + + core_aouthdr.a_magic = 0; + + flush_cached_frames (); + select_frame (get_current_frame (), 0); + validate_files (); + + print_stack_frame (selected_frame, selected_frame_level, -1); + } + else if (from_tty) + printf_filtered ("No core file now.\n"); +} diff --git a/contrib/gdb/gdb/delta68-nat.c b/contrib/gdb/gdb/delta68-nat.c new file mode 100644 index 0000000000000..5502263d9f684 --- /dev/null +++ b/contrib/gdb/gdb/delta68-nat.c @@ -0,0 +1,79 @@ +/* Functions specific to running gdb native on a Motorola Delta Series sysV68. + Copyright (C) 1993, Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include <sys/signal.h> /* for MAXSIG in sys/user.h */ +#include <sys/types.h> /* for ushort in sys/dir.h */ +#include <sys/dir.h> /* for struct direct in sys/user.h */ +#include <sys/user.h> + +#include <nlist.h> + +#if !defined (offsetof) +#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) +#endif + +/* Return the address in the core dump or inferior of register REGNO. + BLOCKEND is the address of the end of the user structure. */ + +unsigned int +register_addr (regno, blockend) + int regno; + int blockend; +{ + static int sysv68reg[] = + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, 15, 16 }; + + if (regno >= 0 && regno < sizeof(sysv68reg) / sizeof(sysv68reg[0])) + return blockend + sysv68reg[regno] * 4; + else if (regno < FPC_REGNUM) + return offsetof (struct user, u_fpu.regs.reg[regno - FP0_REGNUM][0]); + else if (regno == FPC_REGNUM) + return offsetof (struct user, u_fpu.regs.control); + else if (regno == FPS_REGNUM) + return offsetof (struct user, u_fpu.regs.status); + else if (regno == FPI_REGNUM) + return offsetof (struct user, u_fpu.regs.iaddr); + else + { + fprintf_unfiltered (gdb_stderr, "\ +Internal error: invalid register number %d in REGISTER_U_ADDR\n", + regno); + return blockend; + } +} + +CORE_ADDR kernel_u_addr; + +/* Read the value of the u area from the kernel. */ +void +_initialize_delta68_nat () +{ + struct nlist nl[2]; + + nl[0].n_name = "u"; + nl[1].n_name = NULL; + if (nlist ("/sysV68", nl) == 0 && nl[0].n_scnum != 0) + kernel_u_addr = nl[0].n_value; + else + { + perror ("Cannot get kernel u area address"); + exit (1); + } +} diff --git a/contrib/gdb/gdb/dpx2-nat.c b/contrib/gdb/gdb/dpx2-nat.c new file mode 100644 index 0000000000000..21dc13571746e --- /dev/null +++ b/contrib/gdb/gdb/dpx2-nat.c @@ -0,0 +1,83 @@ +/* DPX2 host interface. + Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "gdbcore.h" + +#include "gdb_string.h" +#include <sys/types.h> +#include <sys/param.h> +#include <sys/dir.h> +#include <signal.h> +#include <sys/user.h> +#include <sys/reg.h> +#include <sys/utsname.h> + + +/* this table must line up with REGISTER_NAMES in tm-68k.h */ +/* symbols like 'A0' come from <sys/reg.h> */ +static int regmap[] = +{ + R0, R1, R2, R3, R4, R5, R6, R7, + A0, A1, A2, A3, A4, A5, A6, SP, + PS, PC, + FP0, FP1, FP2, FP3, FP4, FP5, FP6, FP7, + FP_CR, FP_SR, FP_IAR +}; + +/* blockend is the value of u.u_ar0, and points to the + * place where D0 is stored + */ + +int +dpx2_register_u_addr (blockend, regnum) + int blockend; + int regnum; +{ + if (regnum < FP0_REGNUM) + return (blockend + 4 * regmap[regnum]); + else + return (int) &(((struct user *)0)->u_fpstate[regmap[regnum]]); +} + +/* This is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. + Unfortunately this is not provided in the system header files. + To make matters worse, this value also differs between + the dpx/2200 and dpx/2300 models and nlist is not available on the dpx2. + We use utsname() to decide on which model we are running. + FIXME: This breaks cross examination of core files (it would not be hard + to check whether u.u_ar0 is between 0x7fff5000 and 0x7fffc000 and if so + use 0x7fff5000 and if not use 0x7fffc000. FIXME). */ + +#define KERNEL_U_ADDR_200 0x7fff5000 +#define KERNEL_U_ADDR_300 0x7fffc000 + +CORE_ADDR kernel_u_addr; + +void +_initialize_dpx2_nat () +{ + struct utsname uts; + + if (uname (&uts) == 0 && strcmp (uts.machine, "DPX/2200") == 0) + kernel_u_addr = KERNEL_U_ADDR_200; + else + kernel_u_addr = KERNEL_U_ADDR_300; +} diff --git a/contrib/gdb/gdb/dsrec.c b/contrib/gdb/gdb/dsrec.c new file mode 100644 index 0000000000000..3105ba244012d --- /dev/null +++ b/contrib/gdb/gdb/dsrec.c @@ -0,0 +1,254 @@ +/* S-record download support for GDB, the GNU debugger. + Copyright 1995, 1996 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "serial.h" +#include "srec.h" + +extern int remote_debug; + +static int make_srec PARAMS ((char *srec, CORE_ADDR targ_addr, bfd *abfd, + asection *sect, int sectoff, int *maxrecsize, + int flags)); + +/* Download an executable by converting it to S records. DESC is a serial_t + to send the data to. FILE is the name of the file to be loaded. + MAXRECSIZE is the length in chars of the largest S-record the host can + accomodate. This is measured from the starting `S' to the last char of the + checksum. FLAGS is various random flags, and HASHMARK is non-zero to cause + a `#' to be printed out for each record loaded. */ + +void +load_srec (desc, file, maxrecsize, flags, hashmark) + serial_t desc; + const char *file; + int maxrecsize; + int flags; + int hashmark; +{ + bfd *abfd; + asection *s; + char *srec; + int i; + int reclen; + + srec = (char *)alloca (maxrecsize + 1); + + abfd = bfd_openr (file, 0); + if (!abfd) + { + printf_filtered ("Unable to open file %s\n", file); + return; + } + + if (bfd_check_format (abfd, bfd_object) == 0) + { + printf_filtered ("File is not an object file\n"); + return; + } + + for (s = abfd->sections; s; s = s->next) + if (s->flags & SEC_LOAD) + { + int numbytes; + + printf_filtered ("%s\t: 0x%4x .. 0x%4x ", s->name, s->vma, + s->vma + s->_raw_size); + gdb_flush (gdb_stdout); + + for (i = 0; i < s->_raw_size; i += numbytes) + { + reclen = maxrecsize; + numbytes = make_srec (srec, s->vma + i, abfd, s, i, &reclen, + flags); + + if (remote_debug) + fprintf_unfiltered (gdb_stderr, "%.*s\\r\n", reclen-1, srec); + SERIAL_WRITE (desc, srec, reclen); + + if (hashmark) + { + putchar_unfiltered ('#'); + gdb_flush (gdb_stdout); + } + } /* Per-packet (or S-record) loop */ + + putchar_unfiltered ('\n'); + } /* Loadable sections */ + + if (hashmark) + putchar_unfiltered ('\n'); + + /* Write a type 7 terminator record. no data for a type 7, and there + is no data, so len is 0. */ + + reclen = maxrecsize; + make_srec (srec, abfd->start_address, NULL, NULL, 0, &reclen, flags); + + if (remote_debug) + fprintf_unfiltered (gdb_stderr, "%.*s\\r\n", reclen-1, srec); + SERIAL_WRITE (desc, srec, reclen); + + SERIAL_WRITE (desc, "\r\r", 2); /* Some monitors need these to wake up */ + + SERIAL_FLUSH_INPUT (desc); +} + +/* + * make_srec -- make an srecord. This writes each line, one at a + * time, each with it's own header and trailer line. + * An srecord looks like this: + * + * byte count-+ address + * start ---+ | | data +- checksum + * | | | | + * S01000006F6B692D746573742E73726563E4 + * S315000448600000000000000000FC00005900000000E9 + * S31A0004000023C1400037DE00F023604000377B009020825000348D + * S30B0004485A0000000000004E + * S70500040000F6 + * + * S<type><length><address><data><checksum> + * + * Where + * - length + * is the number of bytes following upto the checksum. Note that + * this is not the number of chars following, since it takes two + * chars to represent a byte. + * - type + * is one of: + * 0) header record + * 1) two byte address data record + * 2) three byte address data record + * 3) four byte address data record + * 7) four byte address termination record + * 8) three byte address termination record + * 9) two byte address termination record + * + * - address + * is the start address of the data following, or in the case of + * a termination record, the start address of the image + * - data + * is the data. + * - checksum + * is the sum of all the raw byte data in the record, from the length + * upwards, modulo 256 and subtracted from 255. + * + * This routine returns the length of the S-record. + * + */ + +static int +make_srec (srec, targ_addr, abfd, sect, sectoff, maxrecsize, flags) + char *srec; + CORE_ADDR targ_addr; + bfd *abfd; + asection *sect; + int sectoff; + int *maxrecsize; + int flags; +{ + unsigned char checksum; + int tmp; + const static char hextab[] = "0123456789ABCDEF"; + const static char data_code_table[] = "xx123"; + const static char term_code_table[] = "xx987"; + const static char *formats[] = {NULL, NULL, "S%c%02X%04X", "S%c%02X%06X", + "S%c%02X%08X"}; + char const *code_table; + int addr_size; + int payload_size; + int type_code; + char *binbuf; + char *p; + + if (sect) + { + tmp = flags; /* Data record */ + code_table = data_code_table; + binbuf = alloca (*maxrecsize/2); + } + else + { + tmp = flags >> SREC_TERM_SHIFT; /* Term record */ + code_table = term_code_table; + } + + if (tmp & SREC_4_BYTE_ADDR && targ_addr > 0xffffff) + addr_size = 4; + else if (tmp & SREC_3_BYTE_ADDR && targ_addr > 0xffff) + addr_size = 3; + else if (tmp & SREC_2_BYTE_ADDR && targ_addr > 0xff) + addr_size = 2; + else + fatal ("make_srec: Bad address (0x%x), or bad flags (0x%x).", targ_addr, + flags); + +/* Now that we know the address size, we can figure out how much data this + record can hold. */ + + if (sect) + { + payload_size = (*maxrecsize - (1 + 1 + 2 + addr_size * 2 + 2)) / 2; + payload_size = min (payload_size, sect->_raw_size - sectoff); + + bfd_get_section_contents (abfd, sect, binbuf, sectoff, payload_size); + } + else + payload_size = 0; /* Term packets have no payload */ + +/* Output the header. */ + + sprintf (srec, formats[addr_size], code_table[addr_size], + addr_size + payload_size + 1, targ_addr); + +/* Note that the checksum is calculated on the raw data, not the hexified + data. It includes the length, address and the data portions of the + packet. */ + + checksum = 0; + + checksum += (payload_size + addr_size + 1 /* Packet length */ + + (targ_addr & 0xff) /* Address... */ + + ((targ_addr >> 8) & 0xff) + + ((targ_addr >> 16) & 0xff) + + ((targ_addr >> 24) & 0xff)); + + p = srec + 1 + 1 + 2 + addr_size * 2; + + /* build the srecord */ + for (tmp = 0; tmp < payload_size; tmp++) + { + unsigned char k; + + k = binbuf[tmp]; + *p++ = hextab [k >> 4]; + *p++ = hextab [k & 0xf]; + checksum += k; + } + + checksum = ~checksum; + + *p++ = hextab[checksum >> 4]; + *p++ = hextab[checksum & 0xf]; + *p++ = '\r'; + + *maxrecsize = p - srec; + return payload_size; +} diff --git a/contrib/gdb/gdb/dst.h b/contrib/gdb/gdb/dst.h new file mode 100644 index 0000000000000..252a3a86b8b10 --- /dev/null +++ b/contrib/gdb/gdb/dst.h @@ -0,0 +1,1659 @@ +/* <apollo/dst.h> */ +/* Apollo object module DST (debug symbol table) description */ + +#ifndef apollo_dst_h +#define apollo_dst_h + +#if defined(apollo) && !defined(__GNUC__) +#define ALIGNED1 __attribute( (aligned(1)) ) +#else +/* Remove attribute directives from non-Apollo code: */ +#define ALIGNED1 /* nil */ +#endif + + + +/* Identification of this version of the debug symbol table. Producers of the + debug symbol table must write these values into the version number field of + the compilation unit record in .blocks . +*/ +#define dst_version_major 1 +#define dst_version_minor 3 + + +/* +** Enumeration of debug record types appearing in .blocks and .symbols ... +*/ +typedef enum + { + dst_typ_pad, /* 0 */ + dst_typ_comp_unit, /* 1 */ + dst_typ_section_tab, /* 2 */ + dst_typ_file_tab, /* 3 */ + dst_typ_block, /* 4 */ + dst_typ_5, + dst_typ_var, + dst_typ_pointer, /* 7 */ + dst_typ_array, /* 8 */ + dst_typ_subrange, /* 9 */ + dst_typ_set, /* 10 */ + dst_typ_implicit_enum, /* 11 */ + dst_typ_explicit_enum, /* 12 */ + dst_typ_short_rec, /* 13 */ + dst_typ_old_record, + dst_typ_short_union, /* 15 */ + dst_typ_old_union, + dst_typ_file, /* 17 */ + dst_typ_offset, /* 18 */ + dst_typ_alias, /* 19 */ + dst_typ_signature, /* 20 */ + dst_typ_21, + dst_typ_old_label, /* 22 */ + dst_typ_scope, /* 23 */ + dst_typ_end_scope, /* 24 */ + dst_typ_25, + dst_typ_26, + dst_typ_string_tab, /* 27 */ + dst_typ_global_name_tab, /* 28 */ + dst_typ_forward, /* 29 */ + dst_typ_aux_size, /* 30 */ + dst_typ_aux_align, /* 31 */ + dst_typ_aux_field_size, /* 32 */ + dst_typ_aux_field_off, /* 33 */ + dst_typ_aux_field_align, /* 34 */ + dst_typ_aux_qual, /* 35 */ + dst_typ_aux_var_bound, /* 36 */ + dst_typ_extension, /* 37 */ + dst_typ_string, /* 38 */ + dst_typ_old_entry, + dst_typ_const, /* 40 */ + dst_typ_reference, /* 41 */ + dst_typ_record, /* 42 */ + dst_typ_union, /* 43 */ + dst_typ_aux_type_deriv, /* 44 */ + dst_typ_locpool, /* 45 */ + dst_typ_variable, /* 46 */ + dst_typ_label, /* 47 */ + dst_typ_entry, /* 48 */ + dst_typ_aux_lifetime, /* 49 */ + dst_typ_aux_ptr_base, /* 50 */ + dst_typ_aux_src_range, /* 51 */ + dst_typ_aux_reg_val, /* 52 */ + dst_typ_aux_unit_names, /* 53 */ + dst_typ_aux_sect_info, /* 54 */ + dst_typ_END_OF_ENUM + } + dst_rec_type_t; + + +/* +** Dummy bounds for variably dimensioned arrays: +*/ +#define dst_dummy_array_size 100 + + +/* +** Reference to another item in the symbol table. +** +** The value of a dst_rel_offset_t is the relative offset from the start of the +** referencing record to the start of the referenced record, string, etc. +** +** The value of a NIL dst_rel_offset_t is zero. +*/ + +typedef long dst_rel_offset_t ALIGNED1; + + +/* FIXME: Here and many places we make assumptions about sizes of host + data types, structure layout, etc. Only needs to be fixed if we care + about cross-debugging, though. */ + +/* +** Section-relative reference. +** +** The section index field is an index into the local compilation unit's +** section table (see dst_rec_section_tab_t)--NOT into the object module +** section table! +** +** The sect_offset field is the offset in bytes into the section. +** +** A NIL dst_sect_ref_t has a sect_index field of zero. Indexes originate +** at one. +*/ + +typedef struct + { + unsigned short sect_index; + unsigned long sect_offset ALIGNED1; + } + dst_sect_ref_t; + +#define dst_sect_index_nil 0 +#define dst_sect_index_origin 1 + + +/* +** Source location descriptor. +** +** The file_index field is an index into the local compilation unit's +** file table (see dst_rec_file_tab_t). +** +** A NIL dst_src_loc_t has a file_index field of zero. Indexes originate +** at one. +*/ + +typedef struct + { + boolean reserved : 1; /* reserved for future use */ + int file_index : 11; /* index into .blocks source file list */ + int line_number : 20; /* source line number */ + } + dst_src_loc_t; + +#define dst_file_index_nil 0 +#define dst_file_index_origin 1 + + +/* +** Standard (primitive) type codes. +*/ + +typedef enum + { + dst_non_std_type, + dst_int8_type, /* 8 bit integer */ + dst_int16_type, /* 16 bit integer */ + dst_int32_type, /* 32 bit integer */ + dst_uint8_type, /* 8 bit unsigned integer */ + dst_uint16_type, /* 16 bit unsigned integer */ + dst_uint32_type, /* 32 bit unsigned integer */ + dst_real32_type, /* single precision ieee floatining point */ + dst_real64_type, /* double precision ieee floatining point */ + dst_complex_type, /* single precision complex */ + dst_dcomplex_type, /* double precision complex */ + dst_bool8_type, /* boolean =logical*1 */ + dst_bool16_type, /* boolean =logical*2 */ + dst_bool32_type, /* boolean =logical*4 */ + dst_char_type, /* 8 bit ascii character */ + dst_string_type, /* string of 8 bit ascii characters */ + dst_ptr_type, /* univ_pointer */ + dst_set_type, /* generic 256 bit set */ + dst_proc_type, /* generic procedure (signature not specified) */ + dst_func_type, /* generic function (signature not specified) */ + dst_void_type, /* c void type */ + dst_uchar_type, /* c unsigned char */ + dst_std_type_END_OF_ENUM + } + dst_std_type_t; + + +/* +** General data type descriptor +** +** If the user_defined_type bit is clear, then the type is a standard type, and +** the remaining bits contain the dst_std_type_t of the type. If the bit is +** set, then the type is defined in a separate dst record, which is referenced +** by the remaining bits as a dst_rel_offset_t. +*/ + +typedef union + { + struct + { + boolean user_defined_type : 1; /* tag field */ + int must_be_zero : 23; /* 23 bits of pad */ + dst_std_type_t dtc : 8; /* 8 bit primitive data */ + } + std_type; + + struct + { + boolean user_defined_type : 1; /* tag field */ + int doffset : 31; /* offset to type record */ + } + user_type; + } + dst_type_t ALIGNED1; + +/* The user_type.doffset field is a 31-bit signed value. Some versions of C + do not support signed bit fields. The following macro will extract that + field as a signed value: +*/ +#define dst_user_type_offset(type_rec) \ + ( ((int) ((type_rec).user_type.doffset << 1)) >> 1 ) + + +/*================================================*/ +/*========== RECORDS IN .blocks SECTION ==========*/ +/*================================================*/ + +/*----------------------- + COMPILATION UNIT record + ----------------------- + This must be the first record in each .blocks section. + Provides a set of information describing the output of a single compilation + and pointers to additional information for the compilation unit. +*/ + +typedef enum + { + dst_pc_code_locs, /* ranges in loc strings are pc ranges */ + dst_comp_unit_END_OF_ENUM + } + dst_comp_unit_flag_t; + +typedef enum + { + dst_lang_unk, /* unknown language */ + dst_lang_pas, /* Pascal */ + dst_lang_ftn, /* FORTRAN */ + dst_lang_c, /* C */ + dst_lang_mod2, /* Modula-2 */ + dst_lang_asm_m68k, /* 68K assembly language */ + dst_lang_asm_a88k, /* AT assembly language */ + dst_lang_ada, /* Ada */ + dst_lang_cxx, /* C++ */ + dst_lang_END_OF_ENUM + } + dst_lang_type_t; + +typedef struct + { + struct + { + unsigned char major_part; /* = dst_version_major */ + unsigned char minor_part; /* = dst_version_minor */ + } + version; /* version of dst */ + unsigned short flags; /* mask of dst_comp_unit_flag_t */ + unsigned short lang_type; /* source language */ + unsigned short number_of_blocks; /* number of blocks records */ + dst_rel_offset_t root_block_offset; /* offset to root block (module?) */ + dst_rel_offset_t section_table /* offset to section table record */; + dst_rel_offset_t file_table; /* offset to file table record */ + unsigned long data_size; /* total size of .blocks data */ + } + dst_rec_comp_unit_t ALIGNED1; + + +/*-------------------- + SECTION TABLE record + -------------------- + There must be one section table associated with each compilation unit. + Other debug records refer to sections via their index in this table. The + section base addresses in the table are virtual addresses of the sections, + relocated by the linker. +*/ + +typedef struct + { + unsigned short number_of_sections; /* size of array: */ + unsigned long section_base[dst_dummy_array_size] ALIGNED1; + } + dst_rec_section_tab_t ALIGNED1; + + +/*----------------- + FILE TABLE record + ----------------- + There must be one file table associated with each compilation unit describing + the source (and include) files used by each compilation unit. Other debug + records refer to files via their index in this table. The first entry is the + primary source file. +*/ + +typedef struct + { + long dtm; /* time last modified (time_$clock_t) */ + dst_rel_offset_t noffset; /* offset to name string for source file */ + } + dst_file_desc_t; + +typedef struct + { + unsigned short number_of_files; /* size of array: */ + dst_file_desc_t files[dst_dummy_array_size] ALIGNED1; + } + dst_rec_file_tab_t ALIGNED1; + + +/*----------------- + NAME TABLE record + ----------------- + A name table record may appear as an auxiliary record to the file table, + providing additional qualification of the file indexes for languages that + need it (i.e. Ada). Name table entries parallel file table entries of the + same file index. +*/ + +typedef struct + { + unsigned short number_of_names; /* size of array: */ + dst_rel_offset_t names[dst_dummy_array_size] ALIGNED1; + } + dst_rec_name_tab_t ALIGNED1; + + +/*-------------- + BLOCK record + -------------- + Describes a lexical program block--a procedure, function, module, etc. +*/ + +/* Block types. These may be used in any way desired by the compiler writers. + The debugger uses them only to give a description to the user of the type of + a block. The debugger makes no other assumptions about the meaning of any + of these. For example, the fact that a block is executable (e.g., program) + or not (e.g., module) is expressed in block attributes (see below), not + guessed at from the block type. +*/ +typedef enum + { + dst_block_module, /* some pascal = modula = ada types */ + dst_block_program, + dst_block_procedure, + dst_block_function, /* C function */ + dst_block_subroutine, /* some fortran block types */ + dst_block_block_data, + dst_block_stmt_function, + dst_block_package, /* a few particular to Ada */ + dst_block_package_body, + dst_block_subunit, + dst_block_task, + dst_block_file, /* a C outer scope? */ + dst_block_class, /* C++ or Simula */ + dst_block_END_OF_ENUM + } + dst_block_type_t; + +/* Block attributes. This is the information used by the debugger to represent + the semantics of blocks. +*/ +typedef enum + { + dst_block_main_entry, /* the block's entry point is a main entry into + the compilation unit */ + dst_block_executable, /* the block has an entry point */ + dst_block_attr_END_OF_ENUM + } + dst_block_attr_t; + +/* Code range. Each block has associated with it one or more code ranges. An + individual code range is identified by a range of source (possibly nil) and + a range of executable code. For example, a block which has its executable + code spread over multiple sections will have one code range per section. +*/ +typedef struct + { + unsigned long code_size; /* size of executable code (in bytes ) */ + dst_sect_ref_t code_start; /* starting address of executable code */ + dst_sect_ref_t lines_start; /* start of line number tables */ + } + dst_code_range_t; + +typedef struct + { + dst_block_type_t block_type : 8; + unsigned short flags : 8; /* mask of dst_block_attr_t flags */ + dst_rel_offset_t sibling_block_off; /* offset to next sibling block */ + dst_rel_offset_t child_block_off; /* offset to first contained block */ + dst_rel_offset_t noffset; /* offset to block name string */ + dst_sect_ref_t symbols_start; /* start of debug symbols */ + unsigned short n_of_code_ranges; /* size of array... */ + dst_code_range_t code_ranges[dst_dummy_array_size] ALIGNED1; + } + dst_rec_block_t ALIGNED1; + + +/*-------------------------- + AUX SECT INFO TABLE record + -------------------------- + Appears as an auxiliary to a block record. Expands code range information + by providing references into additional, language-dependent sections for + information related to specific code ranges of the block. Sect info table + entries parallel code range array entries of the same index. +*/ + +typedef struct + { + unsigned char tag; /* currently can only be zero */ + unsigned char number_of_refs; /* size of array: */ + dst_sect_ref_t refs[dst_dummy_array_size] ALIGNED1; + } + dst_rec_sect_info_tab_t ALIGNED1; + +/*=================================================*/ +/*========== RECORDS IN .symbols SECTION ==========*/ +/*=================================================*/ + +/*----------------- + CONSTANT record + ----------------- + Describes a symbolic constant. +*/ + +typedef struct + { + float r; /* real part */ + float i; /* imaginary part */ + } + dst_complex_t; + +typedef struct + { + double dr; /* real part */ + double di; /* imaginary part */ + } + dst_double_complex_t; + +/* The following record provides a way of describing constant values with + non-standard type and no limit on size. +*/ +typedef union + { + char char_data[dst_dummy_array_size]; + short int_data [dst_dummy_array_size]; + long long_data[dst_dummy_array_size]; + } + dst_big_kon_t; + +/* Representation of the value of a general constant. +*/ +typedef struct + { + unsigned short length; /* size of constant value (bytes) */ + + union + { + unsigned short kon_int8; + short kon_int16; + long kon_int32 ALIGNED1; + float kon_real ALIGNED1; + double kon_dbl ALIGNED1; + dst_complex_t kon_cplx ALIGNED1; + dst_double_complex_t kon_dcplx ALIGNED1; + char kon_char; + dst_big_kon_t kon ALIGNED1; + } + val; /* value data of constant */ + } + dst_const_t ALIGNED1; + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line of const definition */ + dst_type_t type_desc; /* type of this (manifest) constant */ + dst_const_t value; + } + dst_rec_const_t ALIGNED1; + +/*---------------- + VARIABLE record + ---------------- + Describes a program variable. +*/ + +/* Variable attributes. These define certain variable semantics to the + debugger. +*/ +typedef enum + { + dst_var_attr_read_only, /* is read-only (a program literal) */ + dst_var_attr_volatile, /* same as compiler's VOLATILE attribute */ + dst_var_attr_global, /* is a global definition or reference */ + dst_var_attr_compiler_gen, /* is compiler-generated */ + dst_var_attr_static, /* has static location */ + dst_var_attr_END_OF_ENUM + } + dst_var_attr_t; + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_rel_offset_t loffset; /* offset to loc string */ + dst_src_loc_t src_loc; /* file/line of variable definition */ + dst_type_t type_desc; /* type descriptor */ + unsigned short attributes; /* mask of dst_var_attr_t flags */ + } + dst_rec_variable_t ALIGNED1; + + +/*---------------- + old VAR record + ----------------- + Used by older compilers to describe a variable +*/ + +typedef enum + { + dst_var_loc_unknown, /* Actually defined as "unknown" */ + dst_var_loc_abs, /* Absolute address */ + dst_var_loc_sect_off, /* Absolute address as a section offset */ + dst_var_loc_ind_sect_off, /* An indexed section offset ???? */ + dst_var_loc_reg, /* register */ + dst_var_loc_reg_rel, /* register relative - usually fp */ + dst_var_loc_ind_reg_rel, /* Indexed register relative */ + dst_var_loc_ftn_ptr_based, /* Fortran pointer based */ + dst_var_loc_pc_rel, /* PC relative. Really. */ + dst_var_loc_external, /* External */ + dst_var_loc_END_OF_ENUM + } + dst_var_loc_t; + +/* Locations come in two versions. The sort, and the long. The difference + * between the short and the long is the addition of a statement number + * field to the start andend of the range of the long, and and unkown + * purpose field in the middle. Also, loc_type and loc_index aren't + * bitfields in the long version. + */ + +typedef struct + { + unsigned short loc_type : 4; + unsigned short loc_index : 12; + long location; + short start_line; /* start_line and end_line? */ + short end_line; /* I'm guessing here. */ + } dst_var_loc_short_t; + +typedef struct + { + unsigned short loc_type; + unsigned short loc_index; + long location; + short unknown; /* Always 0003 or 3b3c. Why? */ + short start_statement; + short start_line; + short end_statement; + short end_line; + } dst_var_loc_long_t; + + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line of description */ + dst_type_t type_desc; /* Type description */ + unsigned short attributes; /* mask of dst_var_attr_t flags */ + unsigned short no_of_locs : 15;/* Number of locations */ + unsigned short short_locs : 1; /* True if short locations. */ + union + { + dst_var_loc_short_t shorts[dst_dummy_array_size]; + dst_var_loc_long_t longs[dst_dummy_array_size]; + } locs; + } dst_rec_var_t; + +/*---------------- + old LABEL record + ----------------- + Used by older compilers to describe a label +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line of description */ + char location[12]; /* location string */ + } + dst_rec_old_label_t ALIGNED1; + +/*---------------- + POINTER record + ---------------- + Describes a pointer type. +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to the name string for this type */ + dst_src_loc_t src_loc; /* file/line of definition */ + dst_type_t type_desc; /* base type of this pointer */ + } + dst_rec_pointer_t ALIGNED1; + + +/*------------- + ARRAY record + ------------- + Describes an array type. + + Multidimensional arrays are described with a number of dst_rec_array_t + records, one per array dimension, each linked to the next through the + elem_type_desc.doffset field. Each record must have its multi_dim flag + set. + + If column_major is true (as with FORTRAN arrays) then the last array bound in + the declaration is the first array index in memory, which is the opposite of + the usual case (as with Pascal and C arrays). + + Variable array bounds are described by auxiliary records; if aux_var_bound + records are present, the lo_bound and hi_bound fields of this record are + ignored by the debugger. + + span_comp identifies one of the language-dependent ways in which the distance + between successive array elements (span) is calculated. + dst_use_span_field -- the span is the value of span field. + dst_compute_from_prev -- the span is the size of the previous dimension. + dst_compute_from_next -- the span is the size of the next dimension. + In the latter two cases, the span field contains an amount of padding to add + to the size of the appropriate dimension to calculate the span. +*/ + +typedef enum + { + dst_use_span_field, + dst_compute_from_prev, + dst_compute_from_next, + dst_span_comp_END_OF_ENUM + } + dst_span_comp_t; + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line of definition */ + dst_type_t elem_type_desc; /* array element type */ + dst_type_t indx_type_desc; /* array index type */ + long lo_bound; /* lower bound of index */ + long hi_bound; /* upper bound of index */ + unsigned long span; /* see above */ + unsigned long size; /* total array size (bytes) */ + boolean multi_dim : 1; + boolean is_packed : 1; /* true if packed array */ + boolean is_signed : 1; /* true if packed elements are signed */ + dst_span_comp_t span_comp : 2; /* how to compute span */ + boolean column_major : 1; + unsigned short reserved : 2; /* must be zero */ + unsigned short elem_size : 8; /* element size if packed (bits) */ + } + dst_rec_array_t ALIGNED1; + + +/*----------------- + SUBRANGE record + ----------------- + Describes a subrange type. +*/ + +/* Variable subrange bounds are described by auxiliary records; if aux_var_bound + records are present, the lo_bound and hi_bound fields of this record are + ignored by the debugger. +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line of subrange definition */ + dst_type_t type_desc; /* parent type */ + long lo_bound; /* lower bound of subrange */ + long hi_bound; /* upper bound of subrange */ + unsigned short size; /* storage size (bytes) */ + } + dst_rec_subrange_t ALIGNED1; + + +/*--------------- + STRING record + --------------- + Describes a string type. +*/ + +/* Variable subrange bounds are described by auxiliary records; if aux_var_bound + records are present, the lo_bound and hi_bound fields of this record are + ignored by the debugger. +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line of string definition */ + dst_type_t elem_type_desc; /* element type */ + dst_type_t indx_type_desc; /* index type */ + long lo_bound; /* lower bound */ + long hi_bound; /* upper bound */ + unsigned long size; /* total string size (bytes) if fixed */ + } + dst_rec_string_t ALIGNED1; + + +/*--------------- + SET record + --------------- + Describes a set type. +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line of definition */ + dst_type_t type_desc; /* element type */ + unsigned short nbits; /* number of bits in set */ + unsigned short size; /* storage size (bytes) */ + } + dst_rec_set_t ALIGNED1; + + +/*----------------------------- + IMPLICIT ENUMERATION record + ----------------------------- + Describes an enumeration type with implicit element values = 0, 1, 2, ... + (Pascal-style). +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line of definition */ + unsigned short nelems; /* number of elements in enumeration */ + unsigned short size; /* storage size (bytes) */ + /* offsets to name strings of elements 0, 1, 2, ... */ + dst_rel_offset_t elem_noffsets[dst_dummy_array_size]; + } + dst_rec_implicit_enum_t ALIGNED1; + + +/*----------------------------- + EXPLICIT ENUMERATION record + ----------------------------- + Describes an enumeration type with explicitly assigned element values + (C-style). +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to element name string */ + long value; /* element value */ + } + dst_enum_elem_t; + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line of definition */ + unsigned short nelems; /* number of elements in enumeration */ + unsigned short size; /* storage size (bytes) */ + /* name/value pairs, one describing each enumeration value: */ + dst_enum_elem_t elems[dst_dummy_array_size]; + } + dst_rec_explicit_enum_t ALIGNED1; + + +/*----------------------- + RECORD / UNION record + ----------------------- + Describes a record (struct) or union. + + If the record is larger than 2**16 bytes then an attached aux record + specifies its size. Also, if the record is stored in short form then + attached records specify field offsets larger than 2**16 bytes. + + Whether the fields[] array or sfields[] array is used is selected by + the dst_rec_type_t of the overall dst record. +*/ + +/* + Record field descriptor, short form. This form handles only fields which + are an even number of bytes long, located some number of bytes from the + start of the record. +*/ +typedef struct + { + dst_rel_offset_t noffset; /* offset to field name string */ + dst_type_t type_desc; /* field type */ + unsigned short foffset; /* field offset from start of record (bytes) */ + } + dst_short_field_t ALIGNED1; + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_type_t type_desc; /* field type */ + unsigned short foffset; /* byte offset */ + unsigned short is_packed : 1; /* True if field is packed */ + unsigned short bit_offset : 6; /* Bit offset */ + unsigned short size : 6; /* Size in bits */ + unsigned short sign : 1; /* True if signed */ + unsigned short pad : 2; /* Padding. Must be 0 */ + } + dst_old_field_t ALIGNED1; + +/* Tag enumeration for long record field descriptor: +*/ +typedef enum + { + dst_field_byte, + dst_field_bit, + dst_field_loc, + dst_field_END_OF_ENUM + } + dst_field_format_t; + +/* + Record field descriptor, long form. The format of the field information + is identified by the format_tag, which contains one of the above values. + The field_byte variant is equivalent to the short form of field descriptor. + The field_bit variant handles fields which are any number of bits long, + located some number of bits from the start of the record. The field_loc + variant allows the location of the field to be described by a general loc + string. +*/ +typedef struct + { + dst_rel_offset_t noffset; /* offset to name of field */ + dst_type_t type_desc; /* type of field */ + union + { + struct { + dst_field_format_t format_tag: 2; /* dst_field_byte */ + unsigned long offset: 30; /* offset of field in bytes */ + } + field_byte ALIGNED1; + struct { + dst_field_format_t format_tag: 2; /* dst_field_bit */ + unsigned long nbits: 6; /* bit size of field */ + unsigned long is_signed: 1; /* signed/unsigned attribute */ + unsigned long bit_offset: 3; /* bit offset from byte boundary */ + int pad: 4; /* must be zero */ + unsigned short byte_offset; /* offset of byte boundary */ + } + field_bit ALIGNED1; + struct { + dst_field_format_t format_tag: 2; /* dst_field_loc */ + int loffset: 30; /* dst_rel_offset_t to loc string */ + } + field_loc ALIGNED1; + } + f ALIGNED1; + } + dst_field_t; + +/* The field_loc.loffset field is a 30-bit signed value. Some versions of C do + not support signed bit fields. The following macro will extract that field + as a signed value: +*/ +#define dst_field_loffset(field_rec) \ + ( ((int) ((field_rec).f.field_loc.loffset << 2)) >> 2 ) + + +typedef struct + { + dst_rel_offset_t noffset; /* offset to record name string */ + dst_src_loc_t src_loc; /* file/line where this record is defined */ + unsigned short size; /* storage size (bytes) */ + unsigned short nfields; /* number of fields in this record */ + union + { + dst_field_t fields[dst_dummy_array_size]; + dst_short_field_t sfields[dst_dummy_array_size]; + dst_old_field_t ofields[dst_dummy_array_size]; + } + f; /* array of fields */ + } + dst_rec_record_t ALIGNED1; + + +/*------------- + FILE record + ------------- + Describes a file type. +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line where type was defined */ + dst_type_t type_desc; /* file element type */ + } + dst_rec_file_t ALIGNED1; + + +/*--------------- + OFFSET record + --------------- + Describes a Pascal offset type. + (This type, an undocumented Domain Pascal extension, is currently not + supported by the debugger) +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to the name string */ + dst_src_loc_t src_loc; /* file/line of definition */ + dst_type_t area_type_desc; /* area type */ + dst_type_t base_type_desc; /* base type */ + long lo_bound; /* low bound of the offset range */ + long hi_bound; /* high bound of the offset range */ + long bias; /* bias */ + unsigned short scale; /* scale factor */ + unsigned short size; /* storage size (bytes) */ + } + dst_rec_offset_t ALIGNED1; + + +/*-------------- + ALIAS record + -------------- + Describes a type alias (e.g., typedef). +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line of definition */ + dst_type_t type_desc; /* parent type */ + } + dst_rec_alias_t ALIGNED1; + + +/*------------------ + SIGNATURE record + ------------------ + Describes a procedure/function type. +*/ + +/* Enumeration of argument semantics. Note that most are mutually + exclusive. +*/ +typedef enum + { + dst_arg_attr_val, /* passed by value */ + dst_arg_attr_ref, /* passed by reference */ + dst_arg_attr_name, /* passed by name */ + dst_arg_attr_in, /* readable in the callee */ + dst_arg_attr_out, /* writable in the callee */ + dst_arg_attr_hidden, /* not visible in the caller */ + dst_arg_attr_END_OF_ENUM + } + dst_arg_attr_t; + +/* Argument descriptor. Actually points to a variable record for most of the + information. +*/ +typedef struct + { + dst_rel_offset_t var_offset; /* offset to variable record */ + unsigned short attributes; /* a mask of dst_arg_attr_t flags */ + } + dst_arg_t ALIGNED1; + +typedef struct + { + dst_rel_offset_t noffset; /* offset to name string */ + dst_src_loc_t src_loc; /* file/line of function definition */ + dst_rel_offset_t result; /* offset to function result variable record */ + unsigned short nargs; /* number of arguments */ + dst_arg_t args[dst_dummy_array_size]; + } + dst_rec_signature_t ALIGNED1; + +/*-------------- + SCOPE record + -------------- + Obsolete. Use the new ENTRY type instead. + Old compilers may put this in as the first entry in a function, + terminated by an end of scope entry. +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* Name offset */ + dst_src_loc_t start_line; /* Starting line */ + dst_src_loc_t end_line; /* Ending line */ + } + dst_rec_scope_t ALIGNED1; + +/*-------------- + ENTRY record + -------------- + Describes a procedure/function entry point. An entry record is to a + signature record roughly as a variable record is to a type descriptor record. + + The entry_number field is keyed to the entry numbers in .lines -- the + debugger locates the code location of an entry by searching the line + number table for an entry numbered with the value of entry_number. The + main entry is numbered zero. +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to entry name string */ + dst_rel_offset_t loffset; /* where to jump to call this entry */ + dst_src_loc_t src_loc; /* file/line of definition */ + dst_rel_offset_t sig_desc; /* offset to signature descriptor */ + unsigned int entry_number: 8; + int pad: 8; /* must be zero */ + } + dst_rec_entry_t ALIGNED1; + +/*----------------------- + Old format ENTRY record + ----------------------- + Supposedly obsolete but still used by some compilers. + */ + +typedef struct + { + dst_rel_offset_t noffset; /* Offset to entry name string */ + dst_src_loc_t src_loc; /* Location in source */ + dst_rel_offset_t sig_desc; /* Signature description */ + char unknown[36]; + } + dst_rec_old_entry_t ALIGNED1; + +/*-------------- + LABEL record + -------------- + Describes a program label. +*/ + +typedef struct + { + dst_rel_offset_t noffset; /* offset to label string */ + dst_rel_offset_t loffset; /* offset to loc string */ + dst_src_loc_t src_loc; /* file/line of definition */ + } + dst_rec_label_t ALIGNED1; + + +/*----------------------- + AUXILIARY SIZE record + ----------------------- + May appear in the auxiliary record list of any type or variable record to + modify the default size of the type or variable. +*/ + +typedef struct + { + unsigned long size; /* size (bytes) */ + } + dst_rec_aux_size_t ALIGNED1; + + +/*----------------------- + AUXILIARY ALIGN record + ----------------------- + May appear in the auxiliary record list of any type or variable record to + modify the default alignment of the type or variable. +*/ + +typedef struct + { + unsigned short alignment; /* # of low order zero bits */ + } + dst_rec_aux_align_t ALIGNED1; + + +/*----------------------------- + AUXILIARY FIELD SIZE record + ----------------------------- + May appear in the auxiliary record list of any RECORD/UNION record to + modify the default size of a field. +*/ + +typedef struct + { + unsigned short field_no; /* field number */ + unsigned long size; /* size (bits) */ + } + dst_rec_aux_field_size_t ALIGNED1; + + + +/*----------------------------- + AUXILIARY FIELD OFFSET record + ----------------------------- + May appear in the auxiliary record list of any RECORD/UNION record to + specify a field offset larger than 2**16. +*/ + +typedef struct + { + unsigned short field_no; /* field number */ + unsigned long foffset; /* offset */ + } + dst_rec_aux_field_off_t ALIGNED1; + + +/*----------------------------- + AUXILIARY FIELD ALIGN record + ----------------------------- + May appear in the auxiliary record list of any RECORD/UNION record to + modify the default alignment of a field. +*/ + +typedef struct + { + unsigned short field_no; /* field number */ + unsigned short alignment; /* number of low order zero bits */ + } + dst_rec_aux_field_align_t ALIGNED1; + + +/*---------------------------- + AUXILIARY VAR BOUND record + ---------------------------- + May appear in the auxiliary record list of any ARRAY, SUBRANGE or STRING + record to describe a variable bound for the range of the type. +*/ + +typedef enum + { + dst_low_bound, /* the low bound is variable */ + dst_high_bound, /* the high bound is variable */ + dst_var_bound_END_OF_ENUM + } + dst_var_bound_t; + +typedef struct + { + unsigned short which; /* which bound */ + dst_rel_offset_t voffset ALIGNED1; /* variable that defines bound */ + } + dst_rec_aux_var_bound_t ALIGNED1; + + +/*---------------------------------- + AUXILIARY TYPE DERIVATION record + ---------------------------------- + May appear in the auxiliary record list of any RECORD/UNION record to denote + class inheritance of that type from a parent type. + + Inheritance implies that it is possible to convert the inheritor type to the + inherited type, retaining those fields which were inherited. To allow this, + orig_field_no, a field number into the record type, is provided. If + orig_is_pointer is false, then the start of the inherited record is located + at the location of the field indexed by orig_field_no. If orig_is_pointer + is true, then it is located at the address contained in the field indexed + by orig_field_no (assumed to be a pointer). +*/ + +typedef struct + { + dst_type_t parent_type; /* reference to inherited type */ + unsigned short orig_field_no; + boolean orig_is_pointer: 1; + int unused: 15; /* must be zero */ + } + dst_rec_aux_type_deriv_t ALIGNED1; + + +/*------------------------------------ + AUXILIARY VARIABLE LIFETIME record + ------------------------------------ + May appear in the auxiliary record list of a VARIABLE record to add location + information for an additional variable lifetime. +*/ + +typedef struct + { + dst_rel_offset_t loffset; + } + dst_rec_aux_lifetime_t ALIGNED1; + + +/*------------------------------- + AUXILIARY POINTER BASE record + ------------------------------- + May appear in the auxiliary record list of a VARIABLE record to provide a + pointer base to substitute for references to any such bases in the location + string of the variable. A pointer base is another VARIABLE record. When + the variable is evaluated by the debugger, it uses the current value of the + pointer base variable in computing its location. + + This is useful for representing FORTRAN pointer-based variables. +*/ + +typedef struct + { + dst_rel_offset_t voffset; + } + dst_rec_aux_ptr_base_t ALIGNED1; + + +/*--------------------------------- + AUXILIARY REGISTER VALUE record + --------------------------------- + May appear in the auxiliary record list of an ENTRY record to specify + a register that must be set to a specific value before jumping to the entry + point in a debugger "call". The debugger must set the debuggee register, + specified by the register code, to the value of the *address* to which the + location string resolves. If the address is register-relative, then the + call cannot be made unless the current stack frame is the lexical parent + of the entry. An example of this is when a (Pascal) nested procedure + contains references to its parent's variables, which it accesses through + a static link register. The static link register must be set to some + address relative to the parent's stack base register. +*/ + +typedef struct + { + unsigned short reg; /* identifies register to set (isp enum) */ + dst_rel_offset_t loffset; /* references a location string */ + } + dst_rec_aux_reg_val_t ALIGNED1; + + +/*==========================================================*/ +/*========== RECORDS USED IN .blocks AND .symbols ==========*/ +/*==========================================================*/ + +/*--------------------- + STRING TABLE record + --------------------- + A string table record contains any number of null-terminated, variable length + strings. The length field gives the size in bytes of the text field, which + can be any size. + + The global name table shares this format. This record appears in the + .blocks section. Each string in the table identifies a global defined in + the current compilation unit. + + The loc pool record shares this format as well. Loc strings are described + elsewhere. +*/ + +typedef struct + { + unsigned long length; + char text[dst_dummy_array_size]; + } + dst_rec_string_tab_t ALIGNED1; + + +/*----------------------- + AUXILIARY QUAL record + ----------------------- + May appear in the auxiliary record list of any BLOCK, VARIABLE, or type record + to provide it with a fully-qualified, language-dependent name. +*/ + +typedef struct + { + dst_rel_offset_t lang_qual_name; + } + dst_rec_aux_qual_t ALIGNED1; + + +/*---------------- + FORWARD record + ---------------- + Reference to a record somewhere else. This allows identical definitions in + different scopes to share data. +*/ + +typedef struct + { + dst_rel_offset_t rec_off; + } + dst_rec_forward_t ALIGNED1; + + +/*------------------------------- + AUXILIARY SOURCE RANGE record + ------------------------------- + May appear in the auxiliary record list of any BLOCK record to specify a + range of source lines over which the block is active. +*/ + +typedef struct + { + dst_src_loc_t first_line; /* first source line */ + dst_src_loc_t last_line; /* last source line */ + } + dst_rec_aux_src_range_t ALIGNED1; + + +/*------------------ + EXTENSION record + ------------------ + Provision for "foreign" records, such as might be generated by a non-Apollo + compiler. Apollo software will ignore these. +*/ + +typedef struct + { + unsigned short rec_size; /* record size (bytes) */ + unsigned short ext_type; /* defined by whoever generates it */ + unsigned short ext_data; /* place-holder for arbitrary amount of data */ + } + dst_rec_extension_t ALIGNED1; + + +/* +** DEBUG SYMBOL record -- The wrapper for all .blocks and .symbols records. +** +** This record ties together all previous .blocks and .symbols records +** together in a union with a common header. The rec_type field of the +** header identifies the record type. The rec_flags field currently only +** defines auxiliary record lists. +** +** If a record carries with it a non-null auxiliary record list, its +** dst_flag_has_aux_recs flag is set, and each of the records that follow +** it are treated as its auxiliary records, until the end of the compilation +** unit or scope is reached, or until an auxiliary record with its +** dst_flag_last_aux_rec flag set is reached. +*/ + +typedef enum + { + dst_flag_has_aux_recs, + dst_flag_last_aux_rec, + dst_rec_flag_END_OF_ENUM + } + dst_rec_flags_t; + +typedef struct + { + dst_rec_type_t rec_type : 8; /* record type */ + int rec_flags: 8; /* mask of dst_rec_flags_t */ + union /* switched on rec_type field above */ + { + /* dst_typ_pad requires no additional fields */ + dst_rec_comp_unit_t comp_unit_; + dst_rec_section_tab_t section_tab_; + dst_rec_file_tab_t file_tab_; + dst_rec_block_t block_; + dst_rec_var_t var_; + dst_rec_pointer_t pointer_; + dst_rec_array_t array_; + dst_rec_subrange_t subrange_; + dst_rec_set_t set_; + dst_rec_implicit_enum_t implicit_enum_; + dst_rec_explicit_enum_t explicit_enum_; + /* dst_typ_short_{rec,union} are represented by 'rec' (below) */ + dst_rec_file_t file_; + dst_rec_offset_t offset_; + dst_rec_alias_t alias_; + dst_rec_signature_t signature_; + dst_rec_old_label_t old_label_; + dst_rec_scope_t scope_; + /* dst_typ_end_scope requires no additional fields */ + dst_rec_string_tab_t string_tab_; + /* dst_typ_global_name_tab is represented by 'string_tab' (above) */ + dst_rec_forward_t forward_; + dst_rec_aux_size_t aux_size_; + dst_rec_aux_align_t aux_align_; + dst_rec_aux_field_size_t aux_field_size_; + dst_rec_aux_field_off_t aux_field_off_; + dst_rec_aux_field_align_t aux_field_align_; + dst_rec_aux_qual_t aux_qual_; + dst_rec_aux_var_bound_t aux_var_bound_; + dst_rec_extension_t extension_; + dst_rec_string_t string_; + dst_rec_const_t const_; + /* dst_typ_reference is represented by 'pointer' (above) */ + dst_rec_record_t record_; + /* dst_typ_union is represented by 'record' (above) */ + dst_rec_aux_type_deriv_t aux_type_deriv_; + /* dst_typ_locpool is represented by 'string_tab' (above) */ + dst_rec_variable_t variable_; + dst_rec_label_t label_; + dst_rec_entry_t entry_; + dst_rec_aux_lifetime_t aux_lifetime_; + dst_rec_aux_ptr_base_t aux_ptr_base_; + dst_rec_aux_src_range_t aux_src_range_; + dst_rec_aux_reg_val_t aux_reg_val_; + dst_rec_name_tab_t aux_unit_names_; + dst_rec_sect_info_tab_t aux_sect_info_; + } + rec_data ALIGNED1; + } + dst_rec_t, *dst_rec_ptr_t; + + +/*===============================================*/ +/*========== .lines SECTION DEFINITIONS =========*/ +/*===============================================*/ +/* + The .lines section contains a sequence of line number tables. There is no + record structure within the section. The start of the table for a routine + is pointed to by the block record, and the end of the table is signaled by + an escape code. + + A line number table is a sequence of bytes. The default entry contains a line + number delta (-7..+7) in the high 4 bits and a pc delta (0..15) in the low 4 + bits. Special cases, including when one or both of the values is too large + to fit in 4 bits and other special cases are handled through escape entries. + Escape entries are identified by the value 0x8 in the high 4 bits. The low 4 + bits are occupied by a function code. Some escape entries are followed by + additional arguments, which may be bytes, words, or longwords. This data is + not aligned. + + The initial PC offset, file number and line number are zero. Normally, the + table begins with a dst_ln_file escape which establishes the initial file + and line number. All PC deltas are unsigned (thus the table is ordered by + increasing PC); line number deltas are signed. The table ends with a + dst_ln_end escape, which is followed by a final table entry whose PC delta + gives the code size of the last statement. + + Escape Semantic + --------- ------------------------------------------------------------ + file Changes file state. The current source file remains constant + until another file escape. Though the line number state is + also updated by a file escape, a file escape does NOT + constitute a line table entry. + + statement Alters the statement number of the next table entry. By + default, all table entries refer to the first statement on a + line. Statement number one is the second statement, and so on. + + entry Identifies the next table entry as the position of an entry + point for the current block. The PC position should follow + any procedure prologue code. An argument specifies the entry + number, which is keyed to the entry number of the corresponding + .symbols ENTRY record. + + exit Identifies the next table entry as the last position within + the current block before a procedure epiloge and subsequent + procedure exit. + + gap By default, the executable code corresponding to a table entry + is assumed to extend to the beginning of the next table entry. + If this is not the case--there is a "hole" in the table--then + a gap escape should follow the first table entry to specify + where the code for that entry ends. +*/ + +#define dst_ln_escape_flag -8 + +/* + Escape function codes: +*/ +typedef enum + { + dst_ln_pad, /* pad byte */ + dst_ln_file, /* file escape. Next 4 bytes are a dst_src_loc_t */ + dst_ln_dln1_dpc1, /* 1 byte line delta, 1 byte pc delta */ + dst_ln_dln2_dpc2, /* 2 bytes line delta, 2 bytes pc delta */ + dst_ln_ln4_pc4, /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */ + dst_ln_dln1_dpc0, /* 1 byte line delta, pc delta = 0 */ + dst_ln_ln_off_1, /* statement escape, stmt # = 1 (2nd stmt on line) */ + dst_ln_ln_off, /* statement escape, stmt # = next byte */ + dst_ln_entry, /* entry escape, next byte is entry number */ + dst_ln_exit, /* exit escape */ + dst_ln_stmt_end, /* gap escape, 4 bytes pc delta */ + dst_ln_escape_11, /* reserved */ + dst_ln_escape_12, /* reserved */ + dst_ln_escape_13, /* reserved */ + dst_ln_nxt_byte, /* next byte contains the real escape code */ + dst_ln_end, /* end escape, final entry follows */ + dst_ln_escape_END_OF_ENUM + } + dst_ln_escape_t; + +/* + Line number table entry +*/ +typedef union + { + struct + { + unsigned int ln_delta : 4; /* 4 bit line number delta */ + unsigned int pc_delta : 4; /* 4 bit pc delta */ + } + delta; + + struct + { + unsigned int esc_flag : 4; /* alias for ln_delta */ + dst_ln_escape_t esc_code : 4; /* escape function code */ + } + esc; + + char sdata; /* signed data byte */ + unsigned char udata; /* unsigned data byte */ + } + dst_ln_entry_t, + *dst_ln_entry_ptr_t, + dst_ln_table_t[dst_dummy_array_size]; + +/* The following macro will extract the ln_delta field as a signed value: +*/ +#define dst_ln_ln_delta(ln_rec) \ + ( ((short) ((ln_rec).delta.ln_delta << 12)) >> 12 ) + + + + +typedef struct dst_sec_struct { + char *buffer; + long position; + long size; + long base; +} dst_sec; + + +/* Macros for access to the data */ + +#define DST_comp_unit(x) ((x)->rec_data.comp_unit_) +#define DST_section_tab(x) ((x)->rec_data.section_tab_) +#define DST_file_tab(x) ((x)->rec_data.file_tab_) +#define DST_block(x) ((x)->rec_data.block_) +#define DST_var(x) ((x)->rec_data.var_) +#define DST_pointer(x) ((x)->rec_data.pointer_) +#define DST_array(x) ((x)->rec_data.array_) +#define DST_subrange(x) ((x)->rec_data.subrange_) +#define DST_set(x) ((x)->rec_data.set_) +#define DST_implicit_enum(x) ((x)->rec_data.implicit_enum_) +#define DST_explicit_enum(x) ((x)->rec_data.explicit_enum_) +#define DST_short_rec(x) ((x)->rec_data.record_) +#define DST_short_union(x) ((x)->rec_data.record_) +#define DST_file(x) ((x)->rec_data.file_) +#define DST_offset(x) ((x)->rec_data.offset_) +#define DST_alias(x) ((x)->rec_data.alias_) +#define DST_signature(x) ((x)->rec_data.signature_) +#define DST_old_label(x) ((x)->rec_data.old_label_) +#define DST_scope(x) ((x)->rec_data.scope_) +#define DST_string_tab(x) ((x)->rec_data.string_tab_) +#define DST_global_name_tab(x) ((x)->rec_data.string_tab_) +#define DST_forward(x) ((x)->rec_data.forward_) +#define DST_aux_size(x) ((x)->rec_data.aux_size_) +#define DST_aux_align(x) ((x)->rec_data.aux_align_) +#define DST_aux_field_size(x) ((x)->rec_data.aux_field_size_) +#define DST_aux_field_off(x) ((x)->rec_data.aux_field_off_) +#define DST_aux_field_align(x) ((x)->rec_data.aux_field_align_) +#define DST_aux_qual(x) ((x)->rec_data.aux_qual_) +#define DST_aux_var_bound(x) ((x)->rec_data.aux_var_bound_) +#define DST_extension(x) ((x)->rec_data.extension_) +#define DST_string(x) ((x)->rec_data.string_) +#define DST_const(x) ((x)->rec_data.const_) +#define DST_reference(x) ((x)->rec_data.pointer_) +#define DST_record(x) ((x)->rec_data.record_) +#define DST_union(x) ((x)->rec_data.record_) +#define DST_aux_type_deriv(x) ((x)->rec_data.aux_type_deriv_) +#define DST_locpool(x) ((x)->rec_data.string_tab_) +#define DST_variable(x) ((x)->rec_data.variable_) +#define DST_label(x) ((x)->rec_data.label_) +#define DST_entry(x) ((x)->rec_data.entry_) +#define DST_aux_lifetime(x) ((x)->rec_data.aux_lifetime_) +#define DST_aux_ptr_base(x) ((x)->rec_data.aux_ptr_base_) +#define DST_aux_src_range(x) ((x)->rec_data.aux_src_range_) +#define DST_aux_reg_val(x) ((x)->rec_data.aux_reg_val_) +#define DST_aux_unit_names(x) ((x)->rec_data.aux_unit_names_) +#define DST_aux_sect_info(x) ((x)->rec_data.aux_sect_info_) + + +/* + * Type codes for loc strings. I'm not entirely certain about all of + * these, but they seem to work. + * troy@cbme.unsw.EDU.AU + * If you find a variable whose location can't be decoded, you should + * find out it's code using "dstdump -s filename". It will record an + * entry for the variable, and give a text representation of what + * the locstring means. Before that explaination there will be a + * number. In the LOCSTRING table, that number will appear before + * the start of the location string. Location string codes are + * five bit codes with a 3 bit argument. Check the high 5 bits of + * the one byte code, and figure out where it goes in here. + * Then figure out exactly what the meaning is and code it in + * dstread.c + * + * Note that ranged locs mean that the variable is in different locations + * depending on the current PC. We ignore these because (a) gcc can't handle + * them, and (b), If you don't use high levels of optimisation they won't + * occur. + */ +typedef enum +{ + dst_lsc_end, /* End of string */ + dst_lsc_indirect, /* Indirect through previous. Arg == 6 */ + /* Or register ax (x=arg) */ + dst_lsc_dreg, /* register dx (x=arg) */ + dst_lsc_03, + dst_lsc_section, /* Section (arg+1) */ + dst_lsc_05, + dst_lsc_06, + dst_lsc_add, /* Add (arg+1)*2 */ + dst_lsc_sub, /* Subtract (arg+1)*2 */ + dst_lsc_09, + dst_lsc_0a, + dst_lsc_sec_byte, /* Section of next byte+1 */ + dst_lsc_add_byte, /* Add next byte (arg == 5) or next word + * (arg == 6) + */ + dst_lsc_sub_byte, /* Subtract next byte. (arg == 1) or next + * word (arg == 6 ?) + */ + dst_lsc_sbreg, /* Stack base register (frame pointer). Arg==0*/ + dst_lsc_0f, + dst_lsc_ranged, /* location is pc dependent */ + dst_lsc_11, + dst_lsc_12, + dst_lsc_13, + dst_lsc_14, + dst_lsc_15, + dst_lsc_16, + dst_lsc_17, + dst_lsc_18, + dst_lsc_19, + dst_lsc_1a, + dst_lsc_1b, + dst_lsc_1c, + dst_lsc_1d, + dst_lsc_1e, + dst_lsc_1f +} dst_loc_string_code_t; + +/* If the following occurs after an addition/subtraction, that addition + * or subtraction should be multiplied by 256. It's a complete byte, not + * a code. + */ + +#define dst_multiply_256 ((char) 0x73) + +typedef struct +{ + char code : 5; + char arg : 3; +} dst_loc_header_t ALIGNED1; + +typedef union +{ + dst_loc_header_t header; + char data; +} dst_loc_entry_t ALIGNED1; + +#undef ALIGNED1 +#endif /* apollo_dst_h */ diff --git a/contrib/gdb/gdb/dstread.c b/contrib/gdb/gdb/dstread.c new file mode 100644 index 0000000000000..16b02f5771d6c --- /dev/null +++ b/contrib/gdb/gdb/dstread.c @@ -0,0 +1,1730 @@ +/* Read apollo DST symbol tables and convert to internal format, for GDB. + Contributed by Troy Rollo, University of NSW (troy@cbme.unsw.edu.au). + Copyright 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "symtab.h" +#include "gdbtypes.h" +#include "breakpoint.h" +#include "bfd.h" +#include "symfile.h" +#include "objfiles.h" +#include "buildsym.h" +#include "obstack.h" + +#include "gdb_string.h" + +#include "dst.h" + +CORE_ADDR cur_src_start_addr, cur_src_end_addr; +dst_sec blocks_info, lines_info, symbols_info; + +/* Vector of line number information. */ + +static struct linetable *line_vector; + +/* Index of next entry to go in line_vector_index. */ + +static int line_vector_index; + +/* Last line number recorded in the line vector. */ + +static int prev_line_number; + +/* Number of elements allocated for line_vector currently. */ + +static int line_vector_length; + +static struct blockvector * +make_blockvector PARAMS ((struct objfile *)); + +static int +init_dst_sections PARAMS ((int)); + +static void +read_dst_symtab PARAMS ((struct objfile *)); + +static void +find_dst_sections PARAMS ((bfd *, sec_ptr, PTR)); + +static void +dst_symfile_init PARAMS ((struct objfile *)); + +static void +dst_new_init PARAMS ((struct objfile *)); + +static void +dst_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int)); + +static void +dst_symfile_finish PARAMS ((struct objfile *)); + +static void +record_minimal_symbol PARAMS ((char *, CORE_ADDR, enum minimal_symbol_type, + struct objfile *)); + +static void +dst_end_symtab PARAMS ((struct objfile *)); + +static void +complete_symtab PARAMS ((char *, CORE_ADDR, unsigned int)); + +static void +dst_start_symtab PARAMS ((void)); + +static void +dst_record_line PARAMS ((int, CORE_ADDR)); + +static struct blockvector * +make_blockvector (objfile) + struct objfile *objfile; +{ + register struct pending_block *next, *next1; + register struct blockvector *blockvector; + register int i; + + /* Count the length of the list of blocks. */ + + for (next = pending_blocks, i = 0; next; next = next->next, i++); + + blockvector = (struct blockvector *) + obstack_alloc (&objfile->symbol_obstack, sizeof (struct blockvector) + (i - 1) * sizeof (struct block *)); + + /* Copy the blocks into the blockvector. + This is done in reverse order, which happens to put + the blocks into the proper order (ascending starting address). + */ + + BLOCKVECTOR_NBLOCKS (blockvector) = i; + for (next = pending_blocks; next; next = next->next) + BLOCKVECTOR_BLOCK (blockvector, --i) = next->block; + + /* Now free the links of the list, and empty the list. */ + + for (next = pending_blocks; next; next = next1) + { + next1 = next->next; + free ((PTR)next); + } + pending_blocks = 0; + + return blockvector; +} + +/* Manage the vector of line numbers. */ +/* FIXME: Use record_line instead. */ + +static void +dst_record_line (line, pc) + int line; + CORE_ADDR pc; +{ + struct linetable_entry *e; + /* Make sure line vector is big enough. */ + + if (line_vector_index + 2 >= line_vector_length) + { + line_vector_length *= 2; + line_vector = (struct linetable *) + xrealloc ((char *) line_vector, sizeof (struct linetable) + + (line_vector_length + * sizeof (struct linetable_entry))); + } + + e = line_vector->item + line_vector_index++; + e->line = line; e->pc = pc; +} + +/* Start a new symtab for a new source file. + It indicates the start of data for one original source file. */ +/* FIXME: use start_symtab, like coffread.c now does. */ + +static void +dst_start_symtab () +{ + /* Initialize the source file line number information for this file. */ + + if (line_vector) /* Unlikely, but maybe possible? */ + free ((PTR)line_vector); + line_vector_index = 0; + line_vector_length = 1000; + prev_line_number = -2; /* Force first line number to be explicit */ + line_vector = (struct linetable *) + xmalloc (sizeof (struct linetable) + + line_vector_length * sizeof (struct linetable_entry)); +} + +/* Save the vital information from when starting to read a file, + for use when closing off the current file. + NAME is the file name the symbols came from, START_ADDR is the first + text address for the file, and SIZE is the number of bytes of text. */ + +static void +complete_symtab (name, start_addr, size) + char *name; + CORE_ADDR start_addr; + unsigned int size; +{ + last_source_file = savestring (name, strlen (name)); + cur_src_start_addr = start_addr; + cur_src_end_addr = start_addr + size; + + if (current_objfile -> ei.entry_point >= cur_src_start_addr && + current_objfile -> ei.entry_point < cur_src_end_addr) + { + current_objfile -> ei.entry_file_lowpc = cur_src_start_addr; + current_objfile -> ei.entry_file_highpc = cur_src_end_addr; + } +} + +/* Finish the symbol definitions for one main source file, + close off all the lexical contexts for that file + (creating struct block's for them), then make the + struct symtab for that file and put it in the list of all such. */ +/* FIXME: Use end_symtab, like coffread.c now does. */ + +static void +dst_end_symtab (objfile) + struct objfile *objfile; +{ + register struct symtab *symtab; + register struct blockvector *blockvector; + register struct linetable *lv; + + /* Create the blockvector that points to all the file's blocks. */ + + blockvector = make_blockvector (objfile); + + /* Now create the symtab object for this source file. */ + symtab = allocate_symtab (last_source_file, objfile); + + /* Fill in its components. */ + symtab->blockvector = blockvector; + symtab->free_code = free_linetable; + symtab->free_ptr = 0; + symtab->filename = last_source_file; + symtab->dirname = NULL; + lv = line_vector; + lv->nitems = line_vector_index; + symtab->linetable = (struct linetable *) + xrealloc ((char *) lv, (sizeof (struct linetable) + + lv->nitems * sizeof (struct linetable_entry))); + + free_named_symtabs (symtab->filename); + + /* Reinitialize for beginning of new file. */ + line_vector = 0; + line_vector_length = -1; + last_source_file = NULL; +} + +static void +record_minimal_symbol (name, address, type, objfile) + char *name; + CORE_ADDR address; + enum minimal_symbol_type type; + struct objfile *objfile; +{ + prim_record_minimal_symbol (savestring (name, strlen (name)), + address, + type, + objfile); +} + +/* dst_symfile_init () + is the dst-specific initialization routine for reading symbols. + + We will only be called if this is a DST or DST-like file. + BFD handles figuring out the format of the file, and code in symtab.c + uses BFD's determination to vector to us. + + The ultimate result is a new symtab (or, FIXME, eventually a psymtab). */ + +static void +dst_symfile_init (objfile) + struct objfile *objfile; +{ + asection *section; + bfd *abfd = objfile->obfd; + + init_entry_point_info (objfile); + +} + +/* This function is called for every section; it finds the outer limits + of the line table (minimum and maximum file offset) so that the + mainline code can read the whole thing for efficiency. */ + +/* ARGSUSED */ +static void +find_dst_sections (abfd, asect, vpinfo) + bfd *abfd; + sec_ptr asect; + PTR vpinfo; +{ + int size, count; + long base; + file_ptr offset, maxoff; + dst_sec *section; + +/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */ + size = asect->_raw_size; + offset = asect->filepos; + base = asect->vma; +/* End of warning */ + + section = NULL; + if (!strcmp(asect->name, ".blocks")) + section = &blocks_info; + else if (!strcmp(asect->name, ".lines")) + section = &lines_info; + else if (!strcmp(asect->name, ".symbols")) + section = &symbols_info; + if (!section) + return; + section->size = size; + section->position = offset; + section->base = base; +} + + +/* The BFD for this file -- only good while we're actively reading + symbols into a psymtab or a symtab. */ + +static bfd *symfile_bfd; + +/* Read a symbol file, after initialization by dst_symfile_init. */ +/* FIXME! Addr and Mainline are not used yet -- this will not work for + shared libraries or add_file! */ + +/* ARGSUSED */ +static void +dst_symfile_read (objfile, section_offsets, mainline) + struct objfile *objfile; + struct section_offsets *section_offsets; + int mainline; +{ + bfd *abfd = objfile->obfd; + char *name = bfd_get_filename (abfd); + int desc; + register int val; + int num_symbols; + int symtab_offset; + int stringtab_offset; + + symfile_bfd = abfd; /* Kludge for swap routines */ + +/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */ + desc = fileno ((GDB_FILE *)(abfd->iostream)); /* File descriptor */ + + /* Read the line number table, all at once. */ + bfd_map_over_sections (abfd, find_dst_sections, (PTR)NULL); + + val = init_dst_sections (desc); + if (val < 0) + error ("\"%s\": error reading debugging symbol tables\n", name); + + init_minimal_symbol_collection (); + make_cleanup (discard_minimal_symbols, 0); + + /* Now that the executable file is positioned at symbol table, + process it and define symbols accordingly. */ + + read_dst_symtab (objfile); + + /* Sort symbols alphabetically within each block. */ + + { + struct symtab *s; + for (s = objfile -> symtabs; s != NULL; s = s -> next) + { + sort_symtab_syms (s); + } + } + + /* Install any minimal symbols that have been collected as the current + minimal symbols for this objfile. */ + + install_minimal_symbols (objfile); +} + +static void +dst_new_init (ignore) + struct objfile *ignore; +{ + /* Nothin' to do */ +} + +/* Perform any local cleanups required when we are done with a particular + objfile. I.E, we are in the process of discarding all symbol information + for an objfile, freeing up all memory held for it, and unlinking the + objfile struct from the global list of known objfiles. */ + +static void +dst_symfile_finish (objfile) + struct objfile *objfile; +{ + /* Nothing to do */ +} + + +/* Get the next line number from the DST. Returns 0 when we hit an + * end directive or cannot continue for any other reason. + * + * Note that ordinary pc deltas are multiplied by two. Apparently + * this is what was really intended. + */ +static int +get_dst_line(buffer, pc) + signed char **buffer; + long *pc; +{ + static last_pc = 0; + static long last_line = 0; + static int last_file = 0; + dst_ln_entry_ptr_t entry; + int size; + dst_src_loc_t *src_loc; + + if (*pc != -1) + { + last_pc = *pc; + *pc = -1; + } + entry = (dst_ln_entry_ptr_t) *buffer; + + while (dst_ln_ln_delta(*entry) == dst_ln_escape_flag) + { + switch(entry->esc.esc_code) + { + case dst_ln_pad: + size = 1; /* pad byte */ + break; + case dst_ln_file: + /* file escape. Next 4 bytes are a dst_src_loc_t */ + size = 5; + src_loc = (dst_src_loc_t *) (*buffer + 1); + last_line = src_loc->line_number; + last_file = src_loc->file_index; + break; + case dst_ln_dln1_dpc1: + /* 1 byte line delta, 1 byte pc delta */ + last_line += (*buffer)[1]; + last_pc += 2 * (unsigned char) (*buffer)[2]; + dst_record_line(last_line, last_pc); + size = 3; + break; + case dst_ln_dln2_dpc2: + /* 2 bytes line delta, 2 bytes pc delta */ + last_line += *(short *) (*buffer + 1); + last_pc += 2 * (*(short *) (*buffer + 3)); + size = 5; + dst_record_line(last_line, last_pc); + break; + case dst_ln_ln4_pc4: + /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */ + last_line = *(unsigned long *) (*buffer + 1); + last_pc = *(unsigned long *) (*buffer + 5); + size = 9; + dst_record_line(last_line, last_pc); + break; + case dst_ln_dln1_dpc0: + /* 1 byte line delta, pc delta = 0 */ + size = 2; + last_line+= (*buffer)[1]; + break; + case dst_ln_ln_off_1: + /* statement escape, stmt # = 1 (2nd stmt on line) */ + size = 1; + break; + case dst_ln_ln_off: + /* statement escape, stmt # = next byte */ + size = 2; + break; + case dst_ln_entry: + /* entry escape, next byte is entry number */ + size = 2; + break; + case dst_ln_exit: + /* exit escape */ + size = 1; + break; + case dst_ln_stmt_end: + /* gap escape, 4 bytes pc delta */ + size = 5; + /* last_pc += 2 * (*(long *) (*buffer + 1)); */ + /* Apparently this isn't supposed to actually modify + * the pc value. Totally weird. + */ + break; + case dst_ln_escape_11: + case dst_ln_escape_12: + case dst_ln_escape_13: + size = 1; + break; + case dst_ln_nxt_byte: + /* This shouldn't happen. If it does, we're SOL */ + return 0; + break; + case dst_ln_end: + /* end escape, final entry follows */ + return 0; + } + *buffer += (size < 0) ? -size : size; + entry = (dst_ln_entry_ptr_t) *buffer; + } + last_line += dst_ln_ln_delta(*entry); + last_pc += entry->delta.pc_delta * 2; + (*buffer)++; + dst_record_line(last_line, last_pc); + return 1; +} + +static void +enter_all_lines(buffer, address) + char *buffer; + long address; +{ + if (buffer) + while (get_dst_line(&buffer, &address)); +} + +static int +get_dst_entry(buffer, ret_entry) + char *buffer; + dst_rec_ptr_t *ret_entry; +{ + int size; + dst_rec_ptr_t entry; + static int last_type; + int ar_size; + static unsigned lu3; + + entry = (dst_rec_ptr_t) buffer; + switch(entry->rec_type) + { + case dst_typ_pad: + size = 0; + break; + case dst_typ_comp_unit: + size = sizeof(DST_comp_unit(entry)); + break; + case dst_typ_section_tab: + size = sizeof(DST_section_tab(entry)) + + ((int) DST_section_tab(entry).number_of_sections + - dst_dummy_array_size) * sizeof(long); + break; + case dst_typ_file_tab: + size = sizeof(DST_file_tab(entry)) + + ((int) DST_file_tab(entry).number_of_files + - dst_dummy_array_size) * sizeof(dst_file_desc_t); + break; + case dst_typ_block: + size = sizeof(DST_block(entry)) + + ((int) DST_block(entry).n_of_code_ranges + - dst_dummy_array_size) * sizeof(dst_code_range_t); + break; + case dst_typ_5: + size = -1; + break; + case dst_typ_var: + size = sizeof(DST_var(entry)) - + sizeof(dst_var_loc_long_t) * dst_dummy_array_size + + DST_var(entry).no_of_locs * + ( DST_var(entry).short_locs ? + sizeof(dst_var_loc_short_t): + sizeof(dst_var_loc_long_t)); + break; + case dst_typ_pointer: + size = sizeof(DST_pointer(entry)); + break; + case dst_typ_array: + size = sizeof(DST_array(entry)); + break; + case dst_typ_subrange: + size = sizeof(DST_subrange(entry)); + break; + case dst_typ_set: + size = sizeof(DST_set(entry)); + break; + case dst_typ_implicit_enum: + size = sizeof(DST_implicit_enum(entry)) + + ((int) DST_implicit_enum(entry).nelems + - dst_dummy_array_size) * sizeof(dst_rel_offset_t); + break; + case dst_typ_explicit_enum: + size = sizeof(DST_explicit_enum(entry)) + + ((int) DST_explicit_enum(entry).nelems + - dst_dummy_array_size) * sizeof(dst_enum_elem_t); + break; + case dst_typ_short_rec: + size = sizeof(DST_short_rec(entry)) + + DST_short_rec(entry).nfields * sizeof(dst_short_field_t) + - dst_dummy_array_size * sizeof(dst_field_t); + break; + case dst_typ_short_union: + size = sizeof(DST_short_union(entry)) + + DST_short_union(entry).nfields * sizeof(dst_short_field_t) + - dst_dummy_array_size * sizeof(dst_field_t); + break; + case dst_typ_file: + size = sizeof(DST_file(entry)); + break; + case dst_typ_offset: + size = sizeof(DST_offset(entry)); + break; + case dst_typ_alias: + size = sizeof(DST_alias(entry)); + break; + case dst_typ_signature: + size = sizeof(DST_signature(entry)) + + ((int) DST_signature(entry).nargs - + dst_dummy_array_size) * sizeof(dst_arg_t); + break; + case dst_typ_21: + size = -1; + break; + case dst_typ_old_label: + size = sizeof(DST_old_label(entry)); + break; + case dst_typ_scope: + size = sizeof(DST_scope(entry)); + break; + case dst_typ_end_scope: + size = 0; + break; + case dst_typ_25: + case dst_typ_26: + size = -1; + break; + case dst_typ_string_tab: + case dst_typ_global_name_tab: + size = sizeof(DST_string_tab(entry)) + + DST_string_tab(entry).length + - dst_dummy_array_size; + break; + case dst_typ_forward: + size = sizeof(DST_forward(entry)); + get_dst_entry((char *) entry + DST_forward(entry).rec_off, &entry); + break; + case dst_typ_aux_size: + size = sizeof(DST_aux_size(entry)); + break; + case dst_typ_aux_align: + size = sizeof(DST_aux_align(entry)); + break; + case dst_typ_aux_field_size: + size = sizeof(DST_aux_field_size(entry)); + break; + case dst_typ_aux_field_off: + size = sizeof(DST_aux_field_off(entry)); + break; + case dst_typ_aux_field_align: + size = sizeof(DST_aux_field_align(entry)); + break; + case dst_typ_aux_qual: + size = sizeof(DST_aux_qual(entry)); + break; + case dst_typ_aux_var_bound: + size = sizeof(DST_aux_var_bound(entry)); + break; + case dst_typ_extension: + size = DST_extension(entry).rec_size; + break; + case dst_typ_string: + size = sizeof(DST_string(entry)); + break; + case dst_typ_old_entry: + size = 48; /* Obsolete entry type */ + break; + case dst_typ_const: + size = sizeof(DST_const(entry)) + + DST_const(entry).value.length + - sizeof(DST_const(entry).value.val); + break; + case dst_typ_reference: + size = sizeof(DST_reference(entry)); + break; + case dst_typ_old_record: + case dst_typ_old_union: + case dst_typ_record: + case dst_typ_union: + size = sizeof(DST_record(entry)) + + ((int) DST_record(entry).nfields + - dst_dummy_array_size) * sizeof(dst_field_t); + break; + case dst_typ_aux_type_deriv: + size = sizeof(DST_aux_type_deriv(entry)); + break; + case dst_typ_locpool: + size = sizeof(DST_locpool(entry)) + + ((int) DST_locpool(entry).length - + dst_dummy_array_size); + break; + case dst_typ_variable: + size = sizeof(DST_variable(entry)); + break; + case dst_typ_label: + size = sizeof(DST_label(entry)); + break; + case dst_typ_entry: + size = sizeof(DST_entry(entry)); + break; + case dst_typ_aux_lifetime: + size = sizeof(DST_aux_lifetime(entry)); + break; + case dst_typ_aux_ptr_base: + size = sizeof(DST_aux_ptr_base(entry)); + break; + case dst_typ_aux_src_range: + size = sizeof(DST_aux_src_range(entry)); + break; + case dst_typ_aux_reg_val: + size = sizeof(DST_aux_reg_val(entry)); + break; + case dst_typ_aux_unit_names: + size = sizeof(DST_aux_unit_names(entry)) + + ((int) DST_aux_unit_names(entry).number_of_names + - dst_dummy_array_size) * sizeof(dst_rel_offset_t); + break; + case dst_typ_aux_sect_info: + size = sizeof(DST_aux_sect_info(entry)) + + ((int) DST_aux_sect_info(entry).number_of_refs + - dst_dummy_array_size) * sizeof(dst_sect_ref_t); + break; + default: + size = -1; + break; + } + if (size == -1) + { + fprintf_unfiltered(gdb_stderr, "Warning: unexpected DST entry type (%d) found\nLast valid entry was of type: %d\n", + (int) entry->rec_type, + last_type); + fprintf_unfiltered(gdb_stderr, "Last unknown_3 value: %d\n", lu3); + size = 0; + } + else + last_type = entry->rec_type; + if (size & 1) /* Align on a word boundary */ + size++; + size += 2; + *ret_entry = entry; + return size; +} + +static int next_dst_entry(buffer, entry, table) + char **buffer; + dst_rec_ptr_t *entry; + dst_sec *table; +{ + if (*buffer - table->buffer >= table->size) + { + *entry = NULL; + return 0; + } + *buffer += get_dst_entry(*buffer, entry); + return 1; +} + +#define NEXT_BLK(a, b) next_dst_entry(a, b, &blocks_info) +#define NEXT_SYM(a, b) next_dst_entry(a, b, &symbols_info) +#define DST_OFFSET(a, b) ((char *) (a) + (b)) + +static dst_rec_ptr_t section_table = NULL; + +char * +get_sec_ref(ref) + dst_sect_ref_t *ref; +{ + dst_sec *section = NULL; + long offset; + + if (!section_table || !ref->sect_index) + return NULL; + offset = DST_section_tab(section_table).section_base[ref->sect_index-1] + + ref->sect_offset; + if (offset >= blocks_info.base && + offset < blocks_info.base + blocks_info.size) + section = &blocks_info; + else if (offset >= symbols_info.base && + offset < symbols_info.base + symbols_info.size) + section = &symbols_info; + else if (offset >= lines_info.base && + offset < lines_info.base + lines_info.size) + section = &lines_info; + if (!section) + return NULL; + return section->buffer + (offset - section->base); +} + +CORE_ADDR +dst_get_addr(int section, long offset) +{ + if (!section_table || !section) + return 0; + return DST_section_tab(section_table).section_base[section-1] + offset; +} + +CORE_ADDR +dst_sym_addr(ref) + dst_sect_ref_t *ref; +{ + if (!section_table || !ref->sect_index) + return 0; + return DST_section_tab(section_table).section_base[ref->sect_index-1] + + ref->sect_offset; +} + +static struct type * +create_new_type(objfile) + struct objfile *objfile; +{ + struct type *type; + + type = (struct type *) + obstack_alloc (&objfile->symbol_obstack, sizeof (struct type)); + memset(type, 0, sizeof(struct type)); + return type; +} + +static struct symbol * +create_new_symbol(objfile, name) + struct objfile *objfile; + char *name; +{ + struct symbol *sym = (struct symbol *) + obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); + memset (sym, 0, sizeof (struct symbol)); + SYMBOL_NAME (sym) = obstack_copy0 (&objfile->symbol_obstack, + name, strlen (name)); + SYMBOL_VALUE (sym) = 0; + SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + + SYMBOL_CLASS (sym) = LOC_BLOCK; + return sym; +}; + +static struct type * +decode_dst_type PARAMS ((struct objfile *, dst_rec_ptr_t)); + +static struct type * +decode_type_desc(objfile, type_desc, base) + struct objfile *objfile; + dst_type_t *type_desc; + dst_rec_ptr_t base; +{ + struct type *type; + dst_rec_ptr_t entry; + if (type_desc->std_type.user_defined_type) + { + entry = (dst_rec_ptr_t) DST_OFFSET(base, + dst_user_type_offset(*type_desc)); + type = decode_dst_type(objfile, entry); + } + else + { + switch(type_desc->std_type.dtc) + { + case dst_int8_type: + type = builtin_type_signed_char; + break; + case dst_int16_type: + type = builtin_type_short; + break; + case dst_int32_type: + type = builtin_type_long; + break; + case dst_uint8_type: + type = builtin_type_unsigned_char; + break; + case dst_uint16_type: + type = builtin_type_unsigned_short; + break; + case dst_uint32_type: + type = builtin_type_unsigned_long; + break; + case dst_real32_type: + type = builtin_type_float; + break; + case dst_real64_type: + type = builtin_type_double; + break; + case dst_complex_type: + type = builtin_type_complex; + break; + case dst_dcomplex_type: + type = builtin_type_double_complex; + break; + case dst_bool8_type: + type = builtin_type_char; + break; + case dst_bool16_type: + type = builtin_type_short; + break; + case dst_bool32_type: + type = builtin_type_long; + break; + case dst_char_type: + type = builtin_type_char; + break; + /* The next few are more complex. I will take care + * of them properly at a later point. + */ + case dst_string_type: + type = builtin_type_void; + break; + case dst_ptr_type: + type = builtin_type_void; + break; + case dst_set_type: + type = builtin_type_void; + break; + case dst_proc_type: + type = builtin_type_void; + break; + case dst_func_type: + type = builtin_type_void; + break; + /* Back tto some ordinary ones */ + case dst_void_type: + type = builtin_type_void; + break; + case dst_uchar_type: + type = builtin_type_unsigned_char; + break; + default: + type = builtin_type_void; + break; + } + } + return type; +} + +struct structure_list + { + struct structure_list *next; + struct type *type; + }; + +static struct structure_list *struct_list = NULL; + +static struct type * +find_dst_structure(name) + char *name; +{ + struct structure_list *element; + + for (element = struct_list; element; element = element->next) + if (!strcmp(name, TYPE_NAME(element->type))) + return element->type; + return NULL; +} + + +static struct type * +decode_dst_structure(objfile, entry, code, version) + struct objfile *objfile; + dst_rec_ptr_t entry; + int code; + int version; +{ + struct type *type, *child_type; + char *struct_name; + char *name, *field_name; + int i; + int fieldoffset, fieldsize; + dst_type_t type_desc; + struct structure_list *element; + + struct_name = DST_OFFSET(entry, DST_record(entry).noffset); + name = concat( (code == TYPE_CODE_UNION)?"union ":"struct ", + struct_name, NULL); + type = find_dst_structure(name); + if (type) + { + free((PTR) name); + return type; + } + type = create_new_type(objfile); + TYPE_NAME(type) = obstack_copy0 (&objfile->symbol_obstack, + name, strlen(name)); + free((PTR) name); + TYPE_CODE(type) = code; + TYPE_LENGTH(type) = DST_record(entry).size; + TYPE_NFIELDS(type) = DST_record(entry).nfields; + TYPE_FIELDS(type) = (struct field *) + obstack_alloc (&objfile->symbol_obstack, sizeof (struct field) * + DST_record(entry).nfields); + fieldoffset = fieldsize = 0; + INIT_CPLUS_SPECIFIC(type); + element = (struct structure_list *) + xmalloc(sizeof(struct structure_list)); + element->type = type; + element->next = struct_list; + struct_list = element; + for (i = 0; i < DST_record(entry).nfields; i++) + { + switch (version) + { + case 2: + field_name = DST_OFFSET(entry, + DST_record(entry).f.ofields[i].noffset); + fieldoffset = DST_record(entry).f.ofields[i].foffset*8 + + DST_record(entry).f.ofields[i].bit_offset; + fieldsize = DST_record(entry).f.ofields[i].size; + type_desc = DST_record(entry).f.ofields[i].type_desc; + break; + case 1: + field_name = DST_OFFSET(entry, + DST_record(entry).f.fields[i].noffset); + type_desc = DST_record(entry).f.fields[i].type_desc; + switch(DST_record(entry).f.fields[i].f.field_loc.format_tag) + { + case dst_field_byte: + fieldoffset = DST_record(entry).f. + fields[i].f.field_byte.offset * 8; + fieldsize = -1; + break; + case dst_field_bit: + fieldoffset = DST_record(entry).f. + fields[i].f.field_bit.byte_offset * 8 + + DST_record(entry).f. + fields[i].f.field_bit.bit_offset; + fieldsize = DST_record(entry).f. + fields[i].f.field_bit.nbits; + break; + case dst_field_loc: + fieldoffset += fieldsize; + fieldsize = -1; + break; + } + break; + case 0: + field_name = DST_OFFSET(entry, + DST_record(entry).f.sfields[i].noffset); + fieldoffset = DST_record(entry).f.sfields[i].foffset; + type_desc = DST_record(entry).f.sfields[i].type_desc; + if (i < DST_record(entry).nfields - 1) + fieldsize = DST_record(entry).f.sfields[i+1].foffset; + else + fieldsize = DST_record(entry).size; + fieldsize -= fieldoffset; + fieldoffset *= 8; + fieldsize *= 8; + } + TYPE_FIELDS(type)[i].name = + obstack_copy0 (&objfile->symbol_obstack, + field_name, strlen(field_name)); + TYPE_FIELDS(type)[i].type = decode_type_desc(objfile, + &type_desc, + entry); + if (fieldsize == -1) + fieldsize = TYPE_LENGTH(TYPE_FIELDS(type)[i].type) * + 8; + TYPE_FIELDS(type)[i].bitsize = fieldsize; + TYPE_FIELDS(type)[i].bitpos = fieldoffset; + } + return type; +} + +static struct type * +decode_dst_type(objfile, entry) + struct objfile *objfile; + dst_rec_ptr_t entry; +{ + struct type *child_type, *type, *range_type, *index_type; + + switch(entry->rec_type) + { + case dst_typ_var: + return decode_type_desc(objfile, + &DST_var(entry).type_desc, + entry); + break; + case dst_typ_variable: + return decode_type_desc(objfile, + &DST_variable(entry).type_desc, + entry); + break; + case dst_typ_short_rec: + return decode_dst_structure(objfile, entry, TYPE_CODE_STRUCT,0); + case dst_typ_short_union: + return decode_dst_structure(objfile, entry, TYPE_CODE_UNION, 0); + case dst_typ_union: + return decode_dst_structure(objfile, entry, TYPE_CODE_UNION, 1); + case dst_typ_record: + return decode_dst_structure(objfile, entry, TYPE_CODE_STRUCT,1); + case dst_typ_old_union: + return decode_dst_structure(objfile, entry, TYPE_CODE_UNION, 2); + case dst_typ_old_record: + return decode_dst_structure(objfile, entry, TYPE_CODE_STRUCT,2); + case dst_typ_pointer: + return make_pointer_type( + decode_type_desc(objfile, + &DST_pointer(entry).type_desc, + entry), + NULL); + case dst_typ_array: + child_type = decode_type_desc(objfile, + &DST_pointer(entry).type_desc, + entry); + index_type = lookup_fundamental_type(objfile, + FT_INTEGER); + range_type = create_range_type ((struct type *) NULL, + index_type, DST_array(entry).lo_bound, + DST_array(entry).hi_bound); + return create_array_type ((struct type *) NULL, child_type, + range_type); + case dst_typ_alias: + return decode_type_desc(objfile, + &DST_alias(entry).type_desc, + entry); + default: + return builtin_type_int; + } +} + +struct symbol_list { + struct symbol_list *next; + struct symbol *symbol; +}; + +static struct symbol_list *dst_global_symbols = NULL; +static int total_globals = 0; + +static void +decode_dst_locstring(locstr, sym) + char *locstr; + struct symbol *sym; +{ + dst_loc_entry_t *entry, *next_entry; + CORE_ADDR temp; + int count = 0; + + while(1) + { + if (count++ == 100) + { + fprintf_unfiltered(gdb_stderr, "Error reading locstring\n"); + break; + } + entry = (dst_loc_entry_t *) locstr; + next_entry = (dst_loc_entry_t *) (locstr + 1); + switch (entry->header.code) + { + case dst_lsc_end: /* End of string */ + return; + case dst_lsc_indirect:/* Indirect through previous. Arg == 6 */ + /* Or register ax x == arg */ + if (entry->header.arg < 6) + { + SYMBOL_CLASS(sym) = LOC_REGISTER; + SYMBOL_VALUE(sym) = entry->header.arg + 8; + } + /* We predict indirects */ + locstr++; + break; + case dst_lsc_dreg: + SYMBOL_CLASS(sym) = LOC_REGISTER; + SYMBOL_VALUE(sym) = entry->header.arg; + locstr++; + break; + case dst_lsc_section:/* Section (arg+1) */ + SYMBOL_VALUE(sym) = dst_get_addr(entry->header.arg+1, 0); + locstr++; + break; + case dst_lsc_sec_byte: /* Section (next_byte+1) */ + SYMBOL_VALUE(sym) = dst_get_addr(locstr[1]+1, 0); + locstr+=2; + break; + case dst_lsc_add: /* Add (arg+1)*2 */ + case dst_lsc_sub: /* Subtract (arg+1)*2 */ + temp = (entry->header.arg + 1) * 2; + locstr++; + if (*locstr == dst_multiply_256) + { + temp <<= 8; + locstr++; + } + switch(entry->header.code) + { + case dst_lsc_add: + if (SYMBOL_CLASS(sym) == LOC_LOCAL) + SYMBOL_CLASS(sym) = LOC_ARG; + SYMBOL_VALUE(sym) += temp; + break; + case dst_lsc_sub: + SYMBOL_VALUE(sym) -= temp; + break; + } + break; + case dst_lsc_add_byte: + case dst_lsc_sub_byte: + switch (entry->header.arg & 0x03) + { + case 1: + temp = (unsigned char) locstr[1]; + locstr += 2; + break; + case 2: + temp = * (unsigned short *) (locstr + 1); + locstr += 3; + break; + case 3: + temp = * (unsigned long *) (locstr + 1); + locstr += 5; + break; + } + if (*locstr == dst_multiply_256) + { + temp <<= 8; + locstr++; + } + switch(entry->header.code) + { + case dst_lsc_add_byte: + if (SYMBOL_CLASS(sym) == LOC_LOCAL) + SYMBOL_CLASS(sym) = LOC_ARG; + SYMBOL_VALUE(sym) += temp; + break; + case dst_lsc_sub_byte: + SYMBOL_VALUE(sym) -= temp; + break; + } + break; + case dst_lsc_sbreg: /* Stack base register (frame pointer). Arg==0*/ + if (next_entry->header.code != dst_lsc_indirect) + { + SYMBOL_VALUE(sym) = 0; + SYMBOL_CLASS(sym) = LOC_STATIC; + return; + } + SYMBOL_VALUE(sym) = 0; + SYMBOL_CLASS(sym) = LOC_LOCAL; + locstr++; + break; + default: + SYMBOL_VALUE(sym) = 0; + SYMBOL_CLASS(sym) = LOC_STATIC; + return; + } + } +} + +static struct symbol_list * +process_dst_symbols(objfile, entry, name, nsyms_ret) + struct objfile *objfile; + dst_rec_ptr_t entry; + char *name; + int *nsyms_ret; +{ + struct symbol_list *list = NULL, *element; + struct symbol *sym; + char *symname; + int nsyms = 0; + char *location; + long line; + dst_type_t symtype; + struct type *type; + dst_var_attr_t attr; + dst_var_loc_t loc_type; + unsigned loc_index; + long loc_value; + + if (!entry) + { + *nsyms_ret = 0; + return NULL; + } + location = (char *) entry; + while (NEXT_SYM(&location, &entry) && + entry->rec_type != dst_typ_end_scope) + { + if (entry->rec_type == dst_typ_var) + { + if (DST_var(entry).short_locs) + { + loc_type = DST_var(entry).locs.shorts[0].loc_type; + loc_index = DST_var(entry).locs.shorts[0].loc_index; + loc_value = DST_var(entry).locs.shorts[0].location; + } + else + { + loc_type = DST_var(entry).locs.longs[0].loc_type; + loc_index = DST_var(entry).locs.longs[0].loc_index; + loc_value = DST_var(entry).locs.longs[0].location; + } + if (loc_type == dst_var_loc_external) + continue; + symname = DST_OFFSET(entry, DST_var(entry).noffset); + line = DST_var(entry).src_loc.line_number; + symtype = DST_var(entry).type_desc; + attr = DST_var(entry).attributes; + } + else if (entry->rec_type == dst_typ_variable) + { + symname = DST_OFFSET(entry, + DST_variable(entry).noffset); + line = DST_variable(entry).src_loc.line_number; + symtype = DST_variable(entry).type_desc; + attr = DST_variable(entry).attributes; + } + else + { + continue; + } + if (symname && name && !strcmp(symname, name)) + /* It's the function return value */ + continue; + sym = create_new_symbol(objfile, symname); + + if ((attr & (1<<dst_var_attr_global)) || + (attr & (1<<dst_var_attr_static))) + SYMBOL_CLASS(sym) = LOC_STATIC; + else + SYMBOL_CLASS(sym) = LOC_LOCAL; + SYMBOL_LINE(sym) = line; + SYMBOL_TYPE(sym) = decode_type_desc(objfile, &symtype, + entry); + SYMBOL_VALUE(sym) = 0; + switch (entry->rec_type) + { + case dst_typ_var: + switch(loc_type) + { + case dst_var_loc_abs: + SYMBOL_VALUE_ADDRESS(sym) = loc_value; + break; + case dst_var_loc_sect_off: + case dst_var_loc_ind_sect_off: /* What is this? */ + SYMBOL_VALUE_ADDRESS(sym) = dst_get_addr( + loc_index, + loc_value); + break; + case dst_var_loc_ind_reg_rel: /* What is this? */ + case dst_var_loc_reg_rel: + /* If it isn't fp relative, specify the + * register it's relative to. + */ + if (loc_index) + { + sym->aux_value.basereg = loc_index; + } + SYMBOL_VALUE(sym) = loc_value; + if (loc_value > 0 && + SYMBOL_CLASS(sym) == LOC_BASEREG) + SYMBOL_CLASS(sym) = LOC_BASEREG_ARG; + break; + case dst_var_loc_reg: + SYMBOL_VALUE(sym) = loc_index; + SYMBOL_CLASS(sym) = LOC_REGISTER; + break; + } + break; + case dst_typ_variable: + /* External variable..... don't try to interpret + * its nonexistant locstring. + */ + if (DST_variable(entry).loffset == -1) + continue; + decode_dst_locstring(DST_OFFSET(entry, + DST_variable(entry).loffset), + sym); + } + element = (struct symbol_list *) + xmalloc(sizeof(struct symbol_list)); + + if (attr & (1<<dst_var_attr_global)) + { + element->next = dst_global_symbols; + dst_global_symbols = element; + total_globals++; + } + else + { + element->next = list; + list = element; + nsyms++; + } + element->symbol = sym; + } + *nsyms_ret = nsyms; + return list; +} + + +static struct symbol * +process_dst_function(objfile, entry, name, address) + struct objfile *objfile; + dst_rec_ptr_t entry; + char *name; + CORE_ADDR address; +{ + struct symbol *sym; + struct type *type, *ftype; + dst_rec_ptr_t sym_entry, typ_entry; + char *location; + struct symbol_list *element; + + type = builtin_type_int; + sym = create_new_symbol(objfile, name); + SYMBOL_CLASS(sym) = LOC_BLOCK; + + if (entry) + { + location = (char *) entry; + do + { + NEXT_SYM(&location, &sym_entry); + } while (sym_entry && sym_entry->rec_type != dst_typ_signature); + + if (sym_entry) + { + SYMBOL_LINE(sym) = + DST_signature(sym_entry).src_loc.line_number; + if (DST_signature(sym_entry).result) + { + typ_entry = (dst_rec_ptr_t) + DST_OFFSET(sym_entry, + DST_signature(sym_entry).result); + type = decode_dst_type(objfile, typ_entry); + } + } + } + + if (!type->function_type) + { + ftype = create_new_type(objfile); + type->function_type = ftype; + ftype->target_type = type; + ftype->code = TYPE_CODE_FUNC; + } + SYMBOL_TYPE(sym) = type->function_type; + + /* Now add ourselves to the global symbols list */ + element = (struct symbol_list *) + xmalloc(sizeof(struct symbol_list)); + + element->next = dst_global_symbols; + dst_global_symbols = element; + total_globals++; + element->symbol = sym; + + return sym; +} + +static struct block * +process_dst_block(objfile, entry) + struct objfile *objfile; + dst_rec_ptr_t entry; +{ + struct block *block; + struct symbol *function = NULL; + CORE_ADDR address; + long size; + char *name; + dst_rec_ptr_t child_entry, symbol_entry; + struct block *child_block; + int total_symbols = 0; + struct pending_block *pblock; + char fake_name[20]; + static long fake_seq = 0; + struct symbol_list *symlist, *nextsym; + int symnum; + + if (DST_block(entry).noffset) + name = DST_OFFSET(entry, DST_block(entry).noffset); + else + name = NULL; + if (DST_block(entry).n_of_code_ranges) + { + address = dst_sym_addr( + &DST_block(entry).code_ranges[0].code_start); + size = DST_block(entry).code_ranges[0].code_size; + } + else + { + address = -1; + size = 0; + } + symbol_entry = (dst_rec_ptr_t) get_sec_ref(&DST_block(entry).symbols_start); + switch(DST_block(entry).block_type) + { + /* These are all really functions. Even the "program" type. + * This is because the Apollo OS was written in Pascal, and + * in Pascal, the main procedure is described as the Program. + * Cute, huh? + */ + case dst_block_procedure: + case dst_block_function: + case dst_block_subroutine: + case dst_block_program: + record_minimal_symbol(name, address, mst_text, objfile); + function = process_dst_function( + objfile, + symbol_entry, + name, + address); + enter_all_lines(get_sec_ref(&DST_block(entry).code_ranges[0].lines_start), address); + break; + case dst_block_block_data: + break; + + default: + /* GDB has to call it something, and the module name + * won't cut it + */ + sprintf(fake_name, "block_%08lx", fake_seq++); + function = process_dst_function( + objfile, NULL, fake_name, address); + break; + } + symlist = process_dst_symbols(objfile, symbol_entry, + name, &total_symbols); + block = (struct block *) + obstack_alloc (&objfile->symbol_obstack, + sizeof (struct block) + + (total_symbols - 1) * sizeof (struct symbol *)); + + symnum = 0; + while (symlist) + { + nextsym = symlist->next; + + block->sym[symnum] = symlist->symbol; + + free((PTR) symlist); + symlist = nextsym; + symnum++; + } + BLOCK_NSYMS (block) = total_symbols; + BLOCK_START (block) = address; + BLOCK_END (block) = address + size; + BLOCK_SUPERBLOCK (block) = 0; + if (function) + { + SYMBOL_BLOCK_VALUE (function) = block; + BLOCK_FUNCTION (block) = function; + } + else + BLOCK_FUNCTION (block) = 0; + + pblock = (struct pending_block *) + xmalloc (sizeof (struct pending_block)); + pblock->block = block; + pblock->next = pending_blocks; + pending_blocks = pblock; + if (DST_block(entry).child_block_off) + { + child_entry = (dst_rec_ptr_t) DST_OFFSET(entry, + DST_block(entry).child_block_off); + while (child_entry) + { + child_block = process_dst_block(objfile, child_entry); + if (child_block) + { + if (BLOCK_START(child_block) < + BLOCK_START(block) || + BLOCK_START(block) == -1) + BLOCK_START(block) = + BLOCK_START(child_block); + if (BLOCK_END(child_block) > + BLOCK_END(block) || + BLOCK_END(block) == -1) + BLOCK_END(block) = + BLOCK_END(child_block); + BLOCK_SUPERBLOCK (child_block) = block; + } + if (DST_block(child_entry).sibling_block_off) + child_entry = (dst_rec_ptr_t) DST_OFFSET( + child_entry, + DST_block(child_entry).sibling_block_off); + else + child_entry = NULL; + } + } + return block; +} + + +static void +read_dst_symtab (objfile) + struct objfile *objfile; +{ + char *buffer; + dst_rec_ptr_t entry, file_table, root_block; + char *source_file; + struct block *block, *global_block; + struct pending_block *pblock; + int symnum; + struct symbol_list *nextsym; + int module_num = 0; + struct structure_list *element; + + current_objfile = objfile; + buffer = blocks_info.buffer; + while (NEXT_BLK(&buffer, &entry)) + { + if (entry->rec_type == dst_typ_comp_unit) + { + file_table = (dst_rec_ptr_t) DST_OFFSET(entry, + DST_comp_unit(entry).file_table); + section_table = (dst_rec_ptr_t) DST_OFFSET(entry, + DST_comp_unit(entry).section_table); + root_block = (dst_rec_ptr_t) DST_OFFSET(entry, + DST_comp_unit(entry).root_block_offset); + source_file = DST_OFFSET(file_table, + DST_file_tab(file_table).files[0].noffset); + /* Point buffer to the start of the next comp_unit */ + buffer = DST_OFFSET(entry, + DST_comp_unit(entry).data_size); + dst_start_symtab(); + + pblock = (struct pending_block *) + xmalloc (sizeof (struct pending_block)); + pblock->next = NULL; + pending_blocks = pblock; + + block = process_dst_block(objfile, root_block); + + global_block = (struct block *) + obstack_alloc (&objfile->symbol_obstack, + sizeof (struct block) + + (total_globals - 1) * + sizeof (struct symbol *)); + BLOCK_NSYMS(global_block) = total_globals; + for (symnum = 0; symnum < total_globals; symnum++) + { + nextsym = dst_global_symbols->next; + + global_block->sym[symnum] = + dst_global_symbols->symbol; + + free((PTR) dst_global_symbols); + dst_global_symbols = nextsym; + } + dst_global_symbols = NULL; + total_globals = 0; + BLOCK_FUNCTION(global_block) = 0; + BLOCK_START(global_block) = BLOCK_START(block); + BLOCK_END(global_block) = BLOCK_END(block); + BLOCK_SUPERBLOCK(global_block) = 0; + BLOCK_SUPERBLOCK(block) = global_block; + pblock->block = global_block; + + complete_symtab(source_file, + BLOCK_START(block), + BLOCK_END(block) - BLOCK_START(block)); + module_num++; + dst_end_symtab(objfile); + } + } + if (module_num) + record_minimal_symbol("<end_of_program>", + BLOCK_END(block), mst_text, objfile); + /* One more faked symbol to make sure nothing can ever run off the + * end of the symbol table. This one represents the end of the + * text space. It used to be (CORE_ADDR) -1 (effectively the highest + * int possible), but some parts of gdb treated it as a signed + * number and failed comparisons. We could equally use 7fffffff, + * but no functions are ever mapped to an address higher than + * 40000000 + */ + record_minimal_symbol("<end_of_text>", + (CORE_ADDR) 0x40000000, + mst_text, objfile); + while (struct_list) + { + element = struct_list; + struct_list = element->next; + free((PTR) element); + } +} + + +/* Support for line number handling */ +static char *linetab = NULL; +static long linetab_offset; +static unsigned long linetab_size; + +/* Read in all the line numbers for fast lookups later. Leave them in + external (unswapped) format in memory; we'll swap them as we enter + them into GDB's data structures. */ +static int +init_one_section(chan, secinfo) + int chan; + dst_sec *secinfo; +{ + if (secinfo->size == 0 + || lseek(chan, secinfo->position, 0) == -1 + || (secinfo->buffer = xmalloc(secinfo->size)) == NULL + || myread(chan, secinfo->buffer, secinfo->size) == -1) + return 0; + else + return 1; +} + +static int +init_dst_sections (chan) + int chan; +{ + + if (!init_one_section(chan, &blocks_info) || + !init_one_section(chan, &lines_info) || + !init_one_section(chan, &symbols_info)) + return -1; + else + return 0; +} + +/* Fake up support for relocating symbol addresses. FIXME. */ + +struct section_offsets dst_symfile_faker = {0}; + +struct section_offsets * +dst_symfile_offsets (objfile, addr) + struct objfile *objfile; + CORE_ADDR addr; +{ + objfile->num_sections = 1; + return &dst_symfile_faker; +} + +/* Register our ability to parse symbols for DST BFD files */ + +static struct sym_fns dst_sym_fns = +{ + /* FIXME: Can this be integrated with coffread.c? If not, should it be + a separate flavour like ecoff? */ + (enum bfd_flavour)-2, + + dst_new_init, /* sym_new_init: init anything gbl to entire symtab */ + dst_symfile_init, /* sym_init: read initial info, setup for sym_read() */ + dst_symfile_read, /* sym_read: read a symbol file into symtab */ + dst_symfile_finish, /* sym_finish: finished with file, cleanup */ + dst_symfile_offsets, /* sym_offsets: xlate external to internal form */ + NULL /* next: pointer to next struct sym_fns */ +}; + +void +_initialize_dstread () +{ + add_symtab_fns(&dst_sym_fns); +} diff --git a/contrib/gdb/gdb/gould-tdep.c b/contrib/gdb/gdb/gould-tdep.c new file mode 100644 index 0000000000000..79575e087c5d9 --- /dev/null +++ b/contrib/gdb/gdb/gould-tdep.c @@ -0,0 +1,291 @@ +/* GOULD RISC target-dependent code for GDB, the GNU debugger. + Copyright 1986, 1987, 1989, 1991 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "symtab.h" +#include "frame.h" +#include "gdbcore.h" +#if defined GOULD_PN +#include "opcode/pn.h" +#else +#include "opcode/np1.h" +#endif + +/* GOULD RISC instructions are never longer than this many bytes. */ +#define MAXLEN 4 + +/* Number of elements in the opcode table. */ +#define NOPCODES (sizeof gld_opcodes / sizeof gld_opcodes[0]) + + +/* Print the GOULD instruction at address MEMADDR in debugged memory, + on STREAM. Returns length of the instruction, in bytes. */ + +int +gould_print_insn (memaddr, stream) + CORE_ADDR memaddr; + FILE *stream; +{ + unsigned char buffer[MAXLEN]; + register int i; + register char *d; + register int bestmask; + unsigned best; + int temp, index, bestlen; + + read_memory (memaddr, buffer, MAXLEN); + + bestmask = 0; + index = -1; + best = 0xffffffff; + for (i = 0; i < NOPCODES; i++) + { + register unsigned int opcode = gld_opcodes[i].opcode; + register unsigned int mask = gld_opcodes[i].mask; + register unsigned int len = gld_opcodes[i].length; + register unsigned int test; + + /* Get possible opcode bytes into integer */ + test = buffer[0] << 24; + test |= buffer[1] << 16; + test |= buffer[2] << 8; + test |= buffer[3]; + + /* Mask with opcode and see if match */ + if ((opcode & mask) == (test & mask)) + { + /* See if second or third match */ + if (index >= 0) + { + /* Take new one if it looks good */ + if (bestlen == MAXLEN && len == MAXLEN) + { + /* See if lower bits matched */ + if (((bestmask & 3) == 0) && + ((mask & 3) != 0)) + { + bestmask = mask; + bestlen = len; + best = test; + index = i; + } + } + } + else + { + /* First match, save it */ + bestmask = mask; + bestlen = len; + best = test; + index = i; + } + } + } + + /* Handle undefined instructions. */ + if (index < 0) + { + fprintf (stream, "undefined 0%o",(buffer[0]<<8)+buffer[1]); + return 2; + } + + /* Print instruction name */ + fprintf (stream, "%-12s", gld_opcodes[index].name); + + /* Adjust if short instruction */ + if (gld_opcodes[index].length < 4) + { + best >>= 16; + i = 0; + } + else + { + i = 16; + } + + /* Dump out instruction arguments */ + for (d = gld_opcodes[index].args; *d; ++d) + { + switch (*d) + { + case 'f': + fprintf (stream, "%d", (best >> (7 + i)) & 7); + break; + case 'r': + fprintf (stream, "r%d", (best >> (7 + i)) & 7); + break; + case 'R': + fprintf (stream, "r%d", (best >> (4 + i)) & 7); + break; + case 'b': + fprintf (stream, "b%d", (best >> (7 + i)) & 7); + break; + case 'B': + fprintf (stream, "b%d", (best >> (4 + i)) & 7); + break; + case 'v': + fprintf (stream, "b%d", (best >> (7 + i)) & 7); + break; + case 'V': + fprintf (stream, "b%d", (best >> (4 + i)) & 7); + break; + case 'X': + temp = (best >> 20) & 7; + if (temp) + fprintf (stream, "r%d", temp); + else + putc ('0', stream); + break; + case 'A': + temp = (best >> 16) & 7; + if (temp) + fprintf (stream, "(b%d)", temp); + break; + case 'S': + fprintf (stream, "#%d", best & 0x1f); + break; + case 'I': + fprintf (stream, "#%x", best & 0xffff); + break; + case 'O': + fprintf (stream, "%x", best & 0xffff); + break; + case 'h': + fprintf (stream, "%d", best & 0xfffe); + break; + case 'd': + fprintf (stream, "%d", best & 0xfffc); + break; + case 'T': + fprintf (stream, "%d", (best >> 8) & 0xff); + break; + case 'N': + fprintf (stream, "%d", best & 0xff); + break; + default: + putc (*d, stream); + break; + } + } + + /* Return length of instruction */ + return (gld_opcodes[index].length); +} + +/* + * Find the number of arguments to a function. + */ +findarg(frame) + struct frame_info *frame; +{ + register struct symbol *func; + register unsigned pc; + +#ifdef notdef + /* find starting address of frame function */ + pc = get_pc_function_start (frame->pc); + + /* find function symbol info */ + func = find_pc_function (pc); + + /* call blockframe code to look for match */ + if (func != NULL) + return (func->value.block->nsyms / sizeof(int)); +#endif + + return (-1); +} + +/* + * In the case of the NPL, the frame's norminal address is Br2 and the + * previous routines frame is up the stack X bytes. Finding out what + * 'X' is can be tricky. + * + * 1.) stored in the code function header xA(Br1). + * 2.) must be careful of recurssion. + */ +CORE_ADDR +findframe(thisframe) + struct frame_info *thisframe; +{ + register CORE_ADDR pointer; + CORE_ADDR framechain(); +#if 0 + struct frame_info *frame; + + /* Setup toplevel frame structure */ + frame->pc = read_pc(); + frame->next_frame = 0; + frame->frame = read_register (SP_REGNUM); /* Br2 */ + + /* Search for this frame (start at current Br2) */ + do + { + pointer = framechain(frame); + frame->next_frame = frame->frame; + frame->frame = pointer; + frame->pc = FRAME_SAVED_PC(frame); + } + while (frame->next_frame != thisframe); +#endif + + pointer = framechain (thisframe); + + /* stop gap for now, end at __base3 */ + if (thisframe->pc == 0) + return 0; + + return pointer; +} + +/* + * Gdb front-end and internal framechain routine. + * Go back up stack one level. Tricky... + */ +CORE_ADDR +framechain(frame) + register struct frame_info *frame; +{ + register CORE_ADDR func, prevsp; + register unsigned value; + + /* Get real function start address from internal frame address */ + func = get_pc_function_start(frame->pc); + + /* If no stack given, read register Br1 "(sp)" */ + if (!frame->frame) + prevsp = read_register (SP_REGNUM); + else + prevsp = frame->frame; + + /* Check function header, case #2 */ + value = read_memory_integer (func, 4); + if (value) + { + /* 32bit call push value stored in function header */ + prevsp += value; + } + else + { + /* read half-word from suabr at start of function */ + prevsp += read_memory_integer (func + 10, 2); + } + + return (prevsp); +} diff --git a/contrib/gdb/gdb/gould-xdep.c b/contrib/gdb/gdb/gould-xdep.c new file mode 100644 index 0000000000000..bf2c33a1aa191 --- /dev/null +++ b/contrib/gdb/gdb/gould-xdep.c @@ -0,0 +1,130 @@ +/* Low level interface to ptrace, for GDB when running under Unix. + Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "frame.h" +#include "inferior.h" + +#include <sys/param.h> +#include <sys/dir.h> +#include <signal.h> +#include <sys/user.h> +#include <sys/ioctl.h> +#include <fcntl.h> + +#include "gdbcore.h" + +#include <sys/file.h> +#include "gdb_stat.h" + + +/* Work with core dump and executable files, for GDB. + This code would be in corefile.c if it weren't machine-dependent. */ + +void +core_file_command (filename, from_tty) + char *filename; + int from_tty; +{ + int val; + extern char registers[]; + + /* Discard all vestiges of any previous core file + and mark data and stack spaces as empty. */ + + if (corefile) + free (corefile); + corefile = 0; + + if (corechan >= 0) + close (corechan); + corechan = -1; + + data_start = 0; + data_end = 0; + stack_start = STACK_END_ADDR; + stack_end = STACK_END_ADDR; + + /* Now, if a new core file was specified, open it and digest it. */ + + if (filename) + { + filename = tilde_expand (filename); + make_cleanup (free, filename); + + if (have_inferior_p ()) + error ("To look at a core file, you must kill the program with \"kill\"."); + corechan = open (filename, O_RDONLY, 0); + if (corechan < 0) + perror_with_name (filename); + /* 4.2-style (and perhaps also sysV-style) core dump file. */ + { + struct user u; + int reg_offset; + + val = myread (corechan, &u, sizeof u); + if (val < 0) + perror_with_name (filename); + data_start = exec_data_start; + + data_end = data_start + NBPG * u.u_dsize; + stack_start = stack_end - NBPG * u.u_ssize; + data_offset = NBPG * UPAGES; + stack_offset = NBPG * (UPAGES + u.u_dsize); + reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR; + + /* I don't know where to find this info. + So, for now, mark it as not available. */ + core_aouthdr.a_magic = 0; + + /* Read the register values out of the core file and store + them where `read_register' will find them. */ + + { + register int regno; + + for (regno = 0; regno < NUM_REGS; regno++) + { + char buf[MAX_REGISTER_RAW_SIZE]; + + val = lseek (corechan, register_addr (regno, reg_offset), 0); + if (val < 0) + perror_with_name (filename); + + val = myread (corechan, buf, sizeof buf); + if (val < 0) + perror_with_name (filename); + supply_register (regno, buf); + } + } + } + if (filename[0] == '/') + corefile = savestring (filename, strlen (filename)); + else + { + corefile = concat (current_directory, "/", filename, NULL); + } + + flush_cached_frames (); + select_frame (get_current_frame (), 0); + validate_files (); + } + else if (from_tty) + printf ("No core file now.\n"); +} diff --git a/contrib/gdb/gdb/h8300-tdep.c b/contrib/gdb/gdb/h8300-tdep.c new file mode 100644 index 0000000000000..954e25816349b --- /dev/null +++ b/contrib/gdb/gdb/h8300-tdep.c @@ -0,0 +1,478 @@ +/* Target-machine dependent code for Hitachi H8/300, for GDB. + Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* + Contributed by Steve Chamberlain + sac@cygnus.com + */ + +#include "defs.h" +#include "frame.h" +#include "obstack.h" +#include "symtab.h" +#include "dis-asm.h" +#include "gdbcmd.h" +#include "gdbtypes.h" + +#undef NUM_REGS +#define NUM_REGS 11 + +#define UNSIGNED_SHORT(X) ((X) & 0xffff) + +/* an easy to debug H8 stack frame looks like: +0x6df6 push r6 +0x0d76 mov.w r7,r6 +0x6dfn push reg +0x7905 nnnn mov.w #n,r5 or 0x1b87 subs #2,sp +0x1957 sub.w r5,sp + + */ + +#define IS_PUSH(x) ((x & 0xff00)==0x6d00) +#define IS_PUSH_FP(x) (x == 0x6df6) +#define IS_MOVE_FP(x) (x == 0x0d76) +#define IS_MOV_SP_FP(x) (x == 0x0d76) +#define IS_SUB2_SP(x) (x==0x1b87) +#define IS_MOVK_R5(x) (x==0x7905) +#define IS_SUB_R5SP(x) (x==0x1957) + +static CORE_ADDR examine_prologue (); + +void frame_find_saved_regs (); +CORE_ADDR +h8300_skip_prologue (start_pc) + CORE_ADDR start_pc; +{ + short int w; + + w = read_memory_unsigned_integer (start_pc, 2); + /* Skip past all push insns */ + while (IS_PUSH_FP (w)) + { + start_pc += 2; + w = read_memory_unsigned_integer (start_pc, 2); + } + + /* Skip past a move to FP */ + if (IS_MOVE_FP (w)) + { + start_pc += 2; + w = read_memory_unsigned_integer (start_pc, 2); + } + + /* Skip the stack adjust */ + + if (IS_MOVK_R5 (w)) + { + start_pc += 2; + w = read_memory_unsigned_integer (start_pc, 2); + } + if (IS_SUB_R5SP (w)) + { + start_pc += 2; + w = read_memory_unsigned_integer (start_pc, 2); + } + while (IS_SUB2_SP (w)) + { + start_pc += 2; + w = read_memory_unsigned_integer (start_pc, 2); + } + + return start_pc; +} + +int +gdb_print_insn_h8300 (memaddr, info) + bfd_vma memaddr; + disassemble_info *info; +{ + if (h8300hmode) + return print_insn_h8300h (memaddr, info); + else + return print_insn_h8300 (memaddr, info); +} + +/* Given a GDB frame, determine the address of the calling function's frame. + This will be used to create a new GDB frame struct, and then + INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame. + + For us, the frame address is its stack pointer value, so we look up + the function prologue to determine the caller's sp value, and return it. */ + +CORE_ADDR +h8300_frame_chain (thisframe) + struct frame_info *thisframe; +{ + frame_find_saved_regs (thisframe, (struct frame_saved_regs *) 0); + return thisframe->fsr->regs[SP_REGNUM]; +} + +/* Put here the code to store, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. + + We cache the result of doing this in the frame_cache_obstack, since + it is fairly expensive. */ + +void +frame_find_saved_regs (fi, fsr) + struct frame_info *fi; + struct frame_saved_regs *fsr; +{ + register CORE_ADDR next_addr; + register CORE_ADDR *saved_regs; + register int regnum; + register struct frame_saved_regs *cache_fsr; + extern struct obstack frame_cache_obstack; + CORE_ADDR ip; + struct symtab_and_line sal; + CORE_ADDR limit; + + if (!fi->fsr) + { + cache_fsr = (struct frame_saved_regs *) + obstack_alloc (&frame_cache_obstack, + sizeof (struct frame_saved_regs)); + memset (cache_fsr, '\0', sizeof (struct frame_saved_regs)); + + fi->fsr = cache_fsr; + + /* Find the start and end of the function prologue. If the PC + is in the function prologue, we only consider the part that + has executed already. */ + + ip = get_pc_function_start (fi->pc); + sal = find_pc_line (ip, 0); + limit = (sal.end && sal.end < fi->pc) ? sal.end : fi->pc; + + /* This will fill in fields in *fi as well as in cache_fsr. */ + examine_prologue (ip, limit, fi->frame, cache_fsr, fi); + } + + if (fsr) + *fsr = *fi->fsr; +} + +/* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or + is not the address of a valid instruction, the address of the next + instruction beyond ADDR otherwise. *PWORD1 receives the first word + of the instruction.*/ + +CORE_ADDR +NEXT_PROLOGUE_INSN (addr, lim, pword1) + CORE_ADDR addr; + CORE_ADDR lim; + INSN_WORD *pword1; +{ + char buf[2]; + if (addr < lim + 8) + { + read_memory (addr, buf, 2); + *pword1 = extract_signed_integer (buf, 2); + + return addr + 2; + } + return 0; +} + +/* Examine the prologue of a function. `ip' points to the first instruction. + `limit' is the limit of the prologue (e.g. the addr of the first + linenumber, or perhaps the program counter if we're stepping through). + `frame_sp' is the stack pointer value in use in this frame. + `fsr' is a pointer to a frame_saved_regs structure into which we put + info about the registers saved by this frame. + `fi' is a struct frame_info pointer; we fill in various fields in it + to reflect the offsets of the arg pointer and the locals pointer. */ + +static CORE_ADDR +examine_prologue (ip, limit, after_prolog_fp, fsr, fi) + register CORE_ADDR ip; + register CORE_ADDR limit; + CORE_ADDR after_prolog_fp; + struct frame_saved_regs *fsr; + struct frame_info *fi; +{ + register CORE_ADDR next_ip; + int r; + int i; + int have_fp = 0; + register int src; + register struct pic_prologue_code *pcode; + INSN_WORD insn_word; + int size, offset; + /* Number of things pushed onto stack, starts at 2/4, 'cause the + PC is already there */ + unsigned int reg_save_depth = h8300hmode ? 4 : 2; + + unsigned int auto_depth = 0; /* Number of bytes of autos */ + + char in_frame[11]; /* One for each reg */ + + memset (in_frame, 1, 11); + for (r = 0; r < 8; r++) + { + fsr->regs[r] = 0; + } + if (after_prolog_fp == 0) + { + after_prolog_fp = read_register (SP_REGNUM); + } + if (ip == 0 || ip & (h8300hmode ? ~0xffff : ~0xffff)) + return 0; + + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn_word); + + /* Skip over any fp push instructions */ + fsr->regs[6] = after_prolog_fp; + while (next_ip && IS_PUSH_FP (insn_word)) + { + ip = next_ip; + + in_frame[insn_word & 0x7] = reg_save_depth; + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn_word); + reg_save_depth += 2; + } + + /* Is this a move into the fp */ + if (next_ip && IS_MOV_SP_FP (insn_word)) + { + ip = next_ip; + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn_word); + have_fp = 1; + } + + /* Skip over any stack adjustment, happens either with a number of + sub#2,sp or a mov #x,r5 sub r5,sp */ + + if (next_ip && IS_SUB2_SP (insn_word)) + { + while (next_ip && IS_SUB2_SP (insn_word)) + { + auto_depth += 2; + ip = next_ip; + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn_word); + } + } + else + { + if (next_ip && IS_MOVK_R5 (insn_word)) + { + ip = next_ip; + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn_word); + auto_depth += insn_word; + + next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn_word); + auto_depth += insn_word; + } + } + /* Work out which regs are stored where */ + while (next_ip && IS_PUSH (insn_word)) + { + ip = next_ip; + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn_word); + fsr->regs[r] = after_prolog_fp + auto_depth; + auto_depth += 2; + } + + /* The args are always reffed based from the stack pointer */ + fi->args_pointer = after_prolog_fp; + /* Locals are always reffed based from the fp */ + fi->locals_pointer = after_prolog_fp; + /* The PC is at a known place */ + fi->from_pc = read_memory_unsigned_integer (after_prolog_fp + 2, BINWORD); + + /* Rememeber any others too */ + in_frame[PC_REGNUM] = 0; + + if (have_fp) + /* We keep the old FP in the SP spot */ + fsr->regs[SP_REGNUM] = read_memory_unsigned_integer (fsr->regs[6], BINWORD); + else + fsr->regs[SP_REGNUM] = after_prolog_fp + auto_depth; + + return (ip); +} + +void +init_extra_frame_info (fromleaf, fi) + int fromleaf; + struct frame_info *fi; +{ + fi->fsr = 0; /* Not yet allocated */ + fi->args_pointer = 0; /* Unknown */ + fi->locals_pointer = 0; /* Unknown */ + fi->from_pc = 0; +} + +/* Return the saved PC from this frame. + + If the frame has a memory copy of SRP_REGNUM, use that. If not, + just use the register SRP_REGNUM itself. */ + +CORE_ADDR +frame_saved_pc (frame) + struct frame_info *frame; +{ + return frame->from_pc; +} + +CORE_ADDR +frame_locals_address (fi) + struct frame_info *fi; +{ + if (!fi->locals_pointer) + { + struct frame_saved_regs ignore; + + get_frame_saved_regs (fi, &ignore); + + } + return fi->locals_pointer; +} + +/* Return the address of the argument block for the frame + described by FI. Returns 0 if the address is unknown. */ + +CORE_ADDR +frame_args_address (fi) + struct frame_info *fi; +{ + if (!fi->args_pointer) + { + struct frame_saved_regs ignore; + + get_frame_saved_regs (fi, &ignore); + + } + + return fi->args_pointer; +} + +void +h8300_pop_frame () +{ + unsigned regnum; + struct frame_saved_regs fsr; + struct frame_info *frame = get_current_frame (); + + get_frame_saved_regs (frame, &fsr); + + for (regnum = 0; regnum < 8; regnum++) + { + if (fsr.regs[regnum]) + write_register (regnum, read_memory_integer(fsr.regs[regnum]), BINWORD); + + flush_cached_frames (); + } +} + + +struct cmd_list_element *setmemorylist; + +static void +h8300_command(args, from_tty) +{ + extern int h8300hmode; + h8300hmode = 0; +} + +static void +h8300h_command(args, from_tty) +{ + extern int h8300hmode; + h8300hmode = 1; +} + +static void +set_machine (args, from_tty) + char *args; + int from_tty; +{ + printf_unfiltered ("\"set machine\" must be followed by h8300 or h8300h.\n"); + help_list (setmemorylist, "set memory ", -1, gdb_stdout); +} + +void +_initialize_h8300m () +{ + add_prefix_cmd ("machine", no_class, set_machine, + "set the machine type", &setmemorylist, "set machine ", 0, + &setlist); + + add_cmd ("h8300", class_support, h8300_command, + "Set machine to be H8/300.", &setmemorylist); + + add_cmd ("h8300h", class_support, h8300h_command, + "Set machine to be H8/300H.", &setmemorylist); +} + + + +void +print_register_hook (regno) +{ + if (regno == 8) + { + /* CCR register */ + int C, Z, N, V; + unsigned char b[4]; + unsigned char l; + read_relative_register_raw_bytes (regno, b); + l = b[REGISTER_VIRTUAL_SIZE(8) -1]; + printf_unfiltered ("\t"); + printf_unfiltered ("I-%d - ", (l & 0x80) != 0); + printf_unfiltered ("H-%d - ", (l & 0x20) != 0); + N = (l & 0x8) != 0; + Z = (l & 0x4) != 0; + V = (l & 0x2) != 0; + C = (l & 0x1) != 0; + printf_unfiltered ("N-%d ", N); + printf_unfiltered ("Z-%d ", Z); + printf_unfiltered ("V-%d ", V); + printf_unfiltered ("C-%d ", C); + if ((C | Z) == 0) + printf_unfiltered ("u> "); + if ((C | Z) == 1) + printf_unfiltered ("u<= "); + if ((C == 0)) + printf_unfiltered ("u>= "); + if (C == 1) + printf_unfiltered ("u< "); + if (Z == 0) + printf_unfiltered ("!= "); + if (Z == 1) + printf_unfiltered ("== "); + if ((N ^ V) == 0) + printf_unfiltered (">= "); + if ((N ^ V) == 1) + printf_unfiltered ("< "); + if ((Z | (N ^ V)) == 0) + printf_unfiltered ("> "); + if ((Z | (N ^ V)) == 1) + printf_unfiltered ("<= "); + } +} + +void +_initialize_h8300_tdep () +{ + tm_print_insn = gdb_print_insn_h8300; +} diff --git a/contrib/gdb/gdb/h8500-tdep.c b/contrib/gdb/gdb/h8500-tdep.c new file mode 100644 index 0000000000000..38a4859d0d3de --- /dev/null +++ b/contrib/gdb/gdb/h8500-tdep.c @@ -0,0 +1,678 @@ +/* Target-dependent code for Hitachi H8/500, for GDB. + Copyright 1993, 1994, 1995 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* + Contributed by Steve Chamberlain + sac@cygnus.com + */ + +#include "defs.h" +#include "frame.h" +#include "obstack.h" +#include "symtab.h" +#include "gdbtypes.h" +#include "gdbcmd.h" +#include "value.h" +#include "dis-asm.h" +#include "gdbcore.h" + +#define UNSIGNED_SHORT(X) ((X) & 0xffff) + +static int code_size = 2; + +static int data_size = 2; + +/* Shape of an H8/500 frame : + + arg-n + .. + arg-2 + arg-1 + return address <2 or 4 bytes> + old fp <2 bytes> + auto-n + .. + auto-1 + saved registers + +*/ + +/* an easy to debug H8 stack frame looks like: +0x6df6 push r6 +0x0d76 mov.w r7,r6 +0x6dfn push reg +0x7905 nnnn mov.w #n,r5 or 0x1b87 subs #2,sp +0x1957 sub.w r5,sp + + */ + +#define IS_PUSH(x) (((x) & 0xff00)==0x6d00) +#define IS_LINK_8(x) ((x) == 0x17) +#define IS_LINK_16(x) ((x) == 0x1f) +#define IS_MOVE_FP(x) ((x) == 0x0d76) +#define IS_MOV_SP_FP(x) ((x) == 0x0d76) +#define IS_SUB2_SP(x) ((x) == 0x1b87) +#define IS_MOVK_R5(x) ((x) == 0x7905) +#define IS_SUB_R5SP(x) ((x) == 0x1957) + +#define LINK_8 0x17 +#define LINK_16 0x1f + +int minimum_mode = 1; + +CORE_ADDR +h8500_skip_prologue (start_pc) + CORE_ADDR start_pc; +{ + short int w; + + w = read_memory_integer (start_pc, 1); + if (w == LINK_8) + { + start_pc += 2; + w = read_memory_integer (start_pc, 1); + } + + if (w == LINK_16) + { + start_pc += 3; + w = read_memory_integer (start_pc, 2); + } + + return start_pc; +} + +/* Given a GDB frame, determine the address of the calling function's frame. + This will be used to create a new GDB frame struct, and then + INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame. + + For us, the frame address is its stack pointer value, so we look up + the function prologue to determine the caller's sp value, and return it. */ + +CORE_ADDR +h8500_frame_chain (thisframe) + struct frame_info *thisframe; +{ + if (!inside_entry_file (thisframe->pc)) + return (read_memory_integer (FRAME_FP (thisframe), PTR_SIZE)); + else + return 0; +} + +/* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or + is not the address of a valid instruction, the address of the next + instruction beyond ADDR otherwise. *PWORD1 receives the first word + of the instruction.*/ + +CORE_ADDR +NEXT_PROLOGUE_INSN (addr, lim, pword1) + CORE_ADDR addr; + CORE_ADDR lim; + char *pword1; +{ + if (addr < lim + 8) + { + read_memory (addr, pword1, 1); + read_memory (addr, pword1 + 1, 1); + return 1; + } + return 0; +} + +/* Examine the prologue of a function. `ip' points to the first + instruction. `limit' is the limit of the prologue (e.g. the addr + of the first linenumber, or perhaps the program counter if we're + stepping through). `frame_sp' is the stack pointer value in use in + this frame. `fsr' is a pointer to a frame_saved_regs structure + into which we put info about the registers saved by this frame. + `fi' is a struct frame_info pointer; we fill in various fields in + it to reflect the offsets of the arg pointer and the locals + pointer. */ + +/* Return the saved PC from this frame. */ + +CORE_ADDR +frame_saved_pc (frame) + struct frame_info *frame; +{ + return read_memory_integer (FRAME_FP (frame) + 2, PTR_SIZE); +} + +void +h8500_pop_frame () +{ + unsigned regnum; + struct frame_saved_regs fsr; + struct frame_info *frame = get_current_frame (); + + get_frame_saved_regs (frame, &fsr); + + for (regnum = 0; regnum < 8; regnum++) + { + if (fsr.regs[regnum]) + write_register (regnum, read_memory_short (fsr.regs[regnum])); + + flush_cached_frames (); + } +} + +void +print_register_hook (regno) + int regno; +{ + if (regno == CCR_REGNUM) + { + /* CCR register */ + + int C, Z, N, V; + unsigned char b[2]; + unsigned char l; + + read_relative_register_raw_bytes (regno, b); + l = b[1]; + printf_unfiltered ("\t"); + printf_unfiltered ("I-%d - ", (l & 0x80) != 0); + N = (l & 0x8) != 0; + Z = (l & 0x4) != 0; + V = (l & 0x2) != 0; + C = (l & 0x1) != 0; + printf_unfiltered ("N-%d ", N); + printf_unfiltered ("Z-%d ", Z); + printf_unfiltered ("V-%d ", V); + printf_unfiltered ("C-%d ", C); + if ((C | Z) == 0) + printf_unfiltered ("u> "); + if ((C | Z) == 1) + printf_unfiltered ("u<= "); + if ((C == 0)) + printf_unfiltered ("u>= "); + if (C == 1) + printf_unfiltered ("u< "); + if (Z == 0) + printf_unfiltered ("!= "); + if (Z == 1) + printf_unfiltered ("== "); + if ((N ^ V) == 0) + printf_unfiltered (">= "); + if ((N ^ V) == 1) + printf_unfiltered ("< "); + if ((Z | (N ^ V)) == 0) + printf_unfiltered ("> "); + if ((Z | (N ^ V)) == 1) + printf_unfiltered ("<= "); + } +} + +int +h8500_register_size (regno) + int regno; +{ + switch (regno) + { + case SEG_C_REGNUM: + case SEG_D_REGNUM: + case SEG_E_REGNUM: + case SEG_T_REGNUM: + return 1; + case R0_REGNUM: + case R1_REGNUM: + case R2_REGNUM: + case R3_REGNUM: + case R4_REGNUM: + case R5_REGNUM: + case R6_REGNUM: + case R7_REGNUM: + case CCR_REGNUM: + return 2; + + case PR0_REGNUM: + case PR1_REGNUM: + case PR2_REGNUM: + case PR3_REGNUM: + case PR4_REGNUM: + case PR5_REGNUM: + case PR6_REGNUM: + case PR7_REGNUM: + case PC_REGNUM: + return 4; + default: + abort (); + } +} + +struct type * +h8500_register_virtual_type (regno) + int regno; +{ + switch (regno) + { + case SEG_C_REGNUM: + case SEG_E_REGNUM: + case SEG_D_REGNUM: + case SEG_T_REGNUM: + return builtin_type_unsigned_char; + case R0_REGNUM: + case R1_REGNUM: + case R2_REGNUM: + case R3_REGNUM: + case R4_REGNUM: + case R5_REGNUM: + case R6_REGNUM: + case R7_REGNUM: + case CCR_REGNUM: + return builtin_type_unsigned_short; + case PR0_REGNUM: + case PR1_REGNUM: + case PR2_REGNUM: + case PR3_REGNUM: + case PR4_REGNUM: + case PR5_REGNUM: + case PR6_REGNUM: + case PR7_REGNUM: + case PC_REGNUM: + return builtin_type_unsigned_long; + default: + abort (); + } +} + +/* Put here the code to store, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. */ + +void +frame_find_saved_regs (frame_info, frame_saved_regs) + struct frame_info *frame_info; + struct frame_saved_regs *frame_saved_regs; +{ + register int regnum; + register int regmask; + register CORE_ADDR next_addr; + register CORE_ADDR pc; + unsigned char thebyte; + + memset (frame_saved_regs, '\0', sizeof *frame_saved_regs); + + if ((frame_info)->pc >= (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 4 + && (frame_info)->pc <= (frame_info)->frame) + { + next_addr = (frame_info)->frame; + pc = (frame_info)->frame - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 4; + } + else + { + pc = get_pc_function_start ((frame_info)->pc); + /* Verify we have a link a6 instruction next; + if not we lose. If we win, find the address above the saved + regs using the amount of storage from the link instruction. + */ + + thebyte = read_memory_integer (pc, 1); + if (0x1f == thebyte) + next_addr = (frame_info)->frame + read_memory_integer (pc += 1, 2), pc += 2; + else if (0x17 == thebyte) + next_addr = (frame_info)->frame + read_memory_integer (pc += 1, 1), pc += 1; + else + goto lose; +#if 0 + /* FIXME steve */ + /* If have an add:g.waddal #-n, sp next, adjust next_addr. */ + if ((0x0c0177777 & read_memory_integer (pc, 2)) == 0157774) + next_addr += read_memory_integer (pc += 2, 4), pc += 4; +#endif + } + + thebyte = read_memory_integer (pc, 1); + if (thebyte == 0x12) + { + /* Got stm */ + pc++; + regmask = read_memory_integer (pc, 1); + pc++; + for (regnum = 0; regnum < 8; regnum++, regmask >>= 1) + { + if (regmask & 1) + { + (frame_saved_regs)->regs[regnum] = (next_addr += 2) - 2; + } + } + thebyte = read_memory_integer (pc, 1); + } + /* Maybe got a load of pushes */ + while (thebyte == 0xbf) + { + pc++; + regnum = read_memory_integer (pc, 1) & 0x7; + pc++; + (frame_saved_regs)->regs[regnum] = (next_addr += 2) - 2; + thebyte = read_memory_integer (pc, 1); + } + +lose:; + + /* Remember the address of the frame pointer */ + (frame_saved_regs)->regs[FP_REGNUM] = (frame_info)->frame; + + /* This is where the old sp is hidden */ + (frame_saved_regs)->regs[SP_REGNUM] = (frame_info)->frame; + + /* And the PC - remember the pushed FP is always two bytes long */ + (frame_saved_regs)->regs[PC_REGNUM] = (frame_info)->frame + 2; +} + +CORE_ADDR +saved_pc_after_call () +{ + int x; + int a = read_register (SP_REGNUM); + + x = read_memory_integer (a, code_size); + if (code_size == 2) + { + /* Stick current code segement onto top */ + x &= 0xffff; + x |= read_register (SEG_C_REGNUM) << 16; + } + x &= 0xffffff; + return x; +} + +#if 0 /* never called */ +/* Nonzero if instruction at PC is a return instruction. */ + +int +about_to_return (pc) + CORE_ADDR pc; +{ + int b1 = read_memory_integer (pc, 1); + + switch (b1) + { + case 0x14: /* rtd #8 */ + case 0x1c: /* rtd #16 */ + case 0x19: /* rts */ + case 0x1a: /* rte */ + return 1; + case 0x11: + { + int b2 = read_memory_integer (pc + 1, 1); + switch (b2) + { + case 0x18: /* prts */ + case 0x14: /* prtd #8 */ + case 0x16: /* prtd #16 */ + return 1; + } + } + } + return 0; +} +#endif + +void +h8500_set_pointer_size (newsize) + int newsize; +{ + static int oldsize = 0; + + if (oldsize != newsize) + { + printf_unfiltered ("pointer size set to %d bits\n", newsize); + oldsize = newsize; + if (newsize == 32) + { + minimum_mode = 0; + } + else + { + minimum_mode = 1; + } + _initialize_gdbtypes (); + } +} + +static void +big_command () +{ + h8500_set_pointer_size (32); + code_size = 4; + data_size = 4; +} + +static void +medium_command () +{ + h8500_set_pointer_size (32); + code_size = 4; + data_size = 2; +} + +static void +compact_command () +{ + h8500_set_pointer_size (32); + code_size = 2; + data_size = 4; +} + +static void +small_command () +{ + h8500_set_pointer_size (16); + code_size = 2; + data_size = 2; +} + +static struct cmd_list_element *setmemorylist; + +static void +set_memory (args, from_tty) + char *args; + int from_tty; +{ + printf_unfiltered ("\"set memory\" must be followed by the name of a memory subcommand.\n"); + help_list (setmemorylist, "set memory ", -1, gdb_stdout); +} + +/* See if variable name is ppc or pr[0-7] */ + +int +h8500_is_trapped_internalvar (name) + char *name; +{ + if (name[0] != 'p') + return 0; + + if (strcmp (name + 1, "pc") == 0) + return 1; + + if (name[1] == 'r' + && name[2] >= '0' + && name[2] <= '7' + && name[3] == '\000') + return 1; + else + return 0; +} + +value_ptr +h8500_value_of_trapped_internalvar (var) + struct internalvar *var; +{ + LONGEST regval; + unsigned char regbuf[4]; + int page_regnum, regnum; + + regnum = var->name[2] == 'c' ? PC_REGNUM : var->name[2] - '0'; + + switch (var->name[2]) + { + case 'c': + page_regnum = SEG_C_REGNUM; + break; + case '0': + case '1': + case '2': + case '3': + page_regnum = SEG_D_REGNUM; + break; + case '4': + case '5': + page_regnum = SEG_E_REGNUM; + break; + case '6': + case '7': + page_regnum = SEG_T_REGNUM; + break; + } + + get_saved_register (regbuf, NULL, NULL, selected_frame, page_regnum, NULL); + regval = regbuf[0] << 16; + + get_saved_register (regbuf, NULL, NULL, selected_frame, regnum, NULL); + regval |= regbuf[0] << 8 | regbuf[1]; /* XXX host/target byte order */ + + free (var->value); /* Free up old value */ + + var->value = value_from_longest (builtin_type_unsigned_long, regval); + release_value (var->value); /* Unchain new value */ + + VALUE_LVAL (var->value) = lval_internalvar; + VALUE_INTERNALVAR (var->value) = var; + return var->value; +} + +void +h8500_set_trapped_internalvar (var, newval, bitpos, bitsize, offset) + struct internalvar *var; + int offset, bitpos, bitsize; + value_ptr newval; +{ + char *page_regnum, *regnum; + char expression[100]; + unsigned new_regval; + struct type *type; + enum type_code newval_type_code; + + type = check_typedef (VALUE_TYPE (newval)); + newval_type_code = TYPE_CODE (type); + + if ((newval_type_code != TYPE_CODE_INT + && newval_type_code != TYPE_CODE_PTR) + || TYPE_LENGTH (type) != sizeof (new_regval)) + error ("Illegal type (%s) for assignment to $%s\n", + TYPE_NAME (VALUE_TYPE (newval)), var->name); + + new_regval = *(long *) VALUE_CONTENTS_RAW (newval); + + regnum = var->name + 1; + + switch (var->name[2]) + { + case 'c': + page_regnum = "cp"; + break; + case '0': + case '1': + case '2': + case '3': + page_regnum = "dp"; + break; + case '4': + case '5': + page_regnum = "ep"; + break; + case '6': + case '7': + page_regnum = "tp"; + break; + } + + sprintf (expression, "$%s=%d", page_regnum, new_regval >> 16); + parse_and_eval (expression); + + sprintf (expression, "$%s=%d", regnum, new_regval & 0xffff); + parse_and_eval (expression); +} + +CORE_ADDR +h8500_read_sp () +{ + return read_register (PR7_REGNUM); +} + +void +h8500_write_sp (v) + CORE_ADDR v; +{ + write_register (PR7_REGNUM, v); +} + +CORE_ADDR +h8500_read_pc (pid) + int pid; +{ + return read_register (PC_REGNUM); +} + +void +h8500_write_pc (v, pid) + CORE_ADDR v; + int pid; +{ + write_register (PC_REGNUM, v); +} + +CORE_ADDR +h8500_read_fp () +{ + return read_register (PR6_REGNUM); +} + +void +h8500_write_fp (v) + CORE_ADDR v; +{ + write_register (PR6_REGNUM, v); +} + +void +_initialize_h8500_tdep () +{ + tm_print_insn = print_insn_h8500; + + add_prefix_cmd ("memory", no_class, set_memory, + "set the memory model", &setmemorylist, "set memory ", 0, + &setlist); + + add_cmd ("small", class_support, small_command, + "Set small memory model. (16 bit code, 16 bit data)", &setmemorylist); + + add_cmd ("big", class_support, big_command, + "Set big memory model. (32 bit code, 32 bit data)", &setmemorylist); + + add_cmd ("medium", class_support, medium_command, + "Set medium memory model. (32 bit code, 16 bit data)", &setmemorylist); + + add_cmd ("compact", class_support, compact_command, + "Set compact memory model. (16 bit code, 32 bit data)", &setmemorylist); + +} diff --git a/contrib/gdb/gdb/hp300ux-nat.c b/contrib/gdb/gdb/hp300ux-nat.c new file mode 100644 index 0000000000000..e1641f9fe11ba --- /dev/null +++ b/contrib/gdb/gdb/hp300ux-nat.c @@ -0,0 +1,214 @@ +/* HP/UX native interface for HP 300's, for GDB when running under Unix. + Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "frame.h" +#include "inferior.h" + +/* Defining this means some system include files define some extra stuff. */ +#define WOPR +#include <sys/param.h> +#include <signal.h> +#include <sys/user.h> +#include <fcntl.h> + +#include <sys/ptrace.h> +#include <sys/reg.h> +#include <sys/trap.h> + +#include <sys/file.h> + +/* Get kernel_u_addr using HPUX-style nlist(). */ +CORE_ADDR kernel_u_addr; + +struct hpnlist { + char * n_name; + long n_value; + unsigned char n_type; + unsigned char n_length; + short n_almod; + short n_unused; +}; +static struct hpnlist nl[] = {{ "_u", -1, }, { (char *) 0, }}; + +/* read the value of the u area from the hp-ux kernel */ +void +_initialize_hp300ux_nat () +{ +#ifndef HPUX_VERSION_5 + nlist ("/hp-ux", nl); + kernel_u_addr = nl[0].n_value; +#else /* HPUX version 5. */ + kernel_u_addr = (CORE_ADDR) 0x0097900; +#endif +} + +#define INFERIOR_AR0(u) \ + ((ptrace \ + (PT_RUAREA, inferior_pid, \ + (PTRACE_ARG3_TYPE) ((char *) &u.u_ar0 - (char *) &u), 0, 0)) \ + - kernel_u_addr) + +static void +fetch_inferior_register (regno, regaddr) + register int regno; + register unsigned int regaddr; +{ +#ifndef HPUX_VERSION_5 + if (regno == PS_REGNUM) + { + union { int i; short s[2]; } ps_val; + int regval; + + ps_val.i = (ptrace (PT_RUAREA, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, + 0, 0)); + regval = ps_val.s[0]; + supply_register (regno, (char *)®val); + } + else +#endif /* not HPUX_VERSION_5 */ + { + char buf[MAX_REGISTER_RAW_SIZE]; + register int i; + + for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) + { + *(int *) &buf[i] = ptrace (PT_RUAREA, inferior_pid, + (PTRACE_ARG3_TYPE) regaddr, 0, 0); + regaddr += sizeof (int); + } + supply_register (regno, buf); + } + return; +} + +static void +store_inferior_register_1 (regno, regaddr, val) + int regno; + unsigned int regaddr; + int val; +{ + errno = 0; + ptrace (PT_WUAREA, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, val, 0); +#if 0 + /* HP-UX randomly sets errno to non-zero for regno == 25. + However, the value is correctly written, so ignore errno. */ + if (errno != 0) + { + char string_buf[64]; + + sprintf (string_buf, "writing register number %d", regno); + perror_with_name (string_buf); + } +#endif + return; +} + +static void +store_inferior_register (regno, regaddr) + register int regno; + register unsigned int regaddr; +{ +#ifndef HPUX_VERSION_5 + if (regno == PS_REGNUM) + { + union { int i; short s[2]; } ps_val; + + ps_val.i = (ptrace (PT_RUAREA, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, + 0, 0)); + ps_val.s[0] = (read_register (regno)); + store_inferior_register_1 (regno, regaddr, ps_val.i); + } + else +#endif /* not HPUX_VERSION_5 */ + { + char buf[MAX_REGISTER_RAW_SIZE]; + register int i; + extern char registers[]; + + for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) + { + store_inferior_register_1 + (regno, regaddr, + (*(int *) ®isters[(REGISTER_BYTE (regno)) + i])); + regaddr += sizeof (int); + } + } + return; +} + +void +fetch_inferior_registers (regno) + int regno; +{ + struct user u; + register unsigned int ar0_offset; + + ar0_offset = (INFERIOR_AR0 (u)); + if (regno == -1) + { + for (regno = 0; (regno < FP0_REGNUM); regno++) + fetch_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno))); + for (; (regno < NUM_REGS); regno++) + fetch_inferior_register (regno, (FP_REGISTER_ADDR (u, regno))); + } + else + fetch_inferior_register (regno, + (regno < FP0_REGNUM + ? REGISTER_ADDR (ar0_offset, regno) + : FP_REGISTER_ADDR (u, regno))); +} + +/* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +void +store_inferior_registers (regno) + register int regno; +{ + struct user u; + register unsigned int ar0_offset; + extern char registers[]; + + if (regno >= FP0_REGNUM) + { + store_inferior_register (regno, (FP_REGISTER_ADDR (u, regno))); + return; + } + + ar0_offset = (INFERIOR_AR0 (u)); + if (regno >= 0) + { + store_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno))); + return; + } + + for (regno = 0; (regno < FP0_REGNUM); regno++) + store_inferior_register (regno, (REGISTER_ADDR (ar0_offset, regno))); + for (; (regno < NUM_REGS); regno++) + store_inferior_register (regno, (FP_REGISTER_ADDR (u, regno))); + return; +} + +int +getpagesize () +{ + return 4096; +} diff --git a/contrib/gdb/gdb/hppa-tdep.c b/contrib/gdb/gdb/hppa-tdep.c new file mode 100644 index 0000000000000..efc8081cf0a2e --- /dev/null +++ b/contrib/gdb/gdb/hppa-tdep.c @@ -0,0 +1,2823 @@ +/* Target-dependent code for the HP PA architecture, for GDB. + Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 + Free Software Foundation, Inc. + + Contributed by the Center for Software Science at the + University of Utah (pa-gdb-bugs@cs.utah.edu). + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "frame.h" +#include "inferior.h" +#include "value.h" + +/* For argument passing to the inferior */ +#include "symtab.h" + +#ifdef USG +#include <sys/types.h> +#endif + +#include <sys/param.h> +#include <signal.h> + +#ifdef COFF_ENCAPSULATE +#include "a.out.encap.h" +#else +#endif +#ifndef N_SET_MAGIC +#define N_SET_MAGIC(exec, val) ((exec).a_magic = (val)) +#endif + +/*#include <sys/user.h> After a.out.h */ +#include <sys/file.h> +#include "gdb_stat.h" +#include "wait.h" + +#include "gdbcore.h" +#include "gdbcmd.h" +#include "target.h" +#include "symfile.h" +#include "objfiles.h" + +static int restore_pc_queue PARAMS ((struct frame_saved_regs *)); + +static int hppa_alignof PARAMS ((struct type *)); + +CORE_ADDR frame_saved_pc PARAMS ((struct frame_info *)); + +static int prologue_inst_adjust_sp PARAMS ((unsigned long)); + +static int is_branch PARAMS ((unsigned long)); + +static int inst_saves_gr PARAMS ((unsigned long)); + +static int inst_saves_fr PARAMS ((unsigned long)); + +static int pc_in_interrupt_handler PARAMS ((CORE_ADDR)); + +static int pc_in_linker_stub PARAMS ((CORE_ADDR)); + +static int compare_unwind_entries PARAMS ((const void *, const void *)); + +static void read_unwind_info PARAMS ((struct objfile *)); + +static void internalize_unwinds PARAMS ((struct objfile *, + struct unwind_table_entry *, + asection *, unsigned int, + unsigned int, CORE_ADDR)); +static void pa_print_registers PARAMS ((char *, int, int)); +static void pa_print_fp_reg PARAMS ((int)); + + +/* Routines to extract various sized constants out of hppa + instructions. */ + +/* This assumes that no garbage lies outside of the lower bits of + value. */ + +int +sign_extend (val, bits) + unsigned val, bits; +{ + return (int)(val >> bits - 1 ? (-1 << bits) | val : val); +} + +/* For many immediate values the sign bit is the low bit! */ + +int +low_sign_extend (val, bits) + unsigned val, bits; +{ + return (int)((val & 0x1 ? (-1 << (bits - 1)) : 0) | val >> 1); +} +/* extract the immediate field from a ld{bhw}s instruction */ + +unsigned +get_field (val, from, to) + unsigned val, from, to; +{ + val = val >> 31 - to; + return val & ((1 << 32 - from) - 1); +} + +unsigned +set_field (val, from, to, new_val) + unsigned *val, from, to; +{ + unsigned mask = ~((1 << (to - from + 1)) << (31 - from)); + return *val = *val & mask | (new_val << (31 - from)); +} + +/* extract a 3-bit space register number from a be, ble, mtsp or mfsp */ + +extract_3 (word) + unsigned word; +{ + return GET_FIELD (word, 18, 18) << 2 | GET_FIELD (word, 16, 17); +} + +extract_5_load (word) + unsigned word; +{ + return low_sign_extend (word >> 16 & MASK_5, 5); +} + +/* extract the immediate field from a st{bhw}s instruction */ + +int +extract_5_store (word) + unsigned word; +{ + return low_sign_extend (word & MASK_5, 5); +} + +/* extract the immediate field from a break instruction */ + +unsigned +extract_5r_store (word) + unsigned word; +{ + return (word & MASK_5); +} + +/* extract the immediate field from a {sr}sm instruction */ + +unsigned +extract_5R_store (word) + unsigned word; +{ + return (word >> 16 & MASK_5); +} + +/* extract an 11 bit immediate field */ + +int +extract_11 (word) + unsigned word; +{ + return low_sign_extend (word & MASK_11, 11); +} + +/* extract a 14 bit immediate field */ + +int +extract_14 (word) + unsigned word; +{ + return low_sign_extend (word & MASK_14, 14); +} + +/* deposit a 14 bit constant in a word */ + +unsigned +deposit_14 (opnd, word) + int opnd; + unsigned word; +{ + unsigned sign = (opnd < 0 ? 1 : 0); + + return word | ((unsigned)opnd << 1 & MASK_14) | sign; +} + +/* extract a 21 bit constant */ + +int +extract_21 (word) + unsigned word; +{ + int val; + + word &= MASK_21; + word <<= 11; + val = GET_FIELD (word, 20, 20); + val <<= 11; + val |= GET_FIELD (word, 9, 19); + val <<= 2; + val |= GET_FIELD (word, 5, 6); + val <<= 5; + val |= GET_FIELD (word, 0, 4); + val <<= 2; + val |= GET_FIELD (word, 7, 8); + return sign_extend (val, 21) << 11; +} + +/* deposit a 21 bit constant in a word. Although 21 bit constants are + usually the top 21 bits of a 32 bit constant, we assume that only + the low 21 bits of opnd are relevant */ + +unsigned +deposit_21 (opnd, word) + unsigned opnd, word; +{ + unsigned val = 0; + + val |= GET_FIELD (opnd, 11 + 14, 11 + 18); + val <<= 2; + val |= GET_FIELD (opnd, 11 + 12, 11 + 13); + val <<= 2; + val |= GET_FIELD (opnd, 11 + 19, 11 + 20); + val <<= 11; + val |= GET_FIELD (opnd, 11 + 1, 11 + 11); + val <<= 1; + val |= GET_FIELD (opnd, 11 + 0, 11 + 0); + return word | val; +} + +/* extract a 12 bit constant from branch instructions */ + +int +extract_12 (word) + unsigned word; +{ + return sign_extend (GET_FIELD (word, 19, 28) | + GET_FIELD (word, 29, 29) << 10 | + (word & 0x1) << 11, 12) << 2; +} + +/* Deposit a 17 bit constant in an instruction (like bl). */ + +unsigned int +deposit_17 (opnd, word) + unsigned opnd, word; +{ + word |= GET_FIELD (opnd, 15 + 0, 15 + 0); /* w */ + word |= GET_FIELD (opnd, 15 + 1, 15 + 5) << 16; /* w1 */ + word |= GET_FIELD (opnd, 15 + 6, 15 + 6) << 2; /* w2[10] */ + word |= GET_FIELD (opnd, 15 + 7, 15 + 16) << 3; /* w2[0..9] */ + + return word; +} + +/* extract a 17 bit constant from branch instructions, returning the + 19 bit signed value. */ + +int +extract_17 (word) + unsigned word; +{ + return sign_extend (GET_FIELD (word, 19, 28) | + GET_FIELD (word, 29, 29) << 10 | + GET_FIELD (word, 11, 15) << 11 | + (word & 0x1) << 16, 17) << 2; +} + + +/* Compare the start address for two unwind entries returning 1 if + the first address is larger than the second, -1 if the second is + larger than the first, and zero if they are equal. */ + +static int +compare_unwind_entries (arg1, arg2) + const void *arg1; + const void *arg2; +{ + const struct unwind_table_entry *a = arg1; + const struct unwind_table_entry *b = arg2; + + if (a->region_start > b->region_start) + return 1; + else if (a->region_start < b->region_start) + return -1; + else + return 0; +} + +static void +internalize_unwinds (objfile, table, section, entries, size, text_offset) + struct objfile *objfile; + struct unwind_table_entry *table; + asection *section; + unsigned int entries, size; + CORE_ADDR text_offset; +{ + /* We will read the unwind entries into temporary memory, then + fill in the actual unwind table. */ + if (size > 0) + { + unsigned long tmp; + unsigned i; + char *buf = alloca (size); + + bfd_get_section_contents (objfile->obfd, section, buf, 0, size); + + /* Now internalize the information being careful to handle host/target + endian issues. */ + for (i = 0; i < entries; i++) + { + table[i].region_start = bfd_get_32 (objfile->obfd, + (bfd_byte *)buf); + table[i].region_start += text_offset; + buf += 4; + table[i].region_end = bfd_get_32 (objfile->obfd, (bfd_byte *)buf); + table[i].region_end += text_offset; + buf += 4; + tmp = bfd_get_32 (objfile->obfd, (bfd_byte *)buf); + buf += 4; + table[i].Cannot_unwind = (tmp >> 31) & 0x1; + table[i].Millicode = (tmp >> 30) & 0x1; + table[i].Millicode_save_sr0 = (tmp >> 29) & 0x1; + table[i].Region_description = (tmp >> 27) & 0x3; + table[i].reserved1 = (tmp >> 26) & 0x1; + table[i].Entry_SR = (tmp >> 25) & 0x1; + table[i].Entry_FR = (tmp >> 21) & 0xf; + table[i].Entry_GR = (tmp >> 16) & 0x1f; + table[i].Args_stored = (tmp >> 15) & 0x1; + table[i].Variable_Frame = (tmp >> 14) & 0x1; + table[i].Separate_Package_Body = (tmp >> 13) & 0x1; + table[i].Frame_Extension_Millicode = (tmp >> 12 ) & 0x1; + table[i].Stack_Overflow_Check = (tmp >> 11) & 0x1; + table[i].Two_Instruction_SP_Increment = (tmp >> 10) & 0x1; + table[i].Ada_Region = (tmp >> 9) & 0x1; + table[i].reserved2 = (tmp >> 5) & 0xf; + table[i].Save_SP = (tmp >> 4) & 0x1; + table[i].Save_RP = (tmp >> 3) & 0x1; + table[i].Save_MRP_in_frame = (tmp >> 2) & 0x1; + table[i].extn_ptr_defined = (tmp >> 1) & 0x1; + table[i].Cleanup_defined = tmp & 0x1; + tmp = bfd_get_32 (objfile->obfd, (bfd_byte *)buf); + buf += 4; + table[i].MPE_XL_interrupt_marker = (tmp >> 31) & 0x1; + table[i].HP_UX_interrupt_marker = (tmp >> 30) & 0x1; + table[i].Large_frame = (tmp >> 29) & 0x1; + table[i].reserved4 = (tmp >> 27) & 0x3; + table[i].Total_frame_size = tmp & 0x7ffffff; + } + } +} + +/* Read in the backtrace information stored in the `$UNWIND_START$' section of + the object file. This info is used mainly by find_unwind_entry() to find + out the stack frame size and frame pointer used by procedures. We put + everything on the psymbol obstack in the objfile so that it automatically + gets freed when the objfile is destroyed. */ + +static void +read_unwind_info (objfile) + struct objfile *objfile; +{ + asection *unwind_sec, *elf_unwind_sec, *stub_unwind_sec; + unsigned unwind_size, elf_unwind_size, stub_unwind_size, total_size; + unsigned index, unwind_entries, elf_unwind_entries; + unsigned stub_entries, total_entries; + CORE_ADDR text_offset; + struct obj_unwind_info *ui; + + text_offset = ANOFFSET (objfile->section_offsets, 0); + ui = (struct obj_unwind_info *)obstack_alloc (&objfile->psymbol_obstack, + sizeof (struct obj_unwind_info)); + + ui->table = NULL; + ui->cache = NULL; + ui->last = -1; + + /* Get hooks to all unwind sections. Note there is no linker-stub unwind + section in ELF at the moment. */ + unwind_sec = bfd_get_section_by_name (objfile->obfd, "$UNWIND_START$"); + elf_unwind_sec = bfd_get_section_by_name (objfile->obfd, ".PARISC.unwind"); + stub_unwind_sec = bfd_get_section_by_name (objfile->obfd, "$UNWIND_END$"); + + /* Get sizes and unwind counts for all sections. */ + if (unwind_sec) + { + unwind_size = bfd_section_size (objfile->obfd, unwind_sec); + unwind_entries = unwind_size / UNWIND_ENTRY_SIZE; + } + else + { + unwind_size = 0; + unwind_entries = 0; + } + + if (elf_unwind_sec) + { + elf_unwind_size = bfd_section_size (objfile->obfd, elf_unwind_sec); + elf_unwind_entries = elf_unwind_size / UNWIND_ENTRY_SIZE; + } + else + { + elf_unwind_size = 0; + elf_unwind_entries = 0; + } + + if (stub_unwind_sec) + { + stub_unwind_size = bfd_section_size (objfile->obfd, stub_unwind_sec); + stub_entries = stub_unwind_size / STUB_UNWIND_ENTRY_SIZE; + } + else + { + stub_unwind_size = 0; + stub_entries = 0; + } + + /* Compute total number of unwind entries and their total size. */ + total_entries = unwind_entries + elf_unwind_entries + stub_entries; + total_size = total_entries * sizeof (struct unwind_table_entry); + + /* Allocate memory for the unwind table. */ + ui->table = obstack_alloc (&objfile->psymbol_obstack, total_size); + ui->last = total_entries - 1; + + /* Internalize the standard unwind entries. */ + index = 0; + internalize_unwinds (objfile, &ui->table[index], unwind_sec, + unwind_entries, unwind_size, text_offset); + index += unwind_entries; + internalize_unwinds (objfile, &ui->table[index], elf_unwind_sec, + elf_unwind_entries, elf_unwind_size, text_offset); + index += elf_unwind_entries; + + /* Now internalize the stub unwind entries. */ + if (stub_unwind_size > 0) + { + unsigned int i; + char *buf = alloca (stub_unwind_size); + + /* Read in the stub unwind entries. */ + bfd_get_section_contents (objfile->obfd, stub_unwind_sec, buf, + 0, stub_unwind_size); + + /* Now convert them into regular unwind entries. */ + for (i = 0; i < stub_entries; i++, index++) + { + /* Clear out the next unwind entry. */ + memset (&ui->table[index], 0, sizeof (struct unwind_table_entry)); + + /* Convert offset & size into region_start and region_end. + Stuff away the stub type into "reserved" fields. */ + ui->table[index].region_start = bfd_get_32 (objfile->obfd, + (bfd_byte *) buf); + ui->table[index].region_start += text_offset; + buf += 4; + ui->table[index].stub_type = bfd_get_8 (objfile->obfd, + (bfd_byte *) buf); + buf += 2; + ui->table[index].region_end + = ui->table[index].region_start + 4 * + (bfd_get_16 (objfile->obfd, (bfd_byte *) buf) - 1); + buf += 2; + } + + } + + /* Unwind table needs to be kept sorted. */ + qsort (ui->table, total_entries, sizeof (struct unwind_table_entry), + compare_unwind_entries); + + /* Keep a pointer to the unwind information. */ + objfile->obj_private = (PTR) ui; +} + +/* Lookup the unwind (stack backtrace) info for the given PC. We search all + of the objfiles seeking the unwind table entry for this PC. Each objfile + contains a sorted list of struct unwind_table_entry. Since we do a binary + search of the unwind tables, we depend upon them to be sorted. */ + +struct unwind_table_entry * +find_unwind_entry(pc) + CORE_ADDR pc; +{ + int first, middle, last; + struct objfile *objfile; + + ALL_OBJFILES (objfile) + { + struct obj_unwind_info *ui; + + ui = OBJ_UNWIND_INFO (objfile); + + if (!ui) + { + read_unwind_info (objfile); + ui = OBJ_UNWIND_INFO (objfile); + } + + /* First, check the cache */ + + if (ui->cache + && pc >= ui->cache->region_start + && pc <= ui->cache->region_end) + return ui->cache; + + /* Not in the cache, do a binary search */ + + first = 0; + last = ui->last; + + while (first <= last) + { + middle = (first + last) / 2; + if (pc >= ui->table[middle].region_start + && pc <= ui->table[middle].region_end) + { + ui->cache = &ui->table[middle]; + return &ui->table[middle]; + } + + if (pc < ui->table[middle].region_start) + last = middle - 1; + else + first = middle + 1; + } + } /* ALL_OBJFILES() */ + return NULL; +} + +/* Return the adjustment necessary to make for addresses on the stack + as presented by hpread.c. + + This is necessary because of the stack direction on the PA and the + bizarre way in which someone (?) decided they wanted to handle + frame pointerless code in GDB. */ +int +hpread_adjust_stack_address (func_addr) + CORE_ADDR func_addr; +{ + struct unwind_table_entry *u; + + u = find_unwind_entry (func_addr); + if (!u) + return 0; + else + return u->Total_frame_size << 3; +} + +/* Called to determine if PC is in an interrupt handler of some + kind. */ + +static int +pc_in_interrupt_handler (pc) + CORE_ADDR pc; +{ + struct unwind_table_entry *u; + struct minimal_symbol *msym_us; + + u = find_unwind_entry (pc); + if (!u) + return 0; + + /* Oh joys. HPUX sets the interrupt bit for _sigreturn even though + its frame isn't a pure interrupt frame. Deal with this. */ + msym_us = lookup_minimal_symbol_by_pc (pc); + + return u->HP_UX_interrupt_marker && !IN_SIGTRAMP (pc, SYMBOL_NAME (msym_us)); +} + +/* Called when no unwind descriptor was found for PC. Returns 1 if it + appears that PC is in a linker stub. */ + +static int +pc_in_linker_stub (pc) + CORE_ADDR pc; +{ + int found_magic_instruction = 0; + int i; + char buf[4]; + + /* If unable to read memory, assume pc is not in a linker stub. */ + if (target_read_memory (pc, buf, 4) != 0) + return 0; + + /* We are looking for something like + + ; $$dyncall jams RP into this special spot in the frame (RP') + ; before calling the "call stub" + ldw -18(sp),rp + + ldsid (rp),r1 ; Get space associated with RP into r1 + mtsp r1,sp ; Move it into space register 0 + be,n 0(sr0),rp) ; back to your regularly scheduled program + */ + + /* Maximum known linker stub size is 4 instructions. Search forward + from the given PC, then backward. */ + for (i = 0; i < 4; i++) + { + /* If we hit something with an unwind, stop searching this direction. */ + + if (find_unwind_entry (pc + i * 4) != 0) + break; + + /* Check for ldsid (rp),r1 which is the magic instruction for a + return from a cross-space function call. */ + if (read_memory_integer (pc + i * 4, 4) == 0x004010a1) + { + found_magic_instruction = 1; + break; + } + /* Add code to handle long call/branch and argument relocation stubs + here. */ + } + + if (found_magic_instruction != 0) + return 1; + + /* Now look backward. */ + for (i = 0; i < 4; i++) + { + /* If we hit something with an unwind, stop searching this direction. */ + + if (find_unwind_entry (pc - i * 4) != 0) + break; + + /* Check for ldsid (rp),r1 which is the magic instruction for a + return from a cross-space function call. */ + if (read_memory_integer (pc - i * 4, 4) == 0x004010a1) + { + found_magic_instruction = 1; + break; + } + /* Add code to handle long call/branch and argument relocation stubs + here. */ + } + return found_magic_instruction; +} + +static int +find_return_regnum(pc) + CORE_ADDR pc; +{ + struct unwind_table_entry *u; + + u = find_unwind_entry (pc); + + if (!u) + return RP_REGNUM; + + if (u->Millicode) + return 31; + + return RP_REGNUM; +} + +/* Return size of frame, or -1 if we should use a frame pointer. */ +int +find_proc_framesize (pc) + CORE_ADDR pc; +{ + struct unwind_table_entry *u; + struct minimal_symbol *msym_us; + + u = find_unwind_entry (pc); + + if (!u) + { + if (pc_in_linker_stub (pc)) + /* Linker stubs have a zero size frame. */ + return 0; + else + return -1; + } + + msym_us = lookup_minimal_symbol_by_pc (pc); + + /* If Save_SP is set, and we're not in an interrupt or signal caller, + then we have a frame pointer. Use it. */ + if (u->Save_SP && !pc_in_interrupt_handler (pc) + && !IN_SIGTRAMP (pc, SYMBOL_NAME (msym_us))) + return -1; + + return u->Total_frame_size << 3; +} + +/* Return offset from sp at which rp is saved, or 0 if not saved. */ +static int rp_saved PARAMS ((CORE_ADDR)); + +static int +rp_saved (pc) + CORE_ADDR pc; +{ + struct unwind_table_entry *u; + + u = find_unwind_entry (pc); + + if (!u) + { + if (pc_in_linker_stub (pc)) + /* This is the so-called RP'. */ + return -24; + else + return 0; + } + + if (u->Save_RP) + return -20; + else if (u->stub_type != 0) + { + switch (u->stub_type) + { + case EXPORT: + case IMPORT: + return -24; + case PARAMETER_RELOCATION: + return -8; + default: + return 0; + } + } + else + return 0; +} + +int +frameless_function_invocation (frame) + struct frame_info *frame; +{ + struct unwind_table_entry *u; + + u = find_unwind_entry (frame->pc); + + if (u == 0) + return 0; + + return (u->Total_frame_size == 0 && u->stub_type == 0); +} + +CORE_ADDR +saved_pc_after_call (frame) + struct frame_info *frame; +{ + int ret_regnum; + CORE_ADDR pc; + struct unwind_table_entry *u; + + ret_regnum = find_return_regnum (get_frame_pc (frame)); + pc = read_register (ret_regnum) & ~0x3; + + /* If PC is in a linker stub, then we need to dig the address + the stub will return to out of the stack. */ + u = find_unwind_entry (pc); + if (u && u->stub_type != 0) + return frame_saved_pc (frame); + else + return pc; +} + +CORE_ADDR +frame_saved_pc (frame) + struct frame_info *frame; +{ + CORE_ADDR pc = get_frame_pc (frame); + struct unwind_table_entry *u; + + /* BSD, HPUX & OSF1 all lay out the hardware state in the same manner + at the base of the frame in an interrupt handler. Registers within + are saved in the exact same order as GDB numbers registers. How + convienent. */ + if (pc_in_interrupt_handler (pc)) + return read_memory_integer (frame->frame + PC_REGNUM * 4, 4) & ~0x3; + +#ifdef FRAME_SAVED_PC_IN_SIGTRAMP + /* Deal with signal handler caller frames too. */ + if (frame->signal_handler_caller) + { + CORE_ADDR rp; + FRAME_SAVED_PC_IN_SIGTRAMP (frame, &rp); + return rp & ~0x3; + } +#endif + + if (frameless_function_invocation (frame)) + { + int ret_regnum; + + ret_regnum = find_return_regnum (pc); + + /* If the next frame is an interrupt frame or a signal + handler caller, then we need to look in the saved + register area to get the return pointer (the values + in the registers may not correspond to anything useful). */ + if (frame->next + && (frame->next->signal_handler_caller + || pc_in_interrupt_handler (frame->next->pc))) + { + struct frame_saved_regs saved_regs; + + get_frame_saved_regs (frame->next, &saved_regs); + if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4) & 0x2) + { + pc = read_memory_integer (saved_regs.regs[31], 4) & ~0x3; + + /* Syscalls are really two frames. The syscall stub itself + with a return pointer in %rp and the kernel call with + a return pointer in %r31. We return the %rp variant + if %r31 is the same as frame->pc. */ + if (pc == frame->pc) + pc = read_memory_integer (saved_regs.regs[RP_REGNUM], 4) & ~0x3; + } + else + pc = read_memory_integer (saved_regs.regs[RP_REGNUM], 4) & ~0x3; + } + else + pc = read_register (ret_regnum) & ~0x3; + } + else + { + int rp_offset; + +restart: + rp_offset = rp_saved (pc); + /* Similar to code in frameless function case. If the next + frame is a signal or interrupt handler, then dig the right + information out of the saved register info. */ + if (rp_offset == 0 + && frame->next + && (frame->next->signal_handler_caller + || pc_in_interrupt_handler (frame->next->pc))) + { + struct frame_saved_regs saved_regs; + + get_frame_saved_regs (frame->next, &saved_regs); + if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4) & 0x2) + { + pc = read_memory_integer (saved_regs.regs[31], 4) & ~0x3; + + /* Syscalls are really two frames. The syscall stub itself + with a return pointer in %rp and the kernel call with + a return pointer in %r31. We return the %rp variant + if %r31 is the same as frame->pc. */ + if (pc == frame->pc) + pc = read_memory_integer (saved_regs.regs[RP_REGNUM], 4) & ~0x3; + } + else + pc = read_memory_integer (saved_regs.regs[RP_REGNUM], 4) & ~0x3; + } + else if (rp_offset == 0) + pc = read_register (RP_REGNUM) & ~0x3; + else + pc = read_memory_integer (frame->frame + rp_offset, 4) & ~0x3; + } + + /* If PC is inside a linker stub, then dig out the address the stub + will return to. + + Don't do this for long branch stubs. Why? For some unknown reason + _start is marked as a long branch stub in hpux10. */ + u = find_unwind_entry (pc); + if (u && u->stub_type != 0 + && u->stub_type != LONG_BRANCH) + { + unsigned int insn; + + /* If this is a dynamic executable, and we're in a signal handler, + then the call chain will eventually point us into the stub for + _sigreturn. Unlike most cases, we'll be pointed to the branch + to the real sigreturn rather than the code after the real branch!. + + Else, try to dig the address the stub will return to in the normal + fashion. */ + insn = read_memory_integer (pc, 4); + if ((insn & 0xfc00e000) == 0xe8000000) + return (pc + extract_17 (insn) + 8) & ~0x3; + else + goto restart; + } + + return pc; +} + +/* We need to correct the PC and the FP for the outermost frame when we are + in a system call. */ + +void +init_extra_frame_info (fromleaf, frame) + int fromleaf; + struct frame_info *frame; +{ + int flags; + int framesize; + + if (frame->next && !fromleaf) + return; + + /* If the next frame represents a frameless function invocation + then we have to do some adjustments that are normally done by + FRAME_CHAIN. (FRAME_CHAIN is not called in this case.) */ + if (fromleaf) + { + /* Find the framesize of *this* frame without peeking at the PC + in the current frame structure (it isn't set yet). */ + framesize = find_proc_framesize (FRAME_SAVED_PC (get_next_frame (frame))); + + /* Now adjust our base frame accordingly. If we have a frame pointer + use it, else subtract the size of this frame from the current + frame. (we always want frame->frame to point at the lowest address + in the frame). */ + if (framesize == -1) + frame->frame = read_register (FP_REGNUM); + else + frame->frame -= framesize; + return; + } + + flags = read_register (FLAGS_REGNUM); + if (flags & 2) /* In system call? */ + frame->pc = read_register (31) & ~0x3; + + /* The outermost frame is always derived from PC-framesize + + One might think frameless innermost frames should have + a frame->frame that is the same as the parent's frame->frame. + That is wrong; frame->frame in that case should be the *high* + address of the parent's frame. It's complicated as hell to + explain, but the parent *always* creates some stack space for + the child. So the child actually does have a frame of some + sorts, and its base is the high address in its parent's frame. */ + framesize = find_proc_framesize(frame->pc); + if (framesize == -1) + frame->frame = read_register (FP_REGNUM); + else + frame->frame = read_register (SP_REGNUM) - framesize; +} + +/* Given a GDB frame, determine the address of the calling function's frame. + This will be used to create a new GDB frame struct, and then + INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame. + + This may involve searching through prologues for several functions + at boundaries where GCC calls HP C code, or where code which has + a frame pointer calls code without a frame pointer. */ + +CORE_ADDR +frame_chain (frame) + struct frame_info *frame; +{ + int my_framesize, caller_framesize; + struct unwind_table_entry *u; + CORE_ADDR frame_base; + struct frame_info *tmp_frame; + + /* Handle HPUX, BSD, and OSF1 style interrupt frames first. These + are easy; at *sp we have a full save state strucutre which we can + pull the old stack pointer from. Also see frame_saved_pc for + code to dig a saved PC out of the save state structure. */ + if (pc_in_interrupt_handler (frame->pc)) + frame_base = read_memory_integer (frame->frame + SP_REGNUM * 4, 4); +#ifdef FRAME_BASE_BEFORE_SIGTRAMP + else if (frame->signal_handler_caller) + { + FRAME_BASE_BEFORE_SIGTRAMP (frame, &frame_base); + } +#endif + else + frame_base = frame->frame; + + /* Get frame sizes for the current frame and the frame of the + caller. */ + my_framesize = find_proc_framesize (frame->pc); + caller_framesize = find_proc_framesize (FRAME_SAVED_PC(frame)); + + /* If caller does not have a frame pointer, then its frame + can be found at current_frame - caller_framesize. */ + if (caller_framesize != -1) + return frame_base - caller_framesize; + + /* Both caller and callee have frame pointers and are GCC compiled + (SAVE_SP bit in unwind descriptor is on for both functions. + The previous frame pointer is found at the top of the current frame. */ + if (caller_framesize == -1 && my_framesize == -1) + return read_memory_integer (frame_base, 4); + + /* Caller has a frame pointer, but callee does not. This is a little + more difficult as GCC and HP C lay out locals and callee register save + areas very differently. + + The previous frame pointer could be in a register, or in one of + several areas on the stack. + + Walk from the current frame to the innermost frame examining + unwind descriptors to determine if %r3 ever gets saved into the + stack. If so return whatever value got saved into the stack. + If it was never saved in the stack, then the value in %r3 is still + valid, so use it. + + We use information from unwind descriptors to determine if %r3 + is saved into the stack (Entry_GR field has this information). */ + + tmp_frame = frame; + while (tmp_frame) + { + u = find_unwind_entry (tmp_frame->pc); + + if (!u) + { + /* We could find this information by examining prologues. I don't + think anyone has actually written any tools (not even "strip") + which leave them out of an executable, so maybe this is a moot + point. */ + warning ("Unable to find unwind for PC 0x%x -- Help!", tmp_frame->pc); + return 0; + } + + /* Entry_GR specifies the number of callee-saved general registers + saved in the stack. It starts at %r3, so %r3 would be 1. */ + if (u->Entry_GR >= 1 || u->Save_SP + || tmp_frame->signal_handler_caller + || pc_in_interrupt_handler (tmp_frame->pc)) + break; + else + tmp_frame = tmp_frame->next; + } + + if (tmp_frame) + { + /* We may have walked down the chain into a function with a frame + pointer. */ + if (u->Save_SP + && !tmp_frame->signal_handler_caller + && !pc_in_interrupt_handler (tmp_frame->pc)) + return read_memory_integer (tmp_frame->frame, 4); + /* %r3 was saved somewhere in the stack. Dig it out. */ + else + { + struct frame_saved_regs saved_regs; + + /* Sick. + + For optimization purposes many kernels don't have the + callee saved registers into the save_state structure upon + entry into the kernel for a syscall; the optimization + is usually turned off if the process is being traced so + that the debugger can get full register state for the + process. + + This scheme works well except for two cases: + + * Attaching to a process when the process is in the + kernel performing a system call (debugger can't get + full register state for the inferior process since + the process wasn't being traced when it entered the + system call). + + * Register state is not complete if the system call + causes the process to core dump. + + + The following heinous code is an attempt to deal with + the lack of register state in a core dump. It will + fail miserably if the function which performs the + system call has a variable sized stack frame. */ + + get_frame_saved_regs (tmp_frame, &saved_regs); + + /* Abominable hack. */ + if (current_target.to_has_execution == 0 + && ((saved_regs.regs[FLAGS_REGNUM] + && (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4) + & 0x2)) + || (saved_regs.regs[FLAGS_REGNUM] == 0 + && read_register (FLAGS_REGNUM) & 0x2))) + { + u = find_unwind_entry (FRAME_SAVED_PC (frame)); + if (!u) + return read_memory_integer (saved_regs.regs[FP_REGNUM], 4); + else + return frame_base - (u->Total_frame_size << 3); + } + + return read_memory_integer (saved_regs.regs[FP_REGNUM], 4); + } + } + else + { + struct frame_saved_regs saved_regs; + + /* Get the innermost frame. */ + tmp_frame = frame; + while (tmp_frame->next != NULL) + tmp_frame = tmp_frame->next; + + get_frame_saved_regs (tmp_frame, &saved_regs); + /* Abominable hack. See above. */ + if (current_target.to_has_execution == 0 + && ((saved_regs.regs[FLAGS_REGNUM] + && (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], 4) + & 0x2)) + || (saved_regs.regs[FLAGS_REGNUM] == 0 + && read_register (FLAGS_REGNUM) & 0x2))) + { + u = find_unwind_entry (FRAME_SAVED_PC (frame)); + if (!u) + return read_memory_integer (saved_regs.regs[FP_REGNUM], 4); + else + return frame_base - (u->Total_frame_size << 3); + } + + /* The value in %r3 was never saved into the stack (thus %r3 still + holds the value of the previous frame pointer). */ + return read_register (FP_REGNUM); + } +} + + +/* To see if a frame chain is valid, see if the caller looks like it + was compiled with gcc. */ + +int +frame_chain_valid (chain, thisframe) + CORE_ADDR chain; + struct frame_info *thisframe; +{ + struct minimal_symbol *msym_us; + struct minimal_symbol *msym_start; + struct unwind_table_entry *u, *next_u = NULL; + struct frame_info *next; + + if (!chain) + return 0; + + u = find_unwind_entry (thisframe->pc); + + if (u == NULL) + return 1; + + /* We can't just check that the same of msym_us is "_start", because + someone idiotically decided that they were going to make a Ltext_end + symbol with the same address. This Ltext_end symbol is totally + indistinguishable (as nearly as I can tell) from the symbol for a function + which is (legitimately, since it is in the user's namespace) + named Ltext_end, so we can't just ignore it. */ + msym_us = lookup_minimal_symbol_by_pc (FRAME_SAVED_PC (thisframe)); + msym_start = lookup_minimal_symbol ("_start", NULL, NULL); + if (msym_us + && msym_start + && SYMBOL_VALUE_ADDRESS (msym_us) == SYMBOL_VALUE_ADDRESS (msym_start)) + return 0; + + /* Grrrr. Some new idiot decided that they don't want _start for the + PRO configurations; $START$ calls main directly.... Deal with it. */ + msym_start = lookup_minimal_symbol ("$START$", NULL, NULL); + if (msym_us + && msym_start + && SYMBOL_VALUE_ADDRESS (msym_us) == SYMBOL_VALUE_ADDRESS (msym_start)) + return 0; + + next = get_next_frame (thisframe); + if (next) + next_u = find_unwind_entry (next->pc); + + /* If this frame does not save SP, has no stack, isn't a stub, + and doesn't "call" an interrupt routine or signal handler caller, + then its not valid. */ + if (u->Save_SP || u->Total_frame_size || u->stub_type != 0 + || (thisframe->next && thisframe->next->signal_handler_caller) + || (next_u && next_u->HP_UX_interrupt_marker)) + return 1; + + if (pc_in_linker_stub (thisframe->pc)) + return 1; + + return 0; +} + +/* + * These functions deal with saving and restoring register state + * around a function call in the inferior. They keep the stack + * double-word aligned; eventually, on an hp700, the stack will have + * to be aligned to a 64-byte boundary. + */ + +void +push_dummy_frame (inf_status) + struct inferior_status *inf_status; +{ + CORE_ADDR sp, pc, pcspace; + register int regnum; + int int_buffer; + double freg_buffer; + + /* Oh, what a hack. If we're trying to perform an inferior call + while the inferior is asleep, we have to make sure to clear + the "in system call" bit in the flag register (the call will + start after the syscall returns, so we're no longer in the system + call!) This state is kept in "inf_status", change it there. + + We also need a number of horrid hacks to deal with lossage in the + PC queue registers (apparently they're not valid when the in syscall + bit is set). */ + pc = target_read_pc (inferior_pid); + int_buffer = read_register (FLAGS_REGNUM); + if (int_buffer & 0x2) + { + unsigned int sid; + int_buffer &= ~0x2; + memcpy (inf_status->registers, &int_buffer, 4); + memcpy (inf_status->registers + REGISTER_BYTE (PCOQ_HEAD_REGNUM), &pc, 4); + pc += 4; + memcpy (inf_status->registers + REGISTER_BYTE (PCOQ_TAIL_REGNUM), &pc, 4); + pc -= 4; + sid = (pc >> 30) & 0x3; + if (sid == 0) + pcspace = read_register (SR4_REGNUM); + else + pcspace = read_register (SR4_REGNUM + 4 + sid); + memcpy (inf_status->registers + REGISTER_BYTE (PCSQ_HEAD_REGNUM), + &pcspace, 4); + memcpy (inf_status->registers + REGISTER_BYTE (PCSQ_TAIL_REGNUM), + &pcspace, 4); + } + else + pcspace = read_register (PCSQ_HEAD_REGNUM); + + /* Space for "arguments"; the RP goes in here. */ + sp = read_register (SP_REGNUM) + 48; + int_buffer = read_register (RP_REGNUM) | 0x3; + write_memory (sp - 20, (char *)&int_buffer, 4); + + int_buffer = read_register (FP_REGNUM); + write_memory (sp, (char *)&int_buffer, 4); + + write_register (FP_REGNUM, sp); + + sp += 8; + + for (regnum = 1; regnum < 32; regnum++) + if (regnum != RP_REGNUM && regnum != FP_REGNUM) + sp = push_word (sp, read_register (regnum)); + + sp += 4; + + for (regnum = FP0_REGNUM; regnum < NUM_REGS; regnum++) + { + read_register_bytes (REGISTER_BYTE (regnum), (char *)&freg_buffer, 8); + sp = push_bytes (sp, (char *)&freg_buffer, 8); + } + sp = push_word (sp, read_register (IPSW_REGNUM)); + sp = push_word (sp, read_register (SAR_REGNUM)); + sp = push_word (sp, pc); + sp = push_word (sp, pcspace); + sp = push_word (sp, pc + 4); + sp = push_word (sp, pcspace); + write_register (SP_REGNUM, sp); +} + +void +find_dummy_frame_regs (frame, frame_saved_regs) + struct frame_info *frame; + struct frame_saved_regs *frame_saved_regs; +{ + CORE_ADDR fp = frame->frame; + int i; + + frame_saved_regs->regs[RP_REGNUM] = fp - 20 & ~0x3; + frame_saved_regs->regs[FP_REGNUM] = fp; + frame_saved_regs->regs[1] = fp + 8; + + for (fp += 12, i = 3; i < 32; i++) + { + if (i != FP_REGNUM) + { + frame_saved_regs->regs[i] = fp; + fp += 4; + } + } + + fp += 4; + for (i = FP0_REGNUM; i < NUM_REGS; i++, fp += 8) + frame_saved_regs->regs[i] = fp; + + frame_saved_regs->regs[IPSW_REGNUM] = fp; + frame_saved_regs->regs[SAR_REGNUM] = fp + 4; + frame_saved_regs->regs[PCOQ_HEAD_REGNUM] = fp + 8; + frame_saved_regs->regs[PCSQ_HEAD_REGNUM] = fp + 12; + frame_saved_regs->regs[PCOQ_TAIL_REGNUM] = fp + 16; + frame_saved_regs->regs[PCSQ_TAIL_REGNUM] = fp + 20; +} + +void +hppa_pop_frame () +{ + register struct frame_info *frame = get_current_frame (); + register CORE_ADDR fp, npc, target_pc; + register int regnum; + struct frame_saved_regs fsr; + double freg_buffer; + + fp = FRAME_FP (frame); + get_frame_saved_regs (frame, &fsr); + +#ifndef NO_PC_SPACE_QUEUE_RESTORE + if (fsr.regs[IPSW_REGNUM]) /* Restoring a call dummy frame */ + restore_pc_queue (&fsr); +#endif + + for (regnum = 31; regnum > 0; regnum--) + if (fsr.regs[regnum]) + write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); + + for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM ; regnum--) + if (fsr.regs[regnum]) + { + read_memory (fsr.regs[regnum], (char *)&freg_buffer, 8); + write_register_bytes (REGISTER_BYTE (regnum), (char *)&freg_buffer, 8); + } + + if (fsr.regs[IPSW_REGNUM]) + write_register (IPSW_REGNUM, + read_memory_integer (fsr.regs[IPSW_REGNUM], 4)); + + if (fsr.regs[SAR_REGNUM]) + write_register (SAR_REGNUM, + read_memory_integer (fsr.regs[SAR_REGNUM], 4)); + + /* If the PC was explicitly saved, then just restore it. */ + if (fsr.regs[PCOQ_TAIL_REGNUM]) + { + npc = read_memory_integer (fsr.regs[PCOQ_TAIL_REGNUM], 4); + write_register (PCOQ_TAIL_REGNUM, npc); + } + /* Else use the value in %rp to set the new PC. */ + else + { + npc = read_register (RP_REGNUM); + target_write_pc (npc, 0); + } + + write_register (FP_REGNUM, read_memory_integer (fp, 4)); + + if (fsr.regs[IPSW_REGNUM]) /* call dummy */ + write_register (SP_REGNUM, fp - 48); + else + write_register (SP_REGNUM, fp); + + /* The PC we just restored may be inside a return trampoline. If so + we want to restart the inferior and run it through the trampoline. + + Do this by setting a momentary breakpoint at the location the + trampoline returns to. + + Don't skip through the trampoline if we're popping a dummy frame. */ + target_pc = SKIP_TRAMPOLINE_CODE (npc & ~0x3) & ~0x3; + if (target_pc && !fsr.regs[IPSW_REGNUM]) + { + struct symtab_and_line sal; + struct breakpoint *breakpoint; + struct cleanup *old_chain; + + /* Set up our breakpoint. Set it to be silent as the MI code + for "return_command" will print the frame we returned to. */ + sal = find_pc_line (target_pc, 0); + sal.pc = target_pc; + breakpoint = set_momentary_breakpoint (sal, NULL, bp_finish); + breakpoint->silent = 1; + + /* So we can clean things up. */ + old_chain = make_cleanup (delete_breakpoint, breakpoint); + + /* Start up the inferior. */ + clear_proceed_status (); + proceed_to_finish = 1; + proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0); + + /* Perform our cleanups. */ + do_cleanups (old_chain); + } + flush_cached_frames (); +} + +/* + * After returning to a dummy on the stack, restore the instruction + * queue space registers. */ + +static int +restore_pc_queue (fsr) + struct frame_saved_regs *fsr; +{ + CORE_ADDR pc = read_pc (); + CORE_ADDR new_pc = read_memory_integer (fsr->regs[PCOQ_HEAD_REGNUM], 4); + struct target_waitstatus w; + int insn_count; + + /* Advance past break instruction in the call dummy. */ + write_register (PCOQ_HEAD_REGNUM, pc + 4); + write_register (PCOQ_TAIL_REGNUM, pc + 8); + + /* + * HPUX doesn't let us set the space registers or the space + * registers of the PC queue through ptrace. Boo, hiss. + * Conveniently, the call dummy has this sequence of instructions + * after the break: + * mtsp r21, sr0 + * ble,n 0(sr0, r22) + * + * So, load up the registers and single step until we are in the + * right place. + */ + + write_register (21, read_memory_integer (fsr->regs[PCSQ_HEAD_REGNUM], 4)); + write_register (22, new_pc); + + for (insn_count = 0; insn_count < 3; insn_count++) + { + /* FIXME: What if the inferior gets a signal right now? Want to + merge this into wait_for_inferior (as a special kind of + watchpoint? By setting a breakpoint at the end? Is there + any other choice? Is there *any* way to do this stuff with + ptrace() or some equivalent?). */ + resume (1, 0); + target_wait (inferior_pid, &w); + + if (w.kind == TARGET_WAITKIND_SIGNALLED) + { + stop_signal = w.value.sig; + terminal_ours_for_output (); + printf_unfiltered ("\nProgram terminated with signal %s, %s.\n", + target_signal_to_name (stop_signal), + target_signal_to_string (stop_signal)); + gdb_flush (gdb_stdout); + return 0; + } + } + target_terminal_ours (); + target_fetch_registers (-1); + return 1; +} + +CORE_ADDR +hppa_push_arguments (nargs, args, sp, struct_return, struct_addr) + int nargs; + value_ptr *args; + CORE_ADDR sp; + int struct_return; + CORE_ADDR struct_addr; +{ + /* array of arguments' offsets */ + int *offset = (int *)alloca(nargs * sizeof (int)); + int cum = 0; + int i, alignment; + + for (i = 0; i < nargs; i++) + { + cum += TYPE_LENGTH (VALUE_TYPE (args[i])); + + /* value must go at proper alignment. Assume alignment is a + power of two.*/ + alignment = hppa_alignof (VALUE_TYPE (args[i])); + if (cum % alignment) + cum = (cum + alignment) & -alignment; + offset[i] = -cum; + } + sp += max ((cum + 7) & -8, 16); + + for (i = 0; i < nargs; i++) + write_memory (sp + offset[i], VALUE_CONTENTS (args[i]), + TYPE_LENGTH (VALUE_TYPE (args[i]))); + + if (struct_return) + write_register (28, struct_addr); + return sp + 32; +} + +/* + * Insert the specified number of args and function address + * into a call sequence of the above form stored at DUMMYNAME. + * + * On the hppa we need to call the stack dummy through $$dyncall. + * Therefore our version of FIX_CALL_DUMMY takes an extra argument, + * real_pc, which is the location where gdb should start up the + * inferior to do the function call. + */ + +CORE_ADDR +hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p) + char *dummy; + CORE_ADDR pc; + CORE_ADDR fun; + int nargs; + value_ptr *args; + struct type *type; + int gcc_p; +{ + CORE_ADDR dyncall_addr; + struct minimal_symbol *msymbol; + struct minimal_symbol *trampoline; + int flags = read_register (FLAGS_REGNUM); + struct unwind_table_entry *u; + + trampoline = NULL; + msymbol = lookup_minimal_symbol ("$$dyncall", NULL, NULL); + if (msymbol == NULL) + error ("Can't find an address for $$dyncall trampoline"); + + dyncall_addr = SYMBOL_VALUE_ADDRESS (msymbol); + + /* FUN could be a procedure label, in which case we have to get + its real address and the value of its GOT/DP. */ + if (fun & 0x2) + { + /* Get the GOT/DP value for the target function. It's + at *(fun+4). Note the call dummy is *NOT* allowed to + trash %r19 before calling the target function. */ + write_register (19, read_memory_integer ((fun & ~0x3) + 4, 4)); + + /* Now get the real address for the function we are calling, it's + at *fun. */ + fun = (CORE_ADDR) read_memory_integer (fun & ~0x3, 4); + } + else + { + +#ifndef GDB_TARGET_IS_PA_ELF + /* FUN could be either an export stub, or the real address of a + function in a shared library. We must call an import stub + rather than the export stub or real function for lazy binding + to work correctly. */ + if (som_solib_get_got_by_pc (fun)) + { + struct objfile *objfile; + struct minimal_symbol *funsymbol, *stub_symbol; + CORE_ADDR newfun = 0; + + funsymbol = lookup_minimal_symbol_by_pc (fun); + if (!funsymbol) + error ("Unable to find minimal symbol for target fucntion.\n"); + + /* Search all the object files for an import symbol with the + right name. */ + ALL_OBJFILES (objfile) + { + stub_symbol = lookup_minimal_symbol (SYMBOL_NAME (funsymbol), + NULL, objfile); + /* Found a symbol with the right name. */ + if (stub_symbol) + { + struct unwind_table_entry *u; + /* It must be a shared library trampoline. */ + if (SYMBOL_TYPE (stub_symbol) != mst_solib_trampoline) + continue; + + /* It must also be an import stub. */ + u = find_unwind_entry (SYMBOL_VALUE (stub_symbol)); + if (!u || u->stub_type != IMPORT) + continue; + + /* OK. Looks like the correct import stub. */ + newfun = SYMBOL_VALUE (stub_symbol); + fun = newfun; + } + } + if (newfun == 0) + write_register (19, som_solib_get_got_by_pc (fun)); + } +#endif + } + + /* If we are calling an import stub (eg calling into a dynamic library) + then have sr4export call the magic __d_plt_call routine which is linked + in from end.o. (You can't use _sr4export to call the import stub as + the value in sp-24 will get fried and you end up returning to the + wrong location. You can't call the import stub directly as the code + to bind the PLT entry to a function can't return to a stack address.) */ + u = find_unwind_entry (fun); + if (u && u->stub_type == IMPORT) + { + CORE_ADDR new_fun; + + /* Prefer __gcc_plt_call over the HP supplied routine because + __gcc_plt_call works for any number of arguments. */ + trampoline = lookup_minimal_symbol ("__gcc_plt_call", NULL, NULL); + if (trampoline == NULL) + trampoline = lookup_minimal_symbol ("__d_plt_call", NULL, NULL); + + if (trampoline == NULL) + error ("Can't find an address for __d_plt_call or __gcc_plt_call trampoline"); + + /* This is where sr4export will jump to. */ + new_fun = SYMBOL_VALUE_ADDRESS (trampoline); + + if (strcmp (SYMBOL_NAME (trampoline), "__d_plt_call") == 0) + { + /* We have to store the address of the stub in __shlib_funcptr. */ + msymbol = lookup_minimal_symbol ("__shlib_funcptr", NULL, + (struct objfile *)NULL); + if (msymbol == NULL) + error ("Can't find an address for __shlib_funcptr"); + + target_write_memory (SYMBOL_VALUE_ADDRESS (msymbol), (char *)&fun, 4); + + /* We want sr4export to call __d_plt_call, so we claim it is + the final target. Clear trampoline. */ + fun = new_fun; + trampoline = NULL; + } + } + + /* Store upper 21 bits of function address into ldil. fun will either be + the final target (most cases) or __d_plt_call when calling into a shared + library and __gcc_plt_call is not available. */ + store_unsigned_integer + (&dummy[FUNC_LDIL_OFFSET], + INSTRUCTION_SIZE, + deposit_21 (fun >> 11, + extract_unsigned_integer (&dummy[FUNC_LDIL_OFFSET], + INSTRUCTION_SIZE))); + + /* Store lower 11 bits of function address into ldo */ + store_unsigned_integer + (&dummy[FUNC_LDO_OFFSET], + INSTRUCTION_SIZE, + deposit_14 (fun & MASK_11, + extract_unsigned_integer (&dummy[FUNC_LDO_OFFSET], + INSTRUCTION_SIZE))); +#ifdef SR4EXPORT_LDIL_OFFSET + + { + CORE_ADDR trampoline_addr; + + /* We may still need sr4export's address too. */ + + if (trampoline == NULL) + { + msymbol = lookup_minimal_symbol ("_sr4export", NULL, NULL); + if (msymbol == NULL) + error ("Can't find an address for _sr4export trampoline"); + + trampoline_addr = SYMBOL_VALUE_ADDRESS (msymbol); + } + else + trampoline_addr = SYMBOL_VALUE_ADDRESS (trampoline); + + + /* Store upper 21 bits of trampoline's address into ldil */ + store_unsigned_integer + (&dummy[SR4EXPORT_LDIL_OFFSET], + INSTRUCTION_SIZE, + deposit_21 (trampoline_addr >> 11, + extract_unsigned_integer (&dummy[SR4EXPORT_LDIL_OFFSET], + INSTRUCTION_SIZE))); + + /* Store lower 11 bits of trampoline's address into ldo */ + store_unsigned_integer + (&dummy[SR4EXPORT_LDO_OFFSET], + INSTRUCTION_SIZE, + deposit_14 (trampoline_addr & MASK_11, + extract_unsigned_integer (&dummy[SR4EXPORT_LDO_OFFSET], + INSTRUCTION_SIZE))); + } +#endif + + write_register (22, pc); + + /* If we are in a syscall, then we should call the stack dummy + directly. $$dyncall is not needed as the kernel sets up the + space id registers properly based on the value in %r31. In + fact calling $$dyncall will not work because the value in %r22 + will be clobbered on the syscall exit path. + + Similarly if the current PC is in a shared library. Note however, + this scheme won't work if the shared library isn't mapped into + the same space as the stack. */ + if (flags & 2) + return pc; +#ifndef GDB_TARGET_IS_PA_ELF + else if (som_solib_get_got_by_pc (target_read_pc (inferior_pid))) + return pc; +#endif + else + return dyncall_addr; + +} + +/* Get the PC from %r31 if currently in a syscall. Also mask out privilege + bits. */ + +CORE_ADDR +target_read_pc (pid) + int pid; +{ + int flags = read_register (FLAGS_REGNUM); + + if (flags & 2) { + return read_register (31) & ~0x3; + } + return read_register (PC_REGNUM) & ~0x3; +} + +/* Write out the PC. If currently in a syscall, then also write the new + PC value into %r31. */ + +void +target_write_pc (v, pid) + CORE_ADDR v; + int pid; +{ + int flags = read_register (FLAGS_REGNUM); + + /* If in a syscall, then set %r31. Also make sure to get the + privilege bits set correctly. */ + if (flags & 2) + write_register (31, (long) (v | 0x3)); + + write_register (PC_REGNUM, (long) v); + write_register (NPC_REGNUM, (long) v + 4); +} + +/* return the alignment of a type in bytes. Structures have the maximum + alignment required by their fields. */ + +static int +hppa_alignof (type) + struct type *type; +{ + int max_align, align, i; + CHECK_TYPEDEF (type); + switch (TYPE_CODE (type)) + { + case TYPE_CODE_PTR: + case TYPE_CODE_INT: + case TYPE_CODE_FLT: + return TYPE_LENGTH (type); + case TYPE_CODE_ARRAY: + return hppa_alignof (TYPE_FIELD_TYPE (type, 0)); + case TYPE_CODE_STRUCT: + case TYPE_CODE_UNION: + max_align = 2; + for (i = 0; i < TYPE_NFIELDS (type); i++) + { + /* Bit fields have no real alignment. */ + if (!TYPE_FIELD_BITPOS (type, i)) + { + align = hppa_alignof (TYPE_FIELD_TYPE (type, i)); + max_align = max (max_align, align); + } + } + return max_align; + default: + return 4; + } +} + +/* Print the register regnum, or all registers if regnum is -1 */ + +void +pa_do_registers_info (regnum, fpregs) + int regnum; + int fpregs; +{ + char raw_regs [REGISTER_BYTES]; + int i; + + for (i = 0; i < NUM_REGS; i++) + read_relative_register_raw_bytes (i, raw_regs + REGISTER_BYTE (i)); + if (regnum == -1) + pa_print_registers (raw_regs, regnum, fpregs); + else if (regnum < FP0_REGNUM) + printf_unfiltered ("%s %x\n", reg_names[regnum], *(long *)(raw_regs + + REGISTER_BYTE (regnum))); + else + pa_print_fp_reg (regnum); +} + +static void +pa_print_registers (raw_regs, regnum, fpregs) + char *raw_regs; + int regnum; + int fpregs; +{ + int i,j; + long val; + + for (i = 0; i < 18; i++) + { + for (j = 0; j < 4; j++) + { + val = + extract_signed_integer (raw_regs + REGISTER_BYTE (i+(j*18)), 4); + printf_unfiltered ("%8.8s: %8x ", reg_names[i+(j*18)], val); + } + printf_unfiltered ("\n"); + } + + if (fpregs) + for (i = 72; i < NUM_REGS; i++) + pa_print_fp_reg (i); +} + +static void +pa_print_fp_reg (i) + int i; +{ + unsigned char raw_buffer[MAX_REGISTER_RAW_SIZE]; + unsigned char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE]; + + /* Get 32bits of data. */ + read_relative_register_raw_bytes (i, raw_buffer); + + /* Put it in the buffer. No conversions are ever necessary. */ + memcpy (virtual_buffer, raw_buffer, REGISTER_RAW_SIZE (i)); + + fputs_filtered (reg_names[i], gdb_stdout); + print_spaces_filtered (8 - strlen (reg_names[i]), gdb_stdout); + fputs_filtered ("(single precision) ", gdb_stdout); + + val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, gdb_stdout, 0, + 1, 0, Val_pretty_default); + printf_filtered ("\n"); + + /* If "i" is even, then this register can also be a double-precision + FP register. Dump it out as such. */ + if ((i % 2) == 0) + { + /* Get the data in raw format for the 2nd half. */ + read_relative_register_raw_bytes (i + 1, raw_buffer); + + /* Copy it into the appropriate part of the virtual buffer. */ + memcpy (virtual_buffer + REGISTER_RAW_SIZE (i), raw_buffer, + REGISTER_RAW_SIZE (i)); + + /* Dump it as a double. */ + fputs_filtered (reg_names[i], gdb_stdout); + print_spaces_filtered (8 - strlen (reg_names[i]), gdb_stdout); + fputs_filtered ("(double precision) ", gdb_stdout); + + val_print (builtin_type_double, virtual_buffer, 0, gdb_stdout, 0, + 1, 0, Val_pretty_default); + printf_filtered ("\n"); + } +} + +/* Return one if PC is in the call path of a trampoline, else return zero. + + Note we return one for *any* call trampoline (long-call, arg-reloc), not + just shared library trampolines (import, export). */ + +int +in_solib_call_trampoline (pc, name) + CORE_ADDR pc; + char *name; +{ + struct minimal_symbol *minsym; + struct unwind_table_entry *u; + static CORE_ADDR dyncall = 0; + static CORE_ADDR sr4export = 0; + +/* FIXME XXX - dyncall and sr4export must be initialized whenever we get a + new exec file */ + + /* First see if PC is in one of the two C-library trampolines. */ + if (!dyncall) + { + minsym = lookup_minimal_symbol ("$$dyncall", NULL, NULL); + if (minsym) + dyncall = SYMBOL_VALUE_ADDRESS (minsym); + else + dyncall = -1; + } + + if (!sr4export) + { + minsym = lookup_minimal_symbol ("_sr4export", NULL, NULL); + if (minsym) + sr4export = SYMBOL_VALUE_ADDRESS (minsym); + else + sr4export = -1; + } + + if (pc == dyncall || pc == sr4export) + return 1; + + /* Get the unwind descriptor corresponding to PC, return zero + if no unwind was found. */ + u = find_unwind_entry (pc); + if (!u) + return 0; + + /* If this isn't a linker stub, then return now. */ + if (u->stub_type == 0) + return 0; + + /* By definition a long-branch stub is a call stub. */ + if (u->stub_type == LONG_BRANCH) + return 1; + + /* The call and return path execute the same instructions within + an IMPORT stub! So an IMPORT stub is both a call and return + trampoline. */ + if (u->stub_type == IMPORT) + return 1; + + /* Parameter relocation stubs always have a call path and may have a + return path. */ + if (u->stub_type == PARAMETER_RELOCATION + || u->stub_type == EXPORT) + { + CORE_ADDR addr; + + /* Search forward from the current PC until we hit a branch + or the end of the stub. */ + for (addr = pc; addr <= u->region_end; addr += 4) + { + unsigned long insn; + + insn = read_memory_integer (addr, 4); + + /* Does it look like a bl? If so then it's the call path, if + we find a bv or be first, then we're on the return path. */ + if ((insn & 0xfc00e000) == 0xe8000000) + return 1; + else if ((insn & 0xfc00e001) == 0xe800c000 + || (insn & 0xfc000000) == 0xe0000000) + return 0; + } + + /* Should never happen. */ + warning ("Unable to find branch in parameter relocation stub.\n"); + return 0; + } + + /* Unknown stub type. For now, just return zero. */ + return 0; +} + +/* Return one if PC is in the return path of a trampoline, else return zero. + + Note we return one for *any* call trampoline (long-call, arg-reloc), not + just shared library trampolines (import, export). */ + +int +in_solib_return_trampoline (pc, name) + CORE_ADDR pc; + char *name; +{ + struct unwind_table_entry *u; + + /* Get the unwind descriptor corresponding to PC, return zero + if no unwind was found. */ + u = find_unwind_entry (pc); + if (!u) + return 0; + + /* If this isn't a linker stub or it's just a long branch stub, then + return zero. */ + if (u->stub_type == 0 || u->stub_type == LONG_BRANCH) + return 0; + + /* The call and return path execute the same instructions within + an IMPORT stub! So an IMPORT stub is both a call and return + trampoline. */ + if (u->stub_type == IMPORT) + return 1; + + /* Parameter relocation stubs always have a call path and may have a + return path. */ + if (u->stub_type == PARAMETER_RELOCATION + || u->stub_type == EXPORT) + { + CORE_ADDR addr; + + /* Search forward from the current PC until we hit a branch + or the end of the stub. */ + for (addr = pc; addr <= u->region_end; addr += 4) + { + unsigned long insn; + + insn = read_memory_integer (addr, 4); + + /* Does it look like a bl? If so then it's the call path, if + we find a bv or be first, then we're on the return path. */ + if ((insn & 0xfc00e000) == 0xe8000000) + return 0; + else if ((insn & 0xfc00e001) == 0xe800c000 + || (insn & 0xfc000000) == 0xe0000000) + return 1; + } + + /* Should never happen. */ + warning ("Unable to find branch in parameter relocation stub.\n"); + return 0; + } + + /* Unknown stub type. For now, just return zero. */ + return 0; + +} + +/* Figure out if PC is in a trampoline, and if so find out where + the trampoline will jump to. If not in a trampoline, return zero. + + Simple code examination probably is not a good idea since the code + sequences in trampolines can also appear in user code. + + We use unwinds and information from the minimal symbol table to + determine when we're in a trampoline. This won't work for ELF + (yet) since it doesn't create stub unwind entries. Whether or + not ELF will create stub unwinds or normal unwinds for linker + stubs is still being debated. + + This should handle simple calls through dyncall or sr4export, + long calls, argument relocation stubs, and dyncall/sr4export + calling an argument relocation stub. It even handles some stubs + used in dynamic executables. */ + +CORE_ADDR +skip_trampoline_code (pc, name) + CORE_ADDR pc; + char *name; +{ + long orig_pc = pc; + long prev_inst, curr_inst, loc; + static CORE_ADDR dyncall = 0; + static CORE_ADDR sr4export = 0; + struct minimal_symbol *msym; + struct unwind_table_entry *u; + +/* FIXME XXX - dyncall and sr4export must be initialized whenever we get a + new exec file */ + + if (!dyncall) + { + msym = lookup_minimal_symbol ("$$dyncall", NULL, NULL); + if (msym) + dyncall = SYMBOL_VALUE_ADDRESS (msym); + else + dyncall = -1; + } + + if (!sr4export) + { + msym = lookup_minimal_symbol ("_sr4export", NULL, NULL); + if (msym) + sr4export = SYMBOL_VALUE_ADDRESS (msym); + else + sr4export = -1; + } + + /* Addresses passed to dyncall may *NOT* be the actual address + of the function. So we may have to do something special. */ + if (pc == dyncall) + { + pc = (CORE_ADDR) read_register (22); + + /* If bit 30 (counting from the left) is on, then pc is the address of + the PLT entry for this function, not the address of the function + itself. Bit 31 has meaning too, but only for MPE. */ + if (pc & 0x2) + pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, 4); + } + else if (pc == sr4export) + pc = (CORE_ADDR) (read_register (22)); + + /* Get the unwind descriptor corresponding to PC, return zero + if no unwind was found. */ + u = find_unwind_entry (pc); + if (!u) + return 0; + + /* If this isn't a linker stub, then return now. */ + if (u->stub_type == 0) + return orig_pc == pc ? 0 : pc & ~0x3; + + /* It's a stub. Search for a branch and figure out where it goes. + Note we have to handle multi insn branch sequences like ldil;ble. + Most (all?) other branches can be determined by examining the contents + of certain registers and the stack. */ + loc = pc; + curr_inst = 0; + prev_inst = 0; + while (1) + { + /* Make sure we haven't walked outside the range of this stub. */ + if (u != find_unwind_entry (loc)) + { + warning ("Unable to find branch in linker stub"); + return orig_pc == pc ? 0 : pc & ~0x3; + } + + prev_inst = curr_inst; + curr_inst = read_memory_integer (loc, 4); + + /* Does it look like a branch external using %r1? Then it's the + branch from the stub to the actual function. */ + if ((curr_inst & 0xffe0e000) == 0xe0202000) + { + /* Yup. See if the previous instruction loaded + a value into %r1. If so compute and return the jump address. */ + if ((prev_inst & 0xffe00000) == 0x20200000) + return (extract_21 (prev_inst) + extract_17 (curr_inst)) & ~0x3; + else + { + warning ("Unable to find ldil X,%%r1 before ble Y(%%sr4,%%r1)."); + return orig_pc == pc ? 0 : pc & ~0x3; + } + } + + /* Does it look like a be 0(sr0,%r21)? That's the branch from an + import stub to an export stub. + + It is impossible to determine the target of the branch via + simple examination of instructions and/or data (consider + that the address in the plabel may be the address of the + bind-on-reference routine in the dynamic loader). + + So we have try an alternative approach. + + Get the name of the symbol at our current location; it should + be a stub symbol with the same name as the symbol in the + shared library. + + Then lookup a minimal symbol with the same name; we should + get the minimal symbol for the target routine in the shared + library as those take precedence of import/export stubs. */ + if (curr_inst == 0xe2a00000) + { + struct minimal_symbol *stubsym, *libsym; + + stubsym = lookup_minimal_symbol_by_pc (loc); + if (stubsym == NULL) + { + warning ("Unable to find symbol for 0x%x", loc); + return orig_pc == pc ? 0 : pc & ~0x3; + } + + libsym = lookup_minimal_symbol (SYMBOL_NAME (stubsym), NULL, NULL); + if (libsym == NULL) + { + warning ("Unable to find library symbol for %s\n", + SYMBOL_NAME (stubsym)); + return orig_pc == pc ? 0 : pc & ~0x3; + } + + return SYMBOL_VALUE (libsym); + } + + /* Does it look like bl X,%rp or bl X,%r0? Another way to do a + branch from the stub to the actual function. */ + else if ((curr_inst & 0xffe0e000) == 0xe8400000 + || (curr_inst & 0xffe0e000) == 0xe8000000) + return (loc + extract_17 (curr_inst) + 8) & ~0x3; + + /* Does it look like bv (rp)? Note this depends on the + current stack pointer being the same as the stack + pointer in the stub itself! This is a branch on from the + stub back to the original caller. */ + else if ((curr_inst & 0xffe0e000) == 0xe840c000) + { + /* Yup. See if the previous instruction loaded + rp from sp - 8. */ + if (prev_inst == 0x4bc23ff1) + return (read_memory_integer + (read_register (SP_REGNUM) - 8, 4)) & ~0x3; + else + { + warning ("Unable to find restore of %%rp before bv (%%rp)."); + return orig_pc == pc ? 0 : pc & ~0x3; + } + } + + /* What about be,n 0(sr0,%rp)? It's just another way we return to + the original caller from the stub. Used in dynamic executables. */ + else if (curr_inst == 0xe0400002) + { + /* The value we jump to is sitting in sp - 24. But that's + loaded several instructions before the be instruction. + I guess we could check for the previous instruction being + mtsp %r1,%sr0 if we want to do sanity checking. */ + return (read_memory_integer + (read_register (SP_REGNUM) - 24, 4)) & ~0x3; + } + + /* Haven't found the branch yet, but we're still in the stub. + Keep looking. */ + loc += 4; + } +} + +/* For the given instruction (INST), return any adjustment it makes + to the stack pointer or zero for no adjustment. + + This only handles instructions commonly found in prologues. */ + +static int +prologue_inst_adjust_sp (inst) + unsigned long inst; +{ + /* This must persist across calls. */ + static int save_high21; + + /* The most common way to perform a stack adjustment ldo X(sp),sp */ + if ((inst & 0xffffc000) == 0x37de0000) + return extract_14 (inst); + + /* stwm X,D(sp) */ + if ((inst & 0xffe00000) == 0x6fc00000) + return extract_14 (inst); + + /* addil high21,%r1; ldo low11,(%r1),%r30) + save high bits in save_high21 for later use. */ + if ((inst & 0xffe00000) == 0x28200000) + { + save_high21 = extract_21 (inst); + return 0; + } + + if ((inst & 0xffff0000) == 0x343e0000) + return save_high21 + extract_14 (inst); + + /* fstws as used by the HP compilers. */ + if ((inst & 0xffffffe0) == 0x2fd01220) + return extract_5_load (inst); + + /* No adjustment. */ + return 0; +} + +/* Return nonzero if INST is a branch of some kind, else return zero. */ + +static int +is_branch (inst) + unsigned long inst; +{ + switch (inst >> 26) + { + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x28: + case 0x29: + case 0x2a: + case 0x2b: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x38: + case 0x39: + case 0x3a: + return 1; + + default: + return 0; + } +} + +/* Return the register number for a GR which is saved by INST or + zero it INST does not save a GR. */ + +static int +inst_saves_gr (inst) + unsigned long inst; +{ + /* Does it look like a stw? */ + if ((inst >> 26) == 0x1a) + return extract_5R_store (inst); + + /* Does it look like a stwm? GCC & HPC may use this in prologues. */ + if ((inst >> 26) == 0x1b) + return extract_5R_store (inst); + + /* Does it look like sth or stb? HPC versions 9.0 and later use these + too. */ + if ((inst >> 26) == 0x19 || (inst >> 26) == 0x18) + return extract_5R_store (inst); + + return 0; +} + +/* Return the register number for a FR which is saved by INST or + zero it INST does not save a FR. + + Note we only care about full 64bit register stores (that's the only + kind of stores the prologue will use). + + FIXME: What about argument stores with the HP compiler in ANSI mode? */ + +static int +inst_saves_fr (inst) + unsigned long inst; +{ + if ((inst & 0xfc00dfc0) == 0x2c001200) + return extract_5r_store (inst); + return 0; +} + +/* Advance PC across any function entry prologue instructions + to reach some "real" code. + + Use information in the unwind table to determine what exactly should + be in the prologue. */ + +CORE_ADDR +skip_prologue (pc) + CORE_ADDR pc; +{ + char buf[4]; + CORE_ADDR orig_pc = pc; + unsigned long inst, stack_remaining, save_gr, save_fr, save_rp, save_sp; + unsigned long args_stored, status, i, restart_gr, restart_fr; + struct unwind_table_entry *u; + + restart_gr = 0; + restart_fr = 0; + +restart: + u = find_unwind_entry (pc); + if (!u) + return pc; + + /* If we are not at the beginning of a function, then return now. */ + if ((pc & ~0x3) != u->region_start) + return pc; + + /* This is how much of a frame adjustment we need to account for. */ + stack_remaining = u->Total_frame_size << 3; + + /* Magic register saves we want to know about. */ + save_rp = u->Save_RP; + save_sp = u->Save_SP; + + /* An indication that args may be stored into the stack. Unfortunately + the HPUX compilers tend to set this in cases where no args were + stored too!. */ + args_stored = 1; + + /* Turn the Entry_GR field into a bitmask. */ + save_gr = 0; + for (i = 3; i < u->Entry_GR + 3; i++) + { + /* Frame pointer gets saved into a special location. */ + if (u->Save_SP && i == FP_REGNUM) + continue; + + save_gr |= (1 << i); + } + save_gr &= ~restart_gr; + + /* Turn the Entry_FR field into a bitmask too. */ + save_fr = 0; + for (i = 12; i < u->Entry_FR + 12; i++) + save_fr |= (1 << i); + save_fr &= ~restart_fr; + + /* Loop until we find everything of interest or hit a branch. + + For unoptimized GCC code and for any HP CC code this will never ever + examine any user instructions. + + For optimzied GCC code we're faced with problems. GCC will schedule + its prologue and make prologue instructions available for delay slot + filling. The end result is user code gets mixed in with the prologue + and a prologue instruction may be in the delay slot of the first branch + or call. + + Some unexpected things are expected with debugging optimized code, so + we allow this routine to walk past user instructions in optimized + GCC code. */ + while (save_gr || save_fr || save_rp || save_sp || stack_remaining > 0 + || args_stored) + { + unsigned int reg_num; + unsigned long old_stack_remaining, old_save_gr, old_save_fr; + unsigned long old_save_rp, old_save_sp, next_inst; + + /* Save copies of all the triggers so we can compare them later + (only for HPC). */ + old_save_gr = save_gr; + old_save_fr = save_fr; + old_save_rp = save_rp; + old_save_sp = save_sp; + old_stack_remaining = stack_remaining; + + status = target_read_memory (pc, buf, 4); + inst = extract_unsigned_integer (buf, 4); + + /* Yow! */ + if (status != 0) + return pc; + + /* Note the interesting effects of this instruction. */ + stack_remaining -= prologue_inst_adjust_sp (inst); + + /* There is only one instruction used for saving RP into the stack. */ + if (inst == 0x6bc23fd9) + save_rp = 0; + + /* This is the only way we save SP into the stack. At this time + the HP compilers never bother to save SP into the stack. */ + if ((inst & 0xffffc000) == 0x6fc10000) + save_sp = 0; + + /* Account for general and floating-point register saves. */ + reg_num = inst_saves_gr (inst); + save_gr &= ~(1 << reg_num); + + /* Ugh. Also account for argument stores into the stack. + Unfortunately args_stored only tells us that some arguments + where stored into the stack. Not how many or what kind! + + This is a kludge as on the HP compiler sets this bit and it + never does prologue scheduling. So once we see one, skip past + all of them. We have similar code for the fp arg stores below. + + FIXME. Can still die if we have a mix of GR and FR argument + stores! */ + if (reg_num >= 23 && reg_num <= 26) + { + while (reg_num >= 23 && reg_num <= 26) + { + pc += 4; + status = target_read_memory (pc, buf, 4); + inst = extract_unsigned_integer (buf, 4); + if (status != 0) + return pc; + reg_num = inst_saves_gr (inst); + } + args_stored = 0; + continue; + } + + reg_num = inst_saves_fr (inst); + save_fr &= ~(1 << reg_num); + + status = target_read_memory (pc + 4, buf, 4); + next_inst = extract_unsigned_integer (buf, 4); + + /* Yow! */ + if (status != 0) + return pc; + + /* We've got to be read to handle the ldo before the fp register + save. */ + if ((inst & 0xfc000000) == 0x34000000 + && inst_saves_fr (next_inst) >= 4 + && inst_saves_fr (next_inst) <= 7) + { + /* So we drop into the code below in a reasonable state. */ + reg_num = inst_saves_fr (next_inst); + pc -= 4; + } + + /* Ugh. Also account for argument stores into the stack. + This is a kludge as on the HP compiler sets this bit and it + never does prologue scheduling. So once we see one, skip past + all of them. */ + if (reg_num >= 4 && reg_num <= 7) + { + while (reg_num >= 4 && reg_num <= 7) + { + pc += 8; + status = target_read_memory (pc, buf, 4); + inst = extract_unsigned_integer (buf, 4); + if (status != 0) + return pc; + if ((inst & 0xfc000000) != 0x34000000) + break; + status = target_read_memory (pc + 4, buf, 4); + next_inst = extract_unsigned_integer (buf, 4); + if (status != 0) + return pc; + reg_num = inst_saves_fr (next_inst); + } + args_stored = 0; + continue; + } + + /* Quit if we hit any kind of branch. This can happen if a prologue + instruction is in the delay slot of the first call/branch. */ + if (is_branch (inst)) + break; + + /* What a crock. The HP compilers set args_stored even if no + arguments were stored into the stack (boo hiss). This could + cause this code to then skip a bunch of user insns (up to the + first branch). + + To combat this we try to identify when args_stored was bogusly + set and clear it. We only do this when args_stored is nonzero, + all other resources are accounted for, and nothing changed on + this pass. */ + if (args_stored + && ! (save_gr || save_fr || save_rp || save_sp || stack_remaining > 0) + && old_save_gr == save_gr && old_save_fr == save_fr + && old_save_rp == save_rp && old_save_sp == save_sp + && old_stack_remaining == stack_remaining) + break; + + /* Bump the PC. */ + pc += 4; + } + + /* We've got a tenative location for the end of the prologue. However + because of limitations in the unwind descriptor mechanism we may + have went too far into user code looking for the save of a register + that does not exist. So, if there registers we expected to be saved + but never were, mask them out and restart. + + This should only happen in optimized code, and should be very rare. */ + if (save_gr || save_fr + && ! (restart_fr || restart_gr)) + { + pc = orig_pc; + restart_gr = save_gr; + restart_fr = save_fr; + goto restart; + } + + return pc; +} + +/* Put here the code to store, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. */ + +void +hppa_frame_find_saved_regs (frame_info, frame_saved_regs) + struct frame_info *frame_info; + struct frame_saved_regs *frame_saved_regs; +{ + CORE_ADDR pc; + struct unwind_table_entry *u; + unsigned long inst, stack_remaining, save_gr, save_fr, save_rp, save_sp; + int status, i, reg; + char buf[4]; + int fp_loc = -1; + + /* Zero out everything. */ + memset (frame_saved_regs, '\0', sizeof (struct frame_saved_regs)); + + /* Call dummy frames always look the same, so there's no need to + examine the dummy code to determine locations of saved registers; + instead, let find_dummy_frame_regs fill in the correct offsets + for the saved registers. */ + if ((frame_info->pc >= frame_info->frame + && frame_info->pc <= (frame_info->frame + CALL_DUMMY_LENGTH + + 32 * 4 + (NUM_REGS - FP0_REGNUM) * 8 + + 6 * 4))) + find_dummy_frame_regs (frame_info, frame_saved_regs); + + /* Interrupt handlers are special too. They lay out the register + state in the exact same order as the register numbers in GDB. */ + if (pc_in_interrupt_handler (frame_info->pc)) + { + for (i = 0; i < NUM_REGS; i++) + { + /* SP is a little special. */ + if (i == SP_REGNUM) + frame_saved_regs->regs[SP_REGNUM] + = read_memory_integer (frame_info->frame + SP_REGNUM * 4, 4); + else + frame_saved_regs->regs[i] = frame_info->frame + i * 4; + } + return; + } + +#ifdef FRAME_FIND_SAVED_REGS_IN_SIGTRAMP + /* Handle signal handler callers. */ + if (frame_info->signal_handler_caller) + { + FRAME_FIND_SAVED_REGS_IN_SIGTRAMP (frame_info, frame_saved_regs); + return; + } +#endif + + /* Get the starting address of the function referred to by the PC + saved in frame. */ + pc = get_pc_function_start (frame_info->pc); + + /* Yow! */ + u = find_unwind_entry (pc); + if (!u) + return; + + /* This is how much of a frame adjustment we need to account for. */ + stack_remaining = u->Total_frame_size << 3; + + /* Magic register saves we want to know about. */ + save_rp = u->Save_RP; + save_sp = u->Save_SP; + + /* Turn the Entry_GR field into a bitmask. */ + save_gr = 0; + for (i = 3; i < u->Entry_GR + 3; i++) + { + /* Frame pointer gets saved into a special location. */ + if (u->Save_SP && i == FP_REGNUM) + continue; + + save_gr |= (1 << i); + } + + /* Turn the Entry_FR field into a bitmask too. */ + save_fr = 0; + for (i = 12; i < u->Entry_FR + 12; i++) + save_fr |= (1 << i); + + /* The frame always represents the value of %sp at entry to the + current function (and is thus equivalent to the "saved" stack + pointer. */ + frame_saved_regs->regs[SP_REGNUM] = frame_info->frame; + + /* Loop until we find everything of interest or hit a branch. + + For unoptimized GCC code and for any HP CC code this will never ever + examine any user instructions. + + For optimzied GCC code we're faced with problems. GCC will schedule + its prologue and make prologue instructions available for delay slot + filling. The end result is user code gets mixed in with the prologue + and a prologue instruction may be in the delay slot of the first branch + or call. + + Some unexpected things are expected with debugging optimized code, so + we allow this routine to walk past user instructions in optimized + GCC code. */ + while (save_gr || save_fr || save_rp || save_sp || stack_remaining > 0) + { + status = target_read_memory (pc, buf, 4); + inst = extract_unsigned_integer (buf, 4); + + /* Yow! */ + if (status != 0) + return; + + /* Note the interesting effects of this instruction. */ + stack_remaining -= prologue_inst_adjust_sp (inst); + + /* There is only one instruction used for saving RP into the stack. */ + if (inst == 0x6bc23fd9) + { + save_rp = 0; + frame_saved_regs->regs[RP_REGNUM] = frame_info->frame - 20; + } + + /* Just note that we found the save of SP into the stack. The + value for frame_saved_regs was computed above. */ + if ((inst & 0xffffc000) == 0x6fc10000) + save_sp = 0; + + /* Account for general and floating-point register saves. */ + reg = inst_saves_gr (inst); + if (reg >= 3 && reg <= 18 + && (!u->Save_SP || reg != FP_REGNUM)) + { + save_gr &= ~(1 << reg); + + /* stwm with a positive displacement is a *post modify*. */ + if ((inst >> 26) == 0x1b + && extract_14 (inst) >= 0) + frame_saved_regs->regs[reg] = frame_info->frame; + else + { + /* Handle code with and without frame pointers. */ + if (u->Save_SP) + frame_saved_regs->regs[reg] + = frame_info->frame + extract_14 (inst); + else + frame_saved_regs->regs[reg] + = frame_info->frame + (u->Total_frame_size << 3) + + extract_14 (inst); + } + } + + + /* GCC handles callee saved FP regs a little differently. + + It emits an instruction to put the value of the start of + the FP store area into %r1. It then uses fstds,ma with + a basereg of %r1 for the stores. + + HP CC emits them at the current stack pointer modifying + the stack pointer as it stores each register. */ + + /* ldo X(%r3),%r1 or ldo X(%r30),%r1. */ + if ((inst & 0xffffc000) == 0x34610000 + || (inst & 0xffffc000) == 0x37c10000) + fp_loc = extract_14 (inst); + + reg = inst_saves_fr (inst); + if (reg >= 12 && reg <= 21) + { + /* Note +4 braindamage below is necessary because the FP status + registers are internally 8 registers rather than the expected + 4 registers. */ + save_fr &= ~(1 << reg); + if (fp_loc == -1) + { + /* 1st HP CC FP register store. After this instruction + we've set enough state that the GCC and HPCC code are + both handled in the same manner. */ + frame_saved_regs->regs[reg + FP4_REGNUM + 4] = frame_info->frame; + fp_loc = 8; + } + else + { + frame_saved_regs->regs[reg + FP0_REGNUM + 4] + = frame_info->frame + fp_loc; + fp_loc += 8; + } + } + + /* Quit if we hit any kind of branch. This can happen if a prologue + instruction is in the delay slot of the first call/branch. */ + if (is_branch (inst)) + break; + + /* Bump the PC. */ + pc += 4; + } +} + +#ifdef MAINTENANCE_CMDS + +static void +unwind_command (exp, from_tty) + char *exp; + int from_tty; +{ + CORE_ADDR address; + struct unwind_table_entry *u; + + /* If we have an expression, evaluate it and use it as the address. */ + + if (exp != 0 && *exp != 0) + address = parse_and_eval_address (exp); + else + return; + + u = find_unwind_entry (address); + + if (!u) + { + printf_unfiltered ("Can't find unwind table entry for %s\n", exp); + return; + } + + printf_unfiltered ("unwind_table_entry (0x%x):\n", u); + + printf_unfiltered ("\tregion_start = "); + print_address (u->region_start, gdb_stdout); + + printf_unfiltered ("\n\tregion_end = "); + print_address (u->region_end, gdb_stdout); + +#ifdef __STDC__ +#define pif(FLD) if (u->FLD) printf_unfiltered (" "#FLD); +#else +#define pif(FLD) if (u->FLD) printf_unfiltered (" FLD"); +#endif + + printf_unfiltered ("\n\tflags ="); + pif (Cannot_unwind); + pif (Millicode); + pif (Millicode_save_sr0); + pif (Entry_SR); + pif (Args_stored); + pif (Variable_Frame); + pif (Separate_Package_Body); + pif (Frame_Extension_Millicode); + pif (Stack_Overflow_Check); + pif (Two_Instruction_SP_Increment); + pif (Ada_Region); + pif (Save_SP); + pif (Save_RP); + pif (Save_MRP_in_frame); + pif (extn_ptr_defined); + pif (Cleanup_defined); + pif (MPE_XL_interrupt_marker); + pif (HP_UX_interrupt_marker); + pif (Large_frame); + + putchar_unfiltered ('\n'); + +#ifdef __STDC__ +#define pin(FLD) printf_unfiltered ("\t"#FLD" = 0x%x\n", u->FLD); +#else +#define pin(FLD) printf_unfiltered ("\tFLD = 0x%x\n", u->FLD); +#endif + + pin (Region_description); + pin (Entry_FR); + pin (Entry_GR); + pin (Total_frame_size); +} +#endif /* MAINTENANCE_CMDS */ + +void +_initialize_hppa_tdep () +{ + tm_print_insn = print_insn_hppa; + +#ifdef MAINTENANCE_CMDS + add_cmd ("unwind", class_maintenance, unwind_command, + "Print unwind table entry at given address.", + &maintenanceprintlist); +#endif /* MAINTENANCE_CMDS */ +} diff --git a/contrib/gdb/gdb/hppab-nat.c b/contrib/gdb/gdb/hppab-nat.c new file mode 100644 index 0000000000000..57360f3fd640e --- /dev/null +++ b/contrib/gdb/gdb/hppab-nat.c @@ -0,0 +1,215 @@ +/* Machine-dependent hooks for the unix child process stratum. This + code is for the HP PA-RISC cpu. + + Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. + + Contributed by the Center for Software Science at the + University of Utah (pa-gdb-bugs@cs.utah.edu). + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "inferior.h" +#include "target.h" +#include <sys/ptrace.h> + +/* Use an extra level of indirection for ptrace calls. + This lets us breakpoint usefully on call_ptrace. It also + allows us to pass an extra argument to ptrace without + using an ANSI-C specific macro. */ + +#define ptrace call_ptrace + +#if !defined (offsetof) +#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) +#endif + +/* U_REGS_OFFSET is the offset of the registers within the u area. */ +#if !defined (U_REGS_OFFSET) +#define U_REGS_OFFSET \ + ptrace (PT_READ_U, inferior_pid, \ + (PTRACE_ARG3_TYPE) (offsetof (struct user, u_ar0)), 0) \ + - KERNEL_U_ADDR +#endif + +/* Fetch one register. */ + +static void +fetch_register (regno) + int regno; +{ + register unsigned int regaddr; + char buf[MAX_REGISTER_RAW_SIZE]; + register int i; + + /* Offset of registers within the u area. */ + unsigned int offset; + + offset = U_REGS_OFFSET; + + regaddr = register_addr (regno, offset); + for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) + { + errno = 0; + *(int *) &buf[i] = ptrace (PT_RUREGS, inferior_pid, + (PTRACE_ARG3_TYPE) regaddr, 0); + regaddr += sizeof (int); + if (errno != 0) + { + /* Warning, not error, in case we are attached; sometimes the + kernel doesn't let us at the registers. */ + char *err = safe_strerror (errno); + char *msg = alloca (strlen (err) + 128); + sprintf (msg, "reading register %s: %s", reg_names[regno], err); + warning (msg); + goto error_exit; + } + } + supply_register (regno, buf); + error_exit:; +} + +/* Fetch all registers, or just one, from the child process. */ + +void +fetch_inferior_registers (regno) + int regno; +{ + if (regno == -1) + for (regno = 0; regno < NUM_REGS; regno++) + fetch_register (regno); + else + fetch_register (regno); +} + +/* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +void +store_inferior_registers (regno) + int regno; +{ + register unsigned int regaddr; + char buf[80]; + extern char registers[]; + register int i; + unsigned int offset = U_REGS_OFFSET; + int scratch; + + if (regno >= 0) + { + if (CANNOT_STORE_REGISTER (regno)) + return; + regaddr = register_addr (regno, offset); + errno = 0; + if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) + { + scratch = *(int *) ®isters[REGISTER_BYTE (regno)] | 0x3; + ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, + scratch); + if (errno != 0) + { + /* Error, even if attached. Failing to write these two + registers is pretty serious. */ + sprintf (buf, "writing register number %d", regno); + perror_with_name (buf); + } + } + else + for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int)) + { + errno = 0; + ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, + *(int *) ®isters[REGISTER_BYTE (regno) + i]); + if (errno != 0) + { + /* Warning, not error, in case we are attached; sometimes the + kernel doesn't let us at the registers. */ + char *err = safe_strerror (errno); + char *msg = alloca (strlen (err) + 128); + sprintf (msg, "writing register %s: %s", + reg_names[regno], err); + warning (msg); + return; + } + regaddr += sizeof(int); + } + } + else + for (regno = 0; regno < NUM_REGS; regno++) + store_inferior_registers (regno); +} + +/* PT_PROT is specific to the PA BSD kernel and isn't documented + anywhere (except here). + + PT_PROT allows one to enable/disable the data memory break bit + for pages of memory in an inferior process. This bit is used + to cause "Data memory break traps" to occur when the appropriate + page is written to. + + The arguments are as follows: + + PT_PROT -- The ptrace action to perform. + + INFERIOR_PID -- The pid of the process who's page table entries + will be modified. + + PT_ARGS -- The *address* of a 3 word block of memory which has + additional information: + + word 0 -- The start address to watch. This should be a page-aligned + address. + + word 1 -- The ending address to watch. Again, this should be a + page aligned address. + + word 2 -- Nonzero to enable the data memory break bit on the + given address range or zero to disable the data memory break + bit on the given address range. + + This call may fail if the given addresses are not valid in the inferior + process. This most often happens when restarting a program which + as watchpoints inserted on heap or stack memory. */ + +#define PT_PROT 21 + +int +hppa_set_watchpoint (addr, len, flag) + int addr, len, flag; +{ + int pt_args[3]; + pt_args[0] = addr; + pt_args[1] = addr + len; + pt_args[2] = flag; + + /* Mask off the lower 12 bits since we want to work on a page basis. */ + pt_args[0] >>= 12; + pt_args[1] >>= 12; + + /* Rounding adjustments. */ + pt_args[1] -= pt_args[0]; + pt_args[1]++; + + /* Put the lower 12 bits back as zero. */ + pt_args[0] <<= 12; + pt_args[1] <<= 12; + + /* Do it. */ + return ptrace (PT_PROT, inferior_pid, (PTRACE_ARG3_TYPE) pt_args, 0); +} diff --git a/contrib/gdb/gdb/hppah-nat.c b/contrib/gdb/gdb/hppah-nat.c new file mode 100644 index 0000000000000..17a675dc6af8b --- /dev/null +++ b/contrib/gdb/gdb/hppah-nat.c @@ -0,0 +1,226 @@ +/* Machine-dependent hooks for the unix child process stratum, for HPUX PA-RISC. + + Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993 + Free Software Foundation, Inc. + + Contributed by the Center for Software Science at the + University of Utah (pa-gdb-bugs@cs.utah.edu). + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +#include "defs.h" +#include "inferior.h" +#include "target.h" +#include <sys/ptrace.h> + +extern CORE_ADDR text_end; + +static void fetch_register (); + +void +fetch_inferior_registers (regno) + int regno; +{ + if (regno == -1) + for (regno = 0; regno < NUM_REGS; regno++) + fetch_register (regno); + else + fetch_register (regno); +} + +/* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +void +store_inferior_registers (regno) + int regno; +{ + register unsigned int regaddr; + char buf[80]; + extern char registers[]; + register int i; + unsigned int offset = U_REGS_OFFSET; + int scratch; + + if (regno >= 0) + { + if (CANNOT_STORE_REGISTER (regno)) + return; + regaddr = register_addr (regno, offset); + errno = 0; + if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) + { + scratch = *(int *) ®isters[REGISTER_BYTE (regno)] | 0x3; + call_ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, + scratch); + if (errno != 0) + { + /* Error, even if attached. Failing to write these two + registers is pretty serious. */ + sprintf (buf, "writing register number %d", regno); + perror_with_name (buf); + } + } + else + for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int)) + { + errno = 0; + call_ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, + *(int *) ®isters[REGISTER_BYTE (regno) + i]); + if (errno != 0) + { + /* Warning, not error, in case we are attached; sometimes the + kernel doesn't let us at the registers. */ + char *err = safe_strerror (errno); + char *msg = alloca (strlen (err) + 128); + sprintf (msg, "writing register %s: %s", + reg_names[regno], err); + warning (msg); + return; + } + regaddr += sizeof(int); + } + } + else + for (regno = 0; regno < NUM_REGS; regno++) + store_inferior_registers (regno); +} + +/* Fetch one register. */ + +static void +fetch_register (regno) + int regno; +{ + register unsigned int regaddr; + char buf[MAX_REGISTER_RAW_SIZE]; + char mess[128]; /* For messages */ + register int i; + + /* Offset of registers within the u area. */ + unsigned int offset; + + offset = U_REGS_OFFSET; + + regaddr = register_addr (regno, offset); + for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) + { + errno = 0; + *(int *) &buf[i] = call_ptrace (PT_RUREGS, inferior_pid, + (PTRACE_ARG3_TYPE) regaddr, 0); + regaddr += sizeof (int); + if (errno != 0) + { + /* Warning, not error, in case we are attached; sometimes the + kernel doesn't let us at the registers. */ + char *err = safe_strerror (errno); + char *msg = alloca (strlen (err) + 128); + sprintf (msg, "reading register %s: %s", reg_names[regno], err); + warning (msg); + goto error_exit; + } + } + if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) + buf[3] &= ~0x3; + supply_register (regno, buf); + error_exit:; +} + +/* Copy LEN bytes to or from inferior's memory starting at MEMADDR + to debugger memory starting at MYADDR. Copy to inferior if + WRITE is nonzero. + + Returns the length copied, which is either the LEN argument or zero. + This xfer function does not do partial moves, since child_ops + doesn't allow memory operations to cross below us in the target stack + anyway. */ + +int +child_xfer_memory (memaddr, myaddr, len, write, target) + CORE_ADDR memaddr; + char *myaddr; + int len; + int write; + struct target_ops *target; /* ignored */ +{ + register int i; + /* Round starting address down to longword boundary. */ + register CORE_ADDR addr = memaddr & - sizeof (int); + /* Round ending address up; get number of longwords that makes. */ + register int count + = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); + /* Allocate buffer of that many longwords. */ + register int *buffer = (int *) alloca (count * sizeof (int)); + + if (write) + { + /* Fill start and end extra bytes of buffer with existing memory data. */ + + if (addr != memaddr || len < (int)sizeof (int)) { + /* Need part of initial word -- fetch it. */ + buffer[0] = call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER, + inferior_pid, (PTRACE_ARG3_TYPE) addr, 0); + } + + if (count > 1) /* FIXME, avoid if even boundary */ + { + buffer[count - 1] + = call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER, inferior_pid, + (PTRACE_ARG3_TYPE) (addr + (count - 1) * sizeof (int)), + 0); + } + + /* Copy data to be written over corresponding part of buffer */ + + memcpy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len); + + /* Write the entire buffer. */ + + for (i = 0; i < count; i++, addr += sizeof (int)) + { +/* The HP-UX kernel crashes if you use PT_WDUSER to write into the text + segment. FIXME -- does it work to write into the data segment using + WIUSER, or do these idiots really expect us to figure out which segment + the address is in, so we can use a separate system call for it??! */ + errno = 0; + call_ptrace (addr < text_end ? PT_WIUSER : PT_WDUSER, inferior_pid, + (PTRACE_ARG3_TYPE) addr, + buffer[i]); + if (errno) + return 0; + } + } + else + { + /* Read all the longwords */ + for (i = 0; i < count; i++, addr += sizeof (int)) + { + errno = 0; + buffer[i] = call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER, + inferior_pid, (PTRACE_ARG3_TYPE) addr, 0); + if (errno) + return 0; + QUIT; + } + + /* Copy appropriate bytes out of the buffer. */ + memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len); + } + return len; +} diff --git a/contrib/gdb/gdb/hppam3-nat.c b/contrib/gdb/gdb/hppam3-nat.c new file mode 100644 index 0000000000000..95a66b05fefd3 --- /dev/null +++ b/contrib/gdb/gdb/hppam3-nat.c @@ -0,0 +1,141 @@ +/* Low level interface to HP800 running mach 4.0. + Copyright (C) 1995 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "inferior.h" +#include "floatformat.h" + +#include <stdio.h> + +#include <mach.h> +#include <mach/message.h> +#include <mach/exception.h> +#include <mach_error.h> + +#include <target.h> + +/* + * Fetch inferiors registers for gdb. + * REGNO specifies which (as gdb views it) register, -1 for all. + */ + +void +fetch_inferior_registers (regno) + int regno; +{ + kern_return_t ret; + thread_state_data_t state; + unsigned int stateCnt = TRACE_FLAVOR_SIZE; + int index; + + if (! MACH_PORT_VALID (current_thread)) + error ("fetch inferior registers: Invalid thread"); + + if (must_suspend_thread) + setup_thread (current_thread, 1); + + ret = thread_get_state (current_thread, + TRACE_FLAVOR, + state, + &stateCnt); + + if (ret != KERN_SUCCESS) + warning ("fetch_inferior_registers: %s ", + mach_error_string (ret)); + else + { + for (index = 0; index < NUM_REGS; index++) + supply_register (index,(void*)&state[index]); + } + + if (must_suspend_thread) + setup_thread (current_thread, 0); +} + +/* Store our register values back into the inferior. + * If REGNO is -1, do this for all registers. + * Otherwise, REGNO specifies which register + * + * On mach3 all registers are always saved in one call. + */ +void +store_inferior_registers (regno) + int regno; +{ + kern_return_t ret; + thread_state_data_t state; + unsigned int stateCnt = TRACE_FLAVOR_SIZE; + register int index; + + if (! MACH_PORT_VALID (current_thread)) + error ("store inferior registers: Invalid thread"); + + if (must_suspend_thread) + setup_thread (current_thread, 1); + + /* Fetch the state of the current thread */ + ret = thread_get_state (current_thread, + TRACE_FLAVOR, + state, + &stateCnt); + + if (ret != KERN_SUCCESS) + { + warning ("store_inferior_registers (get): %s", + mach_error_string (ret)); + if (must_suspend_thread) + setup_thread (current_thread, 0); + return; + } + + + /* move gdb's registers to thread's state + * + * Since we save all registers anyway, save the ones + * that gdb thinks are valid (e.g. ignore the regno + * parameter) + */ + if (regno > 0 && regno < NUM_REGS ) + { + memcpy(&state[regno], ®isters[REGISTER_BYTE (regno)], + REGISTER_RAW_SIZE(regno)); + } + else + { + for (index = 0; index < NUM_REGS; index++) + memcpy(&state[index], ®isters[REGISTER_BYTE (index)], + REGISTER_RAW_SIZE(index)); +/* state[index] = registers[REGISTER_BYTE (index)];*/ + + } + + /* Write gdb's current view of register to the thread + */ + ret = thread_set_state (current_thread, + TRACE_FLAVOR, + state, + TRACE_FLAVOR_SIZE); + + if (ret != KERN_SUCCESS) + warning ("store_inferior_registers (set): %s", + mach_error_string (ret)); + + if (must_suspend_thread) + setup_thread (current_thread, 0); +} diff --git a/contrib/gdb/gdb/hpread.c b/contrib/gdb/gdb/hpread.c new file mode 100644 index 0000000000000..e902169286d0e --- /dev/null +++ b/contrib/gdb/gdb/hpread.c @@ -0,0 +1,2052 @@ +/* Read hp debug symbols and convert to internal format, for GDB. + Copyright 1993, 1996 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + Written by the Center for Software Science at the University of Utah + and by Cygnus Support. */ + +#include "defs.h" +#include "bfd.h" +#include "gdb_string.h" +#include "hp-symtab.h" +#include "syms.h" +#include "symtab.h" +#include "symfile.h" +#include "objfiles.h" +#include "buildsym.h" +#include "complaints.h" +#include "gdb-stabs.h" +#include "gdbtypes.h" +#include "demangle.h" + +/* Private information attached to an objfile which we use to find + and internalize the HP C debug symbols within that objfile. */ + +struct hpread_symfile_info +{ + /* The contents of each of the debug sections (there are 4 of them). */ + char *gntt; + char *lntt; + char *slt; + char *vt; + + /* We keep the size of the $VT$ section for range checking. */ + unsigned int vt_size; + + /* Some routines still need to know the number of symbols in the + main debug sections ($LNTT$ and $GNTT$). */ + unsigned int lntt_symcount; + unsigned int gntt_symcount; + + /* To keep track of all the types we've processed. */ + struct type **type_vector; + int type_vector_length; + + /* Keeps track of the beginning of a range of source lines. */ + sltpointer sl_index; + + /* Some state variables we'll need. */ + int within_function; + + /* Keep track of the current function's address. We may need to look + up something based on this address. */ + unsigned int current_function_value; +}; + +/* Accessor macros to get at the fields. */ +#define HPUX_SYMFILE_INFO(o) \ + ((struct hpread_symfile_info *)((o)->sym_private)) +#define GNTT(o) (HPUX_SYMFILE_INFO(o)->gntt) +#define LNTT(o) (HPUX_SYMFILE_INFO(o)->lntt) +#define SLT(o) (HPUX_SYMFILE_INFO(o)->slt) +#define VT(o) (HPUX_SYMFILE_INFO(o)->vt) +#define VT_SIZE(o) (HPUX_SYMFILE_INFO(o)->vt_size) +#define LNTT_SYMCOUNT(o) (HPUX_SYMFILE_INFO(o)->lntt_symcount) +#define GNTT_SYMCOUNT(o) (HPUX_SYMFILE_INFO(o)->gntt_symcount) +#define TYPE_VECTOR(o) (HPUX_SYMFILE_INFO(o)->type_vector) +#define TYPE_VECTOR_LENGTH(o) (HPUX_SYMFILE_INFO(o)->type_vector_length) +#define SL_INDEX(o) (HPUX_SYMFILE_INFO(o)->sl_index) +#define WITHIN_FUNCTION(o) (HPUX_SYMFILE_INFO(o)->within_function) +#define CURRENT_FUNCTION_VALUE(o) (HPUX_SYMFILE_INFO(o)->current_function_value) + +/* Given the native debug symbol SYM, set NAMEP to the name associated + with the debug symbol. Note we may be called with a debug symbol which + has no associated name, in that case we return an empty string. + + Also note we "know" that the name for any symbol is always in the + same place. Hence we don't have to conditionalize on the symbol type. */ +#define SET_NAMESTRING(SYM, NAMEP, OBJFILE) \ + if (! hpread_has_name ((SYM)->dblock.kind)) \ + *NAMEP = ""; \ + else if (((unsigned)(SYM)->dsfile.name) >= VT_SIZE (OBJFILE)) \ + { \ + complain (&string_table_offset_complaint, (char *) symnum); \ + *NAMEP = ""; \ + } \ + else \ + *NAMEP = (SYM)->dsfile.name + VT (OBJFILE) + +/* We put a pointer to this structure in the read_symtab_private field + of the psymtab. */ + +struct symloc +{ + /* The offset within the file symbol table of first local symbol for + this file. */ + + int ldsymoff; + + /* Length (in bytes) of the section of the symbol table devoted to + this file's symbols (actually, the section bracketed may contain + more than just this file's symbols). If ldsymlen is 0, the only + reason for this thing's existence is the dependency list. + Nothing else will happen when it is read in. */ + + int ldsymlen; +}; + +#define LDSYMOFF(p) (((struct symloc *)((p)->read_symtab_private))->ldsymoff) +#define LDSYMLEN(p) (((struct symloc *)((p)->read_symtab_private))->ldsymlen) +#define SYMLOC(p) ((struct symloc *)((p)->read_symtab_private)) + +/* FIXME: Shouldn't this stuff be in a .h file somewhere? */ +/* Nonzero means give verbose info on gdb action. */ +extern int info_verbose; + +/* Complaints about the symbols we have encountered. */ +extern struct complaint string_table_offset_complaint; +extern struct complaint lbrac_unmatched_complaint; +extern struct complaint lbrac_mismatch_complaint; + + +void hpread_symfile_init PARAMS ((struct objfile *)); + +static struct type *hpread_alloc_type + PARAMS ((dnttpointer, struct objfile *)); + +static struct type **hpread_lookup_type + PARAMS ((dnttpointer, struct objfile *)); + +static struct type *hpread_read_enum_type + PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + +static struct type *hpread_read_set_type + PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + +static struct type *hpread_read_subrange_type + PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + +static struct type *hpread_read_struct_type + PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + +void hpread_build_psymtabs + PARAMS ((struct objfile *, struct section_offsets *, int)); + +void hpread_symfile_finish PARAMS ((struct objfile *)); + +static struct partial_symtab *hpread_start_psymtab + PARAMS ((struct objfile *, struct section_offsets *, char *, CORE_ADDR, int, + struct partial_symbol **, struct partial_symbol **)); + +static struct partial_symtab *hpread_end_psymtab + PARAMS ((struct partial_symtab *, char **, int, int, CORE_ADDR, + struct partial_symtab **, int)); + +static struct symtab *hpread_expand_symtab + PARAMS ((struct objfile *, int, int, CORE_ADDR, int, + struct section_offsets *, char *)); + +static void hpread_process_one_debug_symbol + PARAMS ((union dnttentry *, char *, struct section_offsets *, + struct objfile *, CORE_ADDR, int, char *, int)); + +static sltpointer hpread_record_lines + PARAMS ((struct subfile *, sltpointer, sltpointer, + struct objfile *, CORE_ADDR)); + +static struct type *hpread_read_function_type + PARAMS ((dnttpointer, union dnttentry *, struct objfile *)); + +static struct type * hpread_type_lookup + PARAMS ((dnttpointer, struct objfile *)); + +static unsigned long hpread_get_depth + PARAMS ((sltpointer, struct objfile *)); + +static unsigned long hpread_get_line + PARAMS ((sltpointer, struct objfile *)); + +static CORE_ADDR hpread_get_location + PARAMS ((sltpointer, struct objfile *)); + +static int hpread_type_translate PARAMS ((dnttpointer)); +static unsigned long hpread_get_textlow PARAMS ((int, int, struct objfile *)); +static union dnttentry *hpread_get_gntt PARAMS ((int, struct objfile *)); +static union dnttentry *hpread_get_lntt PARAMS ((int, struct objfile *)); +static union sltentry *hpread_get_slt PARAMS ((int, struct objfile *)); +static void hpread_psymtab_to_symtab PARAMS ((struct partial_symtab *)); +static void hpread_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *)); +static int hpread_has_name PARAMS ((enum dntt_entry_type)); + + +/* Initialization for reading native HP C debug symbols from OBJFILE. + + It's only purpose in life is to set up the symbol reader's private + per-objfile data structures, and read in the raw contents of the debug + sections (attaching pointers to the debug info into the private data + structures). + + Since BFD doesn't know how to read debug symbols in a format-independent + way (and may never do so...), we have to do it ourselves. Note we may + be called on a file without native HP C debugging symbols. + FIXME, there should be a cleaner peephole into the BFD environment here. */ + +void +hpread_symfile_init (objfile) + struct objfile *objfile; +{ + asection *vt_section, *slt_section, *lntt_section, *gntt_section; + + /* Allocate struct to keep track of the symfile */ + objfile->sym_private = (PTR) + xmmalloc (objfile->md, sizeof (struct hpread_symfile_info)); + memset (objfile->sym_private, 0, sizeof (struct hpread_symfile_info)); + + /* We haven't read in any types yet. */ + TYPE_VECTOR (objfile) = 0; + + /* Read in data from the $GNTT$ subspace. */ + gntt_section = bfd_get_section_by_name (objfile->obfd, "$GNTT$"); + if (!gntt_section) + return; + + GNTT (objfile) + = obstack_alloc (&objfile->symbol_obstack, + bfd_section_size (objfile->obfd, gntt_section)); + + bfd_get_section_contents (objfile->obfd, gntt_section, GNTT (objfile), + 0, bfd_section_size (objfile->obfd, gntt_section)); + + GNTT_SYMCOUNT (objfile) + = bfd_section_size (objfile->obfd, gntt_section) + / sizeof (struct dntt_type_block); + + /* Read in data from the $LNTT$ subspace. Also keep track of the number + of LNTT symbols. */ + lntt_section = bfd_get_section_by_name (objfile->obfd, "$LNTT$"); + if (!lntt_section) + return; + + LNTT (objfile) + = obstack_alloc (&objfile->symbol_obstack, + bfd_section_size (objfile->obfd, lntt_section)); + + bfd_get_section_contents (objfile->obfd, lntt_section, LNTT (objfile), + 0, bfd_section_size (objfile->obfd, lntt_section)); + + LNTT_SYMCOUNT (objfile) + = bfd_section_size (objfile->obfd, lntt_section) + / sizeof (struct dntt_type_block); + + /* Read in data from the $SLT$ subspace. $SLT$ contains information + on source line numbers. */ + slt_section = bfd_get_section_by_name (objfile->obfd, "$SLT$"); + if (!slt_section) + return; + + SLT (objfile) = + obstack_alloc (&objfile->symbol_obstack, + bfd_section_size (objfile->obfd, slt_section)); + + bfd_get_section_contents (objfile->obfd, slt_section, SLT (objfile), + 0, bfd_section_size (objfile->obfd, slt_section)); + + /* Read in data from the $VT$ subspace. $VT$ contains things like + names and constants. Keep track of the number of symbols in the VT. */ + vt_section = bfd_get_section_by_name (objfile->obfd, "$VT$"); + if (!vt_section) + return; + + VT_SIZE (objfile) = bfd_section_size (objfile->obfd, vt_section); + + VT (objfile) = + (char *) obstack_alloc (&objfile->symbol_obstack, + VT_SIZE (objfile)); + + bfd_get_section_contents (objfile->obfd, vt_section, VT (objfile), + 0, VT_SIZE (objfile)); +} + +/* Scan and build partial symbols for a symbol file. + + The minimal symbol table (either SOM or HP a.out) has already been + read in; all we need to do is setup partial symbols based on the + native debugging information. + + We assume hpread_symfile_init has been called to initialize the + symbol reader's private data structures. + + SECTION_OFFSETS contains offsets relative to which the symbols in the + various sections are (depending where the sections were actually loaded). + MAINLINE is true if we are reading the main symbol + table (as opposed to a shared lib or dynamically loaded file). */ + +void +hpread_build_psymtabs (objfile, section_offsets, mainline) + struct objfile *objfile; + struct section_offsets *section_offsets; + int mainline; +{ + char *namestring; + int past_first_source_file = 0; + struct cleanup *old_chain; + + int hp_symnum, symcount, i; + + union dnttentry *dn_bufp; + unsigned long valu; + char *p; + int texthigh = 0; + int have_name = 0; + + /* Current partial symtab */ + struct partial_symtab *pst; + + /* List of current psymtab's include files */ + char **psymtab_include_list; + int includes_allocated; + int includes_used; + + /* Index within current psymtab dependency list */ + struct partial_symtab **dependency_list; + int dependencies_used, dependencies_allocated; + + /* Just in case the stabs reader left turds lying around. */ + pending_blocks = 0; + make_cleanup (really_free_pendings, 0); + + pst = (struct partial_symtab *) 0; + + /* We shouldn't use alloca, instead use malloc/free. Doing so avoids + a number of problems with cross compilation and creating useless holes + in the stack when we have to allocate new entries. FIXME. */ + + includes_allocated = 30; + includes_used = 0; + psymtab_include_list = (char **) alloca (includes_allocated * + sizeof (char *)); + + dependencies_allocated = 30; + dependencies_used = 0; + dependency_list = + (struct partial_symtab **) alloca (dependencies_allocated * + sizeof (struct partial_symtab *)); + + old_chain = make_cleanup (free_objfile, objfile); + + last_source_file = 0; + + /* Make two passes, one ofr the GNTT symbols, the other for the + LNTT symbols. */ + for (i = 0; i < 1; i++) + { + int within_function = 0; + + if (i) + symcount = GNTT_SYMCOUNT (objfile); + else + symcount = LNTT_SYMCOUNT (objfile); + + for (hp_symnum = 0; hp_symnum < symcount; hp_symnum++) + { + QUIT; + if (i) + dn_bufp = hpread_get_gntt (hp_symnum, objfile); + else + dn_bufp = hpread_get_lntt (hp_symnum, objfile); + + if (dn_bufp->dblock.extension) + continue; + + /* Only handle things which are necessary for minimal symbols. + everything else is ignored. */ + switch (dn_bufp->dblock.kind) + { + case DNTT_TYPE_SRCFILE: + { + /* A source file of some kind. Note this may simply + be an included file. */ + SET_NAMESTRING (dn_bufp, &namestring, objfile); + + /* Check if this is the source file we are already working + with. */ + if (pst && !strcmp (namestring, pst->filename)) + continue; + + /* Check if this is an include file, if so check if we have + already seen it. Add it to the include list */ + p = strrchr (namestring, '.'); + if (!strcmp (p, ".h")) + { + int j, found; + + found = 0; + for (j = 0; j < includes_used; j++) + if (!strcmp (namestring, psymtab_include_list[j])) + { + found = 1; + break; + } + if (found) + continue; + + /* Add it to the list of includes seen so far and + allocate more include space if necessary. */ + psymtab_include_list[includes_used++] = namestring; + if (includes_used >= includes_allocated) + { + char **orig = psymtab_include_list; + + psymtab_include_list = (char **) + alloca ((includes_allocated *= 2) * + sizeof (char *)); + memcpy ((PTR) psymtab_include_list, (PTR) orig, + includes_used * sizeof (char *)); + } + continue; + } + + + if (pst) + { + if (!have_name) + { + pst->filename = (char *) + obstack_alloc (&pst->objfile->psymbol_obstack, + strlen (namestring) + 1); + strcpy (pst->filename, namestring); + have_name = 1; + continue; + } + continue; + } + + /* This is a bonafide new source file. + End the current partial symtab and start a new one. */ + + if (pst && past_first_source_file) + { + hpread_end_psymtab (pst, psymtab_include_list, + includes_used, + (hp_symnum + * sizeof (struct dntt_type_block)), + texthigh, + dependency_list, dependencies_used); + pst = (struct partial_symtab *) 0; + includes_used = 0; + dependencies_used = 0; + } + else + past_first_source_file = 1; + + valu = hpread_get_textlow (i, hp_symnum, objfile); + valu += ANOFFSET (section_offsets, SECT_OFF_TEXT); + pst = hpread_start_psymtab (objfile, section_offsets, + namestring, valu, + (hp_symnum + * sizeof (struct dntt_type_block)), + objfile->global_psymbols.next, + objfile->static_psymbols.next); + texthigh = valu; + have_name = 1; + continue; + } + + case DNTT_TYPE_MODULE: + /* A source file. It's still unclear to me what the + real difference between a DNTT_TYPE_SRCFILE and DNTT_TYPE_MODULE + is supposed to be. */ + SET_NAMESTRING (dn_bufp, &namestring, objfile); + valu = hpread_get_textlow (i, hp_symnum, objfile); + valu += ANOFFSET (section_offsets, SECT_OFF_TEXT); + if (!pst) + { + pst = hpread_start_psymtab (objfile, section_offsets, + namestring, valu, + (hp_symnum + * sizeof (struct dntt_type_block)), + objfile->global_psymbols.next, + objfile->static_psymbols.next); + texthigh = valu; + have_name = 0; + } + continue; + case DNTT_TYPE_FUNCTION: + case DNTT_TYPE_ENTRY: + /* The beginning of a function. DNTT_TYPE_ENTRY may also denote + a secondary entry point. */ + valu = dn_bufp->dfunc.hiaddr + ANOFFSET (section_offsets, + SECT_OFF_TEXT); + if (valu > texthigh) + texthigh = valu; + valu = dn_bufp->dfunc.lowaddr + + ANOFFSET (section_offsets, SECT_OFF_TEXT); + SET_NAMESTRING (dn_bufp, &namestring, objfile); + add_psymbol_to_list (namestring, strlen (namestring), + VAR_NAMESPACE, LOC_BLOCK, + &objfile->static_psymbols, valu, + 0, language_unknown, objfile); + within_function = 1; + continue; + case DNTT_TYPE_BEGIN: + case DNTT_TYPE_END: + /* Scope block begin/end. We only care about function + and file blocks right now. */ + if (dn_bufp->dend.endkind == DNTT_TYPE_MODULE) + { + hpread_end_psymtab (pst, psymtab_include_list, includes_used, + (hp_symnum + * sizeof (struct dntt_type_block)), + texthigh, + dependency_list, dependencies_used); + pst = (struct partial_symtab *) 0; + includes_used = 0; + dependencies_used = 0; + have_name = 0; + } + if (dn_bufp->dend.endkind == DNTT_TYPE_FUNCTION) + within_function = 0; + continue; + case DNTT_TYPE_SVAR: + case DNTT_TYPE_DVAR: + case DNTT_TYPE_TYPEDEF: + case DNTT_TYPE_TAGDEF: + { + /* Variables, typedefs an the like. */ + enum address_class storage; + namespace_enum namespace; + + /* Don't add locals to the partial symbol table. */ + if (within_function + && (dn_bufp->dblock.kind == DNTT_TYPE_SVAR + || dn_bufp->dblock.kind == DNTT_TYPE_DVAR)) + continue; + + /* TAGDEFs go into the structure namespace. */ + if (dn_bufp->dblock.kind == DNTT_TYPE_TAGDEF) + namespace = STRUCT_NAMESPACE; + else + namespace = VAR_NAMESPACE; + + /* What kind of "storage" does this use? */ + if (dn_bufp->dblock.kind == DNTT_TYPE_SVAR) + storage = LOC_STATIC; + else if (dn_bufp->dblock.kind == DNTT_TYPE_DVAR + && dn_bufp->ddvar.regvar) + storage = LOC_REGISTER; + else if (dn_bufp->dblock.kind == DNTT_TYPE_DVAR) + storage = LOC_LOCAL; + else + storage = LOC_UNDEF; + + SET_NAMESTRING (dn_bufp, &namestring, objfile); + if (!pst) + { + pst = hpread_start_psymtab (objfile, section_offsets, + "globals", 0, + (hp_symnum + * sizeof (struct dntt_type_block)), + objfile->global_psymbols.next, + objfile->static_psymbols.next); + } + if (dn_bufp->dsvar.global) + { + add_psymbol_to_list (namestring, strlen (namestring), + namespace, storage, + &objfile->global_psymbols, + dn_bufp->dsvar.location, + 0, language_unknown, objfile); + } + else + { + add_psymbol_to_list (namestring, strlen (namestring), + namespace, storage, + &objfile->static_psymbols, + dn_bufp->dsvar.location, + 0, language_unknown, objfile); + } + continue; + } + case DNTT_TYPE_MEMENUM: + case DNTT_TYPE_CONST: + /* Constants and members of enumerated types. */ + SET_NAMESTRING (dn_bufp, &namestring, objfile); + if (!pst) + { + pst = hpread_start_psymtab (objfile, section_offsets, + "globals", 0, + (hp_symnum + * sizeof (struct dntt_type_block)), + objfile->global_psymbols.next, + objfile->static_psymbols.next); + } + add_psymbol_to_list (namestring, strlen (namestring), + VAR_NAMESPACE, LOC_CONST, + &objfile->static_psymbols, 0, + 0, language_unknown, objfile); + continue; + default: + continue; + } + } + } + + /* End any pending partial symbol table. */ + if (pst) + { + hpread_end_psymtab (pst, psymtab_include_list, includes_used, + hp_symnum * sizeof (struct dntt_type_block), + 0, dependency_list, dependencies_used); + } + + discard_cleanups (old_chain); +} + +/* Perform any local cleanups required when we are done with a particular + objfile. I.E, we are in the process of discarding all symbol information + for an objfile, freeing up all memory held for it, and unlinking the + objfile struct from the global list of known objfiles. */ + +void +hpread_symfile_finish (objfile) + struct objfile *objfile; +{ + if (objfile->sym_private != NULL) + { + mfree (objfile->md, objfile->sym_private); + } +} + + +/* The remaining functions are all for internal use only. */ + +/* Various small functions to get entries in the debug symbol sections. */ + +static union dnttentry * +hpread_get_lntt (index, objfile) + int index; + struct objfile *objfile; +{ + return (union dnttentry *) + &(LNTT (objfile)[(index * sizeof (struct dntt_type_block))]); +} + +static union dnttentry * +hpread_get_gntt (index, objfile) + int index; + struct objfile *objfile; +{ + return (union dnttentry *) + &(GNTT (objfile)[(index * sizeof (struct dntt_type_block))]); +} + +static union sltentry * +hpread_get_slt (index, objfile) + int index; + struct objfile *objfile; +{ + return (union sltentry *)&(SLT (objfile)[index * sizeof (union sltentry)]); +} + +/* Get the low address associated with some symbol (typically the start + of a particular source file or module). Since that information is not + stored as part of the DNTT_TYPE_MODULE or DNTT_TYPE_SRCFILE symbol we must infer it from + the existance of DNTT_TYPE_FUNCTION symbols. */ + +static unsigned long +hpread_get_textlow (global, index, objfile) + int global; + int index; + struct objfile *objfile; +{ + union dnttentry *dn_bufp; + struct minimal_symbol *msymbol; + + /* Look for a DNTT_TYPE_FUNCTION symbol. */ + do + { + if (global) + dn_bufp = hpread_get_gntt (index++, objfile); + else + dn_bufp = hpread_get_lntt (index++, objfile); + } while (dn_bufp->dblock.kind != DNTT_TYPE_FUNCTION + && dn_bufp->dblock.kind != DNTT_TYPE_END); + + /* Avoid going past a DNTT_TYPE_END when looking for a DNTT_TYPE_FUNCTION. This + might happen when a sourcefile has no functions. */ + if (dn_bufp->dblock.kind == DNTT_TYPE_END) + return 0; + + /* The minimal symbols are typically more accurate for some reason. */ + msymbol = lookup_minimal_symbol (dn_bufp->dfunc.name + VT (objfile), NULL, + objfile); + if (msymbol) + return SYMBOL_VALUE_ADDRESS (msymbol); + else + return dn_bufp->dfunc.lowaddr; +} + +/* Get the nesting depth for the source line identified by INDEX. */ + +static unsigned long +hpread_get_depth (index, objfile) + sltpointer index; + struct objfile *objfile; +{ + union sltentry *sl_bufp; + + sl_bufp = hpread_get_slt (index, objfile); + return sl_bufp->sspec.backptr.dnttp.index; +} + +/* Get the source line number the the line identified by INDEX. */ + +static unsigned long +hpread_get_line (index, objfile) + sltpointer index; + struct objfile *objfile; +{ + union sltentry *sl_bufp; + + sl_bufp = hpread_get_slt (index, objfile); + return sl_bufp->snorm.line; +} + +static CORE_ADDR +hpread_get_location (index, objfile) + sltpointer index; + struct objfile *objfile; +{ + union sltentry *sl_bufp; + int i; + + /* code location of special sltentrys is determined from context */ + sl_bufp = hpread_get_slt (index, objfile); + + if (sl_bufp->snorm.sltdesc == SLT_END) + { + /* find previous normal sltentry and get address */ + for (i = 0; ((sl_bufp->snorm.sltdesc != SLT_NORMAL) && + (sl_bufp->snorm.sltdesc != SLT_EXIT)); i++) + sl_bufp = hpread_get_slt (index - i, objfile); + return sl_bufp->snorm.address; + } + + /* find next normal sltentry and get address */ + for (i = 0; ((sl_bufp->snorm.sltdesc != SLT_NORMAL) && + (sl_bufp->snorm.sltdesc != SLT_EXIT)); i++) + sl_bufp = hpread_get_slt (index + i, objfile); + return sl_bufp->snorm.address; +} + + +/* Return 1 if an HP debug symbol of type KIND has a name associated with + it, else return 0. */ + +static int +hpread_has_name (kind) + enum dntt_entry_type kind; +{ + switch (kind) + { + case DNTT_TYPE_SRCFILE: + case DNTT_TYPE_MODULE: + case DNTT_TYPE_FUNCTION: + case DNTT_TYPE_ENTRY: + case DNTT_TYPE_IMPORT: + case DNTT_TYPE_LABEL: + case DNTT_TYPE_FPARAM: + case DNTT_TYPE_SVAR: + case DNTT_TYPE_DVAR: + case DNTT_TYPE_CONST: + case DNTT_TYPE_TYPEDEF: + case DNTT_TYPE_TAGDEF: + case DNTT_TYPE_MEMENUM: + case DNTT_TYPE_FIELD: + case DNTT_TYPE_SA: + return 1; + + case DNTT_TYPE_BEGIN: + case DNTT_TYPE_END: + case DNTT_TYPE_WITH: + case DNTT_TYPE_COMMON: + case DNTT_TYPE_POINTER: + case DNTT_TYPE_ENUM: + case DNTT_TYPE_SET: + case DNTT_TYPE_SUBRANGE: + case DNTT_TYPE_ARRAY: + case DNTT_TYPE_STRUCT: + case DNTT_TYPE_UNION: + case DNTT_TYPE_VARIANT: + case DNTT_TYPE_FILE: + case DNTT_TYPE_FUNCTYPE: + case DNTT_TYPE_COBSTRUCT: + case DNTT_TYPE_XREF: + case DNTT_TYPE_MACRO: + default: + return 0; + } +} + +/* Allocate and partially fill a partial symtab. It will be + completely filled at the end of the symbol list. + + SYMFILE_NAME is the name of the symbol-file we are reading from, and ADDR + is the address relative to which its symbols are (incremental) or 0 + (normal). */ + +static struct partial_symtab * +hpread_start_psymtab (objfile, section_offsets, + filename, textlow, ldsymoff, global_syms, static_syms) + struct objfile *objfile; + struct section_offsets *section_offsets; + char *filename; + CORE_ADDR textlow; + int ldsymoff; + struct partial_symbol **global_syms; + struct partial_symbol **static_syms; +{ + struct partial_symtab *result = + start_psymtab_common (objfile, section_offsets, + filename, textlow, global_syms, static_syms); + + result->read_symtab_private = (char *) + obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc)); + LDSYMOFF (result) = ldsymoff; + result->read_symtab = hpread_psymtab_to_symtab; + + return result; +} + + +/* Close off the current usage of PST. + Returns PST or NULL if the partial symtab was empty and thrown away. + + FIXME: List variables and peculiarities of same. */ + +static struct partial_symtab * +hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset, + capping_text, dependency_list, number_dependencies) + struct partial_symtab *pst; + char **include_list; + int num_includes; + int capping_symbol_offset; + CORE_ADDR capping_text; + struct partial_symtab **dependency_list; + int number_dependencies; +{ + int i; + struct objfile *objfile = pst -> objfile; + + if (capping_symbol_offset != -1) + LDSYMLEN(pst) = capping_symbol_offset - LDSYMOFF(pst); + pst->texthigh = capping_text; + + pst->n_global_syms = + objfile->global_psymbols.next - (objfile->global_psymbols.list + pst->globals_offset); + pst->n_static_syms = + objfile->static_psymbols.next - (objfile->static_psymbols.list + pst->statics_offset); + + pst->number_of_dependencies = number_dependencies; + if (number_dependencies) + { + pst->dependencies = (struct partial_symtab **) + obstack_alloc (&objfile->psymbol_obstack, + number_dependencies * sizeof (struct partial_symtab *)); + memcpy (pst->dependencies, dependency_list, + number_dependencies * sizeof (struct partial_symtab *)); + } + else + pst->dependencies = 0; + + for (i = 0; i < num_includes; i++) + { + struct partial_symtab *subpst = + allocate_psymtab (include_list[i], objfile); + + subpst->section_offsets = pst->section_offsets; + subpst->read_symtab_private = + (char *) obstack_alloc (&objfile->psymbol_obstack, + sizeof (struct symloc)); + LDSYMOFF(subpst) = + LDSYMLEN(subpst) = + subpst->textlow = + subpst->texthigh = 0; + + /* We could save slight bits of space by only making one of these, + shared by the entire set of include files. FIXME-someday. */ + subpst->dependencies = (struct partial_symtab **) + obstack_alloc (&objfile->psymbol_obstack, + sizeof (struct partial_symtab *)); + subpst->dependencies[0] = pst; + subpst->number_of_dependencies = 1; + + subpst->globals_offset = + subpst->n_global_syms = + subpst->statics_offset = + subpst->n_static_syms = 0; + + subpst->readin = 0; + subpst->symtab = 0; + subpst->read_symtab = pst->read_symtab; + } + + sort_pst_symbols (pst); + + /* If there is already a psymtab or symtab for a file of this name, remove it. + (If there is a symtab, more drastic things also happen.) + This happens in VxWorks. */ + free_named_symtabs (pst->filename); + + if (num_includes == 0 + && number_dependencies == 0 + && pst->n_global_syms == 0 + && pst->n_static_syms == 0) + { + /* Throw away this psymtab, it's empty. We can't deallocate it, since + it is on the obstack, but we can forget to chain it on the list. */ + /* Empty psymtabs happen as a result of header files which don't have + any symbols in them. There can be a lot of them. But this check + is wrong, in that a psymtab with N_SLINE entries but nothing else + is not empty, but we don't realize that. Fixing that without slowing + things down might be tricky. */ + struct partial_symtab *prev_pst; + + /* First, snip it out of the psymtab chain */ + + if (pst->objfile->psymtabs == pst) + pst->objfile->psymtabs = pst->next; + else + for (prev_pst = pst->objfile->psymtabs; prev_pst; prev_pst = pst->next) + if (prev_pst->next == pst) + prev_pst->next = pst->next; + + /* Next, put it on a free list for recycling */ + + pst->next = pst->objfile->free_psymtabs; + pst->objfile->free_psymtabs = pst; + + /* Indicate that psymtab was thrown away. */ + pst = (struct partial_symtab *)NULL; + } + return pst; +} + +/* Do the dirty work of reading in the full symbol from a partial symbol + table. */ + +static void +hpread_psymtab_to_symtab_1 (pst) + struct partial_symtab *pst; +{ + struct cleanup *old_chain; + int i; + + /* Get out quick if passed junk. */ + if (!pst) + return; + + /* Complain if we've already read in this symbol table. */ + if (pst->readin) + { + fprintf (stderr, "Psymtab for %s already read in. Shouldn't happen.\n", + pst->filename); + return; + } + + /* Read in all partial symtabs on which this one is dependent */ + for (i = 0; i < pst->number_of_dependencies; i++) + if (!pst->dependencies[i]->readin) + { + /* Inform about additional files that need to be read in. */ + if (info_verbose) + { + fputs_filtered (" ", stdout); + wrap_here (""); + fputs_filtered ("and ", stdout); + wrap_here (""); + printf_filtered ("%s...", pst->dependencies[i]->filename); + wrap_here (""); /* Flush output */ + fflush (stdout); + } + hpread_psymtab_to_symtab_1 (pst->dependencies[i]); + } + + /* If it's real... */ + if (LDSYMLEN (pst)) + { + /* Init stuff necessary for reading in symbols */ + buildsym_init (); + old_chain = make_cleanup (really_free_pendings, 0); + + pst->symtab = + hpread_expand_symtab (pst->objfile, LDSYMOFF (pst), LDSYMLEN (pst), + pst->textlow, pst->texthigh - pst->textlow, + pst->section_offsets, pst->filename); + sort_symtab_syms (pst->symtab); + + do_cleanups (old_chain); + } + + pst->readin = 1; +} + +/* Read in all of the symbols for a given psymtab for real. + Be verbose about it if the user wants that. */ + +static void +hpread_psymtab_to_symtab (pst) + struct partial_symtab *pst; +{ + /* Get out quick if given junk. */ + if (!pst) + return; + + /* Sanity check. */ + if (pst->readin) + { + fprintf (stderr, "Psymtab for %s already read in. Shouldn't happen.\n", + pst->filename); + return; + } + + if (LDSYMLEN (pst) || pst->number_of_dependencies) + { + /* Print the message now, before reading the string table, + to avoid disconcerting pauses. */ + if (info_verbose) + { + printf_filtered ("Reading in symbols for %s...", pst->filename); + fflush (stdout); + } + + hpread_psymtab_to_symtab_1 (pst); + + /* Match with global symbols. This only needs to be done once, + after all of the symtabs and dependencies have been read in. */ + scan_file_globals (pst->objfile); + + /* Finish up the debug error message. */ + if (info_verbose) + printf_filtered ("done.\n"); + } +} +/* Read in a defined section of a specific object file's symbols. + + DESC is the file descriptor for the file, positioned at the + beginning of the symtab + SYM_OFFSET is the offset within the file of + the beginning of the symbols we want to read + SYM_SIZE is the size of the symbol info to read in. + TEXT_OFFSET is the beginning of the text segment we are reading symbols for + TEXT_SIZE is the size of the text segment read in. + SECTION_OFFSETS are the relocation offsets which get added to each symbol. */ + +static struct symtab * +hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size, + section_offsets, filename) + struct objfile *objfile; + int sym_offset; + int sym_size; + CORE_ADDR text_offset; + int text_size; + struct section_offsets *section_offsets; + char *filename; +{ + char *namestring; + union dnttentry *dn_bufp; + unsigned max_symnum; + + int sym_index = sym_offset / sizeof (struct dntt_type_block); + + current_objfile = objfile; + subfile_stack = 0; + + last_source_file = 0; + + dn_bufp = hpread_get_lntt (sym_index, objfile); + if (!((dn_bufp->dblock.kind == (unsigned char) DNTT_TYPE_SRCFILE) || + (dn_bufp->dblock.kind == (unsigned char) DNTT_TYPE_MODULE))) + start_symtab ("globals", NULL, 0); + + max_symnum = sym_size / sizeof (struct dntt_type_block); + + /* Read in and process each debug symbol within the specified range. */ + for (symnum = 0; + symnum < max_symnum; + symnum++) + { + QUIT; /* Allow this to be interruptable */ + dn_bufp = hpread_get_lntt (sym_index + symnum, objfile); + + if (dn_bufp->dblock.extension) + continue; + + /* Yow! We call SET_NAMESTRING on things without names! */ + SET_NAMESTRING (dn_bufp, &namestring, objfile); + + hpread_process_one_debug_symbol (dn_bufp, namestring, section_offsets, + objfile, text_offset, text_size, + filename, symnum + sym_index); + } + + current_objfile = NULL; + + return end_symtab (text_offset + text_size, objfile, 0); +} + + +/* Convert basic types from HP debug format into GDB internal format. */ + +static int +hpread_type_translate (typep) + dnttpointer typep; +{ + if (!typep.dntti.immediate) + abort (); + + switch (typep.dntti.type) + { + case HP_TYPE_BOOLEAN: + case HP_TYPE_BOOLEAN_S300_COMPAT: + case HP_TYPE_BOOLEAN_VAX_COMPAT: + return FT_BOOLEAN; + /* Ugh. No way to distinguish between signed and unsigned chars. */ + case HP_TYPE_CHAR: + case HP_TYPE_WIDE_CHAR: + return FT_CHAR; + case HP_TYPE_INT: + if (typep.dntti.bitlength <= 8) + return FT_CHAR; + if (typep.dntti.bitlength <= 16) + return FT_SHORT; + if (typep.dntti.bitlength <= 32) + return FT_INTEGER; + return FT_LONG_LONG; + case HP_TYPE_LONG: + return FT_LONG; + case HP_TYPE_UNSIGNED_LONG: + if (typep.dntti.bitlength <= 8) + return FT_UNSIGNED_CHAR; + if (typep.dntti.bitlength <= 16) + return FT_UNSIGNED_SHORT; + if (typep.dntti.bitlength <= 32) + return FT_UNSIGNED_LONG; + return FT_UNSIGNED_LONG_LONG; + case HP_TYPE_UNSIGNED_INT: + if (typep.dntti.bitlength <= 8) + return FT_UNSIGNED_CHAR; + if (typep.dntti.bitlength <= 16) + return FT_UNSIGNED_SHORT; + if (typep.dntti.bitlength <= 32) + return FT_UNSIGNED_INTEGER; + return FT_UNSIGNED_LONG_LONG; + case HP_TYPE_REAL: + case HP_TYPE_REAL_3000: + case HP_TYPE_DOUBLE: + if (typep.dntti.bitlength == 64) + return FT_DBL_PREC_FLOAT; + if (typep.dntti.bitlength == 128) + return FT_EXT_PREC_FLOAT; + return FT_FLOAT; + case HP_TYPE_COMPLEX: + case HP_TYPE_COMPLEXS3000: + if (typep.dntti.bitlength == 128) + return FT_DBL_PREC_COMPLEX; + if (typep.dntti.bitlength == 192) + return FT_EXT_PREC_COMPLEX; + return FT_COMPLEX; + case HP_TYPE_STRING200: + case HP_TYPE_LONGSTRING200: + case HP_TYPE_FTN_STRING_SPEC: + case HP_TYPE_MOD_STRING_SPEC: + case HP_TYPE_MOD_STRING_3000: + case HP_TYPE_FTN_STRING_S300_COMPAT: + case HP_TYPE_FTN_STRING_VAX_COMPAT: + return FT_STRING; + default: + abort (); + } +} + +/* Return the type associated with the index found in HP_TYPE. */ + +static struct type ** +hpread_lookup_type (hp_type, objfile) + dnttpointer hp_type; + struct objfile *objfile; +{ + unsigned old_len; + int index = hp_type.dnttp.index; + + if (hp_type.dntti.immediate) + return NULL; + + if (index < LNTT_SYMCOUNT (objfile)) + { + if (index >= TYPE_VECTOR_LENGTH (objfile)) + { + old_len = TYPE_VECTOR_LENGTH (objfile); + if (old_len == 0) + { + TYPE_VECTOR_LENGTH (objfile) = 100; + TYPE_VECTOR (objfile) = (struct type **) + xmalloc (TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *)); + } + while (index >= TYPE_VECTOR_LENGTH (objfile)) + TYPE_VECTOR_LENGTH (objfile) *= 2; + TYPE_VECTOR (objfile) = (struct type **) + xrealloc ((char *) TYPE_VECTOR (objfile), + (TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *))); + memset (&TYPE_VECTOR (objfile)[old_len], 0, + (TYPE_VECTOR_LENGTH (objfile) - old_len) * + sizeof (struct type *)); + } + return &TYPE_VECTOR (objfile)[index]; + } + else + return NULL; +} + +/* Possibly allocate a GDB internal type so we can internalize HP_TYPE. + Note we'll just return the address of a GDB internal type if we already + have it lying around. */ + +static struct type * +hpread_alloc_type (hp_type, objfile) + dnttpointer hp_type; + struct objfile *objfile; +{ + struct type **type_addr; + + type_addr = hpread_lookup_type (hp_type, objfile); + if (*type_addr == 0) + *type_addr = alloc_type (objfile); + + TYPE_CPLUS_SPECIFIC (*type_addr) + = (struct cplus_struct_type *) &cplus_struct_default; + return *type_addr; +} + +/* Read a native enumerated type and return it in GDB internal form. */ + +static struct type * +hpread_read_enum_type (hp_type, dn_bufp, objfile) + dnttpointer hp_type; + union dnttentry *dn_bufp; + struct objfile *objfile; +{ + struct type *type; + struct pending **symlist, *osyms, *syms; + int o_nsyms, nsyms = 0; + dnttpointer mem; + union dnttentry *memp; + char *name; + long n; + struct symbol *sym; + + type = hpread_alloc_type (hp_type, objfile); + TYPE_LENGTH (type) = 4; + + symlist = &file_symbols; + osyms = *symlist; + o_nsyms = osyms ? osyms->nsyms : 0; + + /* Get a name for each member and add it to our list of members. */ + mem = dn_bufp->denum.firstmem; + while (mem.dnttp.extension && mem.word != DNTTNIL) + { + memp = hpread_get_lntt (mem.dnttp.index, objfile); + + name = VT (objfile) + memp->dmember.name; + sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, + sizeof (struct symbol)); + memset (sym, 0, sizeof (struct symbol)); + SYMBOL_NAME (sym) = name; + SYMBOL_CLASS (sym) = LOC_CONST; + SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_VALUE (sym) = memp->dmember.value; + add_symbol_to_list (sym, symlist); + nsyms++; + mem = memp->dmember.nextmem; + } + + /* Now that we know more about the enum, fill in more info. */ + TYPE_CODE (type) = TYPE_CODE_ENUM; + TYPE_FLAGS (type) &= ~TYPE_FLAG_STUB; + TYPE_NFIELDS (type) = nsyms; + TYPE_FIELDS (type) = (struct field *) + obstack_alloc (&objfile->type_obstack, sizeof (struct field) * nsyms); + + /* Find the symbols for the members and put them into the type. + The symbols can be found in the symlist that we put them on + to cause them to be defined. osyms contains the old value + of that symlist; everything up to there was defined by us. + + Note that we preserve the order of the enum constants, so + that in something like "enum {FOO, LAST_THING=FOO}" we print + FOO, not LAST_THING. */ + for (syms = *symlist, n = 0; syms; syms = syms->next) + { + int j = 0; + if (syms == osyms) + j = o_nsyms; + for (; j < syms->nsyms; j++, n++) + { + struct symbol *xsym = syms->symbol[j]; + SYMBOL_TYPE (xsym) = type; + TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym); + TYPE_FIELD_VALUE (type, n) = 0; + TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym); + TYPE_FIELD_BITSIZE (type, n) = 0; + } + if (syms == osyms) + break; + } + + return type; +} + +/* Read and internalize a native function debug symbol. */ + +static struct type * +hpread_read_function_type (hp_type, dn_bufp, objfile) + dnttpointer hp_type; + union dnttentry *dn_bufp; + struct objfile *objfile; +{ + struct type *type, *type1; + struct pending **symlist, *osyms, *syms; + int o_nsyms, nsyms = 0; + dnttpointer param; + union dnttentry *paramp; + char *name; + long n; + struct symbol *sym; + + param = dn_bufp->dfunc.firstparam; + + /* See if we've already read in this type. */ + type = hpread_alloc_type (hp_type, objfile); + if (TYPE_CODE (type) == TYPE_CODE_FUNC) + return type; + + /* Nope, so read it in and store it away. */ + type1 = lookup_function_type (hpread_type_lookup (dn_bufp->dfunc.retval, + objfile)); + memcpy ((char *) type, (char *) type1, sizeof (struct type)); + + symlist = &local_symbols; + osyms = *symlist; + o_nsyms = osyms ? osyms->nsyms : 0; + + /* Now examine each parameter noting its type, location, and a + wealth of other information. */ + while (param.word && param.word != DNTTNIL) + { + paramp = hpread_get_lntt (param.dnttp.index, objfile); + nsyms++; + param = paramp->dfparam.nextparam; + + /* Get the name. */ + name = VT (objfile) + paramp->dfparam.name; + sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, + sizeof (struct symbol)); + (void) memset (sym, 0, sizeof (struct symbol)); + SYMBOL_NAME (sym) = name; + + /* Figure out where it lives. */ + if (paramp->dfparam.regparam) + SYMBOL_CLASS (sym) = LOC_REGPARM; + else if (paramp->dfparam.indirect) + SYMBOL_CLASS (sym) = LOC_REF_ARG; + else + SYMBOL_CLASS (sym) = LOC_ARG; + SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + if (paramp->dfparam.copyparam) + { + SYMBOL_VALUE (sym) = paramp->dfparam.location ; +#ifdef HPREAD_ADJUST_STACK_ADDRESS + SYMBOL_VALUE (sym) + += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile)); +#endif + /* This is likely a pass-by-invisible reference parameter, + Hack on the symbol class to make GDB happy. */ + SYMBOL_CLASS (sym) = LOC_REGPARM_ADDR; + } + else + SYMBOL_VALUE (sym) = paramp->dfparam.location; + + /* Get its type. */ + SYMBOL_TYPE (sym) = hpread_type_lookup (paramp->dfparam.type, objfile); + + /* Add it to the list. */ + add_symbol_to_list (sym, symlist); + } + + /* Note how many parameters we found. */ + TYPE_NFIELDS (type) = nsyms; + TYPE_FIELDS (type) = (struct field *) + obstack_alloc (&objfile->type_obstack, + sizeof (struct field) * nsyms); + + /* Find the symbols for the values and put them into the type. + The symbols can be found in the symlist that we put them on + to cause them to be defined. osyms contains the old value + of that symlist; everything up to there was defined by us. */ + /* Note that we preserve the order of the parameters, so + that in something like "enum {FOO, LAST_THING=FOO}" we print + FOO, not LAST_THING. */ + for (syms = *symlist, n = 0; syms; syms = syms->next) + { + int j = 0; + if (syms == osyms) + j = o_nsyms; + for (; j < syms->nsyms; j++, n++) + { + struct symbol *xsym = syms->symbol[j]; + TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym); + TYPE_FIELD_TYPE (type, n) = SYMBOL_TYPE (xsym); + TYPE_FIELD_BITPOS (type, n) = n; + TYPE_FIELD_BITSIZE (type, n) = 0; + } + if (syms == osyms) + break; + } + return type; +} + +/* Read in and internalize a structure definition. */ + +static struct type * +hpread_read_struct_type (hp_type, dn_bufp, objfile) + dnttpointer hp_type; + union dnttentry *dn_bufp; + struct objfile *objfile; +{ + struct nextfield + { + struct nextfield *next; + struct field field; + }; + + struct type *type; + struct nextfield *list = 0; + struct nextfield *new; + int n, nfields = 0; + dnttpointer field; + union dnttentry *fieldp; + + /* Is it something we've already dealt with? */ + type = hpread_alloc_type (hp_type, objfile); + if ((TYPE_CODE (type) == TYPE_CODE_STRUCT) || + (TYPE_CODE (type) == TYPE_CODE_UNION)) + return type; + + /* Get the basic type correct. */ + if (dn_bufp->dblock.kind == DNTT_TYPE_STRUCT) + { + TYPE_CODE (type) = TYPE_CODE_STRUCT; + TYPE_LENGTH (type) = dn_bufp->dstruct.bitlength / 8; + } + else if (dn_bufp->dblock.kind == DNTT_TYPE_UNION) + { + TYPE_CODE (type) = TYPE_CODE_UNION; + TYPE_LENGTH (type) = dn_bufp->dunion.bitlength / 8; + } + else + return type; + + + TYPE_FLAGS (type) &= ~TYPE_FLAG_STUB; + + /* Read in and internalize all the fields. */ + field = dn_bufp->dstruct.firstfield; + while (field.word != DNTTNIL && field.dnttp.extension) + { + fieldp = hpread_get_lntt (field.dnttp.index, objfile); + + /* Get space to record the next field's data. */ + new = (struct nextfield *) alloca (sizeof (struct nextfield)); + new->next = list; + list = new; + + list->field.name = VT (objfile) + fieldp->dfield.name; + list->field.bitpos = fieldp->dfield.bitoffset; + if (fieldp->dfield.bitlength % 8) + list->field.bitsize = fieldp->dfield.bitlength; + else + list->field.bitsize = 0; + nfields++; + field = fieldp->dfield.nextfield; + list->field.type = hpread_type_lookup (fieldp->dfield.type, objfile); + } + + TYPE_NFIELDS (type) = nfields; + TYPE_FIELDS (type) = (struct field *) + obstack_alloc (&objfile->type_obstack, sizeof (struct field) * nfields); + + /* Copy the saved-up fields into the field vector. */ + for (n = nfields; list; list = list->next) + { + n -= 1; + TYPE_FIELD (type, n) = list->field; + } + return type; +} + +/* Read in and internalize a set debug symbol. */ + +static struct type * +hpread_read_set_type (hp_type, dn_bufp, objfile) + dnttpointer hp_type; + union dnttentry *dn_bufp; + struct objfile *objfile; +{ + struct type *type; + + /* See if it's something we've already deal with. */ + type = hpread_alloc_type (hp_type, objfile); + if (TYPE_CODE (type) == TYPE_CODE_SET) + return type; + + /* Nope. Fill in the appropriate fields. */ + TYPE_CODE (type) = TYPE_CODE_SET; + TYPE_LENGTH (type) = dn_bufp->dset.bitlength / 8; + TYPE_NFIELDS (type) = 0; + TYPE_TARGET_TYPE (type) = hpread_type_lookup (dn_bufp->dset.subtype, + objfile); + return type; +} + +/* Read in and internalize an array debug symbol. */ + +static struct type * +hpread_read_array_type (hp_type, dn_bufp, objfile) + dnttpointer hp_type; + union dnttentry *dn_bufp; + struct objfile *objfile; +{ + struct type *type; + union dnttentry save; + save = *dn_bufp; + + /* Why no check here? Because it kept us from properly determining + the size of the array! */ + type = hpread_alloc_type (hp_type, objfile); + + TYPE_CODE (type) = TYPE_CODE_ARRAY; + + /* values are not normalized. */ + if (!((dn_bufp->darray.arrayisbytes && dn_bufp->darray.elemisbytes) + || (!dn_bufp->darray.arrayisbytes && !dn_bufp->darray.elemisbytes))) + abort (); + else if (dn_bufp->darray.arraylength == 0x7fffffff) + { + /* The HP debug format represents char foo[]; as an array with + length 0x7fffffff. Internally GDB wants to represent this + as an array of length zero. */ + TYPE_LENGTH (type) = 0; + } + else + TYPE_LENGTH (type) = dn_bufp->darray.arraylength / 8; + + TYPE_NFIELDS (type) = 1; + TYPE_TARGET_TYPE (type) = hpread_type_lookup (dn_bufp->darray.elemtype, + objfile); + dn_bufp = &save; + TYPE_FIELDS (type) = (struct field *) + obstack_alloc (&objfile->type_obstack, sizeof (struct field)); + TYPE_FIELD_TYPE (type, 0) = hpread_type_lookup (dn_bufp->darray.indextype, + objfile); + return type; +} + +/* Read in and internalize a subrange debug symbol. */ +static struct type * +hpread_read_subrange_type (hp_type, dn_bufp, objfile) + dnttpointer hp_type; + union dnttentry *dn_bufp; + struct objfile *objfile; +{ + struct type *type; + + /* Is it something we've already dealt with. */ + type = hpread_alloc_type (hp_type, objfile); + if (TYPE_CODE (type) == TYPE_CODE_RANGE) + return type; + + /* Nope, internalize it. */ + TYPE_CODE (type) = TYPE_CODE_RANGE; + TYPE_LENGTH (type) = dn_bufp->dsubr.bitlength / 8; + TYPE_NFIELDS (type) = 2; + TYPE_FIELDS (type) + = (struct field *) obstack_alloc (&objfile->type_obstack, + 2 * sizeof (struct field)); + + if (dn_bufp->dsubr.dyn_low) + TYPE_FIELD_BITPOS (type, 0) = 0; + else + TYPE_FIELD_BITPOS (type, 0) = dn_bufp->dsubr.lowbound; + + if (dn_bufp->dsubr.dyn_high) + TYPE_FIELD_BITPOS (type, 1) = -1; + else + TYPE_FIELD_BITPOS (type, 1) = dn_bufp->dsubr.highbound; + TYPE_TARGET_TYPE (type) = hpread_type_lookup (dn_bufp->dsubr.subtype, + objfile); + return type; +} + +static struct type * +hpread_type_lookup (hp_type, objfile) + dnttpointer hp_type; + struct objfile *objfile; +{ + union dnttentry *dn_bufp; + + /* First see if it's a simple builtin type. */ + if (hp_type.dntti.immediate) + return lookup_fundamental_type (objfile, hpread_type_translate (hp_type)); + + /* Not a builtin type. We'll have to read it in. */ + if (hp_type.dnttp.index < LNTT_SYMCOUNT (objfile)) + dn_bufp = hpread_get_lntt (hp_type.dnttp.index, objfile); + else + return lookup_fundamental_type (objfile, FT_VOID); + + switch (dn_bufp->dblock.kind) + { + case DNTT_TYPE_SRCFILE: + case DNTT_TYPE_MODULE: + case DNTT_TYPE_FUNCTION: + case DNTT_TYPE_ENTRY: + case DNTT_TYPE_BEGIN: + case DNTT_TYPE_END: + case DNTT_TYPE_IMPORT: + case DNTT_TYPE_LABEL: + case DNTT_TYPE_WITH: + case DNTT_TYPE_COMMON: + case DNTT_TYPE_FPARAM: + case DNTT_TYPE_SVAR: + case DNTT_TYPE_DVAR: + case DNTT_TYPE_CONST: + /* Opps. Something went very wrong. */ + return lookup_fundamental_type (objfile, FT_VOID); + + case DNTT_TYPE_TYPEDEF: + { + struct type *structtype = hpread_type_lookup (dn_bufp->dtype.type, + objfile); + char *suffix; + suffix = VT (objfile) + dn_bufp->dtype.name; + + TYPE_CPLUS_SPECIFIC (structtype) + = (struct cplus_struct_type *) &cplus_struct_default; + TYPE_NAME (structtype) = suffix; + return structtype; + } + + case DNTT_TYPE_TAGDEF: + { + /* Just a little different from above. We have to tack on + an identifier of some kind (struct, union, enum, etc). */ + struct type *structtype = hpread_type_lookup (dn_bufp->dtype.type, + objfile); + char *prefix, *suffix; + suffix = VT (objfile) + dn_bufp->dtype.name; + + /* Lookup the next type in the list. It should be a structure, + union, or enum type. We will need to attach that to our name. */ + if (dn_bufp->dtype.type.dnttp.index < LNTT_SYMCOUNT (objfile)) + dn_bufp = hpread_get_lntt (dn_bufp->dtype.type.dnttp.index, objfile); + else + abort (); + + if (dn_bufp->dblock.kind == DNTT_TYPE_STRUCT) + prefix = "struct "; + else if (dn_bufp->dblock.kind == DNTT_TYPE_UNION) + prefix = "union "; + else + prefix = "enum "; + + /* Build the correct name. */ + structtype->name + = (char *) obstack_alloc (&objfile->type_obstack, + strlen (prefix) + strlen (suffix) + 1); + TYPE_NAME (structtype) = strcpy (TYPE_NAME (structtype), prefix); + TYPE_NAME (structtype) = strcat (TYPE_NAME (structtype), suffix); + TYPE_TAG_NAME (structtype) = suffix; + + TYPE_CPLUS_SPECIFIC (structtype) + = (struct cplus_struct_type *) &cplus_struct_default; + + return structtype; + } + case DNTT_TYPE_POINTER: + return lookup_pointer_type (hpread_type_lookup (dn_bufp->dptr.pointsto, + objfile)); + case DNTT_TYPE_ENUM: + return hpread_read_enum_type (hp_type, dn_bufp, objfile); + case DNTT_TYPE_MEMENUM: + return lookup_fundamental_type (objfile, FT_VOID); + case DNTT_TYPE_SET: + return hpread_read_set_type (hp_type, dn_bufp, objfile); + case DNTT_TYPE_SUBRANGE: + return hpread_read_subrange_type (hp_type, dn_bufp, objfile); + case DNTT_TYPE_ARRAY: + return hpread_read_array_type (hp_type, dn_bufp, objfile); + case DNTT_TYPE_STRUCT: + case DNTT_TYPE_UNION: + return hpread_read_struct_type (hp_type, dn_bufp, objfile); + case DNTT_TYPE_FIELD: + return hpread_type_lookup (dn_bufp->dfield.type, objfile); + case DNTT_TYPE_VARIANT: + case DNTT_TYPE_FILE: + return lookup_fundamental_type (objfile, FT_VOID); + case DNTT_TYPE_FUNCTYPE: + return lookup_function_type (hpread_type_lookup (dn_bufp->dfunctype.retval, + objfile)); + case DNTT_TYPE_COBSTRUCT: + case DNTT_TYPE_XREF: + case DNTT_TYPE_SA: + case DNTT_TYPE_MACRO: + default: + return lookup_fundamental_type (objfile, FT_VOID); + } +} + +static sltpointer +hpread_record_lines (subfile, s_idx, e_idx, objfile, offset) + struct subfile *subfile; + sltpointer s_idx, e_idx; + struct objfile *objfile; + CORE_ADDR offset; +{ + union sltentry *sl_bufp; + + while (s_idx <= e_idx) + { + sl_bufp = hpread_get_slt (s_idx, objfile); + /* Only record "normal" entries in the SLT. */ + if (sl_bufp->snorm.sltdesc == SLT_NORMAL + || sl_bufp->snorm.sltdesc == SLT_EXIT) + record_line (subfile, sl_bufp->snorm.line, + sl_bufp->snorm.address + offset); + s_idx++; + } + return e_idx; +} + +/* Internalize one native debug symbol. */ + +static void +hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile, + text_offset, text_size, filename, index) + union dnttentry *dn_bufp; + char *name; + struct section_offsets *section_offsets; + struct objfile *objfile; + CORE_ADDR text_offset; + int text_size; + char *filename; + int index; +{ + unsigned long desc; + int type; + CORE_ADDR valu; + int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT); + union dnttentry *dn_temp; + dnttpointer hp_type; + struct symbol *sym; + struct context_stack *new; + + /* Allocate one GDB debug symbol and fill in some default values. */ + sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, + sizeof (struct symbol)); + memset (sym, 0, sizeof (struct symbol)); + SYMBOL_NAME (sym) = name; + SYMBOL_LANGUAGE (sym) = language_auto; + SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack); + SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_LINE (sym) = 0; + SYMBOL_VALUE (sym) = 0; + SYMBOL_CLASS (sym) = LOC_TYPEDEF; + + hp_type.dnttp.extension = 1; + hp_type.dnttp.immediate = 0; + hp_type.dnttp.global = 0; + hp_type.dnttp.index = index; + + type = dn_bufp->dblock.kind; + + switch (type) + { + case DNTT_TYPE_SRCFILE: + /* This type of symbol indicates from which source file or include file + the following data comes. If there are no modules it also may + indicate the start of a new source file, in which case we must + finish the symbol table of the previous source file + (if any) and start accumulating a new symbol table. */ + + valu = text_offset; + if (!last_source_file) + { + start_symtab (name, NULL, valu); + SL_INDEX (objfile) = dn_bufp->dsfile.address; + } + else + { + SL_INDEX (objfile) = hpread_record_lines (current_subfile, + SL_INDEX (objfile), + dn_bufp->dsfile.address, + objfile, offset); + } + start_subfile (name, NULL); + break; + + case DNTT_TYPE_MODULE: + /* No need to do anything with these DNTT_TYPE_MODULE symbols anymore. */ + break; + + case DNTT_TYPE_FUNCTION: + case DNTT_TYPE_ENTRY: + /* A function or secondary entry point. */ + valu = dn_bufp->dfunc.lowaddr + offset; + SL_INDEX (objfile) = hpread_record_lines (current_subfile, + SL_INDEX (objfile), + dn_bufp->dfunc.address, + objfile, offset); + + WITHIN_FUNCTION (objfile) = 1; + CURRENT_FUNCTION_VALUE (objfile) = valu; + + /* Stack must be empty now. */ + if (context_stack_depth != 0) + complain (&lbrac_unmatched_complaint, (char *) symnum); + new = push_context (0, valu); + + SYMBOL_CLASS (sym) = LOC_BLOCK; + SYMBOL_TYPE (sym) = hpread_read_function_type (hp_type, dn_bufp, objfile); + if (dn_bufp->dfunc.global) + add_symbol_to_list (sym, &global_symbols); + else + add_symbol_to_list (sym, &file_symbols); + new->name = sym; + + /* Search forward to the next scope beginning. */ + while (dn_bufp->dblock.kind != DNTT_TYPE_BEGIN) + { + dn_bufp = hpread_get_lntt (++index, objfile); + if (dn_bufp->dblock.extension) + continue; + } + SL_INDEX (objfile) = hpread_record_lines (current_subfile, + SL_INDEX (objfile), + dn_bufp->dbegin.address, + objfile, offset); + SYMBOL_LINE (sym) = hpread_get_line (dn_bufp->dbegin.address, objfile); + record_line (current_subfile, SYMBOL_LINE (sym), valu); + break; + + case DNTT_TYPE_BEGIN: + /* Begin a new scope. */ + SL_INDEX (objfile) = hpread_record_lines (current_subfile, + SL_INDEX (objfile), + dn_bufp->dbegin.address, + objfile, offset); + valu = hpread_get_location (dn_bufp->dbegin.address, objfile); + valu += offset; /* Relocate for dynamic loading */ + desc = hpread_get_depth (dn_bufp->dbegin.address, objfile); + new = push_context (desc, valu); + break; + + case DNTT_TYPE_END: + /* End a scope. */ + SL_INDEX (objfile) = hpread_record_lines (current_subfile, + SL_INDEX (objfile), + dn_bufp->dend.address + 1, + objfile, offset); + switch (dn_bufp->dend.endkind) + { + case DNTT_TYPE_MODULE: + /* Ending a module ends the symbol table for that module. */ + valu = text_offset + text_size + offset; + (void) end_symtab (valu, objfile, 0); + break; + + case DNTT_TYPE_FUNCTION: + /* Ending a function, well, ends the function's scope. */ + dn_temp = hpread_get_lntt (dn_bufp->dend.beginscope.dnttp.index, + objfile); + valu = dn_temp->dfunc.hiaddr + offset; + new = pop_context (); + /* Make a block for the local symbols within. */ + finish_block (new->name, &local_symbols, new->old_blocks, + new->start_addr, valu, objfile); + WITHIN_FUNCTION (objfile) = 0; + break; + case DNTT_TYPE_BEGIN: + /* Just ending a local scope. */ + valu = hpread_get_location (dn_bufp->dend.address, objfile); + /* Why in the hell is this needed? */ + valu += offset + 9; /* Relocate for dynamic loading */ + new = pop_context (); + desc = dn_bufp->dend.beginscope.dnttp.index; + if (desc != new->depth) + complain (&lbrac_mismatch_complaint, (char *) symnum); + /* Make a block for the local symbols within. */ + finish_block (new->name, &local_symbols, new->old_blocks, + new->start_addr, valu, objfile); + local_symbols = new->locals; + break; + } + break; + case DNTT_TYPE_LABEL: + SYMBOL_NAMESPACE (sym) = LABEL_NAMESPACE; + break; + case DNTT_TYPE_FPARAM: + /* Function parameters. */ + if (dn_bufp->dfparam.regparam) + SYMBOL_CLASS (sym) = LOC_REGISTER; + else + SYMBOL_CLASS (sym) = LOC_LOCAL; + if (dn_bufp->dfparam.copyparam) + { + SYMBOL_VALUE (sym) = dn_bufp->dfparam.location; +#ifdef HPREAD_ADJUST_STACK_ADDRESS + SYMBOL_VALUE (sym) + += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile)); +#endif + } + else + SYMBOL_VALUE (sym) = dn_bufp->dfparam.location; + SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dfparam.type, objfile); + add_symbol_to_list (sym, &local_symbols); + break; + case DNTT_TYPE_SVAR: + /* Static variables. */ + SYMBOL_CLASS (sym) = LOC_STATIC; + SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location; + SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dsvar.type, objfile); + if (dn_bufp->dsvar.global) + add_symbol_to_list (sym, &global_symbols); + else if (WITHIN_FUNCTION (objfile)) + add_symbol_to_list (sym, &local_symbols); + else + add_symbol_to_list (sym, &file_symbols); + break; + case DNTT_TYPE_DVAR: + /* Dynamic variables. */ + if (dn_bufp->ddvar.regvar) + SYMBOL_CLASS (sym) = LOC_REGISTER; + else + SYMBOL_CLASS (sym) = LOC_LOCAL; + SYMBOL_VALUE (sym) = dn_bufp->ddvar.location; +#ifdef HPREAD_ADJUST_STACK_ADDRESS + SYMBOL_VALUE (sym) + += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile)); +#endif + SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->ddvar.type, objfile); + if (dn_bufp->ddvar.global) + add_symbol_to_list (sym, &global_symbols); + else if (WITHIN_FUNCTION (objfile)) + add_symbol_to_list (sym, &local_symbols); + else + add_symbol_to_list (sym, &file_symbols); + break; + case DNTT_TYPE_CONST: + /* A constant (pascal?). */ + SYMBOL_CLASS (sym) = LOC_CONST; + SYMBOL_VALUE (sym) = dn_bufp->dconst.location; + SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dconst.type, objfile); + if (dn_bufp->dconst.global) + add_symbol_to_list (sym, &global_symbols); + else if (WITHIN_FUNCTION (objfile)) + add_symbol_to_list (sym, &local_symbols); + else + add_symbol_to_list (sym, &file_symbols); + break; + case DNTT_TYPE_TYPEDEF: + SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; + SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dtype.type, objfile); + if (dn_bufp->dtype.global) + add_symbol_to_list (sym, &global_symbols); + else if (WITHIN_FUNCTION (objfile)) + add_symbol_to_list (sym, &local_symbols); + else + add_symbol_to_list (sym, &file_symbols); + break; + case DNTT_TYPE_TAGDEF: + SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE; + SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dtype.type, objfile); + TYPE_NAME (sym->type) = SYMBOL_NAME (sym); + TYPE_TAG_NAME (sym->type) = SYMBOL_NAME (sym); + if (dn_bufp->dtype.global) + add_symbol_to_list (sym, &global_symbols); + else if (WITHIN_FUNCTION (objfile)) + add_symbol_to_list (sym, &local_symbols); + else + add_symbol_to_list (sym, &file_symbols); + break; + case DNTT_TYPE_POINTER: + SYMBOL_TYPE (sym) = lookup_pointer_type (hpread_type_lookup + (dn_bufp->dptr.pointsto, + objfile)); + add_symbol_to_list (sym, &file_symbols); + break; + case DNTT_TYPE_ENUM: + SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE; + SYMBOL_TYPE (sym) = hpread_read_enum_type (hp_type, dn_bufp, objfile); + add_symbol_to_list (sym, &file_symbols); + break; + case DNTT_TYPE_MEMENUM: + break; + case DNTT_TYPE_SET: + SYMBOL_TYPE (sym) = hpread_read_set_type (hp_type, dn_bufp, objfile); + add_symbol_to_list (sym, &file_symbols); + break; + case DNTT_TYPE_SUBRANGE: + SYMBOL_TYPE (sym) = hpread_read_subrange_type (hp_type, dn_bufp, + objfile); + add_symbol_to_list (sym, &file_symbols); + break; + case DNTT_TYPE_ARRAY: + SYMBOL_TYPE (sym) = hpread_read_array_type (hp_type, dn_bufp, objfile); + add_symbol_to_list (sym, &file_symbols); + break; + case DNTT_TYPE_STRUCT: + case DNTT_TYPE_UNION: + SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE; + SYMBOL_TYPE (sym) = hpread_read_struct_type (hp_type, dn_bufp, objfile); + add_symbol_to_list (sym, &file_symbols); + break; + default: + break; + } +} diff --git a/contrib/gdb/gdb/i960-tdep.c b/contrib/gdb/gdb/i960-tdep.c new file mode 100644 index 0000000000000..5b7f477e07c45 --- /dev/null +++ b/contrib/gdb/gdb/i960-tdep.c @@ -0,0 +1,816 @@ +/* Target-machine dependent code for the Intel 960 + Copyright 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + Contributed by Intel Corporation. + examine_prologue and other parts contributed by Wind River Systems. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "symtab.h" +#include "value.h" +#include "frame.h" +#include "floatformat.h" +#include "target.h" + +static CORE_ADDR next_insn PARAMS ((CORE_ADDR memaddr, + unsigned int *pword1, + unsigned int *pword2)); + +/* gdb960 is always running on a non-960 host. Check its characteristics. + This routine must be called as part of gdb initialization. */ + +static void +check_host() +{ + int i; + + static struct typestruct { + int hostsize; /* Size of type on host */ + int i960size; /* Size of type on i960 */ + char *typename; /* Name of type, for error msg */ + } types[] = { + { sizeof(short), 2, "short" }, + { sizeof(int), 4, "int" }, + { sizeof(long), 4, "long" }, + { sizeof(float), 4, "float" }, + { sizeof(double), 8, "double" }, + { sizeof(char *), 4, "pointer" }, + }; +#define TYPELEN (sizeof(types) / sizeof(struct typestruct)) + + /* Make sure that host type sizes are same as i960 + */ + for ( i = 0; i < TYPELEN; i++ ){ + if ( types[i].hostsize != types[i].i960size ){ + printf_unfiltered("sizeof(%s) != %d: PROCEED AT YOUR OWN RISK!\n", + types[i].typename, types[i].i960size ); + } + + } +} + +/* Examine an i960 function prologue, recording the addresses at which + registers are saved explicitly by the prologue code, and returning + the address of the first instruction after the prologue (but not + after the instruction at address LIMIT, as explained below). + + LIMIT places an upper bound on addresses of the instructions to be + examined. If the prologue code scan reaches LIMIT, the scan is + aborted and LIMIT is returned. This is used, when examining the + prologue for the current frame, to keep examine_prologue () from + claiming that a given register has been saved when in fact the + instruction that saves it has not yet been executed. LIMIT is used + at other times to stop the scan when we hit code after the true + function prologue (e.g. for the first source line) which might + otherwise be mistaken for function prologue. + + The format of the function prologue matched by this routine is + derived from examination of the source to gcc960 1.21, particularly + the routine i960_function_prologue (). A "regular expression" for + the function prologue is given below: + + (lda LRn, g14 + mov g14, g[0-7] + (mov 0, g14) | (lda 0, g14))? + + (mov[qtl]? g[0-15], r[4-15])* + ((addo [1-31], sp, sp) | (lda n(sp), sp))? + (st[qtl]? g[0-15], n(fp))* + + (cmpobne 0, g14, LFn + mov sp, g14 + lda 0x30(sp), sp + LFn: stq g0, (g14) + stq g4, 0x10(g14) + stq g8, 0x20(g14))? + + (st g14, n(fp))? + (mov g13,r[4-15])? +*/ + +/* Macros for extracting fields from i960 instructions. */ + +#define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos)) +#define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width)) + +#define REG_SRC1(insn) EXTRACT_FIELD (insn, 0, 5) +#define REG_SRC2(insn) EXTRACT_FIELD (insn, 14, 5) +#define REG_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5) +#define MEM_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5) +#define MEMA_OFFSET(insn) EXTRACT_FIELD (insn, 0, 12) + +/* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or + is not the address of a valid instruction, the address of the next + instruction beyond ADDR otherwise. *PWORD1 receives the first word + of the instruction, and (for two-word instructions), *PWORD2 receives + the second. */ + +#define NEXT_PROLOGUE_INSN(addr, lim, pword1, pword2) \ + (((addr) < (lim)) ? next_insn (addr, pword1, pword2) : 0) + +static CORE_ADDR +examine_prologue (ip, limit, frame_addr, fsr) + register CORE_ADDR ip; + register CORE_ADDR limit; + CORE_ADDR frame_addr; + struct frame_saved_regs *fsr; +{ + register CORE_ADDR next_ip; + register int src, dst; + register unsigned int *pcode; + unsigned int insn1, insn2; + int size; + int within_leaf_prologue; + CORE_ADDR save_addr; + static unsigned int varargs_prologue_code [] = + { + 0x3507a00c, /* cmpobne 0x0, g14, LFn */ + 0x5cf01601, /* mov sp, g14 */ + 0x8c086030, /* lda 0x30(sp), sp */ + 0xb2879000, /* LFn: stq g0, (g14) */ + 0xb2a7a010, /* stq g4, 0x10(g14) */ + 0xb2c7a020 /* stq g8, 0x20(g14) */ + }; + + /* Accept a leaf procedure prologue code fragment if present. + Note that ip might point to either the leaf or non-leaf + entry point; we look for the non-leaf entry point first: */ + + within_leaf_prologue = 0; + if ((next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2)) + && ((insn1 & 0xfffff000) == 0x8cf00000 /* lda LRx, g14 (MEMA) */ + || (insn1 & 0xfffffc60) == 0x8cf03000)) /* lda LRx, g14 (MEMB) */ + { + within_leaf_prologue = 1; + next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2); + } + + /* Now look for the prologue code at a leaf entry point: */ + + if (next_ip + && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */ + && REG_SRCDST (insn1) <= G0_REGNUM + 7) + { + within_leaf_prologue = 1; + if ((next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2)) + && (insn1 == 0x8cf00000 /* lda 0, g14 */ + || insn1 == 0x5cf01e00)) /* mov 0, g14 */ + { + ip = next_ip; + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); + within_leaf_prologue = 0; + } + } + + /* If something that looks like the beginning of a leaf prologue + has been seen, but the remainder of the prologue is missing, bail. + We don't know what we've got. */ + + if (within_leaf_prologue) + return (ip); + + /* Accept zero or more instances of "mov[qtl]? gx, ry", where y >= 4. + This may cause us to mistake the moving of a register + parameter to a local register for the saving of a callee-saved + register, but that can't be helped, since with the + "-fcall-saved" flag, any register can be made callee-saved. */ + + while (next_ip + && (insn1 & 0xfc802fb0) == 0x5c000610 + && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4)) + { + src = REG_SRC1 (insn1); + size = EXTRACT_FIELD (insn1, 24, 2) + 1; + save_addr = frame_addr + ((dst - R0_REGNUM) * 4); + while (size--) + { + fsr->regs[src++] = save_addr; + save_addr += 4; + } + ip = next_ip; + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); + } + + /* Accept an optional "addo n, sp, sp" or "lda n(sp), sp". */ + + if (next_ip && + ((insn1 & 0xffffffe0) == 0x59084800 /* addo n, sp, sp */ + || (insn1 & 0xfffff000) == 0x8c086000 /* lda n(sp), sp (MEMA) */ + || (insn1 & 0xfffffc60) == 0x8c087400)) /* lda n(sp), sp (MEMB) */ + { + ip = next_ip; + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); + } + + /* Accept zero or more instances of "st[qtl]? gx, n(fp)". + This may cause us to mistake the copying of a register + parameter to the frame for the saving of a callee-saved + register, but that can't be helped, since with the + "-fcall-saved" flag, any register can be made callee-saved. + We can, however, refuse to accept a save of register g14, + since that is matched explicitly below. */ + + while (next_ip && + ((insn1 & 0xf787f000) == 0x9287e000 /* stl? gx, n(fp) (MEMA) */ + || (insn1 & 0xf787fc60) == 0x9287f400 /* stl? gx, n(fp) (MEMB) */ + || (insn1 & 0xef87f000) == 0xa287e000 /* st[tq] gx, n(fp) (MEMA) */ + || (insn1 & 0xef87fc60) == 0xa287f400) /* st[tq] gx, n(fp) (MEMB) */ + && ((src = MEM_SRCDST (insn1)) != G14_REGNUM)) + { + save_addr = frame_addr + ((insn1 & BITMASK (12, 1)) + ? insn2 : MEMA_OFFSET (insn1)); + size = (insn1 & BITMASK (29, 1)) ? ((insn1 & BITMASK (28, 1)) ? 4 : 3) + : ((insn1 & BITMASK (27, 1)) ? 2 : 1); + while (size--) + { + fsr->regs[src++] = save_addr; + save_addr += 4; + } + ip = next_ip; + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); + } + + /* Accept the varargs prologue code if present. */ + + size = sizeof (varargs_prologue_code) / sizeof (int); + pcode = varargs_prologue_code; + while (size-- && next_ip && *pcode++ == insn1) + { + ip = next_ip; + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); + } + + /* Accept an optional "st g14, n(fp)". */ + + if (next_ip && + ((insn1 & 0xfffff000) == 0x92f7e000 /* st g14, n(fp) (MEMA) */ + || (insn1 & 0xfffffc60) == 0x92f7f400)) /* st g14, n(fp) (MEMB) */ + { + fsr->regs[G14_REGNUM] = frame_addr + ((insn1 & BITMASK (12, 1)) + ? insn2 : MEMA_OFFSET (insn1)); + ip = next_ip; + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); + } + + /* Accept zero or one instance of "mov g13, ry", where y >= 4. + This is saving the address where a struct should be returned. */ + + if (next_ip + && (insn1 & 0xff802fbf) == 0x5c00061d + && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4)) + { + save_addr = frame_addr + ((dst - R0_REGNUM) * 4); + fsr->regs[G0_REGNUM+13] = save_addr; + ip = next_ip; +#if 0 /* We'll need this once there is a subsequent instruction examined. */ + next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); +#endif + } + + return (ip); +} + +/* Given an ip value corresponding to the start of a function, + return the ip of the first instruction after the function + prologue. */ + +CORE_ADDR +skip_prologue (ip) + CORE_ADDR (ip); +{ + struct frame_saved_regs saved_regs_dummy; + struct symtab_and_line sal; + CORE_ADDR limit; + + sal = find_pc_line (ip, 0); + limit = (sal.end) ? sal.end : 0xffffffff; + + return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy)); +} + +/* Put here the code to store, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. + + We cache the result of doing this in the frame_cache_obstack, since + it is fairly expensive. */ + +void +frame_find_saved_regs (fi, fsr) + struct frame_info *fi; + struct frame_saved_regs *fsr; +{ + register CORE_ADDR next_addr; + register CORE_ADDR *saved_regs; + register int regnum; + register struct frame_saved_regs *cache_fsr; + extern struct obstack frame_cache_obstack; + CORE_ADDR ip; + struct symtab_and_line sal; + CORE_ADDR limit; + + if (!fi->fsr) + { + cache_fsr = (struct frame_saved_regs *) + obstack_alloc (&frame_cache_obstack, + sizeof (struct frame_saved_regs)); + memset (cache_fsr, '\0', sizeof (struct frame_saved_regs)); + fi->fsr = cache_fsr; + + /* Find the start and end of the function prologue. If the PC + is in the function prologue, we only consider the part that + has executed already. */ + + ip = get_pc_function_start (fi->pc); + sal = find_pc_line (ip, 0); + limit = (sal.end && sal.end < fi->pc) ? sal.end: fi->pc; + + examine_prologue (ip, limit, fi->frame, cache_fsr); + + /* Record the addresses at which the local registers are saved. + Strictly speaking, we should only do this for non-leaf procedures, + but no one will ever look at these values if it is a leaf procedure, + since local registers are always caller-saved. */ + + next_addr = (CORE_ADDR) fi->frame; + saved_regs = cache_fsr->regs; + for (regnum = R0_REGNUM; regnum <= R15_REGNUM; regnum++) + { + *saved_regs++ = next_addr; + next_addr += 4; + } + + cache_fsr->regs[FP_REGNUM] = cache_fsr->regs[PFP_REGNUM]; + } + + *fsr = *fi->fsr; + + /* Fetch the value of the sp from memory every time, since it + is conceivable that it has changed since the cache was flushed. + This unfortunately undoes much of the savings from caching the + saved register values. I suggest adding an argument to + get_frame_saved_regs () specifying the register number we're + interested in (or -1 for all registers). This would be passed + through to FRAME_FIND_SAVED_REGS (), permitting more efficient + computation of saved register addresses (e.g., on the i960, + we don't have to examine the prologue to find local registers). + -- markf@wrs.com + FIXME, we don't need to refetch this, since the cache is cleared + every time the child process is restarted. If GDB itself + modifies SP, it has to clear the cache by hand (does it?). -gnu */ + + fsr->regs[SP_REGNUM] = read_memory_integer (fsr->regs[SP_REGNUM], 4); +} + +/* Return the address of the argument block for the frame + described by FI. Returns 0 if the address is unknown. */ + +CORE_ADDR +frame_args_address (fi, must_be_correct) + struct frame_info *fi; +{ + struct frame_saved_regs fsr; + CORE_ADDR ap; + + /* If g14 was saved in the frame by the function prologue code, return + the saved value. If the frame is current and we are being sloppy, + return the value of g14. Otherwise, return zero. */ + + get_frame_saved_regs (fi, &fsr); + if (fsr.regs[G14_REGNUM]) + ap = read_memory_integer (fsr.regs[G14_REGNUM],4); + else + { + if (must_be_correct) + return 0; /* Don't cache this result */ + if (get_next_frame (fi)) + ap = 0; + else + ap = read_register (G14_REGNUM); + if (ap == 0) + ap = fi->frame; + } + fi->arg_pointer = ap; /* Cache it for next time */ + return ap; +} + +/* Return the address of the return struct for the frame + described by FI. Returns 0 if the address is unknown. */ + +CORE_ADDR +frame_struct_result_address (fi) + struct frame_info *fi; +{ + struct frame_saved_regs fsr; + CORE_ADDR ap; + + /* If the frame is non-current, check to see if g14 was saved in the + frame by the function prologue code; return the saved value if so, + zero otherwise. If the frame is current, return the value of g14. + + FIXME, shouldn't this use the saved value as long as we are past + the function prologue, and only use the current value if we have + no saved value and are at TOS? -- gnu@cygnus.com */ + + if (get_next_frame (fi)) + { + get_frame_saved_regs (fi, &fsr); + if (fsr.regs[G13_REGNUM]) + ap = read_memory_integer (fsr.regs[G13_REGNUM],4); + else + ap = 0; + } + else + ap = read_register (G13_REGNUM); + + return ap; +} + +/* Return address to which the currently executing leafproc will return, + or 0 if ip is not in a leafproc (or if we can't tell if it is). + + Do this by finding the starting address of the routine in which ip lies. + If the instruction there is "mov g14, gx" (where x is in [0,7]), this + is a leafproc and the return address is in register gx. Well, this is + true unless the return address points at a RET instruction in the current + procedure, which indicates that we have a 'dual entry' routine that + has been entered through the CALL entry point. */ + +CORE_ADDR +leafproc_return (ip) + CORE_ADDR ip; /* ip from currently executing function */ +{ + register struct minimal_symbol *msymbol; + char *p; + int dst; + unsigned int insn1, insn2; + CORE_ADDR return_addr; + + if ((msymbol = lookup_minimal_symbol_by_pc (ip)) != NULL) + { + if ((p = strchr(SYMBOL_NAME (msymbol), '.')) && STREQ (p, ".lf")) + { + if (next_insn (SYMBOL_VALUE_ADDRESS (msymbol), &insn1, &insn2) + && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */ + && (dst = REG_SRCDST (insn1)) <= G0_REGNUM + 7) + { + /* Get the return address. If the "mov g14, gx" + instruction hasn't been executed yet, read + the return address from g14; otherwise, read it + from the register into which g14 was moved. */ + + return_addr = + read_register ((ip == SYMBOL_VALUE_ADDRESS (msymbol)) + ? G14_REGNUM : dst); + + /* We know we are in a leaf procedure, but we don't know + whether the caller actually did a "bal" to the ".lf" + entry point, or a normal "call" to the non-leaf entry + point one instruction before. In the latter case, the + return address will be the address of a "ret" + instruction within the procedure itself. We test for + this below. */ + + if (!next_insn (return_addr, &insn1, &insn2) + || (insn1 & 0xff000000) != 0xa000000 /* ret */ + || lookup_minimal_symbol_by_pc (return_addr) != msymbol) + return (return_addr); + } + } + } + + return (0); +} + +/* Immediately after a function call, return the saved pc. + Can't go through the frames for this because on some machines + the new frame is not set up until the new function executes + some instructions. + On the i960, the frame *is* set up immediately after the call, + unless the function is a leaf procedure. */ + +CORE_ADDR +saved_pc_after_call (frame) + struct frame_info *frame; +{ + CORE_ADDR saved_pc; + + saved_pc = leafproc_return (get_frame_pc (frame)); + if (!saved_pc) + saved_pc = FRAME_SAVED_PC (frame); + + return saved_pc; +} + +/* Discard from the stack the innermost frame, + restoring all saved registers. */ + +pop_frame () +{ + register struct frame_info *current_fi, *prev_fi; + register int i; + CORE_ADDR save_addr; + CORE_ADDR leaf_return_addr; + struct frame_saved_regs fsr; + char local_regs_buf[16 * 4]; + + current_fi = get_current_frame (); + + /* First, undo what the hardware does when we return. + If this is a non-leaf procedure, restore local registers from + the save area in the calling frame. Otherwise, load the return + address obtained from leafproc_return () into the rip. */ + + leaf_return_addr = leafproc_return (current_fi->pc); + if (!leaf_return_addr) + { + /* Non-leaf procedure. Restore local registers, incl IP. */ + prev_fi = get_prev_frame (current_fi); + read_memory (prev_fi->frame, local_regs_buf, sizeof (local_regs_buf)); + write_register_bytes (REGISTER_BYTE (R0_REGNUM), local_regs_buf, + sizeof (local_regs_buf)); + + /* Restore frame pointer. */ + write_register (FP_REGNUM, prev_fi->frame); + } + else + { + /* Leaf procedure. Just restore the return address into the IP. */ + write_register (RIP_REGNUM, leaf_return_addr); + } + + /* Now restore any global regs that the current function had saved. */ + get_frame_saved_regs (current_fi, &fsr); + for (i = G0_REGNUM; i < G14_REGNUM; i++) + { + if (save_addr = fsr.regs[i]) + write_register (i, read_memory_integer (save_addr, 4)); + } + + /* Flush the frame cache, create a frame for the new innermost frame, + and make it the current frame. */ + + flush_cached_frames (); +} + +/* Given a 960 stop code (fault or trace), return the signal which + corresponds. */ + +enum target_signal +i960_fault_to_signal (fault) + int fault; +{ + switch (fault) + { + case 0: return TARGET_SIGNAL_BUS; /* parallel fault */ + case 1: return TARGET_SIGNAL_UNKNOWN; + case 2: return TARGET_SIGNAL_ILL; /* operation fault */ + case 3: return TARGET_SIGNAL_FPE; /* arithmetic fault */ + case 4: return TARGET_SIGNAL_FPE; /* floating point fault */ + + /* constraint fault. This appears not to distinguish between + a range constraint fault (which should be SIGFPE) and a privileged + fault (which should be SIGILL). */ + case 5: return TARGET_SIGNAL_ILL; + + case 6: return TARGET_SIGNAL_SEGV; /* virtual memory fault */ + + /* protection fault. This is for an out-of-range argument to + "calls". I guess it also could be SIGILL. */ + case 7: return TARGET_SIGNAL_SEGV; + + case 8: return TARGET_SIGNAL_BUS; /* machine fault */ + case 9: return TARGET_SIGNAL_BUS; /* structural fault */ + case 0xa: return TARGET_SIGNAL_ILL; /* type fault */ + case 0xb: return TARGET_SIGNAL_UNKNOWN; /* reserved fault */ + case 0xc: return TARGET_SIGNAL_BUS; /* process fault */ + case 0xd: return TARGET_SIGNAL_SEGV; /* descriptor fault */ + case 0xe: return TARGET_SIGNAL_BUS; /* event fault */ + case 0xf: return TARGET_SIGNAL_UNKNOWN; /* reserved fault */ + case 0x10: return TARGET_SIGNAL_TRAP; /* single-step trace */ + case 0x11: return TARGET_SIGNAL_TRAP; /* branch trace */ + case 0x12: return TARGET_SIGNAL_TRAP; /* call trace */ + case 0x13: return TARGET_SIGNAL_TRAP; /* return trace */ + case 0x14: return TARGET_SIGNAL_TRAP; /* pre-return trace */ + case 0x15: return TARGET_SIGNAL_TRAP; /* supervisor call trace */ + case 0x16: return TARGET_SIGNAL_TRAP; /* breakpoint trace */ + default: return TARGET_SIGNAL_UNKNOWN; + } +} + +/****************************************/ +/* MEM format */ +/****************************************/ + +struct tabent { + char *name; + char numops; +}; + +static int /* returns instruction length: 4 or 8 */ +mem( memaddr, word1, word2, noprint ) + unsigned long memaddr; + unsigned long word1, word2; + int noprint; /* If TRUE, return instruction length, but + don't output any text. */ +{ + int i, j; + int len; + int mode; + int offset; + const char *reg1, *reg2, *reg3; + + /* This lookup table is too sparse to make it worth typing in, but not + * so large as to make a sparse array necessary. We allocate the + * table at runtime, initialize all entries to empty, and copy the + * real ones in from an initialization table. + * + * NOTE: In this table, the meaning of 'numops' is: + * 1: single operand + * 2: 2 operands, load instruction + * -2: 2 operands, store instruction + */ + static struct tabent *mem_tab = NULL; +/* Opcodes of 0x8X, 9X, aX, bX, and cX must be in the table. */ +#define MEM_MIN 0x80 +#define MEM_MAX 0xcf +#define MEM_SIZ ((MEM_MAX-MEM_MIN+1) * sizeof(struct tabent)) + + static struct { int opcode; char *name; char numops; } mem_init[] = { + 0x80, "ldob", 2, + 0x82, "stob", -2, + 0x84, "bx", 1, + 0x85, "balx", 2, + 0x86, "callx", 1, + 0x88, "ldos", 2, + 0x8a, "stos", -2, + 0x8c, "lda", 2, + 0x90, "ld", 2, + 0x92, "st", -2, + 0x98, "ldl", 2, + 0x9a, "stl", -2, + 0xa0, "ldt", 2, + 0xa2, "stt", -2, + 0xb0, "ldq", 2, + 0xb2, "stq", -2, + 0xc0, "ldib", 2, + 0xc2, "stib", -2, + 0xc8, "ldis", 2, + 0xca, "stis", -2, + 0, NULL, 0 + }; + + if ( mem_tab == NULL ){ + mem_tab = (struct tabent *) xmalloc( MEM_SIZ ); + memset( mem_tab, '\0', MEM_SIZ ); + for ( i = 0; mem_init[i].opcode != 0; i++ ){ + j = mem_init[i].opcode - MEM_MIN; + mem_tab[j].name = mem_init[i].name; + mem_tab[j].numops = mem_init[i].numops; + } + } + + i = ((word1 >> 24) & 0xff) - MEM_MIN; + mode = (word1 >> 10) & 0xf; + + if ( (mem_tab[i].name != NULL) /* Valid instruction */ + && ((mode == 5) || (mode >=12)) ){ /* With 32-bit displacement */ + len = 8; + } else { + len = 4; + } + + if ( noprint ){ + return len; + } + abort (); +} + +/* Read the i960 instruction at 'memaddr' and return the address of + the next instruction after that, or 0 if 'memaddr' is not the + address of a valid instruction. The first word of the instruction + is stored at 'pword1', and the second word, if any, is stored at + 'pword2'. */ + +static CORE_ADDR +next_insn (memaddr, pword1, pword2) + unsigned int *pword1, *pword2; + CORE_ADDR memaddr; +{ + int len; + char buf[8]; + + /* Read the two (potential) words of the instruction at once, + to eliminate the overhead of two calls to read_memory (). + FIXME: Loses if the first one is readable but the second is not + (e.g. last word of the segment). */ + + read_memory (memaddr, buf, 8); + *pword1 = extract_unsigned_integer (buf, 4); + *pword2 = extract_unsigned_integer (buf + 4, 4); + + /* Divide instruction set into classes based on high 4 bits of opcode*/ + + switch ((*pword1 >> 28) & 0xf) + { + case 0x0: + case 0x1: /* ctrl */ + + case 0x2: + case 0x3: /* cobr */ + + case 0x5: + case 0x6: + case 0x7: /* reg */ + len = 4; + break; + + case 0x8: + case 0x9: + case 0xa: + case 0xb: + case 0xc: + len = mem (memaddr, *pword1, *pword2, 1); + break; + + default: /* invalid instruction */ + len = 0; + break; + } + + if (len) + return memaddr + len; + else + return 0; +} + +/* 'start_frame' is a variable in the MON960 runtime startup routine + that contains the frame pointer of the 'start' routine (the routine + that calls 'main'). By reading its contents out of remote memory, + we can tell where the frame chain ends: backtraces should halt before + they display this frame. */ + +int +mon960_frame_chain_valid (chain, curframe) + unsigned int chain; + struct frame_info *curframe; +{ + struct symbol *sym; + struct minimal_symbol *msymbol; + + /* crtmon960.o is an assembler module that is assumed to be linked + * first in an i80960 executable. It contains the true entry point; + * it performs startup up initialization and then calls 'main'. + * + * 'sf' is the name of a variable in crtmon960.o that is set + * during startup to the address of the first frame. + * + * 'a' is the address of that variable in 80960 memory. + */ + static char sf[] = "start_frame"; + CORE_ADDR a; + + + chain &= ~0x3f; /* Zero low 6 bits because previous frame pointers + contain return status info in them. */ + if ( chain == 0 ){ + return 0; + } + + sym = lookup_symbol(sf, 0, VAR_NAMESPACE, (int *)NULL, + (struct symtab **)NULL); + if ( sym != 0 ){ + a = SYMBOL_VALUE (sym); + } else { + msymbol = lookup_minimal_symbol (sf, NULL, NULL); + if (msymbol == NULL) + return 0; + a = SYMBOL_VALUE_ADDRESS (msymbol); + } + + return ( chain != read_memory_integer(a,4) ); +} + +void +_initialize_i960_tdep () +{ + check_host (); + + tm_print_insn = print_insn_i960; +} diff --git a/contrib/gdb/gdb/mac-defs.h b/contrib/gdb/gdb/mac-defs.h new file mode 100644 index 0000000000000..82f7e71a33829 --- /dev/null +++ b/contrib/gdb/gdb/mac-defs.h @@ -0,0 +1,34 @@ +/* Definitions shared between C and Rez files. */ + +#define mbMain 128 + +#define mApple 128 + +#define miAbout 1 + +#define mFile 129 + +#define miFileNew 1 +#define miFileOpen 2 +/* 3 */ +#define miFileQuit 4 + +#define mEdit 130 + +#define miEditCut 1 +#define miEditCopy 2 +#define miEditPaste 3 +#define miEditClear 4 + +#define mDebug 131 + +#define miDebugTarget 1 +/* 2 */ +#define miDebugRun 3 +#define miDebugContinue 4 +#define miDebugStep 5 +#define miDebugNext 6 + +#define wConsole 128 + + diff --git a/contrib/gdb/gdb/mac-gdb.r b/contrib/gdb/gdb/mac-gdb.r new file mode 100644 index 0000000000000..3736ddef9443f --- /dev/null +++ b/contrib/gdb/gdb/mac-gdb.r @@ -0,0 +1,184 @@ +/* Resource file for MacGDB. */ + +#include "SysTypes.r" +#include "Types.r" + +#include "mac-defs.h" + +/* Version resources. */ + +resource 'vers' (1) { + 0, + 0, + 0, + 0, + verUS, + VERSION_STRING, + VERSION_STRING " (C) 1986-95 FSF, Inc." +}; + +resource 'vers' (2, purgeable) { + 0, + 0, + 0, + 0, + verUs, + VERSION_STRING, + "GDB " VERSION_STRING " for MPW" +}; + +#ifdef WANT_CFRG + +#include "CodeFragmentTypes.r" + +resource 'cfrg' (0) { + { + kPowerPC, + kFullLib, + kNoVersionNum, kNoVersionNum, + 0, 0, + kIsApp, kOnDiskFlat, kZeroOffset, kWholeFork, + PROG_NAME + } +}; + +#endif /* WANT_CFRG */ + +#ifdef Macgdb /* Exclude the following from SIOWgdb which uses SIOW.r. */ + +resource 'MBAR' (128) { + { mApple, mFile, mEdit, mDebug }; +}; + +resource 'MENU' (mApple, preload) { + mApple, + textMenuProc, + 0x7FFFFFFD, + enabled, + apple, + { + "About...", noIcon, noKey, noMark, plain, + "-", noIcon, noKey, noMark, plain + } +}; + +resource 'MENU' (mFile, preload) { + mFile, + textMenuProc, + allEnabled, + enabled, + "File", + { + "New", noIcon, noKey, noMark, plain, + "Open...", noIcon, "O", noMark, plain, + "-", noIcon, noKey, noMark, plain, + "Quit", noIcon, "Q", noMark, plain + } +}; + +resource 'MENU' (mEdit, preload) { + mEdit, + textMenuProc, + allEnabled, + enabled, + "Edit", + { + "Undo", noIcon, "Z", noMark, plain, + "-", noIcon, noKey, noMark, plain, + "Cut", noIcon, "X", noMark, plain, + "Copy", noIcon, "C", noMark, plain, + "Paste", noIcon, "V", noMark, plain, + "Clear", noIcon, noKey, noMark, plain + } +}; + +resource 'MENU' (mDebug, preload) { + mDebug, + textMenuProc, + allEnabled, + enabled, + "Debug", + { + "Target", noIcon, "T", noMark, plain, + "-", noIcon, noKey, noMark, plain, + "Run", noIcon, "R", noMark, plain, + "Continue", noIcon, "K", noMark, plain, + "Step", noIcon, "S", noMark, plain, + "Next", noIcon, "N", noMark, plain + } +}; + +resource 'ALRT' (128) { + {40, 40, 180, 420}, + 128, + { /* array: 4 elements */ + /* [1] */ + OK, visible, sound1, + /* [2] */ + OK, visible, sound1, + /* [3] */ + OK, visible, sound1, + /* [4] */ + OK, visible, sound1 + } +}; + +resource 'DITL' (128) { + { /* array DITLarray: 2 elements */ + /* [1] */ + {110, 150, 128, 200}, + Button { + enabled, + "OK" + }, + /* [2] */ + {10, 10, 100, 370}, + StaticText { + disabled, + "GDB 4.12.3\n" + "Copyright © 1994 Free Software Foundation, Inc.\n" + }, + } +}; + +resource 'WIND' (wConsole, preload, purgeable) { + {40, 40, 310, 572}, + zoomDocProc, + visible, + goAway, + 0x0, + "GDB Console" +}; + +resource 'SIZE' (-1) { + reserved, + acceptSuspendResumeEvents, + reserved, + canBackground, + multiFinderAware, + backgroundAndForeground, + dontGetFrontClicks, + ignoreChildDiedEvents, + not32BitCompatible, + isHighLevelEventAware, + localAndRemoteHLEvents, + notStationeryAware, + dontUseTextEditServices, + reserved, + reserved, + reserved, + 5000*1024, + 2000*1024 +}; + +resource 'DLOG' (128) { + {40, 40, 240, 280}, + documentProc, + visible, + goAway, + 0x0, + 128, + "" +}; + +#endif diff --git a/contrib/gdb/gdb/mac-nat.c b/contrib/gdb/gdb/mac-nat.c new file mode 100644 index 0000000000000..bdf6c6df2c40c --- /dev/null +++ b/contrib/gdb/gdb/mac-nat.c @@ -0,0 +1,384 @@ +/* Target-vector operations for controlling Mac applications, for GDB. + Copyright (C) 1995 Free Software Foundation, Inc. + Written by Stan Shebs. Contributed by Cygnus Support. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without eve nthe implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Note that because all the available Mac compilers are ANSI or very + close, and this is a native-only file, the code may be purely ANSI. */ + +#include "defs.h" +#include "frame.h" /* required by inferior.h */ +#include "inferior.h" +#include "target.h" +#include "wait.h" +#include "gdbcore.h" +#include "command.h" +#include <signal.h> +#include <sys/types.h> +#include <fcntl.h> +#include "buildsym.h" +#include "gdb_string.h" +#include "thread.h" +#include "gdbcmd.h" + +#include <Processes.h> + +/* We call the functions "child_..." rather than "mac_..." so no one + is tempted to try to link this with other native-only code. */ + +/* Forward declaration */ + +extern struct target_ops child_ops; + +static void +child_fetch_inferior_registers (int r) +{ + if (r < 0) + { + for (r = 0; r < NUM_REGS; r++) + child_fetch_inferior_registers (r); + } + else + { + supply_register (r, 0); + } +} + +static void +child_store_inferior_registers (int r) +{ + if (r < 0) + { + for (r = 0; r < NUM_REGS; r++) + child_store_inferior_registers (r); + } + else + { + read_register_gen (r, 0); + } +} + +static int +child_wait (int pid, struct target_waitstatus *ourstatus) +{ +} + +/* Attach to process PID, then initialize for debugging it. */ + +static void +child_attach (args, from_tty) + char *args; + int from_tty; +{ + ProcessSerialNumber psn; + ProcessInfoRec inforec; + Str31 name; + FSSpecPtr fsspec; + OSType code; + int pid; + char *exec_file; + + if (!args) + error_no_arg ("process-id to attach"); + + pid = atoi (args); + + psn.highLongOfPSN = 0; + psn.lowLongOfPSN = pid; + + inforec.processInfoLength = sizeof(ProcessInfoRec); + inforec.processName = name; + inforec.processAppSpec = fsspec; + + if (GetProcessInformation (&psn, &inforec) == noErr) + { + if (from_tty) + { + exec_file = (char *) get_exec_file (0); + + if (exec_file) + printf_unfiltered ("Attaching to program `%s', %s\n", exec_file, + target_pid_to_str (pid)); + else + printf_unfiltered ("Attaching to %s\n", target_pid_to_str (pid)); + + gdb_flush (gdb_stdout); + } + /* Do we need to do anything special? */ + attach_flag = 1; + inferior_pid = pid; + push_target (&child_ops); + } +} + +static void +child_detach (args, from_tty) + char *args; + int from_tty; +{ + char *exec_file; + + if (from_tty) + { + exec_file = get_exec_file (0); + if (exec_file == 0) + exec_file = ""; + printf_unfiltered ("Detaching from program: %s %s\n", exec_file, + target_pid_to_str (inferior_pid)); + gdb_flush (gdb_stdout); + } + inferior_pid = 0; + unpush_target (&child_ops); +} + +/* Print status information about what we're accessing. */ + +static void +child_files_info (ignore) + struct target_ops *ignore; +{ + printf_unfiltered ("\tUsing the running image of %s %s.\n", + attach_flag ? "attached" : "child", target_pid_to_str (inferior_pid)); +} + +/* ARGSUSED */ +static void +child_open (arg, from_tty) + char *arg; + int from_tty; +{ + error ("Use the \"run\" command to start a Mac application."); +} + +/* Start an inferior Mac program and sets inferior_pid to its pid. + EXEC_FILE is the file to run. + ALLARGS is a string containing the arguments to the program. + ENV is the environment vector to pass. Errors reported with error(). */ + +static void +child_create_inferior (exec_file, allargs, env) + char *exec_file; + char *allargs; + char **env; +{ + LaunchParamBlockRec launchparms; + FSSpec fsspec; + OSErr launch_err; + + if (!exec_file) + { + error ("No executable specified, use `target exec'.\n"); + } + + launchparms.launchBlockID = extendedBlock; + launchparms.launchEPBLength = extendedBlockLen; + launchparms.launchFileFlags = 0; + launchparms.launchControlFlags = launchContinue | launchNoFileFlags; + fsspec.vRefNum = 0; + fsspec.parID = 0; + strcpy(fsspec.name + 1, exec_file); + fsspec.name[0] = strlen(exec_file); + launchparms.launchAppSpec = &fsspec; + launchparms.launchAppParameters = nil; + + launch_err = LaunchApplication (&launchparms); + + if (launch_err == 999 /*memFullErr*/) + { + error ("Not enough memory to launch %s\n", exec_file); + } + else if (launch_err != noErr) + { + error ("Error launching %s, code %d\n", exec_file, launch_err); + } + + inferior_pid = launchparms.launchProcessSN.lowLongOfPSN; + /* FIXME be sure that high long of PSN is 0 */ + + push_target (&child_ops); + init_wait_for_inferior (); + clear_proceed_status (); + +/* proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0); */ +} + +static void +child_mourn_inferior () +{ + unpush_target (&child_ops); + generic_mourn_inferior (); +} + +void +child_stop () +{ +} + +int +child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, + int write, struct target_ops *target) +{ + int i; + + for (i = 0; i < len; ++i) + { + if (write) + { + ((char *) memaddr)[i] = myaddr[i]; + } + else + { + myaddr[i] = ((char *) memaddr)[i]; + } + } + return len; +} + +void +child_kill_inferior (void) +{ +} + +void +child_resume (int pid, int step, enum target_signal signal) +{ +} + +static void +child_prepare_to_store () +{ + /* Do nothing, since we can store individual regs */ +} + +static int +child_can_run () +{ + return 1; +} + +static void +child_close () +{ +} + +static void +info_proc (args, from_tty) + char *args; + int from_tty; +{ + ProcessSerialNumber psn; + ProcessInfoRec inforec; + Str31 name; + FSSpecPtr fsspec; + OSType code; + + /* Eventually use args, but not right now. */ + + psn.highLongOfPSN = 0; + psn.lowLongOfPSN = kNoProcess; + + inforec.processInfoLength = sizeof(ProcessInfoRec); + inforec.processName = name; + inforec.processAppSpec = fsspec; + + printf_filtered ("Process Name Sgnt Type PSN Loc Size FreeMem Time\n"); + + while (GetNextProcess (&psn) == noErr) + { + if (GetProcessInformation (&psn, &inforec) == noErr) + { + name[name[0] + 1] = '\0'; + printf_filtered ("%-32.32s", name + 1); + code = inforec.processSignature; + printf_filtered (" %c%c%c%c", + (code >> 24) & 0xff, + (code >> 16) & 0xff, + (code >> 8) & 0xff, + (code >> 0) & 0xff); + code = inforec.processType; + printf_filtered (" %c%c%c%c", + (code >> 24) & 0xff, + (code >> 16) & 0xff, + (code >> 8) & 0xff, + (code >> 0) & 0xff); + if (psn.highLongOfPSN == 0) + printf_filtered (" %9d", psn.lowLongOfPSN); + else + printf_filtered (" %9d,%9d\n", + psn.highLongOfPSN, psn.lowLongOfPSN); + printf_filtered (" 0x%x", inforec.processLocation); + printf_filtered (" %9d", inforec.processSize); + printf_filtered (" %9d", inforec.processFreeMem); + printf_filtered (" %9d", inforec.processActiveTime); + printf_filtered ("\n"); + } + } +} + +struct target_ops child_ops = +{ + "mac", /* to_shortname */ + "MacOS application", /* to_longname */ + "MacOS application (started by the \"run\" command).", /* to_doc */ + child_open, /* to_open */ + child_close, /* to_close */ + child_attach, /* to_attach */ + child_detach, /* to_detach */ + child_resume, /* to_resume */ + child_wait, /* to_wait */ + child_fetch_inferior_registers,/* to_fetch_registers */ + child_store_inferior_registers,/* to_store_registers */ + child_prepare_to_store, /* to_prepare_to_store */ + child_xfer_memory, /* to_xfer_memory */ + child_files_info, /* to_files_info */ + memory_insert_breakpoint, /* to_insert_breakpoint */ + memory_remove_breakpoint, /* to_remove_breakpoint */ + 0, /* to_terminal_init */ + 0, /* to_terminal_inferior */ + 0, /* to_terminal_ours_for_output */ + 0, /* to_terminal_ours */ + 0, /* to_terminal_info */ + child_kill_inferior, /* to_kill */ + 0, /* to_load */ + 0, /* to_lookup_symbol */ + child_create_inferior, /* to_create_inferior */ + child_mourn_inferior, /* to_mourn_inferior */ + child_can_run, /* to_can_run */ + 0, /* to_notice_signals */ + 0, /* to_thread_alive */ + child_stop, /* to_stop */ + process_stratum, /* to_stratum */ + 0, /* to_next */ + 1, /* to_has_all_memory */ + 1, /* to_has_memory */ + 1, /* to_has_stack */ + 1, /* to_has_registers */ + 1, /* to_has_execution */ + 0, /* to_sections */ + 0, /* to_sections_end */ + OPS_MAGIC /* to_magic */ +}; + +void +_initialize_mac_nat () +{ + add_target (&child_ops); + + add_info ("proc", info_proc, + "Show information about processes."); +} diff --git a/contrib/gdb/gdb/mac-xdep.c b/contrib/gdb/gdb/mac-xdep.c new file mode 100644 index 0000000000000..20a79a53c88a5 --- /dev/null +++ b/contrib/gdb/gdb/mac-xdep.c @@ -0,0 +1,1087 @@ +/* Top level support for Mac interface to GDB, the GNU debugger. + Copyright 1994 Free Software Foundation, Inc. + Contributed by Cygnus Support. Written by Stan Shebs. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" + +#include "readline.h" +#include "history.h" + +#include <Types.h> +#include <Resources.h> +#include <QuickDraw.h> +#include <Fonts.h> +#include <Events.h> +#include <Windows.h> +#include <Menus.h> +#include <TextEdit.h> +#include <Dialogs.h> +#include <Desk.h> +#include <ToolUtils.h> +#include <Memory.h> +#include <SegLoad.h> +#include <Files.h> +#include <Folders.h> +#include <OSUtils.h> +#include <OSEvents.h> +#include <DiskInit.h> +#include <Packages.h> +#include <Traps.h> +#include <Lists.h> +#include <Gestalt.h> +#include <PPCToolbox.h> +#include <AppleEvents.h> +#include <StandardFile.h> +#include <Sound.h> + +#ifdef MPW +#define QD(whatever) (qd.##whatever) +#define QDPat(whatever) (&(qd.##whatever)) +#endif /* MPW */ + +#ifdef THINK_C +#define QD(whatever) (whatever) +#endif + +#define p2c(pstr,cbuf) \ + strncpy(cbuf, ((char *) (pstr) + 1), pstr[0]); \ + cbuf[pstr[0]] = '\0'; + +#define pascalify(STR) \ + sprintf(tmpbuf, " %s", STR); \ + tmpbuf[0] = strlen(STR); + +#include "gdbcmd.h" +#include "call-cmds.h" +#include "symtab.h" +#include "inferior.h" +#include "signals.h" +#include "target.h" +#include "breakpoint.h" +#include "gdbtypes.h" +#include "expression.h" +#include "language.h" + +#include "mac-defs.h" + +int debug_openp = 0; + +/* This is true if we are running as a standalone application. */ + +int mac_app; + +/* This is true if we are using WaitNextEvent. */ + +int use_wne; + +/* This is true if we have Color Quickdraw. */ + +int has_color_qd; + +/* This is true if we are using Color Quickdraw. */ + +int use_color_qd; + +int inbackground; + +Rect dragrect = { -32000, -32000, 32000, 32000 }; +Rect sizerect; + +int sbarwid = 15; + +/* Globals for the console window. */ + +WindowPtr console_window; + +ControlHandle console_v_scrollbar; + +Rect console_v_scroll_rect; + +TEHandle console_text; + +Rect console_text_rect; + +/* This will go away eventually. */ +gdb_has_a_terminal () { return 1; } + +mac_init () +{ + SysEnvRec se; + int eventloopdone = 0; + char *str; + Boolean gotevent; + Point mouse; + EventRecord event; + WindowPtr win; + RgnHandle cursorRgn; + int i; + Handle menubar; + MenuHandle menu; + Handle siow_resource; + + mac_app = 0; + + str = getenv("DEBUG_GDB"); + if (str != NULL && str[0] != '\0') + { + if (strcmp(str, "openp") == 0) + debug_openp = 1; + } + + /* Don't do anything if we`re running under MPW. */ + if (!StandAlone) + return; + + /* Don't do anything if we're using SIOW. */ + /* This test requires that the siow 0 resource, as defined in + {RIncludes}siow.r, not be messed with. If it is, then the + standard Mac setup below will step on SIOW's Mac setup and + most likely crash the machine. */ + siow_resource = GetResource('siow', 0); + if (siow_resource != nil) + return; + + mac_app = 1; + + /* Do the standard Mac environment setup. */ + InitGraf (&QD (thePort)); + InitFonts (); + FlushEvents (everyEvent, 0); + InitWindows (); + InitMenus (); + TEInit (); + InitDialogs (NULL); + InitCursor (); + + /* Color Quickdraw is different from Classic QD. */ + SysEnvirons(2, &se); + has_color_qd = se.hasColorQD; + /* Use it if we got it. */ + use_color_qd = has_color_qd; + + sizerect.top = 50; + sizerect.left = 50; + sizerect.bottom = 1000; + sizerect.right = 1000; +#if 0 + sizerect.bottom = screenBits.bounds.bottom - screenBits.bounds.top; + sizerect.right = screenBits.bounds.right - screenBits.bounds.left; +#endif + + /* Set up the menus. */ + menubar = GetNewMBar (mbMain); + SetMenuBar (menubar); + /* Add the DAs etc as usual. */ + menu = GetMHandle (mApple); + if (menu != nil) { + AddResMenu (menu, 'DRVR'); + } + DrawMenuBar (); + + new_console_window (); +} + +new_console_window () +{ + /* Create the main window we're going to play in. */ + if (has_color_qd) + console_window = GetNewCWindow (wConsole, NULL, (WindowPtr) -1L); + else + console_window = GetNewWindow (wConsole, NULL, (WindowPtr) -1L); + + SetPort (console_window); + console_text_rect = console_window->portRect; + /* Leave 8 pixels of blank space, for aesthetic reasons and to + make it easier to select from the beginning of a line. */ + console_text_rect.left += 8; + console_text_rect.bottom -= sbarwid - 1; + console_text_rect.right -= sbarwid - 1; + console_text = TENew (&console_text_rect, &console_text_rect); + TESetSelect (0, 40000, console_text); + TEDelete (console_text); + TEAutoView (1, console_text); + + console_v_scroll_rect = console_window->portRect; + console_v_scroll_rect.bottom -= sbarwid - 1; + console_v_scroll_rect.left = console_v_scroll_rect.right - sbarwid; + console_v_scrollbar = + NewControl (console_window, &console_v_scroll_rect, + "\p", 1, 0, 0, 0, scrollBarProc, 0L); + + ShowWindow (console_window); + SelectWindow (console_window); +} + +mac_command_loop() +{ + SysEnvRec se; + int eventloopdone = 0; + Boolean gotevent; + Point mouse; + EventRecord event; + WindowPtr win; + RgnHandle cursorRgn; + int i, tm; + Handle menubar; + MenuHandle menu; + + /* Figure out if the WaitNextEvent Trap is available. */ + use_wne = + (NGetTrapAddress (0x60, ToolTrap) != NGetTrapAddress (0x9f, ToolTrap)); + /* Pass WaitNextEvent an empty region the first time through. */ + cursorRgn = NewRgn (); + /* Go into the main event-handling loop. */ + while (!eventloopdone) + { + /* Use WaitNextEvent if it is available, otherwise GetNextEvent. */ + if (use_wne) + { + get_global_mouse (&mouse); + adjust_cursor (mouse, cursorRgn); + tm = GetCaretTime(); + gotevent = WaitNextEvent (everyEvent, &event, tm, cursorRgn); + } + else + { + SystemTask (); + gotevent = GetNextEvent (everyEvent, &event); + } + /* First decide if the event is for a dialog or is just any old event. */ + if (FrontWindow () != nil && IsDialogEvent (&event)) + { + short itemhit; + DialogPtr dialog; + + /* Handle all the modeless dialogs here. */ + if (DialogSelect (&event, &dialog, &itemhit)) + { + } + } + else if (gotevent) + { + /* Make sure we have the right cursor before handling the event. */ + adjust_cursor (event.where, cursorRgn); + do_event (&event); + } + else + { + do_idle (); + } + } +} + +/* Collect the global coordinates of the mouse pointer. */ + +get_global_mouse (mouse) +Point *mouse; +{ + EventRecord evt; + + OSEventAvail (0, &evt); + *mouse = evt.where; +} + +/* Change the cursor's appearance to be appropriate for the given mouse + location. */ + +adjust_cursor (mouse, region) +Point mouse; +RgnHandle region; +{ +} + +/* Decipher an event, maybe do something with it. */ + +do_event (evt) +EventRecord *evt; +{ + short part, err, rslt = 0; + WindowPtr win; + Boolean hit; + char key; + Point pnt; + + switch (evt->what) + { + case mouseDown: + /* See if the click happened in a special part of the screen. */ + part = FindWindow (evt->where, &win); + switch (part) + { + case inMenuBar: + adjust_menus (); + do_menu_command (MenuSelect (evt->where)); + break; + case inSysWindow: + SystemClick (evt, win); + break; + case inContent: + if (win != FrontWindow ()) + { + /* Bring the clicked-on window to the front. */ + SelectWindow (win); + /* Fix the menu to match the new front window. */ + adjust_menus (); + /* We always want to discard the event now, since clicks in a + windows are often irreversible actions. */ + } else + /* Mouse clicks in the front window do something useful. */ + do_mouse_down (win, evt); + break; + case inDrag: + /* Standard drag behavior, no tricks necessary. */ + DragWindow (win, evt->where, &dragrect); + break; + case inGrow: + grow_window (win, evt->where); + break; + case inZoomIn: + case inZoomOut: + zoom_window (win, evt->where, part); + break; + case inGoAway: + close_window (win); + break; + } + break; + case keyDown: + case autoKey: + key = evt->message & charCodeMask; + /* Check for menukey equivalents. */ + if (evt->modifiers & cmdKey) + { + if (evt->what == keyDown) + { + adjust_menus (); + do_menu_command (MenuKey (key)); + } + } + else + { + if (evt->what == keyDown) + { + /* Random keypress, interpret it. */ + do_keyboard_command (key); + } + } + break; + case activateEvt: + activate_window ((WindowPtr) evt->message, evt->modifiers & activeFlag); + break; + case updateEvt: + update_window ((WindowPtr) evt->message); + break; + case diskEvt: + /* Call DIBadMount in response to a diskEvt, so that the user can format + a floppy. (from DTS Sample) */ + if (HiWord (evt->message) != noErr) + { + SetPt (&pnt, 50, 50); + err = DIBadMount (pnt, evt->message); + } + break; + case app4Evt: + /* Grab only a single byte. */ + switch ((evt->message >> 24) & 0xFF) + { + case 0xfa: + break; + case 1: + inbackground = !(evt->message & 1); + activate_window (FrontWindow (), !inbackground); + break; + } + break; + case kHighLevelEvent: + AEProcessAppleEvent (evt); + break; + case nullEvent: + do_idle (); + rslt = 1; + break; + default: + break; + } + return rslt; +} + +/* Do any idle-time activities. */ + +do_idle () +{ + TEIdle (console_text); +} + +grow_window (win, where) +WindowPtr win; +Point where; +{ + long winsize; + int h, v; + GrafPtr oldport; + + winsize = GrowWindow (win, where, &sizerect); + /* Only do anything if it actually changed size. */ + if (winsize != 0) + { + GetPort (&oldport); + SetPort (win); + if (win == console_window) + { + EraseRect (&win->portRect); + h = LoWord (winsize); + v = HiWord (winsize); + SizeWindow (win, h, v, 1); + resize_console_window (); + } + SetPort (oldport); + } +} + +zoom_window (win, where, part) +WindowPtr win; +Point where; +short part; +{ + ZoomWindow (win, part, (win == FrontWindow ())); + if (win == console_window) + { + resize_console_window (); + } +} + +resize_console_window () +{ + adjust_console_sizes (); + adjust_console_scrollbars (); + adjust_console_text (); + InvalRect (&console_window->portRect); +} + +close_window (win) +WindowPtr win; +{ +} + +pascal void +v_scroll_proc (ControlHandle control, short part) +{ + int oldval, amount = 0, newval; + int pagesize = ((*console_text)->viewRect.bottom - (*console_text)->viewRect.top) / (*console_text)->lineHeight; + if (part) + { + oldval = GetCtlValue (control); + switch (part) + { + case inUpButton: + amount = 1; + break; + case inDownButton: + amount = -1; + break; + case inPageUp: + amount = pagesize; + break; + case inPageDown: + amount = - pagesize; + break; + default: + /* (should freak out) */ + break; + } + SetCtlValue(control, oldval - amount); + newval = GetCtlValue (control); + amount = oldval - newval; + if (amount) + TEScroll (0, amount * (*console_text)->lineHeight, console_text); + } +} + +do_mouse_down (WindowPtr win, EventRecord *event) +{ + short part, value; + Point mouse; + ControlHandle control; + + if (1 /*is_app_window(win)*/) + { + SetPort (win); + mouse = event->where; + GlobalToLocal (&mouse); + part = FindControl(mouse, win, &control); + if (control == console_v_scrollbar) + { + switch (part) + { + case inThumb: + value = GetCtlValue (control); + part = TrackControl (control, mouse, nil); + if (part) + { + value -= GetCtlValue (control); + if (value) + TEScroll(0, value * (*console_text)->lineHeight, + console_text); + } + break; + default: +#if 0 /* don't deal with right now */ +#if 1 /* universal headers */ + value = TrackControl (control, mouse, (ControlActionUPP) v_scroll_proc); +#else + value = TrackControl (control, mouse, (ProcPtr) v_scroll_proc); +#endif +#endif + break; + } + } + else + { + TEClick (mouse, 0, console_text); + } + } +} + +scroll_text (hlines, vlines) +int hlines, vlines; +{ +} + +activate_window (win, activate) +WindowPtr win; +int activate; +{ + Rect grow_rect; + + if (win == nil) return; + /* It's convenient to make the activated window also be the + current GrafPort. */ + if (activate) + SetPort(win); + /* Activate the console window's scrollbar. */ + if (win == console_window) + { + if (activate) + { + TEActivate (console_text); + /* Cause the grow icon to be redrawn at the next update. */ + grow_rect = console_window->portRect; + grow_rect.top = grow_rect.bottom - sbarwid; + grow_rect.left = grow_rect.right - sbarwid; + InvalRect (&grow_rect); + } + else + { + TEDeactivate (console_text); + DrawGrowIcon (console_window); + } + HiliteControl (console_v_scrollbar, (activate ? 0 : 255)); + } +} + +update_window (win) +WindowPtr win; +{ + int controls = 1, growbox = 0; + GrafPtr oldport; + + /* Set the updating window to be the current grafport. */ + GetPort (&oldport); + SetPort (win); +/* recalc_depths(); */ + BeginUpdate (win); + if (win == console_window) + { + draw_console (); + controls = 1; + growbox = 1; + } + if (controls) + UpdateControls (win, win->visRgn); + if (growbox) + DrawGrowIcon (win); + EndUpdate (win); + SetPort (oldport); +} + +adjust_menus () +{ +} + +do_menu_command (which) +long which; +{ + short menuid, menuitem; + short itemHit; + Str255 daname; + short daRefNum; + Boolean handledbyda; + WindowPtr win; + short ditem; + int i; + char cmdbuf[300]; + + cmdbuf[0] = '\0'; + menuid = HiWord (which); + menuitem = LoWord (which); + switch (menuid) + { + case mApple: + switch (menuitem) + { + case miAbout: + Alert (128, nil); + break; +#if 0 + case miHelp: + /* (should pop up help info) */ + break; +#endif + default: + GetItem (GetMHandle (mApple), menuitem, daname); + daRefNum = OpenDeskAcc (daname); + } + break; + case mFile: + switch (menuitem) + { + case miFileNew: + if (console_window == FrontWindow ()) + { + close_window (console_window); + } + new_console_window (); + break; + case miFileOpen: + SysBeep (20); + break; + case miFileQuit: + ExitToShell (); + break; + } + break; + case mEdit: + /* handledbyda = SystemEdit(menuitem-1); */ + switch (menuitem) + { + case miEditCut: + TECut (console_text); + break; + case miEditCopy: + TECopy (console_text); + break; + case miEditPaste: + TEPaste (console_text); + break; + case miEditClear: + TEDelete (console_text); + break; + } + /* All of these operations need the same postprocessing. */ + adjust_console_sizes (); + adjust_console_scrollbars (); + adjust_console_text (); + break; + case mDebug: + switch (menuitem) + { + case miDebugTarget: + sprintf (cmdbuf, "target %s", "remote"); + break; + case miDebugRun: + sprintf (cmdbuf, "run"); + break; + case miDebugContinue: + sprintf (cmdbuf, "continue"); + break; + case miDebugStep: + sprintf (cmdbuf, "step"); + break; + case miDebugNext: + sprintf (cmdbuf, "next"); + break; + } + break; + } + HiliteMenu (0); + /* Execute a command if one had been given. Do here because a command + may longjmp before we get a chance to unhilite the menu. */ + if (strlen (cmdbuf) > 0) + execute_command (cmdbuf, 0); +} + +char commandbuf[1000]; + +do_keyboard_command (key) +int key; +{ + int startpos, endpos, i, len; + char *last_newline; + char buf[10], *text_str, *command, *cmd_start; + CharsHandle text; + + if (key == '\015' || key == '\003') + { + text = TEGetText (console_text); + HLock ((Handle) text); + text_str = *text; + startpos = (*console_text)->selStart; + endpos = (*console_text)->selEnd; + if (startpos != endpos) + { + len = endpos - startpos; + cmd_start = text_str + startpos; + } + else + { + for (i = startpos - 1; i >= 0; --i) + if (text_str[i] == '\015') + break; + last_newline = text_str + i; + len = (text_str + startpos) - 1 - last_newline; + cmd_start = last_newline + 1; + } + if (len > 1000) len = 999; + if (len < 0) len = 0; + strncpy (commandbuf + 1, cmd_start, len); + commandbuf[1 + len] = 0; + command = commandbuf + 1; + HUnlock ((Handle) text); + commandbuf[0] = strlen(command); + + /* Insert a newline and recalculate before doing any command. */ + key = '\015'; + TEKey (key, console_text); + TEInsert (buf, 1, console_text); + adjust_console_sizes (); + adjust_console_scrollbars (); + adjust_console_text (); + + if (strlen (command) > 0) + { + execute_command (command, 0); + bpstat_do_actions (&stop_bpstat); + } + } + else + { + /* A self-inserting character. This includes delete. */ + TEKey (key, console_text); + } +} + +/* Draw all graphical stuff in the console window. */ + +draw_console () +{ + SetPort (console_window); + TEUpdate (&(console_window->portRect), console_text); +} + +/* Cause an update of a given window's entire contents. */ + +force_update (win) +WindowPtr win; +{ + GrafPtr oldport; + + if (win == nil) return; + GetPort (&oldport); + SetPort (win); + EraseRect (&win->portRect); + InvalRect (&win->portRect); + SetPort (oldport); +} + +adjust_console_sizes () +{ + Rect tmprect; + + tmprect = console_window->portRect; + /* Move and size the scrollbar. */ + MoveControl (console_v_scrollbar, tmprect.right - sbarwid, 0); + SizeControl (console_v_scrollbar, sbarwid + 1, tmprect.bottom - sbarwid + 1); + /* Move and size the text. */ + tmprect.left += 7; + tmprect.right -= sbarwid; + tmprect.bottom -= sbarwid; + InsetRect(&tmprect, 1, 1); + (*console_text)->destRect = tmprect; + /* Fiddle bottom of viewrect to be even multiple of text lines. */ + tmprect.bottom = tmprect.top + + ((tmprect.bottom - tmprect.top) / (*console_text)->lineHeight) + * (*console_text)->lineHeight; + (*console_text)->viewRect = tmprect; +} + +adjust_console_scrollbars () +{ + int lines, newmax, value; + + (*console_v_scrollbar)->contrlVis = 0; + lines = (*console_text)->nLines; + newmax = lines - (((*console_text)->viewRect.bottom + - (*console_text)->viewRect.top) + / (*console_text)->lineHeight); + if (newmax < 0) newmax = 0; + SetCtlMax (console_v_scrollbar, newmax); + value = ((*console_text)->viewRect.top - (*console_text)->destRect.top) + / (*console_text)->lineHeight; + SetCtlValue (console_v_scrollbar, value); + (*console_v_scrollbar)->contrlVis = 0xff; + ShowControl (console_v_scrollbar); +} + +/* Scroll the TE record so that it is consistent with the scrollbar(s). */ + +adjust_console_text () +{ + TEScroll (((*console_text)->viewRect.left + - (*console_text)->destRect.left) + - 0 /* get h scroll value */, + ((((*console_text)->viewRect.top - (*console_text)->destRect.top) + / (*console_text)->lineHeight) + - GetCtlValue (console_v_scrollbar)) + * (*console_text)->lineHeight, + console_text); +} + +/* Readline substitute. */ + +char * +readline (char *prrompt) +{ + return gdb_readline (prrompt); +} + +char *rl_completer_word_break_characters; + +char *rl_completer_quote_characters; + +int (*rl_completion_entry_function) (); + +int rl_point; + +char *rl_line_buffer; + +char *rl_readline_name; + +/* History substitute. */ + +void +add_history (char *buf) +{ +} + +void +stifle_history (int n) +{ +} + +int +unstifle_history () +{ +} + +int +read_history (char *name) +{ +} + +int +write_history (char *name) +{ +} + +int +history_expand (char *x, char **y) +{ +} + +extern HIST_ENTRY * +history_get (int xxx) +{ + return NULL; +} + +int history_base; + +char * +filename_completion_function (char *text, char *name) +{ + return "?"; +} + +char * +tilde_expand (char *str) +{ + return strsave (str); +} + +/* Modified versions of standard I/O. */ + +#undef fprintf + +int +hacked_fprintf (FILE *fp, const char *fmt, ...) +{ + int ret; + va_list ap; + + va_start (ap, fmt); + if (mac_app && (fp == stdout || fp == stderr)) + { + char buf[1000]; + + ret = vsprintf(buf, fmt, ap); + TEInsert (buf, strlen(buf), console_text); + } + else + ret = vfprintf (fp, fmt, ap); + va_end (ap); + return ret; +} + +#undef printf + +int +hacked_printf (const char *fmt, ...) +{ + int ret; + va_list ap; + + va_start (ap, fmt); + ret = hacked_vfprintf(stdout, fmt, ap); + va_end (ap); + return ret; +} + +#undef vfprintf + +int +hacked_vfprintf (FILE *fp, const char *format, va_list args) +{ + if (mac_app && (fp == stdout || fp == stderr)) + { + char buf[1000]; + int ret; + + ret = vsprintf(buf, format, args); + TEInsert (buf, strlen(buf), console_text); + if (strchr(buf, '\n')) + { + adjust_console_sizes (); + adjust_console_scrollbars (); + adjust_console_text (); + } + return ret; + } + else + return vfprintf (fp, format, args); +} + +#undef fputs + +hacked_fputs (const char *s, FILE *fp) +{ + if (mac_app && (fp == stdout || fp == stderr)) + { + TEInsert (s, strlen(s), console_text); + if (strchr(s, '\n')) + { + adjust_console_sizes (); + adjust_console_scrollbars (); + adjust_console_text (); + } + return 0; + } + else + return fputs (s, fp); +} + +#undef fputc + +hacked_fputc (const char c, FILE *fp) +{ + if (mac_app && (fp == stdout || fp == stderr)) + { + char buf[1]; + + buf[0] = c; + TEInsert (buf, 1, console_text); + if (c == '\n') + { + adjust_console_sizes (); + adjust_console_scrollbars (); + adjust_console_text (); + } + return c; + } + else + return fputc (c, fp); +} + +#undef putc + +hacked_putc (const char c, FILE *fp) +{ + if (mac_app && (fp == stdout || fp == stderr)) + { + char buf[1]; + + buf[0] = c; + TEInsert (buf, 1, console_text); + if (c == '\n') + { + adjust_console_sizes (); + adjust_console_scrollbars (); + adjust_console_text (); + } + return c; + } + else + return fputc (c, fp); +} + +#undef fflush + +hacked_fflush (FILE *fp) +{ + if (mac_app && (fp == stdout || fp == stderr)) + { + adjust_console_sizes (); + adjust_console_scrollbars (); + adjust_console_text (); + return 0; + } + return fflush (fp); +} + +#undef fgetc + +hacked_fgetc (FILE *fp) +{ + if (mac_app && (fp == stdin)) + { + /* Catch any attempts to use this. */ + DebugStr("\pShould not be reading from stdin!"); + return '\n'; + } + return fgetc (fp); +} diff --git a/contrib/gdb/gdb/mips-nat.c b/contrib/gdb/gdb/mips-nat.c new file mode 100644 index 0000000000000..8d80af4e587a7 --- /dev/null +++ b/contrib/gdb/gdb/mips-nat.c @@ -0,0 +1,242 @@ +/* Low level DECstation interface to ptrace, for GDB when running native. + Copyright 1988, 1989, 1991, 1992, 1995 Free Software Foundation, Inc. + Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU + and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "inferior.h" +#include "gdbcore.h" +#include <sys/ptrace.h> +#include <sys/types.h> +#include <sys/param.h> +#include <sys/user.h> +#undef JB_S0 +#undef JB_S1 +#undef JB_S2 +#undef JB_S3 +#undef JB_S4 +#undef JB_S5 +#undef JB_S6 +#undef JB_S7 +#undef JB_SP +#undef JB_S8 +#undef JB_PC +#undef JB_SR +#undef NJBREGS +#include <setjmp.h> /* For JB_XXX. */ + +/* Size of elements in jmpbuf */ + +#define JB_ELEMENT_SIZE 4 + +/* Map gdb internal register number to ptrace ``address''. + These ``addresses'' are defined in DECstation <sys/ptrace.h> */ + +#define REGISTER_PTRACE_ADDR(regno) \ + (regno < 32 ? GPR_BASE + regno \ + : regno == PC_REGNUM ? PC \ + : regno == CAUSE_REGNUM ? CAUSE \ + : regno == HI_REGNUM ? MMHI \ + : regno == LO_REGNUM ? MMLO \ + : regno == FCRCS_REGNUM ? FPC_CSR \ + : regno == FCRIR_REGNUM ? FPC_EIR \ + : regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) \ + : 0) + +static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0}; + +/* Get all registers from the inferior */ + +void +fetch_inferior_registers (regno) + int regno; +{ + register unsigned int regaddr; + char buf[MAX_REGISTER_RAW_SIZE]; + register int i; + + registers_fetched (); + + for (regno = 1; regno < NUM_REGS; regno++) + { + regaddr = REGISTER_PTRACE_ADDR (regno); + for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) + { + *(int *) &buf[i] = ptrace (PT_READ_U, inferior_pid, + (PTRACE_ARG3_TYPE) regaddr, 0); + regaddr += sizeof (int); + } + supply_register (regno, buf); + } + + supply_register (ZERO_REGNUM, zerobuf); + /* Frame ptr reg must appear to be 0; it is faked by stack handling code. */ + supply_register (FP_REGNUM, zerobuf); +} + +/* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +void +store_inferior_registers (regno) + int regno; +{ + register unsigned int regaddr; + char buf[80]; + + if (regno > 0) + { + if (regno == ZERO_REGNUM || regno == PS_REGNUM + || regno == BADVADDR_REGNUM || regno == CAUSE_REGNUM + || regno == FCRIR_REGNUM || regno == FP_REGNUM + || (regno >= FIRST_EMBED_REGNUM && regno <= LAST_EMBED_REGNUM)) + return; + regaddr = REGISTER_PTRACE_ADDR (regno); + errno = 0; + ptrace (PT_WRITE_U, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, + read_register (regno)); + if (errno != 0) + { + sprintf (buf, "writing register number %d", regno); + perror_with_name (buf); + } + } + else + { + for (regno = 0; regno < NUM_REGS; regno++) + store_inferior_registers (regno); + } +} + + +/* Figure out where the longjmp will land. + We expect the first arg to be a pointer to the jmp_buf structure from which + we extract the pc (JB_PC) that we will land at. The pc is copied into PC. + This routine returns true on success. */ + +int +get_longjmp_target(pc) + CORE_ADDR *pc; +{ + CORE_ADDR jb_addr; + char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT]; + + jb_addr = read_register (A0_REGNUM); + + if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf, + TARGET_PTR_BIT / TARGET_CHAR_BIT)) + return 0; + + *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); + + return 1; +} + +/* Extract the register values out of the core file and store + them where `read_register' will find them. + + CORE_REG_SECT points to the register values themselves, read into memory. + CORE_REG_SIZE is the size of that area. + WHICH says which set of registers we are handling (0 = int, 2 = float + on machines where they are discontiguous). + REG_ADDR is the offset from u.u_ar0 to the register values relative to + core_reg_sect. This is used with old-fashioned core files to + locate the registers in a large upage-plus-stack ".reg" section. + Original upage address X is at location core_reg_sect+x+reg_addr. + */ + +static void +fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) + char *core_reg_sect; + unsigned core_reg_size; + int which; + unsigned reg_addr; +{ + register int regno; + register unsigned int addr; + int bad_reg = -1; + register reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */ + + /* If u.u_ar0 was an absolute address in the core file, relativize it now, + so we can use it as an offset into core_reg_sect. When we're done, + "register 0" will be at core_reg_sect+reg_ptr, and we can use + register_addr to offset to the other registers. If this is a modern + core file without a upage, reg_ptr will be zero and this is all a big + NOP. */ + if (reg_ptr > core_reg_size) +#ifdef KERNEL_U_ADDR + reg_ptr -= KERNEL_U_ADDR; +#else + error ("Old mips core file can't be processed on this machine."); +#endif + + for (regno = 0; regno < NUM_REGS; regno++) + { + addr = register_addr (regno, reg_ptr); + if (addr >= core_reg_size) { + if (bad_reg < 0) + bad_reg = regno; + } else { + supply_register (regno, core_reg_sect + addr); + } + } + if (bad_reg >= 0) + { + error ("Register %s not found in core file.", reg_names[bad_reg]); + } + supply_register (ZERO_REGNUM, zerobuf); + /* Frame ptr reg must appear to be 0; it is faked by stack handling code. */ + supply_register (FP_REGNUM, zerobuf); +} + +/* Return the address in the core dump or inferior of register REGNO. + BLOCKEND is the address of the end of the user structure. */ + +unsigned int +register_addr (regno, blockend) + int regno; + int blockend; +{ + int addr; + + if (regno < 0 || regno >= NUM_REGS) + error ("Invalid register number %d.", regno); + + REGISTER_U_ADDR (addr, blockend, regno); + + return addr; +} + + +/* Register that we are able to handle mips core file formats. + FIXME: is this really bfd_target_unknown_flavour? */ + +static struct core_fns mips_core_fns = +{ + bfd_target_unknown_flavour, + fetch_core_registers, + NULL +}; + +void +_initialize_core_mips () +{ + add_core_fns (&mips_core_fns); +} diff --git a/contrib/gdb/gdb/mips-tdep.c b/contrib/gdb/gdb/mips-tdep.c new file mode 100644 index 0000000000000..7365adf9c8c16 --- /dev/null +++ b/contrib/gdb/gdb/mips-tdep.c @@ -0,0 +1,1585 @@ +/* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger. + Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995 + Free Software Foundation, Inc. + Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU + and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "gdb_string.h" +#include "frame.h" +#include "inferior.h" +#include "symtab.h" +#include "value.h" +#include "gdbcmd.h" +#include "language.h" +#include "gdbcore.h" +#include "symfile.h" +#include "objfiles.h" +#include "gdbtypes.h" + +#include "opcode/mips.h" + +#define VM_MIN_ADDRESS (unsigned)0x400000 + +/* FIXME: Put this declaration in frame.h. */ +extern struct obstack frame_cache_obstack; + +#if 0 +static int mips_in_lenient_prologue PARAMS ((CORE_ADDR, CORE_ADDR)); +#endif + +static void mips_set_fpu_command PARAMS ((char *, int, + struct cmd_list_element *)); + +static void mips_show_fpu_command PARAMS ((char *, int, + struct cmd_list_element *)); + +void mips_set_processor_type_command PARAMS ((char *, int)); + +int mips_set_processor_type PARAMS ((char *)); + +static void mips_show_processor_type_command PARAMS ((char *, int)); + +static void reinit_frame_cache_sfunc PARAMS ((char *, int, + struct cmd_list_element *)); + +static mips_extra_func_info_t + find_proc_desc PARAMS ((CORE_ADDR pc, struct frame_info *next_frame)); + +static CORE_ADDR after_prologue PARAMS ((CORE_ADDR pc, + mips_extra_func_info_t proc_desc)); + +/* This value is the model of MIPS in use. It is derived from the value + of the PrID register. */ + +char *mips_processor_type; + +char *tmp_mips_processor_type; + +/* Some MIPS boards don't support floating point, so we permit the + user to turn it off. */ + +enum mips_fpu_type mips_fpu; + +static char *mips_fpu_string; + +/* A set of original names, to be used when restoring back to generic + registers from a specific set. */ + +char *mips_generic_reg_names[] = REGISTER_NAMES; + +/* Names of IDT R3041 registers. */ + +char *mips_r3041_reg_names[] = { + "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", + "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", + "sr", "lo", "hi", "bad", "cause","pc", + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", + "fsr", "fir", "fp", "", + "", "", "bus", "ccfg", "", "", "", "", + "", "", "port", "cmp", "", "", "epc", "prid", +}; + +/* Names of IDT R3051 registers. */ + +char *mips_r3051_reg_names[] = { + "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", + "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", + "sr", "lo", "hi", "bad", "cause","pc", + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", + "fsr", "fir", "fp", "", + "inx", "rand", "elo", "", "ctxt", "", "", "", + "", "", "ehi", "", "", "", "epc", "prid", +}; + +/* Names of IDT R3081 registers. */ + +char *mips_r3081_reg_names[] = { + "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", + "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", + "sr", "lo", "hi", "bad", "cause","pc", + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", + "fsr", "fir", "fp", "", + "inx", "rand", "elo", "cfg", "ctxt", "", "", "", + "", "", "ehi", "", "", "", "epc", "prid", +}; + +/* Names of LSI 33k registers. */ + +char *mips_lsi33k_reg_names[] = { + "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", + "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", + "epc", "hi", "lo", "sr", "cause","badvaddr", + "dcic", "bpc", "bda", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", +}; + +struct { + char *name; + char **regnames; +} mips_processor_type_table[] = { + { "generic", mips_generic_reg_names }, + { "r3041", mips_r3041_reg_names }, + { "r3051", mips_r3051_reg_names }, + { "r3071", mips_r3081_reg_names }, + { "r3081", mips_r3081_reg_names }, + { "lsi33k", mips_lsi33k_reg_names }, + { NULL, NULL } +}; + +/* Heuristic_proc_start may hunt through the text section for a long + time across a 2400 baud serial line. Allows the user to limit this + search. */ + +static unsigned int heuristic_fence_post = 0; + +#define PROC_LOW_ADDR(proc) ((proc)->pdr.adr) /* least address */ +#define PROC_HIGH_ADDR(proc) ((proc)->pdr.iline) /* upper address bound */ +#define PROC_FRAME_OFFSET(proc) ((proc)->pdr.frameoffset) +#define PROC_FRAME_REG(proc) ((proc)->pdr.framereg) +#define PROC_REG_MASK(proc) ((proc)->pdr.regmask) +#define PROC_FREG_MASK(proc) ((proc)->pdr.fregmask) +#define PROC_REG_OFFSET(proc) ((proc)->pdr.regoffset) +#define PROC_FREG_OFFSET(proc) ((proc)->pdr.fregoffset) +#define PROC_PC_REG(proc) ((proc)->pdr.pcreg) +#define PROC_SYMBOL(proc) (*(struct symbol**)&(proc)->pdr.isym) +#define _PROC_MAGIC_ 0x0F0F0F0F +#define PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym == _PROC_MAGIC_) +#define SET_PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym = _PROC_MAGIC_) + +struct linked_proc_info +{ + struct mips_extra_func_info info; + struct linked_proc_info *next; +} *linked_proc_desc_table = NULL; + + + +/* This returns the PC of the first inst after the prologue. If we can't + find the prologue, then return 0. */ + +static CORE_ADDR +after_prologue (pc, proc_desc) + CORE_ADDR pc; + mips_extra_func_info_t proc_desc; +{ + struct symtab_and_line sal; + CORE_ADDR func_addr, func_end; + + if (!proc_desc) + proc_desc = find_proc_desc (pc, NULL); + + if (proc_desc) + { + /* If function is frameless, then we need to do it the hard way. I + strongly suspect that frameless always means prologueless... */ + if (PROC_FRAME_REG (proc_desc) == SP_REGNUM + && PROC_FRAME_OFFSET (proc_desc) == 0) + return 0; + } + + if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end)) + return 0; /* Unknown */ + + sal = find_pc_line (func_addr, 0); + + if (sal.end < func_end) + return sal.end; + + /* The line after the prologue is after the end of the function. In this + case, tell the caller to find the prologue the hard way. */ + + return 0; +} + +/* Guaranteed to set fci->saved_regs to some values (it never leaves it + NULL). */ + +void +mips_find_saved_regs (fci) + struct frame_info *fci; +{ + int ireg; + CORE_ADDR reg_position; + /* r0 bit means kernel trap */ + int kernel_trap; + /* What registers have been saved? Bitmasks. */ + unsigned long gen_mask, float_mask; + mips_extra_func_info_t proc_desc; + + fci->saved_regs = (struct frame_saved_regs *) + obstack_alloc (&frame_cache_obstack, sizeof(struct frame_saved_regs)); + memset (fci->saved_regs, 0, sizeof (struct frame_saved_regs)); + + /* If it is the frame for sigtramp, the saved registers are located + in a sigcontext structure somewhere on the stack. + If the stack layout for sigtramp changes we might have to change these + constants and the companion fixup_sigtramp in mdebugread.c */ +#ifndef SIGFRAME_BASE +/* To satisfy alignment restrictions, sigcontext is located 4 bytes + above the sigtramp frame. */ +#define SIGFRAME_BASE 4 +#define SIGFRAME_PC_OFF (SIGFRAME_BASE + 2 * 4) +#define SIGFRAME_REGSAVE_OFF (SIGFRAME_BASE + 3 * 4) +#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_REGSAVE_OFF + 32 * 4 + 3 * 4) +#endif +#ifndef SIGFRAME_REG_SIZE +#define SIGFRAME_REG_SIZE 4 +#endif + if (fci->signal_handler_caller) + { + for (ireg = 0; ireg < 32; ireg++) + { + reg_position = fci->frame + SIGFRAME_REGSAVE_OFF + + ireg * SIGFRAME_REG_SIZE; + fci->saved_regs->regs[ireg] = reg_position; + } + for (ireg = 0; ireg < 32; ireg++) + { + reg_position = fci->frame + SIGFRAME_FPREGSAVE_OFF + + ireg * SIGFRAME_REG_SIZE; + fci->saved_regs->regs[FP0_REGNUM + ireg] = reg_position; + } + fci->saved_regs->regs[PC_REGNUM] = fci->frame + SIGFRAME_PC_OFF; + return; + } + + proc_desc = fci->proc_desc; + if (proc_desc == NULL) + /* I'm not sure how/whether this can happen. Normally when we can't + find a proc_desc, we "synthesize" one using heuristic_proc_desc + and set the saved_regs right away. */ + return; + + kernel_trap = PROC_REG_MASK(proc_desc) & 1; + gen_mask = kernel_trap ? 0xFFFFFFFF : PROC_REG_MASK(proc_desc); + float_mask = kernel_trap ? 0xFFFFFFFF : PROC_FREG_MASK(proc_desc); + + if (/* In any frame other than the innermost, we assume that all + registers have been saved. This assumes that all register + saves in a function happen before the first function + call. */ + fci->next == NULL + + /* In a dummy frame we know exactly where things are saved. */ + && !PROC_DESC_IS_DUMMY (proc_desc) + + /* Don't bother unless we are inside a function prologue. Outside the + prologue, we know where everything is. */ + + && in_prologue (fci->pc, PROC_LOW_ADDR (proc_desc)) + + /* Not sure exactly what kernel_trap means, but if it means + the kernel saves the registers without a prologue doing it, + we better not examine the prologue to see whether registers + have been saved yet. */ + && !kernel_trap) + { + /* We need to figure out whether the registers that the proc_desc + claims are saved have been saved yet. */ + + CORE_ADDR addr; + int status; + char buf[4]; + unsigned long inst; + + /* Bitmasks; set if we have found a save for the register. */ + unsigned long gen_save_found = 0; + unsigned long float_save_found = 0; + + for (addr = PROC_LOW_ADDR (proc_desc); + addr < fci->pc /*&& (gen_mask != gen_save_found + || float_mask != float_save_found)*/; + addr += 4) + { + status = read_memory_nobpt (addr, buf, 4); + if (status) + memory_error (status, addr); + inst = extract_unsigned_integer (buf, 4); + if (/* sw reg,n($sp) */ + (inst & 0xffe00000) == 0xafa00000 + + /* sw reg,n($r30) */ + || (inst & 0xffe00000) == 0xafc00000 + + /* sd reg,n($sp) */ + || (inst & 0xffe00000) == 0xffa00000) + { + /* It might be possible to use the instruction to + find the offset, rather than the code below which + is based on things being in a certain order in the + frame, but figuring out what the instruction's offset + is relative to might be a little tricky. */ + int reg = (inst & 0x001f0000) >> 16; + gen_save_found |= (1 << reg); + } + else if (/* swc1 freg,n($sp) */ + (inst & 0xffe00000) == 0xe7a00000 + + /* swc1 freg,n($r30) */ + || (inst & 0xffe00000) == 0xe7c00000 + + /* sdc1 freg,n($sp) */ + || (inst & 0xffe00000) == 0xf7a00000) + + { + int reg = ((inst & 0x001f0000) >> 16); + float_save_found |= (1 << reg); + } + } + gen_mask = gen_save_found; + float_mask = float_save_found; + } + + /* Fill in the offsets for the registers which gen_mask says + were saved. */ + reg_position = fci->frame + PROC_REG_OFFSET (proc_desc); + for (ireg= 31; gen_mask; --ireg, gen_mask <<= 1) + if (gen_mask & 0x80000000) + { + fci->saved_regs->regs[ireg] = reg_position; + reg_position -= MIPS_REGSIZE; + } + /* Fill in the offsets for the registers which float_mask says + were saved. */ + reg_position = fci->frame + PROC_FREG_OFFSET (proc_desc); + + /* The freg_offset points to where the first *double* register + is saved. So skip to the high-order word. */ + reg_position += 4; + for (ireg = 31; float_mask; --ireg, float_mask <<= 1) + if (float_mask & 0x80000000) + { + fci->saved_regs->regs[FP0_REGNUM+ireg] = reg_position; + reg_position -= MIPS_REGSIZE; + } + + fci->saved_regs->regs[PC_REGNUM] = fci->saved_regs->regs[RA_REGNUM]; +} + +static int +read_next_frame_reg(fi, regno) + struct frame_info *fi; + int regno; +{ + for (; fi; fi = fi->next) + { + /* We have to get the saved sp from the sigcontext + if it is a signal handler frame. */ + if (regno == SP_REGNUM && !fi->signal_handler_caller) + return fi->frame; + else + { + if (fi->saved_regs == NULL) + mips_find_saved_regs (fi); + if (fi->saved_regs->regs[regno]) + return read_memory_integer(fi->saved_regs->regs[regno], MIPS_REGSIZE); + } + } + return read_register (regno); +} + +int +mips_frame_saved_pc(frame) + struct frame_info *frame; +{ + mips_extra_func_info_t proc_desc = frame->proc_desc; + /* We have to get the saved pc from the sigcontext + if it is a signal handler frame. */ + int pcreg = frame->signal_handler_caller ? PC_REGNUM + : (proc_desc ? PROC_PC_REG(proc_desc) : RA_REGNUM); + + if (proc_desc && PROC_DESC_IS_DUMMY(proc_desc)) + return read_memory_integer(frame->frame - 4, 4); + + return read_next_frame_reg(frame, pcreg); +} + +static struct mips_extra_func_info temp_proc_desc; +static struct frame_saved_regs temp_saved_regs; + +/* This fencepost looks highly suspicious to me. Removing it also + seems suspicious as it could affect remote debugging across serial + lines. */ + +static CORE_ADDR +heuristic_proc_start(pc) + CORE_ADDR pc; +{ + CORE_ADDR start_pc = pc; + CORE_ADDR fence = start_pc - heuristic_fence_post; + + if (start_pc == 0) return 0; + + if (heuristic_fence_post == UINT_MAX + || fence < VM_MIN_ADDRESS) + fence = VM_MIN_ADDRESS; + + /* search back for previous return */ + for (start_pc -= 4; ; start_pc -= 4) + if (start_pc < fence) + { + /* It's not clear to me why we reach this point when + stop_soon_quietly, but with this test, at least we + don't print out warnings for every child forked (eg, on + decstation). 22apr93 rich@cygnus.com. */ + if (!stop_soon_quietly) + { + static int blurb_printed = 0; + + if (fence == VM_MIN_ADDRESS) + warning("Hit beginning of text section without finding"); + else + warning("Hit heuristic-fence-post without finding"); + + warning("enclosing function for address 0x%x", pc); + if (!blurb_printed) + { + printf_filtered ("\ +This warning occurs if you are debugging a function without any symbols\n\ +(for example, in a stripped executable). In that case, you may wish to\n\ +increase the size of the search with the `set heuristic-fence-post' command.\n\ +\n\ +Otherwise, you told GDB there was a function where there isn't one, or\n\ +(more likely) you have encountered a bug in GDB.\n"); + blurb_printed = 1; + } + } + + return 0; + } + else if (ABOUT_TO_RETURN(start_pc)) + break; + + start_pc += 8; /* skip return, and its delay slot */ +#if 0 + /* skip nops (usually 1) 0 - is this */ + while (start_pc < pc && read_memory_integer (start_pc, 4) == 0) + start_pc += 4; +#endif + return start_pc; +} + +static mips_extra_func_info_t +heuristic_proc_desc(start_pc, limit_pc, next_frame) + CORE_ADDR start_pc, limit_pc; + struct frame_info *next_frame; +{ + CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM); + CORE_ADDR cur_pc; + int frame_size; + int has_frame_reg = 0; + int reg30 = 0; /* Value of $r30. Used by gcc for frame-pointer */ + unsigned long reg_mask = 0; + + if (start_pc == 0) return NULL; + memset (&temp_proc_desc, '\0', sizeof(temp_proc_desc)); + memset (&temp_saved_regs, '\0', sizeof(struct frame_saved_regs)); + PROC_LOW_ADDR (&temp_proc_desc) = start_pc; + + if (start_pc + 200 < limit_pc) + limit_pc = start_pc + 200; + restart: + frame_size = 0; + for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += 4) { + char buf[4]; + unsigned long word; + int status; + + status = read_memory_nobpt (cur_pc, buf, 4); + if (status) memory_error (status, cur_pc); + word = extract_unsigned_integer (buf, 4); + + if ((word & 0xFFFF0000) == 0x27bd0000) /* addiu $sp,$sp,-i */ + frame_size += (-word) & 0xFFFF; + else if ((word & 0xFFFF0000) == 0x23bd0000) /* addu $sp,$sp,-i */ + frame_size += (-word) & 0xFFFF; + else if ((word & 0xFFE00000) == 0xafa00000) { /* sw reg,offset($sp) */ + int reg = (word & 0x001F0000) >> 16; + reg_mask |= 1 << reg; + temp_saved_regs.regs[reg] = sp + (word & 0xffff); + } + else if ((word & 0xFFFF0000) == 0x27be0000) { /* addiu $30,$sp,size */ + if ((word & 0xffff) != frame_size) + reg30 = sp + (word & 0xffff); + else if (!has_frame_reg) { + int alloca_adjust; + has_frame_reg = 1; + reg30 = read_next_frame_reg(next_frame, 30); + alloca_adjust = reg30 - (sp + (word & 0xffff)); + if (alloca_adjust > 0) { + /* FP > SP + frame_size. This may be because + * of an alloca or somethings similar. + * Fix sp to "pre-alloca" value, and try again. + */ + sp += alloca_adjust; + goto restart; + } + } + } + else if ((word & 0xFFE00000) == 0xafc00000) { /* sw reg,offset($30) */ + int reg = (word & 0x001F0000) >> 16; + reg_mask |= 1 << reg; + temp_saved_regs.regs[reg] = reg30 + (word & 0xffff); + } + } + if (has_frame_reg) { + PROC_FRAME_REG(&temp_proc_desc) = 30; + PROC_FRAME_OFFSET(&temp_proc_desc) = 0; + } + else { + PROC_FRAME_REG(&temp_proc_desc) = SP_REGNUM; + PROC_FRAME_OFFSET(&temp_proc_desc) = frame_size; + } + PROC_REG_MASK(&temp_proc_desc) = reg_mask; + PROC_PC_REG(&temp_proc_desc) = RA_REGNUM; + return &temp_proc_desc; +} + +static mips_extra_func_info_t +find_proc_desc (pc, next_frame) + CORE_ADDR pc; + struct frame_info *next_frame; +{ + mips_extra_func_info_t proc_desc; + struct block *b = block_for_pc(pc); + struct symbol *sym; + CORE_ADDR startaddr; + + find_pc_partial_function (pc, NULL, &startaddr, NULL); + if (b == NULL) + sym = NULL; + else + { + if (startaddr > BLOCK_START (b)) + /* This is the "pathological" case referred to in a comment in + print_frame_info. It might be better to move this check into + symbol reading. */ + sym = NULL; + else + sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_NAMESPACE, + 0, NULL); + } + + /* If we never found a PDR for this function in symbol reading, then + examine prologues to find the information. */ + if (sym && ((mips_extra_func_info_t) SYMBOL_VALUE (sym))->pdr.framereg == -1) + sym = NULL; + + if (sym) + { + /* IF this is the topmost frame AND + * (this proc does not have debugging information OR + * the PC is in the procedure prologue) + * THEN create a "heuristic" proc_desc (by analyzing + * the actual code) to replace the "official" proc_desc. + */ + proc_desc = (mips_extra_func_info_t) SYMBOL_VALUE (sym); + if (next_frame == NULL) { + struct symtab_and_line val; + struct symbol *proc_symbol = + PROC_DESC_IS_DUMMY(proc_desc) ? 0 : PROC_SYMBOL(proc_desc); + + if (proc_symbol) { + val = find_pc_line (BLOCK_START + (SYMBOL_BLOCK_VALUE(proc_symbol)), + 0); + val.pc = val.end ? val.end : pc; + } + if (!proc_symbol || pc < val.pc) { + mips_extra_func_info_t found_heuristic = + heuristic_proc_desc (PROC_LOW_ADDR (proc_desc), + pc, next_frame); + if (found_heuristic) + proc_desc = found_heuristic; + } + } + } + else + { + /* Is linked_proc_desc_table really necessary? It only seems to be used + by procedure call dummys. However, the procedures being called ought + to have their own proc_descs, and even if they don't, + heuristic_proc_desc knows how to create them! */ + + register struct linked_proc_info *link; + + for (link = linked_proc_desc_table; link; link = link->next) + if (PROC_LOW_ADDR(&link->info) <= pc + && PROC_HIGH_ADDR(&link->info) > pc) + return &link->info; + + if (startaddr == 0) + startaddr = heuristic_proc_start (pc); + + proc_desc = + heuristic_proc_desc (startaddr, pc, next_frame); + } + return proc_desc; +} + +mips_extra_func_info_t cached_proc_desc; + +CORE_ADDR +mips_frame_chain(frame) + struct frame_info *frame; +{ + mips_extra_func_info_t proc_desc; + CORE_ADDR saved_pc = FRAME_SAVED_PC(frame); + + if (saved_pc == 0 || inside_entry_file (saved_pc)) + return 0; + + proc_desc = find_proc_desc(saved_pc, frame); + if (!proc_desc) + return 0; + + cached_proc_desc = proc_desc; + + /* If no frame pointer and frame size is zero, we must be at end + of stack (or otherwise hosed). If we don't check frame size, + we loop forever if we see a zero size frame. */ + if (PROC_FRAME_REG (proc_desc) == SP_REGNUM + && PROC_FRAME_OFFSET (proc_desc) == 0 + /* The previous frame from a sigtramp frame might be frameless + and have frame size zero. */ + && !frame->signal_handler_caller) + return 0; + else + return read_next_frame_reg(frame, PROC_FRAME_REG(proc_desc)) + + PROC_FRAME_OFFSET(proc_desc); +} + +void +init_extra_frame_info(fci) + struct frame_info *fci; +{ + /* Use proc_desc calculated in frame_chain */ + mips_extra_func_info_t proc_desc = + fci->next ? cached_proc_desc : find_proc_desc(fci->pc, fci->next); + + fci->saved_regs = NULL; + fci->proc_desc = + proc_desc == &temp_proc_desc ? 0 : proc_desc; + if (proc_desc) + { + /* Fixup frame-pointer - only needed for top frame */ + /* This may not be quite right, if proc has a real frame register. + Get the value of the frame relative sp, procedure might have been + interrupted by a signal at it's very start. */ + if (fci->pc == PROC_LOW_ADDR (proc_desc) + && !PROC_DESC_IS_DUMMY (proc_desc)) + fci->frame = read_next_frame_reg (fci->next, SP_REGNUM); + else + fci->frame = + read_next_frame_reg (fci->next, PROC_FRAME_REG (proc_desc)) + + PROC_FRAME_OFFSET (proc_desc); + + if (proc_desc == &temp_proc_desc) + { + char *name; + + /* Do not set the saved registers for a sigtramp frame, + mips_find_saved_registers will do that for us. + We can't use fci->signal_handler_caller, it is not yet set. */ + find_pc_partial_function (fci->pc, &name, + (CORE_ADDR *)NULL,(CORE_ADDR *)NULL); + if (!IN_SIGTRAMP (fci->pc, name)) + { + fci->saved_regs = (struct frame_saved_regs*) + obstack_alloc (&frame_cache_obstack, + sizeof (struct frame_saved_regs)); + *fci->saved_regs = temp_saved_regs; + fci->saved_regs->regs[PC_REGNUM] + = fci->saved_regs->regs[RA_REGNUM]; + } + } + + /* hack: if argument regs are saved, guess these contain args */ + if ((PROC_REG_MASK(proc_desc) & 0xF0) == 0) fci->num_args = -1; + else if ((PROC_REG_MASK(proc_desc) & 0x80) == 0) fci->num_args = 4; + else if ((PROC_REG_MASK(proc_desc) & 0x40) == 0) fci->num_args = 3; + else if ((PROC_REG_MASK(proc_desc) & 0x20) == 0) fci->num_args = 2; + else if ((PROC_REG_MASK(proc_desc) & 0x10) == 0) fci->num_args = 1; + } +} + +/* MIPS stack frames are almost impenetrable. When execution stops, + we basically have to look at symbol information for the function + that we stopped in, which tells us *which* register (if any) is + the base of the frame pointer, and what offset from that register + the frame itself is at. + + This presents a problem when trying to examine a stack in memory + (that isn't executing at the moment), using the "frame" command. We + don't have a PC, nor do we have any registers except SP. + + This routine takes two arguments, SP and PC, and tries to make the + cached frames look as if these two arguments defined a frame on the + cache. This allows the rest of info frame to extract the important + arguments without difficulty. */ + +struct frame_info * +setup_arbitrary_frame (argc, argv) + int argc; + CORE_ADDR *argv; +{ + if (argc != 2) + error ("MIPS frame specifications require two arguments: sp and pc"); + + return create_new_frame (argv[0], argv[1]); +} + + +CORE_ADDR +mips_push_arguments(nargs, args, sp, struct_return, struct_addr) + int nargs; + value_ptr *args; + CORE_ADDR sp; + int struct_return; + CORE_ADDR struct_addr; +{ + register i; + int accumulate_size = struct_return ? MIPS_REGSIZE : 0; + struct mips_arg { char *contents; int len; int offset; }; + struct mips_arg *mips_args = + (struct mips_arg*)alloca((nargs + 4) * sizeof(struct mips_arg)); + register struct mips_arg *m_arg; + int fake_args = 0; + + for (i = 0, m_arg = mips_args; i < nargs; i++, m_arg++) { + value_ptr arg = args[i]; + m_arg->len = TYPE_LENGTH (VALUE_TYPE (arg)); + /* This entire mips-specific routine is because doubles must be aligned + * on 8-byte boundaries. It still isn't quite right, because MIPS decided + * to align 'struct {int a, b}' on 4-byte boundaries (even though this + * breaks their varargs implementation...). A correct solution + * requires an simulation of gcc's 'alignof' (and use of 'alignof' + * in stdarg.h/varargs.h). + * On the 64 bit r4000 we always pass the first four arguments + * using eight bytes each, so that we can load them up correctly + * in CALL_DUMMY. + */ + if (m_arg->len > 4) + accumulate_size = (accumulate_size + 7) & -8; + m_arg->offset = accumulate_size; + m_arg->contents = VALUE_CONTENTS(arg); + if (! GDB_TARGET_IS_MIPS64) + accumulate_size = (accumulate_size + m_arg->len + 3) & -4; + else + { + if (accumulate_size >= 4 * MIPS_REGSIZE) + accumulate_size = (accumulate_size + m_arg->len + 3) &~ 4; + else + { + static char zeroes[8] = { 0 }; + int len = m_arg->len; + + if (len < 8) + { + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + m_arg->offset += 8 - len; + ++m_arg; + m_arg->len = 8 - len; + m_arg->contents = zeroes; + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + m_arg->offset = accumulate_size; + else + m_arg->offset = accumulate_size + len; + ++fake_args; + } + accumulate_size = (accumulate_size + len + 7) & ~8; + } + } + } + accumulate_size = (accumulate_size + 7) & (-8); + if (accumulate_size < 4 * MIPS_REGSIZE) + accumulate_size = 4 * MIPS_REGSIZE; + sp -= accumulate_size; + for (i = nargs + fake_args; m_arg--, --i >= 0; ) + write_memory(sp + m_arg->offset, m_arg->contents, m_arg->len); + if (struct_return) + { + char buf[TARGET_PTR_BIT / HOST_CHAR_BIT]; + + store_address (buf, sizeof buf, struct_addr); + write_memory (sp, buf, sizeof buf); + } + return sp; +} + +/* MASK(i,j) == (1<<i) + (1<<(i+1)) + ... + (1<<j)). Assume i<=j<31. */ +#define MASK(i,j) (((1 << ((j)+1))-1) ^ ((1 << (i))-1)) + +void +mips_push_dummy_frame() +{ + char buffer[MAX_REGISTER_RAW_SIZE]; + int ireg; + struct linked_proc_info *link = (struct linked_proc_info*) + xmalloc(sizeof(struct linked_proc_info)); + mips_extra_func_info_t proc_desc = &link->info; + CORE_ADDR sp = read_register (SP_REGNUM); + CORE_ADDR save_address; + link->next = linked_proc_desc_table; + linked_proc_desc_table = link; +#define PUSH_FP_REGNUM 16 /* must be a register preserved across calls */ +#define GEN_REG_SAVE_MASK MASK(1,16)|MASK(24,28)|(1<<31) +#define GEN_REG_SAVE_COUNT 22 +#define FLOAT_REG_SAVE_MASK MASK(0,19) +#define FLOAT_REG_SAVE_COUNT 20 +#define FLOAT_SINGLE_REG_SAVE_MASK \ + ((1<<18)|(1<<16)|(1<<14)|(1<<12)|(1<<10)|(1<<8)|(1<<6)|(1<<4)|(1<<2)|(1<<0)) +#define FLOAT_SINGLE_REG_SAVE_COUNT 10 +#define SPECIAL_REG_SAVE_COUNT 4 + /* + * The registers we must save are all those not preserved across + * procedure calls. Dest_Reg (see tm-mips.h) must also be saved. + * In addition, we must save the PC, and PUSH_FP_REGNUM. + * (Ideally, we should also save MDLO/-HI and FP Control/Status reg.) + * + * Dummy frame layout: + * (high memory) + * Saved PC + * Saved MMHI, MMLO, FPC_CSR + * Saved R31 + * Saved R28 + * ... + * Saved R1 + * Saved D18 (i.e. F19, F18) + * ... + * Saved D0 (i.e. F1, F0) + * CALL_DUMMY (subroutine stub; see tm-mips.h) + * Parameter build area (not yet implemented) + * (low memory) + */ + PROC_REG_MASK(proc_desc) = GEN_REG_SAVE_MASK; + switch (mips_fpu) + { + case MIPS_FPU_DOUBLE: + PROC_FREG_MASK(proc_desc) = FLOAT_REG_SAVE_MASK; + break; + case MIPS_FPU_SINGLE: + PROC_FREG_MASK(proc_desc) = FLOAT_SINGLE_REG_SAVE_MASK; + break; + case MIPS_FPU_NONE: + PROC_FREG_MASK(proc_desc) = 0; + break; + } + PROC_REG_OFFSET(proc_desc) = /* offset of (Saved R31) from FP */ + -sizeof(long) - 4 * SPECIAL_REG_SAVE_COUNT; + PROC_FREG_OFFSET(proc_desc) = /* offset of (Saved D18) from FP */ + -sizeof(double) - 4 * (SPECIAL_REG_SAVE_COUNT + GEN_REG_SAVE_COUNT); + /* save general registers */ + save_address = sp + PROC_REG_OFFSET(proc_desc); + for (ireg = 32; --ireg >= 0; ) + if (PROC_REG_MASK(proc_desc) & (1 << ireg)) + { + read_register_gen (ireg, buffer); + + /* Need to fix the save_address decrement below, and also make sure + that we don't run into problems with the size of the dummy frame + or any of the offsets within it. */ + if (REGISTER_RAW_SIZE (ireg) > 4) + error ("Cannot call functions on mips64"); + + write_memory (save_address, buffer, REGISTER_RAW_SIZE (ireg)); + save_address -= 4; + } + /* save floating-points registers starting with high order word */ + save_address = sp + PROC_FREG_OFFSET(proc_desc) + 4; + for (ireg = 32; --ireg >= 0; ) + if (PROC_FREG_MASK(proc_desc) & (1 << ireg)) + { + read_register_gen (ireg + FP0_REGNUM, buffer); + + if (REGISTER_RAW_SIZE (ireg + FP0_REGNUM) > 4) + error ("Cannot call functions on mips64"); + + write_memory (save_address, buffer, + REGISTER_RAW_SIZE (ireg + FP0_REGNUM)); + save_address -= 4; + } + write_register (PUSH_FP_REGNUM, sp); + PROC_FRAME_REG(proc_desc) = PUSH_FP_REGNUM; + PROC_FRAME_OFFSET(proc_desc) = 0; + read_register_gen (PC_REGNUM, buffer); + write_memory (sp - 4, buffer, REGISTER_RAW_SIZE (PC_REGNUM)); + read_register_gen (HI_REGNUM, buffer); + write_memory (sp - 8, buffer, REGISTER_RAW_SIZE (HI_REGNUM)); + read_register_gen (LO_REGNUM, buffer); + write_memory (sp - 12, buffer, REGISTER_RAW_SIZE (LO_REGNUM)); + if (mips_fpu != MIPS_FPU_NONE) + read_register_gen (FCRCS_REGNUM, buffer); + else + memset (buffer, 0, REGISTER_RAW_SIZE (FCRCS_REGNUM)); + write_memory (sp - 16, buffer, REGISTER_RAW_SIZE (FCRCS_REGNUM)); + sp -= 4 * (GEN_REG_SAVE_COUNT + SPECIAL_REG_SAVE_COUNT); + if (mips_fpu == MIPS_FPU_DOUBLE) + sp -= 4 * FLOAT_REG_SAVE_COUNT; + else if (mips_fpu == MIPS_FPU_SINGLE) + sp -= 4 * FLOAT_SINGLE_REG_SAVE_COUNT; + write_register (SP_REGNUM, sp); + PROC_LOW_ADDR(proc_desc) = sp - CALL_DUMMY_SIZE + CALL_DUMMY_START_OFFSET; + PROC_HIGH_ADDR(proc_desc) = sp; + SET_PROC_DESC_IS_DUMMY(proc_desc); + PROC_PC_REG(proc_desc) = RA_REGNUM; +} + +void +mips_pop_frame() +{ + register int regnum; + struct frame_info *frame = get_current_frame (); + CORE_ADDR new_sp = FRAME_FP (frame); + + mips_extra_func_info_t proc_desc = frame->proc_desc; + + write_register (PC_REGNUM, FRAME_SAVED_PC(frame)); + if (frame->saved_regs == NULL) + mips_find_saved_regs (frame); + if (proc_desc) + { + for (regnum = 32; --regnum >= 0; ) + if (PROC_REG_MASK(proc_desc) & (1 << regnum)) + write_register (regnum, + read_memory_integer (frame->saved_regs->regs[regnum], + 4)); + for (regnum = 32; --regnum >= 0; ) + if (PROC_FREG_MASK(proc_desc) & (1 << regnum)) + write_register (regnum + FP0_REGNUM, + read_memory_integer (frame->saved_regs->regs[regnum + FP0_REGNUM], 4)); + } + write_register (SP_REGNUM, new_sp); + flush_cached_frames (); + + if (proc_desc && PROC_DESC_IS_DUMMY(proc_desc)) + { + struct linked_proc_info *pi_ptr, *prev_ptr; + + for (pi_ptr = linked_proc_desc_table, prev_ptr = NULL; + pi_ptr != NULL; + prev_ptr = pi_ptr, pi_ptr = pi_ptr->next) + { + if (&pi_ptr->info == proc_desc) + break; + } + + if (pi_ptr == NULL) + error ("Can't locate dummy extra frame info\n"); + + if (prev_ptr != NULL) + prev_ptr->next = pi_ptr->next; + else + linked_proc_desc_table = pi_ptr->next; + + free (pi_ptr); + + write_register (HI_REGNUM, read_memory_integer(new_sp - 8, 4)); + write_register (LO_REGNUM, read_memory_integer(new_sp - 12, 4)); + if (mips_fpu != MIPS_FPU_NONE) + write_register (FCRCS_REGNUM, read_memory_integer(new_sp - 16, 4)); + } +} + +static void +mips_print_register (regnum, all) + int regnum, all; +{ + char raw_buffer[MAX_REGISTER_RAW_SIZE]; + + /* Get the data in raw format. */ + if (read_relative_register_raw_bytes (regnum, raw_buffer)) + { + printf_filtered ("%s: [Invalid]", reg_names[regnum]); + return; + } + + /* If an even floating pointer register, also print as double. */ + if (regnum >= FP0_REGNUM && regnum < FP0_REGNUM+32 + && !((regnum-FP0_REGNUM) & 1)) + { + char dbuffer[MAX_REGISTER_RAW_SIZE]; + + read_relative_register_raw_bytes (regnum, dbuffer); + read_relative_register_raw_bytes (regnum+1, dbuffer+4); +#ifdef REGISTER_CONVERT_TO_TYPE + REGISTER_CONVERT_TO_TYPE(regnum, builtin_type_double, dbuffer); +#endif + printf_filtered ("(d%d: ", regnum-FP0_REGNUM); + val_print (builtin_type_double, dbuffer, 0, + gdb_stdout, 0, 1, 0, Val_pretty_default); + printf_filtered ("); "); + } + fputs_filtered (reg_names[regnum], gdb_stdout); + + /* The problem with printing numeric register names (r26, etc.) is that + the user can't use them on input. Probably the best solution is to + fix it so that either the numeric or the funky (a2, etc.) names + are accepted on input. */ + if (regnum < 32) + printf_filtered ("(r%d): ", regnum); + else + printf_filtered (": "); + + /* If virtual format is floating, print it that way. */ + if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT) + val_print (REGISTER_VIRTUAL_TYPE (regnum), raw_buffer, 0, + gdb_stdout, 0, 1, 0, Val_pretty_default); + /* Else print as integer in hex. */ + else + print_scalar_formatted (raw_buffer, REGISTER_VIRTUAL_TYPE (regnum), + 'x', 0, gdb_stdout); +} + +/* Replacement for generic do_registers_info. */ + +void +mips_do_registers_info (regnum, fpregs) + int regnum; + int fpregs; +{ + if (regnum != -1) + { + if (*(reg_names[regnum]) == '\0') + error ("Not a valid register for the current processor type"); + + mips_print_register (regnum, 0); + printf_filtered ("\n"); + } + else + { + int did_newline = 0; + + for (regnum = 0; regnum < NUM_REGS; ) + { + if (((!fpregs) && regnum >= FP0_REGNUM && regnum <= FCRIR_REGNUM) + || *(reg_names[regnum]) == '\0') + { + regnum++; + continue; + } + mips_print_register (regnum, 1); + regnum++; + printf_filtered ("; "); + did_newline = 0; + if ((regnum & 3) == 0) + { + printf_filtered ("\n"); + did_newline = 1; + } + } + if (!did_newline) + printf_filtered ("\n"); + } +} + +/* Return number of args passed to a frame. described by FIP. + Can return -1, meaning no way to tell. */ + +int +mips_frame_num_args (frame) + struct frame_info *frame; +{ +#if 0 /* FIXME Use or lose this! */ + struct chain_info_t *p; + + p = mips_find_cached_frame (FRAME_FP (frame)); + if (p->valid) + return p->the_info.numargs; +#endif + return -1; +} + +/* Is this a branch with a delay slot? */ + +static int is_delayed PARAMS ((unsigned long)); + +static int +is_delayed (insn) + unsigned long insn; +{ + int i; + for (i = 0; i < NUMOPCODES; ++i) + if (mips_opcodes[i].pinfo != INSN_MACRO + && (insn & mips_opcodes[i].mask) == mips_opcodes[i].match) + break; + return (i < NUMOPCODES + && (mips_opcodes[i].pinfo & (INSN_UNCOND_BRANCH_DELAY + | INSN_COND_BRANCH_DELAY + | INSN_COND_BRANCH_LIKELY))); +} + +int +mips_step_skips_delay (pc) + CORE_ADDR pc; +{ + char buf[4]; + + if (target_read_memory (pc, buf, 4) != 0) + /* If error reading memory, guess that it is not a delayed branch. */ + return 0; + return is_delayed (extract_unsigned_integer (buf, 4)); +} + +/* To skip prologues, I use this predicate. Returns either PC itself + if the code at PC does not look like a function prologue; otherwise + returns an address that (if we're lucky) follows the prologue. If + LENIENT, then we must skip everything which is involved in setting + up the frame (it's OK to skip more, just so long as we don't skip + anything which might clobber the registers which are being saved. + We must skip more in the case where part of the prologue is in the + delay slot of a non-prologue instruction). */ + +CORE_ADDR +mips_skip_prologue (pc, lenient) + CORE_ADDR pc; + int lenient; +{ + unsigned long inst; + int offset; + int seen_sp_adjust = 0; + int load_immediate_bytes = 0; + CORE_ADDR post_prologue_pc; + + /* See if we can determine the end of the prologue via the symbol table. + If so, then return either PC, or the PC after the prologue, whichever + is greater. */ + + post_prologue_pc = after_prologue (pc, NULL); + + if (post_prologue_pc != 0) + return max (pc, post_prologue_pc); + + /* Can't determine prologue from the symbol table, need to examine + instructions. */ + + /* Skip the typical prologue instructions. These are the stack adjustment + instruction and the instructions that save registers on the stack + or in the gcc frame. */ + for (offset = 0; offset < 100; offset += 4) + { + char buf[4]; + int status; + + status = read_memory_nobpt (pc + offset, buf, 4); + if (status) + memory_error (status, pc + offset); + inst = extract_unsigned_integer (buf, 4); + +#if 0 + if (lenient && is_delayed (inst)) + continue; +#endif + + if ((inst & 0xffff0000) == 0x27bd0000) /* addiu $sp,$sp,offset */ + seen_sp_adjust = 1; + else if (inst == 0x03a1e823 || /* subu $sp,$sp,$at */ + inst == 0x03a8e823) /* subu $sp,$sp,$t0 */ + seen_sp_adjust = 1; + else if ((inst & 0xFFE00000) == 0xAFA00000 && (inst & 0x001F0000)) + continue; /* sw reg,n($sp) */ + /* reg != $zero */ + else if ((inst & 0xFFE00000) == 0xE7A00000) /* swc1 freg,n($sp) */ + continue; + else if ((inst & 0xF3E00000) == 0xA3C00000 && (inst & 0x001F0000)) + /* sx reg,n($s8) */ + continue; /* reg != $zero */ + + /* move $s8,$sp. With different versions of gas this will be either + `addu $s8,$sp,$zero' or `or $s8,$sp,$zero'. Accept either. */ + else if (inst == 0x03A0F021 || inst == 0x03a0f025) + continue; + + else if ((inst & 0xFF9F07FF) == 0x00800021) /* move reg,$a0-$a3 */ + continue; + else if ((inst & 0xffff0000) == 0x3c1c0000) /* lui $gp,n */ + continue; + else if ((inst & 0xffff0000) == 0x279c0000) /* addiu $gp,$gp,n */ + continue; + else if (inst == 0x0399e021 /* addu $gp,$gp,$t9 */ + || inst == 0x033ce021) /* addu $gp,$t9,$gp */ + continue; + /* The following instructions load $at or $t0 with an immediate + value in preparation for a stack adjustment via + subu $sp,$sp,[$at,$t0]. These instructions could also initialize + a local variable, so we accept them only before a stack adjustment + instruction was seen. */ + else if (!seen_sp_adjust) + { + if ((inst & 0xffff0000) == 0x3c010000 || /* lui $at,n */ + (inst & 0xffff0000) == 0x3c080000) /* lui $t0,n */ + { + load_immediate_bytes += 4; + continue; + } + else if ((inst & 0xffff0000) == 0x34210000 || /* ori $at,$at,n */ + (inst & 0xffff0000) == 0x35080000 || /* ori $t0,$t0,n */ + (inst & 0xffff0000) == 0x34010000 || /* ori $at,$zero,n */ + (inst & 0xffff0000) == 0x34080000) /* ori $t0,$zero,n */ + { + load_immediate_bytes += 4; + continue; + } + else + break; + } + else + break; + } + + /* In a frameless function, we might have incorrectly + skipped some load immediate instructions. Undo the skipping + if the load immediate was not followed by a stack adjustment. */ + if (load_immediate_bytes && !seen_sp_adjust) + offset -= load_immediate_bytes; + return pc + offset; +} + +#if 0 +/* The lenient prologue stuff should be superceded by the code in + init_extra_frame_info which looks to see whether the stores mentioned + in the proc_desc have actually taken place. */ + +/* Is address PC in the prologue (loosely defined) for function at + STARTADDR? */ + +static int +mips_in_lenient_prologue (startaddr, pc) + CORE_ADDR startaddr; + CORE_ADDR pc; +{ + CORE_ADDR end_prologue = mips_skip_prologue (startaddr, 1); + return pc >= startaddr && pc < end_prologue; +} +#endif + +/* Given a return value in `regbuf' with a type `valtype', + extract and copy its value into `valbuf'. */ +void +mips_extract_return_value (valtype, regbuf, valbuf) + struct type *valtype; + char regbuf[REGISTER_BYTES]; + char *valbuf; +{ + int regnum; + int offset = 0; + + regnum = 2; + if (TYPE_CODE (valtype) == TYPE_CODE_FLT + && (mips_fpu == MIPS_FPU_DOUBLE + || (mips_fpu == MIPS_FPU_SINGLE && TYPE_LENGTH (valtype) <= 4))) + regnum = FP0_REGNUM; + + if (TARGET_BYTE_ORDER == BIG_ENDIAN + && TYPE_CODE (valtype) != TYPE_CODE_FLT + && TYPE_LENGTH (valtype) < REGISTER_RAW_SIZE (regnum)) + offset = REGISTER_RAW_SIZE (regnum) - TYPE_LENGTH (valtype); + + memcpy (valbuf, regbuf + REGISTER_BYTE (regnum) + offset, + TYPE_LENGTH (valtype)); +#ifdef REGISTER_CONVERT_TO_TYPE + REGISTER_CONVERT_TO_TYPE(regnum, valtype, valbuf); +#endif +} + +/* Given a return value in `regbuf' with a type `valtype', + write it's value into the appropriate register. */ +void +mips_store_return_value (valtype, valbuf) + struct type *valtype; + char *valbuf; +{ + int regnum; + char raw_buffer[MAX_REGISTER_RAW_SIZE]; + + regnum = 2; + if (TYPE_CODE (valtype) == TYPE_CODE_FLT + && (mips_fpu == MIPS_FPU_DOUBLE + || (mips_fpu == MIPS_FPU_SINGLE && TYPE_LENGTH (valtype) <= 4))) + regnum = FP0_REGNUM; + + memcpy(raw_buffer, valbuf, TYPE_LENGTH (valtype)); + +#ifdef REGISTER_CONVERT_FROM_TYPE + REGISTER_CONVERT_FROM_TYPE(regnum, valtype, raw_buffer); +#endif + + write_register_bytes(REGISTER_BYTE (regnum), raw_buffer, TYPE_LENGTH (valtype)); +} + +/* These exist in mdebugread.c. */ +extern CORE_ADDR sigtramp_address, sigtramp_end; +extern void fixup_sigtramp PARAMS ((void)); + +/* Exported procedure: Is PC in the signal trampoline code */ + +int +in_sigtramp (pc, ignore) + CORE_ADDR pc; + char *ignore; /* function name */ +{ + if (sigtramp_address == 0) + fixup_sigtramp (); + return (pc >= sigtramp_address && pc < sigtramp_end); +} + +/* Command to set FPU type. mips_fpu_string will have been set to the + user's argument. Set mips_fpu based on mips_fpu_string, and then + canonicalize mips_fpu_string. */ + +/*ARGSUSED*/ +static void +mips_set_fpu_command (args, from_tty, c) + char *args; + int from_tty; + struct cmd_list_element *c; +{ + char *err = NULL; + + if (mips_fpu_string == NULL || *mips_fpu_string == '\0') + mips_fpu = MIPS_FPU_DOUBLE; + else if (strcasecmp (mips_fpu_string, "double") == 0 + || strcasecmp (mips_fpu_string, "on") == 0 + || strcasecmp (mips_fpu_string, "1") == 0 + || strcasecmp (mips_fpu_string, "yes") == 0) + mips_fpu = MIPS_FPU_DOUBLE; + else if (strcasecmp (mips_fpu_string, "none") == 0 + || strcasecmp (mips_fpu_string, "off") == 0 + || strcasecmp (mips_fpu_string, "0") == 0 + || strcasecmp (mips_fpu_string, "no") == 0) + mips_fpu = MIPS_FPU_NONE; + else if (strcasecmp (mips_fpu_string, "single") == 0) + mips_fpu = MIPS_FPU_SINGLE; + else + err = strsave (mips_fpu_string); + + if (mips_fpu_string != NULL) + free (mips_fpu_string); + + switch (mips_fpu) + { + case MIPS_FPU_DOUBLE: + mips_fpu_string = strsave ("double"); + break; + case MIPS_FPU_SINGLE: + mips_fpu_string = strsave ("single"); + break; + case MIPS_FPU_NONE: + mips_fpu_string = strsave ("none"); + break; + } + + if (err != NULL) + { + struct cleanup *cleanups = make_cleanup (free, err); + error ("Unknown FPU type `%s'. Use `double', `none', or `single'.", + err); + do_cleanups (cleanups); + } +} + +static void +mips_show_fpu_command (args, from_tty, c) + char *args; + int from_tty; + struct cmd_list_element *c; +{ +} + +/* Command to set the processor type. */ + +void +mips_set_processor_type_command (args, from_tty) + char *args; + int from_tty; +{ + int i; + + if (tmp_mips_processor_type == NULL || *tmp_mips_processor_type == '\0') + { + printf_unfiltered ("The known MIPS processor types are as follows:\n\n"); + for (i = 0; mips_processor_type_table[i].name != NULL; ++i) + printf_unfiltered ("%s\n", mips_processor_type_table[i].name); + + /* Restore the value. */ + tmp_mips_processor_type = strsave (mips_processor_type); + + return; + } + + if (!mips_set_processor_type (tmp_mips_processor_type)) + { + error ("Unknown processor type `%s'.", tmp_mips_processor_type); + /* Restore its value. */ + tmp_mips_processor_type = strsave (mips_processor_type); + } +} + +static void +mips_show_processor_type_command (args, from_tty) + char *args; + int from_tty; +{ +} + +/* Modify the actual processor type. */ + +int +mips_set_processor_type (str) + char *str; +{ + int i, j; + + if (str == NULL) + return 0; + + for (i = 0; mips_processor_type_table[i].name != NULL; ++i) + { + if (strcasecmp (str, mips_processor_type_table[i].name) == 0) + { + mips_processor_type = str; + + for (j = 0; j < NUM_REGS; ++j) + reg_names[j] = mips_processor_type_table[i].regnames[j]; + + return 1; + + /* FIXME tweak fpu flag too */ + } + } + + return 0; +} + +/* Attempt to identify the particular processor model by reading the + processor id. */ + +char * +mips_read_processor_type () +{ + int prid; + + prid = read_register (PRID_REGNUM); + + if (prid & ~0xf == 0x700) + return savestring ("r3041", strlen("r3041")); + + return NULL; +} + +/* Just like reinit_frame_cache, but with the right arguments to be + callable as an sfunc. */ + +static void +reinit_frame_cache_sfunc (args, from_tty, c) + char *args; + int from_tty; + struct cmd_list_element *c; +{ + reinit_frame_cache (); +} + +int +gdb_print_insn_mips (memaddr, info) + bfd_vma memaddr; + disassemble_info *info; +{ + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + return print_insn_big_mips (memaddr, info); + else + return print_insn_little_mips (memaddr, info); +} + +void +_initialize_mips_tdep () +{ + struct cmd_list_element *c; + + tm_print_insn = gdb_print_insn_mips; + + /* Let the user turn off floating point and set the fence post for + heuristic_proc_start. */ + + c = add_set_cmd ("mipsfpu", class_support, var_string_noescape, + (char *) &mips_fpu_string, + "Set use of floating point coprocessor.\n\ +Set to `none' to avoid using floating point instructions when calling\n\ +functions or dealing with return values. Set to `single' to use only\n\ +single precision floating point as on the R4650. Set to `double' for\n\ +normal floating point support.", + &setlist); + c->function.sfunc = mips_set_fpu_command; + c = add_show_from_set (c, &showlist); + c->function.sfunc = mips_show_fpu_command; + + mips_fpu = MIPS_FPU_DOUBLE; + mips_fpu_string = strsave ("double"); + + c = add_set_cmd ("processor", class_support, var_string_noescape, + (char *) &tmp_mips_processor_type, + "Set the type of MIPS processor in use.\n\ +Set this to be able to access processor-type-specific registers.\n\ +", + &setlist); + c->function.cfunc = mips_set_processor_type_command; + c = add_show_from_set (c, &showlist); + c->function.cfunc = mips_show_processor_type_command; + + tmp_mips_processor_type = strsave (DEFAULT_MIPS_TYPE); + mips_set_processor_type_command (strsave (DEFAULT_MIPS_TYPE), 0); + + /* We really would like to have both "0" and "unlimited" work, but + command.c doesn't deal with that. So make it a var_zinteger + because the user can always use "999999" or some such for unlimited. */ + c = add_set_cmd ("heuristic-fence-post", class_support, var_zinteger, + (char *) &heuristic_fence_post, + "\ +Set the distance searched for the start of a function.\n\ +If you are debugging a stripped executable, GDB needs to search through the\n\ +program for the start of a function. This command sets the distance of the\n\ +search. The only need to set it is when debugging a stripped executable.", + &setlist); + /* We need to throw away the frame cache when we set this, since it + might change our ability to get backtraces. */ + c->function.sfunc = reinit_frame_cache_sfunc; + add_show_from_set (c, &showlist); +} diff --git a/contrib/gdb/gdb/mipsm3-nat.c b/contrib/gdb/gdb/mipsm3-nat.c new file mode 100644 index 0000000000000..b7359ba84c16e --- /dev/null +++ b/contrib/gdb/gdb/mipsm3-nat.c @@ -0,0 +1,386 @@ +/* Definitions to make GDB run on a mips box under Mach 3.0 + Copyright (C) 1992 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Mach specific routines for little endian mips (e.g. pmax) + * running Mach 3.0 + * + * Author: Jukka Virtanen <jtv@hut.fi> + */ + +#include "defs.h" +#include "inferior.h" + +#include <stdio.h> + +#include <mach.h> +#include <mach/message.h> +#include <mach/exception.h> +#include <mach_error.h> + +/* Find offsets to thread states at compile time. + * If your compiler does not grok this, check the hand coded + * offsets and use them. + */ + +#if 1 + +#define REG_OFFSET(reg) (int)(&((struct mips_thread_state *)0)->reg) +#define CREG_OFFSET(reg) (int)(&((struct mips_float_state *)0)->reg) +#define EREG_OFFSET(reg) (int)(&((struct mips_exc_state *)0)->reg) + +/* at reg_offset[i] is the offset to the mips_thread_state + * location where the gdb registers[i] is stored. + * + * -1 means mach does not save it anywhere. + */ +static int reg_offset[] = +{ + /* zero at v0 v1 */ + -1, REG_OFFSET(r1), REG_OFFSET(r2), REG_OFFSET(r3), + + /* a0 a1 a2 a3 */ + REG_OFFSET(r4), REG_OFFSET(r5), REG_OFFSET(r6), REG_OFFSET(r7), + + /* t0 t1 t2 t3 */ + REG_OFFSET(r8), REG_OFFSET(r9), REG_OFFSET(r10), REG_OFFSET(r11), + + /* t4 t5 t6 t7 */ + REG_OFFSET(r12), REG_OFFSET(r13), REG_OFFSET(r14), REG_OFFSET(r15), + + /* s0 s1 s2 s3 */ + REG_OFFSET(r16), REG_OFFSET(r17), REG_OFFSET(r18), REG_OFFSET(r19), + + /* s4 s5 s6 s7 */ + REG_OFFSET(r20), REG_OFFSET(r21), REG_OFFSET(r22), REG_OFFSET(r23), + + /* t8 t9 k0 k1 */ + REG_OFFSET(r24), REG_OFFSET(r25), REG_OFFSET(r26), REG_OFFSET(r27), + + /* gp sp s8(30) == fp(72) ra */ + REG_OFFSET(r28), REG_OFFSET(r29), REG_OFFSET(r30), REG_OFFSET(r31), + + /* sr(32) PS_REGNUM */ + EREG_OFFSET(coproc_state), + + /* lo(33) hi(34) */ + REG_OFFSET(mdlo), REG_OFFSET(mdhi), + + /* bad(35) cause(36) pc(37) */ + EREG_OFFSET(address), EREG_OFFSET(cause), REG_OFFSET(pc), + + /* f0(38) f1(39) f2(40) f3(41) */ + CREG_OFFSET(r0), CREG_OFFSET(r1), CREG_OFFSET(r2), CREG_OFFSET(r3), + CREG_OFFSET(r4), CREG_OFFSET(r5), CREG_OFFSET(r6), CREG_OFFSET(r7), + CREG_OFFSET(r8), CREG_OFFSET(r9), CREG_OFFSET(r10), CREG_OFFSET(r11), + CREG_OFFSET(r12), CREG_OFFSET(r13), CREG_OFFSET(r14), CREG_OFFSET(r15), + CREG_OFFSET(r16), CREG_OFFSET(r17), CREG_OFFSET(r18), CREG_OFFSET(r19), + CREG_OFFSET(r20), CREG_OFFSET(r21), CREG_OFFSET(r22), CREG_OFFSET(r23), + CREG_OFFSET(r24), CREG_OFFSET(r25), CREG_OFFSET(r26), CREG_OFFSET(r27), + CREG_OFFSET(r28), CREG_OFFSET(r29), CREG_OFFSET(r30), CREG_OFFSET(r31), + + /* fsr(70) fir(71) fp(72) == s8(30) */ + CREG_OFFSET(csr), CREG_OFFSET(esr), REG_OFFSET(r30) +}; +#else +/* If the compiler does not grok the above defines */ +static int reg_offset[] = +{ +/* mach_thread_state offsets: */ + -1, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, + 60, 64, 68, 72, 76, 80, 84, 88, 92, 96,100,104, 108,112,116,120, +/*sr, lo, hi,addr,cause,pc */ + 8,124,128, 4, 0,132, +/* mach_float_state offsets: */ + 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, + 64, 68, 72, 76, 80, 84, 88, 92, 96,100,104,108, 112,116,120,124, +/*fsr,fir*/ + 128,132, +/* FP_REGNUM pseudo maps to s8==r30 in mach_thread_state */ + 116 +}; +#endif + +/* Fetch COUNT contiguous registers from thread STATE starting from REGNUM + * Caller knows that the regs handled in one transaction are of same size. + */ +#define FETCH_REGS(state, regnum, count) \ + memcpy (®isters[REGISTER_BYTE (regnum)], \ + (char *)state+reg_offset[ regnum ], \ + count*REGISTER_SIZE) + +/* Store COUNT contiguous registers to thread STATE starting from REGNUM */ +#define STORE_REGS(state, regnum, count) \ + memcpy ((char *)state+reg_offset[ regnum ], \ + ®isters[REGISTER_BYTE (regnum)], \ + count*REGISTER_SIZE) + +#define REGS_ALL -1 +#define REGS_NORMAL 1 +#define REGS_EXC 2 +#define REGS_COP1 4 + +/* Hardware regs that matches FP_REGNUM */ +#define MACH_FP_REGNUM 30 + +/* Fech thread's registers. if regno == -1, fetch all regs */ +void +fetch_inferior_registers (regno) + int regno; +{ + kern_return_t ret; + + thread_state_data_t state; + struct mips_exc_state exc_state; + + int stateCnt = MIPS_THREAD_STATE_COUNT; + + int which_regs = 0; /* A bit mask */ + + if (! MACH_PORT_VALID (current_thread)) + error ("fetch inferior registers: Invalid thread"); + + if (regno < -1 || regno >= NUM_REGS) + error ("invalid register %d supplied to fetch_inferior_registers", regno); + + if (regno == -1) + which_regs = REGS_ALL; + else if (regno == ZERO_REGNUM) + { + int zero = 0; + supply_register (ZERO_REGNUM, &zero); + return; + } + else if ((ZERO_REGNUM < regno && regno < PS_REGNUM) + || regno == FP_REGNUM + || regno == LO_REGNUM + || regno == HI_REGNUM + || regno == PC_REGNUM) + which_regs = REGS_NORMAL; + else if (FP0_REGNUM <= regno && regno <= FCRIR_REGNUM) + which_regs = REGS_COP1 | REGS_EXC; + else + which_regs = REGS_EXC; + + /* fetch regs saved to mips_thread_state */ + if (which_regs & REGS_NORMAL) + { + ret = thread_get_state (current_thread, + MIPS_THREAD_STATE, + state, + &stateCnt); + CHK ("fetch inferior registers: thread_get_state", ret); + + if (which_regs == REGS_NORMAL) + { + /* Fetch also FP_REGNUM if fetching MACH_FP_REGNUM and vice versa */ + if (regno == MACH_FP_REGNUM || regno == FP_REGNUM) + { + supply_register (FP_REGNUM, + (char *)state+reg_offset[ MACH_FP_REGNUM ]); + supply_register (MACH_FP_REGNUM, + (char *)state+reg_offset[ MACH_FP_REGNUM ]); + } + else + supply_register (regno, + (char *)state+reg_offset[ regno ]); + return; + } + + /* ZERO_REGNUM is always zero */ + *(int *) registers = 0; + + /* Copy thread saved regs 1..31 to gdb's reg value array + * Luckily, they are contiquous + */ + FETCH_REGS (state, 1, 31); + + /* Copy mdlo and mdhi */ + FETCH_REGS (state, LO_REGNUM, 2); + + /* Copy PC */ + FETCH_REGS (state, PC_REGNUM, 1); + + /* Mach 3.0 saves FP to MACH_FP_REGNUM. + * For some reason gdb wants to assign a pseudo register for it. + */ + FETCH_REGS (state, FP_REGNUM, 1); + } + + /* Read exc state. Also read if need to fetch floats */ + if (which_regs & REGS_EXC) + { + stateCnt = MIPS_EXC_STATE_COUNT; + ret = thread_get_state (current_thread, + MIPS_EXC_STATE, + (thread_state_t) &exc_state, + &stateCnt); + CHK ("fetch inferior regs (exc): thread_get_state", ret); + + /* We need to fetch exc_state to see if the floating + * state is valid for the thread. + */ + + /* cproc_state: Which coprocessors the thread uses */ + supply_register (PS_REGNUM, + (char *)&exc_state+reg_offset[ PS_REGNUM ]); + + if (which_regs == REGS_EXC || which_regs == REGS_ALL) + { + supply_register (BADVADDR_REGNUM, + (char *)&exc_state+reg_offset[ BADVADDR_REGNUM ]); + + supply_register (CAUSE_REGNUM, + (char *)&exc_state+reg_offset[ CAUSE_REGNUM ]); + if (which_regs == REGS_EXC) + return; + } + } + + + if (which_regs & REGS_COP1) + { + /* If the thread does not have saved COPROC1, set regs to zero */ + + if (! (exc_state.coproc_state & MIPS_STATUS_USE_COP1)) + bzero (®isters[ REGISTER_BYTE (FP0_REGNUM) ], + sizeof (struct mips_float_state)); + else + { + stateCnt = MIPS_FLOAT_STATE_COUNT; + ret = thread_get_state (current_thread, + MIPS_FLOAT_STATE, + state, + &stateCnt); + CHK ("fetch inferior regs (floats): thread_get_state", ret); + + if (regno != -1) + { + supply_register (regno, + (char *)state+reg_offset[ regno ]); + return; + } + + FETCH_REGS (state, FP0_REGNUM, 34); + } + } + + /* All registers are valid, if not returned yet */ + registers_fetched (); +} + +/* Store gdb's view of registers to the thread. + * All registers are always valid when entering here. + * @@ ahem, maybe that is too strict, we could validate the necessary ones + * here. + * + * Hmm. It seems that gdb set $reg=value command first reads everything, + * then sets the reg and then stores everything. -> we must make sure + * that the immutable registers are not changed by reading them first. + */ + +void +store_inferior_registers (regno) + register int regno; +{ + thread_state_data_t state; + kern_return_t ret; + + if (! MACH_PORT_VALID (current_thread)) + error ("store inferior registers: Invalid thread"); + + /* Check for read only regs. + * @@ If some of these is can be changed, fix this + */ + if (regno == ZERO_REGNUM || + regno == PS_REGNUM || + regno == BADVADDR_REGNUM || + regno == CAUSE_REGNUM || + regno == FCRIR_REGNUM) + { + message ("You can not alter read-only register `%s'", + reg_names[ regno ]); + fetch_inferior_registers (regno); + return; + } + + if (regno == -1) + { + /* Don't allow these to change */ + + /* ZERO_REGNUM */ + *(int *)registers = 0; + + fetch_inferior_registers (PS_REGNUM); + fetch_inferior_registers (BADVADDR_REGNUM); + fetch_inferior_registers (CAUSE_REGNUM); + fetch_inferior_registers (FCRIR_REGNUM); + } + + if (regno == -1 || (ZERO_REGNUM < regno && regno <= PC_REGNUM)) + { +#if 1 + /* Mach 3.0 saves thread's FP to MACH_FP_REGNUM. + * GDB wants assigns a pseudo register FP_REGNUM for frame pointer. + * + * @@@ Here I assume (!) that gdb's FP has the value that + * should go to threads frame pointer. If not true, this + * fails badly!!!!! + */ + memcpy (®isters[REGISTER_BYTE (MACH_FP_REGNUM)], + ®isters[REGISTER_BYTE (FP_REGNUM)], + REGISTER_RAW_SIZE (FP_REGNUM)); +#endif + + /* Save gdb's regs 1..31 to thread saved regs 1..31 + * Luckily, they are contiquous + */ + STORE_REGS (state, 1, 31); + + /* Save mdlo, mdhi */ + STORE_REGS (state, LO_REGNUM, 2); + + /* Save PC */ + STORE_REGS (state, PC_REGNUM, 1); + + ret = thread_set_state (current_thread, + MIPS_THREAD_STATE, + state, + MIPS_FLOAT_STATE_COUNT); + CHK ("store inferior regs : thread_set_state", ret); + } + + if (regno == -1 || regno >= FP0_REGNUM) + { + /* If thread has floating state, save it */ + if (read_register (PS_REGNUM) & MIPS_STATUS_USE_COP1) + { + /* Do NOT save FCRIR_REGNUM */ + STORE_REGS (state, FP0_REGNUM, 33); + + ret = thread_set_state (current_thread, + MIPS_FLOAT_STATE, + state, + MIPS_FLOAT_STATE_COUNT); + CHK ("store inferior registers (floats): thread_set_state", ret); + } + else if (regno != -1) + message + ("Thread does not use floating point unit, floating regs not saved"); + } +} diff --git a/contrib/gdb/gdb/mipsv4-nat.c b/contrib/gdb/gdb/mipsv4-nat.c new file mode 100644 index 0000000000000..df4b6e9a090e3 --- /dev/null +++ b/contrib/gdb/gdb/mipsv4-nat.c @@ -0,0 +1,159 @@ +/* Native support for MIPS running SVR4, for GDB. + Copyright 1994, 1995 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "inferior.h" +#include "gdbcore.h" +#include "target.h" + +#include <sys/time.h> +#include <sys/procfs.h> +#include <setjmp.h> /* For JB_XXX. */ + +/* Size of elements in jmpbuf */ + +#define JB_ELEMENT_SIZE 4 + +/* + * See the comment in m68k-tdep.c regarding the utility of these functions. + * + * These definitions are from the MIPS SVR4 ABI, so they may work for + * any MIPS SVR4 target. + */ + +void +supply_gregset (gregsetp) + gregset_t *gregsetp; +{ + register int regi; + register greg_t *regp = &(*gregsetp)[0]; + static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0}; + + for (regi = 0; regi <= CXT_RA; regi++) + supply_register (regi, (char *)(regp + regi)); + + supply_register (PC_REGNUM, (char *)(regp + CXT_EPC)); + supply_register (HI_REGNUM, (char *)(regp + CXT_MDHI)); + supply_register (LO_REGNUM, (char *)(regp + CXT_MDLO)); + supply_register (CAUSE_REGNUM, (char *)(regp + CXT_CAUSE)); + + /* Fill inaccessible registers with zero. */ + supply_register (PS_REGNUM, zerobuf); + supply_register (BADVADDR_REGNUM, zerobuf); + supply_register (FP_REGNUM, zerobuf); + supply_register (UNUSED_REGNUM, zerobuf); + for (regi = FIRST_EMBED_REGNUM; regi <= LAST_EMBED_REGNUM; regi++) + supply_register (regi, zerobuf); +} + +void +fill_gregset (gregsetp, regno) + gregset_t *gregsetp; + int regno; +{ + int regi; + register greg_t *regp = &(*gregsetp)[0]; + + for (regi = 0; regi <= 32; regi++) + if ((regno == -1) || (regno == regi)) + *(regp + regi) = *(greg_t *) ®isters[REGISTER_BYTE (regi)]; + + if ((regno == -1) || (regno == PC_REGNUM)) + *(regp + CXT_EPC) = *(greg_t *) ®isters[REGISTER_BYTE (PC_REGNUM)]; + + if ((regno == -1) || (regno == CAUSE_REGNUM)) + *(regp + CXT_CAUSE) = *(greg_t *) ®isters[REGISTER_BYTE (CAUSE_REGNUM)]; + + if ((regno == -1) || (regno == HI_REGNUM)) + *(regp + CXT_MDHI) = *(greg_t *) ®isters[REGISTER_BYTE (HI_REGNUM)]; + + if ((regno == -1) || (regno == LO_REGNUM)) + *(regp + CXT_MDLO) = *(greg_t *) ®isters[REGISTER_BYTE (LO_REGNUM)]; +} + +/* + * Now we do the same thing for floating-point registers. + * We don't bother to condition on FP0_REGNUM since any + * reasonable MIPS configuration has an R3010 in it. + * + * Again, see the comments in m68k-tdep.c. + */ + +void +supply_fpregset (fpregsetp) + fpregset_t *fpregsetp; +{ + register int regi; + static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0}; + + for (regi = 0; regi < 32; regi++) + supply_register (FP0_REGNUM + regi, + (char *)&fpregsetp->fp_r.fp_regs[regi]); + + supply_register (FCRCS_REGNUM, (char *)&fpregsetp->fp_csr); + + /* FIXME: how can we supply FCRIR_REGNUM? The ABI doesn't tell us. */ + supply_register (FCRIR_REGNUM, zerobuf); +} + +void +fill_fpregset (fpregsetp, regno) + fpregset_t *fpregsetp; + int regno; +{ + int regi; + char *from, *to; + + for (regi = FP0_REGNUM; regi < FP0_REGNUM + 32; regi++) + { + if ((regno == -1) || (regno == regi)) + { + from = (char *) ®isters[REGISTER_BYTE (regi)]; + to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]); + memcpy(to, from, REGISTER_RAW_SIZE (regi)); + } + } + + if ((regno == -1) || (regno == FCRCS_REGNUM)) + fpregsetp->fp_csr = *(unsigned *) ®isters[REGISTER_BYTE(FCRCS_REGNUM)]; +} + + +/* Figure out where the longjmp will land. + We expect the first arg to be a pointer to the jmp_buf structure from which + we extract the pc (_JB_PC) that we will land at. The pc is copied into PC. + This routine returns true on success. */ + +int +get_longjmp_target (pc) + CORE_ADDR *pc; +{ + char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT]; + CORE_ADDR jb_addr; + + jb_addr = read_register (A0_REGNUM); + + if (target_read_memory (jb_addr + _JB_PC * JB_ELEMENT_SIZE, buf, + TARGET_PTR_BIT / TARGET_CHAR_BIT)) + return 0; + + *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); + + return 1; +} diff --git a/contrib/gdb/gdb/rom68k-rom.c b/contrib/gdb/gdb/rom68k-rom.c new file mode 100644 index 0000000000000..208d9aa0762cf --- /dev/null +++ b/contrib/gdb/gdb/rom68k-rom.c @@ -0,0 +1,173 @@ +/* Remote target glue for the ROM68K ROM monitor. + Copyright 1988, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "gdbcore.h" +#include "target.h" +#include "monitor.h" +#include "serial.h" + +static void rom68k_open PARAMS ((char *args, int from_tty)); + +static void +rom68k_supply_register (regname, regnamelen, val, vallen) + char *regname; + int regnamelen; + char *val; + int vallen; +{ + int numregs; + int regno; + + numregs = 1; + regno = -1; + + if (regnamelen == 2) + switch (regname[0]) + { + case 'S': + if (regname[1] == 'R') + regno = PS_REGNUM; + break; + case 'P': + if (regname[1] == 'C') + regno = PC_REGNUM; + break; + case 'D': + if (regname[1] != 'R') + break; + regno = D0_REGNUM; + numregs = 8; + break; + case 'A': + if (regname[1] != 'R') + break; + regno = A0_REGNUM; + numregs = 7; + break; + } + else if (regnamelen == 3) + switch (regname[0]) + { + case 'I': + if (regname[1] == 'S' && regname[2] == 'P') + regno = SP_REGNUM; + } + + if (regno >= 0) + while (numregs-- > 0) + val = monitor_supply_register (regno++, val); +} + +/* This array of registers need to match the indexes used by GDB. + This exists because the various ROM monitors use different strings + than does GDB, and don't necessarily support all the registers + either. So, typing "info reg sp" becomes a "r30". */ + +static char *rom68k_regnames[NUM_REGS] = { + "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", + "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP", + "SR", "PC" }; + +/* Define the monitor command strings. Since these are passed directly + through to a printf style function, we may include formatting + strings. We also need a CR or LF on the end. */ + +static struct target_ops rom68k_ops; + +static char *rom68k_inits[] = {".\r\r", NULL}; /* Exits pm/pr & download cmds */ + +static struct monitor_ops rom68k_cmds = +{ + 0, /* flags */ + rom68k_inits, /* monitor init string */ + "go\r", /* continue command */ + "st\r", /* single step */ + NULL, /* No way to interrupt program */ + "db %x\r", /* set a breakpoint */ + "cb %x\r", /* clear a breakpoint */ + "cb *\r", /* clear all breakpoints */ + "fm %x %x %x\r", /* fill (start len val) */ + { + "pm %x %x\r", /* setmem.cmdb (addr, value) */ + "pm.w %x %x\r", /* setmem.cmdw (addr, value) */ + "pm.l %x %x\r", /* setmem.cmdl (addr, value) */ + NULL, /* setmem.cmdll (addr, value) */ + NULL, /* setreg.resp_delim */ + NULL, /* setreg.term */ + NULL, /* setreg.term_cmd */ + }, + { + "dm %x %x\r", /* getmem.cmdb (addr, len) */ + "dm.w %x %x\r", /* getmem.cmdw (addr, len) */ + "dm.l %x %x\r", /* getmem.cmdl (addr, len) */ + NULL, /* getmem.cmdll (addr, len) */ + " ", /* getmem.resp_delim */ + NULL, /* getmem.term */ + NULL, /* getmem.term_cmd */ + }, + { + "pr %s %x\r", /* setreg.cmd (name, value) */ + NULL, /* setreg.resp_delim */ + NULL, /* setreg.term */ + NULL /* setreg.term_cmd */ + }, + { + "pr %s\r", /* getreg.cmd (name) */ + ": ", /* getreg.resp_delim */ + "= ", /* getreg.term */ + ".\r" /* getreg.term_cmd */ + }, + "dr\r", /* dump_registers */ + /* register_pattern */ + "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)", + rom68k_supply_register, /* supply_register */ + NULL, /* load_routine (defaults to SRECs) */ + "dc\r", /* download command */ + "Waiting for S-records from host... ", /* Load response */ + "ROM68K :-> ", /* monitor command prompt */ + "\r", /* end-of-line terminator */ + ".\r", /* optional command terminator */ + &rom68k_ops, /* target operations */ + SERIAL_1_STOPBITS, /* number of stop bits */ + rom68k_regnames, /* registers names */ + MONITOR_OPS_MAGIC /* magic */ +}; + +static void +rom68k_open (args, from_tty) + char *args; + int from_tty; +{ + monitor_open (args, &rom68k_cmds, from_tty); +} + +void +_initialize_rom68k () +{ + init_monitor_ops (&rom68k_ops); + + rom68k_ops.to_shortname = "rom68k"; + rom68k_ops.to_longname = "Rom68k debug monitor for the IDP Eval board"; + rom68k_ops.to_doc = "Debug on a Motorola IDP eval board running the ROM68K monitor.\n\ +Specify the serial device it is connected to (e.g. /dev/ttya)."; + rom68k_ops.to_open = rom68k_open; + + add_target (&rom68k_ops); +} diff --git a/contrib/gdb/gdb/rs6000-nat.c b/contrib/gdb/gdb/rs6000-nat.c new file mode 100644 index 0000000000000..b9ad387b05d44 --- /dev/null +++ b/contrib/gdb/gdb/rs6000-nat.c @@ -0,0 +1,822 @@ +/* IBM RS/6000 native-dependent code for GDB, the GNU debugger. + Copyright 1986, 1987, 1989, 1991, 1992, 1994, 1995, 1996 + Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "inferior.h" +#include "target.h" +#include "gdbcore.h" +#include "xcoffsolib.h" +#include "symfile.h" +#include "objfiles.h" +#include "libbfd.h" /* For bfd_cache_lookup (FIXME) */ +#include "bfd.h" +#include "gdb-stabs.h" + +#include <sys/ptrace.h> +#include <sys/reg.h> + +#include <sys/param.h> +#include <sys/dir.h> +#include <sys/user.h> +#include <signal.h> +#include <sys/ioctl.h> +#include <fcntl.h> + +#include <a.out.h> +#include <sys/file.h> +#include "gdb_stat.h" +#include <sys/core.h> +#include <sys/ldr.h> + +extern int errno; + +extern struct vmap * map_vmap PARAMS ((bfd *bf, bfd *arch)); + +extern struct target_ops exec_ops; + +static void +exec_one_dummy_insn PARAMS ((void)); + +extern void +add_text_to_loadinfo PARAMS ((CORE_ADDR textaddr, CORE_ADDR dataaddr)); + +extern void +fixup_breakpoints PARAMS ((CORE_ADDR low, CORE_ADDR high, CORE_ADDR delta)); + +/* Conversion from gdb-to-system special purpose register numbers.. */ + +static int special_regs[] = { + IAR, /* PC_REGNUM */ + MSR, /* PS_REGNUM */ + CR, /* CR_REGNUM */ + LR, /* LR_REGNUM */ + CTR, /* CTR_REGNUM */ + XER, /* XER_REGNUM */ + MQ /* MQ_REGNUM */ +}; + +void +fetch_inferior_registers (regno) + int regno; +{ + int ii; + extern char registers[]; + + if (regno < 0) { /* for all registers */ + + /* read 32 general purpose registers. */ + + for (ii=0; ii < 32; ++ii) + *(int*)®isters[REGISTER_BYTE (ii)] = + ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) ii, 0, 0); + + /* read general purpose floating point registers. */ + + for (ii=0; ii < 32; ++ii) + ptrace (PT_READ_FPR, inferior_pid, + (PTRACE_ARG3_TYPE) ®isters [REGISTER_BYTE (FP0_REGNUM+ii)], + FPR0+ii, 0); + + /* read special registers. */ + for (ii=0; ii <= LAST_SP_REGNUM-FIRST_SP_REGNUM; ++ii) + *(int*)®isters[REGISTER_BYTE (FIRST_SP_REGNUM+ii)] = + ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) special_regs[ii], + 0, 0); + + registers_fetched (); + return; + } + + /* else an individual register is addressed. */ + + else if (regno < FP0_REGNUM) { /* a GPR */ + *(int*)®isters[REGISTER_BYTE (regno)] = + ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) regno, 0, 0); + } + else if (regno <= FPLAST_REGNUM) { /* a FPR */ + ptrace (PT_READ_FPR, inferior_pid, + (PTRACE_ARG3_TYPE) ®isters [REGISTER_BYTE (regno)], + (regno-FP0_REGNUM+FPR0), 0); + } + else if (regno <= LAST_SP_REGNUM) { /* a special register */ + *(int*)®isters[REGISTER_BYTE (regno)] = + ptrace (PT_READ_GPR, inferior_pid, + (PTRACE_ARG3_TYPE) special_regs[regno-FIRST_SP_REGNUM], 0, 0); + } + else + fprintf_unfiltered (gdb_stderr, "gdb error: register no %d not implemented.\n", regno); + + register_valid [regno] = 1; +} + +/* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +void +store_inferior_registers (regno) + int regno; +{ + extern char registers[]; + + errno = 0; + + if (regno == -1) + { /* for all registers.. */ + int ii; + + /* execute one dummy instruction (which is a breakpoint) in inferior + process. So give kernel a chance to do internal house keeping. + Otherwise the following ptrace(2) calls will mess up user stack + since kernel will get confused about the bottom of the stack (%sp) */ + + exec_one_dummy_insn (); + + /* write general purpose registers first! */ + for ( ii=GPR0; ii<=GPR31; ++ii) + { + ptrace (PT_WRITE_GPR, inferior_pid, (PTRACE_ARG3_TYPE) ii, + *(int*)®isters[REGISTER_BYTE (ii)], 0); + if (errno) + { + perror ("ptrace write_gpr"); + errno = 0; + } + } + + /* write floating point registers now. */ + for ( ii=0; ii < 32; ++ii) + { + ptrace (PT_WRITE_FPR, inferior_pid, + (PTRACE_ARG3_TYPE) ®isters[REGISTER_BYTE (FP0_REGNUM+ii)], + FPR0+ii, 0); + if (errno) + { + perror ("ptrace write_fpr"); + errno = 0; + } + } + + /* write special registers. */ + for (ii=0; ii <= LAST_SP_REGNUM-FIRST_SP_REGNUM; ++ii) + { + ptrace (PT_WRITE_GPR, inferior_pid, + (PTRACE_ARG3_TYPE) special_regs[ii], + *(int*)®isters[REGISTER_BYTE (FIRST_SP_REGNUM+ii)], 0); + if (errno) + { + perror ("ptrace write_gpr"); + errno = 0; + } + } + } + + /* else, a specific register number is given... */ + + else if (regno < FP0_REGNUM) /* a GPR */ + { + ptrace (PT_WRITE_GPR, inferior_pid, (PTRACE_ARG3_TYPE) regno, + *(int*)®isters[REGISTER_BYTE (regno)], 0); + } + + else if (regno <= FPLAST_REGNUM) /* a FPR */ + { + ptrace (PT_WRITE_FPR, inferior_pid, + (PTRACE_ARG3_TYPE) ®isters[REGISTER_BYTE (regno)], + regno - FP0_REGNUM + FPR0, 0); + } + + else if (regno <= LAST_SP_REGNUM) /* a special register */ + { + ptrace (PT_WRITE_GPR, inferior_pid, + (PTRACE_ARG3_TYPE) special_regs [regno-FIRST_SP_REGNUM], + *(int*)®isters[REGISTER_BYTE (regno)], 0); + } + + else + fprintf_unfiltered (gdb_stderr, "Gdb error: register no %d not implemented.\n", regno); + + if (errno) + { + perror ("ptrace write"); + errno = 0; + } +} + +/* Execute one dummy breakpoint instruction. This way we give the kernel + a chance to do some housekeeping and update inferior's internal data, + including u_area. */ + +static void +exec_one_dummy_insn () +{ +#define DUMMY_INSN_ADDR (TEXT_SEGMENT_BASE)+0x200 + + char shadow_contents[BREAKPOINT_MAX]; /* Stash old bkpt addr contents */ + unsigned int status, pid; + CORE_ADDR prev_pc; + + /* We plant one dummy breakpoint into DUMMY_INSN_ADDR address. We assume that + this address will never be executed again by the real code. */ + + target_insert_breakpoint (DUMMY_INSN_ADDR, shadow_contents); + + errno = 0; + + /* You might think this could be done with a single ptrace call, and + you'd be correct for just about every platform I've ever worked + on. However, rs6000-ibm-aix4.1.3 seems to have screwed this up -- + the inferior never hits the breakpoint (it's also worth noting + powerpc-ibm-aix4.1.3 works correctly). */ + prev_pc = read_pc (); + write_pc (DUMMY_INSN_ADDR); + ptrace (PT_CONTINUE, inferior_pid, (PTRACE_ARG3_TYPE)1, 0, 0); + + if (errno) + perror ("pt_continue"); + + do { + pid = wait (&status); + } while (pid != inferior_pid); + + write_pc (prev_pc); + target_remove_breakpoint (DUMMY_INSN_ADDR, shadow_contents); +} + +static void +fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) + char *core_reg_sect; + unsigned core_reg_size; + int which; + unsigned int reg_addr; /* Unused in this version */ +{ + /* fetch GPRs and special registers from the first register section + in core bfd. */ + if (which == 0) + { + /* copy GPRs first. */ + memcpy (registers, core_reg_sect, 32 * 4); + + /* gdb's internal register template and bfd's register section layout + should share a common include file. FIXMEmgo */ + /* then comes special registes. They are supposed to be in the same + order in gdb template and bfd `.reg' section. */ + core_reg_sect += (32 * 4); + memcpy (®isters [REGISTER_BYTE (FIRST_SP_REGNUM)], core_reg_sect, + (LAST_SP_REGNUM - FIRST_SP_REGNUM + 1) * 4); + } + + /* fetch floating point registers from register section 2 in core bfd. */ + else if (which == 2) + memcpy (®isters [REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 32 * 8); + + else + fprintf_unfiltered (gdb_stderr, "Gdb error: unknown parameter to fetch_core_registers().\n"); +} + +/* handle symbol translation on vmapping */ + +static void +vmap_symtab (vp) + register struct vmap *vp; +{ + register struct objfile *objfile; + CORE_ADDR text_delta; + CORE_ADDR data_delta; + CORE_ADDR bss_delta; + struct section_offsets *new_offsets; + int i; + + objfile = vp->objfile; + if (objfile == NULL) + { + /* OK, it's not an objfile we opened ourselves. + Currently, that can only happen with the exec file, so + relocate the symbols for the symfile. */ + if (symfile_objfile == NULL) + return; + objfile = symfile_objfile; + } + + new_offsets = alloca + (sizeof (struct section_offsets) + + sizeof (new_offsets->offsets) * objfile->num_sections); + + for (i = 0; i < objfile->num_sections; ++i) + ANOFFSET (new_offsets, i) = ANOFFSET (objfile->section_offsets, i); + + text_delta = + vp->tstart - ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + ANOFFSET (new_offsets, SECT_OFF_TEXT) = vp->tstart; + + data_delta = + vp->dstart - ANOFFSET (objfile->section_offsets, SECT_OFF_DATA); + ANOFFSET (new_offsets, SECT_OFF_DATA) = vp->dstart; + + bss_delta = + vp->dstart - ANOFFSET (objfile->section_offsets, SECT_OFF_BSS); + ANOFFSET (new_offsets, SECT_OFF_BSS) = vp->dstart; + + objfile_relocate (objfile, new_offsets); +} + +/* Add symbols for an objfile. */ + +static int +objfile_symbol_add (arg) + char *arg; +{ + struct objfile *obj = (struct objfile *) arg; + + syms_from_objfile (obj, 0, 0, 0); + new_symfile_objfile (obj, 0, 0); + return 1; +} + +/* Add a new vmap entry based on ldinfo() information. + + If ldi->ldinfo_fd is not valid (e.g. this struct ld_info is from a + core file), the caller should set it to -1, and we will open the file. + + Return the vmap new entry. */ + +static struct vmap * +add_vmap (ldi) + register struct ld_info *ldi; +{ + bfd *abfd, *last; + register char *mem, *objname; + struct objfile *obj; + struct vmap *vp; + + /* This ldi structure was allocated using alloca() in + xcoff_relocate_symtab(). Now we need to have persistent object + and member names, so we should save them. */ + + mem = ldi->ldinfo_filename + strlen (ldi->ldinfo_filename) + 1; + mem = savestring (mem, strlen (mem)); + objname = savestring (ldi->ldinfo_filename, strlen (ldi->ldinfo_filename)); + + if (ldi->ldinfo_fd < 0) + /* Note that this opens it once for every member; a possible + enhancement would be to only open it once for every object. */ + abfd = bfd_openr (objname, gnutarget); + else + abfd = bfd_fdopenr (objname, gnutarget, ldi->ldinfo_fd); + if (!abfd) + error ("Could not open `%s' as an executable file: %s", + objname, bfd_errmsg (bfd_get_error ())); + + /* make sure we have an object file */ + + if (bfd_check_format (abfd, bfd_object)) + vp = map_vmap (abfd, 0); + + else if (bfd_check_format (abfd, bfd_archive)) + { + last = 0; + /* FIXME??? am I tossing BFDs? bfd? */ + while ((last = bfd_openr_next_archived_file (abfd, last))) + if (STREQ (mem, last->filename)) + break; + + if (!last) + { + bfd_close (abfd); + /* FIXME -- should be error */ + warning ("\"%s\": member \"%s\" missing.", abfd->filename, mem); + return; + } + + if (!bfd_check_format(last, bfd_object)) + { + bfd_close (last); /* XXX??? */ + goto obj_err; + } + + vp = map_vmap (last, abfd); + } + else + { + obj_err: + bfd_close (abfd); + error ("\"%s\": not in executable format: %s.", + objname, bfd_errmsg (bfd_get_error ())); + /*NOTREACHED*/ + } + obj = allocate_objfile (vp->bfd, 0); + vp->objfile = obj; + +#ifndef SOLIB_SYMBOLS_MANUAL + if (catch_errors (objfile_symbol_add, (char *)obj, + "Error while reading shared library symbols:\n", + RETURN_MASK_ALL)) + { + /* Note this is only done if symbol reading was successful. */ + vmap_symtab (vp); + vp->loaded = 1; + } +#endif + return vp; +} + +/* update VMAP info with ldinfo() information + Input is ptr to ldinfo() results. */ + +static void +vmap_ldinfo (ldi) + register struct ld_info *ldi; +{ + struct stat ii, vi; + register struct vmap *vp; + int got_one, retried; + int got_exec_file; + + /* For each *ldi, see if we have a corresponding *vp. + If so, update the mapping, and symbol table. + If not, add an entry and symbol table. */ + + do { + char *name = ldi->ldinfo_filename; + char *memb = name + strlen(name) + 1; + + retried = 0; + + if (fstat (ldi->ldinfo_fd, &ii) < 0) + fatal ("cannot fstat(fd=%d) on %s", ldi->ldinfo_fd, name); + retry: + for (got_one = 0, vp = vmap; vp; vp = vp->nxt) + { + /* First try to find a `vp', which is the same as in ldinfo. + If not the same, just continue and grep the next `vp'. If same, + relocate its tstart, tend, dstart, dend values. If no such `vp' + found, get out of this for loop, add this ldi entry as a new vmap + (add_vmap) and come back, fins its `vp' and so on... */ + + /* The filenames are not always sufficient to match on. */ + + if ((name[0] == '/' && !STREQ(name, vp->name)) + || (memb[0] && !STREQ(memb, vp->member))) + continue; + + /* See if we are referring to the same file. */ + if (bfd_stat (vp->bfd, &vi) < 0) + /* An error here is innocuous, most likely meaning that + the file descriptor has become worthless. + FIXME: What does it mean for a file descriptor to become + "worthless"? What makes it happen? What error does it + produce (ENOENT? others?)? Should we at least provide + a warning? */ + continue; + + if (ii.st_dev != vi.st_dev || ii.st_ino != vi.st_ino) + continue; + + if (!retried) + close (ldi->ldinfo_fd); + + ++got_one; + + /* Found a corresponding VMAP. Remap! */ + + /* We can assume pointer == CORE_ADDR, this code is native only. */ + vp->tstart = (CORE_ADDR) ldi->ldinfo_textorg; + vp->tend = vp->tstart + ldi->ldinfo_textsize; + vp->dstart = (CORE_ADDR) ldi->ldinfo_dataorg; + vp->dend = vp->dstart + ldi->ldinfo_datasize; + + if (vp->tadj) + { + vp->tstart += vp->tadj; + vp->tend += vp->tadj; + } + + /* The objfile is only NULL for the exec file. */ + if (vp->objfile == NULL) + got_exec_file = 1; + +#ifdef DONT_RELOCATE_SYMFILE_OBJFILE + if (vp->objfile == symfile_objfile + || vp->objfile == NULL) + { + ldi->ldinfo_dataorg = 0; + vp->dstart = (CORE_ADDR) 0; + vp->dend = ldi->ldinfo_datasize; + } +#endif + + /* relocate symbol table(s). */ + vmap_symtab (vp); + + /* There may be more, so we don't break out of the loop. */ + } + + /* if there was no matching *vp, we must perforce create the sucker(s) */ + if (!got_one && !retried) + { + add_vmap (ldi); + ++retried; + goto retry; + } + } while (ldi->ldinfo_next + && (ldi = (void *) (ldi->ldinfo_next + (char *) ldi))); + + /* If we don't find the symfile_objfile anywhere in the ldinfo, it + is unlikely that the symbol file is relocated to the proper + address. And we might have attached to a process which is + running a different copy of the same executable. */ + if (symfile_objfile != NULL && !got_exec_file) + { + warning_begin (); + fputs_unfiltered ("Symbol file ", gdb_stderr); + fputs_unfiltered (symfile_objfile->name, gdb_stderr); + fputs_unfiltered ("\nis not mapped; discarding it.\n\ +If in fact that file has symbols which the mapped files listed by\n\ +\"info files\" lack, you can load symbols with the \"symbol-file\" or\n\ +\"add-symbol-file\" commands (note that you must take care of relocating\n\ +symbols to the proper address).\n", gdb_stderr); + free_objfile (symfile_objfile); + symfile_objfile = NULL; + } + breakpoint_re_set (); +} + +/* As well as symbol tables, exec_sections need relocation. After + the inferior process' termination, there will be a relocated symbol + table exist with no corresponding inferior process. At that time, we + need to use `exec' bfd, rather than the inferior process's memory space + to look up symbols. + + `exec_sections' need to be relocated only once, as long as the exec + file remains unchanged. +*/ + +static void +vmap_exec () +{ + static bfd *execbfd; + int i; + + if (execbfd == exec_bfd) + return; + + execbfd = exec_bfd; + + if (!vmap || !exec_ops.to_sections) + error ("vmap_exec: vmap or exec_ops.to_sections == 0\n"); + + for (i=0; &exec_ops.to_sections[i] < exec_ops.to_sections_end; i++) + { + if (STREQ(".text", exec_ops.to_sections[i].the_bfd_section->name)) + { + exec_ops.to_sections[i].addr += vmap->tstart; + exec_ops.to_sections[i].endaddr += vmap->tstart; + } + else if (STREQ(".data", exec_ops.to_sections[i].the_bfd_section->name)) + { + exec_ops.to_sections[i].addr += vmap->dstart; + exec_ops.to_sections[i].endaddr += vmap->dstart; + } + } +} + +/* xcoff_relocate_symtab - hook for symbol table relocation. + also reads shared libraries.. */ + +void +xcoff_relocate_symtab (pid) + unsigned int pid; +{ +#define MAX_LOAD_SEGS 64 /* maximum number of load segments */ + + struct ld_info *ldi; + + ldi = (void *) alloca(MAX_LOAD_SEGS * sizeof (*ldi)); + + /* According to my humble theory, AIX has some timing problems and + when the user stack grows, kernel doesn't update stack info in time + and ptrace calls step on user stack. That is why we sleep here a little, + and give kernel to update its internals. */ + + usleep (36000); + + errno = 0; + ptrace (PT_LDINFO, pid, (PTRACE_ARG3_TYPE) ldi, + MAX_LOAD_SEGS * sizeof(*ldi), ldi); + if (errno) + perror_with_name ("ptrace ldinfo"); + + vmap_ldinfo (ldi); + + do { + /* We are allowed to assume CORE_ADDR == pointer. This code is + native only. */ + add_text_to_loadinfo ((CORE_ADDR) ldi->ldinfo_textorg, + (CORE_ADDR) ldi->ldinfo_dataorg); + } while (ldi->ldinfo_next + && (ldi = (void *) (ldi->ldinfo_next + (char *) ldi))); + +#if 0 + /* Now that we've jumbled things around, re-sort them. */ + sort_minimal_symbols (); +#endif + + /* relocate the exec and core sections as well. */ + vmap_exec (); +} + +/* Core file stuff. */ + +/* Relocate symtabs and read in shared library info, based on symbols + from the core file. */ + +void +xcoff_relocate_core (target) + struct target_ops *target; +{ +/* Offset of member MEMBER in a struct of type TYPE. */ +#ifndef offsetof +#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER) +#endif + +/* Size of a struct ld_info except for the variable-length filename. */ +#define LDINFO_SIZE (offsetof (struct ld_info, ldinfo_filename)) + + sec_ptr ldinfo_sec; + int offset = 0; + struct ld_info *ldip; + struct vmap *vp; + + /* Allocated size of buffer. */ + int buffer_size = LDINFO_SIZE; + char *buffer = xmalloc (buffer_size); + struct cleanup *old = make_cleanup (free_current_contents, &buffer); + + /* FIXME, this restriction should not exist. For now, though I'll + avoid coredumps with error() pending a real fix. */ + if (vmap == NULL) + error + ("Can't debug a core file without an executable file (on the RS/6000)"); + + ldinfo_sec = bfd_get_section_by_name (core_bfd, ".ldinfo"); + if (ldinfo_sec == NULL) + { + bfd_err: + fprintf_filtered (gdb_stderr, "Couldn't get ldinfo from core file: %s\n", + bfd_errmsg (bfd_get_error ())); + do_cleanups (old); + return; + } + do + { + int i; + int names_found = 0; + + /* Read in everything but the name. */ + if (bfd_get_section_contents (core_bfd, ldinfo_sec, buffer, + offset, LDINFO_SIZE) == 0) + goto bfd_err; + + /* Now the name. */ + i = LDINFO_SIZE; + do + { + if (i == buffer_size) + { + buffer_size *= 2; + buffer = xrealloc (buffer, buffer_size); + } + if (bfd_get_section_contents (core_bfd, ldinfo_sec, &buffer[i], + offset + i, 1) == 0) + goto bfd_err; + if (buffer[i++] == '\0') + ++names_found; + } while (names_found < 2); + + ldip = (struct ld_info *) buffer; + + /* Can't use a file descriptor from the core file; need to open it. */ + ldip->ldinfo_fd = -1; + + /* The first ldinfo is for the exec file, allocated elsewhere. */ + if (offset == 0) + vp = vmap; + else + vp = add_vmap (ldip); + + offset += ldip->ldinfo_next; + + /* We can assume pointer == CORE_ADDR, this code is native only. */ + vp->tstart = (CORE_ADDR) ldip->ldinfo_textorg; + vp->tend = vp->tstart + ldip->ldinfo_textsize; + vp->dstart = (CORE_ADDR) ldip->ldinfo_dataorg; + vp->dend = vp->dstart + ldip->ldinfo_datasize; + +#ifdef DONT_RELOCATE_SYMFILE_OBJFILE + if (vp == vmap) + { + vp->dstart = (CORE_ADDR) 0; + vp->dend = ldip->ldinfo_datasize; + } +#endif + + if (vp->tadj != 0) + { + vp->tstart += vp->tadj; + vp->tend += vp->tadj; + } + + /* Unless this is the exec file, + add our sections to the section table for the core target. */ + if (vp != vmap) + { + int count; + struct section_table *stp; + int update_coreops; + + /* We must update the to_sections field in the core_ops structure + now to avoid dangling pointer dereferences. */ + update_coreops = core_ops.to_sections == target->to_sections; + + count = target->to_sections_end - target->to_sections; + count += 2; + target->to_sections = (struct section_table *) + xrealloc (target->to_sections, + sizeof (struct section_table) * count); + target->to_sections_end = target->to_sections + count; + + /* Update the to_sections field in the core_ops structure + if needed. */ + if (update_coreops) + { + core_ops.to_sections = target->to_sections; + core_ops.to_sections_end = target->to_sections_end; + } + stp = target->to_sections_end - 2; + + /* "Why do we add bfd_section_vma?", I hear you cry. + Well, the start of the section in the file is actually + that far into the section as the struct vmap understands it. + So for text sections, bfd_section_vma tends to be 0x200, + and if vp->tstart is 0xd0002000, then the first byte of + the text section on disk corresponds to address 0xd0002200. */ + stp->bfd = vp->bfd; + stp->the_bfd_section = bfd_get_section_by_name (stp->bfd, ".text"); + stp->addr = bfd_section_vma (stp->bfd, stp->the_bfd_section) + vp->tstart; + stp->endaddr = bfd_section_vma (stp->bfd, stp->the_bfd_section) + vp->tend; + stp++; + + stp->bfd = vp->bfd; + stp->the_bfd_section = bfd_get_section_by_name (stp->bfd, ".data"); + stp->addr = bfd_section_vma (stp->bfd, stp->the_bfd_section) + vp->dstart; + stp->endaddr = bfd_section_vma (stp->bfd, stp->the_bfd_section) + vp->dend; + } + + vmap_symtab (vp); + + add_text_to_loadinfo ((CORE_ADDR)ldip->ldinfo_textorg, + (CORE_ADDR)ldip->ldinfo_dataorg); + } while (ldip->ldinfo_next != 0); + vmap_exec (); + breakpoint_re_set (); + do_cleanups (old); +} + +int +kernel_u_size () +{ + return (sizeof (struct user)); +} + + +/* Register that we are able to handle rs6000 core file formats. */ + +static struct core_fns rs6000_core_fns = +{ + bfd_target_coff_flavour, + fetch_core_registers, + NULL +}; + +void +_initialize_core_rs6000 () +{ + add_core_fns (&rs6000_core_fns); +} diff --git a/contrib/gdb/gdb/rs6000-tdep.c b/contrib/gdb/gdb/rs6000-tdep.c new file mode 100644 index 0000000000000..614a28264066e --- /dev/null +++ b/contrib/gdb/gdb/rs6000-tdep.c @@ -0,0 +1,1277 @@ +/* Target-dependent code for GDB, the GNU debugger. + Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995 + Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "frame.h" +#include "inferior.h" +#include "symtab.h" +#include "target.h" +#include "gdbcore.h" +#include "symfile.h" +#include "objfiles.h" +#include "xcoffsolib.h" + +extern struct obstack frame_cache_obstack; + +extern int errno; + +/* Nonzero if we just simulated a single step break. */ +int one_stepped; + +/* Breakpoint shadows for the single step instructions will be kept here. */ + +static struct sstep_breaks { + /* Address, or 0 if this is not in use. */ + CORE_ADDR address; + /* Shadow contents. */ + char data[4]; +} stepBreaks[2]; + +/* Static function prototypes */ + +static CORE_ADDR find_toc_address PARAMS ((CORE_ADDR pc)); + +static CORE_ADDR branch_dest PARAMS ((int opcode, int instr, CORE_ADDR pc, + CORE_ADDR safety)); + +static void frame_get_cache_fsr PARAMS ((struct frame_info *fi, + struct rs6000_framedata *fdatap)); + +/* Calculate the destination of a branch/jump. Return -1 if not a branch. */ + +static CORE_ADDR +branch_dest (opcode, instr, pc, safety) + int opcode; + int instr; + CORE_ADDR pc; + CORE_ADDR safety; +{ + register long offset; + CORE_ADDR dest; + int immediate; + int absolute; + int ext_op; + + absolute = (int) ((instr >> 1) & 1); + + switch (opcode) { + case 18 : + immediate = ((instr & ~3) << 6) >> 6; /* br unconditional */ + if (absolute) + dest = immediate; + else + dest = pc + immediate; + break; + + case 16 : + immediate = ((instr & ~3) << 16) >> 16; /* br conditional */ + if (absolute) + dest = immediate; + else + dest = pc + immediate; + break; + + case 19 : + ext_op = (instr>>1) & 0x3ff; + + if (ext_op == 16) /* br conditional register */ + dest = read_register (LR_REGNUM) & ~3; + + else if (ext_op == 528) /* br cond to count reg */ + { + dest = read_register (CTR_REGNUM) & ~3; + + /* If we are about to execute a system call, dest is something + like 0x22fc or 0x3b00. Upon completion the system call + will return to the address in the link register. */ + if (dest < TEXT_SEGMENT_BASE) + dest = read_register (LR_REGNUM) & ~3; + } + else return -1; + break; + + default: return -1; + } + return (dest < TEXT_SEGMENT_BASE) ? safety : dest; +} + + + +/* AIX does not support PT_STEP. Simulate it. */ + +void +single_step (signal) + int signal; +{ +#define INSNLEN(OPCODE) 4 + + static char le_breakp[] = LITTLE_BREAKPOINT; + static char be_breakp[] = BIG_BREAKPOINT; + char *breakp = TARGET_BYTE_ORDER == BIG_ENDIAN ? be_breakp : le_breakp; + int ii, insn; + CORE_ADDR loc; + CORE_ADDR breaks[2]; + int opcode; + + if (!one_stepped) { + loc = read_pc (); + + insn = read_memory_integer (loc, 4); + + breaks[0] = loc + INSNLEN(insn); + opcode = insn >> 26; + breaks[1] = branch_dest (opcode, insn, loc, breaks[0]); + + /* Don't put two breakpoints on the same address. */ + if (breaks[1] == breaks[0]) + breaks[1] = -1; + + stepBreaks[1].address = 0; + + for (ii=0; ii < 2; ++ii) { + + /* ignore invalid breakpoint. */ + if ( breaks[ii] == -1) + continue; + + read_memory (breaks[ii], stepBreaks[ii].data, 4); + + write_memory (breaks[ii], breakp, 4); + stepBreaks[ii].address = breaks[ii]; + } + + one_stepped = 1; + } else { + + /* remove step breakpoints. */ + for (ii=0; ii < 2; ++ii) + if (stepBreaks[ii].address != 0) + write_memory + (stepBreaks[ii].address, stepBreaks[ii].data, 4); + + one_stepped = 0; + } + errno = 0; /* FIXME, don't ignore errors! */ + /* What errors? {read,write}_memory call error(). */ +} + + +/* return pc value after skipping a function prologue and also return + information about a function frame. + + in struct rs6000_frameinfo fdata: + - frameless is TRUE, if function does not have a frame. + - nosavedpc is TRUE, if function does not save %pc value in its frame. + - offset is the number of bytes used in the frame to save registers. + - saved_gpr is the number of the first saved gpr. + - saved_fpr is the number of the first saved fpr. + - alloca_reg is the number of the register used for alloca() handling. + Otherwise -1. + - gpr_offset is the offset of the saved gprs + - fpr_offset is the offset of the saved fprs + - lr_offset is the offset of the saved lr + - cr_offset is the offset of the saved cr + */ + +#define SIGNED_SHORT(x) \ + ((sizeof (short) == 2) \ + ? ((int)(short)(x)) \ + : ((int)((((x) & 0xffff) ^ 0x8000) - 0x8000))) + +#define GET_SRC_REG(x) (((x) >> 21) & 0x1f) + +CORE_ADDR +skip_prologue (pc, fdata) + CORE_ADDR pc; + struct rs6000_framedata *fdata; +{ + CORE_ADDR orig_pc = pc; + char buf[4]; + unsigned long op; + long offset = 0; + int lr_reg = 0; + int cr_reg = 0; + int reg; + int framep = 0; + int minimal_toc_loaded = 0; + static struct rs6000_framedata zero_frame; + + *fdata = zero_frame; + fdata->saved_gpr = -1; + fdata->saved_fpr = -1; + fdata->alloca_reg = -1; + fdata->frameless = 1; + fdata->nosavedpc = 1; + + if (target_read_memory (pc, buf, 4)) + return pc; /* Can't access it -- assume no prologue. */ + + /* Assume that subsequent fetches can fail with low probability. */ + pc -= 4; + for (;;) + { + pc += 4; + op = read_memory_integer (pc, 4); + + if ((op & 0xfc1fffff) == 0x7c0802a6) { /* mflr Rx */ + lr_reg = (op & 0x03e00000) | 0x90010000; + continue; + + } else if ((op & 0xfc1fffff) == 0x7c000026) { /* mfcr Rx */ + cr_reg = (op & 0x03e00000) | 0x90010000; + continue; + + } else if ((op & 0xfc1f0000) == 0xd8010000) { /* stfd Rx,NUM(r1) */ + reg = GET_SRC_REG (op); + if (fdata->saved_fpr == -1 || fdata->saved_fpr > reg) { + fdata->saved_fpr = reg; + fdata->fpr_offset = SIGNED_SHORT (op) + offset; + } + continue; + + } else if (((op & 0xfc1f0000) == 0xbc010000) || /* stm Rx, NUM(r1) */ + ((op & 0xfc1f0000) == 0x90010000 && /* st rx,NUM(r1), rx >= r13 */ + (op & 0x03e00000) >= 0x01a00000)) { + + reg = GET_SRC_REG (op); + if (fdata->saved_gpr == -1 || fdata->saved_gpr > reg) { + fdata->saved_gpr = reg; + fdata->gpr_offset = SIGNED_SHORT (op) + offset; + } + continue; + + } else if ((op & 0xffff0000) == 0x3c000000) { /* addis 0,0,NUM, used for >= 32k frames */ + fdata->offset = (op & 0x0000ffff) << 16; + fdata->frameless = 0; + continue; + + } else if ((op & 0xffff0000) == 0x60000000) { /* ori 0,0,NUM, 2nd half of >= 32k frames */ + fdata->offset |= (op & 0x0000ffff); + fdata->frameless = 0; + continue; + + } else if ((op & 0xffff0000) == lr_reg) { /* st Rx,NUM(r1) where Rx == lr */ + fdata->lr_offset = SIGNED_SHORT (op) + offset; + fdata->nosavedpc = 0; + lr_reg = 0; + continue; + + } else if ((op & 0xffff0000) == cr_reg) { /* st Rx,NUM(r1) where Rx == cr */ + fdata->cr_offset = SIGNED_SHORT (op) + offset; + cr_reg = 0; + continue; + + } else if (op == 0x48000005) { /* bl .+4 used in -mrelocatable */ + continue; + + } else if (op == 0x48000004) { /* b .+4 (xlc) */ + break; + + } else if (((op & 0xffff0000) == 0x801e0000 || /* lwz 0,NUM(r30), used in V.4 -mrelocatable */ + op == 0x7fc0f214) && /* add r30,r0,r30, used in V.4 -mrelocatable */ + lr_reg == 0x901e0000) { + continue; + + } else if ((op & 0xffff0000) == 0x3fc00000 || /* addis 30,0,foo@ha, used in V.4 -mminimal-toc */ + (op & 0xffff0000) == 0x3bde0000) { /* addi 30,30,foo@l */ + continue; + + } else if ((op & 0xfc000000) == 0x48000000) { /* bl foo, to save fprs??? */ + + fdata->frameless = 0; + /* Don't skip over the subroutine call if it is not within the first + three instructions of the prologue. */ + if ((pc - orig_pc) > 8) + break; + + op = read_memory_integer (pc+4, 4); + + /* At this point, make sure this is not a trampoline function + (a function that simply calls another functions, and nothing else). + If the next is not a nop, this branch was part of the function + prologue. */ + + if (op == 0x4def7b82 || op == 0) /* crorc 15, 15, 15 */ + break; /* don't skip over this branch */ + + continue; + + /* update stack pointer */ + } else if ((op & 0xffff0000) == 0x94210000) { /* stu r1,NUM(r1) */ + fdata->frameless = 0; + fdata->offset = SIGNED_SHORT (op); + offset = fdata->offset; + continue; + + } else if (op == 0x7c21016e) { /* stwux 1,1,0 */ + fdata->frameless = 0; + offset = fdata->offset; + continue; + + /* Load up minimal toc pointer */ + } else if ((op >> 22) == 0x20f + && ! minimal_toc_loaded) { /* l r31,... or l r30,... */ + minimal_toc_loaded = 1; + continue; + + /* store parameters in stack */ + } else if ((op & 0xfc1f0000) == 0x90010000 || /* st rx,NUM(r1) */ + (op & 0xfc1f0000) == 0xd8010000 || /* stfd Rx,NUM(r1) */ + (op & 0xfc1f0000) == 0xfc010000) { /* frsp, fp?,NUM(r1) */ + continue; + + /* store parameters in stack via frame pointer */ + } else if (framep && + (op & 0xfc1f0000) == 0x901f0000 || /* st rx,NUM(r1) */ + (op & 0xfc1f0000) == 0xd81f0000 || /* stfd Rx,NUM(r1) */ + (op & 0xfc1f0000) == 0xfc1f0000) { /* frsp, fp?,NUM(r1) */ + continue; + + /* Set up frame pointer */ + } else if (op == 0x603f0000 /* oril r31, r1, 0x0 */ + || op == 0x7c3f0b78) { /* mr r31, r1 */ + fdata->frameless = 0; + framep = 1; + fdata->alloca_reg = 31; + continue; + + /* Another way to set up the frame pointer. */ + } else if ((op & 0xfc1fffff) == 0x38010000) { /* addi rX, r1, 0x0 */ + fdata->frameless = 0; + framep = 1; + fdata->alloca_reg = (op & ~0x38010000) >> 21; + continue; + + } else { + break; + } + } + +#if 0 +/* I have problems with skipping over __main() that I need to address + * sometime. Previously, I used to use misc_function_vector which + * didn't work as well as I wanted to be. -MGO */ + + /* If the first thing after skipping a prolog is a branch to a function, + this might be a call to an initializer in main(), introduced by gcc2. + We'd like to skip over it as well. Fortunately, xlc does some extra + work before calling a function right after a prologue, thus we can + single out such gcc2 behaviour. */ + + + if ((op & 0xfc000001) == 0x48000001) { /* bl foo, an initializer function? */ + op = read_memory_integer (pc+4, 4); + + if (op == 0x4def7b82) { /* cror 0xf, 0xf, 0xf (nop) */ + + /* check and see if we are in main. If so, skip over this initializer + function as well. */ + + tmp = find_pc_misc_function (pc); + if (tmp >= 0 && STREQ (misc_function_vector [tmp].name, "main")) + return pc + 8; + } + } +#endif /* 0 */ + + fdata->offset = - fdata->offset; + return pc; +} + + +/************************************************************************* + Support for creating pushind a dummy frame into the stack, and popping + frames, etc. +*************************************************************************/ + +/* The total size of dummy frame is 436, which is; + + 32 gpr's - 128 bytes + 32 fpr's - 256 " + 7 the rest - 28 " + and 24 extra bytes for the callee's link area. The last 24 bytes + for the link area might not be necessary, since it will be taken + care of by push_arguments(). */ + +#define DUMMY_FRAME_SIZE 436 + +#define DUMMY_FRAME_ADDR_SIZE 10 + +/* Make sure you initialize these in somewhere, in case gdb gives up what it + was debugging and starts debugging something else. FIXMEibm */ + +static int dummy_frame_count = 0; +static int dummy_frame_size = 0; +static CORE_ADDR *dummy_frame_addr = 0; + +extern int stop_stack_dummy; + +/* push a dummy frame into stack, save all register. Currently we are saving + only gpr's and fpr's, which is not good enough! FIXMEmgo */ + +void +push_dummy_frame () +{ + /* stack pointer. */ + CORE_ADDR sp; + /* Same thing, target byte order. */ + char sp_targ[4]; + + /* link register. */ + CORE_ADDR pc; + /* Same thing, target byte order. */ + char pc_targ[4]; + + /* Needed to figure out where to save the dummy link area. + FIXME: There should be an easier way to do this, no? tiemann 9/9/95. */ + struct rs6000_framedata fdata; + + int ii; + + target_fetch_registers (-1); + + if (dummy_frame_count >= dummy_frame_size) { + dummy_frame_size += DUMMY_FRAME_ADDR_SIZE; + if (dummy_frame_addr) + dummy_frame_addr = (CORE_ADDR*) xrealloc + (dummy_frame_addr, sizeof(CORE_ADDR) * (dummy_frame_size)); + else + dummy_frame_addr = (CORE_ADDR*) + xmalloc (sizeof(CORE_ADDR) * (dummy_frame_size)); + } + + sp = read_register(SP_REGNUM); + pc = read_register(PC_REGNUM); + store_address (pc_targ, 4, pc); + + (void) skip_prologue (get_pc_function_start (pc) + FUNCTION_START_OFFSET, &fdata); + + dummy_frame_addr [dummy_frame_count++] = sp; + + /* Be careful! If the stack pointer is not decremented first, then kernel + thinks he is free to use the space underneath it. And kernel actually + uses that area for IPC purposes when executing ptrace(2) calls. So + before writing register values into the new frame, decrement and update + %sp first in order to secure your frame. */ + + /* FIXME: We don't check if the stack really has this much space. + This is a problem on the ppc simulator (which only grants one page + (4096 bytes) by default. */ + + write_register (SP_REGNUM, sp-DUMMY_FRAME_SIZE); + + /* gdb relies on the state of current_frame. We'd better update it, + otherwise things like do_registers_info() wouldn't work properly! */ + + flush_cached_frames (); + + /* save program counter in link register's space. */ + write_memory (sp + (fdata.lr_offset ? fdata.lr_offset : DEFAULT_LR_SAVE), + pc_targ, 4); + + /* save all floating point and general purpose registers here. */ + + /* fpr's, f0..f31 */ + for (ii = 0; ii < 32; ++ii) + write_memory (sp-8-(ii*8), ®isters[REGISTER_BYTE (31-ii+FP0_REGNUM)], 8); + + /* gpr's r0..r31 */ + for (ii=1; ii <=32; ++ii) + write_memory (sp-256-(ii*4), ®isters[REGISTER_BYTE (32-ii)], 4); + + /* so far, 32*2 + 32 words = 384 bytes have been written. + 7 extra registers in our register set: pc, ps, cnd, lr, cnt, xer, mq */ + + for (ii=1; ii <= (LAST_SP_REGNUM-FIRST_SP_REGNUM+1); ++ii) { + write_memory (sp-384-(ii*4), + ®isters[REGISTER_BYTE (FPLAST_REGNUM + ii)], 4); + } + + /* Save sp or so called back chain right here. */ + store_address (sp_targ, 4, sp); + write_memory (sp-DUMMY_FRAME_SIZE, sp_targ, 4); + sp -= DUMMY_FRAME_SIZE; + + /* And finally, this is the back chain. */ + write_memory (sp+8, pc_targ, 4); +} + + +/* Pop a dummy frame. + + In rs6000 when we push a dummy frame, we save all of the registers. This + is usually done before user calls a function explicitly. + + After a dummy frame is pushed, some instructions are copied into stack, + and stack pointer is decremented even more. Since we don't have a frame + pointer to get back to the parent frame of the dummy, we start having + trouble poping it. Therefore, we keep a dummy frame stack, keeping + addresses of dummy frames as such. When poping happens and when we + detect that was a dummy frame, we pop it back to its parent by using + dummy frame stack (`dummy_frame_addr' array). + +FIXME: This whole concept is broken. You should be able to detect +a dummy stack frame *on the user's stack itself*. When you do, +then you know the format of that stack frame -- including its +saved SP register! There should *not* be a separate stack in the +GDB process that keeps track of these dummy frames! -- gnu@cygnus.com Aug92 + */ + +pop_dummy_frame () +{ + CORE_ADDR sp, pc; + int ii; + sp = dummy_frame_addr [--dummy_frame_count]; + + /* restore all fpr's. */ + for (ii = 1; ii <= 32; ++ii) + read_memory (sp-(ii*8), ®isters[REGISTER_BYTE (32-ii+FP0_REGNUM)], 8); + + /* restore all gpr's */ + for (ii=1; ii <= 32; ++ii) { + read_memory (sp-256-(ii*4), ®isters[REGISTER_BYTE (32-ii)], 4); + } + + /* restore the rest of the registers. */ + for (ii=1; ii <=(LAST_SP_REGNUM-FIRST_SP_REGNUM+1); ++ii) + read_memory (sp-384-(ii*4), + ®isters[REGISTER_BYTE (FPLAST_REGNUM + ii)], 4); + + read_memory (sp-(DUMMY_FRAME_SIZE-8), + ®isters [REGISTER_BYTE(PC_REGNUM)], 4); + + /* when a dummy frame was being pushed, we had to decrement %sp first, in + order to secure astack space. Thus, saved %sp (or %r1) value, is not the + one we should restore. Change it with the one we need. */ + + *(int*)®isters [REGISTER_BYTE(FP_REGNUM)] = sp; + + /* Now we can restore all registers. */ + + target_store_registers (-1); + pc = read_pc (); + flush_cached_frames (); +} + + +/* pop the innermost frame, go back to the caller. */ + +void +pop_frame () +{ + CORE_ADDR pc, lr, sp, prev_sp; /* %pc, %lr, %sp */ + struct rs6000_framedata fdata; + struct frame_info *frame = get_current_frame (); + int addr, ii; + + pc = read_pc (); + sp = FRAME_FP (frame); + + if (stop_stack_dummy && dummy_frame_count) { + pop_dummy_frame (); + return; + } + + /* Make sure that all registers are valid. */ + read_register_bytes (0, NULL, REGISTER_BYTES); + + /* figure out previous %pc value. If the function is frameless, it is + still in the link register, otherwise walk the frames and retrieve the + saved %pc value in the previous frame. */ + + addr = get_pc_function_start (frame->pc) + FUNCTION_START_OFFSET; + (void) skip_prologue (addr, &fdata); + + if (fdata.frameless) + prev_sp = sp; + else + prev_sp = read_memory_integer (sp, 4); + if (fdata.lr_offset == 0) + lr = read_register (LR_REGNUM); + else + lr = read_memory_integer (prev_sp + fdata.lr_offset, 4); + + /* reset %pc value. */ + write_register (PC_REGNUM, lr); + + /* reset register values if any was saved earlier. */ + addr = prev_sp - fdata.offset; + + if (fdata.saved_gpr != -1) + for (ii = fdata.saved_gpr; ii <= 31; ++ii) { + read_memory (addr, ®isters [REGISTER_BYTE (ii)], 4); + addr += 4; + } + + if (fdata.saved_fpr != -1) + for (ii = fdata.saved_fpr; ii <= 31; ++ii) { + read_memory (addr, ®isters [REGISTER_BYTE (ii+FP0_REGNUM)], 8); + addr += 8; + } + + write_register (SP_REGNUM, prev_sp); + target_store_registers (-1); + flush_cached_frames (); +} + +/* fixup the call sequence of a dummy function, with the real function address. + its argumets will be passed by gdb. */ + +void +fix_call_dummy (dummyname, pc, fun, nargs, type) + char *dummyname; + CORE_ADDR pc; + CORE_ADDR fun; + int nargs; /* not used */ + int type; /* not used */ +{ +#define TOC_ADDR_OFFSET 20 +#define TARGET_ADDR_OFFSET 28 + + int ii; + CORE_ADDR target_addr; + CORE_ADDR tocvalue; + + target_addr = fun; + tocvalue = find_toc_address (target_addr); + + ii = *(int*)((char*)dummyname + TOC_ADDR_OFFSET); + ii = (ii & 0xffff0000) | (tocvalue >> 16); + *(int*)((char*)dummyname + TOC_ADDR_OFFSET) = ii; + + ii = *(int*)((char*)dummyname + TOC_ADDR_OFFSET+4); + ii = (ii & 0xffff0000) | (tocvalue & 0x0000ffff); + *(int*)((char*)dummyname + TOC_ADDR_OFFSET+4) = ii; + + ii = *(int*)((char*)dummyname + TARGET_ADDR_OFFSET); + ii = (ii & 0xffff0000) | (target_addr >> 16); + *(int*)((char*)dummyname + TARGET_ADDR_OFFSET) = ii; + + ii = *(int*)((char*)dummyname + TARGET_ADDR_OFFSET+4); + ii = (ii & 0xffff0000) | (target_addr & 0x0000ffff); + *(int*)((char*)dummyname + TARGET_ADDR_OFFSET+4) = ii; +} + +/* Pass the arguments in either registers, or in the stack. In RS6000, + the first eight words of the argument list (that might be less than + eight parameters if some parameters occupy more than one word) are + passed in r3..r11 registers. float and double parameters are + passed in fpr's, in addition to that. Rest of the parameters if any + are passed in user stack. There might be cases in which half of the + parameter is copied into registers, the other half is pushed into + stack. + + If the function is returning a structure, then the return address is passed + in r3, then the first 7 words of the parametes can be passed in registers, + starting from r4. */ + +CORE_ADDR +push_arguments (nargs, args, sp, struct_return, struct_addr) + int nargs; + value_ptr *args; + CORE_ADDR sp; + int struct_return; + CORE_ADDR struct_addr; +{ + int ii, len; + int argno; /* current argument number */ + int argbytes; /* current argument byte */ + char tmp_buffer [50]; + int f_argno = 0; /* current floating point argno */ + value_ptr arg; + struct type *type; + + CORE_ADDR saved_sp, pc; + + if ( dummy_frame_count <= 0) + printf_unfiltered ("FATAL ERROR -push_arguments()! frame not found!!\n"); + + /* The first eight words of ther arguments are passed in registers. Copy + them appropriately. + + If the function is returning a `struct', then the first word (which + will be passed in r3) is used for struct return address. In that + case we should advance one word and start from r4 register to copy + parameters. */ + + ii = struct_return ? 1 : 0; + + for (argno=0, argbytes=0; argno < nargs && ii<8; ++ii) { + + arg = args[argno]; + type = check_typedef (VALUE_TYPE (arg)); + len = TYPE_LENGTH (type); + + if (TYPE_CODE (type) == TYPE_CODE_FLT) { + + /* floating point arguments are passed in fpr's, as well as gpr's. + There are 13 fpr's reserved for passing parameters. At this point + there is no way we would run out of them. */ + + if (len > 8) + printf_unfiltered ( +"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno); + + memcpy (®isters[REGISTER_BYTE(FP0_REGNUM + 1 + f_argno)], VALUE_CONTENTS (arg), + len); + ++f_argno; + } + + if (len > 4) { + + /* Argument takes more than one register. */ + while (argbytes < len) { + + *(int*)®isters[REGISTER_BYTE(ii+3)] = 0; + memcpy (®isters[REGISTER_BYTE(ii+3)], + ((char*)VALUE_CONTENTS (arg))+argbytes, + (len - argbytes) > 4 ? 4 : len - argbytes); + ++ii, argbytes += 4; + + if (ii >= 8) + goto ran_out_of_registers_for_arguments; + } + argbytes = 0; + --ii; + } + else { /* Argument can fit in one register. No problem. */ + *(int*)®isters[REGISTER_BYTE(ii+3)] = 0; + memcpy (®isters[REGISTER_BYTE(ii+3)], VALUE_CONTENTS (arg), len); + } + ++argno; + } + +ran_out_of_registers_for_arguments: + + /* location for 8 parameters are always reserved. */ + sp -= 4 * 8; + + /* another six words for back chain, TOC register, link register, etc. */ + sp -= 24; + + /* if there are more arguments, allocate space for them in + the stack, then push them starting from the ninth one. */ + + if ((argno < nargs) || argbytes) { + int space = 0, jj; + + if (argbytes) { + space += ((len - argbytes + 3) & -4); + jj = argno + 1; + } + else + jj = argno; + + for (; jj < nargs; ++jj) { + value_ptr val = args[jj]; + space += ((TYPE_LENGTH (VALUE_TYPE (val))) + 3) & -4; + } + + /* add location required for the rest of the parameters */ + space = (space + 7) & -8; + sp -= space; + + /* This is another instance we need to be concerned about securing our + stack space. If we write anything underneath %sp (r1), we might conflict + with the kernel who thinks he is free to use this area. So, update %sp + first before doing anything else. */ + + write_register (SP_REGNUM, sp); + + /* if the last argument copied into the registers didn't fit there + completely, push the rest of it into stack. */ + + if (argbytes) { + write_memory ( + sp+24+(ii*4), ((char*)VALUE_CONTENTS (arg))+argbytes, len - argbytes); + ++argno; + ii += ((len - argbytes + 3) & -4) / 4; + } + + /* push the rest of the arguments into stack. */ + for (; argno < nargs; ++argno) { + + arg = args[argno]; + type = check_typedef (VALUE_TYPE (arg)); + len = TYPE_LENGTH (type); + + + /* float types should be passed in fpr's, as well as in the stack. */ + if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13) { + + if (len > 8) + printf_unfiltered ( +"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno); + + memcpy (®isters[REGISTER_BYTE(FP0_REGNUM + 1 + f_argno)], VALUE_CONTENTS (arg), + len); + ++f_argno; + } + + write_memory (sp+24+(ii*4), (char *) VALUE_CONTENTS (arg), len); + ii += ((len + 3) & -4) / 4; + } + } + else + /* Secure stack areas first, before doing anything else. */ + write_register (SP_REGNUM, sp); + + saved_sp = dummy_frame_addr [dummy_frame_count - 1]; + read_memory (saved_sp, tmp_buffer, 24); + write_memory (sp, tmp_buffer, 24); + + /* set back chain properly */ + store_address (tmp_buffer, 4, saved_sp); + write_memory (sp, tmp_buffer, 4); + + target_store_registers (-1); + return sp; +} + +/* a given return value in `regbuf' with a type `valtype', extract and copy its + value into `valbuf' */ + +void +extract_return_value (valtype, regbuf, valbuf) + struct type *valtype; + char regbuf[REGISTER_BYTES]; + char *valbuf; +{ + int offset = 0; + + if (TYPE_CODE (valtype) == TYPE_CODE_FLT) { + + double dd; float ff; + /* floats and doubles are returned in fpr1. fpr's have a size of 8 bytes. + We need to truncate the return value into float size (4 byte) if + necessary. */ + + if (TYPE_LENGTH (valtype) > 4) /* this is a double */ + memcpy (valbuf, ®buf[REGISTER_BYTE (FP0_REGNUM + 1)], + TYPE_LENGTH (valtype)); + else { /* float */ + memcpy (&dd, ®buf[REGISTER_BYTE (FP0_REGNUM + 1)], 8); + ff = (float)dd; + memcpy (valbuf, &ff, sizeof(float)); + } + } + else { + /* return value is copied starting from r3. */ + if (TARGET_BYTE_ORDER == BIG_ENDIAN + && TYPE_LENGTH (valtype) < REGISTER_RAW_SIZE (3)) + offset = REGISTER_RAW_SIZE (3) - TYPE_LENGTH (valtype); + + memcpy (valbuf, regbuf + REGISTER_BYTE (3) + offset, + TYPE_LENGTH (valtype)); + } +} + + +/* keep structure return address in this variable. + FIXME: This is a horrid kludge which should not be allowed to continue + living. This only allows a single nested call to a structure-returning + function. Come on, guys! -- gnu@cygnus.com, Aug 92 */ + +CORE_ADDR rs6000_struct_return_address; + + +/* Indirect function calls use a piece of trampoline code to do context + switching, i.e. to set the new TOC table. Skip such code if we are on + its first instruction (as when we have single-stepped to here). + Also skip shared library trampoline code (which is different from + indirect function call trampolines). + Result is desired PC to step until, or NULL if we are not in + trampoline code. */ + +CORE_ADDR +skip_trampoline_code (pc) + CORE_ADDR pc; +{ + register unsigned int ii, op; + CORE_ADDR solib_target_pc; + + static unsigned trampoline_code[] = { + 0x800b0000, /* l r0,0x0(r11) */ + 0x90410014, /* st r2,0x14(r1) */ + 0x7c0903a6, /* mtctr r0 */ + 0x804b0004, /* l r2,0x4(r11) */ + 0x816b0008, /* l r11,0x8(r11) */ + 0x4e800420, /* bctr */ + 0x4e800020, /* br */ + 0 + }; + + /* If pc is in a shared library trampoline, return its target. */ + solib_target_pc = find_solib_trampoline_target (pc); + if (solib_target_pc) + return solib_target_pc; + + for (ii=0; trampoline_code[ii]; ++ii) { + op = read_memory_integer (pc + (ii*4), 4); + if (op != trampoline_code [ii]) + return 0; + } + ii = read_register (11); /* r11 holds destination addr */ + pc = read_memory_integer (ii, 4); /* (r11) value */ + return pc; +} + +/* Determines whether the function FI has a frame on the stack or not. */ + +int +frameless_function_invocation (fi) + struct frame_info *fi; +{ + CORE_ADDR func_start; + struct rs6000_framedata fdata; + + if (fi->next != NULL) + /* Don't even think about framelessness except on the innermost frame. */ + /* FIXME: Can also be frameless if fi->next->signal_handler_caller (if + a signal happens while executing in a frameless function). */ + return 0; + + func_start = get_pc_function_start (fi->pc) + FUNCTION_START_OFFSET; + + /* If we failed to find the start of the function, it is a mistake + to inspect the instructions. */ + + if (!func_start) + return 0; + + (void) skip_prologue (func_start, &fdata); + return fdata.frameless; +} + +/* Return the PC saved in a frame */ + +unsigned long +frame_saved_pc (fi) + struct frame_info *fi; +{ + CORE_ADDR func_start; + struct rs6000_framedata fdata; + int frameless; + + if (fi->signal_handler_caller) + return read_memory_integer (fi->frame + SIG_FRAME_PC_OFFSET, 4); + + func_start = get_pc_function_start (fi->pc) + FUNCTION_START_OFFSET; + + /* If we failed to find the start of the function, it is a mistake + to inspect the instructions. */ + if (!func_start) + return 0; + + (void) skip_prologue (func_start, &fdata); + + if (fdata.lr_offset == 0 && fi->next != NULL) + return read_memory_integer (rs6000_frame_chain (fi) + DEFAULT_LR_SAVE, 4); + + if (fdata.lr_offset == 0) + return read_register (LR_REGNUM); + + return read_memory_integer (rs6000_frame_chain (fi) + fdata.lr_offset, 4); +} + +/* If saved registers of frame FI are not known yet, read and cache them. + &FDATAP contains rs6000_framedata; TDATAP can be NULL, + in which case the framedata are read. */ + +static void +frame_get_cache_fsr (fi, fdatap) + struct frame_info *fi; + struct rs6000_framedata *fdatap; +{ + int ii; + CORE_ADDR frame_addr; + struct rs6000_framedata work_fdata; + + if (fi->cache_fsr) + return; + + if (fdatap == NULL) { + fdatap = &work_fdata; + (void) skip_prologue (get_pc_function_start (fi->pc), fdatap); + } + + fi->cache_fsr = (struct frame_saved_regs *) + obstack_alloc (&frame_cache_obstack, sizeof (struct frame_saved_regs)); + memset (fi->cache_fsr, '\0', sizeof (struct frame_saved_regs)); + + if (fi->prev && fi->prev->frame) + frame_addr = fi->prev->frame; + else + frame_addr = read_memory_integer (fi->frame, 4); + + /* if != -1, fdatap->saved_fpr is the smallest number of saved_fpr. + All fpr's from saved_fpr to fp31 are saved. */ + + if (fdatap->saved_fpr >= 0) { + int fpr_offset = frame_addr + fdatap->fpr_offset; + for (ii = fdatap->saved_fpr; ii < 32; ii++) { + fi->cache_fsr->regs [FP0_REGNUM + ii] = fpr_offset; + fpr_offset += 8; + } + } + + /* if != -1, fdatap->saved_gpr is the smallest number of saved_gpr. + All gpr's from saved_gpr to gpr31 are saved. */ + + if (fdatap->saved_gpr >= 0) { + int gpr_offset = frame_addr + fdatap->gpr_offset; + for (ii = fdatap->saved_gpr; ii < 32; ii++) { + fi->cache_fsr->regs [ii] = gpr_offset; + gpr_offset += 4; + } + } + + /* If != 0, fdatap->cr_offset is the offset from the frame that holds + the CR. */ + if (fdatap->cr_offset != 0) + fi->cache_fsr->regs [CR_REGNUM] = frame_addr + fdatap->cr_offset; + + /* If != 0, fdatap->lr_offset is the offset from the frame that holds + the LR. */ + if (fdatap->lr_offset != 0) + fi->cache_fsr->regs [LR_REGNUM] = frame_addr + fdatap->lr_offset; +} + +/* Return the address of a frame. This is the inital %sp value when the frame + was first allocated. For functions calling alloca(), it might be saved in + an alloca register. */ + +CORE_ADDR +frame_initial_stack_address (fi) + struct frame_info *fi; +{ + CORE_ADDR tmpaddr; + struct rs6000_framedata fdata; + struct frame_info *callee_fi; + + /* if the initial stack pointer (frame address) of this frame is known, + just return it. */ + + if (fi->initial_sp) + return fi->initial_sp; + + /* find out if this function is using an alloca register.. */ + + (void) skip_prologue (get_pc_function_start (fi->pc), &fdata); + + /* if saved registers of this frame are not known yet, read and cache them. */ + + if (!fi->cache_fsr) + frame_get_cache_fsr (fi, &fdata); + + /* If no alloca register used, then fi->frame is the value of the %sp for + this frame, and it is good enough. */ + + if (fdata.alloca_reg < 0) { + fi->initial_sp = fi->frame; + return fi->initial_sp; + } + + /* This function has an alloca register. If this is the top-most frame + (with the lowest address), the value in alloca register is good. */ + + if (!fi->next) + return fi->initial_sp = read_register (fdata.alloca_reg); + + /* Otherwise, this is a caller frame. Callee has usually already saved + registers, but there are exceptions (such as when the callee + has no parameters). Find the address in which caller's alloca + register is saved. */ + + for (callee_fi = fi->next; callee_fi; callee_fi = callee_fi->next) { + + if (!callee_fi->cache_fsr) + frame_get_cache_fsr (callee_fi, NULL); + + /* this is the address in which alloca register is saved. */ + + tmpaddr = callee_fi->cache_fsr->regs [fdata.alloca_reg]; + if (tmpaddr) { + fi->initial_sp = read_memory_integer (tmpaddr, 4); + return fi->initial_sp; + } + + /* Go look into deeper levels of the frame chain to see if any one of + the callees has saved alloca register. */ + } + + /* If alloca register was not saved, by the callee (or any of its callees) + then the value in the register is still good. */ + + return fi->initial_sp = read_register (fdata.alloca_reg); +} + +CORE_ADDR +rs6000_frame_chain (thisframe) + struct frame_info *thisframe; +{ + CORE_ADDR fp; + if (inside_entry_file ((thisframe)->pc)) + return 0; + if (thisframe->signal_handler_caller) + fp = read_memory_integer (thisframe->frame + SIG_FRAME_FP_OFFSET, 4); + else + fp = read_memory_integer ((thisframe)->frame, 4); + + return fp; +} + +/* Keep an array of load segment information and their TOC table addresses. + This info will be useful when calling a shared library function by hand. */ + +struct loadinfo { + CORE_ADDR textorg, dataorg; + unsigned long toc_offset; +}; + +#define LOADINFOLEN 10 + +static struct loadinfo *loadinfo = NULL; +static int loadinfolen = 0; +static int loadinfotocindex = 0; +static int loadinfotextindex = 0; + + +void +xcoff_init_loadinfo () +{ + loadinfotocindex = 0; + loadinfotextindex = 0; + + if (loadinfolen == 0) { + loadinfo = (struct loadinfo *) + xmalloc (sizeof (struct loadinfo) * LOADINFOLEN); + loadinfolen = LOADINFOLEN; + } +} + + +/* FIXME -- this is never called! */ +void +free_loadinfo () +{ + if (loadinfo) + free (loadinfo); + loadinfo = NULL; + loadinfolen = 0; + loadinfotocindex = 0; + loadinfotextindex = 0; +} + +/* this is called from xcoffread.c */ + +void +xcoff_add_toc_to_loadinfo (tocoff) + unsigned long tocoff; +{ + while (loadinfotocindex >= loadinfolen) { + loadinfolen += LOADINFOLEN; + loadinfo = (struct loadinfo *) + xrealloc (loadinfo, sizeof(struct loadinfo) * loadinfolen); + } + loadinfo [loadinfotocindex++].toc_offset = tocoff; +} + +void +add_text_to_loadinfo (textaddr, dataaddr) + CORE_ADDR textaddr; + CORE_ADDR dataaddr; +{ + while (loadinfotextindex >= loadinfolen) { + loadinfolen += LOADINFOLEN; + loadinfo = (struct loadinfo *) + xrealloc (loadinfo, sizeof(struct loadinfo) * loadinfolen); + } + loadinfo [loadinfotextindex].textorg = textaddr; + loadinfo [loadinfotextindex].dataorg = dataaddr; + ++loadinfotextindex; +} + + +/* Note that this assumes that the "textorg" and "dataorg" elements of + a member of this array are correlated with the "toc_offset" element + of the same member. This is taken care of because the loops which + assign the former (in xcoff_relocate_symtab or xcoff_relocate_core) + and the latter (in scan_xcoff_symtab, via vmap_symtab, in + vmap_ldinfo or xcoff_relocate_core) traverse the same objfiles in + the same order. */ + +static CORE_ADDR +find_toc_address (pc) + CORE_ADDR pc; +{ + int ii, toc_entry, tocbase = 0; + + toc_entry = -1; + for (ii=0; ii < loadinfotextindex; ++ii) + if (pc > loadinfo[ii].textorg && loadinfo[ii].textorg > tocbase) { + toc_entry = ii; + tocbase = loadinfo[ii].textorg; + } + + if (toc_entry == -1) + error ("Unable to find TOC entry for pc 0x%x\n", pc); + return loadinfo[toc_entry].dataorg + loadinfo[toc_entry].toc_offset; +} + +/* Return nonzero if ADDR (a function pointer) is in the data space and + is therefore a special function pointer. */ + +int +is_magic_function_pointer (addr) + CORE_ADDR addr; +{ + struct obj_section *s; + + s = find_pc_section (addr); + if (s && s->the_bfd_section->flags & SEC_CODE) + return 0; + else + return 1; +} + +#ifdef GDB_TARGET_POWERPC +int +gdb_print_insn_powerpc (memaddr, info) + bfd_vma memaddr; + disassemble_info *info; +{ + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + return print_insn_big_powerpc (memaddr, info); + else + return print_insn_little_powerpc (memaddr, info); +} +#endif + +void +_initialize_rs6000_tdep () +{ + /* FIXME, this should not be decided via ifdef. */ +#ifdef GDB_TARGET_POWERPC + tm_print_insn = gdb_print_insn_powerpc; +#else + tm_print_insn = print_insn_rs6000; +#endif +} diff --git a/contrib/gdb/gdb/sh-tdep.c b/contrib/gdb/gdb/sh-tdep.c new file mode 100644 index 0000000000000..20885ecd605d7 --- /dev/null +++ b/contrib/gdb/gdb/sh-tdep.c @@ -0,0 +1,436 @@ +/* Target-dependent code for Hitachi Super-H, for GDB. + Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* + Contributed by Steve Chamberlain + sac@cygnus.com + */ + +#include "defs.h" +#include "frame.h" +#include "obstack.h" +#include "symtab.h" +#include "gdbtypes.h" +#include "gdbcmd.h" +#include "gdbcore.h" +#include "value.h" +#include "dis-asm.h" + +/* Default to the original SH. */ + +#define DEFAULT_SH_TYPE "sh" + +/* This value is the model of SH in use. */ + +char *sh_processor_type; + +char *tmp_sh_processor_type; + +/* A set of original names, to be used when restoring back to generic + registers from a specific set. */ + +char *sh_generic_reg_names[] = REGISTER_NAMES; + +char *sh_reg_names[] = { + "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", + "pc", "pr", "gbr", "vbr", "mach","macl", "sr", + "fpul", "fpscr", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "" +}; + +char *sh3_reg_names[] = { + "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", + "pc", "pr", "gbr", "vbr", "mach","macl","sr", + "fpul", "fpscr", + "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", + "fr8", "fr9", "fr10","fr11","fr12","fr13","fr14","fr15", + "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0", + "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1" +}; + +struct { + char *name; + char **regnames; +} sh_processor_type_table[] = { + { "sh", sh_reg_names }, + { "sh3", sh3_reg_names }, + { NULL, NULL } +}; + +/* Prologue looks like + [mov.l <regs>,@-r15]... + [sts.l pr,@-r15] + [mov.l r14,@-r15] + [mov r15,r14] +*/ + +#define IS_STS(x) ((x) == 0x4f22) +#define IS_PUSH(x) (((x) & 0xff0f) == 0x2f06) +#define GET_PUSHED_REG(x) (((x) >> 4) & 0xf) +#define IS_MOV_SP_FP(x) ((x) == 0x6ef3) +#define IS_ADD_SP(x) (((x) & 0xff00) == 0x7f00) +#define IS_MOV_R3(x) (((x) & 0xff00) == 0x1a00) +#define IS_SHLL_R3(x) ((x) == 0x4300) +#define IS_ADD_R3SP(x) ((x) == 0x3f3c) + +/* Skip any prologue before the guts of a function */ + +CORE_ADDR +sh_skip_prologue (start_pc) + CORE_ADDR start_pc; +{ + int w; + + w = read_memory_integer (start_pc, 2); + while (IS_STS (w) + || IS_PUSH (w) + || IS_MOV_SP_FP (w) + || IS_MOV_R3 (w) + || IS_ADD_R3SP (w) + || IS_ADD_SP (w) + || IS_SHLL_R3 (w)) + { + start_pc += 2; + w = read_memory_integer (start_pc, 2); + } + + return start_pc; +} + +/* Disassemble an instruction. */ + +int +gdb_print_insn_sh (memaddr, info) + bfd_vma memaddr; + disassemble_info *info; +{ + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + return print_insn_sh (memaddr, info); + else + return print_insn_shl (memaddr, info); +} + +/* Given a GDB frame, determine the address of the calling function's frame. + This will be used to create a new GDB frame struct, and then + INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame. + + For us, the frame address is its stack pointer value, so we look up + the function prologue to determine the caller's sp value, and return it. */ + +CORE_ADDR +sh_frame_chain (frame) + struct frame_info *frame; +{ + if (!inside_entry_file (frame->pc)) + return read_memory_integer (FRAME_FP (frame) + frame->f_offset, 4); + else + return 0; +} + +/* Put here the code to store, into a struct frame_saved_regs, the + addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: the address we + return for it IS the sp for the next frame. */ + +void +frame_find_saved_regs (fi, fsr) + struct frame_info *fi; + struct frame_saved_regs *fsr; +{ + int where[NUM_REGS]; + int rn; + int have_fp = 0; + int depth; + int pc; + int opc; + int insn; + int r3_val = 0; + + opc = pc = get_pc_function_start (fi->pc); + + insn = read_memory_integer (pc, 2); + + fi->leaf_function = 1; + fi->f_offset = 0; + + for (rn = 0; rn < NUM_REGS; rn++) + where[rn] = -1; + + depth = 0; + + /* Loop around examining the prologue insns, but give up + after 15 of them, since we're getting silly then */ + while (pc < opc + 15 * 2) + { + /* See where the registers will be saved to */ + if (IS_PUSH (insn)) + { + pc += 2; + rn = GET_PUSHED_REG (insn); + where[rn] = depth; + insn = read_memory_integer (pc, 2); + depth += 4; + } + else if (IS_STS (insn)) + { + pc += 2; + where[PR_REGNUM] = depth; + insn = read_memory_integer (pc, 2); + /* If we're storing the pr then this isn't a leaf */ + fi->leaf_function = 0; + depth += 4; + } + else if (IS_MOV_R3 (insn)) + { + r3_val = (char) (insn & 0xff); + pc += 2; + insn = read_memory_integer (pc, 2); + } + else if (IS_SHLL_R3 (insn)) + { + r3_val <<= 1; + pc += 2; + insn = read_memory_integer (pc, 2); + } + else if (IS_ADD_R3SP (insn)) + { + depth += -r3_val; + pc += 2; + insn = read_memory_integer (pc, 2); + } + else if (IS_ADD_SP (insn)) + { + pc += 2; + depth += -((char) (insn & 0xff)); + insn = read_memory_integer (pc, 2); + } + else + break; + } + + /* Now we know how deep things are, we can work out their addresses */ + + for (rn = 0; rn < NUM_REGS; rn++) + { + if (where[rn] >= 0) + { + if (rn == FP_REGNUM) + have_fp = 1; + + fsr->regs[rn] = fi->frame - where[rn] + depth - 4; + } + else + { + fsr->regs[rn] = 0; + } + } + + if (have_fp) + { + fsr->regs[SP_REGNUM] = read_memory_integer (fsr->regs[FP_REGNUM], 4); + } + else + { + fsr->regs[SP_REGNUM] = fi->frame - 4; + } + + fi->f_offset = depth - where[FP_REGNUM] - 4; + /* Work out the return pc - either from the saved pr or the pr + value */ + + if (fsr->regs[PR_REGNUM]) + fi->return_pc = read_memory_integer (fsr->regs[PR_REGNUM], 4); + else + fi->return_pc = read_register (PR_REGNUM); +} + +/* initialize the extra info saved in a FRAME */ + +void +init_extra_frame_info (fromleaf, fi) + int fromleaf; + struct frame_info *fi; +{ + struct frame_saved_regs dummy; + + if (fi->next) + fi->pc = fi->next->return_pc; + + frame_find_saved_regs (fi, &dummy); +} + + +/* Discard from the stack the innermost frame, + restoring all saved registers. */ + +void +pop_frame () +{ + register struct frame_info *frame = get_current_frame (); + register CORE_ADDR fp; + register int regnum; + struct frame_saved_regs fsr; + + fp = FRAME_FP (frame); + get_frame_saved_regs (frame, &fsr); + + /* Copy regs from where they were saved in the frame */ + for (regnum = 0; regnum < NUM_REGS; regnum++) + { + if (fsr.regs[regnum]) + { + write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); + } + } + + write_register (PC_REGNUM, frame->return_pc); + write_register (SP_REGNUM, fp + 4); + flush_cached_frames (); +} + +/* Command to set the processor type. */ + +void +sh_set_processor_type_command (args, from_tty) + char *args; + int from_tty; +{ + int i; + char *temp; + + /* The `set' commands work by setting the value, then calling the hook, + so we let the general command modify a scratch location, then decide + here if we really want to modify the processor type. */ + if (tmp_sh_processor_type == NULL || *tmp_sh_processor_type == '\0') + { + printf_unfiltered ("The known SH processor types are as follows:\n\n"); + for (i = 0; sh_processor_type_table[i].name != NULL; ++i) + printf_unfiltered ("%s\n", sh_processor_type_table[i].name); + + /* Restore the value. */ + tmp_sh_processor_type = strsave (sh_processor_type); + + return; + } + + if (!sh_set_processor_type (tmp_sh_processor_type)) + { + /* Restore to a valid value before erroring out. */ + temp = tmp_sh_processor_type; + tmp_sh_processor_type = strsave (sh_processor_type); + error ("Unknown processor type `%s'.", temp); + } +} + +static void +sh_show_processor_type_command (args, from_tty) + char *args; + int from_tty; +{ +} + +/* Modify the actual processor type. */ + +int +sh_set_processor_type (str) + char *str; +{ + int i, j; + + if (str == NULL) + return 0; + + for (i = 0; sh_processor_type_table[i].name != NULL; ++i) + { + if (strcasecmp (str, sh_processor_type_table[i].name) == 0) + { + sh_processor_type = str; + + for (j = 0; j < NUM_REGS; ++j) + reg_names[j] = sh_processor_type_table[i].regnames[j]; + + return 1; + } + } + + return 0; +} + +/* Print the registers in a form similar to the E7000 */ + +static void +show_regs (args, from_tty) + char *args; + int from_tty; +{ + printf_filtered ("PC=%08x SR=%08x PR=%08x MACH=%08x MACHL=%08x\n", + read_register (PC_REGNUM), + read_register (SR_REGNUM), + read_register (PR_REGNUM), + read_register (MACH_REGNUM), + read_register (MACL_REGNUM)); + + printf_filtered ("R0-R7 %08x %08x %08x %08x %08x %08x %08x %08x\n", + read_register (0), + read_register (1), + read_register (2), + read_register (3), + read_register (4), + read_register (5), + read_register (6), + read_register (7)); + printf_filtered ("R8-R15 %08x %08x %08x %08x %08x %08x %08x %08x\n", + read_register (8), + read_register (9), + read_register (10), + read_register (11), + read_register (12), + read_register (13), + read_register (14), + read_register (15)); +} + +void +_initialize_sh_tdep () +{ + struct cmd_list_element *c; + + tm_print_insn = gdb_print_insn_sh; + + c = add_set_cmd ("processor", class_support, var_string_noescape, + (char *) &tmp_sh_processor_type, + "Set the type of SH processor in use.\n\ +Set this to be able to access processor-type-specific registers.\n\ +", + &setlist); + c->function.cfunc = sh_set_processor_type_command; + c = add_show_from_set (c, &showlist); + c->function.cfunc = sh_show_processor_type_command; + + tmp_sh_processor_type = strsave (DEFAULT_SH_TYPE); + sh_set_processor_type_command (strsave (DEFAULT_SH_TYPE), 0); + + add_com ("regs", class_vars, show_regs, "Print all registers"); +} diff --git a/contrib/gdb/gdb/sh3-rom.c b/contrib/gdb/gdb/sh3-rom.c new file mode 100644 index 0000000000000..b5d77e514d85a --- /dev/null +++ b/contrib/gdb/gdb/sh3-rom.c @@ -0,0 +1,305 @@ +/* Remote target glue for the Hitachi SH-3 ROM monitor. + Copyright 1995, 1996 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "gdbcore.h" +#include "target.h" +#include "monitor.h" +#include "serial.h" +#include "srec.h" + +static serial_t parallel; +static int parallel_in_use; + +static void sh3_open PARAMS ((char *args, int from_tty)); + +static void +sh3_supply_register (regname, regnamelen, val, vallen) + char *regname; + int regnamelen; + char *val; + int vallen; +{ + int numregs; + int regno; + + numregs = 1; + regno = -1; + + if (regnamelen == 2) + { + switch (regname[0]) + { + case 'S': + if (regname[1] == 'R') + regno = SR_REGNUM; + break; + case 'P': + if (regname[1] == 'C') + regno = PC_REGNUM; + else if (regname[1] == 'R') + regno = PR_REGNUM; + break; + } + } + else if (regnamelen == 3) + { + switch (regname[0]) + { + case 'G': + case 'V': + if (regname[1] == 'B' && regname[2] == 'R') + if (regname[0] == 'G') + regno = VBR_REGNUM; + else + regno = GBR_REGNUM; + break; +#if 0 + case 'S': + if (regname[1] == 'S' && regname[2] == 'R') + regno = SSR_REGNUM; + else if (regname[1] == 'P' && regname[2] == 'C') + regno = SPC_REGNUM; + break; +#endif + } + } + else if (regnamelen == 4) + { + switch (regname[0]) + { + case 'M': + if (regname[1] == 'A' && regname[2] == 'C') + if (regname[3] == 'H') + regno = MACH_REGNUM; + else if (regname[3] == 'L') + regno = MACL_REGNUM; + break; + case 'R': + if (regname[1] == '0' && regname[2] == '-' && regname[3] == '7') + { + regno = R0_REGNUM; + numregs = 8; + } + } + } + else if (regnamelen == 5) + { + if (regname[1] == '8' && regname[2] == '-' && regname[3] == '1' + && regname[4] =='5') + { + regno = R0_REGNUM + 8; + numregs = 8; + } + } + + if (regno >= 0) + while (numregs-- > 0) + val = monitor_supply_register (regno++, val); +} + +static void +sh3_load (desc, file, hashmark) + serial_t desc; + char *file; + int hashmark; +{ + if (parallel_in_use) + { + monitor_printf("pl;s\r"); + load_srec (parallel, file, 80, SREC_ALL, hashmark); + monitor_expect_prompt (NULL, 0); + } + else + { + monitor_printf ("il;s:x\r"); + monitor_expect ("\005", NULL, 0); /* Look for ENQ */ + SERIAL_WRITE (desc, "\006", 1); /* Send ACK */ + monitor_expect ("LO x\r", NULL, 0); /* Look for filename */ + + load_srec (desc, file, 80, SREC_ALL, hashmark); + + monitor_expect ("\005", NULL, 0); /* Look for ENQ */ + SERIAL_WRITE (desc, "\006", 1); /* Send ACK */ + monitor_expect_prompt (NULL, 0); + } +} + +/* This array of registers need to match the indexes used by GDB. + This exists because the various ROM monitors use different strings + than does GDB, and don't necessarily support all the registers + either. So, typing "info reg sp" becomes a "r30". */ + +static char *sh3_regnames[NUM_REGS] = { + "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", + "R8", "R9", "R10", "R11","R12", "R13", "R14", "R15", + "PC", "PR", "GBR", "VBR","MACH","MACL", "SR", + NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "R0_BANK0", "R1_BANK0", "R2_BANK0", "R3_BANK0", + "R4_BANK0", "R5_BANK0", "R6_BANK0", "R7_BANK0", + "R0_BANK1", "R1_BANK1", "R2_BANK1", "R3_BANK1", + "R4_BANK1", "R5_BANK1", "R6_BANK1", "R7_BANK1" +}; + +/* Define the monitor command strings. Since these are passed directly + through to a printf style function, we may include formatting + strings. We also need a CR or LF on the end. */ + +static struct target_ops sh3_ops; + +static char *sh3_inits[] = {"\003", NULL}; /* Exits sub-command mode & download cmds */ + +static struct monitor_ops sh3_cmds = +{ + MO_CLR_BREAK_USES_ADDR + | MO_GETMEM_READ_SINGLE, /* flags */ + sh3_inits, /* monitor init string */ + "g\r", /* continue command */ + "s\r", /* single step */ + "\003", /* Interrupt program */ + "b %x\r", /* set a breakpoint */ + "b -%x\r", /* clear a breakpoint */ + "b -\r", /* clear all breakpoints */ + "f %x @%x %x\r", /* fill (start len val) */ + { + "m %x %x\r", /* setmem.cmdb (addr, value) */ + "m %x %x;w\r", /* setmem.cmdw (addr, value) */ + "m %x %x;l\r", /* setmem.cmdl (addr, value) */ + NULL, /* setmem.cmdll (addr, value) */ + NULL, /* setreg.resp_delim */ + NULL, /* setreg.term */ + NULL, /* setreg.term_cmd */ + }, + { + "m %x\r", /* getmem.cmdb (addr, len) */ + "m %x;w\r", /* getmem.cmdw (addr, len) */ + "m %x;l\r", /* getmem.cmdl (addr, len) */ + NULL, /* getmem.cmdll (addr, len) */ + "^ [0-9A-F]+ ", /* getmem.resp_delim */ + "? ", /* getmem.term */ + ".\r", /* getmem.term_cmd */ + }, + { + ".%s %x\r", /* setreg.cmd (name, value) */ + NULL, /* setreg.resp_delim */ + NULL, /* setreg.term */ + NULL /* setreg.term_cmd */ + }, + { + ".%s\r", /* getreg.cmd (name) */ + "=", /* getreg.resp_delim */ + "? ", /* getreg.term */ + ".\r" /* getreg.term_cmd */ + }, + "r\r", /* dump_registers */ + /* register_pattern */ + "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)", + sh3_supply_register, /* supply_register */ + sh3_load, /* load_routine */ + NULL, /* download command */ + NULL, /* Load response */ + "\n:", /* monitor command prompt */ + "\r", /* end-of-line terminator */ + ".\r", /* optional command terminator */ + &sh3_ops, /* target operations */ + SERIAL_1_STOPBITS, /* number of stop bits */ + sh3_regnames, /* registers names */ + MONITOR_OPS_MAGIC /* magic */ +}; + +static void +sh3_open (args, from_tty) + char *args; + int from_tty; +{ + char *serial_port_name = args; + char *parallel_port_name = 0; + + if (args) + { + char *cursor = serial_port_name = strsave (args); + + while (*cursor && *cursor != ' ') + cursor++; + + if (*cursor) + *cursor++ = 0; + + while (*cursor == ' ') + cursor++; + + if (*cursor) + parallel_port_name = cursor; + } + + monitor_open (serial_port_name, &sh3_cmds, from_tty); + + if (parallel_port_name) + { + parallel = SERIAL_OPEN (parallel_port_name); + + if (!parallel) + perror_with_name ("Unable to open parallel port."); + + parallel_in_use = 1; + } + + /* If we connected successfully, we know the processor is an SH3. */ + sh_set_processor_type ("sh3"); +} + + +static void +sh3_close (quitting) + int quitting; +{ + monitor_close (quitting); + if (parallel_in_use) { + SERIAL_CLOSE (parallel); + parallel_in_use = 0; + } +} + +void +_initialize_sh3 () +{ + init_monitor_ops (&sh3_ops); + + sh3_ops.to_shortname = "sh3"; + sh3_ops.to_longname = "Hitachi SH-3 rom monitor"; + + sh3_ops.to_doc = +#ifdef _WINDOWS + /* On windows we can talk through the parallel port too. */ + "Debug on a Hitachi eval board running the SH-3 rom monitor.\n" + "Specify the serial device it is connected to (e.g. com2).\n" + "If you want to use the parallel port to download to it, specify that\n" + "as the second argument. (e.g. lpt1)"; +#else + "Debug on a Hitachi eval board running the SH-3 rom monitor.\n\ +Specify the serial device it is connected to (e.g. /dev/ttya)."; +#endif + + sh3_ops.to_open = sh3_open; + sh3_ops.to_close = sh3_close; + + add_target (&sh3_ops); +} diff --git a/contrib/gdb/gdb/sparc-nat.c b/contrib/gdb/gdb/sparc-nat.c new file mode 100644 index 0000000000000..406238dfd5565 --- /dev/null +++ b/contrib/gdb/gdb/sparc-nat.c @@ -0,0 +1,321 @@ +/* Functions specific to running gdb native on a SPARC running SunOS4. + Copyright 1989, 1992, 1993, 1994, 1996 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "inferior.h" +#include "target.h" +#include "gdbcore.h" + +#include <signal.h> +#include <sys/ptrace.h> +#include <sys/wait.h> +#include <machine/reg.h> +#include <sys/user.h> + +/* We don't store all registers immediately when requested, since they + get sent over in large chunks anyway. Instead, we accumulate most + of the changes and send them over once. "deferred_stores" keeps + track of which sets of registers we have locally-changed copies of, + so we only need send the groups that have changed. */ + +#define INT_REGS 1 +#define STACK_REGS 2 +#define FP_REGS 4 + +/* Fetch one or more registers from the inferior. REGNO == -1 to get + them all. We actually fetch more than requested, when convenient, + marking them as valid so we won't fetch them again. */ + +void +fetch_inferior_registers (regno) + int regno; +{ + struct regs inferior_registers; + struct fp_status inferior_fp_registers; + int i; + + /* We should never be called with deferred stores, because a prerequisite + for writing regs is to have fetched them all (PREPARE_TO_STORE), sigh. */ + if (deferred_stores) abort(); + + DO_DEFERRED_STORES; + + /* Global and Out regs are fetched directly, as well as the control + registers. If we're getting one of the in or local regs, + and the stack pointer has not yet been fetched, + we have to do that first, since they're found in memory relative + to the stack pointer. */ + if (regno < O7_REGNUM /* including -1 */ + || regno >= Y_REGNUM + || (!register_valid[SP_REGNUM] && regno < I7_REGNUM)) + { + if (0 != ptrace (PTRACE_GETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_registers, 0)) + perror("ptrace_getregs"); + + registers[REGISTER_BYTE (0)] = 0; + memcpy (®isters[REGISTER_BYTE (1)], &inferior_registers.r_g1, + 15 * REGISTER_RAW_SIZE (G0_REGNUM)); + *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; + *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; + *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc; + *(int *)®isters[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y; + + for (i = G0_REGNUM; i <= O7_REGNUM; i++) + register_valid[i] = 1; + register_valid[Y_REGNUM] = 1; + register_valid[PS_REGNUM] = 1; + register_valid[PC_REGNUM] = 1; + register_valid[NPC_REGNUM] = 1; + /* If we don't set these valid, read_register_bytes() rereads + all the regs every time it is called! FIXME. */ + register_valid[WIM_REGNUM] = 1; /* Not true yet, FIXME */ + register_valid[TBR_REGNUM] = 1; /* Not true yet, FIXME */ + register_valid[CPS_REGNUM] = 1; /* Not true yet, FIXME */ + } + + /* Floating point registers */ + if (regno == -1 || + regno == FPS_REGNUM || + (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31)) + { + if (0 != ptrace (PTRACE_GETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_fp_registers, + 0)) + perror("ptrace_getfpregs"); + memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, + sizeof inferior_fp_registers.fpu_fr); + memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)], + &inferior_fp_registers.Fpu_fsr, + sizeof (FPU_FSR_TYPE)); + for (i = FP0_REGNUM; i <= FP0_REGNUM+31; i++) + register_valid[i] = 1; + register_valid[FPS_REGNUM] = 1; + } + + /* These regs are saved on the stack by the kernel. Only read them + all (16 ptrace calls!) if we really need them. */ + if (regno == -1) + { + target_xfer_memory (*(CORE_ADDR*)®isters[REGISTER_BYTE (SP_REGNUM)], + ®isters[REGISTER_BYTE (L0_REGNUM)], + 16*REGISTER_RAW_SIZE (L0_REGNUM), 0); + for (i = L0_REGNUM; i <= I7_REGNUM; i++) + register_valid[i] = 1; + } + else if (regno >= L0_REGNUM && regno <= I7_REGNUM) + { + CORE_ADDR sp = *(CORE_ADDR*)®isters[REGISTER_BYTE (SP_REGNUM)]; + i = REGISTER_BYTE (regno); + if (register_valid[regno]) + printf_unfiltered("register %d valid and read\n", regno); + target_xfer_memory (sp + i - REGISTER_BYTE (L0_REGNUM), + ®isters[i], REGISTER_RAW_SIZE (regno), 0); + register_valid[regno] = 1; + } +} + +/* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +void +store_inferior_registers (regno) + int regno; +{ + struct regs inferior_registers; + struct fp_status inferior_fp_registers; + int wanna_store = INT_REGS + STACK_REGS + FP_REGS; + + /* First decide which pieces of machine-state we need to modify. + Default for regno == -1 case is all pieces. */ + if (regno >= 0) + if (FP0_REGNUM <= regno && regno < FP0_REGNUM + 32) + { + wanna_store = FP_REGS; + } + else + { + if (regno == SP_REGNUM) + wanna_store = INT_REGS + STACK_REGS; + else if (regno < L0_REGNUM || regno > I7_REGNUM) + wanna_store = INT_REGS; + else if (regno == FPS_REGNUM) + wanna_store = FP_REGS; + else + wanna_store = STACK_REGS; + } + + /* See if we're forcing the stores to happen now, or deferring. */ + if (regno == -2) + { + wanna_store = deferred_stores; + deferred_stores = 0; + } + else + { + if (wanna_store == STACK_REGS) + { + /* Fall through and just store one stack reg. If we deferred + it, we'd have to store them all, or remember more info. */ + } + else + { + deferred_stores |= wanna_store; + return; + } + } + + if (wanna_store & STACK_REGS) + { + CORE_ADDR sp = *(CORE_ADDR *)®isters[REGISTER_BYTE (SP_REGNUM)]; + + if (regno < 0 || regno == SP_REGNUM) + { + if (!register_valid[L0_REGNUM+5]) abort(); + target_xfer_memory (sp, + ®isters[REGISTER_BYTE (L0_REGNUM)], + 16*REGISTER_RAW_SIZE (L0_REGNUM), 1); + } + else + { + if (!register_valid[regno]) abort(); + target_xfer_memory (sp + REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM), + ®isters[REGISTER_BYTE (regno)], + REGISTER_RAW_SIZE (regno), 1); + } + + } + + if (wanna_store & INT_REGS) + { + if (!register_valid[G1_REGNUM]) abort(); + + memcpy (&inferior_registers.r_g1, ®isters[REGISTER_BYTE (G1_REGNUM)], + 15 * REGISTER_RAW_SIZE (G1_REGNUM)); + + inferior_registers.r_ps = + *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; + inferior_registers.r_pc = + *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; + inferior_registers.r_npc = + *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)]; + inferior_registers.r_y = + *(int *)®isters[REGISTER_BYTE (Y_REGNUM)]; + + if (0 != ptrace (PTRACE_SETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_registers, 0)) + perror("ptrace_setregs"); + } + + if (wanna_store & FP_REGS) + { + if (!register_valid[FP0_REGNUM+9]) abort(); + memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], + sizeof inferior_fp_registers.fpu_fr); + memcpy (&inferior_fp_registers.Fpu_fsr, + ®isters[REGISTER_BYTE (FPS_REGNUM)], sizeof (FPU_FSR_TYPE)); + if (0 != + ptrace (PTRACE_SETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0)) + perror("ptrace_setfpregs"); + } +} + + +static void +fetch_core_registers (core_reg_sect, core_reg_size, which, ignore) + char *core_reg_sect; + unsigned core_reg_size; + int which; + unsigned int ignore; /* reg addr, unused in this version */ +{ + + if (which == 0) { + + /* Integer registers */ + +#define gregs ((struct regs *)core_reg_sect) + /* G0 *always* holds 0. */ + *(int *)®isters[REGISTER_BYTE (0)] = 0; + + /* The globals and output registers. */ + memcpy (®isters[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1, + 15 * REGISTER_RAW_SIZE (G1_REGNUM)); + *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps; + *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc; + *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc; + *(int *)®isters[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y; + + /* My best guess at where to get the locals and input + registers is exactly where they usually are, right above + the stack pointer. If the core dump was caused by a bus error + from blowing away the stack pointer (as is possible) then this + won't work, but it's worth the try. */ + { + int sp; + + sp = *(int *)®isters[REGISTER_BYTE (SP_REGNUM)]; + if (0 != target_read_memory (sp, ®isters[REGISTER_BYTE (L0_REGNUM)], + 16 * REGISTER_RAW_SIZE (L0_REGNUM))) + { + /* fprintf_unfiltered so user can still use gdb */ + fprintf_unfiltered (gdb_stderr, + "Couldn't read input and local registers from core file\n"); + } + } + } else if (which == 2) { + + /* Floating point registers */ + +#define fpuregs ((struct fpu *) core_reg_sect) + if (core_reg_size >= sizeof (struct fpu)) + { + memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], fpuregs->fpu_regs, + sizeof (fpuregs->fpu_regs)); + memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr, + sizeof (FPU_FSR_TYPE)); + } + else + fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n"); + } +} + +int +kernel_u_size () +{ + return (sizeof (struct user)); +} + + +/* Register that we are able to handle sparc core file formats. + FIXME: is this really bfd_target_unknown_flavour? */ + +static struct core_fns sparc_core_fns = +{ + bfd_target_unknown_flavour, + fetch_core_registers, + NULL +}; + +void +_initialize_core_sparc () +{ + add_core_fns (&sparc_core_fns); +} diff --git a/contrib/gdb/gdb/sparc-stub.c b/contrib/gdb/gdb/sparc-stub.c new file mode 100644 index 0000000000000..1f04f31955f37 --- /dev/null +++ b/contrib/gdb/gdb/sparc-stub.c @@ -0,0 +1,847 @@ +/**************************************************************************** + + THIS SOFTWARE IS NOT COPYRIGHTED + + HP offers the following for use in the public domain. HP makes no + warranty with regard to the software or it's performance and the + user accepts the software "AS IS" with all faults. + + HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD + TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +****************************************************************************/ + +/**************************************************************************** + * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $ + * + * Module name: remcom.c $ + * Revision: 1.34 $ + * Date: 91/03/09 12:29:49 $ + * Contributor: Lake Stevens Instrument Division$ + * + * Description: low level support for gdb debugger. $ + * + * Considerations: only works on target hardware $ + * + * Written by: Glenn Engel $ + * ModuleState: Experimental $ + * + * NOTES: See Below $ + * + * Modified for SPARC by Stu Grossman, Cygnus Support. + * + * This code has been extensively tested on the Fujitsu SPARClite demo board. + * + * To enable debugger support, two things need to happen. One, a + * call to set_debug_traps() is necessary in order to allow any breakpoints + * or error conditions to be properly intercepted and reported to gdb. + * Two, a breakpoint needs to be generated to begin communication. This + * is most easily accomplished by a call to breakpoint(). Breakpoint() + * simulates a breakpoint by executing a trap #1. + * + ************* + * + * The following gdb commands are supported: + * + * command function Return value + * + * g return the value of the CPU registers hex data or ENN + * G set the value of the CPU registers OK or ENN + * + * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN + * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN + * + * c Resume at current address SNN ( signal NN) + * cAA..AA Continue at address AA..AA SNN + * + * s Step one instruction SNN + * sAA..AA Step one instruction from AA..AA SNN + * + * k kill + * + * ? What was the last sigval ? SNN (signal NN) + * + * bBB..BB Set baud rate to BB..BB OK or BNN, then sets + * baud rate + * + * All commands and responses are sent with a packet which includes a + * checksum. A packet consists of + * + * $<packet info>#<checksum>. + * + * where + * <packet info> :: <characters representing the command or response> + * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>> + * + * When a packet is received, it is first acknowledged with either '+' or '-'. + * '+' indicates a successful transfer. '-' indicates a failed transfer. + * + * Example: + * + * Host: Reply: + * $m0,10#2a +$00010203040506070809101112131415#42 + * + ****************************************************************************/ + +#include <string.h> +#include <signal.h> + +/************************************************************************ + * + * external low-level support routines + */ + +extern putDebugChar(); /* write a single character */ +extern getDebugChar(); /* read and return a single char */ + +/************************************************************************/ +/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/ +/* at least NUMREGBYTES*2 are needed for register packets */ +#define BUFMAX 2048 + +static int initialized = 0; /* !0 means we've been initialized */ + +static void set_mem_fault_trap(); + +static const char hexchars[]="0123456789abcdef"; + +#define NUMREGS 72 + +/* Number of bytes of registers. */ +#define NUMREGBYTES (NUMREGS * 4) +enum regnames {G0, G1, G2, G3, G4, G5, G6, G7, + O0, O1, O2, O3, O4, O5, SP, O7, + L0, L1, L2, L3, L4, L5, L6, L7, + I0, I1, I2, I3, I4, I5, FP, I7, + + F0, F1, F2, F3, F4, F5, F6, F7, + F8, F9, F10, F11, F12, F13, F14, F15, + F16, F17, F18, F19, F20, F21, F22, F23, + F24, F25, F26, F27, F28, F29, F30, F31, + Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR }; + +/*************************** ASSEMBLY CODE MACROS *************************/ +/* */ + +extern void trap_low(); + +asm(" + .reserve trapstack, 1000 * 4, \"bss\", 8 + + .data + .align 4 + +in_trap_handler: + .word 0 + + .text + .align 4 + +! This function is called when any SPARC trap (except window overflow or +! underflow) occurs. It makes sure that the invalid register window is still +! available before jumping into C code. It will also restore the world if you +! return from handle_exception. + + .globl _trap_low +_trap_low: + mov %psr, %l0 + mov %wim, %l3 + + srl %l3, %l0, %l4 ! wim >> cwp + cmp %l4, 1 + bne window_fine ! Branch if not in the invalid window + nop + +! Handle window overflow + + mov %g1, %l4 ! Save g1, we use it to hold the wim + srl %l3, 1, %g1 ! Rotate wim right + tst %g1 + bg good_wim ! Branch if new wim is non-zero + nop + +! At this point, we need to bring a 1 into the high order bit of the wim. +! Since we don't want to make any assumptions about the number of register +! windows, we figure it out dynamically so as to setup the wim correctly. + + not %g1 ! Fill g1 with ones + mov %g1, %wim ! Fill the wim with ones + nop + nop + nop + mov %wim, %g1 ! Read back the wim + inc %g1 ! Now g1 has 1 just to left of wim + srl %g1, 1, %g1 ! Now put 1 at top of wim + mov %g0, %wim ! Clear wim so that subsequent save + nop ! won't trap + nop + nop + +good_wim: + save %g0, %g0, %g0 ! Slip into next window + mov %g1, %wim ! Install the new wim + + std %l0, [%sp + 0 * 4] ! save L & I registers + std %l2, [%sp + 2 * 4] + std %l4, [%sp + 4 * 4] + std %l6, [%sp + 6 * 4] + + std %i0, [%sp + 8 * 4] + std %i2, [%sp + 10 * 4] + std %i4, [%sp + 12 * 4] + std %i6, [%sp + 14 * 4] + + restore ! Go back to trap window. + mov %l4, %g1 ! Restore %g1 + +window_fine: + sethi %hi(in_trap_handler), %l4 + ld [%lo(in_trap_handler) + %l4], %l5 + tst %l5 + bg recursive_trap + inc %l5 + + set trapstack+1000*4, %sp ! Switch to trap stack + +recursive_trap: + st %l5, [%lo(in_trap_handler) + %l4] + sub %sp,(16+1+6+1+72)*4,%sp ! Make room for input & locals + ! + hidden arg + arg spill + ! + doubleword alignment + ! + registers[72] local var + + std %g0, [%sp + (24 + 0) * 4] ! registers[Gx] + std %g2, [%sp + (24 + 2) * 4] + std %g4, [%sp + (24 + 4) * 4] + std %g6, [%sp + (24 + 6) * 4] + + std %i0, [%sp + (24 + 8) * 4] ! registers[Ox] + std %i2, [%sp + (24 + 10) * 4] + std %i4, [%sp + (24 + 12) * 4] + std %i6, [%sp + (24 + 14) * 4] + ! F0->F31 not implemented + mov %y, %l4 + mov %tbr, %l5 + st %l4, [%sp + (24 + 64) * 4] ! Y + st %l0, [%sp + (24 + 65) * 4] ! PSR + st %l3, [%sp + (24 + 66) * 4] ! WIM + st %l5, [%sp + (24 + 67) * 4] ! TBR + st %l1, [%sp + (24 + 68) * 4] ! PC + st %l2, [%sp + (24 + 69) * 4] ! NPC + + ! CPSR and FPSR not impl + + or %l0, 0xf20, %l4 + mov %l4, %psr ! Turn on traps, disable interrupts + + call _handle_exception + add %sp, 24 * 4, %o0 ! Pass address of registers + +! Reload all of the registers that aren't on the stack + + ld [%sp + (24 + 1) * 4], %g1 ! registers[Gx] + ldd [%sp + (24 + 2) * 4], %g2 + ldd [%sp + (24 + 4) * 4], %g4 + ldd [%sp + (24 + 6) * 4], %g6 + + ldd [%sp + (24 + 8) * 4], %i0 ! registers[Ox] + ldd [%sp + (24 + 10) * 4], %i2 + ldd [%sp + (24 + 12) * 4], %i4 + ldd [%sp + (24 + 14) * 4], %i6 + + ldd [%sp + (24 + 64) * 4], %l0 ! Y & PSR + ldd [%sp + (24 + 68) * 4], %l2 ! PC & NPC + + restore ! Ensure that previous window is valid + save %g0, %g0, %g0 ! by causing a window_underflow trap + + mov %l0, %y + mov %l1, %psr ! Make sure that traps are disabled + ! for rett + + sethi %hi(in_trap_handler), %l4 + ld [%lo(in_trap_handler) + %l4], %l5 + dec %l5 + st %l5, [%lo(in_trap_handler) + %l4] + + jmpl %l2, %g0 ! Restore old PC + rett %l3 ! Restore old nPC +"); + +/* Convert ch from a hex digit to an int */ + +static int +hex(ch) + unsigned char ch; +{ + if (ch >= 'a' && ch <= 'f') + return ch-'a'+10; + if (ch >= '0' && ch <= '9') + return ch-'0'; + if (ch >= 'A' && ch <= 'F') + return ch-'A'+10; + return -1; +} + +/* scan for the sequence $<data>#<checksum> */ + +static void +getpacket(buffer) + char *buffer; +{ + unsigned char checksum; + unsigned char xmitcsum; + int i; + int count; + unsigned char ch; + + do + { + /* wait around for the start character, ignore all other characters */ + while ((ch = (getDebugChar() & 0x7f)) != '$') ; + + checksum = 0; + xmitcsum = -1; + + count = 0; + + /* now, read until a # or end of buffer is found */ + while (count < BUFMAX) + { + ch = getDebugChar() & 0x7f; + if (ch == '#') + break; + checksum = checksum + ch; + buffer[count] = ch; + count = count + 1; + } + + if (count >= BUFMAX) + continue; + + buffer[count] = 0; + + if (ch == '#') + { + xmitcsum = hex(getDebugChar() & 0x7f) << 4; + xmitcsum |= hex(getDebugChar() & 0x7f); +#if 0 + /* Humans shouldn't have to figure out checksums to type to it. */ + putDebugChar ('+'); + return; +#endif + if (checksum != xmitcsum) + putDebugChar('-'); /* failed checksum */ + else + { + putDebugChar('+'); /* successful transfer */ + /* if a sequence char is present, reply the sequence ID */ + if (buffer[2] == ':') + { + putDebugChar(buffer[0]); + putDebugChar(buffer[1]); + /* remove sequence chars from buffer */ + count = strlen(buffer); + for (i=3; i <= count; i++) + buffer[i-3] = buffer[i]; + } + } + } + } + while (checksum != xmitcsum); +} + +/* send the packet in buffer. */ + +static void +putpacket(buffer) + unsigned char *buffer; +{ + unsigned char checksum; + int count; + unsigned char ch; + + /* $<packet info>#<checksum>. */ + do + { + putDebugChar('$'); + checksum = 0; + count = 0; + + while (ch = buffer[count]) + { + if (! putDebugChar(ch)) + return; + checksum += ch; + count += 1; + } + + putDebugChar('#'); + putDebugChar(hexchars[checksum >> 4]); + putDebugChar(hexchars[checksum & 0xf]); + + } + while ((getDebugChar() & 0x7f) != '+'); +} + +static char remcomInBuffer[BUFMAX]; +static char remcomOutBuffer[BUFMAX]; + +/* Indicate to caller of mem2hex or hex2mem that there has been an + error. */ +static volatile int mem_err = 0; + +/* Convert the memory pointed to by mem into hex, placing result in buf. + * Return a pointer to the last char put in buf (null), in case of mem fault, + * return 0. + * If MAY_FAULT is non-zero, then we will handle memory faults by returning + * a 0, else treat a fault like any other fault in the stub. + */ + +static unsigned char * +mem2hex(mem, buf, count, may_fault) + unsigned char *mem; + unsigned char *buf; + int count; + int may_fault; +{ + unsigned char ch; + + set_mem_fault_trap(may_fault); + + while (count-- > 0) + { + ch = *mem++; + if (mem_err) + return 0; + *buf++ = hexchars[ch >> 4]; + *buf++ = hexchars[ch & 0xf]; + } + + *buf = 0; + + set_mem_fault_trap(0); + + return buf; +} + +/* convert the hex array pointed to by buf into binary to be placed in mem + * return a pointer to the character AFTER the last byte written */ + +static char * +hex2mem(buf, mem, count, may_fault) + unsigned char *buf; + unsigned char *mem; + int count; + int may_fault; +{ + int i; + unsigned char ch; + + set_mem_fault_trap(may_fault); + + for (i=0; i<count; i++) + { + ch = hex(*buf++) << 4; + ch |= hex(*buf++); + *mem++ = ch; + if (mem_err) + return 0; + } + + set_mem_fault_trap(0); + + return mem; +} + +/* This table contains the mapping between SPARC hardware trap types, and + signals, which are primarily what GDB understands. It also indicates + which hardware traps we need to commandeer when initializing the stub. */ + +static struct hard_trap_info +{ + unsigned char tt; /* Trap type code for SPARClite */ + unsigned char signo; /* Signal that we map this trap into */ +} hard_trap_info[] = { + {1, SIGSEGV}, /* instruction access error */ + {2, SIGILL}, /* privileged instruction */ + {3, SIGILL}, /* illegal instruction */ + {4, SIGEMT}, /* fp disabled */ + {36, SIGEMT}, /* cp disabled */ + {7, SIGBUS}, /* mem address not aligned */ + {9, SIGSEGV}, /* data access exception */ + {10, SIGEMT}, /* tag overflow */ + {128+1, SIGTRAP}, /* ta 1 - normal breakpoint instruction */ + {0, 0} /* Must be last */ +}; + +/* Set up exception handlers for tracing and breakpoints */ + +void +set_debug_traps() +{ + struct hard_trap_info *ht; + + for (ht = hard_trap_info; ht->tt && ht->signo; ht++) + exceptionHandler(ht->tt, trap_low); + + /* In case GDB is started before us, ack any packets (presumably + "$?#xx") sitting there. */ + + putDebugChar ('+'); + + initialized = 1; +} + +asm (" +! Trap handler for memory errors. This just sets mem_err to be non-zero. It +! assumes that %l1 is non-zero. This should be safe, as it is doubtful that +! 0 would ever contain code that could mem fault. This routine will skip +! past the faulting instruction after setting mem_err. + + .text + .align 4 + +_fltr_set_mem_err: + sethi %hi(_mem_err), %l0 + st %l1, [%l0 + %lo(_mem_err)] + jmpl %l2, %g0 + rett %l2+4 +"); + +static void +set_mem_fault_trap(enable) + int enable; +{ + extern void fltr_set_mem_err(); + mem_err = 0; + + if (enable) + exceptionHandler(9, fltr_set_mem_err); + else + exceptionHandler(9, trap_low); +} + +/* Convert the SPARC hardware trap type code to a unix signal number. */ + +static int +computeSignal(tt) + int tt; +{ + struct hard_trap_info *ht; + + for (ht = hard_trap_info; ht->tt && ht->signo; ht++) + if (ht->tt == tt) + return ht->signo; + + return SIGHUP; /* default for things we don't know about */ +} + +/* + * While we find nice hex chars, build an int. + * Return number of chars processed. + */ + +static int +hexToInt(char **ptr, int *intValue) +{ + int numChars = 0; + int hexValue; + + *intValue = 0; + + while (**ptr) + { + hexValue = hex(**ptr); + if (hexValue < 0) + break; + + *intValue = (*intValue << 4) | hexValue; + numChars ++; + + (*ptr)++; + } + + return (numChars); +} + +/* + * This function does all command procesing for interfacing to gdb. It + * returns 1 if you should skip the instruction at the trap address, 0 + * otherwise. + */ + +extern void breakinst(); + +static void +handle_exception (registers) + unsigned long *registers; +{ + int tt; /* Trap type */ + int sigval; + int addr; + int length; + char *ptr; + unsigned long *sp; + +/* First, we must force all of the windows to be spilled out */ + + asm(" save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + restore + restore + restore + restore + restore + restore + restore + restore +"); + + if (registers[PC] == (unsigned long)breakinst) + { + registers[PC] = registers[NPC]; + registers[NPC] += 4; + } + + sp = (unsigned long *)registers[SP]; + + tt = (registers[TBR] >> 4) & 0xff; + + /* reply to host that an exception has occurred */ + sigval = computeSignal(tt); + ptr = remcomOutBuffer; + + *ptr++ = 'T'; + *ptr++ = hexchars[sigval >> 4]; + *ptr++ = hexchars[sigval & 0xf]; + + *ptr++ = hexchars[PC >> 4]; + *ptr++ = hexchars[PC & 0xf]; + *ptr++ = ':'; + ptr = mem2hex((char *)®isters[PC], ptr, 4, 0); + *ptr++ = ';'; + + *ptr++ = hexchars[FP >> 4]; + *ptr++ = hexchars[FP & 0xf]; + *ptr++ = ':'; + ptr = mem2hex(sp + 8 + 6, ptr, 4, 0); /* FP */ + *ptr++ = ';'; + + *ptr++ = hexchars[SP >> 4]; + *ptr++ = hexchars[SP & 0xf]; + *ptr++ = ':'; + ptr = mem2hex((char *)&sp, ptr, 4, 0); + *ptr++ = ';'; + + *ptr++ = hexchars[NPC >> 4]; + *ptr++ = hexchars[NPC & 0xf]; + *ptr++ = ':'; + ptr = mem2hex((char *)®isters[NPC], ptr, 4, 0); + *ptr++ = ';'; + + *ptr++ = hexchars[O7 >> 4]; + *ptr++ = hexchars[O7 & 0xf]; + *ptr++ = ':'; + ptr = mem2hex((char *)®isters[O7], ptr, 4, 0); + *ptr++ = ';'; + + *ptr++ = 0; + + putpacket(remcomOutBuffer); + + while (1) + { + remcomOutBuffer[0] = 0; + + getpacket(remcomInBuffer); + switch (remcomInBuffer[0]) + { + case '?': + remcomOutBuffer[0] = 'S'; + remcomOutBuffer[1] = hexchars[sigval >> 4]; + remcomOutBuffer[2] = hexchars[sigval & 0xf]; + remcomOutBuffer[3] = 0; + break; + + case 'd': + /* toggle debug flag */ + break; + + case 'g': /* return the value of the CPU registers */ + { + ptr = remcomOutBuffer; + ptr = mem2hex((char *)registers, ptr, 16 * 4, 0); /* G & O regs */ + ptr = mem2hex(sp + 0, ptr, 16 * 4, 0); /* L & I regs */ + memset(ptr, '0', 32 * 8); /* Floating point */ + mem2hex((char *)®isters[Y], + ptr + 32 * 4 * 2, + 8 * 4, + 0); /* Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR */ + } + break; + + case 'G': /* set the value of the CPU registers - return OK */ + { + unsigned long *newsp, psr; + + psr = registers[PSR]; + + ptr = &remcomInBuffer[1]; + hex2mem(ptr, (char *)registers, 16 * 4, 0); /* G & O regs */ + hex2mem(ptr + 16 * 4 * 2, sp + 0, 16 * 4, 0); /* L & I regs */ + hex2mem(ptr + 64 * 4 * 2, (char *)®isters[Y], + 8 * 4, 0); /* Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR */ + + /* See if the stack pointer has moved. If so, then copy the saved + locals and ins to the new location. This keeps the window + overflow and underflow routines happy. */ + + newsp = (unsigned long *)registers[SP]; + if (sp != newsp) + sp = memcpy(newsp, sp, 16 * 4); + + /* Don't allow CWP to be modified. */ + + if (psr != registers[PSR]) + registers[PSR] = (psr & 0x1f) | (registers[PSR] & ~0x1f); + + strcpy(remcomOutBuffer,"OK"); + } + break; + + case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */ + /* Try to read %x,%x. */ + + ptr = &remcomInBuffer[1]; + + if (hexToInt(&ptr, &addr) + && *ptr++ == ',' + && hexToInt(&ptr, &length)) + { + if (mem2hex((char *)addr, remcomOutBuffer, length, 1)) + break; + + strcpy (remcomOutBuffer, "E03"); + } + else + strcpy(remcomOutBuffer,"E01"); + break; + + case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */ + /* Try to read '%x,%x:'. */ + + ptr = &remcomInBuffer[1]; + + if (hexToInt(&ptr, &addr) + && *ptr++ == ',' + && hexToInt(&ptr, &length) + && *ptr++ == ':') + { + if (hex2mem(ptr, (char *)addr, length, 1)) + strcpy(remcomOutBuffer, "OK"); + else + strcpy(remcomOutBuffer, "E03"); + } + else + strcpy(remcomOutBuffer, "E02"); + break; + + case 'c': /* cAA..AA Continue at address AA..AA(optional) */ + /* try to read optional parameter, pc unchanged if no parm */ + + ptr = &remcomInBuffer[1]; + if (hexToInt(&ptr, &addr)) + { + registers[PC] = addr; + registers[NPC] = addr + 4; + } + +/* Need to flush the instruction cache here, as we may have deposited a + breakpoint, and the icache probably has no way of knowing that a data ref to + some location may have changed something that is in the instruction cache. + */ + + flush_i_cache(); + return; + + /* kill the program */ + case 'k' : /* do nothing */ + break; +#if 0 + case 't': /* Test feature */ + asm (" std %f30,[%sp]"); + break; +#endif + case 'r': /* Reset */ + asm ("call 0 + nop "); + break; + +#if 0 +Disabled until we can unscrew this properly + + case 'b': /* bBB... Set baud rate to BB... */ + { + int baudrate; + extern void set_timer_3(); + + ptr = &remcomInBuffer[1]; + if (!hexToInt(&ptr, &baudrate)) + { + strcpy(remcomOutBuffer,"B01"); + break; + } + + /* Convert baud rate to uart clock divider */ + switch (baudrate) + { + case 38400: + baudrate = 16; + break; + case 19200: + baudrate = 33; + break; + case 9600: + baudrate = 65; + break; + default: + strcpy(remcomOutBuffer,"B02"); + goto x1; + } + + putpacket("OK"); /* Ack before changing speed */ + set_timer_3(baudrate); /* Set it */ + } +x1: break; +#endif + } /* switch */ + + /* reply to the request */ + putpacket(remcomOutBuffer); + } +} + +/* This function will generate a breakpoint exception. It is used at the + beginning of a program to sync up with a debugger and can be used + otherwise as a quick means to stop program execution and "break" into + the debugger. */ + +void +breakpoint() +{ + if (!initialized) + return; + + asm(" .globl _breakinst + + _breakinst: ta 1 + "); +} diff --git a/contrib/gdb/gdb/sparc-tdep.c b/contrib/gdb/gdb/sparc-tdep.c new file mode 100644 index 0000000000000..c8b7d5c270a5b --- /dev/null +++ b/contrib/gdb/gdb/sparc-tdep.c @@ -0,0 +1,1513 @@ +/* Target-dependent code for the SPARC for GDB, the GNU debugger. + Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995 + Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* ??? Support for calling functions from gdb in sparc64 is unfinished. */ + +#include "defs.h" +#include "frame.h" +#include "inferior.h" +#include "obstack.h" +#include "target.h" +#include "value.h" + +#ifdef USE_PROC_FS +#include <sys/procfs.h> +#endif + +#include "gdbcore.h" + +#ifdef GDB_TARGET_IS_SPARC64 +#define FP_REGISTER_BYTES (64 * 4) +#else +#define FP_REGISTER_BYTES (32 * 4) +#endif + +/* If not defined, assume 32 bit sparc. */ +#ifndef FP_MAX_REGNUM +#define FP_MAX_REGNUM (FP0_REGNUM + 32) +#endif + +#define SPARC_INTREG_SIZE (REGISTER_RAW_SIZE (G0_REGNUM)) + +/* From infrun.c */ +extern int stop_after_trap; + +/* We don't store all registers immediately when requested, since they + get sent over in large chunks anyway. Instead, we accumulate most + of the changes and send them over once. "deferred_stores" keeps + track of which sets of registers we have locally-changed copies of, + so we only need send the groups that have changed. */ + +int deferred_stores = 0; /* Cumulates stores we want to do eventually. */ + +/* Branches with prediction are treated like their non-predicting cousins. */ +/* FIXME: What about floating point branches? */ + +/* Macros to extract fields from sparc instructions. */ +#define X_OP(i) (((i) >> 30) & 0x3) +#define X_RD(i) (((i) >> 25) & 0x1f) +#define X_A(i) (((i) >> 29) & 1) +#define X_COND(i) (((i) >> 25) & 0xf) +#define X_OP2(i) (((i) >> 22) & 0x7) +#define X_IMM22(i) ((i) & 0x3fffff) +#define X_OP3(i) (((i) >> 19) & 0x3f) +#define X_RS1(i) (((i) >> 14) & 0x1f) +#define X_I(i) (((i) >> 13) & 1) +#define X_IMM13(i) ((i) & 0x1fff) +/* Sign extension macros. */ +#define X_SIMM13(i) ((X_IMM13 (i) ^ 0x1000) - 0x1000) +#define X_DISP22(i) ((X_IMM22 (i) ^ 0x200000) - 0x200000) +#ifdef GDB_TARGET_IS_SPARC64 +#define X_CC(i) (((i) >> 20) & 3) +#define X_P(i) (((i) >> 19) & 1) +#define X_DISP19(i) ((((i) & 0x7ffff) ^ 0x40000) - 0x40000) +#define X_RCOND(i) (((i) >> 25) & 7) +#define X_DISP16(i) ((((((i) >> 6) && 0xc000) | ((i) & 0x3fff)) ^ 0x8000) - 0x8000) +#define X_FCN(i) (((i) >> 25) & 31) +#endif + +typedef enum +{ + Error, not_branch, bicc, bicca, ba, baa, ticc, ta, +#ifdef GDB_TARGET_IS_SPARC64 + done_retry +#endif +} branch_type; + +/* Simulate single-step ptrace call for sun4. Code written by Gary + Beihl (beihl@mcc.com). */ + +/* npc4 and next_pc describe the situation at the time that the + step-breakpoint was set, not necessary the current value of NPC_REGNUM. */ +static CORE_ADDR next_pc, npc4, target; +static int brknpc4, brktrg; +typedef char binsn_quantum[BREAKPOINT_MAX]; +static binsn_quantum break_mem[3]; + +/* Non-zero if we just simulated a single-step ptrace call. This is + needed because we cannot remove the breakpoints in the inferior + process until after the `wait' in `wait_for_inferior'. Used for + sun4. */ + +int one_stepped; + +/* single_step() is called just before we want to resume the inferior, + if we want to single-step it but there is no hardware or kernel single-step + support (as on all SPARCs). We find all the possible targets of the + coming instruction and breakpoint them. + + single_step is also called just after the inferior stops. If we had + set up a simulated single-step, we undo our damage. */ + +void +single_step (ignore) + int ignore; /* pid, but we don't need it */ +{ + branch_type br, isbranch(); + CORE_ADDR pc; + long pc_instruction; + + if (!one_stepped) + { + /* Always set breakpoint for NPC. */ + next_pc = read_register (NPC_REGNUM); + npc4 = next_pc + 4; /* branch not taken */ + + target_insert_breakpoint (next_pc, break_mem[0]); + /* printf_unfiltered ("set break at %x\n",next_pc); */ + + pc = read_register (PC_REGNUM); + pc_instruction = read_memory_integer (pc, 4); + br = isbranch (pc_instruction, pc, &target); + brknpc4 = brktrg = 0; + + if (br == bicca) + { + /* Conditional annulled branch will either end up at + npc (if taken) or at npc+4 (if not taken). + Trap npc+4. */ + brknpc4 = 1; + target_insert_breakpoint (npc4, break_mem[1]); + } + else if (br == baa && target != next_pc) + { + /* Unconditional annulled branch will always end up at + the target. */ + brktrg = 1; + target_insert_breakpoint (target, break_mem[2]); + } +#ifdef GDB_TARGET_IS_SPARC64 + else if (br == done_retry) + { + brktrg = 1; + target_insert_breakpoint (target, break_mem[2]); + } +#endif + + /* We are ready to let it go */ + one_stepped = 1; + return; + } + else + { + /* Remove breakpoints */ + target_remove_breakpoint (next_pc, break_mem[0]); + + if (brknpc4) + target_remove_breakpoint (npc4, break_mem[1]); + + if (brktrg) + target_remove_breakpoint (target, break_mem[2]); + + one_stepped = 0; + } +} + +/* Call this for each newly created frame. For SPARC, we need to calculate + the bottom of the frame, and do some extra work if the prologue + has been generated via the -mflat option to GCC. In particular, + we need to know where the previous fp and the pc have been stashed, + since their exact position within the frame may vary. */ + +void +sparc_init_extra_frame_info (fromleaf, fi) + int fromleaf; + struct frame_info *fi; +{ + char *name; + CORE_ADDR addr; + int insn; + + fi->bottom = + (fi->next ? + (fi->frame == fi->next->frame ? fi->next->bottom : fi->next->frame) : + read_register (SP_REGNUM)); + + /* If fi->next is NULL, then we already set ->frame by passing read_fp() + to create_new_frame. */ + if (fi->next) + { + char buf[MAX_REGISTER_RAW_SIZE]; + int err; + + /* Compute ->frame as if not flat. If it is flat, we'll change + it later. */ + /* FIXME: If error reading memory, should just stop backtracing, rather + than error(). */ + get_saved_register (buf, 0, 0, fi, FP_REGNUM, 0); + fi->frame = extract_address (buf, REGISTER_RAW_SIZE (FP_REGNUM)); + } + + /* Decide whether this is a function with a ``flat register window'' + frame. For such functions, the frame pointer is actually in %i7. */ + fi->flat = 0; + if (find_pc_partial_function (fi->pc, &name, &addr, NULL)) + { + /* See if the function starts with an add (which will be of a + negative number if a flat frame) to the sp. FIXME: Does not + handle large frames which will need more than one instruction + to adjust the sp. */ + insn = read_memory_integer (addr, 4); + if (X_OP (insn) == 2 && X_RD (insn) == 14 && X_OP3 (insn) == 0 + && X_I (insn) && X_SIMM13 (insn) < 0) + { + int offset = X_SIMM13 (insn); + + /* Then look for a save of %i7 into the frame. */ + insn = read_memory_integer (addr + 4, 4); + if (X_OP (insn) == 3 + && X_RD (insn) == 31 + && X_OP3 (insn) == 4 + && X_RS1 (insn) == 14) + { + char buf[MAX_REGISTER_RAW_SIZE]; + + /* We definitely have a flat frame now. */ + fi->flat = 1; + + fi->sp_offset = offset; + + /* Overwrite the frame's address with the value in %i7. */ + get_saved_register (buf, 0, 0, fi, I7_REGNUM, 0); + fi->frame = extract_address (buf, REGISTER_RAW_SIZE (I7_REGNUM)); + + /* Record where the fp got saved. */ + fi->fp_addr = fi->frame + fi->sp_offset + X_SIMM13 (insn); + + /* Also try to collect where the pc got saved to. */ + fi->pc_addr = 0; + insn = read_memory_integer (addr + 12, 4); + if (X_OP (insn) == 3 + && X_RD (insn) == 15 + && X_OP3 (insn) == 4 + && X_RS1 (insn) == 14) + fi->pc_addr = fi->frame + fi->sp_offset + X_SIMM13 (insn); + } + } + } + if (fi->next && fi->frame == 0) + { + /* Kludge to cause init_prev_frame_info to destroy the new frame. */ + fi->frame = fi->next->frame; + fi->pc = fi->next->pc; + } +} + +CORE_ADDR +sparc_frame_chain (frame) + struct frame_info *frame; +{ + /* Value that will cause FRAME_CHAIN_VALID to not worry about the chain + value. If it realy is zero, we detect it later in + sparc_init_prev_frame. */ + return (CORE_ADDR)1; +} + +CORE_ADDR +sparc_extract_struct_value_address (regbuf) + char regbuf[REGISTER_BYTES]; +{ +#ifdef GDB_TARGET_IS_SPARC64 + return extract_address (regbuf + REGISTER_BYTE (O0_REGNUM), + REGISTER_RAW_SIZE (O0_REGNUM)); +#else + return read_memory_integer (((int *)(regbuf)) [SP_REGNUM] + (16 * SPARC_INTREG_SIZE), + TARGET_PTR_BIT / TARGET_CHAR_BIT); +#endif +} + +/* Find the pc saved in frame FRAME. */ + +CORE_ADDR +sparc_frame_saved_pc (frame) + struct frame_info *frame; +{ + char buf[MAX_REGISTER_RAW_SIZE]; + CORE_ADDR addr; + + if (frame->signal_handler_caller) + { + /* This is the signal trampoline frame. + Get the saved PC from the sigcontext structure. */ + +#ifndef SIGCONTEXT_PC_OFFSET +#define SIGCONTEXT_PC_OFFSET 12 +#endif + + CORE_ADDR sigcontext_addr; + char scbuf[TARGET_PTR_BIT / HOST_CHAR_BIT]; + int saved_pc_offset = SIGCONTEXT_PC_OFFSET; + char *name = NULL; + + /* Solaris2 ucbsigvechandler passes a pointer to a sigcontext + as the third parameter. The offset to the saved pc is 12. */ + find_pc_partial_function (frame->pc, &name, + (CORE_ADDR *)NULL,(CORE_ADDR *)NULL); + if (name && STREQ (name, "ucbsigvechandler")) + saved_pc_offset = 12; + + /* The sigcontext address is contained in register O2. */ + get_saved_register (buf, (int *)NULL, (CORE_ADDR *)NULL, + frame, O0_REGNUM + 2, (enum lval_type *)NULL); + sigcontext_addr = extract_address (buf, REGISTER_RAW_SIZE (O0_REGNUM + 2)); + + /* Don't cause a memory_error when accessing sigcontext in case the + stack layout has changed or the stack is corrupt. */ + target_read_memory (sigcontext_addr + saved_pc_offset, + scbuf, sizeof (scbuf)); + return extract_address (scbuf, sizeof (scbuf)); + } + if (frame->flat) + addr = frame->pc_addr; + else + addr = frame->bottom + FRAME_SAVED_I0 + + SPARC_INTREG_SIZE * (I7_REGNUM - I0_REGNUM); + + if (addr == 0) + /* A flat frame leaf function might not save the PC anywhere, + just leave it in %o7. */ + return PC_ADJUST (read_register (O7_REGNUM)); + + read_memory (addr, buf, SPARC_INTREG_SIZE); + return PC_ADJUST (extract_address (buf, SPARC_INTREG_SIZE)); +} + +/* Since an individual frame in the frame cache is defined by two + arguments (a frame pointer and a stack pointer), we need two + arguments to get info for an arbitrary stack frame. This routine + takes two arguments and makes the cached frames look as if these + two arguments defined a frame on the cache. This allows the rest + of info frame to extract the important arguments without + difficulty. */ + +struct frame_info * +setup_arbitrary_frame (argc, argv) + int argc; + CORE_ADDR *argv; +{ + struct frame_info *frame; + + if (argc != 2) + error ("Sparc frame specifications require two arguments: fp and sp"); + + frame = create_new_frame (argv[0], 0); + + if (!frame) + fatal ("internal: create_new_frame returned invalid frame"); + + frame->bottom = argv[1]; + frame->pc = FRAME_SAVED_PC (frame); + return frame; +} + +/* Given a pc value, skip it forward past the function prologue by + disassembling instructions that appear to be a prologue. + + If FRAMELESS_P is set, we are only testing to see if the function + is frameless. This allows a quicker answer. + + This routine should be more specific in its actions; making sure + that it uses the same register in the initial prologue section. */ + +static CORE_ADDR examine_prologue PARAMS ((CORE_ADDR, int, struct frame_info *, + struct frame_saved_regs *)); + +static CORE_ADDR +examine_prologue (start_pc, frameless_p, fi, saved_regs) + CORE_ADDR start_pc; + int frameless_p; + struct frame_info *fi; + struct frame_saved_regs *saved_regs; +{ + int insn; + int dest = -1; + CORE_ADDR pc = start_pc; + int is_flat = 0; + + insn = read_memory_integer (pc, 4); + + /* Recognize the `sethi' insn and record its destination. */ + if (X_OP (insn) == 0 && X_OP2 (insn) == 4) + { + dest = X_RD (insn); + pc += 4; + insn = read_memory_integer (pc, 4); + } + + /* Recognize an add immediate value to register to either %g1 or + the destination register recorded above. Actually, this might + well recognize several different arithmetic operations. + It doesn't check that rs1 == rd because in theory "sub %g0, 5, %g1" + followed by "save %sp, %g1, %sp" is a valid prologue (Not that + I imagine any compiler really does that, however). */ + if (X_OP (insn) == 2 + && X_I (insn) + && (X_RD (insn) == 1 || X_RD (insn) == dest)) + { + pc += 4; + insn = read_memory_integer (pc, 4); + } + + /* Recognize any SAVE insn. */ + if (X_OP (insn) == 2 && X_OP3 (insn) == 60) + { + pc += 4; + if (frameless_p) /* If the save is all we care about, */ + return pc; /* return before doing more work */ + insn = read_memory_integer (pc, 4); + } + /* Recognize add to %sp. */ + else if (X_OP (insn) == 2 && X_RD (insn) == 14 && X_OP3 (insn) == 0) + { + pc += 4; + if (frameless_p) /* If the add is all we care about, */ + return pc; /* return before doing more work */ + is_flat = 1; + insn = read_memory_integer (pc, 4); + /* Recognize store of frame pointer (i7). */ + if (X_OP (insn) == 3 + && X_RD (insn) == 31 + && X_OP3 (insn) == 4 + && X_RS1 (insn) == 14) + { + pc += 4; + insn = read_memory_integer (pc, 4); + + /* Recognize sub %sp, <anything>, %i7. */ + if (X_OP (insn) == 2 + && X_OP3 (insn) == 4 + && X_RS1 (insn) == 14 + && X_RD (insn) == 31) + { + pc += 4; + insn = read_memory_integer (pc, 4); + } + else + return pc; + } + else + return pc; + } + else + /* Without a save or add instruction, it's not a prologue. */ + return start_pc; + + while (1) + { + /* Recognize stores into the frame from the input registers. + This recognizes all non alternate stores of input register, + into a location offset from the frame pointer. */ + if ((X_OP (insn) == 3 + && (X_OP3 (insn) & 0x3c) == 4 /* Store, non-alternate. */ + && (X_RD (insn) & 0x18) == 0x18 /* Input register. */ + && X_I (insn) /* Immediate mode. */ + && X_RS1 (insn) == 30 /* Off of frame pointer. */ + /* Into reserved stack space. */ + && X_SIMM13 (insn) >= 0x44 + && X_SIMM13 (insn) < 0x5b)) + ; + else if (is_flat + && X_OP (insn) == 3 + && X_OP3 (insn) == 4 + && X_RS1 (insn) == 14 + ) + { + if (saved_regs && X_I (insn)) + saved_regs->regs[X_RD (insn)] = + fi->frame + fi->sp_offset + X_SIMM13 (insn); + } + else + break; + pc += 4; + insn = read_memory_integer (pc, 4); + } + + return pc; +} + +CORE_ADDR +skip_prologue (start_pc, frameless_p) + CORE_ADDR start_pc; + int frameless_p; +{ + return examine_prologue (start_pc, frameless_p, NULL, NULL); +} + +/* Check instruction at ADDR to see if it is a branch. + All non-annulled instructions will go to NPC or will trap. + Set *TARGET if we find a candidate branch; set to zero if not. + + This isn't static as it's used by remote-sa.sparc.c. */ + +branch_type +isbranch (instruction, addr, target) + long instruction; + CORE_ADDR addr, *target; +{ + branch_type val = not_branch; + long int offset; /* Must be signed for sign-extend. */ + + *target = 0; + + if (X_OP (instruction) == 0 + && (X_OP2 (instruction) == 2 + || X_OP2 (instruction) == 6 +#ifdef GDB_TARGET_IS_SPARC64 + || X_OP2 (instruction) == 1 + || X_OP2 (instruction) == 3 + || X_OP2 (instruction) == 5 +#else + || X_OP2 (instruction) == 7 +#endif + )) + { + if (X_COND (instruction) == 8) + val = X_A (instruction) ? baa : ba; + else + val = X_A (instruction) ? bicca : bicc; + switch (X_OP2 (instruction)) + { + case 2: + case 6: +#ifndef GDB_TARGET_IS_SPARC64 + case 7: +#endif + offset = 4 * X_DISP22 (instruction); + break; +#ifdef GDB_TARGET_IS_SPARC64 + case 1: + case 5: + offset = 4 * X_DISP19 (instruction); + break; + case 3: + offset = 4 * X_DISP16 (instruction); + break; +#endif + } + *target = addr + offset; + } +#ifdef GDB_TARGET_IS_SPARC64 + else if (X_OP (instruction) == 2 + && X_OP3 (instruction) == 62) + { + if (X_FCN (instruction) == 0) + { + /* done */ + *target = read_register (TNPC_REGNUM); + val = done_retry; + } + else if (X_FCN (instruction) == 1) + { + /* retry */ + *target = read_register (TPC_REGNUM); + val = done_retry; + } + } +#endif + + return val; +} + +/* Find register number REGNUM relative to FRAME and put its + (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable + was optimized out (and thus can't be fetched). If the variable + was fetched from memory, set *ADDRP to where it was fetched from, + otherwise it was fetched from a register. + + The argument RAW_BUFFER must point to aligned memory. */ + +void +get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) + char *raw_buffer; + int *optimized; + CORE_ADDR *addrp; + struct frame_info *frame; + int regnum; + enum lval_type *lval; +{ + struct frame_info *frame1; + CORE_ADDR addr; + + if (!target_has_registers) + error ("No registers."); + + if (optimized) + *optimized = 0; + + addr = 0; + frame1 = frame->next; + while (frame1 != NULL) + { + if (frame1->pc >= (frame1->bottom ? frame1->bottom : + read_register (SP_REGNUM)) + && frame1->pc <= FRAME_FP (frame1)) + { + /* Dummy frame. All but the window regs are in there somewhere. */ + if (regnum >= G1_REGNUM && regnum < G1_REGNUM + 7) + addr = frame1->frame + (regnum - G0_REGNUM) * SPARC_INTREG_SIZE + - (FP_REGISTER_BYTES + 8 * SPARC_INTREG_SIZE); + else if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8) + addr = frame1->frame + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE + - (FP_REGISTER_BYTES + 16 * SPARC_INTREG_SIZE); + else if (regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 32) + addr = frame1->frame + (regnum - FP0_REGNUM) * 4 + - (FP_REGISTER_BYTES); +#ifdef GDB_TARGET_IS_SPARC64 + else if (regnum >= FP0_REGNUM + 32 && regnum < FP_MAX_REGNUM) + addr = frame1->frame + 32 * 4 + (regnum - FP0_REGNUM - 32) * 8 + - (FP_REGISTER_BYTES); +#endif + else if (regnum >= Y_REGNUM && regnum < NUM_REGS) + addr = frame1->frame + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE + - (FP_REGISTER_BYTES + 24 * SPARC_INTREG_SIZE); + } + else if (frame1->flat) + { + + if (regnum == RP_REGNUM) + addr = frame1->pc_addr; + else if (regnum == I7_REGNUM) + addr = frame1->fp_addr; + else + { + CORE_ADDR func_start; + struct frame_saved_regs regs; + memset (®s, 0, sizeof (regs)); + + find_pc_partial_function (frame1->pc, NULL, &func_start, NULL); + examine_prologue (func_start, 0, frame1, ®s); + addr = regs.regs[regnum]; + } + } + else + { + /* Normal frame. Local and In registers are saved on stack. */ + if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8) + addr = (frame1->prev->bottom + + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE + + FRAME_SAVED_I0); + else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8) + addr = (frame1->prev->bottom + + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE + + FRAME_SAVED_L0); + else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8) + { + /* Outs become ins. */ + get_saved_register (raw_buffer, optimized, addrp, frame1, + (regnum - O0_REGNUM + I0_REGNUM), lval); + return; + } + } + if (addr != 0) + break; + frame1 = frame1->next; + } + if (addr != 0) + { + if (lval != NULL) + *lval = lval_memory; + if (regnum == SP_REGNUM) + { + if (raw_buffer != NULL) + { + /* Put it back in target format. */ + store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), addr); + } + if (addrp != NULL) + *addrp = 0; + return; + } + if (raw_buffer != NULL) + read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum)); + } + else + { + if (lval != NULL) + *lval = lval_register; + addr = REGISTER_BYTE (regnum); + if (raw_buffer != NULL) + read_register_gen (regnum, raw_buffer); + } + if (addrp != NULL) + *addrp = addr; +} + +/* Push an empty stack frame, and record in it the current PC, regs, etc. + + We save the non-windowed registers and the ins. The locals and outs + are new; they don't need to be saved. The i's and l's of + the last frame were already saved on the stack. */ + +/* Definitely see tm-sparc.h for more doc of the frame format here. */ + +#ifdef GDB_TARGET_IS_SPARC64 +#define DUMMY_REG_SAVE_OFFSET (128 + 16) +#else +#define DUMMY_REG_SAVE_OFFSET 0x60 +#endif + +/* See tm-sparc.h for how this is calculated. */ +#define DUMMY_STACK_REG_BUF_SIZE \ +(((8+8+8) * SPARC_INTREG_SIZE) + (32 * REGISTER_RAW_SIZE (FP0_REGNUM))) +#define DUMMY_STACK_SIZE (DUMMY_STACK_REG_BUF_SIZE + DUMMY_REG_SAVE_OFFSET) + +void +sparc_push_dummy_frame () +{ + CORE_ADDR sp, old_sp; + char register_temp[DUMMY_STACK_SIZE]; + + old_sp = sp = read_register (SP_REGNUM); + +#ifdef GDB_TARGET_IS_SPARC64 + /* FIXME: not sure what needs to be saved here. */ +#else + /* Y, PS, WIM, TBR, PC, NPC, FPS, CPS regs */ + read_register_bytes (REGISTER_BYTE (Y_REGNUM), ®ister_temp[0], + REGISTER_RAW_SIZE (Y_REGNUM) * 8); +#endif + + read_register_bytes (REGISTER_BYTE (O0_REGNUM), + ®ister_temp[8 * SPARC_INTREG_SIZE], + SPARC_INTREG_SIZE * 8); + + read_register_bytes (REGISTER_BYTE (G0_REGNUM), + ®ister_temp[16 * SPARC_INTREG_SIZE], + SPARC_INTREG_SIZE * 8); + + read_register_bytes (REGISTER_BYTE (FP0_REGNUM), + ®ister_temp[24 * SPARC_INTREG_SIZE], + FP_REGISTER_BYTES); + + sp -= DUMMY_STACK_SIZE; + + write_register (SP_REGNUM, sp); + + write_memory (sp + DUMMY_REG_SAVE_OFFSET, ®ister_temp[0], + DUMMY_STACK_REG_BUF_SIZE); + + write_register (FP_REGNUM, old_sp); + + /* Set return address register for the call dummy to the current PC. */ + write_register (I7_REGNUM, read_pc() - 8); +} + +/* sparc_frame_find_saved_regs (). This function is here only because + pop_frame uses it. Note there is an interesting corner case which + I think few ports of GDB get right--if you are popping a frame + which does not save some register that *is* saved by a more inner + frame (such a frame will never be a dummy frame because dummy + frames save all registers). Rewriting pop_frame to use + get_saved_register would solve this problem and also get rid of the + ugly duplication between sparc_frame_find_saved_regs and + get_saved_register. + + Stores, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. + + Note that on register window machines, we are currently making the + assumption that window registers are being saved somewhere in the + frame in which they are being used. If they are stored in an + inferior frame, find_saved_register will break. + + On the Sun 4, the only time all registers are saved is when + a dummy frame is involved. Otherwise, the only saved registers + are the LOCAL and IN registers which are saved as a result + of the "save/restore" opcodes. This condition is determined + by address rather than by value. + + The "pc" is not stored in a frame on the SPARC. (What is stored + is a return address minus 8.) sparc_pop_frame knows how to + deal with that. Other routines might or might not. + + See tm-sparc.h (PUSH_FRAME and friends) for CRITICAL information + about how this works. */ + +static void sparc_frame_find_saved_regs PARAMS ((struct frame_info *, + struct frame_saved_regs *)); + +static void +sparc_frame_find_saved_regs (fi, saved_regs_addr) + struct frame_info *fi; + struct frame_saved_regs *saved_regs_addr; +{ + register int regnum; + CORE_ADDR frame_addr = FRAME_FP (fi); + + if (!fi) + fatal ("Bad frame info struct in FRAME_FIND_SAVED_REGS"); + + memset (saved_regs_addr, 0, sizeof (*saved_regs_addr)); + + if (fi->pc >= (fi->bottom ? fi->bottom : + read_register (SP_REGNUM)) + && fi->pc <= FRAME_FP(fi)) + { + /* Dummy frame. All but the window regs are in there somewhere. */ + for (regnum = G1_REGNUM; regnum < G1_REGNUM+7; regnum++) + saved_regs_addr->regs[regnum] = + frame_addr + (regnum - G0_REGNUM) * SPARC_INTREG_SIZE + - (FP_REGISTER_BYTES + 8 * SPARC_INTREG_SIZE); + for (regnum = I0_REGNUM; regnum < I0_REGNUM+8; regnum++) + saved_regs_addr->regs[regnum] = + frame_addr + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE + - (FP_REGISTER_BYTES + 16 * SPARC_INTREG_SIZE); + for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 32; regnum++) + saved_regs_addr->regs[regnum] = + frame_addr + (regnum - FP0_REGNUM) * 4 + - (FP_REGISTER_BYTES); +#ifdef GDB_TARGET_IS_SPARC64 + for (regnum = FP0_REGNUM + 32; regnum < FP_MAX_REGNUM; regnum++) + saved_regs_addr->regs[regnum] = + frame_addr + 32 * 4 + (regnum - FP0_REGNUM - 32) * 8 + - (FP_REGISTER_BYTES); +#endif + for (regnum = Y_REGNUM; regnum < NUM_REGS; regnum++) + saved_regs_addr->regs[regnum] = + frame_addr + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE - 0xe0; + - (FP_REGISTER_BYTES + 24 * SPARC_INTREG_SIZE); + frame_addr = fi->bottom ? + fi->bottom : read_register (SP_REGNUM); + } + else if (fi->flat) + { + CORE_ADDR func_start; + find_pc_partial_function (fi->pc, NULL, &func_start, NULL); + examine_prologue (func_start, 0, fi, saved_regs_addr); + + /* Flat register window frame. */ + saved_regs_addr->regs[RP_REGNUM] = fi->pc_addr; + saved_regs_addr->regs[I7_REGNUM] = fi->fp_addr; + } + else + { + /* Normal frame. Just Local and In registers */ + frame_addr = fi->bottom ? + fi->bottom : read_register (SP_REGNUM); + for (regnum = L0_REGNUM; regnum < L0_REGNUM+8; regnum++) + saved_regs_addr->regs[regnum] = + (frame_addr + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE + + FRAME_SAVED_L0); + for (regnum = I0_REGNUM; regnum < I0_REGNUM+8; regnum++) + saved_regs_addr->regs[regnum] = + (frame_addr + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE + + FRAME_SAVED_I0); + } + if (fi->next) + { + if (fi->flat) + { + saved_regs_addr->regs[O7_REGNUM] = fi->pc_addr; + } + else + { + /* Pull off either the next frame pointer or the stack pointer */ + CORE_ADDR next_next_frame_addr = + (fi->next->bottom ? + fi->next->bottom : + read_register (SP_REGNUM)); + for (regnum = O0_REGNUM; regnum < O0_REGNUM+8; regnum++) + saved_regs_addr->regs[regnum] = + (next_next_frame_addr + + (regnum - O0_REGNUM) * SPARC_INTREG_SIZE + + FRAME_SAVED_I0); + } + } + /* Otherwise, whatever we would get from ptrace(GETREGS) is accurate */ + saved_regs_addr->regs[SP_REGNUM] = FRAME_FP (fi); +} + +/* Discard from the stack the innermost frame, restoring all saved registers. + + Note that the values stored in fsr by get_frame_saved_regs are *in + the context of the called frame*. What this means is that the i + regs of fsr must be restored into the o regs of the (calling) frame that + we pop into. We don't care about the output regs of the calling frame, + since unless it's a dummy frame, it won't have any output regs in it. + + We never have to bother with %l (local) regs, since the called routine's + locals get tossed, and the calling routine's locals are already saved + on its stack. */ + +/* Definitely see tm-sparc.h for more doc of the frame format here. */ + +void +sparc_pop_frame () +{ + register struct frame_info *frame = get_current_frame (); + register CORE_ADDR pc; + struct frame_saved_regs fsr; + char raw_buffer[REGISTER_BYTES]; + int regnum; + + sparc_frame_find_saved_regs (frame, &fsr); + if (fsr.regs[FP0_REGNUM]) + { + read_memory (fsr.regs[FP0_REGNUM], raw_buffer, FP_REGISTER_BYTES); + write_register_bytes (REGISTER_BYTE (FP0_REGNUM), + raw_buffer, FP_REGISTER_BYTES); + } +#ifndef GDB_TARGET_IS_SPARC64 + if (fsr.regs[FPS_REGNUM]) + { + read_memory (fsr.regs[FPS_REGNUM], raw_buffer, 4); + write_register_bytes (REGISTER_BYTE (FPS_REGNUM), raw_buffer, 4); + } + if (fsr.regs[CPS_REGNUM]) + { + read_memory (fsr.regs[CPS_REGNUM], raw_buffer, 4); + write_register_bytes (REGISTER_BYTE (CPS_REGNUM), raw_buffer, 4); + } +#endif + if (fsr.regs[G1_REGNUM]) + { + read_memory (fsr.regs[G1_REGNUM], raw_buffer, 7 * SPARC_INTREG_SIZE); + write_register_bytes (REGISTER_BYTE (G1_REGNUM), raw_buffer, + 7 * SPARC_INTREG_SIZE); + } + + if (frame->flat) + { + /* Each register might or might not have been saved, need to test + individually. */ + for (regnum = L0_REGNUM; regnum < L0_REGNUM + 8; ++regnum) + if (fsr.regs[regnum]) + write_register (regnum, read_memory_integer (fsr.regs[regnum], + SPARC_INTREG_SIZE)); + for (regnum = I0_REGNUM; regnum < I0_REGNUM + 8; ++regnum) + if (fsr.regs[regnum]) + write_register (regnum, read_memory_integer (fsr.regs[regnum], + SPARC_INTREG_SIZE)); + + /* Handle all outs except stack pointer (o0-o5; o7). */ + for (regnum = O0_REGNUM; regnum < O0_REGNUM + 6; ++regnum) + if (fsr.regs[regnum]) + write_register (regnum, read_memory_integer (fsr.regs[regnum], + SPARC_INTREG_SIZE)); + if (fsr.regs[O0_REGNUM + 7]) + write_register (O0_REGNUM + 7, + read_memory_integer (fsr.regs[O0_REGNUM + 7], + SPARC_INTREG_SIZE)); + + write_register (SP_REGNUM, frame->frame); + } + else if (fsr.regs[I0_REGNUM]) + { + CORE_ADDR sp; + + char reg_temp[REGISTER_BYTES]; + + read_memory (fsr.regs[I0_REGNUM], raw_buffer, 8 * SPARC_INTREG_SIZE); + + /* Get the ins and locals which we are about to restore. Just + moving the stack pointer is all that is really needed, except + store_inferior_registers is then going to write the ins and + locals from the registers array, so we need to muck with the + registers array. */ + sp = fsr.regs[SP_REGNUM]; + read_memory (sp, reg_temp, SPARC_INTREG_SIZE * 16); + + /* Restore the out registers. + Among other things this writes the new stack pointer. */ + write_register_bytes (REGISTER_BYTE (O0_REGNUM), raw_buffer, + SPARC_INTREG_SIZE * 8); + + write_register_bytes (REGISTER_BYTE (L0_REGNUM), reg_temp, + SPARC_INTREG_SIZE * 16); + } +#ifndef GDB_TARGET_IS_SPARC64 + if (fsr.regs[PS_REGNUM]) + write_register (PS_REGNUM, read_memory_integer (fsr.regs[PS_REGNUM], 4)); +#endif + if (fsr.regs[Y_REGNUM]) + write_register (Y_REGNUM, read_memory_integer (fsr.regs[Y_REGNUM], REGISTER_RAW_SIZE (Y_REGNUM))); + if (fsr.regs[PC_REGNUM]) + { + /* Explicitly specified PC (and maybe NPC) -- just restore them. */ + write_register (PC_REGNUM, read_memory_integer (fsr.regs[PC_REGNUM], + REGISTER_RAW_SIZE (PC_REGNUM))); + if (fsr.regs[NPC_REGNUM]) + write_register (NPC_REGNUM, + read_memory_integer (fsr.regs[NPC_REGNUM], + REGISTER_RAW_SIZE (NPC_REGNUM))); + } + else if (frame->flat) + { + if (frame->pc_addr) + pc = PC_ADJUST ((CORE_ADDR) + read_memory_integer (frame->pc_addr, + REGISTER_RAW_SIZE (PC_REGNUM))); + else + { + /* I think this happens only in the innermost frame, if so then + it is a complicated way of saying + "pc = read_register (O7_REGNUM);". */ + char buf[MAX_REGISTER_RAW_SIZE]; + get_saved_register (buf, 0, 0, frame, O7_REGNUM, 0); + pc = PC_ADJUST (extract_address + (buf, REGISTER_RAW_SIZE (O7_REGNUM))); + } + + write_register (PC_REGNUM, pc); + write_register (NPC_REGNUM, pc + 4); + } + else if (fsr.regs[I7_REGNUM]) + { + /* Return address in %i7 -- adjust it, then restore PC and NPC from it */ + pc = PC_ADJUST ((CORE_ADDR) read_memory_integer (fsr.regs[I7_REGNUM], + SPARC_INTREG_SIZE)); + write_register (PC_REGNUM, pc); + write_register (NPC_REGNUM, pc + 4); + } + flush_cached_frames (); +} + +/* On the Sun 4 under SunOS, the compile will leave a fake insn which + encodes the structure size being returned. If we detect such + a fake insn, step past it. */ + +CORE_ADDR +sparc_pc_adjust(pc) + CORE_ADDR pc; +{ + unsigned long insn; + char buf[4]; + int err; + + err = target_read_memory (pc + 8, buf, sizeof(long)); + insn = extract_unsigned_integer (buf, 4); + if ((err == 0) && (insn & 0xffc00000) == 0) + return pc+12; + else + return pc+8; +} + +/* If pc is in a shared library trampoline, return its target. + The SunOs 4.x linker rewrites the jump table entries for PIC + compiled modules in the main executable to bypass the dynamic linker + with jumps of the form + sethi %hi(addr),%g1 + jmp %g1+%lo(addr) + and removes the corresponding jump table relocation entry in the + dynamic relocations. + find_solib_trampoline_target relies on the presence of the jump + table relocation entry, so we have to detect these jump instructions + by hand. */ + +CORE_ADDR +sunos4_skip_trampoline_code (pc) + CORE_ADDR pc; +{ + unsigned long insn1; + char buf[4]; + int err; + + err = target_read_memory (pc, buf, 4); + insn1 = extract_unsigned_integer (buf, 4); + if (err == 0 && (insn1 & 0xffc00000) == 0x03000000) + { + unsigned long insn2; + + err = target_read_memory (pc + 4, buf, 4); + insn2 = extract_unsigned_integer (buf, 4); + if (err == 0 && (insn2 & 0xffffe000) == 0x81c06000) + { + CORE_ADDR target_pc = (insn1 & 0x3fffff) << 10; + int delta = insn2 & 0x1fff; + + /* Sign extend the displacement. */ + if (delta & 0x1000) + delta |= ~0x1fff; + return target_pc + delta; + } + } + return find_solib_trampoline_target (pc); +} + +#ifdef USE_PROC_FS /* Target dependent support for /proc */ + +/* The /proc interface divides the target machine's register set up into + two different sets, the general register set (gregset) and the floating + point register set (fpregset). For each set, there is an ioctl to get + the current register set and another ioctl to set the current values. + + The actual structure passed through the ioctl interface is, of course, + naturally machine dependent, and is different for each set of registers. + For the sparc for example, the general register set is typically defined + by: + + typedef int gregset_t[38]; + + #define R_G0 0 + ... + #define R_TBR 37 + + and the floating point set by: + + typedef struct prfpregset { + union { + u_long pr_regs[32]; + double pr_dregs[16]; + } pr_fr; + void * pr_filler; + u_long pr_fsr; + u_char pr_qcnt; + u_char pr_q_entrysize; + u_char pr_en; + u_long pr_q[64]; + } prfpregset_t; + + These routines provide the packing and unpacking of gregset_t and + fpregset_t formatted data. + + */ + +/* Given a pointer to a general register set in /proc format (gregset_t *), + unpack the register contents and supply them as gdb's idea of the current + register values. */ + +void +supply_gregset (gregsetp) +prgregset_t *gregsetp; +{ + register int regi; + register prgreg_t *regp = (prgreg_t *) gregsetp; + static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0}; + + /* GDB register numbers for Gn, On, Ln, In all match /proc reg numbers. */ + for (regi = G0_REGNUM ; regi <= I7_REGNUM ; regi++) + { + supply_register (regi, (char *) (regp + regi)); + } + + /* These require a bit more care. */ + supply_register (PS_REGNUM, (char *) (regp + R_PS)); + supply_register (PC_REGNUM, (char *) (regp + R_PC)); + supply_register (NPC_REGNUM,(char *) (regp + R_nPC)); + supply_register (Y_REGNUM, (char *) (regp + R_Y)); + + /* Fill inaccessible registers with zero. */ + supply_register (WIM_REGNUM, zerobuf); + supply_register (TBR_REGNUM, zerobuf); + supply_register (CPS_REGNUM, zerobuf); +} + +void +fill_gregset (gregsetp, regno) +prgregset_t *gregsetp; +int regno; +{ + int regi; + register prgreg_t *regp = (prgreg_t *) gregsetp; + + for (regi = 0 ; regi <= R_I7 ; regi++) + { + if ((regno == -1) || (regno == regi)) + { + *(regp + regi) = *(int *) ®isters[REGISTER_BYTE (regi)]; + } + } + if ((regno == -1) || (regno == PS_REGNUM)) + { + *(regp + R_PS) = *(int *) ®isters[REGISTER_BYTE (PS_REGNUM)]; + } + if ((regno == -1) || (regno == PC_REGNUM)) + { + *(regp + R_PC) = *(int *) ®isters[REGISTER_BYTE (PC_REGNUM)]; + } + if ((regno == -1) || (regno == NPC_REGNUM)) + { + *(regp + R_nPC) = *(int *) ®isters[REGISTER_BYTE (NPC_REGNUM)]; + } + if ((regno == -1) || (regno == Y_REGNUM)) + { + *(regp + R_Y) = *(int *) ®isters[REGISTER_BYTE (Y_REGNUM)]; + } +} + +#if defined (FP0_REGNUM) + +/* Given a pointer to a floating point register set in /proc format + (fpregset_t *), unpack the register contents and supply them as gdb's + idea of the current floating point register values. */ + +void +supply_fpregset (fpregsetp) +prfpregset_t *fpregsetp; +{ + register int regi; + char *from; + + for (regi = FP0_REGNUM ; regi < FP_MAX_REGNUM ; regi++) + { + from = (char *) &fpregsetp->pr_fr.pr_regs[regi-FP0_REGNUM]; + supply_register (regi, from); + } + supply_register (FPS_REGNUM, (char *) &(fpregsetp->pr_fsr)); +} + +/* Given a pointer to a floating point register set in /proc format + (fpregset_t *), update the register specified by REGNO from gdb's idea + of the current floating point register set. If REGNO is -1, update + them all. */ +/* ??? This will probably need some changes for sparc64. */ + +void +fill_fpregset (fpregsetp, regno) +prfpregset_t *fpregsetp; +int regno; +{ + int regi; + char *to; + char *from; + + for (regi = FP0_REGNUM ; regi < FP_MAX_REGNUM ; regi++) + { + if ((regno == -1) || (regno == regi)) + { + from = (char *) ®isters[REGISTER_BYTE (regi)]; + to = (char *) &fpregsetp->pr_fr.pr_regs[regi-FP0_REGNUM]; + memcpy (to, from, REGISTER_RAW_SIZE (regi)); + } + } + if ((regno == -1) || (regno == FPS_REGNUM)) + { + fpregsetp->pr_fsr = *(int *) ®isters[REGISTER_BYTE (FPS_REGNUM)]; + } +} + +#endif /* defined (FP0_REGNUM) */ + +#endif /* USE_PROC_FS */ + + +#ifdef GET_LONGJMP_TARGET + +/* Figure out where the longjmp will land. We expect that we have just entered + longjmp and haven't yet setup the stack frame, so the args are still in the + output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we + extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. + This routine returns true on success */ + +int +get_longjmp_target (pc) + CORE_ADDR *pc; +{ + CORE_ADDR jb_addr; +#define LONGJMP_TARGET_SIZE 4 + char buf[LONGJMP_TARGET_SIZE]; + + jb_addr = read_register (O0_REGNUM); + + if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf, + LONGJMP_TARGET_SIZE)) + return 0; + + *pc = extract_address (buf, LONGJMP_TARGET_SIZE); + + return 1; +} +#endif /* GET_LONGJMP_TARGET */ + +#ifdef STATIC_TRANSFORM_NAME +/* SunPRO (3.0 at least), encodes the static variables. This is not + related to C++ mangling, it is done for C too. */ + +char * +sunpro_static_transform_name (name) + char *name; +{ + char *p; + if (name[0] == '$') + { + /* For file-local statics there will be a dollar sign, a bunch + of junk (the contents of which match a string given in the + N_OPT), a period and the name. For function-local statics + there will be a bunch of junk (which seems to change the + second character from 'A' to 'B'), a period, the name of the + function, and the name. So just skip everything before the + last period. */ + p = strrchr (name, '.'); + if (p != NULL) + name = p + 1; + } + return name; +} +#endif /* STATIC_TRANSFORM_NAME */ + +#ifdef GDB_TARGET_IS_SPARC64 + +/* Utilities for printing registers. + Page numbers refer to the SPARC Architecture Manual. */ + +static void dump_ccreg PARAMS ((char *, int)); + +static void +dump_ccreg (reg, val) + char *reg; + int val; +{ + /* page 41 */ + printf_unfiltered ("%s:%s,%s,%s,%s", reg, + val & 8 ? "N" : "NN", + val & 4 ? "Z" : "NZ", + val & 2 ? "O" : "NO", + val & 1 ? "C" : "NC" + ); +} + +static char * +decode_asi (val) + int val; +{ + /* page 72 */ + switch (val) + { + case 4 : return "ASI_NUCLEUS"; + case 0x0c : return "ASI_NUCLEUS_LITTLE"; + case 0x10 : return "ASI_AS_IF_USER_PRIMARY"; + case 0x11 : return "ASI_AS_IF_USER_SECONDARY"; + case 0x18 : return "ASI_AS_IF_USER_PRIMARY_LITTLE"; + case 0x19 : return "ASI_AS_IF_USER_SECONDARY_LITTLE"; + case 0x80 : return "ASI_PRIMARY"; + case 0x81 : return "ASI_SECONDARY"; + case 0x82 : return "ASI_PRIMARY_NOFAULT"; + case 0x83 : return "ASI_SECONDARY_NOFAULT"; + case 0x88 : return "ASI_PRIMARY_LITTLE"; + case 0x89 : return "ASI_SECONDARY_LITTLE"; + case 0x8a : return "ASI_PRIMARY_NOFAULT_LITTLE"; + case 0x8b : return "ASI_SECONDARY_NOFAULT_LITTLE"; + default : return NULL; + } +} + +/* PRINT_REGISTER_HOOK routine. + Pretty print various registers. */ +/* FIXME: Would be nice if this did some fancy things for 32 bit sparc. */ + +void +sparc_print_register_hook (regno) + int regno; +{ + unsigned LONGEST val; + + /* Handle double/quad versions of lower 32 fp regs. */ + if (regno >= FP0_REGNUM && regno < FP0_REGNUM + 32 + && (regno & 1) == 0) + { + char value[16]; + + if (!read_relative_register_raw_bytes (regno, value) + && !read_relative_register_raw_bytes (regno + 1, value + 4)) + { + printf_unfiltered ("\t"); + print_floating (value, builtin_type_double, gdb_stdout); + } +#if 0 /* FIXME: gdb doesn't handle long doubles */ + if ((regno & 3) == 0) + { + if (!read_relative_register_raw_bytes (regno + 2, value + 8) + && !read_relative_register_raw_bytes (regno + 3, value + 12)) + { + printf_unfiltered ("\t"); + print_floating (value, builtin_type_long_double, gdb_stdout); + } + } +#endif + return; + } + +#if 0 /* FIXME: gdb doesn't handle long doubles */ + /* Print upper fp regs as long double if appropriate. */ + if (regno >= FP0_REGNUM + 32 && regno < FP_MAX_REGNUM + /* We test for even numbered regs and not a multiple of 4 because + the upper fp regs are recorded as doubles. */ + && (regno & 1) == 0) + { + char value[16]; + + if (!read_relative_register_raw_bytes (regno, value) + && !read_relative_register_raw_bytes (regno + 1, value + 8)) + { + printf_unfiltered ("\t"); + print_floating (value, builtin_type_long_double, gdb_stdout); + } + return; + } +#endif + + /* FIXME: Some of these are priviledged registers. + Not sure how they should be handled. */ + +#define BITS(n, mask) ((int) (((val) >> (n)) & (mask))) + + val = read_register (regno); + + /* pages 40 - 60 */ + switch (regno) + { + case CCR_REGNUM : + printf_unfiltered("\t"); + dump_ccreg ("xcc", val >> 4); + printf_unfiltered(", "); + dump_ccreg ("icc", val & 15); + break; + case FPRS_REGNUM : + printf ("\tfef:%d, du:%d, dl:%d", + BITS (2, 1), BITS (1, 1), BITS (0, 1)); + break; + case FSR_REGNUM : + { + static char *fcc[4] = { "=", "<", ">", "?" }; + static char *rd[4] = { "N", "0", "+", "-" }; + /* Long, yes, but I'd rather leave it as is and use a wide screen. */ + printf ("\t0:%s, 1:%s, 2:%s, 3:%s, rd:%s, tem:%d, ns:%d, ver:%d, ftt:%d, qne:%d, aexc:%d, cexc:%d", + fcc[BITS (10, 3)], fcc[BITS (32, 3)], + fcc[BITS (34, 3)], fcc[BITS (36, 3)], + rd[BITS (30, 3)], BITS (23, 31), BITS (22, 1), BITS (17, 7), + BITS (14, 7), BITS (13, 1), BITS (5, 31), BITS (0, 31)); + break; + } + case ASI_REGNUM : + { + char *asi = decode_asi (val); + if (asi != NULL) + printf ("\t%s", asi); + break; + } + case VER_REGNUM : + printf ("\tmanuf:%d, impl:%d, mask:%d, maxtl:%d, maxwin:%d", + BITS (48, 0xffff), BITS (32, 0xffff), + BITS (24, 0xff), BITS (8, 0xff), BITS (0, 31)); + break; + case PSTATE_REGNUM : + { + static char *mm[4] = { "tso", "pso", "rso", "?" }; + printf ("\tcle:%d, tle:%d, mm:%s, red:%d, pef:%d, am:%d, priv:%d, ie:%d, ag:%d", + BITS (9, 1), BITS (8, 1), mm[BITS (6, 3)], BITS (5, 1), + BITS (4, 1), BITS (3, 1), BITS (2, 1), BITS (1, 1), + BITS (0, 1)); + break; + } + case TSTATE_REGNUM : + /* FIXME: print all 4? */ + break; + case TT_REGNUM : + /* FIXME: print all 4? */ + break; + case TPC_REGNUM : + /* FIXME: print all 4? */ + break; + case TNPC_REGNUM : + /* FIXME: print all 4? */ + break; + case WSTATE_REGNUM : + printf ("\tother:%d, normal:%d", BITS (3, 7), BITS (0, 7)); + break; + case CWP_REGNUM : + printf ("\t%d", BITS (0, 31)); + break; + case CANSAVE_REGNUM : + printf ("\t%-2d before spill", BITS (0, 31)); + break; + case CANRESTORE_REGNUM : + printf ("\t%-2d before fill", BITS (0, 31)); + break; + case CLEANWIN_REGNUM : + printf ("\t%-2d before clean", BITS (0, 31)); + break; + case OTHERWIN_REGNUM : + printf ("\t%d", BITS (0, 31)); + break; + } + +#undef BITS +} + +#endif + +void +_initialize_sparc_tdep () +{ + tm_print_insn = print_insn_sparc; +} diff --git a/contrib/gdb/gdb/sparcl-stub.c b/contrib/gdb/gdb/sparcl-stub.c new file mode 100644 index 0000000000000..c7994fe5d5208 --- /dev/null +++ b/contrib/gdb/gdb/sparcl-stub.c @@ -0,0 +1,1024 @@ +/**************************************************************************** + + THIS SOFTWARE IS NOT COPYRIGHTED + + HP offers the following for use in the public domain. HP makes no + warranty with regard to the software or it's performance and the + user accepts the software "AS IS" with all faults. + + HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD + TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +****************************************************************************/ + +/**************************************************************************** + * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $ + * + * Module name: remcom.c $ + * Revision: 1.34 $ + * Date: 91/03/09 12:29:49 $ + * Contributor: Lake Stevens Instrument Division$ + * + * Description: low level support for gdb debugger. $ + * + * Considerations: only works on target hardware $ + * + * Written by: Glenn Engel $ + * ModuleState: Experimental $ + * + * NOTES: See Below $ + * + * Modified for SPARC by Stu Grossman, Cygnus Support. + * Based on sparc-stub.c, it's modified for SPARClite Debug Unit hardware + * breakpoint support to create sparclite-stub.c, by Kung Hsu, Cygnus Support. + * + * This code has been extensively tested on the Fujitsu SPARClite demo board. + * + * To enable debugger support, two things need to happen. One, a + * call to set_debug_traps() is necessary in order to allow any breakpoints + * or error conditions to be properly intercepted and reported to gdb. + * Two, a breakpoint needs to be generated to begin communication. This + * is most easily accomplished by a call to breakpoint(). Breakpoint() + * simulates a breakpoint by executing a trap #1. + * + ************* + * + * The following gdb commands are supported: + * + * command function Return value + * + * g return the value of the CPU registers hex data or ENN + * G set the value of the CPU registers OK or ENN + * + * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN + * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN + * + * c Resume at current address SNN ( signal NN) + * cAA..AA Continue at address AA..AA SNN + * + * s Step one instruction SNN + * sAA..AA Step one instruction from AA..AA SNN + * + * k kill + * + * ? What was the last sigval ? SNN (signal NN) + * + * bBB..BB Set baud rate to BB..BB OK or BNN, then sets + * baud rate + * + * All commands and responses are sent with a packet which includes a + * checksum. A packet consists of + * + * $<packet info>#<checksum>. + * + * where + * <packet info> :: <characters representing the command or response> + * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>> + * + * When a packet is received, it is first acknowledged with either '+' or '-'. + * '+' indicates a successful transfer. '-' indicates a failed transfer. + * + * Example: + * + * Host: Reply: + * $m0,10#2a +$00010203040506070809101112131415#42 + * + ****************************************************************************/ + +#include <string.h> +#include <signal.h> +#include <sparclite.h> + +/************************************************************************ + * + * external low-level support routines + */ + +extern void putDebugChar (int c); /* write a single character */ +extern int getDebugChar (void); /* read and return a single char */ + +/************************************************************************/ +/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/ +/* at least NUMREGBYTES*2 are needed for register packets */ +#define BUFMAX 2048 + +static int initialized = 0; /* !0 means we've been initialized */ + +extern void breakinst (); +static void set_mem_fault_trap (int enable); +static void get_in_break_mode (void); + +static const char hexchars[]="0123456789abcdef"; + +#define NUMREGS 80 + +/* Number of bytes of registers. */ +#define NUMREGBYTES (NUMREGS * 4) +enum regnames {G0, G1, G2, G3, G4, G5, G6, G7, + O0, O1, O2, O3, O4, O5, SP, O7, + L0, L1, L2, L3, L4, L5, L6, L7, + I0, I1, I2, I3, I4, I5, FP, I7, + + F0, F1, F2, F3, F4, F5, F6, F7, + F8, F9, F10, F11, F12, F13, F14, F15, + F16, F17, F18, F19, F20, F21, F22, F23, + F24, F25, F26, F27, F28, F29, F30, F31, + Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR, + DIA1, DIA2, DDA1, DDA2, DDV1, DDV2, DCR, DSR }; + +/*************************** ASSEMBLY CODE MACROS *************************/ +/* */ + +extern void trap_low(); + +/* Create private copies of common functions used by the stub. This prevents + nasty interactions between app code and the stub (for instance if user steps + into strlen, etc..) */ + +static int +strlen (const char *s) +{ + const char *s1 = s; + + while (*s1++ != '\000'); + + return s1 - s; +} + +static char * +strcpy (char *dst, const char *src) +{ + char *retval = dst; + + while ((*dst++ = *src++) != '\000'); + + return retval; +} + +static void * +memcpy (void *vdst, const void *vsrc, int n) +{ + char *dst = vdst; + const char *src = vsrc; + char *retval = dst; + + while (n-- > 0) + *dst++ = *src++; + + return retval; +} + +asm(" + .reserve trapstack, 1000 * 4, \"bss\", 8 + + .data + .align 4 + +in_trap_handler: + .word 0 + + .text + .align 4 + +! This function is called when any SPARC trap (except window overflow or +! underflow) occurs. It makes sure that the invalid register window is still +! available before jumping into C code. It will also restore the world if you +! return from handle_exception. +! +! On entry, trap_low expects l1 and l2 to contain pc and npc respectivly. +! Register usage throughout the routine is as follows: +! +! l0 - psr +! l1 - pc +! l2 - npc +! l3 - wim +! l4 - scratch and y reg +! l5 - scratch and tbr +! l6 - unused +! l7 - unused + + .globl _trap_low +_trap_low: + mov %psr, %l0 + mov %wim, %l3 + + srl %l3, %l0, %l4 ! wim >> cwp + cmp %l4, 1 + bne window_fine ! Branch if not in the invalid window + nop + +! Handle window overflow + + mov %g1, %l4 ! Save g1, we use it to hold the wim + srl %l3, 1, %g1 ! Rotate wim right + tst %g1 + bg good_wim ! Branch if new wim is non-zero + nop + +! At this point, we need to bring a 1 into the high order bit of the wim. +! Since we don't want to make any assumptions about the number of register +! windows, we figure it out dynamically so as to setup the wim correctly. + + not %g1 ! Fill g1 with ones + mov %g1, %wim ! Fill the wim with ones + nop + nop + nop + mov %wim, %g1 ! Read back the wim + inc %g1 ! Now g1 has 1 just to left of wim + srl %g1, 1, %g1 ! Now put 1 at top of wim + mov %g0, %wim ! Clear wim so that subsequent save + nop ! won't trap + nop + nop + +good_wim: + save %g0, %g0, %g0 ! Slip into next window + mov %g1, %wim ! Install the new wim + + std %l0, [%sp + 0 * 4] ! save L & I registers + std %l2, [%sp + 2 * 4] + std %l4, [%sp + 4 * 4] + std %l6, [%sp + 6 * 4] + + std %i0, [%sp + 8 * 4] + std %i2, [%sp + 10 * 4] + std %i4, [%sp + 12 * 4] + std %i6, [%sp + 14 * 4] + + restore ! Go back to trap window. + mov %l4, %g1 ! Restore %g1 + +window_fine: + sethi %hi(in_trap_handler), %l4 + ld [%lo(in_trap_handler) + %l4], %l5 + tst %l5 + bg recursive_trap + inc %l5 + + set trapstack+1000*4, %sp ! Switch to trap stack + +recursive_trap: + st %l5, [%lo(in_trap_handler) + %l4] + sub %sp,(16+1+6+1+80)*4,%sp ! Make room for input & locals + ! + hidden arg + arg spill + ! + doubleword alignment + ! + registers[72] local var + + std %g0, [%sp + (24 + 0) * 4] ! registers[Gx] + std %g2, [%sp + (24 + 2) * 4] + std %g4, [%sp + (24 + 4) * 4] + std %g6, [%sp + (24 + 6) * 4] + + std %i0, [%sp + (24 + 8) * 4] ! registers[Ox] + std %i2, [%sp + (24 + 10) * 4] + std %i4, [%sp + (24 + 12) * 4] + std %i6, [%sp + (24 + 14) * 4] + + mov %y, %l4 + mov %tbr, %l5 + st %l4, [%sp + (24 + 64) * 4] ! Y + st %l0, [%sp + (24 + 65) * 4] ! PSR + st %l3, [%sp + (24 + 66) * 4] ! WIM + st %l5, [%sp + (24 + 67) * 4] ! TBR + st %l1, [%sp + (24 + 68) * 4] ! PC + st %l2, [%sp + (24 + 69) * 4] ! NPC + + or %l0, 0xf20, %l4 + mov %l4, %psr ! Turn on traps, disable interrupts + + set 0x1000, %l1 + btst %l1, %l0 ! FP enabled? + be no_fpstore + nop + +! Must save fsr first, to flush the FQ. This may cause a deferred fp trap, so +! traps must be enabled to allow the trap handler to clean things up. + + st %fsr, [%sp + (24 + 70) * 4] + + std %f0, [%sp + (24 + 32) * 4] + std %f2, [%sp + (24 + 34) * 4] + std %f4, [%sp + (24 + 36) * 4] + std %f6, [%sp + (24 + 38) * 4] + std %f8, [%sp + (24 + 40) * 4] + std %f10, [%sp + (24 + 42) * 4] + std %f12, [%sp + (24 + 44) * 4] + std %f14, [%sp + (24 + 46) * 4] + std %f16, [%sp + (24 + 48) * 4] + std %f18, [%sp + (24 + 50) * 4] + std %f20, [%sp + (24 + 52) * 4] + std %f22, [%sp + (24 + 54) * 4] + std %f24, [%sp + (24 + 56) * 4] + std %f26, [%sp + (24 + 58) * 4] + std %f28, [%sp + (24 + 60) * 4] + std %f30, [%sp + (24 + 62) * 4] +no_fpstore: + + call _handle_exception + add %sp, 24 * 4, %o0 ! Pass address of registers + +! Reload all of the registers that aren't on the stack + + ld [%sp + (24 + 1) * 4], %g1 ! registers[Gx] + ldd [%sp + (24 + 2) * 4], %g2 + ldd [%sp + (24 + 4) * 4], %g4 + ldd [%sp + (24 + 6) * 4], %g6 + + ldd [%sp + (24 + 8) * 4], %i0 ! registers[Ox] + ldd [%sp + (24 + 10) * 4], %i2 + ldd [%sp + (24 + 12) * 4], %i4 + ldd [%sp + (24 + 14) * 4], %i6 + + + ldd [%sp + (24 + 64) * 4], %l0 ! Y & PSR + ldd [%sp + (24 + 68) * 4], %l2 ! PC & NPC + + set 0x1000, %l5 + btst %l5, %l1 ! FP enabled? + be no_fpreload + nop + + ldd [%sp + (24 + 32) * 4], %f0 + ldd [%sp + (24 + 34) * 4], %f2 + ldd [%sp + (24 + 36) * 4], %f4 + ldd [%sp + (24 + 38) * 4], %f6 + ldd [%sp + (24 + 40) * 4], %f8 + ldd [%sp + (24 + 42) * 4], %f10 + ldd [%sp + (24 + 44) * 4], %f12 + ldd [%sp + (24 + 46) * 4], %f14 + ldd [%sp + (24 + 48) * 4], %f16 + ldd [%sp + (24 + 50) * 4], %f18 + ldd [%sp + (24 + 52) * 4], %f20 + ldd [%sp + (24 + 54) * 4], %f22 + ldd [%sp + (24 + 56) * 4], %f24 + ldd [%sp + (24 + 58) * 4], %f26 + ldd [%sp + (24 + 60) * 4], %f28 + ldd [%sp + (24 + 62) * 4], %f30 + + ld [%sp + (24 + 70) * 4], %fsr +no_fpreload: + + restore ! Ensure that previous window is valid + save %g0, %g0, %g0 ! by causing a window_underflow trap + + mov %l0, %y + mov %l1, %psr ! Make sure that traps are disabled + ! for rett + sethi %hi(in_trap_handler), %l4 + ld [%lo(in_trap_handler) + %l4], %l5 + dec %l5 + st %l5, [%lo(in_trap_handler) + %l4] + + jmpl %l2, %g0 ! Restore old PC + rett %l3 ! Restore old nPC +"); + +/* Convert ch from a hex digit to an int */ + +static int +hex(ch) + unsigned char ch; +{ + if (ch >= 'a' && ch <= 'f') + return ch-'a'+10; + if (ch >= '0' && ch <= '9') + return ch-'0'; + if (ch >= 'A' && ch <= 'F') + return ch-'A'+10; + return -1; +} + +/* scan for the sequence $<data>#<checksum> */ + +static void +getpacket(buffer) + char *buffer; +{ + unsigned char checksum; + unsigned char xmitcsum; + int i; + int count; + unsigned char ch; + + do + { + /* wait around for the start character, ignore all other characters */ + while ((ch = (getDebugChar() & 0x7f)) != '$') ; + + checksum = 0; + xmitcsum = -1; + + count = 0; + + /* now, read until a # or end of buffer is found */ + while (count < BUFMAX) + { + ch = getDebugChar() & 0x7f; + if (ch == '#') + break; + checksum = checksum + ch; + buffer[count] = ch; + count = count + 1; + } + + if (count >= BUFMAX) + continue; + + buffer[count] = 0; + + if (ch == '#') + { + xmitcsum = hex(getDebugChar() & 0x7f) << 4; + xmitcsum |= hex(getDebugChar() & 0x7f); +#if 0 + /* Humans shouldn't have to figure out checksums to type to it. */ + putDebugChar ('+'); + return; +#endif + if (checksum != xmitcsum) + putDebugChar('-'); /* failed checksum */ + else + { + putDebugChar('+'); /* successful transfer */ + /* if a sequence char is present, reply the sequence ID */ + if (buffer[2] == ':') + { + putDebugChar(buffer[0]); + putDebugChar(buffer[1]); + /* remove sequence chars from buffer */ + count = strlen(buffer); + for (i=3; i <= count; i++) + buffer[i-3] = buffer[i]; + } + } + } + } + while (checksum != xmitcsum); +} + +/* send the packet in buffer. */ + +static void +putpacket(buffer) + unsigned char *buffer; +{ + unsigned char checksum; + int count; + unsigned char ch; + + /* $<packet info>#<checksum>. */ + do + { + putDebugChar('$'); + checksum = 0; + count = 0; + + while (ch = buffer[count]) + { + putDebugChar (ch); + checksum += ch; + count += 1; + } + + putDebugChar('#'); + putDebugChar(hexchars[checksum >> 4]); + putDebugChar(hexchars[checksum & 0xf]); + + } + while ((getDebugChar() & 0x7f) != '+'); +} + +static char remcomInBuffer[BUFMAX]; +static char remcomOutBuffer[BUFMAX]; + +/* Indicate to caller of mem2hex or hex2mem that there has been an + error. */ +static volatile int mem_err = 0; + +/* Convert the memory pointed to by mem into hex, placing result in buf. + * Return a pointer to the last char put in buf (null), in case of mem fault, + * return 0. + * If MAY_FAULT is non-zero, then we will handle memory faults by returning + * a 0, else treat a fault like any other fault in the stub. + */ + +static unsigned char * +mem2hex(mem, buf, count, may_fault) + unsigned char *mem; + unsigned char *buf; + int count; + int may_fault; +{ + unsigned char ch; + + set_mem_fault_trap(may_fault); + + while (count-- > 0) + { + ch = *mem++; + if (mem_err) + return 0; + *buf++ = hexchars[ch >> 4]; + *buf++ = hexchars[ch & 0xf]; + } + + *buf = 0; + + set_mem_fault_trap(0); + + return buf; +} + +/* convert the hex array pointed to by buf into binary to be placed in mem + * return a pointer to the character AFTER the last byte written */ + +static char * +hex2mem(buf, mem, count, may_fault) + unsigned char *buf; + unsigned char *mem; + int count; + int may_fault; +{ + int i; + unsigned char ch; + + set_mem_fault_trap(may_fault); + + for (i=0; i<count; i++) + { + ch = hex(*buf++) << 4; + ch |= hex(*buf++); + *mem++ = ch; + if (mem_err) + return 0; + } + + set_mem_fault_trap(0); + + return mem; +} + +/* This table contains the mapping between SPARC hardware trap types, and + signals, which are primarily what GDB understands. It also indicates + which hardware traps we need to commandeer when initializing the stub. */ + +static struct hard_trap_info +{ + unsigned char tt; /* Trap type code for SPARClite */ + unsigned char signo; /* Signal that we map this trap into */ +} hard_trap_info[] = { + {0x01, SIGSEGV}, /* instruction access error */ + {0x02, SIGILL}, /* privileged instruction */ + {0x03, SIGILL}, /* illegal instruction */ + {0x04, SIGEMT}, /* fp disabled */ + {0x07, SIGBUS}, /* mem address not aligned */ + {0x09, SIGSEGV}, /* data access exception */ + {0x0a, SIGEMT}, /* tag overflow */ + {0x20, SIGBUS}, /* r register access error */ + {0x21, SIGBUS}, /* instruction access error */ + {0x24, SIGEMT}, /* cp disabled */ + {0x29, SIGBUS}, /* data access error */ + {0x2a, SIGFPE}, /* divide by zero */ + {0x2b, SIGBUS}, /* data store error */ + {0x80+1, SIGTRAP}, /* ta 1 - normal breakpoint instruction */ + {0xff, SIGTRAP}, /* hardware breakpoint */ + {0, 0} /* Must be last */ +}; + +/* Set up exception handlers for tracing and breakpoints */ + +void +set_debug_traps() +{ + struct hard_trap_info *ht; + +/* Only setup fp traps if the FP is disabled. */ + + for (ht = hard_trap_info; + ht->tt != 0 && ht->signo != 0; + ht++) + if (ht->tt != 4 || ! (read_psr () & 0x1000)) + exceptionHandler(ht->tt, trap_low); + + /* In case GDB is started before us, ack any packets (presumably + "$?#xx") sitting there. */ + + putDebugChar ('+'); + + initialized = 1; +} + +asm (" +! Trap handler for memory errors. This just sets mem_err to be non-zero. It +! assumes that %l1 is non-zero. This should be safe, as it is doubtful that +! 0 would ever contain code that could mem fault. This routine will skip +! past the faulting instruction after setting mem_err. + + .text + .align 4 + +_fltr_set_mem_err: + sethi %hi(_mem_err), %l0 + st %l1, [%l0 + %lo(_mem_err)] + jmpl %l2, %g0 + rett %l2+4 +"); + +static void +set_mem_fault_trap(enable) + int enable; +{ + extern void fltr_set_mem_err(); + mem_err = 0; + + if (enable) + exceptionHandler(9, fltr_set_mem_err); + else + exceptionHandler(9, trap_low); +} + +asm (" + .text + .align 4 + +_dummy_hw_breakpoint: + jmpl %l2, %g0 + rett %l2+4 + nop + nop +"); + +static void +get_in_break_mode() +{ + extern void dummy_hw_breakpoint(); + + exceptionHandler (255, dummy_hw_breakpoint); + + asm ("ta 255"); + + exceptionHandler (255, trap_low); +} + +/* Convert the SPARC hardware trap type code to a unix signal number. */ + +static int +computeSignal(tt) + int tt; +{ + struct hard_trap_info *ht; + + for (ht = hard_trap_info; ht->tt && ht->signo; ht++) + if (ht->tt == tt) + return ht->signo; + + return SIGHUP; /* default for things we don't know about */ +} + +/* + * While we find nice hex chars, build an int. + * Return number of chars processed. + */ + +static int +hexToInt(char **ptr, int *intValue) +{ + int numChars = 0; + int hexValue; + + *intValue = 0; + + while (**ptr) + { + hexValue = hex(**ptr); + if (hexValue < 0) + break; + + *intValue = (*intValue << 4) | hexValue; + numChars ++; + + (*ptr)++; + } + + return (numChars); +} + +/* + * This function does all command procesing for interfacing to gdb. It + * returns 1 if you should skip the instruction at the trap address, 0 + * otherwise. + */ + +static void +handle_exception (registers) + unsigned long *registers; +{ + int tt; /* Trap type */ + int sigval; + int addr; + int length; + char *ptr; + unsigned long *sp; + unsigned long dsr; + +/* First, we must force all of the windows to be spilled out */ + + asm(" save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + save %sp, -64, %sp + restore + restore + restore + restore + restore + restore + restore + restore +"); + + get_in_break_mode (); /* Enable DSU register writes */ + + registers[DIA1] = read_asi (1, 0xff00); + registers[DIA2] = read_asi (1, 0xff04); + registers[DDA1] = read_asi (1, 0xff08); + registers[DDA2] = read_asi (1, 0xff0c); + registers[DDV1] = read_asi (1, 0xff10); + registers[DDV2] = read_asi (1, 0xff14); + registers[DCR] = read_asi (1, 0xff18); + registers[DSR] = read_asi (1, 0xff1c); + + if (registers[PC] == (unsigned long)breakinst) + { + registers[PC] = registers[NPC]; + registers[NPC] += 4; + } + sp = (unsigned long *)registers[SP]; + + dsr = (unsigned long)registers[DSR]; + if (dsr & 0x3c) + tt = 255; + else + tt = (registers[TBR] >> 4) & 0xff; + + /* reply to host that an exception has occurred */ + sigval = computeSignal(tt); + ptr = remcomOutBuffer; + + *ptr++ = 'T'; + *ptr++ = hexchars[sigval >> 4]; + *ptr++ = hexchars[sigval & 0xf]; + + *ptr++ = hexchars[PC >> 4]; + *ptr++ = hexchars[PC & 0xf]; + *ptr++ = ':'; + ptr = mem2hex((char *)®isters[PC], ptr, 4, 0); + *ptr++ = ';'; + + *ptr++ = hexchars[FP >> 4]; + *ptr++ = hexchars[FP & 0xf]; + *ptr++ = ':'; + ptr = mem2hex(sp + 8 + 6, ptr, 4, 0); /* FP */ + *ptr++ = ';'; + + *ptr++ = hexchars[SP >> 4]; + *ptr++ = hexchars[SP & 0xf]; + *ptr++ = ':'; + ptr = mem2hex((char *)&sp, ptr, 4, 0); + *ptr++ = ';'; + + *ptr++ = hexchars[NPC >> 4]; + *ptr++ = hexchars[NPC & 0xf]; + *ptr++ = ':'; + ptr = mem2hex((char *)®isters[NPC], ptr, 4, 0); + *ptr++ = ';'; + + *ptr++ = hexchars[O7 >> 4]; + *ptr++ = hexchars[O7 & 0xf]; + *ptr++ = ':'; + ptr = mem2hex((char *)®isters[O7], ptr, 4, 0); + *ptr++ = ';'; + + *ptr++ = 0; + + putpacket(remcomOutBuffer); + + while (1) + { + remcomOutBuffer[0] = 0; + + getpacket(remcomInBuffer); + switch (remcomInBuffer[0]) + { + case '?': + remcomOutBuffer[0] = 'S'; + remcomOutBuffer[1] = hexchars[sigval >> 4]; + remcomOutBuffer[2] = hexchars[sigval & 0xf]; + remcomOutBuffer[3] = 0; + break; + + case 'd': + /* toggle debug flag */ + break; + + case 'g': /* return the value of the CPU registers */ + memcpy (®isters[L0], sp, 16 * 4); /* Copy L & I regs from stack */ + mem2hex ((char *)registers, remcomOutBuffer, NUMREGBYTES, 0); + break; + + case 'G': /* Set the value of all registers */ + case 'P': /* Set the value of one register */ + { + unsigned long *newsp, psr; + + psr = registers[PSR]; + + ptr = &remcomInBuffer[1]; + + if (remcomInBuffer[0] == 'P') + { + int regno; + + if (hexToInt (&ptr, ®no) + && *ptr++ == '=') + if (regno >= L0 && regno <= I7) + hex2mem (ptr, sp + regno - L0, 4, 0); + else + hex2mem (ptr, (char *)®isters[regno], 4, 0); + else + { + strcpy (remcomOutBuffer, "P01"); + break; + } + } + else + { + hex2mem (ptr, (char *)registers, NUMREGBYTES, 0); + memcpy (sp, ®isters[L0], 16 * 4); /* Copy L & I regs to stack */ + } + + /* See if the stack pointer has moved. If so, then copy the saved + locals and ins to the new location. This keeps the window + overflow and underflow routines happy. */ + + newsp = (unsigned long *)registers[SP]; + if (sp != newsp) + sp = memcpy(newsp, sp, 16 * 4); + + /* Don't allow CWP to be modified. */ + + if (psr != registers[PSR]) + registers[PSR] = (psr & 0x1f) | (registers[PSR] & ~0x1f); + + strcpy(remcomOutBuffer,"OK"); + } + break; + + case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */ + /* Try to read %x,%x. */ + + ptr = &remcomInBuffer[1]; + + if (hexToInt(&ptr, &addr) + && *ptr++ == ',' + && hexToInt(&ptr, &length)) + { + if (mem2hex((char *)addr, remcomOutBuffer, length, 1)) + break; + + strcpy (remcomOutBuffer, "E03"); + } + else + strcpy(remcomOutBuffer,"E01"); + break; + + case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */ + /* Try to read '%x,%x:'. */ + + ptr = &remcomInBuffer[1]; + + if (hexToInt(&ptr, &addr) + && *ptr++ == ',' + && hexToInt(&ptr, &length) + && *ptr++ == ':') + { + if (hex2mem(ptr, (char *)addr, length, 1)) + strcpy(remcomOutBuffer, "OK"); + else + strcpy(remcomOutBuffer, "E03"); + } + else + strcpy(remcomOutBuffer, "E02"); + break; + + case 'c': /* cAA..AA Continue at address AA..AA(optional) */ + /* try to read optional parameter, pc unchanged if no parm */ + + ptr = &remcomInBuffer[1]; + if (hexToInt(&ptr, &addr)) + { + registers[PC] = addr; + registers[NPC] = addr + 4; + } + +/* Need to flush the instruction cache here, as we may have deposited a + breakpoint, and the icache probably has no way of knowing that a data ref to + some location may have changed something that is in the instruction cache. + */ + + flush_i_cache (); + + if (!(registers[DSR] & 0x1) /* DSU enabled? */ + && !(registers[DCR] & 0x200)) /* Are we in break state? */ + { /* Yes, set the DSU regs */ + write_asi (1, 0xff00, registers[DIA1]); + write_asi (1, 0xff04, registers[DIA2]); + write_asi (1, 0xff08, registers[DDA1]); + write_asi (1, 0xff0c, registers[DDA2]); + write_asi (1, 0xff10, registers[DDV1]); + write_asi (1, 0xff14, registers[DDV2]); + write_asi (1, 0xff1c, registers[DSR]); + write_asi (1, 0xff18, registers[DCR] | 0x200); /* Clear break */ + } + + return; + + /* kill the program */ + case 'k' : /* do nothing */ + break; +#if 0 + case 't': /* Test feature */ + asm (" std %f30,[%sp]"); + break; +#endif + case 'r': /* Reset */ + asm ("call 0 + nop "); + break; + +#if 0 +Disabled until we can unscrew this properly + + case 'b': /* bBB... Set baud rate to BB... */ + { + int baudrate; + extern void set_timer_3(); + + ptr = &remcomInBuffer[1]; + if (!hexToInt(&ptr, &baudrate)) + { + strcpy(remcomOutBuffer,"B01"); + break; + } + + /* Convert baud rate to uart clock divider */ + switch (baudrate) + { + case 38400: + baudrate = 16; + break; + case 19200: + baudrate = 33; + break; + case 9600: + baudrate = 65; + break; + default: + strcpy(remcomOutBuffer,"B02"); + goto x1; + } + + putpacket("OK"); /* Ack before changing speed */ + set_timer_3(baudrate); /* Set it */ + } +x1: break; +#endif + } /* switch */ + + /* reply to the request */ + putpacket(remcomOutBuffer); + } +} + +/* This function will generate a breakpoint exception. It is used at the + beginning of a program to sync up with a debugger and can be used + otherwise as a quick means to stop program execution and "break" into + the debugger. */ + +void +breakpoint() +{ + if (!initialized) + return; + + asm(" .globl _breakinst + + _breakinst: ta 1 + "); +} diff --git a/contrib/gdb/gdb/sparcl-tdep.c b/contrib/gdb/gdb/sparcl-tdep.c new file mode 100644 index 0000000000000..ed9afb82e0ae3 --- /dev/null +++ b/contrib/gdb/gdb/sparcl-tdep.c @@ -0,0 +1,890 @@ +/* Target dependent code for the Fujitsu SPARClite for GDB, the GNU debugger. + Copyright 1994, 1995, 1996 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "gdbcore.h" +#include "breakpoint.h" +#include "target.h" +#include "serial.h" +#include <sys/types.h> +#include <sys/time.h> + +#if defined(__GO32__) || defined(WIN32) +#undef HAVE_SOCKETS +#else +#define HAVE_SOCKETS +#endif + + +#ifdef HAVE_SOCKETS +#include <unistd.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <netdb.h> +#endif + +extern struct target_ops sparclite_ops; /* Forward decl */ +extern struct target_ops remote_ops; + +static char *remote_target_name = NULL; +static serial_t remote_desc = NULL; +static int serial_flag; +#ifdef HAVE_SOCKETS +static int udp_fd = -1; +#endif + +static serial_t open_tty PARAMS ((char *name)); +static int send_resp PARAMS ((serial_t desc, char c)); +static void close_tty PARAMS ((int ignore)); +#ifdef HAVE_SOCKETS +static int recv_udp_buf PARAMS ((int fd, unsigned char *buf, int len, int timeout)); +static int send_udp_buf PARAMS ((int fd, unsigned char *buf, int len)); +#endif +static void sparclite_open PARAMS ((char *name, int from_tty)); +static void sparclite_close PARAMS ((int quitting)); +static void download PARAMS ((char *target_name, char *args, int from_tty, + void (*write_routine) (bfd *from_bfd, + asection *from_sec, + file_ptr from_addr, + bfd_vma to_addr, int len), + void (*start_routine) (bfd_vma entry))); +static void sparclite_serial_start PARAMS ((bfd_vma entry)); +static void sparclite_serial_write PARAMS ((bfd *from_bfd, asection *from_sec, + file_ptr from_addr, + bfd_vma to_addr, int len)); +#ifdef HAVE_SOCKETS +static unsigned short calc_checksum PARAMS ((unsigned char *buffer, + int count)); +static void sparclite_udp_start PARAMS ((bfd_vma entry)); +static void sparclite_udp_write PARAMS ((bfd *from_bfd, asection *from_sec, + file_ptr from_addr, bfd_vma to_addr, + int len)); +#endif +static void sparclite_download PARAMS ((char *filename, int from_tty)); + +#define DDA2_SUP_ASI 0xb000000 +#define DDA1_SUP_ASI 0xb0000 + +#define DDA2_ASI_MASK 0xff000000 +#define DDA1_ASI_MASK 0xff0000 +#define DIA2_SUP_MODE 0x8000 +#define DIA1_SUP_MODE 0x4000 +#define DDA2_ENABLE 0x100 +#define DDA1_ENABLE 0x80 +#define DIA2_ENABLE 0x40 +#define DIA1_ENABLE 0x20 +#define DSINGLE_STEP 0x10 +#define DDV_TYPE_MASK 0xc +#define DDV_TYPE_LOAD 0x0 +#define DDV_TYPE_STORE 0x4 +#define DDV_TYPE_ACCESS 0x8 +#define DDV_TYPE_ALWAYS 0xc +#define DDV_COND 0x2 +#define DDV_MASK 0x1 + +int +sparclite_insert_watchpoint (addr, len, type) + CORE_ADDR addr; + int len; + int type; +{ + CORE_ADDR dcr; + + dcr = read_register (DCR_REGNUM); + + if (!(dcr & DDA1_ENABLE)) + { + write_register (DDA1_REGNUM, addr); + dcr &= ~(DDA1_ASI_MASK | DDV_TYPE_MASK); + dcr |= (DDA1_SUP_ASI | DDA1_ENABLE); + if (type == 1) + { + write_register (DDV1_REGNUM, 0); + write_register (DDV2_REGNUM, 0xffffffff); + dcr |= (DDV_TYPE_LOAD & (~DDV_COND & ~DDV_MASK)); + } + else if (type == 0) + { + write_register (DDV1_REGNUM, 0); + write_register (DDV2_REGNUM, 0xffffffff); + dcr |= (DDV_TYPE_STORE & (~DDV_COND & ~DDV_MASK)); + } + else + { + write_register (DDV1_REGNUM, 0); + write_register (DDV2_REGNUM, 0xffffffff); + dcr |= (DDV_TYPE_ACCESS); + } + write_register (DCR_REGNUM, dcr); + } + else if (!(dcr & DDA2_ENABLE)) + { + write_register (DDA2_REGNUM, addr); + dcr &= ~(DDA2_ASI_MASK & DDV_TYPE_MASK); + dcr |= (DDA2_SUP_ASI | DDA2_ENABLE); + if (type == 1) + { + write_register (DDV1_REGNUM, 0); + write_register (DDV2_REGNUM, 0xffffffff); + dcr |= (DDV_TYPE_LOAD & ~DDV_COND & ~DDV_MASK); + } + else if (type == 0) + { + write_register (DDV1_REGNUM, 0); + write_register (DDV2_REGNUM, 0xffffffff); + dcr |= (DDV_TYPE_STORE & ~DDV_COND & ~DDV_MASK); + } + else + { + write_register (DDV1_REGNUM, 0); + write_register (DDV2_REGNUM, 0xffffffff); + dcr |= (DDV_TYPE_ACCESS); + } + write_register (DCR_REGNUM, dcr); + } + else + return -1; + + return 0; +} + +int +sparclite_remove_watchpoint (addr, len, type) + CORE_ADDR addr; + int len; + int type; +{ + CORE_ADDR dcr, dda1, dda2; + + dcr = read_register (DCR_REGNUM); + dda1 = read_register (DDA1_REGNUM); + dda2 = read_register (DDA2_REGNUM); + + if ((dcr & DDA1_ENABLE) && addr == dda1) + write_register (DCR_REGNUM, (dcr & ~DDA1_ENABLE)); + else if ((dcr & DDA2_ENABLE) && addr == dda2) + write_register (DCR_REGNUM, (dcr & ~DDA2_ENABLE)); + else + return -1; + + return 0; +} + +int +sparclite_insert_hw_breakpoint (addr, len) + CORE_ADDR addr; + int len; +{ + CORE_ADDR dcr; + + dcr = read_register (DCR_REGNUM); + + if (!(dcr & DIA1_ENABLE)) + { + write_register (DIA1_REGNUM, addr); + write_register (DCR_REGNUM, (dcr | DIA1_ENABLE | DIA1_SUP_MODE)); + } + else if (!(dcr & DIA2_ENABLE)) + { + write_register (DIA2_REGNUM, addr); + write_register (DCR_REGNUM, (dcr | DIA2_ENABLE | DIA2_SUP_MODE)); + } + else + return -1; + + return 0; +} + +int +sparclite_remove_hw_breakpoint (addr, shadow) + CORE_ADDR addr; + int shadow; +{ + CORE_ADDR dcr, dia1, dia2; + + dcr = read_register (DCR_REGNUM); + dia1 = read_register (DIA1_REGNUM); + dia2 = read_register (DIA2_REGNUM); + + if ((dcr & DIA1_ENABLE) && addr == dia1) + write_register (DCR_REGNUM, (dcr & ~DIA1_ENABLE)); + else if ((dcr & DIA2_ENABLE) && addr == dia2) + write_register (DCR_REGNUM, (dcr & ~DIA2_ENABLE)); + else + return -1; + + return 0; +} + +int +sparclite_check_watch_resources (type, cnt, ot) + int type; + int cnt; + int ot; +{ + if (type == bp_hardware_breakpoint) + { + if (TARGET_HW_BREAK_LIMIT == 0) + return 0; + else if (cnt <= TARGET_HW_BREAK_LIMIT) + return 1; + } + else + { + if (TARGET_HW_WATCH_LIMIT == 0) + return 0; + else if (ot) + return -1; + else if (cnt <= TARGET_HW_WATCH_LIMIT) + return 1; + } + return -1; +} + +CORE_ADDR +sparclite_stopped_data_address () +{ + CORE_ADDR dsr, dda1, dda2; + + dsr = read_register (DSR_REGNUM); + dda1 = read_register (DDA1_REGNUM); + dda2 = read_register (DDA2_REGNUM); + + if (dsr & 0x10) + return dda1; + else if (dsr & 0x20) + return dda2; + else + return 0; +} + +static serial_t +open_tty (name) + char *name; +{ + serial_t desc; + + desc = SERIAL_OPEN (name); + if (!desc) + perror_with_name (name); + + if (baud_rate != -1) + { + if (SERIAL_SETBAUDRATE (desc, baud_rate)) + { + SERIAL_CLOSE (desc); + perror_with_name (name); + } + } + + SERIAL_RAW (desc); + + SERIAL_FLUSH_INPUT (desc); + + return desc; +} + +/* Read a single character from the remote end, masking it down to 7 bits. */ + +static int +readchar (desc, timeout) + serial_t desc; + int timeout; +{ + int ch; + + ch = SERIAL_READCHAR (desc, timeout); + + switch (ch) + { + case SERIAL_EOF: + error ("SPARClite remote connection closed"); + case SERIAL_ERROR: + perror_with_name ("SPARClite communication error"); + case SERIAL_TIMEOUT: + error ("SPARClite remote timeout"); + default: + return ch; + } +} + +static int +send_resp (desc, c) + serial_t desc; + char c; +{ + SERIAL_WRITE (desc, &c, 1); + return readchar (desc, 2); +} + +static void +close_tty (ignore) + int ignore; +{ + if (!remote_desc) + return; + + SERIAL_CLOSE (remote_desc); + + remote_desc = NULL; +} + +#ifdef HAVE_SOCKETS +static int +recv_udp_buf (fd, buf, len, timeout) + int fd, len; + unsigned char *buf; + int timeout; +{ + int cc; + fd_set readfds; + + FD_ZERO (&readfds); + FD_SET (fd, &readfds); + + if (timeout >= 0) + { + struct timeval timebuf; + + timebuf.tv_sec = timeout; + timebuf.tv_usec = 0; + cc = select (fd + 1, &readfds, 0, 0, &timebuf); + } + else + cc = select (fd + 1, &readfds, 0, 0, 0); + + if (cc == 0) + return 0; + + if (cc != 1) + perror_with_name ("recv_udp_buf: Bad return value from select:"); + + cc = recv (fd, buf, len, 0); + + if (cc < 0) + perror_with_name ("Got an error from recv: "); +} + +static int +send_udp_buf (fd, buf, len) + int fd, len; + unsigned char *buf; +{ + int cc; + + cc = send (fd, buf, len, 0); + + if (cc == len) + return; + + if (cc < 0) + perror_with_name ("Got an error from send: "); + + error ("Short count in send: tried %d, sent %d\n", len, cc); +} +#endif /* __GO32__ */ + +static void +sparclite_open (name, from_tty) + char *name; + int from_tty; +{ + struct cleanup *old_chain; + int c; + char *p; + + if (!name) + error ("You need to specify what device or hostname is associated with the SparcLite board."); + + target_preopen (from_tty); + + unpush_target (&sparclite_ops); + + if (remote_target_name) + free (remote_target_name); + + remote_target_name = strsave (name); + + /* We need a 'serial' or 'udp' keyword to disambiguate host:port, which can + mean either a serial port on a terminal server, or the IP address of a + SPARClite demo board. If there's no colon, then it pretty much has to be + a local device (except for DOS... grrmble) */ + + p = strchr (name, ' '); + + if (p) + { + *p++ = '\000'; + while ((*p != '\000') && isspace (*p)) p++; + + if (strncmp (name, "serial", strlen (name)) == 0) + serial_flag = 1; + else if (strncmp (name, "udp", strlen (name)) == 0) + serial_flag = 0; + else + error ("Must specify either `serial' or `udp'."); + } + else + { + p = name; + + if (!strchr (name, ':')) + serial_flag = 1; /* No colon is unambiguous (local device) */ + else + error ("Usage: target sparclite serial /dev/ttyb\n\ +or: target sparclite udp host"); + } + + if (serial_flag) + { + remote_desc = open_tty (p); + + old_chain = make_cleanup (close_tty, 0); + + c = send_resp (remote_desc, 0x00); + + if (c != 0xaa) + error ("Unknown response (0x%x) from SparcLite. Try resetting the board.", + c); + + c = send_resp (remote_desc, 0x55); + + if (c != 0x55) + error ("Sparclite appears to be ill."); + } + else + { +#ifdef HAVE_SOCKETS + struct hostent *he; + struct sockaddr_in sockaddr; + unsigned char buffer[100]; + int cc; + + /* Setup the socket. Must be raw UDP. */ + + he = gethostbyname (p); + + if (!he) + error ("No such host %s.", p); + + udp_fd = socket (PF_INET, SOCK_DGRAM, 0); + + old_chain = make_cleanup (close, udp_fd); + + sockaddr.sin_family = PF_INET; + sockaddr.sin_port = htons(7000); + memcpy (&sockaddr.sin_addr.s_addr, he->h_addr, sizeof (struct in_addr)); + + if (connect (udp_fd, &sockaddr, sizeof(sockaddr))) + perror_with_name ("Connect failed"); + + buffer[0] = 0x5; + buffer[1] = 0; + + send_udp_buf (udp_fd, buffer, 2); /* Request version */ + cc = recv_udp_buf (udp_fd, buffer, sizeof(buffer), 5); /* Get response */ + if (cc == 0) + error ("SPARClite isn't responding."); + + if (cc < 3) + error ("SPARClite appears to be ill."); +#else + error ("UDP downloading is not supported for DOS hosts."); +#endif /* __GO32__ */ + } + + printf_unfiltered ("[SPARClite appears to be alive]\n"); + + push_target (&sparclite_ops); + + discard_cleanups (old_chain); + + return; +} + +static void +sparclite_close (quitting) + int quitting; +{ + if (serial_flag) + close_tty (0); +#ifdef HAVE_SOCKETS + else + if (udp_fd != -1) + close (udp_fd); +#endif +} + +#define LOAD_ADDRESS 0x40000000 + +static void +download (target_name, args, from_tty, write_routine, start_routine) + char *target_name; + char *args; + int from_tty; + void (*write_routine)(); + void (*start_routine)(); +{ + struct cleanup *old_chain; + asection *section; + bfd *pbfd; + bfd_vma entry; + int i; +#define WRITESIZE 1024 + char *filename; + int quiet; + int nostart; + + quiet = 0; + nostart = 0; + filename = NULL; + + while (*args != '\000') + { + char *arg; + + while (isspace (*args)) args++; + + arg = args; + + while ((*args != '\000') && !isspace (*args)) args++; + + if (*args != '\000') + *args++ = '\000'; + + if (*arg != '-') + filename = arg; + else if (strncmp (arg, "-quiet", strlen (arg)) == 0) + quiet = 1; + else if (strncmp (arg, "-nostart", strlen (arg)) == 0) + nostart = 1; + else + error ("unknown option `%s'", arg); + } + + if (!filename) + filename = get_exec_file (1); + + pbfd = bfd_openr (filename, gnutarget); + if (pbfd == NULL) + { + perror_with_name (filename); + return; + } + old_chain = make_cleanup (bfd_close, pbfd); + + if (!bfd_check_format (pbfd, bfd_object)) + error ("\"%s\" is not an object file: %s", filename, + bfd_errmsg (bfd_get_error ())); + + for (section = pbfd->sections; section; section = section->next) + { + if (bfd_get_section_flags (pbfd, section) & SEC_LOAD) + { + bfd_vma section_address; + bfd_size_type section_size; + file_ptr fptr; + + section_address = bfd_get_section_vma (pbfd, section); + /* Adjust sections from a.out files, since they don't + carry their addresses with. */ + if (bfd_get_flavour (pbfd) == bfd_target_aout_flavour) + section_address += LOAD_ADDRESS; + + section_size = bfd_get_section_size_before_reloc (section); + + if (!quiet) + printf_filtered ("[Loading section %s at 0x%x (%d bytes)]\n", + bfd_get_section_name (pbfd, section), + section_address, + section_size); + + fptr = 0; + while (section_size > 0) + { + int count; + static char inds[] = "|/-\\"; + static int k = 0; + + QUIT; + + count = min (section_size, WRITESIZE); + + write_routine (pbfd, section, fptr, section_address, count); + + if (!quiet) + { + printf_unfiltered ("\r%c", inds[k++ % 4]); + gdb_flush (gdb_stdout); + } + + section_address += count; + fptr += count; + section_size -= count; + } + } + } + + if (!nostart) + { + entry = bfd_get_start_address (pbfd); + + if (!quiet) + printf_unfiltered ("[Starting %s at 0x%x]\n", filename, entry); + + start_routine (entry); + } + + do_cleanups (old_chain); +} + +static void +sparclite_serial_start (entry) + bfd_vma entry; +{ + char buffer[5]; + int i; + + buffer[0] = 0x03; + store_unsigned_integer (buffer + 1, 4, entry); + + SERIAL_WRITE (remote_desc, buffer, 1 + 4); + i = readchar (remote_desc, 2); + if (i != 0x55) + error ("Can't start SparcLite. Error code %d\n", i); +} + +static void +sparclite_serial_write (from_bfd, from_sec, from_addr, to_addr, len) + bfd *from_bfd; + asection *from_sec; + file_ptr from_addr; + bfd_vma to_addr; + int len; +{ + char buffer[4 + 4 + WRITESIZE]; /* addr + len + data */ + unsigned char checksum; + int i; + + store_unsigned_integer (buffer, 4, to_addr); /* Address */ + store_unsigned_integer (buffer + 4, 4, len); /* Length */ + + bfd_get_section_contents (from_bfd, from_sec, buffer + 8, from_addr, len); + + checksum = 0; + for (i = 0; i < len; i++) + checksum += buffer[8 + i]; + + i = send_resp (remote_desc, 0x01); + + if (i != 0x5a) + error ("Bad response from load command (0x%x)", i); + + SERIAL_WRITE (remote_desc, buffer, 4 + 4 + len); + i = readchar (remote_desc, 2); + + if (i != checksum) + error ("Bad checksum from load command (0x%x)", i); +} + +#ifdef HAVE_SOCKETS + +static unsigned short +calc_checksum (buffer, count) + unsigned char *buffer; + int count; +{ + unsigned short checksum; + + checksum = 0; + for (; count > 0; count -= 2, buffer += 2) + checksum += (*buffer << 8) | *(buffer + 1); + + if (count != 0) + checksum += *buffer << 8; + + return checksum; +} + +static void +sparclite_udp_start (entry) + bfd_vma entry; +{ + unsigned char buffer[6]; + int i; + + buffer[0] = 0x3; + buffer[1] = 0; + buffer[2] = entry >> 24; + buffer[3] = entry >> 16; + buffer[4] = entry >> 8; + buffer[5] = entry; + + send_udp_buf (udp_fd, buffer, 6); /* Send start addr */ + i = recv_udp_buf (udp_fd, buffer, sizeof(buffer), -1); /* Get response */ + + if (i < 1 || buffer[0] != 0x55) + error ("Failed to take start address."); +} + +static void +sparclite_udp_write (from_bfd, from_sec, from_addr, to_addr, len) + bfd *from_bfd; + asection *from_sec; + file_ptr from_addr; + bfd_vma to_addr; + int len; +{ + unsigned char buffer[2000]; + unsigned short checksum; + static int pkt_num = 0; + static unsigned long old_addr = -1; + int i; + + while (1) + { + if (to_addr != old_addr) + { + buffer[0] = 0x1; /* Load command */ + buffer[1] = 0x1; /* Loading address */ + buffer[2] = to_addr >> 24; + buffer[3] = to_addr >> 16; + buffer[4] = to_addr >> 8; + buffer[5] = to_addr; + + checksum = 0; + for (i = 0; i < 6; i++) + checksum += buffer[i]; + checksum &= 0xff; + + send_udp_buf (udp_fd, buffer, 6); + i = recv_udp_buf (udp_fd, buffer, sizeof buffer, -1); + + if (i < 1) + error ("Got back short checksum for load addr."); + + if (checksum != buffer[0]) + error ("Got back bad checksum for load addr."); + + pkt_num = 0; /* Load addr resets packet seq # */ + old_addr = to_addr; + } + + bfd_get_section_contents (from_bfd, from_sec, buffer + 6, from_addr, + len); + + checksum = calc_checksum (buffer + 6, len); + + buffer[0] = 0x1; /* Load command */ + buffer[1] = 0x2; /* Loading data */ + buffer[2] = pkt_num >> 8; + buffer[3] = pkt_num; + buffer[4] = checksum >> 8; + buffer[5] = checksum; + + send_udp_buf (udp_fd, buffer, len + 6); + i = recv_udp_buf (udp_fd, buffer, sizeof buffer, 3); + + if (i == 0) + { + fprintf_unfiltered (gdb_stderr, "send_data: timeout sending %d bytes to address 0x%x retrying\n", len, to_addr); + continue; + } + + if (buffer[0] != 0xff) + error ("Got back bad response for load data."); + + old_addr += len; + pkt_num++; + + return; + } +} + +#endif /* __GO32__ */ + +static void +sparclite_download (filename, from_tty) + char *filename; + int from_tty; +{ + if (!serial_flag) +#ifdef HAVE_SOCKETS + download (remote_target_name, filename, from_tty, sparclite_udp_write, + sparclite_udp_start); +#else + abort (); /* sparclite_open should prevent this! */ +#endif + else + download (remote_target_name, filename, from_tty, sparclite_serial_write, + sparclite_serial_start); +} + +/* Define the target subroutine names */ + +static struct target_ops sparclite_ops = +{ + "sparclite", /* to_shortname */ + "SPARClite remote target", /* to_longname */ + "Use a remote SPARClite target board via a serial line, using a gdb-specific protocol.\n\ +Specify the serial device it is connected to (e.g. /dev/ttya).", /* to_doc */ + sparclite_open, /* to_open */ + sparclite_close, /* to_close */ + 0, /* to_attach */ + 0, /* to_detach */ + 0, /* to_resume */ + 0, /* to_wait */ + 0, /* to_fetch_registers */ + 0, /* to_store_registers */ + 0, /* to_prepare_to_store */ + 0, /* to_xfer_memory */ + 0, /* to_files_info */ + 0, /* to_insert_breakpoint */ + 0, /* to_remove_breakpoint */ + 0, /* to_terminal_init */ + 0, /* to_terminal_inferior */ + 0, /* to_terminal_ours_for_output */ + 0, /* to_terminal_ours */ + 0, /* to_terminal_info */ + 0, /* to_kill */ + sparclite_download, /* to_load */ + 0, /* to_lookup_symbol */ + 0, /* to_create_inferior */ + 0, /* to_mourn_inferior */ + 0, /* to_can_run */ + 0, /* to_notice_signals */ + 0, /* to_thread_alive */ + 0, /* to_stop */ + download_stratum, /* to_stratum */ + 0, /* to_next */ + 0, /* to_has_all_memory */ + 0, /* to_has_memory */ + 0, /* to_has_stack */ + 0, /* to_has_registers */ + 0, /* to_has_execution */ + 0, /* sections */ + 0, /* sections_end */ + OPS_MAGIC /* to_magic */ + }; + +void +_initialize_sparcl_tdep () +{ + add_target (&sparclite_ops); +} diff --git a/contrib/gdb/gdb/sun3-nat.c b/contrib/gdb/gdb/sun3-nat.c new file mode 100644 index 0000000000000..c2ab6c99a5016 --- /dev/null +++ b/contrib/gdb/gdb/sun3-nat.c @@ -0,0 +1,155 @@ +/* Host-dependent code for Sun-3 for GDB, the GNU debugger. + Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "inferior.h" +#include "gdbcore.h" + +#include <sys/ptrace.h> +#define KERNEL /* To get floating point reg definitions */ +#include <machine/reg.h> + +void +fetch_inferior_registers (regno) + int regno; +{ + struct regs inferior_registers; +#ifdef FP0_REGNUM + struct fp_status inferior_fp_registers; +#endif + extern char registers[]; + + registers_fetched (); + + ptrace (PTRACE_GETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_registers); +#ifdef FP0_REGNUM + ptrace (PTRACE_GETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_fp_registers); +#endif + + memcpy (registers, &inferior_registers, 16 * 4); +#ifdef FP0_REGNUM + memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, + sizeof inferior_fp_registers.fps_regs); +#endif + *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; + *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; +#ifdef FP0_REGNUM + memcpy (®isters[REGISTER_BYTE (FPC_REGNUM)], + &inferior_fp_registers.fps_control, + sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs); +#endif +} + +/* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +void +store_inferior_registers (regno) + int regno; +{ + struct regs inferior_registers; +#ifdef FP0_REGNUM + struct fp_status inferior_fp_registers; +#endif + extern char registers[]; + + memcpy (&inferior_registers, registers, 16 * 4); +#ifdef FP0_REGNUM + memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], + sizeof inferior_fp_registers.fps_regs); +#endif + inferior_registers.r_ps = *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; + inferior_registers.r_pc = *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; + +#ifdef FP0_REGNUM + memcpy (&inferior_fp_registers.fps_control, + ®isters[REGISTER_BYTE (FPC_REGNUM)], + sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs); +#endif + + ptrace (PTRACE_SETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_registers); +#if FP0_REGNUM + ptrace (PTRACE_SETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_fp_registers); +#endif +} + + +/* All of this stuff is only relevant if both host and target are sun3. */ +/* Machine-dependent code for pulling registers out of a Sun-3 core file. */ + +static void +fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) + char *core_reg_sect; + unsigned core_reg_size; + int which; + unsigned int reg_addr; /* Unused in this version */ +{ + extern char registers[]; + struct regs *regs = (struct regs *) core_reg_sect; + + if (which == 0) { + if (core_reg_size < sizeof (struct regs)) + error ("Can't find registers in core file"); + + memcpy (registers, (char *)regs, 16 * 4); + supply_register (PS_REGNUM, (char *)®s->r_ps); + supply_register (PC_REGNUM, (char *)®s->r_pc); + + } else if (which == 2) { + +#define fpustruct ((struct fpu *) core_reg_sect) + + if (core_reg_size >= sizeof (struct fpu)) + { +#ifdef FP0_REGNUM + memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], + fpustruct->f_fpstatus.fps_regs, + sizeof fpustruct->f_fpstatus.fps_regs); + memcpy (®isters[REGISTER_BYTE (FPC_REGNUM)], + &fpustruct->f_fpstatus.fps_control, + sizeof fpustruct->f_fpstatus - + sizeof fpustruct->f_fpstatus.fps_regs); +#endif + } + else + fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n"); + } +} + + +/* Register that we are able to handle sun3 core file formats. + FIXME: is this really bfd_target_unknown_flavour? */ + +static struct core_fns sun3_core_fns = +{ + bfd_target_unknown_flavour, + fetch_core_registers, + NULL +}; + +void +_initialize_core_sun3 () +{ + add_core_fns (&sun3_core_fns); +} diff --git a/contrib/gdb/gdb/sun386-nat.c b/contrib/gdb/gdb/sun386-nat.c new file mode 100644 index 0000000000000..1abb4bb1df05a --- /dev/null +++ b/contrib/gdb/gdb/sun386-nat.c @@ -0,0 +1,258 @@ +/* Native support for Sun 386i's for GDB, the GNU debugger. + Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc. + Changes for sun386i by Jean Daniel Fekete (jdf@litp.univ-p6-7.fr), + C2V Paris, April 89. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "frame.h" +#include "inferior.h" +#include "gdbcore.h" + +#include <sys/param.h> +#include <sys/dir.h> +#include <sys/user.h> +#include <signal.h> +#include <sys/ioctl.h> +#include <fcntl.h> + +#include <sys/ptrace.h> +#include <machine/reg.h> + +#include <sys/file.h> +#include "gdb_stat.h" +#include <sys/core.h> + + +/* Machine-dependent code which would otherwise be in corefile.c */ +/* Work with core files, for GDB. */ + + +void +core_file_command (filename, from_tty) + char *filename; + int from_tty; +{ + int val; + extern char registers[]; + + /* Discard all vestiges of any previous core file + and mark data and stack spaces as empty. */ + + if (corefile) + free (corefile); + corefile = 0; + + if (corechan >= 0) + close (corechan); + corechan = -1; + + data_start = 0; + data_end = 0; + stack_start = STACK_END_ADDR; + stack_end = STACK_END_ADDR; + + /* Now, if a new core file was specified, open it and digest it. */ + + if (filename) + { + filename = tilde_expand (filename); + make_cleanup (free, filename); + + if (have_inferior_p ()) + error ("To look at a core file, you must kill the program with \"kill\"."); + corechan = open (filename, O_RDONLY, 0); + if (corechan < 0) + perror_with_name (filename); + + { + struct core corestr; + + val = myread (corechan, &corestr, sizeof corestr); + if (val < 0) + perror_with_name (filename); + if (corestr.c_magic != CORE_MAGIC) + error ("\"%s\" does not appear to be a core dump file (magic 0x%x, expected 0x%x)", + filename, corestr.c_magic, (int) CORE_MAGIC); + else if (sizeof (struct core) != corestr.c_len) + error ("\"%s\" has an invalid struct core length (%d, expected %d)", + filename, corestr.c_len, (int) sizeof (struct core)); + + data_start = exec_data_start; + data_end = data_start + corestr.c_dsize; + stack_start = stack_end - corestr.c_ssize; + data_offset = sizeof corestr; + stack_offset = sizeof corestr + corestr.c_dsize; + + memcpy (registers, &corestr.c_regs, sizeof corestr.c_regs); + + memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], + corestr.c_fpu.f_fpstatus.f_st, + sizeof corestr.c_fpu.f_fpstatus.f_st); + memcpy (®isters[REGISTER_BYTE (FPC_REGNUM)], + &corestr.c_fpu.f_fpstatus.f_ctrl, + sizeof corestr.c_fpu.f_fpstatus - + sizeof corestr.c_fpu.f_fpstatus.f_st); + + /* the struct aouthdr of sun coff is not the struct exec stored + in the core file. */ + memcpy (&core_aouthdr, &corestr.c_aouthdr, sizeof (struct exec)); +#ifndef COFF_ENCAPSULATE + core_aouthdr.magic = corestr.c_aouthdr.a_info; + core_aouthdr.vstamp = /*SUNVERSION*/ 31252; +#endif + printf_unfiltered ("Core file is from \"%s\".\n", corestr.c_cmdname); + if (corestr.c_signo > 0) + printf_unfiltered ("Program terminated with signal %d, %s.\n", + corestr.c_signo, safe_strsignal (corestr.c_signo)); + } + if (filename[0] == '/') + corefile = savestring (filename, strlen (filename)); + else + { + corefile = concat (current_directory, "/", filename, NULL); + } + + flush_cached_frames (); + select_frame (get_current_frame (), 0); + + validate_files (); + } + else if (from_tty) + printf_unfiltered ("No core file now.\n"); +} + +i387_to_double (from, to) + char *from; + char *to; +{ + long *lp; + /* push extended mode on 387 stack, then pop in double mode + * + * first, set exception masks so no error is generated - + * number will be rounded to inf or 0, if necessary + */ + asm ("pushl %eax"); /* grab a stack slot */ + asm ("fstcw (%esp)"); /* get 387 control word */ + asm ("movl (%esp),%eax"); /* save old value */ + asm ("orl $0x3f,%eax"); /* mask all exceptions */ + asm ("pushl %eax"); + asm ("fldcw (%esp)"); /* load new value into 387 */ + + asm ("movl 8(%ebp),%eax"); + asm ("fldt (%eax)"); /* push extended number on 387 stack */ + asm ("fwait"); + asm ("movl 12(%ebp),%eax"); + asm ("fstpl (%eax)"); /* pop double */ + asm ("fwait"); + + asm ("popl %eax"); /* flush modified control word */ + asm ("fnclex"); /* clear exceptions */ + asm ("fldcw (%esp)"); /* restore original control word */ + asm ("popl %eax"); /* flush saved copy */ +} + +double_to_i387 (from, to) + char *from; + char *to; +{ + /* push double mode on 387 stack, then pop in extended mode + * no errors are possible because every 64-bit pattern + * can be converted to an extended + */ + asm ("movl 8(%ebp),%eax"); + asm ("fldl (%eax)"); + asm ("fwait"); + asm ("movl 12(%ebp),%eax"); + asm ("fstpt (%eax)"); + asm ("fwait"); +} + +void +fetch_inferior_registers (regno) + int regno; +{ + struct regs inferior_registers; + struct fp_state inferior_fp_registers; + extern char registers[]; + + registers_fetched (); + + ptrace (PTRACE_GETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_registers); + ptrace (PTRACE_GETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_fp_registers); + + memcpy (registers, &inferior_registers, sizeof inferior_registers); + + memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)],inferior_fp_registers.f_st, + sizeof inferior_fp_registers.f_st); + memcpy (®isters[REGISTER_BYTE (FPC_REGNUM)], + &inferior_fp_registers.f_ctrl, + sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st); +} + +/* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +void +store_inferior_registers (regno) + int regno; +{ + struct regs inferior_registers; + struct fp_state inferior_fp_registers; + extern char registers[]; + + memcpy (&inferior_registers, registers, 20 * 4); + + memcpy (inferior_fp_registers.f_st, + ®isters[REGISTER_BYTE (FP0_REGNUM)], + sizeof inferior_fp_registers.f_st); + memcpy (&inferior_fp_registers.f_ctrl, + ®isters[REGISTER_BYTE (FPC_REGNUM)], + sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st); + +#ifdef PTRACE_FP_BUG + if (regno == FP_REGNUM || regno == -1) + /* Storing the frame pointer requires a gross hack, in which an + instruction that moves eax into ebp gets single-stepped. */ + { + int stack = inferior_registers.r_reg[SP_REGNUM]; + int stuff = ptrace (PTRACE_PEEKDATA, inferior_pid, + (PTRACE_ARG3_TYPE) stack); + int reg = inferior_registers.r_reg[EAX]; + inferior_registers.r_reg[EAX] = + inferior_registers.r_reg[FP_REGNUM]; + ptrace (PTRACE_SETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_registers); + ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack, + 0xc589); + ptrace (PTRACE_SINGLESTEP, inferior_pid, (PTRACE_ARG3_TYPE) stack, + 0); + wait (0); + ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack, + stuff); + inferior_registers.r_reg[EAX] = reg; + } +#endif + ptrace (PTRACE_SETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_registers); + ptrace (PTRACE_SETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) &inferior_fp_registers); +} diff --git a/contrib/gdb/gdb/tahoe-tdep.c b/contrib/gdb/gdb/tahoe-tdep.c new file mode 100644 index 0000000000000..281b1cfb440c4 --- /dev/null +++ b/contrib/gdb/gdb/tahoe-tdep.c @@ -0,0 +1,234 @@ +/* Print instructions for Tahoe target machines, for GDB. + Copyright 1986, 1989, 1991, 1992 Free Software Foundation, Inc. + Contributed by the State University of New York at Buffalo, by the + Distributed Computer Systems Lab, Department of Computer Science, 1991. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "symtab.h" +#include "opcode/tahoe.h" + +/* Tahoe instructions are never longer than this. */ +#define MAXLEN 62 + +/* Number of elements in the opcode table. */ +#define NOPCODES (sizeof votstrs / sizeof votstrs[0]) + +static unsigned char *print_insn_arg (); + +/* Print the Tahoe instruction at address MEMADDR in debugged memory, + on STREAM. Returns length of the instruction, in bytes. */ + +int +tahoe_print_insn (memaddr, stream) + CORE_ADDR memaddr; + GDB_FILE *stream; +{ + unsigned char buffer[MAXLEN]; + register int i; + register unsigned char *p; + register char *d; + + read_memory (memaddr, buffer, MAXLEN); + + for (i = 0; i < NOPCODES; i++) + if (votstrs[i].detail.code == buffer[0] + || votstrs[i].detail.code == *(unsigned short *)buffer) + break; + + /* Handle undefined instructions. */ + if (i == NOPCODES) + { + fprintf_unfiltered (stream, "0%o", buffer[0]); + return 1; + } + + fprintf_unfiltered (stream, "%s", votstrs[i].name); + + /* Point at first byte of argument data, + and at descriptor for first argument. */ + p = buffer + 1 + (votstrs[i].detail.code >= 0x100); + d = votstrs[i].detail.args; + + if (*d) + fputc_unfiltered ('\t', stream); + + while (*d) + { + p = print_insn_arg (d, p, memaddr + (p - buffer), stream); + d += 2; + if (*d) + fprintf_unfiltered (stream, ","); + } + return p - buffer; +} +/*******************************************************************/ +static unsigned char * +print_insn_arg (d, p, addr, stream) + char *d; + register char *p; + CORE_ADDR addr; + GDB_FILE *stream; +{ + int temp1 = 0; + register int regnum = *p & 0xf; + float floatlitbuf; + + if (*d == 'b') + { + if (d[1] == 'b') + fprintf_unfiltered (stream, "0x%x", addr + *p++ + 1); + else + { + + temp1 = *p; + temp1 <<= 8; + temp1 |= *(p + 1); + fprintf_unfiltered (stream, "0x%x", addr + temp1 + 2); + p += 2; + } + } + else + switch ((*p++ >> 4) & 0xf) + { + case 0: + case 1: + case 2: + case 3: /* Literal (short immediate byte) mode */ + if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h') + { + *(int *)&floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4); + fprintf_unfiltered (stream, "$%f", floatlitbuf); + } + else + fprintf_unfiltered (stream, "$%d", p[-1] & 0x3f); + break; + + case 4: /* Indexed */ + p = (char *) print_insn_arg (d, p, addr + 1, stream); + fprintf_unfiltered (stream, "[%s]", reg_names[regnum]); + break; + + case 5: /* Register */ + fprintf_unfiltered (stream, reg_names[regnum]); + break; + + case 7: /* Autodecrement */ + fputc_unfiltered ('-', stream); + case 6: /* Register deferred */ + fprintf_unfiltered (stream, "(%s)", reg_names[regnum]); + break; + + case 9: /* Absolute Address & Autoincrement deferred */ + fputc_unfiltered ('*', stream); + if (regnum == PC_REGNUM) + { + temp1 = *p; + temp1 <<= 8; + temp1 |= *(p +1); + + fputc_unfiltered ('$', stream); + print_address (temp1, stream); + p += 4; + break; + } + case 8: /*Immediate & Autoincrement SP */ + if (regnum == 8) /*88 is Immediate Byte Mode*/ + fprintf_unfiltered (stream, "$%d", *p++); + + else if (regnum == 9) /*89 is Immediate Word Mode*/ + { + temp1 = *p; + temp1 <<= 8; + temp1 |= *(p +1); + fprintf_unfiltered (stream, "$%d", temp1); + p += 2; + } + + else if (regnum == PC_REGNUM) /*8F is Immediate Long Mode*/ + { + temp1 = *p; + temp1 <<=8; + temp1 |= *(p +1); + temp1 <<=8; + temp1 |= *(p +2); + temp1 <<= 8; + temp1 |= *(p +3); + fprintf_unfiltered (stream, "$%d", temp1); + p += 4; + } + + else /*8E is Autoincrement SP Mode*/ + fprintf_unfiltered (stream, "(%s)+", reg_names[regnum]); + break; + + case 11: /* Register + Byte Displacement Deferred Mode*/ + fputc_unfiltered ('*', stream); + case 10: /* Register + Byte Displacement Mode*/ + if (regnum == PC_REGNUM) + print_address (addr + *p + 2, stream); + else + fprintf_unfiltered (stream, "%d(%s)", *p, reg_names[regnum]); + p += 1; + break; + + case 13: /* Register + Word Displacement Deferred Mode*/ + fputc_unfiltered ('*', stream); + case 12: /* Register + Word Displacement Mode*/ + temp1 = *p; + temp1 <<= 8; + temp1 |= *(p +1); + if (regnum == PC_REGNUM) + print_address (addr + temp1 + 3, stream); + else + fprintf_unfiltered (stream, "%d(%s)", temp1, reg_names[regnum]); + p += 2; + break; + + case 15: /* Register + Long Displacement Deferred Mode*/ + fputc_unfiltered ('*', stream); + case 14: /* Register + Long Displacement Mode*/ + temp1 = *p; + temp1 <<= 8; + temp1 |= *(p +1); + temp1 <<= 8; + temp1 |= *(p +2); + temp1 <<= 8; + temp1 |= *(p +3); + if (regnum == PC_REGNUM) + print_address (addr + temp1 + 5, stream); + else + fprintf_unfiltered (stream, "%d(%s)", temp1, reg_names[regnum]); + p += 4; + } + + return (unsigned char *) p; +} + + + + + + + + + + + + + diff --git a/contrib/gdb/gdb/ultra3-nat.c b/contrib/gdb/gdb/ultra3-nat.c new file mode 100644 index 0000000000000..d348c6f7cd35a --- /dev/null +++ b/contrib/gdb/gdb/ultra3-nat.c @@ -0,0 +1,323 @@ +/* Native-dependent code for GDB, for NYU Ultra3 running Sym1 OS. + Copyright (C) 1988, 1989, 1991, 1992 Free Software Foundation, Inc. + Contributed by David Wood (wood@nyu.edu) at New York University. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define DEBUG +#include "defs.h" +#include "frame.h" +#include "inferior.h" +#include "symtab.h" +#include "value.h" + +#include <sys/types.h> +#include <sys/param.h> +#include <signal.h> +#include <sys/ioctl.h> +#include <fcntl.h> + +#include "gdbcore.h" + +#include <sys/file.h> +#include "gdb_stat.h" + +/* Assumes support for AMD's Binary Compatibility Standard + for ptrace(). If you define ULTRA3, the ultra3 extensions to + ptrace() are used allowing the reading of more than one register + at a time. + + This file assumes KERNEL_DEBUGGING is turned off. This means + that if the user/gdb tries to read gr64-gr95 or any of the + protected special registers we silently return -1 (see the + CANNOT_STORE/FETCH_REGISTER macros). */ +#define ULTRA3 + +#if !defined (offsetof) +# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) +#endif + +extern int errno; +struct ptrace_user pt_struct; + +/* Get all available registers from the inferior. Registers that are + * defined in REGISTER_NAMES, but not available to the user/gdb are + * supplied as -1. This may include gr64-gr95 and the protected special + * purpose registers. + */ + +void +fetch_inferior_registers (regno) + int regno; +{ + register int i,j,ret_val=0; + char buf[128]; + + if (regno != -1) { + fetch_register (regno); + return; + } + +/* Global Registers */ +#ifdef ULTRA3 + errno = 0; + ptrace (PT_READ_STRUCT, inferior_pid, + (PTRACE_ARG3_TYPE) register_addr(GR96_REGNUM,0), + (int)&pt_struct.pt_gr[0], 32*4); + if (errno != 0) { + perror_with_name ("reading global registers"); + ret_val = -1; + } else for (regno=GR96_REGNUM, j=0 ; j<32 ; regno++, j++) { + supply_register (regno, &pt_struct.pt_gr[j]); + } +#else + for (regno=GR96_REGNUM ; !ret_val && regno < GR96_REGNUM+32 ; regno++) + fetch_register(regno); +#endif + +/* Local Registers */ +#ifdef ULTRA3 + errno = 0; + ptrace (PT_READ_STRUCT, inferior_pid, + (PTRACE_ARG3_TYPE) register_addr(LR0_REGNUM,0), + (int)&pt_struct.pt_lr[0], 128*4); + if (errno != 0) { + perror_with_name ("reading local registers"); + ret_val = -1; + } else for (regno=LR0_REGNUM, j=0 ; j<128 ; regno++, j++) { + supply_register (regno, &pt_struct.pt_lr[j]); + } +#else + for (regno=LR0_REGNUM ; !ret_val && regno < LR0_REGNUM+128 ; regno++) + fetch_register(regno); +#endif + +/* Special Registers */ + fetch_register(GR1_REGNUM); + fetch_register(CPS_REGNUM); + fetch_register(PC_REGNUM); + fetch_register(NPC_REGNUM); + fetch_register(PC2_REGNUM); + fetch_register(IPC_REGNUM); + fetch_register(IPA_REGNUM); + fetch_register(IPB_REGNUM); + fetch_register(Q_REGNUM); + fetch_register(BP_REGNUM); + fetch_register(FC_REGNUM); + +/* Fake any registers that are in REGISTER_NAMES, but not available to gdb */ + registers_fetched(); +} + +/* Store our register values back into the inferior. + * If REGNO is -1, do this for all registers. + * Otherwise, REGNO specifies which register (so we can save time). + * NOTE: Assumes AMD's binary compatibility standard. + */ + +void +store_inferior_registers (regno) + int regno; +{ + register unsigned int regaddr; + char buf[80]; + + if (regno >= 0) + { + if (CANNOT_STORE_REGISTER(regno)) + return; + regaddr = register_addr (regno, 0); + errno = 0; + ptrace (PT_WRITE_U, inferior_pid, + (PTRACE_ARG3_TYPE) regaddr, read_register(regno)); + if (errno != 0) + { + sprintf (buf, "writing register %s (#%d)", reg_names[regno],regno); + perror_with_name (buf); + } + } + else + { +#ifdef ULTRA3 + pt_struct.pt_gr1 = read_register(GR1_REGNUM); + for (regno = GR96_REGNUM; regno < GR96_REGNUM+32; regno++) + pt_struct.pt_gr[regno] = read_register(regno); + for (regno = LR0_REGNUM; regno < LR0_REGNUM+128; regno++) + pt_struct.pt_gr[regno] = read_register(regno); + errno = 0; + ptrace (PT_WRITE_STRUCT, inferior_pid, + (PTRACE_ARG3_TYPE) register_addr(GR1_REGNUM,0), + (int)&pt_struct.pt_gr1,(1*32*128)*4); + if (errno != 0) + { + sprintf (buf, "writing all local/global registers"); + perror_with_name (buf); + } + pt_struct.pt_psr = read_register(CPS_REGNUM); + pt_struct.pt_pc0 = read_register(NPC_REGNUM); + pt_struct.pt_pc1 = read_register(PC_REGNUM); + pt_struct.pt_pc2 = read_register(PC2_REGNUM); + pt_struct.pt_ipc = read_register(IPC_REGNUM); + pt_struct.pt_ipa = read_register(IPA_REGNUM); + pt_struct.pt_ipb = read_register(IPB_REGNUM); + pt_struct.pt_q = read_register(Q_REGNUM); + pt_struct.pt_bp = read_register(BP_REGNUM); + pt_struct.pt_fc = read_register(FC_REGNUM); + errno = 0; + ptrace (PT_WRITE_STRUCT, inferior_pid, + (PTRACE_ARG3_TYPE) register_addr(CPS_REGNUM,0), + (int)&pt_struct.pt_psr,(10)*4); + if (errno != 0) + { + sprintf (buf, "writing all special registers"); + perror_with_name (buf); + return; + } +#else + store_inferior_registers(GR1_REGNUM); + for (regno=GR96_REGNUM ; regno<GR96_REGNUM+32 ; regno++) + store_inferior_registers(regno); + for (regno=LR0_REGNUM ; regno<LR0_REGNUM+128 ; regno++) + store_inferior_registers(regno); + store_inferior_registers(CPS_REGNUM); + store_inferior_registers(PC_REGNUM); + store_inferior_registers(NPC_REGNUM); + store_inferior_registers(PC2_REGNUM); + store_inferior_registers(IPC_REGNUM); + store_inferior_registers(IPA_REGNUM); + store_inferior_registers(IPB_REGNUM); + store_inferior_registers(Q_REGNUM); + store_inferior_registers(BP_REGNUM); + store_inferior_registers(FC_REGNUM); +#endif /* ULTRA3 */ + } +} + +/* + * Fetch an individual register (and supply it). + * return 0 on success, -1 on failure. + * NOTE: Assumes AMD's Binary Compatibility Standard for ptrace(). + */ +static void +fetch_register (regno) + int regno; +{ + char buf[128]; + int val; + + if (CANNOT_FETCH_REGISTER(regno)) { + val = -1; + supply_register (regno, &val); + } else { + errno = 0; + val = ptrace (PT_READ_U, inferior_pid, + (PTRACE_ARG3_TYPE) register_addr(regno,0), 0); + if (errno != 0) { + sprintf(buf,"reading register %s (#%d)",reg_names[regno],regno); + perror_with_name (buf); + } else { + supply_register (regno, &val); + } + } +} + + +/* + * Read AMD's Binary Compatibilty Standard conforming core file. + * struct ptrace_user is the first thing in the core file + */ + +static void +fetch_core_registers () +{ + register int regno; + int val; + char buf[4]; + + for (regno = 0 ; regno < NUM_REGS; regno++) { + if (!CANNOT_FETCH_REGISTER(regno)) { + val = bfd_seek (core_bfd, (file_ptr) register_addr (regno, 0), SEEK_SET); + if (val < 0 || (val = bfd_read (buf, sizeof buf, 1, core_bfd)) < 0) { + char * buffer = (char *) alloca (strlen (reg_names[regno]) + 35); + strcpy (buffer, "Reading core register "); + strcat (buffer, reg_names[regno]); + perror_with_name (buffer); + } + supply_register (regno, buf); + } + } + + /* Fake any registers that are in REGISTER_NAMES, but not available to gdb */ + registers_fetched(); +} + + +/* + * Takes a register number as defined in tm.h via REGISTER_NAMES, and maps + * it to an offset in a struct ptrace_user defined by AMD's BCS. + * That is, it defines the mapping between gdb register numbers and items in + * a struct ptrace_user. + * A register protection scheme is set up here. If a register not + * available to the user is specified in 'regno', then an address that + * will cause ptrace() to fail is returned. + */ +unsigned int +register_addr (regno,blockend) + unsigned int regno; + char *blockend; +{ + if ((regno >= LR0_REGNUM) && (regno < LR0_REGNUM + 128)) { + return(offsetof(struct ptrace_user,pt_lr[regno-LR0_REGNUM])); + } else if ((regno >= GR96_REGNUM) && (regno < GR96_REGNUM + 32)) { + return(offsetof(struct ptrace_user,pt_gr[regno-GR96_REGNUM])); + } else { + switch (regno) { + case GR1_REGNUM: return(offsetof(struct ptrace_user,pt_gr1)); + case CPS_REGNUM: return(offsetof(struct ptrace_user,pt_psr)); + case NPC_REGNUM: return(offsetof(struct ptrace_user,pt_pc0)); + case PC_REGNUM: return(offsetof(struct ptrace_user,pt_pc1)); + case PC2_REGNUM: return(offsetof(struct ptrace_user,pt_pc2)); + case IPC_REGNUM: return(offsetof(struct ptrace_user,pt_ipc)); + case IPA_REGNUM: return(offsetof(struct ptrace_user,pt_ipa)); + case IPB_REGNUM: return(offsetof(struct ptrace_user,pt_ipb)); + case Q_REGNUM: return(offsetof(struct ptrace_user,pt_q)); + case BP_REGNUM: return(offsetof(struct ptrace_user,pt_bp)); + case FC_REGNUM: return(offsetof(struct ptrace_user,pt_fc)); + default: + fprintf_filtered(gdb_stderr,"register_addr():Bad register %s (%d)\n", + reg_names[regno],regno); + return(0xffffffff); /* Should make ptrace() fail */ + } + } +} + + +/* Register that we are able to handle ultra3 core file formats. + FIXME: is this really bfd_target_unknown_flavour? */ + +static struct core_fns ultra3_core_fns = +{ + bfd_target_unknown_flavour, + fetch_core_registers, + NULL +}; + +void +_initialize_core_ultra3 () +{ + add_core_fns (&ultra3_core_fns); +} diff --git a/contrib/gdb/gdb/ultra3-xdep.c b/contrib/gdb/gdb/ultra3-xdep.c new file mode 100644 index 0000000000000..57bab86e3bfdc --- /dev/null +++ b/contrib/gdb/gdb/ultra3-xdep.c @@ -0,0 +1,128 @@ +/* Host-dependent code for GDB, for NYU Ultra3 running Sym1 OS. + Copyright (C) 1988, 1989, 1991, 1992 Free Software Foundation, Inc. + Contributed by David Wood (wood@nyu.edu) at New York University. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define DEBUG +#include "defs.h" +#include "frame.h" +#include "inferior.h" +#include "symtab.h" +#include "value.h" + +#include <sys/types.h> +#include <sys/param.h> +#include <signal.h> +#include <sys/ioctl.h> +#include <fcntl.h> + +#include "gdbcore.h" + +#include <sys/file.h> +#include "gdb_stat.h" + +/* Assorted operating system circumventions */ + +#ifdef SYM1 + +/* FIXME: Kludge this for now. It really should be system call. */ +int +getpagesize() +{ return(8192); } + +/* FIXME: Fake out the fcntl() call, which we don't have. */ +fcntl(fd, cmd, arg) +int fd, cmd, arg; +{ + + switch (cmd) { + case F_GETFL: return(O_RDONLY); break; + default: + printf_unfiltered("Ultra3's fcntl() failing, cmd = %d.\n",cmd); + return(-1); + } +} + + +/* + * 4.2 Signal support, requires linking with libjobs. + */ +static int _SigMask; +#define sigbit(s) (1L << ((s)-1)) + +init_SigMask() +{ + /* Taken from the sym1 kernel in machdep.c:startup() */ + _SigMask = sigbit (SIGTSTP) | sigbit (SIGTTOU) | sigbit (SIGTTIN) | + sigbit (SIGCHLD) | sigbit (SIGTINT); +} + +sigmask(signo) + int signo; +{ + return (1 << (signo-1)); +} + +sigsetmask(sigmask) +unsigned int sigmask; +{ + int i, mask = 1; + int lastmask = _SigMask; + + for (i=0 ; i<NSIG ; i++) { + if (sigmask & mask) { + if (!(_SigMask & mask)) { + sighold(i+1); + _SigMask |= mask; + } + } else if (_SigMask & mask) { + sigrelse(i+1); + _SigMask &= ~mask; + } + mask <<= 1; + } + return (lastmask); +} + +sigblock(sigmask) +unsigned int sigmask; +{ + int i, mask = 1; + int lastmask = _SigMask; + + for (i=0 ; i<NSIG ; i++) { + if ((sigmask & mask) && !(_SigMask & mask)) { + sighold(i+1); + _SigMask |= mask; + } + mask <<= 1; + } + return (lastmask); +} +#endif /* SYM1 */ + + +/* Initialization code for this module. */ + +void +_initialize_ultra3 () +{ +#ifdef SYM1 + init_SigMask(); +#endif +} diff --git a/contrib/gdb/gdb/vax-tdep.c b/contrib/gdb/gdb/vax-tdep.c new file mode 100644 index 0000000000000..062dcf25bb3b4 --- /dev/null +++ b/contrib/gdb/gdb/vax-tdep.c @@ -0,0 +1,235 @@ +/* Print VAX instructions for GDB, the GNU debugger. + Copyright 1986, 1989, 1991, 1992 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "symtab.h" +#include "opcode/vax.h" + +/* Vax instructions are never longer than this. */ +#define MAXLEN 62 + +/* Number of elements in the opcode table. */ +#define NOPCODES (sizeof votstrs / sizeof votstrs[0]) + +static unsigned char *print_insn_arg (); + +/* Print the vax instruction at address MEMADDR in debugged memory, + on STREAM. Returns length of the instruction, in bytes. */ + +int +vax_print_insn (memaddr, stream) + CORE_ADDR memaddr; + GDB_FILE *stream; +{ + unsigned char buffer[MAXLEN]; + register int i; + register unsigned char *p; + register char *d; + + read_memory (memaddr, buffer, MAXLEN); + + for (i = 0; i < NOPCODES; i++) + if (votstrs[i].detail.code == buffer[0] + || votstrs[i].detail.code == *(unsigned short *)buffer) + break; + + /* Handle undefined instructions. */ + if (i == NOPCODES) + { + fprintf_unfiltered (stream, "0%o", buffer[0]); + return 1; + } + + fprintf_unfiltered (stream, "%s", votstrs[i].name); + + /* Point at first byte of argument data, + and at descriptor for first argument. */ + p = buffer + 1 + (votstrs[i].detail.code >= 0x100); + d = votstrs[i].detail.args; + + if (*d) + fputc_unfiltered (' ', stream); + + while (*d) + { + p = print_insn_arg (d, p, memaddr + (p - buffer), stream); + d += 2; + if (*d) + fprintf_unfiltered (stream, ","); + } + return p - buffer; +} + +static unsigned char * +print_insn_arg (d, p, addr, stream) + char *d; + register char *p; + CORE_ADDR addr; + GDB_FILE *stream; +{ + register int regnum = *p & 0xf; + float floatlitbuf; + + if (*d == 'b') + { + if (d[1] == 'b') + fprintf_unfiltered (stream, "0x%x", addr + *p++ + 1); + else + { + fprintf_unfiltered (stream, "0x%x", addr + *(short *)p + 2); + p += 2; + } + } + else + switch ((*p++ >> 4) & 0xf) + { + case 0: + case 1: + case 2: + case 3: /* Literal mode */ + if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h') + { + *(int *)&floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4); + fprintf_unfiltered (stream, "$%f", floatlitbuf); + } + else + fprintf_unfiltered (stream, "$%d", p[-1] & 0x3f); + break; + + case 4: /* Indexed */ + p = (char *) print_insn_arg (d, p, addr + 1, stream); + fprintf_unfiltered (stream, "[%s]", reg_names[regnum]); + break; + + case 5: /* Register */ + fprintf_unfiltered (stream, reg_names[regnum]); + break; + + case 7: /* Autodecrement */ + fputc_unfiltered ('-', stream); + case 6: /* Register deferred */ + fprintf_unfiltered (stream, "(%s)", reg_names[regnum]); + break; + + case 9: /* Autoincrement deferred */ + fputc_unfiltered ('@', stream); + if (regnum == PC_REGNUM) + { + fputc_unfiltered ('#', stream); + print_address (*(long *)p, stream); + p += 4; + break; + } + case 8: /* Autoincrement */ + if (regnum == PC_REGNUM) + { + fputc_unfiltered ('#', stream); + switch (d[1]) + { + case 'b': + fprintf_unfiltered (stream, "%d", *p++); + break; + + case 'w': + fprintf_unfiltered (stream, "%d", *(short *)p); + p += 2; + break; + + case 'l': + fprintf_unfiltered (stream, "%d", *(long *)p); + p += 4; + break; + + case 'q': + fprintf_unfiltered (stream, "0x%x%08x", ((long *)p)[1], ((long *)p)[0]); + p += 8; + break; + + case 'o': + fprintf_unfiltered (stream, "0x%x%08x%08x%08x", + ((long *)p)[3], ((long *)p)[2], + ((long *)p)[1], ((long *)p)[0]); + p += 16; + break; + + case 'f': + if (INVALID_FLOAT (p, 4)) + fprintf_unfiltered (stream, "<<invalid float 0x%x>>", *(int *) p); + else + fprintf_unfiltered (stream, "%f", *(float *) p); + p += 4; + break; + + case 'd': + if (INVALID_FLOAT (p, 8)) + fprintf_unfiltered (stream, "<<invalid float 0x%x%08x>>", + ((long *)p)[1], ((long *)p)[0]); + else + fprintf_unfiltered (stream, "%f", *(double *) p); + p += 8; + break; + + case 'g': + fprintf_unfiltered (stream, "g-float"); + p += 8; + break; + + case 'h': + fprintf_unfiltered (stream, "h-float"); + p += 16; + break; + + } + } + else + fprintf_unfiltered (stream, "(%s)+", reg_names[regnum]); + break; + + case 11: /* Byte displacement deferred */ + fputc_unfiltered ('@', stream); + case 10: /* Byte displacement */ + if (regnum == PC_REGNUM) + print_address (addr + *p + 2, stream); + else + fprintf_unfiltered (stream, "%d(%s)", *p, reg_names[regnum]); + p += 1; + break; + + case 13: /* Word displacement deferred */ + fputc_unfiltered ('@', stream); + case 12: /* Word displacement */ + if (regnum == PC_REGNUM) + print_address (addr + *(short *)p + 3, stream); + else + fprintf_unfiltered (stream, "%d(%s)", *(short *)p, reg_names[regnum]); + p += 2; + break; + + case 15: /* Long displacement deferred */ + fputc_unfiltered ('@', stream); + case 14: /* Long displacement */ + if (regnum == PC_REGNUM) + print_address (addr + *(long *)p + 5, stream); + else + fprintf_unfiltered (stream, "%d(%s)", *(long *)p, reg_names[regnum]); + p += 4; + } + + return (unsigned char *) p; +} diff --git a/contrib/gdb/gdb/w65-tdep.c b/contrib/gdb/gdb/w65-tdep.c new file mode 100644 index 0000000000000..ebf8d957ab424 --- /dev/null +++ b/contrib/gdb/gdb/w65-tdep.c @@ -0,0 +1,295 @@ +/* Target-machine dependent code for WDC-65816, for GDB. + Copyright (C) 1995 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* + Contributed by Steve Chamberlain + sac@cygnus.com + */ + +#include "defs.h" +#include "frame.h" +#include "obstack.h" +#include "symtab.h" +#include "gdbcmd.h" +#include "gdbtypes.h" +#include "dis-asm.h" + + +/* Return the saved PC from this frame. */ + + +CORE_ADDR +w65_frame_saved_pc (frame) + struct frame_info *frame; +{ + return (read_memory_integer (frame->frame + 2, 4) & 0xffffff); +} + +CORE_ADDR +addr_bits_remove (x) + CORE_ADDR x; +{ + return x; +} + +read_memory_pointer (x) + CORE_ADDR x; +{ + return read_memory_integer (ADDR_BITS_REMOVE (x), 4); +} + +init_frame_pc () +{ + abort (); +} + +void +w65_push_dummy_frame () +{ + abort (); +} + +/* Put here the code to store, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. + + We cache the result of doing this in the frame_cache_obstack, since + it is fairly expensive. */ + +void +frame_find_saved_regs (fip, fsrp) + struct frame_info *fip; + struct frame_saved_regs *fsrp; +{ + int locals; + CORE_ADDR pc; + CORE_ADDR adr; + int i; + + memset (fsrp, 0, sizeof *fsrp); +} + +int +saved_pc_after_call () +{ + int sp = read_register (SP_REGNUM); + int val = read_memory_integer (sp + 1, 4); + return ADDR_BITS_REMOVE (val); +} + + +extract_return_value (type, regbuf, valbuf) + struct type *type; + char *regbuf; + char *valbuf; +{ + int b; + int len = TYPE_LENGTH (type); + + for (b = 0; b < len; b += 2) + { + int todo = len - b; + if (todo > 2) + todo = 2; + memcpy (valbuf + b, regbuf + b, todo); + } +} + +void +write_return_value (type, valbuf) + struct type *type; + char *valbuf; +{ + int reg; + int len; + for (len = 0; len < TYPE_LENGTH (type); len += 2) + { + write_register_bytes (REGISTER_BYTE (len / 2 + 2), valbuf + len, 2); + } +} + +void +store_struct_return (addr, sp) + CORE_ADDR addr; + CORE_ADDR sp; +{ + write_register (2, addr); +} + +void +w65_pop_frame () +{ +} + +init_extra_frame_info () +{ +} + +pop_frame () +{ +} + +w65_frame_chain (thisframe) + struct frame_info *thisframe; +{ + return 0xffff & read_memory_integer ((thisframe)->frame, 2); +} + +static int +gb (x) +{ + return read_memory_integer (x, 1) & 0xff; +} + +extern CORE_ADDR +w65_skip_prologue (pc) + CORE_ADDR pc; +{ + CORE_ADDR too_far = pc + 20; + + /* looking for bits of the prologue, we can expect to + see this in a frameful function: + + stack adjust: + + 3B tsc + 1A inc a + 18 clc + 69E2FF adc #0xffe2 + 3A dec a + 1B tcs + 1A inc a + + link: + + A500 lda <r15 + 48 pha + 3B tsc + 1a inc a + 8500 sta <r15 + + */ + +#define TSC 0x3b +#define TCS 0x1b +#define INCA 0x1a +#define PHA 0x48 +#define LDADIR 0xa5 +#define STADIR 0x85 + + /* Skip a stack adjust - any area between a tsc and tcs */ + if (gb (pc) == TSC) + { + while (pc < too_far && gb (pc) != TCS) + { + pc++; + } + pc++; + /* Skip a stupid inc a */ + if (gb (pc) == INCA) + pc++; + + } + /* Stack adjust can also be done with n pha's */ + while (gb (pc) == PHA) + pc++; + + /* Skip a link - that's a ld/ph/tsc/inc/sta */ + + if (gb (pc) == LDADIR + && gb (pc + 5) == STADIR + && gb (pc + 1) == gb (pc + 6) + && gb (pc + 2) == PHA + && gb (pc + 3) == TSC + && gb (pc + 4) == INCA) + { + pc += 7; + } + + return pc; +} + + +register_raw_size (n) +{ + return sim_reg_size (n); +} + + +void +print_register_hook (regno) +{ + if (regno == P_REGNUM) + { + /* CCR register */ + + int C, Z, N, V, I, D, X, M; + unsigned char b[1]; + unsigned char l; + + read_relative_register_raw_bytes (regno, b); + l = b[0]; + printf_unfiltered ("\t"); + C = (l & 0x1) != 0; + Z = (l & 0x2) != 0; + I = (l & 0x4) != 0; + D = (l & 0x8) != 0; + X = (l & 0x10) != 0; + M = (l & 0x20) != 0; + V = (l & 0x40) != 0; + N = (l & 0x80) != 0; + + printf_unfiltered ("N-%d ", N); + printf_unfiltered ("V-%d ", V); + printf_unfiltered ("M-%d ", M); + printf_unfiltered ("X-%d ", X); + printf_unfiltered ("D-%d ", D); + printf_unfiltered ("I-%d ", I); + printf_unfiltered ("Z-%d ", Z); + printf_unfiltered ("C-%d ", C); + if ((C | Z) == 0) + printf_unfiltered ("u> "); + if ((C | Z) == 1) + printf_unfiltered ("u<= "); + if ((C == 0)) + printf_unfiltered ("u>= "); + if (C == 1) + printf_unfiltered ("u< "); + if (Z == 0) + printf_unfiltered ("!= "); + if (Z == 1) + printf_unfiltered ("== "); + if ((N ^ V) == 0) + printf_unfiltered (">= "); + if ((N ^ V) == 1) + printf_unfiltered ("< "); + if ((Z | (N ^ V)) == 0) + printf_unfiltered ("> "); + if ((Z | (N ^ V)) == 1) + printf_unfiltered ("<= "); + } +} + +void +_initialize_w65_tdep () +{ + tm_print_insn = print_insn_w65; +} diff --git a/contrib/gdb/gdb/w89k-rom.c b/contrib/gdb/gdb/w89k-rom.c new file mode 100644 index 0000000000000..ee2336876d46a --- /dev/null +++ b/contrib/gdb/gdb/w89k-rom.c @@ -0,0 +1,321 @@ +/* Remote target glue for the WinBond ROM monitor running on the "Cougar" + W89k eval board. + + Copyright 1995 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "gdbcore.h" +#include "target.h" +#include "monitor.h" +#include "serial.h" +#include "xmodem.h" + +static void w89k_open PARAMS ((char *args, int from_tty)); + +/* + * this array of registers need to match the indexes used by GDB. The + * whole reason this exists is cause the various ROM monitors use + * different strings than GDB does, and doesn't support all the + * registers either. So, typing "info reg sp" becomes a "r30". + */ + +static char *w89k_regnames[NUM_REGS] = +{ + "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", + "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", + "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", + "SAR", "PC", NULL, NULL, NULL, "EIEM", "IIR", "IVA", + "IOR", "IPSW", NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "CCR", NULL, NULL, "TR0", "TR1", +}; + +static void +w89k_supply_register (regname, regnamelen, val, vallen) + char *regname; + int regnamelen; + char *val; + int vallen; +{ + int numregs; + int regno; + + numregs = 1; + regno = -1; + + if (regnamelen == 2) + switch (regname[0]) + { + case 'r': + numregs = 4; + switch (regname[1]) + { + case '0': + regno = R0_REGNUM; + break; + case '4': + regno = R0_REGNUM + 4; + break; + case '8': + regno = R0_REGNUM + 8; + break; + } + break; + case 'P': + if (regname[1] == 'C') + regno = PC_REGNUM; + break; + } + else if (regnamelen == 3) + switch (regname[0]) + { + case 'r': + numregs = 4; + if (regname[1] == '1' && regname[2] == '2') + regno = R0_REGNUM + 12; + else if (regname[1] == '1' && regname[2] == '6') + regno = R0_REGNUM + 16; + else if (regname[1] == '2' && regname[2] == '0') + regno = R0_REGNUM + 20; + else if (regname[1] == '2' && regname[2] == '4') + regno = R0_REGNUM + 24; + else if (regname[1] == '2' && regname[2] == '8') + regno = R0_REGNUM + 28; + break; + case 'R': + if (regname[1] == 'C' && regname[2] == 'R') + regno = RCR_REGNUM; + break; + case 'C': + if (regname[1] == 'C' && regname[2] == 'R') + regno = CCR_REGNUM; + break; + case 'S': + if (regname[1] == 'A' && regname[2] == 'R') + regno = SAR_REGNUM; + break; + case 'I': + if (regname[1] == 'I' && regname[2] == 'R') + regno = IIR_REGNUM; + else if (regname[1] == 'O' && regname[2] == 'R') + regno = IOR_REGNUM; + break; + case 'T': + numregs = 4; + if (regname[1] == 'R') + if (regname[2] == '0') + regno = TR0_REGNUM; + else if (regname[2] == '4') + regno = TR0_REGNUM + 4; + break; + } + else if (regnamelen == 4) + switch (regname[0]) + { + case 'E': + if (regname[1] == 'I') + if (regname[2] == 'E' && regname[3] == 'M') + regno = EIEM_REGNUM; + break; + case 'I': + if (regname[1] == 'P' && regname[2] == 'S' && regname[3] == 'W') + regno = IPSW_REGNUM; + break; + } + else if (regnamelen == 5) + switch (regname[0]) + { + case 'I': + if (regname[1] == 'A' + && regname[2] == 'O' + && regname[3] == 'Q' + && regname[4] == 'B') + regno = PCOQ_TAIL_REGNUM; + break; + } + + if (regno >= 0) + while (numregs-- > 0) + val = monitor_supply_register (regno++, val); +} + +static int hashmark = 1; /* flag set by "set hash" */ + +extern struct monitor_ops w89k_cmds; /* fwd decl */ + +static void +w89k_load (desc, file, hashmark) + serial_t desc; + char *file; + int hashmark; +{ + bfd *abfd; + asection *s; + char *buffer; + int i; + + buffer = alloca (XMODEM_PACKETSIZE); + + abfd = bfd_openr (file, 0); + if (!abfd) + { + printf_filtered ("Unable to open file %s\n", file); + return; + } + + if (bfd_check_format (abfd, bfd_object) == 0) + { + printf_filtered ("File is not an object file\n"); + return; + } + + for (s = abfd->sections; s; s = s->next) + if (s->flags & SEC_LOAD) + { + bfd_size_type section_size; + + printf_filtered ("%s\t: 0x%4x .. 0x%4x ", s->name, s->vma, + s->vma + s->_raw_size); + gdb_flush (gdb_stdout); + + monitor_printf (w89k_cmds.load, s->vma); + if (w89k_cmds.loadresp) + monitor_expect (w89k_cmds.loadresp, NULL, 0); + + xmodem_init_xfer (desc); + + section_size = bfd_section_size (abfd, s); + + for (i = 0; i < section_size; i += XMODEM_DATASIZE) + { + int numbytes; + + numbytes = min (XMODEM_DATASIZE, section_size - i); + + bfd_get_section_contents (abfd, s, buffer + XMODEM_DATAOFFSET, i, + numbytes); + + xmodem_send_packet (desc, buffer, numbytes, hashmark); + + if (hashmark) + { + putchar_unfiltered ('#'); + gdb_flush (gdb_stdout); + } + } /* Per-packet (or S-record) loop */ + + xmodem_finish_xfer (desc); + + monitor_expect_prompt (NULL, 0); + + putchar_unfiltered ('\n'); + } /* Loadable sections */ + + if (hashmark) + putchar_unfiltered ('\n'); +} + +/* + * Define the monitor command strings. Since these are passed directly + * through to a printf style function, we need can include formatting + * strings. We also need a CR or LF on the end. + */ + +static struct target_ops w89k_ops; + +static char *w89k_inits[] = {"\n", NULL}; + +static struct monitor_ops w89k_cmds = +{ + MO_GETMEM_NEEDS_RANGE|MO_FILL_USES_ADDR, /* flags */ + w89k_inits, /* Init strings */ + "g\n", /* continue command */ + "t\n", /* single step */ + "\003", /* Interrupt char (^C) */ + "bp %x\n", /* set a breakpoint */ + "bc %x\n", /* clear a breakpoint */ + "bc *\n", /* clear all breakpoints */ + "f %x %x %x\n", /* memory fill cmd */ + { + "eb %x %x\n", /* setmem.cmdb (addr, value) */ + "eh %x %x\n", /* setmem.cmdw (addr, value) */ + "ew %x %x\n", /* setmem.cmdl (addr, value) */ + NULL, /* setmem.cmdll (addr, value) */ + NULL, /* setreg.resp_delim */ + NULL, /* setreg.term */ + NULL, /* setreg.term_cmd */ + }, + { + "db %x %x\n", /* getmem.cmdb (startaddr, endaddr) */ + "dh %x %x\n", /* getmem.cmdw (startaddr, endaddr) */ + "dw %x %x\n", /* getmem.cmdl (startaddr, endaddr) */ + NULL, /* getmem.cmdll (startaddr, endaddr) */ + " ", /* getmem.resp_delim */ + NULL, /* getmem.term */ + NULL, /* getmem.term_cmd */ + }, + { + "r %s %x\n", /* setreg.cmd (name, value) */ + NULL, /* setreg.resp_delim */ + NULL, /* setreg.term */ + NULL, /* setreg.term_cmd */ + }, + { + "r %s\n", /* getreg.cmd (name) */ + "\r", /* getreg.resp_delim */ + NULL, /* getreg.term */ + NULL, /* getreg.term_cmd */ + }, + "r\n", /* dump_registers */ + "\\(\\w+\\)\\( +[0-9a-fA-F]+\\b\\)+", + w89k_supply_register, /* supply_register */ + w89k_load, /* load routine */ + "u %x\n", /* download command */ + "\021", /* load response (^Q) */ + "ROM>", /* monitor command prompt */ + "\n", /* end-of-line terminator */ + NULL, /* optional command terminator */ + &w89k_ops, /* target operations */ + SERIAL_1_STOPBITS, /* number of stop bits */ + w89k_regnames, /* register names */ + MONITOR_OPS_MAGIC /* magic */ + }; + +static void +w89k_open(args, from_tty) + char *args; + int from_tty; +{ + monitor_open (args, &w89k_cmds, from_tty); +} + +void +_initialize_w89k () +{ + init_monitor_ops (&w89k_ops); + + w89k_ops.to_shortname = "w89k"; + w89k_ops.to_longname = "WinBond's debug monitor for the W89k Eval board"; + w89k_ops.to_doc = "Debug on a WinBond W89K eval board.\n\ +Specify the serial device it is connected to (e.g. /dev/ttya)."; + w89k_ops.to_open = w89k_open; + + add_target (&w89k_ops); +} diff --git a/contrib/gdb/gdb/win32-nat.c b/contrib/gdb/gdb/win32-nat.c new file mode 100644 index 0000000000000..2b50f6d661f37 --- /dev/null +++ b/contrib/gdb/gdb/win32-nat.c @@ -0,0 +1,1095 @@ +/* Target-vector operations for controlling win32 child processes, for GDB. + Copyright 1995, 1996 + Free Software Foundation, Inc. + + Contributed by Cygnus Support. + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without eve nthe implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* by Steve Chamberlain, sac@cygnus.com */ + +#include "defs.h" +#include "frame.h" /* required by inferior.h */ +#include "inferior.h" +#include "target.h" +#include "wait.h" +#include "gdbcore.h" +#include "command.h" +#include <signal.h> +#include <sys/types.h> +#include <fcntl.h> +#include <windows.h> +#include "buildsym.h" +#include "symfile.h" +#include "objfiles.h" +#include "gdb_string.h" +#include "thread.h" +#include "gdbcmd.h" +#include <sys/param.h> + +#define CHECK(x) check (x, __FILE__,__LINE__) +#define DEBUG_EXEC(x) if (debug_exec) printf x +#define DEBUG_EVENTS(x) if (debug_events) printf x +#define DEBUG_MEM(x) if (debug_memory) printf x +#define DEBUG_EXCEPT(x) if (debug_exceptions) printf x + +/* Forward declaration */ +extern struct target_ops child_ops; + +/* The most recently read context. Inspect ContextFlags to see what + bits are valid. */ + +static CONTEXT context; + +/* The process and thread handles for the above context. */ + +static HANDLE current_process; +static HANDLE current_thread; +static int current_process_id; +static int current_thread_id; + +/* Counts of things. */ +static int exception_count = 0; +static int event_count = 0; + +/* User options. */ +static int new_console = 0; +static int new_group = 0; +static int dos_path_style = 0; +static int debug_exec = 0; /* show execution */ +static int debug_events = 0; /* show events from kernel */ +static int debug_memory = 0; /* show target memory accesses */ +static int debug_exceptions = 0; /* show target exceptions */ + +/* This vector maps GDB's idea of a register's number into an address + in the win32 exception context vector. + + It also contains the bit mask needed to load the register in question. + + One day we could read a reg, we could inspect the context we + already have loaded, if it doesn't have the bit set that we need, + we read that set of registers in using GetThreadContext. If the + context already contains what we need, we just unpack it. Then to + write a register, first we have to ensure that the context contains + the other regs of the group, and then we copy the info in and set + out bit. */ + +struct regmappings + { + char *incontext; + int mask; + }; + + +static const struct regmappings mappings[] = +{ +#ifdef __PPC__ + {(char *) &context.Gpr0, CONTEXT_INTEGER}, + {(char *) &context.Gpr1, CONTEXT_INTEGER}, + {(char *) &context.Gpr2, CONTEXT_INTEGER}, + {(char *) &context.Gpr3, CONTEXT_INTEGER}, + {(char *) &context.Gpr4, CONTEXT_INTEGER}, + {(char *) &context.Gpr5, CONTEXT_INTEGER}, + {(char *) &context.Gpr6, CONTEXT_INTEGER}, + {(char *) &context.Gpr7, CONTEXT_INTEGER}, + + {(char *) &context.Gpr8, CONTEXT_INTEGER}, + {(char *) &context.Gpr9, CONTEXT_INTEGER}, + {(char *) &context.Gpr10, CONTEXT_INTEGER}, + {(char *) &context.Gpr11, CONTEXT_INTEGER}, + {(char *) &context.Gpr12, CONTEXT_INTEGER}, + {(char *) &context.Gpr13, CONTEXT_INTEGER}, + {(char *) &context.Gpr14, CONTEXT_INTEGER}, + {(char *) &context.Gpr15, CONTEXT_INTEGER}, + + {(char *) &context.Gpr16, CONTEXT_INTEGER}, + {(char *) &context.Gpr17, CONTEXT_INTEGER}, + {(char *) &context.Gpr18, CONTEXT_INTEGER}, + {(char *) &context.Gpr19, CONTEXT_INTEGER}, + {(char *) &context.Gpr20, CONTEXT_INTEGER}, + {(char *) &context.Gpr21, CONTEXT_INTEGER}, + {(char *) &context.Gpr22, CONTEXT_INTEGER}, + {(char *) &context.Gpr23, CONTEXT_INTEGER}, + + {(char *) &context.Gpr24, CONTEXT_INTEGER}, + {(char *) &context.Gpr25, CONTEXT_INTEGER}, + {(char *) &context.Gpr26, CONTEXT_INTEGER}, + {(char *) &context.Gpr27, CONTEXT_INTEGER}, + {(char *) &context.Gpr28, CONTEXT_INTEGER}, + {(char *) &context.Gpr29, CONTEXT_INTEGER}, + {(char *) &context.Gpr30, CONTEXT_INTEGER}, + {(char *) &context.Gpr31, CONTEXT_INTEGER}, + + {(char *) &context.Fpr0, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr1, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr2, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr3, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr4, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr5, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr6, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr7, CONTEXT_FLOATING_POINT}, + + {(char *) &context.Fpr8, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr9, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr10, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr11, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr12, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr13, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr14, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr15, CONTEXT_FLOATING_POINT}, + + {(char *) &context.Fpr16, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr17, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr18, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr19, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr20, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr21, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr22, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr23, CONTEXT_FLOATING_POINT}, + + {(char *) &context.Fpr24, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr25, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr26, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr27, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr28, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr29, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr30, CONTEXT_FLOATING_POINT}, + {(char *) &context.Fpr31, CONTEXT_FLOATING_POINT}, + + + {(char *) &context.Iar, CONTEXT_CONTROL}, + {(char *) &context.Msr, CONTEXT_CONTROL}, + {(char *) &context.Cr, CONTEXT_INTEGER}, + {(char *) &context.Lr, CONTEXT_CONTROL}, + {(char *) &context.Ctr, CONTEXT_CONTROL}, + + {(char *) &context.Xer, CONTEXT_INTEGER}, + {0,0}, /* MQ, but there isn't one */ +#else + {(char *) &context.Eax, CONTEXT_INTEGER}, + {(char *) &context.Ecx, CONTEXT_INTEGER}, + {(char *) &context.Edx, CONTEXT_INTEGER}, + {(char *) &context.Ebx, CONTEXT_INTEGER}, + {(char *) &context.Esp, CONTEXT_CONTROL}, + {(char *) &context.Ebp, CONTEXT_CONTROL}, + {(char *) &context.Esi, CONTEXT_INTEGER}, + {(char *) &context.Edi, CONTEXT_INTEGER}, + {(char *) &context.Eip, CONTEXT_CONTROL}, + {(char *) &context.EFlags, CONTEXT_CONTROL}, + {(char *) &context.SegCs, CONTEXT_SEGMENTS}, + {(char *) &context.SegSs, CONTEXT_SEGMENTS}, + {(char *) &context.SegDs, CONTEXT_SEGMENTS}, + {(char *) &context.SegEs, CONTEXT_SEGMENTS}, + {(char *) &context.SegFs, CONTEXT_SEGMENTS}, + {(char *) &context.SegGs, CONTEXT_SEGMENTS}, + {&context.FloatSave.RegisterArea[0 * 10], CONTEXT_FLOATING_POINT}, + {&context.FloatSave.RegisterArea[1 * 10], CONTEXT_FLOATING_POINT}, + {&context.FloatSave.RegisterArea[2 * 10], CONTEXT_FLOATING_POINT}, + {&context.FloatSave.RegisterArea[3 * 10], CONTEXT_FLOATING_POINT}, + {&context.FloatSave.RegisterArea[4 * 10], CONTEXT_FLOATING_POINT}, + {&context.FloatSave.RegisterArea[5 * 10], CONTEXT_FLOATING_POINT}, + {&context.FloatSave.RegisterArea[6 * 10], CONTEXT_FLOATING_POINT}, + {&context.FloatSave.RegisterArea[7 * 10], CONTEXT_FLOATING_POINT}, +#endif +}; + + +/* This vector maps the target's idea of an exception (extracted + from the DEBUG_EVENT structure) to GDB's idea. */ + +struct xlate_exception + { + int them; + enum target_signal us; + }; + + +static const struct xlate_exception + xlate[] = +{ + {EXCEPTION_ACCESS_VIOLATION, TARGET_SIGNAL_SEGV}, + {STATUS_STACK_OVERFLOW, TARGET_SIGNAL_SEGV}, + {EXCEPTION_BREAKPOINT, TARGET_SIGNAL_TRAP}, + {DBG_CONTROL_C, TARGET_SIGNAL_INT}, + {EXCEPTION_SINGLE_STEP, TARGET_SIGNAL_TRAP}, + {-1, -1}}; + + +static void +check (BOOL ok, const char *file, int line) +{ + if (!ok) + printf_filtered ("error return %s:%d was %d\n", file, line, GetLastError ()); +} + +static void +child_fetch_inferior_registers (int r) +{ + if (r < 0) + { + for (r = 0; r < NUM_REGS; r++) + child_fetch_inferior_registers (r); + } + else + { + supply_register (r, mappings[r].incontext); + } +} + +static void +child_store_inferior_registers (int r) +{ + if (r < 0) + { + for (r = 0; r < NUM_REGS; r++) + child_store_inferior_registers (r); + } + else + { + read_register_gen (r, mappings[r].incontext); + } +} + + +/* Wait for child to do something. Return pid of child, or -1 in case + of error; store status through argument pointer OURSTATUS. */ + + +static int +handle_load_dll (char *eventp) +{ + DEBUG_EVENT * event = (DEBUG_EVENT *)eventp; + DWORD dll_name_ptr; + DWORD done; + + ReadProcessMemory (current_process, + (DWORD) event->u.LoadDll.lpImageName, + (char *) &dll_name_ptr, + sizeof (dll_name_ptr), &done); + + /* See if we could read the address of a string, and that the + address isn't null. */ + + if (done == sizeof (dll_name_ptr) && dll_name_ptr) + { + char *dll_name, *dll_basename; + struct objfile *objfile; + char unix_dll_name[MAX_PATH]; + int size = event->u.LoadDll.fUnicode ? sizeof (WCHAR) : sizeof (char); + int len = 0; + char b[2]; + do + { + ReadProcessMemory (current_process, + dll_name_ptr + len * size, + &b, + size, + &done); + len++; + } + while ((b[0] != 0 || b[size - 1] != 0) && done == size); + + dll_name = alloca (len); + + if (event->u.LoadDll.fUnicode) + { + WCHAR *unicode_dll_name = (WCHAR *) alloca (len * sizeof (WCHAR)); + ReadProcessMemory (current_process, + dll_name_ptr, + unicode_dll_name, + len * sizeof (WCHAR), + &done); + + WideCharToMultiByte (CP_ACP, 0, + unicode_dll_name, len, + dll_name, len, 0, 0); + } + else + { + ReadProcessMemory (current_process, + dll_name_ptr, + dll_name, + len, + &done); + } + + + dos_path_to_unix_path (dll_name, unix_dll_name); + + /* FIXME!! It would be nice to define one symbol which pointed to the + front of the dll if we can't find any symbols. */ + + if (!(dll_basename = strrchr(dll_name, '\\'))) + dll_basename = strrchr(dll_name, '/'); + + ALL_OBJFILES(objfile) + { + char *objfile_basename; + if (!(objfile_basename = strrchr(objfile->name, '\\'))) + objfile_basename = strrchr(objfile->name, '/'); + + if (dll_basename && objfile_basename && + strcmp(dll_basename+1, objfile_basename+1) == 0) + { + printf_unfiltered ("%s (symbols previously loaded)\n", + dll_basename + 1); + return 1; + } + } + + + context.ContextFlags = CONTEXT_FULL | CONTEXT_FLOATING_POINT; + GetThreadContext (current_thread, &context); + + /* The symbols in a dll are offset by 0x1000, which is the + the offset from 0 of the first byte in an image - because + of the file header and the section alignment. + + FIXME: Is this the real reason that we need the 0x1000 ? */ + + + symbol_file_add (unix_dll_name, 0, + (int) event->u.LoadDll.lpBaseOfDll + 0x1000, 0, 0, 0); + + printf_unfiltered ("%x:%s\n", event->u.LoadDll.lpBaseOfDll, + unix_dll_name); + } + return 1; +} + + +static void +handle_exception (DEBUG_EVENT * event, struct target_waitstatus *ourstatus) +{ + int i; + int done = 0; + ourstatus->kind = TARGET_WAITKIND_STOPPED; + + + switch (event->u.Exception.ExceptionRecord.ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + DEBUG_EXCEPT (("gdb: Target exception ACCESS_VIOLATION at 0x%08x\n", + event->u.Exception.ExceptionRecord.ExceptionAddress)); + ourstatus->value.sig = TARGET_SIGNAL_SEGV; + break; + case STATUS_STACK_OVERFLOW: + DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08x\n", + event->u.Exception.ExceptionRecord.ExceptionAddress)); + ourstatus->value.sig = TARGET_SIGNAL_SEGV; + break; + case EXCEPTION_BREAKPOINT: + DEBUG_EXCEPT (("gdb: Target exception BREAKPOINT at 0x%08x\n", + event->u.Exception.ExceptionRecord.ExceptionAddress)); + ourstatus->value.sig = TARGET_SIGNAL_TRAP; + break; + case DBG_CONTROL_C: + DEBUG_EXCEPT (("gdb: Target exception CONTROL_C at 0x%08x\n", + event->u.Exception.ExceptionRecord.ExceptionAddress)); + ourstatus->value.sig = TARGET_SIGNAL_INT; + break; + case EXCEPTION_SINGLE_STEP: + DEBUG_EXCEPT (("gdb: Target exception SINGLE_STEP at 0x%08x\n", + event->u.Exception.ExceptionRecord.ExceptionAddress)); + ourstatus->value.sig = TARGET_SIGNAL_TRAP; + break; + default: + printf_unfiltered ("gdb: unknown target exception 0x%08x at 0x%08x\n", + event->u.Exception.ExceptionRecord.ExceptionCode, + event->u.Exception.ExceptionRecord.ExceptionAddress); + ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN; + break; + } + context.ContextFlags = CONTEXT_FULL | CONTEXT_FLOATING_POINT; + GetThreadContext (current_thread, &context); + exception_count++; +} + +static int +child_wait (int pid, struct target_waitstatus *ourstatus) +{ + /* We loop when we get a non-standard exception rather than return + with a SPURIOUS because resume can try and step or modify things, + which needs a current_thread. But some of these exceptions mark + the birth or death of threads, which mean that the current thread + isn't necessarily what you think it is. */ + + while (1) + { + DEBUG_EVENT event; + BOOL t = WaitForDebugEvent (&event, INFINITE); + char *p; + + event_count++; + + current_thread_id = event.dwThreadId; + current_process_id = event.dwProcessId; + + switch (event.dwDebugEventCode) + { + case CREATE_THREAD_DEBUG_EVENT: + DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n", + event.dwProcessId, event.dwThreadId, + "CREATE_THREAD_DEBUG_EVENT")); + break; + case EXIT_THREAD_DEBUG_EVENT: + DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n", + event.dwProcessId, event.dwThreadId, + "EXIT_THREAD_DEBUG_EVENT")); + break; + case CREATE_PROCESS_DEBUG_EVENT: + DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n", + event.dwProcessId, event.dwThreadId, + "CREATE_PROCESS_DEBUG_EVENT")); + break; + + case EXIT_PROCESS_DEBUG_EVENT: + DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n", + event.dwProcessId, event.dwThreadId, + "EXIT_PROCESS_DEBUG_EVENT")); + ourstatus->kind = TARGET_WAITKIND_EXITED; + ourstatus->value.integer = event.u.ExitProcess.dwExitCode; + CloseHandle (current_process); + CloseHandle (current_thread); + return current_process_id; + break; + + case LOAD_DLL_DEBUG_EVENT: + DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n", + event.dwProcessId, event.dwThreadId, + "LOAD_DLL_DEBUG_EVENT")); + catch_errors (handle_load_dll, + (char*) &event, + "\n[failed reading symbols from DLL]\n", + RETURN_MASK_ALL); + registers_changed(); /* mark all regs invalid */ + break; + case UNLOAD_DLL_DEBUG_EVENT: + DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n", + event.dwProcessId, event.dwThreadId, + "UNLOAD_DLL_DEBUG_EVENT")); + break; /* FIXME: don't know what to do here */ + case EXCEPTION_DEBUG_EVENT: + DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n", + event.dwProcessId, event.dwThreadId, + "EXCEPTION_DEBUG_EVENT")); + handle_exception (&event, ourstatus); + return current_process_id; + + case OUTPUT_DEBUG_STRING_EVENT: /* message from the kernel */ + DEBUG_EVENTS (("gdb: kernel event for pid=%d tid=%d code=%s)\n", + event.dwProcessId, event.dwThreadId, + "OUTPUT_DEBUG_STRING_EVENT")); + if (target_read_string + ((CORE_ADDR) event.u.DebugString.lpDebugStringData, + &p, 1024, 0) && p && *p) + { + warning(p); + free(p); + } + break; + default: + printf_unfiltered ("gdb: kernel event for pid=%d tid=%d\n", + event.dwProcessId, event.dwThreadId); + printf_unfiltered (" unknown event code %d\n", + event.dwDebugEventCode); + break; + } + DEBUG_EVENTS (("ContinueDebugEvent (cpid=%d, ctid=%d, DBG_CONTINUE);\n", + current_process_id, current_thread_id)); + CHECK (ContinueDebugEvent (current_process_id, + current_thread_id, + DBG_CONTINUE)); + } +} + + +/* Attach to process PID, then initialize for debugging it. */ + +static void +child_attach (args, from_tty) + char *args; + int from_tty; +{ + BOOL ok; + + if (!args) + error_no_arg ("process-id to attach"); + + current_process_id = strtoul (args, 0, 0); + + ok = DebugActiveProcess (current_process_id); + + if (!ok) + error ("Can't attach to process."); + + + exception_count = 0; + event_count = 0; + + if (from_tty) + { + char *exec_file = (char *) get_exec_file (0); + + if (exec_file) + printf_unfiltered ("Attaching to program `%s', %s\n", exec_file, + target_pid_to_str (current_process_id)); + else + printf_unfiltered ("Attaching to %s\n", + target_pid_to_str (current_process_id)); + + gdb_flush (gdb_stdout); + } + + inferior_pid = current_process_id; + push_target (&child_ops); +} + + +static void +child_detach (args, from_tty) + char *args; + int from_tty; +{ + if (from_tty) + { + char *exec_file = get_exec_file (0); + if (exec_file == 0) + exec_file = ""; + printf_unfiltered ("Detaching from program: %s %s\n", exec_file, + target_pid_to_str (inferior_pid)); + gdb_flush (gdb_stdout); + } + inferior_pid = 0; + unpush_target (&child_ops); +} + + +/* Print status information about what we're accessing. */ + +static void +child_files_info (ignore) + struct target_ops *ignore; +{ + printf_unfiltered ("\tUsing the running image of %s %s.\n", + attach_flag ? "attached" : "child", target_pid_to_str (inferior_pid)); +} + +/* ARGSUSED */ +static void +child_open (arg, from_tty) + char *arg; + int from_tty; +{ + error ("Use the \"run\" command to start a Unix child process."); +} + + +/* Convert a unix-style set-of-paths (a colon-separated list of directory + paths with forward slashes) into the dos style (semicolon-separated + list with backward slashes), simultaneously undoing any translations + performed by the mount table. */ + +static char *buf = NULL; +static int blen = 2000; + +static char * +unix_paths_to_dos_paths(char *newenv) +{ + int ei; + char *src; + + if (buf == 0) + buf = (char *) malloc(blen); + + if (newenv == 0 || *newenv == 0 || + (src = strchr(newenv, '=')) == 0) /* find the equals sign */ + return 0; + + src++; /* now skip past it */ + + if (src[0] == '/' || /* is this a unix style path? */ + (src[0] == '.' && src[1] == '/') || + (src[0] == '.' && src[1] == '.' && src[2] == '/')) + { /* we accept that we will fail on a relative path like 'foo/mumble' */ + /* Found an env name, turn from unix style into dos style */ + int len = src - newenv; + char *dir = buf + len; + + memcpy(buf, newenv, len); + /* Split out the colons */ + while (1) + { + char *tok = strchr (src, ':'); + int doff = dir - buf; + + if (doff + MAX_PATH > blen) + { + blen *= 2; + buf = (char *) realloc((void *) buf, blen); + dir = buf + doff; + } + if (tok) + { + *tok = 0; + cygwin32_unix_path_to_dos_path_keep_rel (src, dir); + *tok = ':'; + dir += strlen(dir); + src = tok + 1; + *dir++ = ';'; + } + else + { + cygwin32_unix_path_to_dos_path_keep_rel (src, dir); + dir += strlen(dir); + *dir++ = 0; + break; + } + } + return buf; + } + return 0; +} + +/* Convert a dos-style set-of-paths (a semicolon-separated list with + backward slashes) into the dos style (colon-separated list of + directory paths with forward slashes), simultaneously undoing any + translations performed by the mount table. */ + +static char * +dos_paths_to_unix_paths(char *newenv) +{ + int ei; + char *src; + + if (buf == 0) + buf = (char *) malloc(blen); + + if (newenv == 0 || *newenv == 0 || + (src = strchr(newenv, '=')) == 0) /* find the equals sign */ + return 0; + + src++; /* now skip past it */ + + if (src[0] == '\\' || /* is this a dos style path? */ + (isalpha(src[0]) && src[1] == ':' && src[2] == '\\') || + (src[0] == '.' && src[1] == '\\') || + (src[0] == '.' && src[1] == '.' && src[2] == '\\')) + { /* we accept that we will fail on a relative path like 'foo\mumble' */ + /* Found an env name, turn from dos style into unix style */ + int len = src - newenv; + char *dir = buf + len; + + memcpy(buf, newenv, len); + /* Split out the colons */ + while (1) + { + char *tok = strchr (src, ';'); + int doff = dir - buf; + + if (doff + MAX_PATH > blen) + { + blen *= 2; + buf = (char *) realloc((void *) buf, blen); + dir = buf + doff; + } + if (tok) + { + *tok = 0; + cygwin32_dos_path_to_unix_path_keep_rel (src, dir); + *tok = ';'; + dir += strlen(dir); + src = tok + 1; + *dir++ = ':'; + } + else + { + cygwin32_dos_path_to_unix_path_keep_rel (src, dir); + dir += strlen(dir); + *dir++ = 0; + break; + } + } + return buf; + } + return 0; +} + + +/* Start an inferior win32 child process and sets inferior_pid to its pid. + EXEC_FILE is the file to run. + ALLARGS is a string containing the arguments to the program. + ENV is the environment vector to pass. Errors reported with error(). */ + +static void +child_create_inferior (exec_file, allargs, env) + char *exec_file; + char *allargs; + char **env; +{ + char real_path[MAXPATHLEN]; + char *winenv; + char *temp; + int envlen; + int i; + + STARTUPINFO si; + PROCESS_INFORMATION pi; + struct target_waitstatus dummy; + BOOL ret; + DWORD flags; + char *args; + + if (!exec_file) + { + error ("No executable specified, use `target exec'.\n"); + } + + memset (&si, 0, sizeof (si)); + si.cb = sizeof (si); + + unix_path_to_dos_path (exec_file, real_path); + + flags = DEBUG_ONLY_THIS_PROCESS; + + if (new_group) + flags |= CREATE_NEW_PROCESS_GROUP; + + if (new_console) + flags |= CREATE_NEW_CONSOLE; + + args = alloca (strlen (real_path) + strlen (allargs) + 2); + + strcpy (args, real_path); + + strcat (args, " "); + strcat (args, allargs); + +#if 0 + /* get total size for env strings */ + for (envlen = 0, i = 0; env[i] && *env[i]; i++) + envlen += strlen(env[i]) + 1; +#else + /* get total size for env strings */ + for (envlen = 0, i = 0; env[i] && *env[i]; i++) + { +#if 0 + winenv = 0; +#else + winenv = unix_paths_to_dos_paths(env[i]); +#endif + envlen += winenv ? strlen(winenv) + 1 : strlen(env[i]) + 1; + } +#endif + + winenv = alloca(2 * envlen + 1); /* allocate new buffer */ + + /* copy env strings into new buffer */ + for (temp = winenv, i = 0; env[i] && *env[i]; i++) + { +#if 0 + char *p = 0; +#else + char *p = unix_paths_to_dos_paths(env[i]); +#endif + strcpy(temp, p ? p : env[i]); + temp += strlen(temp) + 1; + } +#if 0 + /* copy env strings into new buffer */ + for (temp = winenv, i = 0; env[i] && *env[i]; i++) + { + strcpy(temp, env[i]); + temp += strlen(temp) + 1; + } +#endif + + *temp = 0; /* final nil string to terminate new env */ + + ret = CreateProcess (0, + args, /* command line */ + NULL, /* Security */ + NULL, /* thread */ + TRUE, /* inherit handles */ + flags, /* start flags */ + winenv, + NULL, /* current directory */ + &si, + &pi); + if (!ret) + error ("Error creating process %s, (error %d)\n", exec_file, GetLastError()); + + exception_count = 0; + event_count = 0; + + inferior_pid = pi.dwProcessId; + current_process = pi.hProcess; + current_thread = pi.hThread; + current_process_id = pi.dwProcessId; + current_thread_id = pi.dwThreadId; + push_target (&child_ops); + init_thread_list (); + init_wait_for_inferior (); + clear_proceed_status (); + target_terminal_init (); + target_terminal_inferior (); + + /* Ignore the first trap */ + child_wait (inferior_pid, &dummy); + + proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0); +} + +static void +child_mourn_inferior () +{ + unpush_target (&child_ops); + generic_mourn_inferior (); +} + + +/* Send a SIGINT to the process group. This acts just like the user typed a + ^C on the controlling terminal. */ + +void +child_stop () +{ + DEBUG_EVENTS (("gdb: GenerateConsoleCtrlEvent (CTRLC_EVENT, 0)\n")); + CHECK (GenerateConsoleCtrlEvent (CTRL_C_EVENT, 0)); + registers_changed(); /* refresh register state */ +} + +int +child_xfer_memory (CORE_ADDR memaddr, char *our, int len, + int write, struct target_ops *target) +{ + DWORD done; + if (write) + { + DEBUG_MEM (("gdb: write target memory, %d bytes at 0x%08x\n", + len, memaddr)); + WriteProcessMemory (current_process, memaddr, our, len, &done); + FlushInstructionCache (current_process, memaddr, len); + } + else + { + DEBUG_MEM (("gdb: read target memory, %d bytes at 0x%08x\n", + len, memaddr)); + ReadProcessMemory (current_process, memaddr, our, len, &done); + } + return done; +} + +void +child_kill_inferior (void) +{ + CHECK (TerminateProcess (current_process, 0)); + CHECK (CloseHandle (current_process)); + CHECK (CloseHandle (current_thread)); + target_mourn_inferior(); /* or just child_mourn_inferior? */ +} + +void +child_resume (int pid, int step, enum target_signal signal) +{ + DEBUG_EXEC (("gdb: child_resume (pid=%d, step=%d, signal=%d);\n", + pid, step, signal)); + + if (step) + { +#ifdef __PPC__ + warning ("Single stepping not done.\n"); +#endif +#ifdef i386 + /* Single step by setting t bit */ + child_fetch_inferior_registers (PS_REGNUM); + context.EFlags |= FLAG_TRACE_BIT; +#endif + } + + if (context.ContextFlags) + { + CHECK (SetThreadContext (current_thread, &context)); + context.ContextFlags = 0; + } + + if (signal) + { + fprintf_unfiltered (gdb_stderr, "Can't send signals to the child.\n"); + } + + DEBUG_EVENTS (("gdb: ContinueDebugEvent (cpid=%d, ctid=%d, DBG_CONTINUE);\n", + current_process_id, current_thread_id)); + CHECK (ContinueDebugEvent (current_process_id, + current_thread_id, + DBG_CONTINUE)); +} + +static void +child_prepare_to_store () +{ + /* Do nothing, since we can store individual regs */ +} + +static int +child_can_run () +{ + return 1; +} + +static void +child_close () +{ + DEBUG_EVENTS (("gdb: child_close, inferior_pid=%d\n", inferior_pid)); +} + +struct target_ops child_ops = +{ + "child", /* to_shortname */ + "Win32 child process", /* to_longname */ + "Win32 child process (started by the \"run\" command).", /* to_doc */ + child_open, /* to_open */ + child_close, /* to_close */ + child_attach, /* to_attach */ + child_detach, /* to_detach */ + child_resume, /* to_resume */ + child_wait, /* to_wait */ + child_fetch_inferior_registers,/* to_fetch_registers */ + child_store_inferior_registers,/* to_store_registers */ + child_prepare_to_store, /* to_child_prepare_to_store */ + child_xfer_memory, /* to_xfer_memory */ + child_files_info, /* to_files_info */ + memory_insert_breakpoint, /* to_insert_breakpoint */ + memory_remove_breakpoint, /* to_remove_breakpoint */ + terminal_init_inferior, /* to_terminal_init */ + terminal_inferior, /* to_terminal_inferior */ + terminal_ours_for_output, /* to_terminal_ours_for_output */ + terminal_ours, /* to_terminal_ours */ + child_terminal_info, /* to_terminal_info */ + child_kill_inferior, /* to_kill */ + 0, /* to_load */ + 0, /* to_lookup_symbol */ + child_create_inferior, /* to_create_inferior */ + child_mourn_inferior, /* to_mourn_inferior */ + child_can_run, /* to_can_run */ + 0, /* to_notice_signals */ + 0, /* to_thread_alive */ + child_stop, /* to_stop */ + process_stratum, /* to_stratum */ + 0, /* to_next */ + 1, /* to_has_all_memory */ + 1, /* to_has_memory */ + 1, /* to_has_stack */ + 1, /* to_has_registers */ + 1, /* to_has_execution */ + 0, /* to_sections */ + 0, /* to_sections_end */ + OPS_MAGIC /* to_magic */ +}; + +#include "environ.h" + +static void +set_pathstyle_dos(args, from_tty, c) + char *args; + int from_tty; + struct cmd_list_element *c; +{ + char **vector = environ_vector(inferior_environ); + char *thisvar; + int dos = *(int *) c->var; + + if (info_verbose) + printf_unfiltered ("Change dos_path_style to %s\n", dos ? "true":"false"); + + while (vector && *vector) + { + if (dos) + thisvar = unix_paths_to_dos_paths(*vector); + else + thisvar = dos_paths_to_unix_paths(*vector); + + if (thisvar) + { + if (info_verbose) + printf_unfiltered ("Change %s\nto %s\n", *vector, thisvar); + free(*vector); + *vector = xmalloc(strlen(thisvar) + 1); + strcpy(*vector, thisvar); + } + vector++; + } +} + + +void +_initialize_inftarg () +{ + struct cmd_list_element *c; + + add_show_from_set + (add_set_cmd ("new-console", class_support, var_boolean, + (char *) &new_console, + "Set creation of new console when creating child process.", + &setlist), + &showlist); + + add_show_from_set + (add_set_cmd ("new-group", class_support, var_boolean, + (char *) &new_group, + "Set creation of new group when creating child process.", + &setlist), + &showlist); + + add_show_from_set + (c = add_set_cmd ("dos-path-style", class_support, var_boolean, + (char *) &dos_path_style, + "Set whether paths in child's environment are shown in dos style.", + &setlist), + &showlist); + + c->function.sfunc = set_pathstyle_dos; + + add_show_from_set + (add_set_cmd ("debugexec", class_support, var_boolean, + (char *) &debug_exec, + "Set whether to display execution in child process.", + &setlist), + &showlist); + + add_show_from_set + (add_set_cmd ("debugevents", class_support, var_boolean, + (char *) &debug_events, + "Set whether to display kernel events in child process.", + &setlist), + &showlist); + + add_show_from_set + (add_set_cmd ("debugmemory", class_support, var_boolean, + (char *) &debug_memory, + "Set whether to display memory accesses in child process.", + &setlist), + &showlist); + + add_show_from_set + (add_set_cmd ("debugexceptions", class_support, var_boolean, + (char *) &debug_exceptions, + "Set whether to display kernel exceptions in child process.", + &setlist), + &showlist); + + add_target (&child_ops); +} diff --git a/contrib/gdb/gdb/z8k-tdep.c b/contrib/gdb/gdb/z8k-tdep.c new file mode 100644 index 0000000000000..ae5b7a11c10e9 --- /dev/null +++ b/contrib/gdb/gdb/z8k-tdep.c @@ -0,0 +1,448 @@ +/* Target-machine dependent code for Zilog Z8000, for GDB. + Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* + Contributed by Steve Chamberlain + sac@cygnus.com + */ + +#include "defs.h" +#include "frame.h" +#include "obstack.h" +#include "symtab.h" +#include "gdbcmd.h" +#include "gdbtypes.h" +#include "dis-asm.h" + +/* Return the saved PC from this frame. + + If the frame has a memory copy of SRP_REGNUM, use that. If not, + just use the register SRP_REGNUM itself. */ + +CORE_ADDR +frame_saved_pc (frame) + struct frame_info *frame; +{ + return read_memory_pointer (frame->frame + (BIG ? 4 : 2)); +} + +#define IS_PUSHL(x) (BIG ? ((x & 0xfff0) == 0x91e0):((x & 0xfff0) == 0x91F0)) +#define IS_PUSHW(x) (BIG ? ((x & 0xfff0) == 0x93e0):((x & 0xfff0)==0x93f0)) +#define IS_MOVE_FP(x) (BIG ? x == 0xa1ea : x == 0xa1fa) +#define IS_MOV_SP_FP(x) (BIG ? x == 0x94ea : x == 0x0d76) +#define IS_SUB2_SP(x) (x==0x1b87) +#define IS_MOVK_R5(x) (x==0x7905) +#define IS_SUB_SP(x) ((x & 0xffff) == 0x020f) +#define IS_PUSH_FP(x) (BIG ? (x == 0x93ea) : (x == 0x93fa)) + +/* work out how much local space is on the stack and + return the pc pointing to the first push */ + +static CORE_ADDR +skip_adjust (pc, size) + CORE_ADDR pc; + int *size; +{ + *size = 0; + + if (IS_PUSH_FP (read_memory_short (pc)) + && IS_MOV_SP_FP (read_memory_short (pc + 2))) + { + /* This is a function with an explict frame pointer */ + pc += 4; + *size += 2; /* remember the frame pointer */ + } + + /* remember any stack adjustment */ + if (IS_SUB_SP (read_memory_short (pc))) + { + *size += read_memory_short (pc + 2); + pc += 4; + } + return pc; +} + +int +examine_frame (pc, regs, sp) + CORE_ADDR pc; + struct frame_saved_regs *regs; + CORE_ADDR sp; +{ + int w = read_memory_short (pc); + int offset = 0; + int regno; + + for (regno = 0; regno < NUM_REGS; regno++) + regs->regs[regno] = 0; + + while (IS_PUSHW (w) || IS_PUSHL (w)) + { + /* work out which register is being pushed to where */ + if (IS_PUSHL (w)) + { + regs->regs[w & 0xf] = offset; + regs->regs[(w & 0xf) + 1] = offset + 2; + offset += 4; + } + else + { + regs->regs[w & 0xf] = offset; + offset += 2; + } + pc += 2; + w = read_memory_short (pc); + } + + if (IS_MOVE_FP (w)) + { + /* We know the fp */ + + } + else if (IS_SUB_SP (w)) + { + /* Subtracting a value from the sp, so were in a function + which needs stack space for locals, but has no fp. We fake up + the values as if we had an fp */ + regs->regs[FP_REGNUM] = sp; + } + else + { + /* This one didn't have an fp, we'll fake it up */ + regs->regs[SP_REGNUM] = sp; + } + /* stack pointer contains address of next frame */ + /* regs->regs[fp_regnum()] = fp;*/ + regs->regs[SP_REGNUM] = sp; + return pc; +} + +CORE_ADDR +z8k_skip_prologue (start_pc) + CORE_ADDR start_pc; +{ + struct frame_saved_regs dummy; + + return examine_frame (start_pc, &dummy, 0); +} + +CORE_ADDR +addr_bits_remove (x) + CORE_ADDR x; +{ + return x & PTR_MASK; +} + +int +read_memory_pointer (x) + CORE_ADDR x; +{ + return read_memory_integer (ADDR_BITS_REMOVE (x), BIG ? 4 : 2); +} + +CORE_ADDR +frame_chain (thisframe) + struct frame_info *thisframe; +{ + if (thisframe->prev == 0) + { + /* This is the top of the stack, let's get the sp for real */ + } + if (!inside_entry_file (thisframe->pc)) + { + return read_memory_pointer (thisframe->frame); + } + return 0; +} + +init_frame_pc () +{ + abort (); +} + +/* Put here the code to store, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. */ + +void +get_frame_saved_regs (frame_info, frame_saved_regs) + struct frame_info *frame_info; + struct frame_saved_regs *frame_saved_regs; + +{ + CORE_ADDR pc; + int w; + + memset (frame_saved_regs, '\0', sizeof (*frame_saved_regs)); + pc = get_pc_function_start (frame_info->pc); + +/* wander down the instruction stream */ + examine_frame (pc, frame_saved_regs, frame_info->frame); + +} + +void +z8k_push_dummy_frame () +{ + abort (); +} + +int +gdb_print_insn_z8k (memaddr, info) + bfd_vma memaddr; + disassemble_info *info; +{ + if (BIG) + return print_insn_z8001 (memaddr, info); + else + return print_insn_z8002 (memaddr, info); +} + +/* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or + is not the address of a valid instruction, the address of the next + instruction beyond ADDR otherwise. *PWORD1 receives the first word + of the instruction.*/ + +CORE_ADDR +NEXT_PROLOGUE_INSN (addr, lim, pword1) + CORE_ADDR addr; + CORE_ADDR lim; + short *pword1; +{ + char buf[2]; + if (addr < lim + 8) + { + read_memory (addr, buf, 2); + *pword1 = extract_signed_integer (buf, 2); + + return addr + 2; + } + return 0; +} + +/* Put here the code to store, into a struct frame_saved_regs, + the addresses of the saved registers of frame described by FRAME_INFO. + This includes special registers such as pc and fp saved in special + ways in the stack frame. sp is even more special: + the address we return for it IS the sp for the next frame. + + We cache the result of doing this in the frame_cache_obstack, since + it is fairly expensive. */ + +void +frame_find_saved_regs (fip, fsrp) + struct frame_info *fip; + struct frame_saved_regs *fsrp; +{ + int locals; + CORE_ADDR pc; + CORE_ADDR adr; + int i; + + memset (fsrp, 0, sizeof *fsrp); + + pc = skip_adjust (get_pc_function_start (fip->pc), &locals); + + { + adr = FRAME_FP (fip) - locals; + for (i = 0; i < 8; i++) + { + int word = read_memory_short (pc); + + pc += 2; + if (IS_PUSHL (word)) + { + fsrp->regs[word & 0xf] = adr; + fsrp->regs[(word & 0xf) + 1] = adr - 2; + adr -= 4; + } + else if (IS_PUSHW (word)) + { + fsrp->regs[word & 0xf] = adr; + adr -= 2; + } + else + break; + } + + } + + fsrp->regs[PC_REGNUM] = fip->frame + 4; + fsrp->regs[FP_REGNUM] = fip->frame; + +} + +int +saved_pc_after_call () +{ + return addr_bits_remove + (read_memory_integer (read_register (SP_REGNUM), PTR_SIZE)); +} + + +extract_return_value (type, regbuf, valbuf) + struct type *type; + char *regbuf; + char *valbuf; +{ + int b; + int len = TYPE_LENGTH (type); + + for (b = 0; b < len; b += 2) + { + int todo = len - b; + + if (todo > 2) + todo = 2; + memcpy (valbuf + b, regbuf + b, todo); + } +} + +void +write_return_value (type, valbuf) + struct type *type; + char *valbuf; +{ + int reg; + int len; + + for (len = 0; len < TYPE_LENGTH (type); len += 2) + write_register_bytes (REGISTER_BYTE (len / 2 + 2), valbuf + len, 2); +} + +void +store_struct_return (addr, sp) + CORE_ADDR addr; + CORE_ADDR sp; +{ + write_register (2, addr); +} + + +void +print_register_hook (regno) + int regno; +{ + if ((regno & 1) == 0 && regno < 16) + { + unsigned short l[2]; + + read_relative_register_raw_bytes (regno, (char *) (l + 0)); + read_relative_register_raw_bytes (regno + 1, (char *) (l + 1)); + printf_unfiltered ("\t"); + printf_unfiltered ("%04x%04x", l[0], l[1]); + } + + if ((regno & 3) == 0 && regno < 16) + { + unsigned short l[4]; + + read_relative_register_raw_bytes (regno, (char *) (l + 0)); + read_relative_register_raw_bytes (regno + 1, (char *) (l + 1)); + read_relative_register_raw_bytes (regno + 2, (char *) (l + 2)); + read_relative_register_raw_bytes (regno + 3, (char *) (l + 3)); + + printf_unfiltered ("\t"); + printf_unfiltered ("%04x%04x%04x%04x", l[0], l[1], l[2], l[3]); + } + if (regno == 15) + { + unsigned short rval; + int i; + + read_relative_register_raw_bytes (regno, (char *) (&rval)); + + printf_unfiltered ("\n"); + for (i = 0; i < 10; i += 2) + { + printf_unfiltered ("(sp+%d=%04x)", i, read_memory_short (rval + i)); + } + } + +} + +void +z8k_pop_frame () +{ +} + +struct cmd_list_element *setmemorylist; + +void +z8k_set_pointer_size (newsize) + int newsize; +{ + static int oldsize = 0; + + if (oldsize != newsize) + { + printf_unfiltered ("pointer size set to %d bits\n", newsize); + oldsize = newsize; + if (newsize == 32) + { + BIG = 1; + } + else + { + BIG = 0; + } + _initialize_gdbtypes (); + } +} + +static void +segmented_command (args, from_tty) + char *args; + int from_tty; +{ + z8k_set_pointer_size (32); +} + +static void +unsegmented_command (args, from_tty) + char *args; + int from_tty; +{ + z8k_set_pointer_size (16); +} + +static void +set_memory (args, from_tty) + char *args; + int from_tty; +{ + printf_unfiltered ("\"set memory\" must be followed by the name of a memory subcommand.\n"); + help_list (setmemorylist, "set memory ", -1, gdb_stdout); +} + +void +_initialize_z8ktdep () +{ + tm_print_insn = gdb_print_insn_z8k; + + add_prefix_cmd ("memory", no_class, set_memory, + "set the memory model", &setmemorylist, "set memory ", 0, + &setlist); + add_cmd ("segmented", class_support, segmented_command, + "Set segmented memory model.", &setmemorylist); + add_cmd ("unsegmented", class_support, unsegmented_command, + "Set unsegmented memory model.", &setmemorylist); + +} diff --git a/contrib/libgmp/configure b/contrib/libgmp/configure index 1554506225e15..5737ec51102d9 100755 --- a/contrib/libgmp/configure +++ b/contrib/libgmp/configure @@ -80,7 +80,7 @@ subdirs= target_alias=NOTARGET target_makefile_frag= undefs=NOUNDEFS -version="$Revision: 1.218 (modified for gmp) $" +version="$Revision: 1.1.1.1 $" x11=default ### we might need to use some other shell than /bin/sh for running subshells diff --git a/contrib/libgmp/texinfo.tex b/contrib/libgmp/texinfo.tex index 1536ac3f08455..ada46cd941686 100644 --- a/contrib/libgmp/texinfo.tex +++ b/contrib/libgmp/texinfo.tex @@ -35,7 +35,7 @@ % This automatically updates the version number based on RCS. \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} -\deftexinfoversion$Revision: 2.172 $ +\deftexinfoversion$Revision: 1.1.1.1 $ \message{Loading texinfo package [Version \texinfoversion]:} % If in a .fmt file, print the version number diff --git a/contrib/libpcap/nlpid.h b/contrib/libpcap/nlpid.h index c033da224fd1f..047f292b8e9ac 100644 --- a/contrib/libpcap/nlpid.h +++ b/contrib/libpcap/nlpid.h @@ -15,7 +15,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header$ (Juniper) + * @(#) $Header: /home/ncvs/src/contrib/libpcap/nlpid.h,v 1.1 1996/08/21 20:01:07 pst Exp $ (Juniper) */ /* Types missing from some systems */ diff --git a/contrib/tcl/doc/FindExec.3 b/contrib/tcl/doc/FindExec.3 index be6e1f3cc3a0e..8cd6fc3889d4e 100644 --- a/contrib/tcl/doc/FindExec.3 +++ b/contrib/tcl/doc/FindExec.3 @@ -5,7 +5,7 @@ '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" SCCS: @(#) FindExec.3 1.3 96/03/25 20:03:17 -'\" $Id$ +'\" $Id: FindExec.3,v 1.2 1996/10/05 22:26:07 wosch Exp $ '\" .so man.macros .TH Tcl_FindExecutable 3 7.5 Tcl "Tcl Library Procedures" diff --git a/contrib/tcl/doc/break.n b/contrib/tcl/doc/break.n index a1640a862b44a..6d64fb72b3580 100644 --- a/contrib/tcl/doc/break.n +++ b/contrib/tcl/doc/break.n @@ -6,7 +6,7 @@ '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" SCCS: @(#) break.n 1.6 96/03/25 20:10:27 -'\" $Id$ +'\" $Id: break.n,v 1.2 1996/10/05 22:26:08 wosch Exp $ '\" .so man.macros .TH break n "" Tcl "Tcl Built-In Commands" diff --git a/contrib/tcl/doc/continue.n b/contrib/tcl/doc/continue.n index b5dc7af2cc2ac..0bb71bca519b9 100644 --- a/contrib/tcl/doc/continue.n +++ b/contrib/tcl/doc/continue.n @@ -6,7 +6,7 @@ '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" SCCS: @(#) continue.n 1.6 96/03/25 20:12:09 -'\" $Id$ +'\" $Id: continue.n,v 1.2 1996/10/05 22:26:09 wosch Exp $ '\" .so man.macros .TH continue n "" Tcl "Tcl Built-In Commands" diff --git a/contrib/tcl/doc/expr.n b/contrib/tcl/doc/expr.n index 9b7b60fadf6f7..94a6e9f7b3bfb 100644 --- a/contrib/tcl/doc/expr.n +++ b/contrib/tcl/doc/expr.n @@ -6,7 +6,7 @@ '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" SCCS: @(#) expr.n 1.17 96/03/14 10:54:40 -'\" $Id$ +'\" $Id: expr.n,v 1.2 1996/10/05 22:26:10 wosch Exp $ '\" .so man.macros .TH expr n 7.4 Tcl "Tcl Built-In Commands" diff --git a/contrib/tcl/doc/unknown.n b/contrib/tcl/doc/unknown.n index 2f4ba74c7dbad..d96e7ba99df32 100644 --- a/contrib/tcl/doc/unknown.n +++ b/contrib/tcl/doc/unknown.n @@ -6,7 +6,7 @@ '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" SCCS: @(#) unknown.n 1.7 96/03/25 20:26:05 -'\" $Id$ +'\" $Id: unknown.n,v 1.2 1996/10/05 22:26:11 wosch Exp $ '\" .so man.macros .TH unknown n "" Tcl "Tcl Built-In Commands" diff --git a/contrib/traceroute/CHANGES b/contrib/traceroute/CHANGES index b825594077fbb..1652a9c4c96a6 100644 --- a/contrib/traceroute/CHANGES +++ b/contrib/traceroute/CHANGES @@ -1,4 +1,4 @@ -@(#) $Header: CHANGES,v 1.12 96/09/28 18:24:35 leres Exp $ (LBL) +@(#) $Header: /home/ncvs/src/contrib/traceroute/CHANGES,v 1.1.1.1 1996/09/30 19:09:53 fenner Exp $ (LBL) v1.3.2 Thu Sep 26 18:06:16 PDT 1996 diff --git a/contrib/traceroute/INSTALL b/contrib/traceroute/INSTALL index 6f1be4fe9aa0e..6dc514cfb8ba3 100644 --- a/contrib/traceroute/INSTALL +++ b/contrib/traceroute/INSTALL @@ -1,4 +1,4 @@ -@(#) $Header: INSTALL,v 1.7 96/09/18 21:09:56 leres Exp $ (LBL) +@(#) $Header: /home/ncvs/src/contrib/traceroute/INSTALL,v 1.1.1.1 1996/09/30 19:09:53 fenner Exp $ (LBL) Traceroute is known to build and run under SunOS 4.1.4 and Solaris 5.4. If you are running a really old kernel, see the instructions under the diff --git a/contrib/traceroute/Makefile.in b/contrib/traceroute/Makefile.in index 3320abfb0f6c0..d312bc11c4073 100644 --- a/contrib/traceroute/Makefile.in +++ b/contrib/traceroute/Makefile.in @@ -17,7 +17,7 @@ # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # -# @(#) $Header: Makefile.in,v 1.21 96/09/16 18:49:46 leres Exp $ (LBL) +# @(#) $Header: /home/ncvs/src/contrib/traceroute/Makefile.in,v 1.1.1.1 1996/09/30 19:09:53 fenner Exp $ (LBL) # # Various configurable paths (remember to edit Makefile.in, not Makefile) diff --git a/contrib/traceroute/README b/contrib/traceroute/README index fa789ed52b430..ac9f55f4302dc 100644 --- a/contrib/traceroute/README +++ b/contrib/traceroute/README @@ -1,4 +1,4 @@ -@(#) $Header: README,v 1.7 96/07/06 02:08:32 leres Exp $ (LBL) +@(#) $Header: /home/ncvs/src/contrib/traceroute/README,v 1.1.1.1 1996/09/30 19:09:53 fenner Exp $ (LBL) TRACEROUTE 1.3 Lawrence Berkeley National Laboratory diff --git a/contrib/traceroute/acsite.m4 b/contrib/traceroute/acsite.m4 index 19dca475ce3da..07f6dd1cefb32 100644 --- a/contrib/traceroute/acsite.m4 +++ b/contrib/traceroute/acsite.m4 @@ -1,4 +1,4 @@ -dnl @(#) $Header: acsite.m4,v 1.38 96/09/26 21:18:41 leres Exp $ (LBL) +dnl @(#) $Header: /home/ncvs/src/contrib/traceroute/acsite.m4,v 1.1.1.1 1996/09/30 19:09:53 fenner Exp $ (LBL) dnl dnl Copyright (c) 1995, 1996 dnl The Regents of the University of California. All rights reserved. diff --git a/contrib/traceroute/configure.in b/contrib/traceroute/configure.in index 5561baa3e78cf..e4a0776f91354 100644 --- a/contrib/traceroute/configure.in +++ b/contrib/traceroute/configure.in @@ -1,4 +1,4 @@ -dnl @(#) $Header: configure.in,v 1.10 96/09/24 18:44:24 leres Exp $ (LBL) +dnl @(#) $Header: /home/ncvs/src/contrib/traceroute/configure.in,v 1.1.1.1 1996/09/30 19:09:54 fenner Exp $ (LBL) dnl dnl Copyright (c) 1995, 1996 dnl The Regents of the University of California. All rights reserved. diff --git a/contrib/traceroute/lbl/gnuc.h b/contrib/traceroute/lbl/gnuc.h index 9a3200c83632a..3761c44dd8d93 100644 --- a/contrib/traceroute/lbl/gnuc.h +++ b/contrib/traceroute/lbl/gnuc.h @@ -1,4 +1,4 @@ -/* @(#) $Header: gnuc.h,v 1.3 95/10/09 02:47:01 leres Exp $ (LBL) */ +/* @(#) $Header: /home/ncvs/src/contrib/traceroute/lbl/gnuc.h,v 1.1.1.1 1996/09/30 19:09:55 fenner Exp $ (LBL) */ /* Define __P() macro, if necessary */ #ifndef __P diff --git a/contrib/traceroute/lbl/os-solaris2.h b/contrib/traceroute/lbl/os-solaris2.h index fb13516038fe3..54d24334c907d 100644 --- a/contrib/traceroute/lbl/os-solaris2.h +++ b/contrib/traceroute/lbl/os-solaris2.h @@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: os-solaris2.h,v 1.16 96/07/05 22:11:23 leres Locked $ (LBL) + * @(#) $Header: /home/ncvs/src/contrib/traceroute/lbl/os-solaris2.h,v 1.1.1.1 1996/09/30 19:09:55 fenner Exp $ (LBL) */ /* Signal routines are this type */ diff --git a/contrib/traceroute/lbl/os-sunos4.h b/contrib/traceroute/lbl/os-sunos4.h index 7733d9414ba1f..7ea9eac0db7c9 100644 --- a/contrib/traceroute/lbl/os-sunos4.h +++ b/contrib/traceroute/lbl/os-sunos4.h @@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: os-sunos4.h,v 1.31 96/06/24 02:39:07 leres Exp $ (LBL) + * @(#) $Header: /home/ncvs/src/contrib/traceroute/lbl/os-sunos4.h,v 1.1.1.1 1996/09/30 19:09:55 fenner Exp $ (LBL) */ #define SIGRET void diff --git a/contrib/traceroute/traceroute.8 b/contrib/traceroute/traceroute.8 index fa3484e161d83..308252352c6c8 100644 --- a/contrib/traceroute/traceroute.8 +++ b/contrib/traceroute/traceroute.8 @@ -13,7 +13,7 @@ .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. .\" -.\" $Header: /home/ncvs/src/contrib/traceroute/traceroute.8,v 1.1.1.1 1996/09/30 19:09:55 fenner Exp $ +.\" $Header: /home/ncvs/src/contrib/traceroute/traceroute.8,v 1.2 1996/10/08 02:44:23 sef Exp $ .\" .TH TRACEROUTE 8 "27 September 1996" .UC 6 diff --git a/contrib/traceroute/traceroute.c b/contrib/traceroute/traceroute.c index ba870539a73c0..954eea9769504 100644 --- a/contrib/traceroute/traceroute.c +++ b/contrib/traceroute/traceroute.c @@ -24,7 +24,7 @@ static const char copyright[] = "@(#) Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996\n\ The Regents of the University of California. All rights reserved.\n"; static const char rcsid[] = - "@(#)$Header: /home/ncvs/src/contrib/traceroute/traceroute.c,v 1.4 1996/10/08 02:44:26 sef Exp $ (LBL)"; + "@(#)$Header: /home/ncvs/src/contrib/traceroute/traceroute.c,v 1.5 1996/10/08 19:16:24 sef Exp $ (LBL)"; #endif /* |