Subject: bug#77125: [PATCH] igc ; * etc/DEBUG: Fix gdb examples to: call ... (global_igc->arena)

From: Jeremy Bryant <[email-masked]>
Date: Sun, 06 Apr 2025 21:26:01 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Jeremy Bryant <[email-masked]>
>>  and then release it afterwards with:
>>  
>> -     (gdb) call mps_arena_release(arena)
>> +     (gdb) call mps_arena_release(global_igc->arena)
>
> Is it really true that the arena pointer is always global_igc->arena
> in Emacs?  If so, I would suggest to tell that separately, because the
> GDB calls to functions can have arguments constructed in many
> different ways.  Something like
>
>   In Emacs, the arena is usually stored in 'global_igc->arena'.
>
> and leave the examples in their current general form.

OK, on that basis please find attached patch adding that line, with 'usually'.

I believe that there is only one global arena on the basis of the
comments below.

igc.c:
/* The registry for an MPS arena.  There is only one arena used.  */

igc.org:
- Arena.  We tell MPS to create the global arena that is used for all
  objects.

All other model objects are handled in the same way, threads, arenas,
pools, object formats and so on.

Igc collects all these MPS handles in a =struct igc=.  This "registry" of
MPS handles is found in the global variable =global_igc= and thus can be
accessed from anywhere.

>From 578840331d4b3a471eaecd40dedd8e8e5860ebba Mon Sep 17 00:00:00 2001
From: Jeremy Bryant <[email-masked]>
Date: Sun, 6 Apr 2025 21:17:15 +0100
Subject: [PATCH] ; * etc/DEBUG: Improve documentation of debugging igc arena

---
 etc/DEBUG | 1 +
 1 file changed, 1 insertion(+)

diff --git a/etc/DEBUG b/etc/DEBUG
index 79bb6584489..546ff362b0a 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -1388,6 +1388,7 @@ and then release it afterwards with:
 
      (gdb) call mps_arena_release(arena)
 
+In Emacs, the arena is usually stored in 'global_igc->arena'.

-- 
2.47.2