Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC/commit] parse breakpoint condition according to breakpoint location
Date: Mon, 10 May 2010 19:15:00 -0000	[thread overview]
Message-ID: <m3mxw7bmc8.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1273427894-4461-1-git-send-email-brobecker@adacore.com> (Joel	Brobecker's message of "Sun, 9 May 2010 19:58:13 +0200")

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> So the decision was, if the language is auto, to use the language
Joel> corresponding to the breakpoint location, not the current frame.
Joel> This is what this patch implements.

Sounds reasonable.

Joel> ... But at the same time, the discussion digressed over the use of
Joel> a global. I proposed a plan for dealing with this, but it's a huge
Joel> change (adding a language parameter to the parse_* routines), and
Joel> I don't think I got feedback on how I was planning to proceed.

For reference the plan is here:

    http://www.sourceware.org/ml/gdb-patches/2003-09/msg00333.html

I would prefer never passing NULL to parse_exp_1 -- just make the
callers explicitly pass current_language.

That is just a minor detail; overall it sounds fine to me.

current_language is a problem global.  It is referenced in a lot of
places where an argument would be preferable.  E.g., even though
expressions carry their language, code in valops.c checks the global, so
you can wind up with odd behavior (at least in theory, I have not tried
to make a reproducer).  Probably, evaluate_expression should call
set_language and restore the old language in a cleanup -- though this is
a workaround and not a clean fix.

Joel> Summary of the problem: 
Joel> For the longer term, this approach is far from perfect, since it
Joel> depends on the current_language global, which may change over
Joel> time.  For instance, if the user switches from language auto to
Joel> language c between the moment he creates the breakpoint and the
Joel> moment he runs the program, the condition will get re-evaluated
Joel> using C the next time around.

Once the condition is successfully parsed, it seems to me that any
re-parsing should be done with that same language.  Maybe this is
already accomplished by the set_language calls in breakpoint.c, I'm not
sure.

Tom


  reply	other threads:[~2010-05-10 19:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-09 17:58 Joel Brobecker
2010-05-10 19:15 ` Tom Tromey [this message]
2010-05-10 21:28   ` Joel Brobecker
2010-05-17 17:28 ` 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=m3mxw7bmc8.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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