#include <signal.h>
#include <sys/stat.h>
#include <sys/time.h>
+#include <assert.h>
#include "mi_gdb.h"
#ifndef TEMP_FAILURE_RETRY
***************************************************************************/
+char **mi_gdb_argv;
+void (*mi_gdb_start_hook) (mi_h *h);
+
mi_h *mi_connect_local()
{
mi_h *h;
argv[2]="--quiet";
argv[3]=disable_psym_search_workaround ? 0 : "--readnow";
argv[4]=0;
- execvp(argv[0],argv);
+ execvp(argv[0],mi_gdb_argv ? mi_gdb_argv : argv);
/* We get here only if exec failed. */
_exit(127);
}
mi_free_h(&h);
return NULL;
}
- /* Wait for the prompt. */
- mi_get_response_blk(h);
- /* Send the start-up commands */
- mi_send_commands(h,gdb_start);
+ if (mi_gdb_start_hook)
+ {
+ mi_gdb_start_hook (h);
+ assert (gdb_start == NULL);
+ }
+ else
+ {
+ /* Wait for the prompt. */
+ mi_get_response_blk(h);
+ /* Send the start-up commands */
+ mi_send_commands(h,gdb_start);
+ }
return h;
}