Brian Vandenberg
Brian Vandenberg

Reputation: 4121

gdb/solaris: When attaching to a process, symbols not being loaded

I'm using gcc 4.9.2 & gdb 7.2 in Solaris 10 on sparc. The following was tested after compiling/linking with -g, -ggdb, and -ggdb3.

When I attach to a process:

~ gdb
/snip/
(gdb) attach pid_goes_here

... it is not loading symbolic information. I started with netbeans which starts gdb without specifying the executable name until after the attach occurs, but I've eliminated netbeans as the cause.

I can force it to load the symbol table under netbeans if I do one of the following:

Attach to the process, then in the debugger console do one of the following:

(gdb) detach
(gdb) file /path/to/file
(gdb) attach the_pid_goes_here

or

(gdb) file /path/to/file
(gdb) sharedlibrary .

I want to know if there's a more automatic way I can force this behavior. So far googling has turned up zilch.

Upvotes: 2

Views: 672

Answers (1)

Employed Russian
Employed Russian

Reputation: 213375

I want to know if there's a more automatic way I can force this behavior.

It looks like a bug.

Are you sure that the main executable symbols are loaded? This bug says that attach pid without giving the binary doesn't work on Solaris at all.

In any case, it's supposed to work automatically, so your best bet to make it work better is probably to file a bug, and wait for it to be fixed (or send a patch to fix it yourself :-)

Upvotes: 1

Related Questions