This is the mail archive of the 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]

Debugging Excel-callable dll in WinNT using GDB

Hi all,

I would like to debug an Excel-callable dll in Windows NT machine using
gdb version 4.17.1.  Because the dll contains a c++ function that
creates a thread, I put in a DebugBreak() call in the c++ codes before
and inside whhere the program creates a thread.  The program is compiled
with g++.

What the c++ function does is takes in the parameters from the excel
formula, do some calculations, then output the result to the cell.   

I tried the following:
(gdb) file c:\\progra~1\\micros~1\\office\\excel.exe    'path to
(gdb) run       'Excel started

At this point, gdb command window beaome inactive.
I put the formula in a cell in the Excel worksheet with the appropriate
parameters and pressed enter.
The dll kicks in and hit the line where "DebugBreak()" is.  gdb regains
its control.

(gdb) l      'show 10 lines after where debugBreak() is, before creating
a thread
(gdb) cont   'continue to the DebugBreak() after inside the procedure
when the thread is created.

(gdb) 1      '***PROBLEM STARTS****!!!
It showed 10 lines, but they are not the lines that I expected to see! 
I suspect that it gdb is still in the "old" thread.

(gdb) info threads         'attempt to find out the thread IDs
info threads               'not helpful at all!!

Is there any way that I can find out the thread ID?  Is there any switch
that I have to have to put when I compile the program so that gdb
becomes thread-aware?  Any suggestion?  

I am thinking of getting a newer version of gdb, but I could not find a
pre-compiled version of it (ie. a .exe file).  If you do, please let me

Any help is highly appreciated.

Jeanine Kwong
Scotia Capital

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