From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101788 invoked by alias); 7 Jun 2015 20:04:31 -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 101772 invoked by uid 89); 7 Jun 2015 20:04:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 07 Jun 2015 20:04:28 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 6F86CB8BC8; Sun, 7 Jun 2015 20:04:27 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t57K4Pep027848; Sun, 7 Jun 2015 16:04:26 -0400 Subject: [PATCH v6 00/10] Validate binary before use From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Aleksandar Ristovski Date: Sun, 07 Jun 2015 20:04:00 -0000 Message-ID: <20150607200422.8918.48900.stgit@host1.jankratochvil.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00096.txt.bz2 Hi, git://sourceware.org/git/archer.git jankratochvil/gdbserverbuildid an update. Patch below is an overall v5->v6 diff of the whole series. That gdb_regex* move is questionable. linux_find_memory_regions_full() uses regex now. build-id reporting needs to read+parse /proc/PID/maps so it uses linux_find_memory_regions_full(). But the regex is used only for detecing anonymous memory which is used for the build-id reporting (to skip trying to read build-id from anonymous mappings) but it is not too much important. OTOH I do not think it matters too much that a bit more code is moved to common/ . Except for 2 (or 3 - testcase?) patches it was approved a year ago by Tom Tromey modulo some trunk changes. Jan v6 * move also gdb_regex* to common/ as discussed above, also in config*.ac * skip_to_space{,_const}() were moved to common/ * common/common-defs.h #include reordering * new passing of enum filterflags from linux_qxfer_libraries_svr4() * dropped refactoring of code moved to common/ that avoided GDB exceptions * new svr4_copy_library_list() needs to handle new so_list->build_id v5 * svr4_validate() considers missing local build-id as not-a-match * target_so_ops->validate() now returns not-a-match reason as a string * rename common/common-target.[ch] -> common/target-utils.[ch] * testcase runs (but broken) even on different-filesystem remote target * testcase simplified by using with_test_prefix() v4 * NEWS, doc/gdb.texinfo additions. * Used host-defs.h. * New set/show solib-build-id-force. * testsuite: Do not run on non-localhost remote targets. v3 [patchv3 0/8] Validate binary before use https://sourceware.org/ml/gdb-patches/2014-02/msg00842.html Message-ID: <20140227213229.GA21121@host2.jankratochvil.net> * Implemented the review comments I made. * Removed fetching build-id in solib-svr4.c for NAT run. v2 [PATCH 0/8] v2 - validate binary before use https://sourceware.org/ml/gdb-patches/2013-04/msg00472.html Message-ID: <1366127096-5744-1-git-send-email-ARistovski@qnx.com> --- gdb/Makefile.in | 21 + gdb/NEWS | 12 + gdb/cli/cli-utils.c | 36 -- gdb/cli/cli-utils.h | 18 - gdb/common/common-defs.h | 2 gdb/common/common-utils.c | 137 ++++++ gdb/common/common-utils.h | 20 + gdb/common/common.m4 | 29 + gdb/common/gdb_regex.c | 73 +++ gdb/common/gdb_regex.h | 36 ++ gdb/common/host-defs.h | 21 + gdb/common/linux-maps.c | 546 +++++++++++++++++++++++ gdb/common/linux-maps.h | 64 +++ gdb/common/target-utils.c | 106 ++++ gdb/common/target-utils.h | 33 + gdb/config/i386/linux.mh | 2 gdb/config/i386/linux64.mh | 2 gdb/configure | 102 ++-- gdb/configure.ac | 29 - gdb/defs.h | 19 - gdb/doc/gdb.texinfo | 55 ++ gdb/features/library-list-svr4.dtd | 13 - gdb/gdb_regex.h | 36 -- gdb/gdbserver/Makefile.in | 12 - gdb/gdbserver/config.in | 3 gdb/gdbserver/configure | 56 ++ gdb/gdbserver/configure.srv | 2 gdb/gdbserver/gdbreplay.c | 6 gdb/gdbserver/linux-low.c | 398 +++++++++++++++-- gdb/linux-tdep.c | 568 ++---------------------- gdb/monitor.c | 16 - gdb/solib-darwin.c | 1 gdb/solib-dsbt.c | 1 gdb/solib-frv.c | 1 gdb/solib-spu.c | 1 gdb/solib-svr4.c | 91 ++++ gdb/solib-target.c | 2 gdb/solib.c | 62 +++ gdb/solib.h | 4 gdb/solist.h | 21 + gdb/target.c | 94 +--- gdb/testsuite/gdb.base/solib-mismatch-lib.c | 29 + gdb/testsuite/gdb.base/solib-mismatch-libmod.c | 29 + gdb/testsuite/gdb.base/solib-mismatch.c | 56 ++ gdb/testsuite/gdb.base/solib-mismatch.exp | 156 +++++++ gdb/utils.c | 154 ------- gdb/utils.h | 2 47 files changed, 2165 insertions(+), 1012 deletions(-) create mode 100644 gdb/common/gdb_regex.c create mode 100644 gdb/common/gdb_regex.h create mode 100644 gdb/common/linux-maps.c create mode 100644 gdb/common/linux-maps.h create mode 100644 gdb/common/target-utils.c create mode 100644 gdb/common/target-utils.h delete mode 100644 gdb/gdb_regex.h create mode 100644 gdb/testsuite/gdb.base/solib-mismatch-lib.c create mode 100644 gdb/testsuite/gdb.base/solib-mismatch-libmod.c create mode 100644 gdb/testsuite/gdb.base/solib-mismatch.c create mode 100644 gdb/testsuite/gdb.base/solib-mismatch.exp