From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1511 invoked by alias); 1 Sep 2014 20:08:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 1497 invoked by uid 89); 1 Sep 2014 20:08:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f182.google.com Received: from mail-ob0-f182.google.com (HELO mail-ob0-f182.google.com) (209.85.214.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 01 Sep 2014 20:08:24 +0000 Received: by mail-ob0-f182.google.com with SMTP id va2so4096308obc.41 for ; Mon, 01 Sep 2014 13:08:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=/WR/EW5w6uQikuq6qYrLAVB4vzBv2JF7ygKVGZQnGUQ=; b=nOVIEo8OqHBnNlQSOd1r5024iBeS4No27eBt9Ma/IGm9iThgYK+TFynIxp72HD68fK uaGe3+WuqW7iDcSu3AQozrz/B5rfNG80kr9xIyrr9BLWt2z6xg8aZk2Up5an1bk7NZu6 Pe/fTmg/Y5xX9D2Qj9VtoDk0oqlcD4Qsft7UYYDBZUq134zhyGkSJ7t0XRpntiTjJmyT XKdF4MaQ2FM8xDN3thrCftPWqT9RX1Hl+IKOjMQ8phbmsyDYGb4JmJ09Yn43W90ADIaI P2gnFf0H6DNW0fTHTrqOGV02j0+dOt+qsNhTEgNv4vs1v5KkYIvYr5a6r75P+N6Irhyg UHEA== X-Gm-Message-State: ALoCoQlJuB3+LiRpPwjrowdcVejBEH3MYUi+fQ4xS1nrNVC8cNuhrE/ApVB/SZ15+waEC1ouYe2L X-Received: by 10.60.43.196 with SMTP id y4mr4052532oel.60.1409602102086; Mon, 01 Sep 2014 13:08:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.140.40 with HTTP; Mon, 1 Sep 2014 13:08:01 -0700 (PDT) In-Reply-To: <87k35q8xuf.fsf@codesourcery.com> References: <1401898871-2270-1-git-send-email-omair.javaid@linaro.org> <1401898871-2270-5-git-send-email-omair.javaid@linaro.org> <87k35q8xuf.fsf@codesourcery.com> From: Omair Javaid Date: Mon, 01 Sep 2014 20:08:00 -0000 Message-ID: Subject: Re: [PATCH 4/7] Implements aarch64 process record and reverse debugging support To: Yao Qi Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00032.txt.bz2 On 30 August 2014 08:23, Yao Qi wrote: > Omair Javaid 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 instructi= on set. >> >> gdb: >> >> 2014-06-04 Omair Javaid >> >> * 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. OK > >> + >> +/* ARM memory record structure. */ > > s/ARM/AArch64/ OK > >> +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 OK > > Likewise. > > -- > Yao (=E9=BD=90=E5=B0=A7)