From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27969 invoked by alias); 18 Feb 2010 19:32:18 -0000 Received: (qmail 27959 invoked by uid 22791); 18 Feb 2010 19:32:18 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-bw0-f212.google.com (HELO mail-bw0-f212.google.com) (209.85.218.212) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Feb 2010 19:32:14 +0000 Received: by bwz4 with SMTP id 4so104492bwz.8 for ; Thu, 18 Feb 2010 11:32:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.133.27 with SMTP id d27mr6214719bkt.51.1266521531821; Thu, 18 Feb 2010 11:32:11 -0800 (PST) In-Reply-To: References: Date: Thu, 18 Feb 2010 19:32:00 -0000 Message-ID: <90baa01f1002181132v2faf5c3fm4b368ff0324fc3b2@mail.gmail.com> Subject: Fwd: [patch]: Fix crash in objc and breakpoints From: Kai Tietz To: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00463.txt.bz2 ups, wrong mailing list. ---------- Forwarded message ---------- From: Kai Tietz Date: 2010/2/18 Subject: [patch]: Fix crash in objc and breakpoints To: gdb@sourceware.org Cc: Joel Brobecker Hello, Sorry, that I came that late to this subject, but I was pretty busy last weeks. As discussed in thread " [gdb-7.1] 10 days to branching..." there are troubles about setting breakpoints in gdb. =A0As I found is the issue related to recent use of init_sal function and missing initialization of pspace member. The following patch solves this for me. I regression tested it for x86_64-pc-mingw32, i686-pc-linux, and i686-pc-cygwin without any regressions. 2010-02-18 Kai Tietz =A0 =A0 =A0 =A0 =A0* source.c (line_info): Initialize pspace by default =A0 =A0 =A0 =A0current_program_space. =A0 =A0 =A0 =A0* frame.c (find_frame_sal): Likewise. =A0 =A0 =A0 =A0* linespec.c (decode_line_2): Likewise. =A0 =A0 =A0 =A0(decode_objc): Likewise. Ok for apply? Regards, Kai | =A0(\_/) =A0This is Bunny. Copy and paste Bunny | (=3D'.'=3D) into your signature to help him gain | (")_(") world domination. -------- Index: src/gdb/frame.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- src.orig/gdb/frame.c =A0 =A0 =A0 =A02010-01-29 16:28:43.000000000 +0100 +++ src/gdb/frame.c =A0 =A0 2010-02-18 10:49:42.745803800 +0100 @@ -1857,6 +1857,8 @@ =A0 =A0 =A0 =A0 =A0 the call site is. =A0Do not pretend to. =A0This is jarr= ing, but =A0 =A0 =A0 =A0 =A0 we can't do much better. =A0*/ =A0 =A0 =A0 =A0sal->pc =3D get_frame_pc (frame); + =A0 =A0 =A0/* Initialize pspace by default. =A0*/ + =A0 =A0 =A0sal->pspace =3D current_program_space; =A0 =A0 =A0 return; =A0 =A0 } Index: src/gdb/linespec.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- src.orig/gdb/linespec.c =A0 =A0 2010-02-18 10:41:31.000000000 +0100 +++ src/gdb/linespec.c =A02010-02-18 10:52:50.980178800 +0100 @@ -513,7 +513,9 @@ =A0 while (i < nelts) =A0 =A0 { =A0 =A0 =A0 init_sal (&return_values.sals[i]); =A0 =A0 =A0 /* Initialize to= zeroes. */ + =A0 =A0 =A0return_values.sals[i].pspace =3D current_program_space; =A0 =A0 =A0 init_sal (&values.sals[i]); + =A0 =A0 =A0values.sals[i].pspace =3D current_program_space; =A0 =A0 =A0 if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) =3D=3D LOC_BLOCK) =A0 =A0 =A0 =A0values.sals[i] =3D find_function_start_sal (sym_arr[i], funfirstline); =A0 =A0 =A0 i++; @@ -1206,6 +1208,7 @@ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 ¤t_target); =A0 =A0 =A0 =A0 =A0init_sal (&values.sals[0]); + =A0 =A0 =A0 =A0 values.sals[0].pspace =3D current_program_space; =A0 =A0 =A0 =A0 =A0values.sals[0].pc =3D pc; =A0 =A0 =A0 =A0} =A0 =A0 =A0 return values; Index: src/gdb/source.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- src.orig/gdb/source.c =A0 =A0 =A0 2010-01-12 16:54:43.000000000 +0100 +++ src/gdb/source.c =A0 =A02010-02-18 10:46:36.183303800 +0100 @@ -1467,6 +1467,7 @@ =A0 int i; =A0 init_sal (&sal); =A0 =A0 =A0 =A0 =A0 =A0 /* initialize to zeroes */ + =A0sal.pspace =3D current_program_space; /* initialize as default. =A0*/ =A0 if (arg =3D=3D 0) =A0 =A0 { --=20 | (\_/) This is Bunny. Copy and paste | (=3D'.'=3D) Bunny into your signature to help | (")_(") him gain world domination