[patch] Fix uninitialized section index internal error

Joel Brobecker
2001-05-10T14:40:00Z

Hi,

it has been pointed to me that it is better to put the change log
inside the mail body rather than putting it inside the patch. So, I'll
start over. Please discard my previous message. Thanks.

While working with gdb on Tru64 5.1, we noticed the following internal
error sometimes happening at the begining of a gdb session:

| gdb/mdebugread.c:2448: gdb-internal-error: Section index is uninitialized
|
| An internal GDB error was detected. This may make further
| debugging unreliable. Continue this debugging session? (y or n) n

To reproduce the problem, simply compile the following C program:

mach.c:
<<
int
main (void)
{
return 0;
};
>>

Make sure libmach is linked in when building the program:
% gcc -o mach mach.c -lmach

After for investigation, I found that gdb was looking for a symbol in
the .bss section of libmach.so, but there is none (which explains why
the section index is not initialized). Instead, there is a .sbss
section, where the symbol is localized.

I modified default_symfile_offsets () to use the .sbss section if the
.bss one does not exist. In that change, I am assuming that a bss and a
sbss section are mutually exclusive.

This change has been integrated in ACT's version of gdb a few months
ago, and has worked well so far.

Here is the change log:

2001-05-10 J. Brobecker <brobecker@act-europe.fr>

* symfile.c (default_symfile_offsets): use the .sbss section in
place of the .bss section when the latter does not exist.

--
Joel
From ac131313@cygnus.com Thu May 10 15:30:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: [patch] Re-org mi/mi-out.c so that it is (almost) tupple aware
Date: Thu, 10 May 2001 15:30:00 -0000
Message-id: <3AFB167F.4030807@cygnus.com>
X-SW-Source: 2001-05/msg00188.html
Content-length: 152

FYI,

The attached patch tweeks mi/mi-out.c so that it has the tupple/list
parameter available where needed. It doesn't actually use it yet.

Andrew
From ac131313@cygnus.com Thu May 10 15:56:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: GDB Patches <gdb-patches@sourceware.cygnus.com>
Subject: Re: [rfc] Move Makefile.in:VERSION to VERSION file
Date: Thu, 10 May 2001 15:56:00 -0000
Message-id: <3AFB1C97.30009@cygnus.com>
References: <3AB3CB1D.85E1E043@cygnus.com>
X-SW-Source: 2001-05/msg00189.html
Content-length: 743

FYI, I'm about to check in the below but with s/VERSION/version/ for
the file.

Anyone like to come up with a 5 line /bin/sh script that updates this
file using CVS. It would need to remember to use date -u and should
probably check that it hasn't already been run today (1). The path to
the CVS repository and the path to the file would be arguments.

Andrew

(1) Due to the timezone scrample and the possibility of the CVS server
going down, I'm thinking of cheating and running the cronjob twice (if
not more :-)

2001-03-17 Andrew Cagney <ac131313@redhat.com>

* Makefile.in (VERSION): Delete. Moved to file VERSION.
(version.c): Depends on file VERSION. Extract version number from
VERSION file.
* VERSION: New file.