From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Gustaf Waldemarson Newsgroups: gmane.emacs.bugs Subject: bug#34589: 26.1.91; GDB-MI Display Complex Data Types Date: Wed, 20 Feb 2019 11:08:15 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="85555"; mail-complaints-to="usenet@blaine.gmane.org" To: 34589@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 20 11:10:26 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gwOpd-000M8d-T5 for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Feb 2019 11:10:26 +0100 Original-Received: from localhost ([127.0.0.1]:37307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwOpc-0002jb-Nn for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Feb 2019 05:10:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwOpP-0002iv-IW for bug-gnu-emacs@gnu.org; Wed, 20 Feb 2019 05:10:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwOpL-00075G-Lr for bug-gnu-emacs@gnu.org; Wed, 20 Feb 2019 05:10:11 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56433) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gwOpG-000748-FC for bug-gnu-emacs@gnu.org; Wed, 20 Feb 2019 05:10:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gwOpG-0000wm-3w for bug-gnu-emacs@gnu.org; Wed, 20 Feb 2019 05:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gustaf Waldemarson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Feb 2019 10:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34589 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15506573483547 (code B ref -1); Wed, 20 Feb 2019 10:10:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Feb 2019 10:09:08 +0000 Original-Received: from localhost ([127.0.0.1]:57196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gwOoL-0000v7-Rm for submit@debbugs.gnu.org; Wed, 20 Feb 2019 05:09:06 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gwOoJ-0000ub-Qq for submit@debbugs.gnu.org; Wed, 20 Feb 2019 05:09:04 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:41322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gwOoB-0006fq-Fy for submit@debbugs.gnu.org; Wed, 20 Feb 2019 05:08:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwOo7-00026G-2s for bug-gnu-emacs@gnu.org; Wed, 20 Feb 2019 05:08:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwOo5-0006dK-1O for bug-gnu-emacs@gnu.org; Wed, 20 Feb 2019 05:08:50 -0500 Original-Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:42164) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gwOo1-0006XL-5l for bug-gnu-emacs@gnu.org; Wed, 20 Feb 2019 05:08:47 -0500 Original-Received: by mail-ed1-x534.google.com with SMTP id j89so9964209edb.9 for ; Wed, 20 Feb 2019 02:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=l7WYlcR2xjdPGtOXk08IaH7R0JABFraISKOrNH98PzI=; b=WRQIpwuoqnFnYDVuEQtPdfJv/T3vgHGoSgbM0UowGyeRcWzUaWsJX8AEjTcrBM6+XK BCJnA9JbB9uqtrZT079PbulQgP7qL4BRdtlcV5l0asM0S+yZ0faXIHjGJPDPD6G6tE9Q 5H9vxAf+Wcc8a+48TXm1ERvfUvB2b2n2GVLMD3IN3HWHHX9Qt2Zz5RSas5z3F0srPhJC M44MEuU356Sm5I10b4hHjJpdRMk1AOocXduSrwsJQGZIyNvQgF44d1czFRBGtWX5SpEJ kYDtvSgQhQpknML8RTl9KGel15j1ePgO23oMeV9DEOkPJq4emazvh5sUB6RscSYbacM6 TS9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=l7WYlcR2xjdPGtOXk08IaH7R0JABFraISKOrNH98PzI=; b=AQCPQmYBMYiUtEkIhTjdViPTonAPgmJ985KG9inKRfAcAtUm95r9Uv9aGzXdWDa8gI X6gmq6VjNMq+cKEBx3tLK3j02w4SMOqZ2F0msytZT0FxalOJQpqkaoGGgJBk2VIQ4UzP WR2ISecsjyuMVLtumkbxTZTtVnQGrAJ9YhnoAsYjhxVS3r1Lf/pg6q06QOkTTF3r34Qi jU4IcXTDrAT5024he9CvHRCbvSQDX6QNUUrxWyoGg5FWS6NjIdS+VdCecvSvRXmwQVhz CPou3pf2HHErQRR99kYijcxoyx+uKroxXjA3vy4BvyVcOCtdbAMCksQEbTdImgQ5GLbw p+nQ== X-Gm-Message-State: AHQUAuZoP5g9Wptp2YGx6MSHM/P5+FvbvkvdYySGHa0jSb6WZy/s3UnV xdz2TSlgNlc7JcjneQKv5YWBMIhDtimvnT8gDh8NgQ== X-Google-Smtp-Source: AHgI3IbqbHtkANzapdKHAmIcrUl3x0v3hBJ+Pj7YHXgyv2y0ixyqV5FbH3+df99q4hte5m5Rs0QINaZsNssBARIMPAE= X-Received: by 2002:a17:906:1c4b:: with SMTP id l11mr23184160ejg.20.1550657306465; Wed, 20 Feb 2019 02:08:26 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155587 Archived-At: Hello, I've got a minor feature request to the gdb-mi (and possibly a bug to report). I've recently been coding a lot of C++ where almost every variable is a class/struct of some kind and up until now I've simply ignored the "locals" windows since almost every data-type is listed as "". Eventually though, I looked up why it was doing that instead of doing some kind of pretty printing, and finally I noticed the "--simple-values" flag, which causes GDB to print the variable name and type, but not the value (for "complex" data types). Since as C++ (and other languages) is moving more and more towards these kinds non-simple data types, I figured I should send out a feature request for something like the following: - Remove "--simple-values" by default. - Add a customizable variable such as `gdb-simple-values-only`, which adds the above flag. - Add a customizable variable such as `gdb-locals-value-limit` to limit the length a value is allowed to be shown. - Add a simple filter of the retrieved value string to make it fit on a single line (e.g., a simple version could just remove all newlines). Naturally, the having "--simple-values" be default or not is really a matter of taste, the above merely reflects my personal preference. There might also be some efficiency concerns for really large data-structure being sent through the GDB interface, but perhaps that's already handled elsewhere? Also, since it is tangential with the above topic: reference and pointer variables to complex data types *are* being displayed already presumably unintentionally. And since the output is not filtered, this leads to a rather distorted local variable window. A simple example showing the above "bug" can be seen in the program: #include #include using namespace std; int main(void) { size_t idx = 0; vector v{1, 2, 3, 4, 5}; auto &vr = v; for (auto i : v) { idx++; cout << i << endl; } return 0; } (Compile with CXXFLAGS="-std=c++11 -g" and open with gdb-mi as usual). I guess this is caused by GDB considering references themselves to be simple values. I believe the proposed feature(s) would fix this issue and provide a more useful debugging experience. Best regards, Gustaf In GNU Emacs 26.1.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2019-01-10 built on E105888 Repository revision: 9845044fb659735251269213e6e4e6debdd08eee System Description: Ubuntu 16.04.5 LTS Recent messages: Mark saved where search started When done with a buffer, type C-x # Mark saved where search started Mark set Mark saved where search started [3 times] When done with a buffer, type C-x # Mark saved where search started [2 times] Quit delete-backward-char: Text is read-only Making completion list... Configured using: 'configure --prefix=/home/guswal01/.local '--program-transform-name=s/^ctags$/ctags.emacs/'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS GLIB NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LCMS2 Important settings: value of $LC_ALL: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Dired by name Minor modes in effect: gdb-many-windows: t global-magit-file-mode: t diff-auto-refine-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t shell-dirtrack-mode: t beacon-mode: t flycheck-pos-tip-mode: t projectile-mode: t hes-mode: t global-linum-mode: t linum-mode: t yas-global-mode: t yas-minor-mode: t global-company-mode: t company-mode: t global-anzu-mode: t anzu-mode: t perspeen-mode: t global-atomic-chrome-edit-mode: t global-undo-tree-mode: t which-key-mode: t anyclip-mode: t override-global-mode: t electric-pair-mode: t save-place-mode: t global-subword-mode: t subword-mode: t show-paren-mode: t winner-mode: t global-auto-revert-mode: t xterm-mouse-mode: t savehist-mode: t ido-everywhere: t gud-tooltip-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /home/guswal01/.emacs.d/elpa/soap-client-3.1.5/soap-inspect hides /home/guswal01/.local/share/emacs/26.1.91/lisp/net/soap-inspect /home/guswal01/.emacs.d/elpa/soap-client-3.1.5/soap-client hides /home/guswal01/.local/share/emacs/26.1.91/lisp/net/soap-client Features: (shadow sort bbdb-message mail-extr emacsbug sendmail gnus-async qp gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-ml gnus-msg disp-table nndoc gnus-cache gnus-dup gnus-art mm-uu mml2015 mm-view mml-smime smime dig mm-archive network-stream starttls url-cache debbugs-gnu debbugs soap-client url-http url-auth url-gw nsm url url-proxy url-privacy url-expand url-methods url-history mailcap rng-xsd rng-dt rng-util xsd-regexp xml eieio-opt speedbar sb-image ezimage dframe help-fns radix-tree pbrt-mode misearch multi-isearch two-column iso-transl tabify flycheck-popup-tip gdb-mi ace-window modern-cpp-font-lock irony-cdb-libclang irony-cdb-json pp irony-cdb-clang-complete irony-cdb irony-completion irony-snippet irony irony-iotask face-remap vc-git bug-reference org-rmail org-mhe org-irc org-info org-gnus nnir gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win gnus nnheader org-docview doc-view jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m org-table ob-latex ob-plantuml ob-org ob-shell ob-gnuplot ob-python ob-ditaa ob-dot org-element avl-tree generator org org-macro org-footnote org-pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs org-loaddefs cal-menu calendar cal-loaddefs guess-language magit-extras magit-submodule magit-obsolete magit-blame magit-stash magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff-mode magit-core magit-autorevert magit-process magit-margin magit-mode git-commit magit-git magit-section magit-utils magit-popup crm log-edit message rmc puny format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log with-editor async-bytecomp async shell pcomplete dired dired-loaddefs term/tmux term/xterm xterm smart-mode-line-dark-theme smart-mode-line rich-minority beacon server flymake-proc flymake warnings auto-complete-config auto-complete popup form-feed paredit nameless lisp-mnt flyspell ispell whitespace flycheck-pos-tip pos-tip flycheck find-func dash rainbow-delimiters projectile grep compile ibuf-ext ibuffer ibuffer-loaddefs highlight-escape-sequences linum yasnippet-snippets yasnippet company-oddmuse company-keywords company-etags etags xref project company-gtags company-dabbrev-code company-dabbrev company-files company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-bbdb company anzu thingatpt perspeen perspeen-tab powerline powerline-separators powerline-themes atomic-chrome websocket url-cookie url-domsuf url-util bindat subr-x let-alist json map color-theme-approximate color delim-col hydra-examples windmove rect hydra lv pcase bbdb bbdb-site timezone cus-edit cus-start cus-load wid-edit ace-link avy undo-tree diff which-key advice anyclip-mode cl-extra help-mode diminish use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key use-package-core finder-inf autoinsert tex-site rx slime-autoloads info package epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars local-autoloads cwarn cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs elec-pair saveplace cap-words superword subword time-date paren winner autorevert filenotify xt-mouse tango-dark-theme savehist ido seq byte-opt gv bytecomp byte-compile cconv gud easy-mmode comint ansi-color ring keybinds edmacro kmacro cl-loaddefs cl-lib terminals mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1119702 162902) (symbols 48 60024 2) (miscs 40 6949 1708) (strings 32 201194 30469) (string-bytes 1 6831751) (vectors 16 81280) (vector-slots 8 2121524 238164) (floats 8 3772 1218) (intervals 56 96783 1278) (buffers 992 96) (heap 1024 90082 4527))