🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1201

gdb for sparc64-solaris2.10 and Sun cc 5.7

#1201
From: Ken Raeburn
Date: Wed, 18 Jan 2006 04:30
107 lines
6111 bytes
I configured and built gdb-6.4:

  env CC='cc -xarch=v9 -xs' ../configure --prefix=`pwd`/Install --disable-build-warnings sparc64-solaris2.10
  gmake

The --disable-build-warnings was needed, it tried to pass "-W -Wall"
even though the compiler isn't gcc.  The compiler in use is Sun's:

% cc -V
cc: Sun C 5.7 2005/01/07

The "-xs" tells it to retain the debugging info in the executable.

The built gdb (confirmed with "file" it's a 64-bit executable) doesn't
like itself:

% ./gdb ./gdb 
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or 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.
This GDB was configured as "sparc64-solaris2.10"...
Setting up the environment for debugging gdb.
During symbol reading, Unknown C++ symbol name `...:p(3,95)'.
During symbol reading, misplaced N_LBRAC entry; discarding local symbols which have no enclosing block.
Breakpoint 1 at 0x1000eae74: file ../../gdb/utils.c, line 817.
During symbol reading, unknown symbol type 0xd8.
Breakpoint 2 at 0x100144ddc: file ../../gdb/cli/cli-cmds.c, line 189.
(top-gdb) b main 
Breakpoint 3 at 0x1000da63c: file ../../gdb/gdb.c, line 30.
(top-gdb) run
Starting program: /u1/kr/gdb/gdb-6.4/build/gdb/gdb 
warning: Lowest section in /lib/sparcv9/libdl.so.1 is .dynamic at 00000000000000e8

Breakpoint 3, main (argc=Cannot access memory at address 0x7ffff4bc
) at ../../gdb/gdb.c:30
30        memset (&args, 0, sizeof args);
(top-gdb) bt
#0  main (argc=Cannot access memory at address 0x7ffff4bc
) at ../../gdb/gdb.c:30
(top-gdb) q
The program is running.  Exit anyway? (y or n) y


The "3,95" symbol appears to be defined thus (from strings and grep):

_pthread_attr:T(3,94)=s8__pthread_attrp:(3,95)=*(0,21),0,64;

Looking at sys/types.h, pthread_attr_t is a typedef for struct
_pthread_attr, which has one field named __pthread_attrp, a pointer to
void.  There are other pthread-related structure types with single
__pthread_*-named fields, but they use this same type:

_pthread_mutexattr:T(3,97)=s8__pthread_mutexattrp:(3,95),0,64;
_pthread_condattr:T(3,99)=s8__pthread_condattrp:(3,95),0,64;
_pthread_rwlockattr:T(3,104)=s8__pthread_rwlockattrp:(3,95),0,64;
:T(3,106)=s8__pthread_barrierattrp:(3,95),0,64;
sigval:T(14,1)=u8sival_int:(0,3),0,32;sival_ptr:(3,95),0,64;
__va_list:t(19,1)=(3,95)
va_list:t(39,1)=(3,95)
bfd_hash_table:T(43,44)=s32table:(43,45)=*(43,41),0,64;size:(0,14),64,32;newfunc:(43,46)=*(43,47)=f(43,41),128,64;memory:(3,95),192,64;
[...]



If I fire up gdb, suspend it, and run gcore on it, gdb doesn't like
that much either:

% ./gdb ./gdb core.19896 
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or 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.
This GDB was configured as "sparc64-solaris2.10"...
Core was generated by `./gdb'.
Reading symbols from /lib/sparcv9/libdl.so.1...
warning: Lowest section in /lib/sparcv9/libdl.so.1 is .dynamic at 00000000000000e8
done.
Loaded symbols for /lib/64/libdl.so.1
Reading symbols from /lib/sparcv9/libcurses.so.1...done.
Loaded symbols for /lib/64/libcurses.so.1
Reading symbols from /lib/sparcv9/libsocket.so.1...done.
Loaded symbols for /lib/64/libsocket.so.1
Reading symbols from /lib/sparcv9/libnsl.so.1...done.
Loaded symbols for /lib/64/libnsl.so.1
Reading symbols from /lib/sparcv9/libm.so.2...done.
Loaded symbols for /lib/64/libm.so.2
Reading symbols from /lib/sparcv9/libc.so.1...done.
Loaded symbols for /lib/64/libc.so.1
Reading symbols from /platform/SUNW,Sun-Blade-1500/lib/sparcv9/libc_psr.so.1...done.
Loaded symbols for /platform/SUNW,Sun-Blade-1500/lib/sparcv9/libc_psr.so.1
Reading symbols from /lib/sparcv9/libthread_db.so.1...done.
Loaded symbols for /lib/64/libthread_db.so.1
#0  0x0000000000000000 in ?? ()
Setting up the environment for debugging gdb.
During symbol reading, Unknown C++ symbol name `...:p(3,95)'.
During symbol reading, misplaced N_LBRAC entry; discarding local symbols which have no enclosing block.
Breakpoint 1 at 0x1000eae74: file ../../gdb/utils.c, line 817.
During symbol reading, unknown symbol type 0xd8.
Breakpoint 2 at 0x100144ddc: file ../../gdb/cli/cli-cmds.c, line 189.
(top-gdb) bt
#0  0x0000000000000000 in ?? ()
(top-gdb) 
Technical Details
Message-ID: <mailman.2002.1137829068.26925.bug-gdb@gnu.org>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f5053,70ee6a097048d0f6,start
X-Google-Attributes: gidf5053,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
From: Ken Raeburn <raeburn@MIT.EDU>
Newsgroups: gnu.gdb.bug
Subject: gdb for sparc64-solaris2.10 and Sun cc 5.7
Date: Tue, 17 Jan 2006 23:30:15 -0500
Lines: 110
Approved: bug-gdb@gnu.org
Message-ID: <mailman.2002.1137829068.26925.bug-gdb@gnu.org>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1137828912 23696 199.232.76.165 (21 Jan 2006 07:35:12 GMT)
X-Complaints-To: news@news.stanford.edu
To: bug-gdb@gnu.org
Envelope-to: bug-gdb@gnu.org
X-Spam-Score: 1.217
X-Scanned-By: MIMEDefang 2.42
X-Mailman-Approved-At: Sat, 21 Jan 2006 02:37:40 -0500
X-BeenThere: bug-gdb@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Bug reports for GDB, the GNU debugger" <bug-gdb.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-gdb>
List-Post: <mailto:bug-gdb@gnu.org>
List-Help: <mailto:bug-gdb-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=subscribe>