old-cross-binutils/gdb/testsuite/gdb.mi
Don Breazeal 1cafadb4e4 PR 18303, Tolerate malformed input for lookup_symbol-called functions
lookup_symbol is often called with user input.  Consequently, any
function called from lookup_symbol{,_in_language} should attempt to
deal with malformed input gracefully.  After all, malformed user
input is not a programming/API error.

This patch does not attempt to find/correct all instances of this.  It
only fixes locations in the code that trigger test suite failures.

This patch fixes PR breakpoints/18303, "Assertion: -breakpoint-insert
with windows paths of file in non-current directory".

The patch includes three new tests related to this.  One is just
gdb.linespec/ls-errs.exp copied and converted to use C++ instead of C, and
to add a case using a file name containing a Windows-style logical drive
specifier.  The others include an MI test to provide a regression test for
the specific case reported in PR 18303, and a C++ test for proper error
handling of access to a program variable when using a file scope specifier
that refers to a non-existent file.

Tested on x86_64 native Linux.

gdb/ChangeLog
2016-01-28  Keith Seitz  <keiths@redhat.com>

	PR breakpoints/18303
	* cp-namespace.c (cp_lookup_bare_symbol): Change assertion to
	look for "::" instead of simply ":".
	(cp_search_static_and_baseclasses): Return null_block_symbol for
	malformed input.
	Remove assertions.
	* cp-support.c (cp_find_first_component_aux): Do not return
	a prefix length for ':' unless the next character is also ':'.

gdb/testsuite/ChangeLog
2016-01-28  Don Breazeal  <donb@codesourcery.com>

	* gdb.cp/scope-err.cc: New test program.
	* gdb.cp/scope-err.exp: New test script.
	* gdb.linespec/ls-errs.c (myfunction): Expanded to have multiple
	lines and "set breakpoint here" comment.
	* gdb.linespec/ls-errs.exp: Added C++ testing and new test case.
	Fixed some whitespace and format issues.
	* gdb.mi/mi-linespec-err-cp.cc: New test program.
	* gdb.mi/mi-linespec-err-cp.exp: New test script.
2016-03-15 15:25:15 -07:00
..
array.f
basics.c
ChangeLog-1999-2003
dw2-ref-missing-frame-func.c
dw2-ref-missing-frame-main.c
dw2-ref-missing-frame.exp
dw2-ref-missing-frame.S
gdb669.exp
gdb680.exp
gdb701.c
gdb701.exp
gdb792.cc
gdb792.exp
gdb2549.exp
mi-async.exp
mi-basics.exp
mi-break.exp
mi-breakpoint-changed.exp
mi-catch-load-so.c
mi-catch-load.c
mi-catch-load.exp
mi-cli.exp
mi-cmd-param-changed.exp
mi-condbreak-call-thr-state-mt.c
mi-condbreak-call-thr-state-st.c
mi-condbreak-call-thr-state.c
mi-condbreak-call-thr-state.exp
mi-console.c
mi-console.exp
mi-detach.exp
mi-disassemble.exp
mi-dprintf-pending.c
mi-dprintf-pending.exp
mi-dprintf-pendshr.c
mi-dprintf.c
mi-dprintf.exp
mi-eval.exp
mi-exit-code.c
mi-exit-code.exp
mi-file-transfer.exp
mi-file.exp
mi-fill-memory.exp
mi-fullname-deleted.exp
mi-hack-cli.exp
mi-i-cmd.exp
mi-info-os.exp
mi-inheritance-syntax-error.cc
mi-inheritance-syntax-error.exp
mi-language.exp
mi-linespec-err-cp.cc
mi-linespec-err-cp.exp
mi-logging.exp
mi-memory-changed.exp
mi-nonstop-exit.exp
mi-nonstop.exp
mi-ns-stale-regcache.exp
mi-nsintrall.exp
mi-nsmoribund.exp
mi-nsthrexec.exp
mi-pending.c
mi-pending.exp
mi-pendshr.c
mi-pendshr2.c
mi-pthreads.exp
mi-read-memory.c
mi-read-memory.exp
mi-record-changed.exp
mi-reg-undefined.c
mi-reg-undefined.exp
mi-reg-undefined.S
mi-regs.exp
mi-return.exp
mi-reverse.exp
mi-simplerun.exp
mi-solib.exp
mi-stack.c
mi-stack.exp
mi-start.c
mi-start.exp
mi-stepi.exp
mi-stepn.c
mi-stepn.exp
mi-syn-frame.c
mi-syn-frame.exp
mi-undefined-cmd.exp
mi-until.exp
mi-var-block.exp
mi-var-child-f.exp
mi-var-child.c
mi-var-child.exp
mi-var-cmd.exp
mi-var-cp.cc
mi-var-cp.exp
mi-var-create-rtti.c
mi-var-create-rtti.exp
mi-var-display.exp
mi-var-invalidate.exp
mi-var-list-children-invalid-grandchild.c
mi-var-list-children-invalid-grandchild.exp
mi-var-rtti.cc
mi-var-rtti.exp
mi-vla-c99.exp
mi-vla-fortran.exp
mi-watch-nonstop.exp
mi-watch.exp
mi2-amd64-entry-value.c
mi2-amd64-entry-value.exp
mi2-amd64-entry-value.s
mi2-prompt.exp
mi2-var-child.exp
non-stop-exit.c
non-stop.c
ns-stale-regcache.c
nsintrall.c
nsmoribund.c
nsthrexec.c
pending.c
pendshr1.c
pendshr2.c
pr11022.c
pr11022.exp
pthreads.c
solib-lib.c
solib-main.c
testcmds
until.c
var-cmd.c
vla.c
vla.f90
watch-nonstop.c