This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] print arrays with indexes
- From: Daniel Jacobowitz <drow at false dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 2 Oct 2005 18:42:18 -0400
- Subject: Re: [RFA] print arrays with indexes
- References: <20050918191943.GA27191@nevyn.them.org> <uirwy5egh.fsf@gnu.org> <20050920073058.GR2496@adacore.com> <u64svim4h.fsf@gnu.org> <20050920193132.GY2496@adacore.com> <20050920193339.GA28294@nevyn.them.org> <20050920193918.GB10186@adacore.com> <20050922164622.GF5841@adacore.com> <20050926012259.GA22284@nevyn.them.org> <20050927010420.GW922@adacore.com>
On Mon, Sep 26, 2005 at 06:04:20PM -0700, Joel Brobecker wrote:
> BTW: I think you are using vim, IIRC. Do you have some magic settings
> that handles that handles the tabs for you. If I were able to have tabs
> automatically created after I create spaces, and also transformed into
> spaces when I backspace into them, as well as allowing me to go through
> them as if they were spaces, I wouldn't mind the tabs so much.
No, sorry; I use a bastard combination of emacs and joe for most of my
code editing. Can't help you with Vim.
> + if (TYPE_CODE (index) == TYPE_CODE_RANGE)
> + index = TYPE_TARGET_TYPE (index);
>
> which the function used to have. I couldn't understand why this
> was necessary, and a look at where the type was used showed that
> this was not necessary, as ada_print_scalar, the only eventual consumer
> of that type, knew how to handle range types. I would think the same is
> true of all other languages, right?
Not sure what you mean by "used to have", to be honest. I guess this
code had some prior life in an ACT tree, if you didn't write it? It
seems like the sort of check that only Ada would need.
And, this code is still in the patch below. It's definitely dead code,
though, so I assume you meant to remove it.
Should the "return 0;" cases in get_array_low_bound be errors? Or even
internal errors (probably not)? There's already lots of code that uses
TYPE_LOW_BOUND (TYPE_INDEX_TYPE (array_type)). If that's not valid, we
need to know why not.
--
Daniel Jacobowitz
CodeSourcery, LLC