[v2] [patch, testsuite] skip tests in with_target_charset if no ICONV support
Sandra Loosemore
sandra@codesourcery.com
Fri Jan 8 02:34:00 GMT 2016
On 09/16/2015 10:19 PM, Doug Evans wrote:
> Sandra Loosemore <sandra@codesourcery.com> writes:
>> If GDB is configured without ICONV support, it only knows about the
>> charset "ISO-8859-1". Tests that use with_target_charset with some
>> other character set (e.g., gdb.base/printcmds.exp) presumably depend
>> on exactly that character set being supported and can't be expected to
>> work properly in its absence. This patch makes with_target_charset
>> skip those tests as unsupported if switching to the specified
>> character set fails. OK to commit?
>
> The return value of with_target_charset is not well defined.
> It's never used AFAICT (modulo the case where there's a tcl error).
>
> if {$code == 1} {
> global errorInfo errorCode
> return -code $code -errorinfo $errorInfo -errorcode $errorCode $result
> } else {
> return -code $code $result
> }
>
> $ grep with_target_charset */*.exp
> gdb.base/printcmds.exp: with_target_charset "ASCII" {
> gdb.base/printcmds.exp: with_target_charset "ASCII" {
> gdb.base/printcmds.exp: with_target_charset "ASCII" {
> gdb.base/setvar.exp:with_target_charset "ASCII" {
> gdb.base/setvar.exp:with_target_charset "ASCII" {
> gdb.base/setvar.exp:with_target_charset "ASCII" {
> lib/gdb.exp:proc with_target_charset { target_charset body } {
>
> I just wonder whether "return -1" is correct.
> Can we document that the function is "void" and don't return
> anything (except in the case of a tcl error: code == 1)?
I've revised the patch to do that. Is the attached version OK to
commit? There were no other comments on the original post.
-Sandra
-------------- next part --------------
A non-text attachment was scrubbed...
Name: with-target-charset.log
Type: text/x-log
Size: 200 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20160108/b8e7f10d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: with-target-charset.patch
Type: text/x-patch
Size: 1023 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20160108/b8e7f10d/attachment-0001.bin>
More information about the Gdb-patches
mailing list