Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Randolph Chung <randolph@tausq.org>
To: gdb-patches@sources.redhat.com
Subject: [RFA] Update gdb.arch/pa-nullify test for hpux
Date: Thu, 01 Dec 2005 05:49:00 -0000	[thread overview]
Message-ID: <438E8F02.8070201@tausq.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]

Another assembly based test that needs updating for HPUX. Tested against
hppa64-hp-hpux11.11

ok?
randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/

[-- Attachment #2: hpux-null.diff --]
[-- Type: text/plain, Size: 4760 bytes --]

2005-12-01  Randolph Chung  <tausq@debian.org>

        * gdb.arch/pa-nullify.exp: Handle hppa64-*-* targets.
        (get_addr_of_sym): Remove duplicate print.
        (gen_core): xfail hppa*-*-hpux*, update expected output.
        * gdb.arch/pa-nullify.s: Reformat to also work on HPUX.
        * gdb.arch/pa64-nullify.s: New file.

Index: pa-nullify.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/pa-nullify.exp,v
retrieving revision 1.1
diff -u -p -r1.1 pa-nullify.exp
--- pa-nullify.exp      3 Dec 2004 23:59:53 -0000       1.1
+++ pa-nullify.exp      1 Dec 2005 05:37:44 -0000
@@ -25,12 +25,19 @@ set bug_id 0
 
 # Test handling of nullified instructions for the pa target.
 
-if ![istarget "hppa*-*-*"] then {
-    verbose "Skipping hppa nullification tests."
-    return
+switch -glob -- [istarget] {
+    "hppa-*-*" {
+       set testfile "pa-nullify"
+    }
+    "hppa64-*-*" {
+       set testfile "pa64-nullify"
+    }
+    "*" {
+        verbose "Skipping hppa nullification tests."
+        return
+    }
 }
 
-set testfile "pa-nullify"
 set srcfile ${testfile}.s
 set binfile ${objdir}/${subdir}/${testfile}
 set gcorefile ${objdir}/${subdir}/${testfile}.gcore
@@ -78,7 +85,6 @@ proc get_addr_of_sym { sym } {
   global hex
 
   set test "get address of $sym"
-  send_gdb "print $sym\n"
   gdb_test_multiple "print $sym" $test {
     -re ".*($hex) <$sym>.*$gdb_prompt $" {
       set addr $expect_out(1,string)
@@ -93,7 +99,7 @@ if { ! [ runto_main ] } then { gdb_suppr
 
 set foo [get_addr_of_sym "foo"]
 set bar [get_addr_of_sym "bar"]
-set foo_last [expr $bar - 4]
+set foo_last "(bar - 4)"
 
 gdb_breakpoint "*$foo_last"
 
@@ -112,13 +118,19 @@ proc gen_core { test } {
   set gcore_works 0
   set escapedfilename [string_to_regexp $gcorefile]
 
+  # gcore is not yet implemented for HPUX
+  setup_xfail hppa*-*-hpux*
+
   gdb_test_multiple "gcore $gcorefile" "$test: gcore" {
     -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
       pass "$test: gcore"
       set gcore_works 1
     }
+    -re "Undefined command.*$gdb_prompt $" {
+      fail "$test: gcore (undefined command)"
+    }
     -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
-      fail "$test: gcore"
+      fail "$test: gcore (can't create corefile)"
     }
   }
 
Index: pa-nullify.s
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/pa-nullify.s,v
retrieving revision 1.1
diff -u -p -r1.1 pa-nullify.s
--- pa-nullify.s        3 Dec 2004 23:59:53 -0000       1.1
+++ pa-nullify.s        1 Dec 2005 05:37:44 -0000
@@ -1,7 +1,6 @@
-       .LEVEL 1.1
        .text
-       .align 4
-.globl foo
+       .align 8
+       .globl foo
        .type   foo, @function
 foo:
        .PROC
@@ -19,7 +18,7 @@ foo:
        .EXIT
        .PROCEND
 
-.globl bar
+       .globl bar
        .type   bar, @function
 bar:
        .PROC
@@ -34,7 +33,7 @@ bar:
        .EXIT
        .PROCEND
 
-.globl main
+       .globl main
        .type   main, @function
 main:
        .PROC
--- /dev/null   Thu Dec  1 00:38:08 2005
+++ pa64-nullify.s      Thu Dec  1 00:32:58 2005
@@ -0,0 +1,70 @@
+       .LEVEL 2.0w
+       .text
+       .align 8
+       .globl  foo
+       .type   foo, @function
+foo:
+       .PROC
+       .CALLINFO FRAME=64,NO_CALLS,SAVE_SP,ENTRY_GR=3
+       .ENTRY
+       copy %r3,%r1
+       copy %r30,%r3
+       std,ma %r1,64(%r30)
+       std %r3,-8(%r30)
+       ldo -64(%r29),%r28
+       stw %r26,0(%r28)
+       ldw 0(%r28),%r28
+       extrd,s %r28,63,32,%r28
+       ldo 64(%r3),%r30
+       ldd,mb -64(%r30),%r3
+       nop
+       bve,n (%r2)
+       .EXIT
+       .PROCEND
+
+       .align 8
+       .globl  bar
+       .type   bar, @function
+bar:
+       .PROC
+       .CALLINFO FRAME=64,NO_CALLS,SAVE_SP,ENTRY_GR=3
+       .ENTRY
+       copy %r3,%r1
+       copy %r30,%r3
+       std,ma %r1,64(%r30)
+       std %r3,-8(%r30)
+       ldo 64(%r3),%r30
+       ldd,mb -64(%r30),%r3
+       bve,n (%r2)
+       .EXIT
+       .PROCEND
+
+       .align 8
+       .globl  main
+       .type   main, @function
+main:
+       .PROC
+       .CALLINFO FRAME=128,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4
+       .ENTRY
+       std %r2,-16(%r30)
+       copy %r3,%r1
+       copy %r30,%r3
+       std,ma %r1,128(%r30)
+       std %r3,-8(%r30)
+       std %r4,8(%r3)
+       ldo -64(%r29),%r28
+       stw %r26,0(%r28)
+       std %r25,8(%r28)
+       ldw 0(%r28),%r26
+       ldo -48(%r30),%r29
+       copy %r27,%r4
+       b,l foo,%r2
+       nop
+       copy %r4,%r27
+       ldd -16(%r3),%r2
+       ldd 8(%r3),%r4
+       ldo 64(%r3),%r30
+       ldd,mb -64(%r30),%r3
+       bve,n (%r2)
+       .EXIT
+       .PROCEND

             reply	other threads:[~2005-12-01  5:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-01  5:49 Randolph Chung [this message]
2005-12-01 14:34 ` Daniel Jacobowitz

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=438E8F02.8070201@tausq.org \
    --to=randolph@tausq.org \
    --cc=gdb-patches@sources.redhat.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