From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17365 invoked by alias); 1 Aug 2002 22:44:26 -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 17356 invoked from network); 1 Aug 2002 22:44:25 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 1 Aug 2002 22:44:25 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id PAA24805; Thu, 1 Aug 2002 15:43:42 -0700 (PDT) Message-ID: <3D49B573.B21E4D02@redhat.com> Date: Thu, 01 Aug 2002 15:44:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Jim Blandy CC: Joel Brobecker , gdb-patches@sources.redhat.com Subject: Re: [RFC] breakpoints and function prologues... References: <20020722231957.GE4999@gnat.com> <20020726053320.GB10000@gnat.com> <20020731013453.GX13411@gnat.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-08/txt/msg00034.txt.bz2 Jim Blandy wrote: > > For as long as I can remember, GDB has treated setting a breakpoint on > the line containing the opening curly brace of a function's block as > meaning `set a breakpoint before the prologue'. I've always assumed > that was deliberate behavior. Semi. It follows from the line symbols. GCC emits a line symbol for that line which spans the address range of the prologue. So you could say it's deliberate -- but on GCC's part, rather than on GDB's. > But I can't find it documented in the GDB manual. That's because it's not a special case. It's the same behavior as for any line -- put the breakpoint where the compiler says to. > And it's a lousy > user interface (`break *main' works just as well, and makes more sense > to me). Maybe the behavior is just a side effect of the decision to > attribute the prologue code to the line containing the opening curly > brace Exactly -- > --- if the program stops in the prologue, that's as sensible a > place as any to claim it's at. > > So I'd support changing `break LINENO' to always skip the prologue. I would not. It's changing a behavior that people have become accustomed to.