Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Roger Sayle <roger@eyesopen.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Fix IRIX compilation failure in solib-irix.c
Date: Fri, 21 Jul 2006 05:21:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.44.0607202243320.5416-100000@www.eyesopen.com> (raw)


Building mainline gdb on mips-sgi-irix6.5 during the compilation of
gdb/solib-irix.c due to the interaction of -Werror and the compilation
warnings caused by the implicit cases of the first argument in the
calls to extract_unsigned_integer.

The obvious fix is to cast the problematic arguments to gdb_byte*
as expected by extract_unsigned_integer.  This allows the build of
gdb to complete without MIPS/IRIX.

Ok for mainline?  Although I have a gdb copyright assignment on file,
I don't have write access to src, so I'd appreciate it if someone could
commit this for me.  Thanks in advance,



2006-07-20  Roger Sayle  <roger@eyesopen.com>

	* solib-irix.c (fetch_lm_info): Cast the first argument of
	extract_unsigned_integer to "const gdb_byte*" to silence warnings.


Index: solib-irix.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-irix.c,v
retrieving revision 1.10
diff -c -3 -p -r1.10 solib-irix.c
*** solib-irix.c	18 Apr 2006 19:20:06 -0000	1.10
--- solib-irix.c	21 Jul 2006 05:03:31 -0000
*************** fetch_lm_info (CORE_ADDR addr)
*** 152,158 ****
       being at the end of a page or the like.)  */
    read_memory (addr, (char *) &buf, sizeof (buf.ol32));

!   if (extract_unsigned_integer (&buf.magic, sizeof (buf.magic)) != 0xffffffff)
      {
        /* Use buf.ol32... */
        char obj_buf[432];
--- 152,160 ----
       being at the end of a page or the like.)  */
    read_memory (addr, (char *) &buf, sizeof (buf.ol32));

!   if (extract_unsigned_integer ((const gdb_byte*) &buf.magic,
! 				sizeof (buf.magic))
!       != 0xffffffff)
      {
        /* Use buf.ol32... */
        char obj_buf[432];
*************** fetch_lm_info (CORE_ADDR addr)
*** 168,174 ****
  	- extract_mips_address (&obj_buf[248], 4);

      }
!   else if (extract_unsigned_integer (&buf.oi32.oi_size,
  				     sizeof (buf.oi32.oi_size))
  	   == sizeof (buf.oi32))
      {
--- 170,176 ----
  	- extract_mips_address (&obj_buf[248], 4);

      }
!   else if (extract_unsigned_integer ((const gdb_byte *) &buf.oi32.oi_size,
  				     sizeof (buf.oi32.oi_size))
  	   == sizeof (buf.oi32))
      {
*************** fetch_lm_info (CORE_ADDR addr)
*** 188,198 ****
  				sizeof (buf.oi32.oi_orig_ehdr));
        li.pathname_addr = extract_mips_address (&buf.oi32.oi_pathname,
  					       sizeof (buf.oi32.oi_pathname));
!       li.pathname_len = extract_unsigned_integer (&buf.oi32.oi_pathname_len,
! 						  sizeof (buf.oi32.
! 							  oi_pathname_len));
      }
!   else if (extract_unsigned_integer (&buf.oi64.oi_size,
  				     sizeof (buf.oi64.oi_size))
  	   == sizeof (buf.oi64))
      {
--- 190,200 ----
  				sizeof (buf.oi32.oi_orig_ehdr));
        li.pathname_addr = extract_mips_address (&buf.oi32.oi_pathname,
  					       sizeof (buf.oi32.oi_pathname));
!       li.pathname_len = extract_unsigned_integer
! 			  ((const gdb_byte *) &buf.oi32.oi_pathname_len,
! 			   sizeof (buf.oi32.oi_pathname_len));
      }
!   else if (extract_unsigned_integer ((const gdb_byte *) &buf.oi64.oi_size,
  				     sizeof (buf.oi64.oi_size))
  	   == sizeof (buf.oi64))
      {
*************** fetch_lm_info (CORE_ADDR addr)
*** 212,220 ****
  				sizeof (buf.oi64.oi_orig_ehdr));
        li.pathname_addr = extract_mips_address (&buf.oi64.oi_pathname,
  					       sizeof (buf.oi64.oi_pathname));
!       li.pathname_len = extract_unsigned_integer (&buf.oi64.oi_pathname_len,
! 						  sizeof (buf.oi64.
! 							  oi_pathname_len));
      }
    else
      {
--- 214,222 ----
  				sizeof (buf.oi64.oi_orig_ehdr));
        li.pathname_addr = extract_mips_address (&buf.oi64.oi_pathname,
  					       sizeof (buf.oi64.oi_pathname));
!       li.pathname_len = extract_unsigned_integer
! 			  ((const gdb_byte *) &buf.oi64.oi_pathname_len,
! 			   sizeof (buf.oi64.oi_pathname_len));
      }
    else
      {


Roger
--


             reply	other threads:[~2006-07-21  5:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-21  5:21 Roger Sayle [this message]
2006-07-24 20:07 ` Daniel Jacobowitz
2006-07-24 22:00   ` [PATCH] Fix IRIX compilation failure in solib-irix.c (take 2) Roger Sayle
2006-07-24 22:03     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0607202243320.5416-100000@www.eyesopen.com \
    --to=roger@eyesopen.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox