home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / gdb / bug / 1409 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.6 KB  |  54 lines

  1. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ithaca.cat.rpi.edu!ameres
  2. From: ameres@ithaca.cat.rpi.edu (Eric Ameres)
  3. Newsgroups: gnu.gdb.bug
  4. Subject: nm.h not included in inftarg.c
  5. Date: 25 Jan 1993 21:15:30 -0500
  6. Organization: Rensselaer Polytechnic Institute, Troy NY
  7. Lines: 41
  8. Sender: daemon@cis.ohio-state.edu
  9. Approved: bug-gdb@prep.ai.mit.edu
  10. Distribution: gnu
  11. Message-ID: <54n36hr@rpi.edu>
  12.  
  13. After finding that We couldn't attach to running processes we found
  14. the following code was being called in inftarg.c:
  15.  
  16. #ifndef ATTACH_DETACH
  17.   error ("Can't attach to a process on this machine.");
  18. #else
  19.   pid = atoi (args);
  20.  
  21.   if (pid == getpid())          /* Trying to masturbate? */
  22.     error ("I refuse to debug myself!");
  23.  
  24.   if (from_tty)
  25.     {
  26.       exec_file = (char *) get_exec_file (0);
  27.  
  28.       if (exec_file)
  29.         printf ("Attaching program `%s', pid %d\n", exec_file, pid);
  30.       else
  31.         printf ("Attaching pid %d\n", pid);
  32.  
  33.       fflush (stdout);
  34.     }
  35.  
  36.   attach (pid);
  37.   inferior_pid = pid;
  38.   push_target (&child_ops);
  39. #endif  /* ATTACH_DETACH */
  40.  
  41. The strange part is that ATTACH_DETACH is defined in nm.h.  By adding
  42. #include "nm.h", attaching works just fine.  By the way we're using
  43. this on SparcStations using SunOs 4.1.1.
  44.  
  45. Anybody encounter the same thing?
  46.  
  47. Eric.
  48. -- 
  49. ----------------------------------------------------------------------
  50. Eric Ameres,  Software Engineer                 ameres@cat.rpi.edu
  51. New York State Center for Advanced Technology in Automation & Robotics
  52. Rensselaer Polytechnic Institute - CII 8313, Troy, NY 12180-3590
  53.  
  54.