This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] default and help tests for gcore.
- From: Michael Snyder <msnyder at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 22 Mar 2002 15:52:00 -0800
- Subject: [PATCH] default and help tests for gcore.
Include the new gcore command in these tests.
2002-03-22 Michael Snyder <msnyder@redhat.com>
* gdb.base/default.exp: Add test for gcore.
* gdb.base/help.exp: Add test for gcore.
Index: gdb.base/default.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/default.exp,v
retrieving revision 1.6
diff -c -3 -p -r1.6 default.exp
*** default.exp 2002/02/04 18:02:25 1.6
--- default.exp 2002/03/23 00:01:22
*************** gdb_test "finish" "The program is not ru
*** 259,264 ****
--- 259,285 ----
# The message here comes from the regexp library, not gdb, and so can
# vary on different systems.
gdb_test "forward-search" "No previous regular expression.*|There is no previous regular expression.*" "forward-search"
+ #test gcore
+ send_gdb "gcore\n"
+ gdb_expect {
+ -re "You can\'t do that without a process to debug.*$gdb_prompt $" {
+ pass "gcore"
+ }
+ -re "Undefined command: .*$gdb_prompt $" {
+ pass "gcore"
+ }
+ default { fail "gcore" }
+ }
+ send_gdb "generate-core-file\n"
+ gdb_expect {
+ -re "You can\'t do that without a process to debug.*$gdb_prompt $" {
+ pass "generate-core-file"
+ }
+ -re "Undefined command: .*$gdb_prompt $" {
+ pass "generate-core-file"
+ }
+ default { fail "generate-core-file" }
+ }
#test help "h" abbreviation
gdb_test "h" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"
#test help
Index: gdb.base/help.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/help.exp,v
retrieving revision 1.5
diff -c -3 -p -r1.5 help.exp
*** help.exp 2001/06/05 05:03:44 1.5
--- help.exp 2002/03/23 00:01:22
*************** gdb_test "help files" "Specifying.*" "he
*** 149,154 ****
--- 149,175 ----
gdb_test "help finish" "Execute until selected stack frame returns..*\[\r\n\]+Upon return, the value returned is printed and put in the value history." "help finish"
# test help forward-search
gdb_test "help forward-search" "Search for regular expression .see regex.3.. from last line listed..*" "help forward-search"
+ # test help gcore
+ send_gdb "help gcore\n"
+ gdb_expect {
+ -re "Undefined command: \"gcore\". Try \"help\".*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ -re "Save a core file with the current state of the debugged process.\[\r\n\]+Argument is optional filename. Default filename is 'core.<process_id>'.*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ default { fail "help gcore" }
+ }
+ send_gdb "help generate-core-file\n"
+ gdb_expect {
+ -re "Undefined command: \"generate-core-file\". Try \"help\".*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ -re "Save a core file with the current state of the debugged process.\[\r\n\]+Argument is optional filename. Default filename is 'core.<process_id>'.*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ default { fail "help gcore" }
+ }
# test help help "h" abbreviation
gdb_test "help h" "Print list of commands." "help help \"h\" abbreviation"
# test help help