comp.lang.ada
 help / color / mirror / Atom feed
* Quick Question about GPS IDE
@ 2014-12-28  8:22 Hubert
  2014-12-28  8:43 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 25+ messages in thread
From: Hubert @ 2014-12-28  8:22 UTC (permalink / raw)


Hi all,
I am getting more serious with the Adacore GPS now and I ran into 
something that baffled me: There seems to be no search and replave 
functionality!!
Am I looking at the wrong place or is that really missing? I am trying 
to help myself now by running the external Emacs client, but I am not 
familiar with emacs either and have to weasel my way through the dummy 
cards for that one as well.

Thanks!

---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28  8:22 Quick Question about GPS IDE Hubert
@ 2014-12-28  8:43 ` Dmitry A. Kazakov
  2014-12-28  8:54   ` Hubert
  0 siblings, 1 reply; 25+ messages in thread
From: Dmitry A. Kazakov @ 2014-12-28  8:43 UTC (permalink / raw)


On Sun, 28 Dec 2014 00:22:33 -0800, Hubert wrote:

> I am getting more serious with the Adacore GPS now and I ran into 
> something that baffled me: There seems to be no search and replave 
> functionality!!

Ctrl+F

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28  8:43 ` Dmitry A. Kazakov
@ 2014-12-28  8:54   ` Hubert
  2014-12-28  9:20     ` Dmitry A. Kazakov
  2014-12-28 16:04     ` Britt
  0 siblings, 2 replies; 25+ messages in thread
From: Hubert @ 2014-12-28  8:54 UTC (permalink / raw)


On 12/28/2014 0:43 AM, Dmitry A. Kazakov wrote:
> On Sun, 28 Dec 2014 00:22:33 -0800, Hubert wrote:
>
>> I am getting more serious with the Adacore GPS now and I ran into
>> something that baffled me: There seems to be no search and replave
>> functionality!!
>
> Ctrl+F
>

Oh man I feel so embarrassed now :)
It is under "Navigate", not "Edit". Sorry about that, I see it now :D

thanks a bunch



---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28  8:54   ` Hubert
@ 2014-12-28  9:20     ` Dmitry A. Kazakov
  2014-12-28 10:29       ` Hubert
  2014-12-28 16:04     ` Britt
  1 sibling, 1 reply; 25+ messages in thread
From: Dmitry A. Kazakov @ 2014-12-28  9:20 UTC (permalink / raw)


On Sun, 28 Dec 2014 00:54:49 -0800, Hubert wrote:

> On 12/28/2014 0:43 AM, Dmitry A. Kazakov wrote:
>> On Sun, 28 Dec 2014 00:22:33 -0800, Hubert wrote:
>>
>>> I am getting more serious with the Adacore GPS now and I ran into
>>> something that baffled me: There seems to be no search and replave
>>> functionality!!
>>
>> Ctrl+F
> 
> Oh man I feel so embarrassed now :)
> It is under "Navigate", not "Edit". Sorry about that, I see it now :D

BTW, if you want to rename a variable, type etc, right click on it, then
"Refactoring". Of course the sources must be fully compiled before doing
this, because it is not a textual search.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28  9:20     ` Dmitry A. Kazakov
@ 2014-12-28 10:29       ` Hubert
  2014-12-28 10:48         ` Dmitry A. Kazakov
  0 siblings, 1 reply; 25+ messages in thread
From: Hubert @ 2014-12-28 10:29 UTC (permalink / raw)



> BTW, if you want to rename a variable, type etc, right click on it, then
> "Refactoring". Of course the sources must be fully compiled before doing
> this, because it is not a textual search.
>
Thanks, I'm getting the hang of it. It's quite different from 
VisualStudio, but once you find out where all the functionality is, it 
seems to be relatively usable.


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 10:29       ` Hubert
@ 2014-12-28 10:48         ` Dmitry A. Kazakov
  2014-12-28 12:15           ` Hubert
                             ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Dmitry A. Kazakov @ 2014-12-28 10:48 UTC (permalink / raw)


On Sun, 28 Dec 2014 02:29:06 -0800, Hubert wrote:

>> BTW, if you want to rename a variable, type etc, right click on it, then
>> "Refactoring". Of course the sources must be fully compiled before doing
>> this, because it is not a textual search.
>>
> Thanks, I'm getting the hang of it. It's quite different from 
> VisualStudio, but once you find out where all the functionality is, it 
> seems to be relatively usable.

GPS is better than VS. I'm using both pretty much. The only useful feature
VS has which GPS does not is "bookmarks."

[ VS quite degraded since VS 2005, which was its best version IMO. Each
following version is getting more bloated, slower and less usable. ]

P.S. I don't count the debugger, because it is not an IDE's part actually.
AdaCore cannot do anything with gdb. Maybe they should consider supporting
other debuggers in GPS.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 10:48         ` Dmitry A. Kazakov
@ 2014-12-28 12:15           ` Hubert
  2014-12-28 12:41             ` Dmitry A. Kazakov
  2014-12-28 15:52           ` Britt
  2014-12-28 17:56           ` Anh Vo
  2 siblings, 1 reply; 25+ messages in thread
From: Hubert @ 2014-12-28 12:15 UTC (permalink / raw)



> P.S. I don't count the debugger, because it is not an IDE's part actually.
> AdaCore cannot do anything with gdb. Maybe they should consider supporting
> other debuggers in GPS.
>
I don't understand, the gdb debugger seems to be relatively nicely 
integrated with GPS? From what I have seen so far it's a bit different 
from VS debugger but quite alright.
I checked out Slickedit in the meantime because I thought the debugger 
integration there might be better than in GPS but I wasn't able to get 
an Ada program to debug there.


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 12:15           ` Hubert
@ 2014-12-28 12:41             ` Dmitry A. Kazakov
  2014-12-28 22:21               ` J-P. Rosen
  2014-12-29  2:42               ` Hubert
  0 siblings, 2 replies; 25+ messages in thread
From: Dmitry A. Kazakov @ 2014-12-28 12:41 UTC (permalink / raw)


On Sun, 28 Dec 2014 04:15:56 -0800, Hubert wrote:

>> P.S. I don't count the debugger, because it is not an IDE's part actually.
>> AdaCore cannot do anything with gdb. Maybe they should consider supporting
>> other debuggers in GPS.
>>
> I don't understand, the gdb debugger seems to be relatively nicely 
> integrated with GPS?

Its gdb is totally unusable in any real-life sized project. You will not be
able to initialize the program and set a break point, as simple as this.

And in general using breakpoints and inspecting variables and the stack is
only one technique of debugging, the ancient debuggers like gdb single it
out. This technique is not always useful for Ada with tasking, real-time,
external I/O (uncontrollable events). Neither it is for on-line
introspection and problem tracking in already deployed applications and
their components like shared libraries.

In short, I would consider GPS debugger non-existent, and from a very early
project stage integrate good tracing facilities into it. GNAT's RTL has
some nice tools for exceptions tracking and symbolic stack tracing. They
don't work with MS formats, unfortunately, but it is better than nothing.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 10:48         ` Dmitry A. Kazakov
  2014-12-28 12:15           ` Hubert
@ 2014-12-28 15:52           ` Britt
  2014-12-28 16:16             ` Dmitry A. Kazakov
  2014-12-28 17:56           ` Anh Vo
  2 siblings, 1 reply; 25+ messages in thread
From: Britt @ 2014-12-28 15:52 UTC (permalink / raw)


On Sunday, December 28, 2014 5:48:58 AM UTC-5, Dmitry A. Kazakov wrote:

> GPS is better than VS. I'm using both pretty much. The only useful feature
> VS has which GPS does not is "bookmarks."
> 

GPS supports bookmarks:
   Edit -> Create Bookmark
   Tools -> Views -> Bookmarks

Bookmarks can be renamed after they are created. Users may want to assign a key shortcut to each of these two menus.

- Britt


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28  8:54   ` Hubert
  2014-12-28  9:20     ` Dmitry A. Kazakov
@ 2014-12-28 16:04     ` Britt
  1 sibling, 0 replies; 25+ messages in thread
From: Britt @ 2014-12-28 16:04 UTC (permalink / raw)


On Sunday, December 28, 2014 3:54:43 AM UTC-5, Hubert wrote:
> On 12/28/2014 0:43 AM, Dmitry A. Kazakov wrote:
>
> > Ctrl+F
> 
> Oh man I feel so embarrassed now :)
> It is under "Navigate", not "Edit". Sorry about that, I see it now :D
> 

Also, GPS versions 6.0.1 and newer have a "omnisearch" feature that provides a fast "find all" type of searching. The search entry field is normally always visible in the upper right corner of the main window and it can also be invoked with Ctrl+T. The interface for this feature needs some improvements (IMO) but it is still very useful.

- Britt

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 15:52           ` Britt
@ 2014-12-28 16:16             ` Dmitry A. Kazakov
  2014-12-28 18:08               ` Anh Vo
  0 siblings, 1 reply; 25+ messages in thread
From: Dmitry A. Kazakov @ 2014-12-28 16:16 UTC (permalink / raw)


On Sun, 28 Dec 2014 07:52:52 -0800 (PST), Britt wrote:

> On Sunday, December 28, 2014 5:48:58 AM UTC-5, Dmitry A. Kazakov wrote:
> 
>> GPS is better than VS. I'm using both pretty much. The only useful feature
>> VS has which GPS does not is "bookmarks."
> 
> GPS supports bookmarks:
>    Edit -> Create Bookmark
>    Tools -> Views -> Bookmarks
> 
> Bookmarks can be renamed after they are created. Users may want to assign
> a key shortcut to each of these two menus.

OK, however the intended usage is when bookmarks are highlighted in the
source text. Also, it is good that they are preserved upon GPS exit, bad is
that they seem to be global, rather than project-related.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 10:48         ` Dmitry A. Kazakov
  2014-12-28 12:15           ` Hubert
  2014-12-28 15:52           ` Britt
@ 2014-12-28 17:56           ` Anh Vo
  2 siblings, 0 replies; 25+ messages in thread
From: Anh Vo @ 2014-12-28 17:56 UTC (permalink / raw)


On Sunday, December 28, 2014 2:48:58 AM UTC-8, Dmitry A. Kazakov wrote:
> On Sun, 28 Dec 2014 02:29:06 -0800, Hubert wrote:
> 
> >> BTW, if you want to rename a variable, type etc, right click on it, then
> >> "Refactoring". Of course the sources must be fully compiled before doing
> >> this, because it is not a textual search.
> >>
> > Thanks, I'm getting the hang of it. It's quite different from 
> > VisualStudio, but once you find out where all the functionality is, it 
> > seems to be relatively usable.
> 
> GPS is better than VS. I'm using both pretty much. The only useful feature
> VS has which GPS does not is "bookmarks."

GPS has bookmarks, too. I have used it extensively in our project. In addition, the public version GPS 6.0.1 bundled in GNAT-GPL-2014 has it, also. It is in drop down Edit menu.

Anh Vo




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 16:16             ` Dmitry A. Kazakov
@ 2014-12-28 18:08               ` Anh Vo
  0 siblings, 0 replies; 25+ messages in thread
From: Anh Vo @ 2014-12-28 18:08 UTC (permalink / raw)


On Sunday, December 28, 2014 8:16:29 AM UTC-8, Dmitry A. Kazakov wrote:
> On Sun, 28 Dec 2014 07:52:52 -0800 (PST), Britt wrote:
> 
> > On Sunday, December 28, 2014 5:48:58 AM UTC-5, Dmitry A. Kazakov wrote:
> > 
> >> GPS is better than VS. I'm using both pretty much. The only useful feature
> >> VS has which GPS does not is "bookmarks."
> > 
> > GPS supports bookmarks:
> >    Edit -> Create Bookmark
> >    Tools -> Views -> Bookmarks
> > 
> > Bookmarks can be renamed after they are created. Users may want to assign
> > a key shortcut to each of these two menus.
> 
> OK, however the intended usage is when bookmarks are highlighted in the
> source text. Also, it is good that they are preserved upon GPS exit, bad is
> that they seem to be global, rather than project-related.

It is true that Bookmarks are not project based. It is good idea that I will suggest  to AdaCore making it project based instead of GPS based.

Anh Vo 




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 12:41             ` Dmitry A. Kazakov
@ 2014-12-28 22:21               ` J-P. Rosen
  2014-12-28 22:45                 ` Dmitry A. Kazakov
  2014-12-29  2:42               ` Hubert
  1 sibling, 1 reply; 25+ messages in thread
From: J-P. Rosen @ 2014-12-28 22:21 UTC (permalink / raw)


Le 28/12/2014 13:41, Dmitry A. Kazakov a écrit :
> Its gdb is totally unusable in any real-life sized project. You will not be
> able to initialize the program and set a break point, as simple as this.
???
Debug/Initialize, then click in the left margin in front of the line
where you want to set a breakpoint. Looks like simple and intuitive...

Note: I rarely use debuggers in general, but I can't let such an
incorrect information without a rebutal...

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 22:21               ` J-P. Rosen
@ 2014-12-28 22:45                 ` Dmitry A. Kazakov
  2014-12-29  7:48                   ` J-P. Rosen
  2014-12-29  9:39                   ` Stephen Leake
  0 siblings, 2 replies; 25+ messages in thread
From: Dmitry A. Kazakov @ 2014-12-28 22:45 UTC (permalink / raw)


On Sun, 28 Dec 2014 23:21:20 +0100, J-P. Rosen wrote:

> Le 28/12/2014 13:41, Dmitry A. Kazakov a écrit :
>> Its gdb is totally unusable in any real-life sized project. You will not be
>> able to initialize the program and set a break point, as simple as this.
> ???
> Debug/Initialize, then click in the left margin in front of the line
> where you want to set a breakpoint. Looks like simple and intuitive...
> 
> Note: I rarely use debuggers in general,

That's why you believe it would work.

> but I can't let such an
> incorrect information without a rebutal...

As I said, in a real size project you either will not be able to set the
breakpoint after you initialize or else it will not stop at the breakpoint.
Actually it will not stop anywhere. I don't know if that depends on the
size or on libraries used, maybe on both. Even when you could set a
breakpoint you not guaranteed to be able to debug the program. It can go
mad at any time, while stepping through etc. The fact is, it is totally
unusable in practice.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 12:41             ` Dmitry A. Kazakov
  2014-12-28 22:21               ` J-P. Rosen
@ 2014-12-29  2:42               ` Hubert
  1 sibling, 0 replies; 25+ messages in thread
From: Hubert @ 2014-12-29  2:42 UTC (permalink / raw)


> In short, I would consider GPS debugger non-existent, and from a very early
> project stage integrate good tracing facilities into it. GNAT's RTL has
> some nice tools for exceptions tracking and symbolic stack tracing. They
> don't work with MS formats, unfortunately, but it is better than nothing.

Yes that's true. I notice that in my current project which is a fairly 
big client server application in Visual Studio C++ . Although the 
debugger there is probably one of the finest in this field, I am running 
into lots of situations where the cause of the bug lies in the past and 
is propagated through multiple threads and thus the debugger does not 
help very much.

I am working on a logging system that uses an Ada program to log data to 
and then clients that connect and can see various parts of the logged 
data based on channels and priorities etc. I have something like that 
already but it's not very fast, I was very new to Ada when I did that 
and didn't quite understand how to use tasks and protected objects. I'm 
not sure if I'll be able to finish that in the time I have for it, but 
it would be a great help for tracing down errors.




---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 22:45                 ` Dmitry A. Kazakov
@ 2014-12-29  7:48                   ` J-P. Rosen
  2014-12-29  9:19                     ` Dmitry A. Kazakov
  2014-12-29 15:03                     ` Shark8
  2014-12-29  9:39                   ` Stephen Leake
  1 sibling, 2 replies; 25+ messages in thread
From: J-P. Rosen @ 2014-12-29  7:48 UTC (permalink / raw)


Le 28/12/2014 23:45, Dmitry A. Kazakov a écrit :
> As I said, in a real size project you either will not be able to set the
> breakpoint after you initialize or else it will not stop at the breakpoint.
> Actually it will not stop anywhere. I don't know if that depends on the
> size or on libraries used, maybe on both. Even when you could set a
> breakpoint you not guaranteed to be able to debug the program. It can go
> mad at any time, while stepping through etc. The fact is, it is totally
> unusable in practice.

I think AdaControl qualifies as a "real size project", and I never
experienced what you describe. So please tell that YOU experienced
problems, but don't make general statements that gdb is unusable.

Moreover, GPS is just a front-end to gdb, and gdb is presumably the most
used debugger in the world (at least in the world of free software). If
it were that bad, it would have been fixed...

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-29  7:48                   ` J-P. Rosen
@ 2014-12-29  9:19                     ` Dmitry A. Kazakov
  2014-12-29 21:06                       ` ake.ragnar.dahlgren
  2014-12-29 15:03                     ` Shark8
  1 sibling, 1 reply; 25+ messages in thread
From: Dmitry A. Kazakov @ 2014-12-29  9:19 UTC (permalink / raw)


On Mon, 29 Dec 2014 08:48:15 +0100, J-P. Rosen wrote:

> Le 28/12/2014 23:45, Dmitry A. Kazakov a écrit :
>> As I said, in a real size project you either will not be able to set the
>> breakpoint after you initialize or else it will not stop at the breakpoint.
>> Actually it will not stop anywhere. I don't know if that depends on the
>> size or on libraries used, maybe on both. Even when you could set a
>> breakpoint you not guaranteed to be able to debug the program. It can go
>> mad at any time, while stepping through etc. The fact is, it is totally
>> unusable in practice.
> 
> I think AdaControl qualifies as a "real size project", and I never
> experienced what you describe.

I said that I don't know why this happens. It is possible that in a plain
program of any size that uses nothing but Ada.Text_IO, it would not happen.
Maybe libraries is the reason, maybe the number of subcomponents and
sub-projects, I have no idea.

> So please tell that YOU experienced
> problems, 

It would be strange to suggest otherwise.

> but don't make general statements that gdb is unusable.

Since in *none* of the projects I maintain gdb does not work, I feel
obliged to warn others.

> Moreover, GPS is just a front-end to gdb, and gdb is presumably the most
> used debugger in the world (at least in the world of free software). If
> it were that bad, it would have been fixed...

Just like C, just like C...

gdb never ever worked in GPS. Even if it did, it is poorly integrated into
GPS. Breakpoints are not saved, "Initialize" should never existed. The
session shall never stop at the first program "instruction". The GPS
windows layout *shall not* change when a session starts or ends. There no
re-run button, no decent values watch tabs persistent between sessions, no
usable conditional breakpoints. It shall understand pdb files, without that
it is pretty much useless, again in real projects.

I don't blame AdaCore for this and never reported gdb issues to them,
because, clearly to me, it would be wasting scarce resources AdaCore has on
a thing which I don't believe were fixable.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-28 22:45                 ` Dmitry A. Kazakov
  2014-12-29  7:48                   ` J-P. Rosen
@ 2014-12-29  9:39                   ` Stephen Leake
  2014-12-29 16:52                     ` Brad Moore
  1 sibling, 1 reply; 25+ messages in thread
From: Stephen Leake @ 2014-12-29  9:39 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> On Sun, 28 Dec 2014 23:21:20 +0100, J-P. Rosen wrote:
>
>> Le 28/12/2014 13:41, Dmitry A. Kazakov a écrit :
>>> Its gdb is totally unusable in any real-life sized project. You will not be
>>> able to initialize the program and set a break point, as simple as this.
>> ???
>> Debug/Initialize, then click in the left margin in front of the line
>> where you want to set a breakpoint. Looks like simple and intuitive...
>> 
>> Note: I rarely use debuggers in general,
>
> That's why you believe it would work.
>
>> but I can't let such an
>> incorrect information without a rebutal...
>
> As I said, in a real size project you either will not be able to set the
> breakpoint after you initialize or else it will not stop at the breakpoint.
> Actually it will not stop anywhere. I don't know if that depends on the
> size or on libraries used, maybe on both. Even when you could set a
> breakpoint you not guaranteed to be able to debug the program. It can go
> mad at any time, while stepping through etc. The fact is, it is totally
> unusable in practice.

Just for the record, I use gdb fairly often, on real projects (a NASA
simulator, home projects), and have _never_ had these issues. I've run
it on Lynx (a real-time OS) both natively and via the remote interface,
on Windows, Red Hat and Debian.

So it depends on the details of your project.

-- 
-- Stephe


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-29  7:48                   ` J-P. Rosen
  2014-12-29  9:19                     ` Dmitry A. Kazakov
@ 2014-12-29 15:03                     ` Shark8
  1 sibling, 0 replies; 25+ messages in thread
From: Shark8 @ 2014-12-29 15:03 UTC (permalink / raw)


On 29-Dec-14 00:48, J-P. Rosen wrote:
> Moreover, GPS is just a front-end to gdb, and gdb is presumably the most
> used debugger in the world (at least in the world of free software).

Popular ("most used") doesn't mean anything about wither the overall 
quality or the more-specific usability. As far as debugging goes, the 
old Lisp-Machines apparently had debugging environments that put many 
modern debuggers to shame.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-29  9:39                   ` Stephen Leake
@ 2014-12-29 16:52                     ` Brad Moore
  0 siblings, 0 replies; 25+ messages in thread
From: Brad Moore @ 2014-12-29 16:52 UTC (permalink / raw)


On 14-12-29 02:39 AM, Stephen Leake wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>
>> On Sun, 28 Dec 2014 23:21:20 +0100, J-P. Rosen wrote:
>>
>>> Le 28/12/2014 13:41, Dmitry A. Kazakov a écrit :
>>>> Its gdb is totally unusable in any real-life sized project. You will not be
>>>> able to initialize the program and set a break point, as simple as this.
>>> ???
>>> Debug/Initialize, then click in the left margin in front of the line
>>> where you want to set a breakpoint. Looks like simple and intuitive...
>>>
>>> Note: I rarely use debuggers in general,
>>
>> That's why you believe it would work.
>>
>>> but I can't let such an
>>> incorrect information without a rebutal...
>>
>> As I said, in a real size project you either will not be able to set the
>> breakpoint after you initialize or else it will not stop at the breakpoint.
>> Actually it will not stop anywhere. I don't know if that depends on the
>> size or on libraries used, maybe on both. Even when you could set a
>> breakpoint you not guaranteed to be able to debug the program. It can go
>> mad at any time, while stepping through etc. The fact is, it is totally
>> unusable in practice.
>
> Just for the record, I use gdb fairly often, on real projects (a NASA
> simulator, home projects), and have _never_ had these issues. I've run
> it on Lynx (a real-time OS) both natively and via the remote interface,
> on Windows, Red Hat and Debian.
>
> So it depends on the details of your project.
>

I've also used it to debug large multi-threaded distributed systems, 
both within GPS and Ada, and outside of Ada and GPS (C and C++), and 
have found it to be a useful tool. I also have not seen the issues 
mentioned. I've also used the Visual Studio debugger, and offhand 
haven't seen any significant difference between the two environments. 
There may be finer details that highlight one over the other, but if so, 
I haven't noticed them. Overall, I think they are fairly comparable. One 
nice feature of gdb that I think Visual Studio lacks is that it can also 
be used in a console window without a GUI, which I've found to be useful 
at times when debugging on an embedded platform, though gdb also 
supports remote debugging with a GUI.

So I basically disagree with the claim that it is totally unusable in 
practice.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-29  9:19                     ` Dmitry A. Kazakov
@ 2014-12-29 21:06                       ` ake.ragnar.dahlgren
  2014-12-29 23:51                         ` Brad Moore
  0 siblings, 1 reply; 25+ messages in thread
From: ake.ragnar.dahlgren @ 2014-12-29 21:06 UTC (permalink / raw)


Dear all,

I've also had problems with GDB as Dimitry describes. It seems to work for my small hobby projects at home, but for the applications at work it doesn't work as expected for me. When I set breakpoints, GDB may or may not stop execution upon them. If it has to do with a large code base or multi-threading, I've no idea. Anyways, if I ever run into GDB issue in an open source Ada project I will reopen this issue for discussion. Maybe somebody here could then point out where the problem lies.

I am also thankful for the feedback that some Ada developers successfully use GDB in their projects.

Best regards,
Åke Ragnar Dahlgren


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-29 21:06                       ` ake.ragnar.dahlgren
@ 2014-12-29 23:51                         ` Brad Moore
  2014-12-31  0:39                           ` ake.ragnar.dahlgren
  2014-12-31  1:21                           ` Hubert
  0 siblings, 2 replies; 25+ messages in thread
From: Brad Moore @ 2014-12-29 23:51 UTC (permalink / raw)


On 14-12-29 02:06 PM, ake.ragnar.dahlgren@gmail.com wrote:
> Dear all,
>
> I've also had problems with GDB as Dimitry describes. It seems to work for my small hobby projects at home, but for the applications at work it doesn't work as expected for me. When I set breakpoints, GDB may or may not stop execution upon them. If it has to do with a large code base or multi-threading, I've no idea. Anyways, if I ever run into GDB issue in an open source Ada project I will reopen this issue for discussion. Maybe somebody here could then point out where the problem lies.
>
> I am also thankful for the feedback that some Ada developers successfully use GDB in their projects.
>
> Best regards,
> Åke Ragnar Dahlgren
>

Some possibilities to explain why one cant set a breakpoint is that you 
need to ensure that the code you want to debug was been compiled with 
the debug flag turned on.  Look for -g on the command line.

If you are linking with third party libraries, or dynamically linked 
libraries, you need to ensure that those libraries have also been 
compiled with debug enabled, if you want to step into those library 
calls with the debugger.

If in GPS, you try to set a breakpoint and do not get visual feedback 
that the breakpoint was set, then it is a good idea to check the 
compilation flags. As I mentioned above, you should see a -g on the 
command  line for the compilation, in GNAT and gcc.

Another cause might be due to optimization, the code you want to set a 
breakpoint on, may have been optimized out. So usually when debugging, I 
tend to disable optimization flags.

Another possibility is that the code may not have been compiled since 
last edited, causing a discrepency between where the debugger thinks the 
source lines are, and where the editor shows them. Be sure to compile 
the latest version of the sources you want to debug.

Another trick I've learned is that stepping into a protected object 
doesnt usually work, probably because the thread that executes the 
protected action is not the same one that makes the call into the PO.

If you want to step into a PO, I find you usually need to set a 
breakpoint on the code inside the protected object. Then you can step 
through the code inside the protected object.

Sometimes GPS wont set a breakpoint on a particular line of source, 
usually because it does not represent executable code. (eg. A 
declaration of some variable that doesn't have any initialization).

For that case, try instead setting a breakpoint on a nearby line that is 
associated with a statement of execution.

Another point is that when setting breakpoints on function calls where 
the parameters span multiple source lines, you usually want to set a 
breakpoint on the last line of the call, if you want to catch the 
debugger just before stepping into the call. Otherwise, you might find 
that you need to step through execution associated with setting up each 
of the parameters.

Another usage I found very helpful is when a core-dump or stack trace is 
output, due to some exception being raised.

If the code was compiled with debug enabled, you can usually enter the 
address into gdb and see the code associated with the failure. The 
address reported I think is a return address, so quite often the line 
where you want to set a breakpoint, is the source line immediately 
before the line associated with the reported address. Usually it is 
obvious which line caused the problem.

If while stepping through the debugger, the code seems to be jumping 
wildly from one place to another, it is probably because multiple 
threads are executing, and each breakpoint in the debugger represents 
the progress of a different thread or task.

I find it handy to display the threads, and the backtrace windows in 
GPS. This shows which thread is associated with the current break in the 
debugger. Debugging multithreaded applications can be tricky. You may 
need to follow the thread you are interested in, and set lots of 
breakpoints around the area you are trying to debug.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-29 23:51                         ` Brad Moore
@ 2014-12-31  0:39                           ` ake.ragnar.dahlgren
  2014-12-31  1:21                           ` Hubert
  1 sibling, 0 replies; 25+ messages in thread
From: ake.ragnar.dahlgren @ 2014-12-31  0:39 UTC (permalink / raw)


Thank you Brad for your detailed description about what to keep in mind while using GDB to step through Ada code. Very useful information for me. Many thanks!

Best regards,
Åke Ragnar Dahlgren


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Quick Question about GPS IDE
  2014-12-29 23:51                         ` Brad Moore
  2014-12-31  0:39                           ` ake.ragnar.dahlgren
@ 2014-12-31  1:21                           ` Hubert
  1 sibling, 0 replies; 25+ messages in thread
From: Hubert @ 2014-12-31  1:21 UTC (permalink / raw)


Yes,
I also noticed that the program is not always correctly recompiled when 
I edit some ADB files, then I have to rebuild all, that may also be a 
cause for debugger misbehavior sometimes


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2014-12-31  1:21 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-28  8:22 Quick Question about GPS IDE Hubert
2014-12-28  8:43 ` Dmitry A. Kazakov
2014-12-28  8:54   ` Hubert
2014-12-28  9:20     ` Dmitry A. Kazakov
2014-12-28 10:29       ` Hubert
2014-12-28 10:48         ` Dmitry A. Kazakov
2014-12-28 12:15           ` Hubert
2014-12-28 12:41             ` Dmitry A. Kazakov
2014-12-28 22:21               ` J-P. Rosen
2014-12-28 22:45                 ` Dmitry A. Kazakov
2014-12-29  7:48                   ` J-P. Rosen
2014-12-29  9:19                     ` Dmitry A. Kazakov
2014-12-29 21:06                       ` ake.ragnar.dahlgren
2014-12-29 23:51                         ` Brad Moore
2014-12-31  0:39                           ` ake.ragnar.dahlgren
2014-12-31  1:21                           ` Hubert
2014-12-29 15:03                     ` Shark8
2014-12-29  9:39                   ` Stephen Leake
2014-12-29 16:52                     ` Brad Moore
2014-12-29  2:42               ` Hubert
2014-12-28 15:52           ` Britt
2014-12-28 16:16             ` Dmitry A. Kazakov
2014-12-28 18:08               ` Anh Vo
2014-12-28 17:56           ` Anh Vo
2014-12-28 16:04     ` Britt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox