From: Ondrej Oprala <ooprala@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: [PATCH 05/18] poison "private"
Date: Mon, 21 Oct 2013 15:37:00 -0000 [thread overview]
Message-ID: <1382369846-5817-6-git-send-email-ooprala@redhat.com> (raw)
In-Reply-To: <1382369846-5817-1-git-send-email-ooprala@redhat.com>
From: Tom Tromey <tromey@redhat.com>
gdb/ChangeLog
2013-10-21 Tom Tromey <tromey@redhat.com>
* gdbthread.h (struct thread_info): Rename field private to
private_data.
* inferior.c (struct inferior): Likewise.
* inferior.h (private_data): Renamed from private.
* jit.c (private_unwind): Likewise.
* linux-thread-db.c (thread): Rename field private to
private_data.
(private_thr): Renamed from private.
* nto-tdep.c (struct thread_info): Rename field private to
private_data.
* remote.c (struct thread_info): Likewise.
* thread.c (struct thread_info): Likewise.
---
gdb/gdbthread.h | 6 +++---
gdb/inferior.c | 2 +-
gdb/inferior.h | 2 +-
gdb/jit.c | 8 ++++----
gdb/linux-thread-db.c | 42 +++++++++++++++++++++---------------------
gdb/nto-tdep.c | 6 +++---
gdb/remote.c | 18 +++++++++---------
gdb/thread.c | 10 +++++-----
8 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 81dc7ed..eb4bac7 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -230,10 +230,10 @@ struct thread_info
struct frame_id initiating_frame;
/* Private data used by the target vector implementation. */
- struct private_thread_info *private;
+ struct private_thread_info *private_data;
- /* Function that is called to free PRIVATE. If this is NULL, then
- xfree will be called on PRIVATE. */
+ /* Function that is called to free PRIVATE_DATA. If this is NULL, then
+ xfree will be called on PRIVATE_DATA. */
void (*private_dtor) (struct private_thread_info *);
/* Branch trace information for this thread. */
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 28a5200..57004b2 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -102,7 +102,7 @@ free_inferior (struct inferior *inf)
xfree (inf->terminal);
free_environ (inf->environment);
target_desc_info_free (inf->tdesc_info);
- xfree (inf->private);
+ xfree (inf->private_data);
xfree (inf);
}
diff --git a/gdb/inferior.h b/gdb/inferior.h
index fff072b..7c5e1ea 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -486,7 +486,7 @@ struct inferior
struct continuation *continuations;
/* Private data used by the target vector implementation. */
- struct private_inferior *private;
+ struct private_inferior *private_data;
/* HAS_EXIT_CODE is true if the inferior exited with an exit code.
In this case, the EXIT_CODE field is also valid. */
diff --git a/gdb/jit.c b/gdb/jit.c
index 4eb818c..2048391 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -1216,20 +1216,20 @@ static void
jit_frame_this_id (struct frame_info *this_frame, void **cache,
struct frame_id *this_id)
{
- struct jit_unwind_private private;
+ struct jit_unwind_private private_unwind;
struct gdb_frame_id frame_id;
struct gdb_reader_funcs *funcs;
struct gdb_unwind_callbacks callbacks;
- private.registers = NULL;
- private.this_frame = this_frame;
+ private_unwind.registers = NULL;
+ private_unwind.this_frame = this_frame;
/* We don't expect the frame_id function to set any registers, so we
set reg_set to NULL. */
callbacks.reg_get = jit_unwind_reg_get_impl;
callbacks.reg_set = NULL;
callbacks.target_read = jit_target_read_impl;
- callbacks.priv_data = &private;
+ callbacks.priv_data = &private_unwind;
gdb_assert (loaded_jit_reader);
funcs = loaded_jit_reader->functions;
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 593fc29..960e07d 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -375,7 +375,7 @@ have_threads_callback (struct thread_info *thread, void *args)
if (ptid_get_pid (thread->ptid) != pid)
return 0;
- return thread->private != NULL;
+ return thread->private_data != NULL;
}
static int
@@ -1224,7 +1224,7 @@ static int
attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
const td_thrinfo_t *ti_p)
{
- struct private_thread_info *private;
+ struct private_thread_info *private_thr;
struct thread_info *tp;
td_err_e err;
struct thread_db_info *info;
@@ -1249,9 +1249,9 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
PTRACE_EVENT_CLONE); assume the same mechanism notices thread
exit, so this can not be a stale thread recreated with the
same ID. */
- if (tp->private != NULL)
+ if (tp->private_data != NULL)
{
- if (!tp->private->dying)
+ if (!tp->private_data->dying)
return 0;
delete_thread (ptid);
@@ -1286,8 +1286,8 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
}
/* Construct the thread's private data. */
- private = xmalloc (sizeof (struct private_thread_info));
- memset (private, 0, sizeof (struct private_thread_info));
+ private_thr = xmalloc (sizeof (struct private_thread_info));
+ memset (private_thr, 0, sizeof (struct private_thread_info));
/* A thread ID of zero may mean the thread library has not initialized
yet. But we shouldn't even get here if that's the case. FIXME:
@@ -1295,16 +1295,16 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
list this will have to go somewhere else; maybe private == NULL
until the thread_db target claims it. */
gdb_assert (ti_p->ti_tid != 0);
- private->th = *th_p;
- private->tid = ti_p->ti_tid;
+ private_thr->th = *th_p;
+ private_thr->tid = ti_p->ti_tid;
if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
- private->dying = 1;
+ private_thr->dying = 1;
/* Add the thread to GDB's thread list. */
if (tp == NULL)
- add_thread_with_info (ptid, private);
+ add_thread_with_info (ptid, private_thr);
else
- tp->private = private;
+ tp->private_data = private_thr;
info = get_thread_db_info (ptid_get_pid (ptid));
@@ -1335,8 +1335,8 @@ detach_thread (ptid_t ptid)
something re-uses its thread ID. We'll report the thread exit
when the underlying LWP dies. */
thread_info = find_thread_ptid (ptid);
- gdb_assert (thread_info != NULL && thread_info->private != NULL);
- thread_info->private->dying = 1;
+ gdb_assert (thread_info != NULL && thread_info->private_data != NULL);
+ thread_info->private_data->dying = 1;
}
static void
@@ -1598,7 +1598,7 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
ptid = ptid_build (info->pid, ti.ti_lid, 0);
tp = find_thread_ptid (ptid);
- if (tp == NULL || tp->private == NULL)
+ if (tp == NULL || tp->private_data == NULL)
{
if (attach_thread (ptid, th_p, &ti))
cb_data->new_threads += 1;
@@ -1741,12 +1741,12 @@ thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid)
struct thread_info *thread_info = find_thread_ptid (ptid);
struct target_ops *beneath;
- if (thread_info != NULL && thread_info->private != NULL)
+ if (thread_info != NULL && thread_info->private_data != NULL)
{
static char buf[64];
thread_t tid;
- tid = thread_info->private->tid;
+ tid = thread_info->private_data->tid;
snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)",
tid, ptid_get_lwp (ptid));
@@ -1766,10 +1766,10 @@ thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid)
static char *
thread_db_extra_thread_info (struct thread_info *info)
{
- if (info->private == NULL)
+ if (info->private_data == NULL)
return NULL;
- if (info->private->dying)
+ if (info->private_data->dying)
return "Exiting";
return NULL;
@@ -1794,7 +1794,7 @@ thread_db_get_thread_local_address (struct target_ops *ops,
/* Find the matching thread. */
thread_info = find_thread_ptid (ptid);
- if (thread_info != NULL && thread_info->private != NULL)
+ if (thread_info != NULL && thread_info->private_data != NULL)
{
td_err_e err;
psaddr_t address;
@@ -1814,7 +1814,7 @@ thread_db_get_thread_local_address (struct target_ops *ops,
/* Note the cast through uintptr_t: this interface only works if
a target address fits in a psaddr_t, which is a host pointer.
So a 32-bit debugger can not access 64-bit TLS through this. */
- err = info->td_thr_tls_get_addr_p (&thread_info->private->th,
+ err = info->td_thr_tls_get_addr_p (&thread_info->private_data->th,
(psaddr_t)(uintptr_t) lm,
offset, &address);
@@ -1857,7 +1857,7 @@ thread_db_find_thread_from_tid (struct thread_info *thread, void *data)
{
long *tid = (long *) data;
- if (thread->private->tid == *tid)
+ if (thread->private_data->tid == *tid)
return 1;
return 0;
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index 5ec746d..117443c 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -366,9 +366,9 @@ static const char *nto_thread_state_str[] =
char *
nto_extra_thread_info (struct thread_info *ti)
{
- if (ti && ti->private
- && ti->private->state < ARRAY_SIZE (nto_thread_state_str))
- return (char *)nto_thread_state_str [ti->private->state];
+ if (ti && ti->private_data
+ && ti->private_data->state < ARRAY_SIZE (nto_thread_state_str))
+ return (char *)nto_thread_state_str [ti->private_data->state];
return "";
}
diff --git a/gdb/remote.c b/gdb/remote.c
index a2e8a01..34c7edf 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1657,15 +1657,15 @@ demand_private_info (ptid_t ptid)
gdb_assert (info);
- if (!info->private)
+ if (!info->private_data)
{
- info->private = xmalloc (sizeof (*(info->private)));
+ info->private_data = xmalloc (sizeof (*(info->private_data)));
info->private_dtor = free_private_thread_info;
- info->private->core = -1;
- info->private->extra = 0;
+ info->private_data->core = -1;
+ info->private_data->extra = 0;
}
- return info->private;
+ return info->private_data;
}
/* Call this function as a result of
@@ -2885,8 +2885,8 @@ remote_threads_extra_info (struct thread_info *tp)
{
struct thread_info *info = find_thread_ptid (tp->ptid);
- if (info && info->private)
- return info->private->extra;
+ if (info && info->private_data)
+ return info->private_data->extra;
else
return NULL;
}
@@ -11122,8 +11122,8 @@ remote_core_of_thread (struct target_ops *ops, ptid_t ptid)
{
struct thread_info *info = find_thread_ptid (ptid);
- if (info && info->private)
- return info->private->core;
+ if (info && info->private_data)
+ return info->private_data->core;
return -1;
}
diff --git a/gdb/thread.c b/gdb/thread.c
index 64a57c5..aae8cfb 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -139,12 +139,12 @@ clear_thread_inferior_resources (struct thread_info *tp)
static void
free_thread (struct thread_info *tp)
{
- if (tp->private)
+ if (tp->private_data)
{
if (tp->private_dtor)
- tp->private_dtor (tp->private);
+ tp->private_dtor (tp->private_data);
else
- xfree (tp->private);
+ xfree (tp->private_data);
}
xfree (tp->name);
@@ -244,11 +244,11 @@ add_thread_silent (ptid_t ptid)
}
struct thread_info *
-add_thread_with_info (ptid_t ptid, struct private_thread_info *private)
+add_thread_with_info (ptid_t ptid, struct private_thread_info *private_data)
{
struct thread_info *result = add_thread_silent (ptid);
- result->private = private;
+ result->private_data = private_data;
if (print_thread_events)
printf_unfiltered (_("[New %s]\n"), target_pid_to_str (ptid));
--
1.8.3.1
next prev parent reply other threads:[~2013-10-21 15:37 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-21 15:37 [PATCH 00/18] -Wc++-compat patches v2.0 Ondrej Oprala
2013-10-21 15:37 ` [PATCH 14/18] poison "using" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 08/18] poison "mutable" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 02/18] poison "new" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 10/18] poison "operator" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 12/18] poison "try" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 03/18] poison "this" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 18/18] un-nest enum pvk Ondrej Oprala
2013-10-21 15:37 ` Ondrej Oprala [this message]
2013-10-21 15:37 ` [PATCH 07/18] poison "explicit" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 17/18] fix gdbarch buglet Ondrej Oprala
2013-10-21 16:00 ` Pedro Alves
2013-10-22 6:20 ` Ondrej Oprala
2013-10-21 15:37 ` [PATCH 13/18] poison "typename" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 15/18] fix up vec Ondrej Oprala
2013-10-21 15:37 ` [PATCH 01/18] poison "class" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 09/18] poison "namespace" Ondrej Oprala
2013-10-21 15:37 ` [PATCH 11/18] poison "template" Ondrej Oprala
2013-10-21 15:58 ` [PATCH 16/18] fix up gdbtypes.h Ondrej Oprala
2013-10-21 16:11 ` [PATCH 06/18] poison "delete" Ondrej Oprala
2013-10-21 17:00 ` [PATCH 04/18] poison "public" Ondrej Oprala
-- strict thread matches above, loose matches on Subject: below --
2013-10-09 17:17 [PATCH 00/18] -Wc++-compat patches Ondrej Oprala
2013-10-09 18:09 ` [PATCH 05/18] poison "private" Ondrej Oprala
2013-10-13 16:45 ` Jan Kratochvil
2013-10-14 8:49 ` Pedro Alves
2013-10-14 15:36 ` Tom Tromey
2013-10-14 16:19 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1382369846-5817-6-git-send-email-ooprala@redhat.com \
--to=ooprala@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).