Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3C3CC560.A3CB3DEE@scotiacapital.com> Date: Wed, 09 Jan 2002 17:34:08 -0500 From: Jeanine Kwong X-Mailer: Mozilla 4.72 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Debugging Excel-callable dll in WinNT using GDB Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 excel.exe (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!! Questions: 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 know. Any help is highly appreciated. Thanks, Jeanine Kwong Analyst Scotia Capital -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/