From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12560 invoked by alias); 11 Sep 2003 18:42:39 -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 12531 invoked from network); 11 Sep 2003 18:42:39 -0000 Received: from unknown (HELO cygnus.equallogic.com) (65.170.102.10) by sources.redhat.com with SMTP; 11 Sep 2003 18:42:39 -0000 Received: from cygnus.equallogic.com (localhost.localdomain [127.0.0.1]) by cygnus.equallogic.com (8.11.6/8.11.6) with ESMTP id h8BIgcw21368 for ; Thu, 11 Sep 2003 14:42:38 -0400 Received: from deneb.dev.equallogic.com (deneb.dev.equallogic.com [172.16.1.99]) by cygnus.equallogic.com (8.11.6/8.11.6) with ESMTP id h8BIgbN21356; Thu, 11 Sep 2003 14:42:37 -0400 Received: from localhost.equallogic.com (localhost.localdomain [127.0.0.1]) by deneb.dev.equallogic.com (8.11.6/8.11.6) with ESMTP id h8BIgaM02234; Thu, 11 Sep 2003 14:42:37 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16224.49692.542476.869174@gargle.gargle.HOWL> Date: Thu, 11 Sep 2003 18:42:00 -0000 From: Paul Koning To: brobecker@gnat.com Cc: jimb@redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFA] parse and eval breakpoint conditions with correct language References: <20030910015400.GS423@gnat.com> <20030911180920.GD945@gnat.com> X-SW-Source: 2003-09/txt/msg00227.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> Groumf! Our nightly regression test showed a small regression Joel> which does not appear on my machine. We have an all-Ada program Joel> which defines a function named Func1, and here is what the test Joel> does: Joel> (gdb) break *Func1'Address (gdb) run Joel> (The first command says place a breakpoint at the first Joel> instruction of Func1. What's important is that we use the Joel> "break *address" syntax). Joel> The first break command correctly uses the ada language to Joel> parse the expression (Func1'Address). The fun starts after Joel> "run": Joel> (gdb) run Starting program: /[...]/main Error in re-setting Joel> breakpoint 1: No symbol "Func1" in current context. Joel> Program exited normally. Current language: auto; currently c Joel> What happens is that the inferior is stopped twice during the Joel> startup phase after notifications about new shared libraries Joel> being loaded. GDB then re-parses all breakpoint expressions Joel> and re-inserts them. During this phase, the block given to Joel> parse_exp_1 is NULL, so GDB uses the current block (ie the Joel> block corresponding to the current frame) to determine the Joel> language. Since the current frame has nothing to do with the Joel> breakpoint, we are sometimes unlucky enough to use the wrong Joel> language to reparse the breakpoint. That's what happens to the Joel> test above, and is dependent on how the target system is setup. Warning, the following is not based on a really deep understanding of how gdb internals work... Could the same sort of trouble occur when evaluating watchpoint expressions? The parsing should be done according to the language in effect when the watchpoint is defined (either explicit, or from the current block language given this patch) -- not the one that happens to be in effect when gdb is checking for watch hits during execution. Is that a non-issue or could you run into the same sort of problem as what Joel reported? paul