From unknown Mon Jun 23 02:26:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 13:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 61453@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167620694113538 (code B ref -1); Sun, 12 Feb 2023 13:03:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Feb 2023 13:02:21 +0000 Received: from localhost ([127.0.0.1]:44334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRBzo-0003WH-Oo for submit@debbugs.gnu.org; Sun, 12 Feb 2023 08:02:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:44560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRBzm-0003W7-6l for submit@debbugs.gnu.org; Sun, 12 Feb 2023 08:02:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRBzk-00065a-GC for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 08:02:16 -0500 Received: from mx3.muc.de ([193.149.48.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRBze-0006Ow-Eo for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 08:02:14 -0500 Received: (qmail 62939 invoked by uid 3782); 12 Feb 2023 14:01:58 +0100 Received: from acm.muc.de (pd953a525.dip0.t-ipconnect.de [217.83.165.37]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 12 Feb 2023 14:01:57 +0100 Received: (qmail 4890 invoked by uid 1000); 12 Feb 2023 13:01:57 -0000 Date: Sun, 12 Feb 2023 13:01:57 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.5; envelope-from=acm@muc.de; helo=mx3.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hello, Emacs. In a GDB session, whilst debugging Emacs, it is common to want to print, for example, the current value of Lisp variable foo. At the moment, one has to type p foo xpr .. This need, continually to type p (or print) is irritating. It should be possible simply to type xpr foo .. The same applies to many other commands in .gdbinit. The following patch fixes this irritation. It allows a user to type xpr foo, yet also preserves the old version with no arguments, which can be handy, sometimes. I propose this patch be applied to the master branch. diff --git a/etc/DEBUG b/etc/DEBUG index c4f0852abb3..5fa60af2806 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -288,9 +288,10 @@ and where you interact with GDB. ** Examining Lisp object values. When you have a live process to debug, and it has not encountered a -fatal error, you can use the GDB command 'pr'. First print the value -in the ordinary way, with the 'p' command. Then type 'pr' with no -arguments. This calls a subroutine which uses the Lisp printer. +fatal error, you can use the GDB command 'pr'. Just type pr, giving +the object as the argument. (The older method of first printing with +the 'p' command followed by pr without arguments still works.) This +calls a subroutine which uses the Lisp printer. You can also use 'pp value' to print the emacs value directly. @@ -319,8 +320,7 @@ If you can't use 'pr' command, for whatever reason, you can use the 'xpr' command to print out the data type and value of the last data value, For example: - p it->object - xpr + xpr it->object You may also analyze data values using lower-level commands. Use the 'xtype' command to print out the data type of the last data value. @@ -328,10 +328,10 @@ Once you know the data type, use the command that corresponds to that type. Here are these commands: xint xptr xwindow xmarker xoverlay xmiscfree xintfwd xboolfwd xobjfwd - xbufobjfwd xkbobjfwd xbuflocal xbuffer xsymbol xstring xvector xframe - xwinconfig xcompiled xcons xcar xcdr xsubr xprocess xfloat xscrollbar - xchartable xsubchartable xboolvector xhashtable xlist xcoding - xcharset xfontset xfont + xbufobjfwd xkbobjfwd xbuflocal xbuffer xsymbol xsymwithpos xstring + xvector xframe xwinconfig xcompiled xcons xcar xcdr xsubr xprocess + xfloat xscrollbar xchartable xsubchartable xboolvector xhashtable + xlist xcoding xcharset xfontset xfont Each one of them applies to a certain type or class of types. (Some of these types are not visible in Lisp, because they exist only @@ -357,15 +357,13 @@ called frame. First, use these commands: Then Emacs hits the breakpoint: - (gdb) p frame - $1 = 139854428 - (gdb) xpr + (gdb) xpr frame Lisp_Vectorlike PVEC_FRAME - $2 = (struct frame *) 0x8560258 + $1 = (struct frame *) 0x8560258 "emacs@localhost" (gdb) p *$ - $3 = { + $2 = { size = 1073742931, next = 0x85dfe58, name = 140615219, @@ -391,22 +389,19 @@ evaluate expressions like "p XVECTOR (this_command_keys)". When this information isn't available, you can use the xvector command in GDB to get the same result. Here is how: - (gdb) p this_command_keys - $1 = 1078005760 - (gdb) xvector - $2 = (struct Lisp_Vector *) 0x411000 + (gdb) xvector this_command_keys + $1 = (struct Lisp_Vector *) 0x411000 0 (gdb) p $->contents[this_command_key_count] - $3 = 1077872640 + $2 = 1077872640 (gdb) p &$ - $4 = (int *) 0x411008 + $3 = (int *) 0x411008 Here's a related example of macros and the GDB 'define' command. There are many Lisp vectors such as 'recent_keys', which contains the last 300 keystrokes. We can print this Lisp vector - p recent_keys - pr + pr recent_keys But this may be inconvenient, since 'recent_keys' is much more verbose than 'C-h l'. We might want to print only the last 10 elements of @@ -447,8 +442,7 @@ backtrace, and look for stack frames that call Ffuncall. Select them one by one in GDB, by typing "up N", where N is the appropriate number of frames to go up, and in each frame that calls Ffuncall type this: - p *args - pr + pr *args This will print the name of the Lisp function called by that level of function calling. @@ -456,15 +450,13 @@ of function calling. By printing the remaining elements of args, you can see the argument values. Here's how to print the first argument: - p args[1] - pr + pr args[1] If you do not have a live process, you can use xtype and the other x... commands such as xsymbol to get such information, albeit less conveniently. For example: - p *args - xtype + xtype *args and, assuming that "xtype" says that args[0] is a symbol: diff --git a/src/.gdbinit b/src/.gdbinit index c96c2b597bd..65ef9a5684e 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -91,10 +91,15 @@ end # from calling OutputDebugString, which causes GDB to display each # character twice (yuk!). define pr - pp $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + pp $d end document pr -Print the emacs s-expression which is $. +Print the emacs s-expression which is $arg0 or $. Works only when an inferior emacs is executing. end @@ -656,15 +661,20 @@ Takes one argument, a pointer to a glyph_matrix structure. end define xtype - xgettype $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgettype $d output $type echo \n if $type == Lisp_Vectorlike - xvectype + xvectype $d end end document xtype -Print the type of $, assuming it is an Emacs Lisp value. +Print the type of $arg0 or $, assuming it is an Emacs Lisp value. If the first type printed is Lisp_Vectorlike, a second line gives the more precise type. end @@ -684,12 +694,17 @@ Takes one argument, a pointer to an object. end define xvectype - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d pvectype $ptr end document xvectype Print the subtype of vectorlike object. -This command assumes that $ is a Lisp_Object. +This command assumes that $arg0 or $ is a Lisp_Object. end define pvecsize @@ -709,104 +724,159 @@ Takes one argument, a pointer to an object. end define xvecsize - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d pvecsize $ptr end document xvecsize -Print the size of $ -This command assumes that $ is a Lisp_Object. +Print the size of $arg0 or $. +This command assumes that $arg0 or $ is a Lisp_Object. end define xint - xgetint $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetint $d print $int end document xint -Print $ as an Emacs Lisp integer. This gets the sign right. +Print $arg0 or $ as an Emacs Lisp integer. This gets the sign right. end define xptr - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (void *) $ptr end document xptr -Print the pointer portion of an Emacs Lisp value in $. +Print the pointer portion of an Emacs Lisp value in $arg0 or $. end define xmarker - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Marker *) $ptr end document xmarker -Print $ as a marker pointer. +Print $arg0 or $ as a marker pointer. This command assumes that $ is an Emacs Lisp marker value. end define xoverlay - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Overlay *) $ptr end document xoverlay -Print $ as a overlay pointer. -This command assumes that $ is an Emacs Lisp overlay value. +Print $arg0 or $ as a overlay pointer. +This command assumes that $arg0 or $ is an Emacs Lisp overlay value. end define xsymwithpos - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Symbol_With_Pos *) $ptr end document xsymwithpos -Print $ as a symbol with position. -This command assumes that $ is an Emacs Lisp symbol with position value. +Print $arg0 or $ as a symbol with position. +This command assumes that $arg0 or $ is an Emacs Lisp symbol with position value. end define xsymbol - set $sym = $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + set $sym = $d xgetsym $sym print (struct Lisp_Symbol *) $ptr xprintsym $sym echo \n end document xsymbol -Print the name and address of the symbol $. -This command assumes that $ is an Emacs Lisp symbol value. +Print the name and address of the symbol $arg0 or $. +This command assumes that $arg0 or $ is an Emacs Lisp symbol value. end define xstring - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_String *) $ptr xprintstr $ echo \n end document xstring -Print the contents and address of the string $. -This command assumes that $ is an Emacs Lisp string value. +Print the contents and address of the string $arg0 or $. +This command assumes that $arg0 or $ is an Emacs Lisp string value. end define xvector - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Vector *) $ptr output ($->header.size > 50) ? 0 : ($->contents[0])@($->header.size & ~ARRAY_MARK_FLAG) echo \n end document xvector -Print the contents and address of the vector $. -This command assumes that $ is an Emacs Lisp vector value. +Print the contents and address of the vector $arg0 or $. +This command assumes that $arg0 or $ is an Emacs Lisp vector value. end define xprocess - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Process *) $ptr - output *$ + output *$d echo \n end document xprocess -Print the address of the struct Lisp_process to which $ points. -This command assumes that $ is a Lisp_Object. +Print the address of the struct Lisp_process to which $arg0 or $ points. +This command assumes that $arg0 or $ is a Lisp_Object. end define xframe - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct frame *) $ptr xgetptr $->name set $ptr = (struct Lisp_String *) $ptr @@ -814,53 +884,78 @@ define xframe echo \n end document xframe -Print $ as a frame pointer. -This command assumes $ is an Emacs Lisp frame value. +Print $arg0 or $ as a frame pointer. +This command assumes $arg0 or $ is an Emacs Lisp frame value. end define xcompiled - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Vector *) $ptr output ($->contents[0])@($->header.size & 0xff) echo \n end document xcompiled -Print $ as a compiled function pointer. -This command assumes that $ is an Emacs Lisp compiled value. +Print $arg0 or $ as a compiled function pointer. +This command assumes that $arg0 or $ is an Emacs Lisp compiled value. end define xwindow - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct window *) $ptr set $window = (struct window *) $ptr printf "%dx%d+%d+%d\n", $window->total_cols, $window->total_lines, $window->left_col, $window->top_line end document xwindow -Print $ as a window pointer, assuming it is an Emacs Lisp window value. +Print $arg0 or $ as a window pointer, assuming it is an Emacs Lisp window value. Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". end define xwinconfig - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct save_window_data *) $ptr end document xwinconfig -Print $ as a window configuration pointer. -This command assumes that $ is an Emacs Lisp window configuration value. +Print $arg0 or $ as a window configuration pointer. +This command assumes that $arg0 or $ is an Emacs Lisp window configuration value. end define xsubr - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Subr *) $ptr output *$ echo \n end document xsubr -Print the address of the subr which the Lisp_Object $ points to. +Print the address of the subr which the Lisp_Object $arg0 or $ points to. end define xchartable - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Char_Table *) $ptr printf "Purpose: " xprintsym $->purpose @@ -868,65 +963,90 @@ define xchartable echo \n end document xchartable -Print the address of the char-table $, and its purpose. -This command assumes that $ is an Emacs Lisp char-table value. +Print the address of the char-table $arg0 or $, and its purpose. +This command assumes that $arg0 or $ is an Emacs Lisp char-table value. end define xsubchartable - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Sub_Char_Table *) $ptr set $subchartab = (struct Lisp_Sub_Char_Table *) $ptr printf "Depth: %d, Min char: %d (0x%x)\n", $subchartab->depth, $subchartab->min_char, $subchartab->min_char end document xsubchartable -Print the address of the sub-char-table $, its depth and min-char. -This command assumes that $ is an Emacs Lisp sub-char-table value. +Print the address of the sub-char-table $arg0 or $, its depth and min-char. +This command assumes that $arg0 or $ is an Emacs Lisp sub-char-table value. end define xboolvector - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Bool_Vector *) $ptr output ($->size > 256) ? 0 : ($->data[0])@(($->size + BOOL_VECTOR_BITS_PER_CHAR - 1)/ BOOL_VECTOR_BITS_PER_CHAR) echo \n end document xboolvector -Print the contents and address of the bool-vector $. -This command assumes that $ is an Emacs Lisp bool-vector value. +Print the contents and address of the bool-vector $arg0 or $. +This command assumes that $arg0 or $ is an Emacs Lisp bool-vector value. end define xbuffer - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct buffer *) $ptr xgetptr $->name_ output $ptr ? (char *) ((struct Lisp_String *) $ptr)->u.s.data : "DEAD" echo \n end document xbuffer -Set $ as a buffer pointer and the name of the buffer. -This command assumes $ is an Emacs Lisp buffer value. +Set $arg0 or $ as a buffer pointer and the name of the buffer. +This command assumes $arg0 or $ is an Emacs Lisp buffer value. end define xhashtable - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Hash_Table *) $ptr end document xhashtable -Set $ as a hash table pointer. -This command assumes that $ is an Emacs Lisp hash table value. +Set $arg0 or $ as a hash table pointer. +This command assumes that $arg0 or $ is an Emacs Lisp hash table value. end define xcons - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Cons *) $ptr output/x *$ echo \n end document xcons -Print the contents of $ as an Emacs Lisp cons. +Print the contents of $arg0 or $ as an Emacs Lisp cons. end define nextcons - p $.u.cdr + p $.u.s.u.cdr xcons end document nextcons @@ -935,25 +1055,40 @@ This command assumes that the last thing you printed was a cons cell contents (type struct Lisp_Cons) or a pointer to one. end define xcar - xgetptr $ - xgettype $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d + xgettype $d print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.s.car : 0) end document xcar -Assume that $ is an Emacs Lisp pair and print its car. +Assume that $arg0 or $ is an Emacs Lisp pair and print its car. end define xcdr - xgetptr $ - xgettype $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d + xgettype $d print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.s.u.cdr : 0) end document xcdr -Assume that $ is an Emacs Lisp pair and print its cdr. +Assume that $arg0 or $ is an Emacs Lisp pair and print its cdr. end define xlist - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d set $cons = (struct Lisp_Cons *) $ptr xgetptr Qnil set $nil = $ptr @@ -974,97 +1109,112 @@ define xlist end end document xlist -Print $ assuming it is a list. +Print $arg0 or $ assuming it is a list. end define xfloat - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print ((struct Lisp_Float *) $ptr)->u.data end document xfloat -Print $ assuming it is a lisp floating-point number. +Print $arg0 or $ assuming it is a lisp floating-point number. end define xscrollbar - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct scrollbar *) $ptr -output *$ +output *$d echo \n end document xscrollbar -Print $ as a scrollbar pointer. +Print $arg0 or $ as a scrollbar pointer. end define xpr - xtype + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xtype $d if $type == Lisp_Int0 || $type == Lisp_Int1 - xint + xint $d end if $type == Lisp_Symbol - xsymbol + xsymbol $d end if $type == Lisp_String - xstring + xstring $d end if $type == Lisp_Cons - xcons + xcons $d end if $type == Lisp_Float - xfloat + xfloat $d end if $type == Lisp_Vectorlike set $size = ((struct Lisp_Vector *) $ptr)->header.size if ($size & PSEUDOVECTOR_FLAG) set $vec = (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS) if $vec == PVEC_NORMAL_VECTOR - xvector + xvector $d end if $vec == PVEC_MARKER - xmarker + xmarker $d end if $vec == PVEC_OVERLAY - xoverlay + xoverlay $d end if $vec == PVEC_SYMBOL_WITH_POS - xsymwithpos + xsymwithpos $d end if $vec == PVEC_PROCESS - xprocess + xprocess $d end if $vec == PVEC_FRAME - xframe + xframe $d end if $vec == PVEC_COMPILED - xcompiled + xcompiled $d end if $vec == PVEC_WINDOW - xwindow + xwindow $d end if $vec == PVEC_WINDOW_CONFIGURATION - xwinconfig + xwinconfig $d end if $vec == PVEC_SUBR - xsubr + xsubr $d end if $vec == PVEC_CHAR_TABLE - xchartable + xchartable $d end if $vec == PVEC_BOOL_VECTOR - xboolvector + xboolvector $d end if $vec == PVEC_BUFFER - xbuffer + xbuffer $d end if $vec == PVEC_HASH_TABLE - xhashtable + xhashtable $d end else - xvector + xvector $d end end end document xpr -Print $ as a lisp object of any type. +Print $arg0 or $ as a lisp object of any type. end define xprintstr @@ -1118,7 +1268,12 @@ document xcharset end define xfontset - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d set $tbl = (struct Lisp_Char_Table *) $ptr print $tbl xgetint $tbl->extras[0] @@ -1141,7 +1296,12 @@ define xfontset end define xfont - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d set $size = (((struct Lisp_Vector *) $ptr)->header.size & 0x1FF) if $size == FONT_SPEC_MAX print (struct font_spec *) $ptr @@ -1154,7 +1314,7 @@ define xfont end end document xfont -Print $ assuming it is a list font (font-spec, font-entity, or font-object). +Print $arg0 or $ assuming it is a list font (font-spec, font-entity, or font-object). end define xbacktrace -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 23 02:26:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 13:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 61453@debbugs.gnu.org Received: via spool by 61453-submit@debbugs.gnu.org id=B61453.167620736514248 (code B ref 61453); Sun, 12 Feb 2023 13:10:01 +0000 Received: (at 61453) by debbugs.gnu.org; 12 Feb 2023 13:09:25 +0000 Received: from localhost ([127.0.0.1]:44351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRC6f-0003hi-5w for submit@debbugs.gnu.org; Sun, 12 Feb 2023 08:09:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRC6d-0003hU-Qk for 61453@debbugs.gnu.org; Sun, 12 Feb 2023 08:09:24 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRC6Y-0008KT-D8; Sun, 12 Feb 2023 08:09:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Kt3MLzavzQVypF7qgV4EJqEypKYQ7W8xSabTDWGII5E=; b=lgr0+wF7trHc wWkbT8jE4YFHzUK0li07iyPE7FOJMlWLg6Kz1/BNxsDJYaWwkwVEm3mSCLQQ7qeJYh+gAKAqcY6Pl gSAvp5xEzy0U+u9Vy7K83ogA17Fwp39xLfRhaiZ379e4W8pnBJvuRaAz3/Rvpq3Uoc3/nwJvuzXll jinWVT/YyUfCbgSEHzObmES5VJAS2MjvR7yrsT5MsI/E7jZPIJvsa2EFPbFfxs6Rwd4jepApKd6u2 AAAefPx88f80haOmzc7Wko47QdZ5Bvrb8ZjdVfSXzWWJCawqcY2BaP2+szEHd5kF60kZKWUTYqeHJ qZfxfM4DyFBc0U/KirDsEw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRC6X-0005IR-TV; Sun, 12 Feb 2023 08:09:18 -0500 Date: Sun, 12 Feb 2023 15:08:52 +0200 Message-Id: <83mt5jghej.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Alan Mackenzie on Sun, 12 Feb 2023 13:01:57 +0000) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 12 Feb 2023 13:01:57 +0000 > From: Alan Mackenzie > > In a GDB session, whilst debugging Emacs, it is common to want to print, > for example, the current value of Lisp variable foo. At the moment, one > has to type > > p foo > xpr > > .. This need, continually to type p (or print) is irritating. It should > be possible simply to type > > xpr foo > > .. The same applies to many other commands in .gdbinit. > > The following patch fixes this irritation. It allows a user to type xpr > foo, yet also preserves the old version with no arguments, which can be > handy, sometimes. > > I propose this patch be applied to the master branch. What's wrong with the existing "pp" command? I think it covers all your needs, and doesn't need any changes to existing xFOO commands. From unknown Mon Jun 23 02:26:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 13:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 61453@debbugs.gnu.org Received: via spool by 61453-submit@debbugs.gnu.org id=B61453.167620888616788 (code B ref 61453); Sun, 12 Feb 2023 13:35:01 +0000 Received: (at 61453) by debbugs.gnu.org; 12 Feb 2023 13:34:46 +0000 Received: from localhost ([127.0.0.1]:44377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRCVC-0004Mh-Ck for submit@debbugs.gnu.org; Sun, 12 Feb 2023 08:34:46 -0500 Received: from mx3.muc.de ([193.149.48.5]:24863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRCVA-0004MW-C6 for 61453@debbugs.gnu.org; Sun, 12 Feb 2023 08:34:45 -0500 Received: (qmail 77207 invoked by uid 3782); 12 Feb 2023 14:34:36 +0100 Received: from acm.muc.de (pd953a525.dip0.t-ipconnect.de [217.83.165.37]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 12 Feb 2023 14:34:36 +0100 Received: (qmail 5061 invoked by uid 1000); 12 Feb 2023 13:34:36 -0000 Date: Sun, 12 Feb 2023 13:34:36 +0000 Message-ID: References: <83mt5jghej.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83mt5jghej.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Sun, Feb 12, 2023 at 15:08:52 +0200, Eli Zaretskii wrote: > > Date: Sun, 12 Feb 2023 13:01:57 +0000 > > From: Alan Mackenzie > > In a GDB session, whilst debugging Emacs, it is common to want to print, > > for example, the current value of Lisp variable foo. At the moment, one > > has to type > > p foo > > xpr > > .. This need, continually to type p (or print) is irritating. It should > > be possible simply to type > > xpr foo > > .. The same applies to many other commands in .gdbinit. > > The following patch fixes this irritation. It allows a user to type xpr > > foo, yet also preserves the old version with no arguments, which can be > > handy, sometimes. > > I propose this patch be applied to the master branch. > What's wrong with the existing "pp" command? I think it covers all > your needs, and doesn't need any changes to existing xFOO commands. The pp comand does nothing on my setup except for scrolling the gdb window up one line. Its help text says "Works only when an inferior emacs is executing.". I normally start the target Emacs on a separate Linux console, then attach it to my gdb session with the attach command. I don't really know what "an inferior emacs" means, though I'm sure I could find out if I read etc/DEBUG more carefully. Besides, even if pp worked for me, there will be times when the other commands will be handy (otherwise they wouldn't be there). I've never actually used pp. I use xpr all the time. Incidentally, I sneaked in a correction to nextcons which currently has: p $.u.cdr , and which (presumably) since a change in lisp.h needs to be p $.u.s.u.cdr .. I don't understand why we have members car and cdr wrapped in so many unions and structs. So, I still think my patch would be a good idea. -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 23 02:26:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 14:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 61453@debbugs.gnu.org Received: via spool by 61453-submit@debbugs.gnu.org id=B61453.167621069120016 (code B ref 61453); Sun, 12 Feb 2023 14:05:02 +0000 Received: (at 61453) by debbugs.gnu.org; 12 Feb 2023 14:04:51 +0000 Received: from localhost ([127.0.0.1]:44402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRCyJ-0005Cm-6w for submit@debbugs.gnu.org; Sun, 12 Feb 2023 09:04:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRCyH-0005CZ-Ps for 61453@debbugs.gnu.org; Sun, 12 Feb 2023 09:04:50 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRCyB-00027I-Vt; Sun, 12 Feb 2023 09:04:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Idb1fPo6MHgLVzDHysKBDBSpuOimsHYeKkjBMAFFIHw=; b=Y4bD02dHbSXi cNhvYxLl5dwMvstATQTax3dRzljujVrF4psgexZru6oILWWzjtrul9y1Z+OO18gZTLAA5VsiR+M15 GzMdawjFvndQopL1UvMkGmD/uyWSJZ/bpgGXKOk4sSPNkfWW//Chk1aZBX+OUNCBlVMegFIfnOww8 jyiYPjtqHDxCHqATqMB2AfTBVUILxpPkyyaPHf6g5AYSJyrD+ueEgIpvfaDxNBHENe5nQcVtVtRKd D4sENDy2vijSAsQwLz9qJdryDLBmOPobU07KhBnj9ADgpwfxBvU/YSuEe0hpSapheU8zMCZpKsTcV TpvH++0J+XOYAeW5Erafow==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRCyA-0000EI-VQ; Sun, 12 Feb 2023 09:04:43 -0500 Date: Sun, 12 Feb 2023 16:04:15 +0200 Message-Id: <83k00ngeu8.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Alan Mackenzie on Sun, 12 Feb 2023 13:34:36 +0000) References: <83mt5jghej.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 12 Feb 2023 13:34:36 +0000 > Cc: 61453@debbugs.gnu.org > From: Alan Mackenzie > > > What's wrong with the existing "pp" command? I think it covers all > > your needs, and doesn't need any changes to existing xFOO commands. > > The pp comand does nothing on my setup except for scrolling the gdb > window up one line. Its help text says "Works only when an inferior > emacs is executing.". I normally start the target Emacs on a separate > Linux console, then attach it to my gdb session with the attach command. > I don't really know what "an inferior emacs" means, though I'm sure I > could find out if I read etc/DEBUG more carefully. You do need to have a running Emacs for "pp", but if you attach to a running Emacs, you already have that. I guess the problem is that the output of "pp" goes to the same display as the one Emacs uses, since you are running a -nw session, right? Maybe you should try "set new-console 1", or start GDB on a separate console (if that is possible with the console you are using). > So, I still think my patch would be a good idea. But does it really work? You use $arg0, but that means you cannot have an arbitrary expression as an argument, and have to be very cautious with blanks and other delimiters, because GDB could decide that $arg0 is just part of the argument. Observe: (gdb) define foo > print $arg0 > end (gdb) foo 1 + 2 + 3 $1 = 1 But (gdb) print 1 + 2 + 3 $2 = 6 and (gdb) p Vmost_positive_fixnum - 1 $1 = 6917529027641081854 (gdb) xint $2 = 2305843009213693950 So the existing commands accept/interpret arbitrary expressions, whereas your changed commands will not necessarily do so. Which means they can silently produce incorrect results, and the user will be none the wiser. From unknown Mon Jun 23 02:26:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 14:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: acm@muc.de, 61453@debbugs.gnu.org Received: via spool by 61453-submit@debbugs.gnu.org id=B61453.167621296823596 (code B ref 61453); Sun, 12 Feb 2023 14:43:01 +0000 Received: (at 61453) by debbugs.gnu.org; 12 Feb 2023 14:42:48 +0000 Received: from localhost ([127.0.0.1]:44442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRDZ2-00068V-2L for submit@debbugs.gnu.org; Sun, 12 Feb 2023 09:42:48 -0500 Received: from mx3.muc.de ([193.149.48.5]:26853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRDYz-00068H-Pb for 61453@debbugs.gnu.org; Sun, 12 Feb 2023 09:42:46 -0500 Received: (qmail 21101 invoked by uid 3782); 12 Feb 2023 15:42:39 +0100 Received: from acm.muc.de (pd953a525.dip0.t-ipconnect.de [217.83.165.37]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 12 Feb 2023 15:42:39 +0100 Received: (qmail 9685 invoked by uid 1000); 12 Feb 2023 14:42:38 -0000 Date: Sun, 12 Feb 2023 14:42:38 +0000 Message-ID: References: <83mt5jghej.fsf@gnu.org> <83k00ngeu8.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83k00ngeu8.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Sun, Feb 12, 2023 at 16:04:15 +0200, Eli Zaretskii wrote: > > Date: Sun, 12 Feb 2023 13:34:36 +0000 > > Cc: 61453@debbugs.gnu.org > > From: Alan Mackenzie > > > What's wrong with the existing "pp" command? I think it covers all > > > your needs, and doesn't need any changes to existing xFOO commands. > > The pp comand does nothing on my setup except for scrolling the gdb > > window up one line. Its help text says "Works only when an inferior > > emacs is executing.". I normally start the target Emacs on a separate > > Linux console, then attach it to my gdb session with the attach command. > > I don't really know what "an inferior emacs" means, though I'm sure I > > could find out if I read etc/DEBUG more carefully. I've looked at the pp command, and I think it is only capable of displaying objects from within the Lisp environment; it won't display Lisp_Object's in the C environment. If that's the case, it wouldn't cover all my needs. > You do need to have a running Emacs for "pp", but if you attach to a > running Emacs, you already have that. I guess the problem is that the > output of "pp" goes to the same display as the one Emacs uses, ..... I have an Emacs running gdb, and a seperate "target" Emacs, the one being debugged. I'm not sure which one you mean as "... the one Emacs uses". > .... since you are running a -nw session, right? Maybe you should try > "set new-console 1", or start GDB on a separate console (if that is > possible with the console you are using). No, I'm running on Linux consoles, without the -nw. It might be possible to start GDB in a third console, but it would be awkward. > > So, I still think my patch would be a good idea. > But does it really work? You use $arg0, but that means you cannot > have an arbitrary expression as an argument, and have to be very > cautious with blanks and other delimiters, because GDB could decide > that $arg0 is just part of the argument. Thanks, that's a good point I wasn't aware of. One way out of that would be to test gdb's $argc is exactly 1, and throw an error message if not. Presumably, there will be some way to quote arguments to gdb functions, I'll have to read the fine manual a bit more closely. > Observe: > (gdb) define foo > > print $arg0 > > end > (gdb) foo 1 + 2 + 3 > $1 = 1 > But > (gdb) print 1 + 2 + 3 > $2 = 6 > and > (gdb) p Vmost_positive_fixnum - 1 > $1 = 6917529027641081854 > (gdb) xint > $2 = 2305843009213693950 > So the existing commands accept/interpret arbitrary expressions, > whereas your changed commands will not necessarily do so. Which means > they can silently produce incorrect results, and the user will be none > the wiser. As I said, I could test $argc == 1. Most of the time, users are not going to be giving "multi" arguments to the gdb commands, are they? -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 23 02:26:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 14:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: acm@muc.de, 61453@debbugs.gnu.org Received: via spool by 61453-submit@debbugs.gnu.org id=B61453.167621338924501 (code B ref 61453); Sun, 12 Feb 2023 14:50:01 +0000 Received: (at 61453) by debbugs.gnu.org; 12 Feb 2023 14:49:49 +0000 Received: from localhost ([127.0.0.1]:44459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRDfo-0006N7-On for submit@debbugs.gnu.org; Sun, 12 Feb 2023 09:49:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRDfn-0006Mu-J7 for 61453@debbugs.gnu.org; Sun, 12 Feb 2023 09:49:48 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRDfi-00020t-6F; Sun, 12 Feb 2023 09:49:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NjjzVOVrtLn+tiYj/T/pjbvvPNvIDQDn4ZrnQOxMrBc=; b=HChKMUtcQSSP vE5Ov0ab+My1svJfJ/qJ4Ew6/jwCDdfjx4NQbWNESa2Daj1vVnwS2CbFRnQHMPlFZrzgt1aKlSeIf 2YylHTkfLHFkb5c2OyKLHD7Obfoauo8ZMVB/UaohL9LDw9xoa9CbQcBNsy08VAzynxoBt0QYO+pYG r3XC1pM1hUSLT5KLnTOwFy97rp7SEhH550KwBopZtZwdp+p1uVtyUDT1Uk1FAiRNqZxysbir/CiYd nTEiBYqMC64gqX0K7ZPX8k9oDoj5sXs+ag4jYAwLXtJG6rZA4X88G//eedyyHbOVIwZA2jGQqZKTd KJ2gfQ+AYmH9FaZ5Zw60OQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRDfg-0000SR-HP; Sun, 12 Feb 2023 09:49:40 -0500 Date: Sun, 12 Feb 2023 16:49:13 +0200 Message-Id: <83fsbbgcra.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Alan Mackenzie on Sun, 12 Feb 2023 14:42:38 +0000) References: <83mt5jghej.fsf@gnu.org> <83k00ngeu8.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 12 Feb 2023 14:42:38 +0000 > Cc: 61453@debbugs.gnu.org, acm@muc.de > From: Alan Mackenzie > > I've looked at the pp command, and I think it is only capable of > displaying objects from within the Lisp environment; it won't display > Lisp_Object's in the C environment. Nonsense, I use it every day when debugging the C code. The GDB command "pp" can display any Lisp object defined by a C expression. > > You do need to have a running Emacs for "pp", but if you attach to a > > running Emacs, you already have that. I guess the problem is that the > > output of "pp" goes to the same display as the one Emacs uses, ..... > > I have an Emacs running gdb, and a seperate "target" Emacs, the one being > debugged. I'm not sure which one you mean as "... the one Emacs uses". I mean the Emacs you debug. > > But does it really work? You use $arg0, but that means you cannot > > have an arbitrary expression as an argument, and have to be very > > cautious with blanks and other delimiters, because GDB could decide > > that $arg0 is just part of the argument. > > Thanks, that's a good point I wasn't aware of. One way out of that would > be to test gdb's $argc is exactly 1, and throw an error message if not. How will this help? You will ask people to deliberately remove any delimiters from what they type? That's a terrible annoyance. It means, for example, that you cannot simply copy/paste code fragments. > Presumably, there will be some way to quote arguments to gdb functions, > I'll have to read the fine manual a bit more closely. Even if there are such quoting methods (I'm not sure), using them will be a significant annoyance. From unknown Mon Jun 23 02:26:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 16:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: acm@muc.de, 61453@debbugs.gnu.org Received: via spool by 61453-submit@debbugs.gnu.org id=B61453.16762184982260 (code B ref 61453); Sun, 12 Feb 2023 16:15:01 +0000 Received: (at 61453) by debbugs.gnu.org; 12 Feb 2023 16:14:58 +0000 Received: from localhost ([127.0.0.1]:46496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRF0E-0000aO-1h for submit@debbugs.gnu.org; Sun, 12 Feb 2023 11:14:58 -0500 Received: from mx3.muc.de ([193.149.48.5]:29487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRF0C-0000a8-0f for 61453@debbugs.gnu.org; Sun, 12 Feb 2023 11:14:56 -0500 Received: (qmail 56677 invoked by uid 3782); 12 Feb 2023 17:14:50 +0100 Received: from acm.muc.de (pd953a525.dip0.t-ipconnect.de [217.83.165.37]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 12 Feb 2023 17:14:49 +0100 Received: (qmail 10330 invoked by uid 1000); 12 Feb 2023 16:14:49 -0000 Date: Sun, 12 Feb 2023 16:14:49 +0000 Message-ID: References: <83mt5jghej.fsf@gnu.org> <83k00ngeu8.fsf@gnu.org> <83fsbbgcra.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83fsbbgcra.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Sun, Feb 12, 2023 at 16:49:13 +0200, Eli Zaretskii wrote: > > Date: Sun, 12 Feb 2023 14:42:38 +0000 > > Cc: 61453@debbugs.gnu.org, acm@muc.de > > From: Alan Mackenzie > > I've looked at the pp command, and I think it is only capable of > > displaying objects from within the Lisp environment; it won't display > > Lisp_Object's in the C environment. > Nonsense, I use it every day when debugging the C code. The GDB > command "pp" can display any Lisp object defined by a C expression. OK, thanks! I see now that pp was producing output, but like you say, on the target Emacs (in an untidy way), not on the debugging Emacs. > > > You do need to have a running Emacs for "pp", but if you attach to a > > > running Emacs, you already have that. I guess the problem is that the > > > output of "pp" goes to the same display as the one Emacs uses, ..... > > I have an Emacs running gdb, and a seperate "target" Emacs, the one being > > debugged. I'm not sure which one you mean as "... the one Emacs uses". > I mean the Emacs you debug. Thanks. > > > But does it really work? You use $arg0, but that means you cannot > > > have an arbitrary expression as an argument, and have to be very > > > cautious with blanks and other delimiters, because GDB could decide > > > that $arg0 is just part of the argument. > > Thanks, that's a good point I wasn't aware of. One way out of that would > > be to test gdb's $argc is exactly 1, and throw an error message if not. > How will this help? You will ask people to deliberately remove any > delimiters from what they type? That's a terrible annoyance. It > means, for example, that you cannot simply copy/paste code fragments. It seems that the same problem exists with pp. It transfers $arg0 to the target Emacs and ignores any further arguments. It seems the overwhelming bulk of the use of all these commands is for just a single argument. It is certainly so for the bulk of the commands I've amended. I'm not removing any facilities here, so people can continue to use print followed by, say, xpr with no arguments, when that's appropriate. Most of the time, xpr will work just fine. > > Presumably, there will be some way to quote arguments to gdb functions, > > I'll have to read the fine manual a bit more closely. I've experimented with "if $argc > 1 printf "Error message.\n", which seems to work OK. > Even if there are such quoting methods (I'm not sure), using them will > be a significant annoyance. Having to use print to print out something nobody's interested in, which takes up two lines in the gdb window, is a significant annoyance. Otherwise I wouldn't have invested several hours in trying to fix it. -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 23 02:26:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 16:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 61453@debbugs.gnu.org Received: via spool by 61453-submit@debbugs.gnu.org id=B61453.16762198784523 (code B ref 61453); Sun, 12 Feb 2023 16:38:01 +0000 Received: (at 61453) by debbugs.gnu.org; 12 Feb 2023 16:37:58 +0000 Received: from localhost ([127.0.0.1]:46510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRFMU-0001As-GR for submit@debbugs.gnu.org; Sun, 12 Feb 2023 11:37:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRFMS-0001Af-5E for 61453@debbugs.gnu.org; Sun, 12 Feb 2023 11:37:57 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRFMM-00059E-CL; Sun, 12 Feb 2023 11:37:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=aY/IN5tRV3lCMT+TD/HXRjuhgwXkzeEn3/W/E2tJbZw=; b=OsWXK7OGtq+K +Quc+Pjqo/IuH50ZsDPuUDePSaD2qjc5c5WeR0L1zYsb6zbJb1jKZOVw7u8ICdHy1vm0w6cdu8fqG 8jcrO/TKGldSoCZlr/vo7TGgYBgeYScdJLRULqye+lPtV+Oqqf8zP3a2E1PBLviUfii9J9QIRGYCN ydcLxmICu2+ZLauNcDnRf13mPCRYO3Abyjk70YpV/IheKJeIGnoDKO1/JAhLNskTKqmyepf0v3gaV MylfyNRUFo8cS2dgSYX9Bks4flAPXqzW1w/5MTMgVVJPxNNZ9fDUAV9Vqp2siQKq4HJfZjlT7z199 9tUi6Waoxi+VL0CiATdYvw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRFML-0005QA-Hf; Sun, 12 Feb 2023 11:37:49 -0500 Date: Sun, 12 Feb 2023 18:37:22 +0200 Message-Id: <838rh2hmbh.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Alan Mackenzie on Sun, 12 Feb 2023 16:14:49 +0000) References: <83mt5jghej.fsf@gnu.org> <83k00ngeu8.fsf@gnu.org> <83fsbbgcra.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 12 Feb 2023 16:14:49 +0000 > Cc: 61453@debbugs.gnu.org, acm@muc.de > From: Alan Mackenzie > > > How will this help? You will ask people to deliberately remove any > > delimiters from what they type? That's a terrible annoyance. It > > means, for example, that you cannot simply copy/paste code fragments. > > It seems that the same problem exists with pp. Which is why we also have "pr". From unknown Mon Jun 23 02:26:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 18:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: acm@muc.de, 61453@debbugs.gnu.org Received: via spool by 61453-submit@debbugs.gnu.org id=B61453.167622622516018 (code B ref 61453); Sun, 12 Feb 2023 18:24:02 +0000 Received: (at 61453) by debbugs.gnu.org; 12 Feb 2023 18:23:45 +0000 Received: from localhost ([127.0.0.1]:46713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRH0r-0004AH-94 for submit@debbugs.gnu.org; Sun, 12 Feb 2023 13:23:45 -0500 Received: from mx3.muc.de ([193.149.48.5]:33191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRH0o-00049x-EQ for 61453@debbugs.gnu.org; Sun, 12 Feb 2023 13:23:43 -0500 Received: (qmail 99962 invoked by uid 3782); 12 Feb 2023 19:23:36 +0100 Received: from acm.muc.de (pd953a525.dip0.t-ipconnect.de [217.83.165.37]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 12 Feb 2023 19:23:36 +0100 Received: (qmail 10998 invoked by uid 1000); 12 Feb 2023 18:23:36 -0000 Date: Sun, 12 Feb 2023 18:23:36 +0000 Message-ID: References: <83mt5jghej.fsf@gnu.org> <83k00ngeu8.fsf@gnu.org> <83fsbbgcra.fsf@gnu.org> <838rh2hmbh.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <838rh2hmbh.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Sun, Feb 12, 2023 at 18:37:22 +0200, Eli Zaretskii wrote: > > Date: Sun, 12 Feb 2023 16:14:49 +0000 > > Cc: 61453@debbugs.gnu.org, acm@muc.de > > From: Alan Mackenzie > > > How will this help? You will ask people to deliberately remove any > > > delimiters from what they type? That's a terrible annoyance. It > > > means, for example, that you cannot simply copy/paste code fragments. > > It seems that the same problem exists with pp. > Which is why we also have "pr". OK, but that doesn't help with the annoyance in xpr and friends. Anybody typing an expression with spaces into xpr can continue to use print followed by xpr without arguments. For the usual case, when there's exactly one argument, my patch resolves the annoyance. It now handles the $argc > 1 case as an error. So, why not install this patch in master, now? -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 23 02:26:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 18:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 61453@debbugs.gnu.org Received: via spool by 61453-submit@debbugs.gnu.org id=B61453.167622682117231 (code B ref 61453); Sun, 12 Feb 2023 18:34:02 +0000 Received: (at 61453) by debbugs.gnu.org; 12 Feb 2023 18:33:41 +0000 Received: from localhost ([127.0.0.1]:46724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRHAS-0004Tr-OG for submit@debbugs.gnu.org; Sun, 12 Feb 2023 13:33:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRHAR-0004Ta-9E for 61453@debbugs.gnu.org; Sun, 12 Feb 2023 13:33:39 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRHAL-0003N6-Py; Sun, 12 Feb 2023 13:33:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=x7ai9NzvQUwzeLfZg2djBi0lmSGWBhHq1/JAUC1KZUI=; b=qxCDj8An0Kq8 J0Mn8TohvSLMtF5LK2IzxN2TP6lL+ayfgzDxfkBcoHydWXYZq+eYCAUMdWKzR30zTh2ALCFS0qAl0 eo/Sd69PZdgGJ0DuqShhm52FBSa/33gecvcPpVhKbLYdh28yNs1UZ2Wt3OYE070JCGk6nynzWCLQC i3qxIrQbO2Xlm9oFeV4P9QVCEf7PpxovJkx2d6fuDzLaU1xj5pt2W/2gnE2csp5QFL8lyDAPck9hi TpiQK3t9Cd3Aial2h/RLTlUQB48kBuJQ7r3sZNAuYkpPRByIstdjbkfNt+eqxVNnx2tbsgXlnOY2K ofFmj6YPQLUuMUCjy48nmg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRHAL-0007eT-9j; Sun, 12 Feb 2023 13:33:33 -0500 Date: Sun, 12 Feb 2023 20:33:07 +0200 Message-Id: <831qmuhgyk.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Alan Mackenzie on Sun, 12 Feb 2023 18:23:36 +0000) References: <83mt5jghej.fsf@gnu.org> <83k00ngeu8.fsf@gnu.org> <83fsbbgcra.fsf@gnu.org> <838rh2hmbh.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 12 Feb 2023 18:23:36 +0000 > Cc: 61453@debbugs.gnu.org, acm@muc.de > From: Alan Mackenzie > > > Which is why we also have "pr". > > OK, but that doesn't help with the annoyance in xpr and friends. > Anybody typing an expression with spaces into xpr can continue to use > print followed by xpr without arguments. For the usual case, when > there's exactly one argument, my patch resolves the annoyance. It now > handles the $argc > 1 case as an error. > > So, why not install this patch in master, now? I don't like it, sorry. It is not clean enough, and it goes against the overall consistency of the commands we have in src/.gdbinit. You can always have any commands you want in your own ~/.gdbinit. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 12 13:56:53 2023 Received: (at control) by debbugs.gnu.org; 12 Feb 2023 18:56:53 +0000 Received: from localhost ([127.0.0.1]:46754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRHWu-0005Hs-Ol for submit@debbugs.gnu.org; Sun, 12 Feb 2023 13:56:52 -0500 Received: from mx3.muc.de ([193.149.48.5]:34179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRHWs-0005HX-KP for control@debbugs.gnu.org; Sun, 12 Feb 2023 13:56:51 -0500 Received: (qmail 13386 invoked by uid 3782); 12 Feb 2023 19:56:44 +0100 Received: from acm.muc.de (pd953a525.dip0.t-ipconnect.de [217.83.165.37]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 12 Feb 2023 19:56:44 +0100 Received: (qmail 11188 invoked by uid 1000); 12 Feb 2023 18:56:44 -0000 Date: Sun, 12 Feb 2023 18:56:44 +0000 To: Eli Zaretskii Subject: Re: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Message-ID: References: <83mt5jghej.fsf@gnu.org> <83k00ngeu8.fsf@gnu.org> <83fsbbgcra.fsf@gnu.org> <838rh2hmbh.fsf@gnu.org> <831qmuhgyk.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <831qmuhgyk.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: acm@muc.de, 61453-done@debbugs.gnu.org, control@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 61453 wontfix quit Hello, Eli. On Sun, Feb 12, 2023 at 20:33:07 +0200, Eli Zaretskii wrote: > > Date: Sun, 12 Feb 2023 18:23:36 +0000 > > Cc: 61453@debbugs.gnu.org, acm@muc.de > > From: Alan Mackenzie > > > Which is why we also have "pr". > > OK, but that doesn't help with the annoyance in xpr and friends. > > Anybody typing an expression with spaces into xpr can continue to use > > print followed by xpr without arguments. For the usual case, when > > there's exactly one argument, my patch resolves the annoyance. It now > > handles the $argc > 1 case as an error. > > So, why not install this patch in master, now? > I don't like it, sorry. It is not clean enough, and it goes against > the overall consistency of the commands we have in src/.gdbinit. That's a shame. We should be able to do better with this sort of thing. > You can always have any commands you want in your own ~/.gdbinit. Yes, but that doesn't help other people. I'm closing the bug as won't fix. I'll also commit a fix for that other bug I mentioned earlier. -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 23 02:26:43 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Alan Mackenzie Subject: bug#61453: closed (Re: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command.) Message-ID: References: X-Gnu-PR-Message: they-closed 61453 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: wontfix Reply-To: 61453@debbugs.gnu.org Date: Sun, 12 Feb 2023 18:57:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1676228223-20362-1" This is a multi-part message in MIME format... ------------=_1676228223-20362-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #61453: It is annoying to have to type 'print foo' before each .gdbinit com= mand. which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 61453@debbugs.gnu.org. --=20 61453: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D61453 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1676228223-20362-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 61453-done) by debbugs.gnu.org; 12 Feb 2023 18:56:54 +0000 Received: from localhost ([127.0.0.1]:46756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRHWw-0005I0-19 for submit@debbugs.gnu.org; Sun, 12 Feb 2023 13:56:54 -0500 Received: from mx3.muc.de ([193.149.48.5]:34178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRHWs-0005HW-KO for 61453-done@debbugs.gnu.org; Sun, 12 Feb 2023 13:56:51 -0500 Received: (qmail 13385 invoked by uid 3782); 12 Feb 2023 19:56:44 +0100 Received: from acm.muc.de (pd953a525.dip0.t-ipconnect.de [217.83.165.37]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 12 Feb 2023 19:56:44 +0100 Received: (qmail 11188 invoked by uid 1000); 12 Feb 2023 18:56:44 -0000 Date: Sun, 12 Feb 2023 18:56:44 +0000 To: Eli Zaretskii Subject: Re: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Message-ID: References: <83mt5jghej.fsf@gnu.org> <83k00ngeu8.fsf@gnu.org> <83fsbbgcra.fsf@gnu.org> <838rh2hmbh.fsf@gnu.org> <831qmuhgyk.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <831qmuhgyk.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61453-done Cc: acm@muc.de, 61453-done@debbugs.gnu.org, control@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 61453 wontfix quit Hello, Eli. On Sun, Feb 12, 2023 at 20:33:07 +0200, Eli Zaretskii wrote: > > Date: Sun, 12 Feb 2023 18:23:36 +0000 > > Cc: 61453@debbugs.gnu.org, acm@muc.de > > From: Alan Mackenzie > > > Which is why we also have "pr". > > OK, but that doesn't help with the annoyance in xpr and friends. > > Anybody typing an expression with spaces into xpr can continue to use > > print followed by xpr without arguments. For the usual case, when > > there's exactly one argument, my patch resolves the annoyance. It now > > handles the $argc > 1 case as an error. > > So, why not install this patch in master, now? > I don't like it, sorry. It is not clean enough, and it goes against > the overall consistency of the commands we have in src/.gdbinit. That's a shame. We should be able to do better with this sort of thing. > You can always have any commands you want in your own ~/.gdbinit. Yes, but that doesn't help other people. I'm closing the bug as won't fix. I'll also commit a fix for that other bug I mentioned earlier. -- Alan Mackenzie (Nuremberg, Germany). ------------=_1676228223-20362-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 12 Feb 2023 13:02:21 +0000 Received: from localhost ([127.0.0.1]:44334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRBzo-0003WH-Oo for submit@debbugs.gnu.org; Sun, 12 Feb 2023 08:02:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:44560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRBzm-0003W7-6l for submit@debbugs.gnu.org; Sun, 12 Feb 2023 08:02:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRBzk-00065a-GC for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 08:02:16 -0500 Received: from mx3.muc.de ([193.149.48.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRBze-0006Ow-Eo for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 08:02:14 -0500 Received: (qmail 62939 invoked by uid 3782); 12 Feb 2023 14:01:58 +0100 Received: from acm.muc.de (pd953a525.dip0.t-ipconnect.de [217.83.165.37]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 12 Feb 2023 14:01:57 +0100 Received: (qmail 4890 invoked by uid 1000); 12 Feb 2023 13:01:57 -0000 Date: Sun, 12 Feb 2023 13:01:57 +0000 To: bug-gnu-emacs@gnu.org Subject: It is annoying to have to type 'print foo' before each .gdbinit command. Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.5; envelope-from=acm@muc.de; helo=mx3.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hello, Emacs. In a GDB session, whilst debugging Emacs, it is common to want to print, for example, the current value of Lisp variable foo. At the moment, one has to type p foo xpr .. This need, continually to type p (or print) is irritating. It should be possible simply to type xpr foo .. The same applies to many other commands in .gdbinit. The following patch fixes this irritation. It allows a user to type xpr foo, yet also preserves the old version with no arguments, which can be handy, sometimes. I propose this patch be applied to the master branch. diff --git a/etc/DEBUG b/etc/DEBUG index c4f0852abb3..5fa60af2806 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -288,9 +288,10 @@ and where you interact with GDB. ** Examining Lisp object values. When you have a live process to debug, and it has not encountered a -fatal error, you can use the GDB command 'pr'. First print the value -in the ordinary way, with the 'p' command. Then type 'pr' with no -arguments. This calls a subroutine which uses the Lisp printer. +fatal error, you can use the GDB command 'pr'. Just type pr, giving +the object as the argument. (The older method of first printing with +the 'p' command followed by pr without arguments still works.) This +calls a subroutine which uses the Lisp printer. You can also use 'pp value' to print the emacs value directly. @@ -319,8 +320,7 @@ If you can't use 'pr' command, for whatever reason, you can use the 'xpr' command to print out the data type and value of the last data value, For example: - p it->object - xpr + xpr it->object You may also analyze data values using lower-level commands. Use the 'xtype' command to print out the data type of the last data value. @@ -328,10 +328,10 @@ Once you know the data type, use the command that corresponds to that type. Here are these commands: xint xptr xwindow xmarker xoverlay xmiscfree xintfwd xboolfwd xobjfwd - xbufobjfwd xkbobjfwd xbuflocal xbuffer xsymbol xstring xvector xframe - xwinconfig xcompiled xcons xcar xcdr xsubr xprocess xfloat xscrollbar - xchartable xsubchartable xboolvector xhashtable xlist xcoding - xcharset xfontset xfont + xbufobjfwd xkbobjfwd xbuflocal xbuffer xsymbol xsymwithpos xstring + xvector xframe xwinconfig xcompiled xcons xcar xcdr xsubr xprocess + xfloat xscrollbar xchartable xsubchartable xboolvector xhashtable + xlist xcoding xcharset xfontset xfont Each one of them applies to a certain type or class of types. (Some of these types are not visible in Lisp, because they exist only @@ -357,15 +357,13 @@ called frame. First, use these commands: Then Emacs hits the breakpoint: - (gdb) p frame - $1 = 139854428 - (gdb) xpr + (gdb) xpr frame Lisp_Vectorlike PVEC_FRAME - $2 = (struct frame *) 0x8560258 + $1 = (struct frame *) 0x8560258 "emacs@localhost" (gdb) p *$ - $3 = { + $2 = { size = 1073742931, next = 0x85dfe58, name = 140615219, @@ -391,22 +389,19 @@ evaluate expressions like "p XVECTOR (this_command_keys)". When this information isn't available, you can use the xvector command in GDB to get the same result. Here is how: - (gdb) p this_command_keys - $1 = 1078005760 - (gdb) xvector - $2 = (struct Lisp_Vector *) 0x411000 + (gdb) xvector this_command_keys + $1 = (struct Lisp_Vector *) 0x411000 0 (gdb) p $->contents[this_command_key_count] - $3 = 1077872640 + $2 = 1077872640 (gdb) p &$ - $4 = (int *) 0x411008 + $3 = (int *) 0x411008 Here's a related example of macros and the GDB 'define' command. There are many Lisp vectors such as 'recent_keys', which contains the last 300 keystrokes. We can print this Lisp vector - p recent_keys - pr + pr recent_keys But this may be inconvenient, since 'recent_keys' is much more verbose than 'C-h l'. We might want to print only the last 10 elements of @@ -447,8 +442,7 @@ backtrace, and look for stack frames that call Ffuncall. Select them one by one in GDB, by typing "up N", where N is the appropriate number of frames to go up, and in each frame that calls Ffuncall type this: - p *args - pr + pr *args This will print the name of the Lisp function called by that level of function calling. @@ -456,15 +450,13 @@ of function calling. By printing the remaining elements of args, you can see the argument values. Here's how to print the first argument: - p args[1] - pr + pr args[1] If you do not have a live process, you can use xtype and the other x... commands such as xsymbol to get such information, albeit less conveniently. For example: - p *args - xtype + xtype *args and, assuming that "xtype" says that args[0] is a symbol: diff --git a/src/.gdbinit b/src/.gdbinit index c96c2b597bd..65ef9a5684e 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -91,10 +91,15 @@ end # from calling OutputDebugString, which causes GDB to display each # character twice (yuk!). define pr - pp $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + pp $d end document pr -Print the emacs s-expression which is $. +Print the emacs s-expression which is $arg0 or $. Works only when an inferior emacs is executing. end @@ -656,15 +661,20 @@ Takes one argument, a pointer to a glyph_matrix structure. end define xtype - xgettype $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgettype $d output $type echo \n if $type == Lisp_Vectorlike - xvectype + xvectype $d end end document xtype -Print the type of $, assuming it is an Emacs Lisp value. +Print the type of $arg0 or $, assuming it is an Emacs Lisp value. If the first type printed is Lisp_Vectorlike, a second line gives the more precise type. end @@ -684,12 +694,17 @@ Takes one argument, a pointer to an object. end define xvectype - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d pvectype $ptr end document xvectype Print the subtype of vectorlike object. -This command assumes that $ is a Lisp_Object. +This command assumes that $arg0 or $ is a Lisp_Object. end define pvecsize @@ -709,104 +724,159 @@ Takes one argument, a pointer to an object. end define xvecsize - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d pvecsize $ptr end document xvecsize -Print the size of $ -This command assumes that $ is a Lisp_Object. +Print the size of $arg0 or $. +This command assumes that $arg0 or $ is a Lisp_Object. end define xint - xgetint $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetint $d print $int end document xint -Print $ as an Emacs Lisp integer. This gets the sign right. +Print $arg0 or $ as an Emacs Lisp integer. This gets the sign right. end define xptr - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (void *) $ptr end document xptr -Print the pointer portion of an Emacs Lisp value in $. +Print the pointer portion of an Emacs Lisp value in $arg0 or $. end define xmarker - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Marker *) $ptr end document xmarker -Print $ as a marker pointer. +Print $arg0 or $ as a marker pointer. This command assumes that $ is an Emacs Lisp marker value. end define xoverlay - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Overlay *) $ptr end document xoverlay -Print $ as a overlay pointer. -This command assumes that $ is an Emacs Lisp overlay value. +Print $arg0 or $ as a overlay pointer. +This command assumes that $arg0 or $ is an Emacs Lisp overlay value. end define xsymwithpos - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Symbol_With_Pos *) $ptr end document xsymwithpos -Print $ as a symbol with position. -This command assumes that $ is an Emacs Lisp symbol with position value. +Print $arg0 or $ as a symbol with position. +This command assumes that $arg0 or $ is an Emacs Lisp symbol with position value. end define xsymbol - set $sym = $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + set $sym = $d xgetsym $sym print (struct Lisp_Symbol *) $ptr xprintsym $sym echo \n end document xsymbol -Print the name and address of the symbol $. -This command assumes that $ is an Emacs Lisp symbol value. +Print the name and address of the symbol $arg0 or $. +This command assumes that $arg0 or $ is an Emacs Lisp symbol value. end define xstring - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_String *) $ptr xprintstr $ echo \n end document xstring -Print the contents and address of the string $. -This command assumes that $ is an Emacs Lisp string value. +Print the contents and address of the string $arg0 or $. +This command assumes that $arg0 or $ is an Emacs Lisp string value. end define xvector - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Vector *) $ptr output ($->header.size > 50) ? 0 : ($->contents[0])@($->header.size & ~ARRAY_MARK_FLAG) echo \n end document xvector -Print the contents and address of the vector $. -This command assumes that $ is an Emacs Lisp vector value. +Print the contents and address of the vector $arg0 or $. +This command assumes that $arg0 or $ is an Emacs Lisp vector value. end define xprocess - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Process *) $ptr - output *$ + output *$d echo \n end document xprocess -Print the address of the struct Lisp_process to which $ points. -This command assumes that $ is a Lisp_Object. +Print the address of the struct Lisp_process to which $arg0 or $ points. +This command assumes that $arg0 or $ is a Lisp_Object. end define xframe - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct frame *) $ptr xgetptr $->name set $ptr = (struct Lisp_String *) $ptr @@ -814,53 +884,78 @@ define xframe echo \n end document xframe -Print $ as a frame pointer. -This command assumes $ is an Emacs Lisp frame value. +Print $arg0 or $ as a frame pointer. +This command assumes $arg0 or $ is an Emacs Lisp frame value. end define xcompiled - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Vector *) $ptr output ($->contents[0])@($->header.size & 0xff) echo \n end document xcompiled -Print $ as a compiled function pointer. -This command assumes that $ is an Emacs Lisp compiled value. +Print $arg0 or $ as a compiled function pointer. +This command assumes that $arg0 or $ is an Emacs Lisp compiled value. end define xwindow - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct window *) $ptr set $window = (struct window *) $ptr printf "%dx%d+%d+%d\n", $window->total_cols, $window->total_lines, $window->left_col, $window->top_line end document xwindow -Print $ as a window pointer, assuming it is an Emacs Lisp window value. +Print $arg0 or $ as a window pointer, assuming it is an Emacs Lisp window value. Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". end define xwinconfig - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct save_window_data *) $ptr end document xwinconfig -Print $ as a window configuration pointer. -This command assumes that $ is an Emacs Lisp window configuration value. +Print $arg0 or $ as a window configuration pointer. +This command assumes that $arg0 or $ is an Emacs Lisp window configuration value. end define xsubr - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Subr *) $ptr output *$ echo \n end document xsubr -Print the address of the subr which the Lisp_Object $ points to. +Print the address of the subr which the Lisp_Object $arg0 or $ points to. end define xchartable - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Char_Table *) $ptr printf "Purpose: " xprintsym $->purpose @@ -868,65 +963,90 @@ define xchartable echo \n end document xchartable -Print the address of the char-table $, and its purpose. -This command assumes that $ is an Emacs Lisp char-table value. +Print the address of the char-table $arg0 or $, and its purpose. +This command assumes that $arg0 or $ is an Emacs Lisp char-table value. end define xsubchartable - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Sub_Char_Table *) $ptr set $subchartab = (struct Lisp_Sub_Char_Table *) $ptr printf "Depth: %d, Min char: %d (0x%x)\n", $subchartab->depth, $subchartab->min_char, $subchartab->min_char end document xsubchartable -Print the address of the sub-char-table $, its depth and min-char. -This command assumes that $ is an Emacs Lisp sub-char-table value. +Print the address of the sub-char-table $arg0 or $, its depth and min-char. +This command assumes that $arg0 or $ is an Emacs Lisp sub-char-table value. end define xboolvector - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Bool_Vector *) $ptr output ($->size > 256) ? 0 : ($->data[0])@(($->size + BOOL_VECTOR_BITS_PER_CHAR - 1)/ BOOL_VECTOR_BITS_PER_CHAR) echo \n end document xboolvector -Print the contents and address of the bool-vector $. -This command assumes that $ is an Emacs Lisp bool-vector value. +Print the contents and address of the bool-vector $arg0 or $. +This command assumes that $arg0 or $ is an Emacs Lisp bool-vector value. end define xbuffer - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct buffer *) $ptr xgetptr $->name_ output $ptr ? (char *) ((struct Lisp_String *) $ptr)->u.s.data : "DEAD" echo \n end document xbuffer -Set $ as a buffer pointer and the name of the buffer. -This command assumes $ is an Emacs Lisp buffer value. +Set $arg0 or $ as a buffer pointer and the name of the buffer. +This command assumes $arg0 or $ is an Emacs Lisp buffer value. end define xhashtable - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Hash_Table *) $ptr end document xhashtable -Set $ as a hash table pointer. -This command assumes that $ is an Emacs Lisp hash table value. +Set $arg0 or $ as a hash table pointer. +This command assumes that $arg0 or $ is an Emacs Lisp hash table value. end define xcons - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct Lisp_Cons *) $ptr output/x *$ echo \n end document xcons -Print the contents of $ as an Emacs Lisp cons. +Print the contents of $arg0 or $ as an Emacs Lisp cons. end define nextcons - p $.u.cdr + p $.u.s.u.cdr xcons end document nextcons @@ -935,25 +1055,40 @@ This command assumes that the last thing you printed was a cons cell contents (type struct Lisp_Cons) or a pointer to one. end define xcar - xgetptr $ - xgettype $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d + xgettype $d print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.s.car : 0) end document xcar -Assume that $ is an Emacs Lisp pair and print its car. +Assume that $arg0 or $ is an Emacs Lisp pair and print its car. end define xcdr - xgetptr $ - xgettype $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d + xgettype $d print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.s.u.cdr : 0) end document xcdr -Assume that $ is an Emacs Lisp pair and print its cdr. +Assume that $arg0 or $ is an Emacs Lisp pair and print its cdr. end define xlist - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d set $cons = (struct Lisp_Cons *) $ptr xgetptr Qnil set $nil = $ptr @@ -974,97 +1109,112 @@ define xlist end end document xlist -Print $ assuming it is a list. +Print $arg0 or $ assuming it is a list. end define xfloat - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print ((struct Lisp_Float *) $ptr)->u.data end document xfloat -Print $ assuming it is a lisp floating-point number. +Print $arg0 or $ assuming it is a lisp floating-point number. end define xscrollbar - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d print (struct scrollbar *) $ptr -output *$ +output *$d echo \n end document xscrollbar -Print $ as a scrollbar pointer. +Print $arg0 or $ as a scrollbar pointer. end define xpr - xtype + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xtype $d if $type == Lisp_Int0 || $type == Lisp_Int1 - xint + xint $d end if $type == Lisp_Symbol - xsymbol + xsymbol $d end if $type == Lisp_String - xstring + xstring $d end if $type == Lisp_Cons - xcons + xcons $d end if $type == Lisp_Float - xfloat + xfloat $d end if $type == Lisp_Vectorlike set $size = ((struct Lisp_Vector *) $ptr)->header.size if ($size & PSEUDOVECTOR_FLAG) set $vec = (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS) if $vec == PVEC_NORMAL_VECTOR - xvector + xvector $d end if $vec == PVEC_MARKER - xmarker + xmarker $d end if $vec == PVEC_OVERLAY - xoverlay + xoverlay $d end if $vec == PVEC_SYMBOL_WITH_POS - xsymwithpos + xsymwithpos $d end if $vec == PVEC_PROCESS - xprocess + xprocess $d end if $vec == PVEC_FRAME - xframe + xframe $d end if $vec == PVEC_COMPILED - xcompiled + xcompiled $d end if $vec == PVEC_WINDOW - xwindow + xwindow $d end if $vec == PVEC_WINDOW_CONFIGURATION - xwinconfig + xwinconfig $d end if $vec == PVEC_SUBR - xsubr + xsubr $d end if $vec == PVEC_CHAR_TABLE - xchartable + xchartable $d end if $vec == PVEC_BOOL_VECTOR - xboolvector + xboolvector $d end if $vec == PVEC_BUFFER - xbuffer + xbuffer $d end if $vec == PVEC_HASH_TABLE - xhashtable + xhashtable $d end else - xvector + xvector $d end end end document xpr -Print $ as a lisp object of any type. +Print $arg0 or $ as a lisp object of any type. end define xprintstr @@ -1118,7 +1268,12 @@ document xcharset end define xfontset - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d set $tbl = (struct Lisp_Char_Table *) $ptr print $tbl xgetint $tbl->extras[0] @@ -1141,7 +1296,12 @@ define xfontset end define xfont - xgetptr $ + if $argc > 0 + set $d = $arg0 + else + set $d = $ + end + xgetptr $d set $size = (((struct Lisp_Vector *) $ptr)->header.size & 0x1FF) if $size == FONT_SPEC_MAX print (struct font_spec *) $ptr @@ -1154,7 +1314,7 @@ define xfont end end document xfont -Print $ assuming it is a list font (font-spec, font-entity, or font-object). +Print $arg0 or $ assuming it is a list font (font-spec, font-entity, or font-object). end define xbacktrace -- Alan Mackenzie (Nuremberg, Germany). ------------=_1676228223-20362-1-- From unknown Mon Jun 23 02:26:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61453: It is annoying to have to type 'print foo' before each .gdbinit command. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 19:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix To: Alan Mackenzie Cc: acm@muc.de, 61453-done@debbugs.gnu.org, control@debbugs.gnu.org Received: via spool by 61453-done@debbugs.gnu.org id=D61453.167623011332658 (code D ref 61453); Sun, 12 Feb 2023 19:29:02 +0000 Received: (at 61453-done) by debbugs.gnu.org; 12 Feb 2023 19:28:33 +0000 Received: from localhost ([127.0.0.1]:46818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRI1Z-0008Ua-4f for submit@debbugs.gnu.org; Sun, 12 Feb 2023 14:28:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRI1X-0008UJ-6U; Sun, 12 Feb 2023 14:28:31 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRI1R-0004gB-Nm; Sun, 12 Feb 2023 14:28:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=LsPYbNrrr39Cz4g4eI7zU609FaEKpTDLFy+aSkqsEeY=; b=ae74ULDz+NdF NYl1BMAd+6Vy0wEMPzh3hqo/idQMGVHj2QoHnlXCV6nnUsE/T77AI88SnIa0DiDnml8bGnTCzzCzK fGGc6EJqVB4F/DUjbJpUbcyhO/Swg+Qvv8B3A63n1cTTN75LpB77SdaxJYX47xUl47O0+7SBnu8V5 n9FL+udwcEedoj5QJtYevJMefxaNV+XXMMkmrphPcZfDeF9/UEcPhLKG6CIIcMeMzLqK4M1YByhrD Qv3xFZyUia6V+FUiIOW99wLdd3AnxJvxX0q0DAhf4tOsGVJTSSYEyDpK1k+0WYL0mBBU/t/x9puNr RcMgEo565cf4LxHxB3S/FQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRI1M-0004rp-ER; Sun, 12 Feb 2023 14:28:21 -0500 Date: Sun, 12 Feb 2023 21:27:55 +0200 Message-Id: <83wn4mfzus.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Alan Mackenzie on Sun, 12 Feb 2023 18:56:44 +0000) References: <83mt5jghej.fsf@gnu.org> <83k00ngeu8.fsf@gnu.org> <83fsbbgcra.fsf@gnu.org> <838rh2hmbh.fsf@gnu.org> <831qmuhgyk.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 12 Feb 2023 18:56:44 +0000 > Cc: 61453-done@debbugs.gnu.org, control@debbugs.gnu.org, acm@muc.de > From: Alan Mackenzie > > > > So, why not install this patch in master, now? > > > I don't like it, sorry. It is not clean enough, and it goes against > > the overall consistency of the commands we have in src/.gdbinit. > > That's a shame. We should be able to do better with this sort of thing. If you insist, go ahead and install. But I still don't like it.