🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #10165

minor patches for gdb-3.5

#10165
From: Peter Schauer
Date: Mon, 02 Apr 1990 17:46
240 lines
7278 bytes
The set of patches below cures minor bugs in gdb
The infxxx patches are only for those who do remote debugging.
The munch patch is only for those who are cross developping.
The source.c patch marks the line of the current PC in the source listing
as do many source level debuggers.

Peter Schauer		 pes@tumuc.e-technik.tu-muenchen.dbp.de

*** ./infcmd.c.orig	Tue Feb 27 10:19:14 1990
--- ./infcmd.c	Fri Mar 23 17:46:34 1990
***************
*** 986,992 ****
    int signal = 0;
  
  #ifdef ATTACH_DETACH
!   if (inferior_pid)
      {
        if (from_tty)
  	{
--- 986,992 ----
    int signal = 0;
  
  #ifdef ATTACH_DETACH
!   if (inferior_pid && !remote_debugging)
      {
        if (from_tty)
  	{
***************
*** 1013,1018 ****
--- 1013,1019 ----
  	error ("Argument given to \"detach\" when remotely debugging.");
        
        remote_close (from_tty);
+       inferior_pid = 0;
      }
  }
  
*** ./inflow.c.orig	Tue Feb 27 10:19:14 1990
--- ./inflow.c	Fri Mar 23 17:46:35 1990
***************
*** 450,456 ****
--- 450,459 ----
  kill_command ()
  {
    if (remote_debugging)
+     {
+     inferior_pid = 0;
      return;
+     }
    if (inferior_pid == 0)
      error ("The program is not being run.");
    if (!query ("Kill the inferior process? "))
*** ./infrun.c.orig	Tue Feb 27 10:19:16 1990
--- ./infrun.c	Fri Mar 23 17:46:36 1990
***************
*** 432,437 ****
--- 432,438 ----
    clear_proceed_status ();
    running_in_shell = 0;
    trap_expected = 0;
+   stop_after_attach = 1;
    inferior_pid = 3;
    breakpoints_inserted = 0;
    mark_breakpoints_out ();
*** ./main.c.orig	Tue Feb 27 10:19:26 1990
--- ./main.c	Fri Mar 23 17:46:38 1990
***************
*** 262,267 ****
--- 262,271 ----
      getrlimit (RLIMIT_STACK, &rlim);
      original_stack_limit = rlim.rlim_cur;
      rlim.rlim_cur = rlim.rlim_max;
+     /* Avoid large core files and allow shell fork on SUN's */
+ #define MAX_STACK_SIZE (10000 * 1024)
+     if(rlim.rlim_cur > MAX_STACK_SIZE)
+       rlim.rlim_cur = MAX_STACK_SIZE;
      setrlimit (RLIMIT_STACK, &rlim);
    }
  #endif /* SET_STACK_LIMIT_HUGE */
***************
*** 473,480 ****
      {
        if (!setjmp (to_top_level))
  	command_loop ();
!       clearerr (stdin);		/* Don't get hung if C-d is typed.  */
      }
  }
  
  /* Execute the line P as a command.
--- 477,488 ----
      {
        if (!setjmp (to_top_level))
  	command_loop ();
!       if(ISATTY(stdin))
!         clearerr (stdin);             /* Don't get hung if C-d is typed.  */
!       else if(feof(instream))	/* Avoid endless loops for redirected stdin */
!         break;
      }
+   exit(0);
  }
  
  /* Execute the line P as a command.
***************
*** 592,598 ****
  
    while (1)
      {
!       c = fgetc (instream);
        if (c == -1 || c == '\n')
  	break;
        if (return_result)
--- 600,606 ----
  
    while (1)
      {
!       c = fgetc (instream ? instream : stdin);
        if (c == -1 || c == '\n')
  	break;
        if (return_result)
***************
*** 1466,1471 ****
--- 1474,1480 ----
  	else
  	  fputc (c, stdout);
        }
+   fflush(stdout);
  }
  
  static void
***************
*** 1670,1675 ****
--- 1679,1685 ----
    
    while (i > 0 && (arg[i] == ' ' || arg[i] == '\t'))
      i--;
+   i++;
  
    if (!*arg)
      history_filename = (char *) 0;
***************
*** 1728,1733 ****
--- 1738,1744 ----
    /* Command line editing externals.  */
    extern int (*rl_completion_entry_function)();
    extern char *rl_completer_word_break_characters;
+   extern char *rl_readline_name;
    
    /* Set default verbose mode on.  */
    info_verbose = 1;
***************
*** 1759,1764 ****
--- 1770,1776 ----
    /* Setup important stuff for command line editing.  */
    rl_completion_entry_function = (int (*)()) symbol_completion_function;
    rl_completer_word_break_characters = gdb_completer_word_break_characters;
+   rl_readline_name = "gdb";
  
    /* Define the classes of commands.
       They will appear in the help list in the reverse of this order.  */
*** ./munch.orig	Wed Jul  5 21:46:28 1989
--- ./munch	Fri Mar 23 17:46:39 1990
***************
*** 1,5 ****
--- 1,6 ----
  #! /bin/sh
  
+ MUNCH_NM=${MUNCH_NM-nm}
  # create an initialization procedure from a list of .o files
  
  echo '/* Do not modify this file.  It is created automatically by "munch". */'
***************
*** 7,16 ****
  
  if test "$1" = "-DSYSV" ; then
      shift;
!     nm $* | egrep '^(.*[^a-zA-Z_]_|_)initialize_' | \
  	sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/   \1 ();/'
  else
!     nm -p $* | egrep 'T *__initialize_' | \
  	sed -e 's/^.*T *_*\(.*\)/    _\1 ();/'
  fi
  
--- 8,17 ----
  
  if test "$1" = "-DSYSV" ; then
      shift;
!     $MUNCH_NM $* | egrep '^(.*[^a-zA-Z_]_|_)initialize_' | \
  	sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/   \1 ();/'
  else
!     $MUNCH_NM -p $* | egrep 'T *__initialize_' | \
  	sed -e 's/^.*T *_*\(.*\)/    _\1 ();/'
  fi
  
*** ./source.c.orig	Tue Feb 27 10:19:39 1990
--- ./source.c	Fri Mar 23 17:46:45 1990
***************
*** 510,515 ****
--- 510,517 ----
    register int desc;
    register FILE *stream;
    int nlines = stopline - line;
+   struct symtab_and_line pc_sal;
+   char *marker;
  
    desc = openp (source_path, 0, s->filename, O_RDONLY, 0, &s->fullname);
    if (desc < 0)
***************
*** 540,545 ****
--- 542,554 ----
    current_source_symtab = s;
    current_source_line = line;
    first_line_listed = line;
+ 
+   /* Find symtab and line for current pc */
+ 
+   if(have_inferior_p())
+     pc_sal = find_pc_line(read_pc(),0);
+   else
+     pc_sal.line = 0;
    
    stream = fdopen (desc, "r");
    clearerr (stream);
***************
*** 549,555 ****
        c = fgetc (stream);
        if (c == EOF) break;
        last_line_listed = current_source_line;
!       printf_filtered ("%d\t", current_source_line++);
        do
  	{
  	  if (c < 040 && c != '\t' && c != '\n')
--- 558,565 ----
        c = fgetc (stream);
        if (c == EOF) break;
        last_line_listed = current_source_line;
!       marker = ((pc_sal.symtab == s) && (pc_sal.line == current_source_line)) ? "*" : "" ;
!       printf_filtered ("%d%s\t", current_source_line++, marker);
        do
  	{
  	  if (c < 040 && c != '\t' && c != '\n')
Technical Details
Message-ID: <981@tumuc.UUCP>
Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!tumuc!pes
References: <1990Mar27.195402.5339@esegue.segue.boston.ma.us> <1990Mar28.135444.12665@granite.cr.bull.com> <1990Mar28.163706.2474@esegue.segue.boston.ma.us> <980@tumuc.UUCP>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,f5315168aca7ec9
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1990-04-02 21:30:57 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!tumuc!pes
From: pes@tumuc.e-technik.tu-muenchen.dbp.de (Peter Schauer)
Newsgroups: gnu.gdb.bug
Subject: minor patches for gdb-3.5
Message-ID: <981@tumuc.UUCP>
Date: 2 Apr 90 17:46:25 GMT
References: <1990Mar27.195402.5339@esegue.segue.boston.ma.us> <1990Mar28.135444.12665@granite.cr.bull.com> <1990Mar28.163706.2474@esegue.segue.boston.ma.us> <980@tumuc.UUCP>
Sender: news@tumuc.UUCP
Reply-To: pesrem@tumuc.UUCP (Peter Schauer)
Distribution: gnu
Organization: Technical University of Munich, West-Germany
Lines: 240
Posted: Mon Apr  2 18:46:25 1990