Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Charlie Mills <cmills@synopsys.com>
To: gdb-patches@sourceware.cygnus.com
Subject: Simple but crucial bug fix to gdb
Date: Wed, 30 May 2001 14:27:00 -0000	[thread overview]
Message-ID: <3.0.5.32.20010530142745.01470ec0@pophost.pdxuxbre.lmc.com> (raw)

Dear gdb maintainer,

I would like to submit a very simple patch to gdb.
I would like if possible to avoid legal issues (avoid having to
submit a form to our legal department) by simply describing the fix,
which is a diff of only a few characters, rather than sending you a
source file.

Bug description:  gdb 4.xx and 5.0 crashes while reading our executable.
Our executable is the result of linking objects compiled by gcc with
other objects compiled using SPARCworks CC.  The stack trace is
appended at the end of this message.

Unfortunately the executable is large and proprietary.
Although I can't submit a test case, it is very easy to confirm by
inspecting the code that the patch is correct and the original code
is incorrect.  The patch is as follows:

File: gdb-5.0/gdb/partial-stab.h

OLD, lines 602-605:

        if (textlow_not_set
            || (CUR_SYMBOL_VALUE < pst->textlow
                && CUR_SYMBOL_VALUE
                != ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)))
          {
            pst->textlow = CUR_SYMBOL_VALUE;

NEW, lines 602-605:

        if (pst && (textlow_not_set
            || (CUR_SYMBOL_VALUE < pst->textlow
                && CUR_SYMBOL_VALUE
                != ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT))))
          {
            pst->textlow = CUR_SYMBOL_VALUE;

OLD crashes because pst is 0 (and is intended to be 0 I think).

I hope this is enough for you to get this included in the next release.
I hate maintaining patches.  Please let me know if there is anything
else I can do for you about this.  Thank you!

-- Charlie Mills
   cmills@synopsys.com  (work)
   mills@q7.com         (personal)
   (503) 748-2665       (work)


#0  0xc4810 in read_dbx_symtab (objfile=0x1f7120) at partial-stab.h:602
#1  0xc2a94 in dbx_symfile_read (objfile=0x1f7120, mainline=0) at
dbxread.c:631
#2  0xc6974 in elfstab_build_psymtabs (objfile=0x1f7120, mainline=0, 
    staboffset=59705972, stabsize=2080088, stabstroffset=72560872, 
    stabstrsize=59705971) at dbxread.c:2652
#3  0xca24c in elf_symfile_read (objfile=0x1f7120, mainline=0) at
elfread.c:663
#4  0x5384c in syms_from_objfile (objfile=0x1f7120, addrs=0xffbedde8, 
    mainline=1, verbo=0) at symfile.c:807
#5  0x53a74 in symbol_file_add (
    name=0x1edee0 "/u/formal/nightly/synopsys/sparcOS5/fm/bin/fm_gui-g", 
    from_tty=0, addrs=0x0, mainline=1, flags=32) at symfile.c:943
#6  0x53d70 in symbol_file_command (args=0x1d7140 "", from_tty=0)
    at symfile.c:1087
#7  0x91a58 in do_captured_command (data=0xffbee468) at top.c:679
#8  0x919c8 in catch_errors (func=0x91a44 <do_captured_command>, 
    args=0xffbee468, errstring=0x16d438 "", mask=6) at top.c:615
#9  0x91a90 in catch_command_errors (command=0x53b84 <symbol_file_command>, 
    arg=0xffbeeaa7 "/u/formal/nightly/synopsys/sparcOS5/fm/bin/fm_gui-g", 
    from_tty=0, mask=6) at top.c:699
#10 0x34634 in captured_main (data=0xffbee864) at main.c:603
#11 0x919c8 in catch_errors (func=0x33d4c <captured_main>, args=0xffbee7e8, 
    errstring=0x14e880 "", mask=6) at top.c:615
#12 0x348e8 in main (argc=2, argv=0xffbee864) at main.c:761


             reply	other threads:[~2001-05-30 14:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-30 14:27 Charlie Mills [this message]
2001-05-30 14:36 ` Christopher Faylor
2001-05-30 15:16   ` Fernando Nasser
2001-05-30 20:18     ` Jim Blandy
2001-05-30 20:25       ` Christopher Faylor
2001-05-31  5:30       ` Fernando Nasser
2001-05-31 13:55         ` Jim Blandy
2001-05-31 14:43           ` Fernando Nasser
2001-05-31 16:46           ` Christopher Faylor
2001-05-31 17:40             ` Daniel Berlin
2001-05-31 20:00               ` Frank Ch. Eigler
2001-06-01  9:41                 ` Fernando Nasser
2001-06-01 10:01                 ` Michael Snyder
2001-06-01 11:14                   ` Daniel Berlin
2001-06-01 11:25                     ` Fernando Nasser
2001-06-01 14:05                       ` Charlie Mills
2001-06-06  6:01                 ` Andrew Cagney
2001-05-30 20:00   ` Christopher Faylor
2001-05-30 20:43     ` Christopher Faylor
2001-05-30 20:12 ` Jim Blandy
2001-05-30 21:23   ` Daniel Berlin
2001-06-01 13:35 ` Jim Blandy
2001-06-01 13:41   ` Fernando Nasser
2001-06-01 14:07   ` Daniel Berlin
2001-06-01 14:15     ` Jim Blandy
2001-06-01 14:17     ` Jim Blandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3.0.5.32.20010530142745.01470ec0@pophost.pdxuxbre.lmc.com \
    --to=cmills@synopsys.com \
    --cc=gdb-patches@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox