From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11513 invoked by alias); 15 Feb 2017 00:03:49 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 11498 invoked by uid 89); 15 Feb 2017 00:03:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=AWL,BAYES_50,SPF_PASS autolearn=ham version=3.3.2 spammy=Maxim, maxim, max42yandexteamcom, Hx-languages-length:1516 X-HELO: forwardcorp1o.cmail.yandex.net Received: from forwardcorp1o.cmail.yandex.net (HELO forwardcorp1o.cmail.yandex.net) (37.9.109.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Feb 2017 00:03:37 +0000 Received: from mxbackcorp1h.mail.yandex.net (mxbackcorp1h.mail.yandex.net [IPv6:2a02:6b8:0:f05::301]) by forwardcorp1o.cmail.yandex.net (Yandex) with ESMTP id 154DE20EC3 for ; Wed, 15 Feb 2017 03:03:35 +0300 (MSK) Received: from webcorp03e.yandex-team.ru (webcorp03e.yandex-team.ru [5.255.227.11]) by mxbackcorp1h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id a3R3sYoYsv-3YeWn7pK; Wed, 15 Feb 2017 03:03:34 +0300 Authentication-Results: mxbackcorp1h.mail.yandex.net; dkim=pass header.i=@yandex-team.com X-Yandex-Sender-Uid: 1120000000036182 Received: by webcorp03e.yandex-team.ru with HTTP; Wed, 15 Feb 2017 03:03:34 +0300 From: Maxim Akhmedov Envelope-From: max42@yandex-team.ru To: gdb@sourceware.org Subject: Default value for option "python print-stack" MIME-Version: 1.0 Message-Id: <97321487117014@webcorp03e.yandex-team.ru> Date: Wed, 15 Feb 2017 00:03:00 -0000 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-SW-Source: 2017-02/txt/msg00034.txt.bz2 Hi, Currently the default value for an option "python print-stack" is "message" that enables show only the messages of Python exceptions, but not their tracebacks nor line numbers. Though, usually the message of a Python error itself is pretty useless as it doesn't point you where exactly the error happened. Like, suppose you have a pretty-printer written in Python, and then you get the following output: (gdb) yp lastKey Python Exception local variable 'value_data' referenced before assignment: Error occurred in Python command: local variable 'value_data' referenced before assignment it doesn't really tell you anything, there may be lots of usages of a mentioned variable, and due to the dynamic nature of Python you may easily mess somewhere and it's particularly hard to find out the exact place by this message. Also, the exception message is duplicated. I see two options here. First one is choosing "full" as a default value for this option. Is their any rationale for not doing that? Python tracebacks are usually not that large to intentionally suppress them. Second one is appending the sourcefile:lineno to the message. Like: "/path/to/source.py:123". I believe it should be possible to extract this information from the traceback object you get after invoking the Python code. >From my point of view, it's a good idea to implement both of this options. --  Best wishes, Maxim Akhmedov max42@yandex-team.com