From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5916 invoked by alias); 31 Jan 2006 17:45:08 -0000 Received: (qmail 5908 invoked by uid 22791); 31 Jan 2006 17:45:07 -0000 X-Spam-Check-By: sourceware.org Received: from omx2-ext.sgi.com (HELO omx2.sgi.com) (192.48.171.19) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 31 Jan 2006 17:45:05 +0000 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by omx2.sgi.com (8.12.11/8.12.9/linux-outbound_gateway-1.1) with ESMTP id k0VJl55f027461; Tue, 31 Jan 2006 11:47:05 -0800 Received: from quasar.engr.sgi.com (quasar.engr.sgi.com [163.154.6.61]) by cthulhu.engr.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id k0VHj1gi4682292; Tue, 31 Jan 2006 09:45:01 -0800 (PST) Received: from quasar.engr.sgi.com (localhost [127.0.0.1]) by quasar.engr.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id k0VHhUTu209684; Tue, 31 Jan 2006 09:44:10 -0800 (PST) Received: (from davea@localhost) by quasar.engr.sgi.com (SGI-8.12.5/8.12.5/Submit) id k0VHfjs6209741; Tue, 31 Jan 2006 09:41:45 -0800 (PST) Date: Tue, 31 Jan 2006 17:45:00 -0000 From: David Anderson Message-Id: <200601311741.k0VHfjs6209741@quasar.engr.sgi.com> To: David Anderson , Eirik Fuller Subject: Re: [PATCH] Use mmap for symbol tables Cc: Jim Blandy , gdb-patches@sourceware.org References: <200601310437.k0V4bcJ7208753@quasar.engr.sgi.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00491.txt.bz2 |> Been there, done that, with IRIX/dbx and 'just virtual address |> space' was a disaster for a few big apps | |I don't know how dbx handles symbol tables, but in my experience the |size of a symbol table needs to be within a particular power of two to |exhaust virtual address space in a situation where gdb won't exhaust it |anyway with malloc. A debugger which only keeps a small subset of a |symbol table resident in memory (whether it uses malloc or mmap) can |obviously handle much larger symbol tables, but in my experience that |doesn't describe gdb. The problem was not symbol tables (which IRIX dbx does not do as well as gdb!) but the 'gratuitous' mapping in of the text and data space of the executable and shared libraries -- just to get to symbol data. We got away with it for a long time, but people do press the boundaries and eventually we had to redo it. What with memory so cheap and cpus so fast these days more and more apps press these boundaries. >This suggests a simple way to complicate my mmap patch. If it can be >determined beforehand what interval of the symbol table gdb is going to >read in its entirety, that interval can be recorded in the BFD struct, >and the first mmap call can map just that interval. That will >complicate the offset calculations somewhat, but the basic approach will >be the same. This will only waste virtual address space if the sections >gdb would otherwise read don't form a contiguous region of the file. An intriguing observation. For most Elf files your 'simple way' will work, I think. How often it won't is unclear... Don't let my opinions discourage you, you are doing good work whether or not it gets into gdb at this point. David Anderson