public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Pass both CORE&EXE to fstack; avoid path length problems. Date: Mon, 12 Nov 2007 23:58:00 -0000 [thread overview] Message-ID: <20071112235838.10152.qmail@sourceware.org> (raw) The branch, master has been updated via 0631ebed24c1df74fb903d8429916768602aca43 (commit) from c105e3372fba89b087d26ed5f4e98546851714bb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 0631ebed24c1df74fb903d8429916768602aca43 Author: Andrew Cagney <cagney@redhat.com> Date: Mon Nov 12 18:56:31 2007 -0500 Pass both CORE&EXE to fstack; avoid path length problems. frysk-core/frysk/bindir/ChangeLog 2007-11-12 Andrew Cagney <cagney@redhat.com> * TestFstack.java (fstack(String,String[])): New; use throughout. (tearDown()): Delete. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/bindir/ChangeLog | 3 + frysk-core/frysk/bindir/TestFstack.java | 128 +++++++++++++----------------- 2 files changed, 59 insertions(+), 72 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/bindir/ChangeLog b/frysk-core/frysk/bindir/ChangeLog index e165a0a..036a5a8 100644 --- a/frysk-core/frysk/bindir/ChangeLog +++ b/frysk-core/frysk/bindir/ChangeLog @@ -1,5 +1,8 @@ 2007-11-12 Andrew Cagney <cagney@redhat.com> + * TestFstack.java (fstack(String,String[])): New; use throughout. + (tearDown()): Delete. + * TestFstack.java: Update; funit-inlined renamed to funit-stack-inlined. diff --git a/frysk-core/frysk/bindir/TestFstack.java b/frysk-core/frysk/bindir/TestFstack.java index 0d73771..33f7a78 100644 --- a/frysk-core/frysk/bindir/TestFstack.java +++ b/frysk-core/frysk/bindir/TestFstack.java @@ -44,6 +44,7 @@ import java.io.File; import frysk.Config; import frysk.expunit.Expect; import frysk.testbed.CoreFileAtSignal; +import frysk.testbed.TearDownExpect; import frysk.testbed.TestLib; /** @@ -54,104 +55,87 @@ import frysk.testbed.TestLib; public class TestFstack extends TestLib { - Expect e; - - public void tearDown () - { - if (e != null) - e.close (); - e = null; - super.tearDown(); + /** + * Start FSTACK with both a core file and an executable; avoids + * problems with Linux's bone-head COREFILE format storing only + * the first 50 characters of the executable. + */ + private Expect fstack(String program, String[] args) { + File coreExe = Config.getPkgLibFile(program); + File coreFile = CoreFileAtSignal.constructCore(coreExe); + String[] argv = new String[args.length + 3]; + int argc = 0; + argv[argc++] = Config.getBinFile("fstack").getAbsolutePath(); + argv[argc++] = coreFile.getAbsolutePath(); + argv[argc++] = coreExe.getAbsolutePath(); + for (int i = 0; i < args.length; i++) { + argv[argc + i] = args[i]; + } + Expect e = new Expect(argv); + TearDownExpect.add(e); + return e; } public void testBackTrace () { - - File coreFile = CoreFileAtSignal.constructCore("funit-stacks"); - e = new Expect (new String[] { - Config.getBinFile("fstack").getAbsolutePath (), - coreFile.getAbsolutePath() - }); + Expect e = fstack("funit-stack-outlined", new String[0]); // Just look for main. e.expect ("main"); } public void testBackTraceWithParams () { - File coreFile = CoreFileAtSignal.constructCore("funit-stacks"); - e = new Expect (new String[] { - Config.getBinFile("fstack").getAbsolutePath (), - coreFile.getAbsolutePath(), - "--print","params" - }); - e.expect ("int param1"); + Expect e = fstack("funit-stack-outlined", + new String[] { "-print", "params" }); + e.expect("\\#0 .* third\\(int arg3 = 3\\)"); + e.expect("\\#1 .* second\\(int arg2 = 2\\)"); + e.expect("\\#2 .* first\\(int arg1 = 1\\)"); + e.expect("\\#3 .* main\\(\\)"); } public void testBackTraceWithScopes () { - File coreFile = CoreFileAtSignal.constructCore("funit-stacks"); - e = new Expect (new String[] { - Config.getBinFile("fstack").getAbsolutePath (), - coreFile.getAbsolutePath(), - "--print", "scopes" - }); - e.expect ("int one.*int two"); + Expect e = fstack("funit-stack-outlined", + new String[] { "--print", "scopes" }); + e.expect("\\#0 .* third\\(\\)"); + e.expect("int var3"); + e.expect("\\#1 .* second\\(\\)"); + e.expect("int var2"); + e.expect("\\#2 .* first\\(\\)"); + e.expect("int var1"); + e.expect("\\#3 .* main\\(\\)"); + e.expect("int some_int"); } public void testBackTraceWithFullpath () { - File coreFile = CoreFileAtSignal.constructCore("funit-stacks"); - e = new Expect (new String[] { - Config.getBinFile("fstack").getAbsolutePath (), - coreFile.getAbsolutePath(), - "--print", "fullpath" - }); + Expect e = fstack("funit-stack-outlined", + new String[] { "--print", "fullpath" }); e.expect (Config.getRootSrcDir() + ".*" - + "funit-stacks" + + "funit-stack-outlined" + ".c#"); } public void testBackTraceWithDashA () { - File coreFile = CoreFileAtSignal.constructCore("funit-stacks"); - e = new Expect (new String[] { - Config.getBinFile("fstack").getAbsolutePath (), - coreFile.getAbsolutePath(), - "-a" - }); - e.expect ("fourth.*int param1.*int param2.*int param3.*" - + Config.getRootSrcDir() - + ".*" - + "funit-stacks" + "\\.c#" - + ".*char var1.*" - + ""); + Expect e = fstack("funit-stack-outlined", new String[] { "-a" }); + e.expect("\\#0 .* in third\\(int arg3 = 3\\)" + + ".*" + Config.getRootSrcDir() + + ".*" + "funit-stack-outlined" + "\\.c#" + + ".*int var3.*"); + e.expect("\\#1"); } public void testBackTraceWithDashC () { - File coreFile = CoreFileAtSignal.constructCore("funit-stacks"); - e = new Expect (new String[] { - Config.getBinFile("fstack").getAbsolutePath (), - coreFile.getAbsolutePath(), - "-c" - }); - - e.expect ("fourth.*int param1.*int param2.*int param3.*" - + Config.getRootSrcDir() - + ".*" - + "funit-stacks" + "\\.c#" - + ""); + Expect e = fstack("funit-stack-outlined", new String[] { "-c" }); + e.expect("\\#0 .* in third\\(int arg3 = 3\\)" + + ".*" + Config.getRootSrcDir() + + ".*" + "funit-stack-outlined" + "\\.c#"); + e.expect("\\#1"); } public void testBackTraceWithDashV () { - - File coreFile = CoreFileAtSignal.constructCore("funit-stack-inlined"); - e = new Expect (new String[] { - Config.getBinFile("fstack").getAbsolutePath (), - coreFile.getAbsolutePath(), - Config.getPkgLibFile("funit-stack-inlined").getAbsolutePath(), - "-v", - "-a" - }); - e.expect("#0 .*third[^\r\n]*\\[inline\\]" - + ".*#1 .*second[^\r\n]*\\[inline\\]" - + ".*#2 .*first[^\r\n]*\\[inline\\]" - + ".*#3 .*main"); + Expect e = fstack("funit-stack-inlined", new String[] { "-v", "-a" }); + e.expect("\\#0 .*third[^\\r\\n]*\\[inline\\]"); + e.expect("\\#1 .*second[^\\r\\n]*\\[inline\\]"); + e.expect("\\#2 .*first[^\\r\\n]*\\[inline\\]"); + e.expect("\\#3 .*main"); } } hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2007-11-12 23:58 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=20071112235838.10152.qmail@sourceware.org \ --to=cagney@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).