Subject: bug#53058: closed (Re: bug#53058: etc/DEBUG could say more about --enable-check-lisp-object-type)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 03 Feb 2022 07:29:02 +0000

Your bug report

#53058: etc/DEBUG could say more about --enable-check-lisp-object-type

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 [email-masked].

-- 
53058: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=53058
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#53058: etc/DEBUG could say more about --enable-check-lisp-object-type
From: Eli Zaretskii <[email-masked]>
To: Sean Whitton <[email-masked]>
Cc: [email-masked]
Date: Thu, 03 Feb 2022 09:28:49 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Sean Whitton <[email-masked]>
> Cc: [email-masked]
> Date: Wed, 02 Feb 2022 17:19:04 -0700
> 
> Hello,
> 
> On Sat 08 Jan 2022 at 08:55am +02, Eli Zaretskii wrote:
> 
> > The reasons for the problem in your case is not known: NILP should
> > have worked, as did the comparison with Qnil.  Until we understand why
> > those didn't work, I don't see how we can say anything in etc/DEBUG
> > that would both be useful and important/general enough to have there.
> >
> > My best advice is to try to understand why those conditions didn't
> > work on your system.  Maybe someone here knowns, or maybe you should
> > ask on the GDB mailing list ([email-masked]).
> 
> If I understand you correctly: we don't yet know exactly what was going
> wrong on my machine when I tried to set the conditional break point, so
> we lack a concrete case in which --enable-check-lisp-object-type
> affected debugging with GDB, and we are thus not in a position to assert
> in etc/DEBUG that --enable-check-lisp-object-type has the potential to
> have an effect on debugging with gdb?

Yes.

> When you wrote that comparisons with structs are not guaranteed to work
> with gdb, you were /not/ going as far as saying that comparisons with
> structs are never expected to work (because that would imply that
> --enable-check-lisp-object-type would often lead to issues when
> debugging)?

Yes.

> If this summary is right, I think this bug should be closed.

OK, closing.

Subject: etc/DEBUG could say more about --enable-check-lisp-object-type
From: Sean Whitton <[email-masked]>
To: [email-masked]
Date: Thu, 06 Jan 2022 11:20:19 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

On Wed 05 Jan 2022 at 02:11PM +02, Eli Zaretskii wrote:

> Comparisons with structures, like foo == Qnil, aren't guaranteed to
> work in GDB.  --enable-check-lisp-object-type makes Lisp objects be
> structures rather than simple scalar values.

Thanks -- how about the attached?

-- 
Sean Whitton
>From eaf40f04614063010e60d14c9ba8ba48e4b842bc Mon Sep 17 00:00:00 2001
From: Sean Whitton <[email-masked]>
Date: Thu, 6 Jan 2022 11:17:44 -0700
Subject: [PATCH] etc/DEBUG: Say more about --enable-check-lisp-object-type

* etc/DEBUG: Explain how --enable-check-lisp-object-type can obstruct
certain debugging strategies.  Don't claim that this switch has no
effect on debugging with GDB.
---
 etc/DEBUG | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/etc/DEBUG b/etc/DEBUG
index dd33b42f19..6d0e27cbce 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -28,12 +28,21 @@ exceptionally hard.
 Older versions of GCC may need more than just the -g3 flag.  For more,
 search for "analyze failed assertions" below.
 
-The 2 --enable-* switches are optional.  They don't have any effect on
-debugging with GDB, but will compile additional code that might catch
-the problem you are debugging much earlier, in the form of assertion
-violation.  The --enable-checking option also enables additional
-functionality useful for debugging display problems; see more about
-this below under "Debugging Emacs redisplay problems".
+The 2 --enable-* switches are optional.  They compile additional code
+that might catch the problem you are debugging much earlier, in the
+form of assertion violation.  The --enable-checking option also
+enables additional functionality useful for debugging display
+problems; see more about this below under "Debugging Emacs redisplay
+problems".
+
+You should be aware that the --enable-check-lisp-object-type option
+changes Lisp objects from scalar values into structs, and this can
+obstruct certain debugging strategies.  In particular, asking GDB to
+compare Lisp objects might not work.  For example, consider this
+attempt to conditionalize a break point: "condition 2 NILP (foo)".  In
+this case you are requesting that GDB make the comparison "foo ==
+Qnil", and you might need to recompile without
+--enable-check-lisp-object-type for that to work.
 
 Emacs needs not be installed to be debugged, you can debug the binary
 created in the 'src' directory.
-- 
2.30.2