Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Phil Muldoon <pmuldoon@redhat.com>
Cc: gdb@sourceware.org, Alexandre Oliva <aoliva@redhat.com>
Subject: Re: compile: objfiles lifetime UI
Date: Wed, 06 May 2015 12:26:00 -0000	[thread overview]
Message-ID: <20150506122637.GA21147@host1.jankratochvil.net> (raw)
In-Reply-To: <20150430105349.GA6260@host1.jankratochvil.net>

On Thu, 30 Apr 2015 12:53:49 +0200, Jan Kratochvil wrote:
> What about that 2nd case example of:
> 	(gdb) compile code str = "bar";
> That can be also typed as the 1st case:
> 	(gdb) compile print str = "bar"
> Obviously "bar" remains the GDB-mmap()ed memory.

Maybe it would be best if GCC can report whether the compiled code exposes
address to its internal object outside - such as by such an assignment or by
passing such a pointer to some external function.  I expect some scan of the
IR (intermediate representation - RTL/GIMPLE?) would be sufficient.

IMO for 99% of such compiled code it will not happen and therefore GDB can
quietly and safely discard such injected objfile from the inferior.

It is questionable how many false positives would such a scan-for-address-of
make.


Jan


  reply	other threads:[~2015-05-06 12:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 13:57 Jan Kratochvil
2015-04-30 10:31 ` Phil Muldoon
2015-04-30 10:53   ` Jan Kratochvil
2015-05-06 12:26     ` Jan Kratochvil [this message]
2015-05-07  2:53       ` Alexandre Oliva
2015-05-07 17:06         ` Jan Kratochvil

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=20150506122637.GA21147@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=aoliva@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=pmuldoon@redhat.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