From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8252 invoked by alias); 1 Dec 2012 20:48:06 -0000 Received: (qmail 8243 invoked by uid 22791); 1 Dec 2012 20:48:05 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 01 Dec 2012 20:47:58 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB1Klu9v017847 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 1 Dec 2012 15:47:56 -0500 Received: from host2.jankratochvil.net (ovpn-116-104.ams2.redhat.com [10.36.116.104]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qB1Klpw6012805 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 1 Dec 2012 15:47:54 -0500 Date: Sat, 01 Dec 2012 20:48:00 -0000 From: Jan Kratochvil To: Sanjoy Das Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 3/3] Add a test case for the jit-reader interface. Message-ID: <20121201204751.GB22812@host2.jankratochvil.net> References: <1352048631-25042-1-git-send-email-sanjoy@playingwithpointers.com> <1352048631-25042-4-git-send-email-sanjoy@playingwithpointers.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1352048631-25042-4-git-send-email-sanjoy@playingwithpointers.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 X-SW-Source: 2012-12/txt/msg00008.txt.bz2 On Sun, 04 Nov 2012 18:03:51 +0100, Sanjoy Das wrote: > --- a/gdb/testsuite/ChangeLog > +++ b/gdb/testsuite/ChangeLog > @@ -1,3 +1,11 @@ > +2012-11-04 Sanjoy Das > + > + * gdb.base/jit-reader.exp: New file. Test case for the jit-reader > + interface. > + * gdb.base/jithost.c: Do. I do not understand "Do.". Either "Likewise." or also "New file.". > + * gdb.base/jithost.h: Do. > + * gdb.base/jitreader.c : Do. > + > 2012-11-03 Yao Qi > > Fix PR gdb/14617. > diff --git a/gdb/testsuite/gdb.base/jit-reader.exp b/gdb/testsuite/gdb.base/jit-reader.exp > new file mode 100644 > index 0000000..4c61aeb > --- /dev/null > +++ b/gdb/testsuite/gdb.base/jit-reader.exp > @@ -0,0 +1,79 @@ > +# Copyright 2011-2012 Free Software Foundation, Inc. For GDB repository it is only 2012. [...] > +proc jit_reader_test {} { > + global jit_host_bin > + global jit_reader_bin > + global verbose > + > + clean_restart $jit_host_bin > + > + if {$verbose > 0} { > + gdb_run_cmd "set debug jit 1" It executes: run {set debug jit 1} Use: gdb_test_no_output "set debug jit 1" > + } > + > + gdb_test_no_output "jit-reader-load ${jit_reader_bin}" > + gdb_run_cmd "run" It executes: (gdb) run run Besides that it does not wait on the SIGTRAP output it produces, so it is racy. use: gdb_run_cmd gdb_test "" "Program received signal SIGTRAP, .*" "expect SIGTRAP" > + > + gdb_test "bt" "jit_function_00.*" > +} > + > +jit_reader_test > diff --git a/gdb/testsuite/gdb.base/jithost.c b/gdb/testsuite/gdb.base/jithost.c > new file mode 100644 > index 0000000..31adb25 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/jithost.c > @@ -0,0 +1,84 @@ > +/* Copyright (C) 2009-2012 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include JIT_READER_H /* Please see jit-reader.exp for an explanation. */ > +#include "jithost.h" > + > +typedef enum > +{ > + JIT_NOACTION = 0, > + JIT_REGISTER_FN, > + JIT_UNREGISTER_FN > +} jit_actions_t; I do not understand why you do not use gdb/jit.h here? This file is a duplicate. Sorry if it was already discussed during initial JIT review. > + > +struct jit_code_entry > +{ > + struct jit_code_entry *next_entry; > + struct jit_code_entry *prev_entry; > + void *symfile_addr; > + uint64_t symfile_size; > +}; > + > +struct jit_descriptor > +{ > + uint32_t version; > + uint32_t action_flag; > + struct jit_code_entry *relevant_entry; > + struct jit_code_entry *first_entry; > +}; > + > +void __attribute__((noinline)) __jit_debug_register_code () { } > + > +struct jit_descriptor __jit_debug_descriptor = { 1, 0, 0, 0 }; > +struct jit_code_entry only_entry; > + > +typedef void (jit_function_t) (); [...] Thanks, Jan