/* Core dump and executable file functions below target vector, for GDB.
- Copyright (C) 1986-2015 Free Software Foundation, Inc.
+ Copyright (C) 1986-2016 Free Software Foundation, Inc.
This file is part of GDB.
bfd *temp_bfd;
int scratch_chan;
int flags;
- volatile struct gdb_exception except;
char *filename;
target_preopen (from_tty);
may be a thread_stratum target loaded on top of target core by
now. The layer above should claim threads found in the BFD
sections. */
- TRY_CATCH (except, RETURN_MASK_ERROR)
+ TRY
{
target_update_thread_list ();
}
- if (except.reason < 0)
- exception_print (gdb_stderr, except);
+ CATCH (except, RETURN_MASK_ERROR)
+ {
+ exception_print (gdb_stderr, except);
+ }
+ END_CATCH
p = bfd_core_file_failing_command (core_bfd);
if (p)
anything about threads. That is why the test is >= 2. */
if (thread_count () >= 2)
{
- TRY_CATCH (except, RETURN_MASK_ERROR)
+ TRY
{
thread_command (NULL, from_tty);
}
- if (except.reason < 0)
- exception_print (gdb_stderr, except);
+ CATCH (except, RETURN_MASK_ERROR)
+ {
+ exception_print (gdb_stderr, except);
+ }
+ END_CATCH
}
}
section_name);
}
- contents = alloca (size);
+ contents = (char *) alloca (size);
if (! bfd_get_section_contents (core_bfd, section, contents,
(file_ptr) 0, size))
{
static void
add_to_spuid_list (bfd *abfd, asection *asect, void *list_p)
{
- struct spuid_list *list = list_p;
+ struct spuid_list *list = (struct spuid_list *) list_p;
enum bfd_endian byte_order
= bfd_big_endian (abfd) ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
int fd, pos = 0;
return 0;
}
+/* Implement the to_remove_breakpoint method. */
+
+static int
+core_remove_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch,
+ struct bp_target_info *bp_tgt,
+ enum remove_bp_reason reason)
+{
+ return 0;
+}
+
/* Okay, let's be honest: threads gleaned from a core file aren't
exactly lively, are they? On the other hand, if we don't claim
return buf;
}
+static const char *
+core_thread_name (struct target_ops *self, struct thread_info *thr)
+{
+ if (core_gdbarch
+ && gdbarch_core_thread_name_p (core_gdbarch))
+ return gdbarch_core_thread_name (core_gdbarch, thr);
+ return NULL;
+}
+
static int
core_has_memory (struct target_ops *ops)
{
core_ops.to_xfer_partial = core_xfer_partial;
core_ops.to_files_info = core_files_info;
core_ops.to_insert_breakpoint = ignore;
- core_ops.to_remove_breakpoint = ignore;
+ core_ops.to_remove_breakpoint = core_remove_breakpoint;
core_ops.to_thread_alive = core_thread_alive;
core_ops.to_read_description = core_read_description;
core_ops.to_pid_to_str = core_pid_to_str;
+ core_ops.to_thread_name = core_thread_name;
core_ops.to_stratum = process_stratum;
core_ops.to_has_memory = core_has_memory;
core_ops.to_has_stack = core_has_stack;