From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9158 invoked by alias); 10 Jul 2002 20:27:22 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9149 invoked from network); 10 Jul 2002 20:27:21 -0000 Received: from unknown (HELO tetsuo.nj.caldera.com) (63.124.204.226) by sources.redhat.com with SMTP; 10 Jul 2002 20:27:21 -0000 Received: from caldera.com (localhost.localdomain [127.0.0.1]) by tetsuo.nj.caldera.com (8.11.6/8.11.6) with ESMTP id g6AKdX403986; Wed, 10 Jul 2002 16:39:33 -0400 Message-ID: <3D2C9B83.94D00EA6@caldera.com> Date: Wed, 10 Jul 2002 14:06:00 -0000 From: Petr Sorfa Organization: Caldera X-Accept-Language: en MIME-Version: 1.0 To: Daniel Jacobowitz CC: "gdb-patches@sources.redhat.com" Subject: Re: [PATCH] DW_AT_calling_convention support REV 2 References: <3D2C80A8.35D678FE@caldera.com> <20020710184710.GA923@nevyn.them.org> <3D2C8D8C.E5127E28@caldera.com> <20020710193458.GA28939@nevyn.them.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg00205.txt.bz2 Hi, > > Good, I agree, that makes it more generic. Need to check for > > check_symbol for NULL as this might tank GDB at the second if. > > Why should NULL be a legitimate argument? Calling the function without > a symbol is useless... Just error trapping. In case something goes wrong and a NULL pointer gets accidentally passed. > > > And then change all callers of get_main_name () to use this. > > > > > > (Note that this requires being careful if symbol_of_main gets > > > unloaded and we load a C program afterwards!) > > > > > > Make sense? Sound reasonable? > > Um, you've lost me. There is no get_main_name() function, do you mean > > get_main_symbol() or main_name()? I still not sure what the callers of > > the function should do. > > main_name(), I assume. Basically I would like everywhere that > currently checks by a strcmp/STREQ with main_name() to use > is_main_symbol () instead, etc. Things that call lookup_symbol on > main_name() should just use get_main_symbol () if possible. Then > set_main_name () could include calling lookup_symbol(main_name()), so > that get_main_symbol would always be valid, etc.... Ok, got it. > > Although, I do agree that the patch should catch unloading the > > main_symbol, but how? > > I'm not sure :( Is there a hook for when object files are unloaded? Nope. In the cu_header patch, I have a hook from elfread.c to dwarf2read.c to clear up stuff when a new program is about to be debugged. The function will be called dwarf_init (). But as for a generic solution.. Petr