* The problem with stabs and sign extension
@ 2001-08-08 14:11 Daniel Jacobowitz
2001-08-08 16:14 ` H . J . Lu
0 siblings, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2001-08-08 14:11 UTC (permalink / raw)
To: gdb
The problem seems, to my inexperienced eye, to be in stabsread.c:
#define INTERNALIZE_SYMBOL(intern, extern, abfd) \
{ \
(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); \
(intern).n_value = bfd_h_get_32 (abfd, (extern)->e_value); \
}
n_value is a CORE_ADDR. bfd_h_get_32 returns a bfd_vma, without doing sign
extension. For MIPS, we want sign extension to have happened here. Right?
It does if we're reading mdebug in (because ECOFF_SIGNED_32 is defined in
BFD).
On the other hand, I'm sure other targets don't want sign extension here.
How should we handle this?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: The problem with stabs and sign extension
2001-08-08 14:11 The problem with stabs and sign extension Daniel Jacobowitz
@ 2001-08-08 16:14 ` H . J . Lu
2001-08-08 16:54 ` H . J . Lu
0 siblings, 1 reply; 11+ messages in thread
From: H . J . Lu @ 2001-08-08 16:14 UTC (permalink / raw)
To: gdb
On Wed, Aug 08, 2001 at 02:12:07PM -0700, Daniel Jacobowitz wrote:
> The problem seems, to my inexperienced eye, to be in stabsread.c:
>
> #define INTERNALIZE_SYMBOL(intern, extern, abfd) \
> { \
> (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); \
> (intern).n_value = bfd_h_get_32 (abfd, (extern)->e_value); \
> }
>
> n_value is a CORE_ADDR. bfd_h_get_32 returns a bfd_vma, without doing sign
> extension. For MIPS, we want sign extension to have happened here. Right?
> It does if we're reading mdebug in (because ECOFF_SIGNED_32 is defined in
> BFD).
>
> On the other hand, I'm sure other targets don't want sign extension here.
> How should we handle this?
You can do
#define INTERNALIZE_SYMBOL(intern, extern, abfd) \
{ \
(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); \
}
But I don't think it is the main problem. From what I can see,
dbxread.c has no clue whatsoever about the sign extension. I
don't know how hard to fix it.
H.J.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: The problem with stabs and sign extension
2001-08-08 16:14 ` H . J . Lu
@ 2001-08-08 16:54 ` H . J . Lu
2001-08-08 17:03 ` H . J . Lu
0 siblings, 1 reply; 11+ messages in thread
From: H . J . Lu @ 2001-08-08 16:54 UTC (permalink / raw)
To: gdb; +Cc: gdbpatches
On Wed, Aug 08, 2001 at 04:14:21PM -0700, H . J . Lu wrote:
> On Wed, Aug 08, 2001 at 02:12:07PM -0700, Daniel Jacobowitz wrote:
> > The problem seems, to my inexperienced eye, to be in stabsread.c:
> >
> > #define INTERNALIZE_SYMBOL(intern, extern, abfd) \
> > { \
> > (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); \
> > (intern).n_value = bfd_h_get_32 (abfd, (extern)->e_value); \
> > }
> >
> > n_value is a CORE_ADDR. bfd_h_get_32 returns a bfd_vma, without doing sign
> > extension. For MIPS, we want sign extension to have happened here. Right?
> > It does if we're reading mdebug in (because ECOFF_SIGNED_32 is defined in
> > BFD).
> >
> > On the other hand, I'm sure other targets don't want sign extension here.
> > How should we handle this?
>
With this patch, I can do
# gdb vmlinux
...
(gdb) print printk
$1 = {int (char *)} 0x8011c5b0 <printk>
(gdb) list printk
250 printk.c: No such file or directory.
in printk.c
H.J.
----
2001-08-08 H.J. Lu (hjl@gnu.org)
* dbxread.c (COERCE32): New.
(SWAP_SYMBOL): Removed.
(INTERNALIZE_SYMBOL): Check sign extended vma.
(read_ofile_symtab): Set text_offset with COERCE32.
--- gdb/dbxread.c.vma Fri Jul 13 12:12:34 2001
+++ gdb/dbxread.c Wed Aug 8 16:49:09 2001
@@ -109,6 +109,10 @@ struct symloc
#define SYMBOL_OFFSET(p) (SYMLOC(p)->symbol_offset)
#define STRING_OFFSET(p) (SYMLOC(p)->string_offset)
#define FILE_STRING_OFFSET(p) (SYMLOC(p)->file_string_offset)
+
+/* Sign extension to bfd_signed_vma. */
+#define COERCE32(x) \
+ ((bfd_signed_vma) (long) (((unsigned long) (x) ^ 0x80000000) - 0x80000000))
\f
/* Remember what we deduced to be the source language of this psymtab. */
@@ -946,22 +950,15 @@ fill_symbuf (bfd *sym_bfd)
symbuf_read += nbytes;
}
-#define SWAP_SYMBOL(symp, abfd) \
- { \
- (symp)->n_strx = bfd_h_get_32(abfd, \
- (unsigned char *)&(symp)->n_strx); \
- (symp)->n_desc = bfd_h_get_16 (abfd, \
- (unsigned char *)&(symp)->n_desc); \
- (symp)->n_value = bfd_h_get_32 (abfd, \
- (unsigned char *)&(symp)->n_value); \
- }
-
#define INTERNALIZE_SYMBOL(intern, extern, abfd) \
{ \
(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); \
- (intern).n_value = bfd_h_get_32 (abfd, (extern)->e_value); \
+ 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); \
}
/* Invariant: The symbol pointed to by symbuf_idx is the first one
@@ -1687,7 +1684,7 @@ read_ofile_symtab (struct partial_symtab
objfile = pst->objfile;
sym_offset = LDSYMOFF (pst);
sym_size = LDSYMLEN (pst);
- text_offset = pst->textlow;
+ text_offset = COERCE32 (pst->textlow);
text_size = pst->texthigh - pst->textlow;
/* This cannot be simply objfile->section_offsets because of
elfstab_offset_sections() which initializes the psymtab section
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: The problem with stabs and sign extension
2001-08-08 16:54 ` H . J . Lu
@ 2001-08-08 17:03 ` H . J . Lu
2001-08-08 17:15 ` [rfa] " Daniel Jacobowitz
0 siblings, 1 reply; 11+ messages in thread
From: H . J . Lu @ 2001-08-08 17:03 UTC (permalink / raw)
To: gdb
On Wed, Aug 08, 2001 at 04:53:59PM -0700, H . J . Lu wrote:
> With this patch, I can do
>
> # gdb vmlinux
> ...
> (gdb) print printk
> $1 = {int (char *)} 0x8011c5b0 <printk>
> (gdb) list printk
> 250 printk.c: No such file or directory.
> in printk.c
>
>
Here is an update.
H.J.
---
2001-08-08 H.J. Lu (hjl@gnu.org)
* dbxread.c (COERCE32): New.
(SWAP_SYMBOL): Removed.
(INTERNALIZE_SYMBOL): Check sign extended vma.
(read_ofile_symtab): Set text_offset with COERCE32 if
necessary.
--- gdb/dbxread.c.vma Fri Jul 13 12:12:34 2001
+++ gdb/dbxread.c Wed Aug 8 17:00:26 2001
@@ -109,6 +109,10 @@ struct symloc
#define SYMBOL_OFFSET(p) (SYMLOC(p)->symbol_offset)
#define STRING_OFFSET(p) (SYMLOC(p)->string_offset)
#define FILE_STRING_OFFSET(p) (SYMLOC(p)->file_string_offset)
+
+/* Sign extension to bfd_signed_vma. */
+#define COERCE32(x) \
+ ((bfd_signed_vma) (long) (((unsigned long) (x) ^ 0x80000000) - 0x80000000))
\f
/* Remember what we deduced to be the source language of this psymtab. */
@@ -946,22 +950,15 @@ fill_symbuf (bfd *sym_bfd)
symbuf_read += nbytes;
}
-#define SWAP_SYMBOL(symp, abfd) \
- { \
- (symp)->n_strx = bfd_h_get_32(abfd, \
- (unsigned char *)&(symp)->n_strx); \
- (symp)->n_desc = bfd_h_get_16 (abfd, \
- (unsigned char *)&(symp)->n_desc); \
- (symp)->n_value = bfd_h_get_32 (abfd, \
- (unsigned char *)&(symp)->n_value); \
- }
-
#define INTERNALIZE_SYMBOL(intern, extern, abfd) \
{ \
(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); \
- (intern).n_value = bfd_h_get_32 (abfd, (extern)->e_value); \
+ 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); \
}
/* Invariant: The symbol pointed to by symbuf_idx is the first one
@@ -1685,9 +1682,13 @@ read_ofile_symtab (struct partial_symtab
struct section_offsets *section_offsets;
objfile = pst->objfile;
+ abfd = objfile->obfd;
sym_offset = LDSYMOFF (pst);
sym_size = LDSYMLEN (pst);
- text_offset = pst->textlow;
+ if (bfd_get_sign_extend_vma (abfd))
+ text_offset = COERCE32 (pst->textlow);
+ else
+ text_offset = pst->textlow;
text_size = pst->texthigh - pst->textlow;
/* This cannot be simply objfile->section_offsets because of
elfstab_offset_sections() which initializes the psymtab section
@@ -1701,7 +1702,6 @@ read_ofile_symtab (struct partial_symtab
stringtab_global = DBX_STRINGTAB (objfile);
last_source_file = NULL;
- abfd = objfile->obfd;
symfile_bfd = objfile->obfd; /* Implicit param to next_text_symbol */
symbuf_end = symbuf_idx = 0;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [rfa] Re: The problem with stabs and sign extension
2001-08-08 17:03 ` H . J . Lu
@ 2001-08-08 17:15 ` Daniel Jacobowitz
2001-08-08 21:06 ` H . J . Lu
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Daniel Jacobowitz @ 2001-08-08 17:15 UTC (permalink / raw)
To: gdb; +Cc: gdb-patches
On Wed, Aug 08, 2001 at 05:03:26PM -0700, H . J . Lu wrote:
> On Wed, Aug 08, 2001 at 04:53:59PM -0700, H . J . Lu wrote:
> > With this patch, I can do
> >
> > # gdb vmlinux
> > ...
> > (gdb) print printk
> > $1 = {int (char *)} 0x8011c5b0 <printk>
> > (gdb) list printk
> > 250 printk.c: No such file or directory.
> > in printk.c
> >
> >
>
> Here is an update.
This isn't quite the right solution, I think. In particular,
> (SWAP_SYMBOL): Removed.
> (INTERNALIZE_SYMBOL): Check sign extended vma.
are correct, but:
> * dbxread.c (COERCE32): New.
> (read_ofile_symtab): Set text_offset with COERCE32 if
> necessary.
are not. The psymtab has the wrong offsets in it if you do this.
There's actually a clear bug here, once you know where to look. A
CORE_ADDR is assigned to a long int in partial-stab.h. There's a
warning flag in GCC for this, isn't there?
Please try the patch attached.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
2001-08-08 Daniel Jacobowitz <drow@mvista.com>
* partial-stab.h: valu should be a CORE_ADDR.
2001-08-08 H.J. Lu (hjl@gnu.org)
* dbxread.c (SWAP_SYMBOL): Removed.
(INTERNALIZE_SYMBOL): Check sign extended vma.
Index: partial-stab.h
===================================================================
RCS file: /cvs/src/src/gdb/partial-stab.h,v
retrieving revision 1.11
diff -u -p -r1.11 partial-stab.h
--- partial-stab.h 2001/06/01 21:17:50 1.11
+++ partial-stab.h 2001/08/09 00:11:41
@@ -201,7 +201,7 @@ switch (CUR_SYMBOL_TYPE)
case N_SO:
{
- unsigned long valu;
+ CORE_ADDR valu;
static int prev_so_symnum = -10;
static int first_so_symnum;
char *p;
Index: dbxread.c
===================================================================
RCS file: /cvs/src/src/gdb/dbxread.c,v
retrieving revision 1.19
diff -u -p -r1.19 dbxread.c
--- dbxread.c 2001/07/07 17:19:50 1.19
+++ dbxread.c 2001/08/09 00:11:41
@@ -944,22 +944,15 @@
symbuf_read += nbytes;
}
-#define SWAP_SYMBOL(symp, abfd) \
- { \
- (symp)->n_strx = bfd_h_get_32(abfd, \
- (unsigned char *)&(symp)->n_strx); \
- (symp)->n_desc = bfd_h_get_16 (abfd, \
- (unsigned char *)&(symp)->n_desc); \
- (symp)->n_value = bfd_h_get_32 (abfd, \
- (unsigned char *)&(symp)->n_value); \
- }
-
#define INTERNALIZE_SYMBOL(intern, extern, abfd) \
{ \
(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); \
- (intern).n_value = bfd_h_get_32 (abfd, (extern)->e_value); \
+ 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); \
}
/* Invariant: The symbol pointed to by symbuf_idx is the first one
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] Re: The problem with stabs and sign extension
2001-08-08 17:15 ` [rfa] " Daniel Jacobowitz
@ 2001-08-08 21:06 ` H . J . Lu
2001-08-10 15:31 ` H . J . Lu
2001-08-14 21:58 ` Elena Zannoni
2 siblings, 0 replies; 11+ messages in thread
From: H . J . Lu @ 2001-08-08 21:06 UTC (permalink / raw)
To: gdb, gdb-patches
On Wed, Aug 08, 2001 at 05:16:16PM -0700, Daniel Jacobowitz wrote:
> > necessary.
>
> are not. The psymtab has the wrong offsets in it if you do this.
>
> There's actually a clear bug here, once you know where to look. A
> CORE_ADDR is assigned to a long int in partial-stab.h. There's a
> warning flag in GCC for this, isn't there?
>
> Please try the patch attached.
(gdb) list printk
250 printk.c: No such file or directory.
in printk.c
works. But
(gdb) print printk
During symbol reading, inner block (0x802ac9d4-0xffffffff) not inside outer block (0x802aca18-0xffffffff).
$1 = {int (char *)} 0x8011c5b0 <printk>
Something is still wrong.
H.J.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] Re: The problem with stabs and sign extension
2001-08-08 17:15 ` [rfa] " Daniel Jacobowitz
2001-08-08 21:06 ` H . J . Lu
@ 2001-08-10 15:31 ` H . J . Lu
2001-08-14 21:58 ` Elena Zannoni
2 siblings, 0 replies; 11+ messages in thread
From: H . J . Lu @ 2001-08-10 15:31 UTC (permalink / raw)
To: gdb, gdb-patches
On Wed, Aug 08, 2001 at 05:16:16PM -0700, Daniel Jacobowitz wrote:
>
> There's actually a clear bug here, once you know where to look. A
> CORE_ADDR is assigned to a long int in partial-stab.h. There's a
> warning flag in GCC for this, isn't there?
>
You miised one CORE_ADDR in partial-stab.h. This patch seems to fix
my problem. Any comments?
Thanks.
H.J.
-----
2001-08-10 Daniel Jacobowitz <drow@mvista.com>
H.J. Lu (hjl@gnu.org)
* partial-stab.h: valu should be a CORE_ADDR.
2001-08-08 H.J. Lu (hjl@gnu.org)
* dbxread.c (SWAP_SYMBOL): Removed.
(INTERNALIZE_SYMBOL): Check sign extended vma.
--- gdb/dbxread.c.vma Fri Jul 13 12:12:34 2001
+++ gdb/dbxread.c Wed Aug 8 21:02:29 2001
@@ -946,22 +946,15 @@ fill_symbuf (bfd *sym_bfd)
symbuf_read += nbytes;
}
-#define SWAP_SYMBOL(symp, abfd) \
- { \
- (symp)->n_strx = bfd_h_get_32(abfd, \
- (unsigned char *)&(symp)->n_strx); \
- (symp)->n_desc = bfd_h_get_16 (abfd, \
- (unsigned char *)&(symp)->n_desc); \
- (symp)->n_value = bfd_h_get_32 (abfd, \
- (unsigned char *)&(symp)->n_value); \
- }
-
#define INTERNALIZE_SYMBOL(intern, extern, abfd) \
{ \
(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); \
- (intern).n_value = bfd_h_get_32 (abfd, (extern)->e_value); \
+ 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); \
}
/* Invariant: The symbol pointed to by symbuf_idx is the first one
--- gdb/partial-stab.h.vma Fri Jul 13 12:12:54 2001
+++ gdb/partial-stab.h Fri Aug 10 15:25:10 2001
@@ -201,7 +201,7 @@ switch (CUR_SYMBOL_TYPE)
case N_SO:
{
- unsigned long valu;
+ CORE_ADDR valu;
static int prev_so_symnum = -10;
static int first_so_symnum;
char *p;
@@ -399,7 +399,7 @@ switch (CUR_SYMBOL_TYPE)
/* See if this is an end of function stab. */
if (pst && CUR_SYMBOL_TYPE == N_FUN && *namestring == '\000')
{
- unsigned long valu;
+ CORE_ADDR valu;
/* It's value is the size (in bytes) of the function for
function relative stabs, or the address of the function's
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] Re: The problem with stabs and sign extension
2001-08-08 17:15 ` [rfa] " Daniel Jacobowitz
2001-08-08 21:06 ` H . J . Lu
2001-08-10 15:31 ` H . J . Lu
@ 2001-08-14 21:58 ` Elena Zannoni
2001-08-14 22:04 ` H . J . Lu
2 siblings, 1 reply; 11+ messages in thread
From: Elena Zannoni @ 2001-08-14 21:58 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb, gdb-patches
Daniel Jacobowitz writes:
> On Wed, Aug 08, 2001 at 05:03:26PM -0700, H . J . Lu wrote:
> > On Wed, Aug 08, 2001 at 04:53:59PM -0700, H . J . Lu wrote:
> > > With this patch, I can do
> > >
> > > # gdb vmlinux
> > > ...
> > > (gdb) print printk
> > > $1 = {int (char *)} 0x8011c5b0 <printk>
> > > (gdb) list printk
> > > 250 printk.c: No such file or directory.
> > > in printk.c
> > >
> > >
> >
> > Here is an update.
>
> This isn't quite the right solution, I think. In particular,
>
> > (SWAP_SYMBOL): Removed.
> > (INTERNALIZE_SYMBOL): Check sign extended vma.
>
> are correct, but:
>
> > * dbxread.c (COERCE32): New.
> > (read_ofile_symtab): Set text_offset with COERCE32 if
> > necessary.
>
> are not. The psymtab has the wrong offsets in it if you do this.
>
> There's actually a clear bug here, once you know where to look. A
> CORE_ADDR is assigned to a long int in partial-stab.h. There's a
> warning flag in GCC for this, isn't there?
>
> Please try the patch attached.
>
> --
> Daniel Jacobowitz Carnegie Mellon University
> MontaVista Software Debian GNU/Linux Developer
>
This looks ok to me, can you commit it? Should we commit it to the 5.1
branch as well? How many targets is it going to affect? Just mips, right?
Probably yes then.
Elena
> 2001-08-08 Daniel Jacobowitz <drow@mvista.com>
>
> * partial-stab.h: valu should be a CORE_ADDR.
>
> 2001-08-08 H.J. Lu (hjl@gnu.org)
>
> * dbxread.c (SWAP_SYMBOL): Removed.
> (INTERNALIZE_SYMBOL): Check sign extended vma.
>
> Index: partial-stab.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/partial-stab.h,v
> retrieving revision 1.11
> diff -u -p -r1.11 partial-stab.h
> --- partial-stab.h 2001/06/01 21:17:50 1.11
> +++ partial-stab.h 2001/08/09 00:11:41
> @@ -201,7 +201,7 @@ switch (CUR_SYMBOL_TYPE)
>
> case N_SO:
> {
> - unsigned long valu;
> + CORE_ADDR valu;
> static int prev_so_symnum = -10;
> static int first_so_symnum;
> char *p;
> Index: dbxread.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/dbxread.c,v
> retrieving revision 1.19
> diff -u -p -r1.19 dbxread.c
> --- dbxread.c 2001/07/07 17:19:50 1.19
> +++ dbxread.c 2001/08/09 00:11:41
> @@ -944,22 +944,15 @@
> symbuf_read += nbytes;
> }
>
> -#define SWAP_SYMBOL(symp, abfd) \
> - { \
> - (symp)->n_strx = bfd_h_get_32(abfd, \
> - (unsigned char *)&(symp)->n_strx); \
> - (symp)->n_desc = bfd_h_get_16 (abfd, \
> - (unsigned char *)&(symp)->n_desc); \
> - (symp)->n_value = bfd_h_get_32 (abfd, \
> - (unsigned char *)&(symp)->n_value); \
> - }
> -
> #define INTERNALIZE_SYMBOL(intern, extern, abfd) \
> { \
> (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); \
> - (intern).n_value = bfd_h_get_32 (abfd, (extern)->e_value); \
> + 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); \
> }
>
> /* Invariant: The symbol pointed to by symbuf_idx is the first one
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] Re: The problem with stabs and sign extension
2001-08-14 21:58 ` Elena Zannoni
@ 2001-08-14 22:04 ` H . J . Lu
[not found] ` <15226.51428.874589.613358@krustylu.cygnus.com>
0 siblings, 1 reply; 11+ messages in thread
From: H . J . Lu @ 2001-08-14 22:04 UTC (permalink / raw)
To: Elena Zannoni; +Cc: Daniel Jacobowitz, gdb, gdb-patches
On Wed, Aug 15, 2001 at 01:06:44AM -0400, Elena Zannoni wrote:
>
> This looks ok to me, can you commit it? Should we commit it to the 5.1
I checked it in.
> branch as well? How many targets is it going to affect? Just mips, right?
> Probably yes then.
>
Only mips has sign extended vma. I'd like to see it in gdb 5.1. I have
to apply it when I use gdb on mips.
H.J.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] Re: The problem with stabs and sign extension
[not found] ` <15226.51428.874589.613358@krustylu.cygnus.com>
@ 2001-08-15 12:04 ` H . J . Lu
2001-08-16 15:13 ` Daniel Jacobowitz
0 siblings, 1 reply; 11+ messages in thread
From: H . J . Lu @ 2001-08-15 12:04 UTC (permalink / raw)
To: Elena Zannoni; +Cc: Daniel Jacobowitz, gdb, gdb-patches
On Wed, Aug 15, 2001 at 03:09:24PM -0400, Elena Zannoni wrote:
> H . J . Lu writes:
> > On Wed, Aug 15, 2001 at 01:06:44AM -0400, Elena Zannoni wrote:
> > >
> > > This looks ok to me, can you commit it? Should we commit it to the 5.1
> >
> > I checked it in.
> >
> > > branch as well? How many targets is it going to affect? Just mips, right?
> > > Probably yes then.
> > >
> >
> > Only mips has sign extended vma. I'd like to see it in gdb 5.1. I have
> > to apply it when I use gdb on mips.
>
>
> It is probably OK. Do you or Daniel want to check it in?
I don't have the setup for gdb 5.1. Daniel, can you check it in?
Thanks.
H.J.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [rfa] Re: The problem with stabs and sign extension
2001-08-15 12:04 ` H . J . Lu
@ 2001-08-16 15:13 ` Daniel Jacobowitz
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Jacobowitz @ 2001-08-16 15:13 UTC (permalink / raw)
To: H . J . Lu; +Cc: Elena Zannoni, gdb, gdb-patches
On Wed, Aug 15, 2001 at 12:04:45PM -0700, H . J . Lu wrote:
> On Wed, Aug 15, 2001 at 03:09:24PM -0400, Elena Zannoni wrote:
> > H . J . Lu writes:
> > > On Wed, Aug 15, 2001 at 01:06:44AM -0400, Elena Zannoni wrote:
> > > >
> > > > This looks ok to me, can you commit it? Should we commit it to the 5.1
> > >
> > > I checked it in.
> > >
> > > > branch as well? How many targets is it going to affect? Just mips, right?
> > > > Probably yes then.
> > > >
> > >
> > > Only mips has sign extended vma. I'd like to see it in gdb 5.1. I have
> > > to apply it when I use gdb on mips.
> >
> >
> > It is probably OK. Do you or Daniel want to check it in?
>
> I don't have the setup for gdb 5.1. Daniel, can you check it in?
Doing that right now.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2001-08-16 15:13 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-08 14:11 The problem with stabs and sign extension Daniel Jacobowitz
2001-08-08 16:14 ` H . J . Lu
2001-08-08 16:54 ` H . J . Lu
2001-08-08 17:03 ` H . J . Lu
2001-08-08 17:15 ` [rfa] " Daniel Jacobowitz
2001-08-08 21:06 ` H . J . Lu
2001-08-10 15:31 ` H . J . Lu
2001-08-14 21:58 ` Elena Zannoni
2001-08-14 22:04 ` H . J . Lu
[not found] ` <15226.51428.874589.613358@krustylu.cygnus.com>
2001-08-15 12:04 ` H . J . Lu
2001-08-16 15:13 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox