From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 524AF3858D39 for ; Tue, 28 Mar 2023 13:10:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 524AF3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.170] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id B655D1E0D2; Tue, 28 Mar 2023 09:10:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1680009046; bh=lgymL2PxBu4SmwCJXhbLlRwGVaSB2RDC1dSSfZ+vse4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ORueAUL7bwPmY5IUs6oq48cEKLxW9HPML71sP6JijVmL3FILt/DNeP7OCAFbxcvpR /x4BuBWQgUYL/7UB5KjtdGYTGHGo2D87PcCAd6jb/5P1z5uP21ryoqlS40eMz8FQXq MdG4/QVYtwgFPxPbFXRUdihNv5Li/wMT+w7w/IvU= Message-ID: <98da3455-9ff1-e429-330b-d2c2c6f928e0@simark.ca> Date: Tue, 28 Mar 2023 09:10:46 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCHv3 2/3] gdb: move displaced_step_dump_bytes into gdbsupport (and rename) Content-Language: fr To: Andrew Burgess , gdb-patches@sourceware.org Cc: Pedro Alves References: From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,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: > 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 Simon