Results 1 to 5 of 5

Thread: Setting a watchpoint on an array?

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Posts
    2

    Setting a watchpoint on an array?

    User wants a watchpoint on an array, which the user manual casually explains

    "When you set a watchpoint, you are setting it on the complete contents of the information being displayed in the Variable Window. For example, if the Variable Window displays an array, you can only set a watchpoint on the entire array (or as many bytes that TotalView can watch.)"

    Our user's array is integer*4(10) or a whopping 40 bytes. We dive on the array variable, the window opens displaying everything about the array. We ask it to create a watchpoint. TV fills in an address and the length in bytes [40] but when we click OK it says "Invalid watchpoint address or length." We can get it to set the watchpoint if we hobble the length to 8 bytes, or if we select any single array element, but that doesn't seem terribly useful. What are we doing wrong?

    Has the same problem with a character array, by the way. It's willing to look at only 8 bytes of a 10-byte character array.

    Same results with TV 7.2, 8.1, and a brand-new 8.4 build.

    Thanks!

  2. #2
    Junior Member
    Join Date
    Aug 2006
    Location
    Lake Katrine, NY
    Posts
    26

    Re: [Georgia] Setting a watchpoint on an array?

    You have to remember that Watchpoints/Breakpoints are implemented through hardware registers that point to the specified memory address. What they point to are (obviously?) limited to the size of a word; 8 bytes for a 64-bit system. I had the same concern/question a while back and this is what I was told by TV tech support (which made sense once they said it).


    Kenneth Kahn
    Senior Member of Consulting Staff
    CVA R&D Hardware Emulation
    Cadence Design Systems
    Lake Katrine, NY
    kenkahn@cadence.com

  3. #3

    Re: [kenkahn] Setting a watchpoint on an array?

    Ken's right. We're limited by the hardware registers. The number of watchpoints is also limited. Some systems only allow one. On Linux I think the maximum is 4. Generally you can pick a strategic place in the array to set the watchpoint. If the array is getting randomly overwritten, it should still be happening at a particular point each time. Maybe...
    Pete Thompson
    TotalView Customer Services

  4. #4

    Re: [Peter-TotalView-Tech] Setting a watchpoint on an array?

    I will just add another point to address the original question regarding why watchpoints are set on the entire contents of the array. If you create a watchpoint by right clicking on an array reference and then choosing "Create Watchpoint", it will default to the entire contents of the array. The maximum size of a watchpoint is platform dependent so this size is often greater than the maximum allowed. This results in a warning message with the watchpoint being set to the maximum length allowed for that platform.

    If you select specific members of an array and then create the watchpoint, it will be created only for those members.

    Watchpoints are fairly complicated and there are a number of platform dependencies. There are multiple references to watchpoints throughout our documentation. The complete documentation is available online. You can reference it from the support link on our main web page or from the following link:
    [br]
    http://www.totalviewtech.com/Documentation/latest/html/wwhelp/wwhimpl/js/html/wwhelp.htm
    [br]
    Rob Solomon
    Rogue Wave Technical Support - Senior Engineer

  5. #5
    Junior Member
    Join Date
    Feb 2008
    Posts
    2

    Re: [Rob-TotalView] Setting a watchpoint on an array?

    [quote]I will just add another point to address the original question regarding why watchpoints are set on the entire contents of the array. If you create a watchpoint by right clicking on an array reference and then choosing "Create Watchpoint", it will default to the entire contents of the array.


    -> This was what we expected, that it would attempt to watch the whole array. Note: The example in the manual shows TV a byte value of 400 (four hundred :-) ) bytes, which is why we didn't understand the severe truncation.


    If you select specific members of an array and then create the watchpoint, it will be created only for those members.


    -> And it turns out our user was perfectly happy to learn how to do this.
    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •