From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8653 invoked by alias); 22 Feb 2010 18:27:59 -0000 Received: (qmail 8633 invoked by uid 22791); 22 Feb 2010 18:27:58 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Feb 2010 18:27:54 +0000 Received: (qmail 400 invoked from network); 22 Feb 2010 18:27:53 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Feb 2010 18:27:53 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: Fwd: [patch]: Fix crash in objc and breakpoints Date: Mon, 22 Feb 2010 18:27:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-19-generic; KDE/4.3.2; x86_64; ; ) Cc: Kai Tietz References: <90baa01f1002181132v2faf5c3fm4b368ff0324fc3b2@mail.gmail.com> In-Reply-To: <90baa01f1002181132v2faf5c3fm4b368ff0324fc3b2@mail.gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201002221827.51014.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-02/txt/msg00545.txt.bz2 On Thursday 18 February 2010 19:32:11, Kai Tietz wrote: > * source.c (line_info): Initialize pspace by default > current_program_space. > * frame.c (find_frame_sal): Likewise. > * linespec.c (decode_line_2): Likewise. > (decode_objc): Likewise. > > Ok for apply? Sorry, not yet. The patch is mangled and I can't apply it as is, but I'll try to make an effort to read it anyway. Could you please, please also use (cvs) diff's -p switch for future patches? It makes diffs so much more readable. Thanks. > > Index: src/gdb/frame.c > =================================================================== > --- src.orig/gdb/frame.c 2010-01-29 16:28:43.000000000 +0100 > +++ src/gdb/frame.c 2010-02-18 10:49:42.745803800 +0100 > @@ -1857,6 +1857,8 @@ > the call site is. Do not pretend to. This is jarring, but > we can't do much better. */ > sal->pc = get_frame_pc (frame); > + /* Initialize pspace by default. */ > + sal->pspace = current_program_space; > Did you try frame->pspace? > return; > } > Index: src/gdb/linespec.c > =================================================================== > --- src.orig/gdb/linespec.c 2010-02-18 10:41:31.000000000 +0100 > +++ src/gdb/linespec.c 2010-02-18 10:52:50.980178800 +0100 > @@ -513,7 +513,9 @@ > while (i < nelts) > { > init_sal (&return_values.sals[i]); /* Initialize to zeroes. > */ > + return_values.sals[i].pspace = current_program_space; > init_sal (&values.sals[i]); > + values.sals[i].pspace = current_program_space; > if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) == LOC_BLOCK) > values.sals[i] = find_function_start_sal (sym_arr[i], > funfirstline); > i++; Sorry, I don't like these workarounds. Why was this needed? There must be a code path that didn't set the pspace on a valid sal. What was it? I think you're patching this: i = 0; while (i < nelts) { init_sal (&return_values.sals[i]); /* Initialize to zeroes. */ init_sal (&values.sals[i]); if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) == LOC_BLOCK) values.sals[i] = find_function_start_sal (sym_arr[i], funfirstline); i++; } and find_function_start_sal should be returning a sal with the correct pspace, so this must be about the sals that aren't LOC_BLOCK? What are those? Below there's this while (i < nelts) { if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) == LOC_BLOCK) { ... } else printf_unfiltered (_("?HERE\n")); i++; Are we hitting this? Sounds like something similar to PR10966. Does the workaround that has been applied on the branch for this PR happen to fix this? > @@ -1206,6 +1208,7 @@ > ¤t_target); > > init_sal (&values.sals[0]); > + values.sals[0].pspace = current_program_space; > values.sals[0].pc = pc; > } > return values; > Index: src/gdb/source.c > =================================================================== > --- src.orig/gdb/source.c 2010-01-12 16:54:43.000000000 +0100 > +++ src/gdb/source.c 2010-02-18 10:46:36.183303800 +0100 > @@ -1467,6 +1467,7 @@ > int i; > > init_sal (&sal); /* initialize to zeroes */ > + sal.pspace = current_program_space; /* initialize as default. */ Likewise. Isn't this a problem with the `if (arg == 0)' branch below only? It looks like it. > > if (arg == 0) > { > > Do you have a testcase (doesn't have to be in .exp form, just something I could try) for these issues yet? You seem to be covering different problems with the same patch. -- Pedro Alves