home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-01-15 | 206.3 KB | 7,920 lines |
- *** 1.6 1991/10/05 20:59:54
- --- Changelo 1992/01/14 20:05:54
- ***************
- *** 98,100 ****
- --- 98,158 ----
-
- Makefile:: ++jrb
- add target for init.o. delete firstfile.* lastfile.* initialize.*
- +
- + m-atari.h:: ++jrb
- + had forgotten to revert back #def of FRAME_CHAIN, as a result some
- + frames were setup incorrectly.
- +
- + atarist.c:: andreas
- + (st_child_read_word, st_child_write_word): check for vaild address
- + within child memory.
- +
- + source.c:: andreas
- + (print_source_lines): allow last line of file to be printed.
- +
- + gnu-out.h:: ++jrb
- + sync it up with util/gnu-out.h
- +
- + dbxread.c:: ++jrb
- + get rid of the silly xxmalloc(), #define xxmalloc to xmalloc
- +
- + infcmd.c:: ++jrb
- + - dont allow set-args after inferior has started. insist that
- + args for inferior be specified either before issueing the initial
- + run command with a set-arg or in the in the initial run command.
- + - dont allow re-starting inferior.
- +
- + atarist.c:: ++jrb
- + dont allow inferior to be re-run ever. returns special pid == -9999
- + after issueing error. does'nt exit right away as the user may want to
- + examine stuff or issue other non-run commands before he actually quits
- + GDB.
- +
- + atarist.c, main.c:: ++jrb
- + more -D's give more debug info. also include version in debug.gdb
- +
- + dbxread.c:: ++jrb
- + - fix up bug in typevector allocation
- + - dont free pending blocks (per gdb 4.?)
- +
- + main.c, util.c:: ++jrb
- + save all vectors at startup, and restore them all back to the state
- + at entry before exit. exit, now happend via routine really_exit().
- +
- + dbxread.c:: ++jrb
- + - get rid of the silly symseg chain stuff that was cluttering up
- + the code.
- + - when reading pointer and func types dont do the smash_to_type
- + this fixes the typedefs type * and just ordinary type *'s getting
- + confused.
- +
- + symtab.c:: ++jrb
- + - delete smash_to_* fns.
- +
- + all over:: ++jrb
- + if '-L' option is specified, log all debugger output (append) to file
- + "gdb.log". Use this with EXTREME CAUTION: it works with tos 1.4,
- + but does'nt work with newer TOSs, and can potentially trash other
- + files on the disk. YOU HAVE BEEN WARNED!
- +
- + ------------------------------- Patchlevel 15 -----------------------------
- *** 1.6 1991/09/24 16:19:45
- --- PatchLev.h 1992/01/14 20:05:54
- ***************
- *** 1,4 ****
- ! #define PatchLevel "14"
-
- /*
- * the Patch Level above is to identify the version
- --- 1,4 ----
- ! #define PatchLevel "15"
-
- /*
- * the Patch Level above is to identify the version
- *** 1.5 1991/09/24 16:19:45
- --- README 1992/01/14 20:05:55
- ***************
- *** 1,3 ****
- --- 1,73 ----
- + GDB @ Patchlevel 15
- +
- + ================NOTE NOTE NOTE NOTE============================
- +
- + TOS 1.4 or better required unless you
- + recompile the source with -DOLDTOS
- +
- + ================NOTE NOTE NOTE NOTE============================
- +
- + *************************************************
- + Please get rid of gdb Patchlevel 14 or older
- + *************************************************
- +
- + yet another significant update to gdb-atariST. please take
- + a few moments to read over gdb.texinfo too (ie: dont expect
- + to find all the answers in this README file :-).
- +
- + - gdb now has a new option to log a gdb session. gdb -L will
- + log the session in the file gdb.log (append if the file already
- + exists). Use this option WITH EXTREME CAUTION. This only works
- + with TOS 1.4. I have a later version of TOS and it does not
- + work correctly with it, and it goes and adds stuff to random
- + files. I dont know if -L will work with the TOS in STe's or TT's.
- + you have been adequately warned.!!
- +
- + - gdb will NOT try to intut when it is trying to debug a -mshort
- + compiled program. The user must specify the "-mshort" option to
- + gdb.ttp if you are going to try and debug a -mshort compiled
- + application. the heauristic we were using earlier to intut -mshort
- + did not work very well, and caused many problems. So the sequence
- + for a typical -mshort compile/debug becomes:
- +
- + gcc -mshort -c -g foo.c bar.c
- + gcc -mshort -o foo foo.o bar.o
- + sym-ld -o foo.sym e:\lib\crt0.o foo.o bar.o -lgnu16
- + gdb -mshort -e foo -s foo.sym
- +
- + - gdb wont get confused when -mshort is used, and the arguements
- + to a function are displayed (on a breakpoint, backtrace etc).
- + the arguements were always being passed correctly, but were not
- + being displayed correcty.
- +
- + - gdb wont get confused by certain typedefs.
- +
- + - Frames fixed. up/down etc should work.
- +
- + - will not allow you to re-run inferior (even if the
- + inferior has exited). this is not possible to do under TOS.
- +
- + - NEEDS tos 1.4 or better and uses Pexec mode 6 to launch
- + inferior.
- +
- + - many people are confused about this: to pass command line
- + arguements to the program to be debugged you have to either
- + set-args args ...
- + BEFORE you issue the initial run command
- + or you can specify the args in the initial run command
- + run args ...
- + the run args... form is more convenient.
- +
- + - got rid of the initialization hacks, now all the init
- + functions are called from init.c (which in turn in called
- + from main). now we can compile gdb with -O etc.
- +
- + - other code reorgs and hacks.
- +
- + - much thanks to Michal Jaegermann who provided lots of
- + suggestions examples and suffered thru many intermmediate
- + versions.
- +
- GDB @ Patchlevel 14
-
- *************************************************
- ***************
- *** 181,203 ****
- HOW TO USE IT:
- to debug a program called foo, consisting of foo.c and bar.c do
-
- ! gcc [-O] -g -c foo.c bar.c (-O optional)
- ! gcc -o foo foo.o bar.o (get normal TOS executable)
- ! sym-ld -o foo.sym e:\lib\crt0.o foo.o bar.o -lgnu (make symbol file)
- ! (use the appro. full path to your crt0.o
- ! note: sym-ld -r is not required. -l works).
- !
- ! gdb -e foo -s foo.sym (file up gdb with exec-file == foo and
- ! symbol-file == foo.sym)
- ! (gdb) [set-args args1 arg2 ....]
- ! (gdb) r (before doing anything, you have to run,
- ! and it will break immediately with a
- ! non-sensical message)
- ! (gdb) b main (now start issuing normal gdb commands)
- ! ...
- ! (gdb) c finally a continue to actually start the prog
- ! .... and so on
- ! (gdb) q
-
-
- - use the online help
- --- 251,279 ----
- HOW TO USE IT:
- to debug a program called foo, consisting of foo.c and bar.c do
-
- ! gcc -g -c foo.c bar.c (-O optional)
- ! gcc -o foo foo.o bar.o (get normal TOS executable)
- ! sym-ld -o foo.sym e:\lib\crt0.o foo.o bar.o -lgnu (make symbol file)
- ! (use the appro. full path to your crt0.o
- ! note: sym-ld -r is not required and -l works).
- !
- ! gdb -e foo -s foo.sym (fire up gdb with exec-file == foo and
- ! symbol-file == foo.sym)
- ! (gdb) r [any-args to foo] (before doing anything, you have to run,
- ! and it will break immediately with a
- ! non-sensical message)
- ! NOTE VERY CAREFULLY: no other gdb commands before you issue
- ! the run command. this is the most common
- ! mistake. if you want to pass args to foo
- ! specify them with the run command. The
- ! arguements may not exceed 126 characters
- ! and they may not contain re-directions.
- !
- ! (gdb) b main (now start issuing normal gdb commands)
- ! ...
- ! (gdb) c finally a continue to actually start the prog
- ! .... and so on
- ! (gdb) q
-
-
- - use the online help
- *** 1.14 1991/10/05 20:09:09
- --- atarist.c 1992/01/14 20:05:55
- ***************
- *** 85,99 ****
- int i, envlen;
- char cmdname[80], argstring[258];
- char * p, * q;
-
- /* zzz */
- /*
- ! fprintf(stderr, "Execle_kludge:\n");
- ! fprintf(stderr, "\t'%s'\n", args);
-
- ! fprintf(stderr, "\tenv:\n");
- for (i = 0 ; env[i] ; i++)
- ! fprintf(stderr, "\t\t'%s'\n", env[i]);
- */
-
- /* construct the environment string */
- --- 85,105 ----
- int i, envlen;
- char cmdname[80], argstring[258];
- char * p, * q;
- + static char run_already = 0;
- +
- + if(run_already)
- + return -9999;
- + else
- + run_already = 1;
-
- /* zzz */
- /*
- ! fprintf_filtered(stderr, "Execle_kludge:\n");
- ! fprintf_filtered(stderr, "\t'%s'\n", args);
-
- ! fprintf_filtered(stderr, "\tenv:\n");
- for (i = 0 ; env[i] ; i++)
- ! fprintf_filtered(stderr, "\t\t'%s'\n", env[i]);
- */
-
- /* construct the environment string */
- ***************
- *** 142,148 ****
- /* something's really fucked here. We're not supposed to
- be able to come thru here except when we're starting
- things */
- ! fprintf(stderr, "Internal error!!! child already running?\n");
- return(0);
- }
- else
- --- 148,154 ----
- /* something's really fucked here. We're not supposed to
- be able to come thru here except when we're starting
- things */
- ! fprintf_filtered(stderr, "Internal error!!! child already running?\n");
- return(0);
- }
- else
- ***************
- *** 156,162 ****
- Pexec(PE_LOADGO, cmdname, argstring, env);
- but we can't. instead... */
-
- ! /* fprintf(stderr, "Pexec('%s', '%s')\n",
- &cmdname[0], &argstring[1]);
- */
- /* kludge_cmd = &cmdname[0]; */
- --- 162,168 ----
- Pexec(PE_LOADGO, cmdname, argstring, env);
- but we can't. instead... */
-
- ! /* fprintf_filtered(stderr, "Pexec('%s', '%s')\n",
- &cmdname[0], &argstring[1]);
- */
- /* kludge_cmd = &cmdname[0]; */
- ***************
- *** 215,221 ****
- when the child program exits. If anybody ever figures this out,
- please let me know!
- */
- ! fprintf(stderr, "Program exitted with status 0x%lx\n",
- kludge_pexec_result);
-
-
- --- 221,227 ----
- when the child program exits. If anybody ever figures this out,
- please let me know!
- */
- ! fprintf_filtered(stderr, "Program exitted with status 0x%lx\n",
- kludge_pexec_result);
-
-
- ***************
- *** 241,247 ****
- {
- long * child_sp = (long *)child_context.registers[15];
- child_tpa = (struct tpa * )child_sp[1];
- ! /* fprintf(stderr, "child tpa at %X\n", child_tpa); */
- relocate_apropriate_symbols(child_tpa->text_base);
- exception_number = 0;
- }
- --- 247,253 ----
- {
- long * child_sp = (long *)child_context.registers[15];
- child_tpa = (struct tpa * )child_sp[1];
- ! /* fprintf_filtered(stderr, "child tpa at %X\n", child_tpa); */
- relocate_apropriate_symbols(child_tpa->text_base);
- exception_number = 0;
- }
- ***************
- *** 261,270 ****
- Pterm0();
- /* doesn't return... */
- else
- ! fprintf(stderr, "Internal error: attempt to kill when child not running\n");
- }
- else
- ! fprintf(stderr, "You can't kill pid %d, bozo!\n", fake_pid);
-
- return(-1);
- }
- --- 267,276 ----
- Pterm0();
- /* doesn't return... */
- else
- ! fprintf_filtered(stderr, "Internal error: attempt to kill when child not running\n");
- }
- else
- ! fprintf_filtered(stderr, "You can't kill pid %d, bozo!\n", fake_pid);
-
- return(-1);
- }
- ***************
- *** 274,280 ****
- int st_wait_kludge(w)
- WAITTYPE * w;
- {
- ! /* fprintf(stderr, "st-wait-kludge: running %d exc %d\n",
- child_is_running, exception_number); */
- if (child_is_running)
- {
- --- 280,286 ----
- int st_wait_kludge(w)
- WAITTYPE * w;
- {
- ! /* fprintf_filtered(stderr, "st-wait-kludge: running %d exc %d\n",
- child_is_running, exception_number); */
- if (child_is_running)
- {
- ***************
- *** 288,303 ****
- }
- }
-
- - #ifdef JRDLIB
- - /* for printcmd.c */
- - vprintf(str, argv)
- - char * str;
- - char ** argv;
- - {
- - printf(str, argv[0], argv[1], argv[2], argv[3],
- - argv[4], argv[5], argv[6], argv[7]);
- - }
- - #endif
-
- static char *regcomp_error = 0;
- static regexp *compiled_regex = 0;
- --- 294,299 ----
- ***************
- *** 336,344 ****
- long entry_point; /* really a function... */
- {
- long old_vector;
- ! /* fprintf(stderr, "set exception %d %X", n, entry_point); */
- old_vector = (long)Setexc(n, entry_point); /* better way? */
- ! /* fprintf(stderr, " -> %X\n", old_vector); */
- return(old_vector);
- }
-
- --- 332,340 ----
- long entry_point; /* really a function... */
- {
- long old_vector;
- ! /* fprintf_filtered(stderr, "set exception %d %X", n, entry_point); */
- old_vector = (long)Setexc(n, entry_point); /* better way? */
- ! /* fprintf_filtered(stderr, " -> %X\n", old_vector); */
- return(old_vector);
- }
-
- ***************
- *** 379,395 ****
- /* force the child process to exit */
- st_child_exit()
- {
- ! /* fprintf(stderr, "st_child_exit\n"); */
- if (child_is_running)
- Pterm0();
- else
- ! fprintf(stderr, "Internal error: child not running?\n");
- }
-
- /* continue after bpt */
- st_child_continue()
- {
- ! /* fprintf(stderr, "st_child_continue\n"); */
- if (child_is_running)
- {
- set_all_exception_vectors(); /* set our traps */
- --- 375,391 ----
- /* force the child process to exit */
- st_child_exit()
- {
- ! /* fprintf_filtered(stderr, "st_child_exit\n"); */
- if (child_is_running)
- Pterm0();
- else
- ! fprintf_filtered(stderr, "Internal error: child not running?\n");
- }
-
- /* continue after bpt */
- st_child_continue()
- {
- ! /* fprintf_filtered(stderr, "st_child_continue\n"); */
- if (child_is_running)
- {
- set_all_exception_vectors(); /* set our traps */
- ***************
- *** 399,411 ****
- restore_all_exception_vectors(); /* and put our traps back */
- }
- else
- ! fprintf(stderr, "Internal error: child not running?\n");
- }
-
- /* single step */
- st_child_single_step()
- {
- ! /* fprintf(stderr, "st_child_single_step\n"); */
- if (child_is_running)
- {
- set_all_exception_vectors(); /* set our traps */
- --- 395,407 ----
- restore_all_exception_vectors(); /* and put our traps back */
- }
- else
- ! fprintf_filtered(stderr, "Internal error: child not running?\n");
- }
-
- /* single step */
- st_child_single_step()
- {
- ! /* fprintf_filtered(stderr, "st_child_single_step\n"); */
- if (child_is_running)
- {
- set_all_exception_vectors(); /* set our traps */
- ***************
- *** 414,420 ****
- restore_all_exception_vectors(); /* and put our traps back */
- }
- else
- ! fprintf(stderr, "Internal error: child not running?\n");
- }
-
- /* read a register from saved copies */
- --- 410,416 ----
- restore_all_exception_vectors(); /* and put our traps back */
- }
- else
- ! fprintf_filtered(stderr, "Internal error: child not running?\n");
- }
-
- /* read a register from saved copies */
- ***************
- *** 423,429 ****
- {
- long result;
-
- ! /* fprintf(stderr, "st_child_read_register %X ", regaddr); */
- if (child_is_running)
- {
- if ((regaddr >> 2) == PS_REGNUM)
- --- 419,425 ----
- {
- long result;
-
- ! /* fprintf_filtered(stderr, "st_child_read_register %X ", regaddr); */
- if (child_is_running)
- {
- if ((regaddr >> 2) == PS_REGNUM)
- ***************
- *** 434,449 ****
- /*
- if ((exception_number == 2) || (exception_number == 3))
- {
- ! fprintf(stderr, "Adjusting pc for trap %d %08X->%08X\n",
- exception_number, result, result+8);
- result += 8;
- }
- */
- }
- ! /* fprintf(stderr, "-> %X\n", result); */
- }
- else
- ! fprintf(stderr, "Child is not running\n");
- return(result);
- }
-
- --- 430,445 ----
- /*
- if ((exception_number == 2) || (exception_number == 3))
- {
- ! fprintf_filtered(stderr, "Adjusting pc for trap %d %08X->%08X\n",
- exception_number, result, result+8);
- result += 8;
- }
- */
- }
- ! /* fprintf_filtered(stderr, "-> %X\n", result); */
- }
- else
- ! fprintf_filtered(stderr, "Child is not running\n");
- return(result);
- }
-
- ***************
- *** 451,457 ****
- st_child_write_register(regaddr, value)
- int regaddr, value;
- {
- ! /* fprintf(stderr, "st_child_write_register %X <- %X\n", regaddr, value); */
- if (child_is_running)
- {
- if ((regaddr >> 2) == PS_REGNUM)
- --- 447,453 ----
- st_child_write_register(regaddr, value)
- int regaddr, value;
- {
- ! /* fprintf_filtered(stderr, "st_child_write_register %X <- %X\n", regaddr, value); */
- if (child_is_running)
- {
- if ((regaddr >> 2) == PS_REGNUM)
- ***************
- *** 460,466 ****
- *(long * )(regaddr + (char * )(&child_context)) = value;
- }
- else
- ! fprintf(stderr, "Child is not running\n");
- }
-
- /* read a 32-bit word from child memory */
- --- 456,462 ----
- *(long * )(regaddr + (char * )(&child_context)) = value;
- }
- else
- ! fprintf_filtered(stderr, "Child is not running\n");
- }
-
- /* read a 32-bit word from child memory */
- ***************
- *** 469,477 ****
- {
- long result;
-
- ! /* fprintf(stderr, "st_child_read_word %X", addr); */
- ! result = *addr;
- ! /* fprintf(stderr, "->%X\n", result); */
- return(result);
- }
-
- --- 465,477 ----
- {
- long result;
-
- ! /* fprintf_filtered(stderr, "st_child_read_word %X", addr); */
- ! /* check if addr is within child memory */
- ! if (addr >= child_tpa->text_base && addr < child_tpa->memtop)
- ! result = *addr;
- ! else
- ! result = 0;
- ! /* fprintf_filtered(stderr, "->%X\n", result); */
- return(result);
- }
-
- ***************
- *** 480,493 ****
- long * addr;
- long value;
- {
- ! /* fprintf(stderr, "st_child_write_word %X <- %X\n", addr, value); */
- ! *addr = value;
- }
-
- #define DEBUG 1
-
- #ifdef DEBUG
- - FILE *debugfp;
- static char *d_namespace[] =
- { "UNDEF", "VAR", "STRUCT", "LABEL" };
-
- --- 480,494 ----
- long * addr;
- long value;
- {
- ! /* fprintf_filtered(stderr, "st_child_write_word %X <- %X\n", addr, value); */
- ! /* check if addr is within child memory */
- ! if (addr >= child_tpa->text_base && addr < child_tpa->memtop)
- ! *addr = value;
- }
-
- #define DEBUG 1
-
- #ifdef DEBUG
- static char *d_namespace[] =
- { "UNDEF", "VAR", "STRUCT", "LABEL" };
-
- ***************
- *** 518,530 ****
- struct block * block;
- struct linetable * l;
- int nsyms, symnum, i;
- !
- #ifdef DEBUG
- if(atari_debug)
- {
- ! debugfp = fopen("debug.gdb", "w");
- ! fprintf(stderr,"Reloc constant %ld %X\n", base_address, base_address);
- ! fprintf(debugfp,"Reloc constant %ld %X\n", base_address, base_address);
- }
- #endif
- for (s = symtab_list ; s ; s = s->next)
- --- 519,530 ----
- struct block * block;
- struct linetable * l;
- int nsyms, symnum, i;
- ! extern char *version;
- !
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr,"Reloc constant %ld %X\n", base_address, base_address);
- }
- #endif
- for (s = symtab_list ; s ; s = s->next)
- ***************
- *** 533,542 ****
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf(stderr,
- ! "reloc syms table %X file '%s' linetable %08X(%ld) %d items\n",
- ! s, s->filename, l,l, l->nitems);
- ! fprintf(debugfp,
- "reloc syms table %X file '%s' linetable %08X(%ld) %d items\n",
- s, s->filename, l,l, l->nitems);
- }
- --- 533,539 ----
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr,
- "reloc syms table %X file '%s' linetable %08X(%ld) %d items\n",
- s, s->filename, l,l, l->nitems);
- }
- ***************
- *** 548,555 ****
- #ifdef DEBUG
- if(atari_debug && (n <= 0))
- {
- ! fprintf(stderr,"*********linetable with %d items\n", n);
- ! fprintf(debugfp,"*********linetable with %d items\n", n);
- }
- #endif
- for (i = 0 ; i < n ; i++)
- --- 545,551 ----
- #ifdef DEBUG
- if(atari_debug && (n <= 0))
- {
- ! fprintf_filtered(stderr,"*********linetable with %d items\n", n);
- }
- #endif
- for (i = 0 ; i < n ; i++)
- ***************
- *** 558,567 ****
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf(stderr, " %d: line %d %X(%ld)->%X(%ld)\n",
- ! i, item->line, item->pc, item->pc,
- ! item->pc+base_address, item->pc+base_address);
- ! fprintf(debugfp, " %d: line %d %X(%ld)->%X(%ld)\n",
- i, item->line, item->pc, item->pc,
- item->pc+base_address, item->pc+base_address);
- }
- --- 554,560 ----
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr, " %d: line %d %X(%ld)->%X(%ld)\n",
- i, item->line, item->pc, item->pc,
- item->pc+base_address, item->pc+base_address);
- }
- ***************
- *** 576,583 ****
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf(stderr,"Skipping block vector %X(%d) already relocated\n", bv,bv);
- ! fprintf(debugfp,"Skipping block vector %X(%d) already relocated\n", bv,bv);
- }
- #endif
- continue;
- --- 569,575 ----
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr,"Skipping block vector %X(%d) already relocated\n", bv,bv);
- }
- #endif
- continue;
- ***************
- *** 589,596 ****
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf(stderr, " block %d: in %X(%d)\n", i, bv, bv);
- ! fprintf(debugfp, " block %d:in %X(%d)\n", i, bv, bv);
- }
- #endif
- relocate_apropriate_block_symbols(block, base_address);
- --- 581,587 ----
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr, " block %d: in %X(%d)\n", i, bv, bv);
- }
- #endif
- relocate_apropriate_block_symbols(block, base_address);
- ***************
- *** 599,627 ****
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf(stderr,"Relocatings %d misc functions\n", misc_function_count);
- ! fprintf(debugfp,"Relocatings %d misc functions\n", misc_function_count);
- }
- #endif
- /* relocate the misc functions */
- for (i = 0; i < misc_function_count; i++)
- {
- ! #ifdef DEBUG1
- ! if(atari_debug)
- {
- ! fprintf(stderr, "%s:%ld->%ld\n", misc_function_vector[i].name,
- ! misc_function_vector[i].address, misc_function_vector[i].address+base_address);
- ! fprintf(debugfp, "%s:%ld->%ld\n", misc_function_vector[i].name,
- ! misc_function_vector[i].address, misc_function_vector[i].address+base_address);
- }
- #endif
- misc_function_vector[i].address += base_address;
- }
-
- - #ifdef DEBUG
- - if(atari_debug)
- - fclose(debugfp);
- - #endif
- }
-
- relocate_apropriate_block_symbols(block, base_address)
- --- 590,612 ----
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr,"Relocatings %d misc functions\n", misc_function_count);
- }
- #endif
- /* relocate the misc functions */
- for (i = 0; i < misc_function_count; i++)
- {
- ! #ifdef DEBUG
- ! if(atari_debug > 1)
- {
- ! fprintf_filtered(stderr, "%s: %X(%ld)->%X(%ld)\n", misc_function_vector[i].name,
- ! misc_function_vector[i].address, misc_function_vector[i].address,
- ! misc_function_vector[i].address+base_address, misc_function_vector[i].address+base_address);
- }
- #endif
- misc_function_vector[i].address += base_address;
- }
-
- }
-
- relocate_apropriate_block_symbols(block, base_address)
- ***************
- *** 639,646 ****
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf(stderr, " %d syms block %X(%ld)\n", nsyms, block, block);
- ! fprintf(debugfp, " %d syms block %X(%ld)\n", nsyms, block, block);
- }
- #endif
- for (symnum = 0 ; symnum < nsyms ; symnum++)
- --- 624,630 ----
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr, " %d syms block %X(%ld)\n", nsyms, block, block);
- }
- #endif
- for (symnum = 0 ; symnum < nsyms ; symnum++)
- ***************
- *** 649,657 ****
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf(stderr, " sym %d %X name '%s'",
- ! symnum, sym, SYMBOL_NAME(sym));
- ! fprintf(debugfp, " sym %d %X name '%s'",
- symnum, sym, SYMBOL_NAME(sym));
- }
- #endif
- --- 633,639 ----
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr, " sym %d %X name '%s'",
- symnum, sym, SYMBOL_NAME(sym));
- }
- #endif
- ***************
- *** 661,674 ****
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf(stderr, " is relocatable: (%s, %s) %X->%X %ld->%ld\n",
- d_namespace[sym->namespace], d_aclass[sym->class],
- sym->value.value, sym->value.value + base_address,
- sym->value.value, sym->value.value + base_address);
- - fprintf(debugfp, " is relocatable: (%s, %s) %X->%X %ld->%ld\n",
- - d_namespace[sym->namespace], d_aclass[sym->class],
- - sym->value.value, sym->value.value + base_address,
- - sym->value.value, sym->value.value + base_address);
- }
- #endif
- sym->value.value += base_address;
- --- 643,652 ----
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr, " is relocatable: (%s, %s) %X->%X %ld->%ld\n",
- d_namespace[sym->namespace], d_aclass[sym->class],
- sym->value.value, sym->value.value + base_address,
- sym->value.value, sym->value.value + base_address);
- }
- #endif
- sym->value.value += base_address;
- ***************
- *** 678,687 ****
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf(stderr, " is a LOC_block(%s %s)... %X\n",
- d_namespace[sym->namespace], d_aclass[sym->class], sym->value.block);
- - fprintf(debugfp, " is a LOC_block(%s %s)... %X\n",
- - d_namespace[sym->namespace], d_aclass[sym->class], sym->value.block);
- }
- #endif
- #if 0
- --- 656,663 ----
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr, " is a LOC_block(%s %s)... %X\n",
- d_namespace[sym->namespace], d_aclass[sym->class], sym->value.block);
- }
- #endif
- #if 0
- ***************
- *** 692,700 ****
- #ifdef DEBUG0
- if(atari_debug)
- {
- ! fprintf(stderr, " start %X->%X\n",
- ! BLOCK_START(bl), BLOCK_START(bl) + base_address);
- ! fprintf(debugfp, " start %X->%X\n",
- BLOCK_START(bl), BLOCK_START(bl) + base_address);
- }
- #endif
- --- 668,674 ----
- #ifdef DEBUG0
- if(atari_debug)
- {
- ! fprintf_filtered(stderr, " start %X->%X\n",
- BLOCK_START(bl), BLOCK_START(bl) + base_address);
- }
- #endif
- ***************
- *** 702,710 ****
- #ifdef DEBUG0
- if(atari_debug)
- {
- ! fprintf(stderr, " end %X->%X\n",
- ! BLOCK_END(bl), BLOCK_END(bl) + base_address);
- ! fprintf(debugfp, " end %X->%X\n",
- BLOCK_END(bl), BLOCK_END(bl) + base_address);
- }
- #endif
- --- 676,682 ----
- #ifdef DEBUG0
- if(atari_debug)
- {
- ! fprintf_filtered(stderr, " end %X->%X\n",
- BLOCK_END(bl), BLOCK_END(bl) + base_address);
- }
- #endif
- ***************
- *** 714,721 ****
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf(stderr, " ...end block\n");
- ! fprintf(debugfp, " ...end block\n");
- }
- #endif
- }
- --- 686,692 ----
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr, " ...end block\n");
- }
- #endif
- }
- ***************
- *** 724,732 ****
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf(stderr, " is not relocatable: (%s, %s)\n",
- ! d_namespace[sym->namespace], d_aclass[sym->class]);
- ! fprintf(debugfp, " is not relocatable: (%s, %s)\n",
- d_namespace[sym->namespace], d_aclass[sym->class]);
- }
- #endif
- --- 695,701 ----
- #ifdef DEBUG
- if(atari_debug)
- {
- ! fprintf_filtered(stderr, " is not relocatable: (%s, %s)\n",
- d_namespace[sym->namespace], d_aclass[sym->class]);
- }
- #endif
- *** 1.4 1991/10/05 20:59:54
- --- breakpoint.c 1992/01/14 20:05:56
- ***************
- *** 128,134 ****
- {
- b->cond = 0;
- if (from_tty)
- ! printf ("Breakpoint %d now unconditional.\n", bnum);
- }
- else
- {
- --- 128,134 ----
- {
- b->cond = 0;
- if (from_tty)
- ! printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
- }
- else
- {
- ***************
- *** 183,189 ****
- {
- if (input_from_terminal_p ())
- {
- ! printf ("Type commands for when breakpoint %d is hit, one per line.\n\
- End with a line saying just \"end\".\n", bnum);
- fflush (stdout);
- }
- --- 183,189 ----
- {
- if (input_from_terminal_p ())
- {
- ! printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
- End with a line saying just \"end\".\n", bnum);
- fflush (stdout);
- }
- ***************
- *** 251,257 ****
- register struct breakpoint *b;
- int val;
-
- ! /* printf ("Inserting breakpoints.\n"); */
- ALL_BREAKPOINTS (b)
- if (b->enable != disabled && ! b->inserted && ! b->duplicate)
- {
- --- 251,257 ----
- register struct breakpoint *b;
- int val;
-
- ! /* printf_filtered ("Inserting breakpoints.\n"); */
- ALL_BREAKPOINTS (b)
- if (b->enable != disabled && ! b->inserted && ! b->duplicate)
- {
- ***************
- *** 259,265 ****
- val = write_memory (b->address, break_insn, sizeof break_insn);
- if (val)
- return val;
- ! /* printf ("Inserted breakpoint at 0x%x, shadow 0x%x, 0x%x.\n",
- b->address, b->shadow_contents[0], b->shadow_contents[1]); */
- b->inserted = 1;
- }
- --- 259,265 ----
- val = write_memory (b->address, break_insn, sizeof break_insn);
- if (val)
- return val;
- ! /*printf_filtered ("Inserted breakpoint at 0x%x, shadow 0x%x, 0x%x.\n",
- b->address, b->shadow_contents[0], b->shadow_contents[1]); */
- b->inserted = 1;
- }
- ***************
- *** 272,278 ****
- register struct breakpoint *b;
- int val;
-
- ! /* printf ("Removing breakpoints.\n"); */
- ALL_BREAKPOINTS (b)
- if (b->inserted)
- {
- --- 272,278 ----
- register struct breakpoint *b;
- int val;
-
- ! /* printf_filtered ("Removing breakpoints.\n"); */
- ALL_BREAKPOINTS (b)
- if (b->inserted)
- {
- ***************
- *** 280,286 ****
- if (val)
- return val;
- b->inserted = 0;
- ! /* printf ("Removed breakpoint at 0x%x, shadow 0x%x, 0x%x.\n",
- b->address, b->shadow_contents[0], b->shadow_contents[1]); */
- }
-
- --- 280,286 ----
- if (val)
- return val;
- b->inserted = 0;
- ! /*printf_filtered ("Removed breakpoint at 0x%x, shadow 0x%x, 0x%x.\n",
- b->address, b->shadow_contents[0], b->shadow_contents[1]); */
- }
-
- ***************
- *** 399,405 ****
- ALL_BREAKPOINTS (b)
- if (bnum == -1 || bnum == b->number)
- {
- ! printf ("#%-3d %c 0x%08x ", b->number,
- "nyod"[(int) b->enable],
- b->address);
- last_addr = b->address;
- --- 399,405 ----
- ALL_BREAKPOINTS (b)
- if (bnum == -1 || bnum == b->number)
- {
- ! printf_filtered ("#%-3d %c 0x%08x ", b->number,
- "nyod"[(int) b->enable],
- b->address);
- last_addr = b->address;
- ***************
- *** 407,433 ****
- {
- sym = find_pc_function (b->address);
- if (sym)
- ! printf (" in %s (%s line %d)", SYMBOL_NAME (sym),
- b->symtab->filename, b->line_number);
- else
- ! printf ("%s line %d", b->symtab->filename, b->line_number);
- }
- ! printf ("\n");
-
- if (b->ignore_count)
- ! printf ("\tignore next %d hits\n", b->ignore_count);
- if (b->frame)
- ! printf ("\tstop only in stack frame at 0x%x\n", b->frame);
- if (b->cond)
- {
- ! printf ("\tbreak only if ");
- print_expression (b->cond, stdout);
- ! printf ("\n");
- }
- if (l = b->commands)
- while (l)
- {
- ! printf ("\t%s\n", l->line);
- l = l->next;
- }
- }
- --- 407,433 ----
- {
- sym = find_pc_function (b->address);
- if (sym)
- ! printf_filtered (" in %s (%s line %d)", SYMBOL_NAME (sym),
- b->symtab->filename, b->line_number);
- else
- ! printf_filtered ("%s line %d", b->symtab->filename, b->line_number);
- }
- ! printf_filtered ("\n");
-
- if (b->ignore_count)
- ! printf_filtered ("\tignore next %d hits\n", b->ignore_count);
- if (b->frame)
- ! printf_filtered ("\tstop only in stack frame at 0x%x\n", b->frame);
- if (b->cond)
- {
- ! printf_filtered ("\tbreak only if ");
- print_expression (b->cond, stdout);
- ! printf_filtered ("\n");
- }
- if (l = b->commands)
- while (l)
- {
- ! printf_filtered ("\t%s\n", l->line);
- l = l->next;
- }
- }
- ***************
- *** 445,453 ****
- if (bnum_exp)
- bnum = parse_and_eval_address (bnum_exp);
- else if (breakpoint_chain == 0)
- ! printf ("No breakpoints.\n");
- else
- ! printf ("Breakpoints:\n\
- Num Enb Address Where\n");
-
- breakpoint_1 (bnum);
- --- 445,453 ----
- if (bnum_exp)
- bnum = parse_and_eval_address (bnum_exp);
- else if (breakpoint_chain == 0)
- ! printf_filtered ("No breakpoints.\n");
- else
- ! printf_filtered ("Breakpoints:\n\
- Num Enb Address Where\n");
-
- breakpoint_1 (bnum);
- ***************
- *** 467,483 ****
- others++;
- if (others > 0)
- {
- ! printf ("Note: breakpoint%s ", (others > 1) ? "s" : "");
- ALL_BREAKPOINTS (b)
- if (b->address == pc)
- {
- others--;
- ! printf ("%d%s%s ",
- b->number,
- (b->enable == disabled) ? " (disabled)" : "",
- (others > 1) ? "," : ((others == 1) ? " and" : ""));
- }
- ! printf (" also set at pc 0x%x\n", pc);
- }
- }
-
- --- 467,483 ----
- others++;
- if (others > 0)
- {
- ! printf_filtered ("Note: breakpoint%s ", (others > 1) ? "s" : "");
- ALL_BREAKPOINTS (b)
- if (b->address == pc)
- {
- others--;
- ! printf_filtered ("%d%s%s ",
- b->number,
- (b->enable == disabled) ? " (disabled)" : "",
- (others > 1) ? "," : ((others == 1) ? " and" : ""));
- }
- ! printf_filtered (" also set at pc 0x%x\n", pc);
- }
- }
-
- ***************
- *** 611,620 ****
- if (tempflag)
- b->enable = temporary;
-
- ! printf ("Breakpoint %d at 0x%x", b->number, b->address);
- if (b->symtab)
- ! printf (": file %s, line %d.", b->symtab->filename, b->line_number);
- ! printf ("\n");
- }
- }
-
- --- 611,620 ----
- if (tempflag)
- b->enable = temporary;
-
- ! printf_filtered ("Breakpoint %d at 0x%x", b->number, b->address);
- if (b->symtab)
- ! printf_filtered (": file %s, line %d.", b->symtab->filename, b->line_number);
- ! printf_filtered ("\n");
- }
- }
-
- ***************
- *** 672,681 ****
- if (tempflag)
- b->enable = temporary;
-
- ! printf ("Breakpoint %d at 0x%x", b->number, b->address);
- if (b->symtab)
- ! printf (": file %s, line %d.", b->symtab->filename, b->line_number);
- ! printf ("\n");
- }
-
- static void
- --- 672,681 ----
- if (tempflag)
- b->enable = temporary;
-
- ! printf_filtered ("Breakpoint %d at 0x%x", b->number, b->address);
- if (b->symtab)
- ! printf_filtered (": file %s, line %d.", b->symtab->filename, b->line_number);
- ! printf_filtered ("\n");
- }
-
- static void
- ***************
- *** 745,759 ****
- error ("No breakpoint at %s.", arg);
-
- if (found->next) from_tty = 1; /* Alwats report if deleted more than one */
- ! if (from_tty) printf ("Deleted breakpoint%s ", found->next ? "s" : "");
- while (found)
- {
- ! if (from_tty) printf ("%d ", found->number);
- b1 = found->next;
- delete_breakpoint (found);
- found = b1;
- }
- ! if (from_tty) putchar ('\n');
- }
-
- /* Delete breakpoint number BNUM if it is a `delete' breakpoint.
- --- 745,759 ----
- error ("No breakpoint at %s.", arg);
-
- if (found->next) from_tty = 1; /* Alwats report if deleted more than one */
- ! if (from_tty)printf_filtered ("Deleted breakpoint%s ", found->next ? "s" : "");
- while (found)
- {
- ! if (from_tty)printf_filtered ("%d ", found->number);
- b1 = found->next;
- delete_breakpoint (found);
- found = b1;
- }
- ! if (from_tty) fputc_filtered ('\n', stdout);
- }
-
- /* Delete breakpoint number BNUM if it is a `delete' breakpoint.
- ***************
- *** 857,867 ****
- if (!from_tty)
- return;
- else if (count == 0)
- ! printf ("Will stop next time breakpoint %d is reached.", bptnum);
- else if (count == 1)
- ! printf ("Will ignore next crossing of breakpoint %d.", bptnum);
- else
- ! printf ("Will ignore next %d crossings of breakpoint %d.",
- count, bptnum);
- return;
- }
- --- 857,867 ----
- if (!from_tty)
- return;
- else if (count == 0)
- ! printf_filtered ("Will stop next time breakpoint %d is reached.", bptnum);
- else if (count == 1)
- ! printf_filtered ("Will ignore next crossing of breakpoint %d.", bptnum);
- else
- ! printf_filtered ("Will ignore next %d crossings of breakpoint %d.",
- count, bptnum);
- return;
- }
- ***************
- *** 893,899 ****
- error ("Second argument (specified ignore-count) is missing.");
-
- set_ignore_count (num, parse_and_eval_address (p), from_tty);
- ! printf ("\n");
- }
-
- /* Call FUNCTION on each of the breakpoints
- --- 893,899 ----
- error ("Second argument (specified ignore-count) is missing.");
-
- set_ignore_count (num, parse_and_eval_address (p), from_tty);
- ! printf_filtered ("\n");
- }
-
- /* Call FUNCTION on each of the breakpoints
- ***************
- *** 927,933 ****
- function (b);
- goto win;
- }
- ! printf ("No breakpoint number %d.\n", num);
- win:
- p = p1;
- while (*p == ' ' || *p == '\t') p++;
- --- 927,933 ----
- function (b);
- goto win;
- }
- ! printf_filtered ("No breakpoint number %d.\n", num);
- win:
- p = p1;
- while (*p == ' ' || *p == '\t') p++;
- *** 1.2 1991/05/21 01:28:16
- --- command.c 1992/01/14 20:05:56
- ***************
- *** 280,289 ****
- so that the commands in the class will be listed. */
-
- p = c->doc;
- ! fprintf (stream, "%s\n", p);
- if (c->function != 0 && c->prefixlist == 0)
- return;
- ! fputc ('\n', stream);
- if (c->prefixlist)
- {
- list = *c->prefixlist;
- --- 280,289 ----
- so that the commands in the class will be listed. */
-
- p = c->doc;
- ! fprintf_filtered (stream, "%s\n", p);
- if (c->function != 0 && c->prefixlist == 0)
- return;
- ! fputc_filtered ('\n', stream);
- if (c->prefixlist)
- {
- list = *c->prefixlist;
- ***************
- *** 310,318 ****
- }
-
- if (class == -2)
- ! fprintf (stream, "List of classes of %scommands:\n\n", cmdtype2);
- else
- ! fprintf (stream, "List of %scommands:\n\n", cmdtype2);
-
- for (c = list; c; c = c->next)
- {
- --- 310,318 ----
- }
-
- if (class == -2)
- ! fprintf_filtered (stream, "List of classes of %scommands:\n\n", cmdtype2);
- else
- ! fprintf_filtered (stream, "List of %scommands:\n\n", cmdtype2);
-
- for (c = list; c; c = c->next)
- {
- ***************
- *** 321,341 ****
- || (c->class == class && c->function != 0) /* Listing one class */
- || (class == -2 && c->function == 0))) /* Listing the classes */
- {
- ! fprintf (stream, "%s -- ", c->name);
- /* Print just first line of documentation. */
- p = c->doc;
- ! while (*p && *p != '\n') p++;
- ! fwrite (c->doc, 1, p - c->doc, stream);
- ! fputc ('\n', stream);
- }
- }
-
- if (class == -2)
- ! fprintf (stream, "\n\
- Type \"help%s\" followed by a class name for a list of commands in that class.",
- cmdtype1);
-
- ! fprintf (stream, "\n\
- Type \"help%s\" followed by %scommand name for full documentation.\n\
- Command name abbreviations are allowed if unambiguous.\n",
- cmdtype1, cmdtype2);
- --- 321,341 ----
- || (c->class == class && c->function != 0) /* Listing one class */
- || (class == -2 && c->function == 0))) /* Listing the classes */
- {
- ! fprintf_filtered (stream, "%s -- ", c->name);
- /* Print just first line of documentation. */
- p = c->doc;
- ! while (*p && *p != '\n') fputc_filtered(*p++, stream);
- ! /* fwrite (c->doc, 1, p - c->doc, stream); */
- ! fputc_filtered ('\n', stream);
- }
- }
-
- if (class == -2)
- ! fprintf_filtered (stream, "\n\
- Type \"help%s\" followed by a class name for a list of commands in that class.",
- cmdtype1);
-
- ! fprintf_filtered (stream, "\n\
- Type \"help%s\" followed by %scommand name for full documentation.\n\
- Command name abbreviations are allowed if unambiguous.\n",
- cmdtype1, cmdtype2);
- *** 1.10 1991/10/05 20:59:54
- --- dbxread.c 1992/01/14 20:05:57
- ***************
- *** 62,68 ****
- static struct symbol *define_symbol ();
- static void start_subfile ();
- static int hashname ();
- - static void hash_symsegs ();
-
- static void add_undefined_type ();
- static void cleanup_undefined_types ();
- --- 62,67 ----
- ***************
- *** 113,126 ****
- but the information is copied from them when appropriate
- to make the symtabs that will exist permanently. */
-
- - static struct symtab *symseg_chain;
- -
- - /* Symseg symbol table for the file whose data we are now processing.
- - It is one of those in symseg_chain. Or 0, for a compilation that
- - has no symseg. */
- -
- - static struct symtab *current_symseg;
- -
- /* Name of source file whose symbol data we are now processing.
- This comes from a symbol of type N_SO. */
-
- --- 112,117 ----
- ***************
- *** 264,277 ****
-
- static char *symfile;
-
- ! static int
- ! xxmalloc (n)
- ! {
- ! int v = malloc (n);
- ! if (v == 0)
- ! abort ();
- ! return v;
- ! }
-
- /* Make a copy of the string at PTR with SIZE characters in the symbol obstack
- (and add a null character at the end in the copy).
- --- 255,262 ----
-
- static char *symfile;
-
- ! extern char *xmalloc();
- ! #define xxmalloc xmalloc
-
- /* Make a copy of the string at PTR with SIZE characters in the symbol obstack
- (and add a null character at the end in the copy).
- ***************
- *** 532,538 ****
- {
- /* Type is defined outside of header files.
- Find it in this object file's type vector. */
- ! if (Index >= type_vector_length)
- {
- type_vector_length *= 2;
- type_vector = (struct typevector *)
- --- 517,523 ----
- {
- /* Type is defined outside of header files.
- Find it in this object file's type vector. */
- ! while (Index >= type_vector_length)
- {
- type_vector_length *= 2;
- type_vector = (struct typevector *)
- ***************
- *** 546,551 ****
- --- 531,537 ----
- {
- register int real_filenum = this_object_header_files[filenum];
- register struct header_file *f;
- + int f_orig_length;
-
- if (real_filenum >= n_header_files)
- abort ();
- ***************
- *** 552,564 ****
-
- f = &header_files[real_filenum];
-
- ! if (Index >= f->length)
- {
- ! f->length *= 2;
- f->vector = (struct type **)
- xrealloc (f->vector, f->length * sizeof (struct type *));
- ! bzero (&f->vector[f->length / 2],
- ! f->length * sizeof (struct type *) / 2);
- }
- return &f->vector[Index];
- }
- --- 538,552 ----
-
- f = &header_files[real_filenum];
-
- ! f_orig_length = f->length;
- ! if (Index >= f_orig_length)
- {
- ! while (Index >= f->length)
- ! f->length *= 2;
- f->vector = (struct type **)
- xrealloc (f->vector, f->length * sizeof (struct type *));
- ! bzero (&f->vector[f_orig_length],
- ! (f->length - f_orig_length) * sizeof (struct type *));
- }
- return &f->vector[Index];
- }
- ***************
- *** 678,688 ****
- --- 666,678 ----
- }
- free_pendings = 0;
-
- + #if 0 /* Now we make the links in the symbol_obstack, so don't free them. */
- for (bnext = pending_blocks; bnext; bnext = bnext1)
- {
- bnext1 = bnext->next;
- free (bnext);
- }
- + #endif
- pending_blocks = 0;
-
- for (next = file_symbols; next; next = next1)
- ***************
- *** 690,700 ****
- --- 680,694 ----
- 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.
- ***************
- *** 879,891 ****
-
- new_object_header_files ();
-
- - for (s = symseg_chain; s; s = s->next)
- - if (s->ldsymoff == symnum * sizeof (struct nlist))
- - break;
- - current_symseg = s;
- - if (s != 0)
- - return;
- -
- type_vector_length = 160;
- type_vector = (struct typevector *) xxmalloc (sizeof (struct typevector) + type_vector_length * sizeof (struct type *));
- bzero (type_vector->type, type_vector_length * sizeof (struct type *));
- --- 873,878 ----
- ***************
- *** 970,982 ****
- register struct linetable *lv;
- struct subfile *nextsub;
-
- - if (current_symseg != 0)
- - {
- - last_source_file = 0;
- - current_symseg = 0;
- - return;
- - }
- -
- /* Finish the lexical context of the last function in the file;
- pop the context stack. */
-
- --- 957,962 ----
- ***************
- *** 1332,1344 ****
- free (symfile);
- symfile = 0;
- free_all_symtabs ();
- ! printf ("%s has no symbol-table; symbols discarded.\n", name);
- fflush (stdout);
- do_cleanups (old_chain);
- return;
- }
-
- ! printf ("Reading symbol data from %s...", name);
- fflush (stdout);
-
- /* Now read the string table, all at once. */
- --- 1312,1324 ----
- free (symfile);
- symfile = 0;
- free_all_symtabs ();
- ! printf_filtered ("%s has no symbol-table; symbols discarded.\n", name);
- fflush (stdout);
- do_cleanups (old_chain);
- return;
- }
-
- ! printf_filtered ("Reading symbol data from %s...", name);
- fflush (stdout);
-
- /* Now read the string table, all at once. */
- ***************
- *** 1374,1383 ****
- /* Empty the hash table of global syms looking for values. */
- bzero (global_sym_chain, sizeof global_sym_chain);
-
- - /* Symsegs are no longer supported by GDB. Setting symseg_chain to
- - 0 is easier than finding all the symseg code and eliminating it. */
- - symseg_chain = 0;
- -
- /* Position to read the symbol table. Do not read it all at once. */
- val = lseek (desc, SYMBOL_TABLE_OFFSET, 0);
- if (val < 0)
- --- 1354,1359 ----
- ***************
- *** 1424,1439 ****
-
- do_cleanups (old_chain);
-
- ! /* Free the symtabs made by read_symsegs, but not their contents,
- ! which have been copied into symtabs on symtab_list. */
- ! while (symseg_chain)
- ! {
- ! register struct symtab *s = symseg_chain->next;
- ! free (symseg_chain);
- ! symseg_chain = s;
- ! }
- !
- ! printf ("done.\n");
- fflush (stdout);
- }
-
- --- 1400,1406 ----
-
- do_cleanups (old_chain);
-
- ! printf_filtered ("done.\n");
- fflush (stdout);
- }
-
- ***************
- *** 1654,1694 ****
- if (total < 0) total += (1000 << 6);
- return total % HASHSIZE;
- }
- -
- - /* Put all appropriate global symbols in the symseg data
- - onto the hash chains so that their addresses will be stored
- - when seen later in loader global symbols. */
- -
- - static void
- - hash_symsegs ()
- - {
- - /* Look at each symbol in each block in each symseg symtab. */
- - struct symtab *s;
- - for (s = symseg_chain; s; s = s->next)
- - {
- - register int n;
- - for (n = BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)) - 1; n >= 0; n--)
- - {
- - register struct block *b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), n);
- - register int i;
- - for (i = BLOCK_NSYMS (b) - 1; i >= 0; i--)
- - {
- - register struct symbol *sym = BLOCK_SYM (b, i);
- -
- - /* Put the symbol on a chain if its value is an address
- - that is figured out by the loader. */
- -
- - if (SYMBOL_CLASS (sym) == LOC_EXTERNAL)
- - {
- - register int hash = hashname (SYMBOL_NAME (sym));
- - SYMBOL_VALUE (sym) = (int) global_sym_chain[hash];
- - global_sym_chain[hash] = sym;
- - SYMBOL_CLASS (sym) = LOC_STATIC;
- - }
- - }
- - }
- - }
- - }
-
- static void
- process_one_symbol (type, desc, value, name)
- --- 1621,1626 ----
- ***************
- *** 1794,1800 ****
- to be attached to the function's own block. */
- if (local_symbols && context_stack_depth > 1)
- {
- ! /* Muzzle a compiler bug that makes end > start. */
- if (new->start_addr > value)
- new->start_addr = value;
- /* Make a block for the local symbols within. */
- --- 1726,1732 ----
- to be attached to the function's own block. */
- if (local_symbols && context_stack_depth > 1)
- {
- ! /* Muzzle a compiler bug that makes end < start. */
- if (new->start_addr > value)
- new->start_addr = value;
- /* Make a block for the local symbols within. */
- ***************
- *** 1919,1924 ****
- --- 1851,1857 ----
- {
- case 'r':
- {
- + extern double atof();
- double d = atof (p);
- char *value;
-
- ***************
- *** 2028,2034 ****
- add_symbol_to_list (sym, &local_symbols);
- /* DESC == 0 implies compiled with GCC.
- In this case, if it says `short', believe it. */
- ! if (desc == 0)
- break;
- /* If PCC says a parameter is a short or a char,
- it is really an int. */
- --- 1961,1969 ----
- add_symbol_to_list (sym, &local_symbols);
- /* DESC == 0 implies compiled with GCC.
- In this case, if it says `short', believe it. */
- ! #ifndef atarist /* always gcc compiled */
- ! if (desc == 0)
- ! #endif
- break;
- /* If PCC says a parameter is a short or a char,
- it is really an int. */
- ***************
- *** 2400,2405 ****
- --- 2335,2341 ----
- break;
-
- case '*':
- + #if 0
- type1 = read_type (pp);
- if (TYPE_POINTER_TYPE (type1))
- {
- ***************
- *** 2413,2420 ****
- --- 2349,2364 ----
- smash_to_pointer_type (type, type1);
- }
- break;
- + #else
- + type1 = read_type (pp);
- + type = lookup_pointer_type (type1);
- + if (typenums[0] != -1)
- + *dbx_lookup_type (typenums) = type;
- + break;
- + #endif
-
- case 'f':
- + #if 0
- type1 = read_type (pp);
- if (TYPE_FUNCTION_TYPE (type1))
- {
- ***************
- *** 2428,2433 ****
- --- 2372,2384 ----
- smash_to_function_type (type, type1);
- }
- break;
- + #else
- + type1 = read_type (pp);
- + type = lookup_function_type (type1);
- + if (typenums[0] != -1)
- + *dbx_lookup_type (typenums) = type;
- + break;
- + #endif
-
- case 'r':
- type = read_range_type (pp, typenums);
- ***************
- *** 2791,2812 ****
-
- else if (n2 == 0 && n3 == -1)
- {
- - if (sizeof (int) == sizeof (long))
- return builtin_type_unsigned_int;
- - else
- - return builtin_type_unsigned_long;
- }
- #ifdef atarist
- /* special case for -mshort */
- ! else if (n2 == 0 && n3 == 65535)
- {
- - gcc_mshort = 1;
- return builtin_type_unsigned_short;
- }
- /* and this one just occurs, sigh! */
- ! else if (n2 == 0 && n3 == 255)
- {
- - gcc_mshort = 1;
- return builtin_type_unsigned_char;
- }
- #endif
- --- 2742,2758 ----
-
- else if (n2 == 0 && n3 == -1)
- {
- return builtin_type_unsigned_int;
- }
- #ifdef atarist
- /* special case for -mshort */
- ! else if (gcc_mshort && n2 == 0 && n3 == 65535)
- {
- return builtin_type_unsigned_short;
- }
- /* and this one just occurs, sigh! */
- ! else if (gcc_mshort && n2 == 0 && n3 == 255)
- {
- return builtin_type_unsigned_char;
- }
- #endif
- ***************
- *** 2882,2890 ****
- else
- #ifdef atarist
- error ("Ranged type doesn't fit within known sizes.\n\
- ! On an atariST this is most likely a pathological case due to\n\
- objects compiled with the \"-mshort\" option to gcc.\n\
- ! Please re-try without\"-mshort\".\n\
- n2 == %d, n3 == %d\n", n2,n3);
- #else
- error ("Ranged type doesn't fit within known sizes.");
- --- 2828,2836 ----
- else
- #ifdef atarist
- error ("Ranged type doesn't fit within known sizes.\n\
- ! On an atariST this is most likely due to\n\
- objects compiled with the \"-mshort\" option to gcc.\n\
- ! Please re-try by specifying the \"-mshort\" option on the gdb command line.\n\
- n2 == %d, n3 == %d\n", n2,n3);
- #else
- error ("Ranged type doesn't fit within known sizes.");
- ***************
- *** 2949,2955 ****
- #ifdef atarist
- set_gcc_mshort()
- {
- ! printf("Was %d\n", gcc_mshort);
- gcc_mshort = 1;
- }
- #endif
- --- 2895,2901 ----
- #ifdef atarist
- set_gcc_mshort()
- {
- ! printf_filtered("Was %d\n", gcc_mshort);
- gcc_mshort = 1;
- }
- #endif
- *** 1.2 1991/09/20 23:51:25
- --- expprint.c 1992/01/14 20:05:58
- ***************
- *** 135,156 ****
-
- case OP_VAR_VALUE:
- (*pos) += 2;
- ! fprintf (stream, "%s", SYMBOL_NAME (exp->elts[pc + 1].symbol));
- return;
-
- case OP_LAST:
- (*pos) += 2;
- ! fprintf (stream, "$%d", exp->elts[pc + 1].longconst);
- return;
-
- case OP_REGISTER:
- (*pos) += 2;
- ! fprintf (stream, "$%s", reg_names[exp->elts[pc + 1].longconst]);
- return;
-
- case OP_INTERNALVAR:
- (*pos) += 2;
- ! fprintf (stream, "$%s",
- internalvar_name (exp->elts[pc + 1].internalvar));
- return;
-
- --- 135,156 ----
-
- case OP_VAR_VALUE:
- (*pos) += 2;
- ! fprintf_filtered (stream, "%s", SYMBOL_NAME (exp->elts[pc + 1].symbol));
- return;
-
- case OP_LAST:
- (*pos) += 2;
- ! fprintf_filtered (stream, "$%d", exp->elts[pc + 1].longconst);
- return;
-
- case OP_REGISTER:
- (*pos) += 2;
- ! fprintf_filtered (stream, "$%s", reg_names[exp->elts[pc + 1].longconst]);
- return;
-
- case OP_INTERNALVAR:
- (*pos) += 2;
- ! fprintf_filtered (stream, "$%s",
- internalvar_name (exp->elts[pc + 1].internalvar));
- return;
-
- ***************
- *** 158,196 ****
- (*pos) += 2;
- nargs = exp->elts[pc + 1].longconst;
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf (stream, " (");
- for (tem = 0; tem < nargs; tem++)
- {
- if (tem != 0)
- ! fprintf (stream, ", ");
- print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
- }
- ! fprintf (stream, ")");
- return;
-
- case OP_STRING:
- nargs = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + (nargs + sizeof (union exp_element)) / sizeof (union exp_element);
- ! fprintf (stream, "\"");
- for (tem = 0; tem < nargs; tem++)
- printchar ((&exp->elts[pc + 1].string)[tem], stream);
- ! fprintf (stream, "\"");
- return;
-
- case TERNOP_COND:
- if ((int) prec > (int) PREC_COMMA)
- ! fprintf (stream, "(");
- /* Print the subexpressions, forcing parentheses
- around any binary operations within them.
- This is more parentheses than are strictly necessary,
- but it looks clearer. */
- print_subexp (exp, pos, stream, PREC_HYPER);
- ! fprintf (stream, " ? ");
- print_subexp (exp, pos, stream, PREC_HYPER);
- ! fprintf (stream, " : ");
- print_subexp (exp, pos, stream, PREC_HYPER);
- if ((int) prec > (int) PREC_COMMA)
- ! fprintf (stream, ")");
- return;
-
- case STRUCTOP_STRUCT:
- --- 158,196 ----
- (*pos) += 2;
- nargs = exp->elts[pc + 1].longconst;
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf_filtered (stream, " (");
- for (tem = 0; tem < nargs; tem++)
- {
- if (tem != 0)
- ! fprintf_filtered (stream, ", ");
- print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
- }
- ! fprintf_filtered (stream, ")");
- return;
-
- case OP_STRING:
- nargs = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + (nargs + sizeof (union exp_element)) / sizeof (union exp_element);
- ! fprintf_filtered (stream, "\"");
- for (tem = 0; tem < nargs; tem++)
- printchar ((&exp->elts[pc + 1].string)[tem], stream);
- ! fprintf_filtered (stream, "\"");
- return;
-
- case TERNOP_COND:
- if ((int) prec > (int) PREC_COMMA)
- ! fprintf_filtered (stream, "(");
- /* Print the subexpressions, forcing parentheses
- around any binary operations within them.
- This is more parentheses than are strictly necessary,
- but it looks clearer. */
- print_subexp (exp, pos, stream, PREC_HYPER);
- ! fprintf_filtered (stream, " ? ");
- print_subexp (exp, pos, stream, PREC_HYPER);
- ! fprintf_filtered (stream, " : ");
- print_subexp (exp, pos, stream, PREC_HYPER);
- if ((int) prec > (int) PREC_COMMA)
- ! fprintf_filtered (stream, ")");
- return;
-
- case STRUCTOP_STRUCT:
- ***************
- *** 197,203 ****
- tem = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf (stream, ".%s", &exp->elts[pc + 1].string);
- return;
-
- case STRUCTOP_PTR:
- --- 197,203 ----
- tem = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf_filtered (stream, ".%s", &exp->elts[pc + 1].string);
- return;
-
- case STRUCTOP_PTR:
- ***************
- *** 204,251 ****
- tem = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf (stream, "->%s", &exp->elts[pc + 1].string);
- return;
-
- case BINOP_SUBSCRIPT:
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf (stream, "[");
- print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
- ! fprintf (stream, "]");
- return;
-
- case UNOP_POSTINCREMENT:
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf (stream, "++");
- return;
-
- case UNOP_POSTDECREMENT:
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf (stream, "--");
- return;
-
- case UNOP_CAST:
- (*pos) += 2;
- if ((int) prec > (int) PREC_PREFIX)
- ! fprintf (stream, "(");
- ! fprintf (stream, "(");
- type_print (exp->elts[pc + 1].type, "", stream, 0);
- ! fprintf (stream, ") ");
- print_subexp (exp, pos, stream, PREC_PREFIX);
- if ((int) prec > (int) PREC_PREFIX)
- ! fprintf (stream, ")");
- return;
-
- case UNOP_MEMVAL:
- (*pos) += 2;
- if ((int) prec > (int) PREC_PREFIX)
- ! fprintf (stream, "(");
- ! fprintf (stream, "{");
- type_print (exp->elts[pc + 1].type, "", stream, 0);
- ! fprintf (stream, "} ");
- print_subexp (exp, pos, stream, PREC_PREFIX);
- if ((int) prec > (int) PREC_PREFIX)
- ! fprintf (stream, ")");
- return;
-
- case BINOP_ASSIGN_MODIFY:
- --- 204,251 ----
- tem = strlen (&exp->elts[pc + 1].string);
- (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf_filtered (stream, "->%s", &exp->elts[pc + 1].string);
- return;
-
- case BINOP_SUBSCRIPT:
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf_filtered (stream, "[");
- print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
- ! fprintf_filtered (stream, "]");
- return;
-
- case UNOP_POSTINCREMENT:
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf_filtered (stream, "++");
- return;
-
- case UNOP_POSTDECREMENT:
- print_subexp (exp, pos, stream, PREC_SUFFIX);
- ! fprintf_filtered (stream, "--");
- return;
-
- case UNOP_CAST:
- (*pos) += 2;
- if ((int) prec > (int) PREC_PREFIX)
- ! fprintf_filtered (stream, "(");
- ! fprintf_filtered (stream, "(");
- type_print (exp->elts[pc + 1].type, "", stream, 0);
- ! fprintf_filtered (stream, ") ");
- print_subexp (exp, pos, stream, PREC_PREFIX);
- if ((int) prec > (int) PREC_PREFIX)
- ! fprintf_filtered (stream, ")");
- return;
-
- case UNOP_MEMVAL:
- (*pos) += 2;
- if ((int) prec > (int) PREC_PREFIX)
- ! fprintf_filtered (stream, "(");
- ! fprintf_filtered (stream, "{");
- type_print (exp->elts[pc + 1].type, "", stream, 0);
- ! fprintf_filtered (stream, "} ");
- print_subexp (exp, pos, stream, PREC_PREFIX);
- if ((int) prec > (int) PREC_PREFIX)
- ! fprintf_filtered (stream, ")");
- return;
-
- case BINOP_ASSIGN_MODIFY:
- ***************
- *** 273,283 ****
- }
-
- if ((int) myprec < (int) prec)
- ! fprintf (stream, "(");
- if ((int) opcode > (int) BINOP_END)
- {
- /* Unary prefix operator. */
- ! fprintf (stream, "%s", op_str);
- print_subexp (exp, pos, stream, PREC_PREFIX);
- }
- else
- --- 273,283 ----
- }
-
- if ((int) myprec < (int) prec)
- ! fprintf_filtered (stream, "(");
- if ((int) opcode > (int) BINOP_END)
- {
- /* Unary prefix operator. */
- ! fprintf_filtered (stream, "%s", op_str);
- print_subexp (exp, pos, stream, PREC_PREFIX);
- }
- else
- ***************
- *** 289,299 ****
- print_subexp (exp, pos, stream, (int) myprec + assoc);
- /* Print the operator itself. */
- if (assign_modify)
- ! fprintf (stream, " %s= ", op_str);
- else if (op_str[0] == ',')
- ! fprintf (stream, "%s ", op_str);
- else
- ! fprintf (stream, " %s ", op_str);
- /* Print right operand.
- If operator is left-associative,
- increment precedence for this operand. */
- --- 289,299 ----
- print_subexp (exp, pos, stream, (int) myprec + assoc);
- /* Print the operator itself. */
- if (assign_modify)
- ! fprintf_filtered (stream, " %s= ", op_str);
- else if (op_str[0] == ',')
- ! fprintf_filtered (stream, "%s ", op_str);
- else
- ! fprintf_filtered (stream, " %s ", op_str);
- /* Print right operand.
- If operator is left-associative,
- increment precedence for this operand. */
- ***************
- *** 300,304 ****
- print_subexp (exp, pos, stream, (int) myprec + !assoc);
- }
- if ((int) myprec < (int) prec)
- ! fprintf (stream, ")");
- }
- --- 300,304 ----
- print_subexp (exp, pos, stream, (int) myprec + !assoc);
- }
- if ((int) myprec < (int) prec)
- ! fprintf_filtered (stream, ")");
- }
- *** 1.4 1991/09/20 23:51:25
- --- expread.c 1992/01/14 20:05:58
- ***************
- *** 596,602 ****
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf(stderr, "Starting parse\n");
- #endif
-
- yystate = 0;
- --- 596,602 ----
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf_filtered(stderr, "Starting parse\n");
- #endif
-
- yystate = 0;
- ***************
- *** 677,683 ****
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf(stderr, "Stack size increased to %d\n", yystacksize);
- #endif
-
- if (yyssp >= yyss + yystacksize - 1)
- --- 677,683 ----
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf_filtered(stderr, "Stack size increased to %d\n", yystacksize);
- #endif
-
- if (yyssp >= yyss + yystacksize - 1)
- ***************
- *** 686,692 ****
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf(stderr, "Entering state %d\n", yystate);
- #endif
-
- yybackup:
- --- 686,692 ----
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf_filtered(stderr, "Entering state %d\n", yystate);
- #endif
-
- yybackup:
- ***************
- *** 710,716 ****
- {
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf(stderr, "Reading a token: ");
- #endif
- yychar = YYLEX;
- }
- --- 710,716 ----
- {
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf_filtered(stderr, "Reading a token: ");
- #endif
- yychar = YYLEX;
- }
- ***************
- *** 724,730 ****
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf(stderr, "Now at end of input.\n");
- #endif
- }
- else
- --- 724,730 ----
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf_filtered(stderr, "Now at end of input.\n");
- #endif
- }
- else
- ***************
- *** 733,739 ****
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
- #endif
- }
-
- --- 733,739 ----
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf_filtered(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
- #endif
- }
-
- ***************
- *** 767,773 ****
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
- #endif
-
- /* Discard the token being shifted unless it is eof. */
- --- 767,773 ----
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf_filtered(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
- #endif
-
- /* Discard the token being shifted unless it is eof. */
- ***************
- *** 802,814 ****
- {
- int i;
-
- ! fprintf (stderr, "Reducing via rule %d (line %d), ",
- yyn, yyrline[yyn]);
-
- /* Print the symboles being reduced, and their result. */
- for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
- ! fprintf (stderr, "%s ", yytname[yyrhs[i]]);
- ! fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
- }
- #endif
-
- --- 802,814 ----
- {
- int i;
-
- ! fprintf_filtered (stderr, "Reducing via rule %d (line %d), ",
- yyn, yyrline[yyn]);
-
- /* Print the symboles being reduced, and their result. */
- for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
- ! fprintf_filtered (stderr, "%s ", yytname[yyrhs[i]]);
- ! fprintf_filtered (stderr, " -> %s\n", yytname[yyr1[yyn]]);
- }
- #endif
-
- ***************
- *** 1181,1190 ****
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- ! fprintf (stderr, "state stack now");
- while (ssp1 != yyssp)
- ! fprintf (stderr, " %d", *++ssp1);
- ! fprintf (stderr, "\n");
- }
- #endif
-
- --- 1181,1190 ----
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- ! fprintf_filtered (stderr, "state stack now");
- while (ssp1 != yyssp)
- ! fprintf_filtered (stderr, " %d", *++ssp1);
- ! fprintf_filtered (stderr, "\n");
- }
- #endif
-
- ***************
- *** 1277,1283 ****
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
- #endif
-
- yychar = YYEMPTY;
- --- 1277,1283 ----
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf_filtered(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
- #endif
-
- yychar = YYEMPTY;
- ***************
- *** 1312,1321 ****
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- ! fprintf (stderr, "Error: state stack now");
- while (ssp1 != yyssp)
- ! fprintf (stderr, " %d", *++ssp1);
- ! fprintf (stderr, "\n");
- }
- #endif
-
- --- 1312,1321 ----
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- ! fprintf_filtered (stderr, "Error: state stack now");
- while (ssp1 != yyssp)
- ! fprintf_filtered (stderr, " %d", *++ssp1);
- ! fprintf_filtered (stderr, "\n");
- }
- #endif
-
- ***************
- *** 1345,1351 ****
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf(stderr, "Shifting error token, ");
- #endif
-
- *++yyvsp = yylval;
- --- 1345,1351 ----
-
- #if YYDEBUG != 0
- if (yydebug)
- ! fprintf_filtered(stderr, "Shifting error token, ");
- #endif
-
- *++yyvsp = yylval;
- *** 1.4 1991/10/05 20:59:54
- --- findvar.c 1992/01/14 20:05:59
- ***************
- *** 43,48 ****
- --- 43,51 ----
- register FRAME frame1 = 0;
- register CORE_ADDR addr = 0;
-
- + if (frame == 0) /* No regs saved if want current frame */
- + return 0;
- +
- while (1)
- {
- QUIT;
- ***************
- *** 69,75 ****
- {
- register CORE_ADDR addr;
-
- ! if (regnum == FP_REGNUM)
- {
- bcopy (&selected_frame, myaddr, sizeof (CORE_ADDR));
- return;
- --- 72,78 ----
- {
- register CORE_ADDR addr;
-
- ! if (regnum == FP_REGNUM && selected_frame)
- {
- bcopy (&selected_frame, myaddr, sizeof (CORE_ADDR));
- return;
- ***************
- *** 129,135 ****
- Note that you must call `fetch_registers' once
- before examining or depositing any registers. */
-
- ! char registers[REGISTER_BYTES];
-
- /* Copy LEN bytes of consecutive data from registers
- starting with the REGBYTE'th byte of register data
- --- 132,138 ----
- Note that you must call `fetch_registers' once
- before examining or depositing any registers. */
-
- ! char registers[REGISTER_BYTES + 64];
-
- /* Copy LEN bytes of consecutive data from registers
- starting with the REGBYTE'th byte of register data
- ***************
- *** 152,158 ****
- int len;
- {
- bcopy (myaddr, ®isters[regbyte], len);
- ! if (have_inferior_p ())
- store_inferior_registers (-1);
- }
-
- --- 155,161 ----
- int len;
- {
- bcopy (myaddr, ®isters[regbyte], len);
- ! /* if (have_inferior_p ()) */
- store_inferior_registers (-1);
- }
-
- ***************
- *** 176,182 ****
- /* This loses when REGISTER_RAW_SIZE (regno) != sizeof (int) */
- *(int *) ®isters[REGISTER_BYTE (regno)] = val;
-
- ! if (have_inferior_p ())
- store_inferior_registers (regno);
- }
-
- --- 179,185 ----
- /* This loses when REGISTER_RAW_SIZE (regno) != sizeof (int) */
- *(int *) ®isters[REGISTER_BYTE (regno)] = val;
-
- ! /* if (have_inferior_p ()) */
- store_inferior_registers (regno);
- }
-
- ***************
- *** 228,236 ****
- return v;
-
- case LOC_CONST_BYTES:
- ! bcopy (val, VALUE_CONTENTS (v), len);
- ! VALUE_LVAL (v) = not_lval;
- ! return v;
-
- case LOC_STATIC:
- addr = val;
- --- 231,244 ----
- return v;
-
- case LOC_CONST_BYTES:
- ! {
- ! char *bytes_addr;
- ! bytes_addr = SYMBOL_VALUE_BYTES (var);
- ! bcopy (bytes_addr, VALUE_CONTENTS (v), len);
- ! VALUE_LVAL (v) = not_lval;
- ! return v;
- ! }
- !
-
- case LOC_STATIC:
- addr = val;
- ***************
- *** 238,248 ****
- --- 246,260 ----
-
- case LOC_ARG:
- fi = get_frame_info (frame);
- + if(fi.frame == 0)
- + return 0;
- addr = val + FRAME_ARGS_ADDRESS (fi);
- break;
-
- case LOC_LOCAL:
- fi = get_frame_info (frame);
- + if(fi.frame == 0)
- + return 0;
- addr = val + FRAME_LOCALS_ADDRESS (fi);
- break;
-
- *** 1.3 1991/09/20 23:51:25
- --- gdb.texinfo 1992/01/14 20:06:01
- ***************
- *** 543,551 ****
-
- @item gcc-mshort
- @kindex gcc -mshort
- ! While atariST gdb tries to intut when the exec--file has been compiled
- ! for 16 bit integer defaults (gcc -mshort), it is not always successful.
- ! the @samp{gcc-mshort} command informs gdb of this fact.
- @end table
-
- While all file-specifying commands allow both absolute and relative
- --- 543,554 ----
-
- @item gcc-mshort
- @kindex gcc -mshort
- ! When trying to debug an exec--file that has been compiled
- ! for 16 bit integer defaults (gcc -mshort)
- ! the @samp{gcc-mshort} command informs gdb of this fact. This command
- ! is only useful if you issue it before you read the symbol--file. The preferred
- ! way to specify this fact is to specify the @samp{-mshort} command line
- ! option to gdb,ttp when you invoke it.
- @end table
-
- While all file-specifying commands allow both absolute and relative
- ***************
- *** 609,619 ****
- To start your program under GDB, use the @samp{run} command. The program
- must already have been specified using the @samp{exec-file} command or with
- an argument to GDB (@pxref{Files}); what @samp{run} does is create an
- ! inferior process, load the program into it, and set it in motion. And
- then it breaks immediately to allow you enter further GDB commands.
- After you have done so, you can then continue execution with a @samp{cont}
- command. The only GDB command you may enter before you issue the
- ! @samp{run} is the @samp{set-args} command.
-
- The execution of a program is affected by certain information it
- receives from its superior. GDB provides ways to specify this
- --- 612,627 ----
- To start your program under GDB, use the @samp{run} command. The program
- must already have been specified using the @samp{exec-file} command or with
- an argument to GDB (@pxref{Files}); what @samp{run} does is create an
- ! inferior process, load the program into it, passes it command line
- ! arguements and sets it in motion. And
- then it breaks immediately to allow you enter further GDB commands.
- After you have done so, you can then continue execution with a @samp{cont}
- command. The only GDB command you may enter before you issue the
- ! @samp{run} is the @samp{set-args} command. Note that you can also
- ! specify arguements for the inferior process with the @samp{run}
- ! command. On the atariST there is no way to re-run the program
- ! being debugged. You will have to exit GDB and start again. This
- ! restriction is mostly due to the single tasking nature of TOS.
-
- The execution of a program is affected by certain information it
- receives from its superior. GDB provides ways to specify this
- ***************
- *** 664,675 ****
- @samp{run} command. No globbing or redirections are done.
-
- @kindex set-args
- ! The command @samp{set-args} can be used to specify the arguments to be used
- ! the next time the program is run. If @samp{set-args} has no arguments, it
- ! means to use no arguments the next time the program is run. If you have
- ! run your program with arguments and want to run it again with no arguments,
- ! this is the only way to do so. Re-running a program on the atariST is
- ! discouraged. Exit GDB and enter it again afresh.
-
- @node Environment, Working Directory, Arguments, Running
- @section Your Program's Environment
- --- 672,683 ----
- @samp{run} command. No globbing or redirections are done.
-
- @kindex set-args
- ! The command @samp{set-args} can is used to specify the arguments to be passed
- ! to the program being debugged when it is run. If @samp{set-args} has no
- ! arguments, it means to use no arguments when the program is run.
- ! On the atariST there is NO way to re-run a program without arguements or
- ! with a new set of arguements once the initial run command has been issued.
- ! Exit GDB and enter it again afresh.
-
- @node Environment, Working Directory, Arguments, Running
- @section Your Program's Environment
- ***************
- *** 2880,2885 ****
- --- 2888,2899 ----
- @section Mode Options
-
- @table @samp
- + @item -mshort
- + This option must be specified when you are going to debug a program that
- + has been compiled with 16 bit int (@samp{gcc -mshort}). In earlier
- + version of atariST gdb, it tried to intut this information, but now
- + it must be explicitly specified by the @samp{-mshort} option.
- +
- @item -nx
- Do not execute commands from the init files @file{.gdbinit}.
- Normally, the commands in these files are executed after all the
- *** 1.3 1991/05/20 18:06:03
- --- gnu-out.h 1992/01/14 20:06:01
- ***************
- *** 117,122 ****
- --- 117,143 ----
- /* Address of data segment in memory after it is loaded.
- Note that it is up to you to define SEGMENT_SIZE
- on machines not listed here. */
- + #if defined(atarist) || defined(CROSSATARI) || defined(atariminix) || defined(MINIX)
- + # ifdef vax
- + # undef vax
- + # endif
- + # ifdef is68k
- + # undef is68k
- + # endif
- + # ifdef pyr
- + # undef pyr
- + # endif
- + # ifdef hp300
- + # undef hp300
- + # endif
- + # ifdef sony
- + # undef sony
- + # endif
- + # ifdef PORTAR
- + # undef PORTAR
- + # endif
- + #endif
- +
- #if defined(vax) || defined(hp300) || defined(pyr)
- #define SEGMENT_SIZE page_size
- #endif
- ***************
- *** 129,134 ****
- --- 150,158 ----
- #if defined(m68k) && defined(PORTAR)
- #define PAGE_SIZE 0x400
- #define SEGMENT_SIZE PAGE_SIZE
- + #endif
- + #if defined(atarist) || defined(CROSSATARI) || defined(atariminix) || defined(MINIX)
- + #define SEGMENT_SIZE 2
- #endif
-
- #define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1))
- *** 1.8 1991/10/05 20:59:54
- --- infcmd.c 1992/01/14 20:06:02
- ***************
- *** 41,47 ****
- /* String containing arguments to give to the program,
- with a space added at the front. Just a space means no args. */
-
- ! static char *inferior_args;
-
- /* File name for default use for standard in/out in the inferior. */
-
- --- 41,47 ----
- /* String containing arguments to give to the program,
- with a space added at the front. Just a space means no args. */
-
- ! static char *inferior_args = (char *)NULL;
-
- /* File name for default use for standard in/out in the inferior. */
-
- ***************
- *** 118,124 ****
- set_args_command (args)
- char *args;
- {
- ! free (inferior_args);
- if (!args) args = "";
- inferior_args = concat (" ", args, "");
- }
- --- 118,133 ----
- set_args_command (args)
- char *args;
- {
- ! #ifdef atarist
- ! if(have_inferior_p())
- ! error("Cannot set-args after the inferior program has been started\
- ! on the atariST.\n To set args to be passed to an inferior process either\
- ! \n\tissue the set-args command before the initial run command\
- ! \n\tor specify the args for the inferior process in the initial run command.");
- ! #endif
- !
- ! if(inferior_args)
- ! free (inferior_args);
- if (!args) args = "";
- inferior_args = concat (" ", args, "");
- }
- ***************
- *** 151,161 ****
- --- 160,174 ----
-
- if (inferior_pid)
- {
- + #ifndef atarist
- if (query ("The program being debugged has been started already.\n\
- Start it from the beginning? "))
- kill_inferior ();
- else
- error ("Program already started.");
- + #else
- + error("Program already started. Cannot restart program on the atariST.");
- + #endif
- }
-
- #ifndef atarist
- ***************
- *** 164,170 ****
- free (allargs);
- if (from_tty)
- {
- ! printf ("Starting program: %s%s\n",
- exec_file, inferior_args);
- fflush (stdout);
- }
- --- 177,183 ----
- free (allargs);
- if (from_tty)
- {
- ! printf_filtered ("Starting program: %s%s\n",
- exec_file, inferior_args);
- fflush (stdout);
- }
- ***************
- *** 178,184 ****
- exec_file = (char *) get_exec_file (1);
- if (from_tty)
- {
- ! printf ("Starting program: %s%s\n",
- exec_file, inferior_args);
- fflush (stdout);
- }
- --- 191,197 ----
- exec_file = (char *) get_exec_file (1);
- if (from_tty)
- {
- ! printf_filtered ("Starting program: %s%s\n",
- exec_file, inferior_args);
- fflush (stdout);
- }
- ***************
- *** 185,194 ****
-
- allargs = concat ("exec ", exec_file, inferior_args);
- inferior_pid = create_inferior (allargs, environ_vector (inferior_environ));
- }
-
- clear_proceed_status ();
- -
- start_inferior ();
- }
-
- --- 198,212 ----
-
- allargs = concat ("exec ", exec_file, inferior_args);
- inferior_pid = create_inferior (allargs, environ_vector (inferior_environ));
- +
- + #ifdef atarist
- + if(inferior_pid == -9999)
- + error("Program already started or run once. Cannot restart program on\
- + the atariST.\nExit GDB and start again if you want to do this.");
- + #endif
- }
-
- clear_proceed_status ();
- start_inferior ();
- }
-
- ***************
- *** 208,218 ****
- parse_and_eval_address (proc_count_exp) - 1,
- from_tty);
- if (from_tty)
- ! printf (" ");
- }
-
- if (from_tty)
- ! printf ("Continuing.\n");
-
- clear_proceed_status ();
-
- --- 226,236 ----
- parse_and_eval_address (proc_count_exp) - 1,
- from_tty);
- if (from_tty)
- ! printf_filtered (" ");
- }
-
- if (from_tty)
- ! printf_filtered ("Continuing.\n");
-
- clear_proceed_status ();
-
- ***************
- *** 279,285 ****
-
- misc = find_pc_misc_function (stop_pc);
- terminal_ours ();
- ! printf ("Current function has no line number information.\n");
- fflush (stdout);
-
- /* No info or after _etext ("Can't happen") */
- --- 297,303 ----
-
- misc = find_pc_misc_function (stop_pc);
- terminal_ours ();
- ! printf_filtered ("Current function has no line number information.\n");
- fflush (stdout);
-
- /* No info or after _etext ("Can't happen") */
- ***************
- *** 286,292 ****
- if (misc == -1 || misc == misc_function_count - 1)
- error ("No data available on pc function.");
-
- ! printf ("Single stepping until function exit.\n");
- fflush (stdout);
-
- step_range_start = misc_function_vector[misc].address;
- --- 304,310 ----
- if (misc == -1 || misc == misc_function_count - 1)
- error ("No data available on pc function.");
-
- ! printf_filtered ("Single stepping until function exit.\n");
- fflush (stdout);
-
- step_range_start = misc_function_vector[misc].address;
- ***************
- *** 351,357 ****
-
-
- if (from_tty)
- ! printf ("Continuing at 0x%x.\n", addr);
-
- clear_proceed_status ();
- proceed (addr, 0, 0);
- --- 369,375 ----
-
-
- if (from_tty)
- ! printf_filtered ("Continuing at 0x%x.\n", addr);
-
- clear_proceed_status ();
- proceed (addr, 0, 0);
- ***************
- *** 376,382 ****
-
-
- if (from_tty)
- ! printf ("Continuing with signal %d.\n", signum);
-
- clear_proceed_status ();
- proceed (stop_pc, signum, 0);
- --- 394,400 ----
-
-
- if (from_tty)
- ! printf_filtered ("Continuing with signal %d.\n", signum);
-
- clear_proceed_status ();
- proceed (stop_pc, signum, 0);
- ***************
- *** 482,488 ****
- if (!inferior_pid)
- error ("The program is not running.");
- if (arg)
- ! /* until_break_command (arg, from_tty) */;
- else
- until_next_command (from_tty);
- }
- --- 500,508 ----
- if (!inferior_pid)
- error ("The program is not running.");
- if (arg)
- ! /* until_break_command (arg, from_tty); */
- ! error("Sorry until <break> command is a no-op on the atariST for now.\n\
- ! Only the until next command form of until (without args) is supported.");
- else
- until_next_command (from_tty);
- }
- ***************
- *** 524,530 ****
-
- if (from_tty)
- {
- ! printf ("Run till exit from ");
- print_selected_frame ();
- }
-
- --- 544,550 ----
-
- if (from_tty)
- {
- ! printf_filtered ("Run till exit from ");
- print_selected_frame ();
- }
-
- ***************
- *** 553,561 ****
- funcaddr,
- value_type,
- 1));
- ! printf ("Value returned is $%d = ", record_latest_value (val));
- value_print (val, stdout, 0);
- ! putchar ('\n');
- }
- }
-
- --- 573,581 ----
- funcaddr,
- value_type,
- 1));
- ! printf_filtered ("Value returned is $%d = ", record_latest_value (val));
- value_print (val, stdout, 0);
- ! fputc_filtered ('\n', stdout);
- }
- }
-
- ***************
- *** 564,585 ****
- {
- if (inferior_pid == 0)
- {
- ! printf ("The program being debugged is not being run.\n");
- return;
- }
-
- ! printf ("Program being debugged is in process %d, stopped at 0x%x.\n",
- inferior_pid, stop_pc);
- if (stop_step)
- ! printf ("It stopped after being stepped.\n");
- else if (stop_breakpoint)
- ! printf ("It stopped at breakpoint %d.\n", stop_breakpoint);
- else if (stop_signal)
- ! printf ("It stopped with signal %d (%s).\n",
- stop_signal,
- (stop_signal > NSIG)? "unknown": sys_siglist[stop_signal]);
-
- ! printf ("\nType \"info stack\" or \"info reg\" for more information.\n");
- }
-
- static void
- --- 584,605 ----
- {
- if (inferior_pid == 0)
- {
- ! printf_filtered ("The program being debugged is not being run.\n");
- return;
- }
-
- ! printf_filtered ("Program being debugged is in process %d, stopped at 0x%x.\n",
- inferior_pid, stop_pc);
- if (stop_step)
- ! printf_filtered ("It stopped after being stepped.\n");
- else if (stop_breakpoint)
- ! printf_filtered ("It stopped at breakpoint %d.\n", stop_breakpoint);
- else if (stop_signal)
- ! printf_filtered ("It stopped with signal %d (%s).\n",
- stop_signal,
- (stop_signal > NSIG)? "unknown": sys_siglist[stop_signal]);
-
- ! printf_filtered ("\nType \"info stack\" or \"info reg\" for more information.\n");
- }
-
- static void
- ***************
- *** 590,604 ****
- {
- register char *val = get_in_environ (inferior_environ, var);
- if (val)
- ! printf ("%s = %s\n", var, val);
- else
- ! printf ("Environment variable \"%s\" not defined.\n", var);
- }
- else
- {
- register char **vector = environ_vector (inferior_environ);
- while (*vector)
- ! printf ("%s\n", *vector++);
- }
- }
-
- --- 610,624 ----
- {
- register char *val = get_in_environ (inferior_environ, var);
- if (val)
- ! printf_filtered ("%s = %s\n", var, val);
- else
- ! printf_filtered ("Environment variable \"%s\" not defined.\n", var);
- }
- else
- {
- register char **vector = environ_vector (inferior_environ);
- while (*vector)
- ! printf_filtered ("%s\n", *vector++);
- }
- }
-
- ***************
- *** 654,660 ****
- var = savestring (arg, p - arg);
- if (nullset)
- {
- ! printf ("Setting environment variable \"%s\" to null value.\n", var);
- set_in_environ (inferior_environ, var, "");
- }
- else
- --- 674,680 ----
- var = savestring (arg, p - arg);
- if (nullset)
- {
- ! printf_filtered ("Setting environment variable \"%s\" to null value.\n", var);
- set_in_environ (inferior_environ, var, "");
- }
- else
- ***************
- *** 745,751 ****
- }
- }
- else
- ! printf ("Reg\tContents\n\n");
-
- for (i = 0; i < NUM_REGS; i++)
- {
- --- 765,771 ----
- }
- }
- else
- ! printf_filtered ("Reg\tContents\n\n");
-
- for (i = 0; i < NUM_REGS; i++)
- {
- ***************
- *** 760,766 ****
- so user can read the output. */
- if (addr_exp == 0 && i > 0 && i % 16 == 0)
- {
- ! printf ("--Type Return to print more--");
- fflush (stdout);
- read_line ();
- }
- --- 780,786 ----
- so user can read the output. */
- if (addr_exp == 0 && i > 0 && i % 16 == 0)
- {
- ! printf_filtered ("--Type Return to print more--");
- fflush (stdout);
- read_line ();
- }
- ***************
- *** 769,788 ****
- read_relative_register_raw_bytes (i, raw_buffer);
- REGISTER_CONVERT_TO_VIRTUAL (i, raw_buffer, virtual_buffer);
-
- ! printf ("%s\t", reg_names[i]);
-
- /* If virtual format is floating, print it that way. */
- if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT
- && ! INVALID_FLOAT (virtual_buffer, REGISTER_VIRTUAL_SIZE (i)))
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, stdout, 0);
- ! /* Else if virtual format is too long for printf,
- print in hex a byte at a time. */
- else if (REGISTER_VIRTUAL_SIZE (i) > sizeof (long))
- {
- register int j;
- ! printf ("0x");
- for (j = 0; j < REGISTER_VIRTUAL_SIZE (i); j++)
- ! printf ("%02x", virtual_buffer[j]);
- }
- /* Else print as integer in hex and in decimal. */
- else
- --- 789,808 ----
- read_relative_register_raw_bytes (i, raw_buffer);
- REGISTER_CONVERT_TO_VIRTUAL (i, raw_buffer, virtual_buffer);
-
- ! printf_filtered ("%s\t", reg_names[i]);
-
- /* If virtual format is floating, print it that way. */
- if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT
- && ! INVALID_FLOAT (virtual_buffer, REGISTER_VIRTUAL_SIZE (i)))
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, stdout, 0);
- ! /* Else if virtual format is too long forprintf_filtered,
- print in hex a byte at a time. */
- else if (REGISTER_VIRTUAL_SIZE (i) > sizeof (long))
- {
- register int j;
- ! printf_filtered ("0x");
- for (j = 0; j < REGISTER_VIRTUAL_SIZE (i); j++)
- ! printf_filtered ("%02x", virtual_buffer[j]);
- }
- /* Else print as integer in hex and in decimal. */
- else
- ***************
- *** 791,799 ****
-
- bcopy (virtual_buffer, &val, sizeof (long));
- if (val == 0)
- ! printf ("0");
- else
- ! printf ("0x%08x %d", val, val);
- }
-
- /* If register has different raw and virtual formats,
- --- 811,819 ----
-
- bcopy (virtual_buffer, &val, sizeof (long));
- if (val == 0)
- ! printf_filtered ("0");
- else
- ! printf_filtered ("0x%08x %d", val, val);
- }
-
- /* If register has different raw and virtual formats,
- ***************
- *** 803,817 ****
- {
- register int j;
-
- ! printf (" (raw 0x");
- for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
- ! printf ("%02x", raw_buffer[j]);
- ! printf (")");
- }
- ! printf ("\n");
- }
-
- ! printf ("Contents are relative to selected stack frame.\n");
- }
-
- #ifdef ATTACH_DETACH
- --- 823,837 ----
- {
- register int j;
-
- ! printf_filtered (" (raw 0x");
- for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
- ! printf_filtered ("%02x", raw_buffer[j]);
- ! printf_filtered (")");
- }
- ! printf_filtered ("\n");
- }
-
- ! printf_filtered ("Contents are relative to selected stack frame.\n");
- }
-
- #ifdef ATTACH_DETACH
- ***************
- *** 865,873 ****
- if (from_tty)
- {
- if (remote)
- ! printf ("Attaching remote machine\n");
- else
- ! printf ("Attaching program: %s pid %d\n",
- exec_file, pid);
- fflush (stdout);
- }
- --- 885,893 ----
- if (from_tty)
- {
- if (remote)
- ! printf_filtered ("Attaching remote machine\n");
- else
- ! printf_filtered ("Attaching program: %s pid %d\n",
- exec_file, pid);
- fflush (stdout);
- }
- ***************
- *** 906,912 ****
- char *exec_file = (char *)get_exec_file (0);
- if (exec_file == 0)
- exec_file = "";
- ! printf ("Detaching program: %s pid %d\n",
- exec_file, inferior_pid);
- fflush (stdout);
- }
- --- 926,932 ----
- char *exec_file = (char *)get_exec_file (0);
- if (exec_file == 0)
- exec_file = "";
- ! printf_filtered ("Detaching program: %s pid %d\n",
- exec_file, inferior_pid);
- fflush (stdout);
- }
- *** 1.10 1991/10/05 20:10:26
- --- m-atari.h 1992/01/14 20:06:02
- ***************
- *** 242,248 ****
- /* In the case of the Sun, the frame's nominal address
- is the address of a 4-byte word containing the calling frame's address. */
-
- ! #if 0
- #define FRAME_CHAIN(thisframe) ( \
- (FRAME_SAVED_PC (thisframe) >= first_object_file_end) ? \
- read_memory_integer (thisframe, 4) : 0)
- --- 242,248 ----
- /* In the case of the Sun, the frame's nominal address
- is the address of a 4-byte word containing the calling frame's address. */
-
- ! #if 1
- #define FRAME_CHAIN(thisframe) ( \
- (FRAME_SAVED_PC (thisframe) >= first_object_file_end) ? \
- read_memory_integer (thisframe, 4) : 0)
- *** 1.3 1991/09/15 06:01:22
- --- m68k-pinsn.c 1992/01/14 20:06:03
- ***************
- *** 118,128 ****
- /* Handle undefined instructions. */
- if (best < 0)
- {
- ! fprintf (stream, "0%o", (buffer[0] << 8) + buffer[1]);
- return 2;
- }
-
- ! fprintf (stream, "%s", m68k_opcodes[best].name);
-
- /* Point at first word of argument data,
- and at descriptor for first argument. */
- --- 118,128 ----
- /* Handle undefined instructions. */
- if (best < 0)
- {
- ! fprintf_filtered (stream, "0%o", (buffer[0] << 8) + buffer[1]);
- return 2;
- }
-
- ! fprintf_filtered (stream, "%s", m68k_opcodes[best].name);
-
- /* Point at first word of argument data,
- and at descriptor for first argument. */
- ***************
- *** 149,155 ****
- d = m68k_opcodes[best].args;
-
- if (*d)
- ! fputc (' ', stream);
-
- while (*d)
- {
- --- 149,155 ----
- d = m68k_opcodes[best].args;
-
- if (*d)
- ! fputc_filtered (' ', stream);
-
- while (*d)
- {
- ***************
- *** 156,162 ****
- p = print_insn_arg (d, buffer, p, memaddr + p - buffer, stream);
- d += 2;
- if (*d && *(d - 2) != 'I' && *d != 'k')
- ! fprintf (stream, ",");
- }
- return p - buffer;
- }
- --- 156,162 ----
- p = print_insn_arg (d, buffer, p, memaddr + p - buffer, stream);
- d += 2;
- if (*d && *(d - 2) != 'I' && *d != 'k')
- ! fprintf_filtered (stream, ",");
- }
- return p - buffer;
- }
- ***************
- *** 180,194 ****
- switch (*d)
- {
- case 'C':
- ! fprintf (stream, "ccr");
- break;
-
- case 'S':
- ! fprintf (stream, "sr");
- break;
-
- case 'U':
- ! fprintf (stream, "usp");
- break;
-
- case 'J':
- --- 180,194 ----
- switch (*d)
- {
- case 'C':
- ! fprintf_filtered (stream, "ccr");
- break;
-
- case 'S':
- ! fprintf_filtered (stream, "sr");
- break;
-
- case 'U':
- ! fprintf_filtered (stream, "usp");
- break;
-
- case 'J':
- ***************
- *** 202,212 ****
- for (regno = sizeof names / sizeof names[0] - 1; regno >= 0; regno--)
- if (names[regno].value == val)
- {
- ! fprintf (stream, names[regno].name);
- break;
- }
- if (regno < 0)
- ! fprintf (stream, "%d", val);
- }
- break;
-
- --- 202,212 ----
- for (regno = sizeof names / sizeof names[0] - 1; regno >= 0; regno--)
- if (names[regno].value == val)
- {
- ! fprintf_filtered (stream, names[regno].name);
- break;
- }
- if (regno < 0)
- ! fprintf_filtered (stream, "%d", val);
- }
- break;
-
- ***************
- *** 215,221 ****
- /* 0 means 8, except for the bkpt instruction... */
- if (val == 0 && d[1] != 's')
- val = 8;
- ! fprintf (stream, "#%d", val);
- break;
-
- case 'M':
- --- 215,221 ----
- /* 0 means 8, except for the bkpt instruction... */
- if (val == 0 && d[1] != 's')
- val = 8;
- ! fprintf_filtered (stream, "#%d", val);
- break;
-
- case 'M':
- ***************
- *** 222,279 ****
- val = fetch_arg (buffer, place, 8);
- if (val & 0x80)
- val = val - 0x100;
- ! fprintf (stream, "#%d", val);
- break;
-
- case 'T':
- val = fetch_arg (buffer, place, 4);
- ! fprintf (stream, "#%d", val);
- break;
-
- case 'D':
- ! fprintf (stream, "%s", reg_names[fetch_arg (buffer, place, 3)]);
- break;
-
- case 'A':
- ! fprintf (stream, "%s",
- reg_names[fetch_arg (buffer, place, 3) + 010]);
- break;
-
- case 'R':
- ! fprintf (stream, "%s", reg_names[fetch_arg (buffer, place, 4)]);
- break;
-
- case 'F':
- ! fprintf (stream, "fp%d", fetch_arg (buffer, place, 3));
- break;
-
- case 'O':
- val = fetch_arg (buffer, place, 6);
- if (val & 0x20)
- ! fprintf (stream, "%s", reg_names [val & 7]);
- else
- ! fprintf (stream, "%d", val);
- break;
-
- case '+':
- ! fprintf (stream, "%s@+",
- reg_names[fetch_arg (buffer, place, 3) + 8]);
- break;
-
- case '-':
- ! fprintf (stream, "%s@-",
- reg_names[fetch_arg (buffer, place, 3) + 8]);
- break;
-
- case 'k':
- if (place == 'k')
- ! fprintf (stream, "{%s}", reg_names[fetch_arg (buffer, place, 3)]);
- else if (place == 'C')
- {
- val = fetch_arg (buffer, place, 7);
- if ( val > 63 ) /* This is a signed constant. */
- val -= 128;
- ! fprintf (stream, "{#%d}", val);
- }
- else
- error ("Invalid arg format in opcode table: \"%c%c\".",
- --- 222,279 ----
- val = fetch_arg (buffer, place, 8);
- if (val & 0x80)
- val = val - 0x100;
- ! fprintf_filtered (stream, "#%d", val);
- break;
-
- case 'T':
- val = fetch_arg (buffer, place, 4);
- ! fprintf_filtered (stream, "#%d", val);
- break;
-
- case 'D':
- ! fprintf_filtered (stream, "%s", reg_names[fetch_arg (buffer, place, 3)]);
- break;
-
- case 'A':
- ! fprintf_filtered (stream, "%s",
- reg_names[fetch_arg (buffer, place, 3) + 010]);
- break;
-
- case 'R':
- ! fprintf_filtered (stream, "%s", reg_names[fetch_arg (buffer, place, 4)]);
- break;
-
- case 'F':
- ! fprintf_filtered (stream, "fp%d", fetch_arg (buffer, place, 3));
- break;
-
- case 'O':
- val = fetch_arg (buffer, place, 6);
- if (val & 0x20)
- ! fprintf_filtered (stream, "%s", reg_names [val & 7]);
- else
- ! fprintf_filtered (stream, "%d", val);
- break;
-
- case '+':
- ! fprintf_filtered (stream, "%s@+",
- reg_names[fetch_arg (buffer, place, 3) + 8]);
- break;
-
- case '-':
- ! fprintf_filtered (stream, "%s@-",
- reg_names[fetch_arg (buffer, place, 3) + 8]);
- break;
-
- case 'k':
- if (place == 'k')
- ! fprintf_filtered (stream, "{%s}", reg_names[fetch_arg (buffer, place, 3)]);
- else if (place == 'C')
- {
- val = fetch_arg (buffer, place, 7);
- if ( val > 63 ) /* This is a signed constant. */
- val -= 128;
- ! fprintf_filtered (stream, "{#%d}", val);
- }
- else
- error ("Invalid arg format in opcode table: \"%c%c\".",
- ***************
- *** 300,306 ****
- else
- error ("Invalid arg format in opcode table: \"%c%c\".",
- *d, place);
- ! fprintf (stream, "#%d", val);
- break;
-
- case 'B':
- --- 300,306 ----
- else
- error ("Invalid arg format in opcode table: \"%c%c\".",
- *d, place);
- ! fprintf_filtered (stream, "#%d", val);
- break;
-
- case 'B':
- ***************
- *** 334,345 ****
-
- case 'd':
- val = NEXTWORD (p);
- ! fprintf (stream, "%s@(%d)",
- reg_names[fetch_arg (buffer, place, 3)], val);
- break;
-
- case 's':
- ! fprintf (stream, "%s",
- fpcr_names[fetch_arg (buffer, place, 3)]);
- break;
-
- --- 334,345 ----
-
- case 'd':
- val = NEXTWORD (p);
- ! fprintf_filtered (stream, "%s@(%d)",
- reg_names[fetch_arg (buffer, place, 3)], val);
- break;
-
- case 's':
- ! fprintf_filtered (stream, "%s",
- fpcr_names[fetch_arg (buffer, place, 3)]);
- break;
-
- ***************
- *** 346,352 ****
- case 'I':
- val = fetch_arg (buffer, 'd', 3); /* Get coprocessor ID... */
- if (val != 1) /* Unusual coprocessor ID? */
- ! fprintf (stream, "(cpid=%d) ", val);
- if (place == 'i')
- p += 2; /* Skip coprocessor extended operands */
- break;
- --- 346,352 ----
- case 'I':
- val = fetch_arg (buffer, 'd', 3); /* Get coprocessor ID... */
- if (val != 1) /* Unusual coprocessor ID? */
- ! fprintf_filtered (stream, "(cpid=%d) ", val);
- if (place == 'i')
- p += 2; /* Skip coprocessor extended operands */
- break;
- ***************
- *** 376,403 ****
- switch (val >> 3)
- {
- case 0:
- ! fprintf (stream, "%s", reg_names[val]);
- break;
-
- case 1:
- ! fprintf (stream, "%s", regname);
- break;
-
- case 2:
- ! fprintf (stream, "%s@", regname);
- break;
-
- case 3:
- ! fprintf (stream, "%s@+", regname);
- break;
-
- case 4:
- ! fprintf (stream, "%s@-", regname);
- break;
-
- case 5:
- val = NEXTWORD (p);
- ! fprintf (stream, "%s@(%d)", regname, val);
- break;
-
- case 6:
- --- 376,403 ----
- switch (val >> 3)
- {
- case 0:
- ! fprintf_filtered (stream, "%s", reg_names[val]);
- break;
-
- case 1:
- ! fprintf_filtered (stream, "%s", regname);
- break;
-
- case 2:
- ! fprintf_filtered (stream, "%s@", regname);
- break;
-
- case 3:
- ! fprintf_filtered (stream, "%s@+", regname);
- break;
-
- case 4:
- ! fprintf_filtered (stream, "%s@-", regname);
- break;
-
- case 5:
- val = NEXTWORD (p);
- ! fprintf_filtered (stream, "%s@(%d)", regname, val);
- break;
-
- case 6:
- ***************
- *** 409,421 ****
- {
- case 0:
- val = NEXTWORD (p);
- ! fprintf (stream, "@#");
- print_address (val, stream);
- break;
-
- case 1:
- val = NEXTLONG (p);
- ! fprintf (stream, "@#");
- print_address (val, stream);
- break;
-
- --- 409,421 ----
- {
- case 0:
- val = NEXTWORD (p);
- ! fprintf_filtered (stream, "@#");
- print_address (val, stream);
- break;
-
- case 1:
- val = NEXTLONG (p);
- ! fprintf_filtered (stream, "@#");
- print_address (val, stream);
- break;
-
- ***************
- *** 468,480 ****
- *d, place);
- }
- if ( flt_p ) /* Print a float? */
- ! fprintf (stream, "#%g", flval);
- else
- ! fprintf (stream, "#%d", val);
- break;
-
- default:
- ! fprintf (stream, "<invalid address mode 0%o>", val);
- }
- }
- break;
- --- 468,480 ----
- *d, place);
- }
- if ( flt_p ) /* Print a float? */
- ! fprintf_filtered (stream, "#%g", flval);
- else
- ! fprintf_filtered (stream, "#%d", val);
- break;
-
- default:
- ! fprintf_filtered (stream, "<invalid address mode 0%o>", val);
- }
- }
- break;
- ***************
- *** 491,497 ****
- p = p1 > p ? p1 : p;
- if (val == 0)
- {
- ! fputs ("#0", stream);
- break;
- }
- if (*d == 'l')
- --- 491,497 ----
- p = p1 > p ? p1 : p;
- if (val == 0)
- {
- ! fputs_filtered ("#0", stream);
- break;
- }
- if (*d == 'l')
- ***************
- *** 509,522 ****
- {
- int first_regno;
- if (doneany)
- ! fputs ("/", stream);
- doneany = 1;
- ! fprintf (stream, "%s", reg_names[regno]);
- first_regno = regno;
- while (val & (1 << (regno + 1)))
- ++regno;
- if (regno > first_regno)
- ! fprintf (stream, "-%s", reg_names[regno]);
- }
- }
- else if (place == '3')
- --- 509,522 ----
- {
- int first_regno;
- if (doneany)
- ! fputs_filtered ("/", stream);
- doneany = 1;
- ! fprintf_filtered (stream, "%s", reg_names[regno]);
- first_regno = regno;
- while (val & (1 << (regno + 1)))
- ++regno;
- if (regno > first_regno)
- ! fprintf_filtered (stream, "-%s", reg_names[regno]);
- }
- }
- else if (place == '3')
- ***************
- *** 526,532 ****
- val = fetch_arg (buffer, place, 8);
- if (val == 0)
- {
- ! fputs ("#0", stream);
- break;
- }
- if (*d == 'l')
- --- 526,532 ----
- val = fetch_arg (buffer, place, 8);
- if (val == 0)
- {
- ! fputs_filtered ("#0", stream);
- break;
- }
- if (*d == 'l')
- ***************
- *** 544,557 ****
- {
- int first_regno;
- if (doneany)
- ! fputs ("/", stream);
- doneany = 1;
- ! fprintf (stream, "fp%d", regno);
- first_regno = regno;
- while (val & (1 << (regno + 1)))
- ++regno;
- if (regno > first_regno)
- ! fprintf (stream, "-fp%d", regno);
- }
- }
- else
- --- 544,557 ----
- {
- int first_regno;
- if (doneany)
- ! fputs_filtered ("/", stream);
- doneany = 1;
- ! fprintf_filtered (stream, "fp%d", regno);
- first_regno = regno;
- while (val & (1 << (regno + 1)))
- ++regno;
- if (regno > first_regno)
- ! fprintf_filtered (stream, "-fp%d", regno);
- }
- }
- else
- ***************
- *** 686,692 ****
-
- /* Generate the text for the index register.
- Where this will be output is not yet determined. */
- ! sprintf (buf, "[%s.%c%s]",
- reg_names[(word >> 12) & 0xf],
- (word & 0x800) ? 'l' : 'w',
- scales[(word >> 9) & 3]);
- --- 686,692 ----
-
- /* Generate the text for the index register.
- Where this will be output is not yet determined. */
- ! printf_filtered (buf, "[%s.%c%s]",
- reg_names[(word >> 12) & 0xf],
- (word & 0x800) ? 'l' : 'w',
- scales[(word >> 9) & 3]);
- ***************
- *** 699,705 ****
- ((word & 0x80) ? word | 0xff00 : word & 0xff)
- + ((basereg == -1) ? addr : 0),
- stream);
- ! fputs (buf, stream);
- return p;
- }
-
- --- 699,705 ----
- ((word & 0x80) ? word | 0xff00 : word & 0xff)
- + ((basereg == -1) ? addr : 0),
- stream);
- ! fputs_filtered (buf, stream);
- return p;
- }
-
- ***************
- *** 727,733 ****
- if ((word & 7) == 0)
- {
- print_base (basereg, base_disp, stream);
- ! fputs (buf, stream);
- return p;
- }
-
- --- 727,733 ----
- if ((word & 7) == 0)
- {
- print_base (basereg, base_disp, stream);
- ! fputs_filtered (buf, stream);
- return p;
- }
-
- ***************
- *** 743,757 ****
- outer_disp = NEXTLONG (p);
- }
-
- ! fprintf (stream, "%d(", outer_disp);
- print_base (basereg, base_disp, stream);
-
- /* If postindexed, print the closeparen before the index. */
- if (word & 4)
- ! fprintf (stream, ")%s", buf);
- /* If preindexed, print the closeparen after the index. */
- else
- ! fprintf (stream, "%s)", buf);
-
- return p;
- }
- --- 743,757 ----
- outer_disp = NEXTLONG (p);
- }
-
- ! fprintf_filtered (stream, "%d(", outer_disp);
- print_base (basereg, base_disp, stream);
-
- /* If postindexed, print the closeparen before the index. */
- if (word & 4)
- ! fprintf_filtered (stream, ")%s", buf);
- /* If preindexed, print the closeparen after the index. */
- else
- ! fprintf_filtered (stream, "%s)", buf);
-
- return p;
- }
- ***************
- *** 766,776 ****
- FILE *stream;
- {
- if (regno == -2)
- ! fprintf (stream, "%d", disp);
- else if (regno == -1)
- ! fprintf (stream, "0x%x", disp);
- else
- ! fprintf (stream, "%d(%s)", disp, reg_names[regno]);
- }
-
- #ifdef _M68881
- --- 766,776 ----
- FILE *stream;
- {
- if (regno == -2)
- ! fprintf_filtered (stream, "%d", disp);
- else if (regno == -1)
- ! fprintf_filtered (stream, "0x%x", disp);
- else
- ! fprintf_filtered (stream, "%d(%s)", disp, reg_names[regno]);
- }
-
- #ifdef _M68881
- *** 1.4 1991/09/14 19:34:34
- --- main.c 1992/01/14 20:06:04
- ***************
- *** 85,90 ****
- --- 85,98 ----
- static void source_command ();
- void print_gdb_version ();
-
- + #ifdef atarist
- + static void Save_all_vectors();
- + static void Restore_all_vectors();
- + static volatile FILE *atari_logfile;
- + extern int gcc_mshort;
- + #endif
- + void really_exit();
- +
- /* gdb prints this when reading a command interactively */
- static char *prompt;
-
- ***************
- *** 129,135 ****
- val = (*func) (arg);
- else
- {
- ! fprintf (stderr, "%s\n", errstring);
- val = 0;
- }
-
- --- 137,143 ----
- val = (*func) (arg);
- else
- {
- ! fprintf_filtered (stderr, "%s\n", errstring);
- val = 0;
- }
-
- ***************
- *** 163,169 ****
- linesize = 100;
- line = (char *) xmalloc (linesize);
- instream = stdin;
- !
- getwd (dirbuf);
- #ifdef atarist
- #ifndef JRDLIB
- --- 171,178 ----
- linesize = 100;
- line = (char *) xmalloc (linesize);
- instream = stdin;
- ! atari_logfile = 0;
- !
- getwd (dirbuf);
- #ifdef atarist
- #ifndef JRDLIB
- ***************
- *** 206,212 ****
- frame_file_full_name = 1;
- #ifdef atarist
- else if (!strcmp(argv[i], "-D"))
- ! atari_debug = 1;
- #endif
- else if (argv[i][0] == '-')
- i++;
- --- 215,235 ----
- frame_file_full_name = 1;
- #ifdef atarist
- else if (!strcmp(argv[i], "-D"))
- ! atari_debug++;
- ! else if (!strcmp(argv[i], "-mshort"))
- ! gcc_mshort = 1;
- ! else if (!strcmp(argv[i], "-L"))
- ! {
- !
- ! if(!atari_logfile)
- ! {
- ! if(!(atari_logfile = fopen("gdb.log", "at")))
- ! {
- ! fprintf_filtered(stderr,"Failed to open logfile gdb.log\n");
- ! exit(1);
- ! }
- ! }
- ! }
- #endif
- else if (argv[i][0] == '-')
- i++;
- ***************
- *** 214,219 ****
- --- 237,245 ----
-
- /* Run the init function of each source file */
-
- + #ifdef atarist
- + Save_all_vectors(); /* save all exception vectors */
- + #endif
- initialize_all_files ();
- initialize_main (); /* But that omits this file! Do it now */
-
- ***************
- *** 242,247 ****
- --- 268,275 ----
- || !strcmp (arg, "-fullname")
- #ifdef atarist
- || !strcmp (arg, "-D")
- + || !strcmp (arg, "-mshort")
- + || !strcmp (arg, "-L")
- #endif
- )
- /* Already processed above */
- ***************
- *** 248,254 ****
- continue;
-
- if (++i == argc)
- ! fprintf (stderr, "No argument follows \"%s\".\n", arg);
- if (!setjmp (to_top_level))
- {
- /* -s foo: get syms from foo. -e foo: execute foo.
- --- 276,282 ----
- continue;
-
- if (++i == argc)
- ! fprintf_filtered (stderr, "No argument follows \"%s\".\n", arg);
- if (!setjmp (to_top_level))
- {
- /* -s foo: get syms from foo. -e foo: execute foo.
- ***************
- *** 310,316 ****
- break;
-
- case 3:
- ! fprintf (stderr, "Excess command line args ignored. (%s%s)\n",
- arg, (i == argc - 1) ? "" : " ...");
- }
- }
- --- 338,344 ----
- break;
-
- case 3:
- ! fprintf_filtered (stderr, "Excess command line args ignored. (%s%s)\n",
- arg, (i == argc - 1) ? "" : " ...");
- }
- }
- ***************
- *** 341,347 ****
- fatal ("Attempt to read commands from stdin in batch mode.");
-
- if (!quiet)
- ! printf ("Type \"help\" for a list of commands.\n");
-
- /* The command loop. */
-
- --- 369,375 ----
- fatal ("Attempt to read commands from stdin in batch mode.");
-
- if (!quiet)
- ! printf_filtered ("Type \"help\" for a list of commands.\n");
-
- /* The command loop. */
-
- ***************
- *** 351,356 ****
- --- 379,385 ----
- command_loop ();
- clearerr (stdin); /* Don't get hung if C-d is typed. */
- }
- + really_exit(0);
- }
-
- /* Execute the line P as a command.
- ***************
- *** 405,411 ****
- while (!feof (instream))
- {
- if (instream == stdin)
- ! printf ("%s", prompt);
- fflush (stdout);
-
- if (window_hook && instream == stdin)
- --- 434,440 ----
- while (!feof (instream))
- {
- if (instream == stdin)
- ! printf_filtered ("%s", prompt);
- fflush (stdout);
-
- if (window_hook && instream == stdin)
- ***************
- *** 432,438 ****
- kill (getpid (), SIGTSTP);
- #endif
- signal (SIGTSTP, stop_sig);
- ! printf ("%s", prompt);
- fflush (stdout);
-
- /* Forget about any previous command -- null line now will do nothing. */
- --- 461,467 ----
- kill (getpid (), SIGTSTP);
- #endif
- signal (SIGTSTP, stop_sig);
- ! printf_filtered ("%s", prompt);
- fflush (stdout);
-
- /* Forget about any previous command -- null line now will do nothing. */
- ***************
- *** 502,512 ****
- signal (SIGTSTP, SIG_DFL);
- #endif
- immediate_quit--;
- !
- /* If we just got an empty line, and that is supposed
- to repeat the previous command, leave the last input unchanged. */
- if (p == line && repeat)
- ! return line;
-
- /* If line is a comment, clear it out. */
- p1 = line;
- --- 531,547 ----
- signal (SIGTSTP, SIG_DFL);
- #endif
- immediate_quit--;
- !
- /* If we just got an empty line, and that is supposed
- to repeat the previous command, leave the last input unchanged. */
- if (p == line && repeat)
- ! {
- ! if(atari_logfile)
- ! {
- ! fprintf(atari_logfile, "%s\n", line);
- ! }
- ! return line;
- ! }
-
- /* If line is a comment, clear it out. */
- p1 = line;
- ***************
- *** 516,521 ****
- --- 551,561 ----
-
- *p = 0;
-
- + if(atari_logfile)
- + {
- + fprintf(atari_logfile, "%s\n", line);
- + }
- +
- return line;
- }
-
- ***************
- *** 618,624 ****
- static void
- info_command ()
- {
- ! printf ("\"info\" must be followed by the name of an info command.\n");
- help_cmd (0, infolist, "info ", -1, stdout);
- }
-
- --- 658,664 ----
- static void
- info_command ()
- {
- ! printf_filtered ("\"info\" must be followed by the name of an info command.\n");
- help_cmd (0, infolist, "info ", -1, stdout);
- }
-
- ***************
- *** 705,711 ****
- }
-
- if (from_tty)
- ! printf ("Type commands for definition of \"%s\".\n\
- End with a line saying just \"end\".\n", comname);
-
- comname = savestring (comname, strlen (comname));
- --- 745,751 ----
- }
-
- if (from_tty)
- ! printf_filtered ("Type commands for definition of \"%s\".\n\
- End with a line saying just \"end\".\n", comname);
-
- comname = savestring (comname, strlen (comname));
- ***************
- *** 737,743 ****
- error ("Command \"%s\" is built-in.", comname);
-
- if (from_tty)
- ! printf ("Type documentation for \"%s\".\n\
- End with a line saying just \"end\".\n", comname);
-
- doclines = read_command_lines ();
- --- 777,783 ----
- error ("Command \"%s\" is built-in.", comname);
-
- if (from_tty)
- ! printf_filtered ("Type documentation for \"%s\".\n\
- End with a line saying just \"end\".\n", comname);
-
- doclines = read_command_lines ();
- ***************
- *** 769,775 ****
- copying_info ()
- {
- immediate_quit++;
- ! printf (" GDB GENERAL PUBLIC LICENSE\n\
- (Clarified 11 Feb 1988)\n\
- \n\
- Copyright (C) 1988 Richard M. Stallman\n\
- --- 809,815 ----
- copying_info ()
- {
- immediate_quit++;
- ! printf_filtered (" GDB GENERAL PUBLIC LICENSE\n\
- (Clarified 11 Feb 1988)\n\
- \n\
- Copyright (C) 1988 Richard M. Stallman\n\
- ***************
- *** 792,798 ****
- fflush (stdout);
- read_line ();
-
- ! printf ("\
- To make sure that everyone has such rights, we have to forbid you to\n\
- deprive anyone else of these rights. For example, if you distribute\n\
- copies of GDB, you must give the recipients all the rights that you\n\
- --- 832,838 ----
- fflush (stdout);
- read_line ();
-
- ! printf_filtered ("\
- To make sure that everyone has such rights, we have to forbid you to\n\
- deprive anyone else of these rights. For example, if you distribute\n\
- copies of GDB, you must give the recipients all the rights that you\n\
- ***************
- *** 812,818 ****
- fflush (stdout);
- read_line ();
-
- ! printf ("\
- COPYING POLICIES\n\
- \n\
- 1. You may copy and distribute verbatim copies of GDB source code as\n\
- --- 852,858 ----
- fflush (stdout);
- read_line ();
-
- ! printf_filtered ("\
- COPYING POLICIES\n\
- \n\
- 1. You may copy and distribute verbatim copies of GDB source code as\n\
- ***************
- *** 835,841 ****
- fflush (stdout);
- read_line ();
-
- ! printf ("\
- b) cause the whole of any work that you distribute or publish,\n\
- that in whole or in part contains or is a derivative of GDB\n\
- or any part thereof, to be licensed to all third parties on terms\n\
- --- 875,881 ----
- fflush (stdout);
- read_line ();
-
- ! printf_filtered ("\
- b) cause the whole of any work that you distribute or publish,\n\
- that in whole or in part contains or is a derivative of GDB\n\
- or any part thereof, to be licensed to all third parties on terms\n\
- ***************
- *** 843,849 ****
- you may choose to grant more extensive warranty protection to some\n\
- or all third parties, at your option).\n\
- \n");
- ! printf ("\
- c) if the modified program serves as a debugger, cause it\n\
- when started running in the simplest and usual way, to print\n\
- an announcement including a valid copyright notice\n\
- --- 883,889 ----
- you may choose to grant more extensive warranty protection to some\n\
- or all third parties, at your option).\n\
- \n");
- ! printf_filtered ("\
- c) if the modified program serves as a debugger, cause it\n\
- when started running in the simplest and usual way, to print\n\
- an announcement including a valid copyright notice\n\
- ***************
- *** 864,870 ****
- fflush (stdout);
- read_line ();
-
- ! printf ("\
- 3. You may copy and distribute GDB (or a portion or derivative of it,\n\
- under Paragraph 2) in object code or executable form under the terms of\n\
- Paragraphs 1 and 2 above provided that you also do one of the following:\n\
- --- 904,910 ----
- fflush (stdout);
- read_line ();
-
- ! printf_filtered ("\
- 3. You may copy and distribute GDB (or a portion or derivative of it,\n\
- under Paragraph 2) in object code or executable form under the terms of\n\
- Paragraphs 1 and 2 above provided that you also do one of the following:\n\
- ***************
- *** 879,885 ****
- corresponding source code, to be distributed under the terms of\n\
- Paragraphs 1 and 2 above; or,\n\n");
-
- ! printf ("\
- c) accompany it with the information you received as to where the\n\
- corresponding source code may be obtained. (This alternative is\n\
- allowed only for noncommercial distribution and only if you\n\
- --- 919,925 ----
- corresponding source code, to be distributed under the terms of\n\
- Paragraphs 1 and 2 above; or,\n\n");
-
- ! printf_filtered ("\
- c) accompany it with the information you received as to where the\n\
- corresponding source code may be obtained. (This alternative is\n\
- allowed only for noncommercial distribution and only if you\n\
- ***************
- *** 893,899 ****
- fflush (stdout);
- read_line ();
-
- ! printf ("\
- 4. You may not copy, sublicense, distribute or transfer GDB\n\
- except as expressly provided under this License Agreement. Any attempt\n\
- otherwise to copy, sublicense, distribute or transfer GDB is void and\n\
- --- 933,939 ----
- fflush (stdout);
- read_line ();
-
- ! printf_filtered ("\
- 4. You may not copy, sublicense, distribute or transfer GDB\n\
- except as expressly provided under this License Agreement. Any attempt\n\
- otherwise to copy, sublicense, distribute or transfer GDB is void and\n\
- ***************
- *** 920,926 ****
- warranty_info ()
- {
- immediate_quit++;
- ! printf (" NO WARRANTY\n\
- \n\
- BECAUSE GDB IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY NO\n\
- WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT\n\
- --- 960,966 ----
- warranty_info ()
- {
- immediate_quit++;
- ! printf_filtered (" NO WARRANTY\n\
- \n\
- BECAUSE GDB IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY NO\n\
- WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT\n\
- ***************
- *** 932,938 ****
- PERFORMANCE OF GDB IS WITH YOU. SHOULD GDB PROVE DEFECTIVE, YOU\n\
- ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n");
-
- ! printf ("\
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.\n\
- STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY\n\
- WHO MAY MODIFY AND REDISTRIBUTE GDB, BE LIABLE TO\n\
- --- 972,978 ----
- PERFORMANCE OF GDB IS WITH YOU. SHOULD GDB PROVE DEFECTIVE, YOU\n\
- ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n");
-
- ! printf_filtered ("\
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.\n\
- STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY\n\
- WHO MAY MODIFY AND REDISTRIBUTE GDB, BE LIABLE TO\n\
- ***************
- *** 949,955 ****
- static void
- print_gdb_version ()
- {
- ! printf ("GDB %s, Copyright (C) 1988 Free Software Foundation, Inc.\n\
- There is ABSOLUTELY NO WARRANTY for GDB; type \"info warranty\" for details.\n\
- GDB is free software and you are welcome to distribute copies of it\n\
- under certain conditions; type \"info copying\" to see the conditions.\n",
- --- 989,995 ----
- static void
- print_gdb_version ()
- {
- ! printf_filtered ("GDB %s, Copyright (C) 1988 Free Software Foundation, Inc.\n\
- There is ABSOLUTELY NO WARRANTY for GDB; type \"info warranty\" for details.\n\
- GDB is free software and you are welcome to distribute copies of it\n\
- under certain conditions; type \"info copying\" to see the conditions.\n",
- ***************
- *** 969,975 ****
- void
- print_prompt ()
- {
- ! printf ("%s", prompt);
- fflush (stdout);
- }
-
- --- 1009,1015 ----
- void
- print_prompt ()
- {
- ! printf_filtered ("%s", prompt);
- fflush (stdout);
- }
-
- ***************
- *** 1028,1034 ****
- else
- error ("Not confirmed.");
- }
- ! exit (0);
- }
-
- int
- --- 1068,1074 ----
- else
- error ("Not confirmed.");
- }
- ! really_exit (0);
- }
-
- int
- ***************
- *** 1057,1066 ****
- #endif
-
- if (strcmp (dirbuf, current_directory))
- ! printf ("Working directory %s\n (canonically %s).\n",
- current_directory, dirbuf);
- else
- ! printf ("Working directory %s.\n", current_directory);
- }
-
- static void
- --- 1097,1106 ----
- #endif
-
- if (strcmp (dirbuf, current_directory))
- ! printf_filtered ("Working directory %s\n (canonically %s).\n",
- current_directory, dirbuf);
- else
- ! printf_filtered ("Working directory %s.\n", current_directory);
- }
-
- static void
- ***************
- *** 1174,1183 ****
-
- c = parse_escape (&p);
- if (c >= 0)
- ! fputc (c, stdout);
- }
- else
- ! fputc (c, stdout);
- }
- }
-
- --- 1214,1223 ----
-
- c = parse_escape (&p);
- if (c >= 0)
- ! fputc_filtered (c, stdout);
- }
- else
- ! fputc_filtered (c, stdout);
- }
- }
-
- ***************
- *** 1272,1274 ****
- --- 1312,1419 ----
- add_info ("warranty", warranty_info, "Various kinds of warranty you do not have.");
- add_info ("version", version_info, "Report what version of GDB this is.");
- }
- + #ifdef atarist
- + long set_exeption_vector();
- + long s_vectors[10];
- + long s_trap_0_vector, s_trap_f_vector;
- +
- + static void Save_all_vectors()
- + {
- + s_vectors[2] = set_exception_vector(2, do_nothing);
- + /* akp: why does Setexc(-N,..) not work?? */
- + set_exception_vector(2, s_vectors[2]);
- + s_vectors[3] = set_exception_vector(3, do_nothing);
- + set_exception_vector(3, s_vectors[3]);
- + s_vectors[4] = set_exception_vector(4, do_nothing);
- + set_exception_vector(4, s_vectors[4]);
- + s_vectors[5] = set_exception_vector(5, do_nothing);
- + set_exception_vector(5, s_vectors[5]);
- + s_vectors[6] = set_exception_vector(6, do_nothing);
- + set_exception_vector(6, s_vectors[6]);
- + s_vectors[7] = set_exception_vector(7, do_nothing);
- + set_exception_vector(7, s_vectors[7]);
- + s_vectors[8] = set_exception_vector(8, do_nothing);
- + set_exception_vector(8, s_vectors[8]);
- + s_vectors[9] = set_exception_vector(9, do_nothing);
- + set_exception_vector(9, s_vectors[9]);
- +
- + s_trap_0_vector = set_exception_vector(32, do_nothing);
- + set_exception_vector(32, s_trap_0_vector);
- + s_trap_f_vector = set_exception_vector(47, do_nothing);
- + set_exception_vector(47, s_trap_f_vector);
- + }
- +
- + static void Restore_all_vectors()
- + {
- + set_exception_vector(2, s_vectors[2]);
- + set_exception_vector(3, s_vectors[3]);
- + set_exception_vector(4, s_vectors[4]);
- + set_exception_vector(5, s_vectors[5]);
- + set_exception_vector(6, s_vectors[6]);
- + set_exception_vector(7, s_vectors[7]);
- + set_exception_vector(8, s_vectors[8]);
- + set_exception_vector(9, s_vectors[9]);
- +
- + set_exception_vector(32, s_trap_0_vector);
- + set_exception_vector(47, s_trap_f_vector);
- + }
- + #endif
- + void really_exit(n)
- + int n;
- + {
- + #ifdef atarist
- + Restore_all_vectors();
- + if(atari_logfile)
- + fclose(atari_logfile);
- + #endif
- + exit(n);
- + }
- +
- +
- + #ifdef atarist
- + #include <stdarg.h>
- + int fprintf_filtered(FILE *fp, const char *fmt, ...)
- + {
- + va_list argp;
- + va_start(argp, fmt);
- + if(atari_logfile)
- + {
- + _doprnt(atari_logfile, fmt, argp);
- + }
- + return(_doprnt(fp, fmt, argp));
- + }
- +
- + int printf_filtered(const char *fmt, ...)
- + {
- + va_list argp;
- + va_start(argp, fmt);
- + if(atari_logfile)
- + {
- + _doprnt(atari_logfile, fmt, argp);
- + }
- + return(_doprnt(stdout, fmt, argp));
- + }
- +
- + int fputc_filtered(int c, FILE *fp)
- + {
- + if(atari_logfile)
- + {
- + fputc(c, atari_logfile);
- + }
- + return fputc(c, fp);
- + }
- +
- + int putc_filtered(int c, FILE *fp)
- + {
- + return fputc_filtered(c, fp);
- + }
- +
- + int fputs_filtered(const char *s, FILE *fp)
- + {
- + if(atari_logfile)
- + {
- + fputs(s, atari_logfile);
- + }
- + return fputs(s, fp);
- + }
- + #endif
- *** 1.7 1991/10/05 20:59:54
- --- printcmd.c 1992/01/14 20:06:05
- ***************
- *** 60,65 ****
- --- 60,68 ----
-
- int current_display_number;
-
- + #ifdef atarist
- + extern int gcc_mshort;
- + #endif
- static void do_one_display ();
-
- void do_displays ();
- ***************
- *** 229,235 ****
- switch (format)
- {
- case 'x':
- ! fprintf (stream, "0x%08x%08x", v1, v2);
- break;
- default:
- error ("Output size \"g\" unimplemented for format \"%c\".",
- --- 232,238 ----
- switch (format)
- {
- case 'x':
- ! fprintf_filtered (stream, "0x%08x%08x", v1, v2);
- break;
- default:
- error ("Output size \"g\" unimplemented for format \"%c\".",
- ***************
- *** 257,278 ****
- if (!size)
- {
- /* no size specified, like in print. Print varying # of digits. */
- ! fprintf (stream, "0x%lx", val_long);
- }
- else
- switch (size)
- {
- case 'b':
- ! fprintf (stream, "0x%02x", val_long);
- break;
- case 'h':
- ! fprintf (stream, "0x%04x", val_long);
- break;
- case 'w':
- ! fprintf (stream, "0x%08x", val_long);
- break;
- case 'g':
- ! fprintf (stream, "0x%016x", val_long);
- break;
- default:
- error ("Undefined output size \"%c\".", size);
- --- 260,281 ----
- if (!size)
- {
- /* no size specified, like in print. Print varying # of digits. */
- ! fprintf_filtered (stream, "0x%lx", val_long);
- }
- else
- switch (size)
- {
- case 'b':
- ! fprintf_filtered (stream, "0x%02x", val_long);
- break;
- case 'h':
- ! fprintf_filtered (stream, "0x%04x", val_long);
- break;
- case 'w':
- ! fprintf_filtered (stream, "0x%08x", val_long);
- break;
- case 'g':
- ! fprintf_filtered (stream, "0x%016x", val_long);
- break;
- default:
- error ("Undefined output size \"%c\".", size);
- ***************
- *** 280,297 ****
- break;
-
- case 'd':
- ! fprintf (stream, "%d", val_long);
- break;
-
- case 'u':
- ! fprintf (stream, "%u", val_long);
- break;
-
- case 'o':
- if (val_long)
- ! fprintf (stream, "0%o", val_long);
- else
- ! fprintf (stream, "0");
- break;
-
- case 'a':
- --- 283,300 ----
- break;
-
- case 'd':
- ! fprintf_filtered (stream, "%d", val_long);
- break;
-
- case 'u':
- ! fprintf_filtered (stream, "%u", val_long);
- break;
-
- case 'o':
- if (val_long)
- ! fprintf_filtered (stream, "0%o", val_long);
- else
- ! fprintf_filtered (stream, "0");
- break;
-
- case 'a':
- ***************
- *** 310,320 ****
- #ifdef IEEE_FLOAT
- if (is_nan (unpack_double (type, valaddr)))
- {
- ! printf ("Nan");
- break;
- }
- #endif
- ! fprintf (stream, "%g", unpack_double (type, valaddr));
- break;
-
- case 0:
- --- 313,323 ----
- #ifdef IEEE_FLOAT
- if (is_nan (unpack_double (type, valaddr)))
- {
- ! printf_filtered ("Nan");
- break;
- }
- #endif
- ! fprintf_filtered (stream, "%g", unpack_double (type, valaddr));
- break;
-
- case 0:
- ***************
- *** 360,366 ****
- if (*cp == '\0')
- cp--;
- }
- ! fprintf (stream, cp);
- }
- break;
-
- --- 363,369 ----
- if (*cp == '\0')
- cp--;
- }
- ! fprintf_filtered (stream, cp);
- }
- break;
-
- ***************
- *** 398,416 ****
- if (i < 0)
- return;
-
- ! fputs (leadin, stream);
- ! fputs ("<", stream);
- #if 0
- if (do_demangle)
- ! fputs_demangled (misc_function_vector[i].name, stream, 1);
- else
- #endif
- ! fputs (misc_function_vector[i].name, stream);
- name_location = misc_function_vector[i].address;
- if (addr - name_location)
- ! fprintf (stream, "+%d>", addr - name_location);
- else
- ! fputs (">", stream);
- }
-
- /* Print address ADDR symbolically on STREAM.
- --- 401,419 ----
- if (i < 0)
- return;
-
- ! fputs_filtered (leadin, stream);
- ! fputs_filtered ("<", stream);
- #if 0
- if (do_demangle)
- ! fputs_filtered_demangled (misc_function_vector[i].name, stream, 1);
- else
- #endif
- ! fputs_filtered (misc_function_vector[i].name, stream);
- name_location = misc_function_vector[i].address;
- if (addr - name_location)
- ! fprintf_filtered (stream, "+%d>", addr - name_location);
- else
- ! fputs_filtered (">", stream);
- }
-
- /* Print address ADDR symbolically on STREAM.
- ***************
- *** 422,428 ****
- CORE_ADDR addr;
- FILE *stream;
- {
- ! fprintf (stream, "0x%x", addr);
- #if 0
- print_address_symbolic (addr, stream, asm_demangle, " ");
- #else
- --- 425,431 ----
- CORE_ADDR addr;
- FILE *stream;
- {
- ! fprintf_filtered (stream, "0x%x", addr);
- #if 0
- print_address_symbolic (addr, stream, asm_demangle, " ");
- #else
- ***************
- *** 478,495 ****
- while (count > 0)
- {
- print_address (next_address, stdout);
- ! fputc (':', stdout);
- for (i = maxelts;
- i > 0 && count > 0;
- i--, count--)
- {
- ! fputc ('\t', stdout);
- /* Note that this sets next_address for the next object. */
- last_examine_address = next_address;
- last_examine_value = value_at (val_type, next_address);
- print_formatted (last_examine_value, format, size);
- }
- ! fputc ('\n', stdout);
- fflush (stdout);
- }
- }
- --- 481,498 ----
- while (count > 0)
- {
- print_address (next_address, stdout);
- ! fputc_filtered (':', stdout);
- for (i = maxelts;
- i > 0 && count > 0;
- i--, count--)
- {
- ! fputc_filtered ('\t', stdout);
- /* Note that this sets next_address for the next object. */
- last_examine_address = next_address;
- last_examine_value = value_at (val_type, next_address);
- print_formatted (last_examine_value, format, size);
- }
- ! fputc_filtered ('\n', stdout);
- fflush (stdout);
- }
- }
- ***************
- *** 546,555 ****
- val = access_value_history (0);
-
- histindex = record_latest_value (val);
- ! if(histindex >= 0) printf ("$%d = ", histindex);
-
- print_formatted (val, format, fmt.size);
- ! printf ("\n");
-
- if (cleanup)
- do_cleanups (old_chain);
- --- 549,558 ----
- val = access_value_history (0);
-
- histindex = record_latest_value (val);
- ! if(histindex >= 0)printf_filtered ("$%d = ", histindex);
-
- print_formatted (val, format, fmt.size);
- ! printf_filtered ("\n");
-
- if (cleanup)
- do_cleanups (old_chain);
- ***************
- *** 614,620 ****
- break;
-
- if (i < misc_function_count)
- ! printf ("Symbol \"%s\" is at 0x%x in a file compiled without -g.\n",
- exp, misc_function_vector[i].address);
- else
- error ("No symbol \"%s\" in current context.", exp);
- --- 617,623 ----
- break;
-
- if (i < misc_function_count)
- ! printf_filtered ("Symbol \"%s\" is at 0x%x in a file compiled without -g.\n",
- exp, misc_function_vector[i].address);
- else
- error ("No symbol \"%s\" in current context.", exp);
- ***************
- *** 621,627 ****
- return;
- }
-
- ! printf ("Symbol \"%s\" is ", SYMBOL_NAME (sym));
- val = SYMBOL_VALUE (sym);
-
- switch (SYMBOL_CLASS (sym))
- --- 624,630 ----
- return;
- }
-
- ! printf_filtered ("Symbol \"%s\" is ", SYMBOL_NAME (sym));
- val = SYMBOL_VALUE (sym);
-
- switch (SYMBOL_CLASS (sym))
- ***************
- *** 628,670 ****
- {
- case LOC_CONST:
- case LOC_CONST_BYTES:
- ! printf ("constant");
- break;
-
- case LOC_LABEL:
- ! printf ("a label at address 0x%x", val);
- break;
-
- case LOC_REGISTER:
- ! printf ("a variable in register %s", reg_names[val]);
- break;
-
- case LOC_STATIC:
- ! printf ("static at address 0x%x", val);
- break;
-
- case LOC_ARG:
- ! printf ("an argument at offset %d", val);
- break;
-
- case LOC_LOCAL:
- ! printf ("a local variable at frame offset %d", val);
- break;
-
- case LOC_TYPEDEF:
- ! printf ("a typedef");
- break;
-
- case LOC_BLOCK:
- ! printf ("a function at address 0x%x",
- BLOCK_START (SYMBOL_BLOCK_VALUE (sym)));
- break;
-
- default:
- ! printf ("of unknown (botched) type");
- break;
- }
- ! printf (".\n");
- }
-
- static void
- --- 631,673 ----
- {
- case LOC_CONST:
- case LOC_CONST_BYTES:
- ! printf_filtered ("constant");
- break;
-
- case LOC_LABEL:
- ! printf_filtered ("a label at address 0x%x", val);
- break;
-
- case LOC_REGISTER:
- ! printf_filtered ("a variable in register %s", reg_names[val]);
- break;
-
- case LOC_STATIC:
- ! printf_filtered ("static at address 0x%x", val);
- break;
-
- case LOC_ARG:
- ! printf_filtered ("an argument at offset %d", val);
- break;
-
- case LOC_LOCAL:
- ! printf_filtered ("a local variable at frame offset %d", val);
- break;
-
- case LOC_TYPEDEF:
- ! printf_filtered ("a typedef");
- break;
-
- case LOC_BLOCK:
- ! printf_filtered ("a function at address 0x%x",
- BLOCK_START (SYMBOL_BLOCK_VALUE (sym)));
- break;
-
- default:
- ! printf_filtered ("of unknown (botched) type");
- break;
- }
- ! printf_filtered (".\n");
- }
-
- static void
- ***************
- *** 750,758 ****
- else
- val = access_value_history (0);
-
- ! printf ("type = ");
- type_print (VALUE_TYPE (val), "", stdout, 1);
- ! printf ("\n");
-
- if (exp)
- do_cleanups (old_chain);
- --- 753,761 ----
- else
- val = access_value_history (0);
-
- ! printf_filtered ("type = ");
- type_print (VALUE_TYPE (val), "", stdout, 1);
- ! printf_filtered ("\n");
-
- if (exp)
- do_cleanups (old_chain);
- ***************
- *** 791,823 ****
- = lookup_symbol (typename, b, STRUCT_NAMESPACE);
- if (sym == 0)
- error ("No type named %s.", typename);
- ! printf ("No type named %s, but there is a ",
- typename);
- switch (TYPE_CODE (SYMBOL_TYPE (sym)))
- {
- case TYPE_CODE_STRUCT:
- ! printf ("struct");
- break;
-
- case TYPE_CODE_UNION:
- ! printf ("union");
- break;
-
- case TYPE_CODE_ENUM:
- ! printf ("enum");
- break;
-
- default:
- ! printf ("(Internal error in gdb)");
- break;
- }
- ! printf (" %s. Type \"help ptype\".\n", typename);
- type = SYMBOL_TYPE (sym);
- }
- }
-
- type_print (type, "", stdout, 1);
- ! printf ("\n");
- }
-
- struct display
- --- 794,826 ----
- = lookup_symbol (typename, b, STRUCT_NAMESPACE);
- if (sym == 0)
- error ("No type named %s.", typename);
- ! printf_filtered ("No type named %s, but there is a ",
- typename);
- switch (TYPE_CODE (SYMBOL_TYPE (sym)))
- {
- case TYPE_CODE_STRUCT:
- ! printf_filtered ("struct");
- break;
-
- case TYPE_CODE_UNION:
- ! printf_filtered ("union");
- break;
-
- case TYPE_CODE_ENUM:
- ! printf_filtered ("enum");
- break;
-
- default:
- ! printf_filtered ("(Internal error in gdb)");
- break;
- }
- ! printf_filtered (" %s. Type \"help ptype\".\n", typename);
- type = SYMBOL_TYPE (sym);
- }
- }
-
- type_print (type, "", stdout, 1);
- ! printf_filtered ("\n");
- }
-
- struct display
- ***************
- *** 993,1013 ****
- {
- current_display_number = d->number;
-
- ! printf ("%d: ", d->number);
- if (d->format.size)
- {
- ! printf ("x/");
- if (d->format.count != 1)
- ! printf ("%d", d->format.count);
- ! printf ("%c", d->format.format);
- if (d->format.format != 'i' && d->format.format != 's')
- ! printf ("%c", d->format.size);
- ! printf (" ");
- print_expression (d->exp, stdout);
- if (d->format.count != 1)
- ! printf ("\n");
- else
- ! printf (" ");
- do_examine (d->format,
- value_as_long (evaluate_expression (d->exp)));
- }
- --- 996,1016 ----
- {
- current_display_number = d->number;
-
- ! printf_filtered ("%d: ", d->number);
- if (d->format.size)
- {
- ! printf_filtered ("x/");
- if (d->format.count != 1)
- ! printf_filtered ("%d", d->format.count);
- ! printf_filtered ("%c", d->format.format);
- if (d->format.format != 'i' && d->format.format != 's')
- ! printf_filtered ("%c", d->format.size);
- ! printf_filtered (" ");
- print_expression (d->exp, stdout);
- if (d->format.count != 1)
- ! printf_filtered ("\n");
- else
- ! printf_filtered (" ");
- do_examine (d->format,
- value_as_long (evaluate_expression (d->exp)));
- }
- ***************
- *** 1014,1025 ****
- else
- {
- if (d->format.format)
- ! printf ("/%c ", d->format.format);
- print_expression (d->exp, stdout);
- ! printf (" = ");
- print_formatted (evaluate_expression (d->exp),
- d->format.format, d->format.size);
- ! printf ("\n");
- }
-
- fflush (stdout);
- --- 1017,1028 ----
- else
- {
- if (d->format.format)
- ! printf_filtered ("/%c ", d->format.format);
- print_expression (d->exp, stdout);
- ! printf_filtered (" = ");
- print_formatted (evaluate_expression (d->exp),
- d->format.format, d->format.size);
- ! printf_filtered ("\n");
- }
-
- fflush (stdout);
- ***************
- *** 1046,1052 ****
- if (current_display_number >= 0)
- {
- delete_display (current_display_number);
- ! fprintf (stderr, "Deleting display %d to avoid infinite recursion.\n",
- current_display_number);
- }
- current_display_number = -1;
- --- 1049,1055 ----
- if (current_display_number >= 0)
- {
- delete_display (current_display_number);
- ! fprintf_filtered (stderr, "Deleting display %d to avoid infinite recursion.\n",
- current_display_number);
- }
- current_display_number = -1;
- ***************
- *** 1058,1076 ****
- register struct display *d;
-
- if (!display_chain)
- ! printf ("There are no auto-display expressions now.\n");
- else
- ! printf ("Auto-display expressions now in effect:\n");
- for (d = display_chain; d; d = d->next)
- {
- ! printf ("%d: ", d->number);
- if (d->format.size)
- ! printf ("/%d%c%c ", d->format.count, d->format.size,
- d->format.format);
- else if (d->format.format)
- ! printf ("/%c ", d->format.format);
- print_expression (d->exp, stdout);
- ! printf ("\n");
- fflush (stdout);
- }
- }
- --- 1061,1079 ----
- register struct display *d;
-
- if (!display_chain)
- ! printf_filtered ("There are no auto-display expressions now.\n");
- else
- ! printf_filtered ("Auto-display expressions now in effect:\n");
- for (d = display_chain; d; d = d->next)
- {
- ! printf_filtered ("%d: ", d->number);
- if (d->format.size)
- ! printf_filtered ("/%d%c%c ", d->format.count, d->format.size,
- d->format.format);
- else if (d->format.format)
- ! printf_filtered ("/%c ", d->format.format);
- print_expression (d->exp, stdout);
- ! printf_filtered ("\n");
- fflush (stdout);
- }
- }
- ***************
- *** 1142,1155 ****
- /* Print the next arg. */
- val = value_at (SYMBOL_TYPE (sym), addr + SYMBOL_VALUE (sym));
- if (! first)
- ! fprintf (stream, ", ");
- ! fprintf (stream, "%s=", SYMBOL_NAME (sym));
- value_print (val, stream, 0);
- first = 0;
- last_offset = SYMBOL_VALUE (sym) + TYPE_LENGTH (SYMBOL_TYPE (sym));
- /* Round up address of next arg to multiple of size of int. */
- ! last_offset
- ! = ((last_offset + sizeof (int) - 1) / sizeof (int)) * sizeof (int);
- }
- if (num >= 0 && num * sizeof (int) + FRAME_ARGS_SKIP > last_offset)
- print_frame_nameless_args (addr, last_offset,
- --- 1145,1162 ----
- /* Print the next arg. */
- val = value_at (SYMBOL_TYPE (sym), addr + SYMBOL_VALUE (sym));
- if (! first)
- ! fprintf_filtered (stream, ", ");
- ! fprintf_filtered (stream, "%s=", SYMBOL_NAME (sym));
- value_print (val, stream, 0);
- first = 0;
- last_offset = SYMBOL_VALUE (sym) + TYPE_LENGTH (SYMBOL_TYPE (sym));
- /* Round up address of next arg to multiple of size of int. */
- ! if(gcc_mshort)
- ! last_offset
- ! = ((last_offset + sizeof (short) - 1) / sizeof (short)) * sizeof (short);
- ! else
- ! last_offset
- ! = ((last_offset + sizeof (int) - 1) / sizeof (int)) * sizeof (int);
- }
- if (num >= 0 && num * sizeof (int) + FRAME_ARGS_SKIP > last_offset)
- print_frame_nameless_args (addr, last_offset,
- ***************
- *** 1167,1174 ****
- {
- QUIT;
- if (start != FRAME_ARGS_SKIP)
- ! fprintf (stream, ", ");
- ! fprintf (stream, "%d",
- read_memory_integer (argsaddr + start, sizeof (int)));
- start += sizeof (int);
- }
- --- 1174,1181 ----
- {
- QUIT;
- if (start != FRAME_ARGS_SKIP)
- ! fprintf_filtered (stream, ", ");
- ! fprintf_filtered (stream, "%d",
- read_memory_integer (argsaddr + start, sizeof (int)));
- start += sizeof (int);
- }
- ***************
- *** 1320,1326 ****
- read_memory (tem, str, j);
- str[j] = 0;
-
- ! /* Pass address of internal copy as the arg to vprintf. */
- *((int *) &arg_bytes[argindex]) = (int) str;
- argindex += sizeof (int);
- }
- --- 1327,1333 ----
- read_memory (tem, str, j);
- str[j] = 0;
-
- ! /* Pass address of internal copy as the arg to printf_filtered. */
- *((int *) &arg_bytes[argindex]) = (int) str;
- argindex += sizeof (int);
- }
- ***************
- *** 1336,1342 ****
- }
- }
-
- ! vprintf (string, arg_bytes);
- }
-
- /* Helper function for asdump_command. Finds the bounds of a function
- --- 1343,1349 ----
- }
- }
-
- ! printf_filtered (string, arg_bytes);
- }
-
- /* Helper function for asdump_command. Finds the bounds of a function
- ***************
- *** 1405,1419 ****
- high = parse_and_eval_address (space_index + 1);
- }
-
- ! printf ("Dump of assembler code ");
- if (!space_index)
- {
- char *name;
- find_pc_partial_function (pc, &name, 0);
- ! printf ("for function %s:\n", name);
- }
- else
- ! printf ("from 0x%x to 0x%x:\n", low, high);
-
- /* Dump the specified range. */
- for (pc = low; pc < high; )
- --- 1412,1426 ----
- high = parse_and_eval_address (space_index + 1);
- }
-
- ! printf_filtered ("Dump of assembler code ");
- if (!space_index)
- {
- char *name;
- find_pc_partial_function (pc, &name, 0);
- ! printf_filtered ("for function %s:\n", name);
- }
- else
- ! printf_filtered ("from 0x%x to 0x%x:\n", low, high);
-
- /* Dump the specified range. */
- for (pc = low; pc < high; )
- ***************
- *** 1420,1430 ****
- {
- QUIT;
- print_address (pc, stdout);
- ! printf (":\t");
- pc += print_insn (pc, stdout);
- ! printf ("\n");
- }
- ! printf ("End of assembler dump.\n");
- fflush (stdout);
- }
-
- --- 1427,1437 ----
- {
- QUIT;
- print_address (pc, stdout);
- ! printf_filtered (":\t");
- pc += print_insn (pc, stdout);
- ! printf_filtered ("\n");
- }
- ! printf_filtered ("End of assembler dump.\n");
- fflush (stdout);
- }
-
- *** 1.5 1991/10/05 20:59:54
- --- source.c 1992/01/14 20:06:06
- ***************
- *** 102,108 ****
- static void
- directories_info ()
- {
- ! printf ("Source directories searched: %s\n", source_path);
- }
-
- void
- --- 102,108 ----
- static void
- directories_info ()
- {
- ! printf_filtered ("Source directories searched: %s\n", source_path);
- }
-
- void
- ***************
- *** 217,223 ****
- && (tem[len] == '\0' || tem[len] == ':'))
- #endif
- {
- ! printf ("\"%s\" is already in the source path.\n",
- dirname);
- break;
- }
- --- 217,223 ----
- && (tem[len] == '\0' || tem[len] == ':'))
- #endif
- {
- ! printf_filtered ("\"%s\" is already in the source path.\n",
- dirname);
- break;
- }
- ***************
- *** 368,374 ****
- #else
- fstat (desc, &st);
- if (get_exec_file (0) != 0 && exec_mtime < st.st_mtime)
- ! printf ("Source file is more recent than executable.\n");
- #endif
-
- data = (char *) alloca (st.st_size);
- --- 368,374 ----
- #else
- fstat (desc, &st);
- if (get_exec_file (0) != 0 && exec_mtime < st.st_mtime)
- ! printf_filtered ("Source file is more recent than executable.\n");
- #endif
-
- data = (char *) alloca (st.st_size);
- ***************
- *** 479,485 ****
- get_filename_and_charpos (s, line, 0);
- if (s->fullname == 0)
- return 0;
- ! printf ("\032\032%s:%d:%d:%s\n", s->fullname,
- line, s->line_charpos[line - 1],
- mid_statement ? "middle" : "beg");
- current_source_line = line;
- --- 479,485 ----
- get_filename_and_charpos (s, line, 0);
- if (s->fullname == 0)
- return 0;
- ! printf_filtered ("\032\032%s:%d:%d:%s\n", s->fullname,
- line, s->line_charpos[line - 1],
- mid_statement ? "middle" : "beg");
- current_source_line = line;
- ***************
- *** 509,515 ****
- if (s->line_charpos == 0)
- find_source_lines (s, desc);
-
- ! if (line < 1 || line >= s->nlines)
- {
- close (desc);
- error ("Line number %d out of range; %s has %d lines.",
- --- 509,515 ----
- if (s->line_charpos == 0)
- find_source_lines (s, desc);
-
- ! if (line < 1 || line > s->nlines)
- {
- close (desc);
- error ("Line number %d out of range; %s has %d lines.",
- ***************
- *** 534,540 ****
- c = fgetc (stream);
- if (c == EOF) break;
- last_line_listed = current_source_line;
- ! printf ("%d\t", current_source_line++);
- do
- /*
- #ifdef atarist
- --- 534,540 ----
- c = fgetc (stream);
- if (c == EOF) break;
- last_line_listed = current_source_line;
- ! printf_filtered ("%d\t", current_source_line++);
- do
- /*
- #ifdef atarist
- ***************
- *** 544,556 ****
- {
- if (c < 040 && c != '\t' && c != '\n')
- {
- ! fputc ('^', stdout);
- ! fputc (c + 0100, stdout);
- }
- else if (c == 0177)
- ! printf ("^?");
- else
- ! fputc (c, stdout);
- } while (c != '\n' && (c = fgetc (stream)) >= 0);
- }
-
- --- 544,556 ----
- {
- if (c < 040 && c != '\t' && c != '\n')
- {
- ! fputc_filtered ('^', stdout);
- ! fputc_filtered (c + 0100, stdout);
- }
- else if (c == 0177)
- ! printf_filtered ("^?");
- else
- ! fputc_filtered (c, stdout);
- } while (c != '\n' && (c = fgetc (stream)) >= 0);
- }
-
- ***************
- *** 653,662 ****
- error ("No source file for address 0x%x.", sal.pc);
- sym = find_pc_function (sal.pc);
- if (sym)
- ! printf ("0x%x is in %s (%s, line %d).\n",
- sal.pc, SYMBOL_NAME (sym), sal.symtab->filename, sal.line);
- else
- ! printf ("0x%x is in %s, line %d.\n",
- sal.pc, sal.symtab->filename, sal.line);
- }
-
- --- 653,662 ----
- error ("No source file for address 0x%x.", sal.pc);
- sym = find_pc_function (sal.pc);
- if (sym)
- ! printf_filtered ("0x%x is in %s (%s, line %d).\n",
- sal.pc, SYMBOL_NAME (sym), sal.symtab->filename, sal.line);
- else
- ! printf_filtered ("0x%x is in %s, line %d.\n",
- sal.pc, sal.symtab->filename, sal.line);
- }
-
- ***************
- *** 719,728 ****
- && find_line_pc_range (sal.symtab, sal.line, &start_pc, &end_pc))
- {
- if (start_pc == end_pc)
- ! printf ("Line %d of \"%s\" is at pc 0x%x but contains no code.\n",
- sal.line, sal.symtab->filename, start_pc);
- else
- ! printf ("Line %d of \"%s\" starts at pc 0x%x and ends at 0x%x.\n",
- sal.line, sal.symtab->filename, start_pc, end_pc);
- /* x/i should display this line's code. */
- set_next_address (start_pc);
- --- 719,728 ----
- && find_line_pc_range (sal.symtab, sal.line, &start_pc, &end_pc))
- {
- if (start_pc == end_pc)
- ! printf_filtered ("Line %d of \"%s\" is at pc 0x%x but contains no code.\n",
- sal.line, sal.symtab->filename, start_pc);
- else
- ! printf_filtered ("Line %d of \"%s\" starts at pc 0x%x and ends at 0x%x.\n",
- sal.line, sal.symtab->filename, start_pc, end_pc);
- /* x/i should display this line's code. */
- set_next_address (start_pc);
- ***************
- *** 730,736 ****
- last_line_listed = sal.line + 1;
- }
- else
- ! printf ("Line number %d is out of range for \"%s\".\n",
- sal.line, sal.symtab->filename);
- }
-
- --- 730,736 ----
- last_line_listed = sal.line + 1;
- }
- else
- ! printf_filtered ("Line number %d is out of range for \"%s\".\n",
- sal.line, sal.symtab->filename);
- }
-
- ***************
- *** 803,809 ****
- line++;
- }
-
- ! printf ("Expression not found\n");
- fclose (stream);
- }
-
- --- 803,809 ----
- line++;
- }
-
- ! printf_filtered ("Expression not found\n");
- fclose (stream);
- }
-
- ***************
- *** 880,886 ****
- }
- }
-
- ! printf ("Expression not found\n");
- fclose (stream);
- return;
- }
- --- 880,886 ----
- }
- }
-
- ! printf_filtered ("Expression not found\n");
- fclose (stream);
- return;
- }
- *** 1.3 1991/10/05 20:59:54
- --- st-core.c 1992/01/14 20:06:06
- ***************
- *** 106,112 ****
- char *filename;
- int from_tty;
- {
- ! fprintf(stderr, "Not on an ST you don't\n");
- }
-
- exec_file_command (filename, from_tty)
- --- 106,112 ----
- char *filename;
- int from_tty;
- {
- ! fprintf_filtered(stderr, "Not on an ST you don't\n");
- }
-
- exec_file_command (filename, from_tty)
- ***************
- *** 211,217 ****
- validate_files ();
- }
- else if (from_tty)
- ! printf ("No exec file now.\n");
-
- /* Tell display code (if any) about the changed file name. */
- if (exec_file_display_hook)
- --- 211,217 ----
- 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)
- ***************
- *** 285,306 ****
- extern char *get_sym_file ();
-
- if (execfile)
- ! printf ("Executable file \"%s\".\n", execfile);
- else
- ! printf ("No executable file\n");
-
- if (have_inferior_p ())
- ! printf ("Using the running image of the program, rather than these files.\n");
-
- symfile = get_sym_file ();
- if (symfile != 0)
- ! printf ("Symbols loaded from \"%s\".\n", symfile);
-
- if (! have_inferior_p ())
- {
- if (execfile)
- {
- ! printf ("Text segment from 0x%x to 0x%x.\n",
- text_start, text_end);
- }
- }
- --- 285,306 ----
- extern char *get_sym_file ();
-
- if (execfile)
- ! printf_filtered ("Executable file \"%s\".\n", execfile);
- else
- ! printf_filtered ("No executable file\n");
-
- if (have_inferior_p ())
- ! printf_filtered ("Using the running image of the program, rather than these files.\n");
-
- symfile = get_sym_file ();
- if (symfile != 0)
- ! printf_filtered ("Symbols loaded from \"%s\".\n", symfile);
-
- if (! have_inferior_p ())
- {
- if (execfile)
- {
- ! printf_filtered ("Text segment from 0x%x to 0x%x.\n",
- text_start, text_end);
- }
- }
- ***************
- *** 313,319 ****
- char *myaddr;
- int len;
- {
- ! /* fprintf(stderr, "read-memory(%X, %X, %d) inf %d\n", memaddr, myaddr, len,
- have_inferior_p()); */
- if (have_inferior_p ())
- read_inferior_memory (memaddr, myaddr, len);
- --- 313,319 ----
- char *myaddr;
- int len;
- {
- ! /* fprintf_filtered(stderr, "read-memory(%X, %X, %d) inf %d\n", memaddr, myaddr, len,
- have_inferior_p()); */
- if (have_inferior_p ())
- read_inferior_memory (memaddr, myaddr, len);
- *** 1.5 1991/10/05 20:59:54
- --- st-inflo.c 1992/01/14 20:06:06
- ***************
- *** 243,278 ****
- /*
- if (remote_debugging)
- {
- ! printf ("No terminal status when remote debugging.\n");
- return;
- }
- */
-
- ! printf ("Inferior's terminal status (currently saved by GDB):\n");
-
- #ifdef HAVE_TERMIO
-
- ! printf ("fcntl flags = 0x%x, c_iflag = 0x%x, c_oflag = 0x%x,\n",
- tflags_inferior, sg_inferior.c_iflag, sg_inferior.c_oflag);
- ! printf ("c_cflag = 0x%x, c_lflag = 0x%x, c_line = 0x%x.\n",
- sg_inferior.c_cflag, sg_inferior.c_lflag, sg_inferior.c_line);
- ! printf ("c_cc: ");
- for (i = 0; (i < NCC); i += 1)
- ! printf ("0x%x ", sg_inferior.c_cc[i]);
- ! printf ("\n");
-
- #else /* not HAVE_TERMIO */
-
- ! printf ("fcntl flags = 0x%x, lmode = 0x%x,\nsgttyb.sg_flags = 0x%x.\n",
- tflags_inferior, lmode_inferior,
- sg_inferior.sg_flags);
- ! printf ("tchars: ");
- for (i = 0; i < sizeof (struct tchars); i++)
- ! printf ("0x%x ", ((char *)&tc_inferior)[i]);
- ! printf ("\n");
- ! printf ("ltchars: ");
- for (i = 0; i < sizeof (struct ltchars); i++)
- ! printf ("0x%x ", ((char *)<c_inferior)[i]);
-
- #endif /* not HAVE_TERMIO */
- }
- --- 243,278 ----
- /*
- if (remote_debugging)
- {
- ! printf_filtered ("No terminal status when remote debugging.\n");
- return;
- }
- */
-
- ! printf_filtered ("Inferior's terminal status (currently saved by GDB):\n");
-
- #ifdef HAVE_TERMIO
-
- ! printf_filtered ("fcntl flags = 0x%x, c_iflag = 0x%x, c_oflag = 0x%x,\n",
- tflags_inferior, sg_inferior.c_iflag, sg_inferior.c_oflag);
- ! printf_filtered ("c_cflag = 0x%x, c_lflag = 0x%x, c_line = 0x%x.\n",
- sg_inferior.c_cflag, sg_inferior.c_lflag, sg_inferior.c_line);
- ! printf_filtered ("c_cc: ");
- for (i = 0; (i < NCC); i += 1)
- ! printf_filtered ("0x%x ", sg_inferior.c_cc[i]);
- ! printf_filtered ("\n");
-
- #else /* not HAVE_TERMIO */
-
- ! printf_filtered ("fcntl flags = 0x%x, lmode = 0x%x,\nsgttyb.sg_flags = 0x%x.\n",
- tflags_inferior, lmode_inferior,
- sg_inferior.sg_flags);
- ! printf_filtered ("tchars: ");
- for (i = 0; i < sizeof (struct tchars); i++)
- ! printf_filtered ("0x%x ", ((char *)&tc_inferior)[i]);
- ! printf_filtered ("\n");
- ! printf_filtered ("ltchars: ");
- for (i = 0; i < sizeof (struct ltchars); i++)
- ! printf_filtered ("0x%x ", ((char *)<c_inferior)[i]);
-
- #endif /* not HAVE_TERMIO */
- }
- ***************
- *** 355,361 ****
- ptrace (0);
- execle ("/bin/sh", "sh", "-c", allargs, 0, env);
-
- ! fprintf (stderr, "Cannot exec /bin/sh: %s.\n",
- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
- fflush (stderr);
- _exit (0177);
- --- 355,361 ----
- ptrace (0);
- execle ("/bin/sh", "sh", "-c", allargs, 0, env);
-
- ! fprintf_filtered (stderr, "Cannot exec /bin/sh: %s.\n",
- errno < sys_nerr ? sys_errlist[errno] : "unknown error");
- fflush (stderr);
- _exit (0177);
- ***************
- *** 503,509 ****
-
- regaddr += sizeof (int);
- }
- ! /* fprintf(stderr, "supplying register %d from buf %X val %X\n",
- regno, buf, *(long * )&buf); */
- supply_register (regno, buf);
- }
- --- 503,509 ----
-
- regaddr += sizeof (int);
- }
- ! /* fprintf_filtered(stderr, "supplying register %d from buf %X val %X\n",
- regno, buf, *(long * )&buf); */
- supply_register (regno, buf);
- }
- ***************
- *** 542,548 ****
-
- if (errno != 0)
- {
- ! sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- --- 542,548 ----
-
- if (errno != 0)
- {
- ! printf_filtered (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- ***************
- *** 557,563 ****
-
- if (errno != 0)
- {
- ! sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- --- 557,563 ----
-
- if (errno != 0)
- {
- ! printf_filtered (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- ***************
- *** 697,707 ****
- ptrace (6, inferior_pid, i, value);
- if (errno == 0)
- {
- ! printf (" Succeeded with address 0x%x; value 0x%x (%d).\n",
- i, value, value);
- }
- else if ((i & 0377) == 0)
- ! printf (" Failed at 0x%x.\n", i);
- }
- }
- */
- --- 697,707 ----
- ptrace (6, inferior_pid, i, value);
- if (errno == 0)
- {
- ! printf_filtered (" Succeeded with address 0x%x; value 0x%x (%d).\n",
- i, value, value);
- }
- else if ((i & 0377) == 0)
- ! printf_filtered (" Failed at 0x%x.\n", i);
- }
- }
- */
- *** 1.11 1991/10/05 20:59:54
- --- st-infru.c 1992/01/14 20:06:07
- ***************
- *** 381,389 ****
- {
- terminal_ours_for_output ();
- if (WRETCODE (w))
- ! printf ("\nProgram exited with code 0%o.\n", WRETCODE (w));
- else
- ! printf ("\nProgram exited normally.\n");
- fflush (stdout);
- inferior_died ();
- stop_print_frame = 0;
- --- 381,389 ----
- {
- terminal_ours_for_output ();
- if (WRETCODE (w))
- ! printf_filtered ("\nProgram exited with code 0%o.\n", WRETCODE (w));
- else
- ! printf_filtered ("\nProgram exited normally.\n");
- fflush (stdout);
- inferior_died ();
- stop_print_frame = 0;
- ***************
- *** 395,406 ****
- stop_signal = WTERMSIG (w);
- terminal_ours_for_output ();
- kill_inferior ();
- ! printf ("\nProgram terminated with signal %d, %s\n",
- stop_signal,
- stop_signal < NSIG
- ? sys_siglist[stop_signal]
- : "(undocumented)");
- ! printf ("The inferior process no longer exists.\n");
- fflush (stdout);
- break;
- }
- --- 395,406 ----
- stop_signal = WTERMSIG (w);
- terminal_ours_for_output ();
- kill_inferior ();
- ! printf_filtered ("\nProgram terminated with signal %d, %s\n",
- stop_signal,
- stop_signal < NSIG
- ? sys_siglist[stop_signal]
- : "(undocumented)");
- ! printf_filtered ("The inferior process no longer exists.\n");
- fflush (stdout);
- break;
- }
- ***************
- *** 505,511 ****
- {
- printed = 1;
- terminal_ours_for_output ();
- ! printf ("\nProgram received signal %d, %s\n",
- stop_signal,
- stop_signal < NSIG
- ? sys_siglist[stop_signal]
- --- 505,511 ----
- {
- printed = 1;
- terminal_ours_for_output ();
- ! printf_filtered ("\nProgram received signal %d, %s\n",
- stop_signal,
- stop_signal < NSIG
- ? sys_siglist[stop_signal]
- ***************
- *** 765,771 ****
- {
- terminal_ours_for_output ();
- print_sys_errmsg ("ptrace", breakpoints_failed);
- ! printf ("Stopped; cannot insert breakpoints.\n\
- The same program may be running in another process.\n");
- }
-
- --- 765,771 ----
- {
- terminal_ours_for_output ();
- print_sys_errmsg ("ptrace", breakpoints_failed);
- ! printf_filtered ("Stopped; cannot insert breakpoints.\n\
- The same program may be running in another process.\n");
- }
-
- ***************
- *** 776,782 ****
- if (remove_breakpoints ())
- {
- terminal_ours_for_output ();
- ! printf ("Cannot remove breakpoints because program is no longer writable.\n\
- It must be running in another process.\n\
- Further execution is probably impossible.\n");
- }
- --- 776,782 ----
- if (remove_breakpoints ())
- {
- terminal_ours_for_output ();
- ! printf_filtered ("Cannot remove breakpoints because program is no longer writable.\n\
- It must be running in another process.\n\
- Further execution is probably impossible.\n");
- }
- ***************
- *** 801,807 ****
- if (running_in_shell)
- {
- if (stop_signal == SIGSEGV)
- ! printf ("\
- You have just encountered a bug in \"sh\". GDB starts your program\n\
- by running \"sh\" with a command to exec your program.\n\
- This is so that \"sh\" will process wildcards and I/O redirection.\n\
- --- 801,807 ----
- if (running_in_shell)
- {
- if (stop_signal == SIGSEGV)
- ! printf_filtered ("\
- You have just encountered a bug in \"sh\". GDB starts your program\n\
- by running \"sh\" with a command to exec your program.\n\
- This is so that \"sh\" will process wildcards and I/O redirection.\n\
- ***************
- *** 833,839 ****
- if (stop_print_frame)
- {
- if (stop_breakpoint > 0)
- ! printf ("\nBpt %d, ", stop_breakpoint);
- print_sel_frame (stop_step
- && step_frame == stop_frame
- && step_start_function == find_pc_function (stop_pc));
- --- 833,839 ----
- if (stop_print_frame)
- {
- if (stop_breakpoint > 0)
- ! printf_filtered ("\nBpt %d, ", stop_breakpoint);
- print_sel_frame (stop_step
- && step_frame == stop_frame
- && step_start_function == find_pc_function (stop_pc));
- ***************
- *** 952,963 ****
- if (from_tty)
- {
- /* Show the results. */
- ! printf ("Number\tStop\tPrint\tPass to program\tDescription\n");
- ! printf ("%d\t", signum);
- ! printf ("%s\t", signal_stop[signum] ? "Yes" : "No");
- ! printf ("%s\t", signal_print[signum] ? "Yes" : "No");
- ! printf ("%s\t\t", signal_program[signum] ? "Yes" : "No");
- ! printf ("%s\n", sys_siglist[signum]);
- }
- }
-
- --- 952,963 ----
- if (from_tty)
- {
- /* Show the results. */
- ! printf_filtered ("Number\tStop\tPrint\tPass to program\tDescription\n");
- ! printf_filtered ("%d\t", signum);
- ! printf_filtered ("%s\t", signal_stop[signum] ? "Yes" : "No");
- ! printf_filtered ("%s\t", signal_print[signum] ? "Yes" : "No");
- ! printf_filtered ("%s\t\t", signal_program[signum] ? "Yes" : "No");
- ! printf_filtered ("%s\n", sys_siglist[signum]);
- }
- }
-
- ***************
- *** 968,1004 ****
- char *signum_exp;
- {
- register int i;
- ! printf ("Number\tStop\tPrint\tPass to program\tDescription\n");
-
- if (signum_exp)
- {
- i = parse_and_eval_address (signum_exp);
- ! printf ("%d\t", i);
- ! printf ("%s\t", signal_stop[i] ? "Yes" : "No");
- ! printf ("%s\t", signal_print[i] ? "Yes" : "No");
- ! printf ("%s\t\t", signal_program[i] ? "Yes" : "No");
- ! printf ("%s\n", sys_siglist[i]);
- return;
- }
-
- ! printf ("\n");
- for (i = 0; i < NSIG; i++)
- {
- QUIT;
- if (i > 0 && i % 16 == 0)
- {
- ! printf ("[Type Return to see more]");
- fflush (stdout);
- read_line ();
- }
- ! printf ("%d\t", i);
- ! printf ("%s\t", signal_stop[i] ? "Yes" : "No");
- ! printf ("%s\t", signal_print[i] ? "Yes" : "No");
- ! printf ("%s\t\t", signal_program[i] ? "Yes" : "No");
- ! printf ("%s\n", sys_siglist[i]);
- }
-
- ! printf ("\nUse the \"handle\" command to change these tables.\n");
- }
-
- /* Save all of the information associated with the inferior<==>gdb
- --- 968,1004 ----
- char *signum_exp;
- {
- register int i;
- ! printf_filtered ("Number\tStop\tPrint\tPass to program\tDescription\n");
-
- if (signum_exp)
- {
- i = parse_and_eval_address (signum_exp);
- ! printf_filtered ("%d\t", i);
- ! printf_filtered ("%s\t", signal_stop[i] ? "Yes" : "No");
- ! printf_filtered ("%s\t", signal_print[i] ? "Yes" : "No");
- ! printf_filtered ("%s\t\t", signal_program[i] ? "Yes" : "No");
- ! printf_filtered ("%s\n", sys_siglist[i]);
- return;
- }
-
- ! printf_filtered ("\n");
- for (i = 0; i < NSIG; i++)
- {
- QUIT;
- if (i > 0 && i % 16 == 0)
- {
- ! printf_filtered ("[Type Return to see more]");
- fflush (stdout);
- read_line ();
- }
- ! printf_filtered ("%d\t", i);
- ! printf_filtered ("%s\t", signal_stop[i] ? "Yes" : "No");
- ! printf_filtered ("%s\t", signal_print[i] ? "Yes" : "No");
- ! printf_filtered ("%s\t\t", signal_program[i] ? "Yes" : "No");
- ! printf_filtered ("%s\n", sys_siglist[i]);
- }
-
- ! printf_filtered ("\nUse the \"handle\" command to change these tables.\n");
- }
-
- /* Save all of the information associated with the inferior<==>gdb
- ***************
- *** 1093,1099 ****
- error message after another. Besides which, does the
- user really care if we can't restore the previously
- selected frame? */
- ! fprintf (stderr, "Unable to restore previously selected frame.\n");
- #endif
- select_frame (get_current_frame (), 0);
- return;
- --- 1093,1099 ----
- error message after another. Besides which, does the
- user really care if we can't restore the previously
- selected frame? */
- ! fprintf_filtered (stderr, "Unable to restore previously selected frame.\n");
- #endif
- select_frame (get_current_frame (), 0);
- return;
- *** 1.4 1991/10/05 20:59:54
- --- stack.c 1992/01/14 20:06:08
- ***************
- *** 99,117 ****
- tem = *fi;
-
- if (level >= 0)
- ! printf ("#%-2d ", level);
- if (fi->pc != sal.pc || !sal.symtab)
- ! printf ("0x%x in ", fi->pc);
- ! printf ("%s (", funname ? funname : "??");
- if (args)
- {
- FRAME_NUM_ARGS (numargs, tem);
- print_frame_args (func, FRAME_ARGS_ADDRESS (tem), numargs, stdout);
- }
- ! printf (")");
- if (sal.symtab)
- ! printf (" (%s line %d)", sal.symtab->filename, sal.line);
- ! printf ("\n");
- }
-
- if (source != 0 && sal.symtab)
- --- 99,117 ----
- tem = *fi;
-
- if (level >= 0)
- ! printf_filtered ("#%-2d ", level);
- if (fi->pc != sal.pc || !sal.symtab)
- ! printf_filtered ("0x%x in ", fi->pc);
- ! printf_filtered ("%s (", funname ? funname : "??");
- if (args)
- {
- FRAME_NUM_ARGS (numargs, tem);
- print_frame_args (func, FRAME_ARGS_ADDRESS (tem), numargs, stdout);
- }
- ! printf_filtered (")");
- if (sal.symtab)
- ! printf_filtered (" (%s line %d)", sal.symtab->filename, sal.line);
- ! printf_filtered ("\n");
- }
-
- if (source != 0 && sal.symtab)
- ***************
- *** 123,129 ****
- if (!done)
- {
- if (mid_statement)
- ! printf ("0x%x\t", fi->pc);
- print_source_lines (sal.symtab, sal.line, sal.line + 1);
- }
- current_source_line = max (sal.line - 5, 1);
- --- 123,129 ----
- if (!done)
- {
- if (mid_statement)
- ! printf_filtered ("0x%x\t", fi->pc);
- print_source_lines (sal.symtab, sal.line, sal.line + 1);
- }
- current_source_line = max (sal.line - 5, 1);
- ***************
- *** 183,238 ****
- calling_frame = get_prev_frame (frame);
-
- if (!addr_exp && selected_frame_level >= 0)
- ! printf ("Stack level %d, frame at 0x%x:\n pc = 0x%x",
- selected_frame_level, frame, fi.pc);
- else
- ! printf ("Stack frame at 0x%x:\n pc = 0x%x",
- frame, fi.pc);
-
- if (funname)
- ! printf (" in %s", funname);
- if (sal.symtab)
- ! printf (" (%s line %d)", sal.symtab->filename, sal.line);
- ! printf ("; saved pc 0x%x\n", FRAME_SAVED_PC (frame));
- if (calling_frame)
- ! printf (" called by frame at 0x%x", calling_frame);
- if (fi.next_frame && calling_frame)
- ! printf (",");
- if (fi.next_frame)
- ! printf (" caller of frame at 0x%x", fi.next_frame);
- if (fi.next_frame || calling_frame)
- ! printf ("\n");
- ! printf (" Arglist at 0x%x,", FRAME_ARGS_ADDRESS (fi));
- FRAME_NUM_ARGS (i, fi);
- if (i < 0)
- ! printf (" args: ");
- else if (i == 0)
- ! printf (" no args.");
- else if (i == 1)
- ! printf (" 1 arg: ");
- else
- ! printf (" %d args: ", i);
-
- FRAME_NUM_ARGS (numargs, fi);
- print_frame_args (func, FRAME_ARGS_ADDRESS (fi), numargs, stdout);
- ! printf ("\n");
- count = 0;
- for (i = 0; i < NUM_REGS; i++)
- if (fsr.regs[i])
- {
- if (count % 4 != 0)
- ! printf (", ");
- else
- {
- if (count == 0)
- ! printf (" Saved registers:");
- ! printf ("\n ");
- }
- ! printf ("%s at 0x%x", reg_names[i], fsr.regs[i]);
- count++;
- }
- if (count)
- ! printf ("\n");
- }
-
- /* Print briefly all stack frames or just the innermost COUNT frames. */
- --- 183,238 ----
- calling_frame = get_prev_frame (frame);
-
- if (!addr_exp && selected_frame_level >= 0)
- ! printf_filtered ("Stack level %d, frame at 0x%x:\n pc = 0x%x",
- selected_frame_level, frame, fi.pc);
- else
- ! printf_filtered ("Stack frame at 0x%x:\n pc = 0x%x",
- frame, fi.pc);
-
- if (funname)
- ! printf_filtered (" in %s", funname);
- if (sal.symtab)
- ! printf_filtered (" (%s line %d)", sal.symtab->filename, sal.line);
- ! printf_filtered ("; saved pc 0x%x\n", FRAME_SAVED_PC (frame));
- if (calling_frame)
- ! printf_filtered (" called by frame at 0x%x", calling_frame);
- if (fi.next_frame && calling_frame)
- ! printf_filtered (",");
- if (fi.next_frame)
- ! printf_filtered (" caller of frame at 0x%x", fi.next_frame);
- if (fi.next_frame || calling_frame)
- ! printf_filtered ("\n");
- ! printf_filtered (" Arglist at 0x%x,", FRAME_ARGS_ADDRESS (fi));
- FRAME_NUM_ARGS (i, fi);
- if (i < 0)
- ! printf_filtered (" args: ");
- else if (i == 0)
- ! printf_filtered (" no args.");
- else if (i == 1)
- ! printf_filtered (" 1 arg: ");
- else
- ! printf_filtered (" %d args: ", i);
-
- FRAME_NUM_ARGS (numargs, fi);
- print_frame_args (func, FRAME_ARGS_ADDRESS (fi), numargs, stdout);
- ! printf_filtered ("\n");
- count = 0;
- for (i = 0; i < NUM_REGS; i++)
- if (fsr.regs[i])
- {
- if (count % 4 != 0)
- ! printf_filtered (", ");
- else
- {
- if (count == 0)
- ! printf_filtered (" Saved registers:");
- ! printf_filtered ("\n ");
- }
- ! printf_filtered ("%s at 0x%x", reg_names[i], fsr.regs[i]);
- count++;
- }
- if (count)
- ! printf_filtered ("\n");
- }
-
- /* Print briefly all stack frames or just the innermost COUNT frames. */
- ***************
- *** 281,289 ****
- || SYMBOL_CLASS (sym) == LOC_REGISTER
- || SYMBOL_CLASS (sym) == LOC_STATIC)
- {
- ! fprintf (stream, "%s = ", SYMBOL_NAME (sym));
- print_variable_value (sym, frame, stream);
- ! fprintf (stream, "\n");
- fflush (stream);
- }
- }
- --- 281,289 ----
- || SYMBOL_CLASS (sym) == LOC_REGISTER
- || SYMBOL_CLASS (sym) == LOC_STATIC)
- {
- ! fprintf_filtered (stream, "%s = ", SYMBOL_NAME (sym));
- print_variable_value (sym, frame, stream);
- ! fprintf_filtered (stream, "\n");
- fflush (stream);
- }
- }
- ***************
- *** 346,354 ****
- sym = BLOCK_SYM (b, i);
- if (SYMBOL_CLASS (sym) == LOC_ARG)
- {
- ! fprintf (stream, "%s = ", SYMBOL_NAME (sym));
- print_variable_value (sym, frame, stream);
- ! fprintf (stream, "\n");
- fflush (stream);
- }
- }
- --- 346,354 ----
- sym = BLOCK_SYM (b, i);
- if (SYMBOL_CLASS (sym) == LOC_ARG)
- {
- ! fprintf_filtered (stream, "%s = ", SYMBOL_NAME (sym));
- print_variable_value (sym, frame, stream);
- ! fprintf_filtered (stream, "\n");
- fflush (stream);
- }
- }
- *** 1.5 1991/10/05 20:59:54
- --- symmisc.c 1992/01/14 20:06:08
- ***************
- *** 401,415 ****
- for (s = symtab_list; s; s = s->next)
- {
- /* First print the line table. */
- ! fprintf (outfile, "Symtab for file %s\n\n", s->filename);
- ! fprintf (outfile, "Line table:\n\n");
- l = LINETABLE (s);
- len = l->nitems;
- for (i = 0; i < len; i++)
- ! fprintf (outfile, " line %d at %x\n", l->item[i].line,
- l->item[i].pc);
- /* Now print the block info. */
- ! fprintf (outfile, "\nBlockvector:\n\n");
- bv = BLOCKVECTOR (s);
- len = BLOCKVECTOR_NBLOCKS (bv);
- for (i = 0; i < len; i++)
- --- 401,415 ----
- for (s = symtab_list; s; s = s->next)
- {
- /* First print the line table. */
- ! fprintf_filtered (outfile, "Symtab for file %s\n\n", s->filename);
- ! fprintf_filtered (outfile, "Line table:\n\n");
- l = LINETABLE (s);
- len = l->nitems;
- for (i = 0; i < len; i++)
- ! fprintf_filtered (outfile, " line %d at %x\n", l->item[i].line,
- l->item[i].pc);
- /* Now print the block info. */
- ! fprintf_filtered (outfile, "\nBlockvector:\n\n");
- bv = BLOCKVECTOR (s);
- len = BLOCKVECTOR_NBLOCKS (bv);
- for (i = 0; i < len; i++)
- ***************
- *** 417,429 ****
- b = BLOCKVECTOR_BLOCK (bv, i);
- depth = block_depth (b) * 2;
- print_spaces (depth, outfile);
- ! fprintf (outfile, "block #%03d (object 0x%x) ", i, b);
- ! fprintf (outfile, "[0x%x..0x%x]", BLOCK_START (b), BLOCK_END (b));
- if (BLOCK_SUPERBLOCK (b))
- ! fprintf (outfile, " (under 0x%x)", BLOCK_SUPERBLOCK (b));
- if (BLOCK_FUNCTION (b))
- ! fprintf (outfile, " %s", SYMBOL_NAME (BLOCK_FUNCTION (b)));
- ! fputc ('\n', outfile);
- blen = BLOCK_NSYMS (b);
- for (j = 0; j < blen; j++)
- {
- --- 417,429 ----
- b = BLOCKVECTOR_BLOCK (bv, i);
- depth = block_depth (b) * 2;
- print_spaces (depth, outfile);
- ! fprintf_filtered (outfile, "block #%03d (object 0x%x) ", i, b);
- ! fprintf_filtered (outfile, "[0x%x..0x%x]", BLOCK_START (b), BLOCK_END (b));
- if (BLOCK_SUPERBLOCK (b))
- ! fprintf_filtered (outfile, " (under 0x%x)", BLOCK_SUPERBLOCK (b));
- if (BLOCK_FUNCTION (b))
- ! fprintf_filtered (outfile, " %s", SYMBOL_NAME (BLOCK_FUNCTION (b)));
- ! fputc_filtered ('\n', outfile);
- blen = BLOCK_NSYMS (b);
- for (j = 0; j < blen; j++)
- {
- ***************
- *** 431,437 ****
- }
- }
-
- ! fprintf (outfile, "\n\n");
- }
-
- immediate_quit--;
- --- 431,437 ----
- }
- }
-
- ! fprintf_filtered (outfile, "\n\n");
- }
-
- immediate_quit--;
- ***************
- *** 447,453 ****
- print_spaces (depth, outfile);
- if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
- {
- ! fprintf (outfile, "label %s at 0x%x", SYMBOL_NAME (symbol),
- SYMBOL_VALUE (symbol));
- return;
- }
- --- 447,453 ----
- print_spaces (depth, outfile);
- if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
- {
- ! fprintf_filtered (outfile, "label %s at 0x%x", SYMBOL_NAME (symbol),
- SYMBOL_VALUE (symbol));
- return;
- }
- ***************
- *** 459,465 ****
- }
- else
- {
- ! fprintf (outfile, "%s %s = ",
- (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_ENUM
- ? "enum"
- : (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT
- --- 459,465 ----
- }
- else
- {
- ! fprintf_filtered (outfile, "%s %s = ",
- (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_ENUM
- ? "enum"
- : (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT
- ***************
- *** 467,519 ****
- SYMBOL_NAME (symbol));
- type_print_1 (SYMBOL_TYPE (symbol), "", outfile, 1, depth);
- }
- ! fprintf (outfile, ";\n");
- }
- else
- {
- if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF)
- ! fprintf (outfile, "typedef ");
- if (SYMBOL_TYPE (symbol))
- {
- type_print_1 (SYMBOL_TYPE (symbol), SYMBOL_NAME (symbol),
- outfile, 1, depth);
- ! fprintf (outfile, "; ");
- }
- else
- ! fprintf (outfile, "%s ", SYMBOL_NAME (symbol));
-
- switch (SYMBOL_CLASS (symbol))
- {
- case LOC_CONST:
- ! fprintf (outfile, "const %d (0x%x),",
- SYMBOL_VALUE (symbol), SYMBOL_VALUE (symbol));
- break;
-
- case LOC_CONST_BYTES:
- ! fprintf (outfile, "const %d hex bytes:",
- TYPE_LENGTH (SYMBOL_TYPE (symbol)));
- {
- int i;
- for (i = 0; i < TYPE_LENGTH (SYMBOL_TYPE (symbol)); i++)
- ! fprintf (outfile, " %2x", SYMBOL_VALUE_BYTES (symbol) [i]);
- ! fprintf (outfile, ",");
- }
- break;
-
- case LOC_STATIC:
- ! fprintf (outfile, "static at 0x%x,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_REGISTER:
- ! fprintf (outfile, "register %d,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_ARG:
- ! fprintf (outfile, "arg at 0x%x,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_LOCAL:
- ! fprintf (outfile, "local at 0x%x,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_TYPEDEF:
- --- 467,519 ----
- SYMBOL_NAME (symbol));
- type_print_1 (SYMBOL_TYPE (symbol), "", outfile, 1, depth);
- }
- ! fprintf_filtered (outfile, ";\n");
- }
- else
- {
- if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF)
- ! fprintf_filtered (outfile, "typedef ");
- if (SYMBOL_TYPE (symbol))
- {
- type_print_1 (SYMBOL_TYPE (symbol), SYMBOL_NAME (symbol),
- outfile, 1, depth);
- ! fprintf_filtered (outfile, "; ");
- }
- else
- ! fprintf_filtered (outfile, "%s ", SYMBOL_NAME (symbol));
-
- switch (SYMBOL_CLASS (symbol))
- {
- case LOC_CONST:
- ! fprintf_filtered (outfile, "const %d (0x%x),",
- SYMBOL_VALUE (symbol), SYMBOL_VALUE (symbol));
- break;
-
- case LOC_CONST_BYTES:
- ! fprintf_filtered (outfile, "const %d hex bytes:",
- TYPE_LENGTH (SYMBOL_TYPE (symbol)));
- {
- int i;
- for (i = 0; i < TYPE_LENGTH (SYMBOL_TYPE (symbol)); i++)
- ! fprintf_filtered (outfile, " %2x", SYMBOL_VALUE_BYTES (symbol) [i]);
- ! fprintf_filtered (outfile, ",");
- }
- break;
-
- case LOC_STATIC:
- ! fprintf_filtered (outfile, "static at 0x%x,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_REGISTER:
- ! fprintf_filtered (outfile, "register %d,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_ARG:
- ! fprintf_filtered (outfile, "arg at 0x%x,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_LOCAL:
- ! fprintf_filtered (outfile, "local at 0x%x,", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_TYPEDEF:
- ***************
- *** 520,536 ****
- break;
-
- case LOC_LABEL:
- ! fprintf (outfile, "label at 0x%x", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_BLOCK:
- ! fprintf (outfile, "block (object 0x%x) starting at 0x%x,",
- SYMBOL_VALUE (symbol),
- BLOCK_START (SYMBOL_BLOCK_VALUE (symbol)));
- break;
- }
- }
- ! fprintf (outfile, "\n");
- }
-
- /* Return the nexting depth of a block within other blocks in its symtab. */
- --- 520,536 ----
- break;
-
- case LOC_LABEL:
- ! fprintf_filtered (outfile, "label at 0x%x", SYMBOL_VALUE (symbol));
- break;
-
- case LOC_BLOCK:
- ! fprintf_filtered (outfile, "block (object 0x%x) starting at 0x%x,",
- SYMBOL_VALUE (symbol),
- BLOCK_START (SYMBOL_BLOCK_VALUE (symbol)));
- break;
- }
- }
- ! fprintf_filtered (outfile, "\n");
- }
-
- /* Return the nexting depth of a block within other blocks in its symtab. */
- *** 1.7 1991/10/05 20:59:54
- --- symtab.c 1992/01/14 20:06:09
- ***************
- *** 49,76 ****
- struct type *builtin_type_float;
- struct type *builtin_type_double;
-
- ! /* Lookup the symbol table of a source file named NAME. */
-
- ! struct symtab *
- ! lookup_symtab (name)
- char *name;
- {
- register struct symtab *s;
- register char *copy;
-
- for (s = symtab_list; s; s = s->next)
- if (!strcmp (name, s->filename))
- return s;
-
- /* If name not found as specified, see if adding ".c" helps. */
-
- copy = (char *) alloca (strlen (name) + 3);
- strcpy (copy, name);
- strcat (copy, ".c");
- ! for (s = symtab_list; s; s = s->next)
- ! if (!strcmp (copy, s->filename))
- ! return s;
-
- return 0;
- }
-
- --- 49,109 ----
- struct type *builtin_type_float;
- struct type *builtin_type_double;
-
- ! /* Lookup the symbol table of a source file named NAME. Try a couple
- ! of variations if the first lookup doesn't work. */
-
- ! static struct symtab *
- ! lookup_symtab_1 (name)
- char *name;
- {
- register struct symtab *s;
- register char *copy;
- + register char *slash;
- + extern char *strchr();
-
- for (s = symtab_list; s; s = s->next)
- if (!strcmp (name, s->filename))
- return s;
-
- + if(!(slash = strchr (name, '/')))
- + slash = strchr (name, '\\');
- +
- + if (!slash)
- + {
- + int len = strlen(name);
- +
- + for (s = symtab_list; s; s = s->next)
- + {
- + int l = strlen (s->filename);
- +
- + if (s->filename[l - len -1] == *slash
- + && !strcmp (s->filename + l - len, name))
- + return s;
- + }
- + }
- +
- + return 0;
- + }
- +
- + struct symtab *
- + lookup_symtab (name)
- + char *name;
- + {
- + register struct symtab *s;
- + register char *copy;
- +
- + s = lookup_symtab_1 (name);
- + if (s) return s;
- +
- /* If name not found as specified, see if adding ".c" helps. */
-
- copy = (char *) alloca (strlen (name) + 3);
- strcpy (copy, name);
- strcat (copy, ".c");
- ! s = lookup_symtab_1 (copy);
- ! if (s) return s;
-
- + /* We didn't find anything; die. */
- return 0;
- }
-
- ***************
- *** 230,235 ****
- --- 263,269 ----
- return ptype;
- }
-
- + #if 0
- /* Smash TYPE to be a type of pointers to TO_TYPE.
- If TO_TYPE is not permanent and has no pointer-type yet,
- record TYPE as its pointer-type. */
- ***************
- *** 283,288 ****
- --- 317,323 ----
- TYPE_FUNCTION_TYPE (to_type) = type;
- }
- }
- + #endif
-
- static struct symbol *lookup_block_symbol ();
- static int lookup_misc_func ();
- ***************
- *** 625,631 ****
- return 0;
- l = LINETABLE (symtab);
- Index = find_line_common(l, line, &dummy);
- ! return Index ? l->item[Index].pc : 0;
- }
-
- /* Find the range of pc values in a line.
- --- 660,666 ----
- return 0;
- l = LINETABLE (symtab);
- Index = find_line_common(l, line, &dummy);
- ! return (Index >= 0) ? l->item[Index].pc : 0;
- }
-
- /* Find the range of pc values in a line.
- ***************
- *** 651,657 ****
-
- l = LINETABLE (symtab);
- Index = find_line_common (l, thisline, &exact_match);
- ! if (Index)
- {
- *startptr = l->item[Index].pc;
- /* If we have not seen an entry for the specified line,
- --- 686,692 ----
-
- l = LINETABLE (symtab);
- Index = find_line_common (l, thisline, &exact_match);
- ! if (Index >= 0)
- {
- *startptr = l->item[Index].pc;
- /* If we have not seen an entry for the specified line,
- ***************
- *** 661,667 ****
- else
- /* Perhaps the following entry is for the following line.
- It's worth a try. */
- ! if (l->item[Index+1].line == thisline + 1)
- *endptr = l->item[Index+1].pc;
- else
- *endptr = find_line_pc (symtab, thisline+1);
- --- 696,702 ----
- else
- /* Perhaps the following entry is for the following line.
- It's worth a try. */
- ! if (Index+1 < l->nitems && l->item[Index+1].line == thisline + 1)
- *endptr = l->item[Index+1].pc;
- else
- *endptr = find_line_pc (symtab, thisline+1);
- ***************
- *** 690,702 ****
- or 0 if none has been seen so far.
- BEST_INDEX identifies the item for it. */
-
- ! int best_index = 0;
- int best = 0;
-
- int nextline = -1;
-
- if (lineno <= 0)
- ! return 0;
-
- len = l->nitems;
- for (i = 0; i < len; i++)
- --- 725,737 ----
- or 0 if none has been seen so far.
- BEST_INDEX identifies the item for it. */
-
- ! int best_index = -1;
- int best = 0;
-
- int nextline = -1;
-
- if (lineno <= 0)
- ! return -1;
-
- len = l->nitems;
- for (i = 0; i < len; i++)
- ***************
- *** 974,1004 ****
-
- if (symtab_list == 0)
- {
- ! printf ("No symbol table is loaded.\n");
- return;
- }
- ! printf ("Source files for which symbol table is known:\n");
- for (s = symtab_list; s; s = s->next)
- {
- if (column != 0 && column + strlen (s->filename) >= 70)
- {
- ! printf ("\n");
- column = 0;
- }
- else if (column != 0)
- {
- ! printf (" ");
- column++;
- }
- ! printf ("%s", s->filename);
- column += strlen (s->filename);
- if (s->next)
- {
- ! printf (",");
- column++;
- }
- }
- ! printf ("\n");
- }
-
- /* List all symbols (if REGEXP is 0) or all symbols matching REGEXP.
- --- 1009,1039 ----
-
- if (symtab_list == 0)
- {
- ! printf_filtered ("No symbol table is loaded.\n");
- return;
- }
- ! printf_filtered ("Source files for which symbol table is known:\n");
- for (s = symtab_list; s; s = s->next)
- {
- if (column != 0 && column + strlen (s->filename) >= 70)
- {
- ! printf_filtered ("\n");
- column = 0;
- }
- else if (column != 0)
- {
- ! printf_filtered (" ");
- column++;
- }
- ! printf_filtered ("%s", s->filename);
- column += strlen (s->filename);
- if (s->next)
- {
- ! printf_filtered (",");
- column++;
- }
- }
- ! printf_filtered ("\n");
- }
-
- /* List all symbols (if REGEXP is 0) or all symbols matching REGEXP.
- ***************
- *** 1009,1015 ****
- #define MORE \
- { print_count++; \
- if (print_count >= 21) \
- ! { printf ("--Type Return to print more--"); \
- print_count = 0; \
- fflush (stdout); \
- read_line (); } }
- --- 1044,1050 ----
- #define MORE \
- { print_count++; \
- if (print_count >= 21) \
- ! {printf_filtered ("--Type Return to print more--"); \
- print_count = 0; \
- fflush (stdout); \
- read_line (); } }
- ***************
- *** 1037,1043 ****
- if (val = (char *) re_comp (regexp))
- error ("Invalid regexp: %s", val);
-
- ! printf (regexp
- ? "All %ss matching regular expression \"%s\":\n"
- : "All defined %ss:\n",
- classnames[class],
- --- 1072,1078 ----
- if (val = (char *) re_comp (regexp))
- error ("Invalid regexp: %s", val);
-
- ! printf_filtered (regexp
- ? "All %ss matching regular expression \"%s\":\n"
- : "All defined %ss:\n",
- classnames[class],
- ***************
- *** 1071,1086 ****
- {
- if (!found_in_file)
- {
- ! printf ("\nFile %s:\n", s->filename);
- print_count += 2;
- }
- found_in_file = 1;
- MORE;
- if (class != 2 && i == 1)
- ! printf ("static ");
- if (class == 2
- && SYMBOL_NAMESPACE (sym) != STRUCT_NAMESPACE)
- ! printf ("typedef ");
-
- type_print (SYMBOL_TYPE (sym),
- (SYMBOL_CLASS (sym) == LOC_TYPEDEF
- --- 1106,1121 ----
- {
- if (!found_in_file)
- {
- ! printf_filtered ("\nFile %s:\n", s->filename);
- print_count += 2;
- }
- found_in_file = 1;
- MORE;
- if (class != 2 && i == 1)
- ! printf_filtered ("static ");
- if (class == 2
- && SYMBOL_NAMESPACE (sym) != STRUCT_NAMESPACE)
- ! printf_filtered ("typedef ");
-
- type_print (SYMBOL_TYPE (sym),
- (SYMBOL_CLASS (sym) == LOC_TYPEDEF
- ***************
- *** 1091,1098 ****
- && (TYPE_NAME ((SYMBOL_TYPE (sym))) == 0
- || 0 != strcmp (TYPE_NAME ((SYMBOL_TYPE (sym))),
- SYMBOL_NAME (sym))))
- ! printf (" %s", SYMBOL_NAME (sym));
- ! printf (";\n");
- }
- }
- }
- --- 1126,1133 ----
- && (TYPE_NAME ((SYMBOL_TYPE (sym))) == 0
- || 0 != strcmp (TYPE_NAME ((SYMBOL_TYPE (sym))),
- SYMBOL_NAME (sym))))
- ! printf_filtered (" %s", SYMBOL_NAME (sym));
- ! printf_filtered (";\n");
- }
- }
- }
- *** 1.4 1991/09/15 21:31:53
- --- utils.c 1992/01/14 20:06:09
- ***************
- *** 208,214 ****
- strcat (combined, ": ");
- strcat (combined, err);
-
- ! printf ("%s.\n", combined);
- }
-
- void
- --- 208,214 ----
- strcat (combined, ": ");
- strcat (combined, err);
-
- ! printf_filtered ("%s.\n", combined);
- }
-
- void
- ***************
- *** 240,246 ****
- }
-
- /* Print an error message and return to command level.
- ! STRING is the error message, used as a fprintf string,
- and ARG is passed as an argument to it. */
-
- void
- --- 240,246 ----
- }
-
- /* Print an error message and return to command level.
- ! STRING is the error message, used as a fprintf_filtered string,
- and ARG is passed as an argument to it. */
-
- void
- ***************
- *** 249,263 ****
- int arg1, arg2, arg3;
- {
- fflush (stdout);
- ! fprintf (stderr, "\n");
- ! fprintf (stderr, string, arg1, arg2, arg3);
- ! fprintf (stderr, "\n");
- return_to_top_level ();
- }
-
- /* Print an error message and exit reporting failure.
- This is for a error that we cannot continue from.
- ! STRING and ARG are passed to fprintf. */
-
- void
- fatal (string, arg)
- --- 249,263 ----
- int arg1, arg2, arg3;
- {
- fflush (stdout);
- ! fprintf_filtered (stderr, "\n");
- ! fprintf_filtered (stderr, string, arg1, arg2, arg3);
- ! fprintf_filtered (stderr, "\n");
- return_to_top_level ();
- }
-
- /* Print an error message and exit reporting failure.
- This is for a error that we cannot continue from.
- ! STRING and ARG are passed to fprintf_filtered. */
-
- void
- fatal (string, arg)
- ***************
- *** 264,273 ****
- char *string;
- int arg;
- {
- ! fprintf (stderr, "gdb: ");
- ! fprintf (stderr, string, arg);
- ! fprintf (stderr, "\n");
- ! exit (1);
- }
-
- /* Make a copy of the string at PTR with SIZE characters
- --- 264,275 ----
- char *string;
- int arg;
- {
- ! extern void really_exit();
- !
- ! fprintf_filtered (stderr, "gdb: ");
- ! fprintf_filtered (stderr, string, arg);
- ! fprintf_filtered (stderr, "\n");
- ! really_exit (1);
- }
-
- /* Make a copy of the string at PTR with SIZE characters
- ***************
- *** 303,309 ****
- register FILE *file;
- {
- while (n-- > 0)
- ! fputc (' ', file);
- }
-
- /* Ask user a y-or-n question and return 1 iff answer is yes.
- --- 305,311 ----
- register FILE *file;
- {
- while (n-- > 0)
- ! fputc_filtered (' ', file);
- }
-
- /* Ask user a y-or-n question and return 1 iff answer is yes.
- ***************
- *** 323,330 ****
-
- while (1)
- {
- ! printf (ctlstr, arg1, arg2);
- ! printf ("(y or n) ");
- fflush (stdout);
- answer = fgetc (stdin);
- clearerr (stdin); /* in case of C-d */
- --- 325,332 ----
-
- while (1)
- {
- ! printf(ctlstr, arg1, arg2);
- ! printf ("(y or n) ");
- fflush (stdout);
- answer = fgetc (stdin);
- clearerr (stdin); /* in case of C-d */
- ***************
- *** 338,344 ****
- return 1;
- if (answer == 'N')
- return 0;
- ! printf ("Please answer y or n.\n");
- }
- }
-
- --- 340,346 ----
- return 1;
- if (answer == 'N')
- return 0;
- ! printf ("Please answer y or n.\n");
- }
- }
-
- ***************
- *** 432,458 ****
- if (c < 040 || c >= 0177)
- {
- if (c == '\n')
- ! fprintf (stream, "\\n");
- else if (c == '\b')
- ! fprintf (stream, "\\b");
- else if (c == '\t')
- ! fprintf (stream, "\\t");
- else if (c == '\f')
- ! fprintf (stream, "\\f");
- else if (c == '\r')
- ! fprintf (stream, "\\r");
- else if (c == 033)
- ! fprintf (stream, "\\e");
- else if (c == '\a')
- ! fprintf (stream, "\\a");
- else
- ! fprintf (stream, "\\%03o", c);
- }
- else
- {
- if (c == '\\' || c == '"' || c == '\'')
- ! fputc ('\\', stream);
- ! fputc (c, stream);
- }
- }
- #ifdef atarist
- --- 434,460 ----
- if (c < 040 || c >= 0177)
- {
- if (c == '\n')
- ! fprintf_filtered (stream, "\\n");
- else if (c == '\b')
- ! fprintf_filtered (stream, "\\b");
- else if (c == '\t')
- ! fprintf_filtered (stream, "\\t");
- else if (c == '\f')
- ! fprintf_filtered (stream, "\\f");
- else if (c == '\r')
- ! fprintf_filtered (stream, "\\r");
- else if (c == 033)
- ! fprintf_filtered (stream, "\\e");
- else if (c == '\a')
- ! fprintf_filtered (stream, "\\a");
- else
- ! fprintf_filtered (stream, "\\%03o", c);
- }
- else
- {
- if (c == '\\' || c == '"' || c == '\'')
- ! fputc_filtered ('\\', stream);
- ! fputc_filtered (c, stream);
- }
- }
- #ifdef atarist
- *** 1.3 1991/10/05 20:59:54
- --- valprint.c 1992/01/14 20:06:10
- ***************
- *** 50,56 ****
-
- if (val == 0)
- {
- ! printf ("<address of value unknown>");
- return 0;
- }
-
- --- 50,56 ----
-
- if (val == 0)
- {
- ! printf_filtered ("<address of value unknown>");
- return 0;
- }
-
- ***************
- *** 62,73 ****
- {
- n = VALUE_REPETITIONS (val);
- typelen = TYPE_LENGTH (VALUE_TYPE (val));
- ! fputc ('{', stream);
- /* Print arrays of characters using string syntax. */
- if (typelen == 1 && TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT
- && format == 0)
- {
- ! fputc ('"', stream);
- for (i = 0; i < n && i < print_max; i++)
- {
- QUIT;
- --- 62,73 ----
- {
- n = VALUE_REPETITIONS (val);
- typelen = TYPE_LENGTH (VALUE_TYPE (val));
- ! fputc_filtered ('{', stream);
- /* Print arrays of characters using string syntax. */
- if (typelen == 1 && TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT
- && format == 0)
- {
- ! fputc_filtered ('"', stream);
- for (i = 0; i < n && i < print_max; i++)
- {
- QUIT;
- ***************
- *** 74,81 ****
- printchar (VALUE_CONTENTS (val)[i], stream);
- }
- if (i < n)
- ! fprintf (stream, "...");
- ! fputc ('"', stream);
- }
- else
- {
- --- 74,81 ----
- printchar (VALUE_CONTENTS (val)[i], stream);
- }
- if (i < n)
- ! fprintf_filtered (stream, "...");
- ! fputc_filtered ('"', stream);
- }
- else
- {
- ***************
- *** 82,95 ****
- for (i = 0; i < n && i < print_max; i++)
- {
- if (i)
- ! fprintf (stream, ", ");
- val_print (VALUE_TYPE (val), VALUE_CONTENTS (val) + typelen * i,
- VALUE_ADDRESS (val) + typelen * i, stream, format);
- }
- if (i < n)
- ! fprintf (stream, "...");
- }
- ! fputc ('}', stream);
- return n * typelen;
- }
- else
- --- 82,95 ----
- for (i = 0; i < n && i < print_max; i++)
- {
- if (i)
- ! fprintf_filtered (stream, ", ");
- val_print (VALUE_TYPE (val), VALUE_CONTENTS (val) + typelen * i,
- VALUE_ADDRESS (val) + typelen * i, stream, format);
- }
- if (i < n)
- ! fprintf_filtered (stream, "...");
- }
- ! fputc_filtered ('}', stream);
- return n * typelen;
- }
- else
- ***************
- *** 98,106 ****
- /* If it is a pointer, indicate what it points to. */
- if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_PTR)
- {
- ! fprintf (stream, "(");
- type_print (VALUE_TYPE (val), "", stream, -1);
- ! fprintf (stream, ") ");
- }
- return val_print (VALUE_TYPE (val), VALUE_CONTENTS (val),
- VALUE_ADDRESS (val), stream, format);
- --- 98,106 ----
- /* If it is a pointer, indicate what it points to. */
- if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_PTR)
- {
- ! fprintf_filtered (stream, "(");
- type_print (VALUE_TYPE (val), "", stream, -1);
- ! fprintf_filtered (stream, ") ");
- }
- return val_print (VALUE_TYPE (val), VALUE_CONTENTS (val),
- VALUE_ADDRESS (val), stream, format);
- ***************
- *** 140,151 ****
- elttype = TYPE_TARGET_TYPE (type);
- eltlen = TYPE_LENGTH (elttype);
- len = TYPE_LENGTH (type) / eltlen;
- ! fprintf (stream, "{");
- /* For an array of chars, print with string syntax. */
- if (eltlen == 1 && TYPE_CODE (elttype) == TYPE_CODE_INT
- && format == 0)
- {
- ! fputc ('"', stream);
- for (i = 0; i < len && i < print_max; i++)
- {
- QUIT;
- --- 140,151 ----
- elttype = TYPE_TARGET_TYPE (type);
- eltlen = TYPE_LENGTH (elttype);
- len = TYPE_LENGTH (type) / eltlen;
- ! fprintf_filtered (stream, "{");
- /* For an array of chars, print with string syntax. */
- if (eltlen == 1 && TYPE_CODE (elttype) == TYPE_CODE_INT
- && format == 0)
- {
- ! fputc_filtered ('"', stream);
- for (i = 0; i < len && i < print_max; i++)
- {
- QUIT;
- ***************
- *** 152,172 ****
- printchar (valaddr[i], stream);
- }
- if (i < len)
- ! fprintf (stream, "...");
- ! fputc ('"', stream);
- }
- else
- {
- for (i = 0; i < len && i < print_max; i++)
- {
- ! if (i) fprintf (stream, ", ");
- val_print (elttype, valaddr + i * eltlen,
- 0, stream, format);
- }
- if (i < len)
- ! fprintf (stream, "...");
- }
- ! fprintf (stream, "}");
- break;
- }
- /* Array of unspecified length: treat like pointer. */
- --- 152,172 ----
- printchar (valaddr[i], stream);
- }
- if (i < len)
- ! fprintf_filtered (stream, "...");
- ! fputc_filtered ('"', stream);
- }
- else
- {
- for (i = 0; i < len && i < print_max; i++)
- {
- ! if (i) fprintf_filtered (stream, ", ");
- val_print (elttype, valaddr + i * eltlen,
- 0, stream, format);
- }
- if (i < len)
- ! fprintf_filtered (stream, "...");
- }
- ! fprintf_filtered (stream, "}");
- break;
- }
- /* Array of unspecified length: treat like pointer. */
- ***************
- *** 178,184 ****
- print_scalar_formatted (valaddr, type, format, 0, stream);
- break;
- }
- ! fprintf (stream, "0x%x", * (int *) valaddr);
- /* For a pointer to char or unsigned char,
- also print the string pointed to, unless pointer is null. */
-
- --- 178,184 ----
- print_scalar_formatted (valaddr, type, format, 0, stream);
- break;
- }
- ! fprintf_filtered (stream, "0x%x", * (int *) valaddr);
- /* For a pointer to char or unsigned char,
- also print the string pointed to, unless pointer is null. */
-
- ***************
- *** 188,195 ****
- && format == 0
- && unpack_long (type, valaddr) != 0)
- {
- ! fputc (' ', stream);
- ! fputc ('"', stream);
- for (i = 0; i < print_max; i++)
- {
- QUIT;
- --- 188,195 ----
- && format == 0
- && unpack_long (type, valaddr) != 0)
- {
- ! fputc_filtered (' ', stream);
- ! fputc_filtered ('"', stream);
- for (i = 0; i < print_max; i++)
- {
- QUIT;
- ***************
- *** 198,206 ****
- break;
- printchar (c, stream);
- }
- ! fputc ('"', stream);
- if (i == print_max)
- ! fprintf (stream, "...");
- fflush (stream);
- /* Return number of characters printed, plus one for the
- terminating null if we have "reached the end". */
- --- 198,206 ----
- break;
- printchar (c, stream);
- }
- ! fputc_filtered ('"', stream);
- if (i == print_max)
- ! fprintf_filtered (stream, "...");
- fflush (stream);
- /* Return number of characters printed, plus one for the
- terminating null if we have "reached the end". */
- ***************
- *** 210,221 ****
-
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- ! fprintf (stream, "{");
- len = TYPE_NFIELDS (type);
- for (i = 0; i < len; i++)
- {
- ! if (i) fprintf (stream, ", ");
- ! fprintf (stream, "%s = ", TYPE_FIELD_NAME (type, i));
- if (TYPE_FIELD_PACKED (type, i))
- {
- val = unpack_field_as_long (type, valaddr, i);
- --- 210,221 ----
-
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- ! fprintf_filtered (stream, "{");
- len = TYPE_NFIELDS (type);
- for (i = 0; i < len; i++)
- {
- ! if (i) fprintf_filtered (stream, ", ");
- ! fprintf_filtered (stream, "%s = ", TYPE_FIELD_NAME (type, i));
- if (TYPE_FIELD_PACKED (type, i))
- {
- val = unpack_field_as_long (type, valaddr, i);
- ***************
- *** 226,232 ****
- valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
- 0, stream, format);
- }
- ! fprintf (stream, "}");
- break;
-
- case TYPE_CODE_ENUM:
- --- 226,232 ----
- valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
- 0, stream, format);
- }
- ! fprintf_filtered (stream, "}");
- break;
-
- case TYPE_CODE_ENUM:
- ***************
- *** 244,252 ****
- break;
- }
- if (i < len)
- ! fprintf (stream, "%s", TYPE_FIELD_NAME (type, i));
- else
- ! fprintf (stream, "%d", val);
- break;
-
- case TYPE_CODE_FUNC:
- --- 244,252 ----
- break;
- }
- if (i < len)
- ! fprintf_filtered (stream, "%s", TYPE_FIELD_NAME (type, i));
- else
- ! fprintf_filtered (stream, "%d", val);
- break;
-
- case TYPE_CODE_FUNC:
- ***************
- *** 255,264 ****
- print_scalar_formatted (valaddr, type, format, 0, stream);
- break;
- }
- ! fprintf (stream, "{");
- type_print (type, "", stream, -1);
- ! fprintf (stream, "} ");
- ! fprintf (stream, "0x%x", address);
- break;
-
- case TYPE_CODE_INT:
- --- 255,264 ----
- print_scalar_formatted (valaddr, type, format, 0, stream);
- break;
- }
- ! fprintf_filtered (stream, "{");
- type_print (type, "", stream, -1);
- ! fprintf_filtered (stream, "} ");
- ! fprintf_filtered (stream, "0x%x", address);
- break;
-
- case TYPE_CODE_INT:
- ***************
- *** 267,280 ****
- print_scalar_formatted (valaddr, type, format, 0, stream);
- break;
- }
- ! fprintf (stream,
- TYPE_UNSIGNED (type) ? "%u" : "%d",
- unpack_long (type, valaddr));
- if (TYPE_LENGTH (type) == 1)
- {
- ! fprintf (stream, " '");
- printchar (unpack_long (type, valaddr), stream);
- ! fputc ('\'', stream);
- }
- break;
-
- --- 267,280 ----
- print_scalar_formatted (valaddr, type, format, 0, stream);
- break;
- }
- ! fprintf_filtered (stream,
- TYPE_UNSIGNED (type) ? "%u" : "%d",
- unpack_long (type, valaddr));
- if (TYPE_LENGTH (type) == 1)
- {
- ! fprintf_filtered (stream, " '");
- printchar (unpack_long (type, valaddr), stream);
- ! fputc_filtered ('\'', stream);
- }
- break;
-
- ***************
- *** 287,301 ****
- #ifdef IEEE_FLOAT
- if (is_nan (unpack_double (type, valaddr)))
- {
- ! fprintf (stream, "Nan");
- break;
- }
- #endif
- ! fprintf (stream, "%g", unpack_double (type, valaddr));
- break;
-
- case TYPE_CODE_VOID:
- ! fprintf (stream, "void");
- break;
-
- default:
- --- 287,301 ----
- #ifdef IEEE_FLOAT
- if (is_nan (unpack_double (type, valaddr)))
- {
- ! fprintf_filtered (stream, "Nan");
- break;
- }
- #endif
- ! fprintf_filtered (stream, "%g", unpack_double (type, valaddr));
- break;
-
- case TYPE_CODE_VOID:
- ! fprintf_filtered (stream, "void");
- break;
-
- default:
- ***************
- *** 373,381 ****
- &&
- (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
- || code == TYPE_CODE_ARRAY)))
- ! fprintf (stream, " ");
- type_print_varspec_prefix (type, stream, show, 0);
- ! fprintf (stream, "%s", varstring);
- type_print_varspec_suffix (type, stream, show, 0);
- }
-
- --- 373,381 ----
- &&
- (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
- || code == TYPE_CODE_ARRAY)))
- ! fprintf_filtered (stream, " ");
- type_print_varspec_prefix (type, stream, show, 0);
- ! fprintf_filtered (stream, "%s", varstring);
- type_print_varspec_suffix (type, stream, show, 0);
- }
-
- ***************
- *** 406,412 ****
- {
- case TYPE_CODE_PTR:
- type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
- ! fputc ('*', stream);
- break;
-
- case TYPE_CODE_FUNC:
- --- 406,412 ----
- {
- case TYPE_CODE_PTR:
- type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
- ! fputc_filtered ('*', stream);
- break;
-
- case TYPE_CODE_FUNC:
- ***************
- *** 413,419 ****
- case TYPE_CODE_ARRAY:
- type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
- if (passed_a_ptr)
- ! fputc ('(', stream);
- break;
-
- default:
- --- 413,419 ----
- case TYPE_CODE_ARRAY:
- type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
- if (passed_a_ptr)
- ! fputc_filtered ('(', stream);
- break;
-
- default:
- ***************
- *** 444,455 ****
- {
- case TYPE_CODE_ARRAY:
- if (passed_a_ptr)
- ! fprintf (stream, ")");
- ! fprintf (stream, "[");
- if (TYPE_LENGTH (type) >= 0)
- ! fprintf (stream, "%d",
- TYPE_LENGTH (type) / TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
- ! fprintf (stream, "]");
- type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0);
- break;
-
- --- 444,455 ----
- {
- case TYPE_CODE_ARRAY:
- if (passed_a_ptr)
- ! fprintf_filtered (stream, ")");
- ! fprintf_filtered (stream, "[");
- if (TYPE_LENGTH (type) >= 0)
- ! fprintf_filtered (stream, "%d",
- TYPE_LENGTH (type) / TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
- ! fprintf_filtered (stream, "]");
- type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0);
- break;
-
- ***************
- *** 461,468 ****
- type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
- passed_a_ptr);
- if (passed_a_ptr)
- ! fprintf (stream, ")");
- ! fprintf (stream, "()");
- break;
-
- default:
- --- 461,468 ----
- type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
- passed_a_ptr);
- if (passed_a_ptr)
- ! fprintf_filtered (stream, ")");
- ! fprintf_filtered (stream, "()");
- break;
-
- default:
- ***************
- *** 499,511 ****
-
- if (type == 0)
- {
- ! fprintf (stream, "type unknown");
- return;
- }
-
- if (TYPE_NAME (type) && show <= 0)
- {
- ! fprintf (stream, TYPE_NAME (type));
- return;
- }
-
- --- 499,511 ----
-
- if (type == 0)
- {
- ! fprintf_filtered (stream, "type unknown");
- return;
- }
-
- if (TYPE_NAME (type) && show <= 0)
- {
- ! fprintf_filtered (stream, TYPE_NAME (type));
- return;
- }
-
- ***************
- *** 518,544 ****
- break;
-
- case TYPE_CODE_STRUCT:
- ! fprintf (stream, "struct ");
- goto struct_union;
-
- case TYPE_CODE_UNION:
- ! fprintf (stream, "union ");
- struct_union:
- if (TYPE_NAME (type) && (name = TYPE_NAME (type)))
- {
- while (*name != ' ') name++;
- ! fprintf (stream, "%s ", name + 1);
- }
- if (show < 0)
- ! fprintf (stream, "{...}");
- else
- {
- ! fprintf (stream, "{");
- len = TYPE_NFIELDS (type);
- if(len)
- ! fprintf (stream, "\n");
- else
- ! fprintf(stream, "<no data fields>\n");
- for (i = 0; i < len; i++)
- {
- QUIT;
- --- 518,544 ----
- break;
-
- case TYPE_CODE_STRUCT:
- ! fprintf_filtered (stream, "struct ");
- goto struct_union;
-
- case TYPE_CODE_UNION:
- ! fprintf_filtered (stream, "union ");
- struct_union:
- if (TYPE_NAME (type) && (name = TYPE_NAME (type)))
- {
- while (*name != ' ') name++;
- ! fprintf_filtered (stream, "%s ", name + 1);
- }
- if (show < 0)
- ! fprintf_filtered (stream, "{...}");
- else
- {
- ! fprintf_filtered (stream, "{");
- len = TYPE_NFIELDS (type);
- if(len)
- ! fprintf_filtered (stream, "\n");
- else
- ! fprintf_filtered(stream, "<no data fields>\n");
- for (i = 0; i < len; i++)
- {
- QUIT;
- ***************
- *** 558,564 ****
- : 0));
- if (gap != 0)
- {
- ! fprintf (stream, "int : %d;\n", gap);
- print_spaces (level + 4, stream);
- }
- }
- --- 558,564 ----
- : 0));
- if (gap != 0)
- {
- ! fprintf_filtered (stream, "int : %d;\n", gap);
- print_spaces (level + 4, stream);
- }
- }
- ***************
- *** 572,614 ****
- /* Print the field width. */
-
- if (TYPE_FIELD_PACKED (type, i))
- ! fprintf (stream, " : %d", TYPE_FIELD_BITSIZE (type, i));
-
- ! fprintf (stream, ";\n");
- }
- print_spaces (level, stream);
- ! fputc ('}', stream);
- }
- break;
-
- case TYPE_CODE_ENUM:
- ! fprintf (stream, "enum ");
- if (TYPE_NAME (type))
- {
- name = TYPE_NAME (type);
- while (*name != ' ') name++;
- ! fprintf (stream, "%s ", name + 1);
- }
- if (show < 0)
- ! fprintf (stream, "{...}");
- else
- {
- ! fprintf (stream, "{");
- len = TYPE_NFIELDS (type);
- lastval = 0;
- for (i = 0; i < len; i++)
- {
- QUIT;
- ! if (i) fprintf (stream, ", ");
- ! fprintf (stream, "%s", TYPE_FIELD_NAME (type, i));
- if (lastval != TYPE_FIELD_VALUE (type, i))
- {
- ! fprintf (stream, " : %d", TYPE_FIELD_VALUE (type, i));
- lastval = TYPE_FIELD_VALUE (type, i);
- }
- lastval++;
- }
- ! fprintf (stream, "}");
- }
- break;
-
- --- 572,614 ----
- /* Print the field width. */
-
- if (TYPE_FIELD_PACKED (type, i))
- ! fprintf_filtered (stream, " : %d", TYPE_FIELD_BITSIZE (type, i));
-
- ! fprintf_filtered (stream, ";\n");
- }
- print_spaces (level, stream);
- ! fputc_filtered ('}', stream);
- }
- break;
-
- case TYPE_CODE_ENUM:
- ! fprintf_filtered (stream, "enum ");
- if (TYPE_NAME (type))
- {
- name = TYPE_NAME (type);
- while (*name != ' ') name++;
- ! fprintf_filtered (stream, "%s ", name + 1);
- }
- if (show < 0)
- ! fprintf_filtered (stream, "{...}");
- else
- {
- ! fprintf_filtered (stream, "{");
- len = TYPE_NFIELDS (type);
- lastval = 0;
- for (i = 0; i < len; i++)
- {
- QUIT;
- ! if (i) fprintf_filtered (stream, ", ");
- ! fprintf_filtered (stream, "%s", TYPE_FIELD_NAME (type, i));
- if (lastval != TYPE_FIELD_VALUE (type, i))
- {
- ! fprintf_filtered (stream, " : %d", TYPE_FIELD_VALUE (type, i));
- lastval = TYPE_FIELD_VALUE (type, i);
- }
- lastval++;
- }
- ! fprintf_filtered (stream, "}");
- }
- break;
-
- ***************
- *** 617,636 ****
- name = unsigned_type_table[TYPE_LENGTH (type)];
- else
- name = signed_type_table[TYPE_LENGTH (type)];
- ! fprintf (stream, "%s", name);
- break;
-
- case TYPE_CODE_FLT:
- name = float_type_table[TYPE_LENGTH (type)];
- ! fprintf (stream, "%s", name);
- break;
-
- case TYPE_CODE_VOID:
- ! fprintf (stream, "void");
- break;
-
- case 0:
- ! fprintf (stream, "struct unknown");
- break;
-
- default:
- --- 617,636 ----
- name = unsigned_type_table[TYPE_LENGTH (type)];
- else
- name = signed_type_table[TYPE_LENGTH (type)];
- ! fprintf_filtered (stream, "%s", name);
- break;
-
- case TYPE_CODE_FLT:
- name = float_type_table[TYPE_LENGTH (type)];
- ! fprintf_filtered (stream, "%s", name);
- break;
-
- case TYPE_CODE_VOID:
- ! fprintf_filtered (stream, "void");
- break;
-
- case 0:
- ! fprintf_filtered (stream, "struct unknown");
- break;
-
- default:
- *** 1.6 1991/10/05 20:59:54
- --- values.c 1992/01/14 20:06:10
- ***************
- *** 283,291 ****
- for (i = num; i < num + 10 && i <= value_history_count; i++)
- {
- val = access_value_history (i);
- ! printf ("$%d = ", i);
- value_print (val, stdout, 0);
- ! printf ("\n");
- }
- }
-
- --- 283,291 ----
- for (i = num; i < num + 10 && i <= value_history_count; i++)
- {
- val = access_value_history (i);
- ! printf_filtered ("$%d = ", i);
- value_print (val, stdout, 0);
- ! printf_filtered ("\n");
- }
- }
-
- ***************
- *** 387,403 ****
- register struct internalvar *var;
-
- if (internalvars)
- ! printf ("Debugger convenience variables:\n\n");
- else
- ! printf ("No debugger convenience variables now defined.\n\
- Convenience variables have names starting with \"$\";\n\
- use \"set\" as in \"set $foo = 5\" to define them.\n");
-
- for (var = internalvars; var; var = var->next)
- {
- ! printf ("$%s: ", var->name);
- value_print (var->value, stdout, 0);
- ! printf ("\n");
- }
- }
-
- --- 387,403 ----
- register struct internalvar *var;
-
- if (internalvars)
- ! printf_filtered ("Debugger convenience variables:\n\n");
- else
- ! printf_filtered ("No debugger convenience variables now defined.\n\
- Convenience variables have names starting with \"$\";\n\
- use \"set\" as in \"set $foo = 5\" to define them.\n");
-
- for (var = internalvars; var; var = var->next)
- {
- ! printf_filtered ("$%s: ", var->name);
- value_print (var->value, stdout, 0);
- ! printf_filtered ("\n");
- }
- }
-
-