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.
In my particular project I have - a library built into an .so - a swig-generated python layer to provide access to the code in the library Under GDB I just: gdb /usr/bin/python run ommovie.py ... and I can set breakpoints, step etc. Similar steps can be taken in VS 2010. From the project I set up (project with existing source code), I cannot see a way to specify a binary to run (/usr/bin/python). I've seen the project to build a shared library, but that's to build one from scratch.... the code already exists. Perhaps there's a simple solution that I can't see. Please help.
probably a duplicate of bug 124556, please reopen if not. *** This bug has been marked as a duplicate of bug 124556 ***
I agree. Its a dup.
After some discussion, this is not a dup of bug 124556 because it merely said that run/debug were inactive for libraries. No longer true in 7.0. The condition listed above remains. In particular: - if the "run command" in the "run" paragraph under project properties is set to a binary without symbols (e.g. /usr/bin/python), netbeans/gdb complains about "main" not being defined. This should not be an issue, because gdb sees when a shared library is loaded later and can set breakpoints then. - The closest I have come in starting up /usr/bin/python under netbeans appears to require that (a) I make the process sleep early on so I can (b) hit the pause button on netbeans. This gets me into python, and sometimes I hit a stack track I recognize, but netbeans seems unaware of the source code. - I can also start it up from a shell (and sleep) and then attach to it from within NB, but it still does not know about the sources. With gdb alone, on the other hand, its a bit clunky, but it has no trouble with debugging and/or breakpoints. The setup involves the following: * gdb /usr/bin/python * run <tinyscript.py> the tiny script loads the module I want to debug and then exits. This is enough for gdb to see the symbols being loaded and allows me to... * <set various breakpoints> * run <scriptpy> And things work well from there.
Debugging is key to development: upping to P2.
could you please attach gdb-log of the session, I see where the problem is, just need to be sure, thanks!
with the fix of bug 193764 this bug may also be fixed, please verify
Created attachment 105121 [details] screenshot of the error in a newer version of the ide With the new release (below), it still starts up the same way and gets nowhere. Here is a screenshot of the ide after starting the debugger. Note that it seems to be aware of the .so file, but my only option is to stop or restart the task. The debug external terminal never gets any output. Product Version: NetBeans IDE Dev (Build 201101180000) Java: 1.6.0_18; Java HotSpot(TM) 64-Bit Server VM 16.0-b13 System: Linux version 2.6.35.10-74.fc14.x86_64 running on amd64; UTF-8; en_US (nb) Userdir: /home/toddb/.netbeans/dev
Created attachment 105122 [details] gdb helper
Created attachment 105123 [details] gdb helper
I'm not sure why, but there are no gdb logs on my system. The command - find / -mount -name gdb-cmds\ produced nothing. Could this be part of the problem? However, if I look in /tmp while the debugger is running, I can see the help scripts (attached above)
gdb log is no longer saved into a file, you can just copy paste it from debugger console (main menu/windows/debugger/debugger console)
Created attachment 105180 [details] gdb log Attached is the current gdb log. Note that nothing happens after the error message about no "main" being defined. Note also that this is a "project from existing sources" with the run command defined to be /usr/bin/python.
as a workaround try to start debugging with "step into" (from project context menu)
from the log I can see that python is not used as exec file for gdb, .so library is used instead, so it is not trying to run python at all, investigating...
What do you enter into the library run field? I tried with simple library project and enter executable that uses it and it works fine. Please specify your project settings: run, arguments, etc.
> What do you enter into the library run field? That's not available to me. The source code base I work on is a commercial embedded product with a 12 year history and about 1.5M lines of code. One part of that is a shared object built from about 0.5M lines of that code. The NB options include a dynamic library, and I have tried that option, but I have to lie to NB about the library and then add my existing sources. Once I do that, I cannot get enough control over the compile process (another bug I suppose) to generate the dynamic library the way I need to. So instead I have used "project with existing sources", as I described above. In that case, the "run command" can be specified as /usr/bin/python. I'm sure you have fixed the problem within the scope of the "dynamic libary" project. Unfortunately, I can't seem to get there from here. Do you know of any recipes for creating a "dynamic library from existing sources" in NB? If not, perhaps we should close this bug.
aah, now I see :) fixed in: http://hg.netbeans.org/cnd-main/rev/43dcc19949a2 now we should always take file for debug from run command.
Integrated into 'main-golden', will be available in build *201101220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/43dcc19949a2 User: Egor Ushakov <gorrus@netbeans.org> Log: fixed #191812 (NB does not allow debugging shared objects)