1999-07-07 17:31:57 +00:00
|
|
|
|
/* *INDENT-OFF* */ /* ATTR_FORMAT confuses indent, avoid running it for now */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
/* Basic, host-specific, and target-specific definitions for GDB.
|
2005-12-17 22:34:03 +00:00
|
|
|
|
Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
|
2009-01-03 05:58:08 +00:00
|
|
|
|
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
|
1999-04-16 01:35:26 +00:00
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
|
This file is part of GDB.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
|
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
|
2007-08-23 18:08:50 +00:00
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
1999-07-07 20:19:36 +00:00
|
|
|
|
(at your option) any later version.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
|
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.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-23 18:08:50 +00:00
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
#ifndef DEFS_H
|
|
|
|
|
#define DEFS_H
|
|
|
|
|
|
2002-09-27 21:31:22 +00:00
|
|
|
|
#include "config.h" /* Generated by configure. */
|
|
|
|
|
|
2005-05-09 17:20:18 +00:00
|
|
|
|
#include <sys/types.h>
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#include <stdio.h>
|
2002-09-27 21:31:22 +00:00
|
|
|
|
#include <errno.h> /* System call error return status. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#include <limits.h>
|
* Makefile.in (GNULIB_H): Use GNULIB_STDINT_H.
(gdb_stdint_h, gdb_stdint.h, stamp-int): Delete. Remove
all dependencies on $(gdb_stdint_h).
(distclean): Do not delete gdb_stdint.h.
* acinclude.m4: Do not use stdint.m4.
* configure.ac: Set GNULIB_STDINT_H. Remove tests for stdint.h,
uintptr_t, and gdb_stdint.h.
* defs.h: Include <stdint.h>.
* gdb_thread_db.h: Assume stdint.h is already included.
* breakpoint.c, findcmd.c, hppa-tdep.c, inf-ptrace.c, proc-service.c,
rs6000-nat.c, spu-linux-nat.c, target.c, win32-nat.c: Do not
include gdb_stdint.h.
* configure, config.in: Regenerate.
2008-06-26 15:51:28 +00:00
|
|
|
|
#include <stdint.h>
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2008-09-14 06:37:18 +00:00
|
|
|
|
/* The libdecnumber library, on which GDB depends, includes a header file
|
|
|
|
|
called gstdint.h instead of relying directly on stdint.h. GDB, on the
|
|
|
|
|
other hand, includes stdint.h directly, relying on the fact that gnulib
|
|
|
|
|
generates a copy if the system doesn't provide one or if it is missing
|
|
|
|
|
some features. Unfortunately, gstdint.h and stdint.h cannot be included
|
|
|
|
|
at the same time, which may happen when we include a file from
|
|
|
|
|
libdecnumber.
|
|
|
|
|
|
|
|
|
|
The following macro definition effectively prevents the inclusion of
|
|
|
|
|
gstdint.h, as all the definitions it provides are guarded against
|
|
|
|
|
the GCC_GENERATED_STDINT_H macro. We already have gnulib/stdint.h
|
|
|
|
|
included, so it's ok to blank out gstdint.h. */
|
|
|
|
|
#define GCC_GENERATED_STDINT_H 1
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#ifdef HAVE_STDDEF_H
|
1999-10-19 02:47:02 +00:00
|
|
|
|
#include <stddef.h>
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
1999-08-31 01:14:27 +00:00
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-02-25 04:36:39 +00:00
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
2002-09-27 22:08:51 +00:00
|
|
|
|
/* First include ansidecl.h so we can use the various macro definitions
|
|
|
|
|
here and in all subsequent file inclusions. */
|
|
|
|
|
|
|
|
|
|
#include "ansidecl.h"
|
|
|
|
|
|
2002-06-21 23:48:41 +00:00
|
|
|
|
#include "gdb_locale.h"
|
|
|
|
|
|
gdb:
2009-03-19 Tom Tromey <tromey@redhat.com>
Julian Brown <julian@codesourcery.com>
PR i18n/7220, PR i18n/7821, PR exp/8815, PR exp/9103,
PR i18n/9401, PR exp/9613:
* NEWS: Update
* value.h (value_typed_string): Declare.
(val_print_string): Update.
* valprint.h (print_char_chars): Update.
* valprint.c (print_char_chars): Add type argument. Update.
(val_print_string): Likewise.
* valops.c (value_typed_string): New function.
* utils.c (host_char_to_target): New function.
(parse_escape): Use host_char_to_target, host_hex_value. Update.
Remove '^' case.
(no_control_char_error): Remove.
* typeprint.c (print_type_scalar): Update.
* scm-valprint.c (scm_scmval_print): Update.
* scm-lang.h (scm_printchar, scm_printstr): Update.
* scm-lang.c (scm_printchar): Add type argument.
(scm_printstr): Likewise.
* printcmd.c (print_formatted): Update.
(print_scalar_formatted): Update.
(printf_command) <wide_string_arg, wide_char_arg>: New constants.
Handle '%lc' and '%ls'.
* parser-defs.h (struct typed_stoken): New type.
(struct stoken_vector): Likewise.
(write_exp_string_vector): Declare.
* parse.c (write_exp_string_vector): New function.
* p-valprint.c (pascal_val_print): Update.
* p-lang.h (is_pascal_string_type, pascal_printchar,
pascal_printstr): Update.
* p-lang.c (is_pascal_string_type): Remove 'char_size' argument.
Add 'char_type' argument.
(pascal_emit_char): Add type argument.
(pascal_printchar): Likewise.
(pascal_printstr): Likewise.
* objc-lang.c (objc_emit_char): Add type argument.
(objc_printchar): Likewise.
(objc_printstr): Likewise.
* macroexp.c (get_character_constant): Handle unicode characters.
Use c_parse_escape.
(get_string_literal): Handle unicode strings. Use
c_parse_escape.
* m2-valprint.c (print_unpacked_pointer): Update.
(m2_print_array_contents): Update.
(m2_val_print): Update.
* m2-lang.c (m2_emit_char): Add type argument.
(m2_printchar): Likewise.
(m2_printstr): Likewise.
* language.h (struct language_defn) <la_printchar>: Add type
argument.
<la_printstr, la_emitchar>: Likewise.
(LA_PRINT_CHAR): Likewise.
(LA_PRINT_STRING): Likewise.
(LA_EMIT_CHAR): Likewise.
* language.c (unk_lang_emit_char): Add type argument.
(unk_lang_printchar): Likewise.
(unk_lang_printstr): Likewise.
* jv-valprint.c (java_val_print): Update.
* jv-lang.c (java_emit_char): Add type argument.
* f-valprint.c (f_val_print): Update.
* f-lang.c (f_emit_char): Add type argument.
(f_printchar): Likewise.
(f_printstr): Likewise.
* expprint.c (print_subexp_standard): Update.
* charset.h (target_wide_charset): Declare.
(c_target_char_has_backslash_escape, c_parse_backslash,
host_char_print_literally, host_char_to_target,
target_char_to_host, target_char_to_control_char): Remove.
(enum transliterations): New type.
(convert_between_encodings): Declare.
(HOST_ESCAPE_CHAR): New define.
(host_letter_to_control_character, host_hex_value): Declare.
(enum wchar_iterate_result): New enum.
(struct wchar_iterator): Declare.
(make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator,
wchar_push_back): Declare.
* charset-list.h: New file.
* c-valprint.c (textual_name): New function.
(textual_element_type): Handle wide character types.
(c_val_print): Pass original type to textual_element_type. Handle
wide character types.
(c_value_print): Use textual_element_type. Pass original type of
value to val_print.
* c-lang.h (enum c_string_type): New type.
(c_printchar, c_printstr): Update.
* c-lang.c (classify_type): New function.
(print_wchar): Likewise.
(c_emit_char): Add type argument. Handle wide characters.
(c_printchar): Likewise.
(c_printstr): Add type argument. Handle wide and multibyte
character sets.
(convert_ucn): New function.
(emit_numeric_character): Likewise.
(convert_octal): Likewise.
(convert_hex): Likewise.
(ADVANCE): New macro.
(convert_escape): New function.
(parse_one_string): Likewise.
(evaluate_subexp_c): Likewise.
(exp_descriptor_c): New global.
(c_language_defn): Use exp_descriptor_c.
(cplus_language_defn): Likewise.
(asm_language_defn): Likewise.
(minimal_language_defn): Likewise.
(charset_for_string_type): New function.
* c-exp.y (%union): Add 'svec' and 'tsval'.
(CHAR): New token.
(exp): Add CHAR production.
(string_exp): Rewrite.
(exp) <string_exp>: Rewrite.
(tempbuf): Now global.
(tempbuf_init): New global.
(parse_string_or_char): New function.
(yylex) <tempbuf>: Now global.
<tokptr, tempbufindex, tempbufsize, token_string, class_prefix>:
Remove.
Handle 'u', 'U', and 'L' prefixes. Call parse_string_or_char.
(c_parse_escape): New function.
* auxv.c (fprint_target_auxv): Update.
* ada-valprint.c (ada_emit_char): Add type argument.
(ada_printchar): Likewise.
(ada_print_scalar): Update.
(printstr): Add type argument. Update calls to ada_emit_char.
(ada_printstr): Add type argument.
(ada_val_print_array): Update.
(ada_val_print_1): Likewise.
* ada-lang.c (emit_char): Add type argument.
* ada-lang.h (ada_emit_char, ada_printchar, ada_printstr): Add
type arguments.
* gdb_locale.h: Include langinfo.h.
* charset.c (_initialize_charset): Set default host charset from
the locale. Don't register charsets. Add target-wide-charset
commands. Call find_charset_names.
(struct charset, struct translation): Remove.
(GDB_DEFAULT_HOST_CHARSET): Remove.
(GDB_DEFAULT_TARGET_WIDE_CHARSET): New define.
(target_wide_charset_name): New global.
(show_host_charset_name): Handle "auto".
(show_target_wide_charset_name): New function.
(host_charset_enum, target_charset_enum): Remove.
(charset_enum): New global.
(all_charsets, register_charset, lookup_charset, all_translations,
register_translation, lookup_translation): Remove.
(simple_charset, ascii_print_literally, ascii_to_control): Remove.
(iso_8859_print_literally, iso_8859_to_control,
iso_8859_family_charset): Remove.
(ebcdic_print_literally, ebcdic_to_control,
ebcdic_family_charset): Remove.
(struct cached_iconv, check_iconv_cache, cached_iconv_convert,
register_iconv_charsets): Remove.
(target_wide_charset_be_name, target_wide_charset_le_name): New
globals.
(identity_either_char_to_other): Remove.
(set_be_le_names, validate): New functions.
(backslashable, backslashed, represented): Remove.
(default_c_target_char_has_backslash_escape): Remove.
(default_c_parse_backslash, iconv_convert): Remove.
(ascii_to_iso_8859_1_table, ascii_to_ebcdic_us_table,
ascii_to_ibm1047_table, iso_8859_1_to_ascii_table,
iso_8859_1_to_ebcdic_us_table, iso_8859_1_to_ibm1047_table,
ebcdic_us_to_ascii_table, ebcdic_us_to_iso_8859_1_table,
ebcdic_us_to_ibm1047_table, ibm1047_to_ascii_table,
ibm1047_to_iso_8859_1_table, ibm1047_to_ebcdic_us_table): Remove.
(table_convert_char, table_translation, simple_table_translation):
Remove.
(current_host_charset, current_target_charset,
c_target_char_has_backslash_escape_func,
c_target_char_has_backslash_escape_baton): Remove.
(c_parse_backslash_func, c_parse_backslash_baton): Remove.
(host_char_to_target_func, host_char_to_target_baton): Remove.
(target_char_to_host_func, target_char_to_host_baton): Remove.
(cached_iconv_host_to_target, cached_iconv_target_to_host):
Remove.
(lookup_charset_or_error, check_valid_host_charset): Remove.
(set_host_and_target_charsets): Remove.
(set_host_charset, set_target_charset): Remove.
(set_host_charset_sfunc, set_target_charset_sfunc): Rewrite.
(set_target_wide_charset_sfunc): New function.
(show_charset): Print target wide character set.
(host_charset, target_charset): Rewrite.
(target_wide_charset): New function.
(c_target_char_has_backslash_escape): Remove.
(c_parse_backslash): Remove.
(host_letter_to_control_character): New function.
(host_char_print_literally): Remove.
(host_hex_value): New function.
(target_char_to_control_char): Remove.
(cleanup_iconv): New function.
(convert_between_encodings): New function.
(target_char_to_host): Remove.
(struct wchar_iterator): Define.
(make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator,
wchar_push_back): New functions.
(do_cleanup_iterator): New function.
(char_ptr): New typedef.
(charsets): New global.
(add_one, find_charset_names): New functions.
(default_charset_names): New global.
(auto_host_charset_name): Likewise.
* aclocal.m4, config.in, configure: Rebuild.
* configure.ac: Call AM_LANGINFO_CODESET.
(GDB_DEFAULT_HOST_CHARSET): Default to UTF-8.
(AM_ICONV): Invoke earlier.
* acinclude.m4: Include codeset.m4. Subst LIBICONV_INCLUDE and
LIBICONV_LIBDIR. Check for libiconv in build tree.
* Makefile.in (LIBICONV_LIBDIR, LIBICONV_INCLUDE): New macros.
(INTERNAL_CFLAGS_BASE): Add LIBICONV_INCLUDE.
(INTERNAL_LDFLAGS): Add LIBICONV_LIBDIR.
* gdb_obstack.h (obstack_grow_wstr): New define.
* gdb_wchar.h: New file.
* defs.h: Include it.
gdb/testsuite:
* gdb.base/store.exp: Update for change to escape output.
* gdb.base/callfuncs.exp (fetch_all_registers): Update for change
to escape output.
* gdb.base/pointers.exp: Update for change to escape output.
* gdb.base/long_long.exp (gdb_test_long_long): Update for change
to escape output.
* gdb.base/constvars.exp (do_constvar_tests): Update for change to
escape output.
* gdb.base/call-rt-st.exp (print_struct_call): Update for change
to escape output.
* gdb.cp/ref-types.exp (gdb_start_again): Update for change to
escape output.
* gdb.base/setvar.exp: Update for change to escape output.
* lib/gdb.exp (default_gdb_start): Set LC_CTYPE to C.
* gdb.base/printcmds.exp (test_print_all_chars): Update for change
to escape output.
(test_print_string_constants): Likewise.
* gdb.base/charset.exp (valid_host_charset): Check size of
wchar_t. Handle UCS-2 and UCS-4. Add tests for wide and unicode
cases. Handle "auto"-related output.
* gdb.base/charset.c (char16_t, char32_t): New typedefs.
(uvar, Uvar): New globals.
gdb/doc:
* gdb.texinfo (Character Sets): Remove obsolete text. Document
set target-wide-charset.
(Requirements): Mention iconv.
2009-03-20 23:04:40 +00:00
|
|
|
|
#include "gdb_wchar.h"
|
|
|
|
|
|
2002-03-11 00:01:11 +00:00
|
|
|
|
/* For ``enum target_signal''. */
|
|
|
|
|
#include "gdb/signals.h"
|
|
|
|
|
|
2002-09-27 21:31:22 +00:00
|
|
|
|
/* Just in case they're not defined in stdio.h. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
#ifndef SEEK_SET
|
|
|
|
|
#define SEEK_SET 0
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef SEEK_CUR
|
|
|
|
|
#define SEEK_CUR 1
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-02-25 04:36:39 +00:00
|
|
|
|
/* The O_BINARY flag is defined in fcntl.h on some non-Posix platforms.
|
|
|
|
|
It is used as an access modifier in calls to open(), where it acts
|
|
|
|
|
similarly to the "b" character in fopen()'s MODE argument. On Posix
|
|
|
|
|
platforms it should be a no-op, so it is defined as 0 here. This
|
|
|
|
|
ensures that the symbol may be used freely elsewhere in gdb. */
|
|
|
|
|
|
|
|
|
|
#ifndef O_BINARY
|
|
|
|
|
#define O_BINARY 0
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-09-27 21:31:22 +00:00
|
|
|
|
#include <stdarg.h> /* For va_list. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
#include "libiberty.h"
|
|
|
|
|
|
2005-05-08 14:57:41 +00:00
|
|
|
|
/* Rather than duplicate all the logic in BFD for figuring out what
|
|
|
|
|
types to use (which can be pretty complicated), symply define them
|
|
|
|
|
in terms of the corresponding type from BFD. */
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#include "bfd.h"
|
|
|
|
|
|
2005-05-08 14:57:41 +00:00
|
|
|
|
/* A byte from the program being debugged. */
|
|
|
|
|
typedef bfd_byte gdb_byte;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2005-05-08 14:57:41 +00:00
|
|
|
|
/* An address in the program being debugged. Host byte order. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
typedef bfd_vma CORE_ADDR;
|
|
|
|
|
|
Support lexical blocks and function bodies that occupy
non-contiguous address ranges.
* addrmap.c, addrmap.h: New files.
* block.h (struct addrmap): New forward declaration.
(struct blockvector): New member, 'map'.
(BLOCKVECTOR_MAP): New accessor macro.
* block.c: #include "addrmap.h"
(blockvector_for_pc_sect): If the blockvector we've found has
an address map, use it instead of searching the blocks.
* buildsym.c: #include "addrmap.h"
(pending_addrmap_obstack, pending_addrmap_interesting): New static
variables.
(really_free_pendings): If we have a pending addrmap, free it too.
(record_block_range): New function.
(make_blockvector): If we have an interesting pending addrmap,
record it in the new blockvector.
(start_symtab, buildsym_init): Assert that there is no pending
addrmap now; we should have cleaned up any addrmaps we'd built
previously.
(end_symtab): If there is a pending addrmap left over that didn't
get included in the blockvector, free it.
* buildsym.h (struct addrmap): New forward declaration.
(record_block_range): New prototype.
* objfiles.c: #include "addrmap.h".
(objfile_relocate): Relocate the blockvector's address map, if
present.
* dwarf2read.c (dwarf2_record_block_ranges): New function.
(read_func_scope, read_lexical_block_scope): Call it.
* Makefile.in (SFILES): Add addrmap.c.
(addrmap_h): New header dependency variable.
(COMMON_OBS): Add addrmap.o.
(addrmap.o): New rule.l
(block.o, objfiles.o, buildsym.o): Depend on $(addrmap_h).
* block.c (blockvector_for_pc, blockvector_for_pc_sect): Return a
pointer to the block, not its index in the blockvector.
(block_for_pc_sect): Use the returned block, instead of looking it
up ourselves.
* block.h (blockvector_for_pc, blockvector_for_pc_sect): Update
declarations.
* breakpoint.c (resolve_sal_pc): Use returned block, instead of
looking it up ourselves.
* stack.c (print_frame_label_vars): Disable function, which
depends on the block's index.
* buildsym.c (finish_block): Return the block we've built.
* buildsym.h (finish_block): Update prototype.
* defs.h (CORE_ADDR_MAX): New constant.
2007-12-04 23:43:57 +00:00
|
|
|
|
/* The largest CORE_ADDR value. */
|
|
|
|
|
#define CORE_ADDR_MAX (~ (CORE_ADDR) 0)
|
|
|
|
|
|
1999-08-31 01:14:27 +00:00
|
|
|
|
/* This is to make sure that LONGEST is at least as big as CORE_ADDR. */
|
|
|
|
|
|
|
|
|
|
#ifndef LONGEST
|
|
|
|
|
|
|
|
|
|
#ifdef BFD64
|
|
|
|
|
|
|
|
|
|
#define LONGEST BFD_HOST_64_BIT
|
|
|
|
|
#define ULONGEST BFD_HOST_U_64_BIT
|
|
|
|
|
|
|
|
|
|
#else /* No BFD64 */
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
#ifdef CC_HAS_LONG_LONG
|
|
|
|
|
#define LONGEST long long
|
|
|
|
|
#define ULONGEST unsigned long long
|
|
|
|
|
#else
|
|
|
|
|
#ifdef BFD_HOST_64_BIT
|
1999-08-31 01:14:27 +00:00
|
|
|
|
/* BFD_HOST_64_BIT is defined for some hosts that don't have long long
|
|
|
|
|
(e.g. i386-windows) so try it. */
|
1999-10-19 02:47:02 +00:00
|
|
|
|
#define LONGEST BFD_HOST_64_BIT
|
|
|
|
|
#define ULONGEST BFD_HOST_U_64_BIT
|
|
|
|
|
#else
|
|
|
|
|
#define LONGEST long
|
|
|
|
|
#define ULONGEST unsigned long
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
1999-08-31 01:14:27 +00:00
|
|
|
|
|
|
|
|
|
#endif /* No BFD64 */
|
|
|
|
|
|
|
|
|
|
#endif /* ! LONGEST */
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#ifndef min
|
|
|
|
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef max
|
|
|
|
|
#define max(a, b) ((a) > (b) ? (a) : (b))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Check if a character is one of the commonly used C++ marker characters. */
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern int is_cplus_marker (int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
/* enable xdb commands if set */
|
|
|
|
|
extern int xdb_commands;
|
|
|
|
|
|
|
|
|
|
/* enable dbx commands if set */
|
|
|
|
|
extern int dbx_commands;
|
|
|
|
|
|
2003-01-13 18:00:16 +00:00
|
|
|
|
/* System root path, used to find libraries etc. */
|
|
|
|
|
extern char *gdb_sysroot;
|
|
|
|
|
|
2009-04-23 21:28:20 +00:00
|
|
|
|
/* GDB datadir, used to store data files. */
|
|
|
|
|
extern char *gdb_datadir;
|
|
|
|
|
|
2007-01-09 21:34:30 +00:00
|
|
|
|
/* Search path for separate debug files. */
|
|
|
|
|
extern char *debug_file_directory;
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
extern int quit_flag;
|
|
|
|
|
extern int immediate_quit;
|
|
|
|
|
extern int sevenbit_strings;
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void quit (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-03-14 02:37:25 +00:00
|
|
|
|
/* FIXME: cagney/2000-03-13: It has been suggested that the peformance
|
|
|
|
|
benefits of having a ``QUIT'' macro rather than a function are
|
|
|
|
|
marginal. If the overhead of a QUIT function call is proving
|
|
|
|
|
significant then its calling frequency should probably be reduced
|
|
|
|
|
[kingdon]. A profile analyzing the current situtation is
|
|
|
|
|
needed. */
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#define QUIT { \
|
|
|
|
|
if (quit_flag) quit (); \
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-21 23:52:21 +00:00
|
|
|
|
if (deprecated_interactive_hook) deprecated_interactive_hook (); \
|
1999-04-16 01:35:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Languages represented in the symbol table and elsewhere.
|
|
|
|
|
This should probably be in language.h, but since enum's can't
|
|
|
|
|
be forward declared to satisfy opaque references before their
|
|
|
|
|
actual definition, needs to be here. */
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
enum language
|
|
|
|
|
{
|
|
|
|
|
language_unknown, /* Language not known */
|
|
|
|
|
language_auto, /* Placeholder for automatic setting */
|
|
|
|
|
language_c, /* C */
|
|
|
|
|
language_cplus, /* C++ */
|
2002-10-12 02:28:22 +00:00
|
|
|
|
language_objc, /* Objective-C */
|
1999-10-19 02:47:02 +00:00
|
|
|
|
language_java, /* Java */
|
|
|
|
|
language_fortran, /* Fortran */
|
|
|
|
|
language_m2, /* Modula-2 */
|
|
|
|
|
language_asm, /* Assembly language */
|
2003-05-08 17:35:21 +00:00
|
|
|
|
language_pascal, /* Pascal */
|
2004-10-01 10:23:09 +00:00
|
|
|
|
language_ada, /* Ada */
|
2007-08-09 23:01:17 +00:00
|
|
|
|
language_scm, /* Guile Scheme */
|
2004-07-28 02:46:24 +00:00
|
|
|
|
language_minimal, /* All other languages, minimal support only */
|
|
|
|
|
nr_languages
|
1999-10-19 02:47:02 +00:00
|
|
|
|
};
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
enum precision_type
|
1999-10-19 02:47:02 +00:00
|
|
|
|
{
|
|
|
|
|
single_precision,
|
|
|
|
|
double_precision,
|
|
|
|
|
unspecified_precision
|
|
|
|
|
};
|
|
|
|
|
|
2002-06-15 18:45:32 +00:00
|
|
|
|
/* A generic, not quite boolean, enumeration. */
|
|
|
|
|
enum auto_boolean
|
|
|
|
|
{
|
|
|
|
|
AUTO_BOOLEAN_TRUE,
|
|
|
|
|
AUTO_BOOLEAN_FALSE,
|
|
|
|
|
AUTO_BOOLEAN_AUTO
|
|
|
|
|
};
|
|
|
|
|
|
2003-10-20 15:38:02 +00:00
|
|
|
|
/* Potential ways that a function can return a value of a given type. */
|
|
|
|
|
enum return_value_convention
|
|
|
|
|
{
|
|
|
|
|
/* Where the return value has been squeezed into one or more
|
|
|
|
|
registers. */
|
|
|
|
|
RETURN_VALUE_REGISTER_CONVENTION,
|
|
|
|
|
/* Commonly known as the "struct return convention". The caller
|
|
|
|
|
passes an additional hidden first parameter to the caller. That
|
|
|
|
|
parameter contains the address at which the value being returned
|
|
|
|
|
should be stored. While typically, and historically, used for
|
|
|
|
|
large structs, this is convention is applied to values of many
|
|
|
|
|
different types. */
|
2004-05-08 23:02:10 +00:00
|
|
|
|
RETURN_VALUE_STRUCT_CONVENTION,
|
|
|
|
|
/* Like the "struct return convention" above, but where the ABI
|
|
|
|
|
guarantees that the called function stores the address at which
|
|
|
|
|
the value being returned is stored in a well-defined location,
|
|
|
|
|
such as a register or memory slot in the stack frame. Don't use
|
|
|
|
|
this if the ABI doesn't explicitly guarantees this. */
|
|
|
|
|
RETURN_VALUE_ABI_RETURNS_ADDRESS,
|
|
|
|
|
/* Like the "struct return convention" above, but where the ABI
|
|
|
|
|
guarantees that the address at which the value being returned is
|
|
|
|
|
stored will be available in a well-defined location, such as a
|
|
|
|
|
register or memory slot in the stack frame. Don't use this if
|
|
|
|
|
the ABI doesn't explicitly guarantees this. */
|
|
|
|
|
RETURN_VALUE_ABI_PRESERVES_ADDRESS,
|
2003-10-20 15:38:02 +00:00
|
|
|
|
};
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
/* the cleanup list records things that have to be undone
|
|
|
|
|
if an error happens (descriptors to be closed, memory to be freed, etc.)
|
|
|
|
|
Each link in the chain records a function to call and an
|
|
|
|
|
argument to give it.
|
|
|
|
|
|
|
|
|
|
Use make_cleanup to add an element to the cleanup chain.
|
|
|
|
|
Use do_cleanups to do all cleanup actions back to a given
|
|
|
|
|
point in the chain. Use discard_cleanups to remove cleanups
|
2008-06-10 09:29:15 +00:00
|
|
|
|
from the chain back to a given point, not doing them.
|
|
|
|
|
|
|
|
|
|
If the argument is pointer to allocated memory, then you need to
|
|
|
|
|
to additionally set the 'free_arg' member to a function that will
|
|
|
|
|
free that memory. This function will be called both when the cleanup
|
|
|
|
|
is executed and when it's discarded. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
struct cleanup
|
1999-10-19 02:47:02 +00:00
|
|
|
|
{
|
|
|
|
|
struct cleanup *next;
|
2003-01-18 Andrew Cagney <ac131313@redhat.com>
* ada-valprint.c: Eliminate PTR.
* breakpoint.c, corelow.c, cris-tdep.c, dbxread.c: Ditto.
* defs.h, dve3900-rom.c, dwarf2read.c, dwarfread.c: Ditto.
* exec.c, hppa-tdep.c, hpread.c, infcmd.c, mdebugread.c: Ditto.
* objfiles.c, objfiles.h, ocd.c, remote-es.c: Ditto.
* remote-mips.c, remote-sds.c, remote-vx.c: Ditto.
* solib-svr4.c, solib.c, stack.c, symfile.c, symfile.h: Ditto.
* symmisc.c, v850ice.c, xcoffread.c, cli/cli-script.c: Ditto.
2003-01-18 15:55:53 +00:00
|
|
|
|
void (*function) (void *);
|
2008-06-10 09:29:15 +00:00
|
|
|
|
void (*free_arg) (void *);
|
2003-01-18 Andrew Cagney <ac131313@redhat.com>
* ada-valprint.c: Eliminate PTR.
* breakpoint.c, corelow.c, cris-tdep.c, dbxread.c: Ditto.
* defs.h, dve3900-rom.c, dwarf2read.c, dwarfread.c: Ditto.
* exec.c, hppa-tdep.c, hpread.c, infcmd.c, mdebugread.c: Ditto.
* objfiles.c, objfiles.h, ocd.c, remote-es.c: Ditto.
* remote-mips.c, remote-sds.c, remote-vx.c: Ditto.
* solib-svr4.c, solib.c, stack.c, symfile.c, symfile.h: Ditto.
* symmisc.c, v850ice.c, xcoffread.c, cli/cli-script.c: Ditto.
2003-01-18 15:55:53 +00:00
|
|
|
|
void *arg;
|
1999-10-19 02:47:02 +00:00
|
|
|
|
};
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* The ability to declare that a function never returns is useful, but
|
|
|
|
|
not really required to compile GDB successfully, so the NORETURN and
|
|
|
|
|
ATTR_NORETURN macros normally expand into nothing. */
|
|
|
|
|
|
|
|
|
|
/* If compiling with older versions of GCC, a function may be declared
|
|
|
|
|
"volatile" to indicate that it does not return. */
|
|
|
|
|
|
|
|
|
|
#ifndef NORETURN
|
1999-10-19 02:47:02 +00:00
|
|
|
|
#if defined(__GNUC__) \
|
1999-04-16 01:35:26 +00:00
|
|
|
|
&& (__GNUC__ == 1 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7))
|
1999-10-19 02:47:02 +00:00
|
|
|
|
#define NORETURN volatile
|
|
|
|
|
#else
|
|
|
|
|
#define NORETURN /* nothing */
|
|
|
|
|
#endif
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* GCC 2.5 and later versions define a function attribute "noreturn",
|
|
|
|
|
which is the preferred way to declare that a function never returns.
|
|
|
|
|
However GCC 2.7 appears to be the first version in which this fully
|
|
|
|
|
works everywhere we use it. */
|
|
|
|
|
|
|
|
|
|
#ifndef ATTR_NORETURN
|
2000-05-01 05:45:36 +00:00
|
|
|
|
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
|
1999-10-19 02:47:02 +00:00
|
|
|
|
#define ATTR_NORETURN __attribute__ ((noreturn))
|
|
|
|
|
#else
|
|
|
|
|
#define ATTR_NORETURN /* nothing */
|
|
|
|
|
#endif
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef ATTR_FORMAT
|
2000-05-01 05:45:36 +00:00
|
|
|
|
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4))
|
1999-10-19 02:47:02 +00:00
|
|
|
|
#define ATTR_FORMAT(type, x, y) __attribute__ ((format(type, x, y)))
|
|
|
|
|
#else
|
|
|
|
|
#define ATTR_FORMAT(type, x, y) /* nothing */
|
|
|
|
|
#endif
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2003-08-20 17:39:18 +00:00
|
|
|
|
/* Be conservative and use enum bitfields only with GCC.
|
|
|
|
|
This is copied from gcc 3.3.1, system.h. */
|
|
|
|
|
|
|
|
|
|
#if defined(__GNUC__) && (__GNUC__ >= 2)
|
|
|
|
|
#define ENUM_BITFIELD(TYPE) enum TYPE
|
|
|
|
|
#else
|
|
|
|
|
#define ENUM_BITFIELD(TYPE) unsigned int
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
/* Needed for various prototypes */
|
|
|
|
|
|
|
|
|
|
struct symtab;
|
|
|
|
|
struct breakpoint;
|
2004-02-04 16:34:51 +00:00
|
|
|
|
struct frame_info;
|
2008-09-11 14:21:49 +00:00
|
|
|
|
struct gdbarch;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
/* From utils.c */
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void initialize_utils (void);
|
1999-05-25 18:09:09 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void notice_quit (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern int strcmp_iw (const char *, const char *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2003-02-24 23:37:02 +00:00
|
|
|
|
extern int strcmp_iw_ordered (const char *, const char *);
|
|
|
|
|
|
2003-02-04 18:07:01 +00:00
|
|
|
|
extern int streq (const char *, const char *);
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern int subset_compare (char *, char *);
|
1999-04-26 18:34:20 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern char *safe_strerror (int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2005-01-12 Andrew Cagney <cagney@gnu.org>
* exceptions.h (enum return_reason, RETURN_MASK)
(RETURN_MASK_QUIT, RETURN_MASK_ERROR, RETURN_MASK_ALL)
(return_mask, throw_exception, catch_exceptions_ftype)
(catch_exceptions_with_msg, catch_errors_ftype, catch_errors)
(catch_command_errors_ftype, catch_command_errors): Move to
exceptions.h.
* exceptions.c, exceptions.h: New files.
* top.c: Do not include <setjmp.h>.
(SIGJMP_BUF, SIGSETJMP, SIGLONGJMP, catch_return)
(throw_exception, catcher, catch_exceptions)
(catch_exceptions_with_msg, struct catch_errors_args)
(do_catch_errors, catch_errors, struct captured_command_args)
(do_captured_command, catch_command_errors): Move to exceptions.c.
* wrapper.c, wince.c, win32-nat.c, utils.c: Include "exceptions.h".
* tui/tui-interp.c, top.c, thread.c, symmisc.c: Ditto.
* symfile-mem.c, stack.c, solib.c, rs6000-nat.c: Ditto.
* remote-sds.c, remote-mips.c, remote-fileio.c: Ditto.
* remote-e7000.c, objc-lang.c, ocd.c: Ditto.
* remote.c, nto-procfs.c, monitor.c, mi/mi-main.c: Ditto.
* main.c, m32r-rom.c, infrun.c, inf-loop.c: Ditto.
* hppa-hpux-tdep.c, frame.c, event-top.c, event-loop.c: Ditto.
* corelow.c, corefile.c, cli/cli-interp.c, breakpoint.c: Ditto.
* ada-valprint.c, ada-lang.c: Ditto.
* Makefile.in (HFILES_NO_SRCDIR, COMMON_OBS): Add exceptions.h and
exceptions.o. Update all dependencies.
2005-01-12 18:31:35 +00:00
|
|
|
|
#define ALL_CLEANUPS ((struct cleanup *)0)
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void do_cleanups (struct cleanup *);
|
|
|
|
|
extern void do_final_cleanups (struct cleanup *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void discard_cleanups (struct cleanup *);
|
|
|
|
|
extern void discard_final_cleanups (struct cleanup *);
|
|
|
|
|
extern void discard_my_cleanups (struct cleanup **, struct cleanup *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-03-04 00:40:40 +00:00
|
|
|
|
/* NOTE: cagney/2000-03-04: This typedef is strictly for the
|
|
|
|
|
make_cleanup function declarations below. Do not use this typedef
|
|
|
|
|
as a cast when passing functions into the make_cleanup() code.
|
|
|
|
|
Instead either use a bounce function or add a wrapper function.
|
|
|
|
|
Calling a f(char*) function with f(void*) is non-portable. */
|
|
|
|
|
typedef void (make_cleanup_ftype) (void *);
|
|
|
|
|
|
|
|
|
|
extern struct cleanup *make_cleanup (make_cleanup_ftype *, void *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
Exited threads.
* thread.c (enum thread_state): New.
(thread_state main_thread_running): Delete, in favor of...
(thread_state main_thread_state): ... this. Update throughout.
(clear_thread_inferior_resources): New, split from free_thread.
(free_thread): Call clear_thread_inferior_resources.
(init_thread_list): Set main thread to stopped state.
(add_thread_silent): Take care of PTID reuses.
(delete_thread): If deleting inferior_ptid or a thread with
refcount > 0, mark it as exited, but still keep it in the list.
Only notify of thread exits, if we haven't done so yet.
(iterate_over_threads): Make it safe to delete threads while
iterating over them.
(do_captured_list_thread_ids): Don't account for exited threads.
(thread_alive): Check for the THREAD_EXITED state, and don't set
ptid to -1 on exited threads.
(set_running): Update to account for extra possible states.
(is_thread_state): New.
(is_stopped, is_exited): New.
(is_running): Implement in terms of is_thread_state.
(any_running): Update.
(print_thread_info): Update. Account for exited threads. Don't
warn about missed frame restoring here, its done in the cleanup.
(switch_to_thread): Don't read from a thread that has gone.
(restore_current_thread): In non-stop mode, do a full context
switch.
(restore_selected_frame): Add a frame_level argument. Rewrite.
(struct current_thread_cleanup): Add selected_frame_level and
was_stopped members.
(do_restore_current_thread_cleanup): Check if thread was stopped
and still is, and if the target has registers, stack and memory
before restoring the selected frame. Don't delete the cleanup
argument here.
(restore_current_thread_cleanup_dtor): New.
(make_cleanup_restore_current_thread): Remove all arguments.
Rewrite.
(thread_apply_all_command): Update. Prune threads.
(thread_apply_command): Update.
(thread_command): Account for currently selected exited thread.
(do_captured_thread_select): Check for a running thread. Prune
threads.
(_initialize_thread): Make "info threads", "thread", "thread
apply", and "thread apply all" appliable without a selected thread.
* gdbthread.h (struct thread_info): Replace running_ by state_.
Add refcount.
(is_exited, is_stopped): Declare.
(make_cleanup_restore_current_thread): Remove all arguments.
* infrun.c: Include "event-top.h".
(fetch_inferior_event): In non-stop mode, restore selected thread
and frame after handling the event and running breakpoint
commands. Display GDB prompt if needed.
(normal_stop): In non-stop mode, don't print thread switching
notice.
* cli/cli-decode.c (set_cmd_no_selected_thread_ok)
(get_cmd_no_selected_thread_ok): New.
* cli/cli-decode.h (CMD_NO_SELECTED_THREAD_OK): New.
(set_cmd_no_selected_thread_ok, get_cmd_no_selected_thread_ok):
Declare.
* cli/cli-cmds.c: Set "pwd", "help", "info", "show" as
no-selected-thread ok.
* top.c (execute_command): Check for non no-selected-thread-ok
commands.
* linux-nat.c (struct saved_ptids, threads_to_delete)
(record_dead_thread, prune_lwps): Delete.
(exit_lwp): Unconditionally delete thread.
(linux_nat_resume): Remove prune_lwps call.
* infcmd.c (proceed_thread_callback): Check if !is_stopped instead
of is_running. Adjust to make_cleanup_restore_current_thread
interface change.
* mi/mi-main.c (mi_cmd_execute): Only allow a few commands if the
selected thread has exited.
* inf-loop.c (inferior_event_handler): Don't display the prompt
here.
* varobj.c (c_value_of_root): Update.
* defs.h (make_cleanup_dtor): Declare.
* utils.c (make_cleanup_dtor): New.
* Makefile.in (infrun.o): Depend on $(event_top_h).
2008-07-11 11:07:39 +00:00
|
|
|
|
extern struct cleanup *make_cleanup_dtor (make_cleanup_ftype *, void *,
|
|
|
|
|
void (*dtor) (void *));
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern struct cleanup *make_cleanup_freeargv (char **);
|
1999-04-26 18:34:20 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
struct ui_file;
|
|
|
|
|
extern struct cleanup *make_cleanup_ui_file_delete (struct ui_file *);
|
1999-11-09 01:23:30 +00:00
|
|
|
|
|
2004-09-08 21:58:19 +00:00
|
|
|
|
struct section_addr_info;
|
|
|
|
|
extern struct cleanup *(make_cleanup_free_section_addr_info
|
|
|
|
|
(struct section_addr_info *));
|
|
|
|
|
|
2000-05-23 14:48:13 +00:00
|
|
|
|
extern struct cleanup *make_cleanup_close (int fd);
|
|
|
|
|
|
2008-10-28 15:22:13 +00:00
|
|
|
|
extern struct cleanup *make_cleanup_fclose (FILE *file);
|
|
|
|
|
|
2000-05-16 02:43:39 +00:00
|
|
|
|
extern struct cleanup *make_cleanup_bfd_close (bfd *abfd);
|
|
|
|
|
|
2009-03-19 17:39:31 +00:00
|
|
|
|
struct obstack;
|
|
|
|
|
extern struct cleanup *make_cleanup_obstack_free (struct obstack *obstack);
|
|
|
|
|
|
2008-06-10 09:29:15 +00:00
|
|
|
|
extern struct cleanup *make_cleanup_restore_integer (int *variable);
|
|
|
|
|
|
2000-03-04 00:40:40 +00:00
|
|
|
|
extern struct cleanup *make_final_cleanup (make_cleanup_ftype *, void *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern struct cleanup *make_my_cleanup (struct cleanup **,
|
2000-03-04 00:40:40 +00:00
|
|
|
|
make_cleanup_ftype *, void *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2008-06-10 09:29:15 +00:00
|
|
|
|
extern struct cleanup *make_my_cleanup2 (struct cleanup **,
|
|
|
|
|
make_cleanup_ftype *, void *,
|
|
|
|
|
void (*free_arg) (void *));
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern struct cleanup *save_cleanups (void);
|
|
|
|
|
extern struct cleanup *save_final_cleanups (void);
|
|
|
|
|
extern struct cleanup *save_my_cleanups (struct cleanup **);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void restore_cleanups (struct cleanup *);
|
|
|
|
|
extern void restore_final_cleanups (struct cleanup *);
|
|
|
|
|
extern void restore_my_cleanups (struct cleanup **, struct cleanup *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-04-21 04:10:18 +00:00
|
|
|
|
extern void free_current_contents (void *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-03-04 01:15:32 +00:00
|
|
|
|
extern void null_cleanup (void *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern int myread (int, char *, int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2002-02-26 03:29:55 +00:00
|
|
|
|
extern int query (const char *, ...) ATTR_FORMAT (printf, 1, 2);
|
2004-02-23 19:26:14 +00:00
|
|
|
|
extern int nquery (const char *, ...) ATTR_FORMAT (printf, 1, 2);
|
|
|
|
|
extern int yquery (const char *, ...) ATTR_FORMAT (printf, 1, 2);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void init_page_info (void);
|
1999-05-25 18:09:09 +00:00
|
|
|
|
|
2001-12-21 22:32:37 +00:00
|
|
|
|
extern char *gdb_realpath (const char *);
|
2002-04-05 16:39:36 +00:00
|
|
|
|
extern char *xfullpath (const char *);
|
2001-12-21 22:32:37 +00:00
|
|
|
|
|
gdb/ChangeLog:
2003-01-23 Alexander Larsson <alexl@redhat.com>
Jim Blandy <jimb@redhat.com>
Add support for executables whose debug info has been separated
out into a separate file, leaving only a link behind.
* objfiles.h (struct objfile): New fields: separate_debug_objfile
and separate_debug_objfile_backlink.
(put_objfile_before): New declaration.
* symfile.c: #include "filenames.h".
(symbol_file_add_with_addrs_or_offsets): If this objfile has its
debug info in a separate file, read that, too. Save the addrs
argument, so we can use it again to read the separated debug info;
syms_from_objfile modifies the table we pass it.
(reread_symbols): After re-reading an objfile, call
reread_separate_symbols to refresh its separate debug info
objfile, if it has one.
(reread_separate_symbols, find_separate_debug_file,
get_debug_link_info, separate_debug_file_exists): New functions.
(debug_file_directory): New global var.
(_initialize_symfile): Initialize debug_file_directory, and
provide the new `set debug-file-directory' command to let the user
change it.
* objfiles.c (free_objfile): If this objfile has its debug info in
a separate objfile, free that one too. If this is itself a
separate debug info objfile, clear our parent's backlink.
(put_objfile_before): New function.
* utils.c (gnu_debuglink_crc32): New function.
* defs.h (gnu_debuglink_crc32): New declaration.
* Makefile.in (symfile.o): Note dependency on "filenames.h".
* configure.in: Handle --with-separate-debug-dir config option.
* acinclude.m4 (AC_DEFINE_DIR): New macro.
* acconfig.h (DEBUGDIR): New macro.
* configure, aclocal.m4, config.in: Regenerated.
gdb/doc/ChangeLog:
2003-01-23 Jim Blandy <jimb@redhat.com>
* gdb.texinfo (Separate Debug Files): New section.
2003-01-23 23:03:32 +00:00
|
|
|
|
extern unsigned long gnu_debuglink_crc32 (unsigned long crc,
|
|
|
|
|
unsigned char *buf, size_t len);
|
|
|
|
|
|
2006-09-21 13:50:51 +00:00
|
|
|
|
ULONGEST strtoulst (const char *num, const char **trailer, int base);
|
|
|
|
|
|
2007-06-04 12:34:11 +00:00
|
|
|
|
char *ldirname (const char *filename);
|
|
|
|
|
|
2008-10-03 16:36:10 +00:00
|
|
|
|
char **gdb_buildargv (const char *);
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
/* From demangle.c */
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void set_demangling_style (char *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Annotation stuff. */
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern int annotation_level; /* in stack.c */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void begin_line (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void wrap_here (char *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void reinitialize_more_filter (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-06-14 18:08:47 +00:00
|
|
|
|
/* Normal results */
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern struct ui_file *gdb_stdout;
|
2003-06-10 14:37:04 +00:00
|
|
|
|
/* Input stream */
|
|
|
|
|
extern struct ui_file *gdb_stdin;
|
1999-06-14 18:08:47 +00:00
|
|
|
|
/* Serious error notifications */
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern struct ui_file *gdb_stderr;
|
1999-06-14 18:08:47 +00:00
|
|
|
|
/* Log/debug/trace messages that should bypass normal stdout/stderr
|
2004-02-02 16:07:26 +00:00
|
|
|
|
filtering. For moment, always call this stream using
|
1999-06-14 18:08:47 +00:00
|
|
|
|
*_unfiltered. In the very near future that restriction shall be
|
|
|
|
|
removed - either call shall be unfiltered. (cagney 1999-06-13). */
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern struct ui_file *gdb_stdlog;
|
1999-07-05 17:58:44 +00:00
|
|
|
|
/* Target output that should bypass normal stdout/stderr filtering.
|
2004-02-02 16:07:26 +00:00
|
|
|
|
For moment, always call this stream using *_unfiltered. In the
|
1999-07-05 17:58:44 +00:00
|
|
|
|
very near future that restriction shall be removed - either call
|
|
|
|
|
shall be unfiltered. (cagney 1999-07-02). */
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern struct ui_file *gdb_stdtarg;
|
2003-06-10 14:37:04 +00:00
|
|
|
|
extern struct ui_file *gdb_stdtargerr;
|
|
|
|
|
extern struct ui_file *gdb_stdtargin;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
#include "ui-file.h"
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2001-01-31 03:46:23 +00:00
|
|
|
|
/* More generic printf like operations. Filtered versions may return
|
|
|
|
|
non-locally on error. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void fputs_filtered (const char *, struct ui_file *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void fputs_unfiltered (const char *, struct ui_file *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern int fputc_filtered (int c, struct ui_file *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern int fputc_unfiltered (int c, struct ui_file *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2001-01-31 03:46:23 +00:00
|
|
|
|
extern int putchar_filtered (int c);
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern int putchar_unfiltered (int c);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void puts_filtered (const char *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void puts_unfiltered (const char *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2002-10-15 02:16:51 +00:00
|
|
|
|
extern void puts_filtered_tabular (char *string, int width, int right);
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void puts_debug (char *prefix, char *string, char *suffix);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void vprintf_filtered (const char *, va_list) ATTR_FORMAT (printf, 1, 0);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void vfprintf_filtered (struct ui_file *, const char *, va_list) ATTR_FORMAT (printf, 2, 0);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void fprintf_filtered (struct ui_file *, const char *, ...) ATTR_FORMAT (printf, 2, 3);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void fprintfi_filtered (int, struct ui_file *, const char *, ...) ATTR_FORMAT (printf, 3, 4);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void printf_filtered (const char *, ...) ATTR_FORMAT (printf, 1, 2);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void printfi_filtered (int, const char *, ...) ATTR_FORMAT (printf, 2, 3);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void vprintf_unfiltered (const char *, va_list) ATTR_FORMAT (printf, 1, 0);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void vfprintf_unfiltered (struct ui_file *, const char *, va_list) ATTR_FORMAT (printf, 2, 0);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void fprintf_unfiltered (struct ui_file *, const char *, ...) ATTR_FORMAT (printf, 2, 3);
|
1999-10-19 02:47:02 +00:00
|
|
|
|
|
|
|
|
|
extern void printf_unfiltered (const char *, ...) ATTR_FORMAT (printf, 1, 2);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void print_spaces (int, struct ui_file *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void print_spaces_filtered (int, struct ui_file *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern char *n_spaces (int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void fputstr_filtered (const char *str, int quotr, struct ui_file * stream);
|
1999-07-12 11:15:22 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void fputstr_unfiltered (const char *str, int quotr, struct ui_file * stream);
|
1999-07-12 11:15:22 +00:00
|
|
|
|
|
2006-07-12 18:50:18 +00:00
|
|
|
|
extern void fputstrn_filtered (const char *str, int n, int quotr, struct ui_file * stream);
|
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void fputstrn_unfiltered (const char *str, int n, int quotr, struct ui_file * stream);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-09-09 00:02:17 +00:00
|
|
|
|
/* Display the host ADDR on STREAM formatted as ``0x%x''. */
|
2003-04-10 02:18:40 +00:00
|
|
|
|
extern void gdb_print_host_address (const void *addr, struct ui_file *stream);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2008-05-24 16:32:01 +00:00
|
|
|
|
extern const char *host_address_to_string (const void *addr);
|
|
|
|
|
|
1999-08-31 01:14:27 +00:00
|
|
|
|
/* Convert a CORE_ADDR into a HEX string. paddr() is like %08lx.
|
2008-09-04 22:49:30 +00:00
|
|
|
|
paddr_nz() is like %lx. */
|
1999-09-09 00:02:17 +00:00
|
|
|
|
extern int strlen_paddr (void);
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern char *paddr (CORE_ADDR addr);
|
|
|
|
|
extern char *paddr_nz (CORE_ADDR addr);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2008-05-23 04:31:40 +00:00
|
|
|
|
/* Like 0x%lx. */
|
2005-02-14 Andrew Cagney <cagney@gnu.org>
* utils.c (paddress): New function.
* defs.h (paddress): Declare.
* printcmd.c (deprecated_print_address_numeric): Rename
print_address_numeric, call paddress.
* valprint.c, ui-out.c, tui/tui-stack.c, tracepoint.c: Update.
* symmisc.c, symfile.c stack.c, p-valprint.c, printcmd.c: Update.
* maint.c, m32r-rom.c, infcmd.c, f-valprint.c, exec.c: Update.
* dwarf2read.c, dve3900-rom.c, defs.h, c-valprint.c: Update.
* corefile.c, cli/cli-cmds.c, breakpoint.c, annotate.c: Update.
* ada-valprint.c: Update.
2005-02-14 14:37:38 +00:00
|
|
|
|
extern const char *paddress (CORE_ADDR addr);
|
|
|
|
|
|
2008-09-04 22:49:30 +00:00
|
|
|
|
/* %d for LONGEST */
|
|
|
|
|
extern char *plongest (LONGEST l);
|
|
|
|
|
/* %u for ULONGEST */
|
|
|
|
|
extern char *pulongest (ULONGEST l);
|
|
|
|
|
|
2000-05-22 02:07:19 +00:00
|
|
|
|
extern char *phex (ULONGEST l, int sizeof_l);
|
|
|
|
|
extern char *phex_nz (ULONGEST l, int sizeof_l);
|
2004-09-11 10:24:53 +00:00
|
|
|
|
extern char *int_string (LONGEST, int, int, int, int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2001-10-17 20:35:31 +00:00
|
|
|
|
/* Like paddr() only print/scan raw CORE_ADDR. The output from
|
|
|
|
|
core_addr_to_string() can be passed direct to
|
|
|
|
|
string_to_core_addr(). */
|
|
|
|
|
extern const char *core_addr_to_string (const CORE_ADDR addr);
|
2002-02-13 15:43:37 +00:00
|
|
|
|
extern const char *core_addr_to_string_nz (const CORE_ADDR addr);
|
2001-10-17 20:35:31 +00:00
|
|
|
|
extern CORE_ADDR string_to_core_addr (const char *my_string);
|
|
|
|
|
|
2004-09-11 15:04:16 +00:00
|
|
|
|
/* Return a string that contains a number formatted as a hex
|
|
|
|
|
string. */
|
|
|
|
|
extern char *hex_string (LONGEST);
|
|
|
|
|
extern char *hex_string_custom (LONGEST, int);
|
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void fprintf_symbol_filtered (struct ui_file *, char *,
|
1999-10-19 02:47:02 +00:00
|
|
|
|
enum language, int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2002-02-26 03:29:55 +00:00
|
|
|
|
extern NORETURN void perror_with_name (const char *) ATTR_NORETURN;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2002-02-26 03:29:55 +00:00
|
|
|
|
extern void print_sys_errmsg (const char *, int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
/* From regex.c or libc. BSD 4.4 declares this with the argument type as
|
|
|
|
|
"const char *" in unistd.h, so we can't declare the argument
|
|
|
|
|
as "char *". */
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern char *re_comp (const char *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
/* From symfile.c */
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void symbol_file_command (char *, int);
|
|
|
|
|
|
|
|
|
|
/* Remote targets may wish to use this as their load function. */
|
|
|
|
|
extern void generic_load (char *name, int from_tty);
|
|
|
|
|
|
2006-07-18 12:48:20 +00:00
|
|
|
|
/* Report on STREAM the performance of memory transfer operation,
|
|
|
|
|
such as 'load'.
|
|
|
|
|
DATA_COUNT is the number of bytes transferred.
|
|
|
|
|
WRITE_COUNT is the number of separate write operations, or 0,
|
|
|
|
|
if that information is not available.
|
|
|
|
|
START_TIME is the time at which an operation was started.
|
|
|
|
|
END_TIME is the time at which an operation ended. */
|
2005-08-02 03:02:05 +00:00
|
|
|
|
struct timeval;
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void print_transfer_performance (struct ui_file *stream,
|
1999-10-19 02:47:02 +00:00
|
|
|
|
unsigned long data_count,
|
|
|
|
|
unsigned long write_count,
|
2005-08-02 03:02:05 +00:00
|
|
|
|
const struct timeval *start_time,
|
|
|
|
|
const struct timeval *end_time);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
/* From top.c */
|
|
|
|
|
|
1999-09-28 21:55:21 +00:00
|
|
|
|
typedef void initialize_file_ftype (void);
|
|
|
|
|
|
2002-09-19 03:58:41 +00:00
|
|
|
|
extern char *skip_quoted (char *);
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern char *gdb_readline (char *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2002-07-24 17:58:46 +00:00
|
|
|
|
extern char *gdb_readline_wrapper (char *);
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern char *command_line_input (char *, int, char *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void print_prompt (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern int input_from_terminal_p (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
extern int info_verbose;
|
|
|
|
|
|
|
|
|
|
/* From printcmd.c */
|
|
|
|
|
|
2008-09-11 14:21:49 +00:00
|
|
|
|
extern void set_next_address (struct gdbarch *, CORE_ADDR);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void print_address_symbolic (CORE_ADDR, struct ui_file *, int,
|
1999-10-19 02:47:02 +00:00
|
|
|
|
char *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-05 07:30:26 +00:00
|
|
|
|
extern int build_address_symbolic (CORE_ADDR addr,
|
2000-03-13 07:30:00 +00:00
|
|
|
|
int do_demangle,
|
|
|
|
|
char **name,
|
|
|
|
|
int *offset,
|
|
|
|
|
char **filename,
|
|
|
|
|
int *line,
|
2000-02-05 07:30:26 +00:00
|
|
|
|
int *unmapped);
|
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern void print_address (CORE_ADDR, struct ui_file *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
/* From source.c */
|
|
|
|
|
|
2004-07-30 19:17:20 +00:00
|
|
|
|
#define OPF_TRY_CWD_FIRST 0x01
|
|
|
|
|
#define OPF_SEARCH_IN_PATH 0x02
|
|
|
|
|
|
2009-05-19 13:51:37 +00:00
|
|
|
|
extern int openp (const char *, int, const char *, int, char **);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2009-03-13 02:34:13 +00:00
|
|
|
|
extern int source_full_path_of (const char *, char **);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void mod_path (char *, char **);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2002-12-13 17:55:49 +00:00
|
|
|
|
extern void add_path (char *, char **, int);
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void directory_command (char *, int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2006-02-21 19:46:48 +00:00
|
|
|
|
extern void directory_switch (char *, int);
|
|
|
|
|
|
2002-12-13 17:55:49 +00:00
|
|
|
|
extern char *source_path;
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void init_source_path (void);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2002-12-13 17:55:49 +00:00
|
|
|
|
extern void init_last_source_visited (void);
|
|
|
|
|
|
1999-08-31 01:14:27 +00:00
|
|
|
|
/* From exec.c */
|
|
|
|
|
|
2002-01-09 00:37:02 +00:00
|
|
|
|
/* Take over the 'find_mapped_memory' vector from exec.c. */
|
|
|
|
|
extern void exec_set_find_memory_regions (int (*) (int (*) (CORE_ADDR,
|
|
|
|
|
unsigned long,
|
|
|
|
|
int, int, int,
|
|
|
|
|
void *),
|
|
|
|
|
void *));
|
|
|
|
|
|
1999-08-23 22:40:00 +00:00
|
|
|
|
/* Possible lvalue types. Like enum language, this should be in
|
|
|
|
|
value.h, but needs to be here for the same reason. */
|
|
|
|
|
|
|
|
|
|
enum lval_type
|
|
|
|
|
{
|
|
|
|
|
/* Not an lval. */
|
|
|
|
|
not_lval,
|
2004-11-13 02:29:48 +00:00
|
|
|
|
/* In memory. */
|
1999-08-23 22:40:00 +00:00
|
|
|
|
lval_memory,
|
2004-11-13 02:29:48 +00:00
|
|
|
|
/* In a register. Registers are relative to a frame. */
|
1999-08-23 22:40:00 +00:00
|
|
|
|
lval_register,
|
|
|
|
|
/* In a gdb internal variable. */
|
|
|
|
|
lval_internalvar,
|
|
|
|
|
/* Part of a gdb internal variable (structure field). */
|
2009-02-06 22:50:52 +00:00
|
|
|
|
lval_internalvar_component,
|
|
|
|
|
/* Value's bits are fetched and stored using functions provided by
|
|
|
|
|
its creator. */
|
|
|
|
|
lval_computed
|
1999-08-23 22:40:00 +00:00
|
|
|
|
};
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
/* Control types for commands */
|
|
|
|
|
|
|
|
|
|
enum misc_command_type
|
1999-10-19 02:47:02 +00:00
|
|
|
|
{
|
|
|
|
|
ok_command,
|
|
|
|
|
end_command,
|
|
|
|
|
else_command,
|
|
|
|
|
nop_command
|
|
|
|
|
};
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
enum command_control_type
|
1999-10-19 02:47:02 +00:00
|
|
|
|
{
|
|
|
|
|
simple_control,
|
|
|
|
|
break_control,
|
|
|
|
|
continue_control,
|
|
|
|
|
while_control,
|
|
|
|
|
if_control,
|
2007-01-27 12:30:46 +00:00
|
|
|
|
commands_control,
|
2008-08-06 19:41:33 +00:00
|
|
|
|
python_control,
|
1999-10-19 02:47:02 +00:00
|
|
|
|
invalid_control
|
|
|
|
|
};
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
/* Structure for saved commands lines
|
|
|
|
|
(for breakpoints, defined commands, etc). */
|
|
|
|
|
|
|
|
|
|
struct command_line
|
1999-10-19 02:47:02 +00:00
|
|
|
|
{
|
|
|
|
|
struct command_line *next;
|
|
|
|
|
char *line;
|
|
|
|
|
enum command_control_type control_type;
|
|
|
|
|
int body_count;
|
|
|
|
|
struct command_line **body_list;
|
|
|
|
|
};
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2008-08-16 20:36:30 +00:00
|
|
|
|
extern struct command_line *read_command_lines (char *, int, int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void free_command_lines (struct command_line **);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-03-13 07:30:00 +00:00
|
|
|
|
/* To continue the execution commands when running gdb asynchronously.
|
|
|
|
|
A continuation structure contains a pointer to a function to be called
|
1999-07-05 17:58:44 +00:00
|
|
|
|
to finish the command, once the target has stopped. Such mechanism is
|
2008-01-11 00:12:43 +00:00
|
|
|
|
used by the finish and until commands, and in the remote protocol
|
1999-07-05 17:58:44 +00:00
|
|
|
|
when opening an extended-remote connection. */
|
|
|
|
|
|
2008-07-12 19:25:42 +00:00
|
|
|
|
struct continuation;
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 21:57:42 +00:00
|
|
|
|
struct thread_info;
|
2008-11-05 20:23:07 +00:00
|
|
|
|
struct inferior;
|
1999-07-05 17:58:44 +00:00
|
|
|
|
|
|
|
|
|
/* From utils.c */
|
2008-11-05 20:23:07 +00:00
|
|
|
|
|
|
|
|
|
/* Thread specific continuations. */
|
|
|
|
|
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 21:57:42 +00:00
|
|
|
|
extern void add_continuation (struct thread_info *,
|
|
|
|
|
void (*)(void *), void *,
|
2008-07-12 19:25:42 +00:00
|
|
|
|
void (*)(void *));
|
|
|
|
|
extern void do_all_continuations (void);
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 21:57:42 +00:00
|
|
|
|
extern void do_all_continuations_thread (struct thread_info *);
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void discard_all_continuations (void);
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 21:57:42 +00:00
|
|
|
|
extern void discard_all_continuations_thread (struct thread_info *);
|
1999-07-05 17:58:44 +00:00
|
|
|
|
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 21:57:42 +00:00
|
|
|
|
extern void add_intermediate_continuation (struct thread_info *,
|
|
|
|
|
void (*)(void *), void *,
|
2008-07-12 19:25:42 +00:00
|
|
|
|
void (*)(void *));
|
|
|
|
|
extern void do_all_intermediate_continuations (void);
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 21:57:42 +00:00
|
|
|
|
extern void do_all_intermediate_continuations_thread (struct thread_info *);
|
1999-12-07 03:56:43 +00:00
|
|
|
|
extern void discard_all_intermediate_continuations (void);
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 21:57:42 +00:00
|
|
|
|
extern void discard_all_intermediate_continuations_thread (struct thread_info *);
|
1999-12-07 03:56:43 +00:00
|
|
|
|
|
2008-11-05 20:23:07 +00:00
|
|
|
|
/* Inferior specific (any thread) continuations. */
|
|
|
|
|
|
|
|
|
|
extern void add_inferior_continuation (void (*) (void *),
|
|
|
|
|
void *,
|
|
|
|
|
void (*) (void *));
|
|
|
|
|
extern void do_all_inferior_continuations (void);
|
|
|
|
|
extern void discard_all_inferior_continuations (struct inferior *inf);
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
/* String containing the current directory (what getwd would return). */
|
|
|
|
|
|
|
|
|
|
extern char *current_directory;
|
|
|
|
|
|
|
|
|
|
/* Default radixes for input and output. Only some values supported. */
|
|
|
|
|
extern unsigned input_radix;
|
|
|
|
|
extern unsigned output_radix;
|
|
|
|
|
|
|
|
|
|
/* Possibilities for prettyprint parameters to routines which print
|
|
|
|
|
things. Like enum language, this should be in value.h, but needs
|
|
|
|
|
to be here for the same reason. FIXME: If we can eliminate this
|
|
|
|
|
as an arg to LA_VAL_PRINT, then we can probably move it back to
|
|
|
|
|
value.h. */
|
|
|
|
|
|
|
|
|
|
enum val_prettyprint
|
1999-10-19 02:47:02 +00:00
|
|
|
|
{
|
|
|
|
|
Val_no_prettyprint = 0,
|
|
|
|
|
Val_prettyprint,
|
|
|
|
|
/* Use the default setting which the user has specified. */
|
|
|
|
|
Val_pretty_default
|
|
|
|
|
};
|
2001-05-04 04:15:33 +00:00
|
|
|
|
|
2001-05-15 00:03:38 +00:00
|
|
|
|
/* The ptid struct is a collection of the various "ids" necessary
|
|
|
|
|
for identifying the inferior. This consists of the process id
|
|
|
|
|
(pid), thread id (tid), and other fields necessary for uniquely
|
|
|
|
|
identifying the inferior process/thread being debugged. When
|
|
|
|
|
manipulating ptids, the constructors, accessors, and predicate
|
|
|
|
|
declared in inferior.h should be used. These are as follows:
|
|
|
|
|
|
|
|
|
|
ptid_build - Make a new ptid from a pid, lwp, and tid.
|
|
|
|
|
pid_to_ptid - Make a new ptid from just a pid.
|
|
|
|
|
ptid_get_pid - Fetch the pid component of a ptid.
|
|
|
|
|
ptid_get_lwp - Fetch the lwp component of a ptid.
|
|
|
|
|
ptid_get_tid - Fetch the tid component of a ptid.
|
|
|
|
|
ptid_equal - Test to see if two ptids are equal.
|
2008-10-23 23:11:21 +00:00
|
|
|
|
ptid_is_pid - Test to see if this ptid represents a process id.
|
2001-05-15 00:03:38 +00:00
|
|
|
|
|
|
|
|
|
Please do NOT access the struct ptid members directly (except, of
|
|
|
|
|
course, in the implementation of the above ptid manipulation
|
|
|
|
|
functions). */
|
|
|
|
|
|
|
|
|
|
struct ptid
|
|
|
|
|
{
|
|
|
|
|
/* Process id */
|
|
|
|
|
int pid;
|
2001-05-04 04:15:33 +00:00
|
|
|
|
|
2001-05-15 00:03:38 +00:00
|
|
|
|
/* Lightweight process id */
|
|
|
|
|
long lwp;
|
2001-05-04 04:15:33 +00:00
|
|
|
|
|
2001-05-15 00:03:38 +00:00
|
|
|
|
/* Thread id */
|
|
|
|
|
long tid;
|
|
|
|
|
};
|
2001-05-04 04:15:33 +00:00
|
|
|
|
|
2001-05-15 00:03:38 +00:00
|
|
|
|
typedef struct ptid ptid_t;
|
2001-05-04 04:15:33 +00:00
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
|
Thu Jul 27 17:38:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
* configure.in (targetfile): Ignore TM_FILE, don't just issue
warning.
(tm_h, xm_h, nm_h, GDB_TM_FILE, GDB_XM_FILE, GDB_NM_FILE): Define.
* acconfig.h (GDB_XM_FILE, GDB_TM_FILE, GDB_NM_FILE): Add.
* config/nm-empty.h: Delete.
* defs.h (xm.h, nm.h, tm.h): Only include when GDB_XM_FILE,
GDB_NM_FILE or GDB_TM_FILE defined.
* Makefile.in (defs_h): Replace tm.h, xm.h and nm.h with tm_h,
xm_h and nm_h macro that are defined by configure.
(tm_h, xm_h, tm_h): New.
* configure, config.in: Regenerate
* TODO: Update.
2000-08-02 11:11:47 +00:00
|
|
|
|
/* Optional native machine support. Non-native (and possibly pure
|
|
|
|
|
multi-arch) targets do not need a "nm.h" file. This will be a
|
|
|
|
|
symlink to one of the nm-*.h files, built by the `configure'
|
|
|
|
|
script. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
Thu Jul 27 17:38:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
* configure.in (targetfile): Ignore TM_FILE, don't just issue
warning.
(tm_h, xm_h, nm_h, GDB_TM_FILE, GDB_XM_FILE, GDB_NM_FILE): Define.
* acconfig.h (GDB_XM_FILE, GDB_TM_FILE, GDB_NM_FILE): Add.
* config/nm-empty.h: Delete.
* defs.h (xm.h, nm.h, tm.h): Only include when GDB_XM_FILE,
GDB_NM_FILE or GDB_TM_FILE defined.
* Makefile.in (defs_h): Replace tm.h, xm.h and nm.h with tm_h,
xm_h and nm_h macro that are defined by configure.
(tm_h, xm_h, tm_h): New.
* configure, config.in: Regenerate
* TODO: Update.
2000-08-02 11:11:47 +00:00
|
|
|
|
#ifdef GDB_NM_FILE
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#include "nm.h"
|
Thu Jul 27 17:38:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
* configure.in (targetfile): Ignore TM_FILE, don't just issue
warning.
(tm_h, xm_h, nm_h, GDB_TM_FILE, GDB_XM_FILE, GDB_NM_FILE): Define.
* acconfig.h (GDB_XM_FILE, GDB_TM_FILE, GDB_NM_FILE): Add.
* config/nm-empty.h: Delete.
* defs.h (xm.h, nm.h, tm.h): Only include when GDB_XM_FILE,
GDB_NM_FILE or GDB_TM_FILE defined.
* Makefile.in (defs_h): Replace tm.h, xm.h and nm.h with tm_h,
xm_h and nm_h macro that are defined by configure.
(tm_h, xm_h, tm_h): New.
* configure, config.in: Regenerate
* TODO: Update.
2000-08-02 11:11:47 +00:00
|
|
|
|
#endif
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2004-10-12 10:06:14 +00:00
|
|
|
|
/* Assume that fopen accepts the letter "b" in the mode string.
|
2004-11-13 15:28:50 +00:00
|
|
|
|
It is demanded by ISO C9X, and should be supported on all
|
|
|
|
|
platforms that claim to have a standard-conforming C library. On
|
2004-10-12 10:06:14 +00:00
|
|
|
|
true POSIX systems it will be ignored and have no effect. There
|
2004-11-13 15:28:50 +00:00
|
|
|
|
may still be systems without a standard-conforming C library where
|
|
|
|
|
an ISO C9X compiler (GCC) is available. Known examples are SunOS
|
2004-10-12 10:06:14 +00:00
|
|
|
|
4.x and 4.3BSD. This assumption means these systems are no longer
|
|
|
|
|
supported. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#ifndef FOPEN_RB
|
2004-10-12 10:06:14 +00:00
|
|
|
|
# include "fopen-bin.h"
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Defaults for system-wide constants (if not defined by xm.h, we fake it).
|
|
|
|
|
FIXME: Assumes 2's complement arithmetic */
|
|
|
|
|
|
|
|
|
|
#if !defined (UINT_MAX)
|
1999-10-19 02:47:02 +00:00
|
|
|
|
#define UINT_MAX ((unsigned int)(~0)) /* 0xFFFFFFFF for 32-bits */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if !defined (INT_MAX)
|
1999-10-19 02:47:02 +00:00
|
|
|
|
#define INT_MAX ((int)(UINT_MAX >> 1)) /* 0x7FFFFFFF for 32-bits */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if !defined (INT_MIN)
|
|
|
|
|
#define INT_MIN ((int)((int) ~0 ^ INT_MAX)) /* 0x80000000 for 32-bits */
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if !defined (ULONG_MAX)
|
|
|
|
|
#define ULONG_MAX ((unsigned long)(~0L)) /* 0xFFFFFFFF for 32-bits */
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if !defined (LONG_MAX)
|
|
|
|
|
#define LONG_MAX ((long)(ULONG_MAX >> 1)) /* 0x7FFFFFFF for 32-bits */
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-11-17 02:31:06 +00:00
|
|
|
|
#if !defined (ULONGEST_MAX)
|
2000-09-01 23:47:52 +00:00
|
|
|
|
#define ULONGEST_MAX (~(ULONGEST)0) /* 0xFFFFFFFFFFFFFFFF for 64-bits */
|
1999-11-17 02:31:06 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2000-09-01 23:47:52 +00:00
|
|
|
|
#if !defined (LONGEST_MAX) /* 0x7FFFFFFFFFFFFFFF for 64-bits */
|
1999-11-17 02:31:06 +00:00
|
|
|
|
#define LONGEST_MAX ((LONGEST)(ULONGEST_MAX >> 1))
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
/* Convert a LONGEST to an int. This is used in contexts (e.g. number of
|
|
|
|
|
arguments to a function, number in a value history, register number, etc.)
|
|
|
|
|
where the value must not be larger than can fit in an int. */
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern int longest_to_int (LONGEST);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-03-13 07:30:00 +00:00
|
|
|
|
/* Assorted functions we can declare, now that const and volatile are
|
1999-04-16 01:35:26 +00:00
|
|
|
|
defined. */
|
|
|
|
|
|
2001-03-07 02:57:08 +00:00
|
|
|
|
extern char *savestring (const char *, size_t);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
* defs.h (xfree, mcalloc, mmalloc, mrealloc, mfree, xmmalloc,
xmrealloc): Move existing declarations to the one place and
re-order to be consistent.
(xmcalloc, xmfree): Declare.
(xmmalloc, xmrealoc): Assume ISO-C - use size_t and void* in
declaration.
* utils.c (size_t): Delete #ifdef defining size_t.
(mmalloc, mrealloc, mcalloc, mfree): Re-order.
(mmalloc, mrealloc, mcalloc): Document as only calls in GDB
corresponding malloc, realloc, calloc.
(mfree): Call free directly.
(xmmalloc, xmrealloc): Clean up. Assume ISO-C.
(xmcalloc, xmfree): New functions. Copy old xcalloc and xfree
function bodies to here.
(xcalloc, xfree): Call xmcalloc and xmfree respectfully.
2001-03-23 23:39:57 +00:00
|
|
|
|
/* xmalloc(), xrealloc() and xcalloc() have already been declared in
|
|
|
|
|
"libiberty.h". */
|
|
|
|
|
extern void xfree (void *);
|
|
|
|
|
|
2005-02-06 16:22:14 +00:00
|
|
|
|
/* Like xmalloc, but zero the memory. */
|
|
|
|
|
extern void *xzalloc (size_t);
|
|
|
|
|
|
2003-10-31 19:19:51 +00:00
|
|
|
|
/* Utility macros to allocate typed memory. Avoids errors like:
|
|
|
|
|
struct foo *foo = xmalloc (sizeof struct bar); and memset (foo,
|
|
|
|
|
sizeof (struct foo), 0). */
|
2005-02-06 16:22:14 +00:00
|
|
|
|
#define XZALLOC(TYPE) ((TYPE*) xzalloc (sizeof (TYPE)))
|
2002-03-19 02:51:09 +00:00
|
|
|
|
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
|
* regcache.h: Update copyright.
(struct regcache, struct gdbarch): Add opaque declarations.
(current_regcache): Declare global variable.
(regcache_read, regcache_write): Add gdbarch parameter.
(regcache_save, regcache_save_no_passthrough)
(regcache_restore, regcache_restore_no_passthrough)
(regcache_dup, regcache_dup_no_passthrough)
(regcache_cpy, regcache_cpy_no_passthrough)
(deprecated_grub_regcache_for_registers)
(deprecated_grub_regcache_for_register_valid)
(regcache_valid_p): Add function declarations.
* regcache.c: Update copyright.
(regcache_descr_handle): New global variable.
(struct regcache_descr): Define.
(init_legacy_regcache_descr, init_regcache_descr): New functions.
(regcache_descr, xfree_regcache_descr): New functions.
(struct regcache): Define.
(regcache_xmalloc, regcache_xfree): New functions.
(regcache_cpy, regcache_cpy_no_passthrough): New functions.
(regcache_dup, regcache_dup_no_passthrough): New functions.
(regcache_valid_p, regcache_read_as_address): New functions.
(deprecated_grub_regcache_for_registers): New function.
(deprecated_grub_regcache_for_register_valid): New function.
(current_regcache): New global variable.
(register_buffer): Add regcache parameter. Update calls.
(regcache_read, regcache_write): Add regcache parameter. Rewrite.
(read_register_gen, write_register_gen): Update register_buffer
call. Test for legacy_p instead of gdbarch_register_read_p or
gdbarch_register_write_p.
(regcache_collect): Update register_buffer call.
(build_regcache): Rewrite. Use deprecated grub functions.
(regcache_save, regcache_save_no_passthrough): New functions.
(regcache_restore, regcache_restore_no_passthrough): New
functions.
(_initialize_regcache): Create the regcache_data_handle. Swap
current_regcache global variable.
* sh-tdep.c (sh_pseudo_register_read): Add current_regcache
parameter to regcache_read and regcache_write calls.
(sh4_register_read): Ditto.
(sh64_pseudo_register_read): Ditto.
(sh64_register_read): Ditto.
(sh_pseudo_register_write): Ditto.
(sh4_register_write): Ditto.
(sh64_pseudo_register_write): Ditto.
(sh64_register_write): Ditto.
* defs.h (XCALLOC): Define.
2002-06-20 03:13:51 +00:00
|
|
|
|
#define XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE)))
|
2002-03-19 02:51:09 +00:00
|
|
|
|
|
2000-11-20 02:06:19 +00:00
|
|
|
|
/* Like asprintf/vasprintf but get an internal_error if the call
|
|
|
|
|
fails. */
|
|
|
|
|
extern void xasprintf (char **ret, const char *format, ...) ATTR_FORMAT (printf, 2, 3);
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 20:56:26 +00:00
|
|
|
|
extern void xvasprintf (char **ret, const char *format, va_list ap)
|
|
|
|
|
ATTR_FORMAT (printf, 2, 0);
|
2000-11-20 02:06:19 +00:00
|
|
|
|
|
2004-06-29 14:57:39 +00:00
|
|
|
|
/* Like asprintf and vasprintf, but return the string, throw an error
|
|
|
|
|
if no memory. */
|
2003-08-09 14:57:30 +00:00
|
|
|
|
extern char *xstrprintf (const char *format, ...) ATTR_FORMAT (printf, 1, 2);
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 20:56:26 +00:00
|
|
|
|
extern char *xstrvprintf (const char *format, va_list ap)
|
|
|
|
|
ATTR_FORMAT (printf, 1, 0);
|
2003-08-09 14:57:30 +00:00
|
|
|
|
|
2005-03-17 22:11:09 +00:00
|
|
|
|
/* Like snprintf, but throw an error if the output buffer is too small. */
|
|
|
|
|
extern int xsnprintf (char *str, size_t size, const char *format, ...)
|
|
|
|
|
ATTR_FORMAT (printf, 3, 4);
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern int parse_escape (char **);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
/* Message to be printed before the error message, when an error occurs. */
|
|
|
|
|
|
|
|
|
|
extern char *error_pre_print;
|
|
|
|
|
|
|
|
|
|
/* Message to be printed before the error message, when an error occurs. */
|
|
|
|
|
|
|
|
|
|
extern char *quit_pre_print;
|
|
|
|
|
|
|
|
|
|
/* Message to be printed before the warning message, when a warning occurs. */
|
|
|
|
|
|
|
|
|
|
extern char *warning_pre_print;
|
|
|
|
|
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 20:56:26 +00:00
|
|
|
|
extern NORETURN void verror (const char *fmt, va_list ap)
|
|
|
|
|
ATTR_NORETURN ATTR_FORMAT (printf, 1, 0);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2002-03-23 17:38:13 +00:00
|
|
|
|
extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2000-02-02 00:21:19 +00:00
|
|
|
|
extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN;
|
1999-10-05 23:13:56 +00:00
|
|
|
|
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 20:56:26 +00:00
|
|
|
|
extern NORETURN void vfatal (const char *fmt, va_list ap)
|
|
|
|
|
ATTR_NORETURN ATTR_FORMAT (printf, 1, 0);
|
2004-11-05 20:32:04 +00:00
|
|
|
|
|
|
|
|
|
extern NORETURN void fatal (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
|
|
|
|
|
|
2001-02-08 06:03:54 +00:00
|
|
|
|
extern NORETURN void internal_verror (const char *file, int line,
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 20:56:26 +00:00
|
|
|
|
const char *, va_list ap)
|
|
|
|
|
ATTR_NORETURN ATTR_FORMAT (printf, 3, 0);
|
1999-11-17 02:31:06 +00:00
|
|
|
|
|
2001-02-08 06:03:54 +00:00
|
|
|
|
extern NORETURN void internal_error (const char *file, int line,
|
|
|
|
|
const char *, ...) ATTR_NORETURN ATTR_FORMAT (printf, 3, 4);
|
1999-11-17 02:31:06 +00:00
|
|
|
|
|
2002-09-18 23:53:52 +00:00
|
|
|
|
extern void internal_vwarning (const char *file, int line,
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 20:56:26 +00:00
|
|
|
|
const char *, va_list ap)
|
|
|
|
|
ATTR_FORMAT (printf, 3, 0);
|
2002-09-18 23:53:52 +00:00
|
|
|
|
|
|
|
|
|
extern void internal_warning (const char *file, int line,
|
|
|
|
|
const char *, ...) ATTR_FORMAT (printf, 3, 4);
|
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern NORETURN void nomem (long) ATTR_NORETURN;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void warning (const char *, ...) ATTR_FORMAT (printf, 1, 2);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 20:56:26 +00:00
|
|
|
|
extern void vwarning (const char *, va_list args) ATTR_FORMAT (printf, 1, 0);
|
2002-01-31 04:10:51 +00:00
|
|
|
|
|
2003-01-04 23:38:46 +00:00
|
|
|
|
/* List of known OS ABIs. If you change this, make sure to update the
|
|
|
|
|
table in osabi.c. */
|
|
|
|
|
enum gdb_osabi
|
|
|
|
|
{
|
|
|
|
|
GDB_OSABI_UNINITIALIZED = -1, /* For struct gdbarch_info. */
|
|
|
|
|
|
|
|
|
|
GDB_OSABI_UNKNOWN = 0, /* keep this zero */
|
|
|
|
|
|
|
|
|
|
GDB_OSABI_SVR4,
|
|
|
|
|
GDB_OSABI_HURD,
|
|
|
|
|
GDB_OSABI_SOLARIS,
|
|
|
|
|
GDB_OSABI_OSF1,
|
|
|
|
|
GDB_OSABI_LINUX,
|
|
|
|
|
GDB_OSABI_FREEBSD_AOUT,
|
|
|
|
|
GDB_OSABI_FREEBSD_ELF,
|
|
|
|
|
GDB_OSABI_NETBSD_AOUT,
|
|
|
|
|
GDB_OSABI_NETBSD_ELF,
|
2004-01-17 00:13:46 +00:00
|
|
|
|
GDB_OSABI_OPENBSD_ELF,
|
2003-01-04 23:38:46 +00:00
|
|
|
|
GDB_OSABI_WINCE,
|
|
|
|
|
GDB_OSABI_GO32,
|
|
|
|
|
GDB_OSABI_IRIX,
|
|
|
|
|
GDB_OSABI_INTERIX,
|
|
|
|
|
GDB_OSABI_HPUX_ELF,
|
|
|
|
|
GDB_OSABI_HPUX_SOM,
|
|
|
|
|
|
2003-02-26 15:13:07 +00:00
|
|
|
|
GDB_OSABI_QNXNTO,
|
2003-01-04 23:38:46 +00:00
|
|
|
|
|
2003-03-21 10:07:18 +00:00
|
|
|
|
GDB_OSABI_CYGWIN,
|
2006-02-10 20:56:15 +00:00
|
|
|
|
GDB_OSABI_AIX,
|
2008-05-01 23:09:14 +00:00
|
|
|
|
GDB_OSABI_DICOS,
|
2008-11-27 09:23:01 +00:00
|
|
|
|
GDB_OSABI_DARWIN,
|
2003-03-21 10:07:18 +00:00
|
|
|
|
|
2003-01-04 23:38:46 +00:00
|
|
|
|
GDB_OSABI_INVALID /* keep this last */
|
|
|
|
|
};
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
/* Global functions from other, non-gdb GNU thingies.
|
|
|
|
|
Libiberty thingies are no longer declared here. We include libiberty.h
|
|
|
|
|
above, instead. */
|
|
|
|
|
|
|
|
|
|
/* From other system libraries */
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_STDDEF_H
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_STDLIB_H
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef min
|
|
|
|
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef max
|
|
|
|
|
#define max(a, b) ((a) > (b) ? (a) : (b))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef atof
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern double atof (const char *); /* X3.159-1989 4.10.1.1 */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Various possibilities for alloca. */
|
|
|
|
|
#ifndef alloca
|
1999-10-19 02:47:02 +00:00
|
|
|
|
#ifdef __GNUC__
|
|
|
|
|
#define alloca __builtin_alloca
|
|
|
|
|
#else /* Not GNU C */
|
|
|
|
|
#ifdef HAVE_ALLOCA_H
|
|
|
|
|
#include <alloca.h>
|
|
|
|
|
#else
|
|
|
|
|
#ifdef _AIX
|
|
|
|
|
#pragma alloca
|
|
|
|
|
#else
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
/* We need to be careful not to declare this in a way which conflicts with
|
|
|
|
|
bison. Bison never declares it as char *, but under various circumstances
|
|
|
|
|
(like __hpux) we need to use void *. */
|
1999-10-19 02:47:02 +00:00
|
|
|
|
extern void *alloca ();
|
|
|
|
|
#endif /* Not _AIX */
|
|
|
|
|
#endif /* Not HAVE_ALLOCA_H */
|
|
|
|
|
#endif /* Not GNU C */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#endif /* alloca not defined */
|
|
|
|
|
|
|
|
|
|
/* Dynamic target-system-dependent parameters for GDB. */
|
|
|
|
|
#include "gdbarch.h"
|
|
|
|
|
|
2003-05-08 18:46:49 +00:00
|
|
|
|
/* Maximum size of a register. Something small, but large enough for
|
|
|
|
|
all known ISAs. If it turns out to be too small, make it bigger. */
|
|
|
|
|
|
|
|
|
|
enum { MAX_REGISTER_SIZE = 16 };
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
/* 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
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
/* In findvar.c. */
|
|
|
|
|
|
2005-05-19 Andrew Cagney <cagney@gnu.org>
* defs.h (extract_signed_integer, extract_unsigned_integer)
(extract_long_unsigned_integer, extract_typed_address)
(store_signed_integer, store_unsigned_integer)
(store_typed_address): Use gdb_byte for byte buffer parameters.
(push_bytes, push_word): Delete declaration.
* valops.c (push_bytes, push_word): Delete function.
* findvar.c (extract_signed_integer, extract_unsigned_integer)
(extract_typed_address, store_signed_integer)
(store_unsigned_integer): Update.
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.185
diff -p -u -r1.185 defs.h
--- defs.h 9 May 2005 17:20:18 -0000 1.185
+++ defs.h 19 May 2005 17:54:12 -0000
@@ -1042,27 +1042,25 @@ enum { MAX_REGISTER_SIZE = 16 };
/* In findvar.c. */
-extern LONGEST extract_signed_integer (const void *, int);
+extern LONGEST extract_signed_integer (const gdb_byte *, int);
-extern ULONGEST extract_unsigned_integer (const void *, int);
+extern ULONGEST extract_unsigned_integer (const gdb_byte *, int);
-extern int extract_long_unsigned_integer (const void *, int, LONGEST *);
+extern int extract_long_unsigned_integer (const gdb_byte *, int, LONGEST *);
-extern CORE_ADDR extract_typed_address (const void *buf, struct type *type);
+extern CORE_ADDR extract_typed_address (const gdb_byte *buf,
+ struct type *type);
-extern void store_signed_integer (void *, int, LONGEST);
+extern void store_signed_integer (gdb_byte *, int, LONGEST);
-extern void store_unsigned_integer (void *, int, ULONGEST);
+extern void store_unsigned_integer (gdb_byte *, int, ULONGEST);
-extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr);
+extern void store_typed_address (gdb_byte *buf, struct type *type,
+ CORE_ADDR addr);
/* From valops.c */
-extern CORE_ADDR push_bytes (CORE_ADDR, char *, int);
-
-extern CORE_ADDR push_word (CORE_ADDR, ULONGEST);
-
extern int watchdog;
/* Hooks for alternate command interfaces. */
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.91
diff -p -u -r1.91 findvar.c
--- findvar.c 14 May 2005 06:07:41 -0000 1.91
+++ findvar.c 19 May 2005 17:54:12 -0000
@@ -49,7 +49,7 @@ you lose
#endif
LONGEST
-extract_signed_integer (const void *addr, int len)
+extract_signed_integer (const gdb_byte *addr, int len)
{
LONGEST retval;
const unsigned char *p;
@@ -83,7 +83,7 @@ That operation is not available on integ
}
ULONGEST
-extract_unsigned_integer (const void *addr, int len)
+extract_unsigned_integer (const gdb_byte *addr, int len)
{
ULONGEST retval;
const unsigned char *p;
@@ -117,16 +117,18 @@ That operation is not available on integ
function returns 1 and sets *PVAL. Otherwise it returns 0. */
int
-extract_long_unsigned_integer (const void *addr, int orig_len, LONGEST *pval)
+extract_long_unsigned_integer (const gdb_byte *addr, int orig_len,
+ LONGEST *pval)
{
- char *p, *first_addr;
+ const gdb_byte *p;
+ const gdb_byte *first_addr;
int len;
len = orig_len;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
- for (p = (char *) addr;
- len > (int) sizeof (LONGEST) && p < (char *) addr + orig_len;
+ for (p = addr;
+ len > (int) sizeof (LONGEST) && p < addr + orig_len;
p++)
{
if (*p == 0)
@@ -138,9 +140,9 @@ extract_long_unsigned_integer (const voi
}
else
{
- first_addr = (char *) addr;
- for (p = (char *) addr + orig_len - 1;
- len > (int) sizeof (LONGEST) && p >= (char *) addr;
+ first_addr = addr;
+ for (p = addr + orig_len - 1;
+ len > (int) sizeof (LONGEST) && p >= addr;
p--)
{
if (*p == 0)
@@ -164,7 +166,7 @@ extract_long_unsigned_integer (const voi
/* Treat the bytes at BUF as a pointer of type TYPE, and return the
address it represents. */
CORE_ADDR
-extract_typed_address (const void *buf, struct type *type)
+extract_typed_address (const gdb_byte *buf, struct type *type)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
@@ -177,11 +179,11 @@ extract_typed_address (const void *buf,
void
-store_signed_integer (void *addr, int len, LONGEST val)
+store_signed_integer (gdb_byte *addr, int len, LONGEST val)
{
- unsigned char *p;
- unsigned char *startaddr = (unsigned char *) addr;
- unsigned char *endaddr = startaddr + len;
+ gdb_byte *p;
+ gdb_byte *startaddr = addr;
+ gdb_byte *endaddr = startaddr + len;
/* Start at the least significant end of the integer, and work towards
the most significant. */
@@ -204,7 +206,7 @@ store_signed_integer (void *addr, int le
}
void
-store_unsigned_integer (void *addr, int len, ULONGEST val)
+store_unsigned_integer (gdb_byte *addr, int len, ULONGEST val)
{
unsigned char *p;
unsigned char *startaddr = (unsigned char *) addr;
@@ -233,7 +235,7 @@ store_unsigned_integer (void *addr, int
/* Store the address ADDR as a pointer of type TYPE at BUF, in target
form. */
void
-store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
+store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.157
diff -p -u -r1.157 valops.c
--- valops.c 9 May 2005 21:20:35 -0000 1.157
+++ valops.c 19 May 2005 17:54:12 -0000
@@ -933,54 +933,6 @@ value_ind (struct value *arg1)
return 0; /* For lint -- never reached */
}
-/* Pushing small parts of stack frames. */
-
-/* Push one word (the size of object that a register holds). */
-
-CORE_ADDR
-push_word (CORE_ADDR sp, ULONGEST word)
-{
- int len = DEPRECATED_REGISTER_SIZE;
- char buffer[MAX_REGISTER_SIZE];
-
- store_unsigned_integer (buffer, len, word);
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
-/* Push LEN bytes with data at BUFFER. */
-
-CORE_ADDR
-push_bytes (CORE_ADDR sp, char *buffer, int len)
-{
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
/* Create a value for an array by allocating space in the inferior, copying
the data into that space, and then setting up an array value.
2005-05-19 17:55:53 +00:00
|
|
|
|
extern LONGEST extract_signed_integer (const gdb_byte *, int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2005-05-19 Andrew Cagney <cagney@gnu.org>
* defs.h (extract_signed_integer, extract_unsigned_integer)
(extract_long_unsigned_integer, extract_typed_address)
(store_signed_integer, store_unsigned_integer)
(store_typed_address): Use gdb_byte for byte buffer parameters.
(push_bytes, push_word): Delete declaration.
* valops.c (push_bytes, push_word): Delete function.
* findvar.c (extract_signed_integer, extract_unsigned_integer)
(extract_typed_address, store_signed_integer)
(store_unsigned_integer): Update.
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.185
diff -p -u -r1.185 defs.h
--- defs.h 9 May 2005 17:20:18 -0000 1.185
+++ defs.h 19 May 2005 17:54:12 -0000
@@ -1042,27 +1042,25 @@ enum { MAX_REGISTER_SIZE = 16 };
/* In findvar.c. */
-extern LONGEST extract_signed_integer (const void *, int);
+extern LONGEST extract_signed_integer (const gdb_byte *, int);
-extern ULONGEST extract_unsigned_integer (const void *, int);
+extern ULONGEST extract_unsigned_integer (const gdb_byte *, int);
-extern int extract_long_unsigned_integer (const void *, int, LONGEST *);
+extern int extract_long_unsigned_integer (const gdb_byte *, int, LONGEST *);
-extern CORE_ADDR extract_typed_address (const void *buf, struct type *type);
+extern CORE_ADDR extract_typed_address (const gdb_byte *buf,
+ struct type *type);
-extern void store_signed_integer (void *, int, LONGEST);
+extern void store_signed_integer (gdb_byte *, int, LONGEST);
-extern void store_unsigned_integer (void *, int, ULONGEST);
+extern void store_unsigned_integer (gdb_byte *, int, ULONGEST);
-extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr);
+extern void store_typed_address (gdb_byte *buf, struct type *type,
+ CORE_ADDR addr);
/* From valops.c */
-extern CORE_ADDR push_bytes (CORE_ADDR, char *, int);
-
-extern CORE_ADDR push_word (CORE_ADDR, ULONGEST);
-
extern int watchdog;
/* Hooks for alternate command interfaces. */
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.91
diff -p -u -r1.91 findvar.c
--- findvar.c 14 May 2005 06:07:41 -0000 1.91
+++ findvar.c 19 May 2005 17:54:12 -0000
@@ -49,7 +49,7 @@ you lose
#endif
LONGEST
-extract_signed_integer (const void *addr, int len)
+extract_signed_integer (const gdb_byte *addr, int len)
{
LONGEST retval;
const unsigned char *p;
@@ -83,7 +83,7 @@ That operation is not available on integ
}
ULONGEST
-extract_unsigned_integer (const void *addr, int len)
+extract_unsigned_integer (const gdb_byte *addr, int len)
{
ULONGEST retval;
const unsigned char *p;
@@ -117,16 +117,18 @@ That operation is not available on integ
function returns 1 and sets *PVAL. Otherwise it returns 0. */
int
-extract_long_unsigned_integer (const void *addr, int orig_len, LONGEST *pval)
+extract_long_unsigned_integer (const gdb_byte *addr, int orig_len,
+ LONGEST *pval)
{
- char *p, *first_addr;
+ const gdb_byte *p;
+ const gdb_byte *first_addr;
int len;
len = orig_len;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
- for (p = (char *) addr;
- len > (int) sizeof (LONGEST) && p < (char *) addr + orig_len;
+ for (p = addr;
+ len > (int) sizeof (LONGEST) && p < addr + orig_len;
p++)
{
if (*p == 0)
@@ -138,9 +140,9 @@ extract_long_unsigned_integer (const voi
}
else
{
- first_addr = (char *) addr;
- for (p = (char *) addr + orig_len - 1;
- len > (int) sizeof (LONGEST) && p >= (char *) addr;
+ first_addr = addr;
+ for (p = addr + orig_len - 1;
+ len > (int) sizeof (LONGEST) && p >= addr;
p--)
{
if (*p == 0)
@@ -164,7 +166,7 @@ extract_long_unsigned_integer (const voi
/* Treat the bytes at BUF as a pointer of type TYPE, and return the
address it represents. */
CORE_ADDR
-extract_typed_address (const void *buf, struct type *type)
+extract_typed_address (const gdb_byte *buf, struct type *type)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
@@ -177,11 +179,11 @@ extract_typed_address (const void *buf,
void
-store_signed_integer (void *addr, int len, LONGEST val)
+store_signed_integer (gdb_byte *addr, int len, LONGEST val)
{
- unsigned char *p;
- unsigned char *startaddr = (unsigned char *) addr;
- unsigned char *endaddr = startaddr + len;
+ gdb_byte *p;
+ gdb_byte *startaddr = addr;
+ gdb_byte *endaddr = startaddr + len;
/* Start at the least significant end of the integer, and work towards
the most significant. */
@@ -204,7 +206,7 @@ store_signed_integer (void *addr, int le
}
void
-store_unsigned_integer (void *addr, int len, ULONGEST val)
+store_unsigned_integer (gdb_byte *addr, int len, ULONGEST val)
{
unsigned char *p;
unsigned char *startaddr = (unsigned char *) addr;
@@ -233,7 +235,7 @@ store_unsigned_integer (void *addr, int
/* Store the address ADDR as a pointer of type TYPE at BUF, in target
form. */
void
-store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
+store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.157
diff -p -u -r1.157 valops.c
--- valops.c 9 May 2005 21:20:35 -0000 1.157
+++ valops.c 19 May 2005 17:54:12 -0000
@@ -933,54 +933,6 @@ value_ind (struct value *arg1)
return 0; /* For lint -- never reached */
}
-/* Pushing small parts of stack frames. */
-
-/* Push one word (the size of object that a register holds). */
-
-CORE_ADDR
-push_word (CORE_ADDR sp, ULONGEST word)
-{
- int len = DEPRECATED_REGISTER_SIZE;
- char buffer[MAX_REGISTER_SIZE];
-
- store_unsigned_integer (buffer, len, word);
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
-/* Push LEN bytes with data at BUFFER. */
-
-CORE_ADDR
-push_bytes (CORE_ADDR sp, char *buffer, int len)
-{
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
/* Create a value for an array by allocating space in the inferior, copying
the data into that space, and then setting up an array value.
2005-05-19 17:55:53 +00:00
|
|
|
|
extern ULONGEST extract_unsigned_integer (const gdb_byte *, int);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2005-05-19 Andrew Cagney <cagney@gnu.org>
* defs.h (extract_signed_integer, extract_unsigned_integer)
(extract_long_unsigned_integer, extract_typed_address)
(store_signed_integer, store_unsigned_integer)
(store_typed_address): Use gdb_byte for byte buffer parameters.
(push_bytes, push_word): Delete declaration.
* valops.c (push_bytes, push_word): Delete function.
* findvar.c (extract_signed_integer, extract_unsigned_integer)
(extract_typed_address, store_signed_integer)
(store_unsigned_integer): Update.
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.185
diff -p -u -r1.185 defs.h
--- defs.h 9 May 2005 17:20:18 -0000 1.185
+++ defs.h 19 May 2005 17:54:12 -0000
@@ -1042,27 +1042,25 @@ enum { MAX_REGISTER_SIZE = 16 };
/* In findvar.c. */
-extern LONGEST extract_signed_integer (const void *, int);
+extern LONGEST extract_signed_integer (const gdb_byte *, int);
-extern ULONGEST extract_unsigned_integer (const void *, int);
+extern ULONGEST extract_unsigned_integer (const gdb_byte *, int);
-extern int extract_long_unsigned_integer (const void *, int, LONGEST *);
+extern int extract_long_unsigned_integer (const gdb_byte *, int, LONGEST *);
-extern CORE_ADDR extract_typed_address (const void *buf, struct type *type);
+extern CORE_ADDR extract_typed_address (const gdb_byte *buf,
+ struct type *type);
-extern void store_signed_integer (void *, int, LONGEST);
+extern void store_signed_integer (gdb_byte *, int, LONGEST);
-extern void store_unsigned_integer (void *, int, ULONGEST);
+extern void store_unsigned_integer (gdb_byte *, int, ULONGEST);
-extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr);
+extern void store_typed_address (gdb_byte *buf, struct type *type,
+ CORE_ADDR addr);
/* From valops.c */
-extern CORE_ADDR push_bytes (CORE_ADDR, char *, int);
-
-extern CORE_ADDR push_word (CORE_ADDR, ULONGEST);
-
extern int watchdog;
/* Hooks for alternate command interfaces. */
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.91
diff -p -u -r1.91 findvar.c
--- findvar.c 14 May 2005 06:07:41 -0000 1.91
+++ findvar.c 19 May 2005 17:54:12 -0000
@@ -49,7 +49,7 @@ you lose
#endif
LONGEST
-extract_signed_integer (const void *addr, int len)
+extract_signed_integer (const gdb_byte *addr, int len)
{
LONGEST retval;
const unsigned char *p;
@@ -83,7 +83,7 @@ That operation is not available on integ
}
ULONGEST
-extract_unsigned_integer (const void *addr, int len)
+extract_unsigned_integer (const gdb_byte *addr, int len)
{
ULONGEST retval;
const unsigned char *p;
@@ -117,16 +117,18 @@ That operation is not available on integ
function returns 1 and sets *PVAL. Otherwise it returns 0. */
int
-extract_long_unsigned_integer (const void *addr, int orig_len, LONGEST *pval)
+extract_long_unsigned_integer (const gdb_byte *addr, int orig_len,
+ LONGEST *pval)
{
- char *p, *first_addr;
+ const gdb_byte *p;
+ const gdb_byte *first_addr;
int len;
len = orig_len;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
- for (p = (char *) addr;
- len > (int) sizeof (LONGEST) && p < (char *) addr + orig_len;
+ for (p = addr;
+ len > (int) sizeof (LONGEST) && p < addr + orig_len;
p++)
{
if (*p == 0)
@@ -138,9 +140,9 @@ extract_long_unsigned_integer (const voi
}
else
{
- first_addr = (char *) addr;
- for (p = (char *) addr + orig_len - 1;
- len > (int) sizeof (LONGEST) && p >= (char *) addr;
+ first_addr = addr;
+ for (p = addr + orig_len - 1;
+ len > (int) sizeof (LONGEST) && p >= addr;
p--)
{
if (*p == 0)
@@ -164,7 +166,7 @@ extract_long_unsigned_integer (const voi
/* Treat the bytes at BUF as a pointer of type TYPE, and return the
address it represents. */
CORE_ADDR
-extract_typed_address (const void *buf, struct type *type)
+extract_typed_address (const gdb_byte *buf, struct type *type)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
@@ -177,11 +179,11 @@ extract_typed_address (const void *buf,
void
-store_signed_integer (void *addr, int len, LONGEST val)
+store_signed_integer (gdb_byte *addr, int len, LONGEST val)
{
- unsigned char *p;
- unsigned char *startaddr = (unsigned char *) addr;
- unsigned char *endaddr = startaddr + len;
+ gdb_byte *p;
+ gdb_byte *startaddr = addr;
+ gdb_byte *endaddr = startaddr + len;
/* Start at the least significant end of the integer, and work towards
the most significant. */
@@ -204,7 +206,7 @@ store_signed_integer (void *addr, int le
}
void
-store_unsigned_integer (void *addr, int len, ULONGEST val)
+store_unsigned_integer (gdb_byte *addr, int len, ULONGEST val)
{
unsigned char *p;
unsigned char *startaddr = (unsigned char *) addr;
@@ -233,7 +235,7 @@ store_unsigned_integer (void *addr, int
/* Store the address ADDR as a pointer of type TYPE at BUF, in target
form. */
void
-store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
+store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.157
diff -p -u -r1.157 valops.c
--- valops.c 9 May 2005 21:20:35 -0000 1.157
+++ valops.c 19 May 2005 17:54:12 -0000
@@ -933,54 +933,6 @@ value_ind (struct value *arg1)
return 0; /* For lint -- never reached */
}
-/* Pushing small parts of stack frames. */
-
-/* Push one word (the size of object that a register holds). */
-
-CORE_ADDR
-push_word (CORE_ADDR sp, ULONGEST word)
-{
- int len = DEPRECATED_REGISTER_SIZE;
- char buffer[MAX_REGISTER_SIZE];
-
- store_unsigned_integer (buffer, len, word);
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
-/* Push LEN bytes with data at BUFFER. */
-
-CORE_ADDR
-push_bytes (CORE_ADDR sp, char *buffer, int len)
-{
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
/* Create a value for an array by allocating space in the inferior, copying
the data into that space, and then setting up an array value.
2005-05-19 17:55:53 +00:00
|
|
|
|
extern int extract_long_unsigned_integer (const gdb_byte *, int, LONGEST *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2005-05-19 Andrew Cagney <cagney@gnu.org>
* defs.h (extract_signed_integer, extract_unsigned_integer)
(extract_long_unsigned_integer, extract_typed_address)
(store_signed_integer, store_unsigned_integer)
(store_typed_address): Use gdb_byte for byte buffer parameters.
(push_bytes, push_word): Delete declaration.
* valops.c (push_bytes, push_word): Delete function.
* findvar.c (extract_signed_integer, extract_unsigned_integer)
(extract_typed_address, store_signed_integer)
(store_unsigned_integer): Update.
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.185
diff -p -u -r1.185 defs.h
--- defs.h 9 May 2005 17:20:18 -0000 1.185
+++ defs.h 19 May 2005 17:54:12 -0000
@@ -1042,27 +1042,25 @@ enum { MAX_REGISTER_SIZE = 16 };
/* In findvar.c. */
-extern LONGEST extract_signed_integer (const void *, int);
+extern LONGEST extract_signed_integer (const gdb_byte *, int);
-extern ULONGEST extract_unsigned_integer (const void *, int);
+extern ULONGEST extract_unsigned_integer (const gdb_byte *, int);
-extern int extract_long_unsigned_integer (const void *, int, LONGEST *);
+extern int extract_long_unsigned_integer (const gdb_byte *, int, LONGEST *);
-extern CORE_ADDR extract_typed_address (const void *buf, struct type *type);
+extern CORE_ADDR extract_typed_address (const gdb_byte *buf,
+ struct type *type);
-extern void store_signed_integer (void *, int, LONGEST);
+extern void store_signed_integer (gdb_byte *, int, LONGEST);
-extern void store_unsigned_integer (void *, int, ULONGEST);
+extern void store_unsigned_integer (gdb_byte *, int, ULONGEST);
-extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr);
+extern void store_typed_address (gdb_byte *buf, struct type *type,
+ CORE_ADDR addr);
/* From valops.c */
-extern CORE_ADDR push_bytes (CORE_ADDR, char *, int);
-
-extern CORE_ADDR push_word (CORE_ADDR, ULONGEST);
-
extern int watchdog;
/* Hooks for alternate command interfaces. */
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.91
diff -p -u -r1.91 findvar.c
--- findvar.c 14 May 2005 06:07:41 -0000 1.91
+++ findvar.c 19 May 2005 17:54:12 -0000
@@ -49,7 +49,7 @@ you lose
#endif
LONGEST
-extract_signed_integer (const void *addr, int len)
+extract_signed_integer (const gdb_byte *addr, int len)
{
LONGEST retval;
const unsigned char *p;
@@ -83,7 +83,7 @@ That operation is not available on integ
}
ULONGEST
-extract_unsigned_integer (const void *addr, int len)
+extract_unsigned_integer (const gdb_byte *addr, int len)
{
ULONGEST retval;
const unsigned char *p;
@@ -117,16 +117,18 @@ That operation is not available on integ
function returns 1 and sets *PVAL. Otherwise it returns 0. */
int
-extract_long_unsigned_integer (const void *addr, int orig_len, LONGEST *pval)
+extract_long_unsigned_integer (const gdb_byte *addr, int orig_len,
+ LONGEST *pval)
{
- char *p, *first_addr;
+ const gdb_byte *p;
+ const gdb_byte *first_addr;
int len;
len = orig_len;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
- for (p = (char *) addr;
- len > (int) sizeof (LONGEST) && p < (char *) addr + orig_len;
+ for (p = addr;
+ len > (int) sizeof (LONGEST) && p < addr + orig_len;
p++)
{
if (*p == 0)
@@ -138,9 +140,9 @@ extract_long_unsigned_integer (const voi
}
else
{
- first_addr = (char *) addr;
- for (p = (char *) addr + orig_len - 1;
- len > (int) sizeof (LONGEST) && p >= (char *) addr;
+ first_addr = addr;
+ for (p = addr + orig_len - 1;
+ len > (int) sizeof (LONGEST) && p >= addr;
p--)
{
if (*p == 0)
@@ -164,7 +166,7 @@ extract_long_unsigned_integer (const voi
/* Treat the bytes at BUF as a pointer of type TYPE, and return the
address it represents. */
CORE_ADDR
-extract_typed_address (const void *buf, struct type *type)
+extract_typed_address (const gdb_byte *buf, struct type *type)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
@@ -177,11 +179,11 @@ extract_typed_address (const void *buf,
void
-store_signed_integer (void *addr, int len, LONGEST val)
+store_signed_integer (gdb_byte *addr, int len, LONGEST val)
{
- unsigned char *p;
- unsigned char *startaddr = (unsigned char *) addr;
- unsigned char *endaddr = startaddr + len;
+ gdb_byte *p;
+ gdb_byte *startaddr = addr;
+ gdb_byte *endaddr = startaddr + len;
/* Start at the least significant end of the integer, and work towards
the most significant. */
@@ -204,7 +206,7 @@ store_signed_integer (void *addr, int le
}
void
-store_unsigned_integer (void *addr, int len, ULONGEST val)
+store_unsigned_integer (gdb_byte *addr, int len, ULONGEST val)
{
unsigned char *p;
unsigned char *startaddr = (unsigned char *) addr;
@@ -233,7 +235,7 @@ store_unsigned_integer (void *addr, int
/* Store the address ADDR as a pointer of type TYPE at BUF, in target
form. */
void
-store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
+store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.157
diff -p -u -r1.157 valops.c
--- valops.c 9 May 2005 21:20:35 -0000 1.157
+++ valops.c 19 May 2005 17:54:12 -0000
@@ -933,54 +933,6 @@ value_ind (struct value *arg1)
return 0; /* For lint -- never reached */
}
-/* Pushing small parts of stack frames. */
-
-/* Push one word (the size of object that a register holds). */
-
-CORE_ADDR
-push_word (CORE_ADDR sp, ULONGEST word)
-{
- int len = DEPRECATED_REGISTER_SIZE;
- char buffer[MAX_REGISTER_SIZE];
-
- store_unsigned_integer (buffer, len, word);
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
-/* Push LEN bytes with data at BUFFER. */
-
-CORE_ADDR
-push_bytes (CORE_ADDR sp, char *buffer, int len)
-{
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
/* Create a value for an array by allocating space in the inferior, copying
the data into that space, and then setting up an array value.
2005-05-19 17:55:53 +00:00
|
|
|
|
extern CORE_ADDR extract_typed_address (const gdb_byte *buf,
|
|
|
|
|
struct type *type);
|
* gdbarch.sh (POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Two new
functions which architectures can redefine, defaulting to
generic_pointer_to_address and generic_address_to_pointer.
* findvar.c (extract_typed_address, store_typed_address,
generic_pointer_to_address, generic_address_to_pointer): New
functions.
(POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Provide default
definitions.
(extract_address, store_address): Doc fixes.
* values.c (value_as_pointer): Doc fix.
(value_from_pointer): New function.
* defs.h (extract_typed_address, store_typed_address): New
declarations.
* inferior.h (generic_address_to_pointer,
generic_pointer_to_address): New declarations.
* value.h (value_from_pointer): New declaration.
* ax-gdb.c (const_var_ref): Use value_from_pointer, not
value_from_longest.
* blockframe.c (generic_push_dummy_frame): Use read_pc and
read_sp, not read_register.
* c-valprint.c (c_val_print): Use extract_typed_address instead of
extract_address to extract vtable entries and references.
* cp-valprint.c (cp_print_value_fields): Use value_from_pointer
instead of value_from_longest to extract the vtable's address.
* eval.c (evaluate_subexp_standard): Use value_from_pointer
instead of value_from_longest to compute `this', and for doing
pointer-to-member dereferencing.
* findvar.c (read_register): Use extract_unsigned_integer, not
extract_address.
(read_var_value): Use store_typed_address instead of store_address
for building label values.
(locate_var_value): Use value_from_pointer instead of
value_from_longest.
* hppa-tdep.c (find_stub_with_shl_get): Use value_from_pointer,
instead of value_from_longest, to build arguments to __d_shl_get.
* printcmd.c (set_next_address): Use value_from_pointer, not
value_from_longest.
(x_command): Use value_from_pointer, not value_from_longest.
* tracepoint.c (set_traceframe_context): Use value_from_pointer,
not value_from_longest.
* valarith.c (value_add, value_sub): Use value_from_pointer, not
value_from_longest.
* valops.c (find_function_in_inferior, value_coerce_array,
value_coerce_function, value_addr, hand_function_call): Same.
* value.h (COERCE_REF): Use unpack_pointer, not unpack_long.
* values.c (unpack_long): Use extract_typed_address to produce
addresses from pointers and references, not extract_address.
(value_from_longest): Use store_typed_address instead of
store_address to produce pointer and reference values.
2000-04-14 18:43:41 +00:00
|
|
|
|
|
2005-05-19 Andrew Cagney <cagney@gnu.org>
* defs.h (extract_signed_integer, extract_unsigned_integer)
(extract_long_unsigned_integer, extract_typed_address)
(store_signed_integer, store_unsigned_integer)
(store_typed_address): Use gdb_byte for byte buffer parameters.
(push_bytes, push_word): Delete declaration.
* valops.c (push_bytes, push_word): Delete function.
* findvar.c (extract_signed_integer, extract_unsigned_integer)
(extract_typed_address, store_signed_integer)
(store_unsigned_integer): Update.
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.185
diff -p -u -r1.185 defs.h
--- defs.h 9 May 2005 17:20:18 -0000 1.185
+++ defs.h 19 May 2005 17:54:12 -0000
@@ -1042,27 +1042,25 @@ enum { MAX_REGISTER_SIZE = 16 };
/* In findvar.c. */
-extern LONGEST extract_signed_integer (const void *, int);
+extern LONGEST extract_signed_integer (const gdb_byte *, int);
-extern ULONGEST extract_unsigned_integer (const void *, int);
+extern ULONGEST extract_unsigned_integer (const gdb_byte *, int);
-extern int extract_long_unsigned_integer (const void *, int, LONGEST *);
+extern int extract_long_unsigned_integer (const gdb_byte *, int, LONGEST *);
-extern CORE_ADDR extract_typed_address (const void *buf, struct type *type);
+extern CORE_ADDR extract_typed_address (const gdb_byte *buf,
+ struct type *type);
-extern void store_signed_integer (void *, int, LONGEST);
+extern void store_signed_integer (gdb_byte *, int, LONGEST);
-extern void store_unsigned_integer (void *, int, ULONGEST);
+extern void store_unsigned_integer (gdb_byte *, int, ULONGEST);
-extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr);
+extern void store_typed_address (gdb_byte *buf, struct type *type,
+ CORE_ADDR addr);
/* From valops.c */
-extern CORE_ADDR push_bytes (CORE_ADDR, char *, int);
-
-extern CORE_ADDR push_word (CORE_ADDR, ULONGEST);
-
extern int watchdog;
/* Hooks for alternate command interfaces. */
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.91
diff -p -u -r1.91 findvar.c
--- findvar.c 14 May 2005 06:07:41 -0000 1.91
+++ findvar.c 19 May 2005 17:54:12 -0000
@@ -49,7 +49,7 @@ you lose
#endif
LONGEST
-extract_signed_integer (const void *addr, int len)
+extract_signed_integer (const gdb_byte *addr, int len)
{
LONGEST retval;
const unsigned char *p;
@@ -83,7 +83,7 @@ That operation is not available on integ
}
ULONGEST
-extract_unsigned_integer (const void *addr, int len)
+extract_unsigned_integer (const gdb_byte *addr, int len)
{
ULONGEST retval;
const unsigned char *p;
@@ -117,16 +117,18 @@ That operation is not available on integ
function returns 1 and sets *PVAL. Otherwise it returns 0. */
int
-extract_long_unsigned_integer (const void *addr, int orig_len, LONGEST *pval)
+extract_long_unsigned_integer (const gdb_byte *addr, int orig_len,
+ LONGEST *pval)
{
- char *p, *first_addr;
+ const gdb_byte *p;
+ const gdb_byte *first_addr;
int len;
len = orig_len;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
- for (p = (char *) addr;
- len > (int) sizeof (LONGEST) && p < (char *) addr + orig_len;
+ for (p = addr;
+ len > (int) sizeof (LONGEST) && p < addr + orig_len;
p++)
{
if (*p == 0)
@@ -138,9 +140,9 @@ extract_long_unsigned_integer (const voi
}
else
{
- first_addr = (char *) addr;
- for (p = (char *) addr + orig_len - 1;
- len > (int) sizeof (LONGEST) && p >= (char *) addr;
+ first_addr = addr;
+ for (p = addr + orig_len - 1;
+ len > (int) sizeof (LONGEST) && p >= addr;
p--)
{
if (*p == 0)
@@ -164,7 +166,7 @@ extract_long_unsigned_integer (const voi
/* Treat the bytes at BUF as a pointer of type TYPE, and return the
address it represents. */
CORE_ADDR
-extract_typed_address (const void *buf, struct type *type)
+extract_typed_address (const gdb_byte *buf, struct type *type)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
@@ -177,11 +179,11 @@ extract_typed_address (const void *buf,
void
-store_signed_integer (void *addr, int len, LONGEST val)
+store_signed_integer (gdb_byte *addr, int len, LONGEST val)
{
- unsigned char *p;
- unsigned char *startaddr = (unsigned char *) addr;
- unsigned char *endaddr = startaddr + len;
+ gdb_byte *p;
+ gdb_byte *startaddr = addr;
+ gdb_byte *endaddr = startaddr + len;
/* Start at the least significant end of the integer, and work towards
the most significant. */
@@ -204,7 +206,7 @@ store_signed_integer (void *addr, int le
}
void
-store_unsigned_integer (void *addr, int len, ULONGEST val)
+store_unsigned_integer (gdb_byte *addr, int len, ULONGEST val)
{
unsigned char *p;
unsigned char *startaddr = (unsigned char *) addr;
@@ -233,7 +235,7 @@ store_unsigned_integer (void *addr, int
/* Store the address ADDR as a pointer of type TYPE at BUF, in target
form. */
void
-store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
+store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.157
diff -p -u -r1.157 valops.c
--- valops.c 9 May 2005 21:20:35 -0000 1.157
+++ valops.c 19 May 2005 17:54:12 -0000
@@ -933,54 +933,6 @@ value_ind (struct value *arg1)
return 0; /* For lint -- never reached */
}
-/* Pushing small parts of stack frames. */
-
-/* Push one word (the size of object that a register holds). */
-
-CORE_ADDR
-push_word (CORE_ADDR sp, ULONGEST word)
-{
- int len = DEPRECATED_REGISTER_SIZE;
- char buffer[MAX_REGISTER_SIZE];
-
- store_unsigned_integer (buffer, len, word);
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
-/* Push LEN bytes with data at BUFFER. */
-
-CORE_ADDR
-push_bytes (CORE_ADDR sp, char *buffer, int len)
-{
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
/* Create a value for an array by allocating space in the inferior, copying
the data into that space, and then setting up an array value.
2005-05-19 17:55:53 +00:00
|
|
|
|
extern void store_signed_integer (gdb_byte *, int, LONGEST);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2005-05-19 Andrew Cagney <cagney@gnu.org>
* defs.h (extract_signed_integer, extract_unsigned_integer)
(extract_long_unsigned_integer, extract_typed_address)
(store_signed_integer, store_unsigned_integer)
(store_typed_address): Use gdb_byte for byte buffer parameters.
(push_bytes, push_word): Delete declaration.
* valops.c (push_bytes, push_word): Delete function.
* findvar.c (extract_signed_integer, extract_unsigned_integer)
(extract_typed_address, store_signed_integer)
(store_unsigned_integer): Update.
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.185
diff -p -u -r1.185 defs.h
--- defs.h 9 May 2005 17:20:18 -0000 1.185
+++ defs.h 19 May 2005 17:54:12 -0000
@@ -1042,27 +1042,25 @@ enum { MAX_REGISTER_SIZE = 16 };
/* In findvar.c. */
-extern LONGEST extract_signed_integer (const void *, int);
+extern LONGEST extract_signed_integer (const gdb_byte *, int);
-extern ULONGEST extract_unsigned_integer (const void *, int);
+extern ULONGEST extract_unsigned_integer (const gdb_byte *, int);
-extern int extract_long_unsigned_integer (const void *, int, LONGEST *);
+extern int extract_long_unsigned_integer (const gdb_byte *, int, LONGEST *);
-extern CORE_ADDR extract_typed_address (const void *buf, struct type *type);
+extern CORE_ADDR extract_typed_address (const gdb_byte *buf,
+ struct type *type);
-extern void store_signed_integer (void *, int, LONGEST);
+extern void store_signed_integer (gdb_byte *, int, LONGEST);
-extern void store_unsigned_integer (void *, int, ULONGEST);
+extern void store_unsigned_integer (gdb_byte *, int, ULONGEST);
-extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr);
+extern void store_typed_address (gdb_byte *buf, struct type *type,
+ CORE_ADDR addr);
/* From valops.c */
-extern CORE_ADDR push_bytes (CORE_ADDR, char *, int);
-
-extern CORE_ADDR push_word (CORE_ADDR, ULONGEST);
-
extern int watchdog;
/* Hooks for alternate command interfaces. */
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.91
diff -p -u -r1.91 findvar.c
--- findvar.c 14 May 2005 06:07:41 -0000 1.91
+++ findvar.c 19 May 2005 17:54:12 -0000
@@ -49,7 +49,7 @@ you lose
#endif
LONGEST
-extract_signed_integer (const void *addr, int len)
+extract_signed_integer (const gdb_byte *addr, int len)
{
LONGEST retval;
const unsigned char *p;
@@ -83,7 +83,7 @@ That operation is not available on integ
}
ULONGEST
-extract_unsigned_integer (const void *addr, int len)
+extract_unsigned_integer (const gdb_byte *addr, int len)
{
ULONGEST retval;
const unsigned char *p;
@@ -117,16 +117,18 @@ That operation is not available on integ
function returns 1 and sets *PVAL. Otherwise it returns 0. */
int
-extract_long_unsigned_integer (const void *addr, int orig_len, LONGEST *pval)
+extract_long_unsigned_integer (const gdb_byte *addr, int orig_len,
+ LONGEST *pval)
{
- char *p, *first_addr;
+ const gdb_byte *p;
+ const gdb_byte *first_addr;
int len;
len = orig_len;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
- for (p = (char *) addr;
- len > (int) sizeof (LONGEST) && p < (char *) addr + orig_len;
+ for (p = addr;
+ len > (int) sizeof (LONGEST) && p < addr + orig_len;
p++)
{
if (*p == 0)
@@ -138,9 +140,9 @@ extract_long_unsigned_integer (const voi
}
else
{
- first_addr = (char *) addr;
- for (p = (char *) addr + orig_len - 1;
- len > (int) sizeof (LONGEST) && p >= (char *) addr;
+ first_addr = addr;
+ for (p = addr + orig_len - 1;
+ len > (int) sizeof (LONGEST) && p >= addr;
p--)
{
if (*p == 0)
@@ -164,7 +166,7 @@ extract_long_unsigned_integer (const voi
/* Treat the bytes at BUF as a pointer of type TYPE, and return the
address it represents. */
CORE_ADDR
-extract_typed_address (const void *buf, struct type *type)
+extract_typed_address (const gdb_byte *buf, struct type *type)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
@@ -177,11 +179,11 @@ extract_typed_address (const void *buf,
void
-store_signed_integer (void *addr, int len, LONGEST val)
+store_signed_integer (gdb_byte *addr, int len, LONGEST val)
{
- unsigned char *p;
- unsigned char *startaddr = (unsigned char *) addr;
- unsigned char *endaddr = startaddr + len;
+ gdb_byte *p;
+ gdb_byte *startaddr = addr;
+ gdb_byte *endaddr = startaddr + len;
/* Start at the least significant end of the integer, and work towards
the most significant. */
@@ -204,7 +206,7 @@ store_signed_integer (void *addr, int le
}
void
-store_unsigned_integer (void *addr, int len, ULONGEST val)
+store_unsigned_integer (gdb_byte *addr, int len, ULONGEST val)
{
unsigned char *p;
unsigned char *startaddr = (unsigned char *) addr;
@@ -233,7 +235,7 @@ store_unsigned_integer (void *addr, int
/* Store the address ADDR as a pointer of type TYPE at BUF, in target
form. */
void
-store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
+store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.157
diff -p -u -r1.157 valops.c
--- valops.c 9 May 2005 21:20:35 -0000 1.157
+++ valops.c 19 May 2005 17:54:12 -0000
@@ -933,54 +933,6 @@ value_ind (struct value *arg1)
return 0; /* For lint -- never reached */
}
-/* Pushing small parts of stack frames. */
-
-/* Push one word (the size of object that a register holds). */
-
-CORE_ADDR
-push_word (CORE_ADDR sp, ULONGEST word)
-{
- int len = DEPRECATED_REGISTER_SIZE;
- char buffer[MAX_REGISTER_SIZE];
-
- store_unsigned_integer (buffer, len, word);
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
-/* Push LEN bytes with data at BUFFER. */
-
-CORE_ADDR
-push_bytes (CORE_ADDR sp, char *buffer, int len)
-{
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
/* Create a value for an array by allocating space in the inferior, copying
the data into that space, and then setting up an array value.
2005-05-19 17:55:53 +00:00
|
|
|
|
extern void store_unsigned_integer (gdb_byte *, int, ULONGEST);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
2005-05-19 Andrew Cagney <cagney@gnu.org>
* defs.h (extract_signed_integer, extract_unsigned_integer)
(extract_long_unsigned_integer, extract_typed_address)
(store_signed_integer, store_unsigned_integer)
(store_typed_address): Use gdb_byte for byte buffer parameters.
(push_bytes, push_word): Delete declaration.
* valops.c (push_bytes, push_word): Delete function.
* findvar.c (extract_signed_integer, extract_unsigned_integer)
(extract_typed_address, store_signed_integer)
(store_unsigned_integer): Update.
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.185
diff -p -u -r1.185 defs.h
--- defs.h 9 May 2005 17:20:18 -0000 1.185
+++ defs.h 19 May 2005 17:54:12 -0000
@@ -1042,27 +1042,25 @@ enum { MAX_REGISTER_SIZE = 16 };
/* In findvar.c. */
-extern LONGEST extract_signed_integer (const void *, int);
+extern LONGEST extract_signed_integer (const gdb_byte *, int);
-extern ULONGEST extract_unsigned_integer (const void *, int);
+extern ULONGEST extract_unsigned_integer (const gdb_byte *, int);
-extern int extract_long_unsigned_integer (const void *, int, LONGEST *);
+extern int extract_long_unsigned_integer (const gdb_byte *, int, LONGEST *);
-extern CORE_ADDR extract_typed_address (const void *buf, struct type *type);
+extern CORE_ADDR extract_typed_address (const gdb_byte *buf,
+ struct type *type);
-extern void store_signed_integer (void *, int, LONGEST);
+extern void store_signed_integer (gdb_byte *, int, LONGEST);
-extern void store_unsigned_integer (void *, int, ULONGEST);
+extern void store_unsigned_integer (gdb_byte *, int, ULONGEST);
-extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr);
+extern void store_typed_address (gdb_byte *buf, struct type *type,
+ CORE_ADDR addr);
/* From valops.c */
-extern CORE_ADDR push_bytes (CORE_ADDR, char *, int);
-
-extern CORE_ADDR push_word (CORE_ADDR, ULONGEST);
-
extern int watchdog;
/* Hooks for alternate command interfaces. */
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.91
diff -p -u -r1.91 findvar.c
--- findvar.c 14 May 2005 06:07:41 -0000 1.91
+++ findvar.c 19 May 2005 17:54:12 -0000
@@ -49,7 +49,7 @@ you lose
#endif
LONGEST
-extract_signed_integer (const void *addr, int len)
+extract_signed_integer (const gdb_byte *addr, int len)
{
LONGEST retval;
const unsigned char *p;
@@ -83,7 +83,7 @@ That operation is not available on integ
}
ULONGEST
-extract_unsigned_integer (const void *addr, int len)
+extract_unsigned_integer (const gdb_byte *addr, int len)
{
ULONGEST retval;
const unsigned char *p;
@@ -117,16 +117,18 @@ That operation is not available on integ
function returns 1 and sets *PVAL. Otherwise it returns 0. */
int
-extract_long_unsigned_integer (const void *addr, int orig_len, LONGEST *pval)
+extract_long_unsigned_integer (const gdb_byte *addr, int orig_len,
+ LONGEST *pval)
{
- char *p, *first_addr;
+ const gdb_byte *p;
+ const gdb_byte *first_addr;
int len;
len = orig_len;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
- for (p = (char *) addr;
- len > (int) sizeof (LONGEST) && p < (char *) addr + orig_len;
+ for (p = addr;
+ len > (int) sizeof (LONGEST) && p < addr + orig_len;
p++)
{
if (*p == 0)
@@ -138,9 +140,9 @@ extract_long_unsigned_integer (const voi
}
else
{
- first_addr = (char *) addr;
- for (p = (char *) addr + orig_len - 1;
- len > (int) sizeof (LONGEST) && p >= (char *) addr;
+ first_addr = addr;
+ for (p = addr + orig_len - 1;
+ len > (int) sizeof (LONGEST) && p >= addr;
p--)
{
if (*p == 0)
@@ -164,7 +166,7 @@ extract_long_unsigned_integer (const voi
/* Treat the bytes at BUF as a pointer of type TYPE, and return the
address it represents. */
CORE_ADDR
-extract_typed_address (const void *buf, struct type *type)
+extract_typed_address (const gdb_byte *buf, struct type *type)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
@@ -177,11 +179,11 @@ extract_typed_address (const void *buf,
void
-store_signed_integer (void *addr, int len, LONGEST val)
+store_signed_integer (gdb_byte *addr, int len, LONGEST val)
{
- unsigned char *p;
- unsigned char *startaddr = (unsigned char *) addr;
- unsigned char *endaddr = startaddr + len;
+ gdb_byte *p;
+ gdb_byte *startaddr = addr;
+ gdb_byte *endaddr = startaddr + len;
/* Start at the least significant end of the integer, and work towards
the most significant. */
@@ -204,7 +206,7 @@ store_signed_integer (void *addr, int le
}
void
-store_unsigned_integer (void *addr, int len, ULONGEST val)
+store_unsigned_integer (gdb_byte *addr, int len, ULONGEST val)
{
unsigned char *p;
unsigned char *startaddr = (unsigned char *) addr;
@@ -233,7 +235,7 @@ store_unsigned_integer (void *addr, int
/* Store the address ADDR as a pointer of type TYPE at BUF, in target
form. */
void
-store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
+store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
{
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.157
diff -p -u -r1.157 valops.c
--- valops.c 9 May 2005 21:20:35 -0000 1.157
+++ valops.c 19 May 2005 17:54:12 -0000
@@ -933,54 +933,6 @@ value_ind (struct value *arg1)
return 0; /* For lint -- never reached */
}
-/* Pushing small parts of stack frames. */
-
-/* Push one word (the size of object that a register holds). */
-
-CORE_ADDR
-push_word (CORE_ADDR sp, ULONGEST word)
-{
- int len = DEPRECATED_REGISTER_SIZE;
- char buffer[MAX_REGISTER_SIZE];
-
- store_unsigned_integer (buffer, len, word);
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
-/* Push LEN bytes with data at BUFFER. */
-
-CORE_ADDR
-push_bytes (CORE_ADDR sp, char *buffer, int len)
-{
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
/* Create a value for an array by allocating space in the inferior, copying
the data into that space, and then setting up an array value.
2005-05-19 17:55:53 +00:00
|
|
|
|
extern void store_typed_address (gdb_byte *buf, struct type *type,
|
|
|
|
|
CORE_ADDR addr);
|
* gdbarch.sh (POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Two new
functions which architectures can redefine, defaulting to
generic_pointer_to_address and generic_address_to_pointer.
* findvar.c (extract_typed_address, store_typed_address,
generic_pointer_to_address, generic_address_to_pointer): New
functions.
(POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Provide default
definitions.
(extract_address, store_address): Doc fixes.
* values.c (value_as_pointer): Doc fix.
(value_from_pointer): New function.
* defs.h (extract_typed_address, store_typed_address): New
declarations.
* inferior.h (generic_address_to_pointer,
generic_pointer_to_address): New declarations.
* value.h (value_from_pointer): New declaration.
* ax-gdb.c (const_var_ref): Use value_from_pointer, not
value_from_longest.
* blockframe.c (generic_push_dummy_frame): Use read_pc and
read_sp, not read_register.
* c-valprint.c (c_val_print): Use extract_typed_address instead of
extract_address to extract vtable entries and references.
* cp-valprint.c (cp_print_value_fields): Use value_from_pointer
instead of value_from_longest to extract the vtable's address.
* eval.c (evaluate_subexp_standard): Use value_from_pointer
instead of value_from_longest to compute `this', and for doing
pointer-to-member dereferencing.
* findvar.c (read_register): Use extract_unsigned_integer, not
extract_address.
(read_var_value): Use store_typed_address instead of store_address
for building label values.
(locate_var_value): Use value_from_pointer instead of
value_from_longest.
* hppa-tdep.c (find_stub_with_shl_get): Use value_from_pointer,
instead of value_from_longest, to build arguments to __d_shl_get.
* printcmd.c (set_next_address): Use value_from_pointer, not
value_from_longest.
(x_command): Use value_from_pointer, not value_from_longest.
* tracepoint.c (set_traceframe_context): Use value_from_pointer,
not value_from_longest.
* valarith.c (value_add, value_sub): Use value_from_pointer, not
value_from_longest.
* valops.c (find_function_in_inferior, value_coerce_array,
value_coerce_function, value_addr, hand_function_call): Same.
* value.h (COERCE_REF): Use unpack_pointer, not unpack_long.
* values.c (unpack_long): Use extract_typed_address to produce
addresses from pointers and references, not extract_address.
(value_from_longest): Use store_typed_address instead of
store_address to produce pointer and reference values.
2000-04-14 18:43:41 +00:00
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
/* From valops.c */
|
|
|
|
|
|
|
|
|
|
extern int watchdog;
|
|
|
|
|
|
|
|
|
|
/* Hooks for alternate command interfaces. */
|
2000-02-03 04:14:45 +00:00
|
|
|
|
|
2000-02-23 00:25:43 +00:00
|
|
|
|
/* The name of the interpreter if specified on the command line. */
|
|
|
|
|
extern char *interpreter_p;
|
|
|
|
|
|
|
|
|
|
/* If a given interpreter matches INTERPRETER_P then it should update
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-21 23:52:21 +00:00
|
|
|
|
deprecated_command_loop_hook and deprecated_init_ui_hook with the
|
|
|
|
|
per-interpreter implementation. */
|
|
|
|
|
/* FIXME: deprecated_command_loop_hook and deprecated_init_ui_hook
|
|
|
|
|
should be moved here. */
|
2000-02-23 00:25:43 +00:00
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
struct target_waitstatus;
|
|
|
|
|
struct cmd_list_element;
|
|
|
|
|
|
2004-06-24 22:09:34 +00:00
|
|
|
|
extern void (*deprecated_pre_add_symbol_hook) (const char *);
|
|
|
|
|
extern void (*deprecated_post_add_symbol_hook) (void);
|
2004-06-24 21:51:49 +00:00
|
|
|
|
extern void (*selected_frame_level_changed_hook) (int);
|
2004-06-25 19:46:08 +00:00
|
|
|
|
extern int (*deprecated_ui_loop_hook) (int signo);
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-21 23:52:21 +00:00
|
|
|
|
extern void (*deprecated_init_ui_hook) (char *argv0);
|
|
|
|
|
extern void (*deprecated_command_loop_hook) (void);
|
|
|
|
|
extern void (*deprecated_show_load_progress) (const char *section,
|
|
|
|
|
unsigned long section_sent,
|
|
|
|
|
unsigned long section_size,
|
|
|
|
|
unsigned long total_sent,
|
|
|
|
|
unsigned long total_size);
|
|
|
|
|
extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
|
|
|
|
|
int line, int stopline,
|
|
|
|
|
int noerror);
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 20:56:26 +00:00
|
|
|
|
extern int (*deprecated_query_hook) (const char *, va_list)
|
|
|
|
|
ATTRIBUTE_FPTR_PRINTF(1,0);
|
|
|
|
|
extern void (*deprecated_warning_hook) (const char *, va_list)
|
|
|
|
|
ATTRIBUTE_FPTR_PRINTF(1,0);
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-21 23:52:21 +00:00
|
|
|
|
extern void (*deprecated_flush_hook) (struct ui_file * stream);
|
|
|
|
|
extern void (*deprecated_interactive_hook) (void);
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 20:56:26 +00:00
|
|
|
|
extern void (*deprecated_readline_begin_hook) (char *, ...)
|
|
|
|
|
ATTRIBUTE_FPTR_PRINTF_1;
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-21 23:52:21 +00:00
|
|
|
|
extern char *(*deprecated_readline_hook) (char *);
|
|
|
|
|
extern void (*deprecated_readline_end_hook) (void);
|
|
|
|
|
extern void (*deprecated_register_changed_hook) (int regno);
|
|
|
|
|
extern void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len);
|
|
|
|
|
extern void (*deprecated_context_hook) (int);
|
|
|
|
|
extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
|
2009-05-21 15:48:42 +00:00
|
|
|
|
struct target_waitstatus *status,
|
|
|
|
|
int options);
|
1999-10-19 02:47:02 +00:00
|
|
|
|
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-21 23:52:21 +00:00
|
|
|
|
extern void (*deprecated_attach_hook) (void);
|
|
|
|
|
extern void (*deprecated_detach_hook) (void);
|
|
|
|
|
extern void (*deprecated_call_command_hook) (struct cmd_list_element * c,
|
|
|
|
|
char *cmd, int from_tty);
|
1999-10-19 02:47:02 +00:00
|
|
|
|
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-21 23:52:21 +00:00
|
|
|
|
extern void (*deprecated_set_hook) (struct cmd_list_element * c);
|
1999-10-19 02:47:02 +00:00
|
|
|
|
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-21 23:52:21 +00:00
|
|
|
|
extern void (*deprecated_error_begin_hook) (void);
|
1999-10-19 02:47:02 +00:00
|
|
|
|
|
2004-04-21 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
2004-04-21 23:52:21 +00:00
|
|
|
|
extern int (*deprecated_ui_load_progress_hook) (const char *section,
|
|
|
|
|
unsigned long num);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Inhibit window interface if non-zero. */
|
|
|
|
|
|
|
|
|
|
extern int use_windows;
|
|
|
|
|
|
|
|
|
|
/* Symbolic definitions of filename-related things. */
|
|
|
|
|
/* FIXME, this doesn't work very well if host and executable
|
|
|
|
|
filesystems conventions are different. */
|
|
|
|
|
|
2004-11-13 17:00:04 +00:00
|
|
|
|
#ifdef __MSDOS__
|
|
|
|
|
# define CANT_FORK
|
|
|
|
|
# define GLOBAL_CURDIR
|
|
|
|
|
# define DIRNAME_SEPARATOR ';'
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-06-24 13:48:53 +00:00
|
|
|
|
#if !defined (__CYGWIN__) && defined (_WIN32)
|
|
|
|
|
# define DIRNAME_SEPARATOR ';'
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#ifndef DIRNAME_SEPARATOR
|
|
|
|
|
#define DIRNAME_SEPARATOR ':'
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef SLASH_STRING
|
|
|
|
|
#define SLASH_STRING "/"
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-05-15 00:03:38 +00:00
|
|
|
|
/* Provide default definitions of PIDGET, TIDGET, and MERGEPID.
|
|
|
|
|
The name ``TIDGET'' is a historical accident. Many uses of TIDGET
|
|
|
|
|
in the code actually refer to a lightweight process id, i.e,
|
|
|
|
|
something that can be considered a process id in its own right for
|
|
|
|
|
certain purposes. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
#ifndef PIDGET
|
2001-05-15 00:03:38 +00:00
|
|
|
|
#define PIDGET(PTID) (ptid_get_pid (PTID))
|
|
|
|
|
#define TIDGET(PTID) (ptid_get_lwp (PTID))
|
|
|
|
|
#define MERGEPID(PID, TID) ptid_build (PID, TID, 0)
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
1999-08-09 21:36:23 +00:00
|
|
|
|
/* Define well known filenos if the system does not define them. */
|
|
|
|
|
#ifndef STDIN_FILENO
|
|
|
|
|
#define STDIN_FILENO 0
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef STDOUT_FILENO
|
|
|
|
|
#define STDOUT_FILENO 1
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef STDERR_FILENO
|
|
|
|
|
#define STDERR_FILENO 2
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-08-31 01:14:27 +00:00
|
|
|
|
/* If this definition isn't overridden by the header files, assume
|
|
|
|
|
that isatty and fileno exist on this system. */
|
|
|
|
|
#ifndef ISATTY
|
|
|
|
|
#define ISATTY(FP) (isatty (fileno (FP)))
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-09-19 16:22:39 +00:00
|
|
|
|
/* Ensure that V is aligned to an N byte boundary (B's assumed to be a
|
|
|
|
|
power of 2). Round up/down when necessary. Examples of correct
|
|
|
|
|
use include:
|
|
|
|
|
|
|
|
|
|
addr = align_up (addr, 8); -- VALUE needs 8 byte alignment
|
|
|
|
|
write_memory (addr, value, len);
|
|
|
|
|
addr += len;
|
|
|
|
|
|
|
|
|
|
and:
|
|
|
|
|
|
|
|
|
|
sp = align_down (sp - len, 16); -- Keep SP 16 byte aligned
|
|
|
|
|
write_memory (sp, value, len);
|
|
|
|
|
|
|
|
|
|
Note that uses such as:
|
|
|
|
|
|
|
|
|
|
write_memory (addr, value, len);
|
|
|
|
|
addr += align_up (len, 8);
|
|
|
|
|
|
|
|
|
|
and:
|
|
|
|
|
|
|
|
|
|
sp -= align_up (len, 8);
|
|
|
|
|
write_memory (sp, value, len);
|
|
|
|
|
|
|
|
|
|
are typically not correct as they don't ensure that the address (SP
|
|
|
|
|
or ADDR) is correctly aligned (relying on previous alignment to
|
|
|
|
|
keep things right). This is also why the methods are called
|
|
|
|
|
"align_..." instead of "round_..." as the latter reads better with
|
|
|
|
|
this incorrect coding style. */
|
|
|
|
|
|
|
|
|
|
extern ULONGEST align_up (ULONGEST v, int n);
|
|
|
|
|
extern ULONGEST align_down (ULONGEST v, int n);
|
|
|
|
|
|
gdb/
* Makefile.in (gdbtypes_h, gdbtypes.o, utils.o): Update.
* defs.h (hashtab_obstack_allocate, dummy_obstack_deallocate): Add
prototypes.
* dwarf2read.c (read_subroutine_type): Use TYPE_ZALLOC.
(hashtab_obstack_allocate, dummy_obstack_deallocate): Moved to...
* utils.c (hashtab_obstack_allocate, dummy_obstack_deallocate):
...here.
* gdbtypes.c: Include "hashtab.h".
(build_gdbtypes): Remove extra prototype.
(struct type_pair, type_pair_hash, type_pair_eq)
(create_copied_types_hash, copy_type_recursive): New.
* gdbtypes.h: Include "hashtab.h".
(TYPE_ZALLOC): New.
(create_copied_types_hash, copy_type_recursive): New prototypes.
* objfiles.c (free_objfile): Call preserve_values.
* symfile.c (reread_symbols): Likewise.
(clear_symtab_users): Remove calls to clear_value_history and
clear_internalvars.
* value.c (clear_value_history, clear_internalvars): Removed.
(preserve_one_value, preserve_values): New functions.
* value.h (clear_value_history, clear_internalvars): Removed.
(preserve_values): New prototype.
* tracepoint.c (_initialize_tracepoint): Do not initialize convenience
variables here.
gdb/doc/
* gdb.texinfo (Files): Remove obsolete bits from the description
of "symbol-file".
2006-02-01 23:14:11 +00:00
|
|
|
|
/* Allocation and deallocation functions for the libiberty hash table
|
|
|
|
|
which use obstacks. */
|
|
|
|
|
void *hashtab_obstack_allocate (void *data, size_t size, size_t count);
|
|
|
|
|
void dummy_obstack_deallocate (void *object, void *data);
|
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
|
#endif /* #ifndef DEFS_H */
|