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

Paul Pluzhnikov
2008-12-10T23:21:20Z

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

On Wed, Dec 10, 2008 at 7:58 AM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:

> I think it's pretty clear that BFD is to blame.

Well, may be not a BFD problem after all...

Does the patch below seem reasonable?

Thanks,
--
Paul Pluzhnikov

2008-12-10 Paul Pluzhnikov <ppluzhnikov@google.com>

* dbxread.c (stabs_seek): Sign-extend 32-bit STABS values for
64-bit GDB.

[-- Attachment #2: gdb-1526195-20081210.txt --]
[-- Type: text/plain, Size: 756 bytes --]

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