public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@cygnus.com>
To: Ian Roxborough <irox@redhat.com>
Cc: <insight@sources.redhat.com>
Subject: Re: Stack Window Problem [was: Re: DLLs and Insight...]
Date: Thu, 01 Nov 2001 14:05:00 -0000	[thread overview]
Message-ID: <Pine.GSO.4.33.0111011344370.3461-100000@makita.cygnus.com> (raw)
In-Reply-To: <3BE036A6.DBBBB5E2@redhat.com>

Well, I've got a recent cygwin (1.3.4 DLL checked out yesterday) and a
relatively recent gdb (also from yesterday).

I run gdb on itself and I set a break at Tcl_Realloc. The stack is
immediately wrong. The SrcWin shows the right place, but the StackWin and
gdb show the wrong place:

(gdb) bt
#0  Tcl_Realloc (
    ptr=0x2679a0 "C:/cygwin/home/keiths/sources/gdb/built/H-i686-pc-cygwin/share
/tcl8.3 C:/cygwin/home/keiths/sources/gdb/built/H-i686-pc-cygwin/share/tcl8.3 C:
/cygwin/home/keiths/sources/gdb/built/share/tcl8.3 C:/cygw"..., size=800)
    at ../../../src/tcl/win/../generic/tclCkalloc.c:897
#1  0x10058d09 in Tcl_DStringSetLength (dsPtr=0x22f644, length=799)
    at ../../../src/tcl/win/../generic/tclUtil.c:1651
#2  0x10026a95 in DestroyButton ()
    at ../../../src/tcl/win/../generic/tclEncoding.c:986
#3  0x10028314 in ComputeArcBbox ()
    at ../../../src/tcl/win/../generic/tclEncoding.c:2744
#4  0x10026c0b in ConfigureButton ()
    at ../../../src/tcl/win/../generic/tclEncoding.c:1131
#5  0x005021b5 in gdbtk_init (
    argv0=0x22fd78 "/home/keiths/sources/gdb/built/H-i686-pc-cygwin/bin/gdb")
    at ../../src/gdb/gdbtk/generic/gdbtk.c:379
#6  0x00405783 in gdb_init (
    argv0=0x22fd78 "/home/keiths/sources/gdb/built/H-i686-pc-cygwin/bin/gdb")
    at ../../src/gdb/top.c:2055
#7  0x00401a35 in captured_main (data=0x22fd4c) at ../../src/gdb/main.c:460
#8  0x00402ae4 in do_catch_errors (uiout=0x5b0668, data=0x22fd0c)
    at ../../src/gdb/top.c:488
#9  0x0040294f in catcher (func=0x402ad0 <do_catch_errors>,
    func_uiout=0x5b0668, func_args=0x22fd0c, func_val=0x22fd04,
---Type <return> to continue, or q <return> to quit---
    func_caught=0x22fd08, errstring=0x4011a6 "", mask=6)
    at ../../src/gdb/top.c:420
#10 0x00402b23 in catch_errors (func=0x401350 <captured_main>,
    func_args=0x22fd4c, errstring=0x4011a6 "", mask=6)
    at ../../src/gdb/top.c:500
#11 0x00401fae in main (argc=1, argv=0x10281568) at ../../src/gdb/main.c:702
#12 0x61003f82 in dll_crt0_1 () at ../../../../src/winsup/cygwin/dcrt0.cc:769
#13 0x61004199 in _dll_crt0 () at ../../../../src/winsup/cygwin/dcrt0.cc:850
#14 0x610041d8 in dll_crt0 (uptr=0x0)
    at ../../../../src/winsup/cygwin/dcrt0.cc:862
#15 0x005ae0d3 in cygwin_crt0 ()
    at /cygnus/netrel/src/cygwin-1.3.3-2/winsup/cygwin/lib/cygwin_crt0.c:33

You can see right here that frame #2 is wrong. It should be:

(gdb) tk gdb_loc
../../../src/tcl/win/../generic/tclEncoding.c Tcl_UtfToExternalString /home/keiths/sources/gdb/net/tcl/win/../../../src/tcl/win/../generic/tclEncoding.c 986 0x10026a95 0x10010f68 {}

(gdb) p/x $pc
$1 = 0x10026a95
(gdb) info symbol 0x10026a95
DestroyButton + 173 in section .text
DestroyButton + 173 in section .text
(gdb) disas
Dump of assembler code for function DestroyButton:
0x100269e8 <DestroyButton>:           movl   $0x3,0xffffffec(%ebp)
...
0x10026b41 <Tcl_FindExecutable+81>:   lea    0xffffff20(%ebp),%esi
(gdb) disas Tcl_UtfToExternalDString
Dump of assembler code for function Tcl_UtfToExternalDString:
0x10026948 <Tcl_UtfToExternalDString>: push %ebp
...
0x100269e5 <Tcl_UtfToExternalDString+157>: lea  0xfffffff0(%ebp),%eax
0x100269e8 <DestroyButton>:            movl    $0x3,0xffffffec(%ebp)
...
0x10026ab1 <DestroyButton+201>:        ret
(gdb)

As you can see, the output is really messed up. The PC is clearly in
Tcl_UtfToExternalDString, yet gdb claims it is in DestroyButton.
Additionally gdb disassembles more than it should.

(gdb) info shared
/home/keiths/sources/gdb/built/H-i686-pc-cygwin/bin/cygtcl83.dll      10001000
/usr/bin/cygwin1.dll                                                  61001000
/cygdrive/c/WINNT/system32/kernel32.dll                               77e81000
/cygdrive/c/WINNT/system32/advapi32.dll                               77db1000
/cygdrive/c/WINNT/system32/rpcrt4.dll                                 77d41000
/cygdrive/c/WINNT/system32/user32.dll                                 77e11000
/cygdrive/c/WINNT/system32/gdi32.dll                                  77f41000
/home/keiths/sources/gdb/built/H-i686-pc-cygwin/bin/cygtix4183.dll    66601000
/home/keiths/sources/gdb/built/H-i686-pc-cygwin/bin/cygtk83.dll       00b11000
/cygdrive/c/WINNT/system32/comdlg32.dll                               76b31000
/cygdrive/c/WINNT/system32/shlwapi.dll                                70bd1000
/cygdrive/c/WINNT/system32/msvcrt.dll                                 78001000
/cygdrive/c/WINNT/system32/comctl32.dll                               71781000
/cygdrive/c/WINNT/system32/shell32.dll                                782f1000
/cygdrive/c/WINNT/system32/psapi.dll                                  690a1000

[Is msvcrt.dll allowed???]

If I have time to look at this, I will report my findings.
Keith


  parent reply	other threads:[~2001-11-01 14:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-23 10:20 DLLs and Insight Ian Roxborough
2001-10-23 10:27 ` Keith Seitz
2001-10-23 14:30   ` FYI: DLL breakpoint bug [was: Re: DLLs and Insight...] Ian Roxborough
2001-10-23 14:36     ` Keith Seitz
2001-10-23 14:59       ` Ian Roxborough
2001-10-23 15:05         ` Keith Seitz
2001-10-23 15:14           ` Ian Roxborough
2001-10-23 15:21             ` Keith Seitz
2001-10-23 15:33               ` Ian Roxborough
2001-10-24 13:33             ` Keith Seitz
2001-10-23 10:52 ` DLLs and Insight Fernando Nasser
2001-10-23 11:06 ` Christopher Faylor
2001-10-31  9:24   ` Stack Window Problem [was: Re: DLLs and Insight...] Ian Roxborough
2001-10-31 10:48     ` Fernando Nasser
2001-10-31 11:33       ` Ian Roxborough
2001-10-31 11:53         ` Christopher Faylor
2001-11-01 11:42         ` Fernando Nasser
2001-11-01 12:44           ` Ian Roxborough
2001-11-01 12:48             ` Keith Seitz
2001-11-01 13:01               ` Christopher Faylor
2001-11-01 13:20                 ` Ian Roxborough
2001-11-01 14:05     ` Keith Seitz [this message]
2001-11-01 15:08       ` Christopher Faylor
2001-11-01 15:41         ` Keith Seitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.33.0111011344370.3461-100000@makita.cygnus.com \
    --to=keiths@cygnus.com \
    --cc=insight@sources.redhat.com \
    --cc=irox@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).