This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH 4/7] Implements aarch64 process record and reverse debugging support
- From: Omair Javaid <omair dot javaid at linaro dot org>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 2 Sep 2014 01:08:01 +0500
- Subject: Re: [PATCH 4/7] Implements aarch64 process record and reverse debugging support
- Authentication-results: sourceware.org; auth=none
- References: <1401898871-2270-1-git-send-email-omair dot javaid at linaro dot org> <1401898871-2270-5-git-send-email-omair dot javaid at linaro dot org> <87k35q8xuf dot fsf at codesourcery dot com>
On 30 August 2014 08:23, Yao Qi <email@example.com> wrote:
> Omair Javaid <firstname.lastname@example.org> writes:
>> This patch defines structures, macros and functions required for process record
>> and reverse debugging support on aarch64-linux targets. Also implements
>> support for recording most if not all of instructions from a64 instruction set.
>> 2014-06-04 Omair Javaid <email@example.com>
>> * aarch64-linux-tdep.c (aarch64_linux_init_abi): Updated.
>> * aarch64-tdep.c (record.h): Include.
>> (record-full.h): Include.
>> (aarch64_record_data_proc_reg): New function.
>> (aarch64_record_data_proc_imm): New function.
>> (aarch64_record_branch_except_sys): New function.
>> (aarch64_record_load_store): New function.
>> (aarch64_record_decode_insn_handler): New function.
>> (deallocate_reg_mem): New function.
>> (aarch64_process_record): New function.
>> * aarch64-tdep.h (submask): New macro.
>> (bit): New macro.
>> (bits): New macro.
>> (REG_ALLOC): New macro.
>> (MEM_ALLOC): New macro.
>> (struct aarch64_mem_r): Defined.
>> (aarch64_record_result): New enum.
>> (struct insn_decode_record): Defined.
>> (insn_decode_record): New typedef.
>> (aarch64_process_record): New extern declaration.
> We want to support process record on aarch64-linux, but the code is
> added to aarch64-tdep.c. Does aarch64-elf target need process record?
> I prefer to add code to aarch64-linux-tdep.c. I know that code for
> process record on arm was added to arm-tdep.c too, but I don't think it
> is correct either.
If we try Record-Replay can work on any target running a gdb stub with
a little tweaking but we do need a linux host machine in all cases.
so I think *-tdep.c is the right place for it. Thats the reason
syscall recording code resides in *-linux-tdep.c but all other
instruction recording code is in *-tdep.c
>> diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h
>> index 78fb779..8a193f4 100644
>> --- a/gdb/aarch64-tdep.h
>> +++ b/gdb/aarch64-tdep.h
>> @@ -90,4 +90,69 @@ struct gdbarch_tdep
>> struct type *vnb_type;
>> +/* aarch64 process record-replay related structures, defines etc. */
>> +#define submask(x) ((1L << ((x) + 1)) - 1)
>> +#define bit(obj,st) (((obj) >> (st)) & 1)
>> +#define bits(obj,st,fn) (((obj) >> (st)) & submask ((fn) - (st)))
> If they are only used in aarch64-tdep.c, please define them there.
>> +/* ARM memory record structure. */
>> +struct aarch64_mem_r
>> + uint64_t len; /* Record length. */
>> + uint64_t addr; /* Memory address. */
>> +enum aarch64_record_result
>> + AARCH64_RECORD_SUCCESS,
>> + AARCH64_RECORD_FAILURE,
>> + AARCH64_RECORD_USUPPORTED
>> +/* ARM instruction record contains opcode of current insn
> Yao (éå)