From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22140 invoked by alias); 29 Dec 2011 20:30:52 -0000 Received: (qmail 22131 invoked by uid 22791); 29 Dec 2011 20:30:51 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,TW_BJ,TW_CP X-Spam-Check-By: sourceware.org Received: from c2beaomr10.btconnect.com (HELO mail.btconnect.com) (213.123.26.188) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Dec 2011 20:30:35 +0000 Received: from host81-138-1-83.in-addr.btopenworld.com (EHLO thor.office) ([81.138.1.83]) by c2beaomr10.btconnect.com with ESMTP id FQJ29570; Thu, 29 Dec 2011 20:30:33 +0000 (GMT) Message-Id: <59ABFF71-CA26-452C-B9B2-9B0FC6AAE2BD@sandoe-acoustics.co.uk> From: Iain Sandoe To: gdb-patches@sourceware.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v936) Subject: [Patch Darwin] head build fixes for i686-darwin9/x86_64-darwin10. Date: Thu, 29 Dec 2011 20:32:00 -0000 Cc: Tristan Gingold X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0301.4EFCCDE8.005B, actions=tag X-Junkmail-Premium-Raw: score=7/50, refid=2.7.2:2011.12.29.200021:17:7.586, ip=81.138.1.83, rules=__HAS_MSGID, __SANE_MSGID, __MSGID_APPLEMAIL, __TO_MALFORMED_2, __TO_NO_NAME, __CT, __CT_TEXT_PLAIN, __CTE, __MIME_VERSION, __MIME_VERSION_APPLEMAIL, __HAS_X_MAILER, __X_MAILER_APPLEMAIL, BODY_SIZE_3000_3999, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, __USER_AGENT_APPLEMAIL, RDNS_SUSP, BODY_SIZE_7000_LESS, NO_URI_FOUND X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B020A.4EFCCDE9.0031,ss=1,re=0.000,fgs=0, ip=0.0.0.0, so=2011-07-25 19:15:43, dmn=2011-05-27 18:58:46, mode=multiengine 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-12/txt/msg00891.txt.bz2 Hi, At present trunk gdb does not build for me on either i686-darwin9 or=20=20 x86_64-darwin10. There are two problems on Darwin 10 and three on Darwin 9 (description=20=20 with each patchlet, below). OK? Iain gdb: * machoread.c (macho_symtab_read): Initialize nbr_syms. * i386-darwin-nat.c (DR_FIRSTADDR, DR_LASTADDR, DR_STATUS, DR_CONTROL): Ensure a default definition is available. * darwin-nat.c (darwin_read_dyld_info): Only build if TASK_DYLD_INFO_COUNT is available. (darwin_xfer_partial): Don not try to fetch dyld info unless TASK_DYLD_INFO_COUNT is available. =3D=3D=3D=3D=3D 1/ a "maybe used un-initialized" (in machoread.c) which is fixed thus: diff --git a/gdb/machoread.c b/gdb/machoread.c index 46b8842..ba38ca6 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c @@ -180,7 +180,7 @@ macho_symtab_read (struct objfile *objfile, const asymbol *dir_so =3D NULL; const asymbol *file_so =3D NULL; asymbol **oso_file =3D NULL; - unsigned int nbr_syms; + unsigned int nbr_syms =3D 0; /* Current state while reading stabs. */ enum =3D=3D=3D=3D=3D=3D=3D 2/ DR_FIRSTADDR and cousins are undefined. (the fragment below is copied verbatim from gdb-7.3.1 - is there some=20=20 reason to expect that it should have been defined elsewhere?) diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c index 23f6a6d..2a346c4 100644 --- a/gdb/i386-darwin-nat.c +++ b/gdb/i386-darwin-nat.c @@ -263,6 +263,22 @@ i386_darwin_store_inferior_registers (struct=20=20 target_ops *ops, /* Support for debug registers, boosted mostly from i386-linux-=20 nat.c. */ +#ifndef DR_FIRSTADDR +#define DR_FIRSTADDR 0 +#endif + +#ifndef DR_LASTADDR +#define DR_LASTADDR 3 +#endif + +#ifndef DR_STATUS +#define DR_STATUS 6 +#endif + +#ifndef DR_CONTROL +#define DR_CONTROL 7 +#endif + static void i386_darwin_dr_set (int regnum, uint32_t value) { =3D=3D=3D=3D=3D 3/ (Darwin 9 only) TASK_DYLD_INFO_COUNT etc. are not defined. Fixed thus: diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index 94f49d6..efc59e7 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -1823,6 +1823,7 @@ out: return length; } +#ifdef TASK_DYLD_INFO_COUNT /* Read LENGTH bytes at offset ADDR of task_dyld_info for TASK, and=20=20 copy them to RDADDR. Return 0 on failure; number of bytes read / writen otherwise. */ @@ -1848,7 +1849,7 @@ darwin_read_dyld_info (task_t task, CORE_ADDR=20=20 addr, char *rdaddr, int length) memcpy (rdaddr, (char *)&task_dyld_info + addr, length); return length; } - +#endif =0C /* Return 0 on failure, number of bytes handled otherwise. TARGET is ignored. */ @@ -1890,6 +1891,7 @@ darwin_xfer_partial (struct target_ops *ops, case TARGET_OBJECT_MEMORY: return darwin_read_write_inferior (inf->private->task, offset, readbuf, writebuf, len); +#ifdef TASK_DYLD_INFO_COUNT case TARGET_OBJECT_DARWIN_DYLD_INFO: if (writebuf !=3D NULL || readbuf =3D=3D NULL) { @@ -1897,6 +1899,7 @@ darwin_xfer_partial (struct target_ops *ops, return -1; } return darwin_read_dyld_info (inf->private->task, offset,=20=20 readbuf, len); +#endif default: return -1; }