Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Nathan Sidwell <nathan@codesourcery.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Unary plus
Date: Sun, 27 Feb 2005 04:22:00 -0000	[thread overview]
Message-ID: <20050227003608.GC19138@nevyn.them.org> (raw)
In-Reply-To: <4209E2F1.2000504@codesourcery.com>

On Wed, Feb 09, 2005 at 10:16:17AM +0000, Nathan Sidwell wrote:
> Hi,
> gdb doesn't parse or evaluate the unary plus operator (but does have one).
> gdb.trace/collection.exp contains such an expression -- 'a[+b]'. This patch
> adds the necessary parsing and evaluation machinery.
> 
> built & tested on i686-px-linux-gnu and an unreleased architecture. ok?

Two comments:

- Could you add a non-tracepoint testcase for this?  I think one good
place would be gdb.cp/userdef.exp.

> ! /* The unary operators +, - and ~.  They free the argument ARG1
> !    (unless it is returned).  */
> ! 
> ! struct value *
> ! value_pos (struct value *arg1)
> ! {
> !   struct type *type;
> ! 
> !   arg1 = coerce_ref (arg1);
> ! 
> !   type = check_typedef (value_type (arg1));
> ! 
> !   if (TYPE_CODE (type) == TYPE_CODE_FLT)
> !     return arg1;

- IIUC, that's not quite right - we need an rvalue here.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


  reply	other threads:[~2005-02-27  0:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-09 13:37 Nathan Sidwell
2005-02-27  4:22 ` Daniel Jacobowitz [this message]
2005-03-08 10:51   ` Nathan Sidwell
2005-03-08 13:40     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050227003608.GC19138@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=nathan@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox