public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Test a crashing hello-world under HPD. Date: Wed, 19 Mar 2008 04:09:00 -0000 [thread overview] Message-ID: <20080319040859.14500.qmail@sourceware.org> (raw) The branch, master has been updated via 35c076f3436b95a116cba33f52e0c9a592607dfa (commit) from 0189082059eba3c2acfb0b36bb838f01a12fc198 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 35c076f3436b95a116cba33f52e0c9a592607dfa Author: Andrew Cagney <cagney@redhat.com> Date: Wed Mar 19 00:07:56 2008 -0400 Test a crashing hello-world under HPD. frysk-core/frysk/hpd/ChangeLog 2008-03-18 Andrew Cagney <cagney@redhat.com> * CLI.java: Treat a terminating task as stopped. * TestHelloWorld.java: New. frysk-core/frysk/stepping/ChangeLog 2008-03-18 Andrew Cagney <cagney@redhat.com> * SteppingEngine.java: Block terminating tasks. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/hpd/CLI.java | 13 +++++++- frysk-core/frysk/hpd/ChangeLog | 5 +++ .../{TestShellCommand.java => TestHelloWorld.java} | 31 +++++++++++++------ frysk-core/frysk/stepping/ChangeLog | 4 ++ frysk-core/frysk/stepping/SteppingEngine.java | 2 +- 5 files changed, 42 insertions(+), 13 deletions(-) copy frysk-core/frysk/hpd/{TestShellCommand.java => TestHelloWorld.java} (72%) First 500 lines of diff: diff --git a/frysk-core/frysk/hpd/CLI.java b/frysk-core/frysk/hpd/CLI.java index 771898e..1f30bea 100644 --- a/frysk-core/frysk/hpd/CLI.java +++ b/frysk-core/frysk/hpd/CLI.java @@ -448,7 +448,7 @@ public class CLI { // Ensure Ctrl-C handler is set back to fhpd settings Manager.eventLoop.add(SigIntHandler.fhpd); - if (!tse.isAlive()) { + if (!tse.isAlive() && !tse.isTerminating()) { addMessage(tse.getMessage(), Message.TYPE_VERBOSE); tse.setMessage(""); flushMessages(); @@ -462,10 +462,19 @@ public class CLI { return; } - if (! tse.getState().isStopped()) { + if (! tse.isStopped()) { attached = -1; return; } + + + if (!tse.isAlive() && tse.isTerminating()) { + // Report the terminating reason. + addMessage(tse.getMessage(), Message.TYPE_VERBOSE); + tse.setMessage(""); + flushMessages(); + } + Task task = tse.getTask(); synchronized (CLI.this) { DebugInfoFrame frame diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index 94bf334..e9dd8d3 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,3 +1,8 @@ +2008-03-18 Andrew Cagney <cagney@redhat.com> + + * CLI.java: Treat a terminating task as stopped. + * TestHelloWorld.java: New. + 2008-03-18 Stan Cox <scox@redhat.com> * TestListCommand.java (testListPC): Set breakpoint via line number. diff --git a/frysk-core/frysk/hpd/TestShellCommand.java b/frysk-core/frysk/hpd/TestHelloWorld.java similarity index 72% copy from frysk-core/frysk/hpd/TestShellCommand.java copy to frysk-core/frysk/hpd/TestHelloWorld.java index 2bb44e0..6bf4001 100644 --- a/frysk-core/frysk/hpd/TestShellCommand.java +++ b/frysk-core/frysk/hpd/TestHelloWorld.java @@ -40,16 +40,27 @@ package frysk.hpd; /** - * This class tests the "shell" command. + * Test debugging a broken hello-world program. */ -public class TestShellCommand extends TestLib { - - public void testShellCommand() { - e = new HpdTestbed(); - e.sendCommandExpectPrompt("shell echo $$", ".*[0-9]+.*"); - e.sendCommandExpectPrompt("shell blahBLAHblah", ".*command not found.*"); - e.sendCommandExpectPrompt("shell -help", ".*shell <command string>.*"); - e.close(); +public class TestHelloWorld extends TestLib { + public void testHelloWorldTerminating() { + e = HpdTestbed.load("funit-hello"); + e.sendCommandExpectPrompt("run", "Running process [0-9]+\r\n"); + e.expect("is terminating from signal SIGSEGV\\([0-9]+\\)\r\n"); + // XXX: Wait a bit extra so the CLI has a chance to catch up + // with the terminated process. + try { Thread.sleep(100); } catch (Exception e) { } + // crashed processs in focus + e.sendCommandExpectPrompt("focus", + "\r\n\\[0\\.0\\].*funit-hello\r\n"); + // backtrace + e.sendCommandExpectPrompt("where 1", + "\r\n#0 .*/funit-hello.c#44\r\n\\.\\.\\.\r\n"); + // listing?? + + // broken variable + e.sendCommandExpectPrompt("print what", + "\\(char \\*\\) 0x0 \" < Memory Error > \"\r\n"); } -} \ No newline at end of file +} diff --git a/frysk-core/frysk/stepping/ChangeLog b/frysk-core/frysk/stepping/ChangeLog index 1daf4e8..4c18972 100644 --- a/frysk-core/frysk/stepping/ChangeLog +++ b/frysk-core/frysk/stepping/ChangeLog @@ -1,3 +1,7 @@ +2008-03-18 Andrew Cagney <cagney@redhat.com> + + * SteppingEngine.java: Block terminating tasks. + 2008-03-17 Andrew Cagney <cagney@redhat.com> * TestFirstInstruction.java: Update; using diff --git a/frysk-core/frysk/stepping/SteppingEngine.java b/frysk-core/frysk/stepping/SteppingEngine.java index 46513f3..2b5d91d 100644 --- a/frysk-core/frysk/stepping/SteppingEngine.java +++ b/frysk-core/frysk/stepping/SteppingEngine.java @@ -1188,7 +1188,7 @@ public class SteppingEngine { steppingObserver.notifyNotBlocked(tse); - return Action.CONTINUE; + return Action.BLOCK; } public Action updateTerminated(Task task, Signal signal, int value) { hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-03-19 4:09 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=20080319040859.14500.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).