home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update14.zoo / gdb / diffs next >
Encoding:
Text File  |  1992-01-15  |  206.3 KB  |  7,920 lines

  1. *** 1.6    1991/10/05 20:59:54
  2. --- Changelo    1992/01/14 20:05:54
  3. ***************
  4. *** 98,100 ****
  5. --- 98,158 ----
  6.   
  7.   Makefile:: ++jrb
  8.       add target for init.o. delete firstfile.* lastfile.* initialize.*
  9. + m-atari.h:: ++jrb
  10. +     had forgotten to revert back #def of FRAME_CHAIN, as a result some
  11. +         frames were setup incorrectly.
  12. + atarist.c:: andreas
  13. +  (st_child_read_word, st_child_write_word): check for vaild address
  14. +  within child memory.
  15. + source.c:: andreas
  16. +  (print_source_lines): allow last line of file to be printed.
  17. + gnu-out.h:: ++jrb
  18. +     sync it up with util/gnu-out.h
  19. + dbxread.c:: ++jrb
  20. +     get rid of the silly xxmalloc(), #define xxmalloc to xmalloc
  21. + infcmd.c:: ++jrb
  22. +     - dont allow set-args after inferior has started. insist that
  23. + args for inferior be specified either before issueing the initial
  24. + run command with a set-arg or in the in the initial run command.
  25. +     - dont allow re-starting inferior.
  26. + atarist.c:: ++jrb
  27. +     dont allow inferior to be re-run ever. returns special pid == -9999
  28. + after issueing error. does'nt exit right away as the user may want to
  29. + examine stuff or issue other non-run commands before he actually quits
  30. + GDB.
  31. + atarist.c, main.c:: ++jrb
  32. +     more -D's give more debug info. also include version in debug.gdb
  33. + dbxread.c:: ++jrb
  34. +     - fix up bug in typevector allocation
  35. +     - dont free pending blocks (per gdb 4.?)
  36. + main.c, util.c:: ++jrb
  37. +     save all vectors at startup, and restore them all back to the state
  38. +     at entry before exit. exit, now happend via routine really_exit().
  39. + dbxread.c:: ++jrb
  40. +     - get rid of the silly symseg chain stuff that was cluttering up
  41. +     the code.
  42. +     - when reading pointer and func types dont do the smash_to_type
  43. +     this fixes the typedefs type * and just ordinary type *'s getting
  44. +     confused.
  45. + symtab.c:: ++jrb
  46. +     - delete smash_to_* fns.
  47. + all over:: ++jrb
  48. +     if '-L' option is specified, log all debugger output (append) to file
  49. +     "gdb.log". Use this with EXTREME CAUTION: it works with tos 1.4,
  50. +     but does'nt work with newer TOSs, and can potentially trash other
  51. +     files on the disk. YOU HAVE BEEN WARNED!
  52. + ------------------------------- Patchlevel  15 -----------------------------
  53. *** 1.6    1991/09/24 16:19:45
  54. --- PatchLev.h    1992/01/14 20:05:54
  55. ***************
  56. *** 1,4 ****
  57. ! #define PatchLevel "14"
  58.   
  59.   /*
  60.    *    the Patch Level above is to identify the version
  61. --- 1,4 ----
  62. ! #define PatchLevel "15"
  63.   
  64.   /*
  65.    *    the Patch Level above is to identify the version
  66. *** 1.5    1991/09/24 16:19:45
  67. --- README    1992/01/14 20:05:55
  68. ***************
  69. *** 1,3 ****
  70. --- 1,73 ----
  71. + GDB @ Patchlevel 15   
  72. + ================NOTE      NOTE      NOTE    NOTE============================
  73. +          TOS 1.4 or better required unless you
  74. +              recompile the source with -DOLDTOS
  75. + ================NOTE      NOTE      NOTE    NOTE============================
  76. +     *************************************************
  77. +        Please get rid of gdb Patchlevel 14 or older
  78. +     *************************************************
  79. +     yet another significant update to gdb-atariST. please take
  80. +     a few moments to read over gdb.texinfo too (ie: dont expect
  81. +     to find all the answers in this README file :-).
  82. +     - gdb now has a new option to log a gdb session. gdb -L will
  83. +     log the session in the file gdb.log (append if the file already
  84. +     exists). Use this option WITH EXTREME CAUTION. This only works
  85. +     with TOS 1.4. I have a later version of TOS and it does not
  86. +     work correctly with it, and it goes and adds stuff to random
  87. +     files. I dont know if -L will work with the TOS in STe's or TT's.
  88. +     you have been adequately warned.!!
  89. +     - gdb will NOT try to intut when it is trying to debug a -mshort
  90. +     compiled program. The user must specify the "-mshort" option to
  91. +     gdb.ttp if you are going to try and debug a -mshort compiled
  92. +     application. the heauristic we were using earlier to intut -mshort
  93. +     did not work very well, and caused many problems. So the sequence
  94. +     for a typical -mshort compile/debug becomes:
  95. +         gcc -mshort -c -g foo.c bar.c
  96. +         gcc -mshort -o foo foo.o bar.o
  97. +             sym-ld -o foo.sym e:\lib\crt0.o foo.o bar.o -lgnu16
  98. +         gdb -mshort -e foo -s foo.sym
  99. +     - gdb wont get confused when -mshort is used, and the arguements
  100. +     to a function are displayed (on a breakpoint, backtrace etc).
  101. +     the arguements were always being passed correctly, but were not
  102. +     being displayed correcty.
  103. +     - gdb wont get confused by certain typedefs.
  104. +     - Frames fixed. up/down etc should work.
  105. +     - will not allow you to re-run inferior (even if the
  106. +     inferior has exited). this is not possible to do under TOS.
  107. +     - NEEDS tos 1.4 or better and uses Pexec mode 6 to launch
  108. +           inferior.
  109. +     - many people are confused about this: to pass command line
  110. +     arguements to the program to be debugged  you have to either
  111. +         set-args args ...
  112. +        BEFORE you issue the initial run command
  113. +     or you can specify the args in the initial run command
  114. +         run args ...
  115. +     the run args... form is more convenient.
  116. +     - got rid of the initialization hacks, now all the init
  117. +     functions are called from init.c (which in turn in called
  118. +     from main). now we can compile gdb with -O etc.
  119. +     - other code reorgs and hacks.
  120. +     - much thanks to Michal Jaegermann who provided lots of
  121. +     suggestions examples  and suffered thru many intermmediate
  122. +     versions.
  123.   GDB @ Patchlevel 14
  124.   
  125.       *************************************************
  126. ***************
  127. *** 181,203 ****
  128.   HOW TO USE IT:
  129.       to debug a program called foo, consisting of foo.c and bar.c do
  130.   
  131. !     gcc [-O] -g -c foo.c bar.c    (-O optional)
  132. !     gcc -o foo foo.o bar.o        (get normal TOS executable)
  133. !     sym-ld -o foo.sym e:\lib\crt0.o foo.o bar.o -lgnu    (make symbol file)
  134. !                 (use the appro. full path to your crt0.o
  135. !                  note: sym-ld -r is not required. -l works).
  136. !                 
  137. !     gdb -e foo -s foo.sym    (file up gdb with exec-file == foo and
  138. !                           symbol-file == foo.sym)
  139. !     (gdb) [set-args args1 arg2 ....]
  140. !     (gdb) r            (before doing anything, you have to run,
  141. !                 and it will break immediately with a 
  142. !                 non-sensical message)
  143. !     (gdb) b main        (now start issuing normal gdb commands)
  144. !       ...
  145. !     (gdb) c            finally a continue to actually start the prog
  146. !      .... and so on
  147. !     (gdb) q
  148.   
  149.   
  150.    - use the online help
  151. --- 251,279 ----
  152.   HOW TO USE IT:
  153.       to debug a program called foo, consisting of foo.c and bar.c do
  154.   
  155. !         gcc -g -c foo.c bar.c      (-O optional)
  156. !         gcc -o foo foo.o bar.o          (get normal TOS executable)
  157. !         sym-ld -o foo.sym e:\lib\crt0.o foo.o bar.o -lgnu    (make symbol file)
  158. !                                 (use the appro. full path to your crt0.o
  159. !                                  note: sym-ld -r is not required and -l works).
  160. !         gdb -e foo -s foo.sym   (fire up gdb with exec-file == foo and
  161. !                                                   symbol-file == foo.sym)
  162. !         (gdb) r [any-args to foo] (before doing anything, you have to run,
  163. !                                 and it will break immediately with a
  164. !                                 non-sensical message)
  165. !     NOTE VERY CAREFULLY: no other gdb commands before you issue
  166. !                  the run command. this is the most common
  167. !                  mistake. if you want to pass args to foo
  168. !                  specify them with the run command. The
  169. !                  arguements may not exceed 126 characters
  170. !                  and they may not contain re-directions.
  171. !         (gdb) b main            (now start issuing normal gdb commands)
  172. !           ...
  173. !         (gdb) c                 finally a continue to actually start the prog
  174. !          .... and so on
  175. !         (gdb) q
  176.   
  177.   
  178.    - use the online help
  179. *** 1.14    1991/10/05 20:09:09
  180. --- atarist.c    1992/01/14 20:05:55
  181. ***************
  182. *** 85,99 ****
  183.       int i, envlen;
  184.       char cmdname[80], argstring[258];
  185.       char * p, * q;
  186.       
  187.       /* zzz */
  188.       /*
  189. !       fprintf(stderr, "Execle_kludge:\n");
  190. !       fprintf(stderr, "\t'%s'\n", args);
  191.         
  192. !       fprintf(stderr, "\tenv:\n");
  193.         for (i = 0 ; env[i] ; i++)
  194. !       fprintf(stderr, "\t\t'%s'\n", env[i]);
  195.         */
  196.       
  197.       /* construct the environment string */
  198. --- 85,105 ----
  199.       int i, envlen;
  200.       char cmdname[80], argstring[258];
  201.       char * p, * q;
  202. +     static char run_already = 0;
  203. +     if(run_already)
  204. +     return -9999;
  205. +     else
  206. +     run_already = 1;
  207.       
  208.       /* zzz */
  209.       /*
  210. !       fprintf_filtered(stderr, "Execle_kludge:\n");
  211. !       fprintf_filtered(stderr, "\t'%s'\n", args);
  212.         
  213. !       fprintf_filtered(stderr, "\tenv:\n");
  214.         for (i = 0 ; env[i] ; i++)
  215. !       fprintf_filtered(stderr, "\t\t'%s'\n", env[i]);
  216.         */
  217.       
  218.       /* construct the environment string */
  219. ***************
  220. *** 142,148 ****
  221.           /* something's really fucked here.  We're not supposed to
  222.              be able to come thru here except when we're starting
  223.              things */
  224. !         fprintf(stderr, "Internal error!!! child already running?\n");
  225.           return(0);
  226.       }
  227.       else
  228. --- 148,154 ----
  229.           /* something's really fucked here.  We're not supposed to
  230.              be able to come thru here except when we're starting
  231.              things */
  232. !         fprintf_filtered(stderr, "Internal error!!! child already running?\n");
  233.           return(0);
  234.       }
  235.       else
  236. ***************
  237. *** 156,162 ****
  238.              Pexec(PE_LOADGO, cmdname, argstring, env);
  239.              but we can't.  instead... */
  240.           
  241. !         /*        fprintf(stderr, "Pexec('%s', '%s')\n",
  242.               &cmdname[0], &argstring[1]);
  243.               */
  244.           /*        kludge_cmd = &cmdname[0]; */
  245. --- 162,168 ----
  246.              Pexec(PE_LOADGO, cmdname, argstring, env);
  247.              but we can't.  instead... */
  248.           
  249. !         /*        fprintf_filtered(stderr, "Pexec('%s', '%s')\n",
  250.               &cmdname[0], &argstring[1]);
  251.               */
  252.           /*        kludge_cmd = &cmdname[0]; */
  253. ***************
  254. *** 215,221 ****
  255.              when the child program exits.  If anybody ever figures this out,
  256.              please let me know!
  257.              */
  258. !         fprintf(stderr, "Program exitted with status 0x%lx\n", 
  259.               kludge_pexec_result);
  260.           
  261.           
  262. --- 221,227 ----
  263.              when the child program exits.  If anybody ever figures this out,
  264.              please let me know!
  265.              */
  266. !         fprintf_filtered(stderr, "Program exitted with status 0x%lx\n", 
  267.               kludge_pexec_result);
  268.           
  269.           
  270. ***************
  271. *** 241,247 ****
  272.           {
  273.           long * child_sp = (long *)child_context.registers[15];
  274.           child_tpa = (struct tpa * )child_sp[1];
  275. !         /*      fprintf(stderr, "child tpa at %X\n", child_tpa); */
  276.           relocate_apropriate_symbols(child_tpa->text_base);
  277.           exception_number = 0;
  278.           }
  279. --- 247,253 ----
  280.           {
  281.           long * child_sp = (long *)child_context.registers[15];
  282.           child_tpa = (struct tpa * )child_sp[1];
  283. !         /*      fprintf_filtered(stderr, "child tpa at %X\n", child_tpa); */
  284.           relocate_apropriate_symbols(child_tpa->text_base);
  285.           exception_number = 0;
  286.           }
  287. ***************
  288. *** 261,270 ****
  289.           Pterm0();
  290.       /* doesn't return... */
  291.       else
  292. !         fprintf(stderr, "Internal error: attempt to kill when child not running\n");
  293.       }
  294.       else
  295. !     fprintf(stderr, "You can't kill pid %d, bozo!\n", fake_pid);
  296.       
  297.       return(-1);
  298.   }
  299. --- 267,276 ----
  300.           Pterm0();
  301.       /* doesn't return... */
  302.       else
  303. !         fprintf_filtered(stderr, "Internal error: attempt to kill when child not running\n");
  304.       }
  305.       else
  306. !     fprintf_filtered(stderr, "You can't kill pid %d, bozo!\n", fake_pid);
  307.       
  308.       return(-1);
  309.   }
  310. ***************
  311. *** 274,280 ****
  312.   int st_wait_kludge(w)
  313.   WAITTYPE * w;
  314.   {
  315. !     /*  fprintf(stderr, "st-wait-kludge: running %d exc %d\n",
  316.         child_is_running, exception_number);    */
  317.       if (child_is_running)
  318.       {
  319. --- 280,286 ----
  320.   int st_wait_kludge(w)
  321.   WAITTYPE * w;
  322.   {
  323. !     /*  fprintf_filtered(stderr, "st-wait-kludge: running %d exc %d\n",
  324.         child_is_running, exception_number);    */
  325.       if (child_is_running)
  326.       {
  327. ***************
  328. *** 288,303 ****
  329.       }
  330.   }
  331.   
  332. - #ifdef JRDLIB
  333. - /* for printcmd.c */
  334. - vprintf(str, argv)
  335. - char * str;
  336. - char ** argv;
  337. - {
  338. -     printf(str, argv[0], argv[1], argv[2], argv[3],
  339. -        argv[4], argv[5], argv[6], argv[7]);
  340. - }
  341. - #endif
  342.   
  343.   static char *regcomp_error = 0;
  344.   static regexp *compiled_regex = 0;
  345. --- 294,299 ----
  346. ***************
  347. *** 336,344 ****
  348.   long entry_point;    /* really a function... */
  349.   {
  350.       long old_vector;
  351. !     /*  fprintf(stderr, "set exception %d %X", n, entry_point); */
  352.       old_vector = (long)Setexc(n, entry_point);    /* better way? */
  353. !     /*  fprintf(stderr, " -> %X\n", old_vector); */
  354.       return(old_vector);
  355.   }
  356.   
  357. --- 332,340 ----
  358.   long entry_point;    /* really a function... */
  359.   {
  360.       long old_vector;
  361. !     /*  fprintf_filtered(stderr, "set exception %d %X", n, entry_point); */
  362.       old_vector = (long)Setexc(n, entry_point);    /* better way? */
  363. !     /*  fprintf_filtered(stderr, " -> %X\n", old_vector); */
  364.       return(old_vector);
  365.   }
  366.   
  367. ***************
  368. *** 379,395 ****
  369.   /* force the child process to exit */
  370.   st_child_exit()
  371.   {
  372. !     /*  fprintf(stderr, "st_child_exit\n"); */
  373.       if (child_is_running)
  374.         Pterm0();
  375.       else
  376. !     fprintf(stderr, "Internal error: child not running?\n");
  377.   }
  378.   
  379.   /* continue after bpt */
  380.   st_child_continue()
  381.   {
  382. !     /*  fprintf(stderr, "st_child_continue\n"); */
  383.       if (child_is_running)
  384.       {
  385.       set_all_exception_vectors();        /* set our traps */
  386. --- 375,391 ----
  387.   /* force the child process to exit */
  388.   st_child_exit()
  389.   {
  390. !     /*  fprintf_filtered(stderr, "st_child_exit\n"); */
  391.       if (child_is_running)
  392.         Pterm0();
  393.       else
  394. !     fprintf_filtered(stderr, "Internal error: child not running?\n");
  395.   }
  396.   
  397.   /* continue after bpt */
  398.   st_child_continue()
  399.   {
  400. !     /*  fprintf_filtered(stderr, "st_child_continue\n"); */
  401.       if (child_is_running)
  402.       {
  403.       set_all_exception_vectors();        /* set our traps */
  404. ***************
  405. *** 399,411 ****
  406.       restore_all_exception_vectors();    /* and put our traps back */
  407.       }
  408.       else
  409. !     fprintf(stderr, "Internal error: child not running?\n");
  410.   }
  411.   
  412.   /* single step */
  413.   st_child_single_step()
  414.   {
  415. !     /*  fprintf(stderr, "st_child_single_step\n"); */
  416.       if (child_is_running)
  417.       {
  418.       set_all_exception_vectors();        /* set our traps */
  419. --- 395,407 ----
  420.       restore_all_exception_vectors();    /* and put our traps back */
  421.       }
  422.       else
  423. !     fprintf_filtered(stderr, "Internal error: child not running?\n");
  424.   }
  425.   
  426.   /* single step */
  427.   st_child_single_step()
  428.   {
  429. !     /*  fprintf_filtered(stderr, "st_child_single_step\n"); */
  430.       if (child_is_running)
  431.       {
  432.       set_all_exception_vectors();        /* set our traps */
  433. ***************
  434. *** 414,420 ****
  435.       restore_all_exception_vectors();    /* and put our traps back */
  436.       }
  437.       else
  438. !     fprintf(stderr, "Internal error: child not running?\n");
  439.   }
  440.   
  441.   /* read a register from saved copies */
  442. --- 410,416 ----
  443.       restore_all_exception_vectors();    /* and put our traps back */
  444.       }
  445.       else
  446. !     fprintf_filtered(stderr, "Internal error: child not running?\n");
  447.   }
  448.   
  449.   /* read a register from saved copies */
  450. ***************
  451. *** 423,429 ****
  452.   {
  453.       long result;
  454.       
  455. !     /*  fprintf(stderr, "st_child_read_register %X ", regaddr);    */
  456.       if (child_is_running)
  457.       {
  458.       if ((regaddr >> 2) == PS_REGNUM)
  459. --- 419,425 ----
  460.   {
  461.       long result;
  462.       
  463. !     /*  fprintf_filtered(stderr, "st_child_read_register %X ", regaddr);    */
  464.       if (child_is_running)
  465.       {
  466.       if ((regaddr >> 2) == PS_REGNUM)
  467. ***************
  468. *** 434,449 ****
  469.           /*
  470.             if ((exception_number == 2) || (exception_number == 3))
  471.             {
  472. !           fprintf(stderr, "Adjusting pc for trap %d %08X->%08X\n", 
  473.             exception_number, result, result+8);
  474.             result += 8;
  475.             }
  476.             */
  477.       }
  478. !     /*    fprintf(stderr, "-> %X\n", result);    */
  479.       }
  480.       else
  481. !     fprintf(stderr, "Child is not running\n");
  482.       return(result);
  483.   }
  484.   
  485. --- 430,445 ----
  486.           /*
  487.             if ((exception_number == 2) || (exception_number == 3))
  488.             {
  489. !           fprintf_filtered(stderr, "Adjusting pc for trap %d %08X->%08X\n", 
  490.             exception_number, result, result+8);
  491.             result += 8;
  492.             }
  493.             */
  494.       }
  495. !     /*    fprintf_filtered(stderr, "-> %X\n", result);    */
  496.       }
  497.       else
  498. !     fprintf_filtered(stderr, "Child is not running\n");
  499.       return(result);
  500.   }
  501.   
  502. ***************
  503. *** 451,457 ****
  504.   st_child_write_register(regaddr, value)
  505.   int regaddr, value;
  506.   {
  507. !     /*  fprintf(stderr, "st_child_write_register %X <- %X\n", regaddr, value); */
  508.       if (child_is_running)
  509.       {
  510.       if ((regaddr >> 2) == PS_REGNUM)
  511. --- 447,453 ----
  512.   st_child_write_register(regaddr, value)
  513.   int regaddr, value;
  514.   {
  515. !     /*  fprintf_filtered(stderr, "st_child_write_register %X <- %X\n", regaddr, value); */
  516.       if (child_is_running)
  517.       {
  518.       if ((regaddr >> 2) == PS_REGNUM)
  519. ***************
  520. *** 460,466 ****
  521.           *(long * )(regaddr + (char * )(&child_context)) = value;
  522.       }
  523.       else
  524. !     fprintf(stderr, "Child is not running\n");
  525.   }
  526.   
  527.   /* read a 32-bit word from child memory */
  528. --- 456,462 ----
  529.           *(long * )(regaddr + (char * )(&child_context)) = value;
  530.       }
  531.       else
  532. !     fprintf_filtered(stderr, "Child is not running\n");
  533.   }
  534.   
  535.   /* read a 32-bit word from child memory */
  536. ***************
  537. *** 469,477 ****
  538.   {
  539.       long result;
  540.       
  541. !     /*  fprintf(stderr, "st_child_read_word %X", addr); */
  542. !     result = *addr;
  543. !     /*  fprintf(stderr, "->%X\n", result);    */
  544.       return(result);
  545.   }
  546.   
  547. --- 465,477 ----
  548.   {
  549.       long result;
  550.       
  551. !     /*  fprintf_filtered(stderr, "st_child_read_word %X", addr); */
  552. !     /* check if addr is within child memory */
  553. !     if (addr >= child_tpa->text_base && addr < child_tpa->memtop)
  554. !       result = *addr;
  555. !     else
  556. !       result = 0;
  557. !     /*  fprintf_filtered(stderr, "->%X\n", result);    */
  558.       return(result);
  559.   }
  560.   
  561. ***************
  562. *** 480,493 ****
  563.   long * addr;
  564.   long value;
  565.   {
  566. !     /*  fprintf(stderr, "st_child_write_word %X <- %X\n", addr, value); */
  567. !     *addr = value;
  568.   }
  569.   
  570.   #define DEBUG 1
  571.   
  572.   #ifdef DEBUG
  573. - FILE *debugfp;
  574.   static char *d_namespace[] =
  575.   {  "UNDEF", "VAR", "STRUCT", "LABEL"    };
  576.   
  577. --- 480,494 ----
  578.   long * addr;
  579.   long value;
  580.   {
  581. !     /*  fprintf_filtered(stderr, "st_child_write_word %X <- %X\n", addr, value); */
  582. !     /* check if addr is within child memory */
  583. !     if (addr >= child_tpa->text_base && addr < child_tpa->memtop)
  584. !       *addr = value;
  585.   }
  586.   
  587.   #define DEBUG 1
  588.   
  589.   #ifdef DEBUG
  590.   static char *d_namespace[] =
  591.   {  "UNDEF", "VAR", "STRUCT", "LABEL"    };
  592.   
  593. ***************
  594. *** 518,530 ****
  595.       struct block * block;
  596.       struct linetable * l;
  597.       int nsyms, symnum, i;
  598. !     
  599.   #ifdef DEBUG
  600.       if(atari_debug)
  601.       {
  602. !       debugfp = fopen("debug.gdb", "w");
  603. !       fprintf(stderr,"Reloc constant %ld %X\n", base_address, base_address);
  604. !       fprintf(debugfp,"Reloc constant %ld %X\n", base_address, base_address);
  605.       }
  606.   #endif
  607.       for (s = symtab_list ; s ; s = s->next)
  608. --- 519,530 ----
  609.       struct block * block;
  610.       struct linetable * l;
  611.       int nsyms, symnum, i;
  612. !     extern char *version;
  613.   #ifdef DEBUG
  614.       if(atari_debug)
  615.       {
  616. !       fprintf_filtered(stderr,"Reloc constant %ld %X\n", base_address, base_address);
  617.       }
  618.   #endif
  619.       for (s = symtab_list ; s ; s = s->next)
  620. ***************
  621. *** 533,542 ****
  622.   #ifdef DEBUG
  623.       if(atari_debug)
  624.       {
  625. !       fprintf(stderr,
  626. !           "reloc syms table %X file '%s' linetable %08X(%ld) %d items\n",
  627. !         s, s->filename, l,l, l->nitems);
  628. !       fprintf(debugfp,
  629.             "reloc syms table %X file '%s' linetable %08X(%ld) %d items\n",
  630.           s, s->filename, l,l, l->nitems);
  631.           }
  632. --- 533,539 ----
  633.   #ifdef DEBUG
  634.       if(atari_debug)
  635.       {
  636. !       fprintf_filtered(stderr,
  637.             "reloc syms table %X file '%s' linetable %08X(%ld) %d items\n",
  638.           s, s->filename, l,l, l->nitems);
  639.           }
  640. ***************
  641. *** 548,555 ****
  642.   #ifdef DEBUG
  643.           if(atari_debug && (n <= 0))
  644.           {
  645. !         fprintf(stderr,"*********linetable with %d items\n", n);
  646. !         fprintf(debugfp,"*********linetable with %d items\n", n);
  647.           }
  648.   #endif        
  649.           for (i = 0 ; i < n ; i++)
  650. --- 545,551 ----
  651.   #ifdef DEBUG
  652.           if(atari_debug && (n <= 0))
  653.           {
  654. !         fprintf_filtered(stderr,"*********linetable with %d items\n", n);
  655.           }
  656.   #endif        
  657.           for (i = 0 ; i < n ; i++)
  658. ***************
  659. *** 558,567 ****
  660.   #ifdef DEBUG
  661.           if(atari_debug)
  662.           {
  663. !           fprintf(stderr, "    %d: line %d %X(%ld)->%X(%ld)\n",
  664. !             i, item->line, item->pc, item->pc,
  665. !             item->pc+base_address, item->pc+base_address);
  666. !           fprintf(debugfp, "    %d: line %d %X(%ld)->%X(%ld)\n",
  667.               i, item->line, item->pc, item->pc,
  668.               item->pc+base_address, item->pc+base_address);
  669.               }
  670. --- 554,560 ----
  671.   #ifdef DEBUG
  672.           if(atari_debug)
  673.           {
  674. !           fprintf_filtered(stderr, "    %d: line %d %X(%ld)->%X(%ld)\n",
  675.               i, item->line, item->pc, item->pc,
  676.               item->pc+base_address, item->pc+base_address);
  677.               }
  678. ***************
  679. *** 576,583 ****
  680.   #ifdef DEBUG
  681.           if(atari_debug)
  682.           {
  683. !           fprintf(stderr,"Skipping block vector %X(%d) already relocated\n", bv,bv); 
  684. !           fprintf(debugfp,"Skipping block vector %X(%d) already relocated\n", bv,bv);
  685.           }
  686.   #endif
  687.           continue;
  688. --- 569,575 ----
  689.   #ifdef DEBUG
  690.           if(atari_debug)
  691.           {
  692. !           fprintf_filtered(stderr,"Skipping block vector %X(%d) already relocated\n", bv,bv); 
  693.           }
  694.   #endif
  695.           continue;
  696. ***************
  697. *** 589,596 ****
  698.   #ifdef DEBUG
  699.           if(atari_debug)
  700.           {
  701. !           fprintf(stderr, " block %d: in %X(%d)\n", i, bv, bv);
  702. !           fprintf(debugfp, " block %d:in %X(%d)\n", i, bv, bv);
  703.           }
  704.   #endif
  705.           relocate_apropriate_block_symbols(block, base_address);
  706. --- 581,587 ----
  707.   #ifdef DEBUG
  708.           if(atari_debug)
  709.           {
  710. !           fprintf_filtered(stderr, " block %d: in %X(%d)\n", i, bv, bv);
  711.           }
  712.   #endif
  713.           relocate_apropriate_block_symbols(block, base_address);
  714. ***************
  715. *** 599,627 ****
  716.   #ifdef DEBUG
  717.       if(atari_debug)
  718.       {
  719. !       fprintf(stderr,"Relocatings %d misc functions\n", misc_function_count);
  720. !       fprintf(debugfp,"Relocatings %d misc functions\n", misc_function_count);
  721.       }
  722.   #endif
  723.       /* relocate the misc functions */
  724.       for (i = 0; i < misc_function_count; i++)
  725.       {
  726. ! #ifdef DEBUG1
  727. !     if(atari_debug)
  728.       {
  729. !       fprintf(stderr, "%s:%ld->%ld\n", misc_function_vector[i].name,
  730. ! misc_function_vector[i].address, misc_function_vector[i].address+base_address);
  731. !       fprintf(debugfp, "%s:%ld->%ld\n", misc_function_vector[i].name,
  732. ! misc_function_vector[i].address, misc_function_vector[i].address+base_address);
  733.           }
  734.   #endif    
  735.       misc_function_vector[i].address += base_address;
  736.       }
  737.       
  738. - #ifdef DEBUG
  739. -     if(atari_debug)
  740. -       fclose(debugfp);
  741. - #endif
  742.   }
  743.   
  744.   relocate_apropriate_block_symbols(block, base_address)
  745. --- 590,612 ----
  746.   #ifdef DEBUG
  747.       if(atari_debug)
  748.       {
  749. !       fprintf_filtered(stderr,"Relocatings %d misc functions\n", misc_function_count);
  750.       }
  751.   #endif
  752.       /* relocate the misc functions */
  753.       for (i = 0; i < misc_function_count; i++)
  754.       {
  755. ! #ifdef DEBUG
  756. !     if(atari_debug > 1)
  757.       {
  758. !       fprintf_filtered(stderr, "%s: %X(%ld)->%X(%ld)\n", misc_function_vector[i].name,
  759. !             misc_function_vector[i].address, misc_function_vector[i].address,
  760. !         misc_function_vector[i].address+base_address, misc_function_vector[i].address+base_address);
  761.           }
  762.   #endif    
  763.       misc_function_vector[i].address += base_address;
  764.       }
  765.       
  766.   }
  767.   
  768.   relocate_apropriate_block_symbols(block, base_address)
  769. ***************
  770. *** 639,646 ****
  771.   #ifdef DEBUG
  772.       if(atari_debug)
  773.       {
  774. !       fprintf(stderr, " %d syms block %X(%ld)\n", nsyms, block, block);
  775. !       fprintf(debugfp, " %d syms block %X(%ld)\n", nsyms, block, block);
  776.           }
  777.   #endif
  778.       for (symnum = 0 ; symnum < nsyms ; symnum++)
  779. --- 624,630 ----
  780.   #ifdef DEBUG
  781.       if(atari_debug)
  782.       {
  783. !       fprintf_filtered(stderr, " %d syms block %X(%ld)\n", nsyms, block, block);
  784.           }
  785.   #endif
  786.       for (symnum = 0 ; symnum < nsyms ; symnum++)
  787. ***************
  788. *** 649,657 ****
  789.   #ifdef DEBUG
  790.           if(atari_debug)
  791.           {
  792. !           fprintf(stderr, "  sym %d %X name '%s'",
  793. !               symnum, sym, SYMBOL_NAME(sym));
  794. !           fprintf(debugfp, "  sym %d %X name '%s'",
  795.                 symnum, sym, SYMBOL_NAME(sym));
  796.           }
  797.   #endif
  798. --- 633,639 ----
  799.   #ifdef DEBUG
  800.           if(atari_debug)
  801.           {
  802. !           fprintf_filtered(stderr, "  sym %d %X name '%s'",
  803.                 symnum, sym, SYMBOL_NAME(sym));
  804.           }
  805.   #endif
  806. ***************
  807. *** 661,674 ****
  808.   #ifdef DEBUG
  809.           if(atari_debug)
  810.           {
  811. !         fprintf(stderr, " is relocatable: (%s, %s) %X->%X  %ld->%ld\n",
  812.               d_namespace[sym->namespace], d_aclass[sym->class],
  813.               sym->value.value, sym->value.value + base_address,
  814.               sym->value.value, sym->value.value + base_address);
  815. -         fprintf(debugfp, " is relocatable: (%s, %s) %X->%X  %ld->%ld\n",
  816. -             d_namespace[sym->namespace], d_aclass[sym->class],
  817. -             sym->value.value, sym->value.value + base_address,
  818. -             sym->value.value, sym->value.value + base_address);
  819.               }
  820.   #endif
  821.           sym->value.value += base_address;
  822. --- 643,652 ----
  823.   #ifdef DEBUG
  824.           if(atari_debug)
  825.           {
  826. !         fprintf_filtered(stderr, " is relocatable: (%s, %s) %X->%X  %ld->%ld\n",
  827.               d_namespace[sym->namespace], d_aclass[sym->class],
  828.               sym->value.value, sym->value.value + base_address,
  829.               sym->value.value, sym->value.value + base_address);
  830.               }
  831.   #endif
  832.           sym->value.value += base_address;
  833. ***************
  834. *** 678,687 ****
  835.   #ifdef DEBUG
  836.           if(atari_debug)
  837.           {
  838. !         fprintf(stderr, " is a LOC_block(%s %s)... %X\n",
  839.           d_namespace[sym->namespace], d_aclass[sym->class], sym->value.block);
  840. -         fprintf(debugfp, " is a LOC_block(%s %s)... %X\n",
  841. -         d_namespace[sym->namespace], d_aclass[sym->class], sym->value.block);
  842.               }
  843.   #endif
  844.   #if 0
  845. --- 656,663 ----
  846.   #ifdef DEBUG
  847.           if(atari_debug)
  848.           {
  849. !         fprintf_filtered(stderr, " is a LOC_block(%s %s)... %X\n",
  850.           d_namespace[sym->namespace], d_aclass[sym->class], sym->value.block);
  851.               }
  852.   #endif
  853.   #if 0
  854. ***************
  855. *** 692,700 ****
  856.   #ifdef DEBUG0
  857.               if(atari_debug)
  858.               {
  859. !             fprintf(stderr, "  start %X->%X\n", 
  860. !                 BLOCK_START(bl), BLOCK_START(bl) + base_address);
  861. !             fprintf(debugfp, "  start %X->%X\n", 
  862.                   BLOCK_START(bl), BLOCK_START(bl) + base_address);
  863.               }
  864.   #endif
  865. --- 668,674 ----
  866.   #ifdef DEBUG0
  867.               if(atari_debug)
  868.               {
  869. !             fprintf_filtered(stderr, "  start %X->%X\n", 
  870.                   BLOCK_START(bl), BLOCK_START(bl) + base_address);
  871.               }
  872.   #endif
  873. ***************
  874. *** 702,710 ****
  875.   #ifdef DEBUG0
  876.               if(atari_debug)
  877.               {
  878. !             fprintf(stderr, "  end   %X->%X\n", 
  879. !                 BLOCK_END(bl), BLOCK_END(bl) + base_address);
  880. !             fprintf(debugfp, "  end   %X->%X\n", 
  881.                   BLOCK_END(bl), BLOCK_END(bl) + base_address);
  882.               }
  883.   #endif
  884. --- 676,682 ----
  885.   #ifdef DEBUG0
  886.               if(atari_debug)
  887.               {
  888. !             fprintf_filtered(stderr, "  end   %X->%X\n", 
  889.                   BLOCK_END(bl), BLOCK_END(bl) + base_address);
  890.               }
  891.   #endif
  892. ***************
  893. *** 714,721 ****
  894.   #ifdef DEBUG
  895.           if(atari_debug)
  896.           {
  897. !           fprintf(stderr, " ...end block\n");
  898. !           fprintf(debugfp, " ...end block\n");
  899.               }
  900.   #endif
  901.           }
  902. --- 686,692 ----
  903.   #ifdef DEBUG
  904.           if(atari_debug)
  905.           {
  906. !           fprintf_filtered(stderr, " ...end block\n");
  907.               }
  908.   #endif
  909.           }
  910. ***************
  911. *** 724,732 ****
  912.   #ifdef DEBUG
  913.           if(atari_debug)
  914.           {
  915. !           fprintf(stderr, " is not relocatable: (%s, %s)\n",
  916. !             d_namespace[sym->namespace], d_aclass[sym->class]);
  917. !           fprintf(debugfp, " is not relocatable: (%s, %s)\n",
  918.               d_namespace[sym->namespace], d_aclass[sym->class]);
  919.               }
  920.   #endif
  921. --- 695,701 ----
  922.   #ifdef DEBUG
  923.           if(atari_debug)
  924.           {
  925. !           fprintf_filtered(stderr, " is not relocatable: (%s, %s)\n",
  926.               d_namespace[sym->namespace], d_aclass[sym->class]);
  927.               }
  928.   #endif
  929. *** 1.4    1991/10/05 20:59:54
  930. --- breakpoint.c    1992/01/14 20:05:56
  931. ***************
  932. *** 128,134 ****
  933.         {
  934.           b->cond = 0;
  935.           if (from_tty)
  936. !           printf ("Breakpoint %d now unconditional.\n", bnum);
  937.         }
  938.       else
  939.         {
  940. --- 128,134 ----
  941.         {
  942.           b->cond = 0;
  943.           if (from_tty)
  944. !          printf_filtered ("Breakpoint %d now unconditional.\n", bnum);
  945.         }
  946.       else
  947.         {
  948. ***************
  949. *** 183,189 ****
  950.         {
  951.       if (input_from_terminal_p ())
  952.         {
  953. !         printf ("Type commands for when breakpoint %d is hit, one per line.\n\
  954.   End with a line saying just \"end\".\n", bnum);
  955.           fflush (stdout);
  956.         }
  957. --- 183,189 ----
  958.         {
  959.       if (input_from_terminal_p ())
  960.         {
  961. !        printf_filtered ("Type commands for when breakpoint %d is hit, one per line.\n\
  962.   End with a line saying just \"end\".\n", bnum);
  963.           fflush (stdout);
  964.         }
  965. ***************
  966. *** 251,257 ****
  967.     register struct breakpoint *b;
  968.     int val;
  969.   
  970. ! /*   printf ("Inserting breakpoints.\n"); */
  971.     ALL_BREAKPOINTS (b)
  972.       if (b->enable != disabled && ! b->inserted && ! b->duplicate)
  973.         {
  974. --- 251,257 ----
  975.     register struct breakpoint *b;
  976.     int val;
  977.   
  978. ! /*  printf_filtered ("Inserting breakpoints.\n"); */
  979.     ALL_BREAKPOINTS (b)
  980.       if (b->enable != disabled && ! b->inserted && ! b->duplicate)
  981.         {
  982. ***************
  983. *** 259,265 ****
  984.       val = write_memory (b->address, break_insn, sizeof break_insn);
  985.       if (val)
  986.         return val;
  987. ! /*    printf ("Inserted breakpoint at 0x%x, shadow 0x%x, 0x%x.\n",
  988.           b->address, b->shadow_contents[0], b->shadow_contents[1]); */
  989.       b->inserted = 1;
  990.         }
  991. --- 259,265 ----
  992.       val = write_memory (b->address, break_insn, sizeof break_insn);
  993.       if (val)
  994.         return val;
  995. ! /*printf_filtered ("Inserted breakpoint at 0x%x, shadow 0x%x, 0x%x.\n",
  996.           b->address, b->shadow_contents[0], b->shadow_contents[1]); */
  997.       b->inserted = 1;
  998.         }
  999. ***************
  1000. *** 272,278 ****
  1001.     register struct breakpoint *b;
  1002.     int val;
  1003.   
  1004. ! /*   printf ("Removing breakpoints.\n"); */
  1005.     ALL_BREAKPOINTS (b)
  1006.       if (b->inserted)
  1007.         {
  1008. --- 272,278 ----
  1009.     register struct breakpoint *b;
  1010.     int val;
  1011.   
  1012. ! /*  printf_filtered ("Removing breakpoints.\n"); */
  1013.     ALL_BREAKPOINTS (b)
  1014.       if (b->inserted)
  1015.         {
  1016. ***************
  1017. *** 280,286 ****
  1018.       if (val)
  1019.         return val;
  1020.       b->inserted = 0;
  1021. ! /*    printf ("Removed breakpoint at 0x%x, shadow 0x%x, 0x%x.\n",
  1022.           b->address, b->shadow_contents[0], b->shadow_contents[1]); */
  1023.         }
  1024.   
  1025. --- 280,286 ----
  1026.       if (val)
  1027.         return val;
  1028.       b->inserted = 0;
  1029. ! /*printf_filtered ("Removed breakpoint at 0x%x, shadow 0x%x, 0x%x.\n",
  1030.           b->address, b->shadow_contents[0], b->shadow_contents[1]); */
  1031.         }
  1032.   
  1033. ***************
  1034. *** 399,405 ****
  1035.     ALL_BREAKPOINTS (b)
  1036.       if (bnum == -1 || bnum == b->number)
  1037.         {
  1038. !     printf ("#%-3d %c  0x%08x ", b->number,
  1039.           "nyod"[(int) b->enable],
  1040.           b->address);
  1041.       last_addr = b->address;
  1042. --- 399,405 ----
  1043.     ALL_BREAKPOINTS (b)
  1044.       if (bnum == -1 || bnum == b->number)
  1045.         {
  1046. ! printf_filtered ("#%-3d %c  0x%08x ", b->number,
  1047.           "nyod"[(int) b->enable],
  1048.           b->address);
  1049.       last_addr = b->address;
  1050. ***************
  1051. *** 407,433 ****
  1052.         {
  1053.           sym = find_pc_function (b->address);
  1054.           if (sym)
  1055. !           printf (" in %s (%s line %d)", SYMBOL_NAME (sym),
  1056.                 b->symtab->filename, b->line_number);
  1057.           else
  1058. !           printf ("%s line %d", b->symtab->filename, b->line_number);
  1059.         }
  1060. !     printf ("\n");
  1061.   
  1062.       if (b->ignore_count)
  1063. !       printf ("\tignore next %d hits\n", b->ignore_count);
  1064.       if (b->frame)
  1065. !       printf ("\tstop only in stack frame at 0x%x\n", b->frame);
  1066.       if (b->cond)
  1067.         {
  1068. !         printf ("\tbreak only if ");
  1069.           print_expression (b->cond, stdout);
  1070. !         printf ("\n");
  1071.         }
  1072.       if (l = b->commands)
  1073.         while (l)
  1074.           {
  1075. !           printf ("\t%s\n", l->line);
  1076.             l = l->next;
  1077.           }
  1078.         }
  1079. --- 407,433 ----
  1080.         {
  1081.           sym = find_pc_function (b->address);
  1082.           if (sym)
  1083. !          printf_filtered (" in %s (%s line %d)", SYMBOL_NAME (sym),
  1084.                 b->symtab->filename, b->line_number);
  1085.           else
  1086. !          printf_filtered ("%s line %d", b->symtab->filename, b->line_number);
  1087.         }
  1088. ! printf_filtered ("\n");
  1089.   
  1090.       if (b->ignore_count)
  1091. !      printf_filtered ("\tignore next %d hits\n", b->ignore_count);
  1092.       if (b->frame)
  1093. !      printf_filtered ("\tstop only in stack frame at 0x%x\n", b->frame);
  1094.       if (b->cond)
  1095.         {
  1096. !        printf_filtered ("\tbreak only if ");
  1097.           print_expression (b->cond, stdout);
  1098. !        printf_filtered ("\n");
  1099.         }
  1100.       if (l = b->commands)
  1101.         while (l)
  1102.           {
  1103. !          printf_filtered ("\t%s\n", l->line);
  1104.             l = l->next;
  1105.           }
  1106.         }
  1107. ***************
  1108. *** 445,453 ****
  1109.     if (bnum_exp)
  1110.       bnum = parse_and_eval_address (bnum_exp);
  1111.     else if (breakpoint_chain == 0)
  1112. !     printf ("No breakpoints.\n");
  1113.     else
  1114. !     printf ("Breakpoints:\n\
  1115.   Num Enb   Address    Where\n");
  1116.   
  1117.     breakpoint_1 (bnum);
  1118. --- 445,453 ----
  1119.     if (bnum_exp)
  1120.       bnum = parse_and_eval_address (bnum_exp);
  1121.     else if (breakpoint_chain == 0)
  1122. !    printf_filtered ("No breakpoints.\n");
  1123.     else
  1124. !    printf_filtered ("Breakpoints:\n\
  1125.   Num Enb   Address    Where\n");
  1126.   
  1127.     breakpoint_1 (bnum);
  1128. ***************
  1129. *** 467,483 ****
  1130.         others++;
  1131.     if (others > 0)
  1132.       {
  1133. !       printf ("Note: breakpoint%s ", (others > 1) ? "s" : "");
  1134.         ALL_BREAKPOINTS (b)
  1135.       if (b->address == pc)
  1136.         {
  1137.           others--;
  1138. !         printf ("%d%s%s ",
  1139.               b->number,
  1140.               (b->enable == disabled) ? " (disabled)" : "",
  1141.               (others > 1) ? "," : ((others == 1) ? " and" : ""));
  1142.         }
  1143. !       printf (" also set at pc 0x%x\n", pc);
  1144.       }
  1145.   }
  1146.   
  1147. --- 467,483 ----
  1148.         others++;
  1149.     if (others > 0)
  1150.       {
  1151. !      printf_filtered ("Note: breakpoint%s ", (others > 1) ? "s" : "");
  1152.         ALL_BREAKPOINTS (b)
  1153.       if (b->address == pc)
  1154.         {
  1155.           others--;
  1156. !        printf_filtered ("%d%s%s ",
  1157.               b->number,
  1158.               (b->enable == disabled) ? " (disabled)" : "",
  1159.               (others > 1) ? "," : ((others == 1) ? " and" : ""));
  1160.         }
  1161. !      printf_filtered (" also set at pc 0x%x\n", pc);
  1162.       }
  1163.   }
  1164.   
  1165. ***************
  1166. *** 611,620 ****
  1167.         if (tempflag)
  1168.       b->enable = temporary;
  1169.   
  1170. !       printf ("Breakpoint %d at 0x%x", b->number, b->address);
  1171.         if (b->symtab)
  1172. !     printf (": file %s, line %d.", b->symtab->filename, b->line_number);
  1173. !       printf ("\n");
  1174.       }
  1175.   }
  1176.   
  1177. --- 611,620 ----
  1178.         if (tempflag)
  1179.       b->enable = temporary;
  1180.   
  1181. !      printf_filtered ("Breakpoint %d at 0x%x", b->number, b->address);
  1182.         if (b->symtab)
  1183. ! printf_filtered (": file %s, line %d.", b->symtab->filename, b->line_number);
  1184. !      printf_filtered ("\n");
  1185.       }
  1186.   }
  1187.   
  1188. ***************
  1189. *** 672,681 ****
  1190.     if (tempflag)
  1191.       b->enable = temporary;
  1192.   
  1193. !   printf ("Breakpoint %d at 0x%x", b->number, b->address);
  1194.     if (b->symtab)
  1195. !     printf (": file %s, line %d.", b->symtab->filename, b->line_number);
  1196. !   printf ("\n");
  1197.   }
  1198.   
  1199.   static void
  1200. --- 672,681 ----
  1201.     if (tempflag)
  1202.       b->enable = temporary;
  1203.   
  1204. !  printf_filtered ("Breakpoint %d at 0x%x", b->number, b->address);
  1205.     if (b->symtab)
  1206. !    printf_filtered (": file %s, line %d.", b->symtab->filename, b->line_number);
  1207. !  printf_filtered ("\n");
  1208.   }
  1209.   
  1210.   static void
  1211. ***************
  1212. *** 745,759 ****
  1213.       error ("No breakpoint at %s.", arg);
  1214.   
  1215.     if (found->next) from_tty = 1; /* Alwats report if deleted more than one */
  1216. !   if (from_tty) printf ("Deleted breakpoint%s ", found->next ? "s" : "");
  1217.     while (found)
  1218.       {
  1219. !       if (from_tty) printf ("%d ", found->number);
  1220.         b1 = found->next;
  1221.         delete_breakpoint (found);
  1222.         found = b1;
  1223.       }
  1224. !   if (from_tty) putchar ('\n');
  1225.   }
  1226.   
  1227.   /* Delete breakpoint number BNUM if it is a `delete' breakpoint.
  1228. --- 745,759 ----
  1229.       error ("No breakpoint at %s.", arg);
  1230.   
  1231.     if (found->next) from_tty = 1; /* Alwats report if deleted more than one */
  1232. !   if (from_tty)printf_filtered ("Deleted breakpoint%s ", found->next ? "s" : "");
  1233.     while (found)
  1234.       {
  1235. !       if (from_tty)printf_filtered ("%d ", found->number);
  1236.         b1 = found->next;
  1237.         delete_breakpoint (found);
  1238.         found = b1;
  1239.       }
  1240. !   if (from_tty) fputc_filtered ('\n', stdout);
  1241.   }
  1242.   
  1243.   /* Delete breakpoint number BNUM if it is a `delete' breakpoint.
  1244. ***************
  1245. *** 857,867 ****
  1246.       if (!from_tty)
  1247.         return;
  1248.       else if (count == 0)
  1249. !       printf ("Will stop next time breakpoint %d is reached.", bptnum);
  1250.       else if (count == 1)
  1251. !       printf ("Will ignore next crossing of breakpoint %d.", bptnum);
  1252.       else
  1253. !       printf ("Will ignore next %d crossings of breakpoint %d.",
  1254.             count, bptnum);
  1255.       return;
  1256.         }
  1257. --- 857,867 ----
  1258.       if (!from_tty)
  1259.         return;
  1260.       else if (count == 0)
  1261. !      printf_filtered ("Will stop next time breakpoint %d is reached.", bptnum);
  1262.       else if (count == 1)
  1263. !      printf_filtered ("Will ignore next crossing of breakpoint %d.", bptnum);
  1264.       else
  1265. !      printf_filtered ("Will ignore next %d crossings of breakpoint %d.",
  1266.             count, bptnum);
  1267.       return;
  1268.         }
  1269. ***************
  1270. *** 893,899 ****
  1271.       error ("Second argument (specified ignore-count) is missing.");
  1272.   
  1273.     set_ignore_count (num, parse_and_eval_address (p), from_tty);
  1274. !   printf ("\n");
  1275.   }
  1276.   
  1277.   /* Call FUNCTION on each of the breakpoints
  1278. --- 893,899 ----
  1279.       error ("Second argument (specified ignore-count) is missing.");
  1280.   
  1281.     set_ignore_count (num, parse_and_eval_address (p), from_tty);
  1282. !  printf_filtered ("\n");
  1283.   }
  1284.   
  1285.   /* Call FUNCTION on each of the breakpoints
  1286. ***************
  1287. *** 927,933 ****
  1288.           function (b);
  1289.           goto win;
  1290.         }
  1291. !       printf ("No breakpoint number %d.\n", num);
  1292.       win:
  1293.         p = p1;
  1294.         while (*p == ' ' || *p == '\t') p++;
  1295. --- 927,933 ----
  1296.           function (b);
  1297.           goto win;
  1298.         }
  1299. !      printf_filtered ("No breakpoint number %d.\n", num);
  1300.       win:
  1301.         p = p1;
  1302.         while (*p == ' ' || *p == '\t') p++;
  1303. *** 1.2    1991/05/21 01:28:16
  1304. --- command.c    1992/01/14 20:05:56
  1305. ***************
  1306. *** 280,289 ****
  1307.        so that the commands in the class will be listed.  */
  1308.   
  1309.         p = c->doc;
  1310. !       fprintf (stream, "%s\n", p);
  1311.         if (c->function != 0 && c->prefixlist == 0)
  1312.       return;
  1313. !       fputc ('\n', stream);
  1314.         if (c->prefixlist)
  1315.       {
  1316.         list = *c->prefixlist;
  1317. --- 280,289 ----
  1318.        so that the commands in the class will be listed.  */
  1319.   
  1320.         p = c->doc;
  1321. !       fprintf_filtered (stream, "%s\n", p);
  1322.         if (c->function != 0 && c->prefixlist == 0)
  1323.       return;
  1324. !       fputc_filtered ('\n', stream);
  1325.         if (c->prefixlist)
  1326.       {
  1327.         list = *c->prefixlist;
  1328. ***************
  1329. *** 310,318 ****
  1330.       }
  1331.   
  1332.     if (class == -2)
  1333. !     fprintf (stream, "List of classes of %scommands:\n\n", cmdtype2);
  1334.     else
  1335. !     fprintf (stream, "List of %scommands:\n\n", cmdtype2);
  1336.   
  1337.     for (c = list; c; c = c->next)
  1338.       {
  1339. --- 310,318 ----
  1340.       }
  1341.   
  1342.     if (class == -2)
  1343. !     fprintf_filtered (stream, "List of classes of %scommands:\n\n", cmdtype2);
  1344.     else
  1345. !     fprintf_filtered (stream, "List of %scommands:\n\n", cmdtype2);
  1346.   
  1347.     for (c = list; c; c = c->next)
  1348.       {
  1349. ***************
  1350. *** 321,341 ****
  1351.             || (c->class == class && c->function != 0) /* Listing one class */
  1352.             || (class == -2 && c->function == 0)))    /* Listing the classes */
  1353.       {
  1354. !       fprintf (stream, "%s -- ", c->name);
  1355.         /* Print just first line of documentation.  */
  1356.         p = c->doc;
  1357. !       while (*p && *p != '\n') p++;
  1358. !       fwrite (c->doc, 1, p - c->doc, stream);
  1359. !       fputc ('\n', stream);
  1360.       }
  1361.       }
  1362.   
  1363.     if (class == -2)
  1364. !     fprintf (stream, "\n\
  1365.   Type \"help%s\" followed by a class name for a list of commands in that class.",
  1366.            cmdtype1);
  1367.   
  1368. !   fprintf (stream, "\n\
  1369.   Type \"help%s\" followed by %scommand name for full documentation.\n\
  1370.   Command name abbreviations are allowed if unambiguous.\n",
  1371.          cmdtype1, cmdtype2);
  1372. --- 321,341 ----
  1373.             || (c->class == class && c->function != 0) /* Listing one class */
  1374.             || (class == -2 && c->function == 0)))    /* Listing the classes */
  1375.       {
  1376. !       fprintf_filtered (stream, "%s -- ", c->name);
  1377.         /* Print just first line of documentation.  */
  1378.         p = c->doc;
  1379. !       while (*p && *p != '\n') fputc_filtered(*p++, stream);
  1380. ! /*      fwrite (c->doc, 1, p - c->doc, stream); */
  1381. !       fputc_filtered ('\n', stream);
  1382.       }
  1383.       }
  1384.   
  1385.     if (class == -2)
  1386. !     fprintf_filtered (stream, "\n\
  1387.   Type \"help%s\" followed by a class name for a list of commands in that class.",
  1388.            cmdtype1);
  1389.   
  1390. !   fprintf_filtered (stream, "\n\
  1391.   Type \"help%s\" followed by %scommand name for full documentation.\n\
  1392.   Command name abbreviations are allowed if unambiguous.\n",
  1393.          cmdtype1, cmdtype2);
  1394. *** 1.10    1991/10/05 20:59:54
  1395. --- dbxread.c    1992/01/14 20:05:57
  1396. ***************
  1397. *** 62,68 ****
  1398.   static struct symbol *define_symbol ();
  1399.   static void start_subfile ();
  1400.   static int hashname ();
  1401. - static void hash_symsegs ();
  1402.   
  1403.   static void add_undefined_type ();
  1404.   static void cleanup_undefined_types ();
  1405. --- 62,67 ----
  1406. ***************
  1407. *** 113,126 ****
  1408.      but the information is copied from them when appropriate
  1409.      to make the symtabs that will exist permanently.  */
  1410.   
  1411. - static struct symtab *symseg_chain;
  1412. - /* Symseg symbol table for the file whose data we are now processing.
  1413. -    It is one of those in symseg_chain.  Or 0, for a compilation that
  1414. -    has no symseg.  */
  1415. - static struct symtab *current_symseg;
  1416.   /* Name of source file whose symbol data we are now processing.
  1417.      This comes from a symbol of type N_SO.  */
  1418.   
  1419. --- 112,117 ----
  1420. ***************
  1421. *** 264,277 ****
  1422.   
  1423.   static char *symfile;
  1424.   
  1425. ! static int
  1426. ! xxmalloc (n)
  1427. ! {
  1428. !   int v = malloc (n);
  1429. !   if (v == 0)
  1430. !     abort ();
  1431. !   return v;
  1432. ! }
  1433.   
  1434.   /* Make a copy of the string at PTR with SIZE characters in the symbol obstack
  1435.      (and add a null character at the end in the copy).
  1436. --- 255,262 ----
  1437.   
  1438.   static char *symfile;
  1439.   
  1440. ! extern char *xmalloc();
  1441. ! #define xxmalloc xmalloc
  1442.   
  1443.   /* Make a copy of the string at PTR with SIZE characters in the symbol obstack
  1444.      (and add a null character at the end in the copy).
  1445. ***************
  1446. *** 532,538 ****
  1447.       {
  1448.         /* Type is defined outside of header files.
  1449.        Find it in this object file's type vector.  */
  1450. !       if (Index >= type_vector_length)
  1451.       {
  1452.         type_vector_length *= 2;
  1453.         type_vector = (struct typevector *)
  1454. --- 517,523 ----
  1455.       {
  1456.         /* Type is defined outside of header files.
  1457.        Find it in this object file's type vector.  */
  1458. !       while (Index >= type_vector_length)
  1459.       {
  1460.         type_vector_length *= 2;
  1461.         type_vector = (struct typevector *)
  1462. ***************
  1463. *** 546,551 ****
  1464. --- 531,537 ----
  1465.       {
  1466.         register int real_filenum = this_object_header_files[filenum];
  1467.         register struct header_file *f;
  1468. +       int f_orig_length;
  1469.   
  1470.         if (real_filenum >= n_header_files)
  1471.       abort ();
  1472. ***************
  1473. *** 552,564 ****
  1474.   
  1475.         f = &header_files[real_filenum];
  1476.   
  1477. !       if (Index >= f->length)
  1478.       {
  1479. !       f->length *= 2;
  1480.         f->vector = (struct type **)
  1481.           xrealloc (f->vector, f->length * sizeof (struct type *));
  1482. !       bzero (&f->vector[f->length / 2],
  1483. !          f->length * sizeof (struct type *) / 2);
  1484.       }
  1485.         return &f->vector[Index];
  1486.       }
  1487. --- 538,552 ----
  1488.   
  1489.         f = &header_files[real_filenum];
  1490.   
  1491. !       f_orig_length = f->length;
  1492. !       if (Index >= f_orig_length)
  1493.       {
  1494. !       while (Index >= f->length)
  1495. !         f->length *= 2;
  1496.         f->vector = (struct type **)
  1497.           xrealloc (f->vector, f->length * sizeof (struct type *));
  1498. !       bzero (&f->vector[f_orig_length],
  1499. !          (f->length - f_orig_length) * sizeof (struct type *));
  1500.       }
  1501.         return &f->vector[Index];
  1502.       }
  1503. ***************
  1504. *** 678,688 ****
  1505. --- 666,678 ----
  1506.       }
  1507.     free_pendings = 0;
  1508.   
  1509. + #if 0 /* Now we make the links in the symbol_obstack, so don't free them.  */
  1510.     for (bnext = pending_blocks; bnext; bnext = bnext1)
  1511.       {
  1512.         bnext1 = bnext->next;
  1513.         free (bnext);
  1514.       }
  1515. + #endif
  1516.     pending_blocks = 0;
  1517.   
  1518.     for (next = file_symbols; next; next = next1)
  1519. ***************
  1520. *** 690,700 ****
  1521. --- 680,694 ----
  1522.         next1 = next->next;
  1523.         free (next);
  1524.       }
  1525. +   file_symbols = 0;
  1526. +   
  1527.     for (next = global_symbols; next; next = next1)
  1528.       {
  1529.         next1 = next->next;
  1530.         free (next);
  1531.       }
  1532. +   global_symbols = 0;
  1533. +   
  1534.   }
  1535.   
  1536.   /* Take one of the lists of symbols and make a block from it.
  1537. ***************
  1538. *** 879,891 ****
  1539.   
  1540.     new_object_header_files ();
  1541.   
  1542. -   for (s = symseg_chain; s; s = s->next)
  1543. -     if (s->ldsymoff == symnum * sizeof (struct nlist))
  1544. -       break;
  1545. -   current_symseg = s;
  1546. -   if (s != 0)
  1547. -     return;
  1548.     type_vector_length = 160;
  1549.     type_vector = (struct typevector *) xxmalloc (sizeof (struct typevector) + type_vector_length * sizeof (struct type *));
  1550.     bzero (type_vector->type, type_vector_length * sizeof (struct type *));
  1551. --- 873,878 ----
  1552. ***************
  1553. *** 970,982 ****
  1554.     register struct linetable *lv;
  1555.     struct subfile *nextsub;
  1556.   
  1557. -   if (current_symseg != 0)
  1558. -     {
  1559. -       last_source_file = 0;
  1560. -       current_symseg = 0;
  1561. -       return;
  1562. -     }
  1563.     /* Finish the lexical context of the last function in the file;
  1564.        pop the context stack.  */
  1565.   
  1566. --- 957,962 ----
  1567. ***************
  1568. *** 1332,1344 ****
  1569.       free (symfile);
  1570.         symfile = 0;
  1571.         free_all_symtabs ();
  1572. !       printf ("%s has no symbol-table; symbols discarded.\n", name);
  1573.         fflush (stdout);
  1574.         do_cleanups (old_chain);
  1575.         return;
  1576.       }
  1577.   
  1578. !   printf ("Reading symbol data from %s...", name);
  1579.     fflush (stdout);
  1580.   
  1581.     /* Now read the string table, all at once.  */
  1582. --- 1312,1324 ----
  1583.       free (symfile);
  1584.         symfile = 0;
  1585.         free_all_symtabs ();
  1586. !      printf_filtered ("%s has no symbol-table; symbols discarded.\n", name);
  1587.         fflush (stdout);
  1588.         do_cleanups (old_chain);
  1589.         return;
  1590.       }
  1591.   
  1592. !  printf_filtered ("Reading symbol data from %s...", name);
  1593.     fflush (stdout);
  1594.   
  1595.     /* Now read the string table, all at once.  */
  1596. ***************
  1597. *** 1374,1383 ****
  1598.     /* Empty the hash table of global syms looking for values.  */
  1599.     bzero (global_sym_chain, sizeof global_sym_chain);
  1600.   
  1601. -   /* Symsegs are no longer supported by GDB.  Setting symseg_chain to
  1602. -      0 is easier than finding all the symseg code and eliminating it.  */
  1603. -   symseg_chain = 0;
  1604.     /* Position to read the symbol table.  Do not read it all at once. */
  1605.     val = lseek (desc, SYMBOL_TABLE_OFFSET, 0);
  1606.     if (val < 0)
  1607. --- 1354,1359 ----
  1608. ***************
  1609. *** 1424,1439 ****
  1610.   
  1611.     do_cleanups (old_chain);
  1612.   
  1613. !   /* Free the symtabs made by read_symsegs, but not their contents,
  1614. !      which have been copied into symtabs on symtab_list.  */
  1615. !   while (symseg_chain)
  1616. !     {
  1617. !       register struct symtab *s = symseg_chain->next;
  1618. !       free (symseg_chain);
  1619. !       symseg_chain = s;
  1620. !     }
  1621. !   printf ("done.\n");
  1622.     fflush (stdout);
  1623.   }
  1624.   
  1625. --- 1400,1406 ----
  1626.   
  1627.     do_cleanups (old_chain);
  1628.   
  1629. !  printf_filtered ("done.\n");
  1630.     fflush (stdout);
  1631.   }
  1632.   
  1633. ***************
  1634. *** 1654,1694 ****
  1635.     if (total < 0) total += (1000 << 6);
  1636.     return total % HASHSIZE;
  1637.   }
  1638. - /* Put all appropriate global symbols in the symseg data
  1639. -    onto the hash chains so that their addresses will be stored
  1640. -    when seen later in loader global symbols.  */
  1641. - static void
  1642. - hash_symsegs ()
  1643. - {
  1644. -   /* Look at each symbol in each block in each symseg symtab.  */
  1645. -   struct symtab *s;
  1646. -   for (s = symseg_chain; s; s = s->next)
  1647. -     {
  1648. -       register int n;
  1649. -       for (n = BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)) - 1; n >= 0; n--)
  1650. -     {
  1651. -       register struct block *b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), n);
  1652. -       register int i;
  1653. -       for (i = BLOCK_NSYMS (b) - 1; i >= 0; i--)
  1654. -         {
  1655. -           register struct symbol *sym = BLOCK_SYM (b, i);
  1656. -           /* Put the symbol on a chain if its value is an address
  1657. -          that is figured out by the loader.  */
  1658. -           if (SYMBOL_CLASS (sym) == LOC_EXTERNAL)
  1659. -         {
  1660. -           register int hash = hashname (SYMBOL_NAME (sym));
  1661. -           SYMBOL_VALUE (sym) = (int) global_sym_chain[hash];
  1662. -           global_sym_chain[hash] = sym;
  1663. -           SYMBOL_CLASS (sym) = LOC_STATIC;
  1664. -         }
  1665. -         }
  1666. -     }
  1667. -     }
  1668. - }
  1669.   
  1670.   static void
  1671.   process_one_symbol (type, desc, value, name)
  1672. --- 1621,1626 ----
  1673. ***************
  1674. *** 1794,1800 ****
  1675.        to be attached to the function's own block.  */
  1676.         if (local_symbols && context_stack_depth > 1)
  1677.       {
  1678. !       /* Muzzle a compiler bug that makes end > start.  */
  1679.         if (new->start_addr > value)
  1680.           new->start_addr = value;
  1681.         /* Make a block for the local symbols within.  */
  1682. --- 1726,1732 ----
  1683.        to be attached to the function's own block.  */
  1684.         if (local_symbols && context_stack_depth > 1)
  1685.       {
  1686. !       /* Muzzle a compiler bug that makes end < start.  */
  1687.         if (new->start_addr > value)
  1688.           new->start_addr = value;
  1689.         /* Make a block for the local symbols within.  */
  1690. ***************
  1691. *** 1919,1924 ****
  1692. --- 1851,1857 ----
  1693.       {
  1694.       case 'r':
  1695.         {
  1696. +         extern double atof();
  1697.           double d = atof (p);
  1698.           char *value;
  1699.   
  1700. ***************
  1701. *** 2028,2034 ****
  1702.         add_symbol_to_list (sym, &local_symbols);
  1703.         /* DESC == 0 implies compiled with GCC.
  1704.        In this case, if it says `short', believe it.  */
  1705. !       if (desc == 0)
  1706.       break;
  1707.         /* If PCC says a parameter is a short or a char,
  1708.        it is really an int.  */
  1709. --- 1961,1969 ----
  1710.         add_symbol_to_list (sym, &local_symbols);
  1711.         /* DESC == 0 implies compiled with GCC.
  1712.        In this case, if it says `short', believe it.  */
  1713. ! #ifndef atarist /* always gcc compiled */
  1714. !       if (desc == 0) 
  1715. ! #endif
  1716.       break;
  1717.         /* If PCC says a parameter is a short or a char,
  1718.        it is really an int.  */
  1719. ***************
  1720. *** 2400,2405 ****
  1721. --- 2335,2341 ----
  1722.         break;
  1723.         
  1724.       case '*':
  1725. + #if 0
  1726.         type1 = read_type (pp);
  1727.         if (TYPE_POINTER_TYPE (type1))
  1728.       {
  1729. ***************
  1730. *** 2413,2420 ****
  1731. --- 2349,2364 ----
  1732.         smash_to_pointer_type (type, type1);
  1733.       }
  1734.         break;
  1735. + #else
  1736. +       type1 = read_type (pp);
  1737. +       type = lookup_pointer_type (type1);
  1738. +       if (typenums[0] != -1)
  1739. +     *dbx_lookup_type (typenums) = type;
  1740. +       break;
  1741. + #endif
  1742.   
  1743.       case 'f':
  1744. + #if 0
  1745.         type1 = read_type (pp);
  1746.         if (TYPE_FUNCTION_TYPE (type1))
  1747.       {
  1748. ***************
  1749. *** 2428,2433 ****
  1750. --- 2372,2384 ----
  1751.         smash_to_function_type (type, type1);
  1752.       }
  1753.         break;
  1754. + #else
  1755. +       type1 = read_type (pp);
  1756. +       type = lookup_function_type (type1);
  1757. +       if (typenums[0] != -1)
  1758. +     *dbx_lookup_type (typenums) = type;
  1759. +       break;
  1760. + #endif
  1761.   
  1762.       case 'r':
  1763.         type = read_range_type (pp, typenums);
  1764. ***************
  1765. *** 2791,2812 ****
  1766.   
  1767.     else if (n2 == 0 && n3 == -1)
  1768.       {
  1769. -       if (sizeof (int) == sizeof (long))
  1770.       return builtin_type_unsigned_int;
  1771. -       else
  1772. -     return builtin_type_unsigned_long;
  1773.       }
  1774.   #ifdef atarist
  1775.      /* special case for -mshort */
  1776. !   else if (n2 == 0 && n3 == 65535)
  1777.       {
  1778. -     gcc_mshort = 1;
  1779.       return builtin_type_unsigned_short;
  1780.       }
  1781.      /* and this one just occurs, sigh! */
  1782. !   else if (n2 == 0 && n3 == 255)
  1783.       {
  1784. -     gcc_mshort = 1;
  1785.       return builtin_type_unsigned_char;
  1786.       }
  1787.   #endif
  1788. --- 2742,2758 ----
  1789.   
  1790.     else if (n2 == 0 && n3 == -1)
  1791.       {
  1792.       return builtin_type_unsigned_int;
  1793.       }
  1794.   #ifdef atarist
  1795.      /* special case for -mshort */
  1796. !   else if (gcc_mshort && n2 == 0 && n3 == 65535)
  1797.       {
  1798.       return builtin_type_unsigned_short;
  1799.       }
  1800.      /* and this one just occurs, sigh! */
  1801. !   else if (gcc_mshort && n2 == 0 && n3 == 255)
  1802.       {
  1803.       return builtin_type_unsigned_char;
  1804.       }
  1805.   #endif
  1806. ***************
  1807. *** 2882,2890 ****
  1808.     else
  1809.   #ifdef atarist
  1810.       error ("Ranged type doesn't fit within known sizes.\n\
  1811. ! On an atariST this is most likely a pathological case due to\n\
  1812.   objects compiled with the \"-mshort\" option to gcc.\n\
  1813. ! Please re-try without\"-mshort\".\n\
  1814.   n2 == %d, n3 == %d\n", n2,n3);
  1815.   #else
  1816.       error ("Ranged type doesn't fit within known sizes.");
  1817. --- 2828,2836 ----
  1818.     else
  1819.   #ifdef atarist
  1820.       error ("Ranged type doesn't fit within known sizes.\n\
  1821. ! On an atariST this is most likely due to\n\
  1822.   objects compiled with the \"-mshort\" option to gcc.\n\
  1823. ! Please re-try by specifying the \"-mshort\" option on the gdb command line.\n\
  1824.   n2 == %d, n3 == %d\n", n2,n3);
  1825.   #else
  1826.       error ("Ranged type doesn't fit within known sizes.");
  1827. ***************
  1828. *** 2949,2955 ****
  1829.   #ifdef atarist
  1830.   set_gcc_mshort()
  1831.   {
  1832. !     printf("Was %d\n", gcc_mshort);
  1833.       gcc_mshort = 1;
  1834.   }
  1835.   #endif
  1836. --- 2895,2901 ----
  1837.   #ifdef atarist
  1838.   set_gcc_mshort()
  1839.   {
  1840. !    printf_filtered("Was %d\n", gcc_mshort);
  1841.       gcc_mshort = 1;
  1842.   }
  1843.   #endif
  1844. *** 1.2    1991/09/20 23:51:25
  1845. --- expprint.c    1992/01/14 20:05:58
  1846. ***************
  1847. *** 135,156 ****
  1848.   
  1849.       case OP_VAR_VALUE:
  1850.         (*pos) += 2;
  1851. !       fprintf (stream, "%s", SYMBOL_NAME (exp->elts[pc + 1].symbol));
  1852.         return;
  1853.   
  1854.       case OP_LAST:
  1855.         (*pos) += 2;
  1856. !       fprintf (stream, "$%d", exp->elts[pc + 1].longconst);
  1857.         return;
  1858.   
  1859.       case OP_REGISTER:
  1860.         (*pos) += 2;
  1861. !       fprintf (stream, "$%s", reg_names[exp->elts[pc + 1].longconst]);
  1862.         return;
  1863.   
  1864.       case OP_INTERNALVAR:
  1865.         (*pos) += 2;
  1866. !       fprintf (stream, "$%s",
  1867.              internalvar_name (exp->elts[pc + 1].internalvar));
  1868.         return;
  1869.   
  1870. --- 135,156 ----
  1871.   
  1872.       case OP_VAR_VALUE:
  1873.         (*pos) += 2;
  1874. !       fprintf_filtered (stream, "%s", SYMBOL_NAME (exp->elts[pc + 1].symbol));
  1875.         return;
  1876.   
  1877.       case OP_LAST:
  1878.         (*pos) += 2;
  1879. !       fprintf_filtered (stream, "$%d", exp->elts[pc + 1].longconst);
  1880.         return;
  1881.   
  1882.       case OP_REGISTER:
  1883.         (*pos) += 2;
  1884. !       fprintf_filtered (stream, "$%s", reg_names[exp->elts[pc + 1].longconst]);
  1885.         return;
  1886.   
  1887.       case OP_INTERNALVAR:
  1888.         (*pos) += 2;
  1889. !       fprintf_filtered (stream, "$%s",
  1890.              internalvar_name (exp->elts[pc + 1].internalvar));
  1891.         return;
  1892.   
  1893. ***************
  1894. *** 158,196 ****
  1895.         (*pos) += 2;
  1896.         nargs = exp->elts[pc + 1].longconst;
  1897.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  1898. !       fprintf (stream, " (");
  1899.         for (tem = 0; tem < nargs; tem++)
  1900.       {
  1901.         if (tem != 0)
  1902. !         fprintf (stream, ", ");
  1903.         print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
  1904.       }
  1905. !       fprintf (stream, ")");
  1906.         return;
  1907.   
  1908.       case OP_STRING:
  1909.         nargs = strlen (&exp->elts[pc + 1].string);
  1910.         (*pos) += 2 + (nargs + sizeof (union exp_element)) / sizeof (union exp_element);
  1911. !       fprintf (stream, "\"");
  1912.         for (tem = 0; tem < nargs; tem++)
  1913.       printchar ((&exp->elts[pc + 1].string)[tem], stream);
  1914. !       fprintf (stream, "\"");
  1915.         return;
  1916.   
  1917.       case TERNOP_COND:
  1918.         if ((int) prec > (int) PREC_COMMA)
  1919. !     fprintf (stream, "(");
  1920.         /* Print the subexpressions, forcing parentheses
  1921.        around any binary operations within them.
  1922.        This is more parentheses than are strictly necessary,
  1923.        but it looks clearer.  */
  1924.         print_subexp (exp, pos, stream, PREC_HYPER);
  1925. !       fprintf (stream, " ? ");
  1926.         print_subexp (exp, pos, stream, PREC_HYPER);
  1927. !       fprintf (stream, " : ");
  1928.         print_subexp (exp, pos, stream, PREC_HYPER);
  1929.         if ((int) prec > (int) PREC_COMMA)
  1930. !     fprintf (stream, ")");
  1931.         return;
  1932.   
  1933.       case STRUCTOP_STRUCT:
  1934. --- 158,196 ----
  1935.         (*pos) += 2;
  1936.         nargs = exp->elts[pc + 1].longconst;
  1937.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  1938. !       fprintf_filtered (stream, " (");
  1939.         for (tem = 0; tem < nargs; tem++)
  1940.       {
  1941.         if (tem != 0)
  1942. !         fprintf_filtered (stream, ", ");
  1943.         print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
  1944.       }
  1945. !       fprintf_filtered (stream, ")");
  1946.         return;
  1947.   
  1948.       case OP_STRING:
  1949.         nargs = strlen (&exp->elts[pc + 1].string);
  1950.         (*pos) += 2 + (nargs + sizeof (union exp_element)) / sizeof (union exp_element);
  1951. !       fprintf_filtered (stream, "\"");
  1952.         for (tem = 0; tem < nargs; tem++)
  1953.       printchar ((&exp->elts[pc + 1].string)[tem], stream);
  1954. !       fprintf_filtered (stream, "\"");
  1955.         return;
  1956.   
  1957.       case TERNOP_COND:
  1958.         if ((int) prec > (int) PREC_COMMA)
  1959. !     fprintf_filtered (stream, "(");
  1960.         /* Print the subexpressions, forcing parentheses
  1961.        around any binary operations within them.
  1962.        This is more parentheses than are strictly necessary,
  1963.        but it looks clearer.  */
  1964.         print_subexp (exp, pos, stream, PREC_HYPER);
  1965. !       fprintf_filtered (stream, " ? ");
  1966.         print_subexp (exp, pos, stream, PREC_HYPER);
  1967. !       fprintf_filtered (stream, " : ");
  1968.         print_subexp (exp, pos, stream, PREC_HYPER);
  1969.         if ((int) prec > (int) PREC_COMMA)
  1970. !     fprintf_filtered (stream, ")");
  1971.         return;
  1972.   
  1973.       case STRUCTOP_STRUCT:
  1974. ***************
  1975. *** 197,203 ****
  1976.         tem = strlen (&exp->elts[pc + 1].string);
  1977.         (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
  1978.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  1979. !       fprintf (stream, ".%s", &exp->elts[pc + 1].string);
  1980.         return;
  1981.   
  1982.       case STRUCTOP_PTR:
  1983. --- 197,203 ----
  1984.         tem = strlen (&exp->elts[pc + 1].string);
  1985.         (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
  1986.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  1987. !       fprintf_filtered (stream, ".%s", &exp->elts[pc + 1].string);
  1988.         return;
  1989.   
  1990.       case STRUCTOP_PTR:
  1991. ***************
  1992. *** 204,251 ****
  1993.         tem = strlen (&exp->elts[pc + 1].string);
  1994.         (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
  1995.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  1996. !       fprintf (stream, "->%s", &exp->elts[pc + 1].string);
  1997.         return;
  1998.   
  1999.       case BINOP_SUBSCRIPT:
  2000.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  2001. !       fprintf (stream, "[");
  2002.         print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
  2003. !       fprintf (stream, "]");
  2004.         return;
  2005.   
  2006.       case UNOP_POSTINCREMENT:
  2007.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  2008. !       fprintf (stream, "++");
  2009.         return;
  2010.   
  2011.       case UNOP_POSTDECREMENT:
  2012.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  2013. !       fprintf (stream, "--");
  2014.         return;
  2015.   
  2016.       case UNOP_CAST:
  2017.         (*pos) += 2;
  2018.         if ((int) prec > (int) PREC_PREFIX)
  2019. !     fprintf (stream, "(");
  2020. !       fprintf (stream, "(");
  2021.         type_print (exp->elts[pc + 1].type, "", stream, 0);
  2022. !       fprintf (stream, ") ");
  2023.         print_subexp (exp, pos, stream, PREC_PREFIX);
  2024.         if ((int) prec > (int) PREC_PREFIX)
  2025. !     fprintf (stream, ")");
  2026.         return;
  2027.   
  2028.       case UNOP_MEMVAL:
  2029.         (*pos) += 2;
  2030.         if ((int) prec > (int) PREC_PREFIX)
  2031. !     fprintf (stream, "(");
  2032. !       fprintf (stream, "{");
  2033.         type_print (exp->elts[pc + 1].type, "", stream, 0);
  2034. !       fprintf (stream, "} ");
  2035.         print_subexp (exp, pos, stream, PREC_PREFIX);
  2036.         if ((int) prec > (int) PREC_PREFIX)
  2037. !     fprintf (stream, ")");
  2038.         return;
  2039.   
  2040.       case BINOP_ASSIGN_MODIFY:
  2041. --- 204,251 ----
  2042.         tem = strlen (&exp->elts[pc + 1].string);
  2043.         (*pos) += 2 + (tem + sizeof (union exp_element)) / sizeof (union exp_element);
  2044.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  2045. !       fprintf_filtered (stream, "->%s", &exp->elts[pc + 1].string);
  2046.         return;
  2047.   
  2048.       case BINOP_SUBSCRIPT:
  2049.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  2050. !       fprintf_filtered (stream, "[");
  2051.         print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
  2052. !       fprintf_filtered (stream, "]");
  2053.         return;
  2054.   
  2055.       case UNOP_POSTINCREMENT:
  2056.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  2057. !       fprintf_filtered (stream, "++");
  2058.         return;
  2059.   
  2060.       case UNOP_POSTDECREMENT:
  2061.         print_subexp (exp, pos, stream, PREC_SUFFIX);
  2062. !       fprintf_filtered (stream, "--");
  2063.         return;
  2064.   
  2065.       case UNOP_CAST:
  2066.         (*pos) += 2;
  2067.         if ((int) prec > (int) PREC_PREFIX)
  2068. !     fprintf_filtered (stream, "(");
  2069. !       fprintf_filtered (stream, "(");
  2070.         type_print (exp->elts[pc + 1].type, "", stream, 0);
  2071. !       fprintf_filtered (stream, ") ");
  2072.         print_subexp (exp, pos, stream, PREC_PREFIX);
  2073.         if ((int) prec > (int) PREC_PREFIX)
  2074. !     fprintf_filtered (stream, ")");
  2075.         return;
  2076.   
  2077.       case UNOP_MEMVAL:
  2078.         (*pos) += 2;
  2079.         if ((int) prec > (int) PREC_PREFIX)
  2080. !     fprintf_filtered (stream, "(");
  2081. !       fprintf_filtered (stream, "{");
  2082.         type_print (exp->elts[pc + 1].type, "", stream, 0);
  2083. !       fprintf_filtered (stream, "} ");
  2084.         print_subexp (exp, pos, stream, PREC_PREFIX);
  2085.         if ((int) prec > (int) PREC_PREFIX)
  2086. !     fprintf_filtered (stream, ")");
  2087.         return;
  2088.   
  2089.       case BINOP_ASSIGN_MODIFY:
  2090. ***************
  2091. *** 273,283 ****
  2092.       }
  2093.   
  2094.     if ((int) myprec < (int) prec)
  2095. !     fprintf (stream, "(");
  2096.     if ((int) opcode > (int) BINOP_END)
  2097.       {
  2098.         /* Unary prefix operator.  */
  2099. !       fprintf (stream, "%s", op_str);
  2100.         print_subexp (exp, pos, stream, PREC_PREFIX);
  2101.       }
  2102.     else
  2103. --- 273,283 ----
  2104.       }
  2105.   
  2106.     if ((int) myprec < (int) prec)
  2107. !     fprintf_filtered (stream, "(");
  2108.     if ((int) opcode > (int) BINOP_END)
  2109.       {
  2110.         /* Unary prefix operator.  */
  2111. !       fprintf_filtered (stream, "%s", op_str);
  2112.         print_subexp (exp, pos, stream, PREC_PREFIX);
  2113.       }
  2114.     else
  2115. ***************
  2116. *** 289,299 ****
  2117.         print_subexp (exp, pos, stream, (int) myprec + assoc);
  2118.         /* Print the operator itself.  */
  2119.         if (assign_modify)
  2120. !     fprintf (stream, " %s= ", op_str);
  2121.         else if (op_str[0] == ',')
  2122. !     fprintf (stream, "%s ", op_str);
  2123.         else
  2124. !     fprintf (stream, " %s ", op_str);
  2125.         /* Print right operand.
  2126.        If operator is left-associative,
  2127.        increment precedence for this operand.  */
  2128. --- 289,299 ----
  2129.         print_subexp (exp, pos, stream, (int) myprec + assoc);
  2130.         /* Print the operator itself.  */
  2131.         if (assign_modify)
  2132. !     fprintf_filtered (stream, " %s= ", op_str);
  2133.         else if (op_str[0] == ',')
  2134. !     fprintf_filtered (stream, "%s ", op_str);
  2135.         else
  2136. !     fprintf_filtered (stream, " %s ", op_str);
  2137.         /* Print right operand.
  2138.        If operator is left-associative,
  2139.        increment precedence for this operand.  */
  2140. ***************
  2141. *** 300,304 ****
  2142.         print_subexp (exp, pos, stream, (int) myprec + !assoc);
  2143.       }
  2144.     if ((int) myprec < (int) prec)
  2145. !     fprintf (stream, ")");
  2146.   }
  2147. --- 300,304 ----
  2148.         print_subexp (exp, pos, stream, (int) myprec + !assoc);
  2149.       }
  2150.     if ((int) myprec < (int) prec)
  2151. !     fprintf_filtered (stream, ")");
  2152.   }
  2153. *** 1.4    1991/09/20 23:51:25
  2154. --- expread.c    1992/01/14 20:05:58
  2155. ***************
  2156. *** 596,602 ****
  2157.   
  2158.   #if YYDEBUG != 0
  2159.     if (yydebug)
  2160. !     fprintf(stderr, "Starting parse\n");
  2161.   #endif
  2162.   
  2163.     yystate = 0;
  2164. --- 596,602 ----
  2165.   
  2166.   #if YYDEBUG != 0
  2167.     if (yydebug)
  2168. !     fprintf_filtered(stderr, "Starting parse\n");
  2169.   #endif
  2170.   
  2171.     yystate = 0;
  2172. ***************
  2173. *** 677,683 ****
  2174.   
  2175.   #if YYDEBUG != 0
  2176.         if (yydebug)
  2177. !     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  2178.   #endif
  2179.   
  2180.         if (yyssp >= yyss + yystacksize - 1)
  2181. --- 677,683 ----
  2182.   
  2183.   #if YYDEBUG != 0
  2184.         if (yydebug)
  2185. !     fprintf_filtered(stderr, "Stack size increased to %d\n", yystacksize);
  2186.   #endif
  2187.   
  2188.         if (yyssp >= yyss + yystacksize - 1)
  2189. ***************
  2190. *** 686,692 ****
  2191.   
  2192.   #if YYDEBUG != 0
  2193.     if (yydebug)
  2194. !     fprintf(stderr, "Entering state %d\n", yystate);
  2195.   #endif
  2196.   
  2197.    yybackup:
  2198. --- 686,692 ----
  2199.   
  2200.   #if YYDEBUG != 0
  2201.     if (yydebug)
  2202. !     fprintf_filtered(stderr, "Entering state %d\n", yystate);
  2203.   #endif
  2204.   
  2205.    yybackup:
  2206. ***************
  2207. *** 710,716 ****
  2208.       {
  2209.   #if YYDEBUG != 0
  2210.         if (yydebug)
  2211. !     fprintf(stderr, "Reading a token: ");
  2212.   #endif
  2213.         yychar = YYLEX;
  2214.       }
  2215. --- 710,716 ----
  2216.       {
  2217.   #if YYDEBUG != 0
  2218.         if (yydebug)
  2219. !     fprintf_filtered(stderr, "Reading a token: ");
  2220.   #endif
  2221.         yychar = YYLEX;
  2222.       }
  2223. ***************
  2224. *** 724,730 ****
  2225.   
  2226.   #if YYDEBUG != 0
  2227.         if (yydebug)
  2228. !     fprintf(stderr, "Now at end of input.\n");
  2229.   #endif
  2230.       }
  2231.     else
  2232. --- 724,730 ----
  2233.   
  2234.   #if YYDEBUG != 0
  2235.         if (yydebug)
  2236. !     fprintf_filtered(stderr, "Now at end of input.\n");
  2237.   #endif
  2238.       }
  2239.     else
  2240. ***************
  2241. *** 733,739 ****
  2242.   
  2243.   #if YYDEBUG != 0
  2244.         if (yydebug)
  2245. !     fprintf(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
  2246.   #endif
  2247.       }
  2248.   
  2249. --- 733,739 ----
  2250.   
  2251.   #if YYDEBUG != 0
  2252.         if (yydebug)
  2253. !     fprintf_filtered(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
  2254.   #endif
  2255.       }
  2256.   
  2257. ***************
  2258. *** 767,773 ****
  2259.   
  2260.   #if YYDEBUG != 0
  2261.     if (yydebug)
  2262. !     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  2263.   #endif
  2264.   
  2265.     /* Discard the token being shifted unless it is eof.  */
  2266. --- 767,773 ----
  2267.   
  2268.   #if YYDEBUG != 0
  2269.     if (yydebug)
  2270. !     fprintf_filtered(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  2271.   #endif
  2272.   
  2273.     /* Discard the token being shifted unless it is eof.  */
  2274. ***************
  2275. *** 802,814 ****
  2276.       {
  2277.         int i;
  2278.   
  2279. !       fprintf (stderr, "Reducing via rule %d (line %d), ",
  2280.              yyn, yyrline[yyn]);
  2281.   
  2282.         /* Print the symboles being reduced, and their result.  */
  2283.         for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  2284. !     fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  2285. !       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  2286.       }
  2287.   #endif
  2288.   
  2289. --- 802,814 ----
  2290.       {
  2291.         int i;
  2292.   
  2293. !       fprintf_filtered (stderr, "Reducing via rule %d (line %d), ",
  2294.              yyn, yyrline[yyn]);
  2295.   
  2296.         /* Print the symboles being reduced, and their result.  */
  2297.         for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  2298. !     fprintf_filtered (stderr, "%s ", yytname[yyrhs[i]]);
  2299. !       fprintf_filtered (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  2300.       }
  2301.   #endif
  2302.   
  2303. ***************
  2304. *** 1181,1190 ****
  2305.     if (yydebug)
  2306.       {
  2307.         short *ssp1 = yyss - 1;
  2308. !       fprintf (stderr, "state stack now");
  2309.         while (ssp1 != yyssp)
  2310. !     fprintf (stderr, " %d", *++ssp1);
  2311. !       fprintf (stderr, "\n");
  2312.       }
  2313.   #endif
  2314.   
  2315. --- 1181,1190 ----
  2316.     if (yydebug)
  2317.       {
  2318.         short *ssp1 = yyss - 1;
  2319. !       fprintf_filtered (stderr, "state stack now");
  2320.         while (ssp1 != yyssp)
  2321. !     fprintf_filtered (stderr, " %d", *++ssp1);
  2322. !       fprintf_filtered (stderr, "\n");
  2323.       }
  2324.   #endif
  2325.   
  2326. ***************
  2327. *** 1277,1283 ****
  2328.   
  2329.   #if YYDEBUG != 0
  2330.         if (yydebug)
  2331. !     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  2332.   #endif
  2333.   
  2334.         yychar = YYEMPTY;
  2335. --- 1277,1283 ----
  2336.   
  2337.   #if YYDEBUG != 0
  2338.         if (yydebug)
  2339. !     fprintf_filtered(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  2340.   #endif
  2341.   
  2342.         yychar = YYEMPTY;
  2343. ***************
  2344. *** 1312,1321 ****
  2345.     if (yydebug)
  2346.       {
  2347.         short *ssp1 = yyss - 1;
  2348. !       fprintf (stderr, "Error: state stack now");
  2349.         while (ssp1 != yyssp)
  2350. !     fprintf (stderr, " %d", *++ssp1);
  2351. !       fprintf (stderr, "\n");
  2352.       }
  2353.   #endif
  2354.   
  2355. --- 1312,1321 ----
  2356.     if (yydebug)
  2357.       {
  2358.         short *ssp1 = yyss - 1;
  2359. !       fprintf_filtered (stderr, "Error: state stack now");
  2360.         while (ssp1 != yyssp)
  2361. !     fprintf_filtered (stderr, " %d", *++ssp1);
  2362. !       fprintf_filtered (stderr, "\n");
  2363.       }
  2364.   #endif
  2365.   
  2366. ***************
  2367. *** 1345,1351 ****
  2368.   
  2369.   #if YYDEBUG != 0
  2370.     if (yydebug)
  2371. !     fprintf(stderr, "Shifting error token, ");
  2372.   #endif
  2373.   
  2374.     *++yyvsp = yylval;
  2375. --- 1345,1351 ----
  2376.   
  2377.   #if YYDEBUG != 0
  2378.     if (yydebug)
  2379. !     fprintf_filtered(stderr, "Shifting error token, ");
  2380.   #endif
  2381.   
  2382.     *++yyvsp = yylval;
  2383. *** 1.4    1991/10/05 20:59:54
  2384. --- findvar.c    1992/01/14 20:05:59
  2385. ***************
  2386. *** 43,48 ****
  2387. --- 43,51 ----
  2388.     register FRAME frame1 = 0;
  2389.     register CORE_ADDR addr = 0;
  2390.   
  2391. +   if (frame == 0)        /* No regs saved if want current frame */
  2392. +     return 0;
  2393.     while (1)
  2394.       {
  2395.         QUIT;
  2396. ***************
  2397. *** 69,75 ****
  2398.   {
  2399.     register CORE_ADDR addr;
  2400.   
  2401. !   if (regnum == FP_REGNUM)
  2402.       {
  2403.         bcopy (&selected_frame, myaddr, sizeof (CORE_ADDR));
  2404.         return;
  2405. --- 72,78 ----
  2406.   {
  2407.     register CORE_ADDR addr;
  2408.   
  2409. !   if (regnum == FP_REGNUM && selected_frame)
  2410.       {
  2411.         bcopy (&selected_frame, myaddr, sizeof (CORE_ADDR));
  2412.         return;
  2413. ***************
  2414. *** 129,135 ****
  2415.      Note that you must call `fetch_registers' once
  2416.      before examining or depositing any registers.  */
  2417.   
  2418. ! char registers[REGISTER_BYTES];
  2419.   
  2420.   /* Copy LEN bytes of consecutive data from registers
  2421.      starting with the REGBYTE'th byte of register data
  2422. --- 132,138 ----
  2423.      Note that you must call `fetch_registers' once
  2424.      before examining or depositing any registers.  */
  2425.   
  2426. ! char registers[REGISTER_BYTES + 64];
  2427.   
  2428.   /* Copy LEN bytes of consecutive data from registers
  2429.      starting with the REGBYTE'th byte of register data
  2430. ***************
  2431. *** 152,158 ****
  2432.        int len;
  2433.   {
  2434.     bcopy (myaddr, ®isters[regbyte], len);
  2435. !   if (have_inferior_p ())
  2436.       store_inferior_registers (-1);
  2437.   }
  2438.   
  2439. --- 155,161 ----
  2440.        int len;
  2441.   {
  2442.     bcopy (myaddr, ®isters[regbyte], len);
  2443. ! /*  if (have_inferior_p ()) */
  2444.       store_inferior_registers (-1);
  2445.   }
  2446.   
  2447. ***************
  2448. *** 176,182 ****
  2449.     /* This loses when REGISTER_RAW_SIZE (regno) != sizeof (int) */
  2450.     *(int *) ®isters[REGISTER_BYTE (regno)] = val;
  2451.   
  2452. !   if (have_inferior_p ())
  2453.       store_inferior_registers (regno);
  2454.   }
  2455.   
  2456. --- 179,185 ----
  2457.     /* This loses when REGISTER_RAW_SIZE (regno) != sizeof (int) */
  2458.     *(int *) ®isters[REGISTER_BYTE (regno)] = val;
  2459.   
  2460. ! /*  if (have_inferior_p ()) */
  2461.       store_inferior_registers (regno);
  2462.   }
  2463.   
  2464. ***************
  2465. *** 228,236 ****
  2466.         return v;
  2467.   
  2468.       case LOC_CONST_BYTES:
  2469. !       bcopy (val, VALUE_CONTENTS (v), len);
  2470. !       VALUE_LVAL (v) = not_lval;
  2471. !       return v;
  2472.   
  2473.       case LOC_STATIC:
  2474.         addr = val;
  2475. --- 231,244 ----
  2476.         return v;
  2477.   
  2478.       case LOC_CONST_BYTES:
  2479. !     {
  2480. !     char *bytes_addr;
  2481. !     bytes_addr = SYMBOL_VALUE_BYTES (var);
  2482. !     bcopy (bytes_addr, VALUE_CONTENTS (v), len);
  2483. !     VALUE_LVAL (v) = not_lval;
  2484. !     return v;
  2485. !     }
  2486.   
  2487.       case LOC_STATIC:
  2488.         addr = val;
  2489. ***************
  2490. *** 238,248 ****
  2491. --- 246,260 ----
  2492.   
  2493.       case LOC_ARG:
  2494.         fi = get_frame_info (frame);
  2495. +       if(fi.frame == 0)
  2496. +       return 0;
  2497.         addr = val + FRAME_ARGS_ADDRESS (fi);
  2498.         break;
  2499.   
  2500.       case LOC_LOCAL:
  2501.         fi = get_frame_info (frame);
  2502. +       if(fi.frame == 0)
  2503. +       return 0;
  2504.         addr = val + FRAME_LOCALS_ADDRESS (fi);
  2505.         break;
  2506.   
  2507. *** 1.3    1991/09/20 23:51:25
  2508. --- gdb.texinfo    1992/01/14 20:06:01
  2509. ***************
  2510. *** 543,551 ****
  2511.   
  2512.   @item gcc-mshort
  2513.   @kindex gcc -mshort
  2514. ! While atariST gdb tries to intut when the exec--file has been compiled
  2515. ! for 16 bit integer defaults (gcc -mshort), it is not always successful.
  2516. ! the @samp{gcc-mshort} command informs gdb of this fact.
  2517.   @end table
  2518.   
  2519.   While all file-specifying commands allow both absolute and relative
  2520. --- 543,554 ----
  2521.   
  2522.   @item gcc-mshort
  2523.   @kindex gcc -mshort
  2524. ! When trying to debug an exec--file that has been compiled
  2525. ! for 16 bit integer defaults (gcc -mshort)
  2526. ! the @samp{gcc-mshort} command informs gdb of this fact. This command
  2527. ! is only useful if you issue it before you read the symbol--file. The preferred 
  2528. ! way to specify this fact is to specify the @samp{-mshort} command line 
  2529. ! option to gdb,ttp when you invoke it.
  2530.   @end table
  2531.   
  2532.   While all file-specifying commands allow both absolute and relative
  2533. ***************
  2534. *** 609,619 ****
  2535.   To start your program under GDB, use the @samp{run} command.  The program
  2536.   must already have been specified using the @samp{exec-file} command or with
  2537.   an argument to GDB (@pxref{Files}); what @samp{run} does is create an
  2538. ! inferior process, load the program into it, and set it in motion. And
  2539.   then it breaks immediately to allow you enter further GDB commands.
  2540.   After you have done so, you can then continue execution with a @samp{cont}
  2541.   command. The only GDB command you may enter before you issue the
  2542. ! @samp{run} is the @samp{set-args} command.
  2543.   
  2544.   The execution of a program is affected by certain information it
  2545.   receives from its superior.  GDB provides ways to specify this
  2546. --- 612,627 ----
  2547.   To start your program under GDB, use the @samp{run} command.  The program
  2548.   must already have been specified using the @samp{exec-file} command or with
  2549.   an argument to GDB (@pxref{Files}); what @samp{run} does is create an
  2550. ! inferior process, load the program into it, passes it command line
  2551. ! arguements and sets it in motion. And
  2552.   then it breaks immediately to allow you enter further GDB commands.
  2553.   After you have done so, you can then continue execution with a @samp{cont}
  2554.   command. The only GDB command you may enter before you issue the
  2555. ! @samp{run} is the @samp{set-args} command. Note that you can also
  2556. ! specify arguements for the inferior process with the @samp{run}
  2557. ! command. On the atariST there is no way to re-run the program
  2558. ! being debugged. You will have to exit GDB and start again. This
  2559. ! restriction is mostly due to the single tasking nature of TOS.
  2560.   
  2561.   The execution of a program is affected by certain information it
  2562.   receives from its superior.  GDB provides ways to specify this
  2563. ***************
  2564. *** 664,675 ****
  2565.   @samp{run} command. No globbing or redirections are done.
  2566.   
  2567.   @kindex set-args
  2568. ! The command @samp{set-args} can be used to specify the arguments to be used
  2569. ! the next time the program is run.  If @samp{set-args} has no arguments, it
  2570. ! means to use no arguments the next time the program is run.  If you have
  2571. ! run your program with arguments and want to run it again with no arguments,
  2572. ! this is the only way to do so. Re-running a program on the atariST is
  2573. ! discouraged. Exit GDB and enter it again afresh.
  2574.   
  2575.   @node Environment, Working Directory, Arguments, Running
  2576.   @section Your Program's Environment
  2577. --- 672,683 ----
  2578.   @samp{run} command. No globbing or redirections are done.
  2579.   
  2580.   @kindex set-args
  2581. ! The command @samp{set-args} can is used to specify the arguments to be passed
  2582. ! to the program being debugged when it is run.  If @samp{set-args} has no
  2583. ! arguments, it means to use no arguments when the program is run.
  2584. ! On the atariST there is NO way to re-run a program without arguements or
  2585. ! with a new set of arguements once the initial run command has been issued.
  2586. ! Exit GDB and enter it again afresh.
  2587.   
  2588.   @node Environment, Working Directory, Arguments, Running
  2589.   @section Your Program's Environment
  2590. ***************
  2591. *** 2880,2885 ****
  2592. --- 2888,2899 ----
  2593.   @section Mode Options
  2594.   
  2595.   @table @samp
  2596. + @item -mshort
  2597. + This option must be specified when you are going to debug a program that
  2598. + has been compiled with 16 bit int (@samp{gcc -mshort}). In earlier
  2599. + version of atariST gdb, it tried to intut this information, but now
  2600. + it must be explicitly specified by the @samp{-mshort} option.
  2601.   @item -nx
  2602.   Do not execute commands from the init files @file{.gdbinit}.
  2603.   Normally, the commands in these files are executed after all the
  2604. *** 1.3    1991/05/20 18:06:03
  2605. --- gnu-out.h    1992/01/14 20:06:01
  2606. ***************
  2607. *** 117,122 ****
  2608. --- 117,143 ----
  2609.   /* Address of data segment in memory after it is loaded.
  2610.      Note that it is up to you to define SEGMENT_SIZE
  2611.      on machines not listed here.  */
  2612. + #if defined(atarist) || defined(CROSSATARI) || defined(atariminix) || defined(MINIX)
  2613. + #  ifdef vax
  2614. + #    undef vax
  2615. + #  endif
  2616. + #  ifdef is68k
  2617. + #    undef is68k
  2618. + #  endif
  2619. + #  ifdef pyr
  2620. + #    undef pyr
  2621. + #  endif
  2622. + #  ifdef hp300
  2623. + #    undef hp300
  2624. + #  endif
  2625. + #  ifdef sony
  2626. + #    undef sony
  2627. + #  endif
  2628. + #  ifdef PORTAR
  2629. + #    undef PORTAR
  2630. + #  endif
  2631. + #endif
  2632.   #if defined(vax) || defined(hp300) || defined(pyr)
  2633.   #define SEGMENT_SIZE page_size
  2634.   #endif
  2635. ***************
  2636. *** 129,134 ****
  2637. --- 150,158 ----
  2638.   #if defined(m68k) && defined(PORTAR)
  2639.   #define PAGE_SIZE 0x400
  2640.   #define SEGMENT_SIZE PAGE_SIZE
  2641. + #endif
  2642. + #if defined(atarist) || defined(CROSSATARI) || defined(atariminix) || defined(MINIX)
  2643. + #define SEGMENT_SIZE 2
  2644.   #endif
  2645.   
  2646.   #define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1))
  2647. *** 1.8    1991/10/05 20:59:54
  2648. --- infcmd.c    1992/01/14 20:06:02
  2649. ***************
  2650. *** 41,47 ****
  2651.   /* String containing arguments to give to the program,
  2652.      with a space added at the front.  Just a space means no args.  */
  2653.   
  2654. ! static char *inferior_args;
  2655.   
  2656.   /* File name for default use for standard in/out in the inferior.  */
  2657.   
  2658. --- 41,47 ----
  2659.   /* String containing arguments to give to the program,
  2660.      with a space added at the front.  Just a space means no args.  */
  2661.   
  2662. ! static char *inferior_args = (char *)NULL;
  2663.   
  2664.   /* File name for default use for standard in/out in the inferior.  */
  2665.   
  2666. ***************
  2667. *** 118,124 ****
  2668.   set_args_command (args)
  2669.        char *args;
  2670.   {
  2671. !   free (inferior_args);
  2672.     if (!args) args = "";
  2673.     inferior_args = concat (" ", args, "");
  2674.   }
  2675. --- 118,133 ----
  2676.   set_args_command (args)
  2677.        char *args;
  2678.   {
  2679. ! #ifdef atarist
  2680. !   if(have_inferior_p())
  2681. !       error("Cannot set-args after the inferior program has been started\
  2682. !  on the atariST.\n To set args to be passed to an inferior process either\
  2683. ! \n\tissue the set-args command before the initial run command\
  2684. ! \n\tor specify the args for the inferior process in the initial run command.");
  2685. ! #endif
  2686. !   
  2687. !   if(inferior_args)
  2688. !       free (inferior_args);
  2689.     if (!args) args = "";
  2690.     inferior_args = concat (" ", args, "");
  2691.   }
  2692. ***************
  2693. *** 151,161 ****
  2694. --- 160,174 ----
  2695.   
  2696.     if (inferior_pid)
  2697.       {
  2698. + #ifndef atarist
  2699.         if (query ("The program being debugged has been started already.\n\
  2700.   Start it from the beginning? "))
  2701.       kill_inferior ();
  2702.         else
  2703.       error ("Program already started.");
  2704. + #else
  2705. +       error("Program already started. Cannot restart program on the atariST.");
  2706. + #endif      
  2707.       }
  2708.   
  2709.   #ifndef atarist
  2710. ***************
  2711. *** 164,170 ****
  2712.         free (allargs);
  2713.         if (from_tty)
  2714.       {
  2715. !       printf ("Starting program: %s%s\n",
  2716.             exec_file, inferior_args);
  2717.         fflush (stdout);
  2718.       }
  2719. --- 177,183 ----
  2720.         free (allargs);
  2721.         if (from_tty)
  2722.       {
  2723. !      printf_filtered ("Starting program: %s%s\n",
  2724.             exec_file, inferior_args);
  2725.         fflush (stdout);
  2726.       }
  2727. ***************
  2728. *** 178,184 ****
  2729.         exec_file = (char *) get_exec_file (1);
  2730.         if (from_tty)
  2731.       {
  2732. !       printf ("Starting program: %s%s\n",
  2733.             exec_file, inferior_args);
  2734.         fflush (stdout);
  2735.       }
  2736. --- 191,197 ----
  2737.         exec_file = (char *) get_exec_file (1);
  2738.         if (from_tty)
  2739.       {
  2740. !      printf_filtered ("Starting program: %s%s\n",
  2741.             exec_file, inferior_args);
  2742.         fflush (stdout);
  2743.       }
  2744. ***************
  2745. *** 185,194 ****
  2746.   
  2747.         allargs = concat ("exec ", exec_file, inferior_args);
  2748.         inferior_pid = create_inferior (allargs, environ_vector (inferior_environ));
  2749.       }
  2750.   
  2751.     clear_proceed_status ();
  2752.     start_inferior ();
  2753.   }
  2754.   
  2755. --- 198,212 ----
  2756.   
  2757.         allargs = concat ("exec ", exec_file, inferior_args);
  2758.         inferior_pid = create_inferior (allargs, environ_vector (inferior_environ));
  2759. + #ifdef atarist
  2760. +       if(inferior_pid == -9999)
  2761. +         error("Program already started or run once. Cannot restart program on\
  2762. +  the atariST.\nExit GDB and start again if you want to do this.");
  2763. + #endif
  2764.       }
  2765.   
  2766.     clear_proceed_status ();
  2767.     start_inferior ();
  2768.   }
  2769.   
  2770. ***************
  2771. *** 208,218 ****
  2772.               parse_and_eval_address (proc_count_exp) - 1,
  2773.               from_tty);
  2774.         if (from_tty)
  2775. !     printf ("  ");
  2776.       }
  2777.   
  2778.     if (from_tty)
  2779. !     printf ("Continuing.\n");
  2780.   
  2781.     clear_proceed_status ();
  2782.   
  2783. --- 226,236 ----
  2784.               parse_and_eval_address (proc_count_exp) - 1,
  2785.               from_tty);
  2786.         if (from_tty)
  2787. ! printf_filtered ("  ");
  2788.       }
  2789.   
  2790.     if (from_tty)
  2791. !    printf_filtered ("Continuing.\n");
  2792.   
  2793.     clear_proceed_status ();
  2794.   
  2795. ***************
  2796. *** 279,285 ****
  2797.   
  2798.             misc = find_pc_misc_function (stop_pc);
  2799.             terminal_ours ();
  2800. !           printf ("Current function has no line number information.\n");
  2801.             fflush (stdout);
  2802.   
  2803.             /* No info or after _etext ("Can't happen") */
  2804. --- 297,303 ----
  2805.   
  2806.             misc = find_pc_misc_function (stop_pc);
  2807.             terminal_ours ();
  2808. !          printf_filtered ("Current function has no line number information.\n");
  2809.             fflush (stdout);
  2810.   
  2811.             /* No info or after _etext ("Can't happen") */
  2812. ***************
  2813. *** 286,292 ****
  2814.             if (misc == -1 || misc == misc_function_count - 1)
  2815.           error ("No data available on pc function.");
  2816.   
  2817. !           printf ("Single stepping until function exit.\n");
  2818.             fflush (stdout);
  2819.   
  2820.             step_range_start = misc_function_vector[misc].address;
  2821. --- 304,310 ----
  2822.             if (misc == -1 || misc == misc_function_count - 1)
  2823.           error ("No data available on pc function.");
  2824.   
  2825. !          printf_filtered ("Single stepping until function exit.\n");
  2826.             fflush (stdout);
  2827.   
  2828.             step_range_start = misc_function_vector[misc].address;
  2829. ***************
  2830. *** 351,357 ****
  2831.   
  2832.   
  2833.     if (from_tty)
  2834. !     printf ("Continuing at 0x%x.\n", addr);
  2835.   
  2836.     clear_proceed_status ();
  2837.     proceed (addr, 0, 0);
  2838. --- 369,375 ----
  2839.   
  2840.   
  2841.     if (from_tty)
  2842. !    printf_filtered ("Continuing at 0x%x.\n", addr);
  2843.   
  2844.     clear_proceed_status ();
  2845.     proceed (addr, 0, 0);
  2846. ***************
  2847. *** 376,382 ****
  2848.   
  2849.   
  2850.     if (from_tty)
  2851. !     printf ("Continuing with signal %d.\n", signum);
  2852.   
  2853.     clear_proceed_status ();
  2854.     proceed (stop_pc, signum, 0);
  2855. --- 394,400 ----
  2856.   
  2857.   
  2858.     if (from_tty)
  2859. !    printf_filtered ("Continuing with signal %d.\n", signum);
  2860.   
  2861.     clear_proceed_status ();
  2862.     proceed (stop_pc, signum, 0);
  2863. ***************
  2864. *** 482,488 ****
  2865.     if (!inferior_pid)
  2866.       error ("The program is not running.");
  2867.     if (arg)
  2868. ! /*    until_break_command (arg, from_tty) */;
  2869.     else
  2870.       until_next_command (from_tty);
  2871.   }
  2872. --- 500,508 ----
  2873.     if (!inferior_pid)
  2874.       error ("The program is not running.");
  2875.     if (arg)
  2876. ! /*    until_break_command (arg, from_tty); */
  2877. !       error("Sorry until <break> command is a no-op on the atariST for now.\n\
  2878. !  Only the until next command form of until (without args) is supported.");
  2879.     else
  2880.       until_next_command (from_tty);
  2881.   }
  2882. ***************
  2883. *** 524,530 ****
  2884.   
  2885.     if (from_tty)
  2886.       {
  2887. !       printf ("Run till exit from ");
  2888.         print_selected_frame ();
  2889.       }
  2890.   
  2891. --- 544,550 ----
  2892.   
  2893.     if (from_tty)
  2894.       {
  2895. !      printf_filtered ("Run till exit from ");
  2896.         print_selected_frame ();
  2897.       }
  2898.   
  2899. ***************
  2900. *** 553,561 ****
  2901.                      funcaddr,
  2902.                      value_type,
  2903.                      1));
  2904. !       printf ("Value returned is $%d = ", record_latest_value (val));
  2905.         value_print (val, stdout, 0);
  2906. !       putchar ('\n');
  2907.       }
  2908.   }
  2909.   
  2910. --- 573,581 ----
  2911.                      funcaddr,
  2912.                      value_type,
  2913.                      1));
  2914. !      printf_filtered ("Value returned is $%d = ", record_latest_value (val));
  2915.         value_print (val, stdout, 0);
  2916. !       fputc_filtered ('\n', stdout);
  2917.       }
  2918.   }
  2919.   
  2920. ***************
  2921. *** 564,585 ****
  2922.   {
  2923.     if (inferior_pid == 0)
  2924.       {
  2925. !       printf ("The program being debugged is not being run.\n");
  2926.         return;
  2927.       }
  2928.   
  2929. !   printf ("Program being debugged is in process %d, stopped at 0x%x.\n",
  2930.         inferior_pid, stop_pc);
  2931.     if (stop_step)
  2932. !     printf ("It stopped after being stepped.\n");
  2933.     else if (stop_breakpoint)
  2934. !     printf ("It stopped at breakpoint %d.\n", stop_breakpoint);
  2935.     else if (stop_signal)
  2936. !     printf ("It stopped with signal %d (%s).\n",
  2937.           stop_signal,
  2938.           (stop_signal > NSIG)? "unknown": sys_siglist[stop_signal]);
  2939.   
  2940. !   printf ("\nType \"info stack\" or \"info reg\" for more information.\n");
  2941.   }
  2942.   
  2943.   static void
  2944. --- 584,605 ----
  2945.   {
  2946.     if (inferior_pid == 0)
  2947.       {
  2948. !      printf_filtered ("The program being debugged is not being run.\n");
  2949.         return;
  2950.       }
  2951.   
  2952. !  printf_filtered ("Program being debugged is in process %d, stopped at 0x%x.\n",
  2953.         inferior_pid, stop_pc);
  2954.     if (stop_step)
  2955. !    printf_filtered ("It stopped after being stepped.\n");
  2956.     else if (stop_breakpoint)
  2957. !    printf_filtered ("It stopped at breakpoint %d.\n", stop_breakpoint);
  2958.     else if (stop_signal)
  2959. !    printf_filtered ("It stopped with signal %d (%s).\n",
  2960.           stop_signal,
  2961.           (stop_signal > NSIG)? "unknown": sys_siglist[stop_signal]);
  2962.   
  2963. !  printf_filtered ("\nType \"info stack\" or \"info reg\" for more information.\n");
  2964.   }
  2965.   
  2966.   static void
  2967. ***************
  2968. *** 590,604 ****
  2969.       {
  2970.         register char *val = get_in_environ (inferior_environ, var);
  2971.         if (val)
  2972. !     printf ("%s = %s\n", var, val);
  2973.         else
  2974. !     printf ("Environment variable \"%s\" not defined.\n", var);
  2975.       }
  2976.     else
  2977.       {
  2978.         register char **vector = environ_vector (inferior_environ);
  2979.         while (*vector)
  2980. !     printf ("%s\n", *vector++);
  2981.       }
  2982.   }
  2983.   
  2984. --- 610,624 ----
  2985.       {
  2986.         register char *val = get_in_environ (inferior_environ, var);
  2987.         if (val)
  2988. ! printf_filtered ("%s = %s\n", var, val);
  2989.         else
  2990. ! printf_filtered ("Environment variable \"%s\" not defined.\n", var);
  2991.       }
  2992.     else
  2993.       {
  2994.         register char **vector = environ_vector (inferior_environ);
  2995.         while (*vector)
  2996. ! printf_filtered ("%s\n", *vector++);
  2997.       }
  2998.   }
  2999.   
  3000. ***************
  3001. *** 654,660 ****
  3002.     var = savestring (arg, p - arg);
  3003.     if (nullset)
  3004.       {
  3005. !       printf ("Setting environment variable \"%s\" to null value.\n", var);
  3006.         set_in_environ (inferior_environ, var, "");
  3007.       }
  3008.     else
  3009. --- 674,680 ----
  3010.     var = savestring (arg, p - arg);
  3011.     if (nullset)
  3012.       {
  3013. !      printf_filtered ("Setting environment variable \"%s\" to null value.\n", var);
  3014.         set_in_environ (inferior_environ, var, "");
  3015.       }
  3016.     else
  3017. ***************
  3018. *** 745,751 ****
  3019.       }
  3020.       }
  3021.     else
  3022. !     printf ("Reg\tContents\n\n");
  3023.   
  3024.     for (i = 0; i < NUM_REGS; i++)
  3025.       {
  3026. --- 765,771 ----
  3027.       }
  3028.       }
  3029.     else
  3030. !    printf_filtered ("Reg\tContents\n\n");
  3031.   
  3032.     for (i = 0; i < NUM_REGS; i++)
  3033.       {
  3034. ***************
  3035. *** 760,766 ****
  3036.        so user can read the output.  */
  3037.         if (addr_exp == 0 && i > 0 && i % 16 == 0)
  3038.       {
  3039. !       printf ("--Type Return to print more--");
  3040.         fflush (stdout);
  3041.         read_line ();
  3042.       }
  3043. --- 780,786 ----
  3044.        so user can read the output.  */
  3045.         if (addr_exp == 0 && i > 0 && i % 16 == 0)
  3046.       {
  3047. !      printf_filtered ("--Type Return to print more--");
  3048.         fflush (stdout);
  3049.         read_line ();
  3050.       }
  3051. ***************
  3052. *** 769,788 ****
  3053.         read_relative_register_raw_bytes (i, raw_buffer);
  3054.         REGISTER_CONVERT_TO_VIRTUAL (i, raw_buffer, virtual_buffer);
  3055.   
  3056. !       printf ("%s\t", reg_names[i]);
  3057.   
  3058.         /* If virtual format is floating, print it that way.  */
  3059.         if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT
  3060.         && ! INVALID_FLOAT (virtual_buffer, REGISTER_VIRTUAL_SIZE (i)))
  3061.       val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, stdout, 0);
  3062. !       /* Else if virtual format is too long for printf,
  3063.        print in hex a byte at a time.  */
  3064.         else if (REGISTER_VIRTUAL_SIZE (i) > sizeof (long))
  3065.       {
  3066.         register int j;
  3067. !       printf ("0x");
  3068.         for (j = 0; j < REGISTER_VIRTUAL_SIZE (i); j++)
  3069. !         printf ("%02x", virtual_buffer[j]);
  3070.       }
  3071.         /* Else print as integer in hex and in decimal.  */
  3072.         else
  3073. --- 789,808 ----
  3074.         read_relative_register_raw_bytes (i, raw_buffer);
  3075.         REGISTER_CONVERT_TO_VIRTUAL (i, raw_buffer, virtual_buffer);
  3076.   
  3077. !      printf_filtered ("%s\t", reg_names[i]);
  3078.   
  3079.         /* If virtual format is floating, print it that way.  */
  3080.         if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT
  3081.         && ! INVALID_FLOAT (virtual_buffer, REGISTER_VIRTUAL_SIZE (i)))
  3082.       val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, stdout, 0);
  3083. !       /* Else if virtual format is too long forprintf_filtered,
  3084.        print in hex a byte at a time.  */
  3085.         else if (REGISTER_VIRTUAL_SIZE (i) > sizeof (long))
  3086.       {
  3087.         register int j;
  3088. !      printf_filtered ("0x");
  3089.         for (j = 0; j < REGISTER_VIRTUAL_SIZE (i); j++)
  3090. !        printf_filtered ("%02x", virtual_buffer[j]);
  3091.       }
  3092.         /* Else print as integer in hex and in decimal.  */
  3093.         else
  3094. ***************
  3095. *** 791,799 ****
  3096.   
  3097.         bcopy (virtual_buffer, &val, sizeof (long));
  3098.         if (val == 0)
  3099. !         printf ("0");
  3100.         else
  3101. !         printf ("0x%08x  %d", val, val);
  3102.       }
  3103.   
  3104.         /* If register has different raw and virtual formats,
  3105. --- 811,819 ----
  3106.   
  3107.         bcopy (virtual_buffer, &val, sizeof (long));
  3108.         if (val == 0)
  3109. !        printf_filtered ("0");
  3110.         else
  3111. !        printf_filtered ("0x%08x  %d", val, val);
  3112.       }
  3113.   
  3114.         /* If register has different raw and virtual formats,
  3115. ***************
  3116. *** 803,817 ****
  3117.       {
  3118.         register int j;
  3119.   
  3120. !       printf ("  (raw 0x");
  3121.         for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
  3122. !         printf ("%02x", raw_buffer[j]);
  3123. !       printf (")");
  3124.       }
  3125. !       printf ("\n");
  3126.       }
  3127.   
  3128. !   printf ("Contents are relative to selected stack frame.\n");
  3129.   }
  3130.   
  3131.   #ifdef ATTACH_DETACH
  3132. --- 823,837 ----
  3133.       {
  3134.         register int j;
  3135.   
  3136. !      printf_filtered ("  (raw 0x");
  3137.         for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
  3138. !        printf_filtered ("%02x", raw_buffer[j]);
  3139. !      printf_filtered (")");
  3140.       }
  3141. !      printf_filtered ("\n");
  3142.       }
  3143.   
  3144. !  printf_filtered ("Contents are relative to selected stack frame.\n");
  3145.   }
  3146.   
  3147.   #ifdef ATTACH_DETACH
  3148. ***************
  3149. *** 865,873 ****
  3150.     if (from_tty)
  3151.       {
  3152.         if (remote)
  3153. !     printf ("Attaching remote machine\n");
  3154.         else
  3155. !     printf ("Attaching program: %s pid %d\n",
  3156.           exec_file, pid);
  3157.         fflush (stdout);
  3158.       }
  3159. --- 885,893 ----
  3160.     if (from_tty)
  3161.       {
  3162.         if (remote)
  3163. ! printf_filtered ("Attaching remote machine\n");
  3164.         else
  3165. ! printf_filtered ("Attaching program: %s pid %d\n",
  3166.           exec_file, pid);
  3167.         fflush (stdout);
  3168.       }
  3169. ***************
  3170. *** 906,912 ****
  3171.         char *exec_file = (char *)get_exec_file (0);
  3172.         if (exec_file == 0)
  3173.       exec_file = "";
  3174. !       printf ("Detaching program: %s pid %d\n",
  3175.             exec_file, inferior_pid);
  3176.         fflush (stdout);
  3177.       }
  3178. --- 926,932 ----
  3179.         char *exec_file = (char *)get_exec_file (0);
  3180.         if (exec_file == 0)
  3181.       exec_file = "";
  3182. !      printf_filtered ("Detaching program: %s pid %d\n",
  3183.             exec_file, inferior_pid);
  3184.         fflush (stdout);
  3185.       }
  3186. *** 1.10    1991/10/05 20:10:26
  3187. --- m-atari.h    1992/01/14 20:06:02
  3188. ***************
  3189. *** 242,248 ****
  3190.   /* In the case of the Sun, the frame's nominal address
  3191.      is the address of a 4-byte word containing the calling frame's address.  */
  3192.   
  3193. ! #if 0
  3194.   #define FRAME_CHAIN(thisframe)  ( \
  3195.    (FRAME_SAVED_PC (thisframe) >= first_object_file_end) ? \
  3196.     read_memory_integer (thisframe, 4) : 0)
  3197. --- 242,248 ----
  3198.   /* In the case of the Sun, the frame's nominal address
  3199.      is the address of a 4-byte word containing the calling frame's address.  */
  3200.   
  3201. ! #if 1
  3202.   #define FRAME_CHAIN(thisframe)  ( \
  3203.    (FRAME_SAVED_PC (thisframe) >= first_object_file_end) ? \
  3204.     read_memory_integer (thisframe, 4) : 0)
  3205. *** 1.3    1991/09/15 06:01:22
  3206. --- m68k-pinsn.c    1992/01/14 20:06:03
  3207. ***************
  3208. *** 118,128 ****
  3209.     /* Handle undefined instructions.  */
  3210.     if (best < 0)
  3211.       {
  3212. !       fprintf (stream, "0%o", (buffer[0] << 8) + buffer[1]);
  3213.         return 2;
  3214.       }
  3215.   
  3216. !   fprintf (stream, "%s", m68k_opcodes[best].name);
  3217.   
  3218.     /* Point at first word of argument data,
  3219.        and at descriptor for first argument.  */
  3220. --- 118,128 ----
  3221.     /* Handle undefined instructions.  */
  3222.     if (best < 0)
  3223.       {
  3224. !       fprintf_filtered (stream, "0%o", (buffer[0] << 8) + buffer[1]);
  3225.         return 2;
  3226.       }
  3227.   
  3228. !   fprintf_filtered (stream, "%s", m68k_opcodes[best].name);
  3229.   
  3230.     /* Point at first word of argument data,
  3231.        and at descriptor for first argument.  */
  3232. ***************
  3233. *** 149,155 ****
  3234.     d = m68k_opcodes[best].args;
  3235.   
  3236.     if (*d)
  3237. !     fputc (' ', stream);
  3238.   
  3239.     while (*d)
  3240.       {
  3241. --- 149,155 ----
  3242.     d = m68k_opcodes[best].args;
  3243.   
  3244.     if (*d)
  3245. !     fputc_filtered (' ', stream);
  3246.   
  3247.     while (*d)
  3248.       {
  3249. ***************
  3250. *** 156,162 ****
  3251.         p = print_insn_arg (d, buffer, p, memaddr + p - buffer, stream);
  3252.         d += 2;
  3253.         if (*d && *(d - 2) != 'I' && *d != 'k')
  3254. !     fprintf (stream, ",");
  3255.       }
  3256.     return p - buffer;
  3257.   }
  3258. --- 156,162 ----
  3259.         p = print_insn_arg (d, buffer, p, memaddr + p - buffer, stream);
  3260.         d += 2;
  3261.         if (*d && *(d - 2) != 'I' && *d != 'k')
  3262. !     fprintf_filtered (stream, ",");
  3263.       }
  3264.     return p - buffer;
  3265.   }
  3266. ***************
  3267. *** 180,194 ****
  3268.     switch (*d)
  3269.       {
  3270.       case 'C':
  3271. !       fprintf (stream, "ccr");
  3272.         break;
  3273.   
  3274.       case 'S':
  3275. !       fprintf (stream, "sr");
  3276.         break;
  3277.   
  3278.       case 'U':
  3279. !       fprintf (stream, "usp");
  3280.         break;
  3281.   
  3282.       case 'J':
  3283. --- 180,194 ----
  3284.     switch (*d)
  3285.       {
  3286.       case 'C':
  3287. !       fprintf_filtered (stream, "ccr");
  3288.         break;
  3289.   
  3290.       case 'S':
  3291. !       fprintf_filtered (stream, "sr");
  3292.         break;
  3293.   
  3294.       case 'U':
  3295. !       fprintf_filtered (stream, "usp");
  3296.         break;
  3297.   
  3298.       case 'J':
  3299. ***************
  3300. *** 202,212 ****
  3301.       for (regno = sizeof names / sizeof names[0] - 1; regno >= 0; regno--)
  3302.         if (names[regno].value == val)
  3303.           {
  3304. !           fprintf (stream, names[regno].name);
  3305.             break;
  3306.           }
  3307.       if (regno < 0)
  3308. !       fprintf (stream, "%d", val);
  3309.         }
  3310.         break;
  3311.   
  3312. --- 202,212 ----
  3313.       for (regno = sizeof names / sizeof names[0] - 1; regno >= 0; regno--)
  3314.         if (names[regno].value == val)
  3315.           {
  3316. !           fprintf_filtered (stream, names[regno].name);
  3317.             break;
  3318.           }
  3319.       if (regno < 0)
  3320. !       fprintf_filtered (stream, "%d", val);
  3321.         }
  3322.         break;
  3323.   
  3324. ***************
  3325. *** 215,221 ****
  3326.         /* 0 means 8, except for the bkpt instruction... */
  3327.         if (val == 0 && d[1] != 's')
  3328.       val = 8;
  3329. !       fprintf (stream, "#%d", val);
  3330.         break;
  3331.   
  3332.       case 'M':
  3333. --- 215,221 ----
  3334.         /* 0 means 8, except for the bkpt instruction... */
  3335.         if (val == 0 && d[1] != 's')
  3336.       val = 8;
  3337. !       fprintf_filtered (stream, "#%d", val);
  3338.         break;
  3339.   
  3340.       case 'M':
  3341. ***************
  3342. *** 222,279 ****
  3343.         val = fetch_arg (buffer, place, 8);
  3344.         if (val & 0x80)
  3345.       val = val - 0x100;
  3346. !       fprintf (stream, "#%d", val);
  3347.         break;
  3348.   
  3349.       case 'T':
  3350.         val = fetch_arg (buffer, place, 4);
  3351. !       fprintf (stream, "#%d", val);
  3352.         break;
  3353.   
  3354.       case 'D':
  3355. !       fprintf (stream, "%s", reg_names[fetch_arg (buffer, place, 3)]);
  3356.         break;
  3357.   
  3358.       case 'A':
  3359. !       fprintf (stream, "%s",
  3360.               reg_names[fetch_arg (buffer, place, 3) + 010]);
  3361.         break;
  3362.   
  3363.       case 'R':
  3364. !       fprintf (stream, "%s", reg_names[fetch_arg (buffer, place, 4)]);
  3365.         break;
  3366.   
  3367.       case 'F':
  3368. !       fprintf (stream, "fp%d", fetch_arg (buffer, place, 3));
  3369.         break;
  3370.   
  3371.       case 'O':
  3372.         val = fetch_arg (buffer, place, 6);
  3373.         if (val & 0x20)
  3374. !     fprintf (stream, "%s", reg_names [val & 7]);
  3375.         else
  3376. !     fprintf (stream, "%d", val);
  3377.         break;
  3378.   
  3379.       case '+':
  3380. !       fprintf (stream, "%s@+",
  3381.               reg_names[fetch_arg (buffer, place, 3) + 8]);
  3382.         break;
  3383.   
  3384.       case '-':
  3385. !       fprintf (stream, "%s@-",
  3386.              reg_names[fetch_arg (buffer, place, 3) + 8]);
  3387.         break;
  3388.   
  3389.       case 'k':
  3390.         if (place == 'k')
  3391. !     fprintf (stream, "{%s}", reg_names[fetch_arg (buffer, place, 3)]);
  3392.         else if (place == 'C')
  3393.       {
  3394.         val = fetch_arg (buffer, place, 7);
  3395.         if ( val > 63 )        /* This is a signed constant. */
  3396.           val -= 128;
  3397. !       fprintf (stream, "{#%d}", val);
  3398.       }
  3399.         else
  3400.       error ("Invalid arg format in opcode table: \"%c%c\".",
  3401. --- 222,279 ----
  3402.         val = fetch_arg (buffer, place, 8);
  3403.         if (val & 0x80)
  3404.       val = val - 0x100;
  3405. !       fprintf_filtered (stream, "#%d", val);
  3406.         break;
  3407.   
  3408.       case 'T':
  3409.         val = fetch_arg (buffer, place, 4);
  3410. !       fprintf_filtered (stream, "#%d", val);
  3411.         break;
  3412.   
  3413.       case 'D':
  3414. !       fprintf_filtered (stream, "%s", reg_names[fetch_arg (buffer, place, 3)]);
  3415.         break;
  3416.   
  3417.       case 'A':
  3418. !       fprintf_filtered (stream, "%s",
  3419.               reg_names[fetch_arg (buffer, place, 3) + 010]);
  3420.         break;
  3421.   
  3422.       case 'R':
  3423. !       fprintf_filtered (stream, "%s", reg_names[fetch_arg (buffer, place, 4)]);
  3424.         break;
  3425.   
  3426.       case 'F':
  3427. !       fprintf_filtered (stream, "fp%d", fetch_arg (buffer, place, 3));
  3428.         break;
  3429.   
  3430.       case 'O':
  3431.         val = fetch_arg (buffer, place, 6);
  3432.         if (val & 0x20)
  3433. !     fprintf_filtered (stream, "%s", reg_names [val & 7]);
  3434.         else
  3435. !     fprintf_filtered (stream, "%d", val);
  3436.         break;
  3437.   
  3438.       case '+':
  3439. !       fprintf_filtered (stream, "%s@+",
  3440.               reg_names[fetch_arg (buffer, place, 3) + 8]);
  3441.         break;
  3442.   
  3443.       case '-':
  3444. !       fprintf_filtered (stream, "%s@-",
  3445.              reg_names[fetch_arg (buffer, place, 3) + 8]);
  3446.         break;
  3447.   
  3448.       case 'k':
  3449.         if (place == 'k')
  3450. !     fprintf_filtered (stream, "{%s}", reg_names[fetch_arg (buffer, place, 3)]);
  3451.         else if (place == 'C')
  3452.       {
  3453.         val = fetch_arg (buffer, place, 7);
  3454.         if ( val > 63 )        /* This is a signed constant. */
  3455.           val -= 128;
  3456. !       fprintf_filtered (stream, "{#%d}", val);
  3457.       }
  3458.         else
  3459.       error ("Invalid arg format in opcode table: \"%c%c\".",
  3460. ***************
  3461. *** 300,306 ****
  3462.         else
  3463.       error ("Invalid arg format in opcode table: \"%c%c\".",
  3464.              *d, place);
  3465. !       fprintf (stream, "#%d", val);
  3466.         break;
  3467.   
  3468.       case 'B':
  3469. --- 300,306 ----
  3470.         else
  3471.       error ("Invalid arg format in opcode table: \"%c%c\".",
  3472.              *d, place);
  3473. !       fprintf_filtered (stream, "#%d", val);
  3474.         break;
  3475.   
  3476.       case 'B':
  3477. ***************
  3478. *** 334,345 ****
  3479.   
  3480.       case 'd':
  3481.         val = NEXTWORD (p);
  3482. !       fprintf (stream, "%s@(%d)",
  3483.               reg_names[fetch_arg (buffer, place, 3)], val);
  3484.         break;
  3485.   
  3486.       case 's':
  3487. !       fprintf (stream, "%s",
  3488.               fpcr_names[fetch_arg (buffer, place, 3)]);
  3489.         break;
  3490.   
  3491. --- 334,345 ----
  3492.   
  3493.       case 'd':
  3494.         val = NEXTWORD (p);
  3495. !       fprintf_filtered (stream, "%s@(%d)",
  3496.               reg_names[fetch_arg (buffer, place, 3)], val);
  3497.         break;
  3498.   
  3499.       case 's':
  3500. !       fprintf_filtered (stream, "%s",
  3501.               fpcr_names[fetch_arg (buffer, place, 3)]);
  3502.         break;
  3503.   
  3504. ***************
  3505. *** 346,352 ****
  3506.       case 'I':
  3507.         val = fetch_arg (buffer, 'd', 3);          /* Get coprocessor ID... */
  3508.         if (val != 1)                /* Unusual coprocessor ID? */
  3509. !     fprintf (stream, "(cpid=%d) ", val);
  3510.         if (place == 'i')
  3511.       p += 2;                 /* Skip coprocessor extended operands */
  3512.         break;
  3513. --- 346,352 ----
  3514.       case 'I':
  3515.         val = fetch_arg (buffer, 'd', 3);          /* Get coprocessor ID... */
  3516.         if (val != 1)                /* Unusual coprocessor ID? */
  3517. !     fprintf_filtered (stream, "(cpid=%d) ", val);
  3518.         if (place == 'i')
  3519.       p += 2;                 /* Skip coprocessor extended operands */
  3520.         break;
  3521. ***************
  3522. *** 376,403 ****
  3523.         switch (val >> 3)
  3524.       {
  3525.       case 0:
  3526. !       fprintf (stream, "%s", reg_names[val]);
  3527.         break;
  3528.   
  3529.       case 1:
  3530. !       fprintf (stream, "%s", regname);
  3531.         break;
  3532.   
  3533.       case 2:
  3534. !       fprintf (stream, "%s@", regname);
  3535.         break;
  3536.   
  3537.       case 3:
  3538. !       fprintf (stream, "%s@+", regname);
  3539.         break;
  3540.   
  3541.       case 4:
  3542. !       fprintf (stream, "%s@-", regname);
  3543.         break;
  3544.   
  3545.       case 5:
  3546.         val = NEXTWORD (p);
  3547. !       fprintf (stream, "%s@(%d)", regname, val);
  3548.         break;
  3549.     
  3550.       case 6:
  3551. --- 376,403 ----
  3552.         switch (val >> 3)
  3553.       {
  3554.       case 0:
  3555. !       fprintf_filtered (stream, "%s", reg_names[val]);
  3556.         break;
  3557.   
  3558.       case 1:
  3559. !       fprintf_filtered (stream, "%s", regname);
  3560.         break;
  3561.   
  3562.       case 2:
  3563. !       fprintf_filtered (stream, "%s@", regname);
  3564.         break;
  3565.   
  3566.       case 3:
  3567. !       fprintf_filtered (stream, "%s@+", regname);
  3568.         break;
  3569.   
  3570.       case 4:
  3571. !       fprintf_filtered (stream, "%s@-", regname);
  3572.         break;
  3573.   
  3574.       case 5:
  3575.         val = NEXTWORD (p);
  3576. !       fprintf_filtered (stream, "%s@(%d)", regname, val);
  3577.         break;
  3578.     
  3579.       case 6:
  3580. ***************
  3581. *** 409,421 ****
  3582.           {
  3583.           case 0:
  3584.             val = NEXTWORD (p);
  3585. !           fprintf (stream, "@#");
  3586.             print_address (val, stream);
  3587.             break;
  3588.   
  3589.           case 1:
  3590.             val = NEXTLONG (p);
  3591. !           fprintf (stream, "@#");
  3592.             print_address (val, stream);
  3593.             break;
  3594.   
  3595. --- 409,421 ----
  3596.           {
  3597.           case 0:
  3598.             val = NEXTWORD (p);
  3599. !           fprintf_filtered (stream, "@#");
  3600.             print_address (val, stream);
  3601.             break;
  3602.   
  3603.           case 1:
  3604.             val = NEXTLONG (p);
  3605. !           fprintf_filtered (stream, "@#");
  3606.             print_address (val, stream);
  3607.             break;
  3608.   
  3609. ***************
  3610. *** 468,480 ****
  3611.                  *d, place);
  3612.             }
  3613.             if ( flt_p )    /* Print a float? */
  3614. !         fprintf (stream, "#%g", flval);
  3615.             else
  3616. !         fprintf (stream, "#%d", val);
  3617.             break;
  3618.   
  3619.           default:
  3620. !           fprintf (stream, "<invalid address mode 0%o>", val);
  3621.           }
  3622.       }
  3623.         break;
  3624. --- 468,480 ----
  3625.                  *d, place);
  3626.             }
  3627.             if ( flt_p )    /* Print a float? */
  3628. !         fprintf_filtered (stream, "#%g", flval);
  3629.             else
  3630. !         fprintf_filtered (stream, "#%d", val);
  3631.             break;
  3632.   
  3633.           default:
  3634. !           fprintf_filtered (stream, "<invalid address mode 0%o>", val);
  3635.           }
  3636.       }
  3637.         break;
  3638. ***************
  3639. *** 491,497 ****
  3640.           p = p1 > p ? p1 : p;
  3641.           if (val == 0)
  3642.             {
  3643. !         fputs ("#0", stream);
  3644.           break;
  3645.             }
  3646.           if (*d == 'l')
  3647. --- 491,497 ----
  3648.           p = p1 > p ? p1 : p;
  3649.           if (val == 0)
  3650.             {
  3651. !         fputs_filtered ("#0", stream);
  3652.           break;
  3653.             }
  3654.           if (*d == 'l')
  3655. ***************
  3656. *** 509,522 ****
  3657.           {
  3658.             int first_regno;
  3659.             if (doneany)
  3660. !             fputs ("/", stream);
  3661.             doneany = 1;
  3662. !           fprintf (stream, "%s", reg_names[regno]);
  3663.             first_regno = regno;
  3664.             while (val & (1 << (regno + 1)))
  3665.               ++regno;
  3666.             if (regno > first_regno)
  3667. !             fprintf (stream, "-%s", reg_names[regno]);
  3668.           }
  3669.         }
  3670.       else if (place == '3')
  3671. --- 509,522 ----
  3672.           {
  3673.             int first_regno;
  3674.             if (doneany)
  3675. !             fputs_filtered ("/", stream);
  3676.             doneany = 1;
  3677. !           fprintf_filtered (stream, "%s", reg_names[regno]);
  3678.             first_regno = regno;
  3679.             while (val & (1 << (regno + 1)))
  3680.               ++regno;
  3681.             if (regno > first_regno)
  3682. !             fprintf_filtered (stream, "-%s", reg_names[regno]);
  3683.           }
  3684.         }
  3685.       else if (place == '3')
  3686. ***************
  3687. *** 526,532 ****
  3688.           val = fetch_arg (buffer, place, 8);
  3689.           if (val == 0)
  3690.             {
  3691. !         fputs ("#0", stream);
  3692.           break;
  3693.             }
  3694.           if (*d == 'l')
  3695. --- 526,532 ----
  3696.           val = fetch_arg (buffer, place, 8);
  3697.           if (val == 0)
  3698.             {
  3699. !         fputs_filtered ("#0", stream);
  3700.           break;
  3701.             }
  3702.           if (*d == 'l')
  3703. ***************
  3704. *** 544,557 ****
  3705.           {
  3706.             int first_regno;
  3707.             if (doneany)
  3708. !             fputs ("/", stream);
  3709.             doneany = 1;
  3710. !           fprintf (stream, "fp%d", regno);
  3711.             first_regno = regno;
  3712.             while (val & (1 << (regno + 1)))
  3713.               ++regno;
  3714.             if (regno > first_regno)
  3715. !             fprintf (stream, "-fp%d", regno);
  3716.           }
  3717.         }
  3718.       else
  3719. --- 544,557 ----
  3720.           {
  3721.             int first_regno;
  3722.             if (doneany)
  3723. !             fputs_filtered ("/", stream);
  3724.             doneany = 1;
  3725. !           fprintf_filtered (stream, "fp%d", regno);
  3726.             first_regno = regno;
  3727.             while (val & (1 << (regno + 1)))
  3728.               ++regno;
  3729.             if (regno > first_regno)
  3730. !             fprintf_filtered (stream, "-fp%d", regno);
  3731.           }
  3732.         }
  3733.       else
  3734. ***************
  3735. *** 686,692 ****
  3736.   
  3737.     /* Generate the text for the index register.
  3738.        Where this will be output is not yet determined.  */
  3739. !   sprintf (buf, "[%s.%c%s]",
  3740.          reg_names[(word >> 12) & 0xf],
  3741.          (word & 0x800) ? 'l' : 'w',
  3742.          scales[(word >> 9) & 3]);
  3743. --- 686,692 ----
  3744.   
  3745.     /* Generate the text for the index register.
  3746.        Where this will be output is not yet determined.  */
  3747. !   printf_filtered (buf, "[%s.%c%s]",
  3748.          reg_names[(word >> 12) & 0xf],
  3749.          (word & 0x800) ? 'l' : 'w',
  3750.          scales[(word >> 9) & 3]);
  3751. ***************
  3752. *** 699,705 ****
  3753.             ((word & 0x80) ? word | 0xff00 : word & 0xff)
  3754.             + ((basereg == -1) ? addr : 0),
  3755.             stream);
  3756. !       fputs (buf, stream);
  3757.         return p;
  3758.       }
  3759.   
  3760. --- 699,705 ----
  3761.             ((word & 0x80) ? word | 0xff00 : word & 0xff)
  3762.             + ((basereg == -1) ? addr : 0),
  3763.             stream);
  3764. !       fputs_filtered (buf, stream);
  3765.         return p;
  3766.       }
  3767.   
  3768. ***************
  3769. *** 727,733 ****
  3770.     if ((word & 7) == 0)
  3771.       {
  3772.         print_base (basereg, base_disp, stream);
  3773. !       fputs (buf, stream);
  3774.         return p;
  3775.       }
  3776.   
  3777. --- 727,733 ----
  3778.     if ((word & 7) == 0)
  3779.       {
  3780.         print_base (basereg, base_disp, stream);
  3781. !       fputs_filtered (buf, stream);
  3782.         return p;
  3783.       }
  3784.   
  3785. ***************
  3786. *** 743,757 ****
  3787.         outer_disp = NEXTLONG (p);
  3788.       }
  3789.   
  3790. !   fprintf (stream, "%d(", outer_disp);
  3791.     print_base (basereg, base_disp, stream);
  3792.   
  3793.     /* If postindexed, print the closeparen before the index.  */
  3794.     if (word & 4)
  3795. !     fprintf (stream, ")%s", buf);
  3796.     /* If preindexed, print the closeparen after the index.  */
  3797.     else
  3798. !     fprintf (stream, "%s)", buf);
  3799.   
  3800.     return p;
  3801.   }
  3802. --- 743,757 ----
  3803.         outer_disp = NEXTLONG (p);
  3804.       }
  3805.   
  3806. !   fprintf_filtered (stream, "%d(", outer_disp);
  3807.     print_base (basereg, base_disp, stream);
  3808.   
  3809.     /* If postindexed, print the closeparen before the index.  */
  3810.     if (word & 4)
  3811. !     fprintf_filtered (stream, ")%s", buf);
  3812.     /* If preindexed, print the closeparen after the index.  */
  3813.     else
  3814. !     fprintf_filtered (stream, "%s)", buf);
  3815.   
  3816.     return p;
  3817.   }
  3818. ***************
  3819. *** 766,776 ****
  3820.        FILE *stream;
  3821.   {
  3822.     if (regno == -2)
  3823. !     fprintf (stream, "%d", disp);
  3824.     else if (regno == -1)
  3825. !     fprintf (stream, "0x%x", disp);
  3826.     else
  3827. !     fprintf (stream, "%d(%s)", disp, reg_names[regno]);
  3828.   }
  3829.   
  3830.   #ifdef _M68881
  3831. --- 766,776 ----
  3832.        FILE *stream;
  3833.   {
  3834.     if (regno == -2)
  3835. !     fprintf_filtered (stream, "%d", disp);
  3836.     else if (regno == -1)
  3837. !     fprintf_filtered (stream, "0x%x", disp);
  3838.     else
  3839. !     fprintf_filtered (stream, "%d(%s)", disp, reg_names[regno]);
  3840.   }
  3841.   
  3842.   #ifdef _M68881
  3843. *** 1.4    1991/09/14 19:34:34
  3844. --- main.c    1992/01/14 20:06:04
  3845. ***************
  3846. *** 85,90 ****
  3847. --- 85,98 ----
  3848.   static void source_command ();
  3849.   void print_gdb_version ();
  3850.   
  3851. + #ifdef atarist
  3852. + static void Save_all_vectors();
  3853. + static void Restore_all_vectors();
  3854. + static volatile FILE *atari_logfile;
  3855. + extern int gcc_mshort;
  3856. + #endif
  3857. + void really_exit();
  3858.   /* gdb prints this when reading a command interactively */
  3859.   static char *prompt;
  3860.   
  3861. ***************
  3862. *** 129,135 ****
  3863.       val = (*func) (arg);
  3864.     else
  3865.       {
  3866. !       fprintf (stderr, "%s\n", errstring);
  3867.         val = 0;
  3868.       }
  3869.   
  3870. --- 137,143 ----
  3871.       val = (*func) (arg);
  3872.     else
  3873.       {
  3874. !       fprintf_filtered (stderr, "%s\n", errstring);
  3875.         val = 0;
  3876.       }
  3877.   
  3878. ***************
  3879. *** 163,169 ****
  3880.     linesize = 100;
  3881.     line = (char *) xmalloc (linesize);
  3882.     instream = stdin;
  3883.     getwd (dirbuf);
  3884.   #ifdef atarist
  3885.   #ifndef JRDLIB
  3886. --- 171,178 ----
  3887.     linesize = 100;
  3888.     line = (char *) xmalloc (linesize);
  3889.     instream = stdin;
  3890. !   atari_logfile = 0;
  3891. !   
  3892.     getwd (dirbuf);
  3893.   #ifdef atarist
  3894.   #ifndef JRDLIB
  3895. ***************
  3896. *** 206,212 ****
  3897.       frame_file_full_name = 1;
  3898.   #ifdef atarist
  3899.         else if (!strcmp(argv[i], "-D"))
  3900. !       atari_debug = 1;
  3901.   #endif      
  3902.         else if (argv[i][0] == '-')
  3903.       i++;
  3904. --- 215,235 ----
  3905.       frame_file_full_name = 1;
  3906.   #ifdef atarist
  3907.         else if (!strcmp(argv[i], "-D"))
  3908. !       atari_debug++;
  3909. !       else if (!strcmp(argv[i], "-mshort"))
  3910. !       gcc_mshort = 1;
  3911. !       else if (!strcmp(argv[i], "-L"))
  3912. !       {
  3913. !       
  3914. !       if(!atari_logfile)
  3915. !       {
  3916. !           if(!(atari_logfile = fopen("gdb.log", "at")))
  3917. !           {
  3918. !           fprintf_filtered(stderr,"Failed to open logfile gdb.log\n");
  3919. !           exit(1);
  3920. !           }
  3921. !       }
  3922. !       }
  3923.   #endif      
  3924.         else if (argv[i][0] == '-')
  3925.       i++;
  3926. ***************
  3927. *** 214,219 ****
  3928. --- 237,245 ----
  3929.   
  3930.     /* Run the init function of each source file */
  3931.   
  3932. + #ifdef atarist
  3933. +   Save_all_vectors();        /* save all exception vectors */
  3934. + #endif
  3935.     initialize_all_files ();
  3936.     initialize_main ();        /* But that omits this file!  Do it now */
  3937.   
  3938. ***************
  3939. *** 242,247 ****
  3940. --- 268,275 ----
  3941.             || !strcmp (arg, "-fullname")
  3942.   #ifdef atarist
  3943.             || !strcmp (arg, "-D")
  3944. +           || !strcmp (arg, "-mshort")
  3945. +           || !strcmp (arg, "-L")
  3946.   #endif
  3947.             )
  3948.           /* Already processed above */
  3949. ***************
  3950. *** 248,254 ****
  3951.           continue;
  3952.   
  3953.         if (++i == argc)
  3954. !         fprintf (stderr, "No argument follows \"%s\".\n", arg);
  3955.         if (!setjmp (to_top_level))
  3956.           {
  3957.             /* -s foo: get syms from foo.  -e foo: execute foo.
  3958. --- 276,282 ----
  3959.           continue;
  3960.   
  3961.         if (++i == argc)
  3962. !         fprintf_filtered (stderr, "No argument follows \"%s\".\n", arg);
  3963.         if (!setjmp (to_top_level))
  3964.           {
  3965.             /* -s foo: get syms from foo.  -e foo: execute foo.
  3966. ***************
  3967. *** 310,316 ****
  3968.           break;
  3969.   
  3970.             case 3:
  3971. !         fprintf (stderr, "Excess command line args ignored. (%s%s)\n",
  3972.                arg, (i == argc - 1) ? "" : " ...");
  3973.             }
  3974.       }
  3975. --- 338,344 ----
  3976.           break;
  3977.   
  3978.             case 3:
  3979. !         fprintf_filtered (stderr, "Excess command line args ignored. (%s%s)\n",
  3980.                arg, (i == argc - 1) ? "" : " ...");
  3981.             }
  3982.       }
  3983. ***************
  3984. *** 341,347 ****
  3985.       fatal ("Attempt to read commands from stdin in batch mode.");
  3986.   
  3987.     if (!quiet)
  3988. !     printf ("Type \"help\" for a list of commands.\n");
  3989.   
  3990.     /* The command loop.  */
  3991.   
  3992. --- 369,375 ----
  3993.       fatal ("Attempt to read commands from stdin in batch mode.");
  3994.   
  3995.     if (!quiet)
  3996. !    printf_filtered ("Type \"help\" for a list of commands.\n");
  3997.   
  3998.     /* The command loop.  */
  3999.   
  4000. ***************
  4001. *** 351,356 ****
  4002. --- 379,385 ----
  4003.       command_loop ();
  4004.         clearerr (stdin);        /* Don't get hung if C-d is typed.  */
  4005.       }
  4006. +   really_exit(0);
  4007.   }
  4008.   
  4009.   /* Execute the line P as a command.
  4010. ***************
  4011. *** 405,411 ****
  4012.     while (!feof (instream))
  4013.       {
  4014.         if (instream == stdin)
  4015. !     printf ("%s", prompt);
  4016.         fflush (stdout);
  4017.   
  4018.         if (window_hook && instream == stdin)
  4019. --- 434,440 ----
  4020.     while (!feof (instream))
  4021.       {
  4022.         if (instream == stdin)
  4023. !       printf_filtered ("%s", prompt);
  4024.         fflush (stdout);
  4025.   
  4026.         if (window_hook && instream == stdin)
  4027. ***************
  4028. *** 432,438 ****
  4029.     kill (getpid (), SIGTSTP);
  4030.   #endif
  4031.     signal (SIGTSTP, stop_sig);
  4032. !   printf ("%s", prompt);
  4033.     fflush (stdout);
  4034.   
  4035.     /* Forget about any previous command -- null line now will do nothing.  */
  4036. --- 461,467 ----
  4037.     kill (getpid (), SIGTSTP);
  4038.   #endif
  4039.     signal (SIGTSTP, stop_sig);
  4040. !  printf_filtered ("%s", prompt);
  4041.     fflush (stdout);
  4042.   
  4043.     /* Forget about any previous command -- null line now will do nothing.  */
  4044. ***************
  4045. *** 502,512 ****
  4046.     signal (SIGTSTP, SIG_DFL);
  4047.   #endif
  4048.     immediate_quit--;
  4049.     /* If we just got an empty line, and that is supposed
  4050.        to repeat the previous command, leave the last input unchanged.  */
  4051.     if (p == line && repeat)
  4052. !     return line;
  4053.   
  4054.     /* If line is a comment, clear it out.  */
  4055.     p1 = line;
  4056. --- 531,547 ----
  4057.     signal (SIGTSTP, SIG_DFL);
  4058.   #endif
  4059.     immediate_quit--;
  4060. !   
  4061.     /* If we just got an empty line, and that is supposed
  4062.        to repeat the previous command, leave the last input unchanged.  */
  4063.     if (p == line && repeat)
  4064. !   {
  4065. !       if(atari_logfile)
  4066. !       {
  4067. !       fprintf(atari_logfile, "%s\n", line);
  4068. !       }
  4069. !       return line;
  4070. !   }
  4071.   
  4072.     /* If line is a comment, clear it out.  */
  4073.     p1 = line;
  4074. ***************
  4075. *** 516,521 ****
  4076. --- 551,561 ----
  4077.   
  4078.     *p = 0;
  4079.   
  4080. +   if(atari_logfile)
  4081. +   {
  4082. +       fprintf(atari_logfile, "%s\n", line);
  4083. +   }
  4084. +   
  4085.     return line;
  4086.   }
  4087.   
  4088. ***************
  4089. *** 618,624 ****
  4090.   static void
  4091.   info_command ()
  4092.   {
  4093. !   printf ("\"info\" must be followed by the name of an info command.\n");
  4094.     help_cmd (0, infolist, "info ", -1, stdout);
  4095.   }
  4096.   
  4097. --- 658,664 ----
  4098.   static void
  4099.   info_command ()
  4100.   {
  4101. !  printf_filtered ("\"info\" must be followed by the name of an info command.\n");
  4102.     help_cmd (0, infolist, "info ", -1, stdout);
  4103.   }
  4104.   
  4105. ***************
  4106. *** 705,711 ****
  4107.       }
  4108.   
  4109.     if (from_tty)
  4110. !     printf ("Type commands for definition of \"%s\".\n\
  4111.   End with a line saying just \"end\".\n", comname);
  4112.   
  4113.     comname = savestring (comname, strlen (comname));
  4114. --- 745,751 ----
  4115.       }
  4116.   
  4117.     if (from_tty)
  4118. !    printf_filtered ("Type commands for definition of \"%s\".\n\
  4119.   End with a line saying just \"end\".\n", comname);
  4120.   
  4121.     comname = savestring (comname, strlen (comname));
  4122. ***************
  4123. *** 737,743 ****
  4124.       error ("Command \"%s\" is built-in.", comname);
  4125.   
  4126.     if (from_tty)
  4127. !     printf ("Type documentation for \"%s\".\n\
  4128.   End with a line saying just \"end\".\n", comname);
  4129.   
  4130.     doclines = read_command_lines ();
  4131. --- 777,783 ----
  4132.       error ("Command \"%s\" is built-in.", comname);
  4133.   
  4134.     if (from_tty)
  4135. !    printf_filtered ("Type documentation for \"%s\".\n\
  4136.   End with a line saying just \"end\".\n", comname);
  4137.   
  4138.     doclines = read_command_lines ();
  4139. ***************
  4140. *** 769,775 ****
  4141.   copying_info ()
  4142.   {
  4143.     immediate_quit++;
  4144. !   printf ("            GDB GENERAL PUBLIC LICENSE\n\
  4145.               (Clarified 11 Feb 1988)\n\
  4146.   \n\
  4147.    Copyright (C) 1988 Richard M. Stallman\n\
  4148. --- 809,815 ----
  4149.   copying_info ()
  4150.   {
  4151.     immediate_quit++;
  4152. !  printf_filtered ("            GDB GENERAL PUBLIC LICENSE\n\
  4153.               (Clarified 11 Feb 1988)\n\
  4154.   \n\
  4155.    Copyright (C) 1988 Richard M. Stallman\n\
  4156. ***************
  4157. *** 792,798 ****
  4158.     fflush (stdout);
  4159.     read_line ();
  4160.   
  4161. !   printf ("\
  4162.     To make sure that everyone has such rights, we have to forbid you to\n\
  4163.   deprive anyone else of these rights.  For example, if you distribute\n\
  4164.   copies of GDB, you must give the recipients all the rights that you\n\
  4165. --- 832,838 ----
  4166.     fflush (stdout);
  4167.     read_line ();
  4168.   
  4169. !  printf_filtered ("\
  4170.     To make sure that everyone has such rights, we have to forbid you to\n\
  4171.   deprive anyone else of these rights.  For example, if you distribute\n\
  4172.   copies of GDB, you must give the recipients all the rights that you\n\
  4173. ***************
  4174. *** 812,818 ****
  4175.     fflush (stdout);
  4176.     read_line ();
  4177.   
  4178. !   printf ("\
  4179.               COPYING POLICIES\n\
  4180.   \n\
  4181.     1. You may copy and distribute verbatim copies of GDB source code as\n\
  4182. --- 852,858 ----
  4183.     fflush (stdout);
  4184.     read_line ();
  4185.   
  4186. !  printf_filtered ("\
  4187.               COPYING POLICIES\n\
  4188.   \n\
  4189.     1. You may copy and distribute verbatim copies of GDB source code as\n\
  4190. ***************
  4191. *** 835,841 ****
  4192.     fflush (stdout);
  4193.     read_line ();
  4194.   
  4195. !   printf ("\
  4196.       b) cause the whole of any work that you distribute or publish,\n\
  4197.       that in whole or in part contains or is a derivative of GDB\n\
  4198.       or any part thereof, to be licensed to all third parties on terms\n\
  4199. --- 875,881 ----
  4200.     fflush (stdout);
  4201.     read_line ();
  4202.   
  4203. !  printf_filtered ("\
  4204.       b) cause the whole of any work that you distribute or publish,\n\
  4205.       that in whole or in part contains or is a derivative of GDB\n\
  4206.       or any part thereof, to be licensed to all third parties on terms\n\
  4207. ***************
  4208. *** 843,849 ****
  4209.       you may choose to grant more extensive warranty protection to some\n\
  4210.       or all third parties, at your option).\n\
  4211.   \n");
  4212. !   printf ("\
  4213.       c) if the modified program serves as a debugger, cause it\n\
  4214.       when started running in the simplest and usual way, to print\n\
  4215.       an announcement including a valid copyright notice\n\
  4216. --- 883,889 ----
  4217.       you may choose to grant more extensive warranty protection to some\n\
  4218.       or all third parties, at your option).\n\
  4219.   \n");
  4220. !  printf_filtered ("\
  4221.       c) if the modified program serves as a debugger, cause it\n\
  4222.       when started running in the simplest and usual way, to print\n\
  4223.       an announcement including a valid copyright notice\n\
  4224. ***************
  4225. *** 864,870 ****
  4226.     fflush (stdout);
  4227.     read_line ();
  4228.   
  4229. !   printf ("\
  4230.     3. You may copy and distribute GDB (or a portion or derivative of it,\n\
  4231.   under Paragraph 2) in object code or executable form under the terms of\n\
  4232.   Paragraphs 1 and 2 above provided that you also do one of the following:\n\
  4233. --- 904,910 ----
  4234.     fflush (stdout);
  4235.     read_line ();
  4236.   
  4237. !  printf_filtered ("\
  4238.     3. You may copy and distribute GDB (or a portion or derivative of it,\n\
  4239.   under Paragraph 2) in object code or executable form under the terms of\n\
  4240.   Paragraphs 1 and 2 above provided that you also do one of the following:\n\
  4241. ***************
  4242. *** 879,885 ****
  4243.       corresponding source code, to be distributed under the terms of\n\
  4244.       Paragraphs 1 and 2 above; or,\n\n");
  4245.   
  4246. !   printf ("\
  4247.       c) accompany it with the information you received as to where the\n\
  4248.       corresponding source code may be obtained.  (This alternative is\n\
  4249.       allowed only for noncommercial distribution and only if you\n\
  4250. --- 919,925 ----
  4251.       corresponding source code, to be distributed under the terms of\n\
  4252.       Paragraphs 1 and 2 above; or,\n\n");
  4253.   
  4254. !  printf_filtered ("\
  4255.       c) accompany it with the information you received as to where the\n\
  4256.       corresponding source code may be obtained.  (This alternative is\n\
  4257.       allowed only for noncommercial distribution and only if you\n\
  4258. ***************
  4259. *** 893,899 ****
  4260.     fflush (stdout);
  4261.     read_line ();
  4262.   
  4263. !   printf ("\
  4264.     4. You may not copy, sublicense, distribute or transfer GDB\n\
  4265.   except as expressly provided under this License Agreement.  Any attempt\n\
  4266.   otherwise to copy, sublicense, distribute or transfer GDB is void and\n\
  4267. --- 933,939 ----
  4268.     fflush (stdout);
  4269.     read_line ();
  4270.   
  4271. !  printf_filtered ("\
  4272.     4. You may not copy, sublicense, distribute or transfer GDB\n\
  4273.   except as expressly provided under this License Agreement.  Any attempt\n\
  4274.   otherwise to copy, sublicense, distribute or transfer GDB is void and\n\
  4275. ***************
  4276. *** 920,926 ****
  4277.   warranty_info ()
  4278.   {
  4279.     immediate_quit++;
  4280. !   printf ("             NO WARRANTY\n\
  4281.   \n\
  4282.     BECAUSE GDB IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY NO\n\
  4283.   WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT\n\
  4284. --- 960,966 ----
  4285.   warranty_info ()
  4286.   {
  4287.     immediate_quit++;
  4288. !  printf_filtered ("             NO WARRANTY\n\
  4289.   \n\
  4290.     BECAUSE GDB IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY NO\n\
  4291.   WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT\n\
  4292. ***************
  4293. *** 932,938 ****
  4294.   PERFORMANCE OF GDB IS WITH YOU.  SHOULD GDB PROVE DEFECTIVE, YOU\n\
  4295.   ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n");
  4296.   
  4297. !   printf ("\
  4298.    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.\n\
  4299.   STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY\n\
  4300.   WHO MAY MODIFY AND REDISTRIBUTE GDB, BE LIABLE TO\n\
  4301. --- 972,978 ----
  4302.   PERFORMANCE OF GDB IS WITH YOU.  SHOULD GDB PROVE DEFECTIVE, YOU\n\
  4303.   ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n");
  4304.   
  4305. !  printf_filtered ("\
  4306.    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.\n\
  4307.   STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY\n\
  4308.   WHO MAY MODIFY AND REDISTRIBUTE GDB, BE LIABLE TO\n\
  4309. ***************
  4310. *** 949,955 ****
  4311.   static void
  4312.   print_gdb_version ()
  4313.   {
  4314. !   printf ("GDB %s, Copyright (C) 1988 Free Software Foundation, Inc.\n\
  4315.   There is ABSOLUTELY NO WARRANTY for GDB; type \"info warranty\" for details.\n\
  4316.   GDB is free software and you are welcome to distribute copies of it\n\
  4317.    under certain conditions; type \"info copying\" to see the conditions.\n",
  4318. --- 989,995 ----
  4319.   static void
  4320.   print_gdb_version ()
  4321.   {
  4322. !  printf_filtered ("GDB %s, Copyright (C) 1988 Free Software Foundation, Inc.\n\
  4323.   There is ABSOLUTELY NO WARRANTY for GDB; type \"info warranty\" for details.\n\
  4324.   GDB is free software and you are welcome to distribute copies of it\n\
  4325.    under certain conditions; type \"info copying\" to see the conditions.\n",
  4326. ***************
  4327. *** 969,975 ****
  4328.   void
  4329.   print_prompt ()
  4330.   {
  4331. !   printf ("%s", prompt);
  4332.     fflush (stdout);
  4333.   }
  4334.   
  4335. --- 1009,1015 ----
  4336.   void
  4337.   print_prompt ()
  4338.   {
  4339. !  printf_filtered ("%s", prompt);
  4340.     fflush (stdout);
  4341.   }
  4342.   
  4343. ***************
  4344. *** 1028,1034 ****
  4345.         else
  4346.       error ("Not confirmed.");
  4347.       }
  4348. !   exit (0);
  4349.   }
  4350.   
  4351.   int
  4352. --- 1068,1074 ----
  4353.         else
  4354.       error ("Not confirmed.");
  4355.       }
  4356. !   really_exit (0);
  4357.   }
  4358.   
  4359.   int
  4360. ***************
  4361. *** 1057,1066 ****
  4362.   #endif
  4363.   
  4364.     if (strcmp (dirbuf, current_directory))
  4365. !     printf ("Working directory %s\n (canonically %s).\n",
  4366.           current_directory, dirbuf);
  4367.     else
  4368. !     printf ("Working directory %s.\n", current_directory);
  4369.   }
  4370.   
  4371.   static void
  4372. --- 1097,1106 ----
  4373.   #endif
  4374.   
  4375.     if (strcmp (dirbuf, current_directory))
  4376. !    printf_filtered ("Working directory %s\n (canonically %s).\n",
  4377.           current_directory, dirbuf);
  4378.     else
  4379. !    printf_filtered ("Working directory %s.\n", current_directory);
  4380.   }
  4381.   
  4382.   static void
  4383. ***************
  4384. *** 1174,1183 ****
  4385.   
  4386.           c = parse_escape (&p);
  4387.           if (c >= 0)
  4388. !           fputc (c, stdout);
  4389.         }
  4390.       else
  4391. !       fputc (c, stdout);
  4392.         }
  4393.   }
  4394.   
  4395. --- 1214,1223 ----
  4396.   
  4397.           c = parse_escape (&p);
  4398.           if (c >= 0)
  4399. !           fputc_filtered (c, stdout);
  4400.         }
  4401.       else
  4402. !       fputc_filtered (c, stdout);
  4403.         }
  4404.   }
  4405.   
  4406. ***************
  4407. *** 1272,1274 ****
  4408. --- 1312,1419 ----
  4409.     add_info ("warranty", warranty_info, "Various kinds of warranty you do not have.");
  4410.     add_info ("version", version_info, "Report what version of GDB this is.");
  4411.   }
  4412. + #ifdef atarist
  4413. + long set_exeption_vector();
  4414. + long s_vectors[10];
  4415. + long s_trap_0_vector, s_trap_f_vector;
  4416. + static void Save_all_vectors()
  4417. + {
  4418. +     s_vectors[2] = set_exception_vector(2, do_nothing);
  4419. +     /* akp: why does Setexc(-N,..) not work?? */
  4420. +     set_exception_vector(2, s_vectors[2]);
  4421. +     s_vectors[3] = set_exception_vector(3, do_nothing);
  4422. +     set_exception_vector(3, s_vectors[3]);
  4423. +     s_vectors[4] = set_exception_vector(4, do_nothing);
  4424. +     set_exception_vector(4, s_vectors[4]);
  4425. +     s_vectors[5] = set_exception_vector(5, do_nothing);
  4426. +     set_exception_vector(5, s_vectors[5]);
  4427. +     s_vectors[6] = set_exception_vector(6, do_nothing);
  4428. +     set_exception_vector(6, s_vectors[6]);
  4429. +     s_vectors[7] = set_exception_vector(7, do_nothing);
  4430. +     set_exception_vector(7, s_vectors[7]);
  4431. +     s_vectors[8] = set_exception_vector(8, do_nothing);
  4432. +     set_exception_vector(8, s_vectors[8]);
  4433. +     s_vectors[9] = set_exception_vector(9, do_nothing);
  4434. +     set_exception_vector(9, s_vectors[9]);
  4435. +     
  4436. +     s_trap_0_vector = set_exception_vector(32, do_nothing);
  4437. +     set_exception_vector(32, s_trap_0_vector);
  4438. +     s_trap_f_vector = set_exception_vector(47, do_nothing);
  4439. +     set_exception_vector(47, s_trap_f_vector);
  4440. + }
  4441. + static void Restore_all_vectors()
  4442. + {
  4443. +     set_exception_vector(2, s_vectors[2]);
  4444. +     set_exception_vector(3, s_vectors[3]);
  4445. +     set_exception_vector(4, s_vectors[4]);
  4446. +     set_exception_vector(5, s_vectors[5]);
  4447. +     set_exception_vector(6, s_vectors[6]);
  4448. +     set_exception_vector(7, s_vectors[7]);
  4449. +     set_exception_vector(8, s_vectors[8]);
  4450. +     set_exception_vector(9, s_vectors[9]);
  4451. +     
  4452. +     set_exception_vector(32, s_trap_0_vector);
  4453. +     set_exception_vector(47, s_trap_f_vector);
  4454. + }
  4455. + #endif
  4456. + void really_exit(n)
  4457. + int n;
  4458. + {
  4459. + #ifdef atarist
  4460. +     Restore_all_vectors();
  4461. +     if(atari_logfile)
  4462. +     fclose(atari_logfile);
  4463. + #endif
  4464. +     exit(n);
  4465. + }
  4466. + #ifdef atarist
  4467. + #include <stdarg.h>
  4468. + int fprintf_filtered(FILE *fp, const char *fmt, ...)
  4469. + {
  4470. +     va_list argp;
  4471. +     va_start(argp, fmt);
  4472. +     if(atari_logfile)
  4473. +     {
  4474. +     _doprnt(atari_logfile, fmt, argp);
  4475. +     }
  4476. +     return(_doprnt(fp, fmt, argp));
  4477. + }
  4478. + int printf_filtered(const char *fmt, ...)
  4479. + {
  4480. +     va_list argp;
  4481. +     va_start(argp, fmt);
  4482. +     if(atari_logfile)
  4483. +     {
  4484. +     _doprnt(atari_logfile, fmt, argp);
  4485. +     }
  4486. +     return(_doprnt(stdout, fmt, argp));
  4487. + }
  4488. + int fputc_filtered(int c, FILE *fp)
  4489. + {
  4490. +     if(atari_logfile)
  4491. +     {
  4492. +     fputc(c, atari_logfile);
  4493. +     }
  4494. +     return fputc(c, fp);
  4495. + }
  4496. + int putc_filtered(int c, FILE *fp)
  4497. + {
  4498. +     return fputc_filtered(c, fp);
  4499. + }
  4500. + int fputs_filtered(const char *s, FILE *fp)
  4501. + {
  4502. +     if(atari_logfile)
  4503. +     {
  4504. +         fputs(s, atari_logfile);
  4505. +     }
  4506. +     return fputs(s, fp);
  4507. + }
  4508. + #endif
  4509. *** 1.7    1991/10/05 20:59:54
  4510. --- printcmd.c    1992/01/14 20:06:05
  4511. ***************
  4512. *** 60,65 ****
  4513. --- 60,68 ----
  4514.   
  4515.   int current_display_number;
  4516.   
  4517. + #ifdef atarist
  4518. + extern int gcc_mshort;
  4519. + #endif
  4520.   static void do_one_display ();
  4521.   
  4522.   void do_displays ();
  4523. ***************
  4524. *** 229,235 ****
  4525.         switch (format)
  4526.       {
  4527.       case 'x':
  4528. !       fprintf (stream, "0x%08x%08x", v1, v2);
  4529.         break;
  4530.       default:
  4531.         error ("Output size \"g\" unimplemented for format \"%c\".",
  4532. --- 232,238 ----
  4533.         switch (format)
  4534.       {
  4535.       case 'x':
  4536. !       fprintf_filtered (stream, "0x%08x%08x", v1, v2);
  4537.         break;
  4538.       default:
  4539.         error ("Output size \"g\" unimplemented for format \"%c\".",
  4540. ***************
  4541. *** 257,278 ****
  4542.         if (!size)
  4543.       {
  4544.         /* no size specified, like in print.  Print varying # of digits. */
  4545. !       fprintf (stream, "0x%lx", val_long);
  4546.       }
  4547.         else
  4548.         switch (size)
  4549.       {
  4550.       case 'b':
  4551. !       fprintf (stream, "0x%02x", val_long);
  4552.         break;
  4553.       case 'h':
  4554. !       fprintf (stream, "0x%04x", val_long);
  4555.         break;
  4556.       case 'w':
  4557. !       fprintf (stream, "0x%08x", val_long);
  4558.         break;
  4559.       case 'g':
  4560. !       fprintf (stream, "0x%016x", val_long);
  4561.         break;
  4562.       default:
  4563.         error ("Undefined output size \"%c\".", size);
  4564. --- 260,281 ----
  4565.         if (!size)
  4566.       {
  4567.         /* no size specified, like in print.  Print varying # of digits. */
  4568. !       fprintf_filtered (stream, "0x%lx", val_long);
  4569.       }
  4570.         else
  4571.         switch (size)
  4572.       {
  4573.       case 'b':
  4574. !       fprintf_filtered (stream, "0x%02x", val_long);
  4575.         break;
  4576.       case 'h':
  4577. !       fprintf_filtered (stream, "0x%04x", val_long);
  4578.         break;
  4579.       case 'w':
  4580. !       fprintf_filtered (stream, "0x%08x", val_long);
  4581.         break;
  4582.       case 'g':
  4583. !       fprintf_filtered (stream, "0x%016x", val_long);
  4584.         break;
  4585.       default:
  4586.         error ("Undefined output size \"%c\".", size);
  4587. ***************
  4588. *** 280,297 ****
  4589.         break;
  4590.   
  4591.       case 'd':
  4592. !       fprintf (stream, "%d", val_long);
  4593.         break;
  4594.   
  4595.       case 'u':
  4596. !       fprintf (stream, "%u", val_long);
  4597.         break;
  4598.   
  4599.       case 'o':
  4600.         if (val_long)
  4601. !     fprintf (stream, "0%o", val_long);
  4602.         else
  4603. !     fprintf (stream, "0");
  4604.         break;
  4605.   
  4606.       case 'a':
  4607. --- 283,300 ----
  4608.         break;
  4609.   
  4610.       case 'd':
  4611. !       fprintf_filtered (stream, "%d", val_long);
  4612.         break;
  4613.   
  4614.       case 'u':
  4615. !       fprintf_filtered (stream, "%u", val_long);
  4616.         break;
  4617.   
  4618.       case 'o':
  4619.         if (val_long)
  4620. !     fprintf_filtered (stream, "0%o", val_long);
  4621.         else
  4622. !     fprintf_filtered (stream, "0");
  4623.         break;
  4624.   
  4625.       case 'a':
  4626. ***************
  4627. *** 310,320 ****
  4628.   #ifdef IEEE_FLOAT
  4629.         if (is_nan (unpack_double (type, valaddr)))
  4630.       {
  4631. !       printf ("Nan");
  4632.         break;
  4633.       }
  4634.   #endif
  4635. !       fprintf (stream, "%g", unpack_double (type, valaddr));
  4636.         break;
  4637.   
  4638.       case 0:
  4639. --- 313,323 ----
  4640.   #ifdef IEEE_FLOAT
  4641.         if (is_nan (unpack_double (type, valaddr)))
  4642.       {
  4643. !      printf_filtered ("Nan");
  4644.         break;
  4645.       }
  4646.   #endif
  4647. !       fprintf_filtered (stream, "%g", unpack_double (type, valaddr));
  4648.         break;
  4649.   
  4650.       case 0:
  4651. ***************
  4652. *** 360,366 ****
  4653.           if (*cp == '\0')
  4654.             cp--;
  4655.         }
  4656. !         fprintf (stream, cp);
  4657.         }
  4658.         break;
  4659.   
  4660. --- 363,369 ----
  4661.           if (*cp == '\0')
  4662.             cp--;
  4663.         }
  4664. !         fprintf_filtered (stream, cp);
  4665.         }
  4666.         break;
  4667.   
  4668. ***************
  4669. *** 398,416 ****
  4670.     if (i < 0)
  4671.       return;
  4672.   
  4673. !   fputs (leadin, stream);
  4674. !   fputs ("<", stream);
  4675.   #if 0
  4676.     if (do_demangle)
  4677. !     fputs_demangled (misc_function_vector[i].name, stream, 1);
  4678.     else
  4679.   #endif
  4680. !     fputs (misc_function_vector[i].name, stream);
  4681.     name_location = misc_function_vector[i].address;
  4682.     if (addr - name_location)
  4683. !     fprintf (stream, "+%d>", addr - name_location);
  4684.     else
  4685. !     fputs (">", stream);
  4686.   }
  4687.   
  4688.   /* Print address ADDR symbolically on STREAM.
  4689. --- 401,419 ----
  4690.     if (i < 0)
  4691.       return;
  4692.   
  4693. !   fputs_filtered (leadin, stream);
  4694. !   fputs_filtered ("<", stream);
  4695.   #if 0
  4696.     if (do_demangle)
  4697. !     fputs_filtered_demangled (misc_function_vector[i].name, stream, 1);
  4698.     else
  4699.   #endif
  4700. !     fputs_filtered (misc_function_vector[i].name, stream);
  4701.     name_location = misc_function_vector[i].address;
  4702.     if (addr - name_location)
  4703. !     fprintf_filtered (stream, "+%d>", addr - name_location);
  4704.     else
  4705. !     fputs_filtered (">", stream);
  4706.   }
  4707.   
  4708.   /* Print address ADDR symbolically on STREAM.
  4709. ***************
  4710. *** 422,428 ****
  4711.        CORE_ADDR addr;
  4712.        FILE *stream;
  4713.   {
  4714. !   fprintf (stream, "0x%x", addr);
  4715.   #if 0
  4716.     print_address_symbolic (addr, stream, asm_demangle, " ");
  4717.   #else
  4718. --- 425,431 ----
  4719.        CORE_ADDR addr;
  4720.        FILE *stream;
  4721.   {
  4722. !   fprintf_filtered (stream, "0x%x", addr);
  4723.   #if 0
  4724.     print_address_symbolic (addr, stream, asm_demangle, " ");
  4725.   #else
  4726. ***************
  4727. *** 478,495 ****
  4728.     while (count > 0)
  4729.       {
  4730.         print_address (next_address, stdout);
  4731. !       fputc (':', stdout);
  4732.         for (i = maxelts;
  4733.          i > 0 && count > 0;
  4734.          i--, count--)
  4735.       {
  4736. !       fputc ('\t', stdout);
  4737.         /* Note that this sets next_address for the next object.  */
  4738.         last_examine_address = next_address;
  4739.         last_examine_value = value_at (val_type, next_address);
  4740.         print_formatted (last_examine_value, format, size);
  4741.       }
  4742. !       fputc ('\n', stdout);
  4743.         fflush (stdout);
  4744.       }
  4745.   }
  4746. --- 481,498 ----
  4747.     while (count > 0)
  4748.       {
  4749.         print_address (next_address, stdout);
  4750. !       fputc_filtered (':', stdout);
  4751.         for (i = maxelts;
  4752.          i > 0 && count > 0;
  4753.          i--, count--)
  4754.       {
  4755. !       fputc_filtered ('\t', stdout);
  4756.         /* Note that this sets next_address for the next object.  */
  4757.         last_examine_address = next_address;
  4758.         last_examine_value = value_at (val_type, next_address);
  4759.         print_formatted (last_examine_value, format, size);
  4760.       }
  4761. !       fputc_filtered ('\n', stdout);
  4762.         fflush (stdout);
  4763.       }
  4764.   }
  4765. ***************
  4766. *** 546,555 ****
  4767.       val = access_value_history (0);
  4768.   
  4769.     histindex = record_latest_value (val);
  4770. !   if(histindex >= 0) printf ("$%d = ", histindex);
  4771.   
  4772.     print_formatted (val, format, fmt.size);
  4773. !   printf ("\n");
  4774.   
  4775.     if (cleanup)
  4776.       do_cleanups (old_chain);
  4777. --- 549,558 ----
  4778.       val = access_value_history (0);
  4779.   
  4780.     histindex = record_latest_value (val);
  4781. !   if(histindex >= 0)printf_filtered ("$%d = ", histindex);
  4782.   
  4783.     print_formatted (val, format, fmt.size);
  4784. !  printf_filtered ("\n");
  4785.   
  4786.     if (cleanup)
  4787.       do_cleanups (old_chain);
  4788. ***************
  4789. *** 614,620 ****
  4790.         break;
  4791.   
  4792.         if (i < misc_function_count)
  4793. !     printf ("Symbol \"%s\" is at 0x%x in a file compiled without -g.\n",
  4794.           exp, misc_function_vector[i].address);
  4795.         else
  4796.       error ("No symbol \"%s\" in current context.", exp);
  4797. --- 617,623 ----
  4798.         break;
  4799.   
  4800.         if (i < misc_function_count)
  4801. ! printf_filtered ("Symbol \"%s\" is at 0x%x in a file compiled without -g.\n",
  4802.           exp, misc_function_vector[i].address);
  4803.         else
  4804.       error ("No symbol \"%s\" in current context.", exp);
  4805. ***************
  4806. *** 621,627 ****
  4807.         return;
  4808.       }
  4809.   
  4810. !   printf ("Symbol \"%s\" is ", SYMBOL_NAME (sym));
  4811.     val = SYMBOL_VALUE (sym);
  4812.   
  4813.     switch (SYMBOL_CLASS (sym))
  4814. --- 624,630 ----
  4815.         return;
  4816.       }
  4817.   
  4818. !  printf_filtered ("Symbol \"%s\" is ", SYMBOL_NAME (sym));
  4819.     val = SYMBOL_VALUE (sym);
  4820.   
  4821.     switch (SYMBOL_CLASS (sym))
  4822. ***************
  4823. *** 628,670 ****
  4824.       {
  4825.       case LOC_CONST:
  4826.       case LOC_CONST_BYTES:
  4827. !       printf ("constant");
  4828.         break;
  4829.   
  4830.       case LOC_LABEL:
  4831. !       printf ("a label at address 0x%x", val);
  4832.         break;
  4833.   
  4834.       case LOC_REGISTER:
  4835. !       printf ("a variable in register %s", reg_names[val]);
  4836.         break;
  4837.   
  4838.       case LOC_STATIC:
  4839. !       printf ("static at address 0x%x", val);
  4840.         break;
  4841.   
  4842.       case LOC_ARG:
  4843. !       printf ("an argument at offset %d", val);
  4844.         break;
  4845.   
  4846.       case LOC_LOCAL:
  4847. !       printf ("a local variable at frame offset %d", val);
  4848.         break;
  4849.   
  4850.       case LOC_TYPEDEF:
  4851. !       printf ("a typedef");
  4852.         break;
  4853.   
  4854.       case LOC_BLOCK:
  4855. !       printf ("a function at address 0x%x",
  4856.             BLOCK_START (SYMBOL_BLOCK_VALUE (sym)));
  4857.         break;
  4858.   
  4859.       default:
  4860. !       printf ("of unknown (botched) type");
  4861.         break;
  4862.       }
  4863. !   printf (".\n");
  4864.   }
  4865.   
  4866.   static void
  4867. --- 631,673 ----
  4868.       {
  4869.       case LOC_CONST:
  4870.       case LOC_CONST_BYTES:
  4871. !      printf_filtered ("constant");
  4872.         break;
  4873.   
  4874.       case LOC_LABEL:
  4875. !      printf_filtered ("a label at address 0x%x", val);
  4876.         break;
  4877.   
  4878.       case LOC_REGISTER:
  4879. !      printf_filtered ("a variable in register %s", reg_names[val]);
  4880.         break;
  4881.   
  4882.       case LOC_STATIC:
  4883. !      printf_filtered ("static at address 0x%x", val);
  4884.         break;
  4885.   
  4886.       case LOC_ARG:
  4887. !      printf_filtered ("an argument at offset %d", val);
  4888.         break;
  4889.   
  4890.       case LOC_LOCAL:
  4891. !      printf_filtered ("a local variable at frame offset %d", val);
  4892.         break;
  4893.   
  4894.       case LOC_TYPEDEF:
  4895. !      printf_filtered ("a typedef");
  4896.         break;
  4897.   
  4898.       case LOC_BLOCK:
  4899. !      printf_filtered ("a function at address 0x%x",
  4900.             BLOCK_START (SYMBOL_BLOCK_VALUE (sym)));
  4901.         break;
  4902.   
  4903.       default:
  4904. !      printf_filtered ("of unknown (botched) type");
  4905.         break;
  4906.       }
  4907. !  printf_filtered (".\n");
  4908.   }
  4909.   
  4910.   static void
  4911. ***************
  4912. *** 750,758 ****
  4913.     else
  4914.       val = access_value_history (0);
  4915.   
  4916. !   printf ("type = ");
  4917.     type_print (VALUE_TYPE (val), "", stdout, 1);
  4918. !   printf ("\n");
  4919.   
  4920.     if (exp)
  4921.       do_cleanups (old_chain);
  4922. --- 753,761 ----
  4923.     else
  4924.       val = access_value_history (0);
  4925.   
  4926. !  printf_filtered ("type = ");
  4927.     type_print (VALUE_TYPE (val), "", stdout, 1);
  4928. !  printf_filtered ("\n");
  4929.   
  4930.     if (exp)
  4931.       do_cleanups (old_chain);
  4932. ***************
  4933. *** 791,823 ****
  4934.           = lookup_symbol (typename, b, STRUCT_NAMESPACE);
  4935.         if (sym == 0)
  4936.           error ("No type named %s.", typename);
  4937. !       printf ("No type named %s, but there is a ",
  4938.             typename);
  4939.         switch (TYPE_CODE (SYMBOL_TYPE (sym)))
  4940.           {
  4941.           case TYPE_CODE_STRUCT:
  4942. !           printf ("struct");
  4943.             break;
  4944.   
  4945.           case TYPE_CODE_UNION:
  4946. !           printf ("union");
  4947.             break;
  4948.   
  4949.           case TYPE_CODE_ENUM:
  4950. !           printf ("enum");
  4951.             break;
  4952.   
  4953.           default:
  4954. !           printf ("(Internal error in gdb)");
  4955.             break;
  4956.           }
  4957. !       printf (" %s.  Type \"help ptype\".\n", typename);
  4958.         type = SYMBOL_TYPE (sym);
  4959.       }
  4960.       }
  4961.   
  4962.     type_print (type, "", stdout, 1);
  4963. !   printf ("\n");
  4964.   }
  4965.   
  4966.   struct display
  4967. --- 794,826 ----
  4968.           = lookup_symbol (typename, b, STRUCT_NAMESPACE);
  4969.         if (sym == 0)
  4970.           error ("No type named %s.", typename);
  4971. !      printf_filtered ("No type named %s, but there is a ",
  4972.             typename);
  4973.         switch (TYPE_CODE (SYMBOL_TYPE (sym)))
  4974.           {
  4975.           case TYPE_CODE_STRUCT:
  4976. !          printf_filtered ("struct");
  4977.             break;
  4978.   
  4979.           case TYPE_CODE_UNION:
  4980. !          printf_filtered ("union");
  4981.             break;
  4982.   
  4983.           case TYPE_CODE_ENUM:
  4984. !          printf_filtered ("enum");
  4985.             break;
  4986.   
  4987.           default:
  4988. !          printf_filtered ("(Internal error in gdb)");
  4989.             break;
  4990.           }
  4991. !      printf_filtered (" %s.  Type \"help ptype\".\n", typename);
  4992.         type = SYMBOL_TYPE (sym);
  4993.       }
  4994.       }
  4995.   
  4996.     type_print (type, "", stdout, 1);
  4997. !  printf_filtered ("\n");
  4998.   }
  4999.   
  5000.   struct display
  5001. ***************
  5002. *** 993,1013 ****
  5003.   {
  5004.     current_display_number = d->number;
  5005.   
  5006. !   printf ("%d: ", d->number);
  5007.     if (d->format.size)
  5008.       {
  5009. !       printf ("x/");
  5010.         if (d->format.count != 1)
  5011. !     printf ("%d", d->format.count);
  5012. !       printf ("%c", d->format.format);
  5013.         if (d->format.format != 'i' && d->format.format != 's')
  5014. !     printf ("%c", d->format.size);
  5015. !       printf (" ");
  5016.         print_expression (d->exp, stdout);
  5017.         if (d->format.count != 1)
  5018. !     printf ("\n");
  5019.         else
  5020. !     printf ("  ");
  5021.         do_examine (d->format,
  5022.             value_as_long (evaluate_expression (d->exp)));
  5023.       }
  5024. --- 996,1016 ----
  5025.   {
  5026.     current_display_number = d->number;
  5027.   
  5028. !  printf_filtered ("%d: ", d->number);
  5029.     if (d->format.size)
  5030.       {
  5031. !      printf_filtered ("x/");
  5032.         if (d->format.count != 1)
  5033. ! printf_filtered ("%d", d->format.count);
  5034. !      printf_filtered ("%c", d->format.format);
  5035.         if (d->format.format != 'i' && d->format.format != 's')
  5036. ! printf_filtered ("%c", d->format.size);
  5037. !      printf_filtered (" ");
  5038.         print_expression (d->exp, stdout);
  5039.         if (d->format.count != 1)
  5040. ! printf_filtered ("\n");
  5041.         else
  5042. ! printf_filtered ("  ");
  5043.         do_examine (d->format,
  5044.             value_as_long (evaluate_expression (d->exp)));
  5045.       }
  5046. ***************
  5047. *** 1014,1025 ****
  5048.     else
  5049.       {
  5050.         if (d->format.format)
  5051. !     printf ("/%c ", d->format.format);
  5052.         print_expression (d->exp, stdout);
  5053. !       printf (" = ");
  5054.         print_formatted (evaluate_expression (d->exp),
  5055.                  d->format.format, d->format.size);
  5056. !       printf ("\n");
  5057.       }
  5058.   
  5059.     fflush (stdout);
  5060. --- 1017,1028 ----
  5061.     else
  5062.       {
  5063.         if (d->format.format)
  5064. ! printf_filtered ("/%c ", d->format.format);
  5065.         print_expression (d->exp, stdout);
  5066. !      printf_filtered (" = ");
  5067.         print_formatted (evaluate_expression (d->exp),
  5068.                  d->format.format, d->format.size);
  5069. !      printf_filtered ("\n");
  5070.       }
  5071.   
  5072.     fflush (stdout);
  5073. ***************
  5074. *** 1046,1052 ****
  5075.     if (current_display_number >= 0)
  5076.       {
  5077.         delete_display (current_display_number);
  5078. !       fprintf (stderr, "Deleting display %d to avoid infinite recursion.\n",
  5079.              current_display_number);
  5080.       }
  5081.     current_display_number = -1;
  5082. --- 1049,1055 ----
  5083.     if (current_display_number >= 0)
  5084.       {
  5085.         delete_display (current_display_number);
  5086. !       fprintf_filtered (stderr, "Deleting display %d to avoid infinite recursion.\n",
  5087.              current_display_number);
  5088.       }
  5089.     current_display_number = -1;
  5090. ***************
  5091. *** 1058,1076 ****
  5092.     register struct display *d;
  5093.   
  5094.     if (!display_chain)
  5095. !     printf ("There are no auto-display expressions now.\n");
  5096.     else
  5097. !     printf ("Auto-display expressions now in effect:\n");
  5098.     for (d = display_chain; d; d = d->next)
  5099.       {
  5100. !       printf ("%d: ", d->number);
  5101.         if (d->format.size)
  5102. !     printf ("/%d%c%c ", d->format.count, d->format.size,
  5103.           d->format.format);
  5104.         else if (d->format.format)
  5105. !     printf ("/%c ", d->format.format);
  5106.         print_expression (d->exp, stdout);
  5107. !       printf ("\n");
  5108.         fflush (stdout);
  5109.       }
  5110.   }
  5111. --- 1061,1079 ----
  5112.     register struct display *d;
  5113.   
  5114.     if (!display_chain)
  5115. !    printf_filtered ("There are no auto-display expressions now.\n");
  5116.     else
  5117. !    printf_filtered ("Auto-display expressions now in effect:\n");
  5118.     for (d = display_chain; d; d = d->next)
  5119.       {
  5120. !      printf_filtered ("%d: ", d->number);
  5121.         if (d->format.size)
  5122. ! printf_filtered ("/%d%c%c ", d->format.count, d->format.size,
  5123.           d->format.format);
  5124.         else if (d->format.format)
  5125. ! printf_filtered ("/%c ", d->format.format);
  5126.         print_expression (d->exp, stdout);
  5127. !      printf_filtered ("\n");
  5128.         fflush (stdout);
  5129.       }
  5130.   }
  5131. ***************
  5132. *** 1142,1155 ****
  5133.         /* Print the next arg.  */
  5134.         val = value_at (SYMBOL_TYPE (sym), addr + SYMBOL_VALUE (sym));
  5135.         if (! first)
  5136. !     fprintf (stream, ", ");
  5137. !       fprintf (stream, "%s=", SYMBOL_NAME (sym));
  5138.         value_print (val, stream, 0);
  5139.         first = 0;
  5140.         last_offset = SYMBOL_VALUE (sym) + TYPE_LENGTH (SYMBOL_TYPE (sym));
  5141.         /* Round up address of next arg to multiple of size of int.  */
  5142. !       last_offset
  5143. !     = ((last_offset + sizeof (int) - 1) / sizeof (int)) * sizeof (int);
  5144.       }
  5145.     if (num >= 0 && num * sizeof (int) + FRAME_ARGS_SKIP > last_offset)
  5146.       print_frame_nameless_args (addr, last_offset,
  5147. --- 1145,1162 ----
  5148.         /* Print the next arg.  */
  5149.         val = value_at (SYMBOL_TYPE (sym), addr + SYMBOL_VALUE (sym));
  5150.         if (! first)
  5151. !     fprintf_filtered (stream, ", ");
  5152. !       fprintf_filtered (stream, "%s=", SYMBOL_NAME (sym));
  5153.         value_print (val, stream, 0);
  5154.         first = 0;
  5155.         last_offset = SYMBOL_VALUE (sym) + TYPE_LENGTH (SYMBOL_TYPE (sym));
  5156.         /* Round up address of next arg to multiple of size of int.  */
  5157. !       if(gcc_mshort)
  5158. !       last_offset
  5159. !       = ((last_offset + sizeof (short) - 1) / sizeof (short)) * sizeof (short);
  5160. !       else
  5161. !       last_offset
  5162. !         = ((last_offset + sizeof (int) - 1) / sizeof (int)) * sizeof (int);
  5163.       }
  5164.     if (num >= 0 && num * sizeof (int) + FRAME_ARGS_SKIP > last_offset)
  5165.       print_frame_nameless_args (addr, last_offset,
  5166. ***************
  5167. *** 1167,1174 ****
  5168.       {
  5169.         QUIT;
  5170.         if (start != FRAME_ARGS_SKIP)
  5171. !     fprintf (stream, ", ");
  5172. !       fprintf (stream, "%d",
  5173.              read_memory_integer (argsaddr + start, sizeof (int)));
  5174.         start += sizeof (int);
  5175.       }
  5176. --- 1174,1181 ----
  5177.       {
  5178.         QUIT;
  5179.         if (start != FRAME_ARGS_SKIP)
  5180. !     fprintf_filtered (stream, ", ");
  5181. !       fprintf_filtered (stream, "%d",
  5182.              read_memory_integer (argsaddr + start, sizeof (int)));
  5183.         start += sizeof (int);
  5184.       }
  5185. ***************
  5186. *** 1320,1326 ****
  5187.         read_memory (tem, str, j);
  5188.         str[j] = 0;
  5189.   
  5190. !       /* Pass address of internal copy as the arg to vprintf.  */
  5191.         *((int *) &arg_bytes[argindex]) = (int) str;
  5192.         argindex += sizeof (int);
  5193.       }
  5194. --- 1327,1333 ----
  5195.         read_memory (tem, str, j);
  5196.         str[j] = 0;
  5197.   
  5198. !       /* Pass address of internal copy as the arg to printf_filtered.  */
  5199.         *((int *) &arg_bytes[argindex]) = (int) str;
  5200.         argindex += sizeof (int);
  5201.       }
  5202. ***************
  5203. *** 1336,1342 ****
  5204.       }
  5205.       }
  5206.   
  5207. !   vprintf (string, arg_bytes);
  5208.   }
  5209.   
  5210.   /* Helper function for asdump_command.  Finds the bounds of a function
  5211. --- 1343,1349 ----
  5212.       }
  5213.       }
  5214.   
  5215. !   printf_filtered (string, arg_bytes);
  5216.   }
  5217.   
  5218.   /* Helper function for asdump_command.  Finds the bounds of a function
  5219. ***************
  5220. *** 1405,1419 ****
  5221.         high = parse_and_eval_address (space_index + 1);
  5222.       }
  5223.   
  5224. !   printf ("Dump of assembler code ");
  5225.     if (!space_index)
  5226.       {
  5227.         char *name;
  5228.         find_pc_partial_function (pc, &name, 0);
  5229. !       printf ("for function %s:\n", name);
  5230.       }
  5231.     else
  5232. !     printf ("from 0x%x to 0x%x:\n", low, high);
  5233.   
  5234.     /* Dump the specified range.  */
  5235.     for (pc = low; pc < high; )
  5236. --- 1412,1426 ----
  5237.         high = parse_and_eval_address (space_index + 1);
  5238.       }
  5239.   
  5240. !  printf_filtered ("Dump of assembler code ");
  5241.     if (!space_index)
  5242.       {
  5243.         char *name;
  5244.         find_pc_partial_function (pc, &name, 0);
  5245. !      printf_filtered ("for function %s:\n", name);
  5246.       }
  5247.     else
  5248. !    printf_filtered ("from 0x%x to 0x%x:\n", low, high);
  5249.   
  5250.     /* Dump the specified range.  */
  5251.     for (pc = low; pc < high; )
  5252. ***************
  5253. *** 1420,1430 ****
  5254.       {
  5255.         QUIT;
  5256.         print_address (pc, stdout);
  5257. !       printf (":\t");
  5258.         pc += print_insn (pc, stdout);
  5259. !       printf ("\n");
  5260.       }
  5261. !   printf ("End of assembler dump.\n");
  5262.     fflush (stdout);
  5263.   }
  5264.   
  5265. --- 1427,1437 ----
  5266.       {
  5267.         QUIT;
  5268.         print_address (pc, stdout);
  5269. !      printf_filtered (":\t");
  5270.         pc += print_insn (pc, stdout);
  5271. !      printf_filtered ("\n");
  5272.       }
  5273. !  printf_filtered ("End of assembler dump.\n");
  5274.     fflush (stdout);
  5275.   }
  5276.   
  5277. *** 1.5    1991/10/05 20:59:54
  5278. --- source.c    1992/01/14 20:06:06
  5279. ***************
  5280. *** 102,108 ****
  5281.   static void
  5282.   directories_info ()
  5283.   {
  5284. !   printf ("Source directories searched: %s\n", source_path);
  5285.   }
  5286.   
  5287.   void
  5288. --- 102,108 ----
  5289.   static void
  5290.   directories_info ()
  5291.   {
  5292. !  printf_filtered ("Source directories searched: %s\n", source_path);
  5293.   }
  5294.   
  5295.   void
  5296. ***************
  5297. *** 217,223 ****
  5298.             && (tem[len] == '\0' || tem[len] == ':'))
  5299.   #endif
  5300.           {
  5301. !           printf ("\"%s\" is already in the source path.\n",
  5302.                 dirname);
  5303.             break;
  5304.           }
  5305. --- 217,223 ----
  5306.             && (tem[len] == '\0' || tem[len] == ':'))
  5307.   #endif
  5308.           {
  5309. !          printf_filtered ("\"%s\" is already in the source path.\n",
  5310.                 dirname);
  5311.             break;
  5312.           }
  5313. ***************
  5314. *** 368,374 ****
  5315.   #else
  5316.     fstat (desc, &st);
  5317.     if (get_exec_file (0) != 0 && exec_mtime < st.st_mtime)
  5318. !     printf ("Source file is more recent than executable.\n");
  5319.   #endif
  5320.   
  5321.     data = (char *) alloca (st.st_size);
  5322. --- 368,374 ----
  5323.   #else
  5324.     fstat (desc, &st);
  5325.     if (get_exec_file (0) != 0 && exec_mtime < st.st_mtime)
  5326. !    printf_filtered ("Source file is more recent than executable.\n");
  5327.   #endif
  5328.   
  5329.     data = (char *) alloca (st.st_size);
  5330. ***************
  5331. *** 479,485 ****
  5332.       get_filename_and_charpos (s, line, 0);
  5333.     if (s->fullname == 0)
  5334.       return 0;
  5335. !   printf ("\032\032%s:%d:%d:%s\n", s->fullname,
  5336.         line, s->line_charpos[line - 1],
  5337.         mid_statement ? "middle" : "beg");
  5338.     current_source_line = line;
  5339. --- 479,485 ----
  5340.       get_filename_and_charpos (s, line, 0);
  5341.     if (s->fullname == 0)
  5342.       return 0;
  5343. !  printf_filtered ("\032\032%s:%d:%d:%s\n", s->fullname,
  5344.         line, s->line_charpos[line - 1],
  5345.         mid_statement ? "middle" : "beg");
  5346.     current_source_line = line;
  5347. ***************
  5348. *** 509,515 ****
  5349.     if (s->line_charpos == 0)
  5350.       find_source_lines (s, desc);
  5351.   
  5352. !   if (line < 1 || line >= s->nlines)
  5353.       {
  5354.         close (desc);
  5355.         error ("Line number %d out of range; %s has %d lines.",
  5356. --- 509,515 ----
  5357.     if (s->line_charpos == 0)
  5358.       find_source_lines (s, desc);
  5359.   
  5360. !   if (line < 1 || line > s->nlines)
  5361.       {
  5362.         close (desc);
  5363.         error ("Line number %d out of range; %s has %d lines.",
  5364. ***************
  5365. *** 534,540 ****
  5366.         c = fgetc (stream);
  5367.         if (c == EOF) break;
  5368.         last_line_listed = current_source_line;
  5369. !       printf ("%d\t", current_source_line++);
  5370.         do
  5371.   /*
  5372.   #ifdef atarist
  5373. --- 534,540 ----
  5374.         c = fgetc (stream);
  5375.         if (c == EOF) break;
  5376.         last_line_listed = current_source_line;
  5377. !      printf_filtered ("%d\t", current_source_line++);
  5378.         do
  5379.   /*
  5380.   #ifdef atarist
  5381. ***************
  5382. *** 544,556 ****
  5383.       {
  5384.         if (c < 040 && c != '\t' && c != '\n')
  5385.           {
  5386. !           fputc ('^', stdout);
  5387. !           fputc (c + 0100, stdout);
  5388.           }
  5389.         else if (c == 0177)
  5390. !         printf ("^?");
  5391.         else
  5392. !         fputc (c, stdout);
  5393.       } while (c != '\n' && (c = fgetc (stream)) >= 0);
  5394.       }
  5395.   
  5396. --- 544,556 ----
  5397.       {
  5398.         if (c < 040 && c != '\t' && c != '\n')
  5399.           {
  5400. !           fputc_filtered ('^', stdout);
  5401. !           fputc_filtered (c + 0100, stdout);
  5402.           }
  5403.         else if (c == 0177)
  5404. !        printf_filtered ("^?");
  5405.         else
  5406. !         fputc_filtered (c, stdout);
  5407.       } while (c != '\n' && (c = fgetc (stream)) >= 0);
  5408.       }
  5409.   
  5410. ***************
  5411. *** 653,662 ****
  5412.       error ("No source file for address 0x%x.", sal.pc);
  5413.         sym = find_pc_function (sal.pc);
  5414.         if (sym)
  5415. !     printf ("0x%x is in %s (%s, line %d).\n",
  5416.           sal.pc, SYMBOL_NAME (sym), sal.symtab->filename, sal.line);
  5417.         else
  5418. !     printf ("0x%x is in %s, line %d.\n",
  5419.           sal.pc, sal.symtab->filename, sal.line);
  5420.       }
  5421.   
  5422. --- 653,662 ----
  5423.       error ("No source file for address 0x%x.", sal.pc);
  5424.         sym = find_pc_function (sal.pc);
  5425.         if (sym)
  5426. ! printf_filtered ("0x%x is in %s (%s, line %d).\n",
  5427.           sal.pc, SYMBOL_NAME (sym), sal.symtab->filename, sal.line);
  5428.         else
  5429. ! printf_filtered ("0x%x is in %s, line %d.\n",
  5430.           sal.pc, sal.symtab->filename, sal.line);
  5431.       }
  5432.   
  5433. ***************
  5434. *** 719,728 ****
  5435.         && find_line_pc_range (sal.symtab, sal.line, &start_pc, &end_pc))
  5436.       {
  5437.         if (start_pc == end_pc)
  5438. !     printf ("Line %d of \"%s\" is at pc 0x%x but contains no code.\n",
  5439.           sal.line, sal.symtab->filename, start_pc);
  5440.         else
  5441. !     printf ("Line %d of \"%s\" starts at pc 0x%x and ends at 0x%x.\n",
  5442.           sal.line, sal.symtab->filename, start_pc, end_pc);
  5443.         /* x/i should display this line's code.  */
  5444.         set_next_address (start_pc);
  5445. --- 719,728 ----
  5446.         && find_line_pc_range (sal.symtab, sal.line, &start_pc, &end_pc))
  5447.       {
  5448.         if (start_pc == end_pc)
  5449. ! printf_filtered ("Line %d of \"%s\" is at pc 0x%x but contains no code.\n",
  5450.           sal.line, sal.symtab->filename, start_pc);
  5451.         else
  5452. ! printf_filtered ("Line %d of \"%s\" starts at pc 0x%x and ends at 0x%x.\n",
  5453.           sal.line, sal.symtab->filename, start_pc, end_pc);
  5454.         /* x/i should display this line's code.  */
  5455.         set_next_address (start_pc);
  5456. ***************
  5457. *** 730,736 ****
  5458.         last_line_listed = sal.line + 1;
  5459.       }
  5460.     else
  5461. !     printf ("Line number %d is out of range for \"%s\".\n",
  5462.           sal.line, sal.symtab->filename);
  5463.   }
  5464.   
  5465. --- 730,736 ----
  5466.         last_line_listed = sal.line + 1;
  5467.       }
  5468.     else
  5469. !    printf_filtered ("Line number %d is out of range for \"%s\".\n",
  5470.           sal.line, sal.symtab->filename);
  5471.   }
  5472.   
  5473. ***************
  5474. *** 803,809 ****
  5475.       line++;
  5476.     }
  5477.   
  5478. !   printf ("Expression not found\n");
  5479.     fclose (stream);
  5480.   }
  5481.   
  5482. --- 803,809 ----
  5483.       line++;
  5484.     }
  5485.   
  5486. !  printf_filtered ("Expression not found\n");
  5487.     fclose (stream);
  5488.   }
  5489.   
  5490. ***************
  5491. *** 880,886 ****
  5492.       }
  5493.       }
  5494.   
  5495. !   printf ("Expression not found\n");
  5496.     fclose (stream);
  5497.     return;
  5498.   }
  5499. --- 880,886 ----
  5500.       }
  5501.       }
  5502.   
  5503. !  printf_filtered ("Expression not found\n");
  5504.     fclose (stream);
  5505.     return;
  5506.   }
  5507. *** 1.3    1991/10/05 20:59:54
  5508. --- st-core.c    1992/01/14 20:06:06
  5509. ***************
  5510. *** 106,112 ****
  5511.        char *filename;
  5512.        int from_tty;
  5513.   {
  5514. !   fprintf(stderr, "Not on an ST you don't\n");
  5515.   }
  5516.   
  5517.   exec_file_command (filename, from_tty)
  5518. --- 106,112 ----
  5519.        char *filename;
  5520.        int from_tty;
  5521.   {
  5522. !   fprintf_filtered(stderr, "Not on an ST you don't\n");
  5523.   }
  5524.   
  5525.   exec_file_command (filename, from_tty)
  5526. ***************
  5527. *** 211,217 ****
  5528.         validate_files ();
  5529.       }
  5530.     else if (from_tty)
  5531. !     printf ("No exec file now.\n");
  5532.   
  5533.     /* Tell display code (if any) about the changed file name.  */
  5534.     if (exec_file_display_hook)
  5535. --- 211,217 ----
  5536.         validate_files ();
  5537.       }
  5538.     else if (from_tty)
  5539. !    printf_filtered ("No exec file now.\n");
  5540.   
  5541.     /* Tell display code (if any) about the changed file name.  */
  5542.     if (exec_file_display_hook)
  5543. ***************
  5544. *** 285,306 ****
  5545.     extern char *get_sym_file ();
  5546.   
  5547.     if (execfile)
  5548. !     printf ("Executable file \"%s\".\n", execfile);
  5549.     else
  5550. !     printf ("No executable file\n");
  5551.   
  5552.     if (have_inferior_p ())
  5553. !     printf ("Using the running image of the program, rather than these files.\n");
  5554.   
  5555.     symfile = get_sym_file ();
  5556.     if (symfile != 0)
  5557. !     printf ("Symbols loaded from \"%s\".\n", symfile);
  5558.   
  5559.     if (! have_inferior_p ())
  5560.       {
  5561.         if (execfile)
  5562.       {
  5563. !       printf ("Text segment from 0x%x to 0x%x.\n",
  5564.             text_start, text_end);
  5565.       }
  5566.       }
  5567. --- 285,306 ----
  5568.     extern char *get_sym_file ();
  5569.   
  5570.     if (execfile)
  5571. !    printf_filtered ("Executable file \"%s\".\n", execfile);
  5572.     else
  5573. !    printf_filtered ("No executable file\n");
  5574.   
  5575.     if (have_inferior_p ())
  5576. !    printf_filtered ("Using the running image of the program, rather than these files.\n");
  5577.   
  5578.     symfile = get_sym_file ();
  5579.     if (symfile != 0)
  5580. !    printf_filtered ("Symbols loaded from \"%s\".\n", symfile);
  5581.   
  5582.     if (! have_inferior_p ())
  5583.       {
  5584.         if (execfile)
  5585.       {
  5586. !      printf_filtered ("Text segment from 0x%x to 0x%x.\n",
  5587.             text_start, text_end);
  5588.       }
  5589.       }
  5590. ***************
  5591. *** 313,319 ****
  5592.        char *myaddr;
  5593.        int len;
  5594.   {
  5595. ! /* fprintf(stderr, "read-memory(%X, %X, %d) inf %d\n", memaddr, myaddr, len,
  5596.       have_inferior_p()); */
  5597.     if (have_inferior_p ())
  5598.       read_inferior_memory (memaddr, myaddr, len);
  5599. --- 313,319 ----
  5600.        char *myaddr;
  5601.        int len;
  5602.   {
  5603. ! /* fprintf_filtered(stderr, "read-memory(%X, %X, %d) inf %d\n", memaddr, myaddr, len,
  5604.       have_inferior_p()); */
  5605.     if (have_inferior_p ())
  5606.       read_inferior_memory (memaddr, myaddr, len);
  5607. *** 1.5    1991/10/05 20:59:54
  5608. --- st-inflo.c    1992/01/14 20:06:06
  5609. ***************
  5610. *** 243,278 ****
  5611.   /*
  5612.     if (remote_debugging)
  5613.       {
  5614. !       printf ("No terminal status when remote debugging.\n");
  5615.         return;
  5616.       }
  5617.   */
  5618.   
  5619. !   printf ("Inferior's terminal status (currently saved by GDB):\n");
  5620.   
  5621.   #ifdef HAVE_TERMIO
  5622.   
  5623. !   printf ("fcntl flags = 0x%x, c_iflag = 0x%x, c_oflag = 0x%x,\n",
  5624.         tflags_inferior, sg_inferior.c_iflag, sg_inferior.c_oflag);
  5625. !   printf ("c_cflag = 0x%x, c_lflag = 0x%x, c_line = 0x%x.\n",
  5626.         sg_inferior.c_cflag, sg_inferior.c_lflag, sg_inferior.c_line);
  5627. !   printf ("c_cc: ");
  5628.     for (i = 0; (i < NCC); i += 1)
  5629. !     printf ("0x%x ", sg_inferior.c_cc[i]);
  5630. !   printf ("\n");
  5631.   
  5632.   #else /* not HAVE_TERMIO */
  5633.   
  5634. !   printf ("fcntl flags = 0x%x, lmode = 0x%x,\nsgttyb.sg_flags = 0x%x.\n",
  5635.         tflags_inferior, lmode_inferior,
  5636.         sg_inferior.sg_flags);
  5637. !   printf ("tchars: ");
  5638.     for (i = 0; i < sizeof (struct tchars); i++)
  5639. !     printf ("0x%x ", ((char *)&tc_inferior)[i]);
  5640. !   printf ("\n");
  5641. !   printf ("ltchars: ");
  5642.     for (i = 0; i < sizeof (struct ltchars); i++)
  5643. !     printf ("0x%x ", ((char *)<c_inferior)[i]);
  5644.   
  5645.   #endif /* not HAVE_TERMIO */
  5646.   }
  5647. --- 243,278 ----
  5648.   /*
  5649.     if (remote_debugging)
  5650.       {
  5651. !      printf_filtered ("No terminal status when remote debugging.\n");
  5652.         return;
  5653.       }
  5654.   */
  5655.   
  5656. !  printf_filtered ("Inferior's terminal status (currently saved by GDB):\n");
  5657.   
  5658.   #ifdef HAVE_TERMIO
  5659.   
  5660. !  printf_filtered ("fcntl flags = 0x%x, c_iflag = 0x%x, c_oflag = 0x%x,\n",
  5661.         tflags_inferior, sg_inferior.c_iflag, sg_inferior.c_oflag);
  5662. !  printf_filtered ("c_cflag = 0x%x, c_lflag = 0x%x, c_line = 0x%x.\n",
  5663.         sg_inferior.c_cflag, sg_inferior.c_lflag, sg_inferior.c_line);
  5664. !  printf_filtered ("c_cc: ");
  5665.     for (i = 0; (i < NCC); i += 1)
  5666. !    printf_filtered ("0x%x ", sg_inferior.c_cc[i]);
  5667. !  printf_filtered ("\n");
  5668.   
  5669.   #else /* not HAVE_TERMIO */
  5670.   
  5671. !  printf_filtered ("fcntl flags = 0x%x, lmode = 0x%x,\nsgttyb.sg_flags = 0x%x.\n",
  5672.         tflags_inferior, lmode_inferior,
  5673.         sg_inferior.sg_flags);
  5674. !  printf_filtered ("tchars: ");
  5675.     for (i = 0; i < sizeof (struct tchars); i++)
  5676. !    printf_filtered ("0x%x ", ((char *)&tc_inferior)[i]);
  5677. !  printf_filtered ("\n");
  5678. !  printf_filtered ("ltchars: ");
  5679.     for (i = 0; i < sizeof (struct ltchars); i++)
  5680. !    printf_filtered ("0x%x ", ((char *)<c_inferior)[i]);
  5681.   
  5682.   #endif /* not HAVE_TERMIO */
  5683.   }
  5684. ***************
  5685. *** 355,361 ****
  5686.         ptrace (0);
  5687.         execle ("/bin/sh", "sh", "-c", allargs, 0, env);
  5688.   
  5689. !       fprintf (stderr, "Cannot exec /bin/sh: %s.\n",
  5690.              errno < sys_nerr ? sys_errlist[errno] : "unknown error");
  5691.         fflush (stderr);
  5692.         _exit (0177);
  5693. --- 355,361 ----
  5694.         ptrace (0);
  5695.         execle ("/bin/sh", "sh", "-c", allargs, 0, env);
  5696.   
  5697. !       fprintf_filtered (stderr, "Cannot exec /bin/sh: %s.\n",
  5698.              errno < sys_nerr ? sys_errlist[errno] : "unknown error");
  5699.         fflush (stderr);
  5700.         _exit (0177);
  5701. ***************
  5702. *** 503,509 ****
  5703.   
  5704.          regaddr += sizeof (int);
  5705.        }
  5706. ! /* fprintf(stderr, "supplying register %d from buf %X val %X\n", 
  5707.           regno, buf, *(long * )&buf); */
  5708.         supply_register (regno, buf);
  5709.       }
  5710. --- 503,509 ----
  5711.   
  5712.          regaddr += sizeof (int);
  5713.        }
  5714. ! /* fprintf_filtered(stderr, "supplying register %d from buf %X val %X\n", 
  5715.           regno, buf, *(long * )&buf); */
  5716.         supply_register (regno, buf);
  5717.       }
  5718. ***************
  5719. *** 542,548 ****
  5720.   
  5721.         if (errno != 0)
  5722.       {
  5723. !       sprintf (buf, "writing register number %d", regno);
  5724.         perror_with_name (buf);
  5725.       }
  5726.       }
  5727. --- 542,548 ----
  5728.   
  5729.         if (errno != 0)
  5730.       {
  5731. !       printf_filtered (buf, "writing register number %d", regno);
  5732.         perror_with_name (buf);
  5733.       }
  5734.       }
  5735. ***************
  5736. *** 557,563 ****
  5737.   
  5738.         if (errno != 0)
  5739.       {
  5740. !       sprintf (buf, "writing register number %d", regno);
  5741.         perror_with_name (buf);
  5742.       }
  5743.       }
  5744. --- 557,563 ----
  5745.   
  5746.         if (errno != 0)
  5747.       {
  5748. !       printf_filtered (buf, "writing register number %d", regno);
  5749.         perror_with_name (buf);
  5750.       }
  5751.       }
  5752. ***************
  5753. *** 697,707 ****
  5754.         ptrace (6, inferior_pid, i, value);
  5755.         if (errno == 0)
  5756.       {
  5757. !       printf (" Succeeded with address 0x%x; value 0x%x (%d).\n",
  5758.             i, value, value);
  5759.       }
  5760.         else if ((i & 0377) == 0)
  5761. !     printf (" Failed at 0x%x.\n", i);
  5762.       }
  5763.   }
  5764.   */
  5765. --- 697,707 ----
  5766.         ptrace (6, inferior_pid, i, value);
  5767.         if (errno == 0)
  5768.       {
  5769. !      printf_filtered (" Succeeded with address 0x%x; value 0x%x (%d).\n",
  5770.             i, value, value);
  5771.       }
  5772.         else if ((i & 0377) == 0)
  5773. ! printf_filtered (" Failed at 0x%x.\n", i);
  5774.       }
  5775.   }
  5776.   */
  5777. *** 1.11    1991/10/05 20:59:54
  5778. --- st-infru.c    1992/01/14 20:06:07
  5779. ***************
  5780. *** 381,389 ****
  5781.       {
  5782.         terminal_ours_for_output ();
  5783.         if (WRETCODE (w))
  5784. !         printf ("\nProgram exited with code 0%o.\n", WRETCODE (w));
  5785.         else
  5786. !         printf ("\nProgram exited normally.\n");
  5787.         fflush (stdout);
  5788.         inferior_died ();
  5789.         stop_print_frame = 0;
  5790. --- 381,389 ----
  5791.       {
  5792.         terminal_ours_for_output ();
  5793.         if (WRETCODE (w))
  5794. !        printf_filtered ("\nProgram exited with code 0%o.\n", WRETCODE (w));
  5795.         else
  5796. !        printf_filtered ("\nProgram exited normally.\n");
  5797.         fflush (stdout);
  5798.         inferior_died ();
  5799.         stop_print_frame = 0;
  5800. ***************
  5801. *** 395,406 ****
  5802.         stop_signal = WTERMSIG (w);
  5803.         terminal_ours_for_output ();
  5804.         kill_inferior ();
  5805. !       printf ("\nProgram terminated with signal %d, %s\n",
  5806.             stop_signal,
  5807.             stop_signal < NSIG
  5808.             ? sys_siglist[stop_signal]
  5809.             : "(undocumented)");
  5810. !       printf ("The inferior process no longer exists.\n");
  5811.         fflush (stdout);
  5812.         break;
  5813.       }
  5814. --- 395,406 ----
  5815.         stop_signal = WTERMSIG (w);
  5816.         terminal_ours_for_output ();
  5817.         kill_inferior ();
  5818. !      printf_filtered ("\nProgram terminated with signal %d, %s\n",
  5819.             stop_signal,
  5820.             stop_signal < NSIG
  5821.             ? sys_siglist[stop_signal]
  5822.             : "(undocumented)");
  5823. !      printf_filtered ("The inferior process no longer exists.\n");
  5824.         fflush (stdout);
  5825.         break;
  5826.       }
  5827. ***************
  5828. *** 505,511 ****
  5829.           {
  5830.             printed = 1;
  5831.             terminal_ours_for_output ();
  5832. !           printf ("\nProgram received signal %d, %s\n",
  5833.                 stop_signal,
  5834.                 stop_signal < NSIG
  5835.                  ? sys_siglist[stop_signal]
  5836. --- 505,511 ----
  5837.           {
  5838.             printed = 1;
  5839.             terminal_ours_for_output ();
  5840. !          printf_filtered ("\nProgram received signal %d, %s\n",
  5841.                 stop_signal,
  5842.                 stop_signal < NSIG
  5843.                  ? sys_siglist[stop_signal]
  5844. ***************
  5845. *** 765,771 ****
  5846.       {
  5847.         terminal_ours_for_output ();
  5848.         print_sys_errmsg ("ptrace", breakpoints_failed);
  5849. !       printf ("Stopped; cannot insert breakpoints.\n\
  5850.   The same program may be running in another process.\n");
  5851.       }
  5852.   
  5853. --- 765,771 ----
  5854.       {
  5855.         terminal_ours_for_output ();
  5856.         print_sys_errmsg ("ptrace", breakpoints_failed);
  5857. !      printf_filtered ("Stopped; cannot insert breakpoints.\n\
  5858.   The same program may be running in another process.\n");
  5859.       }
  5860.   
  5861. ***************
  5862. *** 776,782 ****
  5863.       if (remove_breakpoints ())
  5864.         {
  5865.       terminal_ours_for_output ();
  5866. !     printf ("Cannot remove breakpoints because program is no longer writable.\n\
  5867.   It must be running in another process.\n\
  5868.   Further execution is probably impossible.\n");
  5869.         }
  5870. --- 776,782 ----
  5871.       if (remove_breakpoints ())
  5872.         {
  5873.       terminal_ours_for_output ();
  5874. ! printf_filtered ("Cannot remove breakpoints because program is no longer writable.\n\
  5875.   It must be running in another process.\n\
  5876.   Further execution is probably impossible.\n");
  5877.         }
  5878. ***************
  5879. *** 801,807 ****
  5880.     if (running_in_shell)
  5881.       {
  5882.         if (stop_signal == SIGSEGV)
  5883. !     printf ("\
  5884.   You have just encountered a bug in \"sh\".  GDB starts your program\n\
  5885.   by running \"sh\" with a command to exec your program.\n\
  5886.   This is so that \"sh\" will process wildcards and I/O redirection.\n\
  5887. --- 801,807 ----
  5888.     if (running_in_shell)
  5889.       {
  5890.         if (stop_signal == SIGSEGV)
  5891. ! printf_filtered ("\
  5892.   You have just encountered a bug in \"sh\".  GDB starts your program\n\
  5893.   by running \"sh\" with a command to exec your program.\n\
  5894.   This is so that \"sh\" will process wildcards and I/O redirection.\n\
  5895. ***************
  5896. *** 833,839 ****
  5897.         if (stop_print_frame)
  5898.       {
  5899.         if (stop_breakpoint > 0)
  5900. !         printf ("\nBpt %d, ", stop_breakpoint);
  5901.         print_sel_frame (stop_step
  5902.                  && step_frame == stop_frame
  5903.                  && step_start_function == find_pc_function (stop_pc));
  5904. --- 833,839 ----
  5905.         if (stop_print_frame)
  5906.       {
  5907.         if (stop_breakpoint > 0)
  5908. !        printf_filtered ("\nBpt %d, ", stop_breakpoint);
  5909.         print_sel_frame (stop_step
  5910.                  && step_frame == stop_frame
  5911.                  && step_start_function == find_pc_function (stop_pc));
  5912. ***************
  5913. *** 952,963 ****
  5914.     if (from_tty)
  5915.       {
  5916.         /* Show the results.  */
  5917. !       printf ("Number\tStop\tPrint\tPass to program\tDescription\n");
  5918. !       printf ("%d\t", signum);
  5919. !       printf ("%s\t", signal_stop[signum] ? "Yes" : "No");
  5920. !       printf ("%s\t", signal_print[signum] ? "Yes" : "No");
  5921. !       printf ("%s\t\t", signal_program[signum] ? "Yes" : "No");
  5922. !       printf ("%s\n", sys_siglist[signum]);
  5923.       }
  5924.   }
  5925.   
  5926. --- 952,963 ----
  5927.     if (from_tty)
  5928.       {
  5929.         /* Show the results.  */
  5930. !      printf_filtered ("Number\tStop\tPrint\tPass to program\tDescription\n");
  5931. !      printf_filtered ("%d\t", signum);
  5932. !      printf_filtered ("%s\t", signal_stop[signum] ? "Yes" : "No");
  5933. !      printf_filtered ("%s\t", signal_print[signum] ? "Yes" : "No");
  5934. !      printf_filtered ("%s\t\t", signal_program[signum] ? "Yes" : "No");
  5935. !      printf_filtered ("%s\n", sys_siglist[signum]);
  5936.       }
  5937.   }
  5938.   
  5939. ***************
  5940. *** 968,1004 ****
  5941.        char *signum_exp;
  5942.   {
  5943.     register int i;
  5944. !   printf ("Number\tStop\tPrint\tPass to program\tDescription\n");
  5945.   
  5946.     if (signum_exp)
  5947.       {
  5948.         i = parse_and_eval_address (signum_exp);
  5949. !       printf ("%d\t", i);
  5950. !       printf ("%s\t", signal_stop[i] ? "Yes" : "No");
  5951. !       printf ("%s\t", signal_print[i] ? "Yes" : "No");
  5952. !       printf ("%s\t\t", signal_program[i] ? "Yes" : "No");
  5953. !       printf ("%s\n", sys_siglist[i]);
  5954.         return;
  5955.       }
  5956.   
  5957. !   printf ("\n");
  5958.     for (i = 0; i < NSIG; i++)
  5959.       {
  5960.         QUIT;
  5961.         if (i > 0 && i % 16 == 0)
  5962.       {
  5963. !       printf ("[Type Return to see more]");
  5964.         fflush (stdout);
  5965.         read_line ();
  5966.       }
  5967. !       printf ("%d\t", i);
  5968. !       printf ("%s\t", signal_stop[i] ? "Yes" : "No");
  5969. !       printf ("%s\t", signal_print[i] ? "Yes" : "No");
  5970. !       printf ("%s\t\t", signal_program[i] ? "Yes" : "No");
  5971. !       printf ("%s\n", sys_siglist[i]);
  5972.       }
  5973.   
  5974. !   printf ("\nUse the \"handle\" command to change these tables.\n");
  5975.   }
  5976.   
  5977.   /* Save all of the information associated with the inferior<==>gdb
  5978. --- 968,1004 ----
  5979.        char *signum_exp;
  5980.   {
  5981.     register int i;
  5982. !  printf_filtered ("Number\tStop\tPrint\tPass to program\tDescription\n");
  5983.   
  5984.     if (signum_exp)
  5985.       {
  5986.         i = parse_and_eval_address (signum_exp);
  5987. !      printf_filtered ("%d\t", i);
  5988. !      printf_filtered ("%s\t", signal_stop[i] ? "Yes" : "No");
  5989. !      printf_filtered ("%s\t", signal_print[i] ? "Yes" : "No");
  5990. !      printf_filtered ("%s\t\t", signal_program[i] ? "Yes" : "No");
  5991. !      printf_filtered ("%s\n", sys_siglist[i]);
  5992.         return;
  5993.       }
  5994.   
  5995. !  printf_filtered ("\n");
  5996.     for (i = 0; i < NSIG; i++)
  5997.       {
  5998.         QUIT;
  5999.         if (i > 0 && i % 16 == 0)
  6000.       {
  6001. !      printf_filtered ("[Type Return to see more]");
  6002.         fflush (stdout);
  6003.         read_line ();
  6004.       }
  6005. !      printf_filtered ("%d\t", i);
  6006. !      printf_filtered ("%s\t", signal_stop[i] ? "Yes" : "No");
  6007. !      printf_filtered ("%s\t", signal_print[i] ? "Yes" : "No");
  6008. !      printf_filtered ("%s\t\t", signal_program[i] ? "Yes" : "No");
  6009. !      printf_filtered ("%s\n", sys_siglist[i]);
  6010.       }
  6011.   
  6012. !  printf_filtered ("\nUse the \"handle\" command to change these tables.\n");
  6013.   }
  6014.   
  6015.   /* Save all of the information associated with the inferior<==>gdb
  6016. ***************
  6017. *** 1093,1099 ****
  6018.            error message after another.  Besides which, does the
  6019.            user really care if we can't restore the previously
  6020.            selected frame?  */
  6021. !       fprintf (stderr, "Unable to restore previously selected frame.\n");
  6022.   #endif
  6023.         select_frame (get_current_frame (), 0);
  6024.         return;
  6025. --- 1093,1099 ----
  6026.            error message after another.  Besides which, does the
  6027.            user really care if we can't restore the previously
  6028.            selected frame?  */
  6029. !       fprintf_filtered (stderr, "Unable to restore previously selected frame.\n");
  6030.   #endif
  6031.         select_frame (get_current_frame (), 0);
  6032.         return;
  6033. *** 1.4    1991/10/05 20:59:54
  6034. --- stack.c    1992/01/14 20:06:08
  6035. ***************
  6036. *** 99,117 ****
  6037.         tem = *fi;
  6038.   
  6039.         if (level >= 0)
  6040. !     printf ("#%-2d ", level);
  6041.         if (fi->pc != sal.pc || !sal.symtab)
  6042. !     printf ("0x%x in ", fi->pc);
  6043. !       printf ("%s (", funname ? funname : "??");
  6044.         if (args)
  6045.       {
  6046.         FRAME_NUM_ARGS (numargs, tem);
  6047.         print_frame_args (func, FRAME_ARGS_ADDRESS (tem), numargs, stdout);
  6048.       }
  6049. !       printf (")");
  6050.         if (sal.symtab)
  6051. !     printf (" (%s line %d)", sal.symtab->filename, sal.line);
  6052. !       printf ("\n");
  6053.       }
  6054.   
  6055.     if (source != 0 && sal.symtab)
  6056. --- 99,117 ----
  6057.         tem = *fi;
  6058.   
  6059.         if (level >= 0)
  6060. ! printf_filtered ("#%-2d ", level);
  6061.         if (fi->pc != sal.pc || !sal.symtab)
  6062. ! printf_filtered ("0x%x in ", fi->pc);
  6063. !      printf_filtered ("%s (", funname ? funname : "??");
  6064.         if (args)
  6065.       {
  6066.         FRAME_NUM_ARGS (numargs, tem);
  6067.         print_frame_args (func, FRAME_ARGS_ADDRESS (tem), numargs, stdout);
  6068.       }
  6069. !      printf_filtered (")");
  6070.         if (sal.symtab)
  6071. ! printf_filtered (" (%s line %d)", sal.symtab->filename, sal.line);
  6072. !      printf_filtered ("\n");
  6073.       }
  6074.   
  6075.     if (source != 0 && sal.symtab)
  6076. ***************
  6077. *** 123,129 ****
  6078.         if (!done)
  6079.       {
  6080.         if (mid_statement)
  6081. !         printf ("0x%x\t", fi->pc);
  6082.         print_source_lines (sal.symtab, sal.line, sal.line + 1);
  6083.       }
  6084.         current_source_line = max (sal.line - 5, 1);
  6085. --- 123,129 ----
  6086.         if (!done)
  6087.       {
  6088.         if (mid_statement)
  6089. !        printf_filtered ("0x%x\t", fi->pc);
  6090.         print_source_lines (sal.symtab, sal.line, sal.line + 1);
  6091.       }
  6092.         current_source_line = max (sal.line - 5, 1);
  6093. ***************
  6094. *** 183,238 ****
  6095.     calling_frame = get_prev_frame (frame);
  6096.   
  6097.     if (!addr_exp && selected_frame_level >= 0)
  6098. !     printf ("Stack level %d, frame at 0x%x:\n pc = 0x%x",
  6099.           selected_frame_level, frame, fi.pc);
  6100.     else
  6101. !     printf ("Stack frame at 0x%x:\n pc = 0x%x",
  6102.           frame, fi.pc);
  6103.   
  6104.     if (funname)
  6105. !     printf (" in %s", funname);
  6106.     if (sal.symtab)
  6107. !     printf (" (%s line %d)", sal.symtab->filename, sal.line);
  6108. !   printf ("; saved pc 0x%x\n", FRAME_SAVED_PC (frame));
  6109.     if (calling_frame)
  6110. !     printf (" called by frame at 0x%x", calling_frame);
  6111.     if (fi.next_frame && calling_frame)
  6112. !     printf (",");
  6113.     if (fi.next_frame)
  6114. !     printf (" caller of frame at 0x%x", fi.next_frame);
  6115.     if (fi.next_frame || calling_frame)
  6116. !     printf ("\n");
  6117. !   printf (" Arglist at 0x%x,", FRAME_ARGS_ADDRESS (fi));
  6118.     FRAME_NUM_ARGS (i, fi);
  6119.     if (i < 0)
  6120. !     printf (" args: ");
  6121.     else if (i == 0)
  6122. !     printf (" no args.");
  6123.     else if (i == 1)
  6124. !     printf (" 1 arg: ");
  6125.     else
  6126. !     printf (" %d args: ", i);
  6127.   
  6128.     FRAME_NUM_ARGS (numargs, fi);
  6129.     print_frame_args (func, FRAME_ARGS_ADDRESS (fi), numargs, stdout);
  6130. !   printf ("\n");
  6131.     count = 0;
  6132.     for (i = 0; i < NUM_REGS; i++)
  6133.       if (fsr.regs[i])
  6134.         {
  6135.       if (count % 4 != 0)
  6136. !       printf (", ");
  6137.       else
  6138.         {
  6139.           if (count == 0)
  6140. !           printf (" Saved registers:");
  6141. !         printf ("\n  ");
  6142.         }
  6143. !     printf ("%s at 0x%x", reg_names[i], fsr.regs[i]);
  6144.       count++;
  6145.         }
  6146.     if (count)
  6147. !     printf ("\n");
  6148.   }
  6149.   
  6150.   /* Print briefly all stack frames or just the innermost COUNT frames.  */
  6151. --- 183,238 ----
  6152.     calling_frame = get_prev_frame (frame);
  6153.   
  6154.     if (!addr_exp && selected_frame_level >= 0)
  6155. !    printf_filtered ("Stack level %d, frame at 0x%x:\n pc = 0x%x",
  6156.           selected_frame_level, frame, fi.pc);
  6157.     else
  6158. !    printf_filtered ("Stack frame at 0x%x:\n pc = 0x%x",
  6159.           frame, fi.pc);
  6160.   
  6161.     if (funname)
  6162. !    printf_filtered (" in %s", funname);
  6163.     if (sal.symtab)
  6164. !    printf_filtered (" (%s line %d)", sal.symtab->filename, sal.line);
  6165. !  printf_filtered ("; saved pc 0x%x\n", FRAME_SAVED_PC (frame));
  6166.     if (calling_frame)
  6167. !    printf_filtered (" called by frame at 0x%x", calling_frame);
  6168.     if (fi.next_frame && calling_frame)
  6169. !    printf_filtered (",");
  6170.     if (fi.next_frame)
  6171. !    printf_filtered (" caller of frame at 0x%x", fi.next_frame);
  6172.     if (fi.next_frame || calling_frame)
  6173. !    printf_filtered ("\n");
  6174. !  printf_filtered (" Arglist at 0x%x,", FRAME_ARGS_ADDRESS (fi));
  6175.     FRAME_NUM_ARGS (i, fi);
  6176.     if (i < 0)
  6177. !    printf_filtered (" args: ");
  6178.     else if (i == 0)
  6179. !    printf_filtered (" no args.");
  6180.     else if (i == 1)
  6181. !    printf_filtered (" 1 arg: ");
  6182.     else
  6183. !    printf_filtered (" %d args: ", i);
  6184.   
  6185.     FRAME_NUM_ARGS (numargs, fi);
  6186.     print_frame_args (func, FRAME_ARGS_ADDRESS (fi), numargs, stdout);
  6187. !  printf_filtered ("\n");
  6188.     count = 0;
  6189.     for (i = 0; i < NUM_REGS; i++)
  6190.       if (fsr.regs[i])
  6191.         {
  6192.       if (count % 4 != 0)
  6193. !      printf_filtered (", ");
  6194.       else
  6195.         {
  6196.           if (count == 0)
  6197. !          printf_filtered (" Saved registers:");
  6198. !        printf_filtered ("\n  ");
  6199.         }
  6200. ! printf_filtered ("%s at 0x%x", reg_names[i], fsr.regs[i]);
  6201.       count++;
  6202.         }
  6203.     if (count)
  6204. !    printf_filtered ("\n");
  6205.   }
  6206.   
  6207.   /* Print briefly all stack frames or just the innermost COUNT frames.  */
  6208. ***************
  6209. *** 281,289 ****
  6210.         || SYMBOL_CLASS (sym) == LOC_REGISTER
  6211.         || SYMBOL_CLASS (sym) == LOC_STATIC)
  6212.       {
  6213. !       fprintf (stream, "%s = ", SYMBOL_NAME (sym));
  6214.         print_variable_value (sym, frame, stream);
  6215. !       fprintf (stream, "\n");
  6216.         fflush (stream);
  6217.       }
  6218.       }
  6219. --- 281,289 ----
  6220.         || SYMBOL_CLASS (sym) == LOC_REGISTER
  6221.         || SYMBOL_CLASS (sym) == LOC_STATIC)
  6222.       {
  6223. !       fprintf_filtered (stream, "%s = ", SYMBOL_NAME (sym));
  6224.         print_variable_value (sym, frame, stream);
  6225. !       fprintf_filtered (stream, "\n");
  6226.         fflush (stream);
  6227.       }
  6228.       }
  6229. ***************
  6230. *** 346,354 ****
  6231.         sym = BLOCK_SYM (b, i);
  6232.         if (SYMBOL_CLASS (sym) == LOC_ARG)
  6233.       {
  6234. !       fprintf (stream, "%s = ", SYMBOL_NAME (sym));
  6235.         print_variable_value (sym, frame, stream);
  6236. !       fprintf (stream, "\n");
  6237.         fflush (stream);
  6238.       }
  6239.       }
  6240. --- 346,354 ----
  6241.         sym = BLOCK_SYM (b, i);
  6242.         if (SYMBOL_CLASS (sym) == LOC_ARG)
  6243.       {
  6244. !       fprintf_filtered (stream, "%s = ", SYMBOL_NAME (sym));
  6245.         print_variable_value (sym, frame, stream);
  6246. !       fprintf_filtered (stream, "\n");
  6247.         fflush (stream);
  6248.       }
  6249.       }
  6250. *** 1.5    1991/10/05 20:59:54
  6251. --- symmisc.c    1992/01/14 20:06:08
  6252. ***************
  6253. *** 401,415 ****
  6254.     for (s = symtab_list; s; s = s->next)
  6255.       {
  6256.         /* First print the line table.  */
  6257. !       fprintf (outfile, "Symtab for file %s\n\n", s->filename);
  6258. !       fprintf (outfile, "Line table:\n\n");
  6259.         l = LINETABLE (s);
  6260.         len = l->nitems;
  6261.         for (i = 0; i < len; i++)
  6262. !     fprintf (outfile, " line %d at %x\n", l->item[i].line,
  6263.            l->item[i].pc);
  6264.         /* Now print the block info.  */
  6265. !       fprintf (outfile, "\nBlockvector:\n\n");
  6266.         bv = BLOCKVECTOR (s);
  6267.         len = BLOCKVECTOR_NBLOCKS (bv);
  6268.         for (i = 0; i < len; i++)
  6269. --- 401,415 ----
  6270.     for (s = symtab_list; s; s = s->next)
  6271.       {
  6272.         /* First print the line table.  */
  6273. !       fprintf_filtered (outfile, "Symtab for file %s\n\n", s->filename);
  6274. !       fprintf_filtered (outfile, "Line table:\n\n");
  6275.         l = LINETABLE (s);
  6276.         len = l->nitems;
  6277.         for (i = 0; i < len; i++)
  6278. !     fprintf_filtered (outfile, " line %d at %x\n", l->item[i].line,
  6279.            l->item[i].pc);
  6280.         /* Now print the block info.  */
  6281. !       fprintf_filtered (outfile, "\nBlockvector:\n\n");
  6282.         bv = BLOCKVECTOR (s);
  6283.         len = BLOCKVECTOR_NBLOCKS (bv);
  6284.         for (i = 0; i < len; i++)
  6285. ***************
  6286. *** 417,429 ****
  6287.         b = BLOCKVECTOR_BLOCK (bv, i);
  6288.         depth = block_depth (b) * 2;
  6289.         print_spaces (depth, outfile);
  6290. !       fprintf (outfile, "block #%03d (object 0x%x) ", i, b);
  6291. !       fprintf (outfile, "[0x%x..0x%x]", BLOCK_START (b), BLOCK_END (b));
  6292.         if (BLOCK_SUPERBLOCK (b))
  6293. !         fprintf (outfile, " (under 0x%x)", BLOCK_SUPERBLOCK (b));
  6294.         if (BLOCK_FUNCTION (b))
  6295. !         fprintf (outfile, " %s", SYMBOL_NAME (BLOCK_FUNCTION (b)));
  6296. !       fputc ('\n', outfile);
  6297.         blen = BLOCK_NSYMS (b);
  6298.         for (j = 0; j < blen; j++)
  6299.           {
  6300. --- 417,429 ----
  6301.         b = BLOCKVECTOR_BLOCK (bv, i);
  6302.         depth = block_depth (b) * 2;
  6303.         print_spaces (depth, outfile);
  6304. !       fprintf_filtered (outfile, "block #%03d (object 0x%x) ", i, b);
  6305. !       fprintf_filtered (outfile, "[0x%x..0x%x]", BLOCK_START (b), BLOCK_END (b));
  6306.         if (BLOCK_SUPERBLOCK (b))
  6307. !         fprintf_filtered (outfile, " (under 0x%x)", BLOCK_SUPERBLOCK (b));
  6308.         if (BLOCK_FUNCTION (b))
  6309. !         fprintf_filtered (outfile, " %s", SYMBOL_NAME (BLOCK_FUNCTION (b)));
  6310. !       fputc_filtered ('\n', outfile);
  6311.         blen = BLOCK_NSYMS (b);
  6312.         for (j = 0; j < blen; j++)
  6313.           {
  6314. ***************
  6315. *** 431,437 ****
  6316.           }
  6317.       }
  6318.   
  6319. !       fprintf (outfile, "\n\n");
  6320.       }
  6321.   
  6322.     immediate_quit--;
  6323. --- 431,437 ----
  6324.           }
  6325.       }
  6326.   
  6327. !       fprintf_filtered (outfile, "\n\n");
  6328.       }
  6329.   
  6330.     immediate_quit--;
  6331. ***************
  6332. *** 447,453 ****
  6333.     print_spaces (depth, outfile);
  6334.     if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
  6335.       {
  6336. !       fprintf (outfile, "label %s at 0x%x", SYMBOL_NAME (symbol),
  6337.              SYMBOL_VALUE (symbol));
  6338.         return;
  6339.       }
  6340. --- 447,453 ----
  6341.     print_spaces (depth, outfile);
  6342.     if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
  6343.       {
  6344. !       fprintf_filtered (outfile, "label %s at 0x%x", SYMBOL_NAME (symbol),
  6345.              SYMBOL_VALUE (symbol));
  6346.         return;
  6347.       }
  6348. ***************
  6349. *** 459,465 ****
  6350.       }
  6351.         else
  6352.       {
  6353. !       fprintf (outfile, "%s %s = ",
  6354.              (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_ENUM
  6355.           ? "enum"
  6356.           : (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT
  6357. --- 459,465 ----
  6358.       }
  6359.         else
  6360.       {
  6361. !       fprintf_filtered (outfile, "%s %s = ",
  6362.              (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_ENUM
  6363.           ? "enum"
  6364.           : (TYPE_CODE (SYMBOL_TYPE (symbol)) == TYPE_CODE_STRUCT
  6365. ***************
  6366. *** 467,519 ****
  6367.              SYMBOL_NAME (symbol));
  6368.         type_print_1 (SYMBOL_TYPE (symbol), "", outfile, 1, depth);
  6369.       }
  6370. !       fprintf (outfile, ";\n");
  6371.       }
  6372.     else
  6373.       {
  6374.         if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF)
  6375. !     fprintf (outfile, "typedef ");
  6376.         if (SYMBOL_TYPE (symbol))
  6377.       {
  6378.         type_print_1 (SYMBOL_TYPE (symbol), SYMBOL_NAME (symbol),
  6379.               outfile, 1, depth);
  6380. !       fprintf (outfile, "; ");
  6381.       }
  6382.         else
  6383. !     fprintf (outfile, "%s ", SYMBOL_NAME (symbol));
  6384.   
  6385.         switch (SYMBOL_CLASS (symbol))
  6386.       {
  6387.       case LOC_CONST:
  6388. !       fprintf (outfile, "const %d (0x%x),",
  6389.              SYMBOL_VALUE (symbol), SYMBOL_VALUE (symbol));
  6390.         break;
  6391.   
  6392.       case LOC_CONST_BYTES:
  6393. !       fprintf (outfile, "const %d hex bytes:",
  6394.              TYPE_LENGTH (SYMBOL_TYPE (symbol)));
  6395.         {
  6396.           int i;
  6397.           for (i = 0; i < TYPE_LENGTH (SYMBOL_TYPE (symbol)); i++)
  6398. !           fprintf (outfile, " %2x", SYMBOL_VALUE_BYTES (symbol) [i]);
  6399. !         fprintf (outfile, ",");
  6400.         }
  6401.         break;
  6402.   
  6403.       case LOC_STATIC:
  6404. !       fprintf (outfile, "static at 0x%x,", SYMBOL_VALUE (symbol));
  6405.         break;
  6406.   
  6407.       case LOC_REGISTER:
  6408. !       fprintf (outfile, "register %d,", SYMBOL_VALUE (symbol));
  6409.         break;
  6410.   
  6411.       case LOC_ARG:
  6412. !       fprintf (outfile, "arg at 0x%x,", SYMBOL_VALUE (symbol));
  6413.         break;
  6414.   
  6415.       case LOC_LOCAL:
  6416. !       fprintf (outfile, "local at 0x%x,", SYMBOL_VALUE (symbol));
  6417.         break;
  6418.   
  6419.       case LOC_TYPEDEF:
  6420. --- 467,519 ----
  6421.              SYMBOL_NAME (symbol));
  6422.         type_print_1 (SYMBOL_TYPE (symbol), "", outfile, 1, depth);
  6423.       }
  6424. !       fprintf_filtered (outfile, ";\n");
  6425.       }
  6426.     else
  6427.       {
  6428.         if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF)
  6429. !     fprintf_filtered (outfile, "typedef ");
  6430.         if (SYMBOL_TYPE (symbol))
  6431.       {
  6432.         type_print_1 (SYMBOL_TYPE (symbol), SYMBOL_NAME (symbol),
  6433.               outfile, 1, depth);
  6434. !       fprintf_filtered (outfile, "; ");
  6435.       }
  6436.         else
  6437. !     fprintf_filtered (outfile, "%s ", SYMBOL_NAME (symbol));
  6438.   
  6439.         switch (SYMBOL_CLASS (symbol))
  6440.       {
  6441.       case LOC_CONST:
  6442. !       fprintf_filtered (outfile, "const %d (0x%x),",
  6443.              SYMBOL_VALUE (symbol), SYMBOL_VALUE (symbol));
  6444.         break;
  6445.   
  6446.       case LOC_CONST_BYTES:
  6447. !       fprintf_filtered (outfile, "const %d hex bytes:",
  6448.              TYPE_LENGTH (SYMBOL_TYPE (symbol)));
  6449.         {
  6450.           int i;
  6451.           for (i = 0; i < TYPE_LENGTH (SYMBOL_TYPE (symbol)); i++)
  6452. !           fprintf_filtered (outfile, " %2x", SYMBOL_VALUE_BYTES (symbol) [i]);
  6453. !         fprintf_filtered (outfile, ",");
  6454.         }
  6455.         break;
  6456.   
  6457.       case LOC_STATIC:
  6458. !       fprintf_filtered (outfile, "static at 0x%x,", SYMBOL_VALUE (symbol));
  6459.         break;
  6460.   
  6461.       case LOC_REGISTER:
  6462. !       fprintf_filtered (outfile, "register %d,", SYMBOL_VALUE (symbol));
  6463.         break;
  6464.   
  6465.       case LOC_ARG:
  6466. !       fprintf_filtered (outfile, "arg at 0x%x,", SYMBOL_VALUE (symbol));
  6467.         break;
  6468.   
  6469.       case LOC_LOCAL:
  6470. !       fprintf_filtered (outfile, "local at 0x%x,", SYMBOL_VALUE (symbol));
  6471.         break;
  6472.   
  6473.       case LOC_TYPEDEF:
  6474. ***************
  6475. *** 520,536 ****
  6476.         break;
  6477.   
  6478.       case LOC_LABEL:
  6479. !       fprintf (outfile, "label at 0x%x", SYMBOL_VALUE (symbol));
  6480.         break;
  6481.   
  6482.       case LOC_BLOCK:
  6483. !       fprintf (outfile, "block (object 0x%x) starting at 0x%x,",
  6484.              SYMBOL_VALUE (symbol),
  6485.              BLOCK_START (SYMBOL_BLOCK_VALUE (symbol)));
  6486.         break;
  6487.       }
  6488.       }
  6489. !   fprintf (outfile, "\n");
  6490.   }
  6491.   
  6492.   /* Return the nexting depth of a block within other blocks in its symtab.  */
  6493. --- 520,536 ----
  6494.         break;
  6495.   
  6496.       case LOC_LABEL:
  6497. !       fprintf_filtered (outfile, "label at 0x%x", SYMBOL_VALUE (symbol));
  6498.         break;
  6499.   
  6500.       case LOC_BLOCK:
  6501. !       fprintf_filtered (outfile, "block (object 0x%x) starting at 0x%x,",
  6502.              SYMBOL_VALUE (symbol),
  6503.              BLOCK_START (SYMBOL_BLOCK_VALUE (symbol)));
  6504.         break;
  6505.       }
  6506.       }
  6507. !   fprintf_filtered (outfile, "\n");
  6508.   }
  6509.   
  6510.   /* Return the nexting depth of a block within other blocks in its symtab.  */
  6511. *** 1.7    1991/10/05 20:59:54
  6512. --- symtab.c    1992/01/14 20:06:09
  6513. ***************
  6514. *** 49,76 ****
  6515.   struct type *builtin_type_float;
  6516.   struct type *builtin_type_double;
  6517.   
  6518. ! /* Lookup the symbol table of a source file named NAME.  */
  6519.   
  6520. ! struct symtab *
  6521. ! lookup_symtab (name)
  6522.        char *name;
  6523.   {
  6524.     register struct symtab *s;
  6525.     register char *copy;
  6526.   
  6527.     for (s = symtab_list; s; s = s->next)
  6528.       if (!strcmp (name, s->filename))
  6529.         return s;
  6530.   
  6531.     /* If name not found as specified, see if adding ".c" helps.  */
  6532.   
  6533.     copy = (char *) alloca (strlen (name) + 3);
  6534.     strcpy (copy, name);
  6535.     strcat (copy, ".c");
  6536. !   for (s = symtab_list; s; s = s->next)
  6537. !     if (!strcmp (copy, s->filename))
  6538. !       return s;
  6539.   
  6540.     return 0;
  6541.   }
  6542.   
  6543. --- 49,109 ----
  6544.   struct type *builtin_type_float;
  6545.   struct type *builtin_type_double;
  6546.   
  6547. ! /* Lookup the symbol table of a source file named NAME.  Try a couple
  6548. !    of variations if the first lookup doesn't work.  */
  6549.   
  6550. ! static struct symtab *
  6551. ! lookup_symtab_1 (name)
  6552.        char *name;
  6553.   {
  6554.     register struct symtab *s;
  6555.     register char *copy;
  6556. +   register char *slash;
  6557. +   extern char *strchr();
  6558.   
  6559.     for (s = symtab_list; s; s = s->next)
  6560.       if (!strcmp (name, s->filename))
  6561.         return s;
  6562.   
  6563. +     if(!(slash = strchr (name, '/')))
  6564. +       slash = strchr (name, '\\');
  6565. +   if (!slash)
  6566. +   {
  6567. +       int len = strlen(name);
  6568. +       
  6569. +       for (s = symtab_list; s; s = s->next)
  6570. +       {
  6571. +       int l = strlen (s->filename);
  6572. +       if (s->filename[l - len -1] == *slash
  6573. +           && !strcmp (s->filename + l - len, name))
  6574. +         return s;
  6575. +       }
  6576. +   }
  6577. +   
  6578. +   return 0;
  6579. + }
  6580. + struct symtab *
  6581. + lookup_symtab (name)
  6582. +      char *name;
  6583. + {
  6584. +   register struct symtab *s;
  6585. +   register char *copy;
  6586. +   s = lookup_symtab_1 (name);
  6587. +   if (s) return s;
  6588.     /* If name not found as specified, see if adding ".c" helps.  */
  6589.   
  6590.     copy = (char *) alloca (strlen (name) + 3);
  6591.     strcpy (copy, name);
  6592.     strcat (copy, ".c");
  6593. !   s = lookup_symtab_1 (copy);
  6594. !   if (s) return s;
  6595.   
  6596. +   /* We didn't find anything; die.  */
  6597.     return 0;
  6598.   }
  6599.   
  6600. ***************
  6601. *** 230,235 ****
  6602. --- 263,269 ----
  6603.     return ptype;
  6604.   }
  6605.   
  6606. + #if 0
  6607.   /* Smash TYPE to be a type of pointers to TO_TYPE.
  6608.      If TO_TYPE is not permanent and has no pointer-type yet,
  6609.      record TYPE as its pointer-type.  */
  6610. ***************
  6611. *** 283,288 ****
  6612. --- 317,323 ----
  6613.         TYPE_FUNCTION_TYPE (to_type) = type;
  6614.       }
  6615.   }
  6616. + #endif
  6617.   
  6618.   static struct symbol *lookup_block_symbol ();
  6619.   static int lookup_misc_func ();
  6620. ***************
  6621. *** 625,631 ****
  6622.       return 0;
  6623.     l = LINETABLE (symtab);
  6624.     Index = find_line_common(l, line, &dummy);
  6625. !   return Index ? l->item[Index].pc : 0;
  6626.   }
  6627.   
  6628.   /* Find the range of pc values in a line.
  6629. --- 660,666 ----
  6630.       return 0;
  6631.     l = LINETABLE (symtab);
  6632.     Index = find_line_common(l, line, &dummy);
  6633. !   return (Index >= 0) ? l->item[Index].pc : 0;
  6634.   }
  6635.   
  6636.   /* Find the range of pc values in a line.
  6637. ***************
  6638. *** 651,657 ****
  6639.   
  6640.     l = LINETABLE (symtab);
  6641.     Index = find_line_common (l, thisline, &exact_match);
  6642. !   if (Index)
  6643.       {
  6644.         *startptr = l->item[Index].pc;
  6645.         /* If we have not seen an entry for the specified line,
  6646. --- 686,692 ----
  6647.   
  6648.     l = LINETABLE (symtab);
  6649.     Index = find_line_common (l, thisline, &exact_match);
  6650. !   if (Index >= 0)
  6651.       {
  6652.         *startptr = l->item[Index].pc;
  6653.         /* If we have not seen an entry for the specified line,
  6654. ***************
  6655. *** 661,667 ****
  6656.         else
  6657.       /* Perhaps the following entry is for the following line.
  6658.          It's worth a try.  */
  6659. !     if (l->item[Index+1].line == thisline + 1)
  6660.         *endptr = l->item[Index+1].pc;
  6661.       else
  6662.         *endptr = find_line_pc (symtab, thisline+1);
  6663. --- 696,702 ----
  6664.         else
  6665.       /* Perhaps the following entry is for the following line.
  6666.          It's worth a try.  */
  6667. !     if (Index+1 < l->nitems && l->item[Index+1].line == thisline + 1)
  6668.         *endptr = l->item[Index+1].pc;
  6669.       else
  6670.         *endptr = find_line_pc (symtab, thisline+1);
  6671. ***************
  6672. *** 690,702 ****
  6673.        or 0 if none has been seen so far.
  6674.        BEST_INDEX identifies the item for it.  */
  6675.   
  6676. !   int best_index = 0;
  6677.     int best = 0;
  6678.   
  6679.     int nextline = -1;
  6680.   
  6681.     if (lineno <= 0)
  6682. !     return 0;
  6683.   
  6684.     len = l->nitems;
  6685.     for (i = 0; i < len; i++)
  6686. --- 725,737 ----
  6687.        or 0 if none has been seen so far.
  6688.        BEST_INDEX identifies the item for it.  */
  6689.   
  6690. !   int best_index = -1;
  6691.     int best = 0;
  6692.   
  6693.     int nextline = -1;
  6694.   
  6695.     if (lineno <= 0)
  6696. !     return -1;
  6697.   
  6698.     len = l->nitems;
  6699.     for (i = 0; i < len; i++)
  6700. ***************
  6701. *** 974,1004 ****
  6702.   
  6703.     if (symtab_list == 0)
  6704.       {
  6705. !       printf ("No symbol table is loaded.\n");
  6706.         return;
  6707.       }
  6708. !   printf ("Source files for which symbol table is known:\n");
  6709.     for (s = symtab_list; s; s = s->next)
  6710.       {
  6711.         if (column != 0 && column + strlen (s->filename) >= 70)
  6712.       {
  6713. !       printf ("\n");
  6714.         column = 0;
  6715.       }
  6716.         else if (column != 0)
  6717.       {
  6718. !       printf (" ");
  6719.         column++;
  6720.       }
  6721. !       printf ("%s", s->filename);
  6722.         column += strlen (s->filename);
  6723.         if (s->next)
  6724.       {
  6725. !       printf (",");
  6726.         column++;
  6727.       }
  6728.       }
  6729. !   printf ("\n");
  6730.   }
  6731.   
  6732.   /* List all symbols (if REGEXP is 0) or all symbols matching REGEXP.
  6733. --- 1009,1039 ----
  6734.   
  6735.     if (symtab_list == 0)
  6736.       {
  6737. !      printf_filtered ("No symbol table is loaded.\n");
  6738.         return;
  6739.       }
  6740. !  printf_filtered ("Source files for which symbol table is known:\n");
  6741.     for (s = symtab_list; s; s = s->next)
  6742.       {
  6743.         if (column != 0 && column + strlen (s->filename) >= 70)
  6744.       {
  6745. !      printf_filtered ("\n");
  6746.         column = 0;
  6747.       }
  6748.         else if (column != 0)
  6749.       {
  6750. !      printf_filtered (" ");
  6751.         column++;
  6752.       }
  6753. !      printf_filtered ("%s", s->filename);
  6754.         column += strlen (s->filename);
  6755.         if (s->next)
  6756.       {
  6757. !      printf_filtered (",");
  6758.         column++;
  6759.       }
  6760.       }
  6761. !  printf_filtered ("\n");
  6762.   }
  6763.   
  6764.   /* List all symbols (if REGEXP is 0) or all symbols matching REGEXP.
  6765. ***************
  6766. *** 1009,1015 ****
  6767.   #define MORE  \
  6768.   { print_count++;        \
  6769.     if (print_count >= 21)    \
  6770. !     { printf ("--Type Return to print more--");    \
  6771.         print_count = 0;        \
  6772.         fflush (stdout);        \
  6773.         read_line (); } }
  6774. --- 1044,1050 ----
  6775.   #define MORE  \
  6776.   { print_count++;        \
  6777.     if (print_count >= 21)    \
  6778. !     {printf_filtered ("--Type Return to print more--");    \
  6779.         print_count = 0;        \
  6780.         fflush (stdout);        \
  6781.         read_line (); } }
  6782. ***************
  6783. *** 1037,1043 ****
  6784.       if (val = (char *) re_comp (regexp))
  6785.         error ("Invalid regexp: %s", val);
  6786.   
  6787. !   printf (regexp
  6788.         ? "All %ss matching regular expression \"%s\":\n"
  6789.         : "All defined %ss:\n",
  6790.         classnames[class],
  6791. --- 1072,1078 ----
  6792.       if (val = (char *) re_comp (regexp))
  6793.         error ("Invalid regexp: %s", val);
  6794.   
  6795. !  printf_filtered (regexp
  6796.         ? "All %ss matching regular expression \"%s\":\n"
  6797.         : "All defined %ss:\n",
  6798.         classnames[class],
  6799. ***************
  6800. *** 1071,1086 ****
  6801.             {
  6802.               if (!found_in_file)
  6803.                 {
  6804. !             printf ("\nFile %s:\n", s->filename);
  6805.               print_count += 2;
  6806.                 }
  6807.               found_in_file = 1;
  6808.               MORE;
  6809.               if (class != 2 && i == 1)
  6810. !               printf ("static ");
  6811.               if (class == 2
  6812.               && SYMBOL_NAMESPACE (sym) != STRUCT_NAMESPACE)
  6813. !               printf ("typedef ");
  6814.   
  6815.               type_print (SYMBOL_TYPE (sym),
  6816.                   (SYMBOL_CLASS (sym) == LOC_TYPEDEF
  6817. --- 1106,1121 ----
  6818.             {
  6819.               if (!found_in_file)
  6820.                 {
  6821. !         printf_filtered ("\nFile %s:\n", s->filename);
  6822.               print_count += 2;
  6823.                 }
  6824.               found_in_file = 1;
  6825.               MORE;
  6826.               if (class != 2 && i == 1)
  6827. !              printf_filtered ("static ");
  6828.               if (class == 2
  6829.               && SYMBOL_NAMESPACE (sym) != STRUCT_NAMESPACE)
  6830. !              printf_filtered ("typedef ");
  6831.   
  6832.               type_print (SYMBOL_TYPE (sym),
  6833.                   (SYMBOL_CLASS (sym) == LOC_TYPEDEF
  6834. ***************
  6835. *** 1091,1098 ****
  6836.               && (TYPE_NAME ((SYMBOL_TYPE (sym))) == 0
  6837.                   || 0 != strcmp (TYPE_NAME ((SYMBOL_TYPE (sym))),
  6838.                           SYMBOL_NAME (sym))))
  6839. !               printf (" %s", SYMBOL_NAME (sym));
  6840. !             printf (";\n");
  6841.             }
  6842.             }
  6843.         }
  6844. --- 1126,1133 ----
  6845.               && (TYPE_NAME ((SYMBOL_TYPE (sym))) == 0
  6846.                   || 0 != strcmp (TYPE_NAME ((SYMBOL_TYPE (sym))),
  6847.                           SYMBOL_NAME (sym))))
  6848. !              printf_filtered (" %s", SYMBOL_NAME (sym));
  6849. !            printf_filtered (";\n");
  6850.             }
  6851.             }
  6852.         }
  6853. *** 1.4    1991/09/15 21:31:53
  6854. --- utils.c    1992/01/14 20:06:09
  6855. ***************
  6856. *** 208,214 ****
  6857.     strcat (combined, ": ");
  6858.     strcat (combined, err);
  6859.   
  6860. !   printf ("%s.\n", combined);
  6861.   }
  6862.   
  6863.   void
  6864. --- 208,214 ----
  6865.     strcat (combined, ": ");
  6866.     strcat (combined, err);
  6867.   
  6868. !  printf_filtered ("%s.\n", combined);
  6869.   }
  6870.   
  6871.   void
  6872. ***************
  6873. *** 240,246 ****
  6874.   }
  6875.   
  6876.   /* Print an error message and return to command level.
  6877. !    STRING is the error message, used as a fprintf string,
  6878.      and ARG is passed as an argument to it.  */
  6879.   
  6880.   void
  6881. --- 240,246 ----
  6882.   }
  6883.   
  6884.   /* Print an error message and return to command level.
  6885. !    STRING is the error message, used as a fprintf_filtered string,
  6886.      and ARG is passed as an argument to it.  */
  6887.   
  6888.   void
  6889. ***************
  6890. *** 249,263 ****
  6891.        int arg1, arg2, arg3;
  6892.   {
  6893.     fflush (stdout);
  6894. !   fprintf (stderr, "\n");
  6895. !   fprintf (stderr, string, arg1, arg2, arg3);
  6896. !   fprintf (stderr, "\n");
  6897.     return_to_top_level ();
  6898.   }
  6899.   
  6900.   /* Print an error message and exit reporting failure.
  6901.      This is for a error that we cannot continue from.
  6902. !    STRING and ARG are passed to fprintf.  */
  6903.   
  6904.   void
  6905.   fatal (string, arg)
  6906. --- 249,263 ----
  6907.        int arg1, arg2, arg3;
  6908.   {
  6909.     fflush (stdout);
  6910. !   fprintf_filtered (stderr, "\n");
  6911. !   fprintf_filtered (stderr, string, arg1, arg2, arg3);
  6912. !   fprintf_filtered (stderr, "\n");
  6913.     return_to_top_level ();
  6914.   }
  6915.   
  6916.   /* Print an error message and exit reporting failure.
  6917.      This is for a error that we cannot continue from.
  6918. !    STRING and ARG are passed to fprintf_filtered.  */
  6919.   
  6920.   void
  6921.   fatal (string, arg)
  6922. ***************
  6923. *** 264,273 ****
  6924.        char *string;
  6925.        int arg;
  6926.   {
  6927. !   fprintf (stderr, "gdb: ");
  6928. !   fprintf (stderr, string, arg);
  6929. !   fprintf (stderr, "\n");
  6930. !   exit (1);
  6931.   }
  6932.   
  6933.   /* Make a copy of the string at PTR with SIZE characters
  6934. --- 264,275 ----
  6935.        char *string;
  6936.        int arg;
  6937.   {
  6938. !   extern void really_exit();
  6939. !   fprintf_filtered (stderr, "gdb: ");
  6940. !   fprintf_filtered (stderr, string, arg);
  6941. !   fprintf_filtered (stderr, "\n");
  6942. !   really_exit (1);
  6943.   }
  6944.   
  6945.   /* Make a copy of the string at PTR with SIZE characters
  6946. ***************
  6947. *** 303,309 ****
  6948.        register FILE *file;
  6949.   {
  6950.     while (n-- > 0)
  6951. !     fputc (' ', file);
  6952.   }
  6953.   
  6954.   /* Ask user a y-or-n question and return 1 iff answer is yes.
  6955. --- 305,311 ----
  6956.        register FILE *file;
  6957.   {
  6958.     while (n-- > 0)
  6959. !     fputc_filtered (' ', file);
  6960.   }
  6961.   
  6962.   /* Ask user a y-or-n question and return 1 iff answer is yes.
  6963. ***************
  6964. *** 323,330 ****
  6965.   
  6966.     while (1)
  6967.       {
  6968. !       printf (ctlstr, arg1, arg2);
  6969. !       printf ("(y or n) ");
  6970.         fflush (stdout);
  6971.         answer = fgetc (stdin);
  6972.         clearerr (stdin);        /* in case of C-d */
  6973. --- 325,332 ----
  6974.   
  6975.     while (1)
  6976.       {
  6977. !      printf(ctlstr, arg1, arg2);
  6978. !      printf ("(y or n) ");
  6979.         fflush (stdout);
  6980.         answer = fgetc (stdin);
  6981.         clearerr (stdin);        /* in case of C-d */
  6982. ***************
  6983. *** 338,344 ****
  6984.       return 1;
  6985.         if (answer == 'N')
  6986.       return 0;
  6987. !       printf ("Please answer y or n.\n");
  6988.       }
  6989.   }
  6990.   
  6991. --- 340,346 ----
  6992.       return 1;
  6993.         if (answer == 'N')
  6994.       return 0;
  6995. !      printf ("Please answer y or n.\n");
  6996.       }
  6997.   }
  6998.   
  6999. ***************
  7000. *** 432,458 ****
  7001.     if (c < 040 || c >= 0177)
  7002.       {
  7003.         if (c == '\n')
  7004. !     fprintf (stream, "\\n");
  7005.         else if (c == '\b')
  7006. !     fprintf (stream, "\\b");
  7007.         else if (c == '\t')
  7008. !     fprintf (stream, "\\t");
  7009.         else if (c == '\f')
  7010. !     fprintf (stream, "\\f");
  7011.         else if (c == '\r')
  7012. !     fprintf (stream, "\\r");
  7013.         else if (c == 033)
  7014. !     fprintf (stream, "\\e");
  7015.         else if (c == '\a')
  7016. !     fprintf (stream, "\\a");
  7017.         else
  7018. !     fprintf (stream, "\\%03o", c);
  7019.       }
  7020.     else
  7021.       {
  7022.         if (c == '\\' || c == '"' || c == '\'')
  7023. !     fputc ('\\', stream);
  7024. !       fputc (c, stream);
  7025.       }
  7026.   }
  7027.   #ifdef atarist
  7028. --- 434,460 ----
  7029.     if (c < 040 || c >= 0177)
  7030.       {
  7031.         if (c == '\n')
  7032. !     fprintf_filtered (stream, "\\n");
  7033.         else if (c == '\b')
  7034. !     fprintf_filtered (stream, "\\b");
  7035.         else if (c == '\t')
  7036. !     fprintf_filtered (stream, "\\t");
  7037.         else if (c == '\f')
  7038. !     fprintf_filtered (stream, "\\f");
  7039.         else if (c == '\r')
  7040. !     fprintf_filtered (stream, "\\r");
  7041.         else if (c == 033)
  7042. !     fprintf_filtered (stream, "\\e");
  7043.         else if (c == '\a')
  7044. !     fprintf_filtered (stream, "\\a");
  7045.         else
  7046. !     fprintf_filtered (stream, "\\%03o", c);
  7047.       }
  7048.     else
  7049.       {
  7050.         if (c == '\\' || c == '"' || c == '\'')
  7051. !     fputc_filtered ('\\', stream);
  7052. !       fputc_filtered (c, stream);
  7053.       }
  7054.   }
  7055.   #ifdef atarist
  7056. *** 1.3    1991/10/05 20:59:54
  7057. --- valprint.c    1992/01/14 20:06:10
  7058. ***************
  7059. *** 50,56 ****
  7060.   
  7061.     if (val == 0)
  7062.     {
  7063. !       printf ("<address of value unknown>");
  7064.         return 0;
  7065.     }
  7066.   
  7067. --- 50,56 ----
  7068.   
  7069.     if (val == 0)
  7070.     {
  7071. !      printf_filtered ("<address of value unknown>");
  7072.         return 0;
  7073.     }
  7074.   
  7075. ***************
  7076. *** 62,73 ****
  7077.       {
  7078.         n = VALUE_REPETITIONS (val);
  7079.         typelen = TYPE_LENGTH (VALUE_TYPE (val));
  7080. !       fputc ('{', stream);
  7081.         /* Print arrays of characters using string syntax.  */
  7082.         if (typelen == 1 && TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT
  7083.         && format == 0)
  7084.       {
  7085. !       fputc ('"', stream);
  7086.         for (i = 0; i < n && i < print_max; i++)
  7087.           {
  7088.             QUIT;
  7089. --- 62,73 ----
  7090.       {
  7091.         n = VALUE_REPETITIONS (val);
  7092.         typelen = TYPE_LENGTH (VALUE_TYPE (val));
  7093. !       fputc_filtered ('{', stream);
  7094.         /* Print arrays of characters using string syntax.  */
  7095.         if (typelen == 1 && TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT
  7096.         && format == 0)
  7097.       {
  7098. !       fputc_filtered ('"', stream);
  7099.         for (i = 0; i < n && i < print_max; i++)
  7100.           {
  7101.             QUIT;
  7102. ***************
  7103. *** 74,81 ****
  7104.             printchar (VALUE_CONTENTS (val)[i], stream);
  7105.           }
  7106.         if (i < n)
  7107. !         fprintf (stream, "...");
  7108. !       fputc ('"', stream);
  7109.       }
  7110.         else
  7111.       {
  7112. --- 74,81 ----
  7113.             printchar (VALUE_CONTENTS (val)[i], stream);
  7114.           }
  7115.         if (i < n)
  7116. !         fprintf_filtered (stream, "...");
  7117. !       fputc_filtered ('"', stream);
  7118.       }
  7119.         else
  7120.       {
  7121. ***************
  7122. *** 82,95 ****
  7123.         for (i = 0; i < n && i < print_max; i++)
  7124.           {
  7125.             if (i)
  7126. !         fprintf (stream, ", ");
  7127.             val_print (VALUE_TYPE (val), VALUE_CONTENTS (val) + typelen * i,
  7128.                VALUE_ADDRESS (val) + typelen * i, stream, format);
  7129.           }
  7130.         if (i < n)
  7131. !         fprintf (stream, "...");
  7132.       }
  7133. !       fputc ('}', stream);
  7134.         return n * typelen;
  7135.       }
  7136.     else
  7137. --- 82,95 ----
  7138.         for (i = 0; i < n && i < print_max; i++)
  7139.           {
  7140.             if (i)
  7141. !         fprintf_filtered (stream, ", ");
  7142.             val_print (VALUE_TYPE (val), VALUE_CONTENTS (val) + typelen * i,
  7143.                VALUE_ADDRESS (val) + typelen * i, stream, format);
  7144.           }
  7145.         if (i < n)
  7146. !         fprintf_filtered (stream, "...");
  7147.       }
  7148. !       fputc_filtered ('}', stream);
  7149.         return n * typelen;
  7150.       }
  7151.     else
  7152. ***************
  7153. *** 98,106 ****
  7154.         /* If it is a pointer, indicate what it points to.  */
  7155.         if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_PTR)
  7156.       {
  7157. !       fprintf (stream, "(");
  7158.         type_print (VALUE_TYPE (val), "", stream, -1);
  7159. !       fprintf (stream, ") ");
  7160.       }
  7161.         return val_print (VALUE_TYPE (val), VALUE_CONTENTS (val),
  7162.               VALUE_ADDRESS (val), stream, format);
  7163. --- 98,106 ----
  7164.         /* If it is a pointer, indicate what it points to.  */
  7165.         if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_PTR)
  7166.       {
  7167. !       fprintf_filtered (stream, "(");
  7168.         type_print (VALUE_TYPE (val), "", stream, -1);
  7169. !       fprintf_filtered (stream, ") ");
  7170.       }
  7171.         return val_print (VALUE_TYPE (val), VALUE_CONTENTS (val),
  7172.               VALUE_ADDRESS (val), stream, format);
  7173. ***************
  7174. *** 140,151 ****
  7175.         elttype = TYPE_TARGET_TYPE (type);
  7176.         eltlen = TYPE_LENGTH (elttype);
  7177.         len = TYPE_LENGTH (type) / eltlen;
  7178. !       fprintf (stream, "{");
  7179.         /* For an array of chars, print with string syntax.  */
  7180.         if (eltlen == 1 && TYPE_CODE (elttype) == TYPE_CODE_INT
  7181.             && format == 0)
  7182.           {
  7183. !           fputc ('"', stream);
  7184.             for (i = 0; i < len && i < print_max; i++)
  7185.           {
  7186.             QUIT;
  7187. --- 140,151 ----
  7188.         elttype = TYPE_TARGET_TYPE (type);
  7189.         eltlen = TYPE_LENGTH (elttype);
  7190.         len = TYPE_LENGTH (type) / eltlen;
  7191. !       fprintf_filtered (stream, "{");
  7192.         /* For an array of chars, print with string syntax.  */
  7193.         if (eltlen == 1 && TYPE_CODE (elttype) == TYPE_CODE_INT
  7194.             && format == 0)
  7195.           {
  7196. !           fputc_filtered ('"', stream);
  7197.             for (i = 0; i < len && i < print_max; i++)
  7198.           {
  7199.             QUIT;
  7200. ***************
  7201. *** 152,172 ****
  7202.             printchar (valaddr[i], stream);
  7203.           }
  7204.             if (i < len)
  7205. !         fprintf (stream, "...");
  7206. !           fputc ('"', stream);
  7207.           }
  7208.         else
  7209.           {
  7210.             for (i = 0; i < len && i < print_max; i++)
  7211.           {
  7212. !           if (i) fprintf (stream, ", ");
  7213.             val_print (elttype, valaddr + i * eltlen,
  7214.                    0, stream, format);
  7215.           }
  7216.             if (i < len)
  7217. !         fprintf (stream, "...");
  7218.           }
  7219. !       fprintf (stream, "}");
  7220.         break;
  7221.       }
  7222.         /* Array of unspecified length: treat like pointer.  */
  7223. --- 152,172 ----
  7224.             printchar (valaddr[i], stream);
  7225.           }
  7226.             if (i < len)
  7227. !         fprintf_filtered (stream, "...");
  7228. !           fputc_filtered ('"', stream);
  7229.           }
  7230.         else
  7231.           {
  7232.             for (i = 0; i < len && i < print_max; i++)
  7233.           {
  7234. !           if (i) fprintf_filtered (stream, ", ");
  7235.             val_print (elttype, valaddr + i * eltlen,
  7236.                    0, stream, format);
  7237.           }
  7238.             if (i < len)
  7239. !         fprintf_filtered (stream, "...");
  7240.           }
  7241. !       fprintf_filtered (stream, "}");
  7242.         break;
  7243.       }
  7244.         /* Array of unspecified length: treat like pointer.  */
  7245. ***************
  7246. *** 178,184 ****
  7247.         print_scalar_formatted (valaddr, type, format, 0, stream);
  7248.         break;
  7249.       }
  7250. !       fprintf (stream, "0x%x", * (int *) valaddr);
  7251.         /* For a pointer to char or unsigned char,
  7252.        also print the string pointed to, unless pointer is null.  */
  7253.   
  7254. --- 178,184 ----
  7255.         print_scalar_formatted (valaddr, type, format, 0, stream);
  7256.         break;
  7257.       }
  7258. !       fprintf_filtered (stream, "0x%x", * (int *) valaddr);
  7259.         /* For a pointer to char or unsigned char,
  7260.        also print the string pointed to, unless pointer is null.  */
  7261.   
  7262. ***************
  7263. *** 188,195 ****
  7264.         && format == 0
  7265.         && unpack_long (type, valaddr) != 0)
  7266.       {
  7267. !       fputc (' ', stream);
  7268. !       fputc ('"', stream);
  7269.         for (i = 0; i < print_max; i++)
  7270.           {
  7271.             QUIT;
  7272. --- 188,195 ----
  7273.         && format == 0
  7274.         && unpack_long (type, valaddr) != 0)
  7275.       {
  7276. !       fputc_filtered (' ', stream);
  7277. !       fputc_filtered ('"', stream);
  7278.         for (i = 0; i < print_max; i++)
  7279.           {
  7280.             QUIT;
  7281. ***************
  7282. *** 198,206 ****
  7283.           break;
  7284.             printchar (c, stream);
  7285.           }
  7286. !       fputc ('"', stream);
  7287.         if (i == print_max)
  7288. !         fprintf (stream, "...");
  7289.         fflush (stream);
  7290.         /* Return number of characters printed, plus one for the
  7291.            terminating null if we have "reached the end".  */
  7292. --- 198,206 ----
  7293.           break;
  7294.             printchar (c, stream);
  7295.           }
  7296. !       fputc_filtered ('"', stream);
  7297.         if (i == print_max)
  7298. !         fprintf_filtered (stream, "...");
  7299.         fflush (stream);
  7300.         /* Return number of characters printed, plus one for the
  7301.            terminating null if we have "reached the end".  */
  7302. ***************
  7303. *** 210,221 ****
  7304.   
  7305.       case TYPE_CODE_STRUCT:
  7306.       case TYPE_CODE_UNION:
  7307. !       fprintf (stream, "{");
  7308.         len = TYPE_NFIELDS (type);
  7309.         for (i = 0; i < len; i++)
  7310.       {
  7311. !       if (i) fprintf (stream, ", ");
  7312. !       fprintf (stream, "%s = ", TYPE_FIELD_NAME (type, i));
  7313.         if (TYPE_FIELD_PACKED (type, i))
  7314.           {
  7315.             val = unpack_field_as_long (type, valaddr, i);
  7316. --- 210,221 ----
  7317.   
  7318.       case TYPE_CODE_STRUCT:
  7319.       case TYPE_CODE_UNION:
  7320. !       fprintf_filtered (stream, "{");
  7321.         len = TYPE_NFIELDS (type);
  7322.         for (i = 0; i < len; i++)
  7323.       {
  7324. !       if (i) fprintf_filtered (stream, ", ");
  7325. !       fprintf_filtered (stream, "%s = ", TYPE_FIELD_NAME (type, i));
  7326.         if (TYPE_FIELD_PACKED (type, i))
  7327.           {
  7328.             val = unpack_field_as_long (type, valaddr, i);
  7329. ***************
  7330. *** 226,232 ****
  7331.                  valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
  7332.                  0, stream, format);
  7333.       }
  7334. !       fprintf (stream, "}");
  7335.         break;
  7336.   
  7337.       case TYPE_CODE_ENUM:
  7338. --- 226,232 ----
  7339.                  valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
  7340.                  0, stream, format);
  7341.       }
  7342. !       fprintf_filtered (stream, "}");
  7343.         break;
  7344.   
  7345.       case TYPE_CODE_ENUM:
  7346. ***************
  7347. *** 244,252 ****
  7348.           break;
  7349.       }
  7350.         if (i < len)
  7351. !     fprintf (stream, "%s", TYPE_FIELD_NAME (type, i));
  7352.         else
  7353. !     fprintf (stream, "%d", val);
  7354.         break;
  7355.   
  7356.       case TYPE_CODE_FUNC:
  7357. --- 244,252 ----
  7358.           break;
  7359.       }
  7360.         if (i < len)
  7361. !     fprintf_filtered (stream, "%s", TYPE_FIELD_NAME (type, i));
  7362.         else
  7363. !     fprintf_filtered (stream, "%d", val);
  7364.         break;
  7365.   
  7366.       case TYPE_CODE_FUNC:
  7367. ***************
  7368. *** 255,264 ****
  7369.         print_scalar_formatted (valaddr, type, format, 0, stream);
  7370.         break;
  7371.       }
  7372. !       fprintf (stream, "{");
  7373.         type_print (type, "", stream, -1);
  7374. !       fprintf (stream, "} ");
  7375. !       fprintf (stream, "0x%x", address);
  7376.         break;
  7377.   
  7378.       case TYPE_CODE_INT:
  7379. --- 255,264 ----
  7380.         print_scalar_formatted (valaddr, type, format, 0, stream);
  7381.         break;
  7382.       }
  7383. !       fprintf_filtered (stream, "{");
  7384.         type_print (type, "", stream, -1);
  7385. !       fprintf_filtered (stream, "} ");
  7386. !       fprintf_filtered (stream, "0x%x", address);
  7387.         break;
  7388.   
  7389.       case TYPE_CODE_INT:
  7390. ***************
  7391. *** 267,280 ****
  7392.         print_scalar_formatted (valaddr, type, format, 0, stream);
  7393.         break;
  7394.       }
  7395. !       fprintf (stream,
  7396.              TYPE_UNSIGNED (type) ? "%u" : "%d",
  7397.              unpack_long (type, valaddr));
  7398.         if (TYPE_LENGTH (type) == 1)
  7399.       {
  7400. !       fprintf (stream, " '");
  7401.         printchar (unpack_long (type, valaddr), stream);
  7402. !       fputc ('\'', stream);
  7403.       }
  7404.         break;
  7405.   
  7406. --- 267,280 ----
  7407.         print_scalar_formatted (valaddr, type, format, 0, stream);
  7408.         break;
  7409.       }
  7410. !       fprintf_filtered (stream,
  7411.              TYPE_UNSIGNED (type) ? "%u" : "%d",
  7412.              unpack_long (type, valaddr));
  7413.         if (TYPE_LENGTH (type) == 1)
  7414.       {
  7415. !       fprintf_filtered (stream, " '");
  7416.         printchar (unpack_long (type, valaddr), stream);
  7417. !       fputc_filtered ('\'', stream);
  7418.       }
  7419.         break;
  7420.   
  7421. ***************
  7422. *** 287,301 ****
  7423.   #ifdef IEEE_FLOAT
  7424.         if (is_nan (unpack_double (type, valaddr)))
  7425.       {
  7426. !       fprintf (stream, "Nan");
  7427.         break;
  7428.       }
  7429.   #endif
  7430. !       fprintf (stream, "%g", unpack_double (type, valaddr));
  7431.         break;
  7432.   
  7433.       case TYPE_CODE_VOID:
  7434. !       fprintf (stream, "void");
  7435.         break;
  7436.   
  7437.       default:
  7438. --- 287,301 ----
  7439.   #ifdef IEEE_FLOAT
  7440.         if (is_nan (unpack_double (type, valaddr)))
  7441.       {
  7442. !       fprintf_filtered (stream, "Nan");
  7443.         break;
  7444.       }
  7445.   #endif
  7446. !       fprintf_filtered (stream, "%g", unpack_double (type, valaddr));
  7447.         break;
  7448.   
  7449.       case TYPE_CODE_VOID:
  7450. !       fprintf_filtered (stream, "void");
  7451.         break;
  7452.   
  7453.       default:
  7454. ***************
  7455. *** 373,381 ****
  7456.          &&
  7457.          (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
  7458.       || code == TYPE_CODE_ARRAY)))
  7459. !     fprintf (stream, " ");
  7460.     type_print_varspec_prefix (type, stream, show, 0);
  7461. !   fprintf (stream, "%s", varstring);
  7462.     type_print_varspec_suffix (type, stream, show, 0);
  7463.   }
  7464.   
  7465. --- 373,381 ----
  7466.          &&
  7467.          (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
  7468.       || code == TYPE_CODE_ARRAY)))
  7469. !     fprintf_filtered (stream, " ");
  7470.     type_print_varspec_prefix (type, stream, show, 0);
  7471. !   fprintf_filtered (stream, "%s", varstring);
  7472.     type_print_varspec_suffix (type, stream, show, 0);
  7473.   }
  7474.   
  7475. ***************
  7476. *** 406,412 ****
  7477.       {
  7478.       case TYPE_CODE_PTR:
  7479.         type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
  7480. !       fputc ('*', stream);
  7481.         break;
  7482.   
  7483.       case TYPE_CODE_FUNC:
  7484. --- 406,412 ----
  7485.       {
  7486.       case TYPE_CODE_PTR:
  7487.         type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
  7488. !       fputc_filtered ('*', stream);
  7489.         break;
  7490.   
  7491.       case TYPE_CODE_FUNC:
  7492. ***************
  7493. *** 413,419 ****
  7494.       case TYPE_CODE_ARRAY:
  7495.         type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
  7496.         if (passed_a_ptr)
  7497. !     fputc ('(', stream);
  7498.         break;
  7499.   
  7500.       default:
  7501. --- 413,419 ----
  7502.       case TYPE_CODE_ARRAY:
  7503.         type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 0);
  7504.         if (passed_a_ptr)
  7505. !     fputc_filtered ('(', stream);
  7506.         break;
  7507.   
  7508.       default:
  7509. ***************
  7510. *** 444,455 ****
  7511.       {
  7512.       case TYPE_CODE_ARRAY:
  7513.         if (passed_a_ptr)
  7514. !     fprintf (stream, ")");
  7515. !       fprintf (stream, "[");
  7516.         if (TYPE_LENGTH (type) >= 0)
  7517. !     fprintf (stream, "%d",
  7518.            TYPE_LENGTH (type) / TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
  7519. !       fprintf (stream, "]");
  7520.         type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0);
  7521.         break;
  7522.   
  7523. --- 444,455 ----
  7524.       {
  7525.       case TYPE_CODE_ARRAY:
  7526.         if (passed_a_ptr)
  7527. !     fprintf_filtered (stream, ")");
  7528. !       fprintf_filtered (stream, "[");
  7529.         if (TYPE_LENGTH (type) >= 0)
  7530. !     fprintf_filtered (stream, "%d",
  7531.            TYPE_LENGTH (type) / TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
  7532. !       fprintf_filtered (stream, "]");
  7533.         type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0);
  7534.         break;
  7535.   
  7536. ***************
  7537. *** 461,468 ****
  7538.         type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
  7539.                    passed_a_ptr);
  7540.         if (passed_a_ptr)
  7541. !     fprintf (stream, ")");
  7542. !       fprintf (stream, "()");
  7543.         break;
  7544.   
  7545.       default:
  7546. --- 461,468 ----
  7547.         type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
  7548.                    passed_a_ptr);
  7549.         if (passed_a_ptr)
  7550. !     fprintf_filtered (stream, ")");
  7551. !       fprintf_filtered (stream, "()");
  7552.         break;
  7553.   
  7554.       default:
  7555. ***************
  7556. *** 499,511 ****
  7557.   
  7558.     if (type == 0)
  7559.       {
  7560. !       fprintf (stream, "type unknown");
  7561.         return;
  7562.       }
  7563.   
  7564.     if (TYPE_NAME (type) && show <= 0)
  7565.       {
  7566. !       fprintf (stream, TYPE_NAME (type));
  7567.         return;
  7568.       }
  7569.   
  7570. --- 499,511 ----
  7571.   
  7572.     if (type == 0)
  7573.       {
  7574. !       fprintf_filtered (stream, "type unknown");
  7575.         return;
  7576.       }
  7577.   
  7578.     if (TYPE_NAME (type) && show <= 0)
  7579.       {
  7580. !       fprintf_filtered (stream, TYPE_NAME (type));
  7581.         return;
  7582.       }
  7583.   
  7584. ***************
  7585. *** 518,544 ****
  7586.         break;
  7587.   
  7588.       case TYPE_CODE_STRUCT:
  7589. !       fprintf (stream, "struct ");
  7590.         goto struct_union;
  7591.   
  7592.       case TYPE_CODE_UNION:
  7593. !       fprintf (stream, "union ");
  7594.       struct_union:
  7595.         if (TYPE_NAME (type) && (name = TYPE_NAME (type)))
  7596.       {
  7597.         while (*name != ' ') name++;
  7598. !       fprintf (stream, "%s ", name + 1);
  7599.       }
  7600.         if (show < 0)
  7601. !     fprintf (stream, "{...}");
  7602.         else
  7603.       {
  7604. !       fprintf (stream, "{");
  7605.         len = TYPE_NFIELDS (type);
  7606.         if(len)
  7607. !           fprintf (stream, "\n");
  7608.         else
  7609. !           fprintf(stream, "<no data fields>\n");
  7610.         for (i = 0; i < len; i++)
  7611.           {
  7612.             QUIT;
  7613. --- 518,544 ----
  7614.         break;
  7615.   
  7616.       case TYPE_CODE_STRUCT:
  7617. !       fprintf_filtered (stream, "struct ");
  7618.         goto struct_union;
  7619.   
  7620.       case TYPE_CODE_UNION:
  7621. !       fprintf_filtered (stream, "union ");
  7622.       struct_union:
  7623.         if (TYPE_NAME (type) && (name = TYPE_NAME (type)))
  7624.       {
  7625.         while (*name != ' ') name++;
  7626. !       fprintf_filtered (stream, "%s ", name + 1);
  7627.       }
  7628.         if (show < 0)
  7629. !     fprintf_filtered (stream, "{...}");
  7630.         else
  7631.       {
  7632. !       fprintf_filtered (stream, "{");
  7633.         len = TYPE_NFIELDS (type);
  7634.         if(len)
  7635. !           fprintf_filtered (stream, "\n");
  7636.         else
  7637. !           fprintf_filtered(stream, "<no data fields>\n");
  7638.         for (i = 0; i < len; i++)
  7639.           {
  7640.             QUIT;
  7641. ***************
  7642. *** 558,564 ****
  7643.                   : 0));
  7644.             if (gap != 0)
  7645.               {
  7646. !               fprintf (stream, "int : %d;\n", gap);
  7647.                 print_spaces (level + 4, stream);
  7648.               }
  7649.           }
  7650. --- 558,564 ----
  7651.                   : 0));
  7652.             if (gap != 0)
  7653.               {
  7654. !               fprintf_filtered (stream, "int : %d;\n", gap);
  7655.                 print_spaces (level + 4, stream);
  7656.               }
  7657.           }
  7658. ***************
  7659. *** 572,614 ****
  7660.             /* Print the field width.  */
  7661.   
  7662.             if (TYPE_FIELD_PACKED (type, i))
  7663. !         fprintf (stream, " : %d", TYPE_FIELD_BITSIZE (type, i));
  7664.   
  7665. !           fprintf (stream, ";\n");
  7666.           }
  7667.         print_spaces (level, stream);
  7668. !       fputc ('}', stream);
  7669.       }
  7670.         break;
  7671.   
  7672.       case TYPE_CODE_ENUM:
  7673. !       fprintf (stream, "enum ");
  7674.         if (TYPE_NAME (type))
  7675.       {
  7676.         name = TYPE_NAME (type);
  7677.         while (*name != ' ') name++;
  7678. !       fprintf (stream, "%s ", name + 1);
  7679.       }
  7680.         if (show < 0)
  7681. !     fprintf (stream, "{...}");
  7682.         else
  7683.       {
  7684. !       fprintf (stream, "{");
  7685.         len = TYPE_NFIELDS (type);
  7686.         lastval = 0;
  7687.         for (i = 0; i < len; i++)
  7688.           {
  7689.             QUIT;
  7690. !           if (i) fprintf (stream, ", ");
  7691. !           fprintf (stream, "%s", TYPE_FIELD_NAME (type, i));
  7692.             if (lastval != TYPE_FIELD_VALUE (type, i))
  7693.           {
  7694. !           fprintf (stream, " : %d", TYPE_FIELD_VALUE (type, i));
  7695.             lastval = TYPE_FIELD_VALUE (type, i);
  7696.           }
  7697.             lastval++;
  7698.           }
  7699. !       fprintf (stream, "}");
  7700.       }
  7701.         break;
  7702.   
  7703. --- 572,614 ----
  7704.             /* Print the field width.  */
  7705.   
  7706.             if (TYPE_FIELD_PACKED (type, i))
  7707. !         fprintf_filtered (stream, " : %d", TYPE_FIELD_BITSIZE (type, i));
  7708.   
  7709. !           fprintf_filtered (stream, ";\n");
  7710.           }
  7711.         print_spaces (level, stream);
  7712. !       fputc_filtered ('}', stream);
  7713.       }
  7714.         break;
  7715.   
  7716.       case TYPE_CODE_ENUM:
  7717. !       fprintf_filtered (stream, "enum ");
  7718.         if (TYPE_NAME (type))
  7719.       {
  7720.         name = TYPE_NAME (type);
  7721.         while (*name != ' ') name++;
  7722. !       fprintf_filtered (stream, "%s ", name + 1);
  7723.       }
  7724.         if (show < 0)
  7725. !     fprintf_filtered (stream, "{...}");
  7726.         else
  7727.       {
  7728. !       fprintf_filtered (stream, "{");
  7729.         len = TYPE_NFIELDS (type);
  7730.         lastval = 0;
  7731.         for (i = 0; i < len; i++)
  7732.           {
  7733.             QUIT;
  7734. !           if (i) fprintf_filtered (stream, ", ");
  7735. !           fprintf_filtered (stream, "%s", TYPE_FIELD_NAME (type, i));
  7736.             if (lastval != TYPE_FIELD_VALUE (type, i))
  7737.           {
  7738. !           fprintf_filtered (stream, " : %d", TYPE_FIELD_VALUE (type, i));
  7739.             lastval = TYPE_FIELD_VALUE (type, i);
  7740.           }
  7741.             lastval++;
  7742.           }
  7743. !       fprintf_filtered (stream, "}");
  7744.       }
  7745.         break;
  7746.   
  7747. ***************
  7748. *** 617,636 ****
  7749.       name = unsigned_type_table[TYPE_LENGTH (type)];
  7750.         else
  7751.       name = signed_type_table[TYPE_LENGTH (type)];
  7752. !       fprintf (stream, "%s", name);
  7753.         break;
  7754.   
  7755.       case TYPE_CODE_FLT:
  7756.         name = float_type_table[TYPE_LENGTH (type)];
  7757. !       fprintf (stream, "%s", name);
  7758.         break;
  7759.   
  7760.       case TYPE_CODE_VOID:
  7761. !       fprintf (stream, "void");
  7762.         break;
  7763.   
  7764.       case 0:
  7765. !       fprintf (stream, "struct unknown");
  7766.         break;
  7767.   
  7768.       default:
  7769. --- 617,636 ----
  7770.       name = unsigned_type_table[TYPE_LENGTH (type)];
  7771.         else
  7772.       name = signed_type_table[TYPE_LENGTH (type)];
  7773. !       fprintf_filtered (stream, "%s", name);
  7774.         break;
  7775.   
  7776.       case TYPE_CODE_FLT:
  7777.         name = float_type_table[TYPE_LENGTH (type)];
  7778. !       fprintf_filtered (stream, "%s", name);
  7779.         break;
  7780.   
  7781.       case TYPE_CODE_VOID:
  7782. !       fprintf_filtered (stream, "void");
  7783.         break;
  7784.   
  7785.       case 0:
  7786. !       fprintf_filtered (stream, "struct unknown");
  7787.         break;
  7788.   
  7789.       default:
  7790. *** 1.6    1991/10/05 20:59:54
  7791. --- values.c    1992/01/14 20:06:10
  7792. ***************
  7793. *** 283,291 ****
  7794.     for (i = num; i < num + 10 && i <= value_history_count; i++)
  7795.       {
  7796.         val = access_value_history (i);
  7797. !       printf ("$%d = ", i);
  7798.         value_print (val, stdout, 0);
  7799. !       printf ("\n");
  7800.       }
  7801.   }
  7802.   
  7803. --- 283,291 ----
  7804.     for (i = num; i < num + 10 && i <= value_history_count; i++)
  7805.       {
  7806.         val = access_value_history (i);
  7807. !      printf_filtered ("$%d = ", i);
  7808.         value_print (val, stdout, 0);
  7809. !      printf_filtered ("\n");
  7810.       }
  7811.   }
  7812.   
  7813. ***************
  7814. *** 387,403 ****
  7815.     register struct internalvar *var;
  7816.   
  7817.     if (internalvars)
  7818. !     printf ("Debugger convenience variables:\n\n");
  7819.     else
  7820. !     printf ("No debugger convenience variables now defined.\n\
  7821.   Convenience variables have names starting with \"$\";\n\
  7822.   use \"set\" as in \"set $foo = 5\" to define them.\n");
  7823.   
  7824.     for (var = internalvars; var; var = var->next)
  7825.       {
  7826. !       printf ("$%s: ", var->name);
  7827.         value_print (var->value, stdout, 0);
  7828. !       printf ("\n");
  7829.       }
  7830.   }
  7831.   
  7832. --- 387,403 ----
  7833.     register struct internalvar *var;
  7834.   
  7835.     if (internalvars)
  7836. !    printf_filtered ("Debugger convenience variables:\n\n");
  7837.     else
  7838. !    printf_filtered ("No debugger convenience variables now defined.\n\
  7839.   Convenience variables have names starting with \"$\";\n\
  7840.   use \"set\" as in \"set $foo = 5\" to define them.\n");
  7841.   
  7842.     for (var = internalvars; var; var = var->next)
  7843.       {
  7844. !      printf_filtered ("$%s: ", var->name);
  7845.         value_print (var->value, stdout, 0);
  7846. !      printf_filtered ("\n");
  7847.       }
  7848.   }
  7849.   
  7850.