From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id RBlkNtsFJmEaeAAAWB0awg (envelope-from ) for ; Wed, 25 Aug 2021 04:56:59 -0400 Received: by simark.ca (Postfix, from userid 112) id CD2D11EE1A; Wed, 25 Aug 2021 04:56:59 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,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 082841EDF0 for ; Wed, 25 Aug 2021 04:56:59 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 478FF385AC26 for ; Wed, 25 Aug 2021 08:56:58 +0000 (GMT) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 542773858416 for ; Wed, 25 Aug 2021 08:56:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 542773858416 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x42d.google.com with SMTP id u16so35243565wrn.5 for ; Wed, 25 Aug 2021 01:56:38 -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:in-reply-to; bh=e+mAZI/IUrajopXS5Mw5f/l+/skbVuqQkw1edtTj8Sc=; b=OVBNUYfxFkp7LYZCk79gHY2vm8HtBmlw3TBQVqSHy0eJcYzC3YRp0lmELFpeiBpPrd yxt1xyonIY2OAZwp+yS37IUSpR/s1tfs7v/zFfrsNfGwE3mcvsOuHDaSBMfX7eyc/ktL jLt4eUF48gZZnzaYAT8xMNyKsOy4bX8kdIUudC142Zkl3n6symN2KjJytwzbaPmCSMKb AGNQccZlNPen8DeYEcvMfB4OJ6Wm5WEH8mYOo8hZjRdgmrcZnBLucnxzYX+eYcimjNJO /bTbknw4Mvdn2yisg/S0r/ZSUy58F85hgrbsn/IWzLzQ+FFOjXHFhdxLJ2M11szhnrn5 uBxA== 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:in-reply-to; bh=e+mAZI/IUrajopXS5Mw5f/l+/skbVuqQkw1edtTj8Sc=; b=axRSqx7Yhhy3HsTv9J7RH2fCw1sCUkfkyF/G8mgSZNkM1JrDI2LbuhGJwy4NvF6aZL RJc0tZTrKJnyiNRsYfBr38hnHc62PXLS2SvjTIJMIiWrQ4tknisAt+hy4mDLu03hkZel 9FDf7GG4aTqqkSowZ1JALEguyK3MqKds2Da3zR8Xdl48FaN/nVXoJkMnMIIKkTRcjfg2 ZdyKT482KNYqZ1UELvbM7p+kJOkqdsCPwXPS505H0zDTsIjYWxmZKCdhMhHM4Y2NKt44 Ui+lxH8aGBYTI/vuU1fMZlLvsqzAEGj1rhKS0an5NZvQat0xTNArkYDatWwCwkU2rFQO XSTw== X-Gm-Message-State: AOAM531OC04Pb/+mvMEYyyQTLcvoLjVyOBjFewz8NCj3SV3HqO45Ld9K ZDVHedM9O5tXvcdEFzLC1so54XmbMBYVJg== X-Google-Smtp-Source: ABdhPJzwOeG9fmsZYt2p9C/YI69AXbdx1PxHHHdheknrncCFSBP9HaEDEegGsnSUNsuGYfGWPXTLKw== X-Received: by 2002:a5d:6286:: with SMTP id k6mr23397049wru.103.1629881797390; Wed, 25 Aug 2021 01:56:37 -0700 (PDT) Received: from localhost (host86-188-49-44.range86-188.btcentralplus.com. [86.188.49.44]) by smtp.gmail.com with ESMTPSA id v21sm1296990wra.92.2021.08.25.01.56.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Aug 2021 01:56:36 -0700 (PDT) Date: Wed, 25 Aug 2021 09:56:36 +0100 From: Andrew Burgess To: Tom Tromey Subject: Re: [PATCH 1/1] gdb: Fix arrays of variable length strings for FORTRAN Message-ID: <20210825085636.GG2581@embecosm.com> References: <20210820110638.26648-1-abdul.b.ijaz@intel.com> <20210820110638.26648-2-abdul.b.ijaz@intel.com> <20210820155247.GA2581@embecosm.com> <87zgt7990i.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zgt7990i.fsf@tromey.com> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 09:40:48 up 7 days, 21:36, 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: abdul.b.ijaz@intel.com, "abdul.b.ijaz" , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" * Tom Tromey [2021-08-23 14:54:53 -0600]: > >>>>> "Andrew" == Andrew Burgess writes: > > >> case TYPE_CODE_ARRAY: > >> + case TYPE_CODE_STRING: > >> c_value_print_array (val, stream, recurse, options); > >> break; > > Andrew> I don't understand what part this change plays in this patch. I can > Andrew> see below how you're now creating values with TYPE_CODE_STRING instead > Andrew> of TYPE_CODE_ARRAY, but then I'd expect these to be covered by the > Andrew> existing handling of TYPE_CODE_STRING in > Andrew> f_language::value_print_inner. > > I wonder if this should go in generic_value_print instead. generic_val_print_array doesn't print arrays of character type things as a string, so I think having this change in c_value_print_inner makes sense. I did wonder if we should _also_ change generic_val_print though, as this would catch any language that wasn't Fortran, C, or C++ that called into generic_val_print and didn't already handle TYPE_CODE_STRING. However, that's only Modula2 and Pascal, both of which already handle TYPE_CODE_ARRAY and do something similar to C's print character types as a string, which leads me to think that maybe both of these languages should be handling TYPE_CODE_STRING as an alias for TYPE_CODE_ARRAY. Given that language_defn::value_print_inner actually calls c_value_print_inner, rather than generic_val_print, I do wonder if some/all of c_value_print_inner could be moved into generic_val_print, though that's clearly out of scope of this patch. I'm also tempted to say that the Modula2 and Pascal changes are optional, as that seems like an edge case (user debugging Fortran code with the language forced to one of those two choices). Thanks, Andrew