From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6607 invoked by alias); 18 Dec 2013 17:31:27 -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 6595 invoked by uid 89); 18 Dec 2013 17:31:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vb0-f43.google.com Received: from mail-vb0-f43.google.com (HELO mail-vb0-f43.google.com) (209.85.212.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 18 Dec 2013 17:31:26 +0000 Received: by mail-vb0-f43.google.com with SMTP id p6so5184983vbe.16 for ; Wed, 18 Dec 2013 09:31:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=2V68P1Bj6zK9g8T7EvPjcQ2t+Hepk1sX78qOYBn4E7E=; b=JbSHNx2xFM12VdSIEP4jBbIVDpPJbVRE9+KB4Jg+9rujlB34MGIH9kj0SHRCE6LbCW fMcXyPcPcZ71U5yW8s/cLDePua4WO4YeJr0DBnPSRS6ysV+X2BfqL9f3f1cgxoEs/hv/ TJglL88RFHKE/9ca0qey60AUz1OeTeo4xeILEPsAjj9qghP1fUylsJwaGXgImXhYZF6P OBoCai9Z1VhAxPIjcX8bgPykJEbnUvbpdVwkDUbAWPDisdW75Yy85pi1gmMH/+JwhKXe PrRPSZz24p9BuwxMqxZNPR0kJ2Y0Rp+HQGl4SsMvGrIbraRYYKwn5Lu9DyT6gOuLgOcM mCZg== X-Gm-Message-State: ALoCoQkmzGTaaqK8lBomOfctQfoPZAnfsNnXoyKgHHVySeXpX/xsTSKM7Djh/sMBJ4ZipN84GxzC126oI/SVl4U4zIXIFQJw8YT1CneAn7ZfXBs/nbxSJHZm6p0FnfIuZYumhpaxTersY8QO3rgJHYYV2RWB1uUDZdsVlMeuyVi15Op3C15yt/chl2QvXtpArqjfz3UBdueOw+MXv1xKH/FivuBZOgMAQA== MIME-Version: 1.0 X-Received: by 10.220.19.134 with SMTP id a6mr1411243vcb.36.1387387883867; Wed, 18 Dec 2013 09:31:23 -0800 (PST) Received: by 10.52.163.52 with HTTP; Wed, 18 Dec 2013 09:31:23 -0800 (PST) In-Reply-To: <52B18420.5060303@redhat.com> References: <52B18420.5060303@redhat.com> Date: Wed, 18 Dec 2013 17:31:00 -0000 Message-ID: Subject: Re: [PATCH 3/6] gdbserver: Add debugging printf when setting last_resume_kind. From: Doug Evans To: Pedro Alves Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00714.txt.bz2 On Wed, Dec 18, 2013 at 3:16 AM, Pedro Alves wrote: > On 12/17/2013 09:45 PM, Doug Evans wrote: >> Hi. >> >> This patch adds a debugging printf to the setting of last_resume_kind >> which I found useful while debugging 16168. >> >> 2013-12-17 Doug Evans >> >> * linux-low.c (resume_kind_to_str): New function. >> (linux_set_resume_request): Add debugging printf when setting >> last_resume_kind. >> >> --- >> gdb/gdbserver/linux-low.c | 25 +++++++++++++++++++++++++ >> 1 file changed, 25 insertions(+) >> >> diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c >> index 464aaf0..3883e50 100644 >> --- a/gdb/gdbserver/linux-low.c >> +++ b/gdb/gdbserver/linux-low.c >> @@ -3301,6 +3301,24 @@ struct thread_resume_array >> size_t n; >> }; >> >> +/* Return the string name of KIND. */ >> + >> +static const char * >> +resume_kind_to_str (enum resume_kind kind) >> +{ >> + switch (kind) >> + { >> + case resume_continue: >> + return "resume_continue"; > > Can you do this with a macro please? See lynx-low.c:ptrace_request_to_str > for example. > > OK with that change. > >> + case resume_step: >> + return "resume_step"; >> + case resume_stop: >> + return "resume_stop"; >> + default: >> + gdb_assert_not_reached ("bad resume_kind"); >> + } >> +} >> + For three values? Aren't we getting into over-engineering territory?