From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121323 invoked by alias); 9 Sep 2018 13:27:44 -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 121312 invoked by uid 89); 9 Sep 2018 13:27:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr1-f66.google.com Received: from mail-wr1-f66.google.com (HELO mail-wr1-f66.google.com) (209.85.221.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 09 Sep 2018 13:27:42 +0000 Received: by mail-wr1-f66.google.com with SMTP id w11-v6so19160209wrc.5 for ; Sun, 09 Sep 2018 06:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=INAhHb4EZ3vL2A811Kp7IvAqBOYXuQsl8kEY5mHrGbk=; b=VdvgrBquU+c4ulN4Jeftnewxlin6J11DpjGoBRgRDnz14Y/qW42wKpoAJ8UwMoom1m C+pQi8HuEF0HHTJ2suIXFigAth0wan5HDvNYGk7B/HBqfnslUhrbWcfSg3A/nNyWJ1kw Qzqx5I8CEOn8IhtXxv8hYWAFb0RU5yMmVn11DjGTURAr7DuO23lKfqZT83HT79eygqLH I7lpJNZ1k1QKwuM5KQqnP5ZxYhzeyjkXx8zBJDPJezsklhPt1iELum+9w+PYArKF238i Dy5LfMnvWHTjUWLfbof7dn7ZmXfMLzvhzEJ0YW7IqynOPYV0+OKXSQfgWC4J4rrTSTy/ 7Ktg== Return-Path: Received: from adacore.com ([192.150.182.225]) by smtp.gmail.com with ESMTPSA id x24-v6sm23823893wrd.13.2018.09.09.06.27.37 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 09 Sep 2018 06:27:39 -0700 (PDT) Received: by adacore.com (sSMTP sendmail emulation); Sun, 09 Sep 2018 15:27:37 +0200 From: Xavier Roirand To: gdb-patches@sourceware.org Cc: brobecker@adacore.com, simon.marchi@polymtl.ca, tom@tromey.com, Xavier Roirand Subject: [RFA 5/5 v2] Darwin: fix SIGTRAP when debugging Date: Sun, 09 Sep 2018 13:27:00 -0000 Message-Id: <1536499653-10033-1-git-send-email-roirand@adacore.com> X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00230.txt.bz2 Debugging a program under Darwin does not work: (gdb) start Temporary breakpoint 1 at 0x100000fb4: file /tmp/helloworld.c, line 1. Starting program: /private/tmp/helloworld [New Thread 0x2903 of process 60326] During startup program terminated with signal SIGTRAP, Trace/breakpoint trap. Field signaled from darwin_thread_info is not initialized thus signal sent to the debuggee is considered as not sent by GDB whereas it should. This patch fixes this problem and also updates (change type, initialize) single_step value in the same structure at the same time. gdb/ChangeLog: * darwin-nat.h (struct darwin_thread_info) : Change type and initialize. (struct darwin_thread_info) : Change type and initialize. Change-Id: I0fe2a6985df9d0dfcc8a2a258a3ef70cfa19b403 --- gdb/darwin-nat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/darwin-nat.h b/gdb/darwin-nat.h index 5965df08ab6..4232b5e0365 100644 --- a/gdb/darwin-nat.h +++ b/gdb/darwin-nat.h @@ -126,10 +126,10 @@ struct darwin_thread_info : public private_thread_info enum darwin_msg_state msg_state; /* True if this thread is single-stepped. */ - unsigned char single_step; + bool single_step = 0; /* True if a signal was manually sent to the thread. */ - unsigned char signaled; + bool signaled = 0; /* The last exception received. */ struct darwin_exception_msg event; -- 2.15.2 (Apple Git-101.1)