From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ECDAF3858C53; Mon, 31 Jul 2023 16:43:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ECDAF3858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690821825; bh=43rMv6tx/QEBxGVJyoFqTFR0gWXG44IXOivmMr1gZOg=; h=From:To:Subject:Date:From; b=WZnu57VAxV7daVWUNWMmyIrUcUCWcz1utKSQZ/wfhx6buHoEWqSbh06NzEf6TOT/I AxgXwpwk0ZA0vsro8KkYW0HSa+A21X/hVqwBKtMO4NSTFlWA8dcADl7RabtlCmQOdc Sp2iCWcGRefcL/S8akI/13464JkhGvLMI4W7Ghtg= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug dap/30708] New: [gdb/dap] DAP support and python 3.4 Date: Mon, 31 Jul 2023 16:43:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: dap X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter 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=3D30708 Bug ID: 30708 Summary: [gdb/dap] DAP support and python 3.4 Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: dap Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- I ran the gdb.dap tests on a system with python 3.4, and ran into a couple = of syntax error issues, which are fixed by: ... diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py index 27745eb..a6465e2 100644 --- a/gdb/python/lib/gdb/dap/breakpoint.py +++ b/gdb/python/lib/gdb/dap/breakpoint.py @@ -199,7 +199,7 @@ def _rewrite_src_breakpoint( condition: Optional[str] =3D None, hitCondition: Optional[str] =3D None, logMessage: Optional[str] =3D None, - **args, + **args ): return { "source": source["path"], @@ -238,7 +238,7 @@ def _rewrite_fn_breakpoint( name: str, condition: Optional[str] =3D None, hitCondition: Optional[str] =3D None, - **args, + **args ): return { "function": name, @@ -267,7 +267,7 @@ def _rewrite_insn_breakpoint( offset: Optional[int] =3D None, condition: Optional[str] =3D None, hitCondition: Optional[str] =3D None, - **args, + **args ): # There's no way to set an explicit address breakpoint from # Python, so we rely on "spec" instead. @@ -300,7 +300,7 @@ def _catch_exception(filterId, **args): elif filterId =3D=3D "exception": cmd =3D "-catch-exception" else: - raise Exception(f"Invalid exception filterID: {filterId}") + raise Exception("Invalid exception filterID: %s" % filterId) result =3D gdb.execute_mi(cmd) # A little lame that there's no more direct way. for bp in gdb.breakpoints(): @@ -323,7 +323,7 @@ def _rewrite_exception_breakpoint( filterId: str, condition: Optional[str] =3D None, # Note that exception breakpoints do not support a hit count. - **args, + **args ): return { "filterId": filterId, diff --git a/gdb/python/lib/gdb/dap/evaluate.py b/gdb/python/lib/gdb/dap/evaluate.py index 63e8033..9622f3c 100644 --- a/gdb/python/lib/gdb/dap/evaluate.py +++ b/gdb/python/lib/gdb/dap/evaluate.py @@ -95,7 +95,7 @@ def eval_request( expression: str, frameId: Optional[int] =3D None, context: str =3D "variables", - **args, + **args ): if context in ("watch", "variables"): # These seem to be expression-like. ... But then we run into the use of module typing, which is available starting version 3.5. Commit 510586589e7 ("Add type-checking to DAP requests") says: ... I've tried to make this code compatible with older versions of Python, but I've only been able to try it with 3.9 and 3.10. ... Its use is extensive: ... breakpoint.py:21:from typing import Optional, Sequence evaluate.py:19:from typing import Optional launch.py:19:from typing import Mapping, Optional, Sequence locations.py:19:from typing import Optional typecheck.py:20:import typing ... Maybe we should just require a higher python version for dap? --=20 You are receiving this mail because: You are on the CC list for the bug.=