From patchwork Wed Aug 6 15:58:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 2329 Received: (qmail 11901 invoked by alias); 6 Aug 2014 16:26:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 11890 invoked by uid 89); 6 Aug 2014 16:26:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 06 Aug 2014 16:26:09 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s76FwC2K000773 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 6 Aug 2014 11:58:12 -0400 Received: from blade.nx (ovpn-116-90.ams2.redhat.com [10.36.116.90]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s76FwBIA016086 for ; Wed, 6 Aug 2014 11:58:12 -0400 Received: from blade.nx (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id A28572640E7 for ; Wed, 6 Aug 2014 16:58:10 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Subject: [PATCH 5/6] Convert fatal to perror_with_name in IPA code Date: Wed, 6 Aug 2014 16:58:07 +0100 Message-Id: <1407340688-13721-6-git-send-email-gbenson@redhat.com> In-Reply-To: <1407340688-13721-1-git-send-email-gbenson@redhat.com> References: <1407340688-13721-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes This commit converts four calls to fatal into calls to perror_with_name. perror_with_name calls error, which in IPA terminates with exit (1) rather than longjmp, so there is no functional change here. gdb/gdbserver/ 2014-08-06 Gary Benson * tracepoint.c (gdb_agent_init): Replace fatal with perror_with_name. (initialize_tracepoint): Likewise. --- gdb/gdbserver/ChangeLog | 6 ++++++ gdb/gdbserver/tracepoint.c | 10 ++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index 92c26aa..617d903 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -7292,7 +7292,7 @@ gdb_agent_init (void) sigfillset (&new_mask); res = pthread_sigmask (SIG_SETMASK, &new_mask, &orig_mask); if (res) - fatal ("pthread_sigmask (1) failed: %s", strerror (res)); + perror_with_name ("pthread_sigmask (1)"); res = pthread_create (&thread, NULL, @@ -7301,7 +7301,7 @@ gdb_agent_init (void) res = pthread_sigmask (SIG_SETMASK, &orig_mask, NULL); if (res) - fatal ("pthread_sigmask (2) failed: %s", strerror (res)); + perror_with_name ("pthread_sigmask (2)"); while (helper_thread_id == 0) usleep (1); @@ -7382,7 +7382,7 @@ initialize_tracepoint (void) pagesize = sysconf (_SC_PAGE_SIZE); if (pagesize == -1) - fatal ("sysconf"); + perror_with_name ("sysconf"); gdb_tp_heap_buffer = xmalloc (5 * 1024 * 1024); @@ -7401,9 +7401,7 @@ initialize_tracepoint (void) } if (addr == 0) - fatal ("\ -initialize_tracepoint: mmap'ing jump pad buffer failed with %s", - strerror (errno)); + perror_with_name ("mmap"); gdb_jump_pad_buffer_end = gdb_jump_pad_buffer + pagesize * SCRATCH_BUFFER_NPAGES; }