Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Make symbol completion language-specific
Date: Tue, 29 Jan 2008 17:35:00 -0000	[thread overview]
Message-ID: <20080129172800.GA3773@caradoc.them.org> (raw)
In-Reply-To: <20071228122825.GC24450@adacore.com>

On Fri, Dec 28, 2007 at 04:28:25AM -0800, Joel Brobecker wrote:
>   1. How does someone verify that a GDB command does not return
>      any output. Do we really have to do it "manually" (using
>      gdb_send et al)?  Right now, there is a hole in my testcase
>      regarding this, and I need to fix it before I commit it.

Pretty much, though I think you could do it with gdb_test_multiple;
see how lib/mi-support.exp does it.  MI tests are anchored by default.
There may be more trouble doing it for the CLI, though, because
readline puts extra stuff in the output sometimes.

>   2. I was getting tired of writing expected output regexps that
>      were completely unreadable mostly because the output was matching
>      more than one line that ended up concatenated inside the same
>      string. So I wrote the following little helper function:
> 
>         proc multi_line { args } {
>             return [join $args "\[\r\n\]*"]
>         }
> 
>      This function allows me to do something like this:
> 
>         gdb_test "print variable" \
>                  [multi_line "first_line" \
>                              "second_line" \
>                              "last_line" ] \
>                  "print big variable"
> 
>      I think that this is far easier to read than:
> 
>         gdb_test "print variable" \
>                  "first_line${eol}second_line${eol}last_line"
>                  "print big variable"

Also see gdb_expect_list, which is similar.  I think that the way
you've written it lends to things being too far indented, which will
be hard to read...

> Index: ada-lang.c
> ===================================================================
> --- ada-lang.c	(revision 12)
> +++ ada-lang.c	(revision 13)
> @@ -68,6 +68,17 @@
>  #define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2)
>  #endif
>  
> +/* A structure that contains a vector of strings.
> +   The main purpose of this type is to group the vector and its
> +   associated parameters in one structure.  This makes it easier
> +   to handle and pass around.  */
> +
> +struct string_vector
> +{
> +  char **array; /* The vector itself.  */
> +  int index;    /* Index of the next available element in the array.  */
> +  size_t size;  /* The number of entries allocated in the array.  */
> +};

We have a generic VEC nowadays.

You left the "should be language specific" FIXME :-)

And a general comment, I'm not thrilled at the amount of generic
symbol table code had to be duplicated in the Ada-specific files.  But
that's the status quo for ada-lang.c, anyway.

I have no objections, despite the above whining.


-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2008-01-29 17:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-28 13:07 Joel Brobecker
2008-01-29 17:35 ` Daniel Jacobowitz [this message]
2008-01-30 20:43   ` Joel Brobecker
2008-01-30 21:25     ` Daniel Jacobowitz
2008-02-04 23:15   ` Joel Brobecker
2008-02-04 23:30     ` Daniel Jacobowitz
2008-02-05 22:32       ` Joel Brobecker
2008-02-06  2:40         ` [RFA/commit/Ada] Replace home-made string_vector struct with VEC Joel Brobecker
2008-02-06  2:48           ` Daniel Jacobowitz
2008-02-07 19:14           ` 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=20080129172800.GA3773@caradoc.them.org \
    --to=drow@false.org \
    --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