From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 1AJmDbdce19ZDAAAWB0awg (envelope-from ) for ; Mon, 05 Oct 2020 13:49:43 -0400 Received: by simark.ca (Postfix, from userid 112) id 29E6F1EE0F; Mon, 5 Oct 2020 13:49:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 76B4C1E58E for ; Mon, 5 Oct 2020 13:49:42 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D83E33857C7E; Mon, 5 Oct 2020 17:49:41 +0000 (GMT) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 72A893857C7E for ; Mon, 5 Oct 2020 17:49:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 72A893857C7E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wm1-x331.google.com with SMTP id d4so353667wmd.5 for ; Mon, 05 Oct 2020 10:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=uqNlcPe1SeZSXkC19bk6D/4BtnLi8K+leP2Wrb7tFb4=; b=cGysvq2Q77qC0Z3AB0529QTBWGIhOVwtz5Ms+hcYjAHHHuQI21Tr5l8HMQ3lqcCV1M hfw3JQmKsll/V+VVuHG3OVc9fyg8TsUW4QcY8WyITSEbGiSoLx/IRV1tGvFhKwgVr4vt j2qWTIo+lTOog/nl/92t96I0t4EejSaZPgdhphtOqHfP5sEql0U2MqLJyXjpjsrVG+rL RwsPAYcisrTjB896OzofWYEISP2HmeHlDHU/9nVXfyY7/6TsaVGSKWK5qEG/gW3Q87F1 B/AR+bIp8vRJTNUjF3qErd9eKfxN7N6laJvfJcZDESFh0ggqmPyhwC2neQ0CBtEaQlIe 6HQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=uqNlcPe1SeZSXkC19bk6D/4BtnLi8K+leP2Wrb7tFb4=; b=koQwmh6stSfHsk0Z7Nz4PR7DqcaNrLPI5apMdW3EX7fsOjQRWZIRXyqRLflAA496KY 6s1wU3qNo9B8KEwc2AN4XK5KyXrFI/EqeSClJ0/juY11oX6rBb9gkLHuVPK5l55wx8N8 dHKFL9b3CZILUlkayvO1217L7uYhM0HgQSTuikJmVbA12qN+PoS6zwyU26dDVgTFyx+Q PPFaHUFYh5EOk+mf15LRdm1nUOaS8GaPvUXnhHGRTbL8Y0AUGxej8OXB4goGCRel0Eh+ feNct+4hbRSV5MVVBMRfMwhskwdI1QxSzjlNeBvyBIzUD4ii8adedQ0geS6zpBJEF7SV h3Uw== X-Gm-Message-State: AOAM532IiX4bxD9nmescGVOzXeeQGvRDPm/RnTnt1oaJFvns7t7X2u+e 0jK9csuONAUswiYBij3jam2VOg== X-Google-Smtp-Source: ABdhPJxnN/0Ir36OcVsgGWtvmxhKE0380MEgai4MNa8SIyfYKqc/rWEI3z3zLePPhR7n8lH4IdTgTw== X-Received: by 2002:a1c:ed09:: with SMTP id l9mr510508wmh.89.1601920178483; Mon, 05 Oct 2020 10:49:38 -0700 (PDT) Received: from localhost (host109-151-14-50.range109-151.btcentralplus.com. [109.151.14.50]) by smtp.gmail.com with ESMTPSA id t5sm935828wrb.21.2020.10.05.10.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Oct 2020 10:49:37 -0700 (PDT) Date: Mon, 5 Oct 2020 18:49:36 +0100 From: Andrew Burgess To: Marco Barisione Subject: Re: [PATCH 1/2] Move the code to execute a cmd_list_element out from execute_command Message-ID: <20201005174936.GH605036@embecosm.com> References: <20200914093925.5442-1-mbarisione@undo.io> <20200914093925.5442-2-mbarisione@undo.io> <20201005090804.GF605036@embecosm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Operating-System: Linux/5.8.12-100.fc31.x86_64 (x86_64) X-Uptime: 18:43:21 up 2 days, 8:55, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" * Marco Barisione [2020-10-05 10:40:19 +0100]: > On 5 Oct 2020, at 10:08, Andrew Burgess wro= te: > >> gdb/ChangeLog: > >>=20 > >> * gdbcmd.h (execute_cmd_list_command): Add declaration. > >> * top.c (execute_command): Move out the code to execute a > >> command from a cmd_list_element. > >> (execute_cmd_list_command): Add from code originally in > >> execute_command. > >> * top.h (execute_cmd_list_command): Add declaration. > >=20 > > Why is execute_cmd_list_command declared twice? This doesn't feel > > right. >=20 > On top of gdbcmd.h there=E2=80=99s this comment: > /* ***DEPRECATED*** The gdblib files must not be calling/using things in= any > of the possible command languages. If necessary, a hook (that may be > present or not) must be used and set to the appropriate routine by any > command language that cares about it. If you are having to include th= is > file you are possibly doing things the old way. This file will dissap= ear. > fnasser@redhat.com */ I read this a couple of times and it still doesn't really make much sense to me. Maybe someone else on the list will jump in to explain what's going on here, but assuming they don't I think we should ignore that comment and make sure the new code we add is as sane as possible. To that end I think we should have a single declaration, probably in gdbcmd.h (as the new function seems related to handling gdb commands) then fix the build fallout, I only had to add new includes to 'top.c' and 'cli/cli-script.c' so it isn't huge. One reason for this, which I completely forgot to mention in my first reply, is that functions should be documented in the header file, and in the source file just say '/* See gdbcmd.h. */'. Obviously we don't want to have functions documented twice at the two declaration points. Thanks, Andrew >=20 > This deprecation notice was added 20 years ago in commit > . > I couldn't really work out the details, so I just copied what is currently > done for execute_command, which is declared in two header files: > $ git grep '\bexecute_command\b' -- '*.h' > gdbcmd.h:extern void execute_command (const char *, int); > top.h:extern void execute_command (const char *, int); >=20 >=20 > --=20 > Marco Barisione >=20