From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3015 invoked by alias); 13 Aug 2012 13:49:42 -0000 Received: (qmail 2999 invoked by uid 22791); 13 Aug 2012 13:49:39 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Aug 2012 13:49:23 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7DDnMrc017056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 09:49:22 -0400 Received: from host2.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q7DDnGrC022597 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 13 Aug 2012 09:49:20 -0400 Date: Mon, 13 Aug 2012 13:49:00 -0000 From: Jan Kratochvil To: Siddhesh Poyarekar Cc: gdb-patches@sourceware.org Subject: Re: bitpos expansion patches summary Message-ID: <20120813134915.GA5960@host2.jankratochvil.net> References: <20120805005350.150e5b74@spoyarek> <20120812175730.GA5968@host2.jankratochvil.net> <20120813082124.2b80ffdf@spoyarek> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120813082124.2b80ffdf@spoyarek> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00359.txt.bz2 On Mon, 13 Aug 2012 04:51:24 +0200, Siddhesh Poyarekar wrote: > > i] ENSURED_SIZET: (avr-tdep.c:1184): FUNC(xmalloc): > > (LONGEST to size_t) [len] > > - You do not, you have changed parameter len to ssize_t, you did > > ENSURED_SIZET on line 1298. > > - But that ENSURED_SIZET is redundant there as the code already > > OK, do you want me to add the check within the function? I was requesting only to remove the redundant line avr-tdep.c:1298:ensure_type_fits_sizet (type); as on this line GDB already executed line const bfd_byte *contents = value_contents (arg); which would already abort for too large TYPE_LENGTH. Unrelated to this specific case but to ensure_type_fits_sizet in general: Could you change these calls of ensure_type_fits_sizet where we already deal with the length itself and no longer the type? ensure_type_fits_sizet (type); si = push_stack_item (si, contents, len); I would find it easier as: ensure_length_fits_sizet (len); si = push_stack_item (si, contents, len); Here only LEN matters. LEN is LONGEST so we can verify whether LONGEST LEN fits into SSIZE_T. Reintroducing here a dependency on TYPE is a needless little complication of the code IMO. Moreover even when we have TYPE we could use: ensure_length_fits_sizet (TYPE_LENGTH (type)); ensure_type_fits_sizet uses only TYPE->LENGTH so it does not need to be passed TYPE at all. It would make sense if ensure_type_fits_sizet prints TYPE_NAME in the error case etc. - but it does not use TYPE_NAME anyway.. > I could just remove the type_is_size_t_or_error call here. Yes. > Likewise for other tdep instances. I do not see how it can be generalized, I may not just see what do you mean. > > (breakpoint.c:4624): FUNC(): (LONGEST to int) > > [loc->length] > > - That's not true, s390x can set arbitrary hardware watchpoint > > memory range, see s390_fix_watch_points. WPFIXED(Expand > > Oh, then my assumption about watchpoint sizes would be wrong then > wouldn't it? We then need to expand the ok_for_watchpoint as well as > {insert|remove}_watchpoint. We could do it as a different changeset > since only s390x would need it. You are right. Sorry I did not remember this s390x feature when we discussed it before. Thanks, Jan