From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D601D38582BC for ; Wed, 29 Mar 2023 09:43:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D601D38582BC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680082994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9B09TOncgomGMS7slULkh4JH6/eycR4LSuCQK6wIGU8=; b=VbmSggD3UJ4XFwkwbjengYuDCjJC9Y2bxEyCeR+lkDSM9l6j34kWui3NQAWPK+gW/vB/cw 4MCz3M1WJon5YtaPzzWT2Ii+BqsKyEuAg6PBlSU63/QzZ5Z6/47QOeAir5cH22eyXuvc+C fFpdxwbc9plZaw5AMCXyJnDa/HsKsjM= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-450-4Sl16GG_PHmxqQy8juBcJA-1; Wed, 29 Mar 2023 05:43:13 -0400 X-MC-Unique: 4Sl16GG_PHmxqQy8juBcJA-1 Received: by mail-wr1-f69.google.com with SMTP id i19-20020adfa513000000b002dc1cdac53fso1424720wrb.5 for ; Wed, 29 Mar 2023 02:43:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680082992; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9B09TOncgomGMS7slULkh4JH6/eycR4LSuCQK6wIGU8=; b=5Sm1YK5eK8qZFzyuX5PHq20YrQCBvC8REeGzRgW1qpeOatFUwM5c8BrQBq1gtIut6d pHER3u0XCDGTAA48RVUrjsD3jP3LTnv/aqB4PZbcEC86TMTP+F3Pi/CnqB9nl2zNFFUD Mj7yn9JsPnDZkOaA3iQ1uC5QqMvFgkZ55n90pxTaaC9/mEnqUZNSjTlg/xydpxYvItfQ MxExPms+BqghLFNwoDXZXfWhHaZcDYHVctG5sr2ZgMQUhQugiJEn7vk54re+HPlsm5Bm yVFSdhfIQ6IIMu2qGFQ96INoHlMov34QvnJ5oxQb5b63768JPINVARKdjHItvjMGtGva LZkg== X-Gm-Message-State: AO0yUKU2+M+d8lRQh3mEA9eWqE9zo4+uvMtQOpPGAnjSST1tv6sZnzC+ Iy5jaOdpOYbkA/Jq0OJEzKW2KZ6M7hd6YKEwckSb+w0XC2QLYpFPs1W0DIPIIZkNhpF/Ek/fH+M 0wDLTJFfS0pcLvVWAeZlROA== X-Received: by 2002:a7b:ca4a:0:b0:3ee:5a48:5b54 with SMTP id m10-20020a7bca4a000000b003ee5a485b54mr14211880wml.16.1680082992265; Wed, 29 Mar 2023 02:43:12 -0700 (PDT) X-Google-Smtp-Source: AK7set9ZHhSpwHz9RBZzgXvhBs50u1QSgqJpAAPr5TH548EcVdUa3ZdMQ/0qL86VCeoTDPY3Wk4dAA== X-Received: by 2002:a7b:ca4a:0:b0:3ee:5a48:5b54 with SMTP id m10-20020a7bca4a000000b003ee5a485b54mr14211866wml.16.1680082991963; Wed, 29 Mar 2023 02:43:11 -0700 (PDT) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id z15-20020a05600c220f00b003ef5f77901dsm1566693wml.45.2023.03.29.02.43.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 02:43:11 -0700 (PDT) From: Andrew Burgess To: Simon Marchi , gdb-patches@sourceware.org Cc: Pedro Alves Subject: Re: [PATCHv3 2/3] gdb: move displaced_step_dump_bytes into gdbsupport (and rename) In-Reply-To: <98da3455-9ff1-e429-330b-d2c2c6f928e0@simark.ca> References: <98da3455-9ff1-e429-330b-d2c2c6f928e0@simark.ca> Date: Wed, 29 Mar 2023 10:43:10 +0100 Message-ID: <878rffevv5.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Simon Marchi writes: >> diff --git a/gdbsupport/array-view.h b/gdbsupport/array-view.h >> index 3d8248b08b7..d07c8bc53fc 100644 >> --- a/gdbsupport/array-view.h >> +++ b/gdbsupport/array-view.h >> @@ -21,6 +21,7 @@ >> #include "traits.h" >> #include >> #include >> +#include "gdbsupport/gdb_assert.h" > I suppose this is needed because array-view.h uses gdb_assert, and you > noticed it because some files didn't compile, because they didn't > happen to include gdb_assert.h before array-view.h. > >> @@ -194,6 +195,20 @@ extern int hex2bin (const char *hex, gdb_byte *bin, int count); >> /* Like the above, but return a gdb::byte_vector. */ >> gdb::byte_vector hex2bin (const char *hex); >> >> +/* Build a string containing the contents of BYTES. Each byte is >> + represented as a 2 character hex string, with spaces separating each >> + individual byte. */ >> + >> +extern std::string bytes_to_string (gdb::array_view bytes); > > I think it could be const: > > gdb::array_view > > And the other overload of bytes_to_string too. > > Otherwise: > > Approved-By: Simon Marchi I fixed the 'const' issue and pushed this patch. Thanks, Andrew