public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] Remove duplicated include in gdb directory
@ 2014-01-06  1:53 Honggyu Kim
  2014-01-06  3:46 ` Sergio Durigan Junior
  0 siblings, 1 reply; 8+ messages in thread
From: Honggyu Kim @ 2014-01-06  1:53 UTC (permalink / raw)
  To: gdb-patches; +Cc: Honggyu Kim

This patch simply removes duplicated include statements in gdb directory.
If there are two duplicated include statements, this patch keeps the first
include and removes the second include.
Those are found by checkincludes.pl tool in linux kernel and double checked
manually once again if the include statements are affected by ifdef macro.

Signed-off-by: Honggyu Kim <hong.gyu.kim@lge.com>
---
 gdb/ada-lang.c          |    1 -
 gdb/alphabsd-nat.c      |    1 -
 gdb/amd64-darwin-tdep.c |    2 --
 gdb/amd64fbsd-nat.c     |    1 -
 gdb/auto-load.c         |    1 -
 gdb/ax-gdb.c            |    1 -
 gdb/breakpoint.c        |    1 -
 gdb/dbxread.c           |    1 -
 gdb/fork-child.c        |    1 -
 gdb/gdb_usleep.c        |    1 -
 gdb/i386-darwin-tdep.c  |    2 --
 gdb/i386fbsd-nat.c      |    1 -
 gdb/infcmd.c            |    1 -
 gdb/inferior.c          |    1 -
 gdb/jv-lang.c           |    2 --
 gdb/linux-nat.c         |    2 --
 gdb/linux-tdep.c        |    1 -
 gdb/m68kbsd-nat.c       |    1 -
 gdb/m68klinux-nat.c     |    2 --
 gdb/microblaze-tdep.c   |    1 -
 gdb/mips-linux-tdep.c   |    1 -
 gdb/mn10300-tdep.c      |    1 -
 gdb/nto-tdep.c          |    2 --
 gdb/opencl-lang.c       |    1 -
 gdb/osdata.c            |    2 --
 gdb/printcmd.c          |    1 -
 gdb/regcache.c          |    1 -
 gdb/remote-m32r-sdi.c   |    1 -
 gdb/remote.c            |    1 -
 gdb/symfile.c           |    1 -
 gdb/symtab.c            |    1 -
 gdb/tilegx-linux-nat.c  |    5 +----
 gdb/tilegx-tdep.c       |    1 -
 gdb/tracepoint.c        |    2 --
 gdb/valops.c            |    2 --
 gdb/vaxbsd-nat.c        |    1 -
 gdb/windows-nat.c       |    1 -
 gdb/xtensa-tdep.c       |    1 -
 38 files changed, 1 insertion(+), 50 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index c14b684..e70a33b 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -64,7 +64,6 @@
 #include "value.h"
 #include "mi/mi-common.h"
 #include "arch-utils.h"
-#include "exceptions.h"
 #include "cli/cli-utils.h"
 
 /* Define whether or not the C operator '/' truncates towards zero for
diff --git a/gdb/alphabsd-nat.c b/gdb/alphabsd-nat.c
index 3a02bbd..00afa8a 100644
--- a/gdb/alphabsd-nat.c
+++ b/gdb/alphabsd-nat.c
@@ -157,7 +157,6 @@ alphabsd_store_inferior_registers (struct target_ops *ops,
 
 /* Support for debugging kernel virtual memory images.  */
 
-#include <sys/types.h>
 #include <sys/signal.h>
 #include <machine/pcb.h>
 
diff --git a/gdb/amd64-darwin-tdep.c b/gdb/amd64-darwin-tdep.c
index eb3adf2..5b897d2 100644
--- a/gdb/amd64-darwin-tdep.c
+++ b/gdb/amd64-darwin-tdep.c
@@ -33,8 +33,6 @@
 #include "amd64-tdep.h"
 #include "osabi.h"
 #include "ui-out.h"
-#include "symtab.h"
-#include "frame.h"
 #include "amd64-darwin-tdep.h"
 #include "i386-darwin-tdep.h"
 #include "solib.h"
diff --git a/gdb/amd64fbsd-nat.c b/gdb/amd64fbsd-nat.c
index e8ffd00..72dc39b 100644
--- a/gdb/amd64fbsd-nat.c
+++ b/gdb/amd64fbsd-nat.c
@@ -95,7 +95,6 @@ static int amd64fbsd32_r_reg_offset[I386_NUM_GREGS] =
 
 /* Support for debugging kernel virtual memory images.  */
 
-#include <sys/types.h>
 #include <machine/pcb.h>
 #include <osreldate.h>
 
diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index 4bb4ced..fd612b2 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -36,7 +36,6 @@
 #include "gdb_vecs.h"
 #include "readline/tilde.h"
 #include "completer.h"
-#include "observer.h"
 #include "fnmatch.h"
 #include "top.h"
 #include "filestuff.h"
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 94caa44..9e27265 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -34,7 +34,6 @@
 #include "block.h"
 #include "regcache.h"
 #include "user-regs.h"
-#include "language.h"
 #include "dictionary.h"
 #include "breakpoint.h"
 #include "tracepoint.h"
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 114762d..66a69b5 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -66,7 +66,6 @@
 #include "continuations.h"
 #include "stack.h"
 #include "skip.h"
-#include "gdb_regex.h"
 #include "ax-gdb.h"
 #include "dummy-frame.h"
 
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 1bab8b8..9a10a1f 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -58,7 +58,6 @@
 #include "block.h"
 
 #include "gdb_assert.h"
-#include <string.h>
 
 #include "aout/aout64.h"
 #include "aout/stab_gnu.h"	/* We always use GNU stabs, not
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index d4403b8..6c42d2e 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -27,7 +27,6 @@
 #include "gdb_wait.h"
 #include "gdb_vfork.h"
 #include "gdbcore.h"
-#include "terminal.h"
 #include "gdbthread.h"
 #include "command.h" /* for dont_repeat () */
 #include "gdbcmd.h"
diff --git a/gdb/gdb_usleep.c b/gdb/gdb_usleep.c
index e05fc43..5cd6bb0 100644
--- a/gdb/gdb_usleep.c
+++ b/gdb/gdb_usleep.c
@@ -18,7 +18,6 @@
 #include "defs.h"
 #include "gdb_usleep.h"
 #include "gdb_select.h"
-#include "gdb_usleep.h"
 
 #include <sys/time.h>
 
diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c
index dd982c4..f2c08d7 100644
--- a/gdb/i386-darwin-tdep.c
+++ b/gdb/i386-darwin-tdep.c
@@ -33,8 +33,6 @@
 #include "i386-tdep.h"
 #include "osabi.h"
 #include "ui-out.h"
-#include "symtab.h"
-#include "frame.h"
 #include "gdb_assert.h"
 #include "i386-darwin-tdep.h"
 #include "solib.h"
diff --git a/gdb/i386fbsd-nat.c b/gdb/i386fbsd-nat.c
index 3dee2fe..6d78171 100644
--- a/gdb/i386fbsd-nat.c
+++ b/gdb/i386fbsd-nat.c
@@ -82,7 +82,6 @@ i386fbsd_resume (struct target_ops *ops,
 
 /* Support for debugging kernel virtual memory images.  */
 
-#include <sys/types.h>
 #include <machine/pcb.h>
 
 #include "bsd-kvm.h"
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 648be74..2d50f41 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -32,7 +32,6 @@
 #include "gdbcore.h"
 #include "target.h"
 #include "language.h"
-#include "symfile.h"
 #include "objfiles.h"
 #include "completer.h"
 #include "ui-out.h"
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 83862d5..90d9649 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -27,7 +27,6 @@
 #include "gdbthread.h"
 #include "ui-out.h"
 #include "observer.h"
-#include "gdbthread.h"
 #include "gdbcore.h"
 #include "symfile.h"
 #include "environ.h"
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index 2bcc6b7..243a45a 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -23,8 +23,6 @@
 #include "expression.h"
 #include "parser-defs.h"
 #include "language.h"
-#include "gdbtypes.h"
-#include "symtab.h"
 #include "symfile.h"
 #include "objfiles.h"
 #include <string.h>
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index bf6f586..4dfb3ff 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -46,7 +46,6 @@
 #include "gregset.h"		/* for gregset */
 #include "gdbcore.h"		/* for get_exec_file */
 #include <ctype.h>		/* for isdigit */
-#include "gdbthread.h"		/* for struct thread_info etc.  */
 #include <sys/stat.h>		/* for struct stat */
 #include <fcntl.h>		/* for O_RDONLY */
 #include "inf-loop.h"
@@ -65,7 +64,6 @@
 #include "agent.h"
 #include "tracepoint.h"
 #include "exceptions.h"
-#include "linux-ptrace.h"
 #include "buffer.h"
 #include "target-descriptions.h"
 #include "filestuff.h"
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 4dbe3ed..bd1e5a2 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -32,7 +32,6 @@
 #include "cli/cli-utils.h"
 #include "arch-utils.h"
 #include "gdb_obstack.h"
-#include "cli/cli-utils.h"
 
 #include <ctype.h>
 
diff --git a/gdb/m68kbsd-nat.c b/gdb/m68kbsd-nat.c
index 311f3a8..dbd0e15 100644
--- a/gdb/m68kbsd-nat.c
+++ b/gdb/m68kbsd-nat.c
@@ -176,7 +176,6 @@ m68kbsd_store_inferior_registers (struct target_ops *ops,
 
 /* Support for debugging kernel virtual memory images.  */
 
-#include <sys/types.h>
 #include <machine/pcb.h>
 
 #include "bsd-kvm.h"
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index 0a8d400..a512a71 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -46,8 +46,6 @@
 
 #include "floatformat.h"
 
-#include "target.h"
-
 /* Prototypes for supply_gregset etc.  */
 #include "gregset.h"
 
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index 078cc32..efca90d 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -29,7 +29,6 @@
 #include "inferior.h"
 #include "regcache.h"
 #include "target.h"
-#include "frame.h"
 #include "frame-base.h"
 #include "frame-unwind.h"
 #include "dwarf2-frame.h"
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 0c41444..6c0459d 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -32,7 +32,6 @@
 #include "gdbtypes.h"
 #include "objfiles.h"
 #include "solib.h"
-#include "solib-svr4.h"
 #include "solist.h"
 #include "symtab.h"
 #include "target-descriptions.h"
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 61c7a5e..ac53ae4 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -26,7 +26,6 @@
 #include "gdb_assert.h"
 #include "gdbcore.h"	/* For write_memory_unsigned_integer.  */
 #include "value.h"
-#include "gdbtypes.h"
 #include "frame.h"
 #include "frame-unwind.h"
 #include "frame-base.h"
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index f12a208..cc61423 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -32,8 +32,6 @@
 #include "gdbcore.h"
 #include "objfiles.h"
 
-#include <string.h>
-
 #ifdef __CYGWIN__
 #include <sys/cygwin.h>
 #endif
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c
index f098b3f..8dbd4ce 100644
--- a/gdb/opencl-lang.c
+++ b/gdb/opencl-lang.c
@@ -24,7 +24,6 @@
 #include "symtab.h"
 #include "expression.h"
 #include "parser-defs.h"
-#include "symtab.h"
 #include "language.h"
 #include "varobj.h"
 #include "c-lang.h"
diff --git a/gdb/osdata.c b/gdb/osdata.c
index 467e2f1..887b4e3 100644
--- a/gdb/osdata.c
+++ b/gdb/osdata.c
@@ -45,8 +45,6 @@ osdata_parse (const char *xml)
 
 #else /* HAVE_LIBEXPAT */
 
-#include "xml-support.h"
-
 /* Internal parsing data passed to all XML callbacks.  */
 struct osdata_parsing_data
   {
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 2acc562..10d3c23 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -41,7 +41,6 @@
 #include "block.h"
 #include "disasm.h"
 #include "dfp.h"
-#include "valprint.h"
 #include "exceptions.h"
 #include "observer.h"
 #include "solist.h"
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 876039d..6c5915b 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -26,7 +26,6 @@
 #include "reggroups.h"
 #include "gdb_assert.h"
 #include <string.h>
-#include "gdbcmd.h"		/* For maintenanceprintlist.  */
 #include "observer.h"
 #include "exceptions.h"
 #include "remote.h"
diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c
index f5a0b5a..7b122d7 100644
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -37,7 +37,6 @@
 #endif
 #include <sys/types.h>
 #include <sys/time.h>
-#include <signal.h>
 #include <time.h>
 #include "gdb_bfd.h"
 #include "cli/cli-utils.h"
diff --git a/gdb/remote.c b/gdb/remote.c
index 3f51a93..8366c5d 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -46,7 +46,6 @@
 #include "gdb_bfd.h"
 #include "filestuff.h"
 
-#include <ctype.h>
 #include <sys/time.h>
 
 #include "event-loop.h"
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 4f0fea8..ddeefb7 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -57,7 +57,6 @@
 #include "stack.h"
 #include "gdb_bfd.h"
 #include "cli/cli-utils.h"
-#include "target.h"
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/gdb/symtab.c b/gdb/symtab.c
index f215586..acfdd46 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -60,7 +60,6 @@
 #include "solist.h"
 #include "macrotab.h"
 #include "macroscope.h"
-#include "ada-lang.h"
 
 #include "psymtab.h"
 #include "parser-defs.h"
diff --git a/gdb/tilegx-linux-nat.c b/gdb/tilegx-linux-nat.c
index 61bca3f..a00f386 100644
--- a/gdb/tilegx-linux-nat.c
+++ b/gdb/tilegx-linux-nat.c
@@ -30,15 +30,12 @@
 
 #include <sys/procfs.h>
 
+/* Defines ps_err_e, struct ps_prochandle.  */
 #include "gdb_proc_service.h"
-#include <sys/ptrace.h>
 
 /* Prototypes for supply_gregset etc.  */
 #include "gregset.h"
 
-/* Defines ps_err_e, struct ps_prochandle.  */
-#include "gdb_proc_service.h"
-
 /* The register sets used in GNU/Linux ELF core-dumps are identical to
    the register sets in `struct user' that is used for a.out
    core-dumps, and is also used by `ptrace'.  The corresponding types
diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
index 993b3f4..d2aae95 100644
--- a/gdb/tilegx-tdep.c
+++ b/gdb/tilegx-tdep.c
@@ -41,7 +41,6 @@
 #include "linux-tdep.h"
 #include "objfiles.h"
 #include "solib-svr4.h"
-#include "symtab.h"
 #include "tilegx-tdep.h"
 #include "opcode/tilegx.h"
 
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 198b6dd..582c284 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -45,7 +45,6 @@
 #include "filenames.h"
 #include "gdbthread.h"
 #include "stack.h"
-#include "gdbcore.h"
 #include "remote.h"
 #include "source.h"
 #include "ax.h"
@@ -55,7 +54,6 @@
 #include "cli/cli-utils.h"
 #include "probe.h"
 #include "ctf.h"
-#include "completer.h"
 #include "filestuff.h"
 
 /* readline include files */
diff --git a/gdb/valops.c b/gdb/valops.c
index fdae3ad..5382c49 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -39,10 +39,8 @@
 #include <errno.h>
 #include <string.h>
 #include "gdb_assert.h"
-#include "cp-support.h"
 #include "observer.h"
 #include "objfiles.h"
-#include "symtab.h"
 #include "exceptions.h"
 
 extern unsigned int overload_debug;
diff --git a/gdb/vaxbsd-nat.c b/gdb/vaxbsd-nat.c
index b8c4657..bc31eca 100644
--- a/gdb/vaxbsd-nat.c
+++ b/gdb/vaxbsd-nat.c
@@ -98,7 +98,6 @@ vaxbsd_store_inferior_registers (struct target_ops *ops,
 
 /* Support for debugging kernel virtual memory images.  */
 
-#include <sys/types.h>
 #include <machine/pcb.h>
 
 #include "bsd-kvm.h"
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index b57adaa..6cd2c46 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -43,7 +43,6 @@
 #include <sys/cygwin.h>
 #include <cygwin/version.h>
 #endif
-#include <signal.h>
 
 #include "buildsym.h"
 #include "filenames.h"
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
index e52b89d..432a9de 100644
--- a/gdb/xtensa-tdep.c
+++ b/gdb/xtensa-tdep.c
@@ -37,7 +37,6 @@
 #include "dwarf2.h"
 #include "dwarf2-frame.h"
 #include "dwarf2loc.h"
-#include "frame.h"
 #include "frame-base.h"
 #include "frame-unwind.h"
 
-- 
1.7.9.5

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

* Re: [PATCH v2] Remove duplicated include in gdb directory
  2014-01-06  1:53 [PATCH v2] Remove duplicated include in gdb directory Honggyu Kim
@ 2014-01-06  3:46 ` Sergio Durigan Junior
  2014-01-06  5:13   ` Honggyu Kim
  2014-01-06 16:37   ` Tom Tromey
  0 siblings, 2 replies; 8+ messages in thread
From: Sergio Durigan Junior @ 2014-01-06  3:46 UTC (permalink / raw)
  To: Honggyu Kim; +Cc: gdb-patches

On Sunday, January 05 2014, Honggyu Kim wrote:

> This patch simply removes duplicated include statements in gdb directory.
> If there are two duplicated include statements, this patch keeps the first
> include and removes the second include.
> Those are found by checkincludes.pl tool in linux kernel and double checked
> manually once again if the include statements are affected by ifdef macro.

Thanks for the patch, Honggyu.  I believe you have tested it by building
GDB with --enable-targets=all, right?

It needs a ChangeLog (mechanical), and it seems to be simple enough to
be committed without needing a copyright assignment (I don't see your
name in the MAINTAINERS file).

Other than that, let's wait for some maintainer to give the green
light.  BTW, if you want to get started on the process to obtain the
copyright assignment, mail me offlist and I can send you the
instructions.

Thanks,

-- 
Sergio

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

* RE: [PATCH v2] Remove duplicated include in gdb directory
  2014-01-06  3:46 ` Sergio Durigan Junior
@ 2014-01-06  5:13   ` Honggyu Kim
  2014-01-06  6:48     ` Honggyu Kim
  2014-01-06 14:55     ` Sergio Durigan Junior
  2014-01-06 16:37   ` Tom Tromey
  1 sibling, 2 replies; 8+ messages in thread
From: Honggyu Kim @ 2014-01-06  5:13 UTC (permalink / raw)
  To: 'Sergio Durigan Junior'; +Cc: gdb-patches

Thank you for your kind feedback.
I thought it's just a minor code cleanup so I didn't expect any copyright issues.

I have tried to build as below.
  $ ./configure --prefix=`pwd`/build
  $ make
and
  $ make distclean
  $ ./configure --prefix=`pwd`/build --enable-targets=all
  $ make

In both cases, build were fine and gdb binary is generated without problems.

However, when I tried to run gdb to debug just a simple hello world program, it fails.
But I found that the current HEAD also fails by showing the following message.
It seems to be very strange for me since it's not from the patch that I submitted.
I have tested the same thing after checkout a tag "gdb_7_6_2-2013-12-08-release" and it worked fine.
Please consider this issue separately or please correct me if I'm wrong.


$ cd build/bin/
$ ./gdb ./a.out
GNU gdb (GDB) 7.6.50.20140106-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./a.out...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/hong.gyu.kim/src/gdb/binutils-gdb/build/bin/a.out
*** glibc detected *** ./gdb: double free or corruption (out): 0x0000000003435860 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7fc88175db96]
./gdb[0x86b8a1]
./gdb(bfd_close+0x82)[0x86be52]
	...
Aborted (core dumped)
Hello, World



-----Original Message-----
From: Sergio Durigan Junior [mailto:sergiodj@redhat.com] 
Sent: Monday, January 06, 2014 12:47 PM
To: Honggyu Kim
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] Remove duplicated include in gdb directory

On Sunday, January 05 2014, Honggyu Kim wrote:

> This patch simply removes duplicated include statements in gdb directory.
> If there are two duplicated include statements, this patch keeps the first
> include and removes the second include.
> Those are found by checkincludes.pl tool in linux kernel and double checked
> manually once again if the include statements are affected by ifdef macro.

Thanks for the patch, Honggyu.  I believe you have tested it by building
GDB with --enable-targets=all, right?

It needs a ChangeLog (mechanical), and it seems to be simple enough to
be committed without needing a copyright assignment (I don't see your
name in the MAINTAINERS file).

Other than that, let's wait for some maintainer to give the green
light.  BTW, if you want to get started on the process to obtain the
copyright assignment, mail me offlist and I can send you the
instructions.

Thanks,

-- 
Sergio

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

* RE: [PATCH v2] Remove duplicated include in gdb directory
  2014-01-06  5:13   ` Honggyu Kim
@ 2014-01-06  6:48     ` Honggyu Kim
  2014-01-06 14:55     ` Sergio Durigan Junior
  1 sibling, 0 replies; 8+ messages in thread
From: Honggyu Kim @ 2014-01-06  6:48 UTC (permalink / raw)
  To: nickc; +Cc: gdb-patches, 'Sergio Durigan Junior', jungsoo.son

Hi,

I have faced a problem, when I try to debug a simple hello world program.
I think it's a free error from your patch "PR binutils/11983" whose hash is "1be5090bcaf4bcab333cf03f4157b16d33881222".
That is merged on Jan 2 this year.

--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -123,6 +123,8 @@ _bfd_delete_bfd (bfd *abfd)
       objalloc_free ((struct objalloc *) abfd->memory);
     }

+  if (abfd->filename)
+    free ((char *) abfd->filename);
   free (abfd->arelt_data);
   free (abfd);
 }

It seems to be a double free error.
If I remove the newly added free statement above, the problem disappeared. ( free ((char *) abfd->filename) )
Please have a look at the execution error message that I posted on the previous mail or correct me if I'm wrong.
I have tested this on x86_64 machine.
Thank you.

Honggyu Kim


-----Original Message-----
From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Honggyu Kim
Sent: Monday, January 06, 2014 2:13 PM
To: 'Sergio Durigan Junior'
Cc: gdb-patches@sourceware.org
Subject: RE: [PATCH v2] Remove duplicated include in gdb directory

Thank you for your kind feedback.
I thought it's just a minor code cleanup so I didn't expect any copyright issues.

I have tried to build as below.
  $ ./configure --prefix=`pwd`/build
  $ make
and
  $ make distclean
  $ ./configure --prefix=`pwd`/build --enable-targets=all
  $ make

In both cases, build were fine and gdb binary is generated without problems.

However, when I tried to run gdb to debug just a simple hello world program, it fails.
But I found that the current HEAD also fails by showing the following message.
It seems to be very strange for me since it's not from the patch that I submitted.
I have tested the same thing after checkout a tag "gdb_7_6_2-2013-12-08-release" and it worked fine.
Please consider this issue separately or please correct me if I'm wrong.


$ cd build/bin/
$ ./gdb ./a.out
GNU gdb (GDB) 7.6.50.20140106-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./a.out...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/hong.gyu.kim/src/gdb/binutils-gdb/build/bin/a.out
*** glibc detected *** ./gdb: double free or corruption (out): 0x0000000003435860 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7fc88175db96]
./gdb[0x86b8a1]
./gdb(bfd_close+0x82)[0x86be52]
	...
Aborted (core dumped)
Hello, World



-----Original Message-----
From: Sergio Durigan Junior [mailto:sergiodj@redhat.com] 
Sent: Monday, January 06, 2014 12:47 PM
To: Honggyu Kim
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] Remove duplicated include in gdb directory

On Sunday, January 05 2014, Honggyu Kim wrote:

> This patch simply removes duplicated include statements in gdb directory.
> If there are two duplicated include statements, this patch keeps the first
> include and removes the second include.
> Those are found by checkincludes.pl tool in linux kernel and double checked
> manually once again if the include statements are affected by ifdef macro.

Thanks for the patch, Honggyu.  I believe you have tested it by building
GDB with --enable-targets=all, right?

It needs a ChangeLog (mechanical), and it seems to be simple enough to
be committed without needing a copyright assignment (I don't see your
name in the MAINTAINERS file).

Other than that, let's wait for some maintainer to give the green
light.  BTW, if you want to get started on the process to obtain the
copyright assignment, mail me offlist and I can send you the
instructions.

Thanks,

-- 
Sergio

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

* Re: [PATCH v2] Remove duplicated include in gdb directory
  2014-01-06  5:13   ` Honggyu Kim
  2014-01-06  6:48     ` Honggyu Kim
@ 2014-01-06 14:55     ` Sergio Durigan Junior
  1 sibling, 0 replies; 8+ messages in thread
From: Sergio Durigan Junior @ 2014-01-06 14:55 UTC (permalink / raw)
  To: Honggyu Kim; +Cc: gdb-patches

On Monday, January 06 2014, Honggyu Kim wrote:

> Thank you for your kind feedback.
> I thought it's just a minor code cleanup so I didn't expect any copyright issues.
>
> I have tried to build as below.
>   $ ./configure --prefix=`pwd`/build
>   $ make
> and
>   $ make distclean
>   $ ./configure --prefix=`pwd`/build --enable-targets=all
>   $ make
>
> In both cases, build were fine and gdb binary is generated without problems.

Nice, thanks.

> However, when I tried to run gdb to debug just a simple hello world program, it fails.
> But I found that the current HEAD also fails by showing the following
> message.

This error is known and is already being taken care of.  But thanks
anyway :-).

-- 
Sergio

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

* Re: [PATCH v2] Remove duplicated include in gdb directory
  2014-01-06  3:46 ` Sergio Durigan Junior
  2014-01-06  5:13   ` Honggyu Kim
@ 2014-01-06 16:37   ` Tom Tromey
  2014-01-06 19:08     ` Sergio Durigan Junior
  1 sibling, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2014-01-06 16:37 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: Honggyu Kim, gdb-patches

>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:

Sergio> Thanks for the patch, Honggyu.  I believe you have tested it by
Sergio> building GDB with --enable-targets=all, right?

That ordinarily would not be quite sufficient since this patch also
touches *-nat parts.  However, reading the patch I think it is obviously
correct.  None of the removed includes are "tricky" ones and the only
odd case I saw (the osdata.c change) really is correct.

Sergio> It needs a ChangeLog (mechanical), and it seems to be simple enough to
Sergio> be committed without needing a copyright assignment (I don't see your
Sergio> name in the MAINTAINERS file).

Agreed on both counts.

Sergio> Other than that, let's wait for some maintainer to give the
Sergio> green light.

You have it.

Tom

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

* Re: [PATCH v2] Remove duplicated include in gdb directory
  2014-01-06 16:37   ` Tom Tromey
@ 2014-01-06 19:08     ` Sergio Durigan Junior
  2014-01-07  2:44       ` Joel Brobecker
  0 siblings, 1 reply; 8+ messages in thread
From: Sergio Durigan Junior @ 2014-01-06 19:08 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Honggyu Kim, gdb-patches

On Monday, January 06 2014, Tom Tromey wrote:

>>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
>
> Sergio> Thanks for the patch, Honggyu.  I believe you have tested it by
> Sergio> building GDB with --enable-targets=all, right?
>
> That ordinarily would not be quite sufficient since this patch also
> touches *-nat parts.  However, reading the patch I think it is obviously
> correct.  None of the removed includes are "tricky" ones and the only
> odd case I saw (the osdata.c change) really is correct.

Thanks for pointing that out.  I thought about the nat files, but then I
thought the change was obvious enough that it didn't request a deeper
test.

> Sergio> Other than that, let's wait for some maintainer to give the
> Sergio> green light.
>
> You have it.

Thanks, Tom.

Honggyu, could you please provide the ChangeLog for the patch?  I can
push it to the repository when you do that.

Thanks,

-- 
Sergio

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

* Re: [PATCH v2] Remove duplicated include in gdb directory
  2014-01-06 19:08     ` Sergio Durigan Junior
@ 2014-01-07  2:44       ` Joel Brobecker
  0 siblings, 0 replies; 8+ messages in thread
From: Joel Brobecker @ 2014-01-07  2:44 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: Tom Tromey, Honggyu Kim, gdb-patches

> > Sergio> Other than that, let's wait for some maintainer to give the
> > Sergio> green light.
> >
> > You have it.
> 
> Thanks, Tom.
> 
> Honggyu, could you please provide the ChangeLog for the patch?  I can
> push it to the repository when you do that.

Here is a suggestion: If Honggyu were to start the paperwork to assign
past and future changes to GDB, we'd be retroactively covered for this
change as well, and we would not be hindered if future changes come in.

-- 
Joel

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-06  1:53 [PATCH v2] Remove duplicated include in gdb directory Honggyu Kim
2014-01-06  3:46 ` Sergio Durigan Junior
2014-01-06  5:13   ` Honggyu Kim
2014-01-06  6:48     ` Honggyu Kim
2014-01-06 14:55     ` Sergio Durigan Junior
2014-01-06 16:37   ` Tom Tromey
2014-01-06 19:08     ` Sergio Durigan Junior
2014-01-07  2:44       ` Joel Brobecker

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