From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id D2EA13851C3A for ; Fri, 21 May 2021 14:03:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D2EA13851C3A 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-x335.google.com with SMTP id z85-20020a1c7e580000b029017a76f3afbaso4691869wmc.2 for ; Fri, 21 May 2021 07:03:42 -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=ai1NcFLk0a4plt5Ot6vIEY0BlWuV3ToHGixiSd6YmSI=; b=MTAkcR3dhZ7xfRWuQMYkO0YwXyB6/SKMqs4HTzymFJeW9D8xwKeP7TUkMRNLHgjCFc wzrTDqbMRm4e7azqWeqa4xn7R5Jv8P0YuDMB7atvlutwM0eOXywIBmhNFVYxtL33cT+/ 1YLvLZd5rfYA0VeqHS65MVdRYk8yu5BL2u2Go7biCfDWj0X69Or6oDW2BvqXEtF754Ws yVTUs8GGHFOTdVh+mrUBIqYkNBiF+PhQpCQ6ymYW0LrN/DJHH46fZYU31xzmELluA9BO NfAZL/Lg14NZRM5EMvYPp9guZ6PVXn98qyZYnnbTmQeKEridg4v0PRu8+Zd+VXwDwR5p yP9Q== 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=ai1NcFLk0a4plt5Ot6vIEY0BlWuV3ToHGixiSd6YmSI=; b=WxlQ8KPbpmr/X11Uu++lnpSI7fVPXCuQwf6v9uY2BxgiAy60aYo+UEQ3ykqg70B1fs hBf/uW0FdE2SL98KnWjSYa0GILmF+9JdgaQsuerJLjzSbVaSSSwoWFIJARVJYDB015Ms BQki9c9ZVyQBUe0hRZ5BrOtHr0XUr7fOz91yJdu4KQrjqyXr6/y+iYMqrkwAFu/Zdqr4 sC790lpwCfCoRzWAuMG2dmqxEubSuf2jGdU88a2AeneQzf67JPW/3dA+tzihoHSaNx4W z2b/TDgKdTHj7pC5W3sAsroYWvgSxeXAueg+B5fqGiNvfKMMgX+XfpujZL8hBiJs/l9t tirA== X-Gm-Message-State: AOAM532Ir0axg087gvrtuoB5jBgaGscrOgXv2cGzMhFZeMlZH6Ew4evh CWp7Jm7TBayH3q84AEGxj3+j4RsM1Vws6A== X-Google-Smtp-Source: ABdhPJy9ZFyB2dHVWJG45C3tvuw6G848S03u8y+0aOTiGHwmRkC5H2F85mDl8WYO1IaAAB2P4dnGMw== X-Received: by 2002:a1c:1f84:: with SMTP id f126mr8790909wmf.140.1621605821759; Fri, 21 May 2021 07:03:41 -0700 (PDT) Received: from localhost (host109-151-46-70.range109-151.btcentralplus.com. [109.151.46.70]) by smtp.gmail.com with ESMTPSA id m9sm2268628wrq.78.2021.05.21.07.03.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 07:03:41 -0700 (PDT) Date: Fri, 21 May 2021 15:03:40 +0100 From: Andrew Burgess To: vaibhav kurhe Cc: gdb@sourceware.org Subject: Re: GDB | DWARF expression | Extracting a range of bits from an 'xmm' register Message-ID: <20210521140340.GC2295059@embecosm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 15:01:11 up 2 days, 3:45, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2021 14:03:44 -0000 * vaibhav kurhe via Gdb [2021-05-21 14:27:15 +0530]: > Hello all, > For a use case, I am trying to build a DWARF expression which represents > the value of an arbitrary range of bits (e.g. 96-127 bits) in an *128-bit > xmm register* to be used as a *location attribute value* for a variable DIE. > I am using GDB to consume the debug info and test it. > > Following is the expression I started with to test out a shift operation on > an 128-bit xmm0 register using Typed DWARF stack :- > > *"DW_OP_GNU_regval_type: 21 (xmm0) <0x30>; DW_OP_GNU_const_type: <0x30> 16 > byte block: 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; DW_OP_shl; I'm probably just not understanding correctly, but I'm confused by the use of DW_OP_GNU_const_type. Isn't this providing the number of bits to shift? I'd have expected something like 'DW_OP_const1u 96'. Thanks, Andrew