This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Support of gdb for Windows 64 native systems
- From: Christopher Faylor <cgf-use-the-mailinglist-please at sourceware dot org>
- To: Pedro Alves <pedro_alves at portugalmail dot pt>, gdb-patches at sourceware dot org
- Date: Sun, 14 Oct 2007 18:16:03 -0400
- Subject: Re: Support of gdb for Windows 64 native systems
- References: <20071013024116.GB29152@adacore.com> <uk5prl27s.fsf@gnu.org> <20071013154715.GE29152@adacore.com> <4711021C.8010805@portugalmail.pt> <20071013205105.GA13789@adacore.com> <47114BB7.1000501@portugalmail.pt> <20071014051622.GC13789@adacore.com> <471200C5.6050609@portugalmail.pt> <20071014173921.GD11619@ednor.casa.cgf.cx> <471259B2.6050808@portugalmail.pt>
On Sun, Oct 14, 2007 at 07:02:26PM +0100, Pedro Alves wrote:
> Christopher Faylor wrote:
>>> + flags = DEBUG_ONLY_THIS_PROCESS;
>>> + toexec = exec_file;
>> This doesn't seem right. You moved this setting outside of an if block
>> and didn't accommodate the else condition.
>
> I didn't move it. The if inside the __CYGWIN__ block sets TOEXEC in both
> branches.
I'm talking about "flags".
> Here is rest of the hunk:
>>> +
>>> +#ifdef __CYGWIN__
>>> if (!useshell)
>>> {
>>> - flags = DEBUG_ONLY_THIS_PROCESS;
>>> cygwin_conv_to_win32_path (exec_file, real_path);
>>> toexec = real_path;
>>> }
>>> @@ -1784,6 +1798,7 @@ win32_create_inferior (char *exec_file,
>>> toexec = shell;
>>> flags = DEBUG_PROCESS;
>>> }
>>> +#endif
>
> This is what the resulting code looks like after the patch is applied:
>
> flags = DEBUG_ONLY_THIS_PROCESS;
> toexec = exec_file;
>
> #ifdef __CYGWIN__
> if (!useshell)
> {
> cygwin_conv_to_win32_path (exec_file, real_path);
> toexec = real_path;
> }
> else
> {
> char *newallargs;
> sh = getenv ("SHELL");
> if (!sh)
> sh = "/bin/sh";
> cygwin_conv_to_win32_path (sh, shell);
> newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file)
> + strlen (allargs) + 2);
> sprintf (newallargs, " -c 'exec %s %s'", exec_file, allargs);
> allargs = newallargs;
> toexec = shell;
> flags = DEBUG_PROCESS;
> }
> #endif
>
> It could be changed into:
>
> #ifdef __CYGWIN__
> ...
> #else
> toexec = exec_file;
> #endif
>
> I prefer how it is now, but I'll respect your decision.
>
>>> +#ifdef __CYGWIN__
>>> add_setshow_boolean_cmd ("shell", class_support, &useshell, _("\
>>> Set use of shell to start subprocess."), _("\
>>> Show use of shell to start subprocess."), NULL,
>>> NULL,
>>> NULL, /* FIXME: i18n: */
>>> &setlist, &showlist);
>>> +#endif
>>>
>>> add_setshow_boolean_cmd ("cygwin-exceptions", class_support,
>>> &cygwin_exceptions, _("\
>>> Break when an exception is detected in the Cygwin DLL itself."), _("\
>> Seems like the above should be ifdef'ed too.
>
> Not sure why. The cygwin1.dll dll detection doesn't depend on any host
> habilities. Having a mingw hosted gdb be able to attach to a cygwin
> executable, and being able to debug it, seems useful. I imagine that
> it might prove useful to have a gdb that doesn't link to cygwin1.dll
> as a resort into debugging Cygwin issues.
There should be no cygwin accommodations in a pure windows port of gdb.
cgf