From: Yao Qi <yao@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA 7/8] New port: TI C6x: test case fixes
Date: Mon, 25 Jul 2011 11:37:00 -0000 [thread overview]
Message-ID: <4E2D1AC1.9070102@codesourcery.com> (raw)
In-Reply-To: <4E263904.8030204@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 384 bytes --]
On 07/20/2011 10:10 AM, Yao Qi wrote:
> Two changes in this patch are related to c6x, while the other two are
> not related to c6x very much, which are about uclinx on NON-MMU machine.
>
Another change is included in this patch related to c6x. It is in
gdb.xml/tdesc-regs.exp, since C6x port starts to understand xml target
description sent from gdbserver.
--
Yao (é½å°§)
[-- Attachment #2: 0008-test-case.patch --]
[-- Type: text/x-patch, Size: 4838 bytes --]
gdb/testsuite/
* gdb.base/maint.exp: set data_section to ".neardata".
* gdb.base/savedregs.c (thrower): Trigger SIGILL on NO-MMU machine.
* gdb.base/savedregs.exp: Handle SIGILL.
(process_saved_regs): Don't check saved register on tic6x-*-*
* gdb.mi/mi-syn-frame.c (bar): Trigger SIGILL on NO-MMU machine.
* gdb.xml/tdesc-regs.exp: Set core-regs for tic6x-*-*.
---
gdb/testsuite/gdb.base/maint.exp | 4 ++++
gdb/testsuite/gdb.base/savedregs.c | 22 ++++++++++++++++++++++
gdb/testsuite/gdb.base/savedregs.exp | 9 +++++++++
gdb/testsuite/gdb.mi/mi-syn-frame.c | 21 ++++++++++++++++++++-
gdb/testsuite/gdb.xml/tdesc-regs.exp | 3 +++
5 files changed, 58 insertions(+), 1 deletions(-)
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 61ad439..9ef84af 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -394,6 +394,10 @@ gdb_test_multiple "maint info sections" "maint info sections" {
set data_section ER_RW
pass "maint info sections"
}
+ -re "Exec file:\r\n.*break($EXEEXT)?., file type.*neardata.*$gdb_prompt $" {
+ # c6x doesn't have .data section. It has .neardata and .fardata section.
+ set data_section ".neardata"
+ }
-re "Exec file:\r\n.*break($EXEEXT)?., file type.*$gdb_prompt $" {
pass "maint info sections"
}
diff --git a/gdb/testsuite/gdb.base/savedregs.c b/gdb/testsuite/gdb.base/savedregs.c
index 9f302a0..582afc4 100644
--- a/gdb/testsuite/gdb.base/savedregs.c
+++ b/gdb/testsuite/gdb.base/savedregs.c
@@ -22,6 +22,12 @@
#include <signal.h>
#include <sys/time.h>
+#ifdef __UCLIBC__
+#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
+#define HAS_NOMMU
+#endif
+#endif
+
static volatile int done;
extern int
@@ -45,11 +51,27 @@ catcher (int sig)
static void
thrower (void)
{
+#if defined(HAS_NOMMU)
+#if defined(__arm__)
+ asm(".word 0xf8f00000");
+#elif defined(__TMS320C6X__)
+ /* 0x56454314 is also an invalid insn but it causes SIGTRAP in kernel. */
+ asm(".word 0x56454313");
+#else
+#error Please write an invalid instruction here for your target
+#endif
+#else /* defined(HAS_NOMMU) */
*(char *)0 = 0;
+#endif /* defined(HAS_NOMMU) */
}
main ()
{
+#if defined(HAS_NOMMU)
+ signal (SIGILL, catcher);
+#else
signal (SIGSEGV, catcher);
+#endif
+
thrower ();
}
diff --git a/gdb/testsuite/gdb.base/savedregs.exp b/gdb/testsuite/gdb.base/savedregs.exp
index eeee0ff..4408137 100644
--- a/gdb/testsuite/gdb.base/savedregs.exp
+++ b/gdb/testsuite/gdb.base/savedregs.exp
@@ -84,6 +84,14 @@ proc process_saved_regs { current inner outer } {
# Sigtramp frames don't yet print <signal trampoline>.
set pat "Stack frame at .* Saved registers:.*"
}
+ thrower {
+ if { [istarget tic6x-*-*] } {
+ # On tic6x, there is no register saved in function thrower.
+ set pat "Stack frame at .* in $func .*"
+ } else {
+ set pat "Stack frame at .* in $func .* Saved registers:.*"
+ }
+ }
default {
set pat "Stack frame at .* in $func .* Saved registers:.*"
}
@@ -143,6 +151,7 @@ process_saved_regs thrower { main } { }
# Continue to the signal catcher, check main's saved-reg info, capture
# catcher's saved-reg info.
gdb_test "handle SIGSEGV pass print nostop"
+gdb_test "handle SIGILL pass print nostop"
gdb_test "advance catcher" "catcher .* at .*"
process_saved_regs catcher { sigtramp thrower } { main }
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.c b/gdb/testsuite/gdb.mi/mi-syn-frame.c
index ddfc08e..cffc5e0 100644
--- a/gdb/testsuite/gdb.mi/mi-syn-frame.c
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.c
@@ -2,6 +2,12 @@
#include <unistd.h>
#include <stdlib.h>
+#ifdef __UCLIBC__
+#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
+#define HAS_NOMMU
+#endif
+#endif
+
void foo (void);
void bar (void);
@@ -25,9 +31,22 @@ foo (void)
void
bar (void)
{
- char *nuller = 0;
+#if defined(HAS_NOMMU)
+
+#if defined(__arm__)
+ asm(".word 0xf8f00000");
+#elif defined(__TMS320C6X__)
+ /* 0x56454314 is also an invalid insn but it causes SIGTRAP in kernel. */
+ asm(".word 0x56454313");
+#else
+#error Please write an invalid instruction here for your target
+#endif
+#else /* defined(HAS_NOMMU) */
+ char *nuller = 0;
*nuller = 'a'; /* try to cause a segfault */
+#endif
+
}
void
diff --git a/gdb/testsuite/gdb.xml/tdesc-regs.exp b/gdb/testsuite/gdb.xml/tdesc-regs.exp
index 224c082..6a12dba 100644
--- a/gdb/testsuite/gdb.xml/tdesc-regs.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-regs.exp
@@ -53,6 +53,9 @@ switch -glob -- [istarget] {
unsupported "register tests"
return 0
}
+ "tic6x-*-*" {
+ set core-regs {tic6x-core.xml}
+ }
"i?86-*-*" {
set architecture "i386"
set regdir "i386/"
--
1.7.0.4
next prev parent reply other threads:[~2011-07-25 7:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-20 2:12 Yao Qi
2011-07-25 11:37 ` Yao Qi [this message]
2011-08-09 14:22 ` Pedro Alves
2011-08-09 15:03 ` Yao Qi
2011-08-09 15:17 ` Mark Kettenis
2011-08-09 15:25 ` Yao Qi
2011-08-10 12:28 ` Mark Kettenis
2011-08-10 14:05 ` Yao Qi
2011-08-14 16:24 ` Yao Qi
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=4E2D1AC1.9070102@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/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