Forgot to mention the file /gdb/cli/cli-script.c From: mohanasundaram.subscr...@outlook.com To: bug-gdb@gnu.org Subject: RE: Problem with user defined commands Date: Wed, 30 Jan 2013 17:35:40 +0530
We figured that the problematic code was this /* Check for while, if, break, continue, etc and build a new command line structure for them. */ if ((p_end - p >= 14 && !strncmp (p, "while-stepping", 14)) || (p_end - p >= 8 && !strncmp (p, "stepping", 8)) || (p_end - p >= 2 && !strncmp (p, "ws", 2))) From: mohanasundaram.subscr...@outlook.com To: bug-gdb@gnu.org Subject: RE: Problem with user defined commands Date: Wed, 30 Jan 2013 16:30:21 +0530 Another info...this works in gdb 6.5 but not working in 7.2 and 7.5.1 which I tried... From: mohanasundaram.subscr...@outlook.com To: bug-gdb@gnu.org Subject: RE: Problem with user defined commands Date: Wed, 30 Jan 2013 16:22:02 +0530 A small correction in the test.gdb file which I pasted earlier. This is the correct one... bash-3.2$ cat test.gdb define wsfoo printf "wsfoo\n" end define foo wsfoo end define bar printf "bar\n" end From: mohanasundaram.subscr...@outlook.com To: bug-gdb@gnu.org Subject: Problem with user defined commands Date: Wed, 30 Jan 2013 16:18:25 +0530 Hi All, User defined commands gets messed up if a definition has a name starting with "ws" and called from another definition. Is it a known defect? Any workarounds? bash-3.2$ cat test.gdb define wsbaz printf "wsbaz\n" end define foo wsbaz end define bar printf "bar\n" end bash-3.2$ ./gdb GNU gdb (GDB) 7.5.1 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. (gdb) source ./test.gdb (gdb) foo warning: Invalid control type in canned commands structure. warning: Error executing canned sequence of commands. (gdb) bar Undefined command: "bar". Try "help". (gdb) show user foo User command "foo": wsfoo end define bar printf "bar\n" (gdb) show user bar Undefined command: "bar". Try "help". (gdb) show user wsfoo User command "wsfoo": printf "wsfoo\n" (gdb) wsfoo wsfoo (gdb) Cheers, Mohan. _______________________________________________ bug-gdb mailing list bug-gdb@gnu.org https://lists.gnu.org/mailman/listinfo/bug-gdb _______________________________________________ bug-gdb mailing list bug-gdb@gnu.org https://lists.gnu.org/mailman/listinfo/bug-gdb _______________________________________________ bug-gdb mailing list bug-gdb@gnu.org https://lists.gnu.org/mailman/listinfo/bug-gdb _______________________________________________ bug-gdb mailing list bug-gdb@gnu.org https://lists.gnu.org/mailman/listinfo/bug-gdb
_______________________________________________ bug-gdb mailing list bug-gdb@gnu.org https://lists.gnu.org/mailman/listinfo/bug-gdb