Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC PATCH] hppa-hpux-tdep.c: Fix host dependency.
@ 2013-03-08 16:22 Pedro Alves
  2013-03-08 22:56 ` Joel Brobecker
  0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2013-03-08 16:22 UTC (permalink / raw)
  To: gdb-patches

$ make WERROR_CFLAGS="-Wpointer-sign -Werror" hppa-hpux-tdep.o -k 2>&1 1>/dev/null
../../src/gdb/hppa-hpux-tdep.c: In function ‘hppa_hpux_push_dummy_code’:
../../src/gdb/hppa-hpux-tdep.c:1225:7: error: pointer targets in passing argument 2 of ‘write_memory’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:22:0:
../../src/gdb/gdbcore.h:85:13: note: expected ‘const gdb_byte *’ but argument is of type ‘char *’
../../src/gdb/hppa-hpux-tdep.c:1251:7: error: pointer targets in passing argument 2 of ‘write_memory’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:22:0:
../../src/gdb/gdbcore.h:85:13: note: expected ‘const gdb_byte *’ but argument is of type ‘char *’
../../src/gdb/hppa-hpux-tdep.c: In function ‘hppa_hpux_supply_save_state’:
../../src/gdb/hppa-hpux-tdep.c:1354:9: error: pointer targets in passing argument 1 of ‘extract_unsigned_integer’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:20:0:
../../src/gdb/defs.h:675:22: note: expected ‘const gdb_byte *’ but argument is of type ‘const char *’

Casting to gdb_byte would fix it, however, writing an
unsigned int array like this

      static unsigned int hppa64_tramp[] = {
        0xeac0f000, /* bve,l (r22),%r2 */
        0x0fdf12d1, /* std r31,-8(,sp) */
        0x0fd110c2, /* ldd -8(,sp),rp */
        0xe840d002, /* bve,n (rp) */
        0x08000240  /* nop */
        ...

directly to target memory assumes the host endianness is the same as
the target's.  hppa is big endian, so I believe this patch should be
correct -- it defines the array as a gdb_byte array.  It uses a macro
to make the insn bytes a little more readable.  I thought of using
write_memory_unsigned_integer once for each element of the unsigned
int array, but this way keeps issuing a single target memory write /
roundtrip for the whole trampoline.

I have no way to test this though, other than making sure it compiles.
I'm inclined to just go ahead and put it in, if nobody's up for
testing it.

Comments?

2013-03-08  Pedro Alves  <palves@redhat.com>

	* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Define INSN macro,
	use it to rewrite the trampoline buffers with type gdb_byte[], and
	undefine the macro.  Remove char* cast.
---
 gdb/hppa-hpux-tdep.c |   40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c
index aacb0a3..9948e9b 100644
--- a/gdb/hppa-hpux-tdep.c
+++ b/gdb/hppa-hpux-tdep.c
@@ -1201,17 +1201,18 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
 
   if (IS_32BIT_TARGET (gdbarch))
     {
-      static unsigned int hppa32_tramp[] = {
-        0x0fdf1291, /* stw r31,-8(,sp) */
-        0x02c010a1, /* ldsid (,r22),r1 */
-        0x00011820, /* mtsp r1,sr0 */
-        0xe6c00000, /* be,l 0(sr0,r22),%sr0,%r31 */
-        0x081f0242, /* copy r31,rp */
-        0x0fd11082, /* ldw -8(,sp),rp */
-        0x004010a1, /* ldsid (,rp),r1 */
-        0x00011820, /* mtsp r1,sr0 */
-        0xe0400000, /* be 0(sr0,rp) */
-        0x08000240  /* nop */
+#define INSN(I1, I2, I3, I4) 0x ## I1, 0x ## I2, 0x ## I3, 0x ## I4
+     static const gdb_byte hppa32_tramp[] = {
+	INSN(0f,df,12,91), /* stw r31,-8(,sp) */
+	INSN(02,c0,10,a1), /* ldsid (,r22),r1 */
+	INSN(00,01,18,20), /* mtsp r1,sr0 */
+	INSN(e6,c0,00,00), /* be,l 0(sr0,r22),%sr0,%r31 */
+	INSN(08,1f,02,42), /* copy r31,rp */
+	INSN(0f,d1,10,82), /* ldw -8(,sp),rp */
+	INSN(00,40,10,a1), /* ldsid (,rp),r1 */
+	INSN(00,01,18,20), /* mtsp r1,sr0 */
+	INSN(e0,40,00,00), /* be 0(sr0,rp) */
+	INSN(08,00,02,40)  /* nop */
       };
 
       /* for hppa32, we must call the function through a stub so that on
@@ -1222,7 +1223,7 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
 	       "(no import stub).\n"));
       regcache_cooked_write_unsigned (regcache, 22, stubaddr);
 
-      write_memory (sp, (char *)&hppa32_tramp, sizeof (hppa32_tramp));
+      write_memory (sp, hppa32_tramp, sizeof (hppa32_tramp));
 
       *bp_addr = hppa_hpux_find_dummy_bpaddr (pc);
       regcache_cooked_write_unsigned (regcache, 31, *bp_addr);
@@ -1237,18 +1238,19 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
     }
   else
     {
-      static unsigned int hppa64_tramp[] = {
-        0xeac0f000, /* bve,l (r22),%r2 */
-        0x0fdf12d1, /* std r31,-8(,sp) */
-        0x0fd110c2, /* ldd -8(,sp),rp */
-        0xe840d002, /* bve,n (rp) */
-        0x08000240  /* nop */
+      static const gdb_byte hppa64_tramp[] = {
+	INSN(ea,c0,f0,00), /* bve,l (r22),%r2 */
+	INSN(0f,df,12,d1), /* std r31,-8(,sp) */
+	INSN(0f,d1,10,c2), /* ldd -8(,sp),rp */
+	INSN(e8,40,d0,02), /* bve,n (rp) */
+	INSN(08,00,02,40)  /* nop */
       };
+#undef INSN
 
       /* for hppa64, we don't need to call through a stub; all functions
          return via a bve.  */
       regcache_cooked_write_unsigned (regcache, 22, funcaddr);
-      write_memory (sp, (char *)&hppa64_tramp, sizeof (hppa64_tramp));
+      write_memory (sp, hppa64_tramp, sizeof (hppa64_tramp));
 
       *bp_addr = pc - 4;
       regcache_cooked_write_unsigned (regcache, 31, *bp_addr);


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH] hppa-hpux-tdep.c: Fix host dependency.
  2013-03-08 16:22 [RFC PATCH] hppa-hpux-tdep.c: Fix host dependency Pedro Alves
@ 2013-03-08 22:56 ` Joel Brobecker
  2013-03-11 15:30   ` Pedro Alves
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Brobecker @ 2013-03-08 22:56 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> I have no way to test this though, other than making sure it compiles.
> I'm inclined to just go ahead and put it in, if nobody's up for
> testing it.
> 
> Comments?
> 
> 2013-03-08  Pedro Alves  <palves@redhat.com>
> 
> 	* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Define INSN macro,
> 	use it to rewrite the trampoline buffers with type gdb_byte[], and
> 	undefine the macro.  Remove char* cast.

FWIW, it looks good to me too. IIRC, John David Anglin is still
able to test pa-hpux patches (Tom should be able to confirm that,
since he had some SOM patches tested recently). I wish I could too,
but we turned our machines off and put them in storage...

-- 
Joel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH] hppa-hpux-tdep.c: Fix host dependency.
  2013-03-08 22:56 ` Joel Brobecker
@ 2013-03-11 15:30   ` Pedro Alves
  2013-03-11 15:36     ` John David Anglin
  2013-03-12  3:10     ` John David Anglin
  0 siblings, 2 replies; 9+ messages in thread
From: Pedro Alves @ 2013-03-11 15:30 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, dave.anglin

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

[Adding Dave]

Hi Dave,

On 03/08/2013 10:56 PM, Joel Brobecker wrote:
>> I have no way to test this though, other than making sure it compiles.
>> I'm inclined to just go ahead and put it in, if nobody's up for
>> testing it.
>>
>> Comments?
>>
>> 2013-03-08  Pedro Alves  <palves@redhat.com>
>>
>> 	* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Define INSN macro,
>> 	use it to rewrite the trampoline buffers with type gdb_byte[], and
>> 	undefine the macro.  Remove char* cast.
> 
> FWIW, it looks good to me too. IIRC, John David Anglin is still
> able to test pa-hpux patches (Tom should be able to confirm that,
> since he had some SOM patches tested recently). I wish I could too,
> but we turned our machines off and put them in storage...
> 

Would you be able to help giving this patch a quick try
on HP-UX?

Thanks,
-- 
Pedro Alves


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-hppa-hpux-tdep.c-Fix-host-dependency.patch --]
[-- Type: text/x-patch; name="0001-hppa-hpux-tdep.c-Fix-host-dependency.patch", Size: 5670 bytes --]

From 885ed2f17eabe2deb1dd52706a5345d752b6bdee Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Fri, 8 Mar 2013 15:01:02 +0000
Subject: [PATCH] hppa-hpux-tdep.c: Fix host dependency.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

$ make WERROR_CFLAGS="-Wpointer-sign -Werror" hppa-hpux-tdep.o -k 2>&1 1>/dev/null
../../src/gdb/hppa-hpux-tdep.c: In function ‘hppa_hpux_push_dummy_code’:
../../src/gdb/hppa-hpux-tdep.c:1225:7: error: pointer targets in passing argument 2 of ‘write_memory’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:22:0:
../../src/gdb/gdbcore.h:85:13: note: expected ‘const gdb_byte *’ but argument is of type ‘char *’
../../src/gdb/hppa-hpux-tdep.c:1251:7: error: pointer targets in passing argument 2 of ‘write_memory’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:22:0:
../../src/gdb/gdbcore.h:85:13: note: expected ‘const gdb_byte *’ but argument is of type ‘char *’
../../src/gdb/hppa-hpux-tdep.c: In function ‘hppa_hpux_supply_save_state’:
../../src/gdb/hppa-hpux-tdep.c:1354:9: error: pointer targets in passing argument 1 of ‘extract_unsigned_integer’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:20:0:
../../src/gdb/defs.h:675:22: note: expected ‘const gdb_byte *’ but argument is of type ‘const char *’

Casting to gdb_byte would fix it, however, writing an
unsigned int array like this

      static unsigned int hppa64_tramp[] = {
        0xeac0f000, /* bve,l (r22),%r2 */
        0x0fdf12d1, /* std r31,-8(,sp) */
        0x0fd110c2, /* ldd -8(,sp),rp */
        0xe840d002, /* bve,n (rp) */
        0x08000240  /* nop */
        ...

directly to target memory assumes the host endianness is the same as
the target's.  hppa is big endian, so I believe this patch should be
correct -- it defines the array as a gdb_byte array.  It uses a macro
to make the insn bytes a little more readable.  I thought of using
write_memory_unsigned_integer once for each element of the unsigned
int array, but this way keeps issuing a single target memory write /
roundtrip for the whole trampoline.

I have no way to test this though, other than making sure it compiles.
I'm inclined to just go ahead and put it in, if nobody's up for
testing it.

Comments?

2013-03-08  Pedro Alves  <palves@redhat.com>

	* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Define INSN macro,
	use it to rewrite the trampoline buffers with type gdb_byte[], and
	undefine the macro.  Remove char* cast.
---
 gdb/hppa-hpux-tdep.c | 40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c
index aacb0a3..9948e9b 100644
--- a/gdb/hppa-hpux-tdep.c
+++ b/gdb/hppa-hpux-tdep.c
@@ -1201,17 +1201,18 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
 
   if (IS_32BIT_TARGET (gdbarch))
     {
-      static unsigned int hppa32_tramp[] = {
-        0x0fdf1291, /* stw r31,-8(,sp) */
-        0x02c010a1, /* ldsid (,r22),r1 */
-        0x00011820, /* mtsp r1,sr0 */
-        0xe6c00000, /* be,l 0(sr0,r22),%sr0,%r31 */
-        0x081f0242, /* copy r31,rp */
-        0x0fd11082, /* ldw -8(,sp),rp */
-        0x004010a1, /* ldsid (,rp),r1 */
-        0x00011820, /* mtsp r1,sr0 */
-        0xe0400000, /* be 0(sr0,rp) */
-        0x08000240  /* nop */
+#define INSN(I1, I2, I3, I4) 0x ## I1, 0x ## I2, 0x ## I3, 0x ## I4
+     static const gdb_byte hppa32_tramp[] = {
+	INSN(0f,df,12,91), /* stw r31,-8(,sp) */
+	INSN(02,c0,10,a1), /* ldsid (,r22),r1 */
+	INSN(00,01,18,20), /* mtsp r1,sr0 */
+	INSN(e6,c0,00,00), /* be,l 0(sr0,r22),%sr0,%r31 */
+	INSN(08,1f,02,42), /* copy r31,rp */
+	INSN(0f,d1,10,82), /* ldw -8(,sp),rp */
+	INSN(00,40,10,a1), /* ldsid (,rp),r1 */
+	INSN(00,01,18,20), /* mtsp r1,sr0 */
+	INSN(e0,40,00,00), /* be 0(sr0,rp) */
+	INSN(08,00,02,40)  /* nop */
       };
 
       /* for hppa32, we must call the function through a stub so that on
@@ -1222,7 +1223,7 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
 	       "(no import stub).\n"));
       regcache_cooked_write_unsigned (regcache, 22, stubaddr);
 
-      write_memory (sp, (char *)&hppa32_tramp, sizeof (hppa32_tramp));
+      write_memory (sp, hppa32_tramp, sizeof (hppa32_tramp));
 
       *bp_addr = hppa_hpux_find_dummy_bpaddr (pc);
       regcache_cooked_write_unsigned (regcache, 31, *bp_addr);
@@ -1237,18 +1238,19 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
     }
   else
     {
-      static unsigned int hppa64_tramp[] = {
-        0xeac0f000, /* bve,l (r22),%r2 */
-        0x0fdf12d1, /* std r31,-8(,sp) */
-        0x0fd110c2, /* ldd -8(,sp),rp */
-        0xe840d002, /* bve,n (rp) */
-        0x08000240  /* nop */
+      static const gdb_byte hppa64_tramp[] = {
+	INSN(ea,c0,f0,00), /* bve,l (r22),%r2 */
+	INSN(0f,df,12,d1), /* std r31,-8(,sp) */
+	INSN(0f,d1,10,c2), /* ldd -8(,sp),rp */
+	INSN(e8,40,d0,02), /* bve,n (rp) */
+	INSN(08,00,02,40)  /* nop */
       };
+#undef INSN
 
       /* for hppa64, we don't need to call through a stub; all functions
          return via a bve.  */
       regcache_cooked_write_unsigned (regcache, 22, funcaddr);
-      write_memory (sp, (char *)&hppa64_tramp, sizeof (hppa64_tramp));
+      write_memory (sp, hppa64_tramp, sizeof (hppa64_tramp));
 
       *bp_addr = pc - 4;
       regcache_cooked_write_unsigned (regcache, 31, *bp_addr);
-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH] hppa-hpux-tdep.c: Fix host dependency.
  2013-03-11 15:30   ` Pedro Alves
@ 2013-03-11 15:36     ` John David Anglin
  2013-03-11 15:54       ` Pedro Alves
  2013-03-12  3:10     ` John David Anglin
  1 sibling, 1 reply; 9+ messages in thread
From: John David Anglin @ 2013-03-11 15:36 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Joel Brobecker, gdb-patches

On 3/11/2013 11:29 AM, Pedro Alves wrote:
> [Adding Dave]
>
> Hi Dave,
>
> On 03/08/2013 10:56 PM, Joel Brobecker wrote:
>>> I have no way to test this though, other than making sure it compiles.
>>> I'm inclined to just go ahead and put it in, if nobody's up for
>>> testing it.
>>>
>>> Comments?
>>>
>>> 2013-03-08  Pedro Alves  <palves@redhat.com>
>>>
>>> 	* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Define INSN macro,
>>> 	use it to rewrite the trampoline buffers with type gdb_byte[], and
>>> 	undefine the macro.  Remove char* cast.
>> FWIW, it looks good to me too. IIRC, John David Anglin is still
>> able to test pa-hpux patches (Tom should be able to confirm that,
>> since he had some SOM patches tested recently). I wish I could too,
>> but we turned our machines off and put them in storage...
>>
> Would you be able to help giving this patch a quick try
> on HP-UX?
>
> Thanks,
Yes, maybe tonight.

-- 
John David Anglin    dave.anglin@bell.net


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH] hppa-hpux-tdep.c: Fix host dependency.
  2013-03-11 15:36     ` John David Anglin
@ 2013-03-11 15:54       ` Pedro Alves
  0 siblings, 0 replies; 9+ messages in thread
From: Pedro Alves @ 2013-03-11 15:54 UTC (permalink / raw)
  To: John David Anglin; +Cc: Joel Brobecker, gdb-patches

On 03/11/2013 03:37 PM, John David Anglin wrote:

>> Would you be able to help giving this patch a quick try
>> on HP-UX?
>>
>> Thanks,
> Yes, maybe tonight.

Thanks!

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH] hppa-hpux-tdep.c: Fix host dependency.
  2013-03-11 15:30   ` Pedro Alves
  2013-03-11 15:36     ` John David Anglin
@ 2013-03-12  3:10     ` John David Anglin
  2013-03-13 18:47       ` Pedro Alves
  2013-03-13 18:47       ` Pedro Alves
  1 sibling, 2 replies; 9+ messages in thread
From: John David Anglin @ 2013-03-12  3:10 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Joel Brobecker, gdb-patches

On 11-Mar-13, at 11:29 AM, Pedro Alves wrote:

> Would you be able to help giving this patch a quick try
> on HP-UX?

Patched file compiles fine on both hppa2.0w-hp-hpux11.11 and
hppa64-hp-hpux11.11.  I think the trampoline works on hppa64:

(gdb) p var
$4 = (tree) 0x800003fffdeaab48
(gdb) p debug_tree (var)
  <var_decl 800003fffdeaab48 D.1404
     type <integer_type 800003fffddc97e0 long unsigned int public  
unsigned DI
         size <integer_cst 800003fffddc05a0 constant 64>
         unit size <integer_cst 800003fffddc05c0 constant 8>
         align 64 symtab 0 alias set -1 canonical type  
800003fffddc97e0 precision 64 min <integer_cst 800003fffddc09a0 0> max  
<integer_cst 800003fffddc0980 18446744073709551615>>
     used unsigned ignored DI file /test/gnu/gcc/gcc/gcc/testsuite/ 
gcc.c-torture/compile/pr55921.c line 10 col 1 size <integer_cst  
800003fffddc05a0 64> unit size <integer_cst 800003fffddc05c0 8>
     align 64 context <function_decl 800003fffde9d700 foo>>
$5 = void
(gdb)

Haven't tested 32-bit yet.

There is one small unrelated issue that needs fixing:

gcc -g -O2   -I. -I../../src/gdb -I../../src/gdb/common -I../../src/ 
gdb/config -DLOCALEDIR="\"/opt/gnu64/share/locale\"" -DHAVE_CONFIG_H - 
I../../src/gdb/../include/opcode -I../../src/gdb/../opcodes/.. -I../../ 
src/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd -I../../src/ 
gdb/../include -I../libdecnumber -I../../src/gdb/../libdecnumber  - 
I../../src/gdb/gnulib/import -Ibuild-gnulib/import   -DTUI=1  -Wall - 
Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno- 
pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch - 
Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement  
-Wempty-body -Werror -c -o hppa-hpux-nat.o -MT hppa-hpux-nat.o -MMD - 
MP -MF .deps/hppa-hpux-nat.Tpo ../../src/gdb/hppa-hpux-nat.c
../../src/gdb/hppa-hpux-nat.c:45:1: error: no previous prototype for  
'hppa_hpux_save_state_offset' [-Werror=missing-prototypes]
cc1: all warnings being treated as errors

Believe the function should be static.

Dave
--
John David Anglin	dave.anglin@bell.net




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH] hppa-hpux-tdep.c: Fix host dependency.
  2013-03-12  3:10     ` John David Anglin
@ 2013-03-13 18:47       ` Pedro Alves
  2013-03-22 18:06         ` Pedro Alves
  2013-03-13 18:47       ` Pedro Alves
  1 sibling, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2013-03-13 18:47 UTC (permalink / raw)
  To: John David Anglin; +Cc: Joel Brobecker, gdb-patches

On 03/12/2013 03:09 AM, John David Anglin wrote:
> On 11-Mar-13, at 11:29 AM, Pedro Alves wrote:
> 
>> Would you be able to help giving this patch a quick try
>> on HP-UX?
> 
> Patched file compiles fine on both hppa2.0w-hp-hpux11.11 and
> hppa64-hp-hpux11.11.  I think the trampoline works on hppa64:

Thanks.

> 
> (gdb) p var
> $4 = (tree) 0x800003fffdeaab48
> (gdb) p debug_tree (var)
>  <var_decl 800003fffdeaab48 D.1404
>     type <integer_type 800003fffddc97e0 long unsigned int public unsigned DI
>         size <integer_cst 800003fffddc05a0 constant 64>
>         unit size <integer_cst 800003fffddc05c0 constant 8>
>         align 64 symtab 0 alias set -1 canonical type 800003fffddc97e0 precision 64 min <integer_cst 800003fffddc09a0 0> max <integer_cst 800003fffddc0980 18446744073709551615>>
>     used unsigned ignored DI file /test/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/compile/pr55921.c line 10 col 1 size <integer_cst 800003fffddc05a0 64> unit size <integer_cst 800003fffddc05c0 8>
>     align 64 context <function_decl 800003fffde9d700 foo>>
> $5 = void
> (gdb)

Looks like it.

> 
> Haven't tested 32-bit yet.

FADO, would you prefer me to wait for confirmation, for shall I go ahead?

Thanks,
-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH] hppa-hpux-tdep.c: Fix host dependency.
  2013-03-12  3:10     ` John David Anglin
  2013-03-13 18:47       ` Pedro Alves
@ 2013-03-13 18:47       ` Pedro Alves
  1 sibling, 0 replies; 9+ messages in thread
From: Pedro Alves @ 2013-03-13 18:47 UTC (permalink / raw)
  To: John David Anglin; +Cc: Joel Brobecker, gdb-patches

On 03/12/2013 03:09 AM, John David Anglin wrote:

> There is one small unrelated issue that needs fixing:
> 
> gcc -g -O2   -I. -I../../src/gdb -I../../src/gdb/common -I../../src/gdb/config -DLOCALEDIR="\"/opt/gnu64/share/locale\"" -DHAVE_CONFIG_H -I../../src/gdb/../include/opcode -I../../src/gdb/../opcodes/.. -I../../src/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd -I../../src/gdb/../include -I../libdecnumber -I../../src/gdb/../libdecnumber  -I../../src/gdb/gnulib/import -Ibuild-gnulib/import   -DTUI=1  -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Werror -c -o hppa-hpux-nat.o -MT hppa-hpux-nat.o -MMD -MP -MF .deps/hppa-hpux-nat.Tpo ../../src/gdb/hppa-hpux-nat.c
> ../../src/gdb/hppa-hpux-nat.c:45:1: error: no previous prototype for 'hppa_hpux_save_state_offset' [-Werror=missing-prototypes]
> cc1: all warnings being treated as errors
> 
> Believe the function should be static.

Indeed.  I'm applying this patch to address it.

Thanks.

-- >8 --
Subject: Make hppa-hpux-nat.c:hppa_hpux_save_state_offset static.

Dave reports:

> There is one small (...) issue that needs fixing:
>
> gcc -g -O2   -I. -I../../src/gdb -I../../src/gdb/common -I../../src/gdb/config -DLOCALEDIR="\"/opt/gnu64/share/locale\"" -DHAVE_CONFIG_H -I../../src/gdb/../include/opcode -I../../src/gdb/../opcodes/.. -I../../src/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd -I../../src/gdb/../include -I../libdecnumber -I../../src/gdb/../libdecnumber  -I../../src/gdb/gnulib/import -Ibuild-gnulib/import   -DTUI=1  -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Werror -c -o hppa-hpux-nat.o -MT hppa-hpux-nat.o -MMD -MP -MF .deps/hppa-hpux-nat.Tpo ../../src/gdb/hppa-hpux-nat.c
> ../../src/gdb/hppa-hpux-nat.c:45:1: error: no previous prototype for 'hppa_hpux_save_state_offset' [-Werror=missing-prototypes]
> cc1: all warnings being treated as errors
>
> Believe the function should be static.

gdb/
2013-03-13  Pedro Alves  <palves@redhat.com>

	* hppa-hpux-nat.c (hppa_hpux_save_state_offset): Make static.

---

 gdb/hppa-hpux-nat.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/hppa-hpux-nat.c b/gdb/hppa-hpux-nat.c
index ba2569d..4fb4e46 100644
--- a/gdb/hppa-hpux-nat.c
+++ b/gdb/hppa-hpux-nat.c
@@ -41,7 +41,7 @@
    the register size (32-bit or 64-bit).  These are taken from
    REGCACHE.  */
 
-LONGEST
+static LONGEST
 hppa_hpux_save_state_offset (struct regcache *regcache, int regnum)
 {
   LONGEST offset;


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH] hppa-hpux-tdep.c: Fix host dependency.
  2013-03-13 18:47       ` Pedro Alves
@ 2013-03-22 18:06         ` Pedro Alves
  0 siblings, 0 replies; 9+ messages in thread
From: Pedro Alves @ 2013-03-22 18:06 UTC (permalink / raw)
  To: gdb-patches; +Cc: John David Anglin

I've put this in now.

Thanks!

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-03-22 14:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-08 16:22 [RFC PATCH] hppa-hpux-tdep.c: Fix host dependency Pedro Alves
2013-03-08 22:56 ` Joel Brobecker
2013-03-11 15:30   ` Pedro Alves
2013-03-11 15:36     ` John David Anglin
2013-03-11 15:54       ` Pedro Alves
2013-03-12  3:10     ` John David Anglin
2013-03-13 18:47       ` Pedro Alves
2013-03-22 18:06         ` Pedro Alves
2013-03-13 18:47       ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox