This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] Add test for comma in linespec (python)
- From: Keith Seitz <keiths at redhat dot com>
- To: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Fri, 30 Mar 2012 11:07:58 -0700
- Subject: [RFA] Add test for comma in linespec (python)
Hi,
This adds a simple test to check if gdb.decode_line (and everything
underneath that) is properly handling linespecs with commas in them,
e.g. "func1,func2". This should return a symtab for func1, but stop
processing at ",func2".
Ok?
Keith
2012-03-30 Keith Seitz <keiths@redhat.com>
* gdb.python: Add test for linespecs with commas.
Index: testsuite/gdb.python/python.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/python.exp,v
retrieving revision 1.31
diff -u -p -r1.31 python.exp
--- testsuite/gdb.python/python.exp 16 Jan 2012 16:21:52 -0000 1.31
+++ testsuite/gdb.python/python.exp 30 Mar 2012 18:04:02 -0000
@@ -182,6 +182,9 @@ gdb_test "python print len(symtab)" "2"
gdb_test "python print len(symtab\[1\])" "1" "Test decode_line func1 length"
gdb_test "python print symtab\[1\]\[0\].symtab" ".*gdb.python/python-1.c.*" "Test decode_line func1 filename"
gdb_test "python print symtab\[1\]\[0\].line" "19" "Test decode_line func1 line number"
+gdb_py_test_silent_cmd {python symtab = gdb.decode_line ("func1,func2")} \
+ "test decode_line func1,func2" 1
+gdb_test {python print symtab[0]} ",func2" "stop at comma in linespec"
# gdb.write
gdb_test "python print sys.stderr" ".*__main__.GdbOutputErrorFile instance at.*" "Test stderr location"