From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29388 invoked by alias); 14 Feb 2011 22:11:27 -0000 Received: (qmail 29378 invoked by uid 22791); 14 Feb 2011 22:11:26 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Feb 2011 22:11:18 +0000 Received: (qmail 25890 invoked from network); 14 Feb 2011 22:11:16 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Feb 2011 22:11:16 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [unavailable values part 1, 04/17] map unavailable memory to unavailable value contents Date: Mon, 14 Feb 2011 22:14:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-25-generic; KDE/4.6.0; x86_64; ; ) Cc: Jan Kratochvil References: <201102071429.40838.pedro@codesourcery.com> <20110214115958.GD2454@host1.dyn.jankratochvil.net> In-Reply-To: <20110214115958.GD2454@host1.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102142211.11899.pedro@codesourcery.com> X-IsSubscribed: yes 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-02/txt/msg00305.txt.bz2 On Monday 14 February 2011 12:00:00, Jan Kratochvil wrote: > > + /* Fallback to reading from read-only sections. */ > > + table = target_get_section_table (&exec_ops); > > Cannot be table NULL? The exec target always returns a non-NULL table. It may be empty though (sections == sections_end). > > + available_memory = > > + section_table_available_memory (available_memory, > > + memaddr, length, > > + table->sections, > > + table->sections_end); > > + > > > > +/* Read LENGTH bytes of memory starting at MEMADDR into BUFFER, which > > + is (or will be copied to) VAL's contents buffer offset by > > + EMBEDDED_OFFSET (that is, to &VAL->contents[EMBEDDED_OFFSET]). > > + Marks value contents ranges as unavailable if the corresponding > > + memory is likewise unavailable. STACK indicates whether the memory > > + is known to be stack memory. */ > > + > > +extern void read_value_memory (struct value *val, int offset, > > + int stack, CORE_ADDR memaddr, > > + gdb_byte *buffer, size_t length); > > + > > Comment talks about EMBEDDED_OFFSET while the declaration parameter name does > not match the function definition parameter name. Thanks. I've renamed s/offset/embedded_offset in the declaration. > > > > @@ -572,6 +572,43 @@ map_vmap (bfd *abfd, bfd *arch) > > } > > > > > > +VEC(mem_range_s) * > > +section_table_available_memory (VEC(mem_range_s) *memory, > > + CORE_ADDR memaddr, LONGEST len, > > After `int', `ULONGEST' and `size_t' the type is now `LONGEST'. > > Does it mean there is no intention for >2GB inferior objects handling? > I thought some Fortran simulations may use such arrays etc. I think these parameters are the least of your troubles, given than you'll need to fix at least all the struct value related code for that. Made it a ULONGEST. > Unused variable `memend'. Deleted. I checked in the patch below. Thanks! -- Pedro Alves 2011-02-14 Pedro Alves Jan Kratochvil gdb/ * exec.c (section_table_available_memory): Change `len' parameter type to ULONGEST. * exec.h (section_table_available_memory): Ditto. * value.h (read_value_memory): Rename the `offset' parameter to `embedded_offset'. --- gdb/exec.c | 3 +-- gdb/exec.h | 2 +- gdb/value.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) Index: src/gdb/exec.c =================================================================== --- src.orig/gdb/exec.c 2011-02-14 11:20:34.000000000 +0000 +++ src/gdb/exec.c 2011-02-14 21:54:43.843995012 +0000 @@ -574,12 +574,11 @@ map_vmap (bfd *abfd, bfd *arch) VEC(mem_range_s) * section_table_available_memory (VEC(mem_range_s) *memory, - CORE_ADDR memaddr, LONGEST len, + CORE_ADDR memaddr, ULONGEST len, struct target_section *sections, struct target_section *sections_end) { struct target_section *p; - ULONGEST memend = memaddr + len; for (p = sections; p < sections_end; p++) { Index: src/gdb/exec.h =================================================================== --- src.orig/gdb/exec.h 2011-02-14 11:20:34.000000000 +0000 +++ src/gdb/exec.h 2011-02-14 21:53:45.573994995 +0000 @@ -52,7 +52,7 @@ extern int resize_section_table (struct extern VEC(mem_range_s) * section_table_available_memory (VEC(mem_range_s) *ranges, - CORE_ADDR memaddr, LONGEST len, + CORE_ADDR memaddr, ULONGEST len, struct target_section *sections, struct target_section *sections_end); Index: src/gdb/value.h =================================================================== --- src.orig/gdb/value.h 2011-02-14 11:32:21.000000000 +0000 +++ src/gdb/value.h 2011-02-14 21:51:17.783995011 +0000 @@ -410,7 +410,7 @@ extern int value_available_contents_eq ( memory is likewise unavailable. STACK indicates whether the memory is known to be stack memory. */ -extern void read_value_memory (struct value *val, int offset, +extern void read_value_memory (struct value *val, int embedded_offset, int stack, CORE_ADDR memaddr, gdb_byte *buffer, size_t length);