From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8517 invoked by alias); 17 Jan 2020 07:46:27 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 8509 invoked by uid 89); 17 Jan 2020 07:46:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=kabatsayev, Kabatsayev, H*f:sk:CAHEcG9, H*MI:sk:CAHEcG9 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Jan 2020 07:46:16 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1isMKc-0006oE-Ko; Fri, 17 Jan 2020 02:46:14 -0500 Received: from [176.228.60.248] (port=4206 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1isMKa-0000J0-5k; Fri, 17 Jan 2020 02:46:14 -0500 Date: Fri, 17 Jan 2020 07:46:00 -0000 Message-Id: <83imla34qm.fsf@gnu.org> From: Eli Zaretskii To: Ruslan Kabatsayev CC: luis.machado@linaro.org, gdb@gnu.org In-reply-to: (message from Ruslan Kabatsayev on Thu, 16 Jan 2020 23:00:04 +0300) Subject: Re: How to set a breakpoint on imported Win32 function? References: <4d48b93e-6ae7-2f27-1b2e-9e06899bec6d@linaro.org> <98c5e02a-9310-268d-3a0f-abe71b2dd47f@linaro.org> <83o8v32r4a.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00029.txt.bz2 > From: Ruslan Kabatsayev > Date: Thu, 16 Jan 2020 23:00:04 +0300 > Cc: Luis Machado , gdb@gnu.org > > > If I start a MinGW program under GDB, and then put a breakpoint on > > ExitProcess, I get this: > > > > Temporary breakpoint 2, main (argc=2, argv=0xa42848) at emacs.c:934 > > 934 bool no_loadup = false; > > (gdb) break ExitProcess > > Breakpoint 3 at 0x7c81bfa7 > > (gdb) info breakpoints > > Num Type Disp Enb Address What > > 3 breakpoint keep y 0x7c81bfa7 > > > > So it seems that GDB already knows how to put breakpoints on such > > functions: you just need to name them without the DLL-name part. > > However, I'm not sure I understand what is meant above by "functions > > imported by name". How exactly were they imported? Does the above > > technique work for you? > > They were imported as named functions usually are, i.e. not by > ordinal. I just said this to emphasize that GDB should be able to find > these symbols. Doesn't the fact that "break ExitProcess" works mean GDB _is_ able to find the symbol? Maybe I'm missing something, but I always considered the "KERNEL32!" part some kind of decoration, not really part of the symbol.