public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* [mingw] build error of the latest CVS
@ 2012-06-13  0:17 asmwarrior
  2012-06-13  0:19 ` asmwarrior
  0 siblings, 1 reply; 9+ messages in thread
From: asmwarrior @ 2012-06-13  0:17 UTC (permalink / raw)
  To: gdb

I see this link error:

Making init.c
mingw32-gcc -g -O2 -D__USE_MINGW_ACCESS   -I. -I../../gdb/gdb -I../../gdb/gdb/common -I../../gdb/gdb/config -DLOCALEDIR="\"/mingw/share/locale\"" -DHAVE_CONFIG_H -I../../gdb/gdb/../include/opcode -I../../gdb/gdb/../opcodes/.. -I../../gdb/gdb/../readline/.. -I../bfd -I../../gdb/gdb/../bfd -I../../gdb/gdb/../include -I../libdecnumber -I../../gdb/gdb/../libdecnumber  -I../../gdb/gdb/gnulib/import -Ibuild-gnulib/import    -IE:/code/python273/include -IE:/code/python273/include -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wno-format -Werror -c -o init.o -MT init.o -MMD -MP -MF .deps/init.Tpo init.c
rm -f gdb.exe
mingw32-gcc -g -O2 -D__USE_MINGW_ACCESS   -Wl,--stack,12582912   \
		-o gdb.exe gdb.o i386-tdep.o i386-cygwin-tdep.o i387-tdep.o windows-tdep.o ser-base.o ser-tcp.o ser-mingw.o i386-nat.o windows-nat.o i386-windows-nat.o remote.o dcache.o tracepoint.o ax-general.o ax-gdb.o remote-fileio.o  cli-dump.o cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-logging.o cli-interp.o cli-utils.o mi-out.o mi-console.o mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o mi-cmd-file.o mi-cmd-disas.o mi-symbol-cmds.o mi-cmd-target.o mi-cmd-info.o mi-interp.o mi-main.o mi-parse.o mi-getopt.o windows-termcap.o python.o py-auto-load.o py-block.o py-bpevent.o py-breakpoint.o py-cmd.o py-continueevent.o py-event.o py-evtregistry.o py-evts.o py-exitedevent.o py-finishbreakpoint.o py-frame.o py-function.o py-inferior.o py-infthread.o py-lazy-string.o py-newobjfileevent.o py-objfile.o py-param.o py-prettyprint.o py-progspace.o py-signalevent.o py-stopevent.o py-symbol.o py-symtab.o py-threadevent.o py-type.o py-utils.o py-value.o elfread.o stap-probe.o 
mingw-hdep.o c-exp.o cp-name-parser.o objc-exp.o ada-exp.o jv-exp.o f-exp.o go-exp.o m2-exp.o p-exp.o version.o annotate.o addrmap.o auto-load.o auxv.o agent.o bfd-target.o blockframe.o breakpoint.o findvar.o regcache.o cleanups.o charset.o continuations.o corelow.o disasm.o dummy-frame.o dfp.o source.o value.o eval.o valops.o valarith.o valprint.o printcmd.o block.o symtab.o psymtab.o symfile.o symmisc.o linespec.o dictionary.o infcall.o infcmd.o infrun.o expprint.o environ.o stack.o thread.o exceptions.o filesystem.o inf-child.o interps.o main.o macrotab.o macrocmd.o macroexp.o macroscope.o mi-common.o event-loop.o event-top.o inf-loop.o completer.o gdbarch.o arch-utils.o gdbtypes.o osabi.o copying.o memattr.o mem-break.o target.o parse.o language.o buildsym.o findcmd.o std-regs.o signals.o exec.o reverse.o bcache.o objfiles.o observer.o minsyms.o maint.o demangle.o dbxread.o coffread.o coff-pe-read.o dwarf2read.o mipsread.o stabsread.o corefile.o dwarf2expr.o dwarf2loc.o dwarf2-fr
ame.o dwarf2-frame-tailcall.o ada-lang.o c-lang.o d-lang.o f-lang.o objc-lang.o ada-tasks.o ada-varobj.o ui-out.o cli-out.o varobj.o vec.o go-lang.o go-valprint.o go-typeprint.o jv-lang.o jv-valprint.o jv-typeprint.o m2-lang.o opencl-lang.o p-lang.o p-typeprint.o p-valprint.o sentinel-frame.o complaints.o typeprint.o ada-typeprint.o c-typeprint.o f-typeprint.o m2-typeprint.o ada-valprint.o c-valprint.o cp-valprint.o d-valprint.o f-valprint.o m2-valprint.o serial.o mdebugread.o top.o utils.o ui-file.o user-regs.o frame.o frame-unwind.o doublest.o frame-base.o inline-frame.o gnu-v2-abi.o gnu-v3-abi.o cp-abi.o cp-support.o cp-namespace.o reggroups.o regset.o trad-frame.o tramp-frame.o solib.o solib-target.o prologue-value.o memory-map.o memrange.o xml-support.o xml-syscall.o xml-utils.o target-descriptions.o target-memory.o xml-tdesc.o xml-builtin.o inferior.o osdata.o gdb_usleep.o record.o gcore.o jit.o progspace.o skip.o probe.o common-utils.o buffer.o ptid.o gdb-dlfcn.o common-agent.
o inflow.o    init.o \
		   ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a  ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a    -ldl -lz -lm   -liconv -LE:/code/python273/libs -lpython27 -lexpat ../libiberty/libiberty.a -lws2_32 build-gnulib/import/libgnu.a
mingw-hdep.o: In function `gdb_select':
f:\build_gdb\gdb\gdbgit\newbuild\gdb/../../gdb/gdb/mingw-hdep.c:125: undefined reference to `serial_for_fd'
collect2: ld returned 1 exit status
make[2]: *** [gdb.exe] Error 1
make[2]: Leaving directory `/f/build_gdb/gdb/gdbgit/newbuild/gdb'
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory `/f/build_gdb/gdb/gdbgit/newbuild'
make: *** [all] Error 2


Any comments?
Thanks.

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

* Re: [mingw] build error of the latest CVS
  2012-06-13  0:17 [mingw] build error of the latest CVS asmwarrior
@ 2012-06-13  0:19 ` asmwarrior
  2012-06-13  9:23   ` Pedro Alves
  0 siblings, 1 reply; 9+ messages in thread
From: asmwarrior @ 2012-06-13  0:19 UTC (permalink / raw)
  To: gdb

On 2012-6-13 8:19, asmwarrior wrote:
> f:\build_gdb\gdb\gdbgit\newbuild\gdb/../../gdb/gdb/mingw-hdep.c:125: undefined reference to `serial_for_fd'

Ok, I found that this function body was deleted in:

SHA-1: 877dce5b0d75d33cf93a4cda88a73cf828be5875

* 2012-06-11  Pedro Alves  <palves@redhat.com>

	Remove #if 0'd "connect" command, and unnecessary associated
	refcounting and serial reuse bits.

	* serial.h (struct serial): Remove fields 'next' and 'refcnt'.
	* serial.c (last_serial_opened): Delete.
	(scb_base): Delete.
	(serial_open): Adjust.
	(serial_for_fd): Delete.
	(serial_fdopen_ops, do_serial_close): Adjust.
	(serial_fdopen_ops): Adjust.

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

* Re: [mingw] build error of the latest CVS
  2012-06-13  0:19 ` asmwarrior
@ 2012-06-13  9:23   ` Pedro Alves
  2012-06-13  9:40     ` Pedro Alves
  0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2012-06-13  9:23 UTC (permalink / raw)
  To: asmwarrior; +Cc: gdb

On 06/13/2012 01:22 AM, asmwarrior wrote:

> On 2012-6-13 8:19, asmwarrior wrote:
>> f:\build_gdb\gdb\gdbgit\newbuild\gdb/../../gdb/gdb/mingw-hdep.c:125: undefined reference to `serial_for_fd'
> 
> Ok, I found that this function body was deleted in:
> 
> SHA-1: 877dce5b0d75d33cf93a4cda88a73cf828be5875
> 
> * 2012-06-11  Pedro Alves  <palves@redhat.com>
> 
>     Remove #if 0'd "connect" command, and unnecessary associated
>     refcounting and serial reuse bits.
> 
>     * serial.h (struct serial): Remove fields 'next' and 'refcnt'.
>     * serial.c (last_serial_opened): Delete.
>     (scb_base): Delete.
>     (serial_open): Adjust.
>     (serial_for_fd): Delete.
>     (serial_fdopen_ops, do_serial_close): Adjust.
>     (serial_fdopen_ops): Adjust.


Whoops, I didn't notice there were other users of that function.  I'll take a look.

-- 
Pedro Alves

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

* Re: [mingw] build error of the latest CVS
  2012-06-13  9:23   ` Pedro Alves
@ 2012-06-13  9:40     ` Pedro Alves
  2012-06-13  9:52       ` asmwarrior
  0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2012-06-13  9:40 UTC (permalink / raw)
  To: gdb; +Cc: asmwarrior

On 06/13/2012 10:22 AM, Pedro Alves wrote:

> On 06/13/2012 01:22 AM, asmwarrior wrote:
> 
>> On 2012-6-13 8:19, asmwarrior wrote:
>>> f:\build_gdb\gdb\gdbgit\newbuild\gdb/../../gdb/gdb/mingw-hdep.c:125: undefined reference to `serial_for_fd'
>>
>> Ok, I found that this function body was deleted in:
>>
>> SHA-1: 877dce5b0d75d33cf93a4cda88a73cf828be5875
>>
>> * 2012-06-11  Pedro Alves  <palves@redhat.com>
>>
>>     Remove #if 0'd "connect" command, and unnecessary associated
>>     refcounting and serial reuse bits.
>>
>>     * serial.h (struct serial): Remove fields 'next' and 'refcnt'.
>>     * serial.c (last_serial_opened): Delete.
>>     (scb_base): Delete.
>>     (serial_open): Adjust.
>>     (serial_for_fd): Delete.
>>     (serial_fdopen_ops, do_serial_close): Adjust.
>>     (serial_fdopen_ops): Adjust.
> 
> 
> Whoops, I didn't notice there were other users of that function.  I'll take a look.


We can just restore the function.  I'm testing a patch.

-- 
Pedro Alves

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

* Re: [mingw] build error of the latest CVS
  2012-06-13  9:40     ` Pedro Alves
@ 2012-06-13  9:52       ` asmwarrior
  2012-06-13  9:57         ` Pedro Alves
  0 siblings, 1 reply; 9+ messages in thread
From: asmwarrior @ 2012-06-13  9:52 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb

On 2012-6-13 17:39, Pedro Alves wrote:
> On 06/13/2012 10:22 AM, Pedro Alves wrote:
>
>> On 06/13/2012 01:22 AM, asmwarrior wrote:
>>
>>> On 2012-6-13 8:19, asmwarrior wrote:
>>>> f:\build_gdb\gdb\gdbgit\newbuild\gdb/../../gdb/gdb/mingw-hdep.c:125: undefined reference to `serial_for_fd'
>>> Ok, I found that this function body was deleted in:
>>>
>>> SHA-1: 877dce5b0d75d33cf93a4cda88a73cf828be5875
>>>
>>> * 2012-06-11  Pedro Alves  <palves@redhat.com>
>>>
>>>      Remove #if 0'd "connect" command, and unnecessary associated
>>>      refcounting and serial reuse bits.
>>>
>>>      * serial.h (struct serial): Remove fields 'next' and 'refcnt'.
>>>      * serial.c (last_serial_opened): Delete.
>>>      (scb_base): Delete.
>>>      (serial_open): Adjust.
>>>      (serial_for_fd): Delete.
>>>      (serial_fdopen_ops, do_serial_close): Adjust.
>>>      (serial_fdopen_ops): Adjust.
>>
>> Whoops, I didn't notice there were other users of that function.  I'll take a look.
>
> We can just restore the function.  I'm testing a patch.
>
I firstly tried to use a hacker local patch to workaround the build error, but finally I found a hang problem caused by my local patch.

So, I revert you three commit about serial.c, and now gdb cvs Head build and works OK.

see: http://sourceware.org/bugzilla/show_bug.cgi?id=14227

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

* Re: [mingw] build error of the latest CVS
  2012-06-13  9:52       ` asmwarrior
@ 2012-06-13  9:57         ` Pedro Alves
  2012-06-13 10:04           ` asmwarrior
  0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2012-06-13  9:57 UTC (permalink / raw)
  To: asmwarrior; +Cc: gdb

On 06/13/2012 10:54 AM, asmwarrior wrote:

> On 2012-6-13 17:39, Pedro Alves wrote:

>> We can just restore the function.  I'm testing a patch.

>>
> I firstly tried to use a hacker local patch to workaround the build error, but finally I found a hang problem caused by my local patch.


You don't say how your patch looked like, but I'm hoping it's not
the same as mine, otherwise I'll need to go back to the drawing board  :-)

Could you try the patch below on top of current mainline?

> So, I revert you three commit about serial.c, and now gdb cvs Head build and works OK.


> see: http://sourceware.org/bugzilla/show_bug.cgi?id=14227


Thanks.

2012-06-13  Pedro Alves  <palves@redhat.com>

	Partial revert of previous change.

	* serial.c (scb_base): New global.
	(serial_for_fd): New.
	(serial_open, serial_fdopen_ops): Link new serial in open serials
	chain.
	(do_serial_close): Unlink serial from the open serials chain.
---

 gdb/serial.c |   35 +++++++++++++++++++++++++++++++++++
 gdb/serial.h |    1 +
 2 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/gdb/serial.c b/gdb/serial.c
index 1140feb..df18b2f 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -33,6 +33,10 @@ static int global_serial_debug_p;

 static struct serial_ops *serial_ops_list = NULL;

+/* Pointer to list of scb's.  */
+
+static struct serial *scb_base;
+
 /* Non-NULL gives filename which contains a recording of the remote session,
    suitable for playback by gdbserver.  */

@@ -157,6 +161,21 @@ serial_add_interface (struct serial_ops *optable)
   serial_ops_list = optable;
 }

+/* Return the open serial device for FD, if found, or NULL if FD is
+   not already opened.  */
+
+struct serial *
+serial_for_fd (int fd)
+{
+  struct serial *scb;
+
+  for (scb = scb_base; scb; scb = scb->next)
+    if (scb->fd == fd)
+      return scb;
+
+  return NULL;
+}
+
 /* Open up a device or a network socket, depending upon the syntax of NAME.  */

 struct serial *
@@ -206,10 +225,12 @@ serial_open (const char *name)
     }

   scb->name = xstrdup (name);
+  scb->next = scb_base;
   scb->debug_p = 0;
   scb->async_state = 0;
   scb->async_handler = NULL;
   scb->async_context = NULL;
+  scb_base = scb;

   if (serial_logfile != NULL)
     {
@@ -249,10 +270,12 @@ serial_fdopen_ops (const int fd, struct serial_ops *ops)
   scb->refcnt = 1;

   scb->name = NULL;
+  scb->next = scb_base;
   scb->debug_p = 0;
   scb->async_state = 0;
   scb->async_handler = NULL;
   scb->async_context = NULL;
+  scb_base = scb;

   if ((ops->fdopen) != NULL)
     (*ops->fdopen) (scb, fd);
@@ -296,6 +319,18 @@ do_serial_close (struct serial *scb, int really_close)
   /* For serial_is_open.  */
   scb->bufp = NULL;

+  if (scb_base == scb)
+    scb_base = scb_base->next;
+  else
+    for (tmp_scb = scb_base; tmp_scb; tmp_scb = tmp_scb->next)
+      {
+	if (tmp_scb->next != scb)
+	  continue;
+
+	tmp_scb->next = tmp_scb->next->next;
+	break;
+      }
+
   serial_unref (scb);
 }

diff --git a/gdb/serial.h b/gdb/serial.h
index 187ed03..b164062 100644
--- a/gdb/serial.h
+++ b/gdb/serial.h
@@ -249,6 +249,7 @@ struct serial
 				   still need to wait for this many
 				   more seconds.  */
     char *name;			/* The name of the device or host */
+    struct serial *next;	/* Pointer to the next `struct serial *' */
     int debug_p;		/* Trace this serial devices operation.  */
     int async_state;		/* Async internal state.  */
     void *async_context;	/* Async event thread's context */

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

* Re: [mingw] build error of the latest CVS
  2012-06-13  9:57         ` Pedro Alves
@ 2012-06-13 10:04           ` asmwarrior
  2012-06-13 10:59             ` asmwarrior
  0 siblings, 1 reply; 9+ messages in thread
From: asmwarrior @ 2012-06-13 10:04 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb

On 2012-6-13 17:56, Pedro Alves wrote:
> You don't say how your patch looked like, but I'm hoping it's not
> the same as mine, otherwise I'll need to go back to the drawing board:-)

My patch is too ugly and dirty, I just create a dummy function body:


struct serial *
serial_for_fd (int fd)
{
   return serial_fdopen (fd);
}
But this cause the hang problems.

>
> Could you try the patch below on top of current mainline?
>
>> >So, I revert you three commit about serial.c, and now gdb cvs Head build and works OK.
>> >see:http://sourceware.org/bugzilla/show_bug.cgi?id=14227
> Thanks.
>
> 2012-06-13  Pedro Alves<palves@redhat.com>
>
> 	Partial revert of previous change.
>
> 	* serial.c (scb_base): New global.
> 	(serial_for_fd): New.
> 	(serial_open, serial_fdopen_ops): Link new serial in open serials
> 	chain.
> 	(do_serial_close): Unlink serial from the open serials chain.
> ---
>
>   gdb/serial.c |   35 +++++++++++++++++++++++++++++++++++
>   gdb/serial.h |    1 +
>   2 files changed, 36 insertions(+), 0 deletions(-)
>
> diff --git a/gdb/serial.c b/gdb/serial.c
> index 1140feb..df18b2f 100644
> --- a/gdb/serial.c
> +++ b/gdb/serial.c
> @@ -33,6 +33,10 @@ static int global_serial_debug_p;
>
>   static struct serial_ops *serial_ops_list = NULL;
>
> +/* Pointer to list of scb's.  */
> +
> +static struct serial *scb_base;
> +
>   /* Non-NULL gives filename which contains a recording of the remote session,
>      suitable for playback by gdbserver.  */
>
> @@ -157,6 +161,21 @@ serial_add_interface (struct serial_ops *optable)
>     serial_ops_list = optable;
>   }
>
> +/* Return the open serial device for FD, if found, or NULL if FD is
> +   not already opened.  */
> +
> +struct serial *
> +serial_for_fd (int fd)
> +{
> +  struct serial *scb;
> +
> +  for (scb = scb_base; scb; scb = scb->next)
> +    if (scb->fd == fd)
> +      return scb;
> +
> +  return NULL;
> +}
> +
>   /* Open up a device or a network socket, depending upon the syntax of NAME.  */
>
>   struct serial *
> @@ -206,10 +225,12 @@ serial_open (const char *name)
>       }
>
>     scb->name = xstrdup (name);
> +  scb->next = scb_base;
>     scb->debug_p = 0;
>     scb->async_state = 0;
>     scb->async_handler = NULL;
>     scb->async_context = NULL;
> +  scb_base = scb;
>
>     if (serial_logfile != NULL)
>       {
> @@ -249,10 +270,12 @@ serial_fdopen_ops (const int fd, struct serial_ops *ops)
>     scb->refcnt = 1;
>
>     scb->name = NULL;
> +  scb->next = scb_base;
>     scb->debug_p = 0;
>     scb->async_state = 0;
>     scb->async_handler = NULL;
>     scb->async_context = NULL;
> +  scb_base = scb;
>
>     if ((ops->fdopen) != NULL)
>       (*ops->fdopen) (scb, fd);
> @@ -296,6 +319,18 @@ do_serial_close (struct serial *scb, int really_close)
>     /* For serial_is_open.  */
>     scb->bufp = NULL;
>
> +  if (scb_base == scb)
> +    scb_base = scb_base->next;
> +  else
> +    for (tmp_scb = scb_base; tmp_scb; tmp_scb = tmp_scb->next)
> +      {
> +	if (tmp_scb->next != scb)
> +	  continue;
> +
> +	tmp_scb->next = tmp_scb->next->next;
> +	break;
> +      }
> +
>     serial_unref (scb);
>   }
>
> diff --git a/gdb/serial.h b/gdb/serial.h
> index 187ed03..b164062 100644
> --- a/gdb/serial.h
> +++ b/gdb/serial.h
> @@ -249,6 +249,7 @@ struct serial
>   				   still need to wait for this many
>   				   more seconds.  */
>       char *name;			/* The name of the device or host */
> +    struct serial *next;	/* Pointer to the next `struct serial *' */
>       int debug_p;		/* Trace this serial devices operation.  */
>       int async_state;		/* Async internal state.  */
>       void *async_context;	/* Async event thread's context */
OK, I will try your patch and give feedback as soon as possible.


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

* Re: [mingw] build error of the latest CVS
  2012-06-13 10:04           ` asmwarrior
@ 2012-06-13 10:59             ` asmwarrior
  2012-06-13 11:03               ` Pedro Alves
  0 siblings, 1 reply; 9+ messages in thread
From: asmwarrior @ 2012-06-13 10:59 UTC (permalink / raw)
  To: Pedro Alves, gdb

On 2012-6-13 18:06, asmwarrior wrote:
> OK, I will try your patch and give feedback as soon as possible.

Hi, Pedro.
I have tested your patch, and it works fine on the MinGW build.
Thanks.

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

* Re: [mingw] build error of the latest CVS
  2012-06-13 10:59             ` asmwarrior
@ 2012-06-13 11:03               ` Pedro Alves
  0 siblings, 0 replies; 9+ messages in thread
From: Pedro Alves @ 2012-06-13 11:03 UTC (permalink / raw)
  To: asmwarrior; +Cc: gdb

On 06/13/2012 12:01 PM, asmwarrior wrote:

> On 2012-6-13 18:06, asmwarrior wrote:
>> OK, I will try your patch and give feedback as soon as possible.
> 
> Hi, Pedro.
> I have tested your patch, and it works fine on the MinGW build.
> Thanks.


Thank you.  I'll apply it.

-- 
Pedro Alves

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

end of thread, other threads:[~2012-06-13 11:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-13  0:17 [mingw] build error of the latest CVS asmwarrior
2012-06-13  0:19 ` asmwarrior
2012-06-13  9:23   ` Pedro Alves
2012-06-13  9:40     ` Pedro Alves
2012-06-13  9:52       ` asmwarrior
2012-06-13  9:57         ` Pedro Alves
2012-06-13 10:04           ` asmwarrior
2012-06-13 10:59             ` asmwarrior
2012-06-13 11:03               ` Pedro Alves

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