On Sun, 17 Jun 2001, Shlomi Fish wrote:
> > (gdb) print open("/dev/tty4", 0) /* '0' stands for O_RDONLY */
> > $ = 4
> > (gdb) print dup2(4, 0);
> > $ = 0
> > (gdb) print open("/dev/tty4", 01) /* '01' stands for O_WRONLY */
> > $ = 5
> > (gdb) print dup2(5, 1);
> > $ = 0
> > (gdb) print dup2(5, 2);
> > $ = 0
>
> Wait a second - will gdb call functions for me if I do that with print()
> and not with its call command? I don't know what to think of this feature.
what do you _want_ to think about tihs feature? its very useful, when you
want to properly print out the return value of a function call, for
example, so you can use it later on.
> It could be dangerous because I can mess things with a simple print. But
> it's probabably handier than call().
anything you do inside a debugger could be dangerous. if its a
time-critical program, just the fact that you've attached a debugger to
it, could make it crash, lose data or kill the mission to mars (if you
happen to be debugging the PathFinder ;) ).
--
guy
"For world domination - press 1,
or dial 0, and please hold, for the creator." -- nob o. dy
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]