aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.arch/mips16-thunks-sinmain.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2012-04-26 16:56:18 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2012-04-26 16:56:18 +0000
commit14132e8924cd988218b4b2c4c6aaea45af951c59 (patch)
tree83541aa536610e46dc843e15c5109206772542bf /gdb/testsuite/gdb.arch/mips16-thunks-sinmain.c
parent518f0db5cfd751f298921b07349fbdf7142969ac (diff)
downloadfsf-binutils-gdb-14132e8924cd988218b4b2c4c6aaea45af951c59.zip
fsf-binutils-gdb-14132e8924cd988218b4b2c4c6aaea45af951c59.tar.gz
fsf-binutils-gdb-14132e8924cd988218b4b2c4c6aaea45af951c59.tar.bz2
gdb/
* infrun.c (handle_inferior_event): Move the check for return trampolines ahead of the check for function trampolines. * mips-tdep.h (MIPS_S2_REGNUM, MIPS_GP_REGNUM): New macros. * mips-tdep.c (mips_str_mips16_call_stub): New variable. (mips_str_mips16_ret_stub): Likewise. (mips_str_call_fp_stub): Likewise. (mips_str_call_stub): Likewise. (mips_str_fn_stub): Likewise. (mips_str_pic): Likewise. (mips_in_frame_stub): New function. (mips_unwind_pc): Return the return address rather than the PC if the PC of an intermediate frame is inside a call thunk. (mips_is_stub_suffix): New function. (mips_is_stub_mode): Likewise. (mips_get_mips16_fn_stub_pc): Likewise. (mips_skip_mips16_trampoline_code): Update to handle all the currently generated stub types. Don't recurse into __fn_stub thunks. Remove heuristics to handle stubs beyond etext/_etext. Use cooked register accesses. (mips_in_return_stub): Reintroduce function. (mips_skip_trampoline_code): Traverse trampolines recursively. (mips_gdbarch_init): Handle MIPS16 return trampolines. gdb/testsuite/ * gdb.arch/mips16-thunks-inmain.c: New file. * gdb.arch/mips16-thunks-main.c: New file. * gdb.arch/mips16-thunks-sin.c: New file. * gdb.arch/mips16-thunks-sinfrob.c: New file. * gdb.arch/mips16-thunks-sinfrob16.c: New file. * gdb.arch/mips16-thunks-sinmain.c: New file. * gdb.arch/mips16-thunks-sinmips16.c: New file. * gdb.arch/mips16-thunks.exp: New file.
Diffstat (limited to 'gdb/testsuite/gdb.arch/mips16-thunks-sinmain.c')
-rw-r--r--gdb/testsuite/gdb.arch/mips16-thunks-sinmain.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.arch/mips16-thunks-sinmain.c b/gdb/testsuite/gdb.arch/mips16-thunks-sinmain.c
new file mode 100644
index 0000000..2cbc471
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/mips16-thunks-sinmain.c
@@ -0,0 +1,51 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 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/>. */
+
+double sinfrob (double d);
+double sinfrob16 (double d);
+
+double sinblah (double d);
+double sinblah16 (double d);
+
+double sinhelper (double);
+long lsinhelper (double);
+
+double (*sinfunc) (double) = sinfrob;
+double (*sinfunc16) (double) = sinfrob16;
+
+double f = 1.0;
+long i = 1;
+
+int
+main (void)
+{
+ double d = f;
+ long l = i;
+
+ d = sinfrob16 (d);
+ d = sinfrob (d);
+ d = sinhelper (d);
+
+ sinfunc = sinblah;
+ sinfunc16 = sinblah16;
+
+ d = sinblah (d);
+ d = sinblah16 (d);
+ l = lsinhelper (d);
+
+ return l + i;
+}