This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/319: sparc{v9,64}-sun-solaris doesn't support 64-bit binaries



>Number:         319
>Category:       gdb
>Synopsis:       sparc{v9,64}-sun-solaris doesn't support 64-bit binaries
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 30 04:08:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     rbrown64@csc.com.au
>Release:        5.2 prerelease - 20020124 snapshot
>Organization:
>Environment:
sparcv9-sun-solaris2.8 compiled with gcc-3.0.3 sparcv9
>Description:
gdb 20020124 fails to debug 64-bit sparc binaries on
Solaris 2.8.  This duplicates PR 210

$ file /usr/local/64-bit/bin/gcov
/usr/local/64-bit/bin/gcov:   ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped

# Default 32-bit configuration
$ gdb+dejagnu-20020124.obj/gdb/gdb /usr/local/64-bit/bin/gcov
GNU gdb 20020124
...
This GDB was configured as "sparc-sun-solaris2.8"...
(gdb) b main
Cannot access memory at address 0x10c8
(gdb) r
Starting program: /space/local/64-bit/bin/gcov
procfs:4230 -- process not stopped.
procfs: ...giving up...

# 64-bit configuration
$ gdb+dejagnu-20020124.obj-64/gdb/gdb /usr/local/64-bit/bin/gcov
GNU gdb 2002012
...

This GDB was configured as "sparcv9-sun-solaris2.8"...
(gdb) b main
Cannot access memory at address 0x10c8
(gdb) r
Starting program: /space/local/64-bit/bin/gcov
../../gdb+dejagnu-20020124/gdb/utils.c:992: gdb-internal-error: virtual memory exhausted: can't allocate 794978670 bytes.

# 64-bit configuration defining _STRUCTURED_PROC=1 (& no optimization)
# => using HAVE_PSTATUS_T proc interface.

$  gdb+dejagnu-20020124.obj-64.2/gdb/gdb /usr/local/64-bit/bin/gcov
GNU gdb 20020124
...
This GDB was configured as "sparcv9-sun-solaris2.8"...
(gdb) b main
Cannot access memory at address 0x10c8
(gdb) r
Starting program: /space/local/64-bit/bin/gcov
../../gdb+dejagnu-20020124/gdb/utils.c:997: gdb-internal-error: virtual memory exhausted.

$ adb gdb*.2/gdb/gdb
nomem:b
:r /usr/local/64-bit/bin/gcov
GNU gdb 20020124
Copyright 2002 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 "sparcv9-sun-solaris2.8"...
SIGWINCH: Window Size Change
stopped at:
ioctl+0xc:     bcc,pt %icc,ioctl+0x28
$c
ioctl(0,ffffffff7e9b0f80,0,0,0,0) + c
get_tty_settings(0,ffffffff7fffeb20,0,0,0,0) + 14
rltty_set_default_bindings(1004a81e0,4a7800,2be000,1004d53f8,0,0) + 38
readline_default_bindings(0,4a7800,1005145e0,0,0,0) + 20
readline_initialize_everything(0,4d1800,0,0,0,0) + 1f0
rl_initialize(6,4d1c00,1004d54b0,4d1c00,0,0) + 2c
_rl_callback_newline(1004d53a0,100098050,0,0,0,0) + 4
rl_callback_handler_install(1004d5910,100098050,1004d2f58,0,0,100346649) + e8
cli_command_loop(1000965e8,4d3c00,0,0,0,0) + 1f8
captured_command_loop(0,100030b50,1b6,ffffffff7e9b0f80,0,0) + 58
do_catch_errors(10050bca0,ffffffff7ffff420,100128680,0,0,0) + 24
catcher(100128680,10050bca0,ffffffff7ffff420,ffffffff7ffff43c,ffffffff7ffff438,1003204b0) + 178
catch_errors(100030b50,0,1003204b0,6,0,0) + 74
captured_main(ffffffff7ffffb80,100030c1c,0,0,0,0) + 1b14
do_catch_errors(10049f570,ffffffff7ffffaa0,100128680,0,0,0) + 24
catcher(100128680,10049f570,ffffffff7ffffaa0,ffffffff7ffffabc,ffffffff7ffffab8,1003204b0) + 178
catch_errors(100030c1c,ffffffff7ffffb80,1003204b0,6,0,0) + 74
main(2,ffffffff7ffffc58,ffffffff7ffffc70,1004b0650,100000000,0) + 58
:c
SIGWINCH: Window Size Change
stopped at:
ioctl+0xc:     bcc,pt %icc,ioctl+0x28
:c
(gdb) b main
Cannot access memory at address 0x10c8
SIGWINCH: Window Size Change
stopped at:
ioctl+0xc:     bcc,pt %icc,ioctl+0x28
:c
(gdb) r
Starting program: /space/local/64-bit/bin/gcov
breakpoint at:
nomem:         save %sp, -0xc0, %sp
$c
nomem(0,ffffffff90122001,7f71f500,0,0,0)
xmalloc(ffffffff90122001,4bf400,4bf400,0,0,0) + 10
first_link_map_member(ffffffff7f71f5d8,4bf400,ffffffff7f71f5d8,ffffffff7fffd470,20,ffffffff7fffd590) + 20
svr4_current_sos(10016297c,4d3000,0,2,4,0) + 88
update_solib_list(0,0,0,fffffffffffffffe,ffffffff7fffdc28,12f800) + 30
solib_add(0,0,0,1,ffffffff7fffdc30,0) + 70
handle_inferior_event(ffffffff7fffdc00,1,0,1000c81a8,0,0) + 2e40
wait_for_inferior(0,4d3400,0,7efefeff,0,100588c91) + 1e4
proceed(ffffffffffffffff,0,0,1000ca764,1000ca350,0) + 3bc
procfs_create_inferior(1005037f0,100588c90,1004eaf30,1000ca9b8,100329a28,100588c90) + 2dc
sol_thread_create_inferior(1005037f0,100588c90,1004eaf30,10017a0d0,100329a28,100588c90) + 38
find_default_create_inferior(1005037f0,100588c90,1004eaf30,1000ec384,0,ffffffff7fffe421) + 48
run_command(0,1,100078b90,0,1,0) + 530
execute_command(1004d64b0,1,1004afa40,72006d61,7200,ff00) + 568
command_handler(1004d64b0,4d3c00,1004d64b0,72006d61,7200,ff00) + 1e8
command_line_handler(100588b50,100098050,100550200,0,0,0) + fb0
rl_callback_read_char(0,18,0,0,0,0) + 118
rl_callback_read_char_wrapper(0,10009658c,0,0,0,0) + 8
stdin_event_handler(0,0,1000977e0,0,0,0) + ec
handle_file_event(0,10015950c,1004d5890,0,0,0) + 270
process_event(0,0,0,0,0,0) + 1a4
gdb_do_one_event(0,10015848c,4a7800,4d1c00,ffffffff7fffec98,0) + 50
do_catch_errors(10050bca0,ffffffff7fffee50,100128680,6,0,0) + 24
catcher(100128680,10050bca0,ffffffff7fffee50,ffffffff7fffee6c,ffffffff7fffee68,10034d010) + 178
catch_errors(10015848c,0,10034d010,6,0,0) + 74
start_event_loop(1004d5910,100098050,1004d2f58,0,0,100346649) + 40
cli_command_loop(1000965e8,4d3c00,0,0,0,0) + 214
captured_command_loop(0,100030b50,1b6,ffffffff7e9b0f80,0,0) + 58
do_catch_errors(10050bca0,ffffffff7ffff420,100128680,0,0,0) + 24
catcher(100128680,10050bca0,ffffffff7ffff420,ffffffff7ffff43c,ffffffff7ffff438,1003204b0) + 178
catch_errors(100030b50,0,1003204b0,6,0,0) + 74
captured_main(ffffffff7ffffb80,100030c1c,0,0,0,0) + 1b14
do_catch_errors(10049f570,ffffffff7ffffaa0,100128680,0,0,0) + 24
catcher(100128680,10049f570,ffffffff7ffffaa0,ffffffff7ffffabc,ffffffff7ffffab8,1003204b0) + 178
catch_errors(100030c1c,ffffffff7ffffb80,1003204b0,6,0,0) + 74
main(2,ffffffff7ffffc58,ffffffff7ffffc70,1004b0650,100000000,0) + 58
:c
../../gdb+dejagnu-20020124/gdb/utils.c:997: gdb-internal-error: virtual memory exhausted.
An internal GDB error was detected.  This may make further
debugging unreliable.  Quit this debugging session? (y or n) n

Create a core file containing the current state of GDB? (y or n) n
SIGWINCH: Window Size Change
stopped at:
ioctl+0xc:     bcc,pt %icc,ioctl+0x28
:c
(gdb) $q
Undefined command: "".   Try "help".
SIGWINCH: Window Size Change
stopped at:
ioctl+0xc:     bcc,pt %icc,ioctl+0x28
:c
(gdb) q
The program is running.  Exit anyway? (y or n) y
process terminated
$q

$ adb gdb+dejagnu-20020124.obj-64.2/gdb/gdb
main:b
:r /usr/local/64-bit/bin/gcov
breakpoint at:
main:           save    %sp, -0xd0, %sp
$t
$r
g0    0                                 l0      2
g1    ffffffff7e89e73c _return_zero     l1      ffffffff7ffffc18
g2    0                                 l2      0
g3    0                                 l3      0
g4    ffffffff7e826338 atexit+0x80      l4      0
g5    1126f8                            l5      0
g6    0                                 l6      0
g7    0                                 l7      0
o0    2                                 i0      0
o1    ffffffff7ffffc18                  i1      0
o2    ffffffff7ffffc30                  i2      0
o3    1004b0650     environ@@SUNW_0.7   i3      0
o4    100000000                         i4      0
o5    0                                 i5      0
sp    ffffffff7ffff361                  fp      0
o7    100030624     _start+0x7c         i7      0
y     0
tstate: 0  (ccr=0x0, asi=0x0, pstate=0x0, cwp=0x0)
pstate: ag:0 ie:0 priv:0 am:0 pef:0 mm:0 tle:0 cle:0 mg:0 ig:0
pc    100032740 main:           save    %sp, -0xd0, %sp
npc   100032744 main+4:         mov     %i0, %o0
$m
? map
b1 =        100000000 e1 =        10039bc18 f1 =                0 `gdb+dejagnu-20020124.obj-64.2/gdb/gdb'
b2 =        10049bc18 e2 =        1004afa40 f2 =           39bc18 `gdb+dejagnu-20020124.obj-64.2/gdb/gdb'
b3 = ffffffff7f6038c0 e3 = ffffffff7f61c7ac f3 =             38c0 `/usr/lib/sparcv9/ld.so.1'
b4 = ffffffff7f213c48 e4 = ffffffff7f230878 f4 =            13c48 `/usr/lib/64/libcurses.so.1'
b5 = ffffffff7f005048 e5 = ffffffff7f00baf8 f5 =             5048 `/usr/lib/64/libsocket.so.1'
b6 = ffffffff7ee1fbb8 e6 = ffffffff7ee952f4 f6 =            1fbb8 `/usr/lib/64/libnsl.so.1'
b7 = ffffffff7f400a30 e7 = ffffffff7f400a90 f7 =              a30 `/usr/lib/64/libdl.so.1'
b8 = ffffffff7ea02eb0 e8 = ffffffff7ea11954 f8 =             2eb0 `/usr/lib/64/libm.so.1'
b9 = ffffffff7e826260 e9 = ffffffff7e8a3688 f9 =            26260 `/usr/lib/64/libc.so.1'
b10 = ffffffff7e601070 e10 = ffffffff7e602fd0 f10 =             1070 `/usr/lib/64/libmp.so.2'
b11 = ffffffff7e5005f0 e11 = ffffffff7e5035d0 f11 =              5f0 `/usr/platform/SUNW,Sun-Blade-100/lib/sparcv9/libc_psr.so.1'
/ map
b1 =                0 e1 = ffffffffffffffff f1 =                0 `-'
b2 =                0 e2 =                0 f2 =                0 `-'

adb
>How-To-Repeat:
Debug any 64-bit binary on sparcv9-sun-solaris2.8
>Fix:
Suggestion only.
Recognize existence of <procfs.h> which will trigger the
use of the pstatus_t interface. This has been the interface
Sun has suggested in the header file since Solaris 2.6 at
least. Requires change to bfd/{acinclude.m4,configure.in}
to update BFD_HAVE_SYS_PROCFS_{TYPE,MEMBER} to search
<procfs.h> preferentially over <sys/procfs.h>.
Alternately define _STRUCTURED_PROC=1 .
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER could also go into gdb/configure.in
to test for pr_dmodel in pstatus_t.
I guess you'd then use the pr_dmodel values defined in
<sys/procfs_isa.h> to select the architecture in a multiarched
SPARC gdb.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]