This is the mail archive of the gdb@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]

Using -mapped -readnow options on Linux/Red Hat 6.2/i386




How do I make a long story short...

Short version:

Is anyone out there using the -mapped -readnow options to use and generate
.syms files to speedup gdb?


Long version:

I am linking a program that I want to debug with some very large DSOs. So
when I start debugging it takes over 3 minutes (really!) before anything
happens (using 'set verbose' tells me that gdb is busy ready the symbols
from my executable, DSOs and source files).

To expedite things I'd like to use .syms file that would be generated
using the -mapped -readnow options as described in the gdb docs.

The problem is that the gdb that comes with Red Hat 6.2 (gdb 4.18/19991004)
is not set up to handle these options...

After getting the sources RPM and configuring with --with-mmalloc I end up
with a gdb that still cannot generate or use .syms files. (tried this with
both version 4.18 and 5.0)

Some investigation revealed that a system call in mmalloc.a (mmap-sup.c)
was failing: it seems that doing a mmap with the flag MAP_SHARED does not
work. I have no idea why... I haven't seen any indication that this would
fail on linux/i386...

Anyway, I've foolishly modyfied the mmap call to use MAP_PRIVATE instead
(which seems to work, but might be a bad idea... after all there was
surely a good reason to use the MAP_SHARED flag).

In the end I do generate .syms files with multiple calls using "gdb -batch
-nx -mapped -readnow ....". Some of the .syms file are very large, i.e.
over 21 megs!. And when I finally try to use gdb for interactive
debugging, it crashes on startup...


The only "workaround" I have found is to 'strip' my DSOs, but I would
rather avoid that...


Any info/advices appreciated...



 -Patrick



--
Patrick Hubert
Work: +1.514.954.7233
Fax : +1.514.393.0110



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