This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: reformatting user command argument
- From: Daniel Jacobowitz <drow at false dot org>
- To: Tavis Ormandy <taviso at sdf dot lonestar dot org>
- Cc: gdb at sourceware dot org
- Date: Thu, 11 May 2006 08:49:59 -0400
- Subject: Re: reformatting user command argument
- References: <20060511124156.GB23650@sdf.lonestar.org>
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