This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 158762 - gdb ignoring "Pause" and breakpoints
Summary: gdb ignoring "Pause" and breakpoints
Status: RESOLVED DUPLICATE of bug 158570
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: Sun Windows XP
: P2 blocker (vote)
Assignee: Egor Ushakov
URL:
Keywords:
Depends on: 158570 159061
Blocks:
  Show dependency tree
 
Reported: 2009-02-18 17:13 UTC by twhite
Modified: 2009-06-25 10:59 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Pause failure GDB Debug Log (3.34 KB, text/plain)
2009-02-20 17:53 UTC, twhite
Details
GDB Debugger log after AutoUpdate update (5.44 KB, text/plain)
2009-02-20 18:08 UTC, twhite
Details
GDB Debugger log after final update (3.57 KB, text/plain)
2009-02-20 18:19 UTC, twhite
Details

Note You need to log in before you can comment on or make changes to this bug.
Description twhite 2009-02-18 17:13:08 UTC
I am using the latest release of NetBeans IDE 6.5 (Build 200811100001), SunStudio (Sun Ceres 2008/10) compiler, and gdb 
6.8.  My development host is a SPARC Solaris 10 zone.  My desktop is a Windows XP laptop.

I am able remotly build and execute the standard "Fractal_1" project that is shipped with SunStudio. When I try to 
debug the poject, the application just runs (inside of gdb).  Any breakpoints I have set are ignored, and I am unable 
to "Pause" or interrupt the run.  The following appears in my debug console:
Running "/opt/SUNWspro/bin/dmake  -f Makefile CONF=Debug" in /opt/SUNWspro/NetBeansProjects/Fractal_1

dmake: defaulting to parallel mode.
See the man page dmake(1) for more information on setting up the .dmakerc file.
h235 --> 1 job
h235 --> 2 jobs
/opt/SUNWspro/bin/dmake -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
/opt/SUNWspro/bin/dmake  -f nbproject/Makefile-Debug.mk dist/Debug/SunStudio-None/fractal_1
`dist/Debug/SunStudio-None/fractal_1' is up to date.

Build successful. Exit value 0.

PR_STOPPED Process (LWP) is stopped
PR_ISTOP Stopped on an event of interest
PR_RLC Run-on-last-close is in effect
PR_MSACCT Microstate accounting enabled
PR_PCOMPAT Micro-state accounting inherited on fork
PR_FAULTED : Incurred a traced hardware fault FLTBPT: Breakpoint trap
Calculating. Please wait....
Wall clock time = 206.923847 seconds



The fractal_1 program completes successfully, but never allows me to interrupt or trigger on any breakpoints.  I have 
tried a precompiled version of gdb as well as one I compiled myself.  Both behave in the same manner.  I can't see what 
gdb commands it is executing, so I am not sure where to go from here.
Comment 1 Leonid Lenyashin 2009-02-18 17:27:11 UTC
I'm afraid it is an issue of gdb & ss compilers interoperability. Can you try to log into the system and try gdb in
command line. Another option is to try GNU compilers if you have them on your SPARC system.
Comment 2 twhite 2009-02-18 19:04:07 UTC
Thank you for the quick response.  It did not seem to make any difference.  I switched my project to use the GNU 
profile, and confirmed the releases of the develoment server:
  C GCC 3.4.6
  G++ GCC 3.4.6
  Fortran GCC 3.4.6
  make SunStudio
  Debugger gdb 6.8

I did a "Clean and Build" and then debugged the project with the same results.  The program ran fine, but would not let 
me interrupt it or trigger my breakpoints:
Running "/opt/SUNWspro/bin/dmake  -f Makefile CONF=Debug clean" in /opt/SUNWspro/NetBeansProjects/Fractal_1

dmake: defaulting to parallel mode.
See the man page dmake(1) for more information on setting up the .dmakerc file.
h235 --> 1 job
h235 --> 2 jobs
/opt/SUNWspro/bin/dmake -f nbproject/Makefile-Debug.mk SUBPROJECTS= .clean-conf
h235 --> 1 job
rm -f -r build/Debug
rm -f dist/Debug/GNU-None/fractal_1
rm -f *.mod

Clean successful. Exit value 0.

Running "/opt/SUNWspro/bin/dmake  -f Makefile CONF=Debug" in /opt/SUNWspro/NetBeansProjects/Fractal_1

dmake: defaulting to parallel mode.
See the man page dmake(1) for more information on setting up the .dmakerc file.
h235 --> 1 job
h235 --> 2 jobs
/opt/SUNWspro/bin/dmake -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
/opt/SUNWspro/bin/dmake  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-None/fractal_1
h235 --> 1 job
mkdir -p build/Debug/GNU-None
g++    -c -g -o build/Debug/GNU-None/fractal.o fractal.cc
h235 --> Job output
mkdir -p build/Debug/GNU-None
g++    -c -g -o build/Debug/GNU-None/fractal.o fractal.cc
fractal.cc: In function `void Mandelbrot()':
fractal.cc:160: warning: converting to `int' from `long double'
fractal.cc:161: warning: converting to `int' from `long double'
h235 --> 1 job
mkdir -p dist/Debug/GNU-None
g++    -o dist/Debug/GNU-None/fractal_1 build/Debug/GNU-None/fractal.o  

Build successful. Exit value 0.

PR_STOPPED Process (LWP) is stopped
PR_ISTOP Stopped on an event of interest
PR_RLC Run-on-last-close is in effect
PR_MSACCT Microstate accounting enabled
PR_PCOMPAT Micro-state accounting inherited on fork
PR_FAULTED : Incurred a traced hardware fault FLTBPT: Breakpoint trap
Calculating. Please wait....
Wall clock time = 291.843168 seconds



I rebuilt the project using the SunStudio model, and ran the gdb from the command-line with the same command-line 
arguments that Netbeans is using.  It debugged the code just fine.  Below is my terminal session:
# /usr/local/bin/gdb --nw --silent --interpreter=mi
(gdb) 
file /opt/SUNWspro/NetBeansProjects/Fractal_1/dist/Debug/SunStudio-Solaris-Sparc/fractal_1
&"file /opt/SUNWspro/NetBeansProjects/Fractal_1/dist/Debug/SunStudio-Solaris-Sparc/fractal_1\n"
~"Reading symbols from /opt/SUNWspro/NetBeansProjects/Fractal_1/dist/Debug/SunStudio-Solaris-Sparc/fractal_1..."
~"done.\n"
^done
(gdb) 
break 212
&"break 212\n"
~"Breakpoint 1 at 0x12184: file fractal.cc, line 212.\n"
^done
(gdb) 
run
&"run\n"
~"Starting program: /opt/SUNWspro/NetBeansProjects/Fractal_1/dist/Debug/SunStudio-Solaris-Sparc/fractal_1 \n"
~"\n"
~"Breakpoint 1, main (argc=1, argv=0xffbffaec) at fractal.cc:212\n"
~"212\t    printf(\"Calculating. Please wait....\\n\");\n"
^done
(gdb) 
list
&"list\n"
~"207\t    seconds += (double) tv.tv_usec * USEC_TO_SEC; // and microseconds\n"
~"208\t    return seconds;\n"
~"209\t}\n"
~"210\t\n"
~"211\tint main(int argc, char* argv[]) {\n"
~"212\t    printf(\"Calculating. Please wait....\\n\");\n"
~"213\t    // tracking  wall time\n"
~"214\t    double startwtime = 0.0;\n"
~"215\t    double endwtime;\n"
~"216\t    startwtime = wallTime();\n"
^done
(gdb) 
break 215
&"break 215\n"
~"Breakpoint 2 at 0x121a0: file fractal.cc, line 215.\n"
^done
(gdb) 
cont
&"cont\n"
~"Continuing.\n"
Calculating. Please wait....
~"\n"
~"Breakpoint 2, main (argc=1, argv=0xffbffaec) at fractal.cc:216\n"
~"216\t    startwtime = wallTime();\n"
^done
(gdb) 
print startwtime
&"print startwtime\n"
~"$1 = 0"
~"\n"
^done
(gdb) 
quit    
&"quit\n"

So, it looks like it should work.  What commands is it sending to the gdb?  Is there a session log that is kept 
somewhere?  It is like a 'run' is being performed instead of a 'start'.
Comment 3 twhite 2009-02-19 03:37:00 UTC
Another interesting bit of information.  If I create a function breakpoint (say in main), then the debugger stops in 
the function and allows me to step through the program.  It shows me the active line, and allows me to examine the 
program variables.  If I set a line breakpoint (thorugh the dialog box or by picking the line) it is ignored.

Both of these types of breakpoints appear to work from the gdb command-line.  Is the breakpoint syntax you are using 
correct for line breakpoints?  Again, it would be helpful if you could expose the terminal session to the developer.  
In other IDE's I have seen, the debugger prompt(session) is available (for viewing and command-line entering) in a 
terminal window.
Comment 4 Egor Ushakov 2009-02-19 08:43:40 UTC
looks like a duplicate of the issue 158570.
Can you please try fresh Netbeans 6.5 without updates?
Comment 5 Leonid Lenyashin 2009-02-19 11:31:19 UTC
Here is a pointer to the article, that explains how to enable Debugger Console:

http://cnd.netbeans.org/docs/articles/debugging/Review_NikMolchanov/NetBeansC_C++DevelopmentPack5.5_Debugging.html#7._Debugger_Console._

There is a Netbeans option:
-J-Dgdb.console.window=true
Comment 6 twhite 2009-02-19 19:29:24 UTC
Thanks for the link to enabling the debug console.  It makes me feel much more comfortable seeing the commands being 
executed.  It is turely awesome!  Now I can execute gdb commands you may not yet directly support.

It does not appear to be the same issue as 158570.  In the excerpt below, it has the full name as the correct path:
108-exec-run  < /tmp/gdbFifo2531.fifo > /tmp/gdbFifo2570.fifo 2>&1
109info proc
106^done,bkpt=
{number="1",type="breakpoint",disp="del",enabled="y",addr="0x00012184",func="main",file="fractal.cc",fullname="/opt/SUNW
spro/NetBeansProjects/Fractal_1/fractal.cc",line="212",times="0"}
107^done,register-names=
["g0","g1","g2","g3","g4","g5","g6","g7","o0","o1","o2","o3","o4","o5","sp","o7","l0","l1","l2","l3","l4","l5","l6","l7"
,"i0","i1","i2","i3","i4","i5","fp","i7","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","f13","f14"
,"f15","f16","f17","f18","f19","f20","f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31","y","psr","wim","
tbr","pc","npc","fsr","csr","d0","d2","d4","d6","d8","d10","d12","d14","d16","d18","d20","d22","d24","d26","d28","d30"]
108^running
  

I did notice that the "times" value is "0".  Should this value be a "1"?  I uninstall and reinstall, but that will take 
me some time.  I will provide an update tonight.
Comment 7 twhite 2009-02-20 01:42:06 UTC
I uninstalled Netbeans 6.5 and all its supporting applications.  I removed the netbeans directory under "Progam Files".
 I then installed the full IDE package.  I was careful not to update anything.  I changed the netbeans.conf file to
include the gdb debugger console.

It did not ignore my breakpoints!  So, it seems to be a similar problem, though the filename in the breakpoint text
looks correct to me (and the "times" value is the same also):
127^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x000121ac",func="main",file="fractal.cc",fullname="/opt/SUNWspro/NetBeansProjects/Fractal_1/fractal.cc",line="219",times="0"}

Let me know if I can do anything else to isolate the issue.  Thank you for you assistance.

Comment 8 Alexander Pepin 2009-02-20 14:56:49 UTC
The regression happened after fixing issue #151761
Comment 9 Egor Ushakov 2009-02-20 15:02:50 UTC
can you please attach the full gdb-log here
Comment 10 Egor Ushakov 2009-02-20 15:05:43 UTC
As you said breakpoints works fine on ide without updates.
What about pause?
Comment 11 twhite 2009-02-20 17:53:56 UTC
Created attachment 77207 [details]
Pause failure GDB Debug Log
Comment 12 twhite 2009-02-20 18:08:28 UTC
Created attachment 77208 [details]
GDB Debugger log after AutoUpdate update
Comment 13 twhite 2009-02-20 18:19:39 UTC
Created attachment 77209 [details]
GDB Debugger log after final update
Comment 14 twhite 2009-02-20 18:21:30 UTC
I tried to "Pause" the applciation, and it would not be interrupted.  The first Debugger log is attachment(Fri Feb 20 
17:53:00 +0000 2009: DebugerLog(PauseFaile).txt).  If I set an explicit breakpoint it would work fine.

I then did a Check or Updates, and updated the AutoUpdate.  After the Netbeans restarted, my breakpoints again worked.  
The second attachment (Fri Feb 20 18:08:00 +0000 2009: DebuggerLog(after AutoUpdate).txt) is the GDB debugger log for 
this session.  Again, I could not "Pause" the application, but the breakpoints seemed to work.  

I then did another Check for Updates.  It updated the following:
   Ant [1.2.1 -> 1.2.2] 
   C/C++ [1.4.1 -> 1.4.3] 
   Database [1.3.1 -> 1.3.3] 
   Editing Files [1.2.1 -> 1.2.2] 
   GUI Builder [1.2.1 -> 1.2.2] 
   GlassFish v3 Prelude - JRuby [0.4.1 -> 1.0.2] 
   GlassFish v3 Prelude [0.4.1 -> 1.0.2] 
   Groovy and Grails [1.7.1 -> 1.7.2] 
   Hibernate Support [1.0.1 -> 1.0.2] 
   IDE Platform [1.5.1 -> 1.5.3] 
   JBoss Application Server [1.11.1 -> 1.11.2] 
   Java EE [1.2.1 -> 1.2.3] 
   Java Profiler [1.9.1 -> 1.9.3] 
   Java [1.3.1 -> 1.3.3] 
   Mercurial [1.7.1.42.1 -> 1.7.2.42.1] 
   NetBeans 6.5 [1.2.1 -> 1.2.3] 
   PHP [1.2.1 -> 1.2.3] 
   Platform [1.2.1 -> 1.2.3] 
   RESTful Web Services [1.0.1 -> 1.0.3] 
   Ruby and Rails [0.104.1 -> 0.104.3] 
   SaaS Services Support [1.0.1 -> 1.0.2] 
   Subversion [1.4.1 -> 1.4.2] 
   Visual Mobile Designer [1.3.1 -> 1.3.2] 
   Web Applications [1.2.1 -> 1.2.3]

After the Netbeans restarted, my breakpoints failed.  The third attachment(Fri Feb 20 18:19:00 +0000 2009: DebuggerLog
(after Update).txt) is the GDB Debugger log from this session.
Comment 15 Egor Ushakov 2009-02-24 10:38:22 UTC
breakpoints problems fixed within the issue 158570
Comment 16 Egor Ushakov 2009-02-24 14:28:38 UTC
Pause issues will be handled in a separate issue 159061.
The rest is a duplicate of the issue 158570.

*** This issue has been marked as a duplicate of 158570 ***
Comment 17 Alexander Pepin 2009-02-25 17:56:15 UTC
As it's a duplicate of the issue #158570 which is also patch3 candidate, this issue is not a patch3 candidate any more.