NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Debugging C code Call Stack Line
Goto page 1, 2  Next
 
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users
View previous topic :: View next topic  
Author Message
dms489



Joined: 18 Aug 2011
Posts: 19
Location: Atlanta, GA

PostPosted: Sat Jan 28, 2012 3:54 pm    Post subject: Debugging C code Call Stack Line Reply with quote

I am using NetBeans 7.0.1 to develop some moderately nasty C code. I can't get the debugger to work. When I set a break point at the first line of main() and run with the "Debug Main Project" button, the processor stops at some place in the code immediately above main() with a little gray triangle where a break point would be. Hovering over that with the mouse reports that this is the Call Stack Line and the only debugging tools active are "Finish Debugging Session" and "Restart".
I don't seem able to find an explanation for what I have done to cause this.
Back to top
pandivoky



Joined: 29 Jan 2012
Posts: 3

PostPosted: Sun Jan 29, 2012 1:10 pm    Post subject: Reply with quote

I have the very same problem with NB 7.1 with minGW on win7 64bit. It stopped working suddenly, after no change in project or other settings.

When I run project, it writes:
RUN FAILED, exit value 127

When try to debug, it's Process State in Session tab is "Exited" before it enters main function.

I've tried to run NB as admin, change Console type and restart pc, but all with no success.

It works fine for new project, I can also compile and run my project using gcc from command line.

Anyone have idea to solve this trouble? Thanks for answer
Back to top
pandivoky



Joined: 29 Jan 2012
Posts: 3

PostPosted: Sun Jan 29, 2012 1:11 pm    Post subject: Reply with quote

I can run project in external terminal now, don't know how I did it (maybe disable firewall, maybe restart NB).
But debug is still not working.. :-/
Back to top
dms489



Joined: 18 Aug 2011
Posts: 19
Location: Atlanta, GA

PostPosted: Sun Jan 29, 2012 2:43 pm    Post subject: Update and More Frustration Reply with quote

Trying to eliminate possible causes, I reinstalled Cygwin, by gcc / gdb machinery, created a new project containing jst a "Hello, World" printf and it still won't break at the first and only source line. :?


BSTTStm_Sim.c
 Description:

Download
 Filename:  BSTTStm_Sim.c
 Filesize:  132 Bytes
 Downloaded:  94 Time(s)

Back to top
dms489



Joined: 18 Aug 2011
Posts: 19
Location: Atlanta, GA

PostPosted: Sun Jan 29, 2012 4:34 pm    Post subject: For one brief shining moment ... Reply with quote

So I installed NetBeans 7.1 and ran the same Hello, World as before. The first time, it actually stopped at a break point in main(...) where it was supposed to. Then on the next try, it reverted to the same behavior.
Back to top
dms489



Joined: 18 Aug 2011
Posts: 19
Location: Atlanta, GA

PostPosted: Sun Jan 29, 2012 8:24 pm    Post subject: ... and the last straw was ... Reply with quote

I moved from Windows 7 to Ubuntu 11.10 using a different C compiler - GNU-linux-x86 vs Cygwin - and NetBeans 7.1 with my full source code configuration. The debugger ran flawlessly perhaps a dozen times and then all of a sudden started exactly the same behavior as before - stopping a few lines above the main(...) declaration with a little gray triangle that believes itself to be the Call Stack Line whatever that is. I have eliminated every possible culprit except netBeans itself. How do we escalate this to get the gurus to take a look?
Back to top
dms489



Joined: 18 Aug 2011
Posts: 19
Location: Atlanta, GA

PostPosted: Sun Jan 29, 2012 8:29 pm    Post subject: Hmmm ... a clue Reply with quote

There is a core dump in the project source directory on both Ubuntu and Windows.
Back to top
lovedr



Joined: 07 Feb 2012
Posts: 3

PostPosted: Tue Feb 07, 2012 3:59 pm    Post subject: Reply with quote

Hello:

I am having the same problem where the NB stops at the line right before the main function with a little gray trianlge. placing the mouse over it says that its a "call stack line". not sure what that means. in the stack window, there is nothing, in the sessions window, it says
Name ProcessID Process State Host
MyAppName -1 Exited localhost

I can not figure out why this is happining. in other projects it works fine. please help I have been dealing with this problem for 2 days now. any help would be grealty appreciated. also, there is no core file in my project dir. Im using CentOS linux and my project is a C/C++. the program compiles and i can run it from the command line

Please Help!!
Thanks
Back to top
dms489



Joined: 18 Aug 2011
Posts: 19
Location: Atlanta, GA

PostPosted: Tue Feb 07, 2012 6:42 pm    Post subject: Trying to elevate the problem Reply with quote

Seems there is no solution emerging at this level of conversation. I'm trying to get developers involved.
Back to top
soldatov



Joined: 05 Nov 2009
Posts: 390

PostPosted: Tue Feb 07, 2012 10:22 pm    Post subject: Reply with quote

If you see strange behaviour in debugger you needs to attach gdb log into forum or create new bug.
gdb log is "main menu/window/debugging/debugger console"
Back to top
dms489



Joined: 18 Aug 2011
Posts: 19
Location: Atlanta, GA

PostPosted: Tue Feb 07, 2012 10:51 pm    Post subject: debugging logs Reply with quote

Not sure what you mean here because a. I'm on Windows 7 (although the Ubuntu NetBeans 7.1 does exactly the same) and b. I don't think this is a gdb problem because in moving to Ubuntu, I changed from Cygwin to the built-in system. However, the first attachment is a debugging file dated immediately after the last crash.


crash_n_burn.jpg
 Description:
 Filesize:  167 KB
 Viewed:  8099 Time(s)

crash_n_burn.jpg


Back to top
dms489



Joined: 18 Aug 2011
Posts: 19
Location: Atlanta, GA

PostPosted: Tue Feb 07, 2012 10:53 pm    Post subject: Wrong attachment - sorry Reply with quote

The attachment above is a screen shot of the problem. Here's the debugging file.
<?xml version="1.0"?>
<!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd">
<settings version="1.0">
<module name="org.netbeans.modules.debugger.jpda.ui/1" spec="1.23.1"/>
<instanceof class="java.awt.Component"/>
<instanceof class="java.awt.Container"/>
<instanceof class="java.awt.MenuContainer"/>
<instanceof class="java.awt.event.AdjustmentListener"/>
<instanceof class="java.awt.event.MouseWheelListener"/>
<instanceof class="java.awt.image.ImageObserver"/>
<instanceof class="java.beans.PropertyChangeListener"/>
<instanceof class="java.io.Externalizable"/>
<instanceof class="java.io.Serializable"/>
<instanceof class="java.lang.Object"/>
<instanceof class="java.util.EventListener"/>
<instanceof class="javax.accessibility.Accessible"/>
<instanceof class="javax.swing.JComponent"/>
<instanceof class="javax.swing.TransferHandler$HasGetTransferHandler"/>
<instanceof class="javax.swing.event.ChangeListener"/>
<instanceof class="javax.swing.event.TreeExpansionListener"/>
<instanceof class="javax.swing.event.TreeModelListener"/>
<instanceof class="javax.swing.event.TreeSelectionListener"/>
<instanceof class="org.netbeans.modules.debugger.jpda.ui.debugging.DebuggingView"/>
<instanceof class="org.openide.explorer.ExplorerManager$Provider"/>
<instanceof class="org.openide.util.HelpCtx$Provider"/>
<instanceof class="org.openide.util.Lookup$Provider"/>
<instanceof class="org.openide.windows.TopComponent"/>
<serialdata class="org.netbeans.modules.debugger.jpda.ui.debugging.DebuggingView">
ACED0005737200296F72672E6F70656E6964652E77696E646F77732E546F70436F6D706F6E656E74245265706C6163657284
874494BDDF6D64030000787074003D6F72672E6E65746265616E732E6D6F64756C65732E64656275676765722E6A7064612E
75692E646562756767696E672E446562756767696E67566965777372000F6A6176612E6C616E672E53686F7274684D371334
60DA5202000153000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B0200007870000177
0400000001740009446562756767696E6774000E446562756767696E6720566965777078
</serialdata>
</settings>
Back to top
soldatov



Joined: 05 Nov 2009
Posts: 390

PostPosted: Wed Feb 08, 2012 8:35 am    Post subject: Re: debugging logs Reply with quote

dms489 wrote:
Not sure what you mean here because a. I'm on Windows 7 (although the Ubuntu NetBeans 7.1 does exactly the same) and b. I don't think this is a gdb problem because in moving to Ubuntu, I changed from Cygwin to the built-in system. However, the first attachment is a debugging file dated immediately after the last crash.


I speaks about text in Debugger Console tab on your screenshot
Back to top
dms489



Joined: 18 Aug 2011
Posts: 19
Location: Atlanta, GA

PostPosted: Wed Feb 08, 2012 3:05 pm    Post subject: Debugger Console Output Reply with quote

This looks like a treasure trove.


debugger_console.txt
 Description:
Complete contents of the Debugger Console after the disaster shown in the screen shot

Download
 Filename:  debugger_console.txt
 Filesize:  6.75 KB
 Downloaded:  194 Time(s)

Back to top
lovedr



Joined: 07 Feb 2012
Posts: 3

PostPosted: Wed Feb 08, 2012 4:03 pm    Post subject: Reply with quote

here is my output in the Debug window. I am currently using gdb 7.4 but when i was using 7.1 version I was getting the same output and the probem doesnt happen on other projects. after doing a google search when using the 7.1 version I found a site saying the problem was fixed in the new version so that is why I upgraded to the 7.4 but as you can see it did not help. the probem I got with the 7.1 version was the same except the line number in the thead.c file was 581 i think but with the same error. I also found that if i run the project in netbeans and then attach the debugger it seems to work ok. so, again, any help will be greatly appreciated. this is really starting to hinder my progress so please help.


=thread-group-added,id="i1"
~"GNU gdb (GDB) 7.4\n"
~"Copyright (C) 2012 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"x86_64-unknown-linux-gnu\".\nFor bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
(gdb)
2-list-features
3-gdb-set print repeat 0
4-gdb-set backtrace limit 1024
5-gdb-set print elements 0
6-environment-directory "/home/whazin/FLECT_Recon_Project"
7-file-exec-and-symbols "/home/whazin/FLECT_Recon_Project/FLECT_Recon_App"
2^done,features=["frozen-varobjs","pending-breakpoints","thread-info","data-read-memory-bytes","breakpoint-notifications","ada-task-info","python"]
(gdb)
3^done
(gdb)
4^done
(gdb)
5^done
(gdb)
6^done,source-path="/home/whazin/FLECT_Recon_Project:$cdir:$cwd"
(gdb)
7^done
(gdb)
8-file-list-exec-source-file
9cd /home/whazin/FLECT_Recon_Project
10-exec-arguments 9001
11-var-create - @ ReconSharedData
12-var-update --all-values *
13-var-create - @ FLECT_2D_Recon
14-var-update --all-values *
8^done,line="58",file="FLECT_Recon_App.c",fullname="/home/whazin/FLECT_Recon_Project/FLECT_Recon_App.c",macro-info="0"
(gdb)
15-break-insert -t _start
&"cd /home/whazin/FLECT_Recon_Project\n"
~"Working directory /home/whazin/FLECT_Recon_Project.\n"
9^done
(gdb)
10^done
(gdb)
11^error,msg="-var-create: unable to create variable object"
(gdb)
12^done,changelist=[]
(gdb)
13^done,name="var2",numchild="4",value="{...}",type="FLECT_2D_ReconStruct",has_more="0"
(gdb)
~"thread.c:613: internal-error: is_thread_state: Assertion `tp' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nQuit this debugging session? "
~"(y or n) [answered Y; input not from terminal]\n"
~"thread.c:613: internal-error: is_thread_state: Assertion `tp' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nCreate a core file of GDB? "
~"(y or n) [answered Y; input not from terminal]\n"
16-var-show-attributes "var2"
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo