diff options
author | Joseph Myers <joseph@codesourcery.com> | 2007-12-16 22:19:21 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2007-12-16 22:19:21 +0000 |
commit | c162e8c9a4969b6fe9492c8dcc4293f3973f674d (patch) | |
tree | 1d391c880cf4b8fccf6edffe32a17df9aeb70e96 /gdb/procfs.c | |
parent | 4e799345942e3d777a2639a00892b67d084204c5 (diff) | |
download | gdb-c162e8c9a4969b6fe9492c8dcc4293f3973f674d.zip gdb-c162e8c9a4969b6fe9492c8dcc4293f3973f674d.tar.gz gdb-c162e8c9a4969b6fe9492c8dcc4293f3973f674d.tar.bz2 |
2007-12-16 Daniel Jacobowitz <dan@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
* configure.ac: Check for *-*-solaris2.1[[0-9]]* instead of
*-*-solaris2.1[[0-9]].
* configure: Regenerate.
* procfs.c (proc_set_current_signal): If redelivering a signal,
reuse the current siginfo if possible.
testsuite:
* gdb.base/siginfo-addr.exp, gdb.base/siginfo-addr.c: New.
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r-- | gdb/procfs.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c index e288459..4bd1fa8 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -2485,6 +2485,8 @@ proc_set_current_signal (procinfo *pi, int signo) char sinfo[sizeof (gdb_siginfo_t)]; } arg; gdb_siginfo_t *mysinfo; + ptid_t wait_ptid; + struct target_waitstatus wait_status; /* * We should never have to apply this operation to any procinfo @@ -2508,10 +2510,31 @@ proc_set_current_signal (procinfo *pi, int signo) /* The pointer is just a type alias. */ mysinfo = (gdb_siginfo_t *) &arg.sinfo; - mysinfo->si_signo = signo; - mysinfo->si_code = 0; - mysinfo->si_pid = getpid (); /* ?why? */ - mysinfo->si_uid = getuid (); /* ?why? */ + get_last_target_status (&wait_ptid, &wait_status); + if (ptid_equal (wait_ptid, inferior_ptid) + && wait_status.kind == TARGET_WAITKIND_STOPPED + && wait_status.value.sig == target_signal_from_host (signo) + && proc_get_status (pi) +#ifdef NEW_PROC_API + && pi->prstatus.pr_lwp.pr_info.si_signo == signo +#else + && pi->prstatus.pr_info.si_signo == signo +#endif + ) + /* Use the siginfo associated with the signal being + redelivered. */ +#ifdef NEW_PROC_API + memcpy (mysinfo, &pi->prstatus.pr_lwp.pr_info, sizeof (gdb_siginfo_t)); +#else + memcpy (mysinfo, &pi->prstatus.pr_info, sizeof (gdb_siginfo_t)); +#endif + else + { + mysinfo->si_signo = signo; + mysinfo->si_code = 0; + mysinfo->si_pid = getpid (); /* ?why? */ + mysinfo->si_uid = getuid (); /* ?why? */ + } #ifdef NEW_PROC_API arg.cmd = PCSSIG; |