unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sean Whitton <spwhitton@spwhitton.name>
To: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Can't set conditional break point using AREF/NILP
Date: Sat, 01 Jan 2022 14:49:05 -0700	[thread overview]
Message-ID: <87pmpbm8j2.fsf@melete.silentflame.com> (raw)
In-Reply-To: <83v8z4eygg.fsf@gnu.org>

[moving to emacs-devel]

On Sat 01 Jan 2022 at 08:56AM +02, Eli Zaretskii wrote:

>> From: Sean Whitton <spwhitton@spwhitton.name>
>> Date: Fri, 31 Dec 2021 17:30:35 -0700
>>
>> If I might ask a gdb question: to try to determine when this code can
>> set FONT_WEIGHT_INDEX to nil, I set a breakpoint right after it and then
>> tried
>>
>>     condition NN NILP (AREF (entity, FONT_WEIGHT_INDEX))
>>
>> but this didn't work -- is it possible to do something like that?
>
> It should be possible if your Emacs was compiled with -g3.

Can confirm mine is.

> Perhaps try
>
>   condition NN AREF (entity, FONT_WEIGHT_INDEX) == Qnil
>
> instead.

This fails in the same way.  This is what I see:

Breakpoint 2 at 0x335d30: file ftfont.c, line 231.
(gdb) condition 2 AREF (entity, FONT_WEIGHT_INDEX) == Qnil
(gdb) r
`/home/spwhitton/src/emacs/src/emacs' has changed; re-reading symbols.
Starting program: /home/spwhitton/src/emacs/src/emacs
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff15c4700 (LWP 2073615)]
[New Thread 0x7ffff0bca700 (LWP 2073616)]
[New Thread 0x7fffebfff700 (LWP 2073617)]
[New Thread 0x7fffeb254700 (LWP 2073618)]
[New Thread 0x7fffea8c3700 (LWP 2073619)]
[New Thread 0x7fffe9f32700 (LWP 2073620)]
Error in testing breakpoint condition:
Couldn't get registers: No such process.
An error occurred while in a function called from GDB.
Evaluation of the expression containing the function
(AREF) will be abandoned.
When the function is done executing, GDB will silently stop.
Selected thread is running.
(gdb) [Switching to thread 1 (Thread 0x7ffff237b040 (LWP 2073608))]
#0  ftfont_pattern_entity (p=0x55555643d660, extra=XIL(0x555555f91953)) at ftfont.c:230
230	  if (FcPatternGetInteger (p, FC_SLANT, 0, &numeric) == FcResultMatch)

And then gdb does break at the break point, but it's badly broken:

(gdb) p AREF (entity, FONT_WEIGHT_INDEX) == Qnil
[Thread 0x7fffea8c3700 (LWP 2073619) exited]
[Thread 0x7fffe9f32700 (LWP 2073620) exited]
Attempt to take address of value not located in memory.
(gdb)

-- 
Sean Whitton



       reply	other threads:[~2022-01-01 21:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87zgoi8xve.fsf@melete.silentflame.com>
     [not found] ` <83r19uim2q.fsf@gnu.org>
     [not found]   ` <871r1uyq1i.fsf@athena.silentflame.com>
     [not found]     ` <8335mahr8f.fsf@gnu.org>
     [not found]       ` <87v8z4mh5g.fsf@melete.silentflame.com>
     [not found]         ` <83v8z4eygg.fsf@gnu.org>
2022-01-01 21:49           ` Sean Whitton [this message]
2022-01-02  6:42             ` Can't set conditional break point using AREF/NILP Eli Zaretskii
2022-01-02 22:38               ` Sean Whitton
2022-01-03 12:28                 ` Eli Zaretskii
2022-01-04 21:57                   ` Sean Whitton
2022-01-05 12:11                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmpbm8j2.fsf@melete.silentflame.com \
    --to=spwhitton@spwhitton.name \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).