[PATCH] arm reversible : <phase_2_complete>
Petr Hluzín
petr.hluzin@gmail.com
Sun Dec 4 13:29:00 GMT 2011
2011/12/4 oza Pawandeep <oza.pawandeep@gmail.com>:
> Hi,
>
> Updated patch contains all the 3 review comments fixed (Tom, Petr and Yao).
> Change log is elaborated; I am looking forwarding to adding more
> details if need. seeking for your feedback on the same.
>
> diff -urN arm_orig/ChangeLog arm_new/ChangeLog
> --- arm_orig/ChangeLog 2011-12-03 18:05:04.000000000 +0530
> +++ arm_new/ChangeLog 2011-12-04 16:45:00.000000000 +0530
> @@ -1,3 +1,65 @@
> +2011-12-03 Oza Pawandeep <oza.pawandeep@gmail.com>
> +
> + * arm-linux-tdep.c: arm_linux_init_abi modified to include
> + arm reversible debugging feature.
> + registered arm_process_record to gdb_arch
> + syscall pointer initialization.
> +
> + * arm-tdep.c: arm-reversible-debugging implementation.
> + newly added functions are as follows.
> +
> + > arm_process_record: handles basic initialization and record
> + summarisation, decodes basic insn ids, on which it hands over
> + controls to decode_insn.
> + > deallocate_reg_mem : clean up function
> + > decode_insn: Decodes arm/thumb insn and calls appropriate
> + decoding routine to record the change.
> + > thumb_record_branch: branch insn reording (thumb)
> + > thumb_record_ldm_stm_swi: load, store and sycall insn
> + recoding (thumb)
> + > thumb_record_misc: misc insn recording (thumb)
> + > thumb_record_ld_st_stack: store and stack insn recording (thumb)
> + > thumb_record_ld_st_imm_offset: load, store with immediate offset
> + insn recording (thumb)
> + > thumb_record_ld_st_reg_offset: load, store with register offset
> + recording (thumb)
> + > thumb_record_add_sub_cmp_mov: addition, subtractation, compare
> + and move insn recording (thumb)
> + > thumb_record_shift_add_sub: shift, add and sub insn recording
> + (thumb)
> + > arm_record_coproc_data_proc: coprocessor and data processing
> + recording (partially implemented) (arm)
> + > arm_record_coproc: coprocessor insn recording
> + (partially implemented) (arm)
> + > arm_record_b_bl: branch insn recording (arm)
> + > arm_record_ld_st_multiple: load and store multiple insn recording
> + (arm)
> + > arm_record_ld_st_reg_offset: load and store reg offset recording
> + (arm)
> + > arm_record_ld_st_imm_offset: load and store immediate offset
> + recording (arm)
> + > arm_record_data_proc_imm: data processing insn recording (arm)
> + > arm_record_data_proc_misc_ld_str: data processing, misc, load and
> + store insn recording (arm)
> + > arm_record_extension_space:arm extension space insn recording
> + (arm)
> + > arm_record_strx: str(X) type insn recording (arm)
> + > sbo_sbz: checks for mendatory sbo and sbz fields in insn,
> +
> + added new data structures:
> + > insn_decode_record_t: local record structure which contains insn's
> + record, which includes both reg and memory.
> +
> + REG_ALLOC and MEM_ALLOC macros takes care of actual memory allocation
> + in local record which is finally processed by arm_rocess_record.
> +
> + * arm-tdep.h: arm-reversible data structures
> +
> + > modified gdbarch_tdep: added member (function pointer) arm_swi_record
> + which is supposed to be recording system calls
> + > arm_process_record externed.
> +
> +
WOW, thats a lot of text. Other people's changelog entries are more
terse. For example the GNU guidelines say "For example, “New function”
is enough for the change log when you add a function, because there
should be a comment before the function definition to explain what it
does."
In function decode_insn():
> +
> + if (extract_arm_insn (arm_record, insn_size))
> + {
> + if (record_debug)
> + {
> + printf_unfiltered (_("Process record: error reading memory at "
> + "addr %s len = %d.\n"),
> + paddress (arm_record->gdbarch, arm_record->this_addr), insn_size);
> + return -1;
> + }
> + }
If the extract_arm_insn() call fails then the function returns only if
`record_debug' is true. This is strange. Enabling debugging traces
usually expected to only affect printing, here it affects behavior of
the decode_insn() function. Plus the rest of the function seems to
misbehave if it is passed failed result in `arm_record'. I guess the
`return -1;' statement should be moved outside of body of condition
`if (record_debug)'. Unortunatelly I did not notice that earlier.
In arm_process_record():
> +
> + if (extract_arm_insn (&arm_record, 2))
> + {
> + if (record_debug)
> + {
> + printf_unfiltered (_("Process record: error reading memory at "
> + "addr %s len = %d.\n"),
> + paddress (arm_record.gdbarch,
> + arm_record.this_addr), 2);
> + return -1;
> + }
> + }
The same applies here.
Except the one last thing the patch looks good to me now. My previous
suggestions have been resolved.
As always, I did not check whitespace, ARM semantics and Changelog entries.
--
Petr Hluzin
More information about the Gdb-patches
mailing list