login
Header Space

 
 

Re: gdb 4.9 and core files

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Date: Wednesday, May 19, 1993 - 2:38 pm

In article <1993May19.073041.20866@nessie.mcc.ac.uk> LeBlanc@mcc.ac.uk writes:

No promises, but I do have a hacked version og gdb-4.9 which seems to
work well even for core-files (my other hacks help debugging programs
which are loaded at some other address than 0 - shared libraries and a
gzipped kernel). To get gdb to recognize linux core-files, I removed the
check in bfd/trad-core.c that looks something like this:

    if (NBPG * (UPAGES + u.u_dsize + u.u_ssize) < statbuf.st_size)
      {
        /* The file is too big.  Maybe it's not a core file
           or we otherwise have bad values for u_dsize and u_ssize).  */
        bfd_error = wrong_format;
        return 0;
      }

(around line 114 or so).  The reason is that linux dumps some additional
data at the end of a core-dump (the task-struct, to be exact), which gdb
doesn't expect, and the above test will make gdb suspect that it's not a
valid core-dump after all.  Disabling the check with "#ifndef __linux__"
around it should get it working.  If anybody wants to send in this
report to the gdb people, feel free (I haven't done so - I've done other
hacks on it, so I can't guarantee the above is the one final solution). 

                Linus
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: gdb 4.9 and core files, Linus Torvalds, (Wed May 19, 2:38 pm)
speck-geostationary