You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Darwin Te <da...@hotmail.com> on 2020/08/04 21:36:12 UTC

How to debug netbeans

Hi,

I have checkout netbeans source from git and able to build it using ant command.

How do I debug netbeans itself and build it with java debug information?

I want to see stack trace why the cpu usage is always 100%.

Also memory keeps on increasing if i perform a search in file.

Thanks.

Best regards,

Darwin


Re: How to debug netbeans

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Very cool! Will take a look!

Gj

On Thu, 10 Dec 2020 at 13:13, John <jo...@lemckes.com> wrote:

> Geertjan,
>
>
> I have submitted a PR that adds these instructions to
> netbeans.apache.org/src/content/participate/submit-pr.asciidoc
>
> https://github.com/apache/netbeans-website/pull/505
>
>
> I've only just started to learn about asciidoc and jbake so there may be
> some rookie mistakes in the file.
>
>
> Have Fun,
>
> John L.
>
>
>
> On 2020/08/05 07:58:25, Geertjan Wielenga <g....@apache.org> wrote:
>  > That’s a great contribution, thanks John! Will add it to the page,
> check>
>  > it, tweet it, etc.>
>  >
>  > Gj>
>  >
>  > On Wed, 5 Aug 2020 at 09:54, John <jo...@lemckes.com> wrote:>
>  >
>  > > Hi,>
>  > >>
>  > > I, too, have been struggling to set up an environment for debugging>
>  > > NetBeans.>
>  > > Those videos are somewhat out of date and a bit vague when it comes
> to>
>  > > the actual location of files etc.>
>  > > I think a textual version of the instructions would be useful. It
> would>
>  > > also be easier to update when there are changes needed.>
>  > > Here's my attempt at a set of steps required ...>
>  > >>
>  > >>
>  > >
> --------------------------------------------------------------------------------->
>
>
>  > >>
>  > > # Check out netbeans>
>  > > $ cd <path-to-my-projects>>
>  > > $ git clone https://github.com/apache/netbeans.git>
>  > > $ cd netbeans>
>  > >>
>  > > # Build netbeans>
>  > > $ ant>
>  > > $ ant tryme ## just to confirm it runs>
>  > >>
>  > > Close the IDE>
>  > >>
>  > > Open Apache NetBeans IDE 12.0>
>  > >>
>  > > # Add your github clone as a NetBeans Platform>
>  > > Open the 'NetBeans Platform Manager' (Tools->NetBeans Platforms)>
>  > > Click 'Add Platform ...'>
>  > > Navigate to <path-to-my-projects>/netbeans/nbbuild/ and select
> netbeans>
>  > > Click 'Next >'>
>  > > Click 'Finish'>
>  > > Select the 'Sources' tab>
>  > > Click 'Add ZIP/Folder ...'>
>  > > Select <path-to-my-projects>/netbeans and click 'Open'>
>  > > Close 'NetBeans Platform Manager'>
>  > >>
>  > > # Create a new project (File->New Project...)>
>  > > In 'Categories:' select 'Java with Ant / NetBeans Modules'>
>  > > In 'Projects:' select 'Module Suite'>
>  > > Click 'Next >'>
>  > > Enter a 'Project Name:' (mine's called NB-IDE-github)>
>  > > Optionally change the 'Project Location:'>
>  > > Click 'Finish'>
>  > >>
>  > > # Locate the source code for your github clone>
>  > > Open the 'Favorites' window (Window->Favorites)>
>  > > Select 'Add to Favorites...' in the right-click context menu>
>  > > Select <path-to-my-projects>/netbeans and click 'Add'>
>  > >>
>  > > # Set a breakpoint in the source code>
>  > > # as a start try the entry point "public static void main (String
> args[])">
>  > > In the 'Favorites' tab navigate to>
>  > > "platform/o.n.bootstrap/src/org/netbeans" and open Main.java>
>  > > Set a breakpoint>
>  > >>
>  > > # Start the debugger>
>  > > Select your IDE project (e.g. NB-IDE-github) from the 'Run->Set Main>
>  > > Project' menu>
>  > > Start the debugger :>
>  > > 'Debug->Debug Main Project' menu,>
>  > > or>
>  > > Click the Debug toolbar item>
>  > > or>
>  > > Ctrl+F5>
>  > >>
>  > >>
>  > >
> --------------------------------------------------------------------------------->
>
>
>  > >>
>  > > I hope that helps,>
>  > >>
>  > > jostle>
>  > >>
>  > >>
>  > > On 2020/08/05 01:14:41, Ernie Rael <e....@raelity.com> wrote:>
>  > > > On the main page>>
>  > > >>
>  > > > http://netbeans.apache.org/>>
>  > > >>
>  > > > "Participate" links to>>
>  > > >>
>  > > > http://netbeans.apache.org/participate/submit-pr.html>>
>  > > >>
>  > > > and you will find directions and some you tube videos that show
> how to >>
>  > > > debug netbeans itself>>
>  > > >>
>  > > > -ernie>>
>  > > >>
>  > > > On 8/4/2020 2:36 PM, Darwin Te wrote:>>
>  > > > > Hi,>>
>  > > > >>>
>  > > > > I have checkout netbeans source from git and able to build it
> using>
>  > > ant command.>>
>  > > > >>>
>  > > > > How do I debug netbeans itself and build it with java debug>
>  > > information?>>
>  > > > >>>
>  > > > > I want to see stack trace why the cpu usage is always 100%.>>
>  > > > >>>
>  > > > > Also memory keeps on increasing if i perform a search in file.>>
>  > > > >>>
>  > > > > Thanks.>>
>  > > > >>>
>  > > > > Best regards,>>
>  > > > >>>
>  > > > > Darwin>>
>  > > > >>>
>  > > > >>>
>  > > >>
>  > > >>
>  > > >
> --------------------------------------------------------------------->>
>  > > > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org>>
>  > > > For additional commands, e-mail: dev-help@netbeans.apache.org>>
>  > > >>
>  > > > For further information about the NetBeans mailing lists, visit:>>
>  > > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >>
>  > > >>
>  > > >>
>  > > >>
>  > > >>
>  > >>
>  > > --------------------------------------------------------------------->
>  > > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org>
>  > > For additional commands, e-mail: dev-help@netbeans.apache.org>
>  > >>
>  > > For further information about the NetBeans mailing lists, visit:>
>  > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists>
>  > >>
>  > >>
>  > >>
>  > >>
>  >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: How to debug netbeans

Posted by John <jo...@lemckes.com>.
Geertjan,


I have submitted a PR that adds these instructions to 
netbeans.apache.org/src/content/participate/submit-pr.asciidoc

https://github.com/apache/netbeans-website/pull/505


I've only just started to learn about asciidoc and jbake so there may be 
some rookie mistakes in the file.


Have Fun,

John L.



On 2020/08/05 07:58:25, Geertjan Wielenga <g....@apache.org> wrote:
 > That’s a great contribution, thanks John! Will add it to the page, 
check>
 > it, tweet it, etc.>
 >
 > Gj>
 >
 > On Wed, 5 Aug 2020 at 09:54, John <jo...@lemckes.com> wrote:>
 >
 > > Hi,>
 > >>
 > > I, too, have been struggling to set up an environment for debugging>
 > > NetBeans.>
 > > Those videos are somewhat out of date and a bit vague when it comes 
to>
 > > the actual location of files etc.>
 > > I think a textual version of the instructions would be useful. It 
would>
 > > also be easier to update when there are changes needed.>
 > > Here's my attempt at a set of steps required ...>
 > >>
 > >>
 > > 
---------------------------------------------------------------------------------> 

 > >>
 > > # Check out netbeans>
 > > $ cd <path-to-my-projects>>
 > > $ git clone https://github.com/apache/netbeans.git>
 > > $ cd netbeans>
 > >>
 > > # Build netbeans>
 > > $ ant>
 > > $ ant tryme ## just to confirm it runs>
 > >>
 > > Close the IDE>
 > >>
 > > Open Apache NetBeans IDE 12.0>
 > >>
 > > # Add your github clone as a NetBeans Platform>
 > > Open the 'NetBeans Platform Manager' (Tools->NetBeans Platforms)>
 > > Click 'Add Platform ...'>
 > > Navigate to <path-to-my-projects>/netbeans/nbbuild/ and select 
netbeans>
 > > Click 'Next >'>
 > > Click 'Finish'>
 > > Select the 'Sources' tab>
 > > Click 'Add ZIP/Folder ...'>
 > > Select <path-to-my-projects>/netbeans and click 'Open'>
 > > Close 'NetBeans Platform Manager'>
 > >>
 > > # Create a new project (File->New Project...)>
 > > In 'Categories:' select 'Java with Ant / NetBeans Modules'>
 > > In 'Projects:' select 'Module Suite'>
 > > Click 'Next >'>
 > > Enter a 'Project Name:' (mine's called NB-IDE-github)>
 > > Optionally change the 'Project Location:'>
 > > Click 'Finish'>
 > >>
 > > # Locate the source code for your github clone>
 > > Open the 'Favorites' window (Window->Favorites)>
 > > Select 'Add to Favorites...' in the right-click context menu>
 > > Select <path-to-my-projects>/netbeans and click 'Add'>
 > >>
 > > # Set a breakpoint in the source code>
 > > # as a start try the entry point "public static void main (String 
args[])">
 > > In the 'Favorites' tab navigate to>
 > > "platform/o.n.bootstrap/src/org/netbeans" and open Main.java>
 > > Set a breakpoint>
 > >>
 > > # Start the debugger>
 > > Select your IDE project (e.g. NB-IDE-github) from the 'Run->Set Main>
 > > Project' menu>
 > > Start the debugger :>
 > > 'Debug->Debug Main Project' menu,>
 > > or>
 > > Click the Debug toolbar item>
 > > or>
 > > Ctrl+F5>
 > >>
 > >>
 > > 
---------------------------------------------------------------------------------> 

 > >>
 > > I hope that helps,>
 > >>
 > > jostle>
 > >>
 > >>
 > > On 2020/08/05 01:14:41, Ernie Rael <e....@raelity.com> wrote:>
 > > > On the main page>>
 > > >>
 > > > http://netbeans.apache.org/>>
 > > >>
 > > > "Participate" links to>>
 > > >>
 > > > http://netbeans.apache.org/participate/submit-pr.html>>
 > > >>
 > > > and you will find directions and some you tube videos that show 
how to >>
 > > > debug netbeans itself>>
 > > >>
 > > > -ernie>>
 > > >>
 > > > On 8/4/2020 2:36 PM, Darwin Te wrote:>>
 > > > > Hi,>>
 > > > >>>
 > > > > I have checkout netbeans source from git and able to build it 
using>
 > > ant command.>>
 > > > >>>
 > > > > How do I debug netbeans itself and build it with java debug>
 > > information?>>
 > > > >>>
 > > > > I want to see stack trace why the cpu usage is always 100%.>>
 > > > >>>
 > > > > Also memory keeps on increasing if i perform a search in file.>>
 > > > >>>
 > > > > Thanks.>>
 > > > >>>
 > > > > Best regards,>>
 > > > >>>
 > > > > Darwin>>
 > > > >>>
 > > > >>>
 > > >>
 > > >>
 > > > 
--------------------------------------------------------------------->>
 > > > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org>>
 > > > For additional commands, e-mail: dev-help@netbeans.apache.org>>
 > > >>
 > > > For further information about the NetBeans mailing lists, visit:>>
 > > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists>>
 > > >>
 > > >>
 > > >>
 > > >>
 > >>
 > > --------------------------------------------------------------------->
 > > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org>
 > > For additional commands, e-mail: dev-help@netbeans.apache.org>
 > >>
 > > For further information about the NetBeans mailing lists, visit:>
 > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists>
 > >>
 > >>
 > >>
 > >>
 >

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: How to debug netbeans

Posted by Geertjan Wielenga <ge...@apache.org>.
That’s a great contribution, thanks John! Will add it to the page, check
it, tweet it, etc.

Gj

On Wed, 5 Aug 2020 at 09:54, John <jo...@lemckes.com> wrote:

> Hi,
>
> I, too, have been struggling to set up an environment for debugging
> NetBeans.
> Those videos are somewhat out of date and a bit vague when it comes to
> the actual location of files etc.
> I think a textual version of the instructions would be useful. It would
> also be easier to update when there are changes needed.
> Here's my attempt at a set of steps required ...
>
>
> ---------------------------------------------------------------------------------
>
> # Check out netbeans
> $ cd <path-to-my-projects>
> $ git clone https://github.com/apache/netbeans.git
> $ cd netbeans
>
> # Build netbeans
> $ ant
> $ ant tryme ## just to confirm it runs
>
> Close the IDE
>
> Open Apache NetBeans IDE 12.0
>
> # Add your github clone as a NetBeans Platform
> Open the 'NetBeans Platform Manager' (Tools->NetBeans Platforms)
> Click 'Add Platform ...'
> Navigate to <path-to-my-projects>/netbeans/nbbuild/ and select netbeans
> Click 'Next >'
> Click 'Finish'
> Select the 'Sources' tab
> Click 'Add ZIP/Folder ...'
> Select <path-to-my-projects>/netbeans and click 'Open'
> Close 'NetBeans Platform Manager'
>
> # Create a new project (File->New Project...)
> In 'Categories:' select 'Java with Ant / NetBeans Modules'
> In 'Projects:' select 'Module Suite'
> Click 'Next >'
> Enter a 'Project Name:' (mine's called NB-IDE-github)
> Optionally change the 'Project Location:'
> Click 'Finish'
>
> # Locate the source code for your github clone
> Open the 'Favorites' window (Window->Favorites)
> Select 'Add to Favorites...' in the right-click context menu
> Select <path-to-my-projects>/netbeans and click 'Add'
>
> # Set a breakpoint in the source code
> # as a start try the entry point "public static void main (String args[])"
> In the 'Favorites' tab navigate to
>      "platform/o.n.bootstrap/src/org/netbeans" and open Main.java
> Set a breakpoint
>
> # Start the debugger
> Select your IDE project (e.g. NB-IDE-github) from the 'Run->Set Main
> Project' menu
> Start the debugger :
>      'Debug->Debug Main Project' menu,
> or
>      Click the Debug toolbar item
>      or
>      Ctrl+F5
>
>
> ---------------------------------------------------------------------------------
>
> I hope that helps,
>
> jostle
>
>
> On 2020/08/05 01:14:41, Ernie Rael <e....@raelity.com> wrote:
>  > On the main page>
>  >
>  > http://netbeans.apache.org/>
>  >
>  > "Participate" links to>
>  >
>  > http://netbeans.apache.org/participate/submit-pr.html>
>  >
>  > and you will find directions and some you tube videos that show how to >
>  > debug netbeans itself>
>  >
>  > -ernie>
>  >
>  > On 8/4/2020 2:36 PM, Darwin Te wrote:>
>  > > Hi,>
>  > >>
>  > > I have checkout netbeans source from git and able to build it using
> ant command.>
>  > >>
>  > > How do I debug netbeans itself and build it with java debug
> information?>
>  > >>
>  > > I want to see stack trace why the cpu usage is always 100%.>
>  > >>
>  > > Also memory keeps on increasing if i perform a search in file.>
>  > >>
>  > > Thanks.>
>  > >>
>  > > Best regards,>
>  > >>
>  > > Darwin>
>  > >>
>  > >>
>  >
>  >
>  > --------------------------------------------------------------------->
>  > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org>
>  > For additional commands, e-mail: dev-help@netbeans.apache.org>
>  >
>  > For further information about the NetBeans mailing lists, visit:>
>  > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists>
>  >
>  >
>  >
>  >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: How to debug netbeans

Posted by John <jo...@lemckes.com>.
Hi,

I, too, have been struggling to set up an environment for debugging 
NetBeans.
Those videos are somewhat out of date and a bit vague when it comes to 
the actual location of files etc.
I think a textual version of the instructions would be useful. It would 
also be easier to update when there are changes needed.
Here's my attempt at a set of steps required ...

---------------------------------------------------------------------------------

# Check out netbeans
$ cd <path-to-my-projects>
$ git clone https://github.com/apache/netbeans.git
$ cd netbeans

# Build netbeans
$ ant
$ ant tryme ## just to confirm it runs

Close the IDE

Open Apache NetBeans IDE 12.0

# Add your github clone as a NetBeans Platform
Open the 'NetBeans Platform Manager' (Tools->NetBeans Platforms)
Click 'Add Platform ...'
Navigate to <path-to-my-projects>/netbeans/nbbuild/ and select netbeans
Click 'Next >'
Click 'Finish'
Select the 'Sources' tab
Click 'Add ZIP/Folder ...'
Select <path-to-my-projects>/netbeans and click 'Open'
Close 'NetBeans Platform Manager'

# Create a new project (File->New Project...)
In 'Categories:' select 'Java with Ant / NetBeans Modules'
In 'Projects:' select 'Module Suite'
Click 'Next >'
Enter a 'Project Name:' (mine's called NB-IDE-github)
Optionally change the 'Project Location:'
Click 'Finish'

# Locate the source code for your github clone
Open the 'Favorites' window (Window->Favorites)
Select 'Add to Favorites...' in the right-click context menu
Select <path-to-my-projects>/netbeans and click 'Add'

# Set a breakpoint in the source code
# as a start try the entry point "public static void main (String args[])"
In the 'Favorites' tab navigate to
     "platform/o.n.bootstrap/src/org/netbeans" and open Main.java
Set a breakpoint

# Start the debugger
Select your IDE project (e.g. NB-IDE-github) from the 'Run->Set Main 
Project' menu
Start the debugger :
     'Debug->Debug Main Project' menu,
or
     Click the Debug toolbar item
     or
     Ctrl+F5

---------------------------------------------------------------------------------

I hope that helps,

jostle


On 2020/08/05 01:14:41, Ernie Rael <e....@raelity.com> wrote:
 > On the main page>
 >
 > http://netbeans.apache.org/>
 >
 > "Participate" links to>
 >
 > http://netbeans.apache.org/participate/submit-pr.html>
 >
 > and you will find directions and some you tube videos that show how to >
 > debug netbeans itself>
 >
 > -ernie>
 >
 > On 8/4/2020 2:36 PM, Darwin Te wrote:>
 > > Hi,>
 > >>
 > > I have checkout netbeans source from git and able to build it using 
ant command.>
 > >>
 > > How do I debug netbeans itself and build it with java debug 
information?>
 > >>
 > > I want to see stack trace why the cpu usage is always 100%.>
 > >>
 > > Also memory keeps on increasing if i perform a search in file.>
 > >>
 > > Thanks.>
 > >>
 > > Best regards,>
 > >>
 > > Darwin>
 > >>
 > >>
 >
 >
 > --------------------------------------------------------------------->
 > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org>
 > For additional commands, e-mail: dev-help@netbeans.apache.org>
 >
 > For further information about the NetBeans mailing lists, visit:>
 > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists>
 >
 >
 >
 >

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: How to debug netbeans

Posted by Ernie Rael <er...@raelity.com>.
(Ergonomics strikes again)

In Tools > Plugins > Installed

    "Show details" should NOT be checked.
    Click the "Developing NetBeans" check box.
    Click "Activate"

Then you should see Tools > NetBeansPlatform

-ernie

On 8/5/2020 8:07 PM, Darwin Te wrote:
> Hi Ernie,
>
> Thanks for the pointers.
>
> I have watched all the youtube movies but I couldn't find the "Netbeans Platform Manager" in the Tools menu.
>
> Best regards,
>
> Darwin
>
> ________________________________
> From: Ernie Rael <er...@raelity.com>
> Sent: August 4, 2020 6:14 PM
> To: dev@netbeans.apache.org <de...@netbeans.apache.org>
> Subject: Re: How to debug netbeans
>
> On the main page
>
>      http://netbeans.apache.org/
>
> "Participate" links to
>
>      http://netbeans.apache.org/participate/submit-pr.html
>
> and you will find directions and some you tube videos that show how to
> debug netbeans itself
>
> -ernie
>
> On 8/4/2020 2:36 PM, Darwin Te wrote:
>> Hi,
>>
>> I have checkout netbeans source from git and able to build it using ant command.
>>
>> How do I debug netbeans itself and build it with java debug information?
>>
>> I want to see stack trace why the cpu usage is always 100%.
>>
>> Also memory keeps on increasing if i perform a search in file.
>>
>> Thanks.
>>
>> Best regards,
>>
>> Darwin
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: How to debug netbeans

Posted by Laszlo Kishalmi <la...@gmail.com>.
I'm on the pro-debugger side, also 15+ years of developing NetBeans 
experience. I usually run the modules I wrote with debug action rather 
than simply run.

It is easier for me, to check different aspects of the runtime and 
en-charting unknown territories in NetBeans. Also fix class action is 
very useful as long as you do not introduce incompatible class changes.

The startup penalty of debugging is not really noticable if you are 
using hotspot vm (J9 is crawling in debug mode). Actually as I'm running 
on weekly dev releases, I'm running my main IDE in debug mode enabled, 
so I can attach a debugger to it  if I notice something odd. (And yes 
the attached debugger is running in another NetBeans session)

On 8/6/20 12:12 AM, Tim Boudreau wrote:
> I've been developing NetBeans itself and plugins for it for 21 years now.
> In that time I have run a debugger against NetBeans maybe ONCE, to see if
> it worked.
>
> The startup time penalty, and the odds of winding up stepping through code
> you actually need to see, rather than marching endlessly through
> java.util.Logger's source code and other irrelevant stuff, are
> infinitesimal.  Debuggers are a great tool for debugging algorithms you can
> isolate in a test or tiny application, or for learning how programs work
> when you're learning to program.  As a tool for fixing things in huge
> applications with deep stacks, they're pretty much useless - way too much
> distracting noise and way to little signal.
>
> My suggestion is, learn to love logging statements and
> System.out.println().  You can isolate problems quite fast if you do a sort
> of logging-binary-search - add a logging statement entering the code where
> something goes wrong, and one at a point where that thing probably has
> already gone wrong.  If that works as expected, add logging at the midpoint
> between those two points.  Still okay at the midpoint?  Add one between the
> middle and end - and so forth until you're on the line where things really
> do go wrong (usually just narrowing down the scope lets you see it).
>
> Sorry to be a downer on debuggers, but I can count on one hand the number
> of times I have learned anything useful from a debugger, and all of those
> times I could have probably found it faster if I'd just read the code.
>
> -Tim
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: How to debug netbeans

Posted by Tim Boudreau <ni...@gmail.com>.
Google it and you will find plenty of tutorials.  Geertjan's blog is full
of stuff - hopefully it survived his transition from Oracle.

-Tim

On Thu, Aug 6, 2020 at 8:21 AM marcos paulo <ma...@yahoo.com.br.invalid>
wrote:

>  Tim Boudreau,
>
> thanks for your suggestion, i agree with you!!!like you said, that wrote
> code to netbeans for 21 years, i found your blogand your netbeans modules,
> that is great, fine work;
> i have a question, do you have some tutorial or do you suggest some
> tutorialhow write plugin and module to netbeans???
> Thanks
> Att,Marcos Paulo
>
>     Le jeudi 6 août 2020 à 04:13:09 UTC−3, Tim Boudreau <
> niftiness@gmail.com> a écrit :
>
>  I've been developing NetBeans itself and plugins for it for 21 years now.
> In that time I have run a debugger against NetBeans maybe ONCE, to see if
> it worked.
>
> The startup time penalty, and the odds of winding up stepping through code
> you actually need to see, rather than marching endlessly through
> java.util.Logger's source code and other irrelevant stuff, are
> infinitesimal.  Debuggers are a great tool for debugging algorithms you can
> isolate in a test or tiny application, or for learning how programs work
> when you're learning to program.  As a tool for fixing things in huge
> applications with deep stacks, they're pretty much useless - way too much
> distracting noise and way to little signal.
>
> My suggestion is, learn to love logging statements and
> System.out.println().  You can isolate problems quite fast if you do a sort
> of logging-binary-search - add a logging statement entering the code where
> something goes wrong, and one at a point where that thing probably has
> already gone wrong.  If that works as expected, add logging at the midpoint
> between those two points.  Still okay at the midpoint?  Add one between the
> middle and end - and so forth until you're on the line where things really
> do go wrong (usually just narrowing down the scope lets you see it).
>
> Sorry to be a downer on debuggers, but I can count on one hand the number
> of times I have learned anything useful from a debugger, and all of those
> times I could have probably found it faster if I'd just read the code.
>
> -Tim
>



-- 
http://timboudreau.com

Re: How to debug netbeans

Posted by marcos paulo <ma...@yahoo.com.br.INVALID>.
 Tim Boudreau, 

thanks for your suggestion, i agree with you!!!like you said, that wrote code to netbeans for 21 years, i found your blogand your netbeans modules, that is great, fine work;
i have a question, do you have some tutorial or do you suggest some tutorialhow write plugin and module to netbeans???
Thanks
Att,Marcos Paulo

    Le jeudi 6 août 2020 à 04:13:09 UTC−3, Tim Boudreau <ni...@gmail.com> a écrit :  
 
 I've been developing NetBeans itself and plugins for it for 21 years now.
In that time I have run a debugger against NetBeans maybe ONCE, to see if
it worked.

The startup time penalty, and the odds of winding up stepping through code
you actually need to see, rather than marching endlessly through
java.util.Logger's source code and other irrelevant stuff, are
infinitesimal.  Debuggers are a great tool for debugging algorithms you can
isolate in a test or tiny application, or for learning how programs work
when you're learning to program.  As a tool for fixing things in huge
applications with deep stacks, they're pretty much useless - way too much
distracting noise and way to little signal.

My suggestion is, learn to love logging statements and
System.out.println().  You can isolate problems quite fast if you do a sort
of logging-binary-search - add a logging statement entering the code where
something goes wrong, and one at a point where that thing probably has
already gone wrong.  If that works as expected, add logging at the midpoint
between those two points.  Still okay at the midpoint?  Add one between the
middle and end - and so forth until you're on the line where things really
do go wrong (usually just narrowing down the scope lets you see it).

Sorry to be a downer on debuggers, but I can count on one hand the number
of times I have learned anything useful from a debugger, and all of those
times I could have probably found it faster if I'd just read the code.

-Tim
  

Re: How to debug netbeans

Posted by Neil C Smith <ne...@apache.org>.
On Tue, 25 Aug 2020 at 11:26, Carl Mosca <ca...@gmail.com> wrote:
> I have been working with the dcevm
> <https://github.com/TravaOpenJDK/trava-jdk-11-dcevm> and NetBeans a bit
> lately and hotswapping classes works nicely in some current use cases
> (remote web applications for example).

Don't get me started on everything that is wrong about the usual
approach to hotswapping in Java! ;-)

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: How to debug netbeans

Posted by Carl Mosca <ca...@gmail.com>.
In general, I find that NetBeans alone works nicely for my debugging
sessions.  There are certainly some nice features which I believe makes it
a very practical tool.

I have used JRebel in the past but I must say the company (sold twice I
think) has made things a bit less friendly with respect to licensing.  (We
have cases for which a license file is needed but we have only been
provided ones that expire in about 30 days despite the fact that our
licenses are for one year)

I have been working with the dcevm
<https://github.com/TravaOpenJDK/trava-jdk-11-dcevm> and NetBeans a bit
lately and hotswapping classes works nicely in some current use cases
(remote web applications for example).

The one issue I am seeing is that resources, such as JSF files, are not
automatically reloaded (remotely).

Carl


On Tue, Aug 25, 2020 at 4:34 AM Jean-Marc Borer <jm...@gmail.com> wrote:

> I also kind of disagree with Tim about it un-usefulness of a debugger. You
> can achieve way more that just stepping through the code. You can even
> dynamically add debugging traces without needing to touch the code and this
> he forgets: you cannot add logging statements for code you cannot compile
> yourself such as the JVM for example or other Maven artifacts. Have a look
> as well at tools such JRebel and Yourkit. They are use cases where they
> help you to save a lot of time.
>
> Cheers,
>
> JM
>
>
>
> On Thu, Aug 6, 2020 at 7:50 PM Matthias Bläsing <mblaesing@doppel-helix.eu
> >
> wrote:
>
> > Hi,
> >
> > I don't think debugging with logging/println statements and debugging
> > are either or. Both are approach that can be taken.
> >
> > HOWEVER, if you are new to programming, learn to use a debugger. While
> > there is learning involved and it is not always the right tool, having
> > it available is a great help.
> >
> > In a past job we had a central staging JavaEE server, that was used to
> > do QS testing with the end users. That server had the jpdw agent loaded
> > and at times it was invaluable to be able to just debug in the testing
> > system with the user reproducing his problem.
> >
> > With a debugger it is much easier to explorer the current runtime
> > environment and in contrast to logging statements, you don't need to
> > know what you want to know before it happens.
> >
> > Contrary to Tims reply a debugger does not require you to single step
> > through code. Line break points are pretty fast, method break points
> > are slower, but can be helpful to get to the offending code quickly.
> >
> > In the end the same advise as in many other cases in IT applies:
> >
> > - Know your tools (also the ones you may not like)
> > - Know when to use which tool
> >
> > Just a second perspective
> >
> > Matthias
> >
> > Am Donnerstag, den 06.08.2020, 03:12 -0400 schrieb Tim Boudreau:
> > > I've been developing NetBeans itself and plugins for it for 21 years
> now.
> > > In that time I have run a debugger against NetBeans maybe ONCE, to see
> if
> > > it worked.
> > >
> > > The startup time penalty, and the odds of winding up stepping through
> > code
> > > you actually need to see, rather than marching endlessly through
> > > java.util.Logger's source code and other irrelevant stuff, are
> > > infinitesimal.  Debuggers are a great tool for debugging algorithms you
> > can
> > > isolate in a test or tiny application, or for learning how programs
> work
> > > when you're learning to program.  As a tool for fixing things in huge
> > > applications with deep stacks, they're pretty much useless - way too
> much
> > > distracting noise and way to little signal.
> > >
> > > My suggestion is, learn to love logging statements and
> > > System.out.println().  You can isolate problems quite fast if you do a
> > sort
> > > of logging-binary-search - add a logging statement entering the code
> > where
> > > something goes wrong, and one at a point where that thing probably has
> > > already gone wrong.  If that works as expected, add logging at the
> > midpoint
> > > between those two points.  Still okay at the midpoint?  Add one between
> > the
> > > middle and end - and so forth until you're on the line where things
> > really
> > > do go wrong (usually just narrowing down the scope lets you see it).
> > >
> > > Sorry to be a downer on debuggers, but I can count on one hand the
> number
> > > of times I have learned anything useful from a debugger, and all of
> those
> > > times I could have probably found it faster if I'd just read the code.
> > >
> > > -Tim
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
>


-- 
Carl J. Mosca

Re: How to debug netbeans

Posted by Jean-Marc Borer <jm...@gmail.com>.
I also kind of disagree with Tim about it un-usefulness of a debugger. You
can achieve way more that just stepping through the code. You can even
dynamically add debugging traces without needing to touch the code and this
he forgets: you cannot add logging statements for code you cannot compile
yourself such as the JVM for example or other Maven artifacts. Have a look
as well at tools such JRebel and Yourkit. They are use cases where they
help you to save a lot of time.

Cheers,

JM



On Thu, Aug 6, 2020 at 7:50 PM Matthias Bläsing <mb...@doppel-helix.eu>
wrote:

> Hi,
>
> I don't think debugging with logging/println statements and debugging
> are either or. Both are approach that can be taken.
>
> HOWEVER, if you are new to programming, learn to use a debugger. While
> there is learning involved and it is not always the right tool, having
> it available is a great help.
>
> In a past job we had a central staging JavaEE server, that was used to
> do QS testing with the end users. That server had the jpdw agent loaded
> and at times it was invaluable to be able to just debug in the testing
> system with the user reproducing his problem.
>
> With a debugger it is much easier to explorer the current runtime
> environment and in contrast to logging statements, you don't need to
> know what you want to know before it happens.
>
> Contrary to Tims reply a debugger does not require you to single step
> through code. Line break points are pretty fast, method break points
> are slower, but can be helpful to get to the offending code quickly.
>
> In the end the same advise as in many other cases in IT applies:
>
> - Know your tools (also the ones you may not like)
> - Know when to use which tool
>
> Just a second perspective
>
> Matthias
>
> Am Donnerstag, den 06.08.2020, 03:12 -0400 schrieb Tim Boudreau:
> > I've been developing NetBeans itself and plugins for it for 21 years now.
> > In that time I have run a debugger against NetBeans maybe ONCE, to see if
> > it worked.
> >
> > The startup time penalty, and the odds of winding up stepping through
> code
> > you actually need to see, rather than marching endlessly through
> > java.util.Logger's source code and other irrelevant stuff, are
> > infinitesimal.  Debuggers are a great tool for debugging algorithms you
> can
> > isolate in a test or tiny application, or for learning how programs work
> > when you're learning to program.  As a tool for fixing things in huge
> > applications with deep stacks, they're pretty much useless - way too much
> > distracting noise and way to little signal.
> >
> > My suggestion is, learn to love logging statements and
> > System.out.println().  You can isolate problems quite fast if you do a
> sort
> > of logging-binary-search - add a logging statement entering the code
> where
> > something goes wrong, and one at a point where that thing probably has
> > already gone wrong.  If that works as expected, add logging at the
> midpoint
> > between those two points.  Still okay at the midpoint?  Add one between
> the
> > middle and end - and so forth until you're on the line where things
> really
> > do go wrong (usually just narrowing down the scope lets you see it).
> >
> > Sorry to be a downer on debuggers, but I can count on one hand the number
> > of times I have learned anything useful from a debugger, and all of those
> > times I could have probably found it faster if I'd just read the code.
> >
> > -Tim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: How to debug netbeans

Posted by Matthias Bläsing <mb...@doppel-helix.eu>.
Hi,

I don't think debugging with logging/println statements and debugging
are either or. Both are approach that can be taken.

HOWEVER, if you are new to programming, learn to use a debugger. While
there is learning involved and it is not always the right tool, having
it available is a great help.

In a past job we had a central staging JavaEE server, that was used to
do QS testing with the end users. That server had the jpdw agent loaded
and at times it was invaluable to be able to just debug in the testing
system with the user reproducing his problem.

With a debugger it is much easier to explorer the current runtime
environment and in contrast to logging statements, you don't need to
know what you want to know before it happens.

Contrary to Tims reply a debugger does not require you to single step
through code. Line break points are pretty fast, method break points
are slower, but can be helpful to get to the offending code quickly.

In the end the same advise as in many other cases in IT applies:

- Know your tools (also the ones you may not like)
- Know when to use which tool

Just a second perspective

Matthias

Am Donnerstag, den 06.08.2020, 03:12 -0400 schrieb Tim Boudreau:
> I've been developing NetBeans itself and plugins for it for 21 years now.
> In that time I have run a debugger against NetBeans maybe ONCE, to see if
> it worked.
> 
> The startup time penalty, and the odds of winding up stepping through code
> you actually need to see, rather than marching endlessly through
> java.util.Logger's source code and other irrelevant stuff, are
> infinitesimal.  Debuggers are a great tool for debugging algorithms you can
> isolate in a test or tiny application, or for learning how programs work
> when you're learning to program.  As a tool for fixing things in huge
> applications with deep stacks, they're pretty much useless - way too much
> distracting noise and way to little signal.
> 
> My suggestion is, learn to love logging statements and
> System.out.println().  You can isolate problems quite fast if you do a sort
> of logging-binary-search - add a logging statement entering the code where
> something goes wrong, and one at a point where that thing probably has
> already gone wrong.  If that works as expected, add logging at the midpoint
> between those two points.  Still okay at the midpoint?  Add one between the
> middle and end - and so forth until you're on the line where things really
> do go wrong (usually just narrowing down the scope lets you see it).
> 
> Sorry to be a downer on debuggers, but I can count on one hand the number
> of times I have learned anything useful from a debugger, and all of those
> times I could have probably found it faster if I'd just read the code.
> 
> -Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: How to debug netbeans

Posted by Tim Boudreau <ni...@gmail.com>.
I've been developing NetBeans itself and plugins for it for 21 years now.
In that time I have run a debugger against NetBeans maybe ONCE, to see if
it worked.

The startup time penalty, and the odds of winding up stepping through code
you actually need to see, rather than marching endlessly through
java.util.Logger's source code and other irrelevant stuff, are
infinitesimal.  Debuggers are a great tool for debugging algorithms you can
isolate in a test or tiny application, or for learning how programs work
when you're learning to program.  As a tool for fixing things in huge
applications with deep stacks, they're pretty much useless - way too much
distracting noise and way to little signal.

My suggestion is, learn to love logging statements and
System.out.println().  You can isolate problems quite fast if you do a sort
of logging-binary-search - add a logging statement entering the code where
something goes wrong, and one at a point where that thing probably has
already gone wrong.  If that works as expected, add logging at the midpoint
between those two points.  Still okay at the midpoint?  Add one between the
middle and end - and so forth until you're on the line where things really
do go wrong (usually just narrowing down the scope lets you see it).

Sorry to be a downer on debuggers, but I can count on one hand the number
of times I have learned anything useful from a debugger, and all of those
times I could have probably found it faster if I'd just read the code.

-Tim

Re: How to debug netbeans

Posted by Darwin Te <da...@hotmail.com>.
Hi Ernie,

Thanks for the pointers.

I have watched all the youtube movies but I couldn't find the "Netbeans Platform Manager" in the Tools menu.

Best regards,

Darwin

________________________________
From: Ernie Rael <er...@raelity.com>
Sent: August 4, 2020 6:14 PM
To: dev@netbeans.apache.org <de...@netbeans.apache.org>
Subject: Re: How to debug netbeans

On the main page

    http://netbeans.apache.org/

"Participate" links to

    http://netbeans.apache.org/participate/submit-pr.html

and you will find directions and some you tube videos that show how to
debug netbeans itself

-ernie

On 8/4/2020 2:36 PM, Darwin Te wrote:
> Hi,
>
> I have checkout netbeans source from git and able to build it using ant command.
>
> How do I debug netbeans itself and build it with java debug information?
>
> I want to see stack trace why the cpu usage is always 100%.
>
> Also memory keeps on increasing if i perform a search in file.
>
> Thanks.
>
> Best regards,
>
> Darwin
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: How to debug netbeans

Posted by Ernie Rael <er...@raelity.com>.
On the main page

    http://netbeans.apache.org/

"Participate" links to

    http://netbeans.apache.org/participate/submit-pr.html

and you will find directions and some you tube videos that show how to 
debug netbeans itself

-ernie

On 8/4/2020 2:36 PM, Darwin Te wrote:
> Hi,
>
> I have checkout netbeans source from git and able to build it using ant command.
>
> How do I debug netbeans itself and build it with java debug information?
>
> I want to see stack trace why the cpu usage is always 100%.
>
> Also memory keeps on increasing if i perform a search in file.
>
> Thanks.
>
> Best regards,
>
> Darwin
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: How to (profile rather than) debug netbeans

Posted by Jaroslav Tulach <ja...@gmail.com>.
- úterý 4. srpna 2020 23:36:12 CEST, Darwin Te -
> I want to see stack trace why the cpu usage is always 100%.

That's not particularly a case for debugger, but for a (self) profiler:
http://wiki.netbeans.org/FaqProfileMeNow
 
> Also memory keeps on increasing if i perform a search in file.

Again, heap dump may be more useful than debugger. Launch VisualVM, take heap 
dump of NetBeans process and check which objects are growing.

-jt

Btw. useful set of performance tips is still available at http://
wiki.netbeans.org/Performance





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists