From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74189 invoked by alias); 14 Oct 2015 11:14:40 -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 72531 invoked by uid 89); 14 Oct 2015 11:14:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mail.windriver.com Received: from mail.windriver.com (HELO mail.windriver.com) (147.11.1.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 14 Oct 2015 11:14:37 +0000 Received: from arn-build2.wrs.com (arn-build2.wrs.com [128.224.95.15]) by mail.windriver.com (8.15.2/8.15.1) with ESMTP id t9EBEYZJ010698 for ; Wed, 14 Oct 2015 04:14:34 -0700 (PDT) Received: by arn-build2.wrs.com (Postfix, from userid 18580) id CAD90220702; Wed, 14 Oct 2015 13:14:33 +0200 (CEST) From: henrik.wallin@windriver.com To: gdb-patches@sourceware.org Subject: [RFC][PATCH 00/15] Fast tracepoint support for ARMv7 Date: Wed, 14 Oct 2015 11:14:00 -0000 Message-Id: X-SW-Source: 2015-10/txt/msg00195.txt.bz2 From: Henrik Wallin Hi, This implements fast tracepoint support for ARMv7. It handles both arm and thumb mode. The first 8 patches are bug-fixes and not directly related to the ARM support and should probably be separated out from this patch set, but I keep them in here for now. The following 7 patches contains the ARM support for fast tracepoint. I post this as an RFC at this point, as I'm not actively working with this. I will response and post updates to this series, but any major improvements / changes will be hard to achieve for me at this point. There are some left-over issues: - The breakpoint based tracepoints does not work. There is another thread [1] providing needed gdbserver changes to achieve that. Those patches together with these should provide full tracepoint support for ARMv7. (Not verified) - Patch "gdbserver: Add help functions to get arm/thumb mode" needs a better solution. - How to correctly identify that the running ARM cpu is supporting ARMv7-a. - No updates done to the testsuite. Known limitations - Current implementation will refuse all instruction that do any relative operation with the PC counter, as relocating such an instruction is non-trivial. This can be improved as some of those instructions can be re-written with alternative instruction(s). - There is no included jit tracepoint expression optimization included. This should be possible to add. - Can only set a tracepoint at a 4 bytes instructions, as a 2 bytes slot is too small for the needed jump instruction. This feels like a natural limitation for this functionality, but means that for thumb the user will hit this limitation quite often. - The inserted 4 byte jump instruction has a limitation on how far it can branch. The length is validated, but if too far it will not be possible to insert the tracepoint. With very large programs this might be an issue, but again feels like a natural limitation. Testing - The internal testsystem has not been run, but I will look into that. I've run other tests on it though and I have no known problems. Patch description: Patches are based on master, e753e154bf8a1f507b43e03dec04b341dde3f429 patch 1-8: Bugfixes in generic code. Not specific to ARM. Should probably be split out from this patch set. patch 9-13: Adds new code (but not activated) for ARM tracepoints. patch 14-15: Activates and makes tracepoints available. [1]: https://sourceware.org/ml/gdb-patches/2015-09/msg00221.html Henrik Wallin (9): Fix mmap usage of MAP_FIXED for multiple pages. gdbserver: Move pointer dereference to after assert checks. gdb: Add relocate instruction helpers gdb: Add arm_fast_tracepoint_valid_at gdbserver: Add helper functions to create arm instructions gdbserver: Add help functions to get arm/thumb mode gdbserver: Add arm_install_fast_tracepoint_jump_pad gdbserver: Add linux-arm-ipa.c gdb/gdbserver: Enable tracepoint for ARM Par Olsson (6): Fix endian problem for tracepoint enabled flag Fix internal error when saving fast tracepoint definitions Fix crash in enable/disable after detach Fix crash in tstatus after detach Fix crash when tstart after detach. Add possibility to restart trace after tfind. gdb/arm-tdep.c | 658 ++++++++++++++++++++++++++++++++++++++++++ gdb/breakpoint.c | 2 +- gdb/common/agent.c | 7 + gdb/gdbserver/Makefile.in | 6 + gdb/gdbserver/configure.srv | 1 + gdb/gdbserver/linux-arm-ipa.c | 97 +++++++ gdb/gdbserver/linux-arm-low.c | 410 +++++++++++++++++++++++++- gdb/gdbserver/tracepoint.c | 33 ++- gdb/tracepoint.c | 14 +- 9 files changed, 1218 insertions(+), 10 deletions(-) create mode 100644 gdb/gdbserver/linux-arm-ipa.c -- 2.1.4