This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Insight 6.0 and Dlls


On Thu, 2004-02-05 at 07:41, Heiko Gerdau wrote:
> Hi,
> 
> is there anybody who can reproduce this. Or does it happen just with my 
> configuration?
> 

Ok, I don't know why, but I've spent a few minutes browsing the sources
to see what might be going on.

The problem lies within gdb -- not insight. Of course, like many things,
the problem is really only visible inside a GUI. :-(

Most of the action is in src/gdb/win32-nat.c. This file contains all the
native code for cygwin and it contains the main target event loop for
windows hosts. The function child_wait is this event loop.

It loops indefinitely calling get_child_debug_event. If you look at this
function, you'll see that one of the events that it knows about is
LOAD_DLL_DEBUG_EVENT. This informs the "tdep" code (the "t"arget
"dep"endent code -- not core gdb) that a DLL has been loaded.

This returns that status TARGET_WAITKIND_LOADED to core gdb. In turn, if
you look where this event is handled in infrun.c's
handle_inferior_event, you'll see that it calls SOLIB_ADD to notify the
rest of gdb that a shared library/DLL was loaded. For cygwin,
src/gdb/config/i386/tm-cygwin.h defines SOLIB_ADD as "child_solib_add".
Eventually, this calls symbol_file_add in src/gdb/symfile.c.

Look closely at the call to SOLIB_ADD:

	SOLIB_ADD (NULL, 0, &current_target, auto_solib_add);

The second parameter here, "0" is the "from_tty" argument. Sadly, this
is problematic.

If you look at symbol_file_add now, we see that the
pre/post_add_symbol_hooks are ONLY called if from_tty != 0 or "info
verbose" has been set.

Now, I cannot tell you that setting "info verbose" in gdb proper will
not interfere with insight, but I do think that there is a fundamental
problem with the hooks not being called in this case.

Should from_tty be non-zero? I don't know.
Should the hooks be called no matter what? I don't remember. I have
vague recollections that there was a reason for the from_tty thing. :-(

I've run through the CVS history, and I see that SOLIB_ADD has always
had from_tty set to 0. Yet I remember clearly that this used to work.
>From the looks of it, it would appear that this shouldn't work on unix,
either.

Well, that's all I have right now. You migt as well try setting info
verbose and seeing if that helps works around it for now.

Keith





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]