Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michal Ludvig <mludvig@suse.cz>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: GDB Patches <gdb-patches@sources.redhat.com>,
	Mark Kettenis <kettenis@chello.nl>
Subject: Re: RFA: Actual support for tracing forks on GNU/Linux
Date: Mon, 18 Aug 2003 09:09:00 -0000	[thread overview]
Message-ID: <3F4097E1.6000706@suse.cz> (raw)
In-Reply-To: <20030817182245.GA24800@nevyn.them.org>

Daniel Jacobowitz told me that:

 > 2003-08-17  Daniel Jacobowitz  <drow@mvista.com>
 >
 >    * config/i386/nm-linux.h (LINUX_CHILD_POST_STARTUP_INFERIOR):
 >     Define.
 >    * i386-linux-nat.c: Include "linux-nat.h".
 >    (child_post_startup_inferior): New function.
 >    * i386-nat.c (child_post_startup_inferior): Wrap in #ifdef.
 >    * linux-nat.c (linux_enable_event_reporting): New function.
 >    (child_post_attach, linux_child_post_startup_inferior)
 >    (child_post_startup_inferior, child_follow_fork)
 >    (linux_handle_extended_wait, kill_inferior): New functions.

Hi Daniel,
this change broke build on AMD64. Per-se I'm getting linker error:

libgdb.a(linux-nat.o)(.text+0x3e8): In function 
`child_post_startup_inferior':
../../gdb-6.0/gdb/linux-nat.c:223: multiple definition of 
`child_post_startup_inferior'
libgdb.a(i386-nat.o)(.text+0x52):../../gdb-6.0/gdb/i386-nat.c:238: first 
defined here
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3/../../../../x86_64-suse-linux/bin/ld: 
Warning: size of symbol `child_post_startup_inferior' changed from 11 in 
libgdb.a(i386-nat.o) to 41 in libgdb.a(i386-nat.o)
collect2: ld returned 1 exit status
make: *** [gdb] Error 1

I.e. `child_post_startup_inferior' is defined twice.

When I define LINUX_CHILD_POST_STARTUP_INFERIOR in 
config/i386/nm-x86-64linux.h I get:

libgdb.a(inftarg.o)(.text+0x692): In function `init_child_ops':
../../gdb-6.0/gdb/inftarg.c:593: undefined reference to 
`child_post_startup_inferior'
libgdb.a(lin-lwp.o)(.text+0x3f76): In function `init_lin_lwp_ops':
../../gdb-6.0/gdb/lin-lwp.c:1675: undefined reference to 
`child_post_startup_inferior'

I.e. it's never defined.

The problem seems to be that child_post_startup_inferior() in both 
i386-nat.c and linux-nat.c is #ifNdef-ed, i.e. either both undefined or 
both defined. Is that intended?

However the proper fix for amd64 seems to be:

Index: x86-64-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-linux-nat.c,v
retrieving revision 1.23.6.2
diff -u -p -r1.23.6.2 x86-64-linux-nat.c
--- x86-64-linux-nat.c  17 Jul 2003 12:51:55 -0000      1.23.6.2
+++ x86-64-linux-nat.c  18 Aug 2003 09:05:51 -0000
@@ -347,3 +347,9 @@ ps_get_thread_area (const struct ps_proc
    return PS_ERR;               /* ptrace failed.  */
  }

+void
+child_post_startup_inferior (ptid_t ptid)
+{
+  i386_cleanup_dregs ();
+  linux_child_post_startup_inferior (ptid);
+}

Right? OK to apply?

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* (+420) 296.545.373 * http://www.suse.cz


  reply	other threads:[~2003-08-18  9:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-18 23:29 Daniel Jacobowitz
2003-06-28 16:35 ` Daniel Jacobowitz
2003-07-09 21:57   ` Daniel Jacobowitz
2003-07-24 18:48     ` Daniel Jacobowitz
2003-08-10 16:11       ` Mark Kettenis
2003-08-17 18:22         ` Daniel Jacobowitz
2003-08-18  9:09           ` Michal Ludvig [this message]
2003-08-18 12:59             ` Daniel Jacobowitz
2003-08-18 13:11               ` Michal Ludvig

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=3F4097E1.6000706@suse.cz \
    --to=mludvig@suse.cz \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@chello.nl \
    /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