Subject: Re: bug#75459: 31.0.50; scratch-igc: Breakpoint 1, terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=2147483647) at ./src/emacs.c:432

From: Eli Zaretskii <[email-masked]>
Date: Fri, 10 Jan 2025 20:56:58 +0200

> Date: Fri, 10 Jan 2025 15:30:12 +0000
> From: Pip Cet <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> 
> "Eli Zaretskii" <[email-masked]> writes:
> 
> The problem is this would make debugging slightly less convenient on
> macOS (where MPS exceptions are handled on the "wrong" thread) and
> possibly Windows (I don't know what sys_thread_self () does for the
> additional threads we use on that system).

You will see that run_thread stores in thread_id the return value of
sys_thread_self.  Does that answer your question?

> > where it is not, one can disable it, like this:
> >
> >   (gdb)  define hookpost-backtrace
> >   Redefine command "hookpost-backtrace"? (y or n) y
> >   Type commands for definition of "hookpost-backtrace".
> >   End with a line saying just "end".
> >   >end
> >   (gdb)
> >
> > (It is also possible to start GDB from a directory other than the
> > Emacs src directory, but then one loses the other conveniencies of our
> > .gdbinit.)
> 
> I think the .gdbinit code is extremely useful, and it'd be great if we
> could somehow cause it to be sourced for gdb run in other directories,
> too.

That's easy" use the 'source' command of GDB:

  (gdb) source /path/to/emacs/src/.gdbinit

> (This is off-topic, but we could make all Makefiles use paths relative
> to the emacs root directory, and use "$(MAKE) -f $@/Makefile" rather
> than "$(MAKE) -C $@".

How can you do that and still support building from a separate build
directory?