From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11720 invoked by alias); 28 Jun 2004 08:16:16 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11709 invoked from network); 28 Jun 2004 08:16:15 -0000 Received: from unknown (HELO moutng.kundenserver.de) (212.227.126.189) by sourceware.org with SMTP; 28 Jun 2004 08:16:15 -0000 Received: from [212.227.126.205] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1BerJE-0002cM-00; Mon, 28 Jun 2004 10:16:12 +0200 Received: from [217.235.213.229] (helo=[217.235.213.229]) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1BerJE-0005mi-00; Mon, 28 Jun 2004 10:16:12 +0200 Message-ID: <40DFD3AA.3060502@kay-mueller.de> Date: Mon, 28 Jun 2004 08:16:00 -0000 From: Michael Mueller User-Agent: Mozilla/5.0 MIME-Version: 1.0 To: Mark Kettenis CC: gdb-patches@sources.redhat.com Subject: Re: [RFC]: patch #2 for Sun C compiled target programs References: <40D32489.9070503@kay-mueller.de> <200406182159.i5ILxF9G001540@elgar.kettenis.dyndns.org> <40D6F901.3010008@kay-mueller.de> <200406241947.i5OJlgKr017239@elgar.kettenis.dyndns.org> In-Reply-To: <200406241947.i5OJlgKr017239@elgar.kettenis.dyndns.org> Content-Type: multipart/mixed; boundary="------------070801040308060003080602" X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:acfe4e233830c7fd36d26ada4c2bf87e X-SW-Source: 2004-06/txt/msg00628.txt.bz2 This is a multi-part message in MIME format. --------------070801040308060003080602 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 881 > Not sure. As I said, it's not easy. As far as I understand things, > INTERNALIZE_SYMBOL() should look at n_type to decide whether n_value > should be treated as a signed or an unsigned value. The problem seems > to be that n_value can either be interpreted as an address or as an > offset. Addresses should be sign-extended based on what > bfd_get_sign_extend_vma() tells us. Offsets should probably always be > sign-extended. > > Mark > The gdb stabs docu says: 4.1 Automatic Variables Allocated on the Stack The value of the stab is the offset of the variable within the local variables. On most machines this is an offset from the frame pointer and is negative. I think we could sign extend e_value if bfd_get_sign_extend_vma() tells us OR if n_type == N_LSYM. N_LSYM is also used for types. But e_value seems to be unused and = 0 in this case. --------------070801040308060003080602 Content-Type: text/plain; name="dbxread.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dbxread.patch" Content-length: 1256 Index: dbxread.c =================================================================== RCS file: /cvs/src/src/gdb/dbxread.c,v retrieving revision 1.67 diff -c -p -r1.67 dbxread.c *** dbxread.c 10 Jun 2004 20:05:43 -0000 1.67 --- dbxread.c 28 Jun 2004 07:39:31 -0000 *************** stabs_seek (int sym_offset) *** 852,858 **** (intern).n_type = bfd_h_get_8 (abfd, (extern)->e_type); \ (intern).n_strx = bfd_h_get_32 (abfd, (extern)->e_strx); \ (intern).n_desc = bfd_h_get_16 (abfd, (extern)->e_desc); \ ! if (bfd_get_sign_extend_vma (abfd)) \ (intern).n_value = bfd_h_get_signed_32 (abfd, (extern)->e_value); \ else \ (intern).n_value = bfd_h_get_32 (abfd, (extern)->e_value); \ --- 852,859 ---- (intern).n_type = bfd_h_get_8 (abfd, (extern)->e_type); \ (intern).n_strx = bfd_h_get_32 (abfd, (extern)->e_strx); \ (intern).n_desc = bfd_h_get_16 (abfd, (extern)->e_desc); \ ! /* stack variable offsets (N_LSYM) are always signed */ \ ! if ((intern).n_type == N_LSYM || bfd_get_sign_extend_vma (abfd)) \ (intern).n_value = bfd_h_get_signed_32 (abfd, (extern)->e_value); \ else \ (intern).n_value = bfd_h_get_32 (abfd, (extern)->e_value); \ --------------070801040308060003080602--