After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 631139 - (textbox_watches) Display arrays in "watches" window as textbox
(textbox_watches)
Display arrays in "watches" window as textbox
Status: RESOLVED OBSOLETE
Product: anjuta
Classification: Applications
Component: plugins: debug-manager
2.32.x
Other All
: Normal enhancement
: ---
Assigned To: Sébastien Granjoux
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2010-10-01 21:18 UTC by Felix Totir
Modified: 2020-11-07 12:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Eclipse Debug Perspective screenshot 1 (160.12 KB, image/png)
2010-10-03 04:51 UTC, Felix Totir
Details
Eclipse Debug Perspective screenshot 2 (164.66 KB, image/png)
2010-10-03 04:54 UTC, Felix Totir
Details

Description Felix Totir 2010-10-01 21:18:44 UTC
Currently, arrays are displayed in "watces" window (during debugging sessions) as expandable trees (each leaf is a value). This is not practical for large arrays and does not allow one to copy the values of the entire array (in order to paste it into another file, for example). More, vertically displaying arrays has the drawback of quickly cluttering the "watches" window.
Instead, I propose to display each watched expression (and notably arrays) in a textbox on the right of the watched expression. For example:

Expression | Value
a[0]@3     | {0, 1, 43}
a[0]+7     | 7
structvar  | [structure]
 -field1   | 87
 -field2   | "John Smith"

More, editable fields (such as program variables) should be editable (allowing one to modify the value of a variable during debugging) while the other ones should be read-only (one cannot modify the value of the sum of two variables, for example "a+b").
Comment 1 Sébastien Granjoux 2010-10-02 08:11:22 UTC
I'm agree that the watch window are not practical. This tree view is the way gdb send back the data. The front end doesn't make the difference between structures and arrays. I think the latest version of gdb adds an additional hint information allowing to distinguish both cases, anyway it need more code to do something better.

As Anjuta supports it now, another solution is that you write yourself a pretty printer for arrays displaying them as a strings. But you have to write the pretty printer in Python and you will not be able to change the array values.

Do you know another IDE, preferably on Linux and using gdb, displaying arrays like you want ?
Comment 2 Felix Totir 2010-10-03 04:51:54 UTC
Created attachment 171614 [details]
Eclipse Debug Perspective screenshot 1
Comment 3 Felix Totir 2010-10-03 04:54:03 UTC
Created attachment 171615 [details]
Eclipse Debug Perspective screenshot 2
Comment 4 Felix Totir 2010-10-03 04:54:50 UTC
Quote: "As Anjuta supports it now, another solution is that you write yourself
a pretty printer for arrays displaying them as a strings. But you have to write
the
pretty printer in Python and you will not be able to change the array values."

That is true, however I have no knowledge of Python or how to write a pretty
printer.

Quote: "Do you know another IDE, preferably on Linux and using gdb, displaying
arrays like you want ?"

Almost yes, it is Eclipse. I attached two screenshots of its Debug Perspective.
The watches ("Expressions") window is in the up right corner. Note that "*s1"
is a structure and that "signal_real" is an array (or a pointer to a double).
The arrays are displayed both as expandable trees (left side) and as
{0,1,2,...} arrays (right side).

Eclipse does not allow modifying the value of an Expression, you have to use
the "Variables" window (not shown in the screenshots) for that.

On a secondary note, the Eclipse Debug Perspective automatically inserts a
breakpoint at "main" each time when launching the program under the control of
the debugger, which I find very convenient (continuing debugging is just a
"Resume" click away).
Comment 5 Sébastien Granjoux 2010-10-03 07:48:42 UTC
(In reply to comment #4)
> Almost yes, it is Eclipse. I attached two screenshots of its Debug Perspective.
> The watches ("Expressions") window is in the up right corner. Note that "*s1"
> is a structure and that "signal_real" is an array (or a pointer to a double).
> The arrays are displayed both as expandable trees (left side) and as
> {0,1,2,...} arrays (right side).

OK, thanks.


> On a secondary note, the Eclipse Debug Perspective automatically inserts a
> breakpoint at "main" each time when launching the program under the control of
> the debugger, which I find very convenient (continuing debugging is just a
> "Resume" click away).

I have done it first, but I think someone has reported that it's annoying. Moreover it can be a issue if the debugger is not used with a C program which doesn't have a main function. I don't know if it's possible but I think gdb support other languages.
Comment 6 Johannes Schmid 2010-10-03 10:39:45 UTC
 > I have done it first, but I think someone has reported that it's annoying.
> Moreover it can be a issue if the debugger is not used with a C program which
> doesn't have a main function. I don't know if it's possible but I think gdb
> support other languages.

Could have be me ;) It is not always pratical when you debug a big program because you have to hit run twice always. But this sounds like something we could offer as an option.
Comment 7 Felix Totir 2012-01-06 23:44:26 UTC
I saw this bug was commented in:

http://mail.gnome.org/archives/anjuta-devel-list/2011-February/msg00020.html

I would like to provide further support if needed in order to help with implementation in next Anjuta version.

Thank you for considering my bug report.
Comment 8 André Klapper 2020-11-07 12:12:24 UTC
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all
old feature requests in Bugzilla which have not seen updates for many years.

If you are still requesting this feature in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/anjuta/-/issues/

Thank you for reporting this issue and we are sorry it could not be implemented.