🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
5 messages
5 total messages Started by Bing-Qing Chen Fri, 25 Dec 1992 02:42
Symbol tables of dynamically loaded objects in gdb
#1966
Author: Bing-Qing Chen
Date: Fri, 25 Dec 1992 02:42
14 lines
1130 bytes
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
Re: Symbol tables of dynamically loaded objects in gdb
#1975
Author: grd Glen Diener
Date: Mon, 28 Dec 1992 17:59
24 lines
1621 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
>

The proper incantation is add-file <filename>, where filename is
the name of an object file produced by rld_load or objc_loadmodules.
You'll probably also want to execute gdb's directory command to
tell gdb the path of the directory you're dynamically-loaded class's
source lives in.

-glen
Re: Symbol tables of dynamically loaded objects in gdb
#2177
Author: 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.
Re: Symbol tables of dynamically loaded objects in gdb
#2178
Author: Louis A. Mamakos
Date: Mon, 04 Jan 1993 23:31
27 lines
1934 bytes
In article <6148@rosie.NeXT.COM> dave_moore@next.com (Dave Moore) writes:

>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.  

I've been using gdb and it really does load the symbols as modules are
dynamically loaded.  I didn't know about the fb command, though, this
sounds way-cool and will be a real big help.

>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.

I've been using NXBundle quite a bit lately on a project that I've
been working on, and its been working pretty well.  However, I'm
thinking of dropping back to using objc_loadModules since I can get it
to create the debug file.  It would be *real* nice if there was a way
to have the NXBundle class make an object file as it loads modules.
While running a program under gdb works most of the time, if you get a
core dump, you're pretty much hosed trying to debug it

louie
Re: Symbol tables of dynamically loaded objects in gdb
#2183
Author: Dark Hacker
Date: Tue, 05 Jan 1993 05:03
19 lines
1022 bytes
While we're on the subject of GDB on the NeXT.... when I try to debug
modules that are in a file other than the one the main is located in,
I... well... can't debug them.  GDB doesn't want to recognize that the
modules exist.  I've tried stuff like:

(gdb) break fooFile:func_name
(gdb) break fooFile::func_name

and I can't get GDB to recognize the module in file fooFile.

What's the magic?

- Hacker
-- 
Dark Hacker @ Black Silicon, Fortress Of Computation
hacker@black-silicon.mclean.va.us

"Life itself is... COMPUTATION!"
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads