From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id F41AB385840F for ; Fri, 3 Sep 2021 14:31:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F41AB385840F Received: by mail-pj1-x1033.google.com with SMTP id w19-20020a17090aaf9300b00191e6d10a19so4019461pjq.1 for ; Fri, 03 Sep 2021 07:31:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iWCYnDaDUFnr3VQUowGHcnBQirnL2ggju+srFDa9ZhM=; b=YdGgZylxcbE7eIFl76WKaU0fhXYLDYNb1dZN+Xopymlyin3CuTrLwbcPmKGYfOP5HK 2zSrjEMVNb4Gvp4BQ22gZVaNICF/ayZvmbgSIOcHNNqIqSCW5GURRymXiwgkqOtGmvrQ 9l3pQSFyvsgnULM1O+AuHAqpcwifUz5v5wAhydU4VHK7sSAocgVXMvcawPnqScvb0DjV z2zqe6L572BbLH07+JS9RLe2OUDcUpHHfW5Enjncl85rpnMsLmtkDCZAGK15u1g45tUi 1C4g/GRUDt9g3uULKP/Ee1rCg22V7pzSRviS2rsgPuqOr1AZEyF2XkOGavbaxgXaJJyD SSGQ== X-Gm-Message-State: AOAM533p5zWkDnq6Jf4uywx/RCAKSrnerWOyXDKj39Ox4pHgL3WKvPEn 37VCjEbjm/1C2lLy6SadHSVGv310GtexZB7F5yofPEgx9nKngg== X-Google-Smtp-Source: ABdhPJww5i79i12O5uztnbWRWbRNDAFw9lBU2NDuCe465D2D95+zEGNFZorI79FGWTQvq0Ia1k0RM68DETj9Da3RU/Y= X-Received: by 2002:a17:902:aa86:b029:116:3e3a:2051 with SMTP id d6-20020a170902aa86b02901163e3a2051mr3230595plr.38.1630679495185; Fri, 03 Sep 2021 07:31:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Matt Rice Date: Fri, 3 Sep 2021 14:31:24 +0000 Message-ID: Subject: Re: Disambiguating symbols by module To: Alexander Miloslavskiy Cc: GDB Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Sep 2021 14:31:37 -0000 On Thu, Sep 2, 2021 at 8:48 PM Alexander Miloslavskiy via Gdb wrote:0x00007ffff6d7a3b0 > > Hello, >0x00007ffff6d7a3b0 > I spend much time debugging Java with GDB. > > In order to obtain current Java callstack, I do this: > (gdb) call (void)ps() > > The problem is, the function's name is too short and gdb confuses it > with a variable in a different library: > > (gdb) info var ^ps$ > File ../../cipher/blowfish.c: > 256: static const u32 ps[18]; > > (gdb) info function ^ps$ > Non-debugging symbols: > 0x00007ffff6d7a3b0 ps > > Here, the symbol I want is a non-debugging symbol. This also means that > I can't disambiguate it by the source file name. > > Is there a syntax to disambiguate the symbol? Been a while since I've needed to do this, but IIRC you can just set a breakpoint using the symbol address too, like: (gdb) break *0x00007ffff6d7a3b0 I don't know of or believe there is any nicer syntax like object_file.o:symbol_name, which one could imagine might be possible.