From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5898 invoked by alias); 19 Nov 2002 05:20:39 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 5887 invoked from network); 19 Nov 2002 05:20:36 -0000 Received: from unknown (HELO zenia.red-bean.com) (66.244.67.22) by sources.redhat.com with SMTP; 19 Nov 2002 05:20:36 -0000 Received: (from jimb@localhost) by zenia.red-bean.com (8.11.6/8.11.6) id gAJ542p01530; Tue, 19 Nov 2002 00:04:02 -0500 To: Alexander Larsson Cc: gdb@sources.redhat.com Subject: Re: Final separate debug info patch References: From: Jim Blandy Date: Mon, 18 Nov 2002 21:20:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.92 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-11/txt/msg00202.txt.bz2 It looks like the stripping process may break some executables. If $D is the top directory of a current GDB source tree, try this: $ g++ --version g++ (GCC) 3.3 20020820 (experimental) Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ g++ -g $D/gdb/testsuite/gdb.c++/try_catch.cc -o try_catch $ ./try_catch $ /home/jimb/elfutils/bin/strip -f try_catch.separate-debug try_catch $ ./try_catch Segmentation fault $ I found this by running the GDB test suite, configured to strip the debug info of every executable it creates to a separate file. If you'd like to try it, here's how I did it: First, I created a file $DEJAGNU/boards/unix-separate-debug.exp, which contains the following: load_base_board_description "unix" set strip_to_file_program "/home/jimb/elfutils/bin/strip" proc ${current_target_name}_compile {source dest type options} { global strip_to_file_program # Run the standard compilation procedure. set result [default_target_compile $source $dest $type $options] # If it didn't succeed, return directly. if {[string compare $result ""] != 0} { return $result } puts "jimb: stripping to a separate file..." # Otherwise, strip the executable and copy its debug info to a # separate file, leaving only a pointer behind. if {[string compare $type executable] == 0} { exec $strip_to_file_program -f ${dest}.separate-debug ${dest} } } This defines a new target, "unix-separate-debug", which is just like "unix" except that it extracts the debug info of each executable the test suite builds to a separate file. Adjust `strip_to_file_program' as needed, of course. Then, I use the following target list in my $DEJAGNU file: set target_list { unix-sdi unix } So the effect is to: - run all the tests once with separate debug info, and then - run all the tests again with the normal debug info arrangement. This makes it easy to see if the patch has any effect on the tests. There are some problems at the moment: DejaGNU has the name "unix" hard-coded into it, and thinks that anything with another name is a remote board. Some tests won't run if the target is remote. I think I know how to persuade it that unix-separate-debug is still not a remote target, but I'm just going to post this as is for the time being.