Author Topic: How to debug?  (Read 4287 times)

Offline mcgillca

  • PixInsight Enthusiast
  • **
  • Posts: 77
    • Astrobin Website
How to debug?
« on: 2012 November 16 07:26:38 »
Hi - I am still very new to PixInsight. I have successfully managed to compile and install a version of sandbox using the makefile generator script under Linux (Ubuntu 12.04)

Before I press on and try to write something that actually does something, I would like to make sure I can run a debugger.

I've seen various posts with information, but mostly its about Eclipse/VC++.

If possible, I would like to debug with GDB - I haven't done much coding for 10 years, but previously used Emacs as my IDE, including for debugging. If I can avoid having to learn a IDE, that would be great.

Any tips about how to run a module with a debugger much appreciated.

Thank you,

Colin
Paramount MX
Ikharos 8" Carbon Truss RC
Atik 460ex
Atik EFW2 with Baader LRGB and HA SII OIII
ONAG with Atik 314L+
http://www.astrobin.com/users/mcgillca/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: How to debug?
« Reply #1 on: 2012 November 16 09:07:38 »
I usually use ddd, but this should be applicable to any debugger:
- run PI
- attach to process
Alternative: Write your own PixInsight.sh, that runs PixInsight within ddd/gdb/whatever you like...
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline mcgillca

  • PixInsight Enthusiast
  • **
  • Posts: 77
    • Astrobin Website
Re: How to debug?
« Reply #2 on: 2012 November 19 04:26:25 »
Thanks, Georg, and for the tip on ddd - looks like a very nice front end to GDB.

One question - what process do you use to set breakpoints etc? I found that I needed to run the module once (to force loading) before I could then set breakpoint and examine variable.

Is there a neater way?

Colin
Paramount MX
Ikharos 8" Carbon Truss RC
Atik 460ex
Atik EFW2 with Baader LRGB and HA SII OIII
ONAG with Atik 314L+
http://www.astrobin.com/users/mcgillca/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: How to debug?
« Reply #3 on: 2012 November 19 05:43:24 »
Sorry, I dont know. Frankly I never tried to set breakpoints before the first run... I am probably more the printf type of developer  ;)

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: How to debug?
« Reply #4 on: 2012 November 29 11:25:44 »
In VC++ debugging a PCL module is just like any other c/c++ project. You put the breakpoint where you want it, run the program and 'boom', it breaks. I assume you know how to debug software on Linux, right? Doesn't it work the same way when you debug PCL modules? If you're not familiar with Linux code development and debugging you may want to start with something a little simpler than PCL.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity