This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/6] [mainline+7.6] PR gdb/15294: list with unlimited listsize broken
- From: Yao Qi <yao at codesourcery dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 22 Mar 2013 15:38:00 +0800
- Subject: Re: [PATCH 0/6] [mainline+7.6] PR gdb/15294: list with unlimited listsize broken
- References: <20130321182902 dot 3180 dot 72398 dot stgit at brno dot lan>
On 03/22/2013 02:29 AM, Pedro Alves wrote:
Before the changes starting at
<http://sourceware.org/ml/gdb-patches/2012-08/msg00020.html>, the 'set
The patch of the link above was not committed. You meant this patch, I
think
[PATCH 2/3] var_integer -> var_zuinteger_unlimited
http://sourceware.org/ml/gdb-patches/2012-08/msg00367.html
and it was committed in revision ac6e6b6e4182a5fd3dfc50504fa4a5fe543faa41
listsize' command only accepted "0" as special value, meaning
"unlimited". The testsuite actually tried "set listsize -1" and
expected that to mean unlimited too.
The patch tried to keep the behaviour that "0" means suppressed and "-1"
means unlimited.
If you tried testing list.exp at the time of that patch above,
FAOD, the list.exp is run _without_ the patch above.
you'd get:
(gdb) PASS: gdb.base/list.exp: list line 10 with listsize 100
set listsize 0
(gdb) PASS: gdb.base/list.exp: setting listsize to 0 #6
show listsize
Number of source lines gdb will list by default is unlimited.
(gdb) PASS: gdb.base/list.exp: show listsize unlimited #6
list 1
1 #include "list0.h"
2
...
42 /* Not used for anything */
43 }
(gdb) PASS: gdb.base/list.exp: listsize of 0 suppresses output
set listsize -1
integer 4294967295 out of range
(gdb) PASS: gdb.base/list.exp: setting listsize to -1 #7
show listsize
Number of source lines gdb will list by default is unlimited.
(gdb) PASS: gdb.base/list.exp: show listsize unlimited #7
list 1
1 #include "list0.h"
Notice that "set listsize -1" actually failed with "integer 4294967295
out of range", but we issued a PASS anyway.
If we go to the revision that the patch was committed, we can see:
$ git checkout ac6e6b6e4182a5fd3dfc50504fa4a5fe543faa41
(gdb) PASS: gdb.base/list.exp: list line 10 with listsize 100
set listsize 0^M
(gdb) PASS: gdb.base/list.exp: setting listsize to 0 #6
show listsize^M
Number of source lines gdb will list by default is 0.^M
(gdb) PASS: gdb.base/list.exp: show listsize 0 #6
list 1^M
(gdb) PASS: gdb.base/list.exp: listsize of 0 suppresses output
set listsize -1^M
(gdb) PASS: gdb.base/list.exp: setting listsize to -1 #7
show listsize^M
Number of source lines gdb will list by default is unlimited.^M
(gdb) PASS: gdb.base/list.exp: show listsize unlimited #7
--
Yao (éå)