From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2F244384D3E0; Sat, 10 Dec 2022 12:23:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F244384D3E0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670675038; bh=JZWW/BdDztz0aTBVXBL7HMDfd7/Bz7qwex2y+oyxLuE=; h=From:To:Subject:Date:From; b=NHZVoPuqneDhFFv8odN5eKikLTT8qdyotxaGo4L6xlOgGbRbdAjYGP8fCSHYCRCtt mROxanOwrrd8b61EWDE50d8f5rYS8D6F6fXCxGm0v5vNEBJue7+yza4YMyvi6Qgzxi SU6XhrS4n+Zqn2h1/OCopmvwTTESj2gaJJ5N5L74= From: "vapier at gentoo dot org" To: gdb-prs@sourceware.org Subject: [Bug sim/29869] New: sim: align sim register numbers with gdb register numbers Date: Sat, 10 Dec 2022 12:23:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: sim X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vapier at gentoo dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: vapier at gentoo dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29869 Bug ID: 29869 Summary: sim: align sim register numbers with gdb register numbers Product: gdb Version: unknown Status: NEW Severity: normal Priority: P2 Component: sim Assignee: vapier at gentoo dot org Reporter: vapier at gentoo dot org CC: vapier at gentoo dot org Target Milestone: --- it would be good if we aligned sim register numbers with gdb's register num= bers (as used in the default remote serial protocol). this has a number of benefits: * if/when we add RSP support to the sim, gdb/debuggers would "just work" wi= th it * we can delete the set_gdbarch_register_sim_regno logic from gdb * we don't need to hand maintain the include/sim/sim-* register lists (as we can generate them from gdb xml files) some architectures already have aligned their register numbers, so there's = no diff to them. for others, this would represent an ABI break. sim.h provid= es sim_fetch_register & sim_store_register APIs, and the sim register numbers = are used with those. changing the enum/constants obviously requires a recompil= e.=20 i don't think this is a problem because: * we already need to do ABI breaks to fix 64-bit address handling (current = ABI is limited to 32-bit) * we'll need to break again to expose multicpu * libsim is only statically linked into programs (we don't provide a shared= lib yet) * for the gdb<->sim interface, since the GNU sim is bundled+linked in to gd= b, we don't have to worry about old/new version skews of gdb/sim * i'm not aware of anyone using the sim reg numbers outside of the GNU sim,= and i don't think gdb even supports that if they tried while we shouldn't trash the API needlessly, i think atm we have so many shortcomings that we shouldn't bend over backwards to maintain support. we could support gdb's Target Description Format where the sim would genera= te an XML document on the fly describing its arches/registers/etc... and thus avoid the register remapping, but i think we should break anyways. gdb doe= sn't require XML support be enabled which means it'll still fallback to classic hardcoded register numbers. https://sourceware.org/gdb/onlinedocs/gdb/Target-Description-Format.html#Ta= rget-Description-Format --=20 You are receiving this mail because: You are on the CC list for the bug.=