[v3 testsuite] gdb-test.exp: catch error running gdb command

Mike Stump mikestump@comcast.net
Sun Jan 6 20:45:00 GMT 2013


On Jan 3, 2013, at 3:57 PM, Janis Johnson <janis_johnson@mentor.com> wrote:
> The libstdc++ prettyprinter tests require a certain level of support
> from GDB, and the check for that GDB support runs a command that
> includes a quoted string.  This causes an error from the testsuite
> infrastructure for embedded processors whose board support passes
> commands through additional levels of procedures that lose the
> backslashes that escape the quotes.  Adding more backslashes wouldn't
> work because it would prevent the command from working for the majority
> of boards.  I can't figure out a real solution to the problem.
> 
> Rather than gdb_version_check resulting in an error for boards that
> pass a command through additional levels of procedure calls, this
> patch lets it catch the error so that it can fail gracefully and the
> tests will be reported as UNSUPPORTED.  This will skip the tests for
> a relatively small number of test setups.
> 
> OK for trunk?

Ok.  If one wants to fix the real problem, just track down call chain and find who does what with quoting.  I usually do this by mixing in spaces, tabs, newlines, backslashes, single quotes and double quotes into the content and then ensue identity at the bottom.  At each step, the content should be preserved.  If anything strips content, that is wrong, and can be fixed by adding:

string=add_quotes(string)

before the thing that strips.  The exact form of add_quote is dependent upon the thing that does the stripped (interpretation).



More information about the Libstdc++ mailing list