From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25576 invoked by alias); 10 Jul 2004 21:06:12 -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 25377 invoked from network); 10 Jul 2004 21:06:07 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.77.109) by sourceware.org with SMTP; 10 Jul 2004 21:06:07 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i6AL64vB022934; Sat, 10 Jul 2004 23:06:04 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i6AL64ZJ013154; Sat, 10 Jul 2004 23:06:04 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i6AL5xJr013149; Sat, 10 Jul 2004 23:05:59 +0200 (CEST) Date: Sat, 10 Jul 2004 21:06:00 -0000 Message-Id: <200407102105.i6AL5xJr013149@elgar.kettenis.dyndns.org> From: Mark Kettenis To: m.mueller99@kay-mueller.de CC: m.mueller99@kay-mueller.de, gdb-patches@sources.redhat.com In-reply-to: <40D6DDFF.7030800@kay-mueller.de> (message from Michael Mueller on Mon, 21 Jun 2004 15:09:19 +0200) Subject: Re: [RFC]: patch 1 for Sun C compiled target programs References: <40D08A0C.1050606@kay-mueller.de> <200406182147.i5ILlM3f001498@elgar.kettenis.dyndns.org> <40D6DDFF.7030800@kay-mueller.de> X-SW-Source: 2004-07/txt/msg00099.txt.bz2 Date: Mon, 21 Jun 2004 15:09:19 +0200 From: Michael Mueller > > I'll try to get this fixed before the 6.2 release. Thanks for giving > me a bit more ammunition for getting this change accepted by the rest > of the crowd. Sounds promising. I filed PR gdb/1682 to remind you guys :-) Can you test the attached patch for me? I don't have access to a machine with a Sun compiler. This patch should fix your problems while keeping the current behaviour with GCC. Thanks, Mark Index: dbxread.c =================================================================== RCS file: /cvs/src/src/gdb/dbxread.c,v retrieving revision 1.69 diff -u -p -r1.69 dbxread.c --- dbxread.c 1 Jul 2004 20:25:53 -0000 1.69 +++ dbxread.c 10 Jul 2004 20:58:09 -0000 @@ -2659,6 +2659,7 @@ process_one_symbol (int type, int desc, /* This holds the address of the start of a function, without the system peculiarities of function_start_offset. */ static CORE_ADDR last_function_start; + static int last_function_desc; /* If this is nonzero, we've seen an N_SLINE since the start of the current function. We use this to tell us to move the first sline @@ -2736,6 +2737,7 @@ process_one_symbol (int type, int desc, valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); valu = SMASH_TEXT_ADDRESS (valu); last_function_start = valu; + last_function_desc = desc; goto define_a_symbol; @@ -2928,11 +2930,12 @@ process_one_symbol (int type, int desc, /* Relocate for dynamic loading and for ELF acc fn-relative syms. */ valu += function_start_offset; - /* If this is the first SLINE note in the function, record it at - the start of the function instead of at the listed location. */ if (within_function && sline_found_in_function == 0) { - record_line (current_subfile, desc, last_function_start); + if (last_function_desc != 0) + record_line (current_subfile, desc, last_function_start); + else + record_line (current_subfile, desc, valu); sline_found_in_function = 1; } else