From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20271 invoked by alias); 26 Nov 2012 04:04:24 -0000 Received: (qmail 20263 invoked by uid 22791); 26 Nov 2012 04:04:23 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_FC,TW_YM X-Spam-Check-By: sourceware.org Received: from mail-pa0-f41.google.com (HELO mail-pa0-f41.google.com) (209.85.220.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Nov 2012 04:04:17 +0000 Received: by mail-pa0-f41.google.com with SMTP id bj3so3649747pad.0 for ; Sun, 25 Nov 2012 20:04:16 -0800 (PST) Received: by 10.66.79.72 with SMTP id h8mr29128301pax.49.1353902656721; Sun, 25 Nov 2012 20:04:16 -0800 (PST) Received: from [192.168.1.128] ([115.193.207.197]) by mx.google.com with ESMTPS id sy1sm8010664pbc.66.2012.11.25.20.04.13 (version=SSLv3 cipher=OTHER); Sun, 25 Nov 2012 20:04:15 -0800 (PST) Message-ID: <50B2EAC7.6080502@gmail.com> Date: Mon, 26 Nov 2012 04:04:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0a1 MIME-Version: 1.0 To: Pierre Muller CC: gdb-patches@sourceware.org Subject: Re: [RFC-v4] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior) References: <834nm07z0s.fsf@gnu.org> <5077FEB9.4030304@redhat.com> <83y5jb7rfe.fsf@gnu.org> <006001cdaada$00c81f00$02585d00$@muller@ics-cnrs.unistra.fr> <20121024194517.GK3555@adacore.com> <011901cdb2ab$48076b90$d81642b0$@muller@ics-cnrs.unistra.fr> <20121105171121.GA2972@adacore.com> <50991f5f.8382440a.1100.ffff82abSMTPIN_ADDED@mx.google.com> <509ABA17.30507@redhat.com> <000301cdbd96$f5cd9f10$e168dd30$@muller@ics-cnrs.unistra.fr> <20121122173019.GF9964@adacore.com> <15690.5992342674$1353883881@news.gmane.org> In-Reply-To: <15690.5992342674$1353883881@news.gmane.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00638.txt.bz2 On 2012-11-26 6:50, Pierre Muller wrote: > I attach a new version of my patch to > cope with variable offset of .text section for Windows OS DLL's. > > I hope I have taken all advices of Joel in account. > In fact, I was unable to satisfy one suggestion... > See below, the answer about my lack of C knowledge. > > > Hoping we are getting closer... > > Pierre Muller > gdb crash here, see the Backtrace: (gdb) file cmd.exe Reading symbols from E:\code\cb\test_code\gdbpython-demo\bin\cmd.exe...done. (gdb) r Starting program: E:\code\cb\test_code\gdbpython-demo\bin\cmd.exe [New Thread 63092.0xf220] warning: HEAP[gdbcvs26.exe]: warning: Invalid Address specified to RtlFreeHeap( 00290000, 04C58028 ) Program received signal SIGTRAP, Trace/breakpoint trap. 0x7c90120f in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll (gdb) bt #0 0x7c90120f in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll #1 0x7c96ee31 in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\system32\ntdll.dll #2 0x7c96f26e in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\system32\ntdll.dll #3 0x7c970456 in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\system32\ntdll.dll #4 0x7c94bafc in ntdll!LdrFindEntryForAddress () from C:\WINDOWS\system32\ntdll.dll #5 0x00290000 in ?? () #6 0x7c91a1ba in ntdll!RtlpUnWaitCriticalSection () from C:\WINDOWS\system32\ntdll.dll #7 0x77c2c2de in msvcrt!free () from C:\WINDOWS\system32\msvcrt.dll #8 0x00290000 in ?? () #9 0x004a10dd in do_my_cleanups (pmy_chain=0x4c58020, old_chain=0x4c58020) at ../../gdb/gdb/cleanups.c:155 #10 0x00536102 in read_pe_exported_syms (objfile=0x4bf9008) at ../../gdb/gdb/coff-pe-read.c:595 #11 0x00535158 in coff_symtab_read (objfile=0x4bf9008, nsyms=0, symtab_offset=) at ../../gdb/gdb/coffread.c:1127 #12 coff_symfile_read (objfile=0x4bf9008, symfile_flags=8) at ../../gdb/gdb/coffread.c:610 #13 0x004d39e3 in syms_from_objfile (objfile=0x4bf9008, addrs=, offsets=0x0, num_offsets=0, add_flags=8) at ../../gdb/gdb/symfile.c:999 #14 0x004d3ce0 in symbol_file_add_with_addrs_or_offsets ( abfd=, add_flags=8, addrs=0x4bef518, flags=, parent=0x0, num_offsets=0, offsets=0x0) at ../../gdb/gdb/symfile.c:1105 #15 0x005c27a7 in solib_read_symbols (so=0x30055c8, flags=8) at ../../gdb/gdb/solib.c:608 #16 0x005c2bda in solib_add (pattern=0x0, from_tty=0, target=0x96dfa0 , readsyms=1) at ../../gdb/gdb/solib.c:919 #17 0x004dfa5e in post_create_inferior (target=0x96dfa0 , from_tty=0) at ../../gdb/gdb/infcmd.c:477 #18 0x004dfc0c in run_command_1 (args=0x0, from_tty=, tbreak_at_main=) at ../../gdb/gdb/infcmd.c:631 #19 0x005ad435 in execute_command (p=0x294331 "", from_tty=1) at ../../gdb/gdb/top.c:491 #20 0x004fd7b6 in command_handler (command=0x294330 "") at ../../gdb/gdb/event-top.c:429 #21 0x004fdf63 in command_line_handler (rl=0x2f98a28 " ") at ../../gdb/gdb/event-top.c:630 #22 0x005debd1 in rl_callback_read_char () at ../../gdb/readline/callback.c:220 #23 0x004fd828 in rl_callback_read_char_wrapper (client_data=0x0) at ../../gdb/gdb/event-top.c:163 #24 0x004fcb24 in handle_file_event (data=...) at ../../gdb/gdb/event-loop.c:827 #25 0x004fcab3 in process_event () at ../../gdb/gdb/event-loop.c:401 #26 process_event () at ../../gdb/gdb/event-loop.c:351 #27 0x004fce35 in gdb_do_one_event () at ../../gdb/gdb/event-loop.c:465 #28 0x004fcf8c in start_event_loop () at ../../gdb/gdb/event-loop.c:490 #29 0x004f7762 in captured_command_loop (data=0x0) at ../../gdb/gdb/main.c:256 #30 0x004f64cb in catch_errors (func=0x4f7750 , func_args=0x0, errstring=0x735b8d <__PRETTY_FUNCTION__.12478+107> "", mask=6) at ../../gdb/gdb/exceptions.c:546 #31 0x004f8266 in captured_main (data=0x2a6fee0) at ../../gdb/gdb/main.c:1032 #32 0x004f64cb in catch_errors (func=0x4f7910 , func_args=0x2a6fee0, errstring=0x735b8d <__PRETTY_FUNCTION__.12478+107> "", mask=6) at ../../gdb/gdb/exceptions.c:546 #33 0x004f8850 in gdb_main (args=0x2a6fee0) at ../../gdb/gdb/main.c:1041 #34 0x006d0218 in main (argc=1, argv=0x293ea0) at ../../gdb/gdb/gdb.c:34 (gdb)