This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patchv3 1/8] Move utility functions to common/
- From: Pedro Alves <palves at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Aleksandar Ristovski <ARistovski at qnx dot com>
- Date: Fri, 28 Feb 2014 12:06:22 +0000
- Subject: Re: [patchv3 1/8] Move utility functions to common/
- Authentication-results: sourceware.org; auth=none
- References: <20140227213242 dot GB21121 at host2 dot jankratochvil dot net>
Looks fine to me, with a few nits.
On 02/27/2014 09:32 PM, Jan Kratochvil wrote:
> (strtoulst): Move decl from utils.h.
> (hex2bin, bin2hex): Move decls from remote.h.
This one looks stale.
> --- a/gdb/common/common-utils.h
> +++ b/gdb/common/common-utils.h
> @@ -25,6 +25,25 @@
> #include <stddef.h>
> #include <stdarg.h>
>
> +/* Static target-system-dependent parameters for GDB. */
> +
> +/* * Number of bits in a char or unsigned char for the target machine.
> + Just like CHAR_BIT in <limits.h> but describes the target machine. */
> +#if !defined (TARGET_CHAR_BIT)
> +#define TARGET_CHAR_BIT 8
> +#endif
> +
> +/* * If we picked up a copy of CHAR_BIT from a configuration file
> + (which may get it by including <limits.h>) then use it to set
Sounds like common-utils.h should include limits.h? defs.h does
include it.
> + the number of bits in a host char. If not, use the same size
> + as the target. */
> +
> +#if defined (CHAR_BIT)
> +#define HOST_CHAR_BIT CHAR_BIT
> +#else
> +#define HOST_CHAR_BIT TARGET_CHAR_BIT
> +#endif
I think host-defs.h might be a better home for this. (With the
target version placed in a new target-defs.h perhaps. I won't
insist though.)
--
Pedro Alves