[v6,3/3] gdb: make solib_contains_address_p static

Message ID 20201210192807.30372-4-mihails.strasuns@intel.com
State New
Headers show
Series
  • Disable breakpoint locations in unloaded jit objects
Related show

Commit Message

Lancelot SIX via Gdb-patches Dec. 10, 2020, 7:28 p.m.
After changes to jit.c this function is only used in solib.c where it is
defined - which means it can be turned into a static function for now.

gdb/ChangeLog:
2020-12-10  Mihails Strasuns  <mihails.strasuns@intel.com>

	* solib.h (solib_contains_address_p): Removed.
	* solib.c (solib_contains_address_p): Changed to static.
---
 gdb/solib.c | 4 ++--
 gdb/solib.h | 4 ----
 2 files changed, 2 insertions(+), 6 deletions(-)

-- 
2.17.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

Comments

Lancelot SIX via Gdb-patches Jan. 8, 2021, 8:04 p.m. | #1
On 2020-12-10 2:28 p.m., Mihails Strasuns via Gdb-patches wrote:
> After changes to jit.c this function is only used in solib.c where it is

> defined - which means it can be turned into a static function for now.

> 

> gdb/ChangeLog:

> 2020-12-10  Mihails Strasuns  <mihails.strasuns@intel.com>

> 

> 	* solib.h (solib_contains_address_p): Removed.

> 	* solib.c (solib_contains_address_p): Changed to static.

> ---

>  gdb/solib.c | 4 ++--

>  gdb/solib.h | 4 ----

>  2 files changed, 2 insertions(+), 6 deletions(-)

> 

> diff --git a/gdb/solib.c b/gdb/solib.c

> index 1f6e91599a5..c0971e16d2a 100644

> --- a/gdb/solib.c

> +++ b/gdb/solib.c

> @@ -1108,9 +1108,9 @@ info_sharedlibrary_command (const char *pattern, int from_tty)

>      }

>  }

>  

> -/* See solib.h.  */

> +/* Return true if ADDR lies within SOLIB.  */

>  

> -bool

> +static bool

>  solib_contains_address_p (const struct so_list *const solib,

>  			  CORE_ADDR address)

>  {

> diff --git a/gdb/solib.h b/gdb/solib.h

> index 801965fcd53..8cfd402422d 100644

> --- a/gdb/solib.h

> +++ b/gdb/solib.h

> @@ -49,10 +49,6 @@ extern void solib_create_inferior_hook (int from_tty);

>  

>  extern char *solib_name_from_address (struct program_space *, CORE_ADDR);

>  

> -/* Return true if ADDR lies within SOLIB.  */

> -

> -extern bool solib_contains_address_p (const struct so_list *, CORE_ADDR);

> -

>  /* Return whether the data starting at VADDR, size SIZE, must be kept

>     in a core file for shared libraries loaded before "gcore" is used

>     to be handled correctly when the core file is loaded.  This only

> 


This is ok (although it depends on the previous patch).

Simon

Patch

diff --git a/gdb/solib.c b/gdb/solib.c
index 1f6e91599a5..c0971e16d2a 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1108,9 +1108,9 @@  info_sharedlibrary_command (const char *pattern, int from_tty)
     }
 }
 
-/* See solib.h.  */
+/* Return true if ADDR lies within SOLIB.  */
 
-bool
+static bool
 solib_contains_address_p (const struct so_list *const solib,
 			  CORE_ADDR address)
 {
diff --git a/gdb/solib.h b/gdb/solib.h
index 801965fcd53..8cfd402422d 100644
--- a/gdb/solib.h
+++ b/gdb/solib.h
@@ -49,10 +49,6 @@  extern void solib_create_inferior_hook (int from_tty);
 
 extern char *solib_name_from_address (struct program_space *, CORE_ADDR);
 
-/* Return true if ADDR lies within SOLIB.  */
-
-extern bool solib_contains_address_p (const struct so_list *, CORE_ADDR);
-
 /* Return whether the data starting at VADDR, size SIZE, must be kept
    in a core file for shared libraries loaded before "gcore" is used
    to be handled correctly when the core file is loaded.  This only