* [PATCH/RFA]: Adapt solib-svr4.c for recent gdbarch_data changes
@ 2002-06-09 8:26 Mark Kettenis
2002-06-09 9:20 ` Andrew Cagney
0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2002-06-09 8:26 UTC (permalink / raw)
To: gdb-patches
Discovered this moring that my gdb was crashing. Seems like we have
an initialization cycle here. I think that after Andrew's patch we
can simplify init_fetch_link_map_offsets as in the attached patch.
OK to check this in?
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* solib-svr4.c (init_fetch_link_map_offsets): Simply return
legacy_fetch_link_map_offsets. Adjust comment to reflect reality
after Andrew's 2002-06-08 gdbarch change.
Index: solib-svr4.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-svr4.c,v
retrieving revision 1.25
diff -u -p -r1.25 solib-svr4.c
--- solib-svr4.c 12 May 2002 01:02:58 -0000 1.25
+++ solib-svr4.c 9 Jun 2002 15:22:10 -0000
@@ -1318,24 +1318,20 @@ set_solib_svr4_fetch_link_map_offsets (s
set_gdbarch_data (gdbarch, fetch_link_map_offsets_gdbarch_data, flmo);
}
-/* Initialize the architecture specific link_map_offsets fetcher.
- This is called after <arch>_gdbarch_init() has set up its struct
- gdbarch for the new architecture, so care must be taken to use the
- value set by set_solib_svr4_fetch_link_map_offsets(), above. We
- do, however, attempt to provide a reasonable alternative (for
- native targets anyway) if the <arch>_gdbarch_init() fails to call
+/* Initialize the architecture-specific link_map_offsets fetcher.
+ This is called after <arch>_gdbarch_init() has set up its `struct
+ gdbarch' for the new architecture, and is only called if the
+ link_map_offsets fetcher isn't already initialized (which is
+ usually done by calling set_solib_svr4_fetch_link_map_offsets()
+ above in <arch>_gdbarch_init()). Therefore we attempt to provide a
+ reasonable alternative (for native targets anyway) if the
+ <arch>_gdbarch_init() fails to call
set_solib_svr4_fetch_link_map_offsets(). */
static void *
init_fetch_link_map_offsets (struct gdbarch *gdbarch)
{
- struct link_map_offsets *(*flmo) =
- gdbarch_data (gdbarch, fetch_link_map_offsets_gdbarch_data);
-
- if (flmo == NULL)
- return legacy_fetch_link_map_offsets;
- else
- return flmo;
+ return legacy_fetch_link_map_offsets;
}
static struct target_so_ops svr4_so_ops;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH/RFA]: Adapt solib-svr4.c for recent gdbarch_data changes
2002-06-09 8:26 [PATCH/RFA]: Adapt solib-svr4.c for recent gdbarch_data changes Mark Kettenis
@ 2002-06-09 9:20 ` Andrew Cagney
2002-06-09 9:39 ` Mark Kettenis
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2002-06-09 9:20 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
> Discovered this moring that my gdb was crashing. Seems like we have
> an initialization cycle here. I think that after Andrew's patch we
> can simplify init_fetch_link_map_offsets as in the attached patch.
Oops! The target I tried this on sets the link map offset.
(So this also means that the cycle test works?)
> OK to check this in?
> * solib-svr4.c (init_fetch_link_map_offsets): Simply return
> legacy_fetch_link_map_offsets. Adjust comment to reflect reality
> after Andrew's 2002-06-08 gdbarch change.
I think it might have to go under an ``obvious fix''. I definitly broke
the code and the way you've changed things is the only way to do it.
I think I'll update the [about to commit] doco to reflect this.
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH/RFA]: Adapt solib-svr4.c for recent gdbarch_data changes
2002-06-09 9:20 ` Andrew Cagney
@ 2002-06-09 9:39 ` Mark Kettenis
0 siblings, 0 replies; 3+ messages in thread
From: Mark Kettenis @ 2002-06-09 9:39 UTC (permalink / raw)
To: ac131313; +Cc: gdb-patches
Date: Sun, 09 Jun 2002 12:20:01 -0400
From: Andrew Cagney <ac131313@cygnus.com>
> Discovered this moring that my gdb was crashing. Seems like we have
> an initialization cycle here. I think that after Andrew's patch we
> can simplify init_fetch_link_map_offsets as in the attached patch.
Oops! The target I tried this on sets the link map offset.
(So this also means that the cycle test works?)
Yup!
> OK to check this in?
> * solib-svr4.c (init_fetch_link_map_offsets): Simply return
> legacy_fetch_link_map_offsets. Adjust comment to reflect reality
> after Andrew's 2002-06-08 gdbarch change.
I think it might have to go under an ``obvious fix''. I definitly broke
the code and the way you've changed things is the only way to do it.
I just wasn't completely sure. Committed now.
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-06-09 16:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-09 8:26 [PATCH/RFA]: Adapt solib-svr4.c for recent gdbarch_data changes Mark Kettenis
2002-06-09 9:20 ` Andrew Cagney
2002-06-09 9:39 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox