public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: scox@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Merge branch 'list' Date: Fri, 08 Feb 2008 23:53:00 -0000 [thread overview] Message-ID: <20080208235258.23508.qmail@sourceware.org> (raw) The branch, master has been updated via 3e3629d920c43935e776fd21513697205c728304 (commit) via e57c7a553b9437f4240928493f9f1516d0a4c3da (commit) from 56a8ca502dd2862e7411cf97e2248fb719db5dac (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 3e3629d920c43935e776fd21513697205c728304 Merge: 56a8ca502dd2862e7411cf97e2248fb719db5dac e57c7a553b9437f4240928493f9f1516d0a4c3da Author: Stan Cox <scox@redhat.com> Date: Fri Feb 8 18:52:01 2008 -0500 Merge branch 'list' commit e57c7a553b9437f4240928493f9f1516d0a4c3da Author: Stan Cox <scox@redhat.com> Date: Fri Feb 8 17:29:21 2008 -0500 Add a cross frame/file test to TestListCommand. * Makefile.am (frysk_pkglibdir_funit_quicksort_LINK): New. * TestListCommand.java (testListFrames): New. (testListPC): Change for new funit-quicksort. (testListFunction): Likewise. (testListReverse): Likewise. * funit-quicksort.c (main): Add bubblesort for cross frame/file testing. * funit-bubblesort.c: New. ----------------------------------------------------------------------- Summary of changes: frysk-core/ChangeLog | 4 + frysk-core/Makefile.am | 8 + frysk-core/frysk/bindir/ChangeLog | 4 + frysk-core/frysk/bindir/fhpd.java | 4 +- frysk-core/frysk/hpd/ChangeLog | 7 + frysk-core/frysk/hpd/TestListCommand.java | 201 ++++++++++++++------ frysk-core/frysk/pkglibdir/ChangeLog | 5 + .../{funit-quicksort.c => funit-bubblesort.c} | 137 ++++++-------- frysk-core/frysk/pkglibdir/funit-quicksort.c | 149 +++++++-------- 9 files changed, 291 insertions(+), 228 deletions(-) copy frysk-core/frysk/pkglibdir/{funit-quicksort.c => funit-bubblesort.c} (53%) First 500 lines of diff: diff --git a/frysk-core/ChangeLog b/frysk-core/ChangeLog index 976381b..4b2e9eb 100644 --- a/frysk-core/ChangeLog +++ b/frysk-core/ChangeLog @@ -1,3 +1,7 @@ +2008-02-08 Stan Cox <scox@redhat.com> + + * Makefile.am (frysk_pkglibdir_funit_quicksort_LINK): New. + 2008-02-06 Stan Cox <scox@redhat.com> * Makefile.am (frysk/pkglibdir/funit-addresses-stripped): Run diff --git a/frysk-core/Makefile.am b/frysk-core/Makefile.am index e5a3758..87088e8 100644 --- a/frysk-core/Makefile.am +++ b/frysk-core/Makefile.am @@ -225,6 +225,12 @@ frysk_pkglibdir_funit_symbols_stripped_SOURCES = frysk/pkglibdir/funit-symbols-stripped: frysk/pkglibdir/funit-symbols strip -o $@ frysk/pkglibdir/funit-symbols +# Create executable for list tests for TestListCommand.java + +frysk_pkglibdir_funit_quicksort_LINK = $(LINK) $(srcdir)/frysk/pkglibdir/funit-bubblesort.c -DNO_MAIN + +# Create sysroot for TestSysRoot.java + pkglib_PROGRAMS += frysk/pkglibdir/funit-addresses-stripped frysk_pkglibdir_funit_addresses_stripped_SOURCES = frysk/pkglibdir/funit-addresses-stripped: frysk/pkglibdir/funit-addresses @@ -265,6 +271,8 @@ frysk_pkglibdir_arch32_funit_symbols_stripped_SOURCES = frysk/pkglibdir/arch32/funit-symbols-stripped: frysk/pkglibdir/arch32/funit-symbols strip -o $@ frysk/pkglibdir/arch32/funit-symbols +frysk_pkglibdir_arch32_funit_quicksort_LINK += $(srcdir)/frysk/pkglibdir/funit-bubblesort.c -DNO_MAIN + pkglib32_PROGRAMS += frysk/pkglibdir/arch32/funit-addresses-stripped frysk_pkglibdir_arch32_funit_addresses_stripped_SOURCES = frysk/pkglibdir/arch32/funit-addresses-stripped: frysk/pkglibdir/arch32/funit-addresses diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog index 2fc1199..fa45822 100644 --- a/frysk-core/frysk/bindir/ChangeLog +++ b/frysk-core/frysk/bindir/ChangeLog @@ -1,3 +1,7 @@ +2008-02-08 Stan Cox <scox@redhat.com> + + * fhpd.java (main): Space after -sysroot. + 2008-02-08 Teresa Thomas <tthomas@redhat.com> * fauxv.java: Refactor to use ProcStopUtil. diff --git a/frysk-core/frysk/bindir/fhpd.java b/frysk-core/frysk/bindir/fhpd.java index 5a985b1..11d9d72 100644 --- a/frysk-core/frysk/bindir/fhpd.java +++ b/frysk-core/frysk/bindir/fhpd.java @@ -1,6 +1,6 @@ // This file is part of the program FRYSK. // -// Copyright 2006, 2007 Red Hat Inc. +// Copyright 2006, 2007, 2008 Red Hat Inc. // // FRYSK is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by @@ -142,7 +142,7 @@ public class fhpd { line +=" -noexe"; } if (sysroot != null) - line = line + " -sysroot" + sysroot; + line = line + " -sysroot " + sysroot; } catch (IOException ignore) {} diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index 6609e8a..a705249 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,3 +1,10 @@ +2008-02-08 Stan Cox <scox@redhat.com> + + * TestListCommand.java (testListFrames): New. + (testListPC): Change for new funit-quicksort. + (testListFunction): Likewise. + (testListReverse): Likewise. + 2008-02-08 Andrew Cagney <cagney@redhat.com> * ActionPointCommands.java: Use Task.getTid(). diff --git a/frysk-core/frysk/hpd/TestListCommand.java b/frysk-core/frysk/hpd/TestListCommand.java index 55371e2..e6ff437 100644 --- a/frysk-core/frysk/hpd/TestListCommand.java +++ b/frysk-core/frysk/hpd/TestListCommand.java @@ -62,18 +62,18 @@ public class TestListCommand extends TestLib { // Matching the list expected output is a trial and error process // as the matching tends to be greedy. e.send("list\n"); - e.expect("114.*114"); - e.expect("115.*115.*printf"); - e.expect("116.*116.*return 1"); - e.expect("117.*117"); - e.expect("118.*118.*return 0"); - e.expect("119.*119"); - e.expect("120.*120"); - e.expect("121.*121"); - e.expect("122.*122.*main"); - e.expect("123.*123"); - e.expect("-> 124.*124"); - e.expect("125.*125"); + e.expect("88.*88.*littlest"); + e.expect("89.*89"); + e.expect("90.*90"); + e.expect("91.*91"); + e.expect("92.*92.*int"); + e.expect("93.*93.*main"); + e.expect("94.*94.*{"); + e.expect("95.*95.*sortlist"); + e.expect("96.*96.*biggest"); + e.expect("97.*97"); + e.expect("-> 98.*98.*init_array"); + e.expect("99.*99.*quicksort"); e.send("quit\n"); e.expect("quit.*\nQuitting..."); e.close(); @@ -92,37 +92,37 @@ public class TestListCommand extends TestLib { e.send("list\n"); e.expect(prompt); e.send("list quicksort\n"); - e.expect("81.*81"); - e.expect("82.*82.*int"); - e.expect("83.*83"); - e.expect("84.*84"); - e.expect("85.*85.*j ="); - e.expect("86.*86.*x ="); - e.expect("87.*87.*do"); - e.expect("88.*88"); - e.expect("89.*89"); - e.expect("90.*90.*while"); - e.expect("91.*91.*if"); - e.expect("92.*92"); - e.expect("93.*93.*w ="); - e.expect("94.*94"); - e.expect("95.*95.*a.j."); - e.expect("96.*96.*i ="); - e.expect("97.*97.*j ="); - e.expect("98.*98"); - e.expect("99.*99.*while"); - e.expect("100.*100.*if"); - e.send("list 101 -length 10\n"); - e.expect("101.*101.*quicksort..a,l,j"); - e.expect("102.*102.*if"); - e.expect("103.*103.*quicksort..a,i,r"); - e.expect("104.*104"); - e.expect("105.*105"); - e.expect("106.*106"); - e.expect("107.*107"); - e.expect("108.*108.*int"); - e.expect("109.*109"); - e.expect("110.*110"); + e.expect("51.*51"); + e.expect("52.*52.*int"); + e.expect("53.*53"); + e.expect("54.*54.*i = l;"); + e.expect("55.*55.*j = r;"); + e.expect("56.*56.*x = a"); + e.expect("57.*57.*do"); + e.expect("58.*58"); + e.expect("59.*59.*while..a"); + e.expect("60.*60.*while..x"); + e.expect("61.*61.*if"); + e.expect("62.*62"); + e.expect("63.*63.*w = a"); + e.expect("64.*64"); + e.expect("65.*65.* = w;"); + e.expect("66.*66.*i = i"); + e.expect("67.*67.*j = j - 1;"); + e.expect("68.*68"); + e.expect("69.*69.*while"); + e.expect("70.*70.*if"); + e.send("list 71 -length 10\n"); + e.expect("71.*71.*quicksort"); + e.expect("72.*72.*if"); + e.expect("73.*73 .*quicksort"); + e.expect("74.*74"); + e.expect("75.*75"); + e.expect("76.*76.*void"); + e.expect("77.*77.*init_array"); + e.expect("78.*78.*{"); + e.expect("79.*79.*int i"); + e.expect("80.*80.*unsigned int seed;"); e.send("quit\n"); e.expect("quit.*\nQuitting..."); e.close(); @@ -138,28 +138,103 @@ public class TestListCommand extends TestLib { e.expect("go.*\n" + prompt + "Breakpoint"); e.send("list\n"); e.expect(prompt); - e.send("list 104 -length -10\n"); + e.send("list 78 -length -10\n"); + e.expect("78.*78"); + e.expect("79.*79"); + e.expect("80.*80.*unsigned int seed"); + e.expect("81.*81.*element_count"); + e.expect("82.*82"); + e.expect("83.*83.*temp = rand_r"); + e.expect("84.*84.*sortlist"); + e.expect("85.*85.*if"); + e.expect("86.*86.*biggest"); + e.expect("87.*87.*else if"); + e.send("list 68 -length -10\n"); + e.expect("68.*68"); + e.expect("69.*69.*while"); + e.expect("70.*70"); + e.expect("71.*71"); + e.expect("72.*72"); + e.expect("73.*73.*quicksort"); + e.expect("74.*74"); + e.expect("75.*75"); + e.expect("76.*76.*void"); + e.expect("77.*77.*init_array"); + e.send("quit\n"); + e.expect("quit.*\nQuitting..."); + e.close(); + } + + public void testListFrames() { + e = new HpdTestbed(); + e.sendCommandExpectPrompt("load " + Config.getPkgLibFile("funit-quicksort").getPath(), + "Loaded executable file.*"); + e.sendCommandExpectPrompt("start", "Attached to process.*"); + e.sendCommandExpectPrompt("break bubblesort", "breakpoint.*"); + e.send("go\n"); + e.expect("go.*\n" + prompt + "Breakpoint"); + e.send("list\n"); + e.expect("45.*45"); + e.expect("46.*46.*void"); + e.expect("47.*47.*bubblesort"); + e.expect("48.*48"); + e.expect("49.*49.*while"); + e.expect("50.*50"); + e.expect("51.*51.*int i"); + e.expect("52.*52.*int j"); + e.expect("53.*53.*while"); + e.expect("54.*54"); + e.expect("-> 55.*55.*if"); + e.expect("56.*56.*j = a"); + e.expect("57.*57.*a.*= a"); + e.expect("58.*58.*a.*= j"); + e.expect("59.*59"); + e.expect("60.*60.*i = i"); + e.expect("61.*61"); + e.expect("62.*62"); + e.expect("63.*63.*r = r"); + e.expect("64.*64"); + e.send("down\n"); + e.send("list\n"); + e.expect("96.*96.*int"); + e.expect("97.*97"); + e.expect("98.*98.*init_array"); + e.expect("99.*99.*quicksort"); + e.expect("100.*100.*if"); + e.expect("101.*101"); + e.expect("102.*102.*return"); + e.expect("103.*103"); e.expect("104.*104"); - e.expect("105.*105"); - e.expect("106.*106"); - e.expect("107.*107"); - e.expect("108.*108.*int"); - e.expect("109.*109.*quick "); + e.expect("105.*105.*init_array"); + e.expect("-> 106.*106.*bubblesort"); + e.expect("107.*107.*if"); + e.expect("108.*108"); + e.expect("109.*109.*return 1"); e.expect("110.*110"); - e.expect("111.*111.*init_array"); - e.expect("112.*112.*quicksort "); - e.expect("113.*113.*if"); - e.send("list 94 -length -10\n"); - e.expect("94.*94.*a.i. ="); - e.expect("95.*95.*a.j. ="); - e.expect("96.*96.*i ="); - e.expect("97.*97.*j ="); - e.expect("98.*98"); - e.expect("99.*99.*while"); - e.expect("100.*100.*if .l"); - e.expect("101.*101.*quicksort .a,l,j"); - e.expect("102.*102.*if .i"); - e.expect("103.*103.*quicksort .a,i,r"); + e.expect("111.*111.*return 0"); + e.expect("112.*112"); + e.send("up\n"); + e.send("list\n"); + e.expect("45.*45"); + e.expect("46.*46.*void"); + e.expect("47.*47.*bubblesort"); + e.expect("48.*48"); + e.expect("49.*49.*while"); + e.expect("50.*50"); + e.expect("51.*51.*int i"); + e.expect("52.*52.*int j"); + e.expect("53.*53.*while"); + e.expect("54.*54"); + e.expect("-> 55.*55.*if"); + e.expect("56.*56.*j = a"); + e.expect("57.*57.*a.*= a"); + e.expect("58.*58.*a.*= j"); + e.expect("59.*59"); + e.expect("60.*60.*i = i"); + e.expect("61.*61"); + e.expect("62.*62"); + e.expect("63.*63.*r = r"); + e.expect("64.*64"); e.send("quit\n"); e.expect("quit.*\nQuitting..."); e.close(); diff --git a/frysk-core/frysk/pkglibdir/ChangeLog b/frysk-core/frysk/pkglibdir/ChangeLog index be3ee37..ec56b56 100644 --- a/frysk-core/frysk/pkglibdir/ChangeLog +++ b/frysk-core/frysk/pkglibdir/ChangeLog @@ -1,3 +1,8 @@ +2008-02-08 Stan Cox <scox@redhat.com> + + * funit-quicksort.c (main): Add bubblesort for cross frame/file testing. + * funit-bubblesort.c: New. + 2007-08-27 Stan Cox <scox@redhat.com> * funit-type-class.cxx: Renamed from funit-class.cxx. diff --git a/frysk-core/frysk/pkglibdir/funit-quicksort.c b/frysk-core/frysk/pkglibdir/funit-bubblesort.c similarity index 53% copy from frysk-core/frysk/pkglibdir/funit-quicksort.c copy to frysk-core/frysk/pkglibdir/funit-bubblesort.c index 287ee9f..7e54592 100644 --- a/frysk-core/frysk/pkglibdir/funit-quicksort.c +++ b/frysk-core/frysk/pkglibdir/funit-bubblesort.c @@ -1,6 +1,6 @@ /* 1 */ // This file is part of the program FRYSK. /* 2 */ // -/* 3 */ // Copyright 2007 Red Hat Inc. +/* 3 */ // Copyright 2008 Red Hat Inc. /* 4 */ // /* 5 */ // FRYSK is free software; you can redistribute it and/or modify it /* 6 */ // under the terms of the GNU General Public License as published by @@ -38,88 +38,61 @@ /* 38 */ // exception. /* 39 */ # /* 40 */ include <sys/types.h> -# /* 41 */ include <stdio.h> +# /* 41 */ include <stdlib.h> # /* 42 */ define element_count 256 /* 43 */ -/* 44 */ int sortlist[element_count+1]; -/* 45 */ int seed; -/* 46 */ int biggest, littlest; -/* 47 */ int top; -/* 48 */ -/* 49 */ void -/* 50 */ init_rand () -/* 51 */ { -/* 52 */ seed = 74755; -/* 53 */ } +/* 44 */ /* bubblesort an array A. */ +/* 45 */ +/* 46 */ void +/* 47 */ bubblesort (int a[], int l, int r) +/* 48 */ { +/* 49 */ while (r > 1) { +/* 50 */ +/* 51 */ int i = 1; +/* 52 */ int j; +/* 53 */ while (i < r) { /* 54 */ -/* 55 */ int -/* 56 */ rand () -/* 57 */ { -/* 58 */ seed = (seed * 1309 + 13849) & 65535; -/* 59 */ return (seed); -/* 60 */ } -/* 61 */ -/* 62 */ void -/* 63 */ init_array () -/* 64 */ { -/* 65 */ int i, temp; -/* 66 */ init_rand (); -/* 67 */ biggest = 0; littlest = 0; -/* 68 */ for (i = 1; i <= element_count; i++) -/* 69 */ { -/* 70 */ temp = rand (); -/* 71 */ sortlist[i] = temp - (temp/100000)*100000 - 50000; -/* 72 */ if (sortlist[i] > biggest) biggest = sortlist[i]; -/* 73 */ else if (sortlist[i] < littlest) littlest = sortlist[i]; -/* 74 */ } -/* 75 */ } -/* 76 */ -/* 77 */ /* quicksort the array A from start to finish */ -/* 78 */ -/* 79 */ void -/* 80 */ quicksort (a,l,r) int a[], l, r; -/* 81 */ { -/* 82 */ int i,j,x,w; +/* 55 */ if (a[i] > a[i + 1]) { +/* 56 */ j = a[i]; +/* 57 */ a[i] = a[i + 1]; +/* 58 */ a[i + 1] = j; +/* 59 */ } +/* 60 */ i = i + 1; +/* 61 */ } +/* 62 */ +/* 63 */ r = r - 1; +/* 64 */ } +/* 65 */ } +/* 66 */ +# /* 67 */ ifndef NO_MAIN +/* 68 */ static void +/* 69 */ init_array (int *sortlist, int *littlest, int *biggest) +/* 70 */ { +/* 71 */ int i, temp; +/* 72 */ unsigned int seed; +/* 73 */ for (i = 1; i <= element_count; i++) +/* 74 */ { +/* 75 */ temp = rand_r (&seed); +/* 76 */ sortlist[i] = temp - (temp/100000) * 100000 - 50000; +/* 77 */ if (sortlist[i] > *biggest) +/* 78 */ *biggest = sortlist[i]; +/* 79 */ else if (sortlist[i] < *littlest) +/* 80 */ *littlest = sortlist[i]; +/* 81 */ } +/* 82 */ } /* 83 */ -/* 84 */ i = l; -/* 85 */ j = r; -/* 86 */ x = a[(l+r) / 2]; -/* 87 */ do -/* 88 */ { -/* 89 */ while (a[i] < x) i = i+1; -/* 90 */ while (x < a[j]) j = j-1; -/* 91 */ if (i <= j) -/* 92 */ { -/* 93 */ w = a[i]; -/* 94 */ a[i] = a[j]; -/* 95 */ a[j] = w; -/* 96 */ i = i+1; -/* 97 */ j = j-1; -/* 98 */ } -/* 99 */ } while (i <= j); -/* 100 */ if (l < j) -/* 101 */ quicksort (a,l,j); -/* 102 */ if (i < r) -/* 103 */ quicksort (a,i,r); -/* 104 */ } -/* 105 */ -/* 106 */ /* setup an array, quicksort the array, validate the quicksort */ -/* 107 */ -/* 108 */ int -/* 109 */ quick () -/* 110 */ { -/* 111 */ init_array (); -/* 112 */ quicksort (sortlist, 1, element_count); -/* 113 */ if ((sortlist[1] != littlest) || (sortlist[element_count] != biggest)) -/* 114 */ { -/* 115 */ printf (" Error in quicksort.\n"); -/* 116 */ return 1; -/* 117 */ } -/* 118 */ return 0; -/* 119 */ } -/* 120 */ -/* 121 */ int -/* 122 */ main() -/* 123 */ { -/* 124 */ return quick(); -/* 125 */ } +/* 84 */ int +/* 85 */ main() +/* 86 */ { +/* 87 */ int sortlist[element_count + 1]; +/* 88 */ int biggest = 0, littlest = 0; +/* 89 */ +/* 90 */ init_array (sortlist, &littlest, &biggest); +/* 91 */ bubblesort(sortlist, 1, element_count); +/* 92 */ if ((sortlist[1] != littlest) || (sortlist[element_count] != biggest)) +/* 93 */ { +/* 94 */ return 1; +/* 95 */ } +/* 96 */ return 0; +/* 97 */ } +# /* 98 */ endif diff --git a/frysk-core/frysk/pkglibdir/funit-quicksort.c b/frysk-core/frysk/pkglibdir/funit-quicksort.c index 287ee9f..0fd4569 100644 --- a/frysk-core/frysk/pkglibdir/funit-quicksort.c +++ b/frysk-core/frysk/pkglibdir/funit-quicksort.c @@ -1,6 +1,6 @@ /* 1 */ // This file is part of the program FRYSK. /* 2 */ // -/* 3 */ // Copyright 2007 Red Hat Inc. +/* 3 */ // Copyright 2007, 2008 Red Hat Inc. /* 4 */ // /* 5 */ // FRYSK is free software; you can redistribute it and/or modify it /* 6 */ // under the terms of the GNU General Public License as published by @@ -38,88 +38,75 @@ /* 38 */ // exception. /* 39 */ hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-02-08 23:53 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080208235258.23508.qmail@sourceware.org \ --to=scox@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).