From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4587 invoked by alias); 6 Jan 2003 16:04:43 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4574 invoked from network); 6 Jan 2003 16:04:36 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by 209.249.29.67 with SMTP; 6 Jan 2003 16:04:36 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 5077A3D44; Mon, 6 Jan 2003 11:04:27 -0500 (EST) Message-ID: <3E19A90B.10203@redhat.com> Date: Mon, 06 Jan 2003 16:04:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] Re: Profiling gdb? References: <20020120210343.A22638@nevyn.them.org> <3C4B8A6B.30407@cygnus.com> <20030105222713.GA22511@nevyn.them.org> <3E198F51.2030209@redhat.com> <20030106151054.GA8796@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-01/txt/msg00211.txt.bz2 > > _mcleanup() is no more or less published than monstartup(), as far as I > can tell; I'll submit a glibc patch to document these when I get around > to it. I know both FreeBSD and GNU/Linux have these, because that's > how Emacs controls profiling. Good old emacs - can always be relied on as the keeper of portability knowledge. FYI, They are all based on the same berkley code. Looking at the Free/Net BSD man pages they document. moncontrol(int mode); monstartup(u_long *lowpc, u_long *highpc); but not _mcleanup() (hence my comment about interfaces). One thing, while the doco indicates pointers, the actual code matches your declaration. So gess we stick with that. http://www.opengroup.org doesn't mention any of this. glibc recently modified its internal structures so that are incompatible with the other implementations. FreeBSD also modified the internal structures but in a `forward compatible' way. NetBSD hasn't touched the code in yonks (other than to fix portability problems). > Hmm, make that less documented, since FreeBSD has a man page for > monstartup. They're both provided, however. > > I am indeed sure of monstartup()'s function signature - well, at least > for GNU/Linux; I don't have access to a FreeBSD system but according to > the source for libc in FreeBSD 5.0 it'll work there too. Although I > think it may leak memory in multiple runs, the way I use it. It's > declared in a non-system-specific file as taking longs (unsigned, oops, > will fix). Andrew