2012-07-18 23:37:58 +00:00
|
|
|
/* Basic host-specific definitions for GDB.
|
2016-01-01 04:33:14 +00:00
|
|
|
Copyright (C) 1986-2016 Free Software Foundation, Inc.
|
2012-01-24 21:36:37 +00:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
2012-07-18 23:37:58 +00:00
|
|
|
#ifndef HOST_DEFS_H
|
|
|
|
#define HOST_DEFS_H
|
2012-01-24 21:36:37 +00:00
|
|
|
|
Move utility functions to common/
gdb/ChangeLog
2015-06-15 Aleksandar Ristovski <aristovski@qnx.com
Jan Kratochvil <jan.kratochvil@redhat.com>
Move utility functions to common/.
* cli/cli-utils.c (skip_spaces, skip_spaces_const, skip_to_space_const):
Move defs to common/common-utils.c.
* cli/cli-utils.h (skip_spaces, skip_spaces_const, skip_to_space)
(skip_to_space_const): Move decls to common/common-utils.h.
* common/common-defs.h: Move include of common-types.h before
common-utils.h.
* common/common-utils.c: Include host-defs.h and ctype.h.
(HIGH_BYTE_POSN, is_digit_in_base, digit_to_int, strtoulst): Move
from utils.c.
(skip_spaces, skip_spaces_const, skip_to_space_const): Move from
cli/cli-utils.c.
* common/common-utils.h (strtoulst): Move decl from utils.h.
(skip_spaces, skip_spaces_const, skip_to_space, skip_to_space_const):
Move from cli/cli-utils.h.
* common/host-defs.h: Include limits.h.
(TARGET_CHAR_BIT, HOST_CHAR_BIT): Moved from defs.h.
(skip_spaces, skip_spaces_const): Move decls from cli/cli-utils.h.
* defs.h (TARGET_CHAR_BIT, HOST_CHAR_BIT): Move to
common/common-utils.h.
* utils.c (HIGH_BYTE_POSN, is_digit_in_base, digit_to_int)
(strtoulst): Move to common/common-utils.c.
* utils.h (strtoulst): Moved decl to common/common-utils.h.
2015-06-15 15:04:56 +00:00
|
|
|
#include <limits.h>
|
|
|
|
|
|
|
|
/* Static host-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
|
|
|
|
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
|
|
|
|
|
2012-07-18 23:37:58 +00:00
|
|
|
#ifdef __MSDOS__
|
|
|
|
# define CANT_FORK
|
|
|
|
# define GLOBAL_CURDIR
|
|
|
|
# define DIRNAME_SEPARATOR ';'
|
|
|
|
#endif
|
gdb/
Code cleanup.
* charset.c (find_charset_names): Remove variables ix and elt.
Use free_char_ptr_vec.
* elfread.c (build_id_to_debug_filename): New variables debugdir_vec,
back_to and ix. Use dirnames_to_char_ptr_vec. Remove variable
debugdir_end. New variable debugdir_len.
* gdb_vecs.h (free_char_ptr_vec, make_cleanup_free_char_ptr_vec)
(dirnames_to_char_ptr_vec_append, dirnames_to_char_ptr_vec): New
declarations.
* progspace.c (clear_program_space_solib_cache): Remove variables ix
and elt. Use free_char_ptr_vec.
* source.c (add_path): Remove variables argv, arg and argv_index.
New variables dir_vec, back_to, ix and name.
Use dirnames_to_char_ptr_vec_append. Use freeargv instead of
make_cleanup_freeargv. Remove variable separator. Simplify the code
no longer expecting DIRNAME_SEPARATOR.
(openp): Remove variable p, p1 and len. New variables dir_vec,
back_to, ix and dir. Use dirnames_to_char_ptr_vec. Simplify the code
no longer expecting DIRNAME_SEPARATOR.
* symfile.c (find_separate_debug_file): New variables debugdir_vec,
back_to and ix. Use dirnames_to_char_ptr_vec. Remove variable
debugdir_end.
* utils.c (free_char_ptr_vec, do_free_char_ptr_vec)
(make_cleanup_free_char_ptr_vec, dirnames_to_char_ptr_vec_append)
(dirnames_to_char_ptr_vec): New functions.
2012-04-17 15:47:09 +00:00
|
|
|
|
2012-07-18 23:37:58 +00:00
|
|
|
#if !defined (__CYGWIN__) && defined (_WIN32)
|
|
|
|
# define DIRNAME_SEPARATOR ';'
|
|
|
|
#endif
|
gdb/
Code cleanup.
* charset.c (find_charset_names): Remove variables ix and elt.
Use free_char_ptr_vec.
* elfread.c (build_id_to_debug_filename): New variables debugdir_vec,
back_to and ix. Use dirnames_to_char_ptr_vec. Remove variable
debugdir_end. New variable debugdir_len.
* gdb_vecs.h (free_char_ptr_vec, make_cleanup_free_char_ptr_vec)
(dirnames_to_char_ptr_vec_append, dirnames_to_char_ptr_vec): New
declarations.
* progspace.c (clear_program_space_solib_cache): Remove variables ix
and elt. Use free_char_ptr_vec.
* source.c (add_path): Remove variables argv, arg and argv_index.
New variables dir_vec, back_to, ix and name.
Use dirnames_to_char_ptr_vec_append. Use freeargv instead of
make_cleanup_freeargv. Remove variable separator. Simplify the code
no longer expecting DIRNAME_SEPARATOR.
(openp): Remove variable p, p1 and len. New variables dir_vec,
back_to, ix and dir. Use dirnames_to_char_ptr_vec. Simplify the code
no longer expecting DIRNAME_SEPARATOR.
* symfile.c (find_separate_debug_file): New variables debugdir_vec,
back_to and ix. Use dirnames_to_char_ptr_vec. Remove variable
debugdir_end.
* utils.c (free_char_ptr_vec, do_free_char_ptr_vec)
(make_cleanup_free_char_ptr_vec, dirnames_to_char_ptr_vec_append)
(dirnames_to_char_ptr_vec): New functions.
2012-04-17 15:47:09 +00:00
|
|
|
|
2012-07-18 23:37:58 +00:00
|
|
|
#ifndef DIRNAME_SEPARATOR
|
|
|
|
#define DIRNAME_SEPARATOR ':'
|
|
|
|
#endif
|
gdb/
Code cleanup.
* charset.c (find_charset_names): Remove variables ix and elt.
Use free_char_ptr_vec.
* elfread.c (build_id_to_debug_filename): New variables debugdir_vec,
back_to and ix. Use dirnames_to_char_ptr_vec. Remove variable
debugdir_end. New variable debugdir_len.
* gdb_vecs.h (free_char_ptr_vec, make_cleanup_free_char_ptr_vec)
(dirnames_to_char_ptr_vec_append, dirnames_to_char_ptr_vec): New
declarations.
* progspace.c (clear_program_space_solib_cache): Remove variables ix
and elt. Use free_char_ptr_vec.
* source.c (add_path): Remove variables argv, arg and argv_index.
New variables dir_vec, back_to, ix and name.
Use dirnames_to_char_ptr_vec_append. Use freeargv instead of
make_cleanup_freeargv. Remove variable separator. Simplify the code
no longer expecting DIRNAME_SEPARATOR.
(openp): Remove variable p, p1 and len. New variables dir_vec,
back_to, ix and dir. Use dirnames_to_char_ptr_vec. Simplify the code
no longer expecting DIRNAME_SEPARATOR.
* symfile.c (find_separate_debug_file): New variables debugdir_vec,
back_to and ix. Use dirnames_to_char_ptr_vec. Remove variable
debugdir_end.
* utils.c (free_char_ptr_vec, do_free_char_ptr_vec)
(make_cleanup_free_char_ptr_vec, dirnames_to_char_ptr_vec_append)
(dirnames_to_char_ptr_vec): New functions.
2012-04-17 15:47:09 +00:00
|
|
|
|
2012-07-18 23:37:58 +00:00
|
|
|
#ifndef SLASH_STRING
|
|
|
|
#define SLASH_STRING "/"
|
|
|
|
#endif
|
2012-04-27 20:47:57 +00:00
|
|
|
|
2012-07-18 23:37:58 +00:00
|
|
|
#endif /* HOST_DEFS_H */
|