From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24379 invoked by alias); 20 Oct 2006 16:56:10 -0000 Received: (qmail 24362 invoked by uid 22791); 20 Oct 2006 16:56:09 -0000 X-Spam-Check-By: sourceware.org Received: from smtp30.hccnet.nl (HELO smtp30.hccnet.nl) (62.251.0.40) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 20 Oct 2006 16:56:02 +0000 Received: from [192.168.0.151] by smtp30.hccnet.nl via [80.100.236.49] with ESMTP for id k9KGtwxQ014925 (8.13.6/2.05); Fri, 20 Oct 2006 18:55:59 +0200 (MEST) Message-ID: <4538FF9D.9070803@hccnet.nl> Date: Fri, 20 Oct 2006 16:56:00 -0000 From: Erik Leunissen User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: gdb@sourceware.org Subject: Re: breakpoint for accessing memory location References: <4537DBC6.1030807@hccnet.nl> <20061019201214.GA32332@nevyn.them.org> <4537DEDC.5000008@hccnet.nl> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00160.txt.bz2 Eli Zaretskii wrote: > > What text would you suggest to have there that would have helped you > recognize that this is the feature you wanted? If you were looking > for some specific words or phrases, please tell what they are. This > will allow us to improve the manual. > OK, I was led off the track by the word "expr" without there being an explanation of its use, which may be quite powerful and encompass a diversity which the mere mentioning of the single word "expr" fails to express. Below you find how I failed to see its usefulness and a beginning of a formulation that would have prevented me from missing it. Actually I was prepared to find a feature like "setting a watch on something", which interrupts program execution as soon as the value for "something" changes. So, the term watchpoint is not the problem (it is one of the things I tried in the first place). The reasons for missing its usefulness are: 1. From previous experience (I believe I derive that from a Turbo Pascal IDE compiler/debugger) I knew a feature that sets a watchpoint on a *variable*. However, the manual mentions an "expr" to watch for. An "expr" is more abstract, but probably includes variables. 2. I tried to set a watch on the memory address of the variable that was giving me trouble (this appeared not to be very useful as Daniel pointed out, but that's beside the point now). The reason I tried such a less useful thing also lies in the fact that "expr" can mean a lot, and one has to devise an interpretation for it oneself. The diversity of the possible interpretations of "expr" isn't worked out in a set of examples. 3. My experiment with a fixed memory address failed. That's when I reverted to breakpoints, which (of course) is not what I was looking for. 4. I sought help in this mailing list (thanks again). So, to summarize a long story: "expr" can mean a lot of different things, but programmers that are new to debugging, or new to gdb will not have much idea about useful interpretations of that term. If no words are spent on an explanation of the power of this single word then users may get lost. As for a recommended formulation, well, something along the lines of: watch expr Set a watchpoint for an expression. GDB will break when expr is written into by the program and its value changes. Be aware that expr is a powerful construct that can be used to: - indicate a variable: [include a reference to an example] - a value at a specific memory address (without a variable needing to reference it): [include a reference to an example] - other useful interpretations that I don't see right now ... Please feel free to adapt from this suggestion, since it should be clear that I don't oversee the extent to which expr may be usefully interpreted in this case. Sincerely, Erik Leunissen