This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch : gdbserver get_image_name on CE


On Sunday 14 June 2009 09:34:41, Danny Backx wrote:

> Your comment about I need to address the setjmp issue is correct. I need
> to find the cause though. This part of the patch certainly doesn't
> belong in gdb's sources. 

> But it's still in discussion phase, isn't it ? 

It sure is.

> More comments ? Should the INT3 comment go away ? I feel that the code
> is under-commented at times, but this one may be somewhat overdone :-)

Yes.  int3 is the standard x86 breakpoint op.  It is the same on
Windows9x/NT, on linux (see linux-x86-low.c), and pretty much
every x86 OS.  win32-i386-low.c just didn't register a breakpoint 
instruction because Windodws gdbserver itself didn't need to insert
breakpoints (gdb takes care of regular user breakpoints by issuing
regular memory reads/writes)  --- on desktop Windows, the OS always
reports a magic "initial breakpoint hit" after reporting all threads and
dlls loaded in the process.  On Windows CE however, we fake it ourselves.
That's this code in win32-low.c:

...
#ifdef _WIN32_WCE
      if (!attaching)
	{
	  /* Windows CE doesn't set the initial breakpoint
	     automatically like the desktop versions of Windows do.
	     We add it explicitly here.	 It will be removed as soon as
	     it is hit.	 */
	  set_breakpoint_at ((CORE_ADDR) (long) current_event.u
			     .CreateProcessInfo.lpStartAddress,
			     auto_delete_breakpoint);
	}
#endif

...

#ifdef _WIN32_WCE
      /* Remove the initial breakpoint.  */
      check_breakpoints ((CORE_ADDR) (long) current_event
			 .u.Exception.ExceptionRecord.ExceptionAddress);
#endif

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]