* [PATCH 1/2] gdb: remove unused imports in solib*.[ch]
@ 2023-09-28 17:47 Simon Marchi
2023-09-28 17:47 ` [PATCH 2/2] gdb: remove nbsd_{ilp32,lp64}_solib_svr4_fetch_link_map_offsets Simon Marchi
0 siblings, 1 reply; 5+ messages in thread
From: Simon Marchi @ 2023-09-28 17:47 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
I'm starting to work on these files, I thought it would be a good time
to remove unused imports. These were identified by
include-what-you-use. Tested by rebuilding.
Change-Id: I3eaf3fa0ea3506c7ecfbc8ecff5031433b1dadb8
---
gdb/solib-aix.c | 3 ---
gdb/solib-darwin.c | 9 ---------
gdb/solib-darwin.h | 1 -
gdb/solib-dsbt.c | 5 ++---
gdb/solib-dsbt.h | 1 -
gdb/solib-frv.c | 4 ----
gdb/solib-svr4.c | 1 -
gdb/solib.c | 8 +-------
8 files changed, 3 insertions(+), 29 deletions(-)
diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c
index 93aa6c4e0407..fd6b1e7a4543 100644
--- a/gdb/solib-aix.c
+++ b/gdb/solib-aix.c
@@ -21,13 +21,10 @@
#include "solist.h"
#include "inferior.h"
#include "gdb_bfd.h"
-#include "gdbcore.h"
#include "objfiles.h"
#include "symtab.h"
#include "xcoffread.h"
#include "observable.h"
-#include "gdbcmd.h"
-#include "gdbsupport/scope-exit.h"
/* Our private data in struct so_list. */
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
index 1f52dd463523..1dacc7ba6a50 100644
--- a/gdb/solib-darwin.c
+++ b/gdb/solib-darwin.c
@@ -19,26 +19,17 @@
#include "defs.h"
-#include "symtab.h"
#include "bfd.h"
-#include "symfile.h"
#include "objfiles.h"
#include "gdbcore.h"
#include "target.h"
#include "inferior.h"
#include "regcache.h"
-#include "gdbthread.h"
#include "gdb_bfd.h"
#include "solist.h"
-#include "solib.h"
-#include "solib-svr4.h"
#include "solib-darwin.h"
-#include "bfd-target.h"
-#include "elf-bfd.h"
-#include "exec.h"
-#include "auxv.h"
#include "mach-o.h"
#include "mach-o/external.h"
diff --git a/gdb/solib-darwin.h b/gdb/solib-darwin.h
index 6cb05e2fcfda..fb3e8abb2064 100644
--- a/gdb/solib-darwin.h
+++ b/gdb/solib-darwin.h
@@ -20,7 +20,6 @@
#ifndef SOLIB_DARWIN_H
#define SOLIB_DARWIN_H
-struct objfile;
struct target_so_ops;
extern const struct target_so_ops darwin_so_ops;
diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c
index b18c4a3e82a1..e0aa7f13c032 100644
--- a/gdb/solib-dsbt.c
+++ b/gdb/solib-dsbt.c
@@ -24,12 +24,11 @@
#include "solist.h"
#include "objfiles.h"
#include "symtab.h"
-#include "language.h"
#include "command.h"
-#include "gdbcmd.h"
-#include "elf-bfd.h"
#include "gdb_bfd.h"
#include "solib-dsbt.h"
+#include "elf/common.h"
+#include "cli/cli-cmds.h"
#define GOT_MODULE_OFFSET 4
diff --git a/gdb/solib-dsbt.h b/gdb/solib-dsbt.h
index 59964a67fdb3..2b8161e8c5a7 100644
--- a/gdb/solib-dsbt.h
+++ b/gdb/solib-dsbt.h
@@ -20,7 +20,6 @@
#ifndef SOLIB_DSBT_H
#define SOLIB_DSBT_H
-struct objfile;
struct target_so_ops;
extern const struct target_so_ops dsbt_so_ops;
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index 8b0e3a6e0b05..152168c6edc7 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -18,16 +18,12 @@
#include "defs.h"
-#include "inferior.h"
#include "gdbcore.h"
#include "solib.h"
#include "solist.h"
#include "frv-tdep.h"
#include "objfiles.h"
#include "symtab.h"
-#include "language.h"
-#include "command.h"
-#include "gdbcmd.h"
#include "elf/frv.h"
#include "gdb_bfd.h"
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index f5fdbc742e7e..521e08c3c938 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -32,7 +32,6 @@
#include "inferior.h"
#include "infrun.h"
#include "regcache.h"
-#include "gdbthread.h"
#include "observable.h"
#include "solist.h"
diff --git a/gdb/solib.c b/gdb/solib.c
index 771954e51c8f..e2636f06783c 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -19,7 +19,6 @@
#include "defs.h"
-#include <sys/types.h>
#include <fcntl.h>
#include "symtab.h"
#include "bfd.h"
@@ -30,12 +29,9 @@
#include "command.h"
#include "target.h"
#include "frame.h"
-#include "gdbsupport/gdb_regex.h"
#include "inferior.h"
#include "gdbsupport/environ.h"
-#include "language.h"
-#include "gdbcmd.h"
-#include "completer.h"
+#include "cli/cli-cmds.h"
#include "elf/external.h"
#include "elf/common.h"
#include "filenames.h"
@@ -43,7 +39,6 @@
#include "solist.h"
#include "observable.h"
#include "readline/tilde.h"
-#include "remote.h"
#include "solib.h"
#include "interps.h"
#include "filesystem.h"
@@ -53,7 +48,6 @@
#include "debuginfod-support.h"
#include "source.h"
#include "cli/cli-style.h"
-#include "solib-target.h"
/* See solib.h. */
base-commit: 4ef9b04fa6c7669ca1deb8f725e5c5f904d3415a
--
2.42.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] gdb: remove nbsd_{ilp32,lp64}_solib_svr4_fetch_link_map_offsets
2023-09-28 17:47 [PATCH 1/2] gdb: remove unused imports in solib*.[ch] Simon Marchi
@ 2023-09-28 17:47 ` Simon Marchi
2023-09-28 18:07 ` [PATCH 2/2] gdb: remove nbsd_{ilp32, lp64}_solib_svr4_fetch_link_map_offsets John Baldwin
0 siblings, 1 reply; 5+ messages in thread
From: Simon Marchi @ 2023-09-28 17:47 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
They are unused.
Change-Id: I9b78837d41126ce1957aa1e8b08c82a422f06cbf
---
gdb/netbsd-tdep.c | 15 ---------------
gdb/netbsd-tdep.h | 3 ---
2 files changed, 18 deletions(-)
diff --git a/gdb/netbsd-tdep.c b/gdb/netbsd-tdep.c
index ed60200f958b..15a9e2fd7d4e 100644
--- a/gdb/netbsd-tdep.c
+++ b/gdb/netbsd-tdep.c
@@ -44,21 +44,6 @@
#define KINFO_VME_FLAG_GROWS_UP 0x00000010
#define KINFO_VME_FLAG_GROWS_DOWN 0x00000020
-/* FIXME: kettenis/20060115: We should really eliminate the next two
- functions completely. */
-
-struct link_map_offsets *
-nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void)
-{
- return svr4_ilp32_fetch_link_map_offsets ();
-}
-
-struct link_map_offsets *
-nbsd_lp64_solib_svr4_fetch_link_map_offsets (void)
-{
- return svr4_lp64_fetch_link_map_offsets ();
-}
-
int
nbsd_pc_in_sigtramp (CORE_ADDR pc, const char *func_name)
{
diff --git a/gdb/netbsd-tdep.h b/gdb/netbsd-tdep.h
index ab13e628d582..2adf9a751e3b 100644
--- a/gdb/netbsd-tdep.h
+++ b/gdb/netbsd-tdep.h
@@ -20,9 +20,6 @@
#ifndef NBSD_TDEP_H
#define NBSD_TDEP_H
-struct link_map_offsets *nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void);
-struct link_map_offsets *nbsd_lp64_solib_svr4_fetch_link_map_offsets (void);
-
int nbsd_pc_in_sigtramp (CORE_ADDR, const char *);
/* NetBSD specific set of ABI-related routines. */
--
2.42.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] gdb: remove nbsd_{ilp32, lp64}_solib_svr4_fetch_link_map_offsets
2023-09-28 17:47 ` [PATCH 2/2] gdb: remove nbsd_{ilp32,lp64}_solib_svr4_fetch_link_map_offsets Simon Marchi
@ 2023-09-28 18:07 ` John Baldwin
2023-09-28 18:24 ` Simon Marchi
0 siblings, 1 reply; 5+ messages in thread
From: John Baldwin @ 2023-09-28 18:07 UTC (permalink / raw)
To: Simon Marchi, gdb-patches
On 9/28/23 6:47 PM, Simon Marchi via Gdb-patches wrote:
> They are unused.
>
> Change-Id: I9b78837d41126ce1957aa1e8b08c82a422f06cbf
> ---
> gdb/netbsd-tdep.c | 15 ---------------
> gdb/netbsd-tdep.h | 3 ---
> 2 files changed, 18 deletions(-)
>
> diff --git a/gdb/netbsd-tdep.c b/gdb/netbsd-tdep.c
> index ed60200f958b..15a9e2fd7d4e 100644
> --- a/gdb/netbsd-tdep.c
> +++ b/gdb/netbsd-tdep.c
> @@ -44,21 +44,6 @@
> #define KINFO_VME_FLAG_GROWS_UP 0x00000010
> #define KINFO_VME_FLAG_GROWS_DOWN 0x00000020
>
> -/* FIXME: kettenis/20060115: We should really eliminate the next two
> - functions completely. */
> -
> -struct link_map_offsets *
> -nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void)
> -{
> - return svr4_ilp32_fetch_link_map_offsets ();
> -}
> -
> -struct link_map_offsets *
> -nbsd_lp64_solib_svr4_fetch_link_map_offsets (void)
> -{
> - return svr4_lp64_fetch_link_map_offsets ();
> -}
> -
> int
> nbsd_pc_in_sigtramp (CORE_ADDR pc, const char *func_name)
> {
> diff --git a/gdb/netbsd-tdep.h b/gdb/netbsd-tdep.h
> index ab13e628d582..2adf9a751e3b 100644
> --- a/gdb/netbsd-tdep.h
> +++ b/gdb/netbsd-tdep.h
> @@ -20,9 +20,6 @@
> #ifndef NBSD_TDEP_H
> #define NBSD_TDEP_H
>
> -struct link_map_offsets *nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void);
> -struct link_map_offsets *nbsd_lp64_solib_svr4_fetch_link_map_offsets (void);
> -
> int nbsd_pc_in_sigtramp (CORE_ADDR, const char *);
>
> /* NetBSD specific set of ABI-related routines. */
Both patches seem sensible to me, and the NetBSD one in particular looks right.
--
John Baldwin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] gdb: remove nbsd_{ilp32, lp64}_solib_svr4_fetch_link_map_offsets
2023-09-28 18:07 ` [PATCH 2/2] gdb: remove nbsd_{ilp32, lp64}_solib_svr4_fetch_link_map_offsets John Baldwin
@ 2023-09-28 18:24 ` Simon Marchi
2023-09-28 21:05 ` John Baldwin
0 siblings, 1 reply; 5+ messages in thread
From: Simon Marchi @ 2023-09-28 18:24 UTC (permalink / raw)
To: John Baldwin, gdb-patches
On 9/28/23 14:07, John Baldwin wrote:
> On 9/28/23 6:47 PM, Simon Marchi via Gdb-patches wrote:
>> They are unused.
>>
>> Change-Id: I9b78837d41126ce1957aa1e8b08c82a422f06cbf
>> ---
>> gdb/netbsd-tdep.c | 15 ---------------
>> gdb/netbsd-tdep.h | 3 ---
>> 2 files changed, 18 deletions(-)
>>
>> diff --git a/gdb/netbsd-tdep.c b/gdb/netbsd-tdep.c
>> index ed60200f958b..15a9e2fd7d4e 100644
>> --- a/gdb/netbsd-tdep.c
>> +++ b/gdb/netbsd-tdep.c
>> @@ -44,21 +44,6 @@
>> #define KINFO_VME_FLAG_GROWS_UP 0x00000010
>> #define KINFO_VME_FLAG_GROWS_DOWN 0x00000020
>> -/* FIXME: kettenis/20060115: We should really eliminate the next two
>> - functions completely. */
>> -
>> -struct link_map_offsets *
>> -nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void)
>> -{
>> - return svr4_ilp32_fetch_link_map_offsets ();
>> -}
>> -
>> -struct link_map_offsets *
>> -nbsd_lp64_solib_svr4_fetch_link_map_offsets (void)
>> -{
>> - return svr4_lp64_fetch_link_map_offsets ();
>> -}
>> -
>> int
>> nbsd_pc_in_sigtramp (CORE_ADDR pc, const char *func_name)
>> {
>> diff --git a/gdb/netbsd-tdep.h b/gdb/netbsd-tdep.h
>> index ab13e628d582..2adf9a751e3b 100644
>> --- a/gdb/netbsd-tdep.h
>> +++ b/gdb/netbsd-tdep.h
>> @@ -20,9 +20,6 @@
>> #ifndef NBSD_TDEP_H
>> #define NBSD_TDEP_H
>> -struct link_map_offsets *nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void);
>> -struct link_map_offsets *nbsd_lp64_solib_svr4_fetch_link_map_offsets (void);
>> -
>> int nbsd_pc_in_sigtramp (CORE_ADDR, const char *);
>> /* NetBSD specific set of ABI-related routines. */
>
> Both patches seem sensible to me, and the NetBSD one in particular looks right.
Thanks, I will push them (they could have maybe been considered
obvious). Can I add your Reviewed-By?
Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] gdb: remove nbsd_{ilp32, lp64}_solib_svr4_fetch_link_map_offsets
2023-09-28 18:24 ` Simon Marchi
@ 2023-09-28 21:05 ` John Baldwin
0 siblings, 0 replies; 5+ messages in thread
From: John Baldwin @ 2023-09-28 21:05 UTC (permalink / raw)
To: Simon Marchi, gdb-patches
On 9/28/23 7:24 PM, Simon Marchi wrote:
> On 9/28/23 14:07, John Baldwin wrote:
>> On 9/28/23 6:47 PM, Simon Marchi via Gdb-patches wrote:
>>> They are unused.
>>>
>>> Change-Id: I9b78837d41126ce1957aa1e8b08c82a422f06cbf
>>> ---
>>> gdb/netbsd-tdep.c | 15 ---------------
>>> gdb/netbsd-tdep.h | 3 ---
>>> 2 files changed, 18 deletions(-)
>>>
>>> diff --git a/gdb/netbsd-tdep.c b/gdb/netbsd-tdep.c
>>> index ed60200f958b..15a9e2fd7d4e 100644
>>> --- a/gdb/netbsd-tdep.c
>>> +++ b/gdb/netbsd-tdep.c
>>> @@ -44,21 +44,6 @@
>>> #define KINFO_VME_FLAG_GROWS_UP 0x00000010
>>> #define KINFO_VME_FLAG_GROWS_DOWN 0x00000020
>>> -/* FIXME: kettenis/20060115: We should really eliminate the next two
>>> - functions completely. */
>>> -
>>> -struct link_map_offsets *
>>> -nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void)
>>> -{
>>> - return svr4_ilp32_fetch_link_map_offsets ();
>>> -}
>>> -
>>> -struct link_map_offsets *
>>> -nbsd_lp64_solib_svr4_fetch_link_map_offsets (void)
>>> -{
>>> - return svr4_lp64_fetch_link_map_offsets ();
>>> -}
>>> -
>>> int
>>> nbsd_pc_in_sigtramp (CORE_ADDR pc, const char *func_name)
>>> {
>>> diff --git a/gdb/netbsd-tdep.h b/gdb/netbsd-tdep.h
>>> index ab13e628d582..2adf9a751e3b 100644
>>> --- a/gdb/netbsd-tdep.h
>>> +++ b/gdb/netbsd-tdep.h
>>> @@ -20,9 +20,6 @@
>>> #ifndef NBSD_TDEP_H
>>> #define NBSD_TDEP_H
>>> -struct link_map_offsets *nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void);
>>> -struct link_map_offsets *nbsd_lp64_solib_svr4_fetch_link_map_offsets (void);
>>> -
>>> int nbsd_pc_in_sigtramp (CORE_ADDR, const char *);
>>> /* NetBSD specific set of ABI-related routines. */
>>
>> Both patches seem sensible to me, and the NetBSD one in particular looks right.
>
> Thanks, I will push them (they could have maybe been considered
> obvious). Can I add your Reviewed-By?
Sure.
--
John Baldwin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-09-28 21:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-28 17:47 [PATCH 1/2] gdb: remove unused imports in solib*.[ch] Simon Marchi
2023-09-28 17:47 ` [PATCH 2/2] gdb: remove nbsd_{ilp32,lp64}_solib_svr4_fetch_link_map_offsets Simon Marchi
2023-09-28 18:07 ` [PATCH 2/2] gdb: remove nbsd_{ilp32, lp64}_solib_svr4_fetch_link_map_offsets John Baldwin
2023-09-28 18:24 ` Simon Marchi
2023-09-28 21:05 ` John Baldwin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).