Bug 230036

Summary: devel/gdb: Doesn't support UTF-8 charset
Product: Ports & Packages Reporter: Gleb Popov <arrowd>
Component: Individual Port(s)Assignee: Luca Pizzamiglio <pizzamig>
Status: Closed FIXED    
Severity: Affects Only Me Flags: pizzamig: maintainer-feedback+
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Gleb Popov freebsd_committer freebsd_triage 2018-07-25 10:01:39 UTC
Running

(gdb) set charset UTF-8

returns

Undefined item: "UTF-8".

this makes it impossible to debug some programs with UTF-encoded constants and also breaks KDevelop unittests [1].

Can anything be done with that?

[1]: https://phabricator.kde.org/T9249
Comment 1 Luca Pizzamiglio freebsd_committer freebsd_triage 2018-07-26 16:05:23 UTC
Sure.
I'm digging into the issue.
Apparently, the system libc iconv doesn't provide the support that gdb wants.
Switching to the libconv in ports, will extend the support to 200 charset.
I guess, I'll add an option (ON on default) to use extend the charset support.

Nice finding.
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-07-27 14:05:57 UTC
A commit references this bug:

Author: pizzamig
Date: Fri Jul 27 14:05:08 UTC 2018
New revision: 475441
URL: https://svnweb.freebsd.org/changeset/ports/475441

Log:
  devel/gdb: add support to UTF-8 charset

  Introduced a new option, enabled on default, to use libiconv, that
  provide wchar_t support and allow to use UTF-8 charset in gdb

  PR:		230036
  Reported by:	Gleb Popov <arrowd@FreeBSD.org>

Changes:
  head/devel/gdb/Makefile
Comment 3 Luca Pizzamiglio freebsd_committer freebsd_triage 2018-07-27 14:07:14 UTC
thanks for reporting.
set charset UTF-8 works now.
Comment 4 Gleb Popov freebsd_committer freebsd_triage 2018-07-27 16:48:45 UTC
Hum, that changed nothing for me.

gdb-8.1_4
Name           : gdb
Version        : 8.1_4
Installed on   : Fri Jul 27 19:32:58 2018 +03
Origin         : devel/gdb
Architecture   : FreeBSD:12:amd64
Prefix         : /usr/local
Categories     : devel
Licenses       : GPLv3
Maintainer     : pizzamig@FreeBSD.org
WWW            : http://www.gnu.org/software/gdb/
Comment        : GNU GDB of newer version than comes with the system
Options        :
        BUNDLED_READLINE: off
        DEBUG          : off
        GDB_LINK       : on
        GUILE          : off
        KGDB           : on
        PORT_ICONV     : on
        PORT_READLINE  : on
        PYTHON         : on
        SYSTEM_ICONV   : off
        TUI            : off
Shared Libs required:
        libexpat.so.1
        libpython2.7.so.1
        libreadline.so.7
        libmpfr.so.6

Still no UTF-8 item.
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-07-28 10:19:34 UTC
A commit references this bug:

Author: pizzamig
Date: Sat Jul 28 10:18:33 UTC 2018
New revision: 475518
URL: https://svnweb.freebsd.org/changeset/ports/475518

Log:
  devel/gdb: Fix iconv support

  Fix iconv support.
  Bump portrevision.

  PR:		230036
  Reported by:	Gleb Popov <arrowd@FreeBSD.org>

Changes:
  head/devel/gdb/Makefile
Comment 6 Luca Pizzamiglio freebsd_committer freebsd_triage 2018-07-28 10:42:33 UTC
Sorry, my bad. I forgot to remove iconv from USES.
It's fixed now.