projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
i386: Align branches within a fixed boundary
[deliverable/binutils-gdb.git]
/
gdb
/
obsd-nat.c
diff --git
a/gdb/obsd-nat.c
b/gdb/obsd-nat.c
index 91bed717a56bd18af3eb90ee616497522743e276..0351f69a8dae3b7db7445e9822f87236797fea12 100644
(file)
--- a/
gdb/obsd-nat.c
+++ b/
gdb/obsd-nat.c
@@
-1,6
+1,6
@@
/* Native-dependent code for OpenBSD.
/* Native-dependent code for OpenBSD.
- Copyright (C) 2012-201
8
Free Software Foundation, Inc.
+ Copyright (C) 2012-201
9
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-24,7
+24,7
@@
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/ptrace.h>
-#include "gdb_wait.h"
+#include "gdb
support/gdb
_wait.h"
#include "inf-child.h"
#include "obsd-nat.h"
#include "inf-child.h"
#include "obsd-nat.h"
@@
-35,16
+35,11
@@
#ifdef PT_GET_THREAD_FIRST
#ifdef PT_GET_THREAD_FIRST
-const char *
+std::string
obsd_nat_target::pid_to_str (ptid_t ptid)
{
obsd_nat_target::pid_to_str (ptid_t ptid)
{
- if (ptid_get_lwp (ptid) != 0)
- {
- static char buf[64];
-
- xsnprintf (buf, sizeof buf, "thread %ld", ptid_get_lwp (ptid));
- return buf;
- }
+ if (ptid.lwp () != 0)
+ return string_printf ("thread %ld", ptid.lwp ());
return normal_pid_to_str (ptid);
}
return normal_pid_to_str (ptid);
}
@@
-52,7
+47,7
@@
obsd_nat_target::pid_to_str (ptid_t ptid)
void
obsd_nat_target::update_thread_list ()
{
void
obsd_nat_target::update_thread_list ()
{
- pid_t pid =
ptid_get_pid (inferior_ptid
);
+ pid_t pid =
inferior_ptid.pid (
);
struct ptrace_thread_state pts;
prune_threads ();
struct ptrace_thread_state pts;
prune_threads ();
@@
-62,11
+57,11
@@
obsd_nat_target::update_thread_list ()
while (pts.pts_tid != -1)
{
while (pts.pts_tid != -1)
{
- ptid_t ptid = ptid_
build
(pid, pts.pts_tid, 0);
+ ptid_t ptid = ptid_
t
(pid, pts.pts_tid, 0);
if (!in_thread_list (ptid))
{
if (!in_thread_list (ptid))
{
- if (
ptid_get_lwp (inferior_ptid
) == 0)
+ if (
inferior_ptid.lwp (
) == 0)
thread_change_ptid (inferior_ptid, ptid);
else
add_thread (ptid);
thread_change_ptid (inferior_ptid, ptid);
else
add_thread (ptid);
@@
-90,7
+85,7
@@
obsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
do
{
do
{
- pid = waitpid (ptid
_get_pid (ptid
), &status, 0);
+ pid = waitpid (ptid
.pid (
), &status, 0);
save_errno = errno;
}
while (pid == -1 && errno == EINTR);
save_errno = errno;
}
while (pid == -1 && errno == EINTR);
@@
-110,12
+105,12
@@
obsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
}
/* Ignore terminated detached child processes. */
}
/* Ignore terminated detached child processes. */
- if (!WIFSTOPPED (status) && pid !=
ptid_get_pid (inferior_ptid
))
+ if (!WIFSTOPPED (status) && pid !=
inferior_ptid.pid (
))
pid = -1;
}
while (pid == -1);
pid = -1;
}
while (pid == -1);
- ptid = p
id_to_ptid
(pid);
+ ptid = p
tid_t
(pid);
if (WIFSTOPPED (status))
{
if (WIFSTOPPED (status))
{
@@
-129,7
+124,7
@@
obsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
{
case PTRACE_FORK:
ourstatus->kind = TARGET_WAITKIND_FORKED;
{
case PTRACE_FORK:
ourstatus->kind = TARGET_WAITKIND_FORKED;
- ourstatus->value.related_pid = p
id_to_ptid
(pe.pe_other_pid);
+ ourstatus->value.related_pid = p
tid_t
(pe.pe_other_pid);
/* Make sure the other end of the fork is stopped too. */
fpid = waitpid (pe.pe_other_pid, &status, 0);
/* Make sure the other end of the fork is stopped too. */
fpid = waitpid (pe.pe_other_pid, &status, 0);
@@
-142,19
+137,19
@@
obsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
gdb_assert (pe.pe_report_event == PTRACE_FORK);
gdb_assert (pe.pe_other_pid == pid);
gdb_assert (pe.pe_report_event == PTRACE_FORK);
gdb_assert (pe.pe_other_pid == pid);
- if (fpid ==
ptid_get_pid (inferior_ptid
))
+ if (fpid ==
inferior_ptid.pid (
))
{
{
- ourstatus->value.related_pid = p
id_to_ptid
(pe.pe_other_pid);
- return p
id_to_ptid
(fpid);
+ ourstatus->value.related_pid = p
tid_t
(pe.pe_other_pid);
+ return p
tid_t
(fpid);
}
}
- return p
id_to_ptid
(pid);
+ return p
tid_t
(pid);
}
}
- ptid = ptid_
build
(pid, pe.pe_tid, 0);
+ ptid = ptid_
t
(pid, pe.pe_tid, 0);
if (!in_thread_list (ptid))
{
if (!in_thread_list (ptid))
{
- if (
ptid_get_lwp (inferior_ptid
) == 0)
+ if (
inferior_ptid.lwp (
) == 0)
thread_change_ptid (inferior_ptid, ptid);
else
add_thread (ptid);
thread_change_ptid (inferior_ptid, ptid);
else
add_thread (ptid);
This page took
0.031564 seconds
and
4
git commands to generate.