From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22722 invoked by alias); 29 Dec 2011 20:32:42 -0000 Received: (qmail 22709 invoked by uid 22791); 29 Dec 2011 20:32:41 -0000 X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Dec 2011 20:32:28 +0000 Received: by vbbfn1 with SMTP id fn1so12512400vbb.0 for ; Thu, 29 Dec 2011 12:32:27 -0800 (PST) Received: by 10.52.95.84 with SMTP id di20mr18159021vdb.63.1325190747248; Thu, 29 Dec 2011 12:32:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.95.84 with SMTP id di20mr18159003vdb.63.1325190747031; Thu, 29 Dec 2011 12:32:27 -0800 (PST) Received: by 10.220.199.4 with HTTP; Thu, 29 Dec 2011 12:32:26 -0800 (PST) In-Reply-To: <4EF9497B.9020501@earthlink.net> References: <4E95DC58.7030805@codesourcery.com> <4ECD3496.1070609@codesourcery.com> <4EF9497B.9020501@earthlink.net> Date: Thu, 29 Dec 2011 20:34:00 -0000 Message-ID: Subject: Re: [PATCH] Add extra 'info os' information types for Linux (trunk and 7.4) From: Doug Evans To: Stan Shebs Cc: gdb-patches@sourceware.org X-System-Of-Record: true Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00892.txt.bz2 On Mon, Dec 26, 2011 at 8:28 PM, Stan Shebs wrote: > Here is a third revision of the 'info os' additions for Linux; it rolls up > Kwok's original patch plus requested edits, plus a few more comments and > tweaks. =A0I plan to commit this in a day or so, if there are no objectio= ns. > > I'd also like to get this pushed into 7.4; although it's getting late in = the > release cycle, this code is purely Linux-native and does not have any eff= ect > outside of 'info os'. =A0The urgency is partly due to snafu on my part - = Kwok > originally posted this patch in October - and partly due to interdependen= cy > with Eclipse, who is doing GUI for these commands. =A0(And yes, there is = an > approved-but-uncommitted MI patch connected with this, that I'll be pushi= ng > soon.) > > Stan > > 2011-12-26 =A0Stan Shebs > =A0 =A0 =A0 =A0Kwok Cheung Yeung > > =A0 =A0* NEWS: Describe new info os commands. > =A0 =A0* common/linux-osdata.c (PID_T, TIME_T): Define. > =A0 =A0(MAX_PID_T_STRLEN): New. > =A0 =A0(linux_common_core_of_thread): Add comment. =A0Change to use PID_T= and > =A0 =A0MAX_PID_T_STRLEN. > =A0 =A0(command_from_pid): Add comment. =A0Change to use PID_T. > =A0 =A0(commandline_from_pid): =A0Change to use PID_T. > =A0 =A0(user_from_pid): Add comment. > =A0 =A0(get_process_owner): Add comment. Change to use PID_T and > =A0 =A0MAX_PID_T_STRLEN. > =A0 =A0(get_number_of_cpu_cores): Add comment. > =A0 =A0(get_cores_used_by_process): Add comment. =A0Change to use PID_T a= nd > =A0 =A0MAX_PID_T_STRLEN. > =A0 =A0(linux_xfer_osdata_processes): Change to use PID_T and > =A0 =A0MAX_PID_T_STRLEN. > =A0 =A0(compare_processes): New function. > =A0 =A0(linux_xfer_osdata_processgroups): New function. > =A0 =A0(linux_xfer_osdata_threads): Change to use PID_T. > =A0 =A0(linux_xfer_osdata_fds): New function. > =A0 =A0(format_socket_state, print_sockets): New functions. > =A0 =A0(union socket_addr): New union. > =A0 =A0(linux_xfer_osdata_isockets): New function. > =A0 =A0(time_from_time_t, group_from_gid): New functions. > =A0 =A0(linux_xfer_osdata_shm): New function. > =A0 =A0(linux_xfer_osdata_sem): New function. > =A0 =A0(linux_xfer_osdata_msg): New function. > =A0 =A0(linux_xfer_osdata_modules): New function. > =A0 =A0(osdata_table): Add new entries. > =A0 =A0* common/buffer.c (buffer_xml_printf): Add support for long and > =A0 =A0long long format specifiers. > > =A0 =A0* gdb.texinfo (Operating System Auxiliary Information): Document n= ew > =A0 =A0'info os' subcommands. > > =A0 =A0* gdb.base/info-os.exp: New file. > =A0 =A0* gdb.base/info-os.c: New file. One nit: In info-os.exp, at the end: +# The SysV IPC primitives linger on after the creating process is killed +# unless they are destroyed explicitly, so allow the test program to tidy +# up after itself. Note that the test program attempts to delete and +# recreate the shared-memory region if it already exists, in case a +# previous run failed before having a chance to clean up. The tests for +# semaphores and message queues should still work with primitives from +# previous runs. +send_gdb "continue\n" Is that robust enough? Seems like you should also wait for the program to exit.