NetBSD Problem Report #58976

From www@netbsd.org  Wed Jan  8 12:54:13 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id AA55F1A9238
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  8 Jan 2025 12:54:13 +0000 (UTC)
Message-Id: <20250108125412.55A861A923B@mollari.NetBSD.org>
Date: Wed,  8 Jan 2025 12:54:12 +0000 (UTC)
From: uwe@stderr.spb.ru
Reply-To: uwe@stderr.spb.ru
To: gnats-bugs@NetBSD.org
Subject: sparc64 gdb cannot debug 32-bit binaries
X-Send-Pr-Version: www-1.0

>Number:         58976
>Category:       port-sparc64
>Synopsis:       sparc64 gdb cannot debug 32-bit binaries
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 08 12:55:00 +0000 2025
>Originator:     Valery Ushakov
>Release:        NetBSD current
>Organization:
>Environment:
NetBSD aurinko 10.99.12 NetBSD 10.99.12 (ULTRA1) #0: Sat Nov  9 00:23:25 MSK 2024  uwe@majava:/home/uwe/work/netbsd/cvs/src/sys/arch/sparc64/compile/ULTRA1 sparc64

>Description:
sparc64 gdb cannot debug programs compiled on that same sparc64 in
32-bit mode with -m32.  I use sparc64 for some 32-bit sparc work and
no working debugger is a problem (sparc gdb doesn't work either b/c of
port-sparc64/58975).

>How-To-Repeat:
<uwe@aurinko:~> (1022) cat > hello.c
#include <stdio.h>

int
main()
{
	printf("hello, world\n");
	return 0;
}
<uwe@aurinko:~> (1023) cc -m32 -o hello -g hello.c
<uwe@aurinko:~> (1024) ./hello
hello, world
<uwe@aurinko:~> (1025) gdb -q ./hello
Reading symbols from ./hello...
(gdb) b main
Breakpoint 1 at 0x10784: file hello.c, line 6.
(gdb) r
Starting program: /home/uwe/hello

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000a06 in ?? ()
(gdb) bt
#0  0x00000a06 in ?? ()
(gdb)

>Fix:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.