This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATH RFA] Avoid Cannot read 0x20000000 on cygwin GDB
- To: Pierre Muller <muller at cerbere dot u-strasbg dot fr>
- Subject: Re: [PATH RFA] Avoid Cannot read 0x20000000 on cygwin GDB
- From: Michael Snyder <msnyder at redhat dot com>
- Date: Wed, 27 Sep 2000 12:08:15 -0700
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Red Hat, Inc.
- References: <200009121311.PAA17053@cerbere.u-strasbg.fr>
The patch looks harmless to me. I suggest checking it
in and see if anything breaks.
Michael
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