Module Name: src
Committed By: martin
Date: Sat Aug 30 14:13:08 UTC 2014
Modified Files:
src/external/gpl3/gdb/dist/gdb [netbsd-7]: sparc-nat.c
Log Message:
Pull up following revision(s) (requested by christos in ticket #70):
external/gpl3/gdb/dist/gdb/sparc-nat.c: revision 1.7
Cleanup the confusion with getting the pid of a sparc debugged process.
If the comments were correct, then this should be factored out to the
OS-specific native code, and the general code should remain sane.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.2.1 src/external/gpl3/gdb/dist/gdb/sparc-nat.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/gpl3/gdb/dist/gdb/sparc-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/sparc-nat.c:1.6 src/external/gpl3/gdb/dist/gdb/sparc-nat.c:1.6.2.1
--- src/external/gpl3/gdb/dist/gdb/sparc-nat.c:1.6 Tue Jul 15 17:35:54 2014
+++ src/external/gpl3/gdb/dist/gdb/sparc-nat.c Sat Aug 30 14:13:08 2014
@@ -142,22 +142,7 @@ sparc_fetch_inferior_registers (struct t
struct gdbarch *gdbarch = get_regcache_arch (regcache);
int pid;
- /* NOTE: cagney/2002-12-03: This code assumes that the currently
- selected light weight processes' registers can be written
- directly into the selected thread's register cache. This works
- fine when given an 1:1 LWP:thread model (such as found on
- GNU/Linux) but will, likely, have problems when used on an N:1
- (userland threads) or N:M (userland multiple LWP) model. In the
- case of the latter two, the LWP's registers do not necessarily
- belong to the selected thread (the LWP could be in the middle of
- executing the thread switch code).
-
- These functions should instead be paramaterized with an explicit
- object (struct regcache, struct thread_info?) into which the LWPs
- registers can be written. */
- pid = ptid_get_lwp (inferior_ptid);
- if (pid == 0)
- pid = ptid_get_pid (inferior_ptid);
+ pid = ptid_get_pid (inferior_ptid);
if (regnum == SPARC_G0_REGNUM)
{
@@ -197,11 +182,7 @@ sparc_store_inferior_registers (struct t
struct gdbarch *gdbarch = get_regcache_arch (regcache);
int pid;
- /* NOTE: cagney/2002-12-02: See comment in fetch_inferior_registers
- about threaded assumptions. */
- pid = ptid_get_lwp (inferior_ptid);
- if (pid == 0)
- pid = ptid_get_pid (inferior_ptid);
+ pid = ptid_get_pid (inferior_ptid);
if (regnum == -1 || sparc_gregset_supplies_p (gdbarch, regnum))
{
@@ -282,9 +263,7 @@ sparc_xfer_wcookie (struct target_ops *o
{
int pid;
- pid = ptid_get_lwp (inferior_ptid);
- if (pid == 0)
- pid = ptid_get_pid (inferior_ptid);
+ pid = ptid_get_pid (inferior_ptid);
/* Sanity check. The proper type for a cookie is register_t, but
we can't assume that this type exists on all systems supported