Author Topic: debugging libraries  (Read 4544 times)

Offline wiseguyin

  • Single posting newcomer
  • *
  • Posts: 6
debugging libraries
« on: July 02, 2009, 07:55:42 am »
Hi Gurus,
I am debugging a library and have set a host application for it. But on starting the debug, it exits immediately
with the message:
Process terminated with status 255 (0 minutes, 0 seconds)

If it helps: the host application is nautilus (since i am coding a nautilus extension)

Any ideas what I need to do ??

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: debugging libraries
« Reply #1 on: July 02, 2009, 08:03:35 am »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: debugging libraries
« Reply #2 on: July 02, 2009, 09:47:51 am »
Hi Gurus,
I am debugging a library and have set a host application for it. But on starting the debug, it exits immediately
with the message:
Process terminated with status 255 (0 minutes, 0 seconds)

If it helps: the host application is nautilus (since i am coding a nautilus extension)

Any ideas what I need to do ??

Is your host program a console application (Right click the project's properties goto "Build targets", chose your target and see which application type is chosen) ?

If yes, you need xterm to be installed on your system, or change the "Terminal to launch console programs:" in "Settings -> Environment... -> General settings".
The first works definitely, the second depends on the console-program and needs at least some tweaking of the parameters and might not work at all.

Offline wiseguyin

  • Single posting newcomer
  • *
  • Posts: 6
Re: debugging libraries
« Reply #3 on: July 02, 2009, 05:29:50 pm »
@ollydbg: Yeah thats the one...

@jens: Its a library - that I am coding... it gets called by nautilus..... which is the "windows explorer" for gnome ...

I can debug using gdb on my terminal ... but since I am new to Linux programming I don't want to spend time learning GDB too.

Regards,
Sunil

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: debugging libraries
« Reply #4 on: July 02, 2009, 06:05:15 pm »
@jens: Its a library - that I am coding... it gets called by nautilus..... which is the "windows explorer" for gnome ...

I know nautilus, even if I'm not using gnome.

I thought you have a test application for your library (overread that nautilus itself is the host app).

You can turn on the debuggers debug log ("Settings -> Compiler and debugger... -> Debugger settings -> Display debuggers debug log"), and post it's content, if the debug-session fails.

Offline wiseguyin

  • Single posting newcomer
  • *
  • Posts: 6
Re: debugging libraries
« Reply #5 on: July 05, 2009, 12:05:47 am »
Tried this today --- nothing happened. The debugger log was empty. Though, nautilus did run, because I could see a new "explorer" window.

I guess I will have to learn gdb (freakin - command line!!) commands .... Is this something that the C::B team can enhance ..?

May be the debugging cannot be done on nautilus because I am not running it with sudo privileges...

Offline wiseguyin

  • Single posting newcomer
  • *
  • Posts: 6
Re: debugging libraries
« Reply #6 on: July 05, 2009, 03:09:26 am »
By the way, launching code::Blocks from the terminal as root, I am able to launch the debugging sesion.. But adding a breakpoint results in the following message:

Code
** (nautilus:20909): WARNING **: Unable to add monitor: Operation not supported
Nautilus-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error No such file or directory
Please ask your system administrator to enable user sharing.

I am not even sure what it means...