Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jason Molenda <jason-swarelist@molenda.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] A few ui_out formatting bugs with commands-on-breakpoints
Date: Fri, 07 Sep 2001 23:40:00 -0000	[thread overview]
Message-ID: <20010907234014.A10697@shell17.ba.best.com> (raw)

Hi, it looks like there were a few small oversights in the ui
support of printing-commands-on-breakpoints.  With the current gdb,
you enter these commands:

   (gdb) b main
   (gdb) comm
   > if $testval == 0
    >   print "true"
    > else
    >   print "false"
    > end
   > print "done"
   > end
   (gdb)

And this is how it's printed:

   (gdb) info br
   Num Type           Disp Enb Address    What
   1   breakpoint     keep y   0x08071a9e in main at ../../src3/gdb/main.c:714
           if if $testval == 0
             print "true"
           elseelse
             print "false"
   end        end
           print "done"
   (gdb)

Not quite ideal. :-)  With the attached patch, the output is

   (gdb) info br
   Num Type           Disp Enb Address    What
   1   breakpoint     keep y   0x08070f30 in captured_command_loop
                                          at ../../src2/gdb/main.c:1
           if $testval == 0
             print "true"
           else
             print "false"
           end
           print "done"
   (gdb)

The 'while' command has a similar problem.  There aren't any
testsuite regressions with this change.

My only concern is that I'm unfamiliar with the UI_OUT suite of
functions.  Are certain ui_out functions are preferred over others?
For instance, we have "end" printed out by both ui_out_field_string()
and by ui_out_text().  I removed the first occurrence in each case,
but who knows, maybe there's a reason to do it the other way.  From
what I can tell in the uiout doco, it's six of one and half a dozen
of the other.

Jason
From kettenis@wins.uva.nl Sat Sep 08 03:19:00 2001
From: Mark Kettenis <kettenis@wins.uva.nl>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] Add forward declaration of `struct block' to gdbtypes.h
Date: Sat, 08 Sep 2001 03:19:00 -0000
Message-id: <200109081019.f88AJOO00300@delius.kettenis.local>
X-SW-Source: 2001-09/msg00103.html
Content-length: 865

See the #include file policy "discussion" on the discussion list.
This makes `gdbtypes.h' (more) self-contained without sucking in
`symtab.h'.

Checked in.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* gdbtypes.h (struct block): Add forward declaration.

Index: gdbtypes.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.h,v
retrieving revision 1.15
diff -u -p -r1.15 gdbtypes.h
--- gdbtypes.h 2001/09/05 23:07:32 1.15
+++ gdbtypes.h 2001/09/08 10:16:03
@@ -23,6 +23,9 @@
 #if !defined (GDBTYPES_H)
 #define GDBTYPES_H 1
 
+/* Forward declarations for prototypes.  */
+struct block;
+
 /* Codes for `fundamental types'.  This is a monstrosity based on the
    bogus notion that there are certain compiler-independent
    `fundamental types'.  None of these is well-defined (how big is


             reply	other threads:[~2001-09-07 23:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-07 23:40 Jason Molenda [this message]
2001-09-08 11:06 ` Fernando Nasser
2001-09-09  7:51 ` Jackie Smith Cashion
2001-09-09  9:21   ` Eli Zaretskii

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=20010907234014.A10697@shell17.ba.best.com \
    --to=jason-swarelist@molenda.com \
    --cc=gdb-patches@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