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: [RFC] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior)


> From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
> Date: Mon, 15 Oct 2012 15:35:55 +0200
> 
>   After some investigation, I noticed that
> the minimal symbol GetLastError was offset by 0xf0000
> respective to the  '_imp__GetLastError@0'.
> 
>   The patch attached allowed me to call
> (gdb) call GetLastError ()
> And get a simple 
> $2 = 126
> (for instance, depending on when you do the call).

Thanks.

>   Could someone please test the patch and 
> confirm that it does fix the problem?

I will try that in a few days.

> +      if (!section_found)
> +	{
> +	  char * forward_name = (char *) (erva + func_rva);
> +	  char * funcname = (char *) (erva + name_rva);
> +          if ((func_rva >= export_rva) 
> +              && (func_rva < export_rva + export_size)) 
> +	  printf ("%s is a forward to %s\n", funcname, forward_name);

Is this printf really necessary?


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