This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [PATH RFA] Avoid Cannot read 0x20000000 on cygwin GDB


Thanks!  This error has always bugged me.  Your patch looks correct to
me but I don't know if it is valid for other platforms although I
suspect it is.

cgf

On Tue, Sep 12, 2000 at 03:00:03PM +0200, Pierre Muller wrote:
>
>  Very often I get 
>Cannot read memory at 0x2000000 
>when I try to do a backtrace in GDB compiled for Cygwin.
>
>  0x20000000 is the address of the minimal symbol  __size_of_stack_reserve__
>but the corresponding memory is not commited (at least not
>as long as the stack is not allmost full).
>
>  When trying to backtrace on a level where the code is inside a DLL
>(for instance the Cygwin DLL) without symbols, and at an adress higher than
>0x20000000, the function get_pc_function_start () returns that value.
>This comes from the fact that minimal symbols have no size and that one 
>has the highest value.
>
>  The code to check for the function prologue then fails because this address
>is not valid.
>
>  I don't know if the same kind of trouble can appear on other targets,
>but the patch should be harmless in other cases.
>
>
>ChangeLog entry:
>
>2000-09-12 Pierre Muller <muller@ics.u-strasbg.fr>
>   * blockframe.c (get_pc_function_start): return 0 if the minimal symbol
>found is not
>      inside a section.
>
>
>Index: blockframe.c
>===================================================================
>RCS file: /cvs/src/src/gdb/blockframe.c,v
>retrieving revision 1.7
>diff -b -c -r1.7 blockframe.c
>*** blockframe.c	2000/09/01 23:39:11	1.7
>--- blockframe.c	2000/09/12 12:51:00
>***************
>*** 556,561 ****
>--- 556,563 ----
>    else if ((msymbol = lookup_minimal_symbol_by_pc (pc)) != NULL)
>      {
>        fstart = SYMBOL_VALUE_ADDRESS (msymbol);
>+       if (!find_pc_section (fstart))
>+         return 0;
>      }
>    else
>      {
>
>
>PS: I didn't recieve any reaction to patch 5 and 6 for pascal support!
>
>PPS: I am currently writing hardware watchpoint support for Cygwin via Page
>protections,
>it basically works except that I get troubles when the page protection is
>triggered inside a system DLL code.
>
>
>
>Pierre Muller
>Institut Charles Sadron
>6,rue Boussingault
>F 67083 STRASBOURG CEDEX (France)
>mailto:muller@ics.u-strasbg.fr
>Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99

-- 
cgf@cygnus.com                        Cygnus Solutions, a Red Hat company
http://sourceware.cygnus.com/         http://www.redhat.com/

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