[754] in linux-announce channel archive

home help back first fref pref prev next nref lref last post

A ELF core dump patch for gdb 4.14

daemon@ATHENA.MIT.EDU (Lars Wirzenius)
Mon Jul 10 13:43:02 1995

Date: Sun, 9 Jul 1995 15:20:20 +0300
From: Lars Wirzenius <wirzeniu@cc.helsinki.fi>
To: linux-activists@niksula.hut.fi, linux-announce@vger.rutgers.edu

X-Mn-Key: announce

From: hjl@nynexst.com (H.J. Lu)
Subject: A ELF core dump patch for gdb 4.14
Newsgroups: comp.os.linux.announce
Keywords: ELF, GCC, GDB, core dumps, programming
Organization: ?
Approved: linux-announce@news.ornl.gov (Lars Wirzenius)
Followup-to: comp.os.linux.development.system

Hi, Folks,

This is the second Linux/ELF core dump patch for gdb 4.14, which is
based on the patch made by jeremy@sour.sw.oz.au (Jeremy Fitzhardinge)
and Eric Youngdale's shared library support. You need kernel 1.3.5 or
above to generate ELF core dump.

The primary ftp sites for the compiler/C library are tsx-11.mit.edu
under pub/linux/packages/GCC and sunsite.unc.edu under pub/Linux/GCC.
gdb-4.14.elf.1.bin.tar.gz contains gdb-4.1.14.elf.1.diff.gz, a patch
against gdb 4.14, and gdb, a static ELF gdb binary. You need libc
5.1.2 or above to compile it without fixing one Linux header file,
<sys/procfs.h> which should include <linux/elfcore.h>.


H.J.
hjl@nynexst.com
07/08/95
----From Eric-----

        This directory contains a gdb that will work with ELF images
and automatically detect the shared libraries that are in use.  You
will now be able to debug into a shared library in a transparent
fashion without any of the hacks that we have used in the past.

        gdb.diff: patches to gdb-4.14
        gdb     - ELF executable for gdb linked against libc.so.5.


Here is an example of the new capabilities:
---------------------------------------------------------------
bash$ gdb test
GDB is free software and you are welcome to 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 details.
GDB 4.14 (i486-linux), Copyright 1995 Free Software Foundation, Inc...
(no debugging symbols found)...
(gdb) break main
Breakpoint 1 at 0x8000513
(gdb) break printf
Breakpoint 2 at 0x80003e8  # Note - this is in PLT of test.
(gdb) info shared
No shared libraries loaded at this time.
(gdb) run
Starting program: /usr1/users/eric/test 
(no debugging symbols found)...Breakpoint 2 at 0x50030940 #Bkpt now in shlib
(no debugging symbols found)...
Breakpoint 1, 0x8000513 in main ()
(gdb) info shared
>From        To          Syms Read   Shared Object Library
0x50007000  0x500ab2cc  Yes         /lib/libc.so.5
0x50000000  0x50005374  Yes         /lib/ld-linux.so.1
(gdb) info break
Num Type           Disp Enb Address    What
1   breakpoint     keep y    0x08000513  <main+3>
        breakpoint already hit 1 time
2   breakpoint     keep y    0x50030940  <printf>
(gdb) disass printf
Dump of assembler code for function printf:
0x50030940 <printf>:    pushl  %ebx
0x50030941 <printf+1>:  call   0x50030946 <printf+6>
0x50030946 <printf+6>:  popl   %ebx
0x50030947 <printf+7>:  addl   $0x4b116,%ebx
0x5003094d <printf+13>: movl   0x8(%esp,1),%eax
0x50030951 <printf+17>: leal   0xc(%esp,1),%edx
0x50030955 <printf+21>: pushl  %edx
0x50030956 <printf+22>: pushl  %eax
0x50030957 <printf+23>: movl   0x82c(%ebx),%eax
0x5003095d <printf+29>: pushl  %eax
0x5003095e <printf+30>: call   0x500144d8 <_init+6584>
0x50030963 <printf+35>: addl   $0xc,%esp
0x50030966 <printf+38>: popl   %ebx
0x50030967 <printf+39>: ret    
0x50030968 <printf+40>: nop    
0x50030969 <printf+41>: nop    
0x5003096a <printf+42>: nop    
0x5003096b <printf+43>: nop    
0x5003096c <printf+44>: nop    
0x5003096d <printf+45>: nop    
0x5003096e <printf+46>: nop    
0x5003096f <printf+47>: nop    
End of assembler dump.

--
Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov
PLEASE remember Keywords: and a short description of the software.


home help back first fref pref prev next nref lref last post