This is the mail archive of the gdb@sourceware.cygnus.com 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]

Re: Debugging Windows Namespace extension dll


In article <l03130305b44c7ccd1ad2@[138.251.135.28]>,
Mark Hindley  <mh15@st-andrews.ac.uk> wrote:
>>The way that I normally do something like this is:
>
>>   gdb /windows/explorer.exe
>>   symbol-file MyDll.dll
>>    set args /root
>>    l DllMain
>>   bp <first line number in DllMain>
>>   run
>
>>As you probably, know using 'symbol-file' wipes out any existing symbol file
>>so this may not be exactly what you want.  You could use add-sym if you know
>>the load address of your DLL.
>
>>Hope this helps,
>>Chris Faylor
>
>
>Dear Chris,
>
>Thanks for your help.
>
>I still get Cannot access memory at 0x.... when I try to place a breakpoint
>at DllMain. I have managed to circumvent this by placing
>	if (bDebug) DebugBreak();
>
>in DllMain, but it is not pretty.

Note that I said that I set a breakpoint on the first line of the function.
That means that you have to first list the function, find the line and set
the breakpoint there.  You can't set a breakpoint on the function by saying
'bp DllMain' prior to running the program.

>And I still get an access violation every time the dll is loaded, either
>for the symbol table or for excution.

Do you get this when using the DebugBreak() method or does it always
occur?  Is the access violation occurring in gdb or in your program?

-chris
-- 
cgf@cygnus.com
http://www.cygnus.com/

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