From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Buettner To: Andrew Cagney Cc: GDB Patches Subject: Re: [rfa] Add a name field to ``struct floatformat'' Date: Tue, 30 May 2000 16:42:00 -0000 Message-id: <1000530234235.ZM5405@ocotillo.lan> References: <3933676F.676D861C@cygnus.com> <1000530153706.ZM32196@ocotillo.lan> <3934454E.AAB68F28@cygnus.com> X-SW-Source: 2000-05/msg00474.html On May 31, 8:48am, Andrew Cagney wrote: > Did you like how GDB added floatformat_to_double() to libiberty and then > replaced that with a local floatformat_to_doublest() ;-/ I noticed it, but did not know how it came about. Who's responsible for maintaining libiberty? The reason I ask is that I've been wondering what to do about the fact that we now have a number of fixes to floatformat_to_doublest() and floatformat_from_doublest() (or their helper functions) and that these have not (to the best of my knowledge) been merged into libiberty. The ones that I know about are: * utils.c (get_field, put_field): Fix buffer underruns and overruns. Also, handle case where total_len is not evenly divisible by 8. (getfield): Make sure zeroing of unwanted bits occurs even when bit field to extract does not straddle two or more bytes. * utils.c (floatformat_from_doublest): Don't assume that a long will be exactly 32 bits in length. Also... make sure space that we're writing the float to is completely initialized to zeroes, even when the number of bits in the float is not evenly divisible by FLOATFORMAT_CHAR_BIT. Kevin >From dan@cgsoftware.com Tue May 30 17:23:00 2000 From: Daniel Berlin To: gdb-patches@sourceware.cygnus.com Subject: [RFA] Reduce memory usage for dwarf2 dramatically, unify hashfunctions Date: Tue, 30 May 2000 17:23:00 -0000 Message-id: X-SW-Source: 2000-05/msg00475.html Content-length: 1587 This patch dramatically reduces memory usage when using DWARF2. It should also make debugging with DWARF2 quicker because of what it is doing. Before, we would allocate a new type every time we saw a type, or close to it. With this patch, we cache the last 4096 (it's controlled by a define, this is a completely unscientific number, you could probably do with smaller, but it won't make much difference, seeing as how it's 16k worth of pointers) types we saw by the hash of their name, and use that, rather than allocating a new type every time. The results are dramatic. Just on GDB, compiled with dwarf2, for instance, we go from 123,739 types to 87,004, a 33% reduction. We also drop from needing 60 meg, with everything read in (maint check symtabs was used to force readin), to 46 meg. Since their are now really only "distinct" symbols, and "distinct" types, rather than tons of duplicates, things should go a bit faster as well in other lookups. In doing all of this, i also changed the hash function in the bcache to a much better hash function (the old one was stolen from SDBM, this one uses what db 3.0.55 uses. The commentary in the db 3.0.55 source says it's just as good on strings, and much better on numbers), made the hash function available through bcache.h, and changed buildsym.c's hashname to use it as well. I was going to change the minsym hash to use the hash function as well, but haven't finished regression tests on that change, so i left it out. I'm just starting to clear out my backlog of patches, expect more memory reductions for dwarf2 soon. --Dan