From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27088 invoked by alias); 11 Jan 2002 00:13:18 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 27060 invoked from network); 11 Jan 2002 00:13:17 -0000 Received: from unknown (HELO localhost.cygnus.com) (24.114.42.213) by sources.redhat.com with SMTP; 11 Jan 2002 00:13:17 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id D3FDE3CEF; Thu, 10 Jan 2002 19:13:13 -0500 (EST) Message-ID: <3C3E2E19.7020704@cygnus.com> Date: Thu, 10 Jan 2002 16:13:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.7) Gecko/20020103 X-Accept-Language: en-us MIME-Version: 1.0 To: Eli Zaretskii Cc: gdb@sources.redhat.com Subject: Re: Request/question from RMS References: <3C3DA906.6010803@cygnus.com> <9743-Thu10Jan2002174616+0200-eliz@is.elta.co.il> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00113.txt.bz2 > Date: Thu, 10 Jan 2002 09:45:26 -0500 >> From: Andrew Cagney >> > >> > In Emacs .gdbinit I found this: >> > >> > define xreload >> > set $valmask = ((long)1 << gdb_valbits) - 1 >> > set $nonvalbits = gdb_emacs_intbits - gdb_valbits >> > end > > [...] > >> > I think GDB should avoid making this necessary--that it should >> > reread .gdbinit when it reloads the executable. Or there should >> > be a certain user-defined command that will be run after GDB >> > reloads the executable. > >> >> I know there are now things like posthook-run commands. However, >> without knowing how EMACS uses the above (I've no desire to debug emacs, >> debugging mozilla was scary enough :-^) it is hard to suggest a replacement. > > > Here's an example of how this is used: > > define xint > print (($ & $valmask) << $nonvalbits) >> $nonvalbits > end > document xint > Print $, assuming it is an Emacs Lisp integer. This gets the sign right. > end > define xsymbol > print (struct Lisp_Symbol *) ((((int) $) & $valmask) | gdb_data_seg_bits) > output (char*)$->name->data > echo \n > end > document xsymbol > Print the name and address of the symbol $. > This command assumes that $ is an Emacs Lisp symbol value. > end Ok. This suggests that: define hookpost-run set $valmask = ((long)1 << gdb_valbits) - 1 set $nonvalbits = gdb_emacs_intbits - gdb_valbits end should do the trick. Andrew