Changeset View
Changeset View
Standalone View
Standalone View
devel/gdb/files/kgdb/fbsd-kvm.c
Show First 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | if (elf_elfheader(abfd)->e_ident[EI_OSABI] != ELFOSABI_FREEBSD) | ||||
return (GDB_OSABI_UNKNOWN); | return (GDB_OSABI_UNKNOWN); | ||||
/* FreeBSD ELF kernels have an interpreter path of "/red/herring". */ | /* FreeBSD ELF kernels have an interpreter path of "/red/herring". */ | ||||
bufp = buf; | bufp = buf; | ||||
s = bfd_get_section_by_name(abfd, ".interp"); | s = bfd_get_section_by_name(abfd, ".interp"); | ||||
if (s != NULL && bfd_section_size(abfd, s) == sizeof(buf) && | if (s != NULL && bfd_section_size(abfd, s) == sizeof(buf) && | ||||
bfd_get_full_section_contents(abfd, s, &bufp) && | bfd_get_full_section_contents(abfd, s, &bufp) && | ||||
memcmp(buf, KERNEL_INTERP, sizeof(buf)) == 0) | memcmp(buf, KERNEL_INTERP, sizeof(buf)) == 0) | ||||
return (GDB_OSABI_FREEBSD_ELF_KERNEL); | return (GDB_OSABI_FREEBSD_KERNEL); | ||||
return (GDB_OSABI_UNKNOWN); | return (GDB_OSABI_UNKNOWN); | ||||
} | } | ||||
#ifdef HAVE_KVM_OPEN2 | #ifdef HAVE_KVM_OPEN2 | ||||
static int | static int | ||||
kgdb_resolve_symbol(const char *name, kvaddr_t *kva) | kgdb_resolve_symbol(const char *name, kvaddr_t *kva) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | kgdb_trgt_detach(struct target_ops *ops, const char *args, int from_tty) | ||||
if (args) | if (args) | ||||
error ("Too many arguments"); | error ("Too many arguments"); | ||||
unpush_target(&kgdb_trgt_ops); | unpush_target(&kgdb_trgt_ops); | ||||
reinit_frame_cache(); | reinit_frame_cache(); | ||||
if (from_tty) | if (from_tty) | ||||
printf_filtered("No vmcore file now.\n"); | printf_filtered("No vmcore file now.\n"); | ||||
} | } | ||||
static char * | static const char * | ||||
kgdb_trgt_extra_thread_info(struct target_ops *ops, struct thread_info *ti) | kgdb_trgt_extra_thread_info(struct target_ops *ops, struct thread_info *ti) | ||||
{ | { | ||||
return (kgdb_thr_extra_thread_info(ptid_get_tid(ti->ptid))); | return (kgdb_thr_extra_thread_info(ptid_get_tid(ti->ptid))); | ||||
} | } | ||||
static void | static void | ||||
kgdb_trgt_files_info(struct target_ops *target) | kgdb_trgt_files_info(struct target_ops *target) | ||||
Show All 23 Lines | if (kvm != NULL) | ||||
return; | return; | ||||
tb = find_target_beneath(ops); | tb = find_target_beneath(ops); | ||||
if (tb->to_update_thread_list != NULL) | if (tb->to_update_thread_list != NULL) | ||||
tb->to_update_thread_list(tb); | tb->to_update_thread_list(tb); | ||||
#endif | #endif | ||||
} | } | ||||
static char * | static const char * | ||||
kgdb_trgt_pid_to_str(struct target_ops *ops, ptid_t ptid) | kgdb_trgt_pid_to_str(struct target_ops *ops, ptid_t ptid) | ||||
{ | { | ||||
static char buf[33]; | static char buf[33]; | ||||
snprintf(buf, sizeof(buf), "Thread %ld", ptid_get_tid(ptid)); | snprintf(buf, sizeof(buf), "Thread %ld", ptid_get_tid(ptid)); | ||||
return (buf); | return (buf); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 183 Lines • Show Last 20 Lines |