Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Danny Backx <danny.backx@scarlet.be>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Patch : gdbserver get_image_name on CE
Date: Sun, 14 Jun 2009 09:48:00 -0000	[thread overview]
Message-ID: <1244972893.20290.71.camel@pavilion> (raw)
In-Reply-To: <1244969225.20290.59.camel@pavilion>

On Sun, 2009-06-14 at 10:47 +0200, Danny Backx wrote:
> On Sat, 2009-06-13 at 19:05 +0100, Pedro Alves wrote:
> > > 2. Handle a case where the inferior refuses to start. See the
> > >    code after WaitForDebugEvent in win32-low.c .
> > 
> > This is quite mystifying.  Do you have more details on this?
> 
> Not yet, but as I said in the other message, the a simple setjmp demo
> application is an example. Other cases I've seen were with invalid
> requirements to a DLL (use of an API that was not in the DLL). On a
> PocketPC, this causes a dialog to pop up. On Windows Embedded CE the
> application appears just not to start up.
> 
> > > 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.

Therefore, an application that tries to fetch it from the DLL will
simply not start up.

I've looked at the gdbserver code. The only two reasons I see for using
setjmp/longjmp are :
- to call kill_inferior () if you're beyond some point
- to end up at the "restart:" point

I see three options :
- write a setjmp replacement, put it in utils.c, and leave the rest of
  the code as is.
- 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.

A final note : detecting this situation automatically at configure time
is not obvious because of the cross-compile.

Opinions ?

	Danny
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


  reply	other threads:[~2009-06-14  9:48 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-13 14:29 Danny Backx
2009-06-13 18:05 ` Pedro Alves
2009-06-13 18:08   ` Pedro Alves
2009-06-14  8:35     ` Danny Backx
2009-06-14 13:56       ` Pedro Alves
2009-06-14  8:47   ` Danny Backx
2009-06-14  9:48     ` Danny Backx [this message]
2009-06-14 14:23       ` Pedro Alves
2009-06-21  9:50         ` Danny Backx
2009-06-30 21:07           ` Danny Backx
2009-06-30 21:56             ` Pedro Alves
2009-07-01 18:41               ` Danny Backx
2009-07-01 18:52                 ` Pedro Alves
2009-07-01 19:12                   ` Danny Backx
2009-07-01 20:12                 ` Pedro Alves
2009-07-04 18:14                   ` Pedro Alves
2009-07-08  9:55                     ` Danny Backx
2009-07-08 11:34                       ` Danny Backx
2009-07-27 20:40                         ` Danny Backx
2009-07-01 19:31               ` Danny Backx
2009-06-14 14:34       ` Pedro Alves
2009-06-14 14:05     ` Pedro Alves
  -- strict thread matches above, loose matches on Subject: below --
2009-06-07  9:18 Danny Backx
2009-06-07 17:03 ` Pedro Alves
2009-06-07 18:02   ` Danny Backx
2009-06-07 18:15     ` Pedro Alves
2009-06-07 19:13       ` Danny Backx
2009-06-07 19:28         ` Pedro Alves
2009-06-08 18:13           ` Danny Backx
2009-06-12 22:18       ` Danny Backx
2009-06-13  6:28         ` Johnny Willemsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1244972893.20290.71.camel@pavilion \
    --to=danny.backx@scarlet.be \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox