Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Using a c debugger with a curses program
it seems ddd doesn't work too well with programs using pdcurses (it
kind of works for a short while and then crashes more often than not).
Insight doesn't even manage to start my program before freezing.

Does anyone have any idea on how to use a debugger under these
circumstances? Compiling my program to use ncursese instead of
pdcurses doesn't seem to help much either.

-Ido.

Report this thread to moderator Post Follow-up to this message
Old Post
Ido Yehieli
01-27-08 12:20 AM


Re: Using a c debugger with a curses program
Ido Yehieli wrote:
> it seems ddd doesn't work too well with programs using pdcurses (it
> kind of works for a short while and then crashes more often than not).
> Insight doesn't even manage to start my program before freezing.
>
> Does anyone have any idea on how to use a debugger under these
> circumstances? Compiling my program to use ncursese instead of
> pdcurses doesn't seem to help much either.
>
> -Ido.
Run the program in the debugger with the input and output re-directed to
another terminal, that's how I've always done it.

$ debugger a.out
debugger> run < /dev/tty01 > /dev/tty01

Obviously you have to have more than one /terminal/ available, but in
these days where xterms and their ilk abound, it's not like you have to
nick the VT340 off someone else's desk!!

Cheers,
Gary	B-)

--
 ________________________________________
____________________________________
__
Armful of chairs: Something some people would not know
whether you were up them with or not
- Barry Humphries

Report this thread to moderator Post Follow-up to this message
Old Post
Gary R. Schmidt
01-27-08 01:20 PM


Re: Using a c debugger with a curses program
Ido Yehieli <Ido.Yehieli@gmail.com> writes:

> it seems ddd doesn't work too well with programs using pdcurses (it
> kind of works for a short while and then crashes more often than not).
> Insight doesn't even manage to start my program before freezing.
>
> Does anyone have any idea on how to use a debugger under these
> circumstances? Compiling my program to use ncursese instead of
> pdcurses doesn't seem to help much either.

If you don't need to debug that program from the very beginning you can
run your application, get it's PID and then run gdb's attach command.

--
Best regards,                                         _     _
.o. | Liege of Serenly Enlightened Majesty of      o' \,=./ `o
.o | Computer Science,  Michal "mina86" Nazarewicz   (o o)
ooo +--<mina86*tlen.pl>--<jid:mina86*jabber.org>--ooO--(_)--Ooo--

Report this thread to moderator Post Follow-up to this message
Old Post
Michal Nazarewicz
01-28-08 09:33 AM


Re: Using a c debugger with a curses program
Sat, 26 Jan 2008 11:37:14 -0800 (PST)
Ido Yehieli <Ido.Yehieli@gmail.com> schrieb:
>it seems ddd doesn't work too well with programs using pdcurses (it
>kind of works for a short while and then crashes more often than not).
>Insight doesn't even manage to start my program before freezing.
>
>Does anyone have any idea on how to use a debugger under these
>circumstances? Compiling my program to use ncursese instead of
>pdcurses doesn't seem to help much either.

I can't test it on ddd, but what works for me with gdb is using to
terminal-sessions, on one I open gdb and enter 'tty /dev/other_terminal',
on the other I put the active shell to sleep with 'sleep 3000'.
--
Jan van den Broek                          balglaas@xs4all.nl

"There are only five great men in the world and three of them
are hamburgers" --- Don van Vliet

Report this thread to moderator Post Follow-up to this message
Old Post
Jan van den Broek
01-30-08 12:26 AM


Re: Using a c debugger with a curses program
On 26 Jan, 19:37, Ido Yehieli <Ido.Yehi...@gmail.com> wrote:
> it seems ddd doesn't work too well with programs using pdcurses (it
> kind of works for a short while and then crashes more often than not).
> Insight doesn't even manage to start my program before freezing.
>
> Does anyone have any idea on how to use a debugger under these
> circumstances? Compiling my program to use ncursese instead of
> pdcurses doesn't seem to help much either.
>
> -Ido.

The difficulties you are having demonstrate the benefits of separating
GUI logic from business logic. They allow the 2 to be tested
independently. And I strongly suspect that the error is NOT in curses.

I recommend doing this split then writing a test program that tests
the business logic in isolation. That will be alot easier to run using
ddd.

Regards,

Andrew Marlow

Report this thread to moderator Post Follow-up to this message
Old Post
apm35@student.open.ac.uk
01-30-08 01:23 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:04 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.