From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21211 invoked by alias); 29 Aug 2002 18:15:27 -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 21202 invoked from network); 29 Aug 2002 18:15:24 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (205.232.38.234) by sources.redhat.com with SMTP; 29 Aug 2002 18:15:24 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 4BA59D2CBD; Thu, 29 Aug 2002 11:15:24 -0700 (PDT) Date: Thu, 29 Aug 2002 11:37:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: [RFA/controversial] move bp by line number past the prologue Message-ID: <20020829181524.GC971@gnat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TRYliJ5NKNqkz5bu" Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2002-08/txt/msg00985.txt.bz2 --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1145 This proposal has been discussed on this gdb-patches mailing list, and there has been no consensus. Some of us are in favor of this change, others are against. I am submitting this change for approval as a request to make a decision. I don't know if making a small summary of the different points for/against this change of behavior would be useful, all the discussion is archived under [RFC] breakpoints and function prologues... http://sources.redhat.com/ml/gdb-patches/2002-07/msg00448.html and http://sources.redhat.com/ml/gdb-patches/2002-07/msg00451.html Let me know if you would like to see such a summary (I'll try not to distort too much the different points too much in my favor :-). 2002-08-29 Jim Ingham * linespec.c (decode_line_1): Skip the function prologue if funfirstline is set. Changes the behavior of the break command to skip the function prologue when breaking by line number. This change introduces 5 FAILs in one testcase which assumes the current behavior, so the FAIL is expected. Should this patch be approved, I'll the testcase up. Ahem... Ok to apply? -- Joel --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="linespec.c.diff" Content-length: 1312 Index: linespec.c =================================================================== RCS file: /cvs/src/src/gdb/linespec.c,v retrieving revision 1.21 diff -c -3 -p -r1.21 linespec.c *** linespec.c 11 May 2002 22:46:19 -0000 1.21 --- linespec.c 29 Aug 2002 18:03:02 -0000 *************** decode_line_1 (char **argptr, int funfir *** 1067,1073 **** --- 1067,1097 ---- if (val.symtab == 0) val.symtab = s; + /* If funfirstline is set, we need to look up the function + containing the line, and move past the prologue. */ + val.pc = 0; + if (funfirstline) + { + CORE_ADDR pc = 0; + + if (find_line_pc (val.symtab, val.line, &pc)) + { + struct symbol *func_sym; + struct symtab_and_line sal; + + func_sym = find_pc_function (pc); + if (func_sym) + { + sal = find_function_start_sal (func_sym, 1); + /* Don't move the line, just set the pc + to the right place. */ + if (val.line <= sal.line) + val.pc = sal.pc; + } + } + } + values.sals = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line)); values.sals[0] = val; --TRYliJ5NKNqkz5bu--