From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17899 invoked by alias); 30 Jul 2007 08:14:31 -0000 Received: (qmail 17890 invoked by uid 22791); 30 Jul 2007 08:14:30 -0000 X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.31) with SMTP; Mon, 30 Jul 2007 08:14:28 +0000 Received: (qmail invoked by alias); 30 Jul 2007 08:14:25 -0000 Received: from DSL01.83.171.165.105.ip-pool.NEFkom.net (EHLO localhost) [83.171.165.105] by mail.gmx.net (mp054) with SMTP; 30 Jul 2007 10:14:25 +0200 X-Authenticated: #2360897 Date: Mon, 30 Jul 2007 09:32:00 -0000 From: Bernhard Walle To: gdb@sourceware.org Subject: Re: Can i set a breakpoint when a member of a C struct is being assigned? Message-ID: <20070730081425.GA13324@mail1.bwalle.de> Mail-Followup-To: gdb@sourceware.org References: <568e62a40707292020j4e53d480je8822ac6f37f4eda@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <568e62a40707292020j4e53d480je8822ac6f37f4eda@mail.gmail.com> User-Agent: Mutt/1.5.16 (2007-06-09) X-Y-GMX-Trusted: 0 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00207.txt.bz2 * ying lcs [2007-07-30 05:20]: > Hi, > > Can i set a breakpoint when a member of a C struct is being assigned? > > For example, i have a C struct in my code: > struct myStruct{ > int type; > }; > > How can I break my debugging program when I have code like this: > > myStruct* p; Set a breakpoint here. And add a watchpoint. > p->type = 10; Then GDB stops here. Bernhard -- lp1 on fire -- One of the more obfuscated kernel messages