This is the mail archive of the gdb-patches@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: [PATCH] aarch64 sim big-endian support


On 02 Jun 2016 19:36, Jim Wilson wrote:
>  aarch64_step (sim_cpu *cpu)
>  {
>    uint64_t pc = aarch64_get_PC (cpu);
> +  enum bfd_endian saved_target_byte_order;
>  
>    if (pc == TOP_LEVEL_RETURN_PC)
>      return FALSE;
>  
>    aarch64_set_next_PC (cpu, pc + 4);
> +
> +  /* Code is always little-endian.  */
> +  saved_target_byte_order = current_target_byte_order;
> +  current_target_byte_order = BFD_ENDIAN_LITTLE;
>    aarch64_get_instr (cpu) = aarch64_get_mem_u32 (cpu, pc);
> +  current_target_byte_order = saved_target_byte_order;

i don't think you should be messing with global state.  the sim core
has functions for reading raw opcodes if that's what you need.
-mike

Attachment: signature.asc
Description: Digital signature


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