From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by sourceware.org (Postfix) with ESMTPS id 395B73857C4D for ; Wed, 19 Aug 2020 13:05:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 395B73857C4D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x441.google.com with SMTP id r15so11543703wrp.13 for ; Wed, 19 Aug 2020 06:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cEto1Uh34dXjrGIxCbPH7xEkBYYFdVRI64S18Pyco3A=; b=P5V0mSV+Wl0hPlk5uWsjFCIH4Cin4uisHkK/Px02ukBemrpA1mv+eS6GWf6oevhg+b a/ajSxyuPks6Ekr2/MANeuW40kBLs8HN7aNp3mz78lVgTazUNyji9Fb1uKdZvLW+K1z1 7zZ8AAve26iH0nA9a7nlQzyM+D8IHKw0LwIIrdDrDyM3Nk3/K+q4EYtVEdozVw5TORm+ 8jZfFRSgHbI4mw7pkxBwigbfYuQSJrOAd7gSFZhX2sUT8pGxUa8zADm+xhe30nqIeePc KHlqAAfiLV/Y4IVV1yDUWqfTe+gMuiLKnCrxr+HOdCB+Y/7abvUSoEya5Qn+ifEvOwPw f70g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cEto1Uh34dXjrGIxCbPH7xEkBYYFdVRI64S18Pyco3A=; b=PAGByNdulyrmwFH+9JtgQOj4sGoa6cUEJV8ZGUI6UGbea+fCql76tIGElZhTzHEiyU C7NKB96XxjKChbrpMCugdbbFxgjUzzkBlPq3zTvWCxhB3+sge34QsptGxQEAi9UKVjlV YLWp2q5KYKKk4j3yJdGTf+rjJAXRvMz0Lib9gLNdt8xeaGRNkWxHucwiaFtOmO7u/DPx BFKRvzwdCFSyaZ1YsmT6m5XL2zoq6Fhbksu7fYfUuNgSS1/7pa0gOY2O29PU1UHyWOMU ybUqn2vInmnqq2eWD33pavHvmmhYIQ+KNXMM+ybK4RazRvQhYBVeYcFUprHQy/+MoBbF ZXMw== X-Gm-Message-State: AOAM533BIe1QOyvCpvVG0v5OOzjGJPAKOR255kR/T74A28fXjQRq6TwE 5pXN2EcJfNH5etVzv+7Z9nYv+7+INFL0zw== X-Google-Smtp-Source: ABdhPJyWopM0WvagP73Szw+7/hMFWLmQRvqEjTpbQcTlQj4kp/b+ydeKXKj56/DdxXIIjJS1Pis6vg== X-Received: by 2002:adf:c108:: with SMTP id r8mr4164185wre.350.1597842327243; Wed, 19 Aug 2020 06:05:27 -0700 (PDT) Received: from localhost (host86-130-161-98.range86-130.btcentralplus.com. [86.130.161.98]) by smtp.gmail.com with ESMTPSA id 33sm42109697wri.16.2020.08.19.06.05.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 06:05:26 -0700 (PDT) Date: Wed, 19 Aug 2020 14:05:25 +0100 From: Andrew Burgess To: Tom Tromey Cc: "Sharma, Alok Kumar" , "George, Jini Susan" , "Achra, Nitika" , "gdb-patches@sourceware.org" Subject: Re: [PATCH] Fix for incorrect breakpoint set in case of flang compiled binary Message-ID: <20200819130525.GM853475@embecosm.com> References: <87pn7puhbs.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pn7puhbs.fsf@tromey.com> X-Operating-System: Linux/5.6.15-200.fc31.x86_64 (x86_64) X-Uptime: 14:01:41 up 31 days, 22:16, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2020 13:05:30 -0000 * Tom Tromey [2020-08-17 14:51:19 -0600]: > >>>>> ">" == Sharma, Alok Kumar writes: > > >> + || startswith(COMPUNIT_PRODUCER(cust), " F90 Flang")))) > > Space before "(". > > Does it really start with a space? That seems weird. > > >> # Check if not allocated VLA in type does not break > >> # the debugger when accessing it. > >> -gdb_breakpoint [gdb_get_line_number "before-allocated"] > >> -gdb_continue_to_breakpoint "before-allocated" > >> +# break main for Flang compiler already breaks here > > Do you know why? The line marked 'before-allocated' is the first line that should be considered after the prologue. Due to GCC not really marking the end of prologue correctly we rely on the prologue scanner for GCC, while for Flang we can use the line table to spot the end of prologue. On Flang this leaves us in the correct place, the 'before-allocated' line. On GCC the prologue scanner aborts early because the prologue contains a small control flow loop to initialise some of the local variables. As a result on GCC we stop part way through the prologue. We could improve the prologue scanner to handle this case on GCC, but that's obviously a separate issue. ... or GCC could start marking the end of prologue. Thanks, Andrew