X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fcorelow.c;h=059ce2f6ebd33b994191b34f1e0cb7095567f2ea;hb=cf4088a92f240b01e6db8f39a5a3abfa918f6f2c;hp=c6175279da9b5df4a006adff63b2251c240cf885;hpb=06333fea767dc1eaf88ac286293fcbaa0ef2de9e;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/corelow.c b/gdb/corelow.c index c6175279da..059ce2f6eb 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -260,11 +260,9 @@ core_target::close () { if (core_bfd) { - int pid = ptid_get_pid (inferior_ptid); inferior_ptid = null_ptid; /* Avoid confusion from thread stuff. */ - if (pid != 0) - exit_inferior_silent (pid); + exit_inferior_silent (current_inferior ()); /* Clear out solib state while the bfd is still open. See comments in clear_solib in solib.c. */ @@ -312,7 +310,7 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg) inf->fake_pid_p = fake_pid_p; } - ptid = ptid_build (pid, lwpid, 0); + ptid = ptid_t (pid, lwpid, 0); add_thread (ptid); @@ -360,7 +358,6 @@ core_target_open (const char *arg, int from_tty) { const char *p; int siggy; - struct cleanup *old_chain; int scratch_chan; int flags; @@ -446,7 +443,7 @@ core_target_open (const char *arg, int from_tty) bfd_map_over_sections (core_bfd, add_to_thread_list, bfd_get_section_by_name (core_bfd, ".reg")); - if (ptid_equal (inferior_ptid, null_ptid)) + if (inferior_ptid == null_ptid) { /* Either we found no .reg/NN section, and hence we have a non-threaded core (single-threaded, from gdb's perspective), @@ -454,16 +451,16 @@ core_target_open (const char *arg, int from_tty) which was the "main" thread. The latter case shouldn't usually happen, but we're dealing with input here, which can always be broken in different ways. */ - struct thread_info *thread = first_thread_of_process (-1); + thread_info *thread = first_thread_of_inferior (current_inferior ()); if (thread == NULL) { inferior_appeared (current_inferior (), CORELOW_PID); - inferior_ptid = pid_to_ptid (CORELOW_PID); + inferior_ptid = ptid_t (CORELOW_PID); add_thread_silent (inferior_ptid); } else - switch_to_thread (thread->ptid); + switch_to_thread (thread); } post_create_inferior (target, from_tty); @@ -704,8 +701,8 @@ core_target::fetch_registers (struct regcache *regcache, int regno) /* Mark all registers not found in the core as unavailable. */ for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++) - if (regcache_register_status (regcache, i) == REG_UNKNOWN) - regcache_raw_supply (regcache, i, NULL); + if (regcache->get_register_status (i) == REG_UNKNOWN) + regcache->raw_supply (i, NULL); } void @@ -950,9 +947,9 @@ core_target::xfer_partial (enum target_object object, const char *annex, return TARGET_XFER_E_IO; default: - return this->beneath->xfer_partial (object, annex, readbuf, - writebuf, offset, len, - xfered_len); + return this->beneath ()->xfer_partial (object, annex, readbuf, + writebuf, offset, len, + xfered_len); } } @@ -987,7 +984,7 @@ core_target::read_description () return result; } - return this->beneath->read_description (); + return this->beneath ()->read_description (); } const char * @@ -1007,9 +1004,9 @@ core_target::pid_to_str (ptid_t ptid) "process", with normal_pid_to_str. */ /* Try the LWPID field first. */ - pid = ptid_get_lwp (ptid); + pid = ptid.lwp (); if (pid != 0) - return normal_pid_to_str (pid_to_ptid (pid)); + return normal_pid_to_str (ptid_t (pid)); /* Otherwise, this isn't a "threaded" core -- use the PID field, but only if it isn't a fake PID. */