binutils-gdb/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
..
ChangeLog-1999-2003
array.f GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
basics.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
dw2-ref-missing-frame-func.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
dw2-ref-missing-frame-main.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
dw2-ref-missing-frame.S GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
dw2-ref-missing-frame.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb669.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb680.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb701.c
gdb701.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb792.cc
gdb792.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb2549.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-async.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-basics.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-break.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-breakpoint-changed.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-catch-load-so.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-catch-load.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-catch-load.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cli.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-param-changed.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-condbreak-call-thr-state-mt.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-condbreak-call-thr-state-st.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-condbreak-call-thr-state.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-condbreak-call-thr-state.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-console.c GDB testsuite: Fix warnings with -std=gnu11 2014-11-13 10:20:44 +01:00
mi-console.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-detach.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-disassemble.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-dprintf-pending.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-dprintf-pending.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-dprintf-pendshr.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-dprintf.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-dprintf.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-eval.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-exit-code.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-exit-code.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-file-transfer.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-file.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-fill-memory.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-fullname-deleted.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-hack-cli.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-i-cmd.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-info-os.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-inheritance-syntax-error.cc
mi-inheritance-syntax-error.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-language.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-linespec-err-cp.cc PR 18303, Tolerate malformed input for lookup_symbol-called functions 2016-03-15 15:25:15 -07:00
mi-linespec-err-cp.exp PR 18303, Tolerate malformed input for lookup_symbol-called functions 2016-03-15 15:25:15 -07:00
mi-logging.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-memory-changed.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-nonstop-exit.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-nonstop.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
mi-ns-stale-regcache.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-nsintrall.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
mi-nsmoribund.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-nsthrexec.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-pending.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-pending.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-pendshr.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-pendshr2.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-pthreads.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-read-memory.c
mi-read-memory.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-record-changed.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-reg-undefined.S GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-reg-undefined.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-reg-undefined.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-regs.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-return.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-reverse.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-simplerun.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-solib.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-stack.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-stack.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-start.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-start.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-stepi.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-stepn.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-stepn.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-syn-frame.c GDB testsuite: Fix warnings with -std=gnu11 2014-11-13 10:20:44 +01:00
mi-syn-frame.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-undefined-cmd.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-until.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-block.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-child-f.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-child.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-child.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-cmd.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-cp.cc GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-cp.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-create-rtti.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-create-rtti.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-display.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-invalidate.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-list-children-invalid-grandchild.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-list-children-invalid-grandchild.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-rtti.cc GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-var-rtti.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-vla-c99.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-vla-fortran.exp gdb: Guard against undefined behaviour in mi-vla-fortran.exp 2016-02-01 18:05:35 +00:00
mi-watch-nonstop.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-watch.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi2-amd64-entry-value.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi2-amd64-entry-value.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi2-amd64-entry-value.s GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi2-prompt.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi2-var-child.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-stop-exit.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-stop.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
ns-stale-regcache.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
nsintrall.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
nsmoribund.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
nsthrexec.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
pending.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
pendshr1.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
pendshr2.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
pr11022.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
pr11022.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
pthreads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
solib-lib.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
solib-main.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
testcmds
until.c Eliminate literal line numbers in mi-until.exp 2014-11-17 10:26:30 +01:00
var-cmd.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
vla.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
vla.f90 testsuite: Nullify pointers before first usage. 2016-03-02 16:36:37 +01:00
watch-nonstop.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00