Re: Build question

Eli Zaretskii
2009-09-05T16:12:13Z

> From: Danny Backx <danny.backx@scarlet.be>
> Cc: gdb@sourceware.org
> Date: Sat, 05 Sep 2009 11:35:11 +0200

Patches should be sent to gdb-patches@ (redirected).

> ESR said "early and often", right ? Here is a first draft of my work.
> Showing this early allows you to steer me in the right direction.

Thanks.

> Otherwise, this code appears to work for me. I hardcoded the variable in
> gdb/main.c, set this to both 0 and 1 for testing, and saw the expected
> results.

Later we should probably have a user option to control that.

> Should I copy code that handles a variable like "solib-search-path" or
> "annotate" to set the _have_dos_based_file_system at runtime ?

Yes, IMO.

> +/* Filesystem type */
> +int _have_dos_based_file_system = 1;

I don't like its starting with an underline. This is a normal
variable, no need to pretend it's internal or something.

> + if (_have_dos_based_file_system) {

Please use the GNU style of brace-placing.

> + } else {

Ditto.

> +/*
> + * Defined in gdb/main.c
> + *
> + * This determines whether we have
> + * as a separator : / or \
> + * a prefix [a-z]: or not
> + * Replaces HAVE_DOS_BASED_FILE_SYSTEM and FILENAME_PREFIX_LEN.
> + *
> + * Case sensitive/insensitive file name comparison is *not* influenced by this.
> + */

This is not the GNU style of comments.

> +static inline int _isalpha(int c)
> +{
> + if (c <= 'Z' && c >= 'A')
> + return TRUE;
> + if (c <= 'z' && c >= 'a')
> + return TRUE;
> + return FALSE;
> +}

I'm not sure what The Powers That Be think about defining inline
functions in a header. In general, if a host does not support the
`inline' keyword, it will be defined away, so you get several
identically-named functions in the same program (although I think
`static' prevents them from causing a link error).