From owner-svn-src-all@freebsd.org Tue May 1 19:34:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF6B4FB55D9; Tue, 1 May 2018 19:34:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D1B779C20; Tue, 1 May 2018 19:34:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7410826666; Tue, 1 May 2018 19:34:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w41JYXFW007230; Tue, 1 May 2018 19:34:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w41JYXIF007229; Tue, 1 May 2018 19:34:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805011934.w41JYXIF007229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 1 May 2018 19:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333151 - stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD X-SVN-Commit-Revision: 333151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 May 2018 19:34:34 -0000 Author: emaste Date: Tue May 1 19:34:33 2018 New Revision: 333151 URL: https://svnweb.freebsd.org/changeset/base/333151 Log: MFC r332849: lldb: propagate error to user if memory read fails Previously, an attempt to read an unreadable access reported zeros: (lldb) memory read -format hex -size 8 0 0x00000000: 0x0000000000000000 0x0000000000000000 0x00000010: 0x0000000000000000 0x0000000000000000 ... Now, if DoReadMemory encounters error then return 0 (bytes read) so we report the error to the user: (lldb) memory read -format hex -size 8 0 error: Bad address LLVM PR: 37190 Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp ============================================================================== --- stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Tue May 1 19:17:38 2018 (r333150) +++ stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Tue May 1 19:34:33 2018 (r333151) @@ -163,8 +163,10 @@ static size_t DoReadMemory(lldb::pid_t pid, lldb::addr pi_desc.piod_addr = buf; pi_desc.piod_len = size; - if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) + if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) { error.SetErrorToErrno(); + return 0; + } return pi_desc.piod_len; }