|
From: | Andrew Cagney |
Subject: | [Fwd: Re: Request/question from RMS] |
Date: | Mon, 14 Jan 2002 00:20:53 -0500 |
User-agent: | Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.7) Gecko/20020103 |
Hello, RMS pointed out that EMACS's GDB startup script contains lines like: > define xreload > set $valmask = ((long)1 << gdb_valbits) - 1 > set $nonvalbits = gdb_emacs_intbits - gdb_valbits > endand was asking about other ways of better handling this. Well new to GDB 5.1 is the hookpost command vis:
define hookpost-run set $valmask = ((long)1 << gdb_valbits) - 1 set $nonvalbits = gdb_emacs_intbits - gdb_valbits end which will be interpreted when ever a ``run'' command is executed.Since this is only new, EMACS may need to hold back on exploiting this though :-/
Andrew
--- Begin Message --- Subject: Re: Request/question from RMS Date: Thu, 10 Jan 2002 19:13:13 -0500 User-agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.7) Gecko/20020103Date: Thu, 10 Jan 2002 09:45:26 -0500From: Andrew Cagney <address@hidden>> 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. endOk. 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
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |