[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim-dev
Subject:    Re: VimGDB and ifndef HAVE_SELECT
From:       XavierDeGaye () netscape ! net (Xavier de Gaye)
Date:       2004-05-26 13:23:59
Message-ID: 4DDA6F0F.26DAA084.4959BA7A () netscape ! net
[Download RAW message or body]


On 5/13/2004 Malte Neumann wrote:
On Thu, May 13, 2004 at 09:48:01AM -0400, Xavier de Gaye wrote:
> [...]
> > a) In mch_call_shell() after line 3521 (so it's more clear, I am
> > using line numbers from the original Vim62 os_unix.c file, not the
> > patched one):
> > 
> >         _exit(EXEC_FAILED);     /* exec failed, return failure code */
> >     }
> >     else            /* parent */
> >     {
> >         /*
> >          * While child is running, ignore terminating signals.
> >          */
> > 3521 -->    catch_signals(SIG_IGN, SIG_ERR);
> > 
> > add at line 3522 after catch_signals():
> > 
> > 3522 -->    signal(SIGCHLD, SIG_IGN);
> 
> Congratulations!! This works fine, expect for a minor draw back.  When
> opening a file, before displaying the file, vim says:
> 

After setting SIGCHLD to SIG_IGN at line 3522 above, vim (not gvim)
executes _ONLY_ the following lines before SIGCHLD is set
back again to gdb_catch_sigchld() in set_signals():

        while (wait_pid != pid)
        {
        wait_pid = wait(&status);
        if (wait_pid <= 0 && errno == ECHILD)
            break;
        }

        /*
         * Set to raw mode right now, otherwise a CTRL-C after
         * catch_signals() will kill Vim.
         */
        if (tmode == TMODE_RAW)
        settmode(TMODE_RAW);
        did_settmode = TRUE;
-->     set_signals();  <-- SIGCHLD back to gdb_catch_sigchld()


What do the man pages say about the argument to wait(), is it a
pointer to an int ?

Does gcc give any warning on these lines when compiling os_unix.c ?

With the fix in line 3522 above, can you have two GDB consecutive
sessions within the same VimGDB session ?
    use the GDB "quit" command, to end the current GDB session: this
    will test VimGDB's handling of waitpid().

Ah, and also another check we have not made yet:
    remove line 3522 above
    replace gdb_sigchld() contents in gdb.c with just one
    statement:
    return FALSE;
    does it crash ?



> [...]
> Ok. I didn't try <CTRL-Z>.  But it works, when in the input-window, <CTRL-Z>
> interrupts the gdb command.
> [...]

You can also type <CTRL-Z> from anywhere, not only the input-window, when
gdb_mappings.vim has been sourced and mappings toggled with <F7>.



> [...]
> > e) Does the input-line window works: to test that, run twice the GDB
> > "file" command on the same file, you get:
> > 
> >     Load new symbol table from "foobar"? (y or n)
> > 
> > and the input-line window _MUST_ pop up.
> 
> The input-line window DOES pop up, but when entering y and <ENTER> the
> window closes and nothing happens. After that gdb is again busy. 
> 
> interrupting gdb after that, the symbols are loaded.


Do you have 'y' echoed after the prompt (y or n) ?
    (gdb) file foobar
    Load new symbol table from "foobar"? (y or n) y
        Reading symbols from foobar...done.
    (gdb)


Another test is to "define" a sequence of commands, like this:

(gdb) define foobar
  Type commands for definition of "foobar".
  End with a line saying just "end".
>print anything
>end
(gdb)

Does this work ?


Try please, to prevent commands from being discarded and remove
"GDB busy: command discarded, please retry" messages:
in gdb.c: in gdb_docmd() comment out 5 lines:

    /* accept one cmd at a time, allow intr */
    if (cmd != NULL && *cmd != NUL && *(cmd + STRLEN(cmd) - 1) == KEY_INTERUPT)
    this->oob.state |= OS_INTR;
/* COMMENT OUT THESE 5 LINES
 *   else if (this->oob.state & OS_CMD)
 *   {
 *  give_warning("GDB busy: command discarded, please retry", TRUE);
 *  return;
 *   }
 * END COMMENT OUT THESE 5 LINES */
    else
    this->oob.idx = -1; /* needed when last oob was aborted with OS_QUITs */
    this->oob.state |= OS_CMD;

Does this change anything in the previous tests ?


Xavier...



__________________________________________________________________
Introducing the New Netscape Internet Service. 
Only $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need. 

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic