From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 685703858403; Sun, 26 Sep 2021 18:17:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 685703858403 From: "shivam98.tkg at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/28371] gdb: watchpoint for local variable doesn't work on RISC-V Date: Sun, 26 Sep 2021 18:17:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: shivam98.tkg at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Sep 2021 18:17:08 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28371 --- Comment #3 from shivam98.tkg at gmail dot com --- Many thanks for replying. I really forget the I should see the assembly generated by -S flag. Yeah, so correct It seems the problem was, RISCV target didn't implement the support for adding CFI (canonical frame information) instructions in the epilogue. Specifically, say the following instruction/directive is missing = in func and func2 functions - `.cfi_def_cfa %rsp, 8 `which is present in clang= x86 assembly. The support to inserts CFI instructions that set appropriate cfa offset(.cfi_def_cfa_offset) and cfa register(.cfi_def_cfa_register) should = be added in emitEpilogue() in RISCVFrameLowering- .https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/RISCV/RISCV= FrameLowering.cpp#L535 . I will see how other backends are doing this and what should be done in t= he RISCV case and try to fix it.=20 Thanks again. It saves a lot of effort for me. --=20 You are receiving this mail because: You are on the CC list for the bug.=