🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1127

RE: Problem with user defined commands

#1127
From: Mohanasundaram Chandran
Date: Wed, 30 Jan 2013 12:05
233 lines
10855 bytes
--_e05600d3-5f72-42f6-8136-63d3b305bd7a_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

We figured that the problematic code was this
      /* Check for while=2C if=2C break=2C continue=2C etc and build a new
         command line structure for them.  */
      if ((p_end - p >=3D 14 && !strncmp (p=2C "while-stepping"=2C 14))
          || (p_end - p >=3D 8 && !strncmp (p=2C "stepping"=2C 8))
          || (p_end - p >=3D 2 && !strncmp (p=2C "ws"=2C 2)))
 From: mohanasundaram.subscribe@outlook.com
To: bug-gdb@gnu.org
Subject: RE: Problem with user defined commands
Date: Wed=2C 30 Jan 2013 16:30:21 +0530

=0A=
=0A=
=0A=
Another info...this works in gdb 6.5 but not working in 7.2 and 7.5.1 which=
 I tried...
=20
From: mohanasundaram.subscribe@outlook.com
To: bug-gdb@gnu.org
Subject: RE: Problem with user defined commands
Date: Wed=2C 30 Jan 2013 16:22:02 +0530

=0A=
=0A=
=0A=
A small correction in the test.gdb file which I pasted earlier. This is the=
 correct one...
=20
bash-3.2$ cat test.gdb
define wsfoo
        printf "wsfoo\n"
end
define foo
        wsfoo
end
define bar
        printf "bar\n"
end
=20
From: mohanasundaram.subscribe@outlook.com
To: bug-gdb@gnu.org
Subject: Problem with user defined commands
Date: Wed=2C 30 Jan 2013 16:18:25 +0530

=0A=
=0A=
=0A=
Hi All=2C
=20
User defined commands gets messed up if a definition has a name starting wi=
th "ws" and called from another definition. Is it a known defect? Any worka=
rounds?
=20
bash-3.2$ cat test.gdb
define wsbaz
        printf "wsbaz\n"
end
define foo
        wsbaz
end
define bar
        printf "bar\n"
end
=20
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=2C
Mohan.
=20
 		 	   		  =0A=

_______________________________________________=0A=
bug-gdb mailing list=0A=
bug-gdb@gnu.org=0A=
https://lists.gnu.org/mailman/listinfo/bug-gdb 		 	   		  =0A=

_______________________________________________=0A=
bug-gdb mailing list=0A=
bug-gdb@gnu.org=0A=
https://lists.gnu.org/mailman/listinfo/bug-gdb 		 	   		  =0A=

_______________________________________________=0A=
bug-gdb mailing list=0A=
bug-gdb@gnu.org=0A=
https://lists.gnu.org/mailman/listinfo/bug-gdb 		 	   		  =

--_e05600d3-5f72-42f6-8136-63d3b305bd7a_
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'>We figured that the problematic =
code was this<BR><br>&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B /* Check for =
while=2C if=2C break=2C continue=2C etc and build a new<br>&nbsp=3B&nbsp=3B=
&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B command line structure for=
 them.&nbsp=3B */<br>&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B if ((p_end - =
p &gt=3B=3D 14 &amp=3B&amp=3B !strncmp (p=2C "while-stepping"=2C 14))<br>&n=
bsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B || (=
p_end - p &gt=3B=3D 8 &amp=3B&amp=3B !strncmp (p=2C "stepping"=2C 8))<br>&n=
bsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B || (=
p_end - p &gt=3B=3D 2 &amp=3B&amp=3B !strncmp (p=2C "ws"=2C 2)))<BR><br>&nb=
sp=3B<BR><div><div id=3D"SkyDrivePlaceholder"></div><hr id=3D"stopSpelling"=
>From: mohanasundaram.subscribe@outlook.com<br>To: bug-gdb@gnu.org<br>Subje=
ct: RE: Problem with user defined commands<br>Date: Wed=2C 30 Jan 2013 16:3=
0:21 +0530<br><br>=0A=
=0A=
<style><!--=0A=
.ExternalClass .ecxhmmessage P=0A=
{padding:0px=3B}=0A=
.ExternalClass body.ecxhmmessage=0A=
{font-size:12pt=3Bfont-family:Calibri=3B}=0A=
=0A=
--></style>=0A=
<div dir=3D"ltr">Another info...this works in gdb 6.5 but not working in 7.=
2 and 7.5.1 which I tried...<br>&nbsp=3B<br><div><div id=3D"ecxSkyDrivePlac=
eholder"></div><hr id=3D"ecxstopSpelling">From: mohanasundaram.subscribe@ou=
tlook.com<br>To: bug-gdb@gnu.org<br>Subject: RE: Problem with user defined =
commands<br>Date: Wed=2C 30 Jan 2013 16:22:02 +0530<br><br>=0A=
=0A=
<style><!--=0A=
.ExternalClass .ecxhmmessage P=0A=
{padding:0px=3B}=0A=
.ExternalClass body.ecxhmmessage=0A=
{font-size:12pt=3Bfont-family:Calibri=3B}=0A=
=0A=
--></style>=0A=
<div dir=3D"ltr">A small correction in the test.gdb file which I pasted ear=
lier.&nbsp=3BThis is the correct one...<br>&nbsp=3B<br>bash-3.2$ cat test.g=
db<br>define wsfoo<br>&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=
=3B printf "wsfoo\n"<br>end<br>define foo<br>&nbsp=3B&nbsp=3B&nbsp=3B&nbsp=
=3B&nbsp=3B&nbsp=3B&nbsp=3B wsfoo<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<b=
r><div><div id=3D"ecxSkyDrivePlaceholder"></div><hr id=3D"ecxstopSpelling">=
From: mohanasundaram.subscribe@outlook.com<br>To: bug-gdb@gnu.org<br>Subjec=
t: Problem with user defined commands<br>Date: Wed=2C 30 Jan 2013 16:18:25 =
+0530<br><br>=0A=
=0A=
<style><!--=0A=
.ExternalClass .ecxhmmessage P=0A=
{padding:0px=3B}=0A=
.ExternalClass body.ecxhmmessage=0A=
{font-size:12pt=3Bfont-family:Calibri=3B}=0A=
=0A=
--></style>=0A=
<div dir=3D"ltr">Hi All=2C<br>&nbsp=3B<br>User defined commands gets messed=
 up if a definition has a name starting with "ws" and called from another d=
efinition. 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&nb=
sp=3B&nbsp=3B printf "wsbaz\n"<br>end<br>define foo<br>&nbsp=3B&nbsp=3B&nbs=
p=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 Fre=
e Software Foundation=2C Inc.<br>License GPLv3+: GNU GPL version 3 or later=
 &lt=3B<a href=3D"http://gnu.org/licenses/gpl.html" target=3D"_blank">http:=
//gnu.org/licenses/gpl.html</a>&gt=3B<br>This is free software: you are fre=
e to change and redistribute it.<br>There is NO WARRANTY=2C to the extent p=
ermitted by law.&nbsp=3B Type "show copying"<br>and "show warranty" for det=
ails.<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://www.gnu.or=
g/software/gdb/bugs/" target=3D"_blank">http://www.gnu.org/software/gdb/bug=
s/</a>&gt=3B.<br>(gdb) source ./test.gdb<br>(gdb) foo<br>warning: Invalid c=
ontrol type in canned commands structure.<br>warning: Error executing canne=
d sequence of commands.<br>(gdb) bar<br>Undefined command: "bar".&nbsp=3B T=
ry "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 user bar<br>Undefined command: "bar".&nbsp=3B Try "help".<br>(gdb) sho=
w user wsfoo<br>User command "wsfoo":<br>&nbsp=3B printf "wsfoo\n"<br>(gdb)=
 wsfoo<br>wsfoo<br>(gdb)<br><br>Cheers=2C<br>Mohan.<br>&nbsp=3B<br> 		 	   =
		  </div>=0A=
<br>_______________________________________________=0A=
bug-gdb mailing list=0A=
bug-gdb@gnu.org=0A=
https://lists.gnu.org/mailman/listinfo/bug-gdb</div> 		 	   		  </div>=0A=
<br>_______________________________________________=0A=
bug-gdb mailing list=0A=
bug-gdb@gnu.org=0A=
https://lists.gnu.org/mailman/listinfo/bug-gdb</div> 		 	   		  </div>=0A=
<br>_______________________________________________=0A=
bug-gdb mailing list=0A=
bug-gdb@gnu.org=0A=
https://lists.gnu.org/mailman/listinfo/bug-gdb</div> 		 	   		  </div></bod=
y>
</html>=

--_e05600d3-5f72-42f6-8136-63d3b305bd7a_--
Technical Details
Message-ID: <mailman.18601.1359547557.855.bug-gdb@gnu.org>
Path: arc1-ca.pugleaf.net!6ni24558pbd.1!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!usenet.stanford.edu!not-for-mail
References: <SNT002-W940925C9778E07B6CEE92F8D1E0@phx.gbl>, , <SNT002-W949CA80EF5E5F0713CECB48D1E0@phx.gbl>, <SNT002-W966C7633A244783F72DFFF8D1E0@phx.gbl>

Show Full Headers
Complete Article Headers
X-Google-Thread: f5053,de73d7bed5d0e049
X-Google-NewGroupId: yes
X-Google-Attributes: gidf0ead4270c,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
X-Received: by 10.66.72.98 with SMTP id c2mr480648pav.28.1359547559083;
        Wed, 30 Jan 2013 04:05:59 -0800 (PST)
Path: arc1-ca.pugleaf.net!6ni24558pbd.1!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!usenet.stanford.edu!not-for-mail
From: Mohanasundaram Chandran <mohanasundaram.subscribe@outlook.com>
Newsgroups: gnu.gdb.bug
Subject: RE: Problem with user defined commands
Date: Wed, 30 Jan 2013 17:35:40 +0530
Lines: 234
Approved: bug-gdb@gnu.org
Message-ID: <mailman.18601.1359547557.855.bug-gdb@gnu.org>
References: <SNT002-W940925C9778E07B6CEE92F8D1E0@phx.gbl>, ,
 <SNT002-W949CA80EF5E5F0713CECB48D1E0@phx.gbl>,
 <SNT002-W966C7633A244783F72DFFF8D1E0@phx.gbl>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
X-Trace: usenet.stanford.edu 1359547558 22982 208.118.235.17 (30 Jan 2013 12:05:58 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: [X34HWfEVl8w3C4oSq+wouSj3x92qxBwE]
X-Originating-Email: [mohanasundaram.subscribe@outlook.com]
Importance: Normal
In-Reply-To: <SNT002-W966C7633A244783F72DFFF8D1E0@phx.gbl>
X-OriginalArrivalTime: 30 Jan 2013 12:05:40.0683 (UTC)
 FILETIME=[1F6BB9B0:01CDFEE2]
X-detected-operating-system: by eggs.gnu.org: Windows XP
X-Received-From: 65.55.90.228
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>
X-Received-Bytes: 10478
Content-Type: multipart/alternative;
 boundary="_e05600d3-5f72-42f6-8136-63d3b305bd7a_"