From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 366 invoked by alias); 21 May 2014 18:09:25 -0000 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 Received: (qmail 352 invoked by uid 89); 21 May 2014 18:09:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 May 2014 18:09:20 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4LI9HTw029304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 May 2014 14:09:17 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s4LI9FfV026534; Wed, 21 May 2014 14:09:16 -0400 Message-ID: <537CEBCB.5020401@redhat.com> Date: Wed, 21 May 2014 18:09:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Simon Marchi , Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [PATCH v5] Exit code of exited inferiors in -list-thread-groups References: <1400018204-29559-1-git-send-email-simon.marchi@ericsson.com> <87mweh31qi.fsf@fleche.redhat.com> <537CE38B.7040000@ericsson.com> In-Reply-To: <537CE38B.7040000@ericsson.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-05/txt/msg00501.txt.bz2 On 05/21/2014 06:34 PM, Simon Marchi wrote: > On Fri 16 May 2014 04:30:45 PM EDT, Tom Tromey wrote: >>>>>>> "Simon" == Simon Marchi writes: >> >> Simon> This one was also from a year ago, I would like to make sure it is still >> Simon> OK. >> >> Simon> + if (inferior->has_exit_code) >> Simon> + ui_out_field_string (uiout, "exit-code", >> Simon> + int_string (inferior->exit_code, 8, 0, 0, 1)); >> >> Why not the simpler ui_out_field_int? >> Going out of the way to print it in octal seems a bit odd for a machine >> interface. >> >> Tom > > Agreed. I found that the exit code is often represented in octal (the > reason for this probably predates my birth). But for MI, it does not > matter. Though it might be a little less surprising if all places that print the exit code print it the same way. That way it's possible that frontends just treat the exit code as a string, and present it as is to the user. They may already be doing that. The =thread-group-exited code has: mi_inferior_exit (struct inferior *inf) { struct mi_interp *mi = top_level_interpreter_data (); target_terminal_ours (); if (inf->has_exit_code) fprintf_unfiltered (mi->event_channel, "thread-group-exited,id=\"i%d\",exit-code=\"%s\"", inf->num, int_string (inf->exit_code, 8, 0, 0, 1)); (I bet that's where the new code was copied from.) -- Pedro Alves