This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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]

[Bug win32/9474] GDB will not set pending breakpoints in DLL'sloaded with LoadLibrary()


http://sourceware.org/bugzilla/show_bug.cgi?id=9474

--- Comment #3 from Paul Bolle <pebolle at tiscali dot nl> 2011-04-28 15:19:43 UTC ---
(In reply to comment #2)
> Hmm?  Doesn't the win32 debug API send a LOAD_DLL_DEBUG_EVENT event when a dll
> is loaded with LoadLibrary?

0) You are right, of course. A little grepping on LOAD_DLL_DEBUG_EVENT pointed
me to the 'set debugevents' command. Using that command it became clear that
the DLL I was interested in was indeed loaded (and that gdb was aware of that
fact too).

> You don't seem to be tackling the same issue the OP reported:

1) This is what seems to be happening and what made me believe no breakpoints
were set (some of this is probably basic stuff that I record here to aid my own
memory):
- this PE32 DLL exports a number of symbols. objdump shows is uses a "Export
Address Table", a "Name Pointer Table" and a "Ordinal Table";
- if you look at the the dump of the "Export Address Table" and the
"[Ordinal/Name Pointer] Table" one sees that the "[Ordinal/Name Pointer] Table"
is in (basically) random order: it's not sorted on ordinal nor (alphabetically)
on the symbols;
- it turns out that (the version of) gdb (that I use) looks up the address of a
symbol in the "[Ordinal/Name Pointer] Table" as if that tables has the same
order as the "Export Address Table". But what actually should be done is: look
up a symbol in the O/NP table, get its ordinal and look up an address in the
EAT for that ordinal;
- I just happened to test gdb with a couple of symbols (which I knew from
wine's debugging output were used) that gdb mapped to addresses that simply
were not used at all in the code paths I apparently ran;
- this confusing behaviour quickly made me think that gdb never set pending
breakpoints in that DLL (which I knew as loaded through LoadLibraryA). Hence
the feeling I ran into the issue reported in this bug.

1) I looked around a bit in gdb's source (for instance in bfd/peXXigen.c), but
haven't found the place(s) were this mapping of symbols to addresses goes awry
for PE32 DLLs. Any suggestions were to look?

2) By the way, should I open a new report for this issue?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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