binutils-gdb/gdb/testsuite/gdb.linespec
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
..
base GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
3explicit.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
body.h
break-ask.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
break-asm-file.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
break-asm-file.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
break-asm-file0.s GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
break-asm-file1.s GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
cpexplicit.cc GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
cpexplicit.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
explicit.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
explicit.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
explicit2.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
keywords.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
keywords.exp Per-inferior/Inferior-qualified thread IDs 2016-01-13 10:59:43 +00:00
linespec.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
ls-dollar.cc GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
ls-dollar.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
ls-errs.c PR 18303, Tolerate malformed input for lookup_symbol-called functions 2016-03-15 15:25:15 -07:00
ls-errs.exp PR 18303, Tolerate malformed input for lookup_symbol-called functions 2016-03-15 15:25:15 -07:00
lspec.cc
lspec.h
macro-relative.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
macro-relative.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
skip-two.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00