Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Lerele <lerele@champenstudios.com>
To: Pedro Alves <pedro_alves@portugalmail.pt>
Cc: gdb-patches@sourceware.org
Subject: Re: [Patch] Win32 gdbserver new interrupt support, and attach to      process  fix.
Date: Tue, 06 Mar 2007 22:18:00 -0000	[thread overview]
Message-ID: <45EDE830.1080400@champenstudios.com> (raw)
In-Reply-To: <45EDD148.3090200@portugalmail.pt>

Pedro Alves wrote:

> Pedro Alves wrote:
>
>> What do you think of just suspending of thread, and setting a breakpoint
>> at the current PC, and resuming?
>>
>
> Errrh, don't even bother to answer this question.  This method is of 
> course very
> fallible. The thread may be blocked on IO or on a synchronization 
> object, which is
> common in windows code (waiting for events).  If the thread doesn't 
> get scheduled,
> the breakpoint won't be hit.  There may not be any thread that is a 
> got candidate
> for the breakpoint - like if you have all your threads either deadlock 
> or blocked.
> The beauty of injecting a remote thread, is that it stops all the 
> inferior threads atomically,
> with minimum interference.  That leaves:
>
Sorry for delay.
Also there's the problem you said on WinCE about not being able to write 
memory (flash/rom...)

> - ctrl-c event, which in some cases doesn't get through.
> - DebugBreakProcess, on XP and 2003 Server and emulating it on NT < 5 
> / Win9x/ME / CE
>  using code injection. One case where it could disturb the inferior 
> would be
>  when you can't debug a DllMain because of the CREATE_THREAD_EVENT that
>  this generates, or is there a way to inhibit its propagation?
> - 'suspend all threads manually, but no breakpoint' method.
>
I'd just leave the last option.
That's according with my personal preferences, for all advantages I 
wroite in previous messages.
Does WinCe have available Set/GetPriorityClass, SetProcessAffinityMask, 
SuspendThread, ResumeThread?
First two only work on some cases/win versions anyway.
However, gdb win32-nat is already done with first option if I remember 
right, so maybe there's a preference to keep it that way.
Also, about DllMain problem you say, I'd guess last option should also 
let you seamlessly debug DllMain without doing anything else (without 
having to disable breakpoints when doing an interrupt for instance 
--this would have to be done on client gdb side-- and even would 
introduce problems such as hitting a disabled-for-interrupt breakpoint 
when interrupt has not yet reached child).
I find last option better almost however you look at it, unless there's 
some other problem I'm not seeing... maybe having a trillion threads 
running or something?
Maybe writing down a pros/cons list could decide for itself.


>> What about using the version you sent (if approved), and then work on
>> this new version on top?  IMHO, it is better to have something working
>> first.  (I don't believe the extra thread makes a difference 
>> 99.999999999%
>> of the times.)
>
> This is still my opinion.
>
I agree. Keep working code, and work on other option(s).
Haven't had time to prepare the new patch. I hope I do will this week(end).




  reply	other threads:[~2007-03-06 22:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-23 23:52 Lerele
2007-02-24 12:07 ` Eli Zaretskii
2007-02-24 13:03   ` Lerele
2007-02-24 14:07     ` Eli Zaretskii
2007-02-24 15:23       ` Lerele
2007-02-24 19:10         ` Eli Zaretskii
2007-02-24 21:19         ` Pedro Alves
2007-02-24 21:44           ` Andreas Schwab
2007-02-24 23:35           ` Lerele
2007-02-25  0:15             ` Daniel Jacobowitz
2007-02-25  1:57             ` Pedro Alves
2007-02-25 22:46 ` Pedro Alves
2007-03-04 22:53   ` Lerele
2007-03-05  0:56     ` Pedro Alves
2007-03-05  1:21       ` Pedro Alves
2007-03-05 13:17       ` Lerele
2007-03-05 20:34         ` Lerele
2007-03-05 20:44         ` Pedro Alves
2007-03-06  0:04           ` Pedro Alves
2007-03-06 20:39           ` Pedro Alves
2007-03-06 22:18             ` Lerele [this message]
2007-03-06 23:22               ` Pedro Alves
2007-03-05 12:44     ` Daniel Jacobowitz
2007-03-05 20:30       ` Lerele

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=45EDE830.1080400@champenstudios.com \
    --to=lerele@champenstudios.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro_alves@portugalmail.pt \
    /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