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] windows-nat.c: Fix offset problem in signal string handling


> Alternatively the call to string_to_core_addr could be replaced with a 
> call to `strtoull (p, NULL, 0)'.  Since this code is only supported on
> Cygwin, it's safe to assume that the strtoull function exists.

I would go for that option, mostly because you already use strtol
to parse the beginning of that string...

> Version 2:
> 
> 	* windows-nat.c (handle_output_debug_string): Replace call
> 	to string_to_core_addr with call to strtoull.
> 
> Index: windows-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/windows-nat.c,v
> retrieving revision 1.242
> diff -u -p -r1.242 windows-nat.c
> --- windows-nat.c	19 Mar 2013 15:06:26 -0000	1.242
> +++ windows-nat.c	19 Mar 2013 15:13:10 -0000
> @@ -978,7 +978,7 @@ handle_output_debug_string (struct targe
>  	  retval = strtoul (p, &p, 0);
>  	  if (!retval)
>  	    retval = main_thread_id;
> -	  else if ((x = (LPCVOID) string_to_core_addr (p))
> +	  else if ((x = (LPCVOID) strtoull (p, NULL, 0))
>  		   && ReadProcessMemory (current_process_handle, x,
>  					 &saved_context,
>  					 __COPY_CONTEXT_SIZE, &n)

-- 
Joel


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