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 'master' of ssh://sources.redhat.com/git/frysk
Date: Wed, 14 Nov 2007 02:38:00 -0000	[thread overview]
Message-ID: <20071114023831.6109.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  7b8e7ff2a2900c7837e1fee0de204f049fa01e58 (commit)
       via  208d3e75e13ae1fbf8f8c24b222e34a2ef5054fb (commit)
      from  9198be3c3245c0e8a8ab7cd054e99306d1a51250 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 7b8e7ff2a2900c7837e1fee0de204f049fa01e58
Merge: 208d3e75e13ae1fbf8f8c24b222e34a2ef5054fb 9198be3c3245c0e8a8ab7cd054e99306d1a51250
Author: Stan Cox <scox@redhat.com>
Date:   Tue Nov 13 21:36:31 2007 -0500

    Merge branch 'master' of ssh://sources.redhat.com/git/frysk

commit 208d3e75e13ae1fbf8f8c24b222e34a2ef5054fb
Author: Stan Cox <scox@redhat.com>
Date:   Tue Nov 13 21:04:02 2007 -0500

    Add tests for hpd list request.
    
    * ListCommand.java (interpret): Check that symbol is a subprogram.
    Fix reversing.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/hpd/ChangeLog            |    5 +
 frysk-core/frysk/hpd/ListCommand.java     |   22 ++++--
 frysk-core/frysk/hpd/TestListCommand.java |  129 +++++++++++++++++++++++++++++
 3 files changed, 149 insertions(+), 7 deletions(-)
 create mode 100644 frysk-core/frysk/hpd/TestListCommand.java

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index 6115ec8..3905c2e 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-13  Stan Cox  <scox@redhat.com>
+
+	* ListCommand.java (interpret): Check that symbol is a subprogram.
+	Fix reversing.  
+
 2007-11-13  Andrew Cagney  <cagney@redhat.com>
 
 	* Input.java (getAction): Delete.
diff --git a/frysk-core/frysk/hpd/ListCommand.java b/frysk-core/frysk/hpd/ListCommand.java
index c4f3cc4..81dbd74 100644
--- a/frysk-core/frysk/hpd/ListCommand.java
+++ b/frysk-core/frysk/hpd/ListCommand.java
@@ -46,6 +46,7 @@ import java.io.IOException;
 import java.io.LineNumberReader;
 import java.util.Iterator;
 import lib.dwfl.DwarfDie;
+import lib.dwfl.DwTag; 
 import frysk.debuginfo.DebugInfoFrame;
 import frysk.debuginfo.DebugInfo;
 import frysk.proc.Task;
@@ -80,6 +81,7 @@ class ListCommand extends ParameterizedCommand {
     private File file = null;
     private int line;
     private int exec_line = 0;
+
     void interpret(CLI cli, Input cmd, Object o) {
 	Options options = (Options)o;
         PTSet ptset = cli.getCommandPTSet(cmd);
@@ -113,18 +115,24 @@ class ListCommand extends ParameterizedCommand {
 			    funcDie = debugInfo
 				.getSymbolDie(cmd.parameter(0));
                         }
-                        line = (int)funcDie.getDeclLine();
+			if (funcDie.getTag().hashCode() == DwTag.SUBPROGRAM_) {
+			    line = (int)funcDie.getDeclLine();
+			    file = new File(funcDie.getDeclFile());
+			}
+			else {
+			    cli.addMessage("function " + cmd.parameter(0) + " not found.",
+					   Message.TYPE_ERROR);
+			    return;
+			}
                     }
                 }
             }
 	    else if (options.length != null) {
 		windowSize = options.length.magnitude;
-		if (options.length.sign < 0)
-		    line -= windowSize;
-		else if (options.length.sign > 0)
+		if (options.length.sign < 0) {
+		    windowSize *= -1;
 		    line += windowSize;
-		else
-		    line -= windowSize / 2;
+		}
 	    }
             else if (frame.getLines()[0].getLine() != exec_line) {
                 // list around pc.
@@ -192,7 +200,7 @@ class ListCommand extends ParameterizedCommand {
                 cli.addMessage("file " + file + " not found.",
                                Message.TYPE_ERROR);
             }
-        }
+	}
 
     }
 
diff --git a/frysk-core/frysk/hpd/TestListCommand.java b/frysk-core/frysk/hpd/TestListCommand.java
new file mode 100644
index 0000000..48c6144
--- /dev/null
+++ b/frysk-core/frysk/hpd/TestListCommand.java
@@ -0,0 +1,129 @@
+// This file is part of the program FRYSK.
+//
+// Copyright 2007 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
+// the Free Software Foundation; version 2 of the License.
+//
+// FRYSK is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with FRYSK; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+// 
+// In addition, as a special exception, Red Hat, Inc. gives You the
+// additional right to link the code of FRYSK with code not covered
+// under the GNU General Public License ("Non-GPL Code") and to
+// distribute linked combinations including the two, subject to the
+// limitations in this paragraph. Non-GPL Code permitted under this
+// exception must only link to the code of FRYSK through those well
+// defined interfaces identified in the file named EXCEPTION found in
+// the source code files (the "Approved Interfaces"). The files of
+// Non-GPL Code may instantiate templates or use macros or inline
+// functions from the Approved Interfaces without causing the
+// resulting work to be covered by the GNU General Public
+// License. Only Red Hat, Inc. may make changes or additions to the
+// list of Approved Interfaces. You must obey the GNU General Public
+// License in all respects for all of the FRYSK code and other code
+// used in conjunction with FRYSK except the Non-GPL Code covered by
+// this exception. If you modify this file, you may extend this
+// exception to your version of the file, but you are not obligated to
+// do so. If you do not wish to provide this exception without
+// modification, you must delete this exception statement from your
+// version and license this file solely under the GPL without
+// exception.
+
+package frysk.hpd;
+
+
+/**
+ * Test the functionality of the alias and unalias commands.
+ */
+
+public class TestListCommand extends TestLib {
+    public void setUp() {
+	super.setUp();
+	e = new HpdTestbed();
+    }
+
+    public void testListPC() {
+	e = HpdTestbed.run("hpd-c");
+        e.send("break main\n");
+        e.expect("breakpoint.*" + prompt);
+        e.send("go\n");
+        e.expect("go.*\n" + prompt + "Breakpoint");
+	e.send("list\n");
+	e.expect(".*208.*int.*209.*int.*210.*int_21.*211.*int_21.*215.*int.*" +
+		 "216.*main.*\\*.*218.*if.*219.*fprintf" +
+		 ".*221.*int.*222.*int.*.*223.*return.*224.*");
+        e.send("quit\n");
+        e.expect("quit.*\nQuitting...");
+        e.close();
+    }
+
+    public void testListFunction() {
+	e = HpdTestbed.run("hpd-c");
+        e.send("break main\n");
+        e.expect("breakpoint.*" + prompt);
+        e.send("go\n");
+        e.expect("go.*\n" + prompt + "Breakpoint");
+	e.send("list\n");
+	e.expect(prompt);
+	e.send("list func_2\n");
+	e.expect(
+		 ".*158.*159.*typedef.*160.*static_class_t.*161.*enum.*" +
+		 "162.*static_class_t.*163.*struct.*164.*asm.*165.*struct.*" +
+		 "166.*asm.*167.*struct.*168.*struct.*169.*typedef.*" +
+		 "170.*volatile.*171.*long.*172.*int.*173.*float.*174.*char.*" +
+		 "175.*static_class_t.*176.*volatile.*177.*sportscar.*" +
+		 prompt);
+	e.send("list -length 10\n");
+	e.expect(
+		".*178.*char.*179.*short.*180.*int.*181.*long.*182.*float.*" +
+		"183.*double.*184.*assign_long_arr.*185.*assign_int_arr.*");
+        e.send("quit\n");
+        e.expect("quit.*\nQuitting...");
+        e.close();
+    }
+
+    public void testListReverse() {
+	e = HpdTestbed.run("hpd-c");
+        e.send("break main\n");
+        e.expect("breakpoint.*" + prompt);
+        e.send("go\n");
+        e.expect("go.*\n" + prompt + "Breakpoint");
+	e.send("list\n");
+	e.expect(prompt);
+	e.send("list -length -10\n");
+	e.expect(".*198.*while.*202.*return.*205.*static.*206.*func_1.*207");
+	e.send("list -length -10\n");
+	e.expect(".*188.*sportscar.*190.*int_p.*191.*class_p.*192.*class_p.*" +
+		 "193.*class_p.*194.*class_1.*196.*int_21.*197.*");
+        e.send("quit\n");
+        e.expect("quit.*\nQuitting...");
+        e.close();
+    }
+
+    public void testListErrors() {
+	e = HpdTestbed.run("hpd-c");
+        e.send("break main\n");
+        e.expect("breakpoint.*" + prompt);
+        e.send("go\n");
+        e.expect("go.*\n" + prompt + "Breakpoint");
+	e.send("list x\n");
+	e.expect(".*function x not found.*" + prompt);
+	e.send("list xyz\n");
+	e.expect(".*symbol xyz not found.*" + prompt);
+        e.send("quit\n");
+        e.expect("quit.*\nQuitting...");
+        e.close();
+    }
+}
+
+
+
+		


hooks/post-receive
--
frysk system monitor/debugger


             reply	other threads:[~2007-11-14  2:38 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-14  2:38 scox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-06-05 15:33 rmoseley
2008-05-12 16:30 rmoseley
2008-05-12 16:07 pmuldoon
2008-05-09 17:29 rmoseley
2008-04-02 22:41 pmuldoon
2008-04-01 12:28 pmuldoon
2008-03-20 20:20 rmoseley
2008-03-18 16:22 pmuldoon
2008-02-26 15:32 pmuldoon
2008-01-24 19:23 rmoseley
2008-01-23 21:10 rmoseley
2008-01-03 16:55 pmuldoon
2007-12-13 20:18 rmoseley
2007-12-04 17:45 jflavio
2007-11-30  4:24 jflavio
2007-11-28 21:40 jflavio
2007-11-28 16:20 jflavio
2007-11-28 13:08 pmuldoon
2007-11-28 12:04 mark
2007-11-20 22:47 scox
2007-11-19 17:58 scox
2007-11-17  8:35 rmoseley
2007-11-16 15:59 scox
2007-11-16 14:59 pmuldoon
2007-11-14  2:09 jflavio
2007-11-13  0:41 scox
2007-11-10 14:47 jflavio
2007-11-10  0:34 scox
2007-11-09 14:59 jflavio

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=20071114023831.6109.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: 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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).