🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by munnari!sibyl.eleceng.ua.oz.au!i... Thu, 01 Dec 1988 05:27
GDB: support for vanilla System V (part 5 of 5)
#629
Author: munnari!sibyl.eleceng.ua.oz.au!i...
Date: Thu, 01 Dec 1988 05:27
757 lines
19118 bytes
(Sorry if you've seen this before but I sent it to bug-gnu-emacs
not realising that bug-gdb existed)

In GDB 2.7 on sibyl (usg-unix-v)

There are 5 parts because outgoing overseas mail from here must be
less than 25k. Part 1 contains a shar archive containing the new
files. Parts 2 to 5 contain shar archives of the patch files to make
the changes to the the existing files. The patch files are context
differences.

Part 5 of 5:

--------------Cut Here-----------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by ian on Thu Nov 24 11:20:20 CST 1988
# Contents:  patch#4
 
echo x - patch#4
sed 's/^@//' > "patch#4" <<'@//E*O*F patch#4//'
*** ../gdb.dist/source.c	Tue May 24 04:54:44 1988
--- source.c	Wed Nov 16 01:02:34 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include <sys/param.h>
  #include <sys/stat.h>

--- 18,29 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
+ #include "param.h"
+ #ifdef NS5
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #endif
  #include <stdio.h>
  #include <sys/param.h>
  #include <sys/stat.h>
***************
*** 49,54
  static int first_line_listed;
  
  START_FILE
  
  /* Set the source file default for the "list" command,
     specifying a symtab.  */

--- 55,62 -----
  static int first_line_listed;
  
  START_FILE
+ 
+ void print_sys_errmsg();
  
  /* Set the source file default for the "list" command,
     specifying a symtab.  */
*** ../gdb.dist/stack.c	Tue May 24 04:54:39 1988
--- stack.c	Wed Nov 16 01:02:36 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  
  #include "defs.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  
  #include "defs.h"
***************
*** 47,52
  static void select_calling_frame ();
  
  void print_frame_info ();
  
  /* Print a stack frame briefly.  FRAME should be the frame address
     and LEVEL should be its level in the stack (or -1 for level not defined).

--- 48,55 -----
  static void select_calling_frame ();
  
  void print_frame_info ();
+ void print_source_lines(), set_default_breakpoint(), print_variable_value();
+ void set_return_value();
  
  /* Print a stack frame briefly.  FRAME should be the frame address
     and LEVEL should be its level in the stack (or -1 for level not defined).
*** ../gdb.dist/standalone.c	Wed May  4 00:51:51 1988
--- standalone.c	Wed Nov  9 02:02:08 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include <sys/ioctl.h>
  #include <signal.h>

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  #include <sys/ioctl.h>
  #include <signal.h>
*** ../gdb.dist/stuff.c	Wed Oct  1 07:17:34 1986
--- stuff.c	Wed Nov  9 02:02:06 1988
***************
*** 20,25
  
  /* Written 13-Mar-86 by David Bridgham. */
  
  #include <stdio.h>
  #include <a.out.h>
  #include <sys/types.h>

--- 20,26 -----
  
  /* Written 13-Mar-86 by David Bridgham. */
  
+ #include "config.h"
  #include <stdio.h>
  #include <a.out.h>
  #include <sys/types.h>
*** ../gdb.dist/symmisc.c	Tue Jul 26 17:03:55 1988
--- symmisc.c	Wed Nov  9 02:02:05 1988
***************
*** 19,24
  */
  
  
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"

--- 19,25 -----
  */
  
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"
*** ../gdb.dist/symtab.c	Fri Apr  8 18:19:09 1988
--- symtab.c	Fri Nov 18 11:00:04 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "symtab.h"
***************
*** 36,41
  struct obstack obstack1;
  
  struct obstack *symbol_obstack = &obstack1;
  
  /* These variables point to the objects
     representing the predefined C data types.  */

--- 37,62 -----
  struct obstack obstack1;
  
  struct obstack *symbol_obstack = &obstack1;
+ 
+ struct misc_function *misc_function_vector;
+ int misc_function_count;
+ /* This is the list of struct symtab's that gdb considers current.  */
+ 
+ struct symtab *symtab_list;
+ 
+ /* This symtab variable specifies the current file for printing source lines */
+ 
+ struct symtab *current_source_symtab;
+ 
+ /* This is the next line to print for listing source lines.  */
+ 
+ int current_source_line;
+ 
+ /* Given a pc value, return line number it is in.
+    Second arg nonzero means if pc is on the boundary
+    use the previous statement's line number.  */
+ 
+ struct symtab_and_line find_pc_line ();
  
  /* These variables point to the objects
     representing the predefined C data types.  */
*** ../gdb.dist/utils.c	Tue May 31 12:57:25 1988
--- utils.c	Wed Nov 16 01:02:29 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include <signal.h>
  #include <sys/ioctl.h>

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  #include <signal.h>
  #include <sys/ioctl.h>
***************
*** 29,35
  
  void error ();
  void fatal ();
! 
  /* Chain of cleanup actions established with make_cleanup,
     to be executed if an error happens.  */
  

--- 30,36 -----
  
  void error ();
  void fatal ();
! char *malloc(), *realloc();
  /* Chain of cleanup actions established with make_cleanup,
     to be executed if an error happens.  */
  
***************
*** 211,217
  /* Control C comes here */
  
  void
! request_quit ()
  {
    quit_flag = 1;
    if (immediate_quit)

--- 212,219 -----
  /* Control C comes here */
  
  void
! request_quit (sig)
! int sig;
  {
  #ifdef NS5
    signal (sig, request_quit);	/* USG sytems reset to default */
***************
*** 213,218
  void
  request_quit ()
  {
    quit_flag = 1;
    if (immediate_quit)
      quit ();

--- 215,223 -----
  request_quit (sig)
  int sig;
  {
+ #ifdef NS5
+   signal (sig, request_quit);	/* USG sytems reset to default */
+ #endif  
    quit_flag = 1;
    if (immediate_quit)
      quit ();
*** ../gdb.dist/valarith.c	Fri Dec 18 02:55:52 1987
--- valarith.c	Wed Nov  9 02:02:02 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"
*** ../gdb.dist/valops.c	Fri Jan  8 13:20:27 1988
--- valops.c	Wed Nov 16 01:02:31 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"
***************
*** 25,30
  #include "value.h"
  
  START_FILE
  
  /* Cast value ARG2 to type TYPE and return as a value.
     More general than a C cast: accepts any two types of the same length,

--- 26,33 -----
  #include "value.h"
  
  START_FILE
+ 
+ void set_internalvar_component(), run_stack_dummy();
  
  /* Cast value ARG2 to type TYPE and return as a value.
     More general than a C cast: accepts any two types of the same length,
*** ../gdb.dist/valprint.c	Sun Sep  4 02:04:52 1988
--- valprint.c	Thu Nov 17 13:07:25 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include "defs.h"
  #include "initialize.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  #include "defs.h"
  #include "initialize.h"
***************
*** 34,39
  static void type_print_varspec_prefix ();
  static void type_print_base ();
  
  START_FILE
  
  char **unsigned_type_table;

--- 35,42 -----
  static void type_print_varspec_prefix ();
  static void type_print_base ();
  
+ void printchar(), print_scalar_formatted(), print_spaces();
+ 
  START_FILE
  
  char **unsigned_type_table;
***************
*** 120,125
       FILE *stream;
       char format;
  {
    register int i;
    int len;
    struct type *elttype;

--- 123,129 -----
       FILE *stream;
       char format;
  {
+   extern void print_invalid_float();
    register int i;
    int len;
    struct type *elttype;
***************
*** 280,285
  	  print_scalar_formatted (valaddr, type, format, 0, stream);
  	  break;
  	}
  #ifdef IEEE_FLOAT
        if (is_nan (unpack_double (type, valaddr)))
  	{

--- 284,299 -----
  	  print_scalar_formatted (valaddr, type, format, 0, stream);
  	  break;
  	}
+ 
+       /* Test for invalid float here because "unpack_double" can't handle
+ 	 invalid floats very elegantly */
+       len = TYPE_LENGTH (type);
+       if (INVALID_FLOAT(valaddr, len))
+ 	{
+ 	  print_invalid_float(stream, valaddr, len);
+ 	  break;
+ 	}
+ 
  #ifdef IEEE_FLOAT
        if (is_nan (unpack_double (type, valaddr)))
  	{
***************
*** 300,305
    fflush (stream);
  }
  
  #ifdef IEEE_FLOAT
  
  union ieee {

--- 314,349 -----
    fflush (stream);
  }
  
+ void print_invalid_float(stream, valaddr, len)
+      FILE *stream;
+      char *valaddr;
+      int len;
+ {
+   int i;
+   unsigned char *charp;
+ 
+   int lowhalf, highhalf;
+   union { int i; char c; } test;
+   
+   fprintf (stream, "<<invalid %s 0x",
+ 	   (len == sizeof (float)) ? "float": "double");
+ 
+   /* Separate the high and low words of the double.
+      Distinguish big and little-endian machines.  */
+   test.i = 1;
+   if (test.c != 1)
+     /* Big-endian machine */
+     for (i = len, charp = ((unsigned char *) valaddr); i--; charp++ )
+       fprintf (stream, "%.2x", (int) *charp);
+   else
+     /* Little-endian machine */
+     for (i = len, charp = (((unsigned char *) valaddr) + len - 1);
+ 	 i--; charp-- )
+       fprintf (stream, "%.2x", (int) *charp);
+ 
+   fprintf (stream, ">>");
+ }
+ 
  #ifdef IEEE_FLOAT
  
  union ieee {
*** ../gdb.dist/values.c	Sat May 21 05:02:39 1988
--- values.c	Wed Nov  9 02:01:58 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  #include "defs.h"
  #include "initialize.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  #include "defs.h"
  #include "initialize.h"
*** ../gdb.dist/vax-pinsn.c	Wed Jun 22 13:16:14 1988
--- vax-pinsn.c	Wed Nov  9 02:01:57 1988
***************
*** 18,23
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
  #include <stdio.h>
  
  #include "defs.h"

--- 18,24 -----
  anyone else from sharing it farther.  Help stamp out software hoarding!
  */
  
+ #include "config.h"
  #include <stdio.h>
  
  #include "defs.h"
*** ../gdb.dist/xgdb.c	Thu Jul 21 08:15:18 1988
--- xgdb.c	Wed Nov  9 02:01:55 1988
***************
*** 20,25
  
  /* Original version was contributed by Derek Beatty, 30 June 87.  */
  
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"

--- 20,26 -----
  
  /* Original version was contributed by Derek Beatty, 30 June 87.  */
  
+ #include "config.h"
  #include "defs.h"
  #include "initialize.h"
  #include "param.h"
*** ../gdb.dist/defs.h	Mon May 23 04:22:48 1988
--- defs.h	Wed Nov 16 11:44:44 1988
***************
*** 20,25
  
  #define CORE_ADDR unsigned int
  
  #define min(a, b) ((a) < (b) ? (a) : (b))
  #define max(a, b) ((a) > (b) ? (a) : (b))
  

--- 20,27 -----
  
  #define CORE_ADDR unsigned int
  
+ extern CORE_ADDR read_register();
+ 
  #define min(a, b) ((a) < (b) ? (a) : (b))
  #define max(a, b) ((a) > (b) ? (a) : (b))
  
***************
*** 29,35
  extern char *alloca ();
  extern int parse_escape ();
  extern char *reg_names[];
! 
  extern int quit_flag;
  
  extern int immediate_quit;

--- 31,37 -----
  extern char *alloca ();
  extern int parse_escape ();
  extern char *reg_names[];
! extern char *get_exec_file();
  extern int quit_flag;
  extern unsigned int register_addr();
  extern char *internalvar_name(), *xmalloc(), *xrealloc();
***************
*** 31,36
  extern char *reg_names[];
  
  extern int quit_flag;
  
  extern int immediate_quit;
  

--- 33,40 -----
  extern char *reg_names[];
  extern char *get_exec_file();
  extern int quit_flag;
+ extern unsigned int register_addr();
+ extern char *internalvar_name(), *xmalloc(), *xrealloc();
  
  extern long lseek();
  extern void free();
***************
*** 32,37
  
  extern int quit_flag;
  
  extern int immediate_quit;
  
  #define QUIT { if (quit_flag) quit (); }

--- 36,46 -----
  extern unsigned int register_addr();
  extern char *internalvar_name(), *xmalloc(), *xrealloc();
  
+ extern long lseek();
+ extern void free();
+ 
+ extern char *re_comp(), *re_exec();
+ 
  extern int immediate_quit;
  
  extern CORE_ADDR parse_and_eval_address(), parse_and_eval_address_1();
***************
*** 34,39
  
  extern int immediate_quit;
  
  #define QUIT { if (quit_flag) quit (); }
  
  enum command_class

--- 43,61 -----
  
  extern int immediate_quit;
  
+ extern CORE_ADDR parse_and_eval_address(), parse_and_eval_address_1();
+ extern CORE_ADDR find_line_pc();
+ 
+ extern void clear_momentary_breakpoints(), clear_breakpoint_commands();
+ extern void delete_current_display();
+ extern void init_source_path(), error(), fatal();
+ extern void free_all_values(), do_breakpoint_commands(), perror_with_name();
+ extern void add_com(), add_prefix_command(), add_com_alias(), add_info();
+ extern void add_info_alias(), error_no_arg(), set_next_address();
+ extern void set_internalvar(), write_register(), error_no_arg();
+ extern void print_expression();
+ 
+ extern void quit();
  #define QUIT { if (quit_flag) quit (); }
  
  enum command_class
*** ../gdb.dist/symtab.h	Fri Apr  8 18:17:50 1988
--- symtab.h	Wed Nov 23 02:59:16 1988
***************
*** 48,55
  
  /* Address and length of the vector recording all misc function names/addresses.  */
  
! struct misc_function *misc_function_vector;
! int misc_function_count;
  
  #include "symseg.h"
  

--- 48,55 -----
  
  /* Address and length of the vector recording all misc function names/addresses.  */
  
! extern struct misc_function *misc_function_vector;
! extern int misc_function_count;
  
  #include "symseg.h"
  
***************
*** 97,103
  
  /* This is the list of struct symtab's that gdb considers current.  */
  
! struct symtab *symtab_list;
  
  /* This symtab variable specifies the current file for printing source lines */
  

--- 97,103 -----
  
  /* This is the list of struct symtab's that gdb considers current.  */
  
! extern struct symtab *symtab_list;
  
  /* This symtab variable specifies the current file for printing source lines */
  
***************
*** 101,107
  
  /* This symtab variable specifies the current file for printing source lines */
  
! struct symtab *current_source_symtab;
  
  /* This is the next line to print for listing source lines.  */
  

--- 101,107 -----
  
  /* This symtab variable specifies the current file for printing source lines */
  
! extern struct symtab *current_source_symtab;
  
  /* This is the next line to print for listing source lines.  */
  
***************
*** 105,111
  
  /* This is the next line to print for listing source lines.  */
  
! int current_source_line;
  
  #define BLOCKLIST(symtab) (symtab)->blockvector
  #define BLOCKVECTOR(symtab) (symtab)->blockvector

--- 105,111 -----
  
  /* This is the next line to print for listing source lines.  */
  
! extern int current_source_line;
  
  #define BLOCKLIST(symtab) (symtab)->blockvector
  #define BLOCKVECTOR(symtab) (symtab)->blockvector
***************
*** 206,212
     Second arg nonzero means if pc is on the boundary
     use the previous statement's line number.  */
  
! struct symtab_and_line find_pc_line ();
  
  /* Given a string, return the line specified by it.
     For commands like "list" and "breakpoint".  */

--- 206,212 -----
     Second arg nonzero means if pc is on the boundary
     use the previous statement's line number.  */
  
! extern struct symtab_and_line find_pc_line ();
  
  /* Given a string, return the line specified by it.
     For commands like "list" and "breakpoint".  */
***************
*** 211,215
  /* Given a string, return the line specified by it.
     For commands like "list" and "breakpoint".  */
  
! struct symtab_and_line decode_line_spec ();
! struct symtab_and_line decode_line_1 ();

--- 211,215 -----
  /* Given a string, return the line specified by it.
     For commands like "list" and "breakpoint".  */
  
! extern struct symtab_and_line decode_line_spec ();
! extern struct symtab_and_line decode_line_1 ();
@//E*O*F patch#4//
chmod u=rw,g=r,o=r patch#4
 
echo Inspecting for damage in transit...
temp=/tmp/shar$$; dtemp=/tmp/.shar$$
trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
cat > $temp <<\!!!
    719   2258  16810 patch#4
!!!
wc  patch#4 | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
if [ -s $dtemp ]
then echo "Ouch [diff of wc output]:" ; cat $dtemp
else echo "No problems found."
fi
exit 0
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads