Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: "gdb-patches@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: [RFA] Add test for comma in linespec (python)
Date: Fri, 30 Mar 2012 18:08:00 -0000	[thread overview]
Message-ID: <4F75F67E.30609@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 347 bytes --]

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.

[-- Attachment #2: python-comma-linespec.patch --]
[-- Type: text/x-patch, Size: 998 bytes --]

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"

             reply	other threads:[~2012-03-30 18:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30 18:08 Keith Seitz [this message]
2012-03-30 18:17 ` Tom Tromey
2012-03-30 19:17   ` Keith Seitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F75F67E.30609@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox