From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24106 invoked by alias); 1 Mar 2007 18:27:10 -0000 Received: (qmail 24098 invoked by uid 22791); 1 Mar 2007 18:27:07 -0000 X-Spam-Check-By: sourceware.org Received: from igw2.br.ibm.com (HELO igw2.br.ibm.com) (32.104.18.25) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 01 Mar 2007 18:27:01 +0000 Received: from mailhub1.br.ibm.com (mailhub1 [9.18.232.109]) by igw2.br.ibm.com (Postfix) with ESMTP id D81825BF79 for ; Thu, 1 Mar 2007 15:22:06 -0300 (BRT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l21IQtxd1618128 for ; Thu, 1 Mar 2007 15:26:55 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l21IPOaf021373 for ; Thu, 1 Mar 2007 15:25:24 -0300 Received: from [9.18.238.151] (kadinsky.br.ibm.com [9.18.238.151]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l21IPM5G020894 for ; Thu, 1 Mar 2007 15:25:23 -0300 Subject: [PATCH 24700] From: Jose Flavio Aguilar Paulino To: gdb-patches@sourceware.org Content-Type: multipart/mixed; boundary="=-suvVcX6IijFs8CJTIve0" Date: Thu, 01 Mar 2007 18:27:00 -0000 Message-Id: <1172777198.10229.11.camel@kadinsky.prado> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 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: 2007-03/txt/msg00002.txt.bz2 --=-suvVcX6IijFs8CJTIve0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-length: 540 This patch modifies the file. It was noticed in GDB for PPC64 that the command "set var" failed when used to change a string value, the intent of this patch is to solve this gdb64's problem. Ex: char *ptr = NULL; printf("ptr string is %s\n", ptr); (gdb) set var ptr="def" ---Problem Description--- gdb64: failed to set a string variable's value. I could not detect any regressions that could be caused by this patch in GDB's testsuite. ----- José Flávio Aguilar Paulino Software Engineer LoP Toolchain Team IBM --=-suvVcX6IijFs8CJTIve0 Content-Disposition: attachment; filename=24700.patch Content-Type: text/x-patch; name=24700.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 2025 Index: ppc-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v retrieving revision 1.81 diff -a -u -r1.81 ppc-linux-tdep.c --- ppc-linux-tdep.c 9 Jan 2007 17:58:55 -0000 1.81 +++ ppc-linux-tdep.c 8 Feb 2007 01:11:15 -0000 @@ -753,11 +753,57 @@ CORE_ADDR addr, struct target_ops *targ) { + CORE_ADDR addr2deref = 0; struct section_table *s = target_section_by_addr (targ, addr); + char buf[sizeof (ULONGEST)]; + struct objfile *objfile; + struct obj_section *osect; + asection *sect; + CORE_ADDR sect_addr; /* Check if ADDR points to a function descriptor. */ - if (s && strcmp (s->the_bfd_section->name, ".opd") == 0) - return get_target_memory_unsigned (targ, addr, 8); + + + if (s) + { + if (strcmp (s->the_bfd_section->name, ".opd") != 0) + /* Found a the section, but it's not an .opd section. */ + return addr; + addr2deref = addr; + } + else + /* The followin table search has been copied from printcmd.c */ + ALL_OBJSECTIONS (objfile, osect) + { + /* Only process each object file once, even if there's a separate + debug file. */ + if (objfile->separate_debug_objfile_backlink) + continue; + + sect = osect->the_bfd_section; + sect_addr = overlay_mapped_address (addr, sect); + + if (osect->addr <= sect_addr && sect_addr < osect->endaddr) + { + if (strcmp (sect->name, ".opd") != 0) + /* Found the section, but it's not an .opd section. */ + return addr; + addr2deref = addr; + break; + } + } + + if (addr2deref) + { + if (targ != ¤t_target) + return get_target_memory_unsigned (targ, addr2deref, 8); + else + { + gdb_assert (8 <= sizeof (buf)); + target_read_memory(addr, buf, 8); + return extract_unsigned_integer (buf, 8); + } + } return addr; } --=-suvVcX6IijFs8CJTIve0--