From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Sanjoy Das <sanjoy@playingwithpointers.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/3] Add a test case for the jit-reader interface.
Date: Sat, 01 Dec 2012 20:48:00 -0000 [thread overview]
Message-ID: <20121201204751.GB22812@host2.jankratochvil.net> (raw)
In-Reply-To: <1352048631-25042-4-git-send-email-sanjoy@playingwithpointers.com>
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 <sanjoy@playingwithpointers.com>
> +
> + * 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 <yao@codesourcery.com>
>
> 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 <http://www.gnu.org/licenses/>. */
> +
> +#include <stdint.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <string.h>
> +#include <unistd.h>
> +
> +#include <sys/mman.h>
> +
> +#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
next prev parent reply other threads:[~2012-12-01 20:48 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-04 16:59 [PATCH 0/3] Address review, "fix recent breakage in the JIT reader interface" Sanjoy Das
2012-11-04 17:00 ` [PATCH 2/3] Make jit-reader-load accept absolute paths to reader shared objects Sanjoy Das
2013-01-09 9:36 ` Jan Kratochvil
2012-11-04 17:00 ` [PATCH 3/3] Add a test case for the jit-reader interface Sanjoy Das
2012-12-01 20:48 ` Jan Kratochvil [this message]
2012-12-07 9:15 ` Sanjoy Das
2012-12-10 16:38 ` Jan Kratochvil
2013-01-08 20:40 ` Sanjoy Das
2013-01-09 12:37 ` Jan Kratochvil
2013-01-13 21:58 ` Sanjoy Das
2013-01-14 3:52 ` Jan Kratochvil
2012-11-04 17:00 ` [PATCH 1/3] Fix segfault when unwinding JIT frames using a custom reader Sanjoy Das
2012-12-01 20:25 ` Jan Kratochvil
2012-11-08 21:06 ` [PATCH 0/3] Address review, "fix recent breakage in the JIT reader interface" Tom Tromey
-- strict thread matches above, loose matches on Subject: below --
2012-10-08 11:43 Sanjoy Das
2012-10-08 11:43 ` [PATCH 3/3] Add a test case for the jit-reader interface Sanjoy Das
2012-10-16 20:16 ` Tom Tromey
2012-10-17 16:16 ` Pedro Alves
2012-10-17 16:27 ` Tom Tromey
2012-10-17 16:35 ` Pedro Alves
2012-10-17 16:29 ` Pedro Alves
2012-09-24 4:48 [PATCH 0/3] Address review, "fix recent breakage in the JIT reader interface" Sanjoy Das
2012-09-24 4:48 ` [PATCH 3/3] Add a test case for the jit-reader interface Sanjoy Das
2012-09-27 21:00 ` Tom Tromey
2012-09-18 4:30 [PATCH 0/3] Fix recent breakage in the JIT reader interface Sanjoy Das
2012-09-18 4:30 ` [PATCH 3/3] Add a test case for the jit-reader interface Sanjoy Das
2012-09-18 19:36 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121201204751.GB22812@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=sanjoy@playingwithpointers.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox