Maker Pro
Maker Pro

OT Xpost: A C++ debugger for/with GUI

R

Rich Grise

Jan 1, 1970
0
crossposted to sci.electronics.design,alt.os.linux.slackware
please manage followups intelligently, thanks.

Kinda OT for either group, but these two are my primary hangouts,
because as we all know this is where the smart people are, and I'm
hoping some of it might rub off. ;-) Anyway, the reason for
the post is that I've decided to take on learning C++ so I can
either get in on some Linux CAD development or write one of my
own, using what's probably going to be OpenCascade.
http://www.opencascade.org.

Well, I've finally studied enough C++ that I can read the source
files and tell what does which and who goes where, mostly. I
can run one of their demos - actually, a couple of them, which
are very, very rudimentary - I can put a box and a cylinder
on a window by command line, and I can start their GUI demo,
which is one empty form with default menus.

So, I'm sitting here, scratching my butt, thinking, since
I've looked at QT enough to figure out that it's just an
interface, I'll still have to learn C++, that I'd like to
load up their gui demo and incorporate their point-by-point
demo, and I'll be able to draw pictures and stuff. It'll
still take some reading to figure out how to generate QT
..ui and .pro files from existing programs, and I thought,
the ideal thing would be a source-level debugger, where I
could just step through the thing and watch what happens
when it does, for example,
---------------------
int main ( int argc, char* argv[] )
{
QApplication a( argc, argv );

QString resDir = ApplicationWindow::getResourceDir();

QTranslator strTrans( 0 );
strTrans.load( "string.qm", resDir );
a.installTranslator( &strTrans );

QTranslator iconTrans( 0 );
iconTrans.load( "icon.qm", resDir );
a.installTranslator( &iconTrans );

QObject::connect( &a, SIGNAL( lastWindowClosed() ), &a,
SLOT( quit() ) );

ApplicationWindow* mw = new ApplicationWindow();
mw->setCaption( QObject::tr( "TIT_SAMPLE" ) );
mw->setIcon( QPixmap( resDir + QString( "/" ) +
QObject::tr( "ICON_SAMPLE" ) ) );
mw->show();

return a.exec();
}
-------------
I can see what happens when it does these operations. What's
really tantalizing is that this is clearly done in Qt, and it
came from OpenCascade. So maybe if I just tell it to load it
up, I'll be able to see. Maybe I should check QT and see if it's
got a debugger, which I was going to do anyway, but wanted to
come and crow about
1) I'm gonna RTFM
B: I actually know what all this stuff means!

Cheers!
Rich
 
R

Rich Grise

Jan 1, 1970
0
[message snipped]
strace. God!

$strace run.sh | wc
[much stuff, like
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
stat64("/usr/local/OpenCASCADE5.2/samples/tutorial/Linux/bin/Tutorial",
{st_mode=S_IFREG|0777, st_size=259814, ...}) = 0
rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0
]
421 2293 24914
rich@entheos:/usr/local/OpenCASCADE5.2/samples/tutorial/src
$
-----------

That's a lot of stuff to go through. I'll go see what Qt has to say.

Cheers!
Rich
 
D

Dan Mills

Jan 1, 1970
0
Rich Grise wrote:

<Of QT CAD development>

Check out Qcad if 2d only is acceptable....
..ui and .pro look to me like the files for qtdesigner and qmake
respectively. This should be installed as part of the QT development kit
but I found it to be slightly buggy and prone to corrupt its own XML
files.....

Regards, Dan.
 
R

Rich Grise

Jan 1, 1970
0
Rich Grise wrote:

<Of QT CAD development>

Check out Qcad if 2d only is acceptable....
.ui and .pro look to me like the files for qtdesigner and qmake
respectively. This should be installed as part of the QT development kit
but I found it to be slightly buggy and prone to corrupt its own XML
files.....
A .pro file is a "project" file in QT - QT creates it when you create a
new project. A .ui file (I think the ui is "user interface") is more or
less a description of a form, with its widgets and stuff. This gets
created by putting stuff in the app window and like that. Then qmake
takes these files and creates header files - maybe it's .ui.h - I haven't
done it much; I'd have to check. What I'd like to see an easy way to do
would be something like reverse compiling - go through the cpp and h files
that the app has, and figure out what kind of .pro and .ui files would
result in that via qmake. The purpose of this would be to run it under
QT, for example in "preview" mode.

I think I mentioned I tried strace, and that gives me a billion system
calls before the app even gets loaded! Then it's real hard to use the
console of the app you're stracing, since as soon as you hit a key,
there are about a hundred system calls (that it reports) scrolling
by until it's ready for the next key, and so on.

So I'd like to see some kind of high-level debugger. I guess I'll
go poke around in kdevelop docs and stuff.

Thanks!
Rich
 
Top