* Re: Post Hook Patch, and Regcache.h Patch
[not found] ` <39CFDF0C.BE95DADE@ozemail.com.au>
@ 2000-09-25 23:10 ` Eli Zaretskii
0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2000-09-25 23:10 UTC (permalink / raw)
To: sbjohnson; +Cc: gdb-patches
> Date: Tue, 26 Sep 2000 09:26:04 +1000
> From: Steven Johnson <sbjohnson@ozemail.com.au>
>
> Post Hook Patch:
> Eli has accepted the document patch. There were some minor @defn problems, but
> he was going to fix them up when he applied the patch.
>
> Fernando has accepted the code patch.
>
> Neither code or document has been applied.
Sorry, I missed Fernando's approval.
I will apply the doco patch soon. I didn't do it before, since I
waited for the code to be approved.
From fnasser@cygnus.com Tue Sep 26 08:57:00 2000
From: Fernando Nasser <fnasser@cygnus.com>
To: Steven Johnson <sbjohnson@ozemail.com.au>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: Post Hook Patch, and Regcache.h Patch
Date: Tue, 26 Sep 2000 08:57:00 -0000
Message-id: <39D0C759.20E2068A@cygnus.com>
References: <200009192140.OAA23805@fishpond.ninemoons.com> <39CFDF0C.BE95DADE@ozemail.com.au>
X-SW-Source: 2000-09/msg00201.html
Content-length: 782
Steven Johnson wrote:
>
> I currently have 2 patches outstanding.
>
> This is their status as I understand it:
>
> Post Hook Patch:
> Eli has accepted the document patch. There were some minor @defn problems, but
> he was going to fix them up when he applied the patch.
>
> Fernando has accepted the code patch.
>
> Neither code or document has been applied.
>
Sorry, I was in a meeting last week. I am trying to catch up with the backlog.
I will be checking your changes in as soon as I get my tree updated, sun the
testsuite again etc. It won't be long.
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@cygnus.com
2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311
Toronto, Ontario M4P 2C9 Fax: 416-482-6299
From brolley@redhat.com Tue Sep 26 09:21:00 2000
From: Dave Brolley <brolley@redhat.com>
To: gdb-patches@sources.redhat.com, cgen@sources.redhat.com
Subject: SIM: PATCH: RFA: Rotate semantics for cgen sims
Date: Tue, 26 Sep 2000 09:21:00 -0000
Message-id: <39D0CD3A.D9B32C72@redhat.com>
X-SW-Source: 2000-09/msg00202.html
Content-length: 321
Hi,
This patch adds RORQI, ROLQI, RORHI and ROLHI to
sim/common/cgen-utils.c. These functions enable rotate semantics
for QI and HI modes.
OK to commit?
Dave
2000-09-26 Dave Brolley <brolley@redhat.com>
* cgen-utils.c (RORQI): New function.
(ROLQI): New function.
(RORHI): New function.
(ROLHI): New function.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix auto-solib-add bug (patch revised again)
[not found] <200009192140.OAA23805@fishpond.ninemoons.com>
[not found] ` <39CFDF0C.BE95DADE@ozemail.com.au>
2001-06-28 15:04 ` [PATCH] Fix auto-solib-add bug (patch revised again) Andrew Cagney
@ 2001-06-28 18:07 ` Kevin Buettner
2001-06-28 19:23 ` Fred Fish
2 siblings, 1 reply; 7+ messages in thread
From: Kevin Buettner @ 2001-06-28 18:07 UTC (permalink / raw)
To: fnf, gdb-patches
On Sep 19, 2:40pm, fnf@ninemoons.com wrote:
> Please review and apply this patch, or let me know how it needs to be
> fixed.
Fred,
Since your patch primarily touches solib related code, it appears that
I need to review it as one of the solib maintainers. (At the time it
was submitted, however, I was not a solib maintainer.)
Anway... I've looked over your patch and it looks okay. I do have a
question, however, regarding...
> ! solib_add (args, from_tty, (struct target_ops *) 0, INT_MAX >> 22);
What does ``INT_MAX >> 22'' represent? One of my concerns regarding
this expression is that if INT_MAX is less than 4194304, this
expression will turn out to be zero which is probably not desirable.
I have not tried to apply your patch, but it seems unlikely that it'll
still apply cleanly due to the changes which have occurred in GDB
since the time of patch submission. If you have the time and inclination,
I'd really appreciate it if you could revise it to apply cleanly against
the current GDB sources. If you don't, please let me know and I'll
do it...
Thanks,
Kevin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix auto-solib-add bug (patch revised again)
2001-06-28 18:07 ` Kevin Buettner
@ 2001-06-28 19:23 ` Fred Fish
2001-07-01 15:21 ` [PATCH] Fix auto-solib-add bug (patch revised 7/1/2001) Fred Fish
0 siblings, 1 reply; 7+ messages in thread
From: Fred Fish @ 2001-06-28 19:23 UTC (permalink / raw)
To: Kevin Buettner; +Cc: fnf, gdb-patches
> What does ``INT_MAX >> 22'' represent?
That was intended to provide a default threshold for the HPPA version
that interprets the solid add flag as a threshold in MB instead of a
boolean flag. I don't recall now why I chose that particular value,
perhaps it comes out as the same as the current default or maybe I
just wanted something big. Perhaps it would be fine to just replace it
with something like 1024 or something.
> the current GDB sources. If you don't, please let me know and I'll
> do it...
I'll give it a try this weekend, though I'm pretty swamped. If I get
too mired down to get to it, I'll let you know Monday. I probably
won't have time to really try it out on all the configurations that it
potentially affects though... Sigh.
-Fred
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Fix auto-solib-add bug (patch revised 7/1/2001)
2001-06-28 19:23 ` Fred Fish
@ 2001-07-01 15:21 ` Fred Fish
[not found] ` <fnf@www.ninemoons.com>
0 siblings, 1 reply; 7+ messages in thread
From: Fred Fish @ 2001-07-01 15:21 UTC (permalink / raw)
To: fnf; +Cc: Kevin Buettner, fnf, gdb-patches
> > What does ``INT_MAX >> 22'' represent?
>
> I don't recall now why I chose that particular value,
I've revised the patch so that the code uses -1 to indicate that symbols
should be unconditionally loaded such as with the "sharedlibrary" command.
Here is the latest patch, which should apply cleanly to the sourceware
gdb sources as of today. I also made a couple of other minor tweaks
and cleanups.
-Fred
2001-07-01 Fred Fish <fnf@redhat.com>
* symfile.h (auto_solib_add): Remove decl.
* coff-solib.h (auto_solib_add): Add decl.
* solib.h (auto_solib_add): Ditto.
* somsolib.h (auto_solib_add): Ditto.
* coff-solib.c (coff_solib_add): Add syms if threshold is nonzero.
* irix5-nat.c: Ditto.
* osfsolib.c (solib_add): Ditto.
* solib.c (solib_add): Ditto.
* win32-nat.c (child_solib_add): Ditto.
* irix5-nat.c (sharedlibrary_command): Pass -1 as threshold to
solib_add.
* osfsolib.c (sharedlibrary_command;): Ditto.
* pa64solib.c (pa64_solib_sharedlibrary_command): Ditto.
* solib.c (sharedlibrary_command): Ditto.
* somsolib.c (som_solib_sharedlibrary_command): Ditto.
* coff-solib.h (coff_solib_add): Adjust prototype for new threshold arg.
* pa64solib.c (add_to_solist): Ditto.
* pa64solib.c (read_dld_descriptor): Ditto.
* pa64solib.h (pa64_solib_add): Ditto.
* solib.h (solib_add): Ditto.
* somsolib.h (som_solib_add): Ditto.
* config/i386/tm-cygwin.h (child_solib_add): Ditto.
* coff-solib.c (coff_solib_add): Add new threshold arg.
* irix5-nat.c (solib_add): Ditto.
* osfsolib.c (solib_add): Ditto.
* pa64solib.c (pa64_solib_add): Ditto.
* pa64solib.c (add_to_solist): Ditto.
* pa64solib.c (read_dld_descriptor): Ditto.
* solib.c (solib_add): Ditto.
* somsolib.c (som_solib_add): Ditto.
* win32-nat.c (child_solib_add): Ditto.
* coff-solib.c (coff_solib_create_inferior_hook): Call solib_add
unconditionally with auto_solib_add.
* irix5-nat.c (solib_create_inferior_hook): Ditto.
* osfsolib.c (solib_create_inferior_hook): Ditto.
* solib-osf.c (osf_solib_create_inferior_hook): Ditto.
* solib-svr4.c (svr4_solib_create_inferior_hook): Ditto.
* corelow.c (solib_add_stub): Add auto_solib_add to args passed
via SOLIB_ADD.
* sol-thread.c (sol_thread_attach): Ditto.
* config/rs6000/nm-rs6000.h (SOLIB_ADD): Ditto.
* infcmd.c (attach_command): Remove auto_solib_add decl.
Call SOLIB_ADD directly with auto_solib_add.
* infrun.c (handle_inferior_event): Ditto.
* coff-solib.h (SOLIB_ADD): Add threshold arg.
* pa64solib.h (SOLIB_ADD): Ditto.
* solib.h (SOLIB_ADD): Ditto.
* somsolib.h (SOLIB_ADD): Ditto.
* config/i386/tm-cygwin.h (SOLIB_ADD): Ditto.
* fork-child.c (clone_and_follow_inferior): Remove unused
auto_solib_add decl.
* pa64solib.c (pa64_solib_add): Call add_to_solist with threshold.
(read_dld_descriptor): Ditto.
(pa64_solib_add): Call read_dld_descriptor with threshold.
(pa64_solib_in_dynamic_linker): Ditto.
* somsolib.c (som_solib_add): A megabyte is 1048576 bytes.
* pa64solib.c (add_to_solist): Ditto.
Index: coff-solib.c
===================================================================
RCS file: /cvs/src/src/gdb/coff-solib.c,v
retrieving revision 1.4
diff -c -p -r1.4 coff-solib.c
*** coff-solib.c 2001/06/28 19:54:41 1.4
--- coff-solib.c 2001/07/01 22:13:22
***************
*** 43,59 ****
SYNOPSIS
void coff_solib_add (char *arg_string, int from_tty,
! struct target_ops *target)
DESCRIPTION
*/
void
! coff_solib_add (char *arg_string, int from_tty, struct target_ops *target)
{
asection *libsect;
libsect = bfd_get_section_by_name (exec_bfd, ".lib");
if (libsect)
--- 43,62 ----
SYNOPSIS
void coff_solib_add (char *arg_string, int from_tty,
! struct target_ops *target, int threshold)
DESCRIPTION
*/
void
! coff_solib_add (char *arg_string, int from_tty, struct target_ops *target, int threshold)
{
asection *libsect;
+ if (threshold == 0)
+ return;
+
libsect = bfd_get_section_by_name (exec_bfd, ".lib");
if (libsect)
*************** coff_solib_add (char *arg_string, int fr
*** 127,131 ****
void
coff_solib_create_inferior_hook (void)
{
! coff_solib_add ((char *) 0, 0, (struct target_ops *) 0);
}
--- 130,134 ----
void
coff_solib_create_inferior_hook (void)
{
! coff_solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
}
Index: coff-solib.h
===================================================================
RCS file: /cvs/src/src/gdb/coff-solib.h,v
retrieving revision 1.3
diff -c -p -r1.3 coff-solib.h
*** coff-solib.h 2001/03/06 08:21:06 1.3
--- coff-solib.h 2001/07/01 22:13:22
*************** struct target_ops;
*** 30,41 ****
extern void coff_clear_solib (void);
#endif
/* Called to add symbols from a shared library to gdb's symbol table. */
! #define SOLIB_ADD(filename, from_tty, targ) \
! coff_solib_add (filename, from_tty, targ)
! extern void coff_solib_add (char *, int, struct target_ops *);
/* Function to be called when the inferior starts up, to discover the names
of shared libraries that are dynamically linked, the base addresses to
--- 30,54 ----
extern void coff_clear_solib (void);
#endif
+ /* Whether to auto load solibs at startup time:
+
+ On all platforms, 0 means "don't auto load".
+
+ On HP-UX, > 0 means a threshhold, in megabytes, of symbol table which will
+ be auto loaded. When the cumulative size of solib symbol table exceeds
+ this threshhold, solibs' symbol tables will not be loaded. A negative
+ value (used internally) means force the symbol table to be loaded.
+
+ On other platforms, != 0 means "always auto load". */
+
+ extern int auto_solib_add;
+
/* Called to add symbols from a shared library to gdb's symbol table. */
! #define SOLIB_ADD(filename, from_tty, targ, threshold) \
! coff_solib_add (filename, from_tty, targ, threshold)
! extern void coff_solib_add (char *, int, struct target_ops *, int);
/* Function to be called when the inferior starts up, to discover the names
of shared libraries that are dynamically linked, the base addresses to
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.17
diff -c -p -r1.17 corelow.c
*** corelow.c 2001/05/15 00:03:36 1.17
--- corelow.c 2001/07/01 22:13:23
*************** core_close_cleanup (void *ignore)
*** 222,228 ****
static int
solib_add_stub (PTR from_ttyp)
{
! SOLIB_ADD (NULL, *(int *) from_ttyp, ¤t_target);
re_enable_breakpoints_in_shlibs ();
return 0;
}
--- 222,228 ----
static int
solib_add_stub (PTR from_ttyp)
{
! SOLIB_ADD (NULL, *(int *) from_ttyp, ¤t_target, auto_solib_add);
re_enable_breakpoints_in_shlibs ();
return 0;
}
Index: fork-child.c
===================================================================
RCS file: /cvs/src/src/gdb/fork-child.c,v
retrieving revision 1.13
diff -c -p -r1.13 fork-child.c
*** fork-child.c 2001/05/04 04:15:24 1.13
--- fork-child.c 2001/07/01 22:13:23
*************** fork_inferior (char *exec_file_arg, char
*** 388,395 ****
void
clone_and_follow_inferior (int child_pid, int *followed_child)
{
- extern int auto_solib_add;
-
int debugger_pid;
int status;
char pid_spelling[100]; /* Arbitrary but sufficient length. */
--- 388,393 ----
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.29
diff -c -p -r1.29 infcmd.c
*** infcmd.c 2001/06/11 16:05:25 1.29
--- infcmd.c 2001/07/01 22:13:23
*************** nofp_registers_info (char *addr_exp, int
*** 1645,1654 ****
void
attach_command (char *args, int from_tty)
{
- #ifdef SOLIB_ADD
- extern int auto_solib_add;
- #endif
-
char *exec_file;
char *full_exec_path = NULL;
--- 1645,1650 ----
*************** attach_command (char *args, int from_tty
*** 1710,1721 ****
}
#ifdef SOLIB_ADD
! if (auto_solib_add)
! {
! /* Add shared library symbols from the newly attached process, if any. */
! SOLIB_ADD ((char *) 0, from_tty, ¤t_target);
! re_enable_breakpoints_in_shlibs ();
! }
#endif
/* Take any necessary post-attaching actions for this platform.
--- 1706,1714 ----
}
#ifdef SOLIB_ADD
! /* Add shared library symbols from the newly attached process, if any. */
! SOLIB_ADD ((char *) 0, from_tty, ¤t_target, auto_solib_add);
! re_enable_breakpoints_in_shlibs ();
#endif
/* Take any necessary post-attaching actions for this platform.
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.41
diff -c -p -r1.41 infrun.c
*** infrun.c 2001/06/28 21:48:41 1.41
--- infrun.c 2001/07/01 22:13:25
*************** handle_inferior_event (struct execution_
*** 1532,1546 ****
remove_breakpoints ();
/* Check for any newly added shared libraries if we're
! supposed to be adding them automatically. */
! if (auto_solib_add)
! {
! /* Switch terminal for any messages produced by
! breakpoint_re_set. */
! target_terminal_ours_for_output ();
! SOLIB_ADD (NULL, 0, NULL);
! target_terminal_inferior ();
! }
/* Reinsert breakpoints and continue. */
if (breakpoints_inserted)
--- 1532,1543 ----
remove_breakpoints ();
/* Check for any newly added shared libraries if we're
! supposed to be adding them automatically. Switch
! terminal for any messages produced by
! breakpoint_re_set. */
! target_terminal_ours_for_output ();
! SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
! target_terminal_inferior ();
/* Reinsert breakpoints and continue. */
if (breakpoints_inserted)
*************** handle_inferior_event (struct execution_
*** 2460,2474 ****
breakpoints_inserted = 0;
/* Check for any newly added shared libraries if we're
! supposed to be adding them automatically. */
! if (auto_solib_add)
! {
! /* Switch terminal for any messages produced by
! breakpoint_re_set. */
! target_terminal_ours_for_output ();
! SOLIB_ADD (NULL, 0, NULL);
! target_terminal_inferior ();
! }
/* Try to reenable shared library breakpoints, additional
code segments in shared libraries might be mapped in now. */
--- 2457,2468 ----
breakpoints_inserted = 0;
/* Check for any newly added shared libraries if we're
! supposed to be adding them automatically. Switch
! terminal for any messages produced by
! breakpoint_re_set. */
! target_terminal_ours_for_output ();
! SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
! target_terminal_inferior ();
/* Try to reenable shared library breakpoints, additional
code segments in shared libraries might be mapped in now. */
Index: irix5-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/irix5-nat.c,v
retrieving revision 1.13
diff -c -p -r1.13 irix5-nat.c
*** irix5-nat.c 2001/05/04 04:15:25 1.13
--- irix5-nat.c 2001/07/01 22:13:25
*************** symbol_add_stub (void *arg)
*** 862,875 ****
SYNOPSIS
void solib_add (char *arg_string, int from_tty,
! struct target_ops *target)
DESCRIPTION
*/
void
! solib_add (char *arg_string, int from_tty, struct target_ops *target)
{
register struct so_list *so = NULL; /* link map state variable */
--- 862,875 ----
SYNOPSIS
void solib_add (char *arg_string, int from_tty,
! struct target_ops *target, int threshold)
DESCRIPTION
*/
void
! solib_add (char *arg_string, int from_tty, struct target_ops *target, int threshold)
{
register struct so_list *so = NULL; /* link map state variable */
*************** solib_add (char *arg_string, int from_tt
*** 880,885 ****
--- 880,888 ----
int count;
int old;
+ if (threshold == 0)
+ return;
+
if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
{
error ("Invalid regexp: %s", re_err);
*************** solib_create_inferior_hook (void)
*** 1251,1258 ****
and will put out an annoying warning.
Delaying the resetting of stop_soon_quietly until after symbol loading
suppresses the warning. */
! if (auto_solib_add)
! solib_add ((char *) 0, 0, (struct target_ops *) 0);
stop_soon_quietly = 0;
}
--- 1254,1260 ----
and will put out an annoying warning.
Delaying the resetting of stop_soon_quietly until after symbol loading
suppresses the warning. */
! solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
stop_soon_quietly = 0;
}
*************** static void
*** 1274,1280 ****
sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
! solib_add (args, from_tty, (struct target_ops *) 0);
}
void
--- 1276,1282 ----
sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
! solib_add (args, from_tty, (struct target_ops *) 0, -1);
}
void
Index: osfsolib.c
===================================================================
RCS file: /cvs/src/src/gdb/osfsolib.c,v
retrieving revision 1.9
diff -c -p -r1.9 osfsolib.c
*** osfsolib.c 2001/05/04 04:15:26 1.9
--- osfsolib.c 2001/07/01 22:13:25
*************** symbol_add_stub (char *arg)
*** 596,609 ****
SYNOPSIS
void solib_add (char *arg_string, int from_tty,
! struct target_ops *target)
DESCRIPTION
*/
void
! solib_add (char *arg_string, int from_tty, struct target_ops *target)
{
register struct so_list *so = NULL; /* link map state variable */
--- 596,609 ----
SYNOPSIS
void solib_add (char *arg_string, int from_tty,
! struct target_ops *target, int threshold)
DESCRIPTION
*/
void
! solib_add (char *arg_string, int from_tty, struct target_ops *target, int threshold)
{
register struct so_list *so = NULL; /* link map state variable */
*************** solib_add (char *arg_string, int from_tt
*** 614,619 ****
--- 614,622 ----
int count;
int old;
+ if (threshold == 0)
+ return;
+
if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
{
error ("Invalid regexp: %s", re_err);
*************** solib_create_inferior_hook (void)
*** 887,894 ****
and will put out an annoying warning.
Delaying the resetting of stop_soon_quietly until after symbol loading
suppresses the warning. */
! if (auto_solib_add)
! solib_add ((char *) 0, 0, (struct target_ops *) 0);
stop_soon_quietly = 0;
}
--- 890,896 ----
and will put out an annoying warning.
Delaying the resetting of stop_soon_quietly until after symbol loading
suppresses the warning. */
! solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
stop_soon_quietly = 0;
}
*************** static void
*** 911,917 ****
sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
! solib_add (args, from_tty, (struct target_ops *) 0);
}
void
--- 913,919 ----
sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
! solib_add (args, from_tty, (struct target_ops *) 0, -1);
}
void
Index: pa64solib.c
===================================================================
RCS file: /cvs/src/src/gdb/pa64solib.c,v
retrieving revision 1.11
diff -c -p -r1.11 pa64solib.c
*** pa64solib.c 2001/03/06 08:21:11 1.11
--- pa64solib.c 2001/07/01 22:13:26
*************** static void pa64_solib_sharedlibrary_com
*** 127,137 ****
static void *pa64_target_read_memory (void *, CORE_ADDR, size_t, int);
! static boolean read_dld_descriptor (struct target_ops *);
static boolean read_dynamic_info (asection *, dld_cache_t *);
! static void add_to_solist (boolean, char *, struct load_module_desc *,
CORE_ADDR, struct target_ops *);
/* When examining the shared library for debugging information we have to
--- 127,137 ----
static void *pa64_target_read_memory (void *, CORE_ADDR, size_t, int);
! static boolean read_dld_descriptor (struct target_ops *, int threshold);
static boolean read_dynamic_info (asection *, dld_cache_t *);
! static void add_to_solist (boolean, char *, int, struct load_module_desc *,
CORE_ADDR, struct target_ops *);
/* When examining the shared library for debugging information we have to
*************** pa64_solib_load_symbols (struct so_list
*** 372,378 ****
be exceeded. */
void
! pa64_solib_add (char *arg_string, int from_tty, struct target_ops *target)
{
struct minimal_symbol *msymbol;
CORE_ADDR addr;
--- 372,378 ----
be exceeded. */
void
! pa64_solib_add (char *arg_string, int from_tty, struct target_ops *target, int threshold)
{
struct minimal_symbol *msymbol;
CORE_ADDR addr;
*************** pa64_solib_add (char *arg_string, int fr
*** 415,421 ****
/* Read in the load map pointer if we have not done so already. */
if (! dld_cache.have_read_dld_descriptor)
! if (! read_dld_descriptor (target))
return;
/* If the libraries were not mapped private, warn the user. */
--- 415,421 ----
/* Read in the load map pointer if we have not done so already. */
if (! dld_cache.have_read_dld_descriptor)
! if (! read_dld_descriptor (target, threshold))
return;
/* If the libraries were not mapped private, warn the user. */
*************** pa64_solib_add (char *arg_string, int fr
*** 439,445 ****
if (!dll_path)
error ("pa64_solib_add, unable to read shared library path.");
! add_to_solist (from_tty, dll_path, &dll_desc, 0, target);
}
}
--- 439,445 ----
if (!dll_path)
error ("pa64_solib_add, unable to read shared library path.");
! add_to_solist (from_tty, dll_path, threshold, &dll_desc, 0, target);
}
}
*************** pa64_solib_in_dynamic_linker (int pid, C
*** 700,706 ****
return 0;
if (!dld_cache.have_read_dld_descriptor)
! if (!read_dld_descriptor (¤t_target))
return 0;
return (pc >= dld_cache.dld_desc.text_base
--- 700,706 ----
return 0;
if (!dld_cache.have_read_dld_descriptor)
! if (!read_dld_descriptor (¤t_target, auto_solib_add))
return 0;
return (pc >= dld_cache.dld_desc.text_base
*************** static void
*** 818,824 ****
pa64_solib_sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
! pa64_solib_add (args, from_tty, (struct target_ops *) 0);
}
/* Return the name of the shared library containing ADDR or NULL if ADDR
--- 818,824 ----
pa64_solib_sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
! pa64_solib_add (args, from_tty, (struct target_ops *) 0, -1);
}
/* Return the name of the shared library containing ADDR or NULL if ADDR
*************** so_lib_thread_start_addr (struct so_list
*** 927,933 ****
return nonzero. */
static boolean
! read_dld_descriptor (struct target_ops *target)
{
char *dll_path;
asection *dyninfo_sect;
--- 927,933 ----
return nonzero. */
static boolean
! read_dld_descriptor (struct target_ops *target, int threshold)
{
char *dll_path;
asection *dyninfo_sect;
*************** read_dld_descriptor (struct target_ops *
*** 986,992 ****
pa64_target_read_memory,
0,
dld_cache.load_map);
! add_to_solist(0, dll_path, &dld_cache.dld_desc, 0, target);
return 1;
}
--- 986,992 ----
pa64_target_read_memory,
0,
dld_cache.load_map);
! add_to_solist(0, dll_path, threshold, &dld_cache.dld_desc, 0, target);
return 1;
}
*************** pa64_target_read_memory (void *buffer, C
*** 1093,1099 ****
be read from the inferior process at the address load_module_desc_addr. */
static void
! add_to_solist (boolean from_tty, char *dll_path,
struct load_module_desc *load_module_desc_p,
CORE_ADDR load_module_desc_addr, struct target_ops *target)
{
--- 1093,1099 ----
be read from the inferior process at the address load_module_desc_addr. */
static void
! add_to_solist (boolean from_tty, char *dll_path, int threshold,
struct load_module_desc *load_module_desc_p,
CORE_ADDR load_module_desc_addr, struct target_ops *target)
{
*************** add_to_solist (boolean from_tty, char *d
*** 1157,1164 ****
st_size = pa64_solib_sizeof_symbol_table (dll_path);
pa64_solib_st_size_threshhold_exceeded =
!from_tty
&& ( (st_size + pa64_solib_total_st_size)
! > (auto_solib_add * (LONGEST)1000000));
if (pa64_solib_st_size_threshhold_exceeded)
{
pa64_solib_add_solib_objfile (new_so, dll_path, from_tty, 1);
--- 1157,1165 ----
st_size = pa64_solib_sizeof_symbol_table (dll_path);
pa64_solib_st_size_threshhold_exceeded =
!from_tty
+ && (threshold >= 0)
&& ( (st_size + pa64_solib_total_st_size)
! > (threshold * (LONGEST)1048576));
if (pa64_solib_st_size_threshhold_exceeded)
{
pa64_solib_add_solib_objfile (new_so, dll_path, from_tty, 1);
Index: pa64solib.h
===================================================================
RCS file: /cvs/src/src/gdb/pa64solib.h,v
retrieving revision 1.3
diff -c -p -r1.3 pa64solib.h
*** pa64solib.h 2001/03/06 08:21:11 1.3
--- pa64solib.h 2001/07/01 22:13:26
*************** struct section_offsets;
*** 25,34 ****
/* Called to add symbols from a shared library to gdb's symbol table. */
! #define SOLIB_ADD(filename, from_tty, targ) \
! pa64_solib_add (filename, from_tty, targ)
! extern void pa64_solib_add (char *, int, struct target_ops *);
extern CORE_ADDR pa64_solib_get_got_by_pc (CORE_ADDR);
--- 25,34 ----
/* Called to add symbols from a shared library to gdb's symbol table. */
! #define SOLIB_ADD(filename, from_tty, targ, threshold) \
! pa64_solib_add (filename, from_tty, targ, threshold)
! extern void pa64_solib_add (char *, int, struct target_ops *, int);
extern CORE_ADDR pa64_solib_get_got_by_pc (CORE_ADDR);
Index: sol-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/sol-thread.c,v
retrieving revision 1.27
diff -c -p -r1.27 sol-thread.c
*** sol-thread.c 2001/05/15 00:03:36 1.27
--- sol-thread.c 2001/07/01 22:13:26
*************** sol_thread_attach (char *args, int from_
*** 415,421 ****
procfs_ops.to_attach (args, from_tty);
/* Must get symbols from solibs before libthread_db can run! */
! SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0);
if (sol_thread_active)
{
--- 415,421 ----
procfs_ops.to_attach (args, from_tty);
/* Must get symbols from solibs before libthread_db can run! */
! SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0, auto_solib_add);
if (sol_thread_active)
{
Index: solib-osf.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-osf.c,v
retrieving revision 1.2
diff -c -p -r1.2 solib-osf.c
*** solib-osf.c 2001/06/28 10:36:19 1.2
--- solib-osf.c 2001/07/01 22:13:26
*************** osf_solib_create_inferior_hook (void)
*** 336,343 ****
and will put out an annoying warning.
Delaying the resetting of stop_soon_quietly until after symbol loading
suppresses the warning. */
! if (auto_solib_add)
! solib_add ((char *) 0, 0, (struct target_ops *) 0);
stop_soon_quietly = 0;
/* Enable breakpoints disabled (unnecessarily) by clear_solib(). */
--- 336,342 ----
and will put out an annoying warning.
Delaying the resetting of stop_soon_quietly until after symbol loading
suppresses the warning. */
! solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
stop_soon_quietly = 0;
/* Enable breakpoints disabled (unnecessarily) by clear_solib(). */
Index: solib-svr4.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-svr4.c,v
retrieving revision 1.15
diff -c -p -r1.15 solib-svr4.c
*** solib-svr4.c 2001/05/04 04:15:27 1.15
--- solib-svr4.c 2001/07/01 22:13:27
*************** svr4_solib_create_inferior_hook (void)
*** 1594,1601 ****
warning ("shared library handler failed to disable breakpoint");
}
! if (auto_solib_add)
! solib_add ((char *) 0, 0, (struct target_ops *) 0);
#endif /* ! _SCO_DS */
#endif
}
--- 1594,1600 ----
warning ("shared library handler failed to disable breakpoint");
}
! solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
#endif /* ! _SCO_DS */
#endif
}
Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.42
diff -c -p -r1.42 solib.c
*** solib.c 2001/06/04 07:45:08 1.42
--- solib.c 2001/07/01 22:13:27
*************** update_solib_list (int from_tty, struct
*** 493,499 ****
SYNOPSIS
! void solib_add (char *pattern, int from_tty, struct target_ops *TARGET)
DESCRIPTION
--- 493,500 ----
SYNOPSIS
! void solib_add (char *pattern, int from_tty, struct target_ops
! *TARGET, int threshold)
DESCRIPTION
*************** update_solib_list (int from_tty, struct
*** 501,510 ****
match PATTERN. (If we've already read a shared object's symbol
info, leave it alone.) If PATTERN is zero, read them all.
FROM_TTY and TARGET are as described for update_solib_list, above. */
void
! solib_add (char *pattern, int from_tty, struct target_ops *target)
{
struct so_list *gdb;
--- 502,513 ----
match PATTERN. (If we've already read a shared object's symbol
info, leave it alone.) If PATTERN is zero, read them all.
+ If THRESHOLD is 0, defer reading symbolic information until later.
+
FROM_TTY and TARGET are as described for update_solib_list, above. */
void
! solib_add (char *pattern, int from_tty, struct target_ops *target, int threshold)
{
struct so_list *gdb;
*************** solib_add (char *pattern, int from_tty,
*** 538,544 ****
}
else
{
! if (catch_errors
(symbol_add_stub, gdb,
"Error while reading shared library symbols:\n",
RETURN_MASK_ALL))
--- 541,547 ----
}
else
{
! if ((threshold != 0) && catch_errors
(symbol_add_stub, gdb,
"Error while reading shared library symbols:\n",
RETURN_MASK_ALL))
*************** static void
*** 804,810 ****
sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
! solib_add (args, from_tty, (struct target_ops *) 0);
}
/* LOCAL FUNCTION
--- 807,813 ----
sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
! solib_add (args, from_tty, (struct target_ops *) 0, -1);
}
/* LOCAL FUNCTION
Index: solib.h
===================================================================
RCS file: /cvs/src/src/gdb/solib.h,v
retrieving revision 1.7
diff -c -p -r1.7 solib.h
*** solib.h 2001/05/14 18:45:45 1.7
--- solib.h 2001/07/01 22:13:27
*************** struct target_ops;
*** 29,40 ****
extern void clear_solib (void);
/* Called to add symbols from a shared library to gdb's symbol table. */
! #define SOLIB_ADD(filename, from_tty, targ) \
! solib_add (filename, from_tty, targ)
! extern void solib_add (char *, int, struct target_ops *);
/* Function to be called when the inferior starts up, to discover the names
of shared libraries that are dynamically linked, the base addresses to
--- 29,53 ----
extern void clear_solib (void);
+ /* Whether to auto load solibs at startup time:
+
+ On all platforms, 0 means "don't auto load".
+
+ On HP-UX, > 0 means a threshhold, in megabytes, of symbol table which will
+ be auto loaded. When the cumulative size of solib symbol table exceeds
+ this threshhold, solibs' symbol tables will not be loaded. A negative
+ value (used internally) means force the symbol table to be loaded.
+
+ On other platforms, != 0 means "always auto load". */
+
+ extern int auto_solib_add;
+
/* Called to add symbols from a shared library to gdb's symbol table. */
! #define SOLIB_ADD(filename, from_tty, targ, threshold) \
! solib_add (filename, from_tty, targ, threshold)
! extern void solib_add (char *, int, struct target_ops *, int);
/* Function to be called when the inferior starts up, to discover the names
of shared libraries that are dynamically linked, the base addresses to
Index: somsolib.c
===================================================================
RCS file: /cvs/src/src/gdb/somsolib.c,v
retrieving revision 1.12
diff -c -p -r1.12 somsolib.c
*** somsolib.c 2001/05/06 22:22:03 1.12
--- somsolib.c 2001/07/01 22:13:28
*************** som_solib_load_symbols (struct so_list *
*** 403,413 ****
/* Add symbols from shared libraries into the symtab list, unless the
! size threshold (specified by auto_solib_add, in megabytes) would
! be exceeded. */
void
! som_solib_add (char *arg_string, int from_tty, struct target_ops *target)
{
struct minimal_symbol *msymbol;
struct so_list *so_list_tail;
--- 403,414 ----
/* Add symbols from shared libraries into the symtab list, unless the
! size threshold (specified by THRESHOLD, in megabytes) would be
! exceeded. A negative threshold means force symbols to be
! loaded. */
void
! som_solib_add (char *arg_string, int from_tty, struct target_ops *target, int threshold)
{
struct minimal_symbol *msymbol;
struct so_list *so_list_tail;
*************** som_solib_add (char *arg_string, int fro
*** 777,783 ****
st_size = som_solib_sizeof_symbol_table (name);
som_solib_st_size_threshold_exceeded =
!from_tty &&
! ((st_size + som_solib_total_st_size) > (auto_solib_add * (LONGEST) 1000000));
if (som_solib_st_size_threshold_exceeded)
{
--- 778,785 ----
st_size = som_solib_sizeof_symbol_table (name);
som_solib_st_size_threshold_exceeded =
!from_tty &&
! (threshold >= 0) &&
! ((st_size + som_solib_total_st_size) > (threshold * (LONGEST) 1048576));
if (som_solib_st_size_threshold_exceeded)
{
*************** static void
*** 1467,1473 ****
som_solib_sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
! som_solib_add (args, from_tty, (struct target_ops *) 0);
}
--- 1469,1475 ----
som_solib_sharedlibrary_command (char *args, int from_tty)
{
dont_repeat ();
! som_solib_add (args, from_tty, (struct target_ops *) 0, -1);
}
Index: somsolib.h
===================================================================
RCS file: /cvs/src/src/gdb/somsolib.h,v
retrieving revision 1.3
diff -c -p -r1.3 somsolib.h
*** somsolib.h 2001/03/06 08:21:17 1.3
--- somsolib.h 2001/07/01 22:13:28
*************** struct target_ops;
*** 27,38 ****
struct objfile;
struct section_offsets;
/* Called to add symbols from a shared library to gdb's symbol table. */
! #define SOLIB_ADD(filename, from_tty, targ) \
! som_solib_add (filename, from_tty, targ)
! extern void som_solib_add (char *, int, struct target_ops *);
extern CORE_ADDR som_solib_get_got_by_pc (CORE_ADDR);
--- 27,51 ----
struct objfile;
struct section_offsets;
+ /* Whether to auto load solibs at startup time:
+
+ On all platforms, 0 means "don't auto load".
+
+ On HP-UX, > 0 means a threshhold, in megabytes, of symbol table which will
+ be auto loaded. When the cumulative size of solib symbol table exceeds
+ this threshhold, solibs' symbol tables will not be loaded. A negative
+ value (used internally) means force the symbol table to be loaded.
+
+ On other platforms, != 0 means "always auto load". */
+
+ extern int auto_solib_add;
+
/* Called to add symbols from a shared library to gdb's symbol table. */
! #define SOLIB_ADD(filename, from_tty, targ, threshold) \
! som_solib_add (filename, from_tty, targ, threshold)
! extern void som_solib_add (char *, int, struct target_ops *, int);
extern CORE_ADDR som_solib_get_got_by_pc (CORE_ADDR);
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.34
diff -c -p -r1.34 symfile.c
*** symfile.c 2001/06/06 17:12:30 1.34
--- symfile.c 2001/07/01 22:13:28
*************** int symbol_reloading = 0;
*** 192,199 ****
report all the functions that are actually present.
Note that HP-UX interprets this variable to mean, "threshhold size
! in megabytes, where zero means never add". Other platforms interpret
! this variable to mean, "always add if non-zero, never add if zero."
*/
int auto_solib_add = 1;
--- 192,201 ----
report all the functions that are actually present.
Note that HP-UX interprets this variable to mean, "threshhold size
! in megabytes, where zero means never add and negative means always
! add". Other platforms interpret this variable to mean, "always add
! if non-zero, never add if zero."
!
*/
int auto_solib_add = 1;
Index: symfile.h
===================================================================
RCS file: /cvs/src/src/gdb/symfile.h,v
retrieving revision 1.9
diff -c -p -r1.9 symfile.h
*** symfile.h 2001/03/06 08:21:17 1.9
--- symfile.h 2001/07/01 22:13:29
*************** extern char *obconcat (struct obstack *o
*** 218,236 ****
/* Variables */
- /* whether to auto load solibs at startup time: 0/1.
-
- On all platforms, 0 means "don't auto load".
-
- On HP-UX, > 0 means a threshhold, in megabytes, of symbol table which will
- be auto loaded. When the cumulative size of solib symbol table exceeds
- this threshhold, solibs' symbol tables will not be loaded.
-
- On other platforms, > 0 means, "always auto load".
- */
-
- extern int auto_solib_add;
-
/* From symfile.c */
extern CORE_ADDR entry_point_address (void);
--- 218,223 ----
Index: win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.27
diff -c -p -r1.27 win32-nat.c
*** win32-nat.c 2001/05/04 04:15:28 1.27
--- win32-nat.c 2001/07/01 22:13:29
*************** out:
*** 1633,1640 ****
}
void
! child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED, struct target_ops *target)
{
if (core_bfd)
{
child_clear_solibs ();
--- 1633,1643 ----
}
void
! child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED, struct target_ops *target, int threshold)
{
+ if (threshold == 0)
+ return;
+
if (core_bfd)
{
child_clear_solibs ();
Index: config/i386/tm-cygwin.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-cygwin.h,v
retrieving revision 1.8
diff -c -p -r1.8 tm-cygwin.h
*** config/i386/tm-cygwin.h 2001/05/04 04:15:31 1.8
--- config/i386/tm-cygwin.h 2001/07/01 22:13:29
*************** extern CORE_ADDR skip_trampoline_code (C
*** 32,45 ****
#endif
#define ATTACH_NO_WAIT
! #define SOLIB_ADD(filename, from_tty, targ) child_solib_add(filename, from_tty, targ)
#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_pathname(pid)
#define CLEAR_SOLIB child_clear_solibs
#define ADD_SHARED_SYMBOL_FILES dll_symbol_command
struct target_ops;
char *cygwin_pid_to_str (ptid_t ptid);
! void child_solib_add (char *, int, struct target_ops *);
char *child_solib_loaded_library_pathname(int);
void child_clear_solibs (void);
void dll_symbol_command (char *, int);
--- 32,45 ----
#endif
#define ATTACH_NO_WAIT
! #define SOLIB_ADD(filename, from_tty, targ, threshold) child_solib_add(filename, from_tty, targ, threshold)
#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_pathname(pid)
#define CLEAR_SOLIB child_clear_solibs
#define ADD_SHARED_SYMBOL_FILES dll_symbol_command
struct target_ops;
char *cygwin_pid_to_str (ptid_t ptid);
! void child_solib_add (char *, int, struct target_ops *, int);
char *child_solib_loaded_library_pathname(int);
void child_clear_solibs (void);
void dll_symbol_command (char *, int);
Index: config/rs6000/nm-rs6000.h
===================================================================
RCS file: /cvs/src/src/gdb/config/rs6000/nm-rs6000.h,v
retrieving revision 1.8
diff -c -p -r1.8 nm-rs6000.h
*** config/rs6000/nm-rs6000.h 2001/05/04 04:15:33 1.8
--- config/rs6000/nm-rs6000.h 2001/07/01 22:13:29
***************
*** 43,49 ****
/* When a target process or core-file has been attached, we sneak in
and figure out where the shared libraries have got to. */
! #define SOLIB_ADD(a, b, c) \
if (PIDGET (inferior_ptid)) \
/* Attach to process. */ \
xcoff_relocate_symtab (PIDGET (inferior_ptid)); \
--- 43,49 ----
/* When a target process or core-file has been attached, we sneak in
and figure out where the shared libraries have got to. */
! #define SOLIB_ADD(a, b, c, threshold) \
if (PIDGET (inferior_ptid)) \
/* Attach to process. */ \
xcoff_relocate_symtab (PIDGET (inferior_ptid)); \
Index: doc/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/doc/ChangeLog,v
retrieving revision 1.79
diff -c -p -r1.79 ChangeLog
*** doc/ChangeLog 2001/06/29 16:21:45 1.79
--- doc/ChangeLog 2001/07/01 22:13:30
***************
*** 1,3 ****
--- 1,7 ----
+ 2001-07-01 Fred Fish <fnf@redhat.com>
+
+ * gdbint.texinfo (SOLIB_ADD): Document the new threshold arg.
+
2001-06-28 Andrew Cagney <ac131313@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Update
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.28
diff -c -p -r1.28 gdbint.texinfo
*** doc/gdbint.texinfo 2001/06/29 16:21:45 1.28
--- doc/gdbint.texinfo 2001/07/01 22:13:32
*************** Defaults to @code{"/bin/sh"}.
*** 3823,3829 ****
@item SOLIB_ADD (@var{filename}, @var{from_tty}, @var{targ})
@findex SOLIB_ADD
Define this to expand into an expression that will cause the symbols in
! @var{filename} to be added to @value{GDBN}'s symbol table.
@item SOLIB_CREATE_INFERIOR_HOOK
@findex SOLIB_CREATE_INFERIOR_HOOK
--- 3823,3834 ----
@item SOLIB_ADD (@var{filename}, @var{from_tty}, @var{targ})
@findex SOLIB_ADD
Define this to expand into an expression that will cause the symbols in
! @var{filename} to be added to @value{GDBN}'s symbol table. If
! @var{threshold} is zero symbols are not read but any necessary low level
! processing for @var{filename} is still done. If @var{threshold} is
! non-zero, it is interpreted on some systems as a threshold (in MB) above
! which symbol reading is suppressed, and on all other systems as a flag
! to enable symbol reading.
@item SOLIB_CREATE_INFERIOR_HOOK
@findex SOLIB_CREATE_INFERIOR_HOOK
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix auto-solib-add bug (patch revised 7/1/2001)
[not found] ` <1010702215326.ZM24300@ocotillo.lan>
@ 2001-07-02 14:56 ` Christopher Faylor
2001-07-13 15:03 ` Elena Zannoni
1 sibling, 0 replies; 7+ messages in thread
From: Christopher Faylor @ 2001-07-02 14:56 UTC (permalink / raw)
To: gdb-patches
On Mon, Jul 02, 2001 at 02:53:26PM -0700, Kevin Buettner wrote:
>One of the problems with approving this patch is that it touches a lot
>of files for which I am not a maintainer. I have spoken with Michael
>Snyder regarding your changes to infcmd.c and infrun.c and he has no
>problem with them. I believe that the rest of the changes are
>"obvious" once the rest of your changes are accepted, but just the
>same it probably wouldn't hurt to wait a couple of days before
>checking them in just in case some other maintainer has issues...
FWIW, The win32-nat.c part of the patch is approved.
cgf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix auto-solib-add bug (patch revised 7/1/2001)
[not found] ` <1010702215326.ZM24300@ocotillo.lan>
2001-07-02 14:56 ` Christopher Faylor
@ 2001-07-13 15:03 ` Elena Zannoni
1 sibling, 0 replies; 7+ messages in thread
From: Elena Zannoni @ 2001-07-13 15:03 UTC (permalink / raw)
To: Kevin Buettner; +Cc: fnf, gdb-patches
Kevin Buettner writes:
> On Jul 1, 3:07pm, Fred Fish wrote:
>
> > Here is the latest patch, which should apply cleanly to the sourceware
> > gdb sources as of today. I also made a couple of other minor tweaks
> > and cleanups.
>
> Fred,
>
> Your patch is approved except for the portions which move the
> declaration of auto_solib_add from symfile.h to coff-solib.h, solib.h,
> and somsolib.h. I would prefer that you submit a separate patch for
> this change. (I spoke with Jim Blandy about them and he pointed out
> that the declaration of auto_solib_add ought to stay in symfile.h so
> long as the definition remains in symfile.c.) In any event, I think
> that moving the declaration of auto_solib_add qualifies as a cleanup
> activity and isn't necessary for the rest of your patch to work.
>
> One of the problems with approving this patch is that it touches a lot
> of files for which I am not a maintainer. I have spoken with Michael
> Snyder regarding your changes to infcmd.c and infrun.c and he has no
> problem with them. I believe that the rest of the changes are
> "obvious" once the rest of your changes are accepted, but just the
> same it probably wouldn't hurt to wait a couple of days before
> checking them in just in case some other maintainer has issues...
>
Actually I have a question about auto_solib_add. Is there any way to
remove the overloaded meaning of 'threshold' that HP has given to this
variable? On some platforms it is a boolean, on others (HPUX) it is
a threshold in megabytes. I am not familiar with the code, but is
there a way to have an extra auto_solib_threshold variable, and
possibly make auto_solib_add an enum?
I also agree with Jim abd Kevin about keeping the definition in
symfile.h.
Elena
> Kevin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix auto-solib-add bug (patch revised again)
[not found] <200009192140.OAA23805@fishpond.ninemoons.com>
[not found] ` <39CFDF0C.BE95DADE@ozemail.com.au>
@ 2001-06-28 15:04 ` Andrew Cagney
2001-06-28 18:07 ` Kevin Buettner
2 siblings, 0 replies; 7+ messages in thread
From: Andrew Cagney @ 2001-06-28 15:04 UTC (permalink / raw)
To: fnf; +Cc: gdb-patches
Did anyone get to this patch?
Andrew
> This is the third patch I've posted for this problem. As it turns
> out, the second patch was too simple and the "attach" command ignored
> the value of auto-solib-add.
>
> Neither of the previous patches have been applied yet, so they can be
> ignored.
>
> Please review and apply this patch, or let me know how it needs to be
> fixed.
>
> Thanks
>
> -Fred
>
> ============================================================================
>
> 2000-09-19 Fred Fish <fnf@cygnus.com>
>
> * symfile.h (auto_solib_add): Remove decl.
> * coff-solib.h (auto_solib_add): Add decl.
> * solib.h (auto_solib_add): Ditto.
> * somsolib.h (auto_solib_add): Ditto.
>
> * coff-solib.c (coff_solib_add): Add syms if threshold is nonzero.
> * irix5-nat.c: Ditto.
> * osfsolib.c (solib_add): Ditto.
> * solib.c (solib_add): Ditto.
> * xcoffsolib.c (solib_add): Ditto.
>
> * irix5-nat.c (sharedlibrary_command): Pass large integer value as
> threshold arg to solib_add.
> * osfsolib.c (sharedlibrary_command;): Ditto.
> * pa64solib.c (pa64_solib_sharedlibrary_command): Ditto.
> * solib.c (sharedlibrary_command): Ditto.
> * somsolib.c (som_solib_sharedlibrary_command): Ditto.
> * xcoffsolib.c (sharedlibrary_command): Ditto.
>
> * coff-solib.h (coff_solib_add): Adjust prototype for new threshold arg.
> * pa64solib.c (add_to_solist): Ditto.
> * pa64solib.h (pa64_solib_add): Ditto.
> * solib.h (solib_add): Ditto.
> * somsolib.h (som_solib_add): Ditto.
> * config/i386/tm-cygwin.h (child_solib_add): Ditto.
>
> * coff-solib.c (coff_solib_add): Add new threshold arg.
> * irix5-nat.c (solib_add): Ditto.
> * osfsolib.c (solib_add): Ditto.
> * pa64solib.c (add_to_solist): Ditto.
> * solib.c (solib_add): Ditto.
> * somsolib.c (som_solib_add): Ditto.
> * win32-nat.c (child_solib_add): Ditto.
> * xcoffsolib.c (solib_add): Ditto.
>
> * coff-solib.c (coff_solib_create_inferior_hook): Call solib_add
> unconditionally with auto_solib_add.
> * irix5-nat.c (solib_create_inferior_hook): Ditto.
> * osfsolib.c (solib_create_inferior_hook): Ditto.
> * solib.c (solib_create_inferior_hook): Ditto.
>
> * corelow.c (solib_add_stub): Add auto_solib_add to args passed
> via SOLIB_ADD.
> * sol-thread.c (sol_thread_attach): Ditto.
> * config/rs6000/nm-rs6000.h (SOLIB_ADD): Ditto.
>
> * infcmd.c (attach_command): Remove auto_solib_add decl.
> Call SOLIB_ADD directly with auto_solib_add.
> * infrun.c (wait_for_inferior): Ditto.
>
> * coff-solib.h (SOLIB_ADD): Add threshold arg.
> * pa64solib.h (SOLIB_ADD): Ditto.
> * solib.h (SOLIB_ADD): Ditto.
> * somsolib.h (SOLIB_ADD): Ditto.
> * config/i386/tm-cygwin.h (SOLIB_ADD): Ditto.
>
> * fork-child.c (clone_and_follow_inferior): Remove unused
> auto_solib_add decl.
>
> * pa64solib.c (pa64_solib_add): Call add_to_solist with threshold.
> (read_dld_descriptor): Ditto.
>
> Index: coff-solib.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/coff-solib.c,v
> retrieving revision 1.2
> diff -c -p -r1.2 coff-solib.c
> *** coff-solib.c 2000/07/30 01:48:24 1.2
> --- coff-solib.c 2000/09/19 21:36:02
> ***************
> *** 41,57 ****
> SYNOPSIS
>
> void coff_solib_add (char *arg_string, int from_tty,
> ! struct target_ops *target)
>
> DESCRIPTION
>
> */
>
> void
> ! coff_solib_add (char *arg_string, int from_tty, struct target_ops *target)
> {
> asection *libsect;
>
> libsect = bfd_get_section_by_name (exec_bfd, ".lib");
>
> if (libsect)
> --- 41,60 ----
> SYNOPSIS
>
> void coff_solib_add (char *arg_string, int from_tty,
> ! struct target_ops *target, int threshold)
>
> DESCRIPTION
>
> */
>
> void
> ! coff_solib_add (char *arg_string, int from_tty, struct target_ops *target, int threshold)
> {
> asection *libsect;
>
> + if (threshold == 0)
> + return;
> +
> libsect = bfd_get_section_by_name (exec_bfd, ".lib");
>
> if (libsect)
> *************** coff_solib_add (char *arg_string, int fr
> *** 125,129 ****
> void
> coff_solib_create_inferior_hook (void)
> {
> ! coff_solib_add ((char *) 0, 0, (struct target_ops *) 0);
> }
> --- 128,132 ----
> void
> coff_solib_create_inferior_hook (void)
> {
> ! coff_solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
> }
> Index: coff-solib.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/coff-solib.h,v
> retrieving revision 1.2
> diff -c -p -r1.2 coff-solib.h
> *** coff-solib.h 2000/05/28 01:12:26 1.2
> --- coff-solib.h 2000/09/19 21:36:02
> *************** struct target_ops;
> *** 30,41 ****
> extern void coff_clear_solib (void);
> #endif
>
> /* Called to add symbols from a shared library to gdb's symbol table. */
>
> ! #define SOLIB_ADD(filename, from_tty, targ) \
> ! coff_solib_add (filename, from_tty, targ)
>
> ! extern void coff_solib_add (char *, int, struct target_ops *);
>
> /* Function to be called when the inferior starts up, to discover the names
> of shared libraries that are dynamically linked, the base addresses to
> --- 30,53 ----
> extern void coff_clear_solib (void);
> #endif
>
> + /* Whether to auto load solibs at startup time: 0/1.
> +
> + On all platforms, 0 means "don't auto load".
> +
> + On HP-UX, > 0 means a threshhold, in megabytes, of symbol table which will
> + be auto loaded. When the cumulative size of solib symbol table exceeds
> + this threshhold, solibs' symbol tables will not be loaded.
> +
> + On other platforms, > 0 means, "always auto load". */
> +
> + extern int auto_solib_add;
> +
> /* Called to add symbols from a shared library to gdb's symbol table. */
>
> ! #define SOLIB_ADD(filename, from_tty, targ, threshold) \
> ! coff_solib_add (filename, from_tty, targ, threshold)
>
> ! extern void coff_solib_add (char *, int, struct target_ops *, int);
>
> /* Function to be called when the inferior starts up, to discover the names
> of shared libraries that are dynamically linked, the base addresses to
> Index: corelow.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/corelow.c,v
> retrieving revision 1.9
> diff -c -p -r1.9 corelow.c
> *** corelow.c 2000/09/01 23:41:20 1.9
> --- corelow.c 2000/09/19 21:36:02
> *************** core_close_cleanup (void *ignore)
> *** 219,225 ****
> static int
> solib_add_stub (PTR from_ttyp)
> {
> ! SOLIB_ADD (NULL, *(int *) from_ttyp, ¤t_target);
> re_enable_breakpoints_in_shlibs ();
> return 0;
> }
> --- 219,225 ----
> static int
> solib_add_stub (PTR from_ttyp)
> {
> ! SOLIB_ADD (NULL, *(int *) from_ttyp, ¤t_target, auto_solib_add);
> re_enable_breakpoints_in_shlibs ();
> return 0;
> }
> Index: fork-child.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/fork-child.c,v
> retrieving revision 1.6
> diff -c -p -r1.6 fork-child.c
> *** fork-child.c 2000/09/01 23:39:11 1.6
> --- fork-child.c 2000/09/19 21:36:03
> *************** fork_inferior (char *exec_file, char *al
> *** 380,387 ****
> void
> clone_and_follow_inferior (int child_pid, int *followed_child)
> {
> - extern int auto_solib_add;
> -
> int debugger_pid;
> int status;
> char pid_spelling[100]; /* Arbitrary but sufficient length. */
> --- 380,385 ----
> Index: infcmd.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/infcmd.c,v
> retrieving revision 1.11
> diff -c -p -r1.11 infcmd.c
> *** infcmd.c 2000/09/02 00:07:13 1.11
> --- infcmd.c 2000/09/19 21:36:03
> *************** nofp_registers_info (char *addr_exp, int
> *** 1624,1633 ****
> void
> attach_command (char *args, int from_tty)
> {
> - #ifdef SOLIB_ADD
> - extern int auto_solib_add;
> - #endif
> -
> char *exec_file;
> char *full_exec_path = NULL;
>
> --- 1624,1629 ----
> *************** attach_command (char *args, int from_tty
> *** 1689,1700 ****
> }
>
> #ifdef SOLIB_ADD
> ! if (auto_solib_add)
> ! {
> ! /* Add shared library symbols from the newly attached process, if any. */
> ! SOLIB_ADD ((char *) 0, from_tty, ¤t_target);
> ! re_enable_breakpoints_in_shlibs ();
> ! }
> #endif
>
> /* Take any necessary post-attaching actions for this platform.
> --- 1685,1693 ----
> }
>
> #ifdef SOLIB_ADD
> ! /* Add shared library symbols from the newly attached process, if any. */
> ! SOLIB_ADD ((char *) 0, from_tty, ¤t_target, auto_solib_add);
> ! re_enable_breakpoints_in_shlibs ();
> #endif
>
> /* Take any necessary post-attaching actions for this platform.
> Index: infrun.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/infrun.c,v
> retrieving revision 1.18
> diff -c -p -r1.18 infrun.c
> *** infrun.c 2000/09/02 00:08:05 1.18
> --- infrun.c 2000/09/19 21:36:04
> *************** handle_inferior_event (struct execution_
> *** 1517,1531 ****
> remove_breakpoints ();
>
> /* Check for any newly added shared libraries if we're
> ! supposed to be adding them automatically. */
> ! if (auto_solib_add)
> ! {
> ! /* Switch terminal for any messages produced by
> ! breakpoint_re_set. */
> ! target_terminal_ours_for_output ();
> ! SOLIB_ADD (NULL, 0, NULL);
> ! target_terminal_inferior ();
> ! }
>
> /* Reinsert breakpoints and continue. */
> if (breakpoints_inserted)
> --- 1517,1528 ----
> remove_breakpoints ();
>
> /* Check for any newly added shared libraries if we're
> ! supposed to be adding them automatically. Switch
> ! terminal for any messages produced by
> ! breakpoint_re_set. */
> ! target_terminal_ours_for_output ();
> ! SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
> ! target_terminal_inferior ();
>
> /* Reinsert breakpoints and continue. */
> if (breakpoints_inserted)
> *************** handle_inferior_event (struct execution_
> *** 2438,2452 ****
> breakpoints_inserted = 0;
>
> /* Check for any newly added shared libraries if we're
> ! supposed to be adding them automatically. */
> ! if (auto_solib_add)
> ! {
> ! /* Switch terminal for any messages produced by
> ! breakpoint_re_set. */
> ! target_terminal_ours_for_output ();
> ! SOLIB_ADD (NULL, 0, NULL);
> ! target_terminal_inferior ();
> ! }
>
> /* Try to reenable shared library breakpoints, additional
> code segments in shared libraries might be mapped in now. */
> --- 2435,2446 ----
> breakpoints_inserted = 0;
>
> /* Check for any newly added shared libraries if we're
> ! supposed to be adding them automatically. Switch
> ! terminal for any messages produced by
> ! breakpoint_re_set. */
> ! target_terminal_ours_for_output ();
> ! SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
> ! target_terminal_inferior ();
>
> /* Try to reenable shared library breakpoints, additional
> code segments in shared libraries might be mapped in now. */
> Index: irix5-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/irix5-nat.c,v
> retrieving revision 1.9
> diff -c -p -r1.9 irix5-nat.c
> *** irix5-nat.c 2000/09/11 07:36:07 1.9
> --- irix5-nat.c 2000/09/19 21:36:05
> *************** symbol_add_stub (void *arg)
> *** 861,874 ****
> SYNOPSIS
>
> void solib_add (char *arg_string, int from_tty,
> ! struct target_ops *target)
>
> DESCRIPTION
>
> */
>
> void
> ! solib_add (char *arg_string, int from_tty, struct target_ops *target)
> {
> register struct so_list *so = NULL; /* link map state variable */
>
> --- 861,874 ----
> SYNOPSIS
>
> void solib_add (char *arg_string, int from_tty,
> ! struct target_ops *target, int threshold)
>
> DESCRIPTION
>
> */
>
> void
> ! solib_add (char *arg_string, int from_tty, struct target_ops *target, int threshold)
> {
> register struct so_list *so = NULL; /* link map state variable */
>
> *************** solib_add (char *arg_string, int from_tt
> *** 879,884 ****
> --- 879,887 ----
> int count;
> int old;
>
> + if (threshold == 0)
> + return;
> +
> if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
> {
> error ("Invalid regexp: %s", re_err);
> *************** solib_create_inferior_hook (void)
> *** 1250,1257 ****
> and will put out an annoying warning.
> Delaying the resetting of stop_soon_quietly until after symbol loading
> suppresses the warning. */
> ! if (auto_solib_add)
> ! solib_add ((char *) 0, 0, (struct target_ops *) 0);
> stop_soon_quietly = 0;
> }
>
> --- 1253,1259 ----
> and will put out an annoying warning.
> Delaying the resetting of stop_soon_quietly until after symbol loading
> suppresses the warning. */
> ! solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
> stop_soon_quietly = 0;
> }
>
> *************** static void
> *** 1273,1279 ****
> sharedlibrary_command (char *args, int from_tty)
> {
> dont_repeat ();
> ! solib_add (args, from_tty, (struct target_ops *) 0);
> }
>
> void
> --- 1275,1281 ----
> sharedlibrary_command (char *args, int from_tty)
> {
> dont_repeat ();
> ! solib_add (args, from_tty, (struct target_ops *) 0, INT_MAX >> 22);
> }
>
> void
> Index: osfsolib.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/osfsolib.c,v
> retrieving revision 1.5
> diff -c -p -r1.5 osfsolib.c
> *** osfsolib.c 2000/07/30 01:48:26 1.5
> --- osfsolib.c 2000/09/19 21:36:05
> *************** symbol_add_stub (char *arg)
> *** 596,609 ****
> SYNOPSIS
>
> void solib_add (char *arg_string, int from_tty,
> ! struct target_ops *target)
>
> DESCRIPTION
>
> */
>
> void
> ! solib_add (char *arg_string, int from_tty, struct target_ops *target)
> {
> register struct so_list *so = NULL; /* link map state variable */
>
> --- 596,609 ----
> SYNOPSIS
>
> void solib_add (char *arg_string, int from_tty,
> ! struct target_ops *target, int threshold)
>
> DESCRIPTION
>
> */
>
> void
> ! solib_add (char *arg_string, int from_tty, struct target_ops *target, int threshold)
> {
> register struct so_list *so = NULL; /* link map state variable */
>
> *************** solib_add (char *arg_string, int from_tt
> *** 614,619 ****
> --- 614,622 ----
> int count;
> int old;
>
> + if (threshold == 0)
> + return;
> +
> if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
> {
> error ("Invalid regexp: %s", re_err);
> *************** solib_create_inferior_hook (void)
> *** 887,894 ****
> and will put out an annoying warning.
> Delaying the resetting of stop_soon_quietly until after symbol loading
> suppresses the warning. */
> ! if (auto_solib_add)
> ! solib_add ((char *) 0, 0, (struct target_ops *) 0);
> stop_soon_quietly = 0;
> }
>
> --- 890,896 ----
> and will put out an annoying warning.
> Delaying the resetting of stop_soon_quietly until after symbol loading
> suppresses the warning. */
> ! solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
> stop_soon_quietly = 0;
> }
>
> *************** static void
> *** 911,917 ****
> sharedlibrary_command (char *args, int from_tty)
> {
> dont_repeat ();
> ! solib_add (args, from_tty, (struct target_ops *) 0);
> }
>
> void
> --- 913,919 ----
> sharedlibrary_command (char *args, int from_tty)
> {
> dont_repeat ();
> ! solib_add (args, from_tty, (struct target_ops *) 0, INT_MAX >> 22);
> }
>
> void
> Index: pa64solib.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/pa64solib.c,v
> retrieving revision 1.7
> diff -c -p -r1.7 pa64solib.c
> *** pa64solib.c 2000/08/27 22:30:29 1.7
> --- pa64solib.c 2000/09/19 21:36:05
> *************** static void pa64_solib_sharedlibrary_com
> *** 126,136 ****
>
> static void *pa64_target_read_memory (void *, CORE_ADDR, size_t, int);
>
> ! static boolean read_dld_descriptor (struct target_ops *);
>
> static boolean read_dynamic_info (asection *, dld_cache_t *);
>
> ! static void add_to_solist (boolean, char *, struct load_module_desc *,
> CORE_ADDR, struct target_ops *);
>
> /* When examining the shared library for debugging information we have to
> --- 126,136 ----
>
> static void *pa64_target_read_memory (void *, CORE_ADDR, size_t, int);
>
> ! static boolean read_dld_descriptor (struct target_ops *, int threshold);
>
> static boolean read_dynamic_info (asection *, dld_cache_t *);
>
> ! static void add_to_solist (boolean, char *, int, struct load_module_desc *,
> CORE_ADDR, struct target_ops *);
>
> /* When examining the shared library for debugging information we have to
> *************** pa64_solib_load_symbols (struct so_list
> *** 371,377 ****
> be exceeded. */
>
> void
> ! pa64_solib_add (char *arg_string, int from_tty, struct target_ops *target)
> {
> struct minimal_symbol *msymbol;
> CORE_ADDR addr;
> --- 371,377 ----
> be exceeded. */
>
> void
> ! pa64_solib_add (char *arg_string, int from_tty, struct target_ops *target, int threshold)
> {
> struct minimal_symbol *msymbol;
> CORE_ADDR addr;
> *************** pa64_solib_add (char *arg_string, int fr
> *** 414,420 ****
>
> /* Read in the load map pointer if we have not done so already. */
> if (! dld_cache.have_read_dld_descriptor)
> ! if (! read_dld_descriptor (target))
> return;
>
> /* If the libraries were not mapped private, warn the user. */
> --- 414,420 ----
>
> /* Read in the load map pointer if we have not done so already. */
> if (! dld_cache.have_read_dld_descriptor)
> ! if (! read_dld_descriptor (target, threshold))
> return;
>
> /* If the libraries were not mapped private, warn the user. */
> *************** pa64_solib_add (char *arg_string, int fr
> *** 438,444 ****
> if (!dll_path)
> error ("pa64_solib_add, unable to read shared library path.");
>
> ! add_to_solist (from_tty, dll_path, &dll_desc, 0, target);
> }
> }
>
> --- 438,444 ----
> if (!dll_path)
> error ("pa64_solib_add, unable to read shared library path.");
>
> ! add_to_solist (from_tty, dll_path, threshold, &dll_desc, 0, target);
> }
> }
>
> *************** pa64_solib_in_dynamic_linker (int pid, C
> *** 699,705 ****
> return 0;
>
> if (!dld_cache.have_read_dld_descriptor)
> ! if (!read_dld_descriptor (¤t_target))
> return 0;
>
> return (pc >= dld_cache.dld_desc.text_base
> --- 699,705 ----
> return 0;
>
> if (!dld_cache.have_read_dld_descriptor)
> ! if (!read_dld_descriptor (¤t_target, auto_solib_add))
> return 0;
>
> return (pc >= dld_cache.dld_desc.text_base
> *************** static void
> *** 817,823 ****
> pa64_solib_sharedlibrary_command (char *args, int from_tty)
> {
> dont_repeat ();
> ! pa64_solib_add (args, from_tty, (struct target_ops *) 0);
> }
>
> /* Return the name of the shared library containing ADDR or NULL if ADDR
> --- 817,823 ----
> pa64_solib_sharedlibrary_command (char *args, int from_tty)
> {
> dont_repeat ();
> ! pa64_solib_add (args, from_tty, (struct target_ops *) 0, INT_MAX >> 22);
> }
>
> /* Return the name of the shared library containing ADDR or NULL if ADDR
> *************** so_lib_thread_start_addr (struct so_list
> *** 926,932 ****
> return nonzero. */
>
> static boolean
> ! read_dld_descriptor (struct target_ops *target)
> {
> char *dll_path;
> asection *dyninfo_sect;
> --- 926,932 ----
> return nonzero. */
>
> static boolean
> ! read_dld_descriptor (struct target_ops *target, int threshold)
> {
> char *dll_path;
> asection *dyninfo_sect;
> *************** read_dld_descriptor (struct target_ops *
> *** 985,991 ****
> pa64_target_read_memory,
> 0,
> dld_cache.load_map);
> ! add_to_solist(0, dll_path, &dld_cache.dld_desc, 0, target);
>
> return 1;
> }
> --- 985,991 ----
> pa64_target_read_memory,
> 0,
> dld_cache.load_map);
> ! add_to_solist(0, dll_path, threshold, &dld_cache.dld_desc, 0, target);
>
> return 1;
> }
> *************** pa64_target_read_memory (void *buffer, C
> *** 1092,1098 ****
> be read from the inferior process at the address load_module_desc_addr. */
>
> static void
> ! add_to_solist (boolean from_tty, char *dll_path,
> struct load_module_desc *load_module_desc_p,
> CORE_ADDR load_module_desc_addr, struct target_ops *target)
> {
> --- 1092,1098 ----
> be read from the inferior process at the address load_module_desc_addr. */
>
> static void
> ! add_to_solist (boolean from_tty, char *dll_path, int threshold,
> struct load_module_desc *load_module_desc_p,
> CORE_ADDR load_module_desc_addr, struct target_ops *target)
> {
> *************** add_to_solist (boolean from_tty, char *d
> *** 1157,1163 ****
> pa64_solib_st_size_threshhold_exceeded =
> !from_tty
> && ( (st_size + pa64_solib_total_st_size)
> ! > (auto_solib_add * (LONGEST)1000000));
> if (pa64_solib_st_size_threshhold_exceeded)
> {
> pa64_solib_add_solib_objfile (new_so, dll_path, from_tty, 1);
> --- 1157,1163 ----
> pa64_solib_st_size_threshhold_exceeded =
> !from_tty
> && ( (st_size + pa64_solib_total_st_size)
> ! > (threshold * (LONGEST)1000000));
> if (pa64_solib_st_size_threshhold_exceeded)
> {
> pa64_solib_add_solib_objfile (new_so, dll_path, from_tty, 1);
> Index: pa64solib.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/pa64solib.h,v
> retrieving revision 1.2
> diff -c -p -r1.2 pa64solib.h
> *** pa64solib.h 2000/05/28 01:12:28 1.2
> --- pa64solib.h 2000/09/19 21:36:05
> *************** struct section_offsets;
> *** 25,34 ****
>
> /* Called to add symbols from a shared library to gdb's symbol table. */
>
> ! #define SOLIB_ADD(filename, from_tty, targ) \
> ! pa64_solib_add (filename, from_tty, targ)
>
> ! extern void pa64_solib_add (char *, int, struct target_ops *);
>
> extern CORE_ADDR pa64_solib_get_got_by_pc (CORE_ADDR);
>
> --- 25,34 ----
>
> /* Called to add symbols from a shared library to gdb's symbol table. */
>
> ! #define SOLIB_ADD(filename, from_tty, targ, threshold) \
> ! pa64_solib_add (filename, from_tty, targ, threshold)
>
> ! extern void pa64_solib_add (char *, int, struct target_ops *, int);
>
> extern CORE_ADDR pa64_solib_get_got_by_pc (CORE_ADDR);
>
> Index: sol-thread.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/sol-thread.c,v
> retrieving revision 1.16
> diff -c -p -r1.16 sol-thread.c
> *** sol-thread.c 2000/09/05 17:43:00 1.16
> --- sol-thread.c 2000/09/19 21:36:06
> *************** sol_thread_attach (char *args, int from_
> *** 454,460 ****
> procfs_ops.to_attach (args, from_tty);
>
> /* Must get symbols from solibs before libthread_db can run! */
> ! SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0);
>
> if (sol_thread_active)
> {
> --- 454,460 ----
> procfs_ops.to_attach (args, from_tty);
>
> /* Must get symbols from solibs before libthread_db can run! */
> ! SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0, auto_solib_add);
>
> if (sol_thread_active)
> {
> Index: solib.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/solib.c,v
> retrieving revision 1.22
> diff -c -p -r1.22 solib.c
> *** solib.c 2000/08/31 00:39:10 1.22
> --- solib.c 2000/09/19 21:36:06
> *************** update_solib_list (int from_tty, struct
> *** 1551,1557 ****
>
> SYNOPSIS
>
> ! void solib_add (char *pattern, int from_tty, struct target_ops *TARGET)
>
> DESCRIPTION
>
> --- 1551,1558 ----
>
> SYNOPSIS
>
> ! void solib_add (char *pattern, int from_tty, struct target_ops
> ! *TARGET, int threshold)
>
> DESCRIPTION
>
> *************** update_solib_list (int from_tty, struct
> *** 1562,1568 ****
> FROM_TTY and TARGET are as described for update_solib_list, above. */
>
> void
> ! solib_add (char *pattern, int from_tty, struct target_ops *target)
> {
> struct so_list *gdb;
>
> --- 1563,1569 ----
> FROM_TTY and TARGET are as described for update_solib_list, above. */
>
> void
> ! solib_add (char *pattern, int from_tty, struct target_ops *target, int threshold)
> {
> struct so_list *gdb;
>
> *************** solib_add (char *pattern, int from_tty,
> *** 1596,1602 ****
> }
> else
> {
> ! if (catch_errors
> (symbol_add_stub, gdb,
> "Error while reading shared library symbols:\n",
> RETURN_MASK_ALL))
> --- 1597,1603 ----
> }
> else
> {
> ! if ((threshold > 0) && catch_errors
> (symbol_add_stub, gdb,
> "Error while reading shared library symbols:\n",
> RETURN_MASK_ALL))
> *************** solib_create_inferior_hook (void)
> *** 2187,2194 ****
> warning ("shared library handler failed to disable breakpoint");
> }
>
> ! if (auto_solib_add)
> ! solib_add ((char *) 0, 0, (struct target_ops *) 0);
> #endif /* ! _SCO_DS */
> #endif
> }
> --- 2188,2194 ----
> warning ("shared library handler failed to disable breakpoint");
> }
>
> ! solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
> #endif /* ! _SCO_DS */
> #endif
> }
> *************** static void
> *** 2278,2284 ****
> sharedlibrary_command (char *args, int from_tty)
> {
> dont_repeat ();
> ! solib_add (args, from_tty, (struct target_ops *) 0);
> }
>
> #endif /* HAVE_LINK_H */
> --- 2278,2284 ----
> sharedlibrary_command (char *args, int from_tty)
> {
> dont_repeat ();
> ! solib_add (args, from_tty, (struct target_ops *) 0, INT_MAX >> 22);
> }
>
> #endif /* HAVE_LINK_H */
> Index: solib.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/solib.h,v
> retrieving revision 1.2
> diff -c -p -r1.2 solib.h
> *** solib.h 2000/05/28 01:12:29 1.2
> --- solib.h 2000/09/19 21:36:06
> *************** struct target_ops;
> *** 28,39 ****
>
> extern void clear_solib (void);
>
> /* Called to add symbols from a shared library to gdb's symbol table. */
>
> ! #define SOLIB_ADD(filename, from_tty, targ) \
> ! solib_add (filename, from_tty, targ)
>
> ! extern void solib_add (char *, int, struct target_ops *);
>
> /* Function to be called when the inferior starts up, to discover the names
> of shared libraries that are dynamically linked, the base addresses to
> --- 28,51 ----
>
> extern void clear_solib (void);
>
> + /* Whether to auto load solibs at startup time: 0/1.
> +
> + On all platforms, 0 means "don't auto load".
> +
> + On HP-UX, > 0 means a threshhold, in megabytes, of symbol table which will
> + be auto loaded. When the cumulative size of solib symbol table exceeds
> + this threshhold, solibs' symbol tables will not be loaded.
> +
> + On other platforms, > 0 means, "always auto load". */
> +
> + extern int auto_solib_add;
> +
> /* Called to add symbols from a shared library to gdb's symbol table. */
>
> ! #define SOLIB_ADD(filename, from_tty, targ, threshold) \
> ! solib_add (filename, from_tty, targ, threshold)
>
> ! extern void solib_add (char *, int, struct target_ops *, int);
>
> /* Function to be called when the inferior starts up, to discover the names
> of shared libraries that are dynamically linked, the base addresses to
> Index: somsolib.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/somsolib.c,v
> retrieving revision 1.6
> diff -c -p -r1.6 somsolib.c
> *** somsolib.c 2000/08/27 22:30:29 1.6
> --- somsolib.c 2000/09/19 21:36:07
> *************** som_solib_load_symbols (struct so_list *
> *** 385,395 ****
>
>
> /* Add symbols from shared libraries into the symtab list, unless the
> ! size threshold (specified by auto_solib_add, in megabytes) would
> be exceeded. */
>
> void
> ! som_solib_add (char *arg_string, int from_tty, struct target_ops *target)
> {
> struct minimal_symbol *msymbol;
> struct so_list *so_list_tail;
> --- 385,395 ----
>
>
> /* Add symbols from shared libraries into the symtab list, unless the
> ! size threshold (specified by THRESHOLD, in megabytes) would
> be exceeded. */
>
> void
> ! som_solib_add (char *arg_string, int from_tty, struct target_ops *target, int threshold)
> {
> struct minimal_symbol *msymbol;
> struct so_list *so_list_tail;
> *************** som_solib_add (char *arg_string, int fro
> *** 759,765 ****
> st_size = som_solib_sizeof_symbol_table (name);
> som_solib_st_size_threshold_exceeded =
> !from_tty &&
> ! ((st_size + som_solib_total_st_size) > (auto_solib_add * (LONGEST) 1000000));
>
> if (som_solib_st_size_threshold_exceeded)
> {
> --- 759,765 ----
> st_size = som_solib_sizeof_symbol_table (name);
> som_solib_st_size_threshold_exceeded =
> !from_tty &&
> ! ((st_size + som_solib_total_st_size) > (threshold * (LONGEST) 1000000));
>
> if (som_solib_st_size_threshold_exceeded)
> {
> *************** static void
> *** 1458,1464 ****
> som_solib_sharedlibrary_command (char *args, int from_tty)
> {
> dont_repeat ();
> ! som_solib_add (args, from_tty, (struct target_ops *) 0);
> }
>
>
> --- 1458,1464 ----
> som_solib_sharedlibrary_command (char *args, int from_tty)
> {
> dont_repeat ();
> ! som_solib_add (args, from_tty, (struct target_ops *) 0, INT_MAX >> 22);
> }
>
>
> Index: somsolib.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/somsolib.h,v
> retrieving revision 1.2
> diff -c -p -r1.2 somsolib.h
> *** somsolib.h 2000/05/28 01:12:29 1.2
> --- somsolib.h 2000/09/19 21:36:07
> *************** struct target_ops;
> *** 26,37 ****
> struct objfile;
> struct section_offsets;
>
> /* Called to add symbols from a shared library to gdb's symbol table. */
>
> ! #define SOLIB_ADD(filename, from_tty, targ) \
> ! som_solib_add (filename, from_tty, targ)
>
> ! extern void som_solib_add (char *, int, struct target_ops *);
>
> extern CORE_ADDR som_solib_get_got_by_pc (CORE_ADDR);
>
> --- 26,49 ----
> struct objfile;
> struct section_offsets;
>
> + /* Whether to auto load solibs at startup time: 0/1.
> +
> + On all platforms, 0 means "don't auto load".
> +
> + On HP-UX, > 0 means a threshhold, in megabytes, of symbol table which will
> + be auto loaded. When the cumulative size of solib symbol table exceeds
> + this threshhold, solibs' symbol tables will not be loaded.
> +
> + On other platforms, > 0 means, "always auto load". */
> +
> + extern int auto_solib_add;
> +
> /* Called to add symbols from a shared library to gdb's symbol table. */
>
> ! #define SOLIB_ADD(filename, from_tty, targ, threshold) \
> ! som_solib_add (filename, from_tty, targ, threshold)
>
> ! extern void som_solib_add (char *, int, struct target_ops *, int);
>
> extern CORE_ADDR som_solib_get_got_by_pc (CORE_ADDR);
>
> Index: symfile.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/symfile.h,v
> retrieving revision 1.6
> diff -c -p -r1.6 symfile.h
> *** symfile.h 2000/09/02 00:12:17 1.6
> --- symfile.h 2000/09/19 21:36:07
> *************** extern char *obconcat (struct obstack *o
> *** 217,235 ****
>
> /* Variables */
>
> - /* whether to auto load solibs at startup time: 0/1.
> -
> - On all platforms, 0 means "don't auto load".
> -
> - On HP-UX, > 0 means a threshhold, in megabytes, of symbol table which will
> - be auto loaded. When the cumulative size of solib symbol table exceeds
> - this threshhold, solibs' symbol tables will not be loaded.
> -
> - On other platforms, > 0 means, "always auto load".
> - */
> -
> - extern int auto_solib_add;
> -
> /* From symfile.c */
>
> extern CORE_ADDR entry_point_address (void);
> --- 217,222 ----
> Index: win32-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/win32-nat.c,v
> retrieving revision 1.15
> diff -c -p -r1.15 win32-nat.c
> *** win32-nat.c 2000/08/27 04:21:35 1.15
> --- win32-nat.c 2000/09/19 21:36:07
> *************** out:
> *** 1618,1625 ****
> }
>
> void
> ! child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED, struct target_ops *target)
> {
> if (core_bfd)
> {
> child_clear_solibs ();
> --- 1618,1628 ----
> }
>
> void
> ! child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED, struct target_ops *target, int threshold)
> {
> + if (threshold == 0)
> + return;
> +
> if (core_bfd)
> {
> child_clear_solibs ();
> Index: xcoffsolib.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/xcoffsolib.c,v
> retrieving revision 1.5
> diff -c -p -r1.5 xcoffsolib.c
> *** xcoffsolib.c 2000/07/30 01:48:28 1.5
> --- xcoffsolib.c 2000/09/19 21:36:07
> *************** extern int current_source_line;
> *** 45,51 ****
> the section list. */
>
> void
> ! solib_add (char *arg_string, int from_tty, struct target_ops *target)
> {
> char *val;
> struct vmap *vp = vmap;
> --- 45,51 ----
> the section list. */
>
> void
> ! solib_add (char *arg_string, int from_tty, struct target_ops *target, int threshold)
> {
> char *val;
> struct vmap *vp = vmap;
> *************** solib_add (char *arg_string, int from_tt
> *** 56,61 ****
> --- 56,64 ----
> int loaded = 0; /* true if any shared obj loaded */
> int matched = 0; /* true if any shared obj matched */
>
> + if (threshold == 0)
> + return;
> +
> if (arg_string == 0)
> re_comp (".");
> else if (val = (char *) re_comp (arg_string))
> *************** sharedlibrary_command (char *args, int f
> *** 207,213 ****
> (*xcoff_relocate_symtab_hook) (inferior_pid);
>
> #ifdef SOLIB_SYMBOLS_MANUAL
> ! solib_add (args, from_tty, (struct target_ops *) 0);
> #endif /* SOLIB_SYMBOLS_MANUAL */
> }
>
> --- 210,216 ----
> (*xcoff_relocate_symtab_hook) (inferior_pid);
>
> #ifdef SOLIB_SYMBOLS_MANUAL
> ! solib_add (args, from_tty, (struct target_ops *) 0, INT_MAX >> 22);
> #endif /* SOLIB_SYMBOLS_MANUAL */
> }
>
> Index: config/i386/tm-cygwin.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/config/i386/tm-cygwin.h,v
> retrieving revision 1.6
> diff -c -p -r1.6 tm-cygwin.h
> *** tm-cygwin.h 2000/08/27 04:21:35 1.6
> --- tm-cygwin.h 2000/09/19 21:36:07
> *************** extern CORE_ADDR skip_trampoline_code (C
> *** 31,44 ****
> #endif
>
> #define ATTACH_NO_WAIT
> ! #define SOLIB_ADD(filename, from_tty, targ) child_solib_add(filename, from_tty, targ)
> #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_pathname(pid)
> #define CLEAR_SOLIB child_clear_solibs
> #define ADD_SHARED_SYMBOL_FILES dll_symbol_command
>
> struct target_ops;
> char *cygwin_pid_to_str (int pid);
> ! void child_solib_add (char *, int, struct target_ops *);
> char *child_solib_loaded_library_pathname(int);
> void child_clear_solibs (void);
> void dll_symbol_command (char *, int);
> --- 31,44 ----
> #endif
>
> #define ATTACH_NO_WAIT
> ! #define SOLIB_ADD(filename, from_tty, targ, threshold) child_solib_add(filename, from_tty, targ, threshold)
> #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_pathname(pid)
> #define CLEAR_SOLIB child_clear_solibs
> #define ADD_SHARED_SYMBOL_FILES dll_symbol_command
>
> struct target_ops;
> char *cygwin_pid_to_str (int pid);
> ! void child_solib_add (char *, int, struct target_ops *, int);
> char *child_solib_loaded_library_pathname(int);
> void child_clear_solibs (void);
> void dll_symbol_command (char *, int);
> Index: config/rs6000/nm-rs6000.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/config/rs6000/nm-rs6000.h,v
> retrieving revision 1.3
> diff -c -p -r1.3 nm-rs6000.h
> *** nm-rs6000.h 2000/06/16 21:02:22 1.3
> --- nm-rs6000.h 2000/09/19 21:36:07
> ***************
> *** 45,51 ****
> /* When a target process or core-file has been attached, we sneak in
> and figure out where the shared libraries have got to. */
>
> ! #define SOLIB_ADD(a, b, c) \
> if (inferior_pid) \
> /* Attach to process. */ \
> xcoff_relocate_symtab (inferior_pid); \
> --- 45,51 ----
> /* When a target process or core-file has been attached, we sneak in
> and figure out where the shared libraries have got to. */
>
> ! #define SOLIB_ADD(a, b, c, threshold) \
> if (inferior_pid) \
> /* Attach to process. */ \
> xcoff_relocate_symtab (inferior_pid); \
> Index: doc/ChangeLog
> ===================================================================
> RCS file: /cvs/src/src/gdb/doc/ChangeLog,v
> retrieving revision 1.49
> diff -c -p -r1.49 ChangeLog
> *** ChangeLog 2000/08/10 13:42:29 1.49
> --- ChangeLog 2000/09/19 21:36:08
> ***************
> *** 1,3 ****
> --- 1,7 ----
> + 2000-09-18 Fred Fish <fnf@cygnus.com>
> +
> + * gdbint.texinfo (SOLIB_ADD): Document the new threshold arg.
> +
> 2000-08-10 Mark Kettenis <kettenis@gnu.org>
> * gdbint.texinfo (Overall Structure): Spelling fix.
> Index: doc/gdbint.texinfo
> ===================================================================
> RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
> retrieving revision 1.15
> diff -c -p -r1.15 gdbint.texinfo
> *** gdbint.texinfo 2000/08/10 13:42:29 1.15
> --- gdbint.texinfo 2000/09/19 21:36:09
> *************** Defaults to @code{"/bin/sh"}.
> *** 2564,2570 ****
>
> @item SOLIB_ADD (filename, from_tty, targ)
> Define this to expand into an expression that will cause the symbols in
> ! @var{filename} to be added to @value{GDBN}'s symbol table.
>
> @item SOLIB_CREATE_INFERIOR_HOOK
> Define this to expand into any shared-library-relocation code that you
> --- 2564,2575 ----
>
> @item SOLIB_ADD (filename, from_tty, targ)
> Define this to expand into an expression that will cause the symbols in
> ! @var{filename} to be added to @value{GDBN}'s symbol table. If
> ! @var{threshold} is zero symbols are not read but any necessary low level
> ! processing for @var{filename} is still done. If @var{threshold} is
> ! non-zero, it is interpreted on some systems as a threshold (in MB) above
> ! which symbol reading is suppressed, and on all other systems as a flag
> ! to enable symbol reading.
>
> @item SOLIB_CREATE_INFERIOR_HOOK
> Define this to expand into any shared-library-relocation code that you
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2001-07-13 15:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <200009192140.OAA23805@fishpond.ninemoons.com>
[not found] ` <39CFDF0C.BE95DADE@ozemail.com.au>
2000-09-25 23:10 ` Post Hook Patch, and Regcache.h Patch Eli Zaretskii
2001-06-28 15:04 ` [PATCH] Fix auto-solib-add bug (patch revised again) Andrew Cagney
2001-06-28 18:07 ` Kevin Buettner
2001-06-28 19:23 ` Fred Fish
2001-07-01 15:21 ` [PATCH] Fix auto-solib-add bug (patch revised 7/1/2001) Fred Fish
[not found] ` <fnf@www.ninemoons.com>
[not found] ` <1010702215326.ZM24300@ocotillo.lan>
2001-07-02 14:56 ` Christopher Faylor
2001-07-13 15:03 ` Elena Zannoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox