Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: <gdb-patches@sourceware.org>
Subject: [RFA] Fix bug in add_alias_cmd
Date: Sat, 06 Jun 2009 15:50:00 -0000	[thread overview]
Message-ID: <006001c9e6be$6fad8fb0$4f08af10$@u-strasbg.fr> (raw)


  Out of curiosity, I tried to start
gdb with --xdb options to see the special
options that this provides.

  I got this:
$ ./gdb -xdb
../../purecvs/gdb/cli/cli-decode.c:255: internal-error: add_alias_cmd:
Assertion
 `!aliases && !prehook && prehookee && !posthook && ! posthookee' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
../../purecvs/gdb/cli/cli-decode.c:255: internal-error: add_alias_cmd:
Assertion
 `!aliases && !prehook && prehookee && !posthook && ! posthookee' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
Aborted (core dumped)

  This is due to "bu" being an alias command of "ubreak"
for xdb options, but "ubreak" doesn't seem to exist anywhere
and I found no trace of it anywhere is the sources :(

I fact after looking at the sources, it appears to me
that the assertion itself is wrong.
prehookee should also be NULL, as the other pointers tested.


This small patch fixes it.

Tested on complier farm without regression.

OK to commit?


Pierre Muller
Pascal language support maintainer for GDB

PS: What should we do about 
Could I also remove that line 
 if (xdb_commands)
    {
      add_com_alias ("ba", "break", class_breakpoint, 1);
      add_com_alias ("bu", "ubreak", class_breakpoint, 1);
    }


2009-06-06  Pierre Muller  <muller@ics.u-strasbg.fr>

	* cli/cli-decode.c (add_alias_cmd): Correct assertion.

Index: src/gdb/cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.79
diff -u -p -r1.79 cli-decode.c
--- src/gdb/cli/cli-decode.c	12 May 2009 16:51:13 -0000	1.79
+++ src/gdb/cli/cli-decode.c	6 Jun 2009 11:18:08 -0000
@@ -251,7 +251,7 @@ add_alias_cmd (char *name, char *oldname
 						     &prehook, &prehookee,
 						     &posthook,
&posthookee);
       /* If this happens, it means a programmer error somewhere.  */
-      gdb_assert (!aliases && !prehook && prehookee
+      gdb_assert (!aliases && !prehook && !prehookee
 		  && !posthook && ! posthookee);
       return 0;
     }


             reply	other threads:[~2009-06-06 15:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-06 15:50 Pierre Muller [this message]
2009-06-08 15:37 ` Tom Tromey
2009-06-08 16:06   ` Pierre Muller
2009-06-08 22:42     ` Tom Tromey
2009-06-08 16:26 ` Daniel Jacobowitz
2009-06-08 16:59   ` Pedro Alves

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='006001c9e6be$6fad8fb0$4f08af10$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --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