[2/4] gdb: rename ext_lang_missing_debuginfo_result

Message ID b59226cfbcd848383ae78466365b250d1691d542.1725987073.git.aburgess@redhat.com
State New
Headers
Series Python API to find missing objfiles |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed

Commit Message

Andrew Burgess Sept. 10, 2024, 4:56 p.m. UTC
  In preparation for later commits in this series, rename
ext_lang_missing_debuginfo_result to ext_lang_missing_file_result.

A later commit will add additional Python APIs to handle different
types of missing files beyond just debuginfo.

This is just a rename commit, there should be no functional changes
after this commit.
---
 gdb/extension-priv.h |  2 +-
 gdb/extension.c      |  4 ++--
 gdb/extension.h      | 10 +++++-----
 gdb/python/python.c  | 12 ++++++------
 gdb/symfile-debug.c  |  2 +-
 5 files changed, 15 insertions(+), 15 deletions(-)
  

Comments

Tom Tromey Oct. 1, 2024, 5:25 p.m. UTC | #1
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> In preparation for later commits in this series, rename
Andrew> ext_lang_missing_debuginfo_result to ext_lang_missing_file_result.

Andrew> A later commit will add additional Python APIs to handle different
Andrew> types of missing files beyond just debuginfo.

Andrew> This is just a rename commit, there should be no functional changes
Andrew> after this commit.

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

Tom
  

Patch

diff --git a/gdb/extension-priv.h b/gdb/extension-priv.h
index 653fd51e2f1..90810e4bbc8 100644
--- a/gdb/extension-priv.h
+++ b/gdb/extension-priv.h
@@ -292,7 +292,7 @@  struct extension_language_ops
   /* Give extension languages a chance to deal with missing debug
      information.  OBJFILE is the file for which GDB was unable to find
      any debug information.  */
-  ext_lang_missing_debuginfo_result
+  ext_lang_missing_file_result
     (*handle_missing_debuginfo) (const struct extension_language_defn *,
 				 struct objfile *objfile);
 };
diff --git a/gdb/extension.c b/gdb/extension.c
index c488fc77494..f7b99d681eb 100644
--- a/gdb/extension.c
+++ b/gdb/extension.c
@@ -1053,7 +1053,7 @@  ext_lang_print_insn (struct gdbarch *gdbarch, CORE_ADDR address,
 
 /* See extension.h.  */
 
-ext_lang_missing_debuginfo_result
+ext_lang_missing_file_result
 ext_lang_handle_missing_debuginfo (struct objfile *objfile)
 {
   for (const struct extension_language_defn *extlang : extension_languages)
@@ -1061,7 +1061,7 @@  ext_lang_handle_missing_debuginfo (struct objfile *objfile)
       if (extlang->ops == nullptr
 	  || extlang->ops->handle_missing_debuginfo == nullptr)
 	continue;
-      ext_lang_missing_debuginfo_result result
+      ext_lang_missing_file_result result
 	= extlang->ops->handle_missing_debuginfo (extlang, objfile);
       if (!result.filename ().empty () || result.try_again ())
 	return result;
diff --git a/gdb/extension.h b/gdb/extension.h
index 5b0830b6675..2a749161508 100644
--- a/gdb/extension.h
+++ b/gdb/extension.h
@@ -361,23 +361,23 @@  extern std::optional<int> ext_lang_print_insn
    it.  And the third option is for the extension to just return a null
    result, indication there is nothing the extension can do to provide the
    missing debug information.  */
-struct ext_lang_missing_debuginfo_result
+struct ext_lang_missing_file_result
 {
   /* Default result.  The extension was unable to provide the missing debug
      info.  */
-  ext_lang_missing_debuginfo_result ()
+  ext_lang_missing_file_result ()
   { /* Nothing.  */ }
 
   /* When TRY_AGAIN is true GDB should try searching again, the extension
      may have installed the missing debug info into a suitable location.
      When TRY_AGAIN is false this is equivalent to the default, no
      argument, constructor.  */
-  ext_lang_missing_debuginfo_result (bool try_again)
+  ext_lang_missing_file_result (bool try_again)
     : m_try_again (try_again)
   { /* Nothing.  */ }
 
   /* Look in FILENAME for the missing debug info.  */
-  ext_lang_missing_debuginfo_result (std::string &&filename)
+  ext_lang_missing_file_result (std::string &&filename)
     : m_filename (std::move (filename))
   { /* Nothing.  */ }
 
@@ -407,7 +407,7 @@  struct ext_lang_missing_debuginfo_result
 
 /* Called when GDB failed to find any debug information for OBJFILE.  */
 
-extern ext_lang_missing_debuginfo_result ext_lang_handle_missing_debuginfo
+extern ext_lang_missing_file_result ext_lang_handle_missing_debuginfo
   (struct objfile *objfile);
 
 #if GDB_SELF_TEST
diff --git a/gdb/python/python.c b/gdb/python/python.c
index a2ce1f6545a..978fc0c4cac 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -128,7 +128,7 @@  static std::optional<std::string> gdbpy_colorize
   (const std::string &filename, const std::string &contents);
 static std::optional<std::string> gdbpy_colorize_disasm
 (const std::string &content, gdbarch *gdbarch);
-static ext_lang_missing_debuginfo_result gdbpy_handle_missing_debuginfo
+static ext_lang_missing_file_result gdbpy_handle_missing_debuginfo
   (const struct extension_language_defn *extlang, struct objfile *objfile);
 
 /* The interface between gdb proper and loading of python scripts.  */
@@ -1755,10 +1755,10 @@  gdbpy_get_current_objfile (PyObject *unused1, PyObject *unused2)
 /* Implement the 'handle_missing_debuginfo' hook for Python.  GDB has
    failed to find any debug information for OBJFILE.  The extension has a
    chance to record this, or even install the required debug information.
-   See the description of ext_lang_missing_debuginfo_result in
-   extension-priv.h for details of the return value.  */
+   See the description of ext_lang_missing_file_result in extension-priv.h
+   for details of the return value.  */
 
-static ext_lang_missing_debuginfo_result
+static ext_lang_missing_file_result
 gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang,
 				struct objfile *objfile)
 {
@@ -1806,7 +1806,7 @@  gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang,
   if (PyBool_Check (pyo_execute_ret.get ()))
     {
       bool try_again = PyObject_IsTrue (pyo_execute_ret.get ());
-      return ext_lang_missing_debuginfo_result (try_again);
+      return ext_lang_missing_file_result (try_again);
     }
 
   if (!gdbpy_is_string (pyo_execute_ret.get ()))
@@ -1826,7 +1826,7 @@  gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang,
       return {};
     }
 
-  return ext_lang_missing_debuginfo_result (std::string (filename.get ()));
+  return ext_lang_missing_file_result (std::string (filename.get ()));
 }
 
 /* Compute the list of active python type printers and store them in
diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c
index 0eccda21f39..473528fc9a2 100644
--- a/gdb/symfile-debug.c
+++ b/gdb/symfile-debug.c
@@ -628,7 +628,7 @@  objfile::find_and_add_separate_symbol_file (symfile_add_flags symfile_flags)
 	     the user a system specific message that guides them to finding
 	     the missing debug info.  */
 
-	  ext_lang_missing_debuginfo_result ext_result
+	  ext_lang_missing_file_result ext_result
 	    = ext_lang_handle_missing_debuginfo (this);
 	  if (!ext_result.filename ().empty ())
 	    {