From 6938d9ab5938f24b49d1757b7426edfe267ce063 Mon Sep 17 00:00:00 2001 From: John Marino Date: Fri, 11 May 2012 08:03:31 +0200 Subject: [PATCH] gdb: Temporarily revert modifications for branch merge These four files don't merge with the vendor branch cleanly, so the plan is to: 1) revert 2) merge vendor branch 3) reapply update versions --- contrib/gdb-7/gdb/defs.h | 5 ----- contrib/gdb-7/gdb/inferior.c | 33 ++++++++++++++++----------------- contrib/gdb-7/gdb/inferior.h | 2 -- contrib/gdb-7/gdb/mi/mi-main.c | 12 ++++++------ 4 files changed, 22 insertions(+), 30 deletions(-) diff --git a/contrib/gdb-7/gdb/defs.h b/contrib/gdb-7/gdb/defs.h index 19b4780d94..9531c5adad 100644 --- a/contrib/gdb-7/gdb/defs.h +++ b/contrib/gdb-7/gdb/defs.h @@ -984,7 +984,6 @@ enum gdb_osabi GDB_OSABI_NETBSD_AOUT, GDB_OSABI_NETBSD_ELF, GDB_OSABI_OPENBSD_ELF, - GDB_OSABI_DRAGONFLY, GDB_OSABI_WINCE, GDB_OSABI_GO32, GDB_OSABI_IRIX, @@ -1257,8 +1256,4 @@ void dummy_obstack_deallocate (void *object, void *data); extern void initialize_progspace (void); extern void initialize_inferiors (void); -/* For DragonFly kgdb */ - -extern int kernel_debugger; - #endif /* #ifndef DEFS_H */ diff --git a/contrib/gdb-7/gdb/inferior.c b/contrib/gdb-7/gdb/inferior.c index 3d4286e3a0..48bb1814fc 100644 --- a/contrib/gdb-7/gdb/inferior.c +++ b/contrib/gdb-7/gdb/inferior.c @@ -138,7 +138,7 @@ add_inferior_silent (int pid) observer_notify_inferior_added (inf); - if (pid != FAKE_PROCESS_ID) + if (pid != 0) inferior_appeared (inf, pid); return inf; @@ -274,7 +274,7 @@ exit_inferior_1 (struct inferior *inftoex, int silent) so that the observers have a chance to look it up. */ observer_notify_inferior_exit (inf); - inf->pid = FAKE_PROCESS_ID; + inf->pid = 0; if (inf->vfork_parent != NULL) { inf->vfork_parent->vfork_child = NULL; @@ -338,7 +338,7 @@ discard_all_inferiors (void) for (inf = inferior_list; inf; inf = inf->next) { - if (inf->pid != FAKE_PROCESS_ID) + if (inf->pid != 0) exit_inferior_silent (inf->pid); } } @@ -360,10 +360,10 @@ find_inferior_pid (int pid) { struct inferior *inf; - /* Looking for a fake inferior pid is always wrong, and indicative of - a bug somewhere else. There may be more than one with fake pid, + /* Looking for inferior pid == 0 is always wrong, and indicative of + a bug somewhere else. There may be more than one with pid == 0, for instance. */ - gdb_assert (pid != FAKE_PROCESS_ID); + gdb_assert (pid != 0); for (inf = inferior_list; inf; inf = inf->next) if (inf->pid == pid) @@ -456,7 +456,7 @@ have_inferiors (void) struct inferior *inf; for (inf = inferior_list; inf; inf = inf->next) - if (inf->pid != FAKE_PROCESS_ID) + if (inf->pid != 0) return 1; return 0; @@ -468,7 +468,7 @@ have_live_inferiors (void) struct inferior *inf; for (inf = inferior_list; inf; inf = inf->next) - if (inf->pid != FAKE_PROCESS_ID) + if (inf->pid != 0) { struct thread_info *tp; @@ -495,7 +495,7 @@ prune_inferiors (void) { if (ss == current || !ss->removable - || (ss->pid != FAKE_PROCESS_ID)) + || ss->pid != 0) { ss_link = &ss->next; ss = *ss_link; @@ -577,11 +577,11 @@ print_inferior (struct ui_out *uiout, char *requested_inferiors) ui_out_field_int (uiout, "number", inf->num); - if (kernel_debugger || (inf->pid != FAKE_PROCESS_ID)) + if (inf->pid) ui_out_field_string (uiout, "target-id", target_pid_to_str (pid_to_ptid (inf->pid))); else - ui_out_field_string (uiout, "target-id", ""); + ui_out_field_string (uiout, "target-id", ""); if (inf->pspace->ebfd) ui_out_field_string (uiout, "exec", @@ -703,7 +703,7 @@ inferior_command (char *args, int from_tty) ? bfd_get_filename (inf->pspace->ebfd) : _(""))); - if (inf->pid != FAKE_PROCESS_ID) + if (inf->pid != 0) { if (inf->pid != ptid_get_pid (inferior_ptid)) { @@ -730,9 +730,9 @@ inferior_command (char *args, int from_tty) set_current_program_space (inf->pspace); } - if (inf->pid != FAKE_PROCESS_ID && is_running (inferior_ptid)) + if (inf->pid != 0 && is_running (inferior_ptid)) ui_out_text (uiout, "(running)\n"); - else if (inf->pid != FAKE_PROCESS_ID) + else if (inf->pid != 0) { ui_out_text (uiout, "\n"); print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC); @@ -777,7 +777,7 @@ remove_inferior_command (char *args, int from_tty) continue; } - if (inf->pid != FAKE_PROCESS_ID) + if (inf->pid != 0) { warning (_("Can not remove active inferior %d."), num); continue; @@ -1070,8 +1070,7 @@ initialize_inferiors (void) can only allocate an inferior when all those modules have done that. Do this after initialize_progspace, due to the current_program_space reference. */ - - current_inferior_ = add_inferior (FAKE_PROCESS_ID); + current_inferior_ = add_inferior (0); current_inferior_->pspace = current_program_space; current_inferior_->aspace = current_program_space->aspace; diff --git a/contrib/gdb-7/gdb/inferior.h b/contrib/gdb-7/gdb/inferior.h index 21ae9a7b19..acae0f7f73 100644 --- a/contrib/gdb-7/gdb/inferior.h +++ b/contrib/gdb-7/gdb/inferior.h @@ -32,8 +32,6 @@ struct regcache; struct ui_out; struct terminal_info; -#define FAKE_PROCESS_ID -777 - /* For bpstat. */ #include "breakpoint.h" diff --git a/contrib/gdb-7/gdb/mi/mi-main.c b/contrib/gdb-7/gdb/mi/mi-main.c index 236fcb6639..ef6bfc3013 100644 --- a/contrib/gdb-7/gdb/mi/mi-main.c +++ b/contrib/gdb-7/gdb/mi/mi-main.c @@ -363,7 +363,7 @@ mi_cmd_exec_interrupt (char *command, char **argv, int argc) static int run_one_inferior (struct inferior *inf, void *arg) { - if (inf->pid != FAKE_PROCESS_ID) + if (inf->pid != 0) { if (inf->pid != ptid_get_pid (inferior_ptid)) { @@ -565,7 +565,7 @@ print_one_inferior (struct inferior *inferior, void *xdata) ui_out_field_fmt (uiout, "id", "i%d", inferior->num); ui_out_field_string (uiout, "type", "process"); - if (inferior->pid != FAKE_PROCESS_ID) + if (inferior->pid != 0) ui_out_field_int (uiout, "pid", inferior->pid); if (inferior->pspace->ebfd) @@ -575,7 +575,7 @@ print_one_inferior (struct inferior *inferior, void *xdata) } data.cores = 0; - if (inferior->pid != FAKE_PROCESS_ID) + if (inferior->pid != 0) { data.pid = inferior->pid; iterate_over_threads (collect_cores, &data); @@ -1784,7 +1784,7 @@ mi_cmd_remove_inferior (char *command, char **argv, int argc) if (!inf) error (_("the specified thread group does not exist")); - if (inf->pid != FAKE_PROCESS_ID) + if (inf->pid != 0) error (_("cannot remove an active inferior")); if (inf == current_inferior ()) @@ -1797,7 +1797,7 @@ mi_cmd_remove_inferior (char *command, char **argv, int argc) error (_("Cannot remove last inferior")); set_current_inferior (new_inferior); - if (new_inferior->pid != FAKE_PROCESS_ID) + if (new_inferior->pid != 0) tp = any_thread_of_process (new_inferior->pid); switch_to_thread (tp ? tp->ptid : null_ptid); set_current_program_space (new_inferior->pspace); @@ -2053,7 +2053,7 @@ mi_cmd_execute (struct mi_parse *parse) an inferior with multiple threads, then a random one will be picked. This is not a problem -- frontend should always provide --thread if it wishes to operate on a specific thread. */ - if (inf->pid != FAKE_PROCESS_ID) + if (inf->pid != 0) tp = any_thread_of_process (inf->pid); switch_to_thread (tp ? tp->ptid : null_ptid); set_current_program_space (inf->pspace); -- 2.41.0