gdb: add AUTO_LOAD_SCOPED_DEBUG_ENTER_EXIT

Message ID 2b59fa82f772266ce90f6201435c157f4ec32b7e.1775570122.git.aburgess@redhat.com
State New
Headers
Series gdb: add AUTO_LOAD_SCOPED_DEBUG_ENTER_EXIT |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Andrew Burgess April 7, 2026, 1:55 p.m. UTC
  Add the AUTO_LOAD_SCOPED_DEBUG_ENTER_EXIT macro, and make use of it in
one place.
---
 gdb/auto-load.c | 5 +++++
 gdb/auto-load.h | 5 +++++
 2 files changed, 10 insertions(+)


base-commit: 9d3cf9efd51ebae3f45bb49e3544cb7eeb63a138
  

Comments

Tom Tromey April 7, 2026, 3:53 p.m. UTC | #1
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> Add the AUTO_LOAD_SCOPED_DEBUG_ENTER_EXIT macro, and make use of it in
Andrew> one place.

Thanks.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Andrew Burgess April 9, 2026, 8:58 a.m. UTC | #2
Tom Tromey <tom@tromey.com> writes:

>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>
> Andrew> Add the AUTO_LOAD_SCOPED_DEBUG_ENTER_EXIT macro, and make use of it in
> Andrew> one place.
>
> Thanks.
> Approved-By: Tom Tromey <tom@tromey.com>

Pushed.

Thanks,
Andrew
  

Patch

diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index bf9e6734ca9..55204ba4a1f 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -878,6 +878,11 @@  void
 auto_load_objfile_script (struct objfile *objfile,
 			  const struct extension_language_defn *language)
 {
+  AUTO_LOAD_SCOPED_DEBUG_ENTER_EXIT;
+  auto_load_debug_printf ("objfile: %s, language: %s",
+			  objfile_name (objfile),
+			  ext_lang_capitalized_name (language));
+
   gdb::unique_xmalloc_ptr<char> realname
     = gdb_realpath (objfile_name (objfile));
 
diff --git a/gdb/auto-load.h b/gdb/auto-load.h
index d03c8493df0..d0da69373c3 100644
--- a/gdb/auto-load.h
+++ b/gdb/auto-load.h
@@ -40,6 +40,11 @@  extern bool debug_auto_load;
 #define auto_load_debug_printf(fmt, ...) \
   debug_prefixed_printf_cond (debug_auto_load, "auto-load", fmt, ##__VA_ARGS__)
 
+/* Print "auto-load" enter/exit debug statements.  */
+
+#define AUTO_LOAD_SCOPED_DEBUG_ENTER_EXIT			\
+  scoped_debug_enter_exit (debug_auto_load, "auto-load")
+
 extern bool global_auto_load;
 
 extern bool auto_load_local_gdbinit;