From: Joel Brobecker <brobecker@adacore.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 4/4] Delete unused functions in sol-thread.c.
Date: Thu, 20 Sep 2012 21:43:00 -0000 [thread overview]
Message-ID: <20120920214340.GB5423@adacore.com> (raw)
In-Reply-To: <505B52EA.5080908@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1409 bytes --]
> Can you expand on what "unused" means?
Good question!
> The Solaris man page I peeked at says these functions are SPARC only.
> Does this mean that current SPARC Solaris libthread_db doesn't call them
> after all? What about older versions?
It took me a while to investigate this part because our sparc-solaris
machines are just sooooo sloooooowwww. Initially, I thought it might
have been something related to OS versions, but the answer was right
there in front of me, if I had tested the patch on *sparc* solaris
(in addition to *x86* solaris).
Basically, /usr/include/proc_service.h:
#if defined(__sparc) || defined(__sparcv9)
extern ps_err_e ps_lgetxregsize(struct ps_prochandle *, lwpid_t, int *);
extern ps_err_e ps_lgetxregs(struct ps_prochandle *, lwpid_t, caddr_t);
extern ps_err_e ps_lsetxregs(struct ps_prochandle *, lwpid_t, caddr_t);
#endif
In other words, these routines are used on sparc-solaris, while they
are not expected on x86-solaris.
I propose we start with the following patch (0001-[...].patch),
and while at it, we remove all the commented out code (0002-[...]).
This is a stop-gap measure to allow the build to work with -Werror
on x86-solaris.
And the next step I propose, to finish the work, is to move these
functions to their own file (sol-sparc-thread.c). We would then
only build that file for sparc-solaris native GDB.
WDYT?
Thanks,
--
Joel
[-- Attachment #2: 0001-sol-thread.c-conditionalize-some-sparc-specific-libt.patch --]
[-- Type: text/x-diff, Size: 1051 bytes --]
From 01b5ab3a4c11703220543e16e21f140f2eaf33e2 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Thu, 20 Sep 2012 17:28:01 -0400
Subject: [PATCH 1/2] sol-thread.c: conditionalize some sparc-specific libthread_db functions.
gdb/ChangeLog:
* sol-thread.c (ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs):
Enable this code for sparc hosts only.
---
gdb/sol-thread.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 78dcec3..323a122 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -984,6 +984,8 @@ ps_plog (const char *fmt, ...)
vfprintf_filtered (gdb_stderr, fmt, args);
}
+#if defined(__sparc) || defined(__sparcv9)
+
/* Get size of extra register set. Currently a noop. */
ps_err_e
@@ -1058,6 +1060,8 @@ ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
return PS_OK;
}
+#endif /* defined(__sparc) || defined(__sparcv9) */
+
/* Get floating-point registers for LWP. */
ps_err_e
--
1.7.0.4
[-- Attachment #3: 0002-sol-thread.c-Remove-if-0-ed-code.patch --]
[-- Type: text/x-diff, Size: 2143 bytes --]
From 5ecc0d7df0ea8f2d53304326147a2a82220de2e8 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Thu, 20 Sep 2012 17:29:35 -0400
Subject: [PATCH 2/2] sol-thread.c: Remove #if 0-ed code.
gdb/ChangeLog:
* sol-thread.c (ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs):
Remove commented-out code.
---
gdb/sol-thread.c | 50 --------------------------------------------------
1 files changed, 0 insertions(+), 50 deletions(-)
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 323a122..b86079f 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -991,26 +991,6 @@ ps_plog (const char *fmt, ...)
ps_err_e
ps_lgetxregsize (gdb_ps_prochandle_t ph, lwpid_t lwpid, int *xregsize)
{
-#if 0
- int lwp_fd;
- int regsize;
- ps_err_e val;
-
- val = get_lwp_fd (ph, lwpid, &lwp_fd);
- if (val != PS_OK)
- return val;
-
- if (ioctl (lwp_fd, PIOCGXREGSIZE, ®size))
- {
- if (errno == EINVAL)
- return PS_NOFREGS; /* XXX Wrong code, but this is the closest
- thing in proc_service.h */
-
- print_sys_errmsg ("ps_lgetxregsize (): PIOCGXREGSIZE", errno);
- return PS_ERR;
- }
-#endif
-
return PS_OK;
}
@@ -1019,21 +999,6 @@ ps_lgetxregsize (gdb_ps_prochandle_t ph, lwpid_t lwpid, int *xregsize)
ps_err_e
ps_lgetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
{
-#if 0
- int lwp_fd;
- ps_err_e val;
-
- val = get_lwp_fd (ph, lwpid, &lwp_fd);
- if (val != PS_OK)
- return val;
-
- if (ioctl (lwp_fd, PIOCGXREG, xregset))
- {
- print_sys_errmsg ("ps_lgetxregs (): PIOCGXREG", errno);
- return PS_ERR;
- }
-#endif
-
return PS_OK;
}
@@ -1042,21 +1007,6 @@ ps_lgetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
ps_err_e
ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
{
-#if 0
- int lwp_fd;
- ps_err_e val;
-
- val = get_lwp_fd (ph, lwpid, &lwp_fd);
- if (val != PS_OK)
- return val;
-
- if (ioctl (lwp_fd, PIOCSXREG, xregset))
- {
- print_sys_errmsg ("ps_lsetxregs (): PIOCSXREG", errno);
- return PS_ERR;
- }
-#endif
-
return PS_OK;
}
--
1.7.0.4
next prev parent reply other threads:[~2012-09-20 21:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-20 16:34 Various build-related fixes for solaris Joel Brobecker
2012-09-20 16:34 ` [PATCH 2/4] Make procfs.c:proc_get_LDT_entry static Joel Brobecker
2012-09-27 12:55 ` checked in: " Joel Brobecker
2012-09-20 16:34 ` [PATCH 1/4] Fix declaration of proc_find_memory_regions Joel Brobecker
2012-09-27 12:55 ` checked in: " Joel Brobecker
2012-09-20 16:34 ` [PATCH 3/4] Add procfs_find_LDT_entry declaration (procfs.h) Joel Brobecker
2012-09-22 14:22 ` Jan Kratochvil
2012-09-27 12:56 ` checked in: " Joel Brobecker
2012-09-20 16:44 ` [PATCH 4/4] Delete unused functions in sol-thread.c Joel Brobecker
2012-09-20 17:31 ` Pedro Alves
2012-09-20 21:43 ` Joel Brobecker [this message]
2012-09-20 22:25 ` Joel Brobecker
2012-09-20 22:25 ` Joel Brobecker
2012-09-24 16:27 ` Pedro Alves
2012-09-24 16:37 ` Joel Brobecker
2012-09-27 13:02 ` checked in: New unit sparc-sol-thread.c extracted from sol-thread.c Joel Brobecker
2012-09-24 16:18 ` [PATCH 4/4] Delete unused functions in sol-thread.c Pedro Alves
2012-09-24 16:40 ` Joel Brobecker
2012-09-27 13:04 ` checked in: sol-thread.c: Remove commented-out code Joel Brobecker
2012-09-27 12:59 ` checked in: [PATCH 4/4] Delete unused functions in sol-thread.c Joel Brobecker
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=20120920214340.GB5423@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@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