diff options
| author | Tom Tromey <tromey@adacore.com> | 2025-12-03 07:07:20 -0700 |
|---|---|---|
| committer | Tom Tromey <tromey@adacore.com> | 2026-01-09 08:37:27 -0700 |
| commit | 793593eb34eaf5b26eb4d6d79b31d26c418f3d7c (patch) | |
| tree | da7669280eefc9bef9ff8efeece38aa63808546b /gdb/python | |
| parent | b824d8db3621bbb29e1bef508dd72a91b1bfbe02 (diff) | |
| download | binutils-793593eb34eaf5b26eb4d6d79b31d26c418f3d7c.tar.gz binutils-793593eb34eaf5b26eb4d6d79b31d26c418f3d7c.tar.bz2 binutils-793593eb34eaf5b26eb4d6d79b31d26c418f3d7c.zip | |
Allow DAP client to set Ada source charset at launch
A co-worker reported that certain symbols weren't appearing in the DAP
'scopes' response. In particular, symbols with non-ASCII names didn't
appear; though further research showed that this was in fact a result
of the variable in question actually being a constant.
Unfortunately Ada still requires the user to set the Ada source
character set in order to properly display symbol names. For DAP, it
seemed to make sense to allow this as a launch parameter. This patch
implements this.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'gdb/python')
| -rw-r--r-- | gdb/python/lib/gdb/dap/launch.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/python/lib/gdb/dap/launch.py b/gdb/python/lib/gdb/dap/launch.py index 6867258b486..6fde3396ee9 100644 --- a/gdb/python/lib/gdb/dap/launch.py +++ b/gdb/python/lib/gdb/dap/launch.py @@ -80,12 +80,15 @@ def launch( env: Optional[Mapping[str, str]] = None, stopAtBeginningOfMainSubprogram: bool = False, stopOnEntry: bool = False, + adaSourceCharset: Optional[str] = None, **extra, ): # Launch setup is handled here. This is done synchronously so # that errors can be reported in a natural way. @in_gdb_thread def _setup_launch(): + if adaSourceCharset is not None: + exec_and_log("set ada source-charset " + adaSourceCharset) if cwd is not None: exec_and_log("cd " + cwd) if program is not None: @@ -132,11 +135,14 @@ def attach( program: Optional[str] = None, pid: Optional[int] = None, target: Optional[str] = None, + adaSourceCharset: Optional[str] = None, **args, ): # The actual attach is handled by this function. @in_gdb_thread def _do_attach(): + if adaSourceCharset is not None: + exec_and_log("set ada source-charset " + adaSourceCharset) if program is not None: file_command(program) if pid is not None: |
