/* GDB routines for supporting auto-loaded scripts.
- Copyright (C) 2012-2015 Free Software Foundation, Inc.
+ Copyright (C) 2012-2016 Free Software Foundation, Inc.
This file is part of GDB.
{
char *filename_copy, *pattern_copy;
- filename_copy = alloca (strlen (filename) + 1);
+ filename_copy = (char *) alloca (strlen (filename) + 1);
strcpy (filename_copy, filename);
- pattern_copy = alloca (strlen (pattern) + 1);
+ pattern_copy = (char *) alloca (strlen (pattern) + 1);
strcpy (pattern_copy, pattern);
return filename_is_in_pattern_1 (filename_copy, pattern_copy);
static void
auto_load_pspace_data_cleanup (struct program_space *pspace, void *arg)
{
- struct auto_load_pspace_info *info = arg;
+ struct auto_load_pspace_info *info = (struct auto_load_pspace_info *) arg;
if (info->loaded_script_files)
htab_delete (info->loaded_script_files);
{
struct auto_load_pspace_info *info;
- info = program_space_data (pspace, auto_load_pspace_data);
+ info = ((struct auto_load_pspace_info *)
+ program_space_data (pspace, auto_load_pspace_data));
if (info == NULL)
{
info = XCNEW (struct auto_load_pspace_info);
static hashval_t
hash_loaded_script_entry (const void *data)
{
- const struct loaded_script *e = data;
+ const struct loaded_script *e = (const struct loaded_script *) data;
return htab_hash_string (e->name) ^ htab_hash_pointer (e->language);
}
static int
eq_loaded_script_entry (const void *a, const void *b)
{
- const struct loaded_script *ea = a;
- const struct loaded_script *eb = b;
+ const struct loaded_script *ea = (const struct loaded_script *) a;
+ const struct loaded_script *eb = (const struct loaded_script *) b;
return strcmp (ea->name, eb->name) == 0 && ea->language == eb->language;
}
char *p;
/* Allocate all space in one chunk so it's easier to free. */
- *slot = xmalloc (sizeof (**slot)
- + strlen (name) + 1
- + (full_path != NULL ? (strlen (full_path) + 1) : 0));
+ *slot = ((struct loaded_script *)
+ xmalloc (sizeof (**slot)
+ + strlen (name) + 1
+ + (full_path != NULL ? (strlen (full_path) + 1) : 0)));
p = ((char*) *slot) + sizeof (**slot);
strcpy (p, name);
(*slot)->name = p;
char *p;
/* Allocate all space in one chunk so it's easier to free. */
- *slot = xmalloc (sizeof (**slot) + strlen (name) + 1);
+ *slot = ((struct loaded_script *)
+ xmalloc (sizeof (**slot) + strlen (name) + 1));
p = ((char*) *slot) + sizeof (**slot);
strcpy (p, name);
(*slot)->name = p;
struct program_space *pspace = current_program_space;
struct auto_load_pspace_info *info;
- info = program_space_data (pspace, auto_load_pspace_data);
+ info = ((struct auto_load_pspace_info *)
+ program_space_data (pspace, auto_load_pspace_data));
if (info != NULL && info->loaded_script_files != NULL)
{
htab_delete (info->loaded_script_files);
const char *suffix = ext_lang_auto_load_suffix (language);
len = strlen (realname);
- filename = xmalloc (len + strlen (suffix) + 1);
+ filename = (char *) xmalloc (len + strlen (suffix) + 1);
memcpy (filename, realname, len);
strcpy (filename + len, suffix);
for (ix = 0; VEC_iterate (char_ptr, vec, ix, dir); ++ix)
{
- debugfile = xmalloc (strlen (dir) + strlen (filename) + 1);
+ debugfile = (char *) xmalloc (strlen (dir) + strlen (filename) + 1);
strcpy (debugfile, dir);
/* FILENAME is absolute, so we don't need a "/" here. */
{
objfile_script_executor_func *executor;
const char *newline, *script_text;
- char *name, *end;
+ char *name;
int is_safe, in_hash_table;
struct cleanup *cleanups;
{
/* Return immediately if auto-loading has been globally disabled.
This is to handle sequencing of operations during gdb startup.
- Also return immediately if OBJFILE is not actually a file. */
- if (!global_auto_load || (objfile->flags & OBJF_NOT_FILENAME) != 0)
+ Also return immediately if OBJFILE was not created from a file
+ on the local filesystem. */
+ if (!global_auto_load
+ || (objfile->flags & OBJF_NOT_FILENAME) != 0
+ || is_target_filename (objfile->original_name))
return;
/* Load any extension language scripts for this objfile.
static int
collect_matching_scripts (void **slot, void *info)
{
- struct loaded_script *script = *slot;
- struct collect_matching_scripts_data *data = info;
+ struct loaded_script *script = (struct loaded_script *) *slot;
+ struct collect_matching_scripts_data *data
+ = (struct collect_matching_scripts_data *) info;
if (script->language == data->language && re_exec (script->name))
VEC_safe_push (loaded_script_ptr, *data->scripts_p, script);
static void
print_scripts (VEC (loaded_script_ptr) *scripts)
{
- struct ui_out *uiout = current_uiout;
int i;
loaded_script_ptr script;