----- Original Message -----
From: "Earnie Boyd" <earnie_boyd@...>
To: "Infidel -" <coder_infidel@...>
Sent: Monday, April 15, 2002 7:41 PM
Subject: Re: [Mingw-users] GDB problem
> Infidel - wrote:
> > Hi,
> > When I try to run a program that is linked to odbc32.dll from within gdb
> > get the following error:
> > GNU gdb 5.1.1 (mingw experimental)
> > Copyright 2002 Free Software Foundation, Inc.
> > GDB is free software, covered by the GNU General Public License, and you
> > welcome to change it and/or distribute copies of it under certain
> > conditions.
> > Type "show copying" to see the conditions.
> > There is absolutely no warranty for GDB. Type "show warranty" for
> > This GDB was configured as "mingw32"...
> > (gdb) r
> > Starting program: C:\apps\mingw\msys\1.0\home\luked/gdb_odbc.exe
> > warning: Lowest section in C:/WINNT/System32/odbcint.dll is .rsrc at
> > 1f8c1000
> > ../../../BUILD/gdb-5.1.1/gdb/coffread.c:472: gdb-internal-error:
> > sect_index_text
> > not initialized
> > After printing this error, gdb hangs and the program does not run.
> Sounds as if you need to debug gdb. What's happening in coffread.c and
> line 472? Why was sect_index_text not initialized?
The short answer is: sect_index_text is not initialised because odbcint.dll
has no text section (only resources).
I know little about how gdb works, so I can only make some observations. The
error is reported in coff_end_symtab() in this line:
symtab = end_symtab (current_source_end_addr, objfile, SECT_OFF_TEXT
The SECT_OFF_TEXT() macro reports the error (objfiles.h):
#define SECT_OFF_TEXT(objfile) \
((objfile->sect_index_text == -1) \
? (internal_error (__FILE__, __LINE__, "sect_index_text not
initialized"), -1) \
I think that it is probably valid to pass -1 to end_symtab() because this
index seems to be used only to relocate line number addresses and other
symbols that could not be present without a text section. Whoever ported GDB
to Mingw would be better able to fix this problem though.
FYI, the problem can be more easily reproduced by running gdb without an
executable (no arguments) and typing the command "dll-symbols odbcint.dll".
But strangely, invoking gdb either way from rxvt fails to produce any error
messages (though it still hangs), while the messages do appear with straight
bash or cmd.
> > P.S. If there is a reason why nobody replied to my post on the MSYS list
> > then please tell me :)
> Was the post related to this? I didn't see it come through if it was.
You did reply, so never mind.
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com