🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #2177

Re: Symbol tables of dynamically loaded objects in gdb

#2177
From: Dave Moore
Date: Mon, 04 Jan 1993 18:31
36 lines
2122 bytes
In article <1hdse7INNslm@gap.caltech.edu> bchen@cco.caltech.edu (Bing-Qing  
Chen) writes:
> I was trying to figure out how to add symbol tables of dynamically  
loaded
> objects to gdb. According to the GDB document, I tried the following
> commands: "load file", "load-file file" and "add-symbol-file file addr".
> The first command returns "You can't do that when your target is `exec'"
> if the program is not running or "You can't do that when your target is
> `child'" when it is running, I wonder when I can use the "load"  
command?!
> The second command seems to do nothing, while the third command does not
> recognize address argument and it crashes gdb with "Segmentation fault"
> if no address is given. This is really frustrating. Any help would be
> greatly appreciated.
> 
> Thanks,
> Bing Chen
> bchen@cco.caltech.edu

If you're running on 3.0 you shouldn't have to do anything to get the  
symbols loaded.  Gdb just notices that code was loaded, and loads up the  
symbols.  In fact you can use the future-break (fb) command to set  
breakpoints in the code before you load it.  Any breakpoints in it are  
forgotten about when the code is unloaded or the program is restarted, but  
they come back when the code is loaded again.  It just ought to work.  

As for the above commands add-file is the one to use.  This can force  
symbols in.  If you supply a "debug-file" argument to rld_load or  
objc_loadModules (there is no way to do this if you're using bundles),  
this is the file to give to add-file.  If you don't do this, but know what  
address the code was loaded at you can give this address as a second  
argument to add-file with the original object file as the first one.

Dave Moore
Software Development Tools
NeXT Computer, Inc.
Technical Details
Message-ID: <6148@rosie.NeXT.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!rosie!next.com
References: <1hdse7INNslm@gap.caltech.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!rosie!next.com
From: dave_moore@next.com (Dave Moore)
Newsgroups: comp.sys.next.programmer
Subject: Re: Symbol tables of dynamically loaded objects in gdb
Message-ID: <6148@rosie.NeXT.COM>
Date: 4 Jan 93 18:31:01 GMT
References: <1hdse7INNslm@gap.caltech.edu>
Sender: news@NeXT.COM
Lines: 36