This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: reformatting user command argument


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]