From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29393 invoked by alias); 19 Mar 2013 21:26:14 -0000 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 Received: (qmail 29347 invoked by uid 89); 19 Mar 2013 21:26:07 -0000 X-Spam-Sware-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 19 Mar 2013 21:25:57 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1DF2F2E44E for ; Tue, 19 Mar 2013 17:25:56 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id evs21V8XfUj2 for ; Tue, 19 Mar 2013 17:25:56 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E25742E24D for ; Tue, 19 Mar 2013 17:25:55 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 45EAFC25A3; Tue, 19 Mar 2013 14:25:54 -0700 (PDT) Date: Wed, 20 Mar 2013 02:25:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [patch] windows-nat.c: Fix offset problem in signal string handling Message-ID: <20130319212554.GE4506@adacore.com> References: <20130319151436.GB20727@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130319151436.GB20727@calimero.vinschen.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-03/txt/msg00724.txt.bz2 > Alternatively the call to string_to_core_addr could be replaced with a > call to `strtoull (p, NULL, 0)'. Since this code is only supported on > Cygwin, it's safe to assume that the strtoull function exists. I would go for that option, mostly because you already use strtol to parse the beginning of that string... > Version 2: > > * windows-nat.c (handle_output_debug_string): Replace call > to string_to_core_addr with call to strtoull. > > Index: windows-nat.c > =================================================================== > RCS file: /cvs/src/src/gdb/windows-nat.c,v > retrieving revision 1.242 > diff -u -p -r1.242 windows-nat.c > --- windows-nat.c 19 Mar 2013 15:06:26 -0000 1.242 > +++ windows-nat.c 19 Mar 2013 15:13:10 -0000 > @@ -978,7 +978,7 @@ handle_output_debug_string (struct targe > retval = strtoul (p, &p, 0); > if (!retval) > retval = main_thread_id; > - else if ((x = (LPCVOID) string_to_core_addr (p)) > + else if ((x = (LPCVOID) strtoull (p, NULL, 0)) > && ReadProcessMemory (current_process_handle, x, > &saved_context, > __COPY_CONTEXT_SIZE, &n) -- Joel