Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: <gdb@sources.redhat.com>
Subject: Re: [RFA] deleting breakpoints inside of 'commands'
Date: Wed, 12 Sep 2001 01:47:00 -0000	[thread overview]
Message-ID: <4.2.0.58.20010912103028.01ff2a80@ics.u-strasbg.fr> (raw)
In-Reply-To: <Pine.LNX.4.33.0109111057120.1364-100000@theotherone>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]

At 00:37 12/09/01 , vous avez écrit:


>The following patch addresses a core-dump that occurs when a 'commands'
>script deletes the current breakpoint:
>
>(gdb) commands
> >clear
> >step
> >end
>(gdb) break foo
>(gdb) continue
>         .
>         .
>         .
>warning: Invalid control type in command structure.
>Segmentation fault (core dumped)
>
>What happens is the breakpoint (and the associated 'commands' script) is
>deleted when first statement of the script is executed.  GDB runs into a
>core dump when it attempts to execute the remaining (deleted)
>statements.
>
>The patch below detects if the current breakpoint has been deleted and
>terminates execution of the associated 'commands' script and issues a
>warning.

   Wouldn't it seem more logical to
isolate the commands temporarily,
by resetting the commands field to NULL ?

        headcmd = bs->commands;
+     bs->commands = NULL;
+     cmd = headcmd;
        while (cmd != NULL)

   This would allow to execute the whole
command sequences to its end.
   At end of the commands,
the commands field should be restored if
the breakpoint has not been distroyed,
otherwise headcmd should be disposed.

    This seems a much more reasonable action scheme
to me.

    Otherwise the command parser should at least warn
if any commands are given past a
'clear' or 'delete breakpoint-number',
but this will anyhow not be possible if
the 'delete' argument is an expression that is not a simple constant.


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:[~2001-09-12  1:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-11 15:38 Don Howard
2001-09-12  1:47 ` Pierre Muller [this message]
2001-09-13  1:01   ` Pierre Muller
2001-09-13 13:50     ` Don Howard
2001-09-13 14:14       ` Andrew Cagney
2001-09-14 18:09       ` Don Howard

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=4.2.0.58.20010912103028.01ff2a80@ics.u-strasbg.fr \
    --to=muller@cerbere.u-strasbg.fr \
    --cc=gdb@sources.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