ddd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Suggestion: array-of-structures slices


From: Atwood, Robert C
Subject: RE: Suggestion: array-of-structures slices
Date: Thu, 4 Dec 2003 16:40:14 -0000

I was thinking that a sort-of feature ought to be possible by modifying the
ddd/gnuplot interface; since
 gnuplot already has a feature for displaying a dataset with a definable
stride and definable block size, a
 simple case like you describe, where the array of structures is contiguous,
or the one I describe where a
 contiguous array is used as a multidimensional array, should be possible to
display in the plot function.
 That is, the plotted graph would show the desired data although the 'graph
display' would not.
 The gnuplot function for that is part of the 'every' command , from the
command line I use 

gnuplot> plot 'mydata.dat' every 2::3

or something like that for a datafile with a couple of lines of text at the
top, to plot every other point. However, I cannot locate a command to replot
an existing data set with a new stride, so I can't suggest how to do this
once the data is already plotted. If this cannot be done then I guess the
ddd calling routine would need to be modified to obtain the parameter and
pass it when the data is first plotted? 

 

-----Original Message-----
From: Mihai Basa [mailto:address@hidden 
Sent: 04 December 2003 14:48
To: Atwood, Robert C
Subject: RE: Suggestion: array-of-structures slices


>===== Original Message From "Atwood, Robert C" 
><address@hidden>
=====
>I don't know at the bottom level how the 'graph display ... ' is 
>processed; but it does seem to grab  the normal output of the gdb 
>display command in order to put it in the graphic area.
>
>At first, I would even like to see a selectable 'stride' even if it 
>does not account for structure ,  for example I have a dynamically 
>allocated array that represents a 3-dimensional space, but for
> ease of memory management, copying, etc. it is just defined as
>
>float * my-block;
>
>For most calculations I can just loop through the whole thing in index 
>order, and if it is necessary to consider the location (i,j,k) in 
>'space' it must be indexed by *(my-block+i+j*nx+k*nx*ny)
>
>In the SGI cvd debugger, there is a feature so that you can select to 
>display a 'slice' of such an array using dummy variables , so you can 
>display an i-j slice, j-k slice, i-k slice quite easily. It also works 
>for structures as you would like. Unfortunately it is only for the IRIX 
>systems. For now I still have access to an aging SGI (very slow by this 
>year's
>standards) but eventually it will break and not be fixed as it is no longer
>under maintenance contract -- I mean we could buy a cluster of 10 Intel
>processors using gnu/linux/beowulf for the cost of just the maintenace
>contract! But that means learning to use the tools available for this
system
>and I miss that feature, sometimes enough to rebuild my code on the SGI and
>debug it there.
>


Hi Robert,


I've posted the question to the gdb list, and the reply was


   "Yes, I've often wanted the same thing.  However, it's quite tricky to
    implement.

    --
    Daniel Jacobowitz"


which I guess means it won't be implemented very soon :(. I might actually 
look into this myself if I get the time... I think, naively, that it could
be 
done with a small modification. But I know nothing of gdb internals of
course. I also got this off-list email that you might find useful too:

    "Hi,

    I saw your post on the gdb list. If you really want this functionality
    you should look at our TotalView product, which provides this (and the
    ability to indirect as well, so to see the targets of a pointer in an
    array of structs).

    TotalView costs money (which is how I get paid to write it :-), but
    you can download a fully functional demo version to try it for a
    couple of weeks for free (from our www site as below).

    Whatever, please forgive the intrusion.

    -- Jim

    James Cownie        <address@hidden>
    Etnus, LLC.     +44 117 9071438
    http://www.etnus.com";


I have heard very good things about Totalview, especially related to
parallel 
programming, but I've never used it myself. (I remember I had some 
difficulties installing it due to a kernel bug, when I tried. So not its 
fault.)


Regards,
Mihai




reply via email to

[Prev in Thread] Current Thread [Next in Thread]