From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6915 invoked by alias); 11 May 2006 12:50:10 -0000 Received: (qmail 6900 invoked by uid 22791); 11 May 2006 12:50:09 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 11 May 2006 12:50:02 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FeAcB-0000wz-U3; Thu, 11 May 2006 08:50:00 -0400 Date: Thu, 11 May 2006 14:47:00 -0000 From: Daniel Jacobowitz To: Tavis Ormandy Cc: gdb@sourceware.org Subject: Re: reformatting user command argument Message-ID: <20060511124959.GA3567@nevyn.them.org> Mail-Followup-To: Tavis Ormandy , gdb@sourceware.org References: <20060511124156.GB23650@sdf.lonestar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060511124156.GB23650@sdf.lonestar.org> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00138.txt.bz2 On Thu, May 11, 2006 at 01:41:56PM +0100, Tavis Ormandy wrote: > Hello, I've written a macro to assemble instructions directly to memory > using the nasm assembler to make patching binaries using `set write` > easier, it works great, but as a final touch I'd like to be able to tell > the assembler the address where the code will be inserted. > > This works fine if I call my macro as `assemble 0x12345`, or `assemble > $pc` but if I use `assemble _start` i cant convert that to an address. I > thought `set $arg0 = (unsigned) $arg0` might work, but no such luck. You can't do this interchangeably with numbers, but &_start should give you something of the appropriate type. -- Daniel Jacobowitz CodeSourcery