X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fproc-service.c;h=5a25113f53cdfcc5ae71daafd89eb871c3cdb771;hb=e809353af1682550b6f19bdd0fe4a3628d7380cd;hp=630100dfbf23ebc14806a699670336fab5919da6;hpb=594f77850bb22a2cec4e8fc44c7ea735a6270eb2;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/proc-service.c b/gdb/proc-service.c index 630100dfbf..5a25113f53 100644 --- a/gdb/proc-service.c +++ b/gdb/proc-service.c @@ -1,12 +1,13 @@ /* implementation. - Copyright (C) 1999, 2000, 2002, 2007 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002, 2007, 2008, 2009, 2010, 2011 + Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,9 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include "defs.h" @@ -28,7 +27,6 @@ #include "regcache.h" #include "gdb_proc_service.h" -#include "gdb_stdint.h" #include @@ -99,7 +97,7 @@ ps_xfer_memory (const struct ps_prochandle *ph, psaddr_t addr, int ret; CORE_ADDR core_addr = ps_addr_to_core_addr (addr); - inferior_ptid = pid_to_ptid (ph->pid); + inferior_ptid = ph->ptid; if (write) ret = target_write_memory (core_addr, buf, len); @@ -191,6 +189,7 @@ ps_plog (const char *fmt, ...) va_start (args, fmt); vfprintf_filtered (gdb_stderr, fmt, args); + va_end (args); } /* Search for the symbol named NAME within the object named OBJ within @@ -259,8 +258,8 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset) struct cleanup *old_chain = save_inferior_ptid (); struct regcache *regcache; - inferior_ptid = BUILD_LWP (lwpid, ph->pid); - regcache = get_thread_regcache (inferior_ptid); + inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid)); + regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); target_fetch_registers (regcache, -1); fill_gregset (regcache, (gdb_gregset_t *) gregset, -1); @@ -278,8 +277,8 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset) struct cleanup *old_chain = save_inferior_ptid (); struct regcache *regcache; - inferior_ptid = BUILD_LWP (lwpid, ph->pid); - regcache = get_thread_regcache (inferior_ptid); + inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid)); + regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); supply_gregset (regcache, (const gdb_gregset_t *) gregset); target_store_registers (regcache, -1); @@ -298,8 +297,8 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, struct cleanup *old_chain = save_inferior_ptid (); struct regcache *regcache; - inferior_ptid = BUILD_LWP (lwpid, ph->pid); - regcache = get_thread_regcache (inferior_ptid); + inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid)); + regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); target_fetch_registers (regcache, -1); fill_fpregset (regcache, (gdb_fpregset_t *) fpregset, -1); @@ -318,8 +317,8 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, struct cleanup *old_chain = save_inferior_ptid (); struct regcache *regcache; - inferior_ptid = BUILD_LWP (lwpid, ph->pid); - regcache = get_thread_regcache (inferior_ptid); + inferior_ptid = BUILD_LWP (lwpid, ptid_get_pid (ph->ptid)); + regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); supply_fpregset (regcache, (const gdb_fpregset_t *) fpregset); target_store_registers (regcache, -1); @@ -334,9 +333,12 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, pid_t ps_getpid (gdb_ps_prochandle_t ph) { - return ph->pid; + return ptid_get_pid (ph->ptid); } +/* Provide a prototype to silence -Wmissing-prototypes. */ +extern initialize_file_ftype _initialize_proc_service; + void _initialize_proc_service (void) {