Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] solib-svr4.c gdb_byteised.
@ 2005-05-26 22:50 Manoj Iyer
  2005-05-27  4:41 ` M.M. Kettenis
  2005-06-03 21:14 ` Kevin Buettner
  0 siblings, 2 replies; 10+ messages in thread
From: Manoj Iyer @ 2005-05-26 22:50 UTC (permalink / raw)
  To: gdb-patches


solib-svr4.c compiles without errors on ppc64 with gcc4.0. Here is a
patch...


2005-05-26  Manoj Iyer  <manjo@austin.ibm.com>

	* solib-svr4.c: lm_info structure convert type of lm to gdb_byte.
	(elf_locate_base): Converted types of buf, bufend, pbuf, to gdb_byte.
	(first_link_map_member): Converted type of r_map_buf to gdb_byte.
	(open_symbol_file_object): Converted type of l_name_buf to gdb_byte.
	(svr4_fetch_objfile_link_map): Converted type of l_name_buf to
	gdb_byte.

--------------------------------------------------------------------------
--- old/src/gdb/solib-svr4.c	2005-04-27 15:51:52.000000000 -0500
+++ new/src/gdb/solib-svr4.c	2005-05-26 17:05:10.000000000 -0500
@@ -57,7 +57,7 @@ struct lm_info
     /* Pointer to copy of link map from inferior.  The type is char *
        rather than void *, so that we may use byte offsets to find the
        various fields without the need for a cast.  */
-    char *lm;
+    gdb_byte *lm;
   };

 /* On SVR4 systems, a list of symbols in the dynamic linker where
@@ -292,8 +292,8 @@ elf_locate_base (void)
   struct bfd_section *dyninfo_sect;
   int dyninfo_sect_size;
   CORE_ADDR dyninfo_addr;
-  char *buf;
-  char *bufend;
+  gdb_byte *buf;
+  gdb_byte *bufend;
   int arch_size;

   /* Find the start address of the .dynamic section.  */
@@ -337,7 +337,7 @@ elf_locate_base (void)
 	    }
 	  else if (dyn_tag == DT_MIPS_RLD_MAP)
 	    {
-	      char *pbuf;
+	      gdb_byte *pbuf;
 	      int pbuf_size = TARGET_PTR_BIT / HOST_CHAR_BIT;

 	      pbuf = alloca (pbuf_size);
@@ -372,7 +372,7 @@ elf_locate_base (void)
 	    }
 	  else if (dyn_tag == DT_MIPS_RLD_MAP)
 	    {
-	      char *pbuf;
+	      gdb_byte *pbuf;
 	      int pbuf_size = TARGET_PTR_BIT / HOST_CHAR_BIT;

 	      pbuf = alloca (pbuf_size);
@@ -468,7 +468,7 @@ first_link_map_member (void)
 {
   CORE_ADDR lm = 0;
   struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
-  char *r_map_buf = xmalloc (lmo->r_map_size);
+  gdb_byte *r_map_buf = xmalloc (lmo->r_map_size);
   struct cleanup *cleanups = make_cleanup (xfree, r_map_buf);

   read_memory (debug_base + lmo->r_map_offset, r_map_buf, lmo->r_map_size);
@@ -515,7 +515,7 @@ open_symbol_file_object (void *from_ttyp
   int errcode;
   int from_tty = *(int *)from_ttyp;
   struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
-  char *l_name_buf = xmalloc (lmo->l_name_size);
+  gdb_byte *l_name_buf = xmalloc (lmo->l_name_size);
   struct cleanup *cleanups = make_cleanup (xfree, l_name_buf);

   if (symfile_objfile)
@@ -690,7 +690,7 @@ svr4_fetch_objfile_link_map (struct objf
       struct lm_info objfile_lm_info;
       struct cleanup *old_chain;
       CORE_ADDR name_address;
-      char *l_name_buf = xmalloc (lmo->l_name_size);
+      gdb_byte *l_name_buf = xmalloc (lmo->l_name_size);
       old_chain = make_cleanup (xfree, l_name_buf);

       /* Set up the buffer to contain the portion of the link_map
-----
manjo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Cogito ergo sum                                                          +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


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

* Re: [RFC] solib-svr4.c gdb_byteised.
  2005-05-26 22:50 [RFC] solib-svr4.c gdb_byteised Manoj Iyer
@ 2005-05-27  4:41 ` M.M. Kettenis
  2005-05-27  4:54   ` Manoj Iyer
  2005-06-03 21:09   ` Kevin Buettner
  2005-06-03 21:14 ` Kevin Buettner
  1 sibling, 2 replies; 10+ messages in thread
From: M.M. Kettenis @ 2005-05-27  4:41 UTC (permalink / raw)
  To: Manoj Iyer, gdb-patches

Manoj Iyer <manjo@austin.ibm.com> wrote: 

> 
> solib-svr4.c compiles without errors on ppc64 with gcc4.0. Here is a
> patch...
> 
> 
> 2005-05-26  Manoj Iyer  <manjo@austin.ibm.com>
> 
> 	* solib-svr4.c: lm_info structure convert type of lm to gdb_byte.
> 	(elf_locate_base): Converted types of buf, bufend, pbuf, to gdb_byte.
> 	(first_link_map_member): Converted type of r_map_buf to gdb_byte.
> 	(open_symbol_file_object): Converted type of l_name_buf to gdb_byte.
> 	(svr4_fetch_objfile_link_map): Converted type of l_name_buf to
> 	gdb_byte.

I think the l_name_buf change is wrong since it *is* supposed to be
a (character) string.

Mark


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

* Re: [RFC] solib-svr4.c gdb_byteised.
  2005-05-27  4:41 ` M.M. Kettenis
@ 2005-05-27  4:54   ` Manoj Iyer
  2005-05-31 16:06     ` Manoj Iyer
  2005-06-03 21:09   ` Kevin Buettner
  1 sibling, 1 reply; 10+ messages in thread
From: Manoj Iyer @ 2005-05-27  4:54 UTC (permalink / raw)
  To: M.M. Kettenis; +Cc: gdb-patches


> > solib-svr4.c compiles without errors on ppc64 with gcc4.0. Here is a
> > patch...
> >
> >
> > 2005-05-26  Manoj Iyer  <manjo@austin.ibm.com>
> >
> > 	* solib-svr4.c: lm_info structure convert type of lm to gdb_byte.
> > 	(elf_locate_base): Converted types of buf, bufend, pbuf, to gdb_byte.
> > 	(first_link_map_member): Converted type of r_map_buf to gdb_byte.
> > 	(open_symbol_file_object): Converted type of l_name_buf to gdb_byte.
> > 	(svr4_fetch_objfile_link_map): Converted type of l_name_buf to
> > 	gdb_byte.
>
> I think the l_name_buf change is wrong since it *is* supposed to be
> a (character) string.


gcc4.0 complained abt the signedness...

reversing gdb_byte to char for l_name_buf :


/opt/gcc-nightly/4.0-20050526/bin/cc -m64 -c -m64  -mminimal-toc  -I.
-I.././gdb -I.././gdb/config -DLOCALEDIR="\"/usr/local/share/locale\""
-DHAVE_CONFIG_H -I.././gdb/../include/opcode -I.././gdb/../readline/..
-I../bfd -I.././gdb/../bfd -I.././gdb/../include -I../intl
-I.././gdb/../intl  -DMI_OUT=1 -Wimplicit -Wreturn-type -Wcomment
-Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral
-Wunused-label -Wunused-function  solib-svr4.c
solib-svr4.c: In function ‘open_symbol_file_object’:
solib-svr4.c:533: warning: pointer targets in passing argument 2 of
‘read_memory’ differ in signedness
solib-svr4.c:537: warning: pointer targets in passing argument 1 of
‘extract_unsigned_integer’ differ in signedness
solib-svr4.c: In function ‘svr4_fetch_objfile_link_map’:
solib-svr4.c:707: warning: pointer targets in passing argument 2 of
‘read_memory’ differ in signedness
solib-svr4.c:711: warning: pointer targets in passing argument 1 of
‘extract_unsigned_integer’ differ in signedness
Making init.c


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

* Re: [RFC] solib-svr4.c gdb_byteised.
  2005-05-27  4:54   ` Manoj Iyer
@ 2005-05-31 16:06     ` Manoj Iyer
  0 siblings, 0 replies; 10+ messages in thread
From: Manoj Iyer @ 2005-05-31 16:06 UTC (permalink / raw)
  To: M.M. Kettenis; +Cc: gdb-patches


Mark,

Any comments? ok to commit?

>
> > > solib-svr4.c compiles without errors on ppc64 with gcc4.0. Here is a
> > > patch...
> > >
> > >
> > > 2005-05-26  Manoj Iyer  <manjo@austin.ibm.com>
> > >
> > > 	* solib-svr4.c: lm_info structure convert type of lm to gdb_byte.
> > > 	(elf_locate_base): Converted types of buf, bufend, pbuf, to gdb_byte.
> > > 	(first_link_map_member): Converted type of r_map_buf to gdb_byte.
> > > 	(open_symbol_file_object): Converted type of l_name_buf to gdb_byte.
> > > 	(svr4_fetch_objfile_link_map): Converted type of l_name_buf to
> > > 	gdb_byte.
> >
> > I think the l_name_buf change is wrong since it *is* supposed to be
> > a (character) string.
>
>
> gcc4.0 complained abt the signedness...
>
> reversing gdb_byte to char for l_name_buf :
>
>
> /opt/gcc-nightly/4.0-20050526/bin/cc -m64 -c -m64  -mminimal-toc  -I.
> -I.././gdb -I.././gdb/config -DLOCALEDIR="\"/usr/local/share/locale\""
> -DHAVE_CONFIG_H -I.././gdb/../include/opcode -I.././gdb/../readline/..
> -I../bfd -I.././gdb/../bfd -I.././gdb/../include -I../intl
> -I.././gdb/../intl  -DMI_OUT=1 -Wimplicit -Wreturn-type -Wcomment
> -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral
> -Wunused-label -Wunused-function  solib-svr4.c
> solib-svr4.c: In function ‘open_symbol_file_object’:
> solib-svr4.c:533: warning: pointer targets in passing argument 2 of
> ‘read_memory’ differ in signedness
> solib-svr4.c:537: warning: pointer targets in passing argument 1 of
> ‘extract_unsigned_integer’ differ in signedness
> solib-svr4.c: In function ‘svr4_fetch_objfile_link_map’:
> solib-svr4.c:707: warning: pointer targets in passing argument 2 of
> ‘read_memory’ differ in signedness
> solib-svr4.c:711: warning: pointer targets in passing argument 1 of
> ‘extract_unsigned_integer’ differ in signedness
> Making init.c
>


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

* Re: [RFC] solib-svr4.c gdb_byteised.
  2005-05-27  4:41 ` M.M. Kettenis
  2005-05-27  4:54   ` Manoj Iyer
@ 2005-06-03 21:09   ` Kevin Buettner
  2005-06-12  0:04     ` Mark Kettenis
  1 sibling, 1 reply; 10+ messages in thread
From: Kevin Buettner @ 2005-06-03 21:09 UTC (permalink / raw)
  To: M.M. Kettenis; +Cc: gdb-patches, Manoj Iyer

On Thu, 26 May 2005 22:39:30 +0000
"M.M. Kettenis" <m.m.kettenis@alumnus.utwente.nl> wrote:

> Manoj Iyer <manjo@austin.ibm.com> wrote: 
> 
> > 
> > solib-svr4.c compiles without errors on ppc64 with gcc4.0. Here is a
> > patch...
> > 
> > 
> > 2005-05-26  Manoj Iyer  <manjo@austin.ibm.com>
> > 
> > 	* solib-svr4.c: lm_info structure convert type of lm to gdb_byte.
> > 	(elf_locate_base): Converted types of buf, bufend, pbuf, to gdb_byte.
> > 	(first_link_map_member): Converted type of r_map_buf to gdb_byte.
> > 	(open_symbol_file_object): Converted type of l_name_buf to gdb_byte.
> > 	(svr4_fetch_objfile_link_map): Converted type of l_name_buf to
> > 	gdb_byte.
> 
> I think the l_name_buf change is wrong since it *is* supposed to be
> a (character) string.

Actually, it's the address of a character string.  I think Manoj's
change is correct.

Kevin


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

* Re: [RFC] solib-svr4.c gdb_byteised.
  2005-05-26 22:50 [RFC] solib-svr4.c gdb_byteised Manoj Iyer
  2005-05-27  4:41 ` M.M. Kettenis
@ 2005-06-03 21:14 ` Kevin Buettner
  2005-06-06 22:26   ` [PATCH] " Manoj Iyer
  1 sibling, 1 reply; 10+ messages in thread
From: Kevin Buettner @ 2005-06-03 21:14 UTC (permalink / raw)
  To: Manoj Iyer; +Cc: gdb-patches

On Thu, 26 May 2005 17:20:32 -0500 (CDT)
Manoj Iyer <manjo@austin.ibm.com> wrote:

> 2005-05-26  Manoj Iyer  <manjo@austin.ibm.com>
> 
> 	* solib-svr4.c: lm_info structure convert type of lm to gdb_byte.
> 	(elf_locate_base): Converted types of buf, bufend, pbuf, to gdb_byte.
> 	(first_link_map_member): Converted type of r_map_buf to gdb_byte.
> 	(open_symbol_file_object): Converted type of l_name_buf to gdb_byte.
> 	(svr4_fetch_objfile_link_map): Converted type of l_name_buf to
> 	gdb_byte.

This patch is okay with me.  Just fix the first line of your ChangeLog
entry as follows:

 	* solib-svr4.c: (struct lm_info): Change type of ``lm'' to gdb_byte.

Thanks!

Kevin


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

* [PATCH] solib-svr4.c gdb_byteised.
  2005-06-03 21:14 ` Kevin Buettner
@ 2005-06-06 22:26   ` Manoj Iyer
  2005-06-07  0:07     ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Manoj Iyer @ 2005-06-06 22:26 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches


Just commited the following patch.

2005-06-06  Manoj Iyer  <manjo@austin.ibm.com>

	* solib-svr4.c: Change type of 'lm' to gdb_byte.
	(elf_locate_base): Converted types of buf, bufend, pbuf, to gdb_byte.
	(first_link_map_member): Converted type of r_map_buf to gdb_byte.
	(open_symbol_file_object): Converted type of l_name_buf to gdb_byte.
	(svr4_fetch_objfile_link_map): Converted type of l_name_buf to
	gdb_byte.

Thanks
-----
manjo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Cogito ergo sum                                                          +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

On Fri, 3 Jun 2005, Kevin Buettner wrote:

> On Thu, 26 May 2005 17:20:32 -0500 (CDT)
> Manoj Iyer <manjo@austin.ibm.com> wrote:
>
> > 2005-05-26  Manoj Iyer  <manjo@austin.ibm.com>
> >
> > 	* solib-svr4.c: lm_info structure convert type of lm to gdb_byte.
> > 	(elf_locate_base): Converted types of buf, bufend, pbuf, to gdb_byte.
> > 	(first_link_map_member): Converted type of r_map_buf to gdb_byte.
> > 	(open_symbol_file_object): Converted type of l_name_buf to gdb_byte.
> > 	(svr4_fetch_objfile_link_map): Converted type of l_name_buf to
> > 	gdb_byte.
>
> This patch is okay with me.  Just fix the first line of your ChangeLog
> entry as follows:
>
>  	* solib-svr4.c: (struct lm_info): Change type of ``lm'' to gdb_byte.
>
> Thanks!
>
> Kevin
>


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

* Re: [PATCH] solib-svr4.c gdb_byteised.
  2005-06-06 22:26   ` [PATCH] " Manoj Iyer
@ 2005-06-07  0:07     ` Daniel Jacobowitz
  2005-06-07  8:34       ` Manoj Iyer
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2005-06-07  0:07 UTC (permalink / raw)
  To: Manoj Iyer; +Cc: Kevin Buettner, gdb-patches

On Mon, Jun 06, 2005 at 05:17:08PM -0500, Manoj Iyer wrote:
> 
> Just commited the following patch.
> 
> 2005-06-06  Manoj Iyer  <manjo@austin.ibm.com>
> 
> 	* solib-svr4.c: Change type of 'lm' to gdb_byte.
> 	(elf_locate_base): Converted types of buf, bufend, pbuf, to gdb_byte.
> 	(first_link_map_member): Converted type of r_map_buf to gdb_byte.
> 	(open_symbol_file_object): Converted type of l_name_buf to gdb_byte.
> 	(svr4_fetch_objfile_link_map): Converted type of l_name_buf to
> 	gdb_byte.

FYI, please use the changelog entry as the CVS commit message in the
future.  Also:

> > This patch is okay with me.  Just fix the first line of your ChangeLog
> > entry as follows:
> >
> >  	* solib-svr4.c: (struct lm_info): Change type of ``lm'' to gdb_byte.

Both the version you used and Kevin's are wrong, Kevin picked up an
extra colon:

	* solib-svr4.c (struct lm_info): Change type of ``lm'' to gdb_byte.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: [PATCH] solib-svr4.c gdb_byteised.
  2005-06-07  0:07     ` Daniel Jacobowitz
@ 2005-06-07  8:34       ` Manoj Iyer
  0 siblings, 0 replies; 10+ messages in thread
From: Manoj Iyer @ 2005-06-07  8:34 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Kevin Buettner, gdb-patches

> FYI, please use the changelog entry as the CVS commit message in the
> future.  Also:
>
> > > This patch is okay with me.  Just fix the first line of your ChangeLog
> > > entry as follows:
> > >
> > >  	* solib-svr4.c: (struct lm_info): Change type of ``lm'' to gdb_byte.
>
> Both the version you used and Kevin's are wrong, Kevin picked up an
> extra colon:
>
> 	* solib-svr4.c (struct lm_info): Change type of ``lm'' to gdb_byte.
>

fixed that line and commited.


Thanks
------
Manoj Iyer


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

* Re: [RFC] solib-svr4.c gdb_byteised.
  2005-06-03 21:09   ` Kevin Buettner
@ 2005-06-12  0:04     ` Mark Kettenis
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Kettenis @ 2005-06-12  0:04 UTC (permalink / raw)
  To: kevinb; +Cc: m.m.kettenis, gdb-patches, manjo

   Date: Fri, 3 Jun 2005 14:09:30 -0700
   From: Kevin Buettner <kevinb@redhat.com>

   On Thu, 26 May 2005 22:39:30 +0000
   "M.M. Kettenis" <m.m.kettenis@alumnus.utwente.nl> wrote:

   > Manoj Iyer <manjo@austin.ibm.com> wrote: 
   > 
   > > 
   > > solib-svr4.c compiles without errors on ppc64 with gcc4.0. Here is a
   > > patch...
   > > 
   > > 
   > > 2005-05-26  Manoj Iyer  <manjo@austin.ibm.com>
   > > 
   > > 	* solib-svr4.c: lm_info structure convert type of lm to gdb_byte.
   > > 	(elf_locate_base): Converted types of buf, bufend, pbuf, to gdb_byte.
   > > 	(first_link_map_member): Converted type of r_map_buf to gdb_byte.
   > > 	(open_symbol_file_object): Converted type of l_name_buf to gdb_byte.
   > > 	(svr4_fetch_objfile_link_map): Converted type of l_name_buf to
   > > 	gdb_byte.
   > 
   > I think the l_name_buf change is wrong since it *is* supposed to be
   > a (character) string.

   Actually, it's the address of a character string.  I think Manoj's
   change is correct.

Indeed it is.  Sorry 'bout the confusion I caused.

Mark


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

end of thread, other threads:[~2005-06-12  0:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-26 22:50 [RFC] solib-svr4.c gdb_byteised Manoj Iyer
2005-05-27  4:41 ` M.M. Kettenis
2005-05-27  4:54   ` Manoj Iyer
2005-05-31 16:06     ` Manoj Iyer
2005-06-03 21:09   ` Kevin Buettner
2005-06-12  0:04     ` Mark Kettenis
2005-06-03 21:14 ` Kevin Buettner
2005-06-06 22:26   ` [PATCH] " Manoj Iyer
2005-06-07  0:07     ` Daniel Jacobowitz
2005-06-07  8:34       ` Manoj Iyer

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