From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: gdb-patches@sources.redhat.com Subject: PATCH: revert find_pc_sect_line sanity check Date: Mon, 26 Nov 2001 16:04:00 -0000 Message-id: <20011127000538.68E465E9D8@zwingli.cygnus.com> X-SW-Source: 2001-11/msg00464.html 2001-11-26 Jim Blandy * symtab.c (find_pc_sect_line): Revert change of 2001-11-13; add comment explaining that hand-written assembly code can have line number info but no debug info for an enclosing function. Index: symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.48 diff -c -c -b -F'^(' -r1.48 symtab.c *** symtab.c 2001/11/13 16:42:50 1.48 --- symtab.c 2001/11/26 23:58:08 *************** *** 1570,1582 **** INIT_SAL (&val); /* initialize to zeroes */ ! /* Don't even think about line numbers if we can't find a function ! symbol for PC. */ ! if (find_pc_function (pc) == NULL) ! { ! val.pc = pc; ! return val; ! } if (notcurrent) pc -= 1; --- 1570,1581 ---- INIT_SAL (&val); /* initialize to zeroes */ ! /* It's tempting to assume that, if we can't find debugging info for ! any function enclosing PC, that we shouldn't search for line ! number info, either. However, GAS can emit line number info for ! assembly files --- very helpful when debugging hand-written ! assembly code. In such a case, we'd have no debug info for the ! function, but we would have line info. */ if (notcurrent) pc -= 1; From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25803 invoked by alias); 27 Nov 2001 00:04:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25764 invoked from network); 27 Nov 2001 00:04:24 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by hostedprojects.ges.redhat.com with SMTP; 27 Nov 2001 00:04:24 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id 68E465E9D8; Mon, 26 Nov 2001 19:05:38 -0500 (EST) From: Jim Blandy To: gdb-patches@sources.redhat.com Subject: PATCH: revert find_pc_sect_line sanity check Message-ID: <20011127000538.68E465E9D8@zwingli.cygnus.com> Date: Tue, 13 Nov 2001 09:11:00 -0000 X-SW-Source: 2001-11/txt/msg00249.txt.bz2 Message-ID: <20011113091100.0zkMb9Q7yldsnL9tjUDudhjhjjI-sc24IYapkyREyDk@z> 2001-11-26 Jim Blandy * symtab.c (find_pc_sect_line): Revert change of 2001-11-13; add comment explaining that hand-written assembly code can have line number info but no debug info for an enclosing function. Index: symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.48 diff -c -c -b -F'^(' -r1.48 symtab.c *** symtab.c 2001/11/13 16:42:50 1.48 --- symtab.c 2001/11/26 23:58:08 *************** *** 1570,1582 **** INIT_SAL (&val); /* initialize to zeroes */ ! /* Don't even think about line numbers if we can't find a function ! symbol for PC. */ ! if (find_pc_function (pc) == NULL) ! { ! val.pc = pc; ! return val; ! } if (notcurrent) pc -= 1; --- 1570,1581 ---- INIT_SAL (&val); /* initialize to zeroes */ ! /* It's tempting to assume that, if we can't find debugging info for ! any function enclosing PC, that we shouldn't search for line ! number info, either. However, GAS can emit line number info for ! assembly files --- very helpful when debugging hand-written ! assembly code. In such a case, we'd have no debug info for the ! function, but we would have line info. */ if (notcurrent) pc -= 1;