Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Mueller <m.mueller99@kay-mueller.de>
To: Mark Kettenis <kettenis@chello.nl>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC]: patch #2 for Sun C compiled target programs
Date: Mon, 28 Jun 2004 08:16:00 -0000	[thread overview]
Message-ID: <40DFD3AA.3060502@kay-mueller.de> (raw)
In-Reply-To: <200406241947.i5OJlgKr017239@elgar.kettenis.dyndns.org>

[-- Attachment #1: Type: text/plain, Size: 881 bytes --]


> 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.

[-- Attachment #2: dbxread.patch --]
[-- Type: text/plain, Size: 1256 bytes --]

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);	\

      parent reply	other threads:[~2004-06-28  8:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-18 17:21 Michael Mueller
2004-06-18 21:59 ` Mark Kettenis
2004-06-21 15:05   ` Michael Mueller
2004-06-24 19:34     ` Mark Kettenis
2004-06-24 19:47     ` Mark Kettenis
2004-06-24 20:57       ` Michael Mueller
2004-06-28  8:16       ` Michael Mueller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40DFD3AA.3060502@kay-mueller.de \
    --to=m.mueller99@kay-mueller.de \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@chello.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox