home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / misc / discuss / 2821 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.5 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!rutgers!micro-heart-of-gold.mit.edu!xn.ll.mit.edu!ll.mit.edu!cogen
  2. From: cogen@ll.mit.edu
  3. Newsgroups: gnu.misc.discuss
  4. Subject: gdb and shared libraries doesn't work
  5. Message-ID: <1992Aug31.185324.21189@ll.mit.edu>
  6. Date: 31 Aug 92 18:53:24 GMT
  7. Sender: cogen@ll.mit.edu
  8. Organization: MIT Lincoln Laboratory
  9. Lines: 33
  10.  
  11. .
  12. .
  13. .
  14. ------- Start -------->
  15.  
  16.  
  17. I have gdb 4.6 And I am trying to debug C programs linked to shared libraries
  18. which I have built myself. The OS is SunOS 4.4.1. gdb fails in many different
  19. ways: 
  20.  
  21. 1) I say gdb <progname>. Then type "break main" and gdb crashes with
  22. segmentation violation. Same for any other function in my source files.
  23.  
  24. 2) If instead of main I try to break in a library routine, gdb says it is not
  25. defined. 
  26.  
  27. 3) Another thing I do a lot it debug an existing process. I say gdb <progname>,
  28. then attach to the process, which is currently in a pause(). Setting a
  29. breakpoint in my function still generates seg violation. However, now I can set
  30. a breakpoint in a library routine. Apparently, library routine names don't get
  31. loaded until main executes. But unfortunately, even with the breakpoint set I
  32. still can't step through these library routines. The breakpoint is never
  33. detected by gdb.
  34.  
  35. All code -- program and library -- were compiled with -g option.
  36.  
  37. The release nodes for 4.6 said that gdb can debug shared libraries. So what is
  38. going wrong?
  39.  
  40. (Apologies if this is the wrong newsgroup. Let me know if so; I will repost
  41. it.) 
  42.  
  43. Thanks for any help.
  44.