This is the mail archive of the gdb-patches@sourceware.org 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]

Re: [patch] Fix a glitch in debugging 32-bit process with 64-bit GDB.


Paul Pluzhnikov <ppluzhnikov@google.com> writes:

> 2008-12-10  Paul Pluzhnikov  <ppluzhnikov@google.com>
>
> 	* dbxread.c (stabs_seek): Sign-extend 32-bit STABS values for
> 	64-bit GDB.
> Index: dbxread.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/dbxread.c,v
> retrieving revision 1.98
> diff -u -p -u -r1.98 dbxread.c
> --- dbxread.c	1 Oct 2008 16:41:27 -0000	1.98
> +++ dbxread.c	10 Dec 2008 22:41:35 -0000
> @@ -855,7 +855,7 @@ stabs_seek (int sym_offset)
>      (intern).n_type = bfd_h_get_8 (abfd, (extern)->e_type);		\
>      (intern).n_other = 0;						\
>      (intern).n_desc = bfd_h_get_16 (abfd, (extern)->e_desc);  		\
> -    if (bfd_get_sign_extend_vma (abfd))					\
> +    if (sizeof (bfd_vma) > 4 || 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);	\

I don't think this does the right thing for genuine addresses beyond
0x80000000.  You can do that only for values that are truely signed,
which stabs has no way to express.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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