⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 templates.exp

📁 这个是LINUX下的GDB调度工具的源码
💻 EXP
📖 第 1 页 / 共 2 页
字号:
send_gdb "ptype Foo\n"   gdb_expect {       -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Foo<volatile char \\*>\r\n\[ \t\]*(class |)Foo<char>\r\n\[ \t\]*(class |)Foo<int>\r\n$gdb_prompt $" { pass "ptype Foo" }    -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Foo" }    -re "type = class Foo<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int foo\\(int, int\\);\r\n\\}\r\n$gdb_prompt $"    { # GCC 3.1, DWARF-2 output.	kfail "gdb/57" "ptype Foo" }    -re "No symbol \"Foo\" in current context.\r\n$gdb_prompt $"    { # GCC 2.95.3, stabs+ output.	pass "ptype Foo" }    -re "$gdb_prompt $"                     { fail "ptype Foo" }    timeout                             { fail "(timeout) ptype Foo" }}#    -re "type = class Foo<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int foo(int, int);\r\n\\}\r\n$gdb_prompt $"# ptype Foo<int>send_gdb "ptype fint\n"   gdb_expect {      -re "type = (class |)Foo<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int foo\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fint" }   -re "type = (class |)Foo<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int foo\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype fint" }   -re "$gdb_prompt $"                     { fail "ptype fint" }   timeout                             { fail "(timeout) ptype fint" }}# ptype Foo<char>send_gdb "ptype fchar\n"   gdb_expect {      -re "type = (class |)Foo<char> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*.*char foo\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fchar" }   -re "type = (class |)Foo<char> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char foo\\(int, char\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype fchar" }   -re "$gdb_prompt $"                     { fail "ptype fchar" }   timeout                             { fail "(timeout) ptype fchar" }}# ptype Foo<volatile char *>send_gdb "ptype fvpchar\n"   gdb_expect {      -re "type = (class |)Foo<volatile char ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" }   -re "type = (class |)Foo<volatile char ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" }   -re "type = (class |)Foo<char volatile ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" {       kfail "gdb/1512" "ptype fvpchar"   }   -re "$gdb_prompt $"                     { fail "ptype fvpchar" }   timeout                             { fail "(timeout) ptype fvpchar" }}# print a function from Foo<volatile char *># This test is sensitive to whitespace matching, so we'll do it twice,# varying the spacing, because of PR gdb/33.send_gdb "print Foo<volatile char *>::foo\n"   gdb_expect {       -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" }    -re "No symbol \"Foo<volatile char \\*>\" in current context.\r\n$gdb_prompt $"    {	# This used to be a kfail gdb/33.  That problem has been	# fixed, but now gdb/931 and gdb/1512 are rearing their ugly	# heads.	kfail "gdb/931" "print Foo<volatile char *>::foo"    }    -re "$gdb_prompt $"                     { fail "print Foo<volatile char *>::foo" }    timeout                             { fail "(timeout) print Foo<volatile char *>::foo" }}send_gdb "print Foo<volatile char*>::foo\n"   gdb_expect {       -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char*>::foo" }    -re "No symbol \"Foo<volatile char\\*>\" in current context.\r\n$gdb_prompt $"    {	# This used to be a kfail gdb/33.  That problem has been	# fixed, but now gdb/931 and gdb/1512 are rearing their ugly	# heads.	kfail "gdb/931" "print Foo<volatile char*>::foo"    }    -re "$gdb_prompt $"                     { fail "print Foo<volatile char*>::foo" }    timeout                             { fail "(timeout) print Foo<volatile char*>::foo" }}# Template Bar<T, int># same as Foo for g++send_gdb "ptype Bar\n"   gdb_expect {       -re "type = template <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)1>\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)33>\r\n$gdb_prompt $" { pass "ptype Bar" }    -re "type = <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Bar" }    -re "ptype Bar\r\ntype = class Bar<int, ?33> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);\r\n}\r\n$gdb_prompt $"    { # GCC 3.1, DWARF-2 output.	kfail "gdb/57" "ptype Bar" }    -re "No symbol \"Bar\" in current context.\r\n$gdb_prompt $"    { # GCC 2.95.3, stabs+ output.	pass "ptype Bar" }    -re "$gdb_prompt $"                     { fail "ptype Bar" }    timeout                             { fail "(timeout) ptype Bar" }}# ptype Bar<int,33>send_gdb "ptype bint\n"   gdb_expect {      -re "type = (class |)Bar<int, ?(\\(int\\)|)33> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint" }   -re "type = (class |)Bar<int,(\\(int\\)|)33> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint" }   -re "$gdb_prompt $"                     { fail "ptype bint" }   timeout                             { fail "(timeout) ptype bint" }}# ptype Bar<int, (4>3)>send_gdb "ptype bint2\n"   gdb_expect {      -re "type = (class |)Bar<int, ?(\\(int\\)|)1> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint2" }   -re "type = (class |)Bar<int,(\\(int\\)|)1> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint2" }   -re "$gdb_prompt $"                     { fail "ptype bint2" }   timeout                             { fail "(timeout) ptype bint2" }}# Template Baz<T, char># Same as Foo, for g++send_gdb "ptype Baz\n"   gdb_expect {       -re "type = template <(class |)T, ?(class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Baz<char,(\\(char\\)|)97>\r\n\[ \t\]*(class |)Baz<int,(\\(char\\)|)115>\r\n$gdb_prompt $" { pass "ptype Baz" }    -re "type = <(class |)T, ?(class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Baz" }    -re "type = class Baz<int, ?'s'> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\);\r\n}\r\n$gdb_prompt $"    { # GCC 3.1, DWARF-2 output.	kfail "gdb/57" "ptype Baz" }    -re "type = class Baz<int, ?(\\(char\\))?115> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\);\r\n}\r\n$gdb_prompt $"    { # GCC 3.x, DWARF-2 output, running into gdb/57 and gdb/1512.	kfail "gdb/57" "ptype Baz" }    -re "No symbol \"Baz\" in current context.\r\n$gdb_prompt $"    { # GCC 2.95.3, stabs+ output.	pass "ptype Baz" }    -re "$gdb_prompt $"                     { fail "ptype Baz" }    timeout                             { fail "(timeout) ptype Baz" }}# ptype Baz<int, 's'>send_gdb "ptype bazint\n"   gdb_expect {      -re "type = (class |)Baz<int, ?(\\(char\\)|)(115|\\'s\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int baz\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint" }   -re "type = (class |)Baz<int,(\\(char\\)|)(115|\\'s\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\).*;\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint" }   -re "$gdb_prompt $"                     { fail "ptype bazint" }   timeout                             { fail "(timeout) ptype bazint" }}# ptype Baz<char, 'a'>send_gdb "ptype bazint2\n"   gdb_expect {      -re "type = (class |)Baz<char, ?(\\(char\\)|)(97|\\'a\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*.*char baz\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint2" }   -re "type = (class |)Baz<char,(\\(char\\)|)(97|\\'a\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char baz\\(int, char\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint2" }   -re "$gdb_prompt $"                     { fail "ptype bazint2" }   timeout                             { fail "(timeout) ptype bazint2" }}# Template Qux<T, int (*f)(int) ># Same as Foo for g++send_gdb "ptype Qux\n"   gdb_expect {       -re "type = template <(class |)T, ?(class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Qux<int,&string>\r\n\[ \t\]*(class |)Qux<char,&string>\r\n$gdb_prompt $" { pass "ptype Qux" }    -re ".*type = template <(class |)T.*, ?(class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}.*$gdb_prompt $" { pass "ptype Qux" }    -re "type = class Qux<char, ?&string> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n}\r\n$gdb_prompt $"    { # GCC 3.1, DWARF-2 output.	kfail "gdb/57" "ptype Qux" }    -re "type = class Qux<char, ?&\\(string\\)> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n}\r\n$gdb_prompt $"    { # GCC 3.x, DWARF-2 output; gdb/57 + gdb/1512.	kfail "gdb/57" "ptype Qux" }    -re "No symbol \"Qux\" in current context.\r\n$gdb_prompt $"    { # GCC 2.95.3, stabs+ output.	pass "ptype Qux" }    -re "$gdb_prompt $"                     { fail "ptype Qux" }    timeout                             { fail "(timeout) ptype Qux" }}# pt Qux<int,&string>send_gdb "ptype quxint\n"   gdb_expect {      -re "type = class Qux<int, ?& ?string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }   -re "type = class Qux<int, ?& ?string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }   -re "type = class Qux<int, ?\\(char ?\\*\\)\\(& ?string\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }   -re "type = class Qux<int, ?& ?\\(string\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {       kfail "gdb/1512" "ptype quxint"   }   -re "$gdb_prompt $"                     { fail "ptype quxint" }   timeout                             { fail "(timeout) ptype quxint" }}# pt Qux<char,0># commented out this as quxint2 declaration was commented out in# templates.exp -- ovidiu# send_gdb "ptype quxint2\n"   # gdb_expect {   #    -re "type = class Qux<char,&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint2" }#    -re "$gdb_prompt $"                     { fail "ptype quxint2" }#    timeout                             { fail "(timeout) ptype quxint2" }# }# Template Spec<T1, T2># Same as Foo for g++send_gdb "ptype Spec\n"   gdb_expect {       -re "type = template <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Spec<int,int \\*>\r\n\[ \t\]*(class |)Spec<int,char>\r\n$gdb_prompt $" { pass "ptype Spec" }    -re "type = <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Spec" }    -re "type = class Spec<int, ?char> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(char\\);\r\n}\r\n$gdb_prompt $"    { # GCC 3.1, DWARF-2 output.	kfail "gdb/57" "ptype Spec" }    -re "No symbol \"Spec\" in current context.\r\n$gdb_prompt $"    { # GCC 2.95.3, stabs+ output.	pass "ptype Spec" }    -re "$gdb_prompt $"                     { fail "ptype Spec" }    timeout                             { fail "(timeout) ptype Spec" }}# pt Spec<char,0>send_gdb "ptype siip\n"   gdb_expect {      -re "type = class Spec<int, ?int ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*.*int spec\\(int ?\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype siip" }   -re "type = class Spec<int,int ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(int ?\\*\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype siip" }   -re "$gdb_prompt $"                     { fail "ptype siip" }   timeout                             { fail "(timeout) ptype siip" }}# pt Garply<int>send_gdb "ptype Garply<int>\n"   gdb_expect {      -re "type = class Garply<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int garply\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<int>" }   -re "type = class Garply<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int garply\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<int>" }   -re "$gdb_prompt $"                     { fail "ptype Garply<int>" }   timeout                             { fail "(timeout) ptype Garply<int>" }}# ptype of nested template namesend_gdb "ptype Garply<Garply<char> >\n"   gdb_expect {      -re "type = (class |)Garply<Garply<char> > \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*(class |)Garply<char> t;\r\n\r\n\[ \t\]*.*(class |)Garply<char> garply\\(int, (class |)Garply<char>\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<Garply<char> >" }   -re "type = (class |)Garply<Garply<char> > \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*(class |)Garply<char> t;\r\n\r\n\[ \t\]*(class |)Garply<char> garply\\(int, (class |)Garply<char>\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<Garply<char> >" }   -re "$gdb_prompt $"                     { fail "ptype Garply<Garply<char> >" }   timeout                             { fail "(timeout) ptype Garply<Garply<char> >" }}# print out a function from a nested template namesend_gdb "print Garply<Garply<char> >::garply\n"gdb_expect {   -re "\\$\[0-9\]* = \\{(class |)Garply<char> \\((class |)Garply<Garply<char> > \\*(| const), int, (class |)Garply<char>\\)\\} $hex <Garply<Garply<char>\[ \t\]*>::garply\\(int, (class |)Garply<char>\\)>\r\n$gdb_prompt $" { pass "print Garply<Garply<char> >::garply" }   -re ".*$gdb_prompt $" { fail "print Garply<Garply<char> >::garply" }   timeout { fail "print Garply<Garply<char> >::garply (timeout)" }}# djb - 06-03-2000# Now should work finesend_gdb "break Garply<Garply<char> >::garply\n"gdb_expect {   -re "Breakpoint \[0-9\]* at $hex: file .*templates.cc, line.*\r\n$gdb_prompt $" { pass "break Garply<Garply<char> >::garply" }   -re ".*$gdb_prompt $" { fail "break Garply<Garply<char> >::garply" }   timeout { fail "break Garply<Garply<char> >::garply (timeout)" }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -