From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13606 invoked by alias); 16 Nov 2010 15:30:24 -0000 Received: (qmail 13498 invoked by uid 22791); 16 Nov 2010 15:30:22 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Nov 2010 15:30:17 +0000 From: "pedro at codesourcery dot com" To: gdb-prs@sourceware.org Subject: [Bug python/12175] show_doc for gdb.Parameter has strange behaviour X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pedro at codesourcery dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: pmuldoon at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 16 Nov 2010 16:29:00 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2010-q4/txt/msg00138.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12175 --- Comment #5 from Pedro Alves 2010-11-16 15:30:13 UTC --- (In reply to comment #4) > Yeah, we can. > First we would have to identify the parameter as being written > in Python. I don't think you need this. Looking at py-param.c:add_setshow_generic, you're currently always passing NULL as both set_func and show_func callbacks. I'd like to make this illegal at some point. You'd instead pass a pointer to py-param.c specific callbacks, and then these new callbacks' implementation would know to call the corresponding callback on the Python (language) side. As a first step, this can be make optional, with the current behavior as fallback, of course. > Then we would require the user to implement show/set documentation > functions in Python. At some point, yes. With i18n, it's necessary. As a first step, we should at least add the possibility to implement the callback. This callback is also the way some commands can show the "(currently foo)" part: As I understand it, it's not possible do have a param do that in python currently. E.g.,: (gdb) show breakpoint always-inserted Always inserted breakpoint mode is auto (currently off). > Then, when the value printing/help parameter code > sections are executed in GDB we can check if it is a Python scripted parameter, > and if so then call into the Python object where it would return the > appropriate string for the above functions. Well, no need for the generic code to know this is a python parameter --- the generic code just calls the installed callback through a function pointer as usual. But instead of getting the default callback implementation (cli/cli-setshow.c:deprecated_show_value_hack), it'd call a new python/py-param.c:py_show_param_value function. > > This would be an API regression on our part though. We might be able to do this > generically which would avoid requiring parameter API changes, but not sure > how. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.