Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Pierre Muller <muller@cerbere.u-strasbg.fr>
Cc: gdb-patches@sources.redhat.com, jimb@redhat.com
Subject: Re: [RFA] 2nd send: Solve the watchpoint failures on second run.
Date: Thu, 29 Aug 2002 15:16:00 -0000	[thread overview]
Message-ID: <3D6E9C9F.A7018859@redhat.com> (raw)
In-Reply-To: <4.2.0.58.20020715162013.02270ed8@ics.u-strasbg.fr>

Pierre Muller wrote:
> 
> I got no answer to that RFA,
> http://sources.redhat.com/ml/gdb-patches/2002-06/msg00394.html
> thus I send it again.
> 
> This bug is related to bug 515 of database.
> The following note:
>  >(This patch, together with the previous RFA that I sent today,
>  >fixes the problem for both statically and dynamically linked
>  >programs).
> Can be modified into:
> The following patch together with the patch commited
> on july 4. 2002
> http://sources.redhat.com/ml/gdb-cvs/2002-07/msg00036.html
> fiwes bug 515 both for statically and dynamically linked programs.
> 
> If you use my previous patch and compile the test program
> of the 515 bug with --static option,
> you will still miss the change of x value on the second run.
> This comes from the fact that the val field of the watchpoint is
> not reset correctly when the program is restarted.
> 
>    I first tried to fix this problem by using evaluate_expression
> in the breakpoint_init_inferior function. But, while this fixes the problem for
> the win32 native debugger, it leads to problems for linux,
> beacuse the program is not yet loaded into memory
> when this function is called: instead, the bash used for launch the debuggee
> seems to be in memory...
> 
> So the only way I found to fix that error was to reset val field to NULL
> so that the val field is computed again
> correctly at the first insert_breakpoint call.

Looks OK to me, Pierre -- except please move the '{' from 
the end of the line.

Thanks
Michael


> 
> 2002-06-19  Pierre Muller  <muller@ics.u-strasbg.fr>
> 
>         * breakpoint.c (breakpoint_init_inferior): Reset the val field of
>         watchpoints to NULL.
>         (insert_breakpoints): set val field of watchpoints if NULL.
> 
> Index: breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.77
> diff -u -p -r1.77 breakpoint.c
> --- breakpoint.c        18 Jun 2002 21:58:55 -0000      1.77
> +++ breakpoint.c        19 Jun 2002 15:20:39 -0000
> @@ -725,7 +725,18 @@ insert_breakpoints (void)
>        if (b->enable_state == bp_permanent)
>          /* Permanent breakpoints cannot be inserted or removed.  */
>          continue;
> -    else if (b->type != bp_watchpoint
> +    if ((b->type == bp_watchpoint
> +       || b->type == bp_hardware_watchpoint
> +       || b->type == bp_read_watchpoint
> +       || b->type == bp_access_watchpoint) && (!b->val)) {
> +       struct value *val;
> +       val = evaluate_expression (b->exp);
> +       release_value (val);
> +       if (VALUE_LAZY (val))
> +         value_fetch_lazy (val);
> +       b->val = val;
> +      }
> +    if (b->type != bp_watchpoint
>         && b->type != bp_hardware_watchpoint
>         && b->type != bp_read_watchpoint
>         && b->type != bp_access_watchpoint
> @@ -1520,6 +1531,14 @@ breakpoint_init_inferior (enum inf_conte
>         /* Likewise for watchpoints on local expressions.  */
>         if (b->exp_valid_block != NULL)
>           delete_breakpoint (b);
> +       if (context == inf_starting)
> +         {
> +           /* Reset val field to force reread of starting value
> +              in insert_breakpoints.  */
> +           if (b->val)
> +             value_free (b->val);
> +           b->val = NULL;
> +         }
>         break;
>          default:
>         /* Likewise for exception catchpoints in dynamic-linked
> 
> Pierre Muller
> Institut Charles Sadron
> 6,rue Boussingault
> F 67083 STRASBOURG CEDEX (France)
> mailto:muller@ics.u-strasbg.fr
> Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99
> 
> Pierre Muller
> Institut Charles Sadron
> 6,rue Boussingault
> F 67083 STRASBOURG CEDEX (France)
> mailto:muller@ics.u-strasbg.fr
> Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


  reply	other threads:[~2002-08-29 22:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-15  8:10 Pierre Muller
2002-08-29 15:16 ` Michael Snyder [this message]
2002-08-30  2:15   ` Pierre Muller

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=3D6E9C9F.A7018859@redhat.com \
    --to=msnyder@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.com \
    --cc=muller@cerbere.u-strasbg.fr \
    /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