From patchwork Sat Nov 8 01:56:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 3621 Received: (qmail 2862 invoked by alias); 8 Nov 2014 01:57:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 2566 invoked by uid 89); 8 Nov 2014 01:57:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f202.google.com Received: from mail-ie0-f202.google.com (HELO mail-ie0-f202.google.com) (209.85.223.202) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 08 Nov 2014 01:56:53 +0000 Received: by mail-ie0-f202.google.com with SMTP id tr6so921418ieb.5 for ; Fri, 07 Nov 2014 17:56:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:subject:in-reply-to :references; bh=4j3ntrP3qKwEcVIeP1RMFTtyqOyyHOdDyU2XF7YiqKg=; b=mW4QBoSLP8N8HNHjvHSBx5Tjh0LrPI4BFfLPOmG587HhbkIHRNSwPAXn8EfDGLrPda EDE39T0TEKmI1OTkxpfqippamXBr4KkDwq5Qd6s/+fJ5vQEN/ce7XsxTIZl4UKa0Q+HQ IIKbvbeZEPLNJ8Nd3XCzNUO3sHefG8/kFEYXfblUnfjCRGNYKNaJ6itAusZj8Bg/q3a1 CrcYxPqpRlZHNTe3JTa+YELtTQ4Cak2A60osufcTEPxnvk870MhxIQAEqHYIEg6LCmMz scaMLQRiUXSruhh4xVD3vSL+L1onNHGDs0PVpGrEcWof+hqlKruIXjgc95WxKTZuqH4m GFRQ== X-Gm-Message-State: ALoCoQlceIpzwazGdIoDhF6Kk68W0nXXd4mI+76esI6exYgg1Fv/TNp4/y5eq0vt3EYk3cS3TcaFpjLM/2kcSbxLAksg8LZ5f3iwZ6rUQ6x7ZwDbKtBjp/tS7vCNr2ibQxJhIo+nSb7KldbqmqxT0LoYu3yxnsl+tW76aY6sOVLCL1xENcZ65xc= X-Received: by 10.182.72.163 with SMTP id e3mr12416182obv.27.1415411811143; Fri, 07 Nov 2014 17:56:51 -0800 (PST) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id s23si440112yhf.0.2014.11.07.17.56.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Nov 2014 17:56:51 -0800 (PST) Received: from ruffy2.mtv.corp.google.com ([172.17.128.107]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id LMMSfDAJ.1; Fri, 07 Nov 2014 17:56:50 -0800 From: Doug Evans MIME-Version: 1.0 Message-ID: <21597.30817.910963.546392@ruffy2.mtv.corp.google.com> Date: Fri, 7 Nov 2014 17:56:49 -0800 To: palves@redhat.com, uweigand@de.ibm.com, gdb-patches@sourceware.org Subject: Re: [PATCH] create_internal_breakpoint: Apply gdbarch_skip_entrypoint. In-Reply-To: References: X-IsSubscribed: yes Doug Evans writes: > Hi. > > In glibc, _dl_debug_state is usually defined like this: > > void > _dl_debug_state (void) > { > } > > and thus on powerpc64le-linux this function does not require a TOC register. > > [...] > ... > -3 shlib events keep y 0x00003fffb7fd8e40 <__GI__dl_debug_state> inf 1 > ... > [...] > ... > -3 shlib events keep y 0x0000100000020e48 <__GI__dl_debug_state+8> inf 1 For completeness sake, You can also see the difference in the "shlib events" breakpoint, but with _ovly_debug_state you can run it for yourself without having to hack glibc. There was a cut-n-paste error in the patch. Fixed below. 2014-11-07 Doug Evans * breakpoint.c (create_internal_breakpoint): Apply gdbarch_skip_entrypoint if it's defined. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index bd51f5d..1b5cf5f 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3306,6 +3306,9 @@ create_internal_breakpoint (struct gdbarch *gdbarch, init_sal (&sal); /* Initialize to zeroes. */ + if (gdbarch_skip_entrypoint_p (gdbarch)) + address = gdbarch_skip_entrypoint (gdbarch, address); + sal.pc = address; sal.section = find_pc_overlay (sal.pc); sal.pspace = current_program_space;