home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / next / programm / 7978 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  2.0 KB

  1. Path: sparky!uunet!rosie!next.com
  2. From: dave_moore@next.com (Dave Moore)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: Symbol tables of dynamically loaded objects in gdb
  5. Message-ID: <6148@rosie.NeXT.COM>
  6. Date: 4 Jan 93 18:31:01 GMT
  7. References: <1hdse7INNslm@gap.caltech.edu>
  8. Sender: news@NeXT.COM
  9. Lines: 36
  10.  
  11. In article <1hdse7INNslm@gap.caltech.edu> bchen@cco.caltech.edu (Bing-Qing  
  12. Chen) writes:
  13. > I was trying to figure out how to add symbol tables of dynamically  
  14. loaded
  15. > objects to gdb. According to the GDB document, I tried the following
  16. > commands: "load file", "load-file file" and "add-symbol-file file addr".
  17. > The first command returns "You can't do that when your target is `exec'"
  18. > if the program is not running or "You can't do that when your target is
  19. > `child'" when it is running, I wonder when I can use the "load"  
  20. command?!
  21. > The second command seems to do nothing, while the third command does not
  22. > recognize address argument and it crashes gdb with "Segmentation fault"
  23. > if no address is given. This is really frustrating. Any help would be
  24. > greatly appreciated.
  25. > Thanks,
  26. > Bing Chen
  27. > bchen@cco.caltech.edu
  28.  
  29. If you're running on 3.0 you shouldn't have to do anything to get the  
  30. symbols loaded.  Gdb just notices that code was loaded, and loads up the  
  31. symbols.  In fact you can use the future-break (fb) command to set  
  32. breakpoints in the code before you load it.  Any breakpoints in it are  
  33. forgotten about when the code is unloaded or the program is restarted, but  
  34. they come back when the code is loaded again.  It just ought to work.  
  35.  
  36. As for the above commands add-file is the one to use.  This can force  
  37. symbols in.  If you supply a "debug-file" argument to rld_load or  
  38. objc_loadModules (there is no way to do this if you're using bundles),  
  39. this is the file to give to add-file.  If you don't do this, but know what  
  40. address the code was loaded at you can give this address as a second  
  41. argument to add-file with the original object file as the first one.
  42.  
  43. Dave Moore
  44. Software Development Tools
  45. NeXT Computer, Inc.
  46.