From: John Gilmore Date: Fri, 5 Apr 1991 09:02:10 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f2e006b77f217bbf4a4cb9299cf248058a44ed3;p=binutils-gdb.git *** empty log message *** --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 12ec9ccc2f8..8201aef4809 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,141 @@ +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 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 + 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: diff --git a/gdb/Makefile.dist b/gdb/Makefile.dist index 7b4e3ce9fa8..8c626fecce1 100755 --- a/gdb/Makefile.dist +++ b/gdb/Makefile.dist @@ -54,7 +54,7 @@ CC-LD=${CC} # system malloc, uncomment the following two lines. #GNU_MALLOC = #MALLOC_CFLAGS = -DNO_MALLOC_CHECK -GNU_MALLOC = gmalloc.o mcheck.o +GNU_MALLOC = gmalloc.o mcheck.o mtrace.o MALLOC_CFLAGS = # Where is the "include" directory? Traditionally ../include or ./include @@ -107,7 +107,7 @@ CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_DIR}/libbfd.a ADD_FILES = ${OBSTACK} ${REGEX} ${ALLOCA} ${GNU_MALLOC} ${GETOPT} ADD_DEPS = ${OBSTACK} ${REGEX1} ${ALLOCA1} ${GNU_MALLOC} ${GETOPT} -VERSION = 3.94.2 +VERSION = 3.94.3 DIST=gdb-$(VERSION) LINT=/usr/5bin/lint @@ -171,12 +171,13 @@ HFILES= breakpoint.h command.h defs.h environ.h \ value.h OPCODES = pn-opcode.h np1-opcode.h sparc-opcode.h vax-opcode.h m68k-opcode.h \ - ns32k-opcode.h convex-opcode.h pyr-opcode.h mips-opcode.h \ + ns32k-opcode.h convx-opcode.h pyr-opcode.h mips-opcode.h \ am29k-opcode.h -REMOTE_EXAMPLES = remote-sa.m68k.shar remote-multi.shar +REMOTE_EXAMPLES = rem-m68k.shar rem-multi.shar -MALLOCSRC = gmalloc.c mcheck.c ansidecl.h stdlib.h gmalloc.h stddef.h +MALLOCSRC = gmalloc.c mcheck.c mtrace.c mtrace.awk \ + ansidecl.h stdlib.h gmalloc.h stddef.h GETOPTSRC = $(GETOPT_DIR)/getopt.c $(GETOPT_DIR)/getopt1.c POSSLIBS_MAINDIR = obstack.h obstack.c regex.c regex.h alloca.c \ @@ -188,11 +189,11 @@ TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c # tdesc-lib cannot be named simply tdesc, because if if it were GNU make # would try to make it from tdesc.c. # tdesc-lib removed from the list due to Motorola copyrights...gnu@cygnus.com -OTHERS = Makefile.dist depend alldeps.mak Makefile.srcdir \ +OTHERS = Makefile.dist depend alldeps.mak Makefile.sdir \ createtags munch config.gdb config.status \ ChangeLog ChangeLog-3.x \ README TODO TAGS WHATS.NEW \ - gdb.texinfo gdb-int.texinfo gdbrc.tex threecol.tex \ + gdb.texinfo gdbint.texinfo gdbrc.tex threecol.tex \ .gdbinit COPYING expread.tab.c stab.def \ copying.c Projects Convex.notes copying.awk \ saber.suppress standalone.c stuff.c kdb-start.c \ @@ -276,7 +277,7 @@ rapp: $(RAPP_OBS) ${srcdir}/munch ${RAPP_OBS} > rapp_init.c ${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS) -Makefiles= Makefile.srcdir $(M_MAKEFILE) \ +Makefiles= Makefile.sdir $(M_MAKEFILE) \ ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist MAKE_MAKEFILE= echo "M_MAKEFILE=$(M_MAKEFILE)" | \ @@ -503,4 +504,4 @@ force_update : # When used with GDB, the demangler should never look for leading underscores # because GDB strips them off during symbol read-in. Thus -Dnounderscore. cplus-dem.o : cplus-dem.c - ${CC} -c -Dnounderscore `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'` + ${CC} -c ${CFLAGS} -Dnounderscore `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'` diff --git a/gdb/Projects b/gdb/Projects index b30d268ea62..fa0d86058f2 100644 --- a/gdb/Projects +++ b/gdb/Projects @@ -92,6 +92,10 @@ The child doesn't let any refs through, but when the child terminates, you are back to debugging the core file -- you might even want to swap back and forth between the two, or between two core files. +Add a command for searching memory, a la adb. It specifies size, +mask, value, start address. ADB searches until it finds it or hits +an error (or is interrupted). + # Local Variables: # mode: text # End: diff --git a/gdb/command.c b/gdb/command.c index 0b541a7cc63..dc9d5fc0ff7 100644 --- a/gdb/command.c +++ b/gdb/command.c @@ -1138,6 +1138,51 @@ make_command (arg, from_tty) shell_escape (p, from_tty); } +static void +user_info_1 (c, stream) + struct cmd_list_element *c; + FILE *stream; +{ + register struct command_line *cmdlines; + + cmdlines = c->user_commands; + if (!cmdlines) + return; + fprintf_filtered (stream, "User command %s:\n", c->name); + while (cmdlines) + { + fprintf_filtered (stream, "%s\n", cmdlines->line); + cmdlines = cmdlines->next; + } + fputs_filtered ("\n", stream); +} + +/* ARGSUSED */ +static void +user_info (args, from_tty) + char *args; + int from_tty; +{ + struct cmd_list_element *c; + extern struct cmd_list_element *cmdlist; + + if (args) + { + c = lookup_cmd (&args, cmdlist, "", 0, 1); + if (c->class != class_user) + error ("Not a user command."); + user_info_1 (c, stdout); + } + else + { + for (c = cmdlist; c; c = c->next) + { + if (c->class == class_user) + user_info_1 (c, stdout); + } + } +} + void _initialize_command () { @@ -1147,4 +1192,8 @@ With no arguments, run an inferior shell."); add_com ("make", class_support, make_command, "Run the ``make'' program using the rest of the line as arguments."); + + add_info ("user", user_info, "Show definitions of user defined commands.\n\ +Argument is the name of the user defined command.\n\ +With no argument, show definitions of all user defined commands."); } diff --git a/gdb/config.gdb b/gdb/config.gdb index 917d94e870d..17124824371 100755 --- a/gdb/config.gdb +++ b/gdb/config.gdb @@ -165,7 +165,7 @@ case ${srcdir} in .) ;; *) - echo "srcdir=${srcdir}" >./Makefile.srcdir + echo "srcdir=${srcdir}" >./Makefile.sdir grep -s "source ${srcdir}/.gdbinit" .gdbinit 2>/dev/null || \ echo "source ${srcdir}/.gdbinit" >> .gdbinit if [ ! -d readline ]; then diff --git a/gdb/convex-pinsn.c b/gdb/convex-pinsn.c index a283d294052..9c685a4a19a 100644 --- a/gdb/convex-pinsn.c +++ b/gdb/convex-pinsn.c @@ -73,7 +73,7 @@ struct formstr { unsigned i:5, j:5, k:2; /* operand formats */ }; -#include "convex-opcode.h" +#include "convx-opcode.h" unsigned char formdecode [] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, diff --git a/gdb/core.c b/gdb/core.c index 2936e46d5d2..119f7162f2f 100644 --- a/gdb/core.c +++ b/gdb/core.c @@ -155,10 +155,9 @@ core_detach (args, from_tty) char *args; int from_tty; { - dont_repeat (); if (args) error ("Too many arguments"); - pop_target (); + unpush_target (&core_ops); if (from_tty) printf ("No core file now.\n"); } @@ -170,6 +169,7 @@ core_file_command (filename, from_tty) char *filename; int from_tty; { + dont_repeat (); /* Either way, seems bogus. */ if (!filename) core_detach (filename, from_tty); else diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 37f456bc74d..4a6a5408920 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -791,11 +791,14 @@ really_free_pendings (foo) next1 = next->next; free (next); } + file_symbols = 0; + for (next = global_symbols; next; next = next1) { next1 = next->next; free (next); } + global_symbols = 0; } /* Take one of the lists of symbols and make a block from it. @@ -1709,7 +1712,7 @@ read_dbx_symtab (symfile_name, addr, #ifdef END_OF_TEXT_DEFAULT end_of_text_addr = END_OF_TEXT_DEFAULT; #else - end_of_text_addr = addr + text_size; + end_of_text_addr = text_addr + text_size; #endif symtab_input_desc = desc; /* This is needed for fill_symbuf below */ diff --git a/gdb/expread.tab.c b/gdb/expread.tab.c index 86fbd0f5a3e..e10aca0a477 100755 --- a/gdb/expread.tab.c +++ b/gdb/expread.tab.c @@ -1,5 +1,5 @@ -/* A Bison parser, made from ../expread.y */ +/* A Bison parser, made from expread.y */ #define INT 258 #define CHAR 259 @@ -41,7 +41,7 @@ #define DECREMENT 295 #define ARROW 296 -#line 29 "../expread.y" +#line 29 "expread.y" #include #include "defs.h" @@ -133,7 +133,7 @@ static enum type_pieces pop_type (); /* Allow debugging of parsing. */ #define YYDEBUG 1 -#line 125 "../expread.y" +#line 125 "expread.y" typedef union { LONGEST lval; @@ -228,7 +228,7 @@ static const short yyrline[] = { 0, 767, 768, 770, 772, 775, 782, 784, 786, 788, 790, 792, 794, 796, 798, 801, 804, 807, 809, 811, 813, 817, 818, 824, 830, 839, 844, 851, 852, 853, 854, - 855, 858, 859, 860, 861 + 855, 858, 859 }; static const char * const yytname[] = { 0, @@ -253,7 +253,7 @@ static const short yyr1[] = { 0, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, 81, 81, 82, 82, 82, 82, - 82, 83, 83, 83, 83 + 82, 83, 83 }; static const short yyr2[] = { 0, @@ -268,7 +268,7 @@ static const short yyr2[] = { 0, 1, 3, 6, 8, 9, 1, 1, 1, 1, 2, 3, 2, 3, 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 1 + 1, 1, 1 }; static const short yydefact[] = { 0, @@ -778,199 +778,199 @@ yyreduce: switch (yyn) { case 3: -#line 224 "../expread.y" +#line 224 "expread.y" { write_exp_elt_opcode (BINOP_COMMA); ; break;} case 4: -#line 229 "../expread.y" +#line 229 "expread.y" { write_exp_elt_opcode (UNOP_IND); ; break;} case 5: -#line 232 "../expread.y" +#line 232 "expread.y" { write_exp_elt_opcode (UNOP_ADDR); ; break;} case 6: -#line 235 "../expread.y" +#line 235 "expread.y" { write_exp_elt_opcode (UNOP_NEG); ; break;} case 7: -#line 239 "../expread.y" +#line 239 "expread.y" { write_exp_elt_opcode (UNOP_ZEROP); ; break;} case 8: -#line 243 "../expread.y" +#line 243 "expread.y" { write_exp_elt_opcode (UNOP_LOGNOT); ; break;} case 9: -#line 247 "../expread.y" +#line 247 "expread.y" { write_exp_elt_opcode (UNOP_PREINCREMENT); ; break;} case 10: -#line 251 "../expread.y" +#line 251 "expread.y" { write_exp_elt_opcode (UNOP_PREDECREMENT); ; break;} case 11: -#line 255 "../expread.y" +#line 255 "expread.y" { write_exp_elt_opcode (UNOP_POSTINCREMENT); ; break;} case 12: -#line 259 "../expread.y" +#line 259 "expread.y" { write_exp_elt_opcode (UNOP_POSTDECREMENT); ; break;} case 13: -#line 263 "../expread.y" +#line 263 "expread.y" { write_exp_elt_opcode (UNOP_SIZEOF); ; break;} case 14: -#line 267 "../expread.y" +#line 267 "expread.y" { write_exp_elt_opcode (STRUCTOP_PTR); write_exp_string (yyvsp[0].sval); write_exp_elt_opcode (STRUCTOP_PTR); ; break;} case 15: -#line 273 "../expread.y" +#line 273 "expread.y" { write_exp_elt_opcode (STRUCTOP_MPTR); ; break;} case 16: -#line 277 "../expread.y" +#line 277 "expread.y" { write_exp_elt_opcode (STRUCTOP_STRUCT); write_exp_string (yyvsp[0].sval); write_exp_elt_opcode (STRUCTOP_STRUCT); ; break;} case 17: -#line 283 "../expread.y" +#line 283 "expread.y" { write_exp_elt_opcode (STRUCTOP_MEMBER); ; break;} case 18: -#line 287 "../expread.y" +#line 287 "expread.y" { write_exp_elt_opcode (BINOP_SUBSCRIPT); ; break;} case 19: -#line 293 "../expread.y" +#line 293 "expread.y" { start_arglist (); ; break;} case 20: -#line 295 "../expread.y" +#line 295 "expread.y" { write_exp_elt_opcode (OP_FUNCALL); write_exp_elt_longcst ((LONGEST) end_arglist ()); write_exp_elt_opcode (OP_FUNCALL); ; break;} case 22: -#line 304 "../expread.y" +#line 304 "expread.y" { arglist_len = 1; ; break;} case 23: -#line 308 "../expread.y" +#line 308 "expread.y" { arglist_len++; ; break;} case 24: -#line 312 "../expread.y" +#line 312 "expread.y" { write_exp_elt_opcode (UNOP_MEMVAL); write_exp_elt_type (yyvsp[-2].tval); write_exp_elt_opcode (UNOP_MEMVAL); ; break;} case 25: -#line 318 "../expread.y" +#line 318 "expread.y" { write_exp_elt_opcode (UNOP_CAST); write_exp_elt_type (yyvsp[-2].tval); write_exp_elt_opcode (UNOP_CAST); ; break;} case 26: -#line 324 "../expread.y" +#line 324 "expread.y" { ; break;} case 27: -#line 330 "../expread.y" +#line 330 "expread.y" { write_exp_elt_opcode (BINOP_REPEAT); ; break;} case 28: -#line 334 "../expread.y" +#line 334 "expread.y" { write_exp_elt_opcode (BINOP_MUL); ; break;} case 29: -#line 338 "../expread.y" +#line 338 "expread.y" { write_exp_elt_opcode (BINOP_DIV); ; break;} case 30: -#line 342 "../expread.y" +#line 342 "expread.y" { write_exp_elt_opcode (BINOP_REM); ; break;} case 31: -#line 346 "../expread.y" +#line 346 "expread.y" { write_exp_elt_opcode (BINOP_ADD); ; break;} case 32: -#line 350 "../expread.y" +#line 350 "expread.y" { write_exp_elt_opcode (BINOP_SUB); ; break;} case 33: -#line 354 "../expread.y" +#line 354 "expread.y" { write_exp_elt_opcode (BINOP_LSH); ; break;} case 34: -#line 358 "../expread.y" +#line 358 "expread.y" { write_exp_elt_opcode (BINOP_RSH); ; break;} case 35: -#line 362 "../expread.y" +#line 362 "expread.y" { write_exp_elt_opcode (BINOP_EQUAL); ; break;} case 36: -#line 366 "../expread.y" +#line 366 "expread.y" { write_exp_elt_opcode (BINOP_NOTEQUAL); ; break;} case 37: -#line 370 "../expread.y" +#line 370 "expread.y" { write_exp_elt_opcode (BINOP_LEQ); ; break;} case 38: -#line 374 "../expread.y" +#line 374 "expread.y" { write_exp_elt_opcode (BINOP_GEQ); ; break;} case 39: -#line 378 "../expread.y" +#line 378 "expread.y" { write_exp_elt_opcode (BINOP_LESS); ; break;} case 40: -#line 382 "../expread.y" +#line 382 "expread.y" { write_exp_elt_opcode (BINOP_GTR); ; break;} case 41: -#line 386 "../expread.y" +#line 386 "expread.y" { write_exp_elt_opcode (BINOP_LOGAND); ; break;} case 42: -#line 390 "../expread.y" +#line 390 "expread.y" { write_exp_elt_opcode (BINOP_LOGXOR); ; break;} case 43: -#line 394 "../expread.y" +#line 394 "expread.y" { write_exp_elt_opcode (BINOP_LOGIOR); ; break;} case 44: -#line 398 "../expread.y" +#line 398 "expread.y" { write_exp_elt_opcode (BINOP_AND); ; break;} case 45: -#line 402 "../expread.y" +#line 402 "expread.y" { write_exp_elt_opcode (BINOP_OR); ; break;} case 46: -#line 406 "../expread.y" +#line 406 "expread.y" { write_exp_elt_opcode (TERNOP_COND); ; break;} case 47: -#line 410 "../expread.y" +#line 410 "expread.y" { write_exp_elt_opcode (BINOP_ASSIGN); ; break;} case 48: -#line 414 "../expread.y" +#line 414 "expread.y" { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); write_exp_elt_opcode (yyvsp[-1].opcode); write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); ; break;} case 49: -#line 420 "../expread.y" +#line 420 "expread.y" { write_exp_elt_opcode (OP_LONG); if (yyvsp[0].lval == (int) yyvsp[0].lval || yyvsp[0].lval == (unsigned int) yyvsp[0].lval) write_exp_elt_type (builtin_type_int); @@ -980,7 +980,7 @@ case 49: write_exp_elt_opcode (OP_LONG); ; break;} case 50: -#line 430 "../expread.y" +#line 430 "expread.y" { YYSTYPE val; parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val); write_exp_elt_opcode (OP_LONG); @@ -993,7 +993,7 @@ case 50: write_exp_elt_opcode (OP_LONG); ; break;} case 51: -#line 443 "../expread.y" +#line 443 "expread.y" { write_exp_elt_opcode (OP_LONG); if (yyvsp[0].ulval == (unsigned int) yyvsp[0].ulval) @@ -1005,7 +1005,7 @@ case 51: ; break;} case 52: -#line 455 "../expread.y" +#line 455 "expread.y" { YYSTYPE val; parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val); write_exp_elt_opcode (OP_LONG); @@ -1018,57 +1018,57 @@ case 52: ; break;} case 53: -#line 468 "../expread.y" +#line 468 "expread.y" { write_exp_elt_opcode (OP_LONG); write_exp_elt_type (builtin_type_char); write_exp_elt_longcst ((LONGEST) yyvsp[0].lval); write_exp_elt_opcode (OP_LONG); ; break;} case 54: -#line 475 "../expread.y" +#line 475 "expread.y" { write_exp_elt_opcode (OP_DOUBLE); write_exp_elt_type (builtin_type_double); write_exp_elt_dblcst (yyvsp[0].dval); write_exp_elt_opcode (OP_DOUBLE); ; break;} case 56: -#line 485 "../expread.y" +#line 485 "expread.y" { write_exp_elt_opcode (OP_LAST); write_exp_elt_longcst ((LONGEST) yyvsp[0].lval); write_exp_elt_opcode (OP_LAST); ; break;} case 57: -#line 491 "../expread.y" +#line 491 "expread.y" { write_exp_elt_opcode (OP_REGISTER); write_exp_elt_longcst ((LONGEST) yyvsp[0].lval); write_exp_elt_opcode (OP_REGISTER); ; break;} case 58: -#line 497 "../expread.y" +#line 497 "expread.y" { write_exp_elt_opcode (OP_INTERNALVAR); write_exp_elt_intern (yyvsp[0].ivar); write_exp_elt_opcode (OP_INTERNALVAR); ; break;} case 59: -#line 503 "../expread.y" +#line 503 "expread.y" { write_exp_elt_opcode (OP_LONG); write_exp_elt_type (builtin_type_int); write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval)); write_exp_elt_opcode (OP_LONG); ; break;} case 60: -#line 510 "../expread.y" +#line 510 "expread.y" { write_exp_elt_opcode (OP_STRING); write_exp_string (yyvsp[0].sval); write_exp_elt_opcode (OP_STRING); ; break;} case 61: -#line 517 "../expread.y" +#line 517 "expread.y" { write_exp_elt_opcode (OP_THIS); write_exp_elt_opcode (OP_THIS); ; break;} case 62: -#line 524 "../expread.y" +#line 524 "expread.y" { if (yyvsp[0].ssym.sym != 0) yyval.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym); @@ -1085,7 +1085,7 @@ case 62: ; break;} case 63: -#line 541 "../expread.y" +#line 541 "expread.y" { struct symbol *tem = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval, VAR_NAMESPACE, 0, NULL); @@ -1095,7 +1095,7 @@ case 63: yyval.bval = SYMBOL_BLOCK_VALUE (tem); ; break;} case 64: -#line 551 "../expread.y" +#line 551 "expread.y" { struct symbol *sym; sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval, VAR_NAMESPACE, 0, NULL); @@ -1107,7 +1107,7 @@ case 64: write_exp_elt_opcode (OP_VAR_VALUE); ; break;} case 65: -#line 563 "../expread.y" +#line 563 "expread.y" { struct type *type = yyvsp[-2].tval; if (TYPE_CODE (type) != TYPE_CODE_STRUCT @@ -1122,7 +1122,7 @@ case 65: ; break;} case 66: -#line 576 "../expread.y" +#line 576 "expread.y" { char *name = copy_name (yyvsp[0].sval); struct symbol *sym; @@ -1168,7 +1168,7 @@ case 66: ; break;} case 67: -#line 622 "../expread.y" +#line 622 "expread.y" { struct symbol *sym = yyvsp[0].ssym.sym; if (sym) @@ -1241,7 +1241,7 @@ case 67: ; break;} case 69: -#line 697 "../expread.y" +#line 697 "expread.y" { /* This is where the interesting stuff happens. */ int done = 0; @@ -1276,26 +1276,26 @@ case 69: ; break;} case 70: -#line 732 "../expread.y" +#line 732 "expread.y" { push_type (tp_pointer); yyval.voidval = 0; ; break;} case 71: -#line 734 "../expread.y" +#line 734 "expread.y" { push_type (tp_pointer); yyval.voidval = yyvsp[0].voidval; ; break;} case 73: -#line 739 "../expread.y" +#line 739 "expread.y" { yyval.voidval = yyvsp[-1].voidval; ; break;} case 74: -#line 741 "../expread.y" +#line 741 "expread.y" { push_type ((enum type_pieces) yyvsp[0].lval); push_type (tp_array); ; break;} case 75: -#line 746 "../expread.y" +#line 746 "expread.y" { push_type ((enum type_pieces) yyvsp[0].lval); push_type (tp_array); @@ -1303,109 +1303,109 @@ case 75: ; break;} case 76: -#line 752 "../expread.y" +#line 752 "expread.y" { push_type (tp_function); ; break;} case 77: -#line 754 "../expread.y" +#line 754 "expread.y" { push_type (tp_function); ; break;} case 78: -#line 758 "../expread.y" +#line 758 "expread.y" { yyval.lval = -1; ; break;} case 79: -#line 760 "../expread.y" +#line 760 "expread.y" { yyval.lval = yyvsp[-1].lval; ; break;} case 80: -#line 764 "../expread.y" +#line 764 "expread.y" { yyval.voidval = 0; ; break;} case 82: -#line 769 "../expread.y" +#line 769 "expread.y" { yyval.tval = lookup_member_type (builtin_type_int, yyvsp[-2].tval); ; break;} case 83: -#line 771 "../expread.y" +#line 771 "expread.y" { yyval.tval = lookup_member_type (yyvsp[-5].tval, yyvsp[-3].tval); ; break;} case 84: -#line 773 "../expread.y" +#line 773 "expread.y" { yyval.tval = lookup_member_type (lookup_function_type (yyvsp[-7].tval), yyvsp[-5].tval); ; break;} case 85: -#line 776 "../expread.y" +#line 776 "expread.y" { yyval.tval = lookup_member_type (lookup_function_type (yyvsp[-8].tval), yyvsp[-6].tval); free (yyvsp[-1].tvec); ; break;} case 86: -#line 783 "../expread.y" +#line 783 "expread.y" { yyval.tval = yyvsp[0].tsym.type; ; break;} case 87: -#line 785 "../expread.y" +#line 785 "expread.y" { yyval.tval = builtin_type_int; ; break;} case 88: -#line 787 "../expread.y" +#line 787 "expread.y" { yyval.tval = builtin_type_long; ; break;} case 89: -#line 789 "../expread.y" +#line 789 "expread.y" { yyval.tval = builtin_type_short; ; break;} case 90: -#line 791 "../expread.y" +#line 791 "expread.y" { yyval.tval = builtin_type_long; ; break;} case 91: -#line 793 "../expread.y" +#line 793 "expread.y" { yyval.tval = builtin_type_unsigned_long; ; break;} case 92: -#line 795 "../expread.y" +#line 795 "expread.y" { yyval.tval = builtin_type_short; ; break;} case 93: -#line 797 "../expread.y" +#line 797 "expread.y" { yyval.tval = builtin_type_unsigned_short; ; break;} case 94: -#line 799 "../expread.y" +#line 799 "expread.y" { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval), expression_context_block); ; break;} case 95: -#line 802 "../expread.y" +#line 802 "expread.y" { yyval.tval = lookup_union (copy_name (yyvsp[0].sval), expression_context_block); ; break;} case 96: -#line 805 "../expread.y" +#line 805 "expread.y" { yyval.tval = lookup_enum (copy_name (yyvsp[0].sval), expression_context_block); ; break;} case 97: -#line 808 "../expread.y" +#line 808 "expread.y" { yyval.tval = lookup_unsigned_typename (TYPE_NAME(yyvsp[0].tsym.type)); ; break;} case 98: -#line 810 "../expread.y" +#line 810 "expread.y" { yyval.tval = builtin_type_unsigned_int; ; break;} case 99: -#line 812 "../expread.y" +#line 812 "expread.y" { yyval.tval = yyvsp[0].tsym.type; ; break;} case 100: -#line 814 "../expread.y" +#line 814 "expread.y" { yyval.tval = builtin_type_int; ; break;} case 102: -#line 819 "../expread.y" +#line 819 "expread.y" { yyval.tsym.stoken.ptr = "int"; yyval.tsym.stoken.length = 3; @@ -1413,7 +1413,7 @@ case 102: ; break;} case 103: -#line 825 "../expread.y" +#line 825 "expread.y" { yyval.tsym.stoken.ptr = "long"; yyval.tsym.stoken.length = 4; @@ -1421,7 +1421,7 @@ case 103: ; break;} case 104: -#line 831 "../expread.y" +#line 831 "expread.y" { yyval.tsym.stoken.ptr = "short"; yyval.tsym.stoken.length = 5; @@ -1429,37 +1429,37 @@ case 104: ; break;} case 105: -#line 840 "../expread.y" +#line 840 "expread.y" { yyval.tvec = (struct type **)xmalloc (sizeof (struct type *) * 2); yyval.tvec[0] = (struct type *)0; yyval.tvec[1] = yyvsp[0].tval; ; break;} case 106: -#line 845 "../expread.y" +#line 845 "expread.y" { int len = sizeof (struct type *) * ++(yyvsp[-2].ivec[0]); yyval.tvec = (struct type **)xrealloc (yyvsp[-2].tvec, len); yyval.tvec[yyval.ivec[0]] = yyvsp[0].tval; ; break;} case 107: -#line 851 "../expread.y" +#line 851 "expread.y" { yyval.sval = yyvsp[0].ssym.stoken; ; break;} case 108: -#line 852 "../expread.y" +#line 852 "expread.y" { yyval.sval = yyvsp[0].ssym.stoken; ; break;} case 109: -#line 853 "../expread.y" +#line 853 "expread.y" { yyval.sval = yyvsp[0].tsym.stoken; ; break;} case 110: -#line 854 "../expread.y" +#line 854 "expread.y" { yyval.sval = yyvsp[0].ssym.stoken; ; break;} case 111: -#line 855 "../expread.y" +#line 855 "expread.y" { yyval.sval = yyvsp[0].ssym.stoken; ; break;} } @@ -1615,7 +1615,7 @@ yyerrhandle: yystate = yyn; goto yynewstate; } -#line 864 "../expread.y" +#line 870 "expread.y" /* Begin counting arguments for a function call, diff --git a/gdb/expread.y b/gdb/expread.y index 3b19750448d..acced91a60b 100755 --- a/gdb/expread.y +++ b/gdb/expread.y @@ -857,8 +857,14 @@ name : NAME { $$ = $1.stoken; } name_not_typename : NAME | BLOCKNAME - | NAME_OR_INT - | NAME_OR_UINT +/* These would be useful if name_not_typename was useful, but it is just + a fake for "variable", so these cause reduce/reduce conflicts because + the parser can't tell whether NAME_OR_INT is a name_not_typename (=variable, + =exp) or just an exp. If name_not_typename was ever used in an lvalue + context where only a name could occur, this might be useful. + | NAME_OR_INT + | NAME_OR_UINT + */ ; %% diff --git a/gdb/i386-pinsn.c b/gdb/i386-pinsn.c index 50cf14bd937..2b34a778728 100644 --- a/gdb/i386-pinsn.c +++ b/gdb/i386-pinsn.c @@ -1,5 +1,5 @@ /* Print i386 instructions for GDB, the GNU debugger. - Copyright (C) 1988, 1989 Free Software Foundation, Inc. + Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc. This file is part of GDB. @@ -34,6 +34,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include +/* For the GDB interface at the bottom of the file... */ +#include "defs.h" +#include "param.h" +#include "gdbcore.h" + #define Eb OP_E, b_mode #define indirEb OP_indirE, b_mode #define Gb OP_G, b_mode @@ -1812,14 +1817,6 @@ OP_rm (bytemode) } } -/* GDB interface */ -#include "defs.h" -#include "param.h" -#include "symtab.h" -#include "frame.h" -#include "inferior.h" -#include "gdbcore.h" - #define MAXLEN 20 print_insn (memaddr, stream) CORE_ADDR memaddr; diff --git a/gdb/ieee-float.c b/gdb/ieee-float.c index 7b7f9f1fd0f..4a2c04c8fc0 100644 --- a/gdb/ieee-float.c +++ b/gdb/ieee-float.c @@ -40,10 +40,17 @@ ieee_extended_to_double (ext_format, from, to) bcopy (&from[MANBYTE_L], &mant1, 4); exp = ((ufrom[EXPBYTE_H] & (unsigned char)~SIGNMASK) << 8) | ufrom[EXPBYTE_L]; +#if 0 + /* We can't do anything useful with a NaN anyway, so ignore its + difference. It will end up as Infinity or something close. */ if (exp == EXT_EXP_NAN) { /* We have a NaN source. */ - dto = 0.123456789; /* Not much else useful to do */ - } else if (exp == 0 && mant0 == 0 && mant1 == 0) { + dto = 0.123456789; /* Not much else useful to do -- we don't know if + the host system even *has* NaNs, nor how to + generate an innocuous one if it does. */ + } else +#endif + if (exp == 0 && mant0 == 0 && mant1 == 0) { dto = 0; } else { /* Build the result algebraically. Might go infinite, underflow, etc; @@ -51,6 +58,8 @@ ieee_extended_to_double (ext_format, from, to) mant0 |= 0x80000000; dto = ldexp ((double)mant0, exp - EXT_EXP_BIAS - 31); dto += ldexp ((double)mant1, exp - EXT_EXP_BIAS - 31 - 32); + if (ufrom[EXPBYTE_H] & SIGNMASK) /* If negative... */ + dto = -dto; /* ...negate. */ } *to = dto; } @@ -129,10 +138,10 @@ ieee_test (n) extern struct ext_format ext_format_68881; for (i = 0; i < n; i++) { - di.i[0] = random(); - di.i[1] = random(); - double_to_ieee_extended (ext_format_68881, &di.d, exten); - ieee_extended_to_double (ext_format_68881, exten, &result); + di.i[0] = (random() << 16) | (random() & 0xffff); + di.i[1] = (random() << 16) | (random() & 0xffff); + double_to_ieee_extended (&ext_format_68881, &di.d, exten); + ieee_extended_to_double (&ext_format_68881, exten, &result); if (di.d != result) printf ("Differ: %x %x %g => %x %x %g\n", di.d, di.d, result, result); } diff --git a/gdb/remote-nindy.c b/gdb/remote-nindy.c index 5724f423977..af19fd484f9 100644 --- a/gdb/remote-nindy.c +++ b/gdb/remote-nindy.c @@ -250,7 +250,6 @@ nindy_detach (name, from_tty) char *name; int from_tty; { - dont_repeat (); if (name) error ("Too many arguments"); pop_target (); diff --git a/gdb/signame.c b/gdb/signame.c index 740da408b8f..9a0c4ce989a 100755 --- a/gdb/signame.c +++ b/gdb/signame.c @@ -31,7 +31,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ static CONST char undoc[] = "unknown signal"; -CONST char *sys_siglist[NSIG]; +char *sys_siglist[NSIG]; #endif /* SYS_SIGLIST_MISSING */ /* Table of abbreviations for signals. Note: A given number can @@ -62,6 +62,8 @@ init_sig (number, abbrev, name) static void init_sigs () { #ifdef SYS_SIGLIST_MISSING + int i; + /* Initialize signal names. */ for (i = 0; i < NSIG; i++) sys_siglist[i] = undoc; diff --git a/gdb/tm-i386v.h b/gdb/tm-i386v.h index 59f89671fa9..4f35e3a9374 100644 --- a/gdb/tm-i386v.h +++ b/gdb/tm-i386v.h @@ -99,11 +99,16 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define INVALID_FLOAT(p, len) (0) +#if 0 /* code to execute to print interesting information about the - * floating point processor (if any) - * No need to define if there is nothing to do. + floating point processor (if any) + No need to define if there is nothing to do. + On the 386, unfortunately this code is host-dependent (and lives + in the i386-xdep.c file), so we can't + do this unless we *know* we aren't cross-debugging. FIXME. */ #define FLOAT_INFO { i386_float_info (); } +#endif 0 /* Say how long (ordinary) registers are. */ diff --git a/gdb/values.c b/gdb/values.c index 39ec8eab324..5d40882646d 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -1111,6 +1111,11 @@ unpack_field_as_long (type, valaddr, fieldno) return val; } +/* Modify the value of a bitfield. ADDR points to a block of memory in + target byte order; the bitfield starts in the byte pointed to. FIELDVAL + is the desired value of the field, in host byte order. BITPOS and BITSIZE + indicate which bits (in target bit order) comprise the bitfield. */ + void modify_field (addr, fieldval, bitpos, bitsize) char *addr; @@ -1125,14 +1130,17 @@ modify_field (addr, fieldval, bitpos, bitsize) error ("Value %d does not fit in %d bits.", fieldval, bitsize); bcopy (addr, &oword, sizeof oword); + SWAP_TARGET_AND_HOST (&oword, sizeof oword); /* To host format */ - /* Shifting for bit field depends on endianness of the machine. */ + /* Shifting for bit field depends on endianness of the target machine. */ #ifdef BITS_BIG_ENDIAN bitpos = sizeof (oword) * 8 - bitpos - bitsize; #endif oword &= ~(((1 << bitsize) - 1) << bitpos); oword |= fieldval << bitpos; + + SWAP_TARGET_AND_HOST (&oword, sizeof oword); /* To target format */ bcopy (&oword, addr, sizeof oword); }