🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1124

Problem with user defined commands

#1124
From: Mohanasundaram Chandran
Date: Wed, 30 Jan 2013 10:48
91 lines
5561 bytes
--_ae5330da-3122-4da6-973c-478ddfa4a9bf_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi All=2C User defined commands gets messed up if a definition has a name s=
tarting 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"
enddefine foo
        wsbaz
enddefine bar
        printf "bar\n"
end bash-3.2$ ./gdb
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 Free Software Foundation=2C Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.htm=
l>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY=2C 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=2C 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=2CMohan.  		 	   		  =

--_ae5330da-3122-4da6-973c-478ddfa4a9bf_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 12pt=3B
font-family:Calibri
}
--></style></head>
<body class=3D'hmmessage'><div dir=3D'ltr'>Hi All=2C<BR>&nbsp=3B<BR>User de=
fined 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?=
<BR>&nbsp=3B<BR>bash-3.2$ cat test.gdb<br>define wsbaz<br>&nbsp=3B&nbsp=3B&=
nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B printf "wsbaz\n"<br>end<BR>define f=
oo<br>&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B wsbaz<br>end=
<BR>define bar<br>&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B =
printf "bar\n"<br>end<BR>&nbsp=3B<BR>bash-3.2$ ./gdb<br>GNU gdb (GDB) 7.5.1=
<br>Copyright (C) 2012 Free Software Foundation=2C Inc.<br>License GPLv3+: =
GNU GPL version 3 or later &lt=3B<a href=3D"http://gnu.org/licenses/gpl.htm=
l">http://gnu.org/licenses/gpl.html</a>&gt=3B<br>This is free software: you=
 are free to change and redistribute it.<br>There is NO WARRANTY=2C to the =
extent permitted by law.&nbsp=3B Type "show copying"<br>and "show warranty"=
 for details.<br>This GDB was configured as "x86_64-unknown-linux-gnu".<br>=
For bug reporting instructions=2C please see:<br>&lt=3B<a href=3D"http://ww=
w.gnu.org/software/gdb/bugs/">http://www.gnu.org/software/gdb/bugs/</a>&gt=
=3B.<br>(gdb) source ./test.gdb<br>(gdb) foo<br>warning: Invalid control ty=
pe in canned commands structure.<br>warning: Error executing canned sequenc=
e of commands.<br>(gdb) bar<br>Undefined command: "bar".&nbsp=3B Try "help"=
.<br>(gdb) show user foo<br>User command "foo":<br>&nbsp=3B wsfoo<br>&nbsp=
=3B end<br>&nbsp=3B define bar<br>&nbsp=3B printf "bar\n"<BR>(gdb) show use=
r bar<br>Undefined command: "bar".&nbsp=3B Try "help".<br>(gdb) show user w=
sfoo<br>User command "wsfoo":<br>&nbsp=3B printf "wsfoo\n"<BR>(gdb) wsfoo<b=
r>wsfoo<br>(gdb)<BR><br>Cheers=2C<BR>Mohan.<BR>&nbsp=3B<BR> 		 	   		  </di=
v></body>
</html>=

--_ae5330da-3122-4da6-973c-478ddfa4a9bf_--
Technical Details
Message-ID: <mailman.18597.1359542914.855.bug-gdb@gnu.org>
Path: arc1-ca.pugleaf.net!6ni25568pbd.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!usenet.stanford.edu!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f5053,de73d7bed5d0e049,start
X-Google-NewGroupId: yes
X-Google-Attributes: gidf0ead4270c,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
X-Received: by 10.66.82.103 with SMTP id h7mr558607pay.11.1359542915436;
        Wed, 30 Jan 2013 02:48:35 -0800 (PST)
Path: arc1-ca.pugleaf.net!6ni25568pbd.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!usenet.stanford.edu!not-for-mail
From: Mohanasundaram Chandran <mohanasundaram.subscribe@outlook.com>
Newsgroups: gnu.gdb.bug
Subject: Problem with user defined commands
Date: Wed, 30 Jan 2013 16:18:25 +0530
Lines: 92
Approved: bug-gdb@gnu.org
Message-ID: <mailman.18597.1359542914.855.bug-gdb@gnu.org>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
X-Trace: usenet.stanford.edu 1359542914 21473 208.118.235.17 (30 Jan 2013 10:48:34 GMT)
X-Complaints-To: action@cs.stanford.edu
To: "bug-gdb@gnu.org" <bug-gdb@gnu.org>
Envelope-to: bug-gdb@gnu.org
X-EIP: [PC6nMZoyBGCRCq5fXCwFOX5oAn35AiNT]
X-Originating-Email: [mohanasundaram.subscribe@outlook.com]
Importance: Normal
X-OriginalArrivalTime: 30 Jan 2013 10:48:25.0743 (UTC)
 FILETIME=[54C801F0:01CDFED7]
X-detected-operating-system: by eggs.gnu.org: Windows XP
X-Received-From: 65.55.90.204
X-BeenThere: bug-gdb@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for GDB, the GNU debugger" <bug-gdb.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-gdb>
List-Post: <mailto:bug-gdb@gnu.org>
List-Help: <mailto:bug-gdb-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=subscribe>
Bytes: 5264
Content-Type: multipart/alternative;
 boundary="_ae5330da-3122-4da6-973c-478ddfa4a9bf_"