This is the mail archive of the gdb@sources.redhat.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]
Other format: [Raw text]

Re: Win32 dlls without .text section


Hi!

Thursday, 26 September, 2002 egor duda deo@logos-m.ru wrote:

ed>   Certain win32 dlls may have no .text section, but contain only .rsrc
ed> and .reloc sections. When such dll is loaded by application, and we
ed> try to run or attach to such application with gdb, we'll got
ed> internal_error in coffread.c (function coff_end_symtab).

ed> What is the proper way to deal with such problem? Ignore files without
ed> .text section altogether? Try to deal with them? I'm not sure i fully
ed> understand why text section is needed to load symbol table. Can
ed> anybody explain?

The patch to fix this problem:

2002-12-10  Egor Duda  <deo@logos-m.ru>

        * coffread.c (coff_symtab_read): Skip reading symbols from files
        without text section to avoid internal errors.

Index: coffread.c
===================================================================
RCS file: /cvs/uberbaum/gdb/coffread.c,v
retrieving revision 1.31
diff -u -p -2 -r1.31 coffread.c
--- coffread.c  11 Nov 2002 00:55:34 -0000      1.31
+++ coffread.c  10 Dec 2002 16:41:44 -0000
@@ -740,4 +740,11 @@ coff_symtab_read (long symtab_offset, un
   CORE_ADDR tmpaddr;
 
+  if (objfile->sect_index_text == -1)
+    {
+      warning ("File %s does not contain text section. No symbols have been read.\n",
+               objfile->name);
+      return;
+    }
+
   /* Work around a stdio bug in SunOS4.1.1 (this makes me nervous....
      it's hard to know I've really worked around it.  The fix should be

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19


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