public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 6/6] Remove an empty-body 'if' statement
  2014-01-06  3:56 [PATCH 0/6 OBV] Fix compilation errors for hurd Yao Qi
                   ` (4 preceding siblings ...)
  2014-01-06  3:56 ` [PATCH 2/6] Remove declaration of inf_tid_to_proc Yao Qi
@ 2014-01-06  3:56 ` Yao Qi
  2014-01-06 16:44 ` [PATCH 0/6 OBV] Fix compilation errors for hurd Tom Tromey
  6 siblings, 0 replies; 9+ messages in thread
From: Yao Qi @ 2014-01-06  3:56 UTC (permalink / raw)
  To: gdb-patches

This patch removes the if statement and the comments together.

gdb:

2014-01-06  Yao Qi  <yao@codesourcery.com>

	* gnu-nat.c (set_exceptions_cmd): Remove an empty body 'if'
	statement.
---
 gdb/gnu-nat.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 7397ec8..f8c8e68 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -3002,10 +3002,6 @@ set_exceptions_cmd (char *args, int from_tty)
   struct inf *inf = cur_inf ();
   int val = parse_bool_arg (args, "set exceptions");
 
-  if (inf->task && inf->want_exceptions != val)
-    /* Make this take effect immediately in a running process.  */
-    /* XXX */ ;
-
   inf->want_exceptions = val;
 }
 
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 3/6] Make functions static.
  2014-01-06  3:56 [PATCH 0/6 OBV] Fix compilation errors for hurd Yao Qi
@ 2014-01-06  3:56 ` Yao Qi
  2014-01-06  3:56 ` [PATCH 4/6] Use void for empty argument list in trace_me Yao Qi
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Yao Qi @ 2014-01-06  3:56 UTC (permalink / raw)
  To: gdb-patches

gdb:

2014-01-05  Yao Qi  <yao@codesourcery.com>

	* gnu-nat.c (make_inf) Update declaration.
	(make_inf): Make it static.
	(inf_set_traced): Likewise.
	(inf_port_to_thread, inf_task_died_status): Likewise.
---
 gdb/gnu-nat.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 7be059f..ff7df8d 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -87,7 +87,7 @@ int gnu_debug_flag = 0;
 
 /* Forward decls */
 
-struct inf *make_inf ();
+static struct inf *make_inf ();
 void inf_clear_wait (struct inf *inf);
 void inf_cleanup (struct inf *inf);
 void inf_startup (struct inf *inf, int pid);
@@ -637,7 +637,7 @@ _proc_free (struct proc *proc)
 }
 
 \f
-struct inf *
+static struct inf *
 make_inf (void)
 {
   struct inf *inf = xmalloc (sizeof (struct inf));
@@ -873,7 +873,7 @@ inf_validate_task_sc (struct inf *inf)
    is.  If INF is running, the resume_sc count of INF's threads will
    be modified, and the signal thread will briefly be run to change
    the trace state.  */
-void
+static void
 inf_set_traced (struct inf *inf, int on)
 {
   if (on == inf->traced)
@@ -974,7 +974,7 @@ inf_tid_to_thread (struct inf *inf, int tid)
 }
 
 /* Converts a thread port to a struct proc.  */
-struct proc *
+static struct proc *
 inf_port_to_thread (struct inf *inf, mach_port_t port)
 {
   struct proc *thread = inf->threads;
@@ -1742,7 +1742,7 @@ S_exception_raise_request (mach_port_t port, mach_port_t reply_port,
 \f
 /* Fill in INF's wait field after a task has died without giving us more
    detailed information.  */
-void
+static void
 inf_task_died_status (struct inf *inf)
 {
   warning (_("Pid %d died with unknown exit status, using SIGKILL."),
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 0/6 OBV] Fix compilation errors for hurd
@ 2014-01-06  3:56 Yao Qi
  2014-01-06  3:56 ` [PATCH 3/6] Make functions static Yao Qi
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Yao Qi @ 2014-01-06  3:56 UTC (permalink / raw)
  To: gdb-patches

I cross compile native GDB for hurd to make sure my changes in target.h don't
break its build.  However, I find some errors on building a clean GDB
checkout for hurd.

This patch series is to fix these errors.  They are all obvious and
I'll push them in three days.

The cross compiler I am using is i686-pc-gnu-gcc (GCC) 4.8.0 20120318
(experimental).

*** BLURB HERE ***

Yao Qi (6):
  Fix no previous prototype for '_initialize_gnu_nat' [-Werror=missing-prototypes]
  Remove declaration of inf_tid_to_proc
  Make functions static.
  Use void for empty argument list in trace_me
  Add qualifier 'const' to argument args
  Remove an empty-body 'if' statement

 gdb/gnu-nat.c |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 5/6] Add qualifier 'const' to argument args
  2014-01-06  3:56 [PATCH 0/6 OBV] Fix compilation errors for hurd Yao Qi
                   ` (2 preceding siblings ...)
  2014-01-06  3:56 ` [PATCH 1/6] Fix no previous prototype for '_initialize_gnu_nat' [-Werror=missing-prototypes] Yao Qi
@ 2014-01-06  3:56 ` Yao Qi
  2014-01-06  3:56 ` [PATCH 2/6] Remove declaration of inf_tid_to_proc Yao Qi
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Yao Qi @ 2014-01-06  3:56 UTC (permalink / raw)
  To: gdb-patches

This patch fixes the following error.

../../../git/gdb/gnu-nat.c: In function 'info_port_rights':
../../../git/gdb/gnu-nat.c:3083:11: error: passing argument 1 of 'parse_to_comma_and_eval' from incompatible pointer type [-Werror]
In file included from ../../../git/gdb/breakpoint.h:23:0,
                 from ../../../git/gdb/inferior.h:37,
                 from ../../../git/gdb/gnu-nat.c:55:
../../../git/gdb/value.h:763:22: note: expected 'const char **' but argument is of type 'char **'

gdb:

2014-01-06  Yao Qi  <yao@codesourcery.com>

	* gnu-nat.c (info_port_rights): Add qualifier const to
	argument args.
---
 gdb/gnu-nat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 7948677..7397ec8 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -3070,7 +3070,7 @@ set_noninvasive_cmd (char *args, int from_tty)
 
 \f
 static void
-info_port_rights (char *args, mach_port_type_t only)
+info_port_rights (const char *args, mach_port_type_t only)
 {
   struct inf *inf = active_inf ();
   struct value *vmark = value_mark ();
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 4/6] Use void for empty argument list in trace_me
  2014-01-06  3:56 [PATCH 0/6 OBV] Fix compilation errors for hurd Yao Qi
  2014-01-06  3:56 ` [PATCH 3/6] Make functions static Yao Qi
@ 2014-01-06  3:56 ` Yao Qi
  2014-01-06  3:56 ` [PATCH 1/6] Fix no previous prototype for '_initialize_gnu_nat' [-Werror=missing-prototypes] Yao Qi
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Yao Qi @ 2014-01-06  3:56 UTC (permalink / raw)
  To: gdb-patches

This patch fixes the following error:

../../../git/gdb/gnu-nat.c: In function 'trace_me':
../../../git/gdb/gnu-nat.c:2106:8: error: old-style function definition [-Werror=old-style-definition]

gdb:

2014-01-05  Yao Qi  <yao@codesourcery.com>

	* gnu-nat.c (trace_me): Use 'void' for empty argument list.
---
 gdb/gnu-nat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index ff7df8d..7948677 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2103,7 +2103,7 @@ gnu_create_inferior (struct target_ops *ops,
   struct inf *inf = cur_inf ();
   int pid;
 
-  void trace_me ()
+  void trace_me (void)
   {
     /* We're in the child; make this process stop as soon as it execs.  */
     inf_debug (inf, "tracing self");
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 2/6] Remove declaration of inf_tid_to_proc
  2014-01-06  3:56 [PATCH 0/6 OBV] Fix compilation errors for hurd Yao Qi
                   ` (3 preceding siblings ...)
  2014-01-06  3:56 ` [PATCH 5/6] Add qualifier 'const' to argument args Yao Qi
@ 2014-01-06  3:56 ` Yao Qi
  2014-01-06  3:56 ` [PATCH 6/6] Remove an empty-body 'if' statement Yao Qi
  2014-01-06 16:44 ` [PATCH 0/6 OBV] Fix compilation errors for hurd Tom Tromey
  6 siblings, 0 replies; 9+ messages in thread
From: Yao Qi @ 2014-01-06  3:56 UTC (permalink / raw)
  To: gdb-patches

inf_tid_to_proc is not defined at all.  This patch is to remove its
declaration.
gdb:

2014-01-06  Yao Qi  <yao@codesourcery.com>

	* gnu-nat.c (inf_tid_to_proc): Remove declaration.
---
 gdb/gnu-nat.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 73e26f9..7be059f 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -96,7 +96,6 @@ void inf_set_pid (struct inf *inf, pid_t pid);
 void inf_validate_procs (struct inf *inf);
 void inf_steal_exc_ports (struct inf *inf);
 void inf_restore_exc_ports (struct inf *inf);
-struct proc *inf_tid_to_proc (struct inf *inf, int tid);
 void inf_set_threads_resume_sc (struct inf *inf,
 				struct proc *run_thread,
 				int run_others);
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/6] Fix no previous prototype for '_initialize_gnu_nat' [-Werror=missing-prototypes]
  2014-01-06  3:56 [PATCH 0/6 OBV] Fix compilation errors for hurd Yao Qi
  2014-01-06  3:56 ` [PATCH 3/6] Make functions static Yao Qi
  2014-01-06  3:56 ` [PATCH 4/6] Use void for empty argument list in trace_me Yao Qi
@ 2014-01-06  3:56 ` Yao Qi
  2014-01-06  3:56 ` [PATCH 5/6] Add qualifier 'const' to argument args Yao Qi
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Yao Qi @ 2014-01-06  3:56 UTC (permalink / raw)
  To: gdb-patches

This patch fixes this error below by declaring _initialize_gnu_nat.

../../../git/gdb/gnu-nat.c:3447:1: error: no previous prototype for '_initialize_gnu_nat' [-Werror=missing-prototypes]

gdb:

2014-01-06  Yao Qi  <yao@codesourcery.com>

	* gnu-nat.c (_initialize_gnu_nat): Declare.
---
 gdb/gnu-nat.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 08eee66..73e26f9 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -3439,6 +3439,10 @@ to the thread's initial suspend-count when gdb notices the threads."),
 }
 
 \f
+
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_gnu_nat;
+
 void
 _initialize_gnu_nat (void)
 {
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/6 OBV] Fix compilation errors for hurd
  2014-01-06  3:56 [PATCH 0/6 OBV] Fix compilation errors for hurd Yao Qi
                   ` (5 preceding siblings ...)
  2014-01-06  3:56 ` [PATCH 6/6] Remove an empty-body 'if' statement Yao Qi
@ 2014-01-06 16:44 ` Tom Tromey
  2014-01-07  7:14   ` Yao Qi
  6 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2014-01-06 16:44 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> I cross compile native GDB for hurd to make sure my changes in
Yao> target.h don't break its build.  However, I find some errors on
Yao> building a clean GDB checkout for hurd.

Yao> This patch series is to fix these errors.  They are all obvious and
Yao> I'll push them in three days.

They're all fine by me FWIW.

Patch #6 removes a "FIXME"-type comment.  Not sure if you want to
preserve the comment or not?  Either way is ok with me.

Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/6 OBV] Fix compilation errors for hurd
  2014-01-06 16:44 ` [PATCH 0/6 OBV] Fix compilation errors for hurd Tom Tromey
@ 2014-01-07  7:14   ` Yao Qi
  0 siblings, 0 replies; 9+ messages in thread
From: Yao Qi @ 2014-01-07  7:14 UTC (permalink / raw)
  To: gdb-patches

On 01/07/2014 12:44 AM, Tom Tromey wrote:
> Patch #6 removes a "FIXME"-type comment.  Not sure if you want to
> preserve the comment or not?  Either way is ok with me.

OK, I preserve it in the updated patch.  All of them are pushed.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-01-07  7:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-06  3:56 [PATCH 0/6 OBV] Fix compilation errors for hurd Yao Qi
2014-01-06  3:56 ` [PATCH 3/6] Make functions static Yao Qi
2014-01-06  3:56 ` [PATCH 4/6] Use void for empty argument list in trace_me Yao Qi
2014-01-06  3:56 ` [PATCH 1/6] Fix no previous prototype for '_initialize_gnu_nat' [-Werror=missing-prototypes] Yao Qi
2014-01-06  3:56 ` [PATCH 5/6] Add qualifier 'const' to argument args Yao Qi
2014-01-06  3:56 ` [PATCH 2/6] Remove declaration of inf_tid_to_proc Yao Qi
2014-01-06  3:56 ` [PATCH 6/6] Remove an empty-body 'if' statement Yao Qi
2014-01-06 16:44 ` [PATCH 0/6 OBV] Fix compilation errors for hurd Tom Tromey
2014-01-07  7:14   ` Yao Qi

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).