From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47137 invoked by alias); 27 Jul 2018 15:49:33 -0000 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 Received: (qmail 47123 invoked by uid 89); 27 Jul 2018 15:49:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-12.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=Transfer, arg_type, Hx-languages-length:2016 X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Jul 2018 15:49:30 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 7FA9A72A87 for ; Fri, 27 Jul 2018 10:49:29 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id j4zhfttkQPvAdj4zhfxLS0; Fri, 27 Jul 2018 10:49:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=saX2n98l9oNjRQt09gSOzpDAktJkEDMpnDlT4B+ekLo=; b=SWdkKWXbTw1gUOmiF+udk8xdk9 8hhbP3pGOZdJtgh4yLfpAA3q+GLWWNcJ/5UbX2SiN6dRRIlGVTkUNQlsUoRCjmYJNkLTUedZwEob5 fr5U3MA5xsqTePEoa7LUokqU9; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:40856 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fj4zh-0036Xc-8v; Fri, 27 Jul 2018 10:49:29 -0500 From: Tom Tromey To: Hafiz Abid Qadeer Cc: , Subject: Re: [1/2] C-SKY Port References: Date: Fri, 27 Jul 2018 15:49:00 -0000 In-Reply-To: (Hafiz Abid Qadeer's message of "Wed, 25 Jul 2018 11:54:01 +0100") Message-ID: <87tvok65mf.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-07/txt/msg00738.txt.bz2 >>>>> ">" == Hafiz Abid Qadeer writes: >> Add support for new target 'csky'. >> 2018-07-25 Jiangshuai Li >> Hafiz Abid Qadeer >> Don Breazeal I didn't check the copyright assignment situation, but for a patch of this size, assignments are needed. I assume codesourcery has some kind of blanket assignment, but what about Jiangshuai Li? >> diff --git a/gdb/configure.tgt b/gdb/configure.tgt >> +csky*-linux*) >> +csky*-*) It's more normal to mention all the "-"s, so "csky*-*-linux*" and "csky*-*-*". I don't know anything about C-SKY, so I didn't really look deeply at the arch-specific bits. I assume those pass your testing. >> diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c >> +struct stack_item >> +{ >> + int len; >> + struct stack_item *prev; >> + void *data; Seems to me that this could be gdb_byte instead of void here, and in push_stack_item and pop_stack_item. >> +/* Implement the push_dummy_call gdbarch method. */ >> + >> +static CORE_ADDR >> +csky_push_dummy_call (struct gdbarch *gdbarch, struct value *function, >> + struct regcache *regcache, CORE_ADDR bp_addr, >> + int nargs, struct value **args, CORE_ADDR sp, >> + int struct_return, CORE_ADDR struct_addr) >> +{ [...] >> + arg_type = check_typedef (value_type (args[argnum])); >> + len = TYPE_LENGTH (arg_type); >> + val = value_contents (args[argnum]); I wonder if this can ever throw. In theory of course it can. But maybe in practice it isn't possible? I don't know. The issue is, if it can throw, then the stack_items will be leaked. A way around that is to redo the stack as self-managing C++ objects and use a local std::vector or the like to hold them. >> + /* Transfer the dummy stack frame to the target. */ >> + while (si) >> + { >> + sp -= si->len; >> + write_memory (sp, (const bfd_byte *) si->data, si->len); A similar consideration applies here. This all seems pretty reasonable to me. Tom