/* General utility routines for GDB, the GNU debugger.
- Copyright (C) 1986-2015 Free Software Foundation, Inc.
+ Copyright (C) 1986-2016 Free Software Foundation, Inc.
This file is part of GDB.
static void
do_bfd_close_cleanup (void *arg)
{
- gdb_bfd_unref (arg);
+ gdb_bfd_unref ((bfd *) arg);
}
struct cleanup *
static void
do_fclose_cleanup (void *arg)
{
- FILE *file = arg;
+ FILE *file = (FILE *) arg;
fclose (file);
}
static void
do_obstack_free (void *arg)
{
- struct obstack *ob = arg;
+ struct obstack *ob = (struct obstack *) arg;
obstack_free (ob, NULL);
}
static void
do_ui_file_delete (void *arg)
{
- ui_file_delete (arg);
+ ui_file_delete ((struct ui_file *) arg);
}
struct cleanup *
static void
do_ui_out_redirect_pop (void *arg)
{
- struct ui_out *uiout = arg;
+ struct ui_out *uiout = (struct ui_out *) arg;
if (ui_out_redirect (uiout, NULL) < 0)
warning (_("Cannot restore redirection of the current output protocol"));
static void
do_free_section_addr_info (void *arg)
{
- free_section_addr_info (arg);
+ free_section_addr_info ((struct section_addr_info *) arg);
}
struct cleanup *
static void
restore_integer (void *p)
{
- struct restore_integer_closure *closure = p;
+ struct restore_integer_closure *closure
+ = (struct restore_integer_closure *) p;
*(closure->variable) = closure->value;
}
static void
do_unpush_target (void *arg)
{
- struct target_ops *ops = arg;
+ struct target_ops *ops = (struct target_ops *) arg;
unpush_target (ops);
}
static void
do_htab_delete_cleanup (void *htab_voidp)
{
- htab_t htab = htab_voidp;
+ htab_t htab = (htab_t) htab_voidp;
htab_delete (htab);
}
static void
do_restore_ui_file (void *p)
{
- struct restore_ui_file_closure *closure = p;
+ struct restore_ui_file_closure *closure
+ = (struct restore_ui_file_closure *) p;
*(closure->variable) = closure->value;
}
static void
do_value_free (void *value)
{
- value_free (value);
+ value_free ((struct value *) value);
}
/* Free VALUE. */
static void
do_free_so (void *arg)
{
- struct so_list *so = arg;
+ struct so_list *so = (struct so_list *) arg;
free_so (so);
}
void
free_current_contents (void *ptr)
{
- void **location = ptr;
+ void **location = (void **) ptr;
if (location == NULL)
internal_error (__FILE__, __LINE__,
/* Print a host address. */
void
-gdb_print_host_address (const void *addr, struct ui_file *stream)
+gdb_print_host_address_1 (const void *addr, struct ui_file *stream)
{
fprintf_filtered (stream, "%s", host_address_to_string (addr));
}
static void
do_regfree_cleanup (void *r)
{
- regfree (r);
+ regfree ((regex_t *) r);
}
/* Create a new cleanup that frees the compiled regular expression R. */
\f
/* Print the character C on STREAM as part of the contents of a literal
string whose delimiter is QUOTER. Note that this routine should only
- be call for printing things which are independent of the language
+ be called for printing things which are independent of the language
of the program being debugged.
printchar will normally escape backslashes and instances of QUOTER. If
Only try to use tgetnum function if rl_get_screen_size
did not return a useful value. */
if (((rows <= 0) && (tgetnum ("li") < 0))
- /* Also disable paging if inside EMACS. */
- || getenv ("EMACS"))
+ /* Also disable paging if inside Emacs. $EMACS was used
+ before Emacs v25.1, $INSIDE_EMACS is used since then. */
+ || getenv ("EMACS") || getenv ("INSIDE_EMACS"))
{
/* The number of lines per page is not mentioned in the terminal
description or EMACS evironment variable is set. This probably
while (*p == ' ' || *p == '\t')
++p;
if (p[0] == 'q')
- quit ();
+ /* Do not call quit here; there is no possibility of SIGINT. */
+ throw_quit ("Quit");
xfree (ignore);
}
immediate_quit--;
hashval_t
core_addr_hash (const void *ap)
{
- const CORE_ADDR *addrp = ap;
+ const CORE_ADDR *addrp = (const CORE_ADDR *) ap;
return *addrp;
}
int
core_addr_eq (const void *ap, const void *bp)
{
- const CORE_ADDR *addr_ap = ap;
- const CORE_ADDR *addr_bp = bp;
+ const CORE_ADDR *addr_ap = (const CORE_ADDR *) ap;
+ const CORE_ADDR *addr_bp = (const CORE_ADDR *) bp;
return *addr_ap == *addr_bp;
}
static void
do_free_char_ptr_vec (void *arg)
{
- VEC (char_ptr) *char_ptr_vec = arg;
+ VEC (char_ptr) *char_ptr_vec = (VEC (char_ptr) *) arg;
free_char_ptr_vec (char_ptr_vec);
}
/* Replace '\' by '/' in both strings. */
- pattern_slash = alloca (strlen (pattern) + 1);
+ pattern_slash = (char *) alloca (strlen (pattern) + 1);
strcpy (pattern_slash, pattern);
pattern = pattern_slash;
for (; *pattern_slash != 0; pattern_slash++)
if (IS_DIR_SEPARATOR (*pattern_slash))
*pattern_slash = '/';
- string_slash = alloca (strlen (string) + 1);
+ string_slash = (char *) alloca (strlen (string) + 1);
strcpy (string_slash, string);
string = string_slash;
for (; *string_slash != 0; string_slash++)