diff options
author | Pedro Alves <palves@redhat.com> | 2011-10-31 12:55:26 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-10-31 12:55:26 +0000 |
commit | b9fd179153353a88a34dd97a03ee698376212d29 (patch) | |
tree | 8bc287b65968fbb6ab935b498ed00a0db9363cec /gdb/testsuite/gdb.trace/trace-break.c | |
parent | *** empty log message *** (diff) | |
download | binutils-gdb-b9fd179153353a88a34dd97a03ee698376212d29.tar.gz binutils-gdb-b9fd179153353a88a34dd97a03ee698376212d29.tar.bz2 binutils-gdb-b9fd179153353a88a34dd97a03ee698376212d29.zip |
2011-10-31 Pedro Alves <pedro@codesourcery.com>
gdb/gdbserver/
* mem-break.c (check_mem_write): Add `myaddr' parameter. Don't
clobber the breakpoints' shadows with fast tracepoint jumps.
* mem-break.h (check_mem_write): Add `myaddr' parameter.
* target.c (write_inferior_memory): Also pass MYADDR down to
check_mem_write.
gdb/testsuite/
* gdb.trace/trace-break.c: New.
* gdb.trace/trace-break.exp: New.
Diffstat (limited to 'gdb/testsuite/gdb.trace/trace-break.c')
-rw-r--r-- | gdb/testsuite/gdb.trace/trace-break.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.trace/trace-break.c b/gdb/testsuite/gdb.trace/trace-break.c new file mode 100644 index 00000000000..fd061424421 --- /dev/null +++ b/gdb/testsuite/gdb.trace/trace-break.c @@ -0,0 +1,58 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2011 Free Software Foundation, Inc. + + 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/>. */ + +#ifdef SYMBOL_PREFIX +#define SYMBOL(str) SYMBOL_PREFIX #str +#else +#define SYMBOL(str) #str +#endif + +/* Called from asm. */ +static void __attribute__((used)) +func (void) +{} + +static void +marker (void) +{ + /* Some code to make sure `b marker' and `b set_point' set + breakpoints at different addresses. */ + int a = 0; + int b = a; + + /* `set_point' is the label where we'll set multiple tracepoints and + breakpoints at. The insn at the label must the large enough to + fit a fast tracepoint jump. */ + asm (" .global " SYMBOL(set_point) "\n" + SYMBOL(set_point) ":\n" +#if (defined __x86_64__ || defined __i386__) + " call " SYMBOL(func) "\n" +#endif + ); +} + +static void +end (void) +{} + +int +main () +{ + marker (); + end (); + return 0; +} |