From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18230 invoked by alias); 5 Nov 2002 03:45:29 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18100 invoked from network); 5 Nov 2002 03:45:27 -0000 Received: from unknown (HELO mail-out2.apple.com) (17.254.0.51) by sources.redhat.com with SMTP; 5 Nov 2002 03:45:27 -0000 Received: from mailgate2.apple.com (A17-129-100-225.apple.com [17.129.100.225]) by mail-out2.apple.com (8.11.3/8.11.3) with ESMTP id gA53jRI03941 for ; Mon, 4 Nov 2002 19:45:27 -0800 (PST) Received: from scv2.apple.com (scv2.apple.com) by mailgate2.apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id ; Mon, 4 Nov 2002 19:45:26 -0800 Received: from platinum.localnet (vpn-scv-x3-17.apple.com [17.219.194.17]) by scv2.apple.com (8.11.3/8.11.3) with ESMTP id gA53jPi02873; Mon, 4 Nov 2002 19:45:26 -0800 (PST) Date: Mon, 04 Nov 2002 19:45:00 -0000 Subject: Re: [PATCH] Use read_memory_unsigned_integer when reading to CORE_ADDR Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v543) Cc: Daniel Jacobowitz , gdb-patches@sources.redhat.com To: Andrew Cagney From: Klee Dienes In-Reply-To: <3DB44FFB.2090205@redhat.com> Message-Id: <038EC655-F071-11D6-8361-00039396EEB8@apple.com> Content-Transfer-Encoding: 7bit X-SW-Source: 2002-11/txt/msg00042.txt.bz2 I used extract_type_address to honor the comment about not causing a memory_error. I'll check in the change from builtin_type_void_data_ptr to builtin_type_void_code_ptr. Unless someone objects, I'll also change int ptrbytes = TARGET_PTR_BIT / TARGET_CHAR_BIT; to int ptrbytes = TYPE_LENGTH (builtin_type_void_code_ptr); at the start of the function. On Monday, October 21, 2002, at 03:05 PM, Andrew Cagney wrote: >> /* Don't cause a memory_error when accessing sigcontext in case >> the stack >> layout has changed or the stack is corrupt. */ >> target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, >> ptrbytes); >> - return extract_unsigned_integer (buf, ptrbytes); >> + return extract_typed_address (buf, builtin_type_void_data_ptr); > > This should be builtin_type_void_code_ptr since it is extracting a > code pointer (the PC). It, also, might as well use > read_memory_typed_address(). > > Andrew > >