From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13988 invoked by alias); 22 Jul 2011 12:22:34 -0000 Received: (qmail 13974 invoked by uid 22791); 22 Jul 2011 12:22:32 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate2.uk.ibm.com (HELO mtagate2.uk.ibm.com) (194.196.100.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Jul 2011 12:22:12 +0000 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p6MCM2b9012690 for ; Fri, 22 Jul 2011 12:22:02 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p6MCM1fj2404524 for ; Fri, 22 Jul 2011 13:22:02 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p6MCM1O0030591 for ; Fri, 22 Jul 2011 06:22:01 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p6MCM012030451; Fri, 22 Jul 2011 06:22:00 -0600 Message-Id: <201107221222.p6MCM012030451@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 22 Jul 2011 14:22:00 +0200 Subject: Re: RFC: partially available registers To: tromey@redhat.com (Tom Tromey) Date: Fri, 22 Jul 2011 13:48:00 -0000 From: "Ulrich Weigand" Cc: drow@false.org (Daniel Jacobowitz), gdb-patches@sourceware.org In-Reply-To: from "Tom Tromey" at Jul 21, 2011 01:20:34 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2011-07/txt/msg00607.txt.bz2 Tom Tromey wrote: > FWIW, I was mostly following the existing code and existing gdbarch > methods, like gdbarch_value_from_register. This looks good to me, thanks. > I think a decent project would be to consolidate this new method, > gdbarch_convert_register, and gdbarch_value_from_register into a single > approach. Agreed. I actually had a patchset a while ago that would get rid of gdbarch_convert_register, but that was never quite completed ... I'll have to see to get this done at some point. > int len = TYPE_LENGTH (type); > + struct value *v2; > > /* Construct the value. */ > v = gdbarch_value_from_register (gdbarch, type, regnum, frame); > > /* Get the data. */ > - ok = get_frame_register_bytes (frame, regnum, value_offset (v), len, > - value_contents_raw (v), > - &optim, &unavail); > - } > + v2 = get_frame_register_value (frame, regnum); > > - if (!ok) > - { > - if (optim) > - set_value_optimized_out (v, 1); > - if (unavail) > - mark_value_bytes_unavailable (v, 0, TYPE_LENGTH (type)); > + value_contents_copy (v, value_offset (v), v2, 0, len); This still looks wrong, I think. It should be: value_contents_copy (v, 0, v2, value_offset (v), len); (v2 is the full register. value_offset (v) specifies at which byte of that full register contents the contents of v start ...) The rest looks good to me. Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com