This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFC: Patch to allow compilation by Sun cc
- To: Hilfinger at cs dot berkeley dot edu
- Subject: Re: RFC: Patch to allow compilation by Sun cc
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Thu, 01 Feb 2001 17:43:37 -0800
- CC: ac131313 at cygnus dot com, gdb-patches at sourceware dot cygnus dot com
- Organization: Red Hat
- References: <200102020120.RAA29451@tully.CS.Berkeley.EDU>
Paul Hilfinger wrote:
>
> > Would you both find this modification of the patch acceptable?
> > I've made the following two changes:
> >
> > 1) Made all three versions of software_single_step use unsigned int
> > as the first parameter (and included Paul's cast to unsigned int
> > in the #define in all three cases).
>
> No strong feelings, but if we actually do move the target_signal
> declaration to defs.h, isn't the obvious change to modify the
> definition of sparc_software_single_step in tm-sparc.h to take an
> enum target_signal as its first argument, and then not change sparc-tdep.c?
Yep -- we can change it back after that change takes place.
This will get us settled until then (with Andrew's approval).
> > 2) Removed the " * sizeof (char)" from all the alloca calls, since
> > it is never used in other contexts where these constants are sent
> > to alloca (not to introduce a new inconsistancy).
>
> Again, no strong feelings on this, but I am forced to disagree with
> your premise. In fact, I only decided to add this fussy pendantic
> little suffix after greping the source and finding, e.g.,
>
> breakpoint.c:5748: blocks_searched = (char *) alloca (BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
> breakpoint.c:5749: memset (blocks_searched, 0, BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
> stack.c:1376: blocks_printed = (char *) alloca (BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
> stack.c:1377: memset (blocks_printed, 0, BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
> varobj.c:1246: * sizeof (char));
> varobj.c:1821: name = (char *) xmalloc (1 + len * sizeof (char));
> varobj.c:1842: name = (char *) xmalloc ((strlen (parent->name) + 2) * sizeof (char));
> win32-nat.c:539: DWORD size = event->fUnicode ? sizeof (WCHAR) : sizeof (char);
>
> ... and then trying to be consistent (:->).
I didn't mean that sizeof (char) is never used -- just that it isn't used
in connection with MAX_REGISTER_RAW_SIZE or REGISTER_BYTES. The situation
is not beautiful now -- I just don't want to make it any uglier.