From: Eirik Fuller <eirik@hackrat.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Use mmap for symbol tables
Date: Tue, 07 Feb 2006 22:05:00 -0000 [thread overview]
Message-ID: <20060207220534.46221690067@ns.hackrat.org> (raw)
In-Reply-To: <43DED9FA.1070305@hackrat.com>
> One important note: you bypassed symfile_relocate_debug_section.
The first time I read this I didn't fully understand it (I just hadn't
really read that code yet). I think I understand it now.
I also saw comments near symfile_relocate_debug_section which suggest
that it won't be trivial to find a test case, contrary to my earlier
response. UPS delivered my disk drive from NewEgg today, which means
I should have a PowerPC GNU/Linux system soon (the disk will soon be
the second disk in my G5). I might still need to pay attention to
linker issues to fully explore this; I guess I'll find out soon. :-)
Nonetheless I do have this revised patch. On symbol tables I use it
seems to be equivalent to the one I sent earlier. I'm not resending
the entire patch, just the part that affects gdb/dwarf2read.c
One assumption in this revised patch which I haven't fully validated
is that it makes sense to free the obstack_alloc'd buf if bfd_fetch
returns a non-NULL value. I figure if symfile_relocate_debug_section
returns NULL, either there were no subsequent calls to obstack_alloc,
or nothing allocated by obstack_alloc after buf matters any more. I'm
sure there's a cleaner way to approach this (which almost certainly
requires a bit more complication in the patch), but if the mmap calls
are eventually per-section in the BFD code (due to other complications
in the patch) instead of covering an entire file, this piece of the
patch will presumably look very different anyway.
> No, probably you should just bypass the mmap if the code in that
> function triggers.
I think this revised patch fits that description, by deferring the
call to bfd_fetch.
--- gdb/dwarf2read.c.orig 2006-01-17 14:30:29.000000000 -0800
+++ gdb/dwarf2read.c 2006-02-07 12:57:46.000000000 -0800
@@ -4958,6 +4958,13 @@
if (retbuf != NULL)
return retbuf;
+ retbuf = bfd_fetch(sectp->filepos, size, abfd);
+ if (retbuf != NULL)
+ {
+ obstack_free(&objfile->objfile_obstack, buf);
+ return retbuf;
+ }
+
if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0
|| bfd_bread (buf, size, abfd) != size)
error (_("Dwarf Error: Can't read DWARF data from '%s'"),
next prev parent reply other threads:[~2006-02-07 22:05 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-29 23:36 Eirik Fuller
2006-01-30 5:04 ` Jim Blandy
2006-01-30 11:44 ` Eirik Fuller
2006-01-30 18:07 ` Jim Blandy
2006-01-30 18:59 ` Eirik Fuller
2006-01-30 22:11 ` Jim Blandy
2006-01-31 0:38 ` Eirik Fuller
2006-01-31 1:49 ` Jim Blandy
2006-01-31 3:12 ` Eirik Fuller
2006-01-31 21:48 ` Mark Kettenis
2006-02-01 17:52 ` Eirik Fuller
2006-02-01 6:04 ` Michael Snyder
2006-01-30 11:34 ` Andrew STUBBS
2006-01-30 11:42 ` Corinna Vinschen
2006-01-30 11:48 ` Andrew STUBBS
2006-01-31 2:23 ` Daniel Jacobowitz
2006-01-31 3:31 ` Eirik Fuller
2006-01-31 3:38 ` Daniel Jacobowitz
2006-02-07 22:05 ` Eirik Fuller [this message]
2006-02-20 15:52 ` Daniel Jacobowitz
2006-01-31 5:28 ` Jim Blandy
2006-01-31 13:59 ` Daniel Jacobowitz
2006-01-31 4:40 David Anderson
2006-01-31 5:00 ` Eirik Fuller
2006-01-31 5:34 ` Jim Blandy
2006-01-31 14:00 ` Daniel Jacobowitz
2006-01-31 18:39 ` Jim Blandy
2006-02-01 18:11 ` Eirik Fuller
2006-01-31 17:45 ` David Anderson
2006-01-31 18:24 ` Jim Blandy
2006-01-31 4:53 David Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060207220534.46221690067@ns.hackrat.org \
--to=eirik@hackrat.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox