Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Cc: gdb@sourceware.org
Subject: Re: sizeof evaluates expression to compute size?
Date: Wed, 16 Sep 2015 14:56:00 -0000	[thread overview]
Message-ID: <20150916145632.GA19688@adacore.com> (raw)
In-Reply-To: <20150916144109.GB14658@jaguar.corp.atmel.com>

>   Is it true that gdb evaluates the expression in a "print
>   sizeof(expression)" to figure out the size?

Yes; it actually evaluates the entire expression (including the use
of the sizeof operator).

>   For one expression on the ARM target 
> 
>      print sizeof((char*)(s->m)

The expression is incomplete; but with the expression you gave and
assuming we're just missing a closing parenthesis, I don't see why
it would need to allocate memory in the inferior. Perhaps you've found
a bug.

-- 
Joel


  reply	other threads:[~2015-09-16 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 14:41 Senthil Kumar Selvaraj
2015-09-16 14:56 ` Joel Brobecker [this message]
2015-09-17 14:10   ` Senthil Kumar Selvaraj
2015-09-17 14:19     ` Joel Brobecker

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=20150916145632.GA19688@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=senthil_kumar.selvaraj@atmel.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