mem command and set command

Daniel Jacobowitz drow@false.org
Fri Mar 7 18:19:00 GMT 2008


On Fri, Mar 07, 2008 at 04:55:53PM +0800, bjgnu@sunnorth.com.cn wrote:
> hello all,
> 
> Executing the following GDB commands:
>  
> mem 0x0 0x100 16
> set *0x0=0x12345678
> 
> I found the 3rd parameter of write_memory (CORE_ADDR memaddr, const 
> bfd_byte *myaddr, int len) is always 4.
> I think the length should be 2 because "mem 0x0 0x100 16" has set memory 
> width to 16.
> Does "mem" command affect write memory operation? 

No.  The width appears to be unused.  I just use set {short} 0 =
0x1234 when I want to generate a 16-bit write.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb mailing list