binutils-gdb/gdb/testsuite/gdb.mi
Keith Seitz 4b48d43901 Introduce some new MI test suite cleanups for breakpoint and
breakpoint table handling.  This is a patch in five parts (all committed
here in one commit).

----- 1/5: parse_args
parse_args is a very useful utility function which allows you to do
getopt-y kinds of things in Tcl.

Example:
proc myproc {foo args} {
        parse_args {{bar} {baz "abc"} {qux}}
          # ...
}
myproc ABC -bar -baz DEF peanut butter

will define the following variables in myproc:
foo (=ABC), bar (=1), baz (=DEF), and qux (=0)
args will be the list {peanut butter}

----- 2/5: mi_build_kv_pairs
build_kv_pairs simply does what it says: given the input list
and an option join string, it combines list elements into kv-pairs
for MI handling.  It knows how to handle tuples and other special
MI types.

Example:
mi_build_kv_pairs {a b c d e f g \[.*\]}
returns a=\"b\",c=\"d\",e=\"f\",g=\[.*\]

----- 3/5: mi_make_breakpoint
This function builds breakpoint regexps, such as
"bkpt={number=\".*\", [snip]}".

Note that ONLY the options given to mi_make_breakpoint/mi_create_breakpoint
will actually be tested. So if -number is omitted, the regexp will allow
anything [number=\".*\"]

Examples:
mi_make_breakpoint -number 3

mi_create_breakpoint "myfile.c:21" -file myfile.c -line 21

----- 4/5: mi_make_breakpoint_table
This function builds MI breakpoint table regexps.

Example:
set bps {}
lappend bps [mi_make_breakpoint -number 1 -func "main" \
    -file ".*/myfile.c" -line 42
lappend bps [mi_make_breakpoint -number 2 -func "marker" \
    -file ".*myfile.c" -line 21
gdb_test "-break-info" "\\^done,[mi_make_breakpoint_table $bps]" \
    "breakpoint list"

----- 5/5: Update all callers
Self-explanatory

testsuite/ChangeLog
2014-04-23  Keith Seitz  <keiths@redhat.com>

	* lib/mi-support.exp (mi_list_breakpoints): Delete.
	(mi_make_breakpoint_table): New procedure.
	(mi_create_breakpoint): Use mi_make_breakpoint
	and return the result.
	(mi_make_breakpoint): New procedure.
	(mi_build_kv_pairs): New procedure.

	* gdb.mi/mi-break.exp: Remove unused globals,
	update mi_create_breakpoint usage, and use mi_make_breakpoint_table.
	All callers updated.
	* gdb.mi/mi-dprintf.exp: Use variable to track command
	number.
	Update all callers of mi_create_breakpoint and use
	mi_make_breakpoint_table.
	Remove any unused global variables.
	* gdb.mi/mi-nonstop.exp: Likewise.
	* gdb.mi/mi-nsintrall.exp: Likewise.
	* gdb.mi/mi-nsmoribund.exp: Likewise.
	* gdb.mi/mi-nsthrexec.exp: Likewise.
	* gdb.mi/mi-reverse.exp: Likewise.
	* gdb.mi/mi-simplerun.exp: Likewise.
	* gdb.mi/mi-stepn.exp: Likewise.
	* gdb.mi/mi-syn-frame.exp: Likewise.
	* gdb.mi/mi-until.exp: Likewise.
	* gdb.mi/mi-var-cp.exp: Likewise.
	* gdb.mi/mi-var-display.exp: Likewise.
	* gdb.mi/mi2-amd64-entry-value.exp: Likewise.
	* gdb.mi/mi2-var-child.exp: Likewise.
	* gdb.mi/mi-vla-c99.exp: Likewise.
	* lib/mi-support.exp: Likewise.

	From Ian Lance Taylor  <iant@cygnus.com>:
	* lib/gdb.exp (parse_args): New procedure.
2014-04-23 12:17:31 -07:00
..
ChangeLog-1999-2003
Makefile.in
array.f Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
basics.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dw2-ref-missing-frame-func.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dw2-ref-missing-frame-main.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dw2-ref-missing-frame.S Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dw2-ref-missing-frame.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
gdb669.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
gdb680.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
gdb701.c
gdb701.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
gdb792.cc
gdb792.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
gdb2549.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-async.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-basics.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-break.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-breakpoint-changed.exp Test no =breakpoint-modified is emitted for modifications from MI commands 2014-02-08 09:41:01 +08:00
mi-catch-load-so.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-catch-load.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-catch-load.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-cli.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-cmd-param-changed.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-console.c gdb.mi/mi-console.c, gdb.mi/mi-stack.c: Remove local emacs variables defining change-log-default-name. 2013-10-29 13:48:25 +00:00
mi-console.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-disassemble.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-dprintf.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-dprintf.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-eval.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-file-transfer.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-file.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-fill-memory.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-fullname-deleted.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-hack-cli.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-i-cmd.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-info-os.exp gdb.mi/mi-info-os.exp: Fix cross-debugger testing 2014-01-09 19:57:13 +00:00
mi-inheritance-syntax-error.cc
mi-inheritance-syntax-error.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-language.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-logging.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-memory-changed.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-nonstop-exit.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-nonstop.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-ns-stale-regcache.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-nsintrall.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-nsmoribund.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-nsthrexec.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-pending.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-pending.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-pendshr.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-pthreads.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-read-memory.c
mi-read-memory.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-record-changed.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-reg-undefined.S Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-reg-undefined.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-reg-undefined.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-regs.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-return.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-reverse.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-simplerun.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-solib.exp PR gdb/13860: make "-exec-foo"'s MI output equal to "foo"'s MI output. 2014-03-18 17:50:28 +00:00
mi-stack.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-stack.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-start.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-start.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-stepi.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-stepn.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-stepn.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-syn-frame.c
mi-syn-frame.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-undefined-cmd.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-until.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-var-block.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-var-child-f.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-var-child.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-var-child.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-var-cmd.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-var-cp.cc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-var-cp.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-var-create-rtti.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-var-create-rtti.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-var-display.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-var-invalidate.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-var-rtti.cc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-var-rtti.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-vla-c99.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi-watch-nonstop.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-watch.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi2-amd64-entry-value.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi2-amd64-entry-value.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
mi2-amd64-entry-value.s Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi2-prompt.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi2-var-child.exp Introduce some new MI test suite cleanups for breakpoint and 2014-04-23 12:17:31 -07:00
non-stop-exit.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
non-stop.c Add return value for non-void function return statements to fix error in clang build. 2014-04-14 08:34:51 -07:00
ns-stale-regcache.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
nsintrall.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
nsmoribund.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
nsthrexec.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pending.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pendshr1.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pendshr2.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pr11022.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pr11022.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pthreads.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
solib-lib.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
solib-main.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
testcmds
until.c
var-cmd.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
vla.c test: add mi vla test 2014-04-14 09:52:11 -07:00
watch-nonstop.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00