[RFA 3/5] New port: CR16: gdb port

Pedro Alves palves@redhat.com
Wed Jan 23 14:26:00 GMT 2013


On 01/23/2013 02:22 PM, Kaushik Phatak wrote:
>> > How about exporting a function that hides these opcodes details?  
>> > I don't even pretend to understand what the code is trying to do, 
>> > and it'd be an opportunity to comment it in the function description.
>> >   /* Take BUF, do something with it, and write length
>> >        to LENGTH.  Blah, blah.  */
>> >    cr16_do_something (buf, *length, ...);
> I think this can be done and it will make this code look cleaner.
> An exported function in bfd would make my code look like this,
> ...
>    target_read_memory (pc, buf, 6);
>    cr16_get_insn_length (buf, *length, ...);
>    next_pc = pc + length;
>     ...
> 

If it's the instruction length you need, then did you
try gdb_buffered_insn_length or gdb_insn_length?

-- 
Pedro Alves



More information about the Gdb-patches mailing list