This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

shlibs/1361: auto-solib-add option and sharedlibrary command broken on HPUX


>Number:         1361
>Category:       shlibs
>Synopsis:       auto-solib-add option and sharedlibrary command broken on HPUX
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          patch
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 29 15:48:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Ken Cecka
>Release:        gdb-5.3
>Organization:
>Environment:
HPUX 11i
>Description:
---- Introduction:

The gdb option auto-solib-add (when turned off) is supposed to stop gdb from automatically loading symbols from shared libraries when they are runtime linked.  This is useful when working with applications that load a large number of shared libraries that do not need to be debugged.

When auto-solib-add is turned off, the user needs to manually load symbols from shared libraries that they are interested in - using the sharedlibrary command.

---- Description of the bug(s):

For HPUX builds of gdb, the auto-solib-add option is ignored and symbols are always automatically loaded from shared libraries.

For HPUX builds of gdb (after fixing the auto-solib-add bug), the sharedlibrary command loads symbols from all shared libraries, rather than those whose names match the regular expression passed to it.
>How-To-Repeat:
Start a program running that uses shared libraries.  Look up its process id.  Start gdb, turn off auto-solib-add, and attach to that process id.  Gdb will ignore auto-solib-add and load the symbols for all shared libraries.

After fixing the above problem, repeat the same procedure.  This time gdb will not load symbols when you attach.  Now try to manually load symbols from a particular shared library by specifying a regular expression.  Gdb will load symbols for all shared libraries, instead of the ones that you specified.
>Fix:
In som_solib_add(), the readsyms parameter (which originates in the auto-solib-add option) is ignored and symbols are loaded for all libraries which have not already been loaded.  Adding "!readsyms &&" to the comparison checking for an already-loaded library causes symbol loading to be skipped when readsyms is false.

Also in som_solib_add(), the regular expression is parsed in a call to re_comp(), but the code never checks the library name against this regular expression.  Adding "&& !re_exec(name)" to the comparison checking for an already-loaded library causes symbol loading to be skipped for libraries which do not match the regular expression.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-diff; name="somsolib.c.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="somsolib.c.patch"

LS0tIHNvbXNvbGliLmMJMjAwMi0wNi0wOCAxMzowMjo1MS4wMDAwMDAwMDAgLTA3MDAKKysrIC9o
b21lL2tlbi9zb21zb2xpYi5jCTIwMDMtMDgtMjkgMDg6MDk6MjAuMDAwMDAwMDAwIC0wNzAwCkBA
IC00MSw2ICs0MSw3IEBACiAjaW5jbHVkZSAiZ2RiY21kLmgiCiAjaW5jbHVkZSAibGFuZ3VhZ2Uu
aCIKICNpbmNsdWRlICJyZWdjYWNoZS5oIgorI2luY2x1ZGUgImdkYl9yZWdleC5oIgogCiAjaW5j
bHVkZSA8ZmNudGwuaD4KIApAQCAtNTc3LDcgKzU3OCw3IEBAIHNvbV9zb2xpYl9hZGQgKGNoYXIg
KmFyZ19zdHJpbmcsIGludCBmcm8KICAgICAgIC8qIFNlZSBpZiB3ZSd2ZSBhbHJlYWR5IGxvYWRl
ZCBzb21ldGhpbmcgd2l0aCB0aGlzIG5hbWUuICAqLwogICAgICAgd2hpbGUgKHNvX2xpc3QpCiAJ
ewotCSAgaWYgKCFzdHJjbXAgKHNvX2xpc3QtPnNvbV9zb2xpYi5uYW1lLCBuYW1lKSkKKwkgIGlm
ICghcmVhZHN5bXMgfHwgIXN0cmNtcCAoc29fbGlzdC0+c29tX3NvbGliLm5hbWUsIG5hbWUpIHx8
IChhcmdfc3RyaW5nICYmICFyZV9leGVjKG5hbWUpKSkKIAkgICAgYnJlYWs7CiAJICBzb19saXN0
ID0gc29fbGlzdC0+bmV4dDsKIAl9Cg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]