This is the mail archive of the
mailing list for the GDB project.
Re: Patch : gdbserver get_image_name on CE
On Sunday 14 June 2009 10:48:13, Danny Backx wrote:
> > > > 3. Setjmp won't work on this platform, I've "#if 0"-ed it out.
> > > > Clearly not the right solution. Comment please.
> > >
> > > What does "won't work on this platform" mean? If longjmp
> > > doesn't work, then you probably have a bug in your
> > > headers or import libs? I'd suspect _JBLEN in the
> > > mingw headers.
> > I've been thinking about that too, I'll try to debug this but that's
> > hard with no debugger.
> The cause turns out to be the obvious one, if you read the above well.
> The setjmp call is documented on MSDN but my experiments show that the
> coredll.dll doesn't offer it on the platform I'm using.
Urgh. MSFT claims that setjmp/longjmp is deprecated and that we
should use SEH instead... sigh. This goes into the same dumb ideas
bucket as removing errno and any notion of cwd in Windows CE. But it
may we be in this case that this is the manufacturer of the device
stripping away optional functions that they think are unnecessary for
their product. Or this is a Windows Embedded profile thing? Is there
any Win32 API function similar to setjmp/longjmp we could use instead? Is
there any MSFT or vendor SDK for your device? Could you get the list of
functions exported by coredll.dll and friends and send them
privately to me?
> - remove setjmp/longjmp and just exit in that one place where longjmp
> is called
> - improve the code so errors are always treated well without relying
> on longjmp
> The last one is not something I'd like to start. My current code
> basically implements the second one, I'm not sure what would be going
> wrong if this would be implemented generally.
Read the code again. It is used in more cases than just exiting. In
any case, this would be going too far. Replacements or an alternative
similar mechanism is in order. Aren't you using the sjlj c++ exceptions
model? If so, you'll need to write setjmp/longjmp replacements
anyway. Maybe add them to libmingwex.a, and call them
mingw32ce_setjmp|mingw32ce_longjmp or something. Or maybe there's
some import library magic we could use to pick up replacements