Bug 17203 - It should be an error to register a pre-existing parameter.
Summary: It should be an error to register a pre-existing parameter.
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: guile (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-27 04:38 UTC by Doug Evans
Modified: 2024-01-19 12:27 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Doug Evans 2014-07-27 04:38:23 UTC
It should be an error to register a pre-existing parameter.

E.g., one can't extend a native gdb parameter.
And changing the meaning/operation of a pre-existing parameter will just confuse users.

I'm not sure Python parameters can be fixed, but Guile parameters can be before 7.8 goes out.
Comment 1 Joel Brobecker 2014-07-28 13:30:11 UTC
Hi Doug,

How long do you think before we have a fix for this?
Comment 2 Doug Evans 2014-07-28 14:30:12 UTC
(In reply to Joel Brobecker from comment #1)
> Hi Doug,
> 
> How long do you think before we have a fix for this?

Patch is posted here:
https://sourceware.org/ml/gdb-patches/2014-07/msg00690.html

It can be checked in today IMO.
Comment 3 brobecker 2014-07-28 14:35:11 UTC
> Patch is posted here:
> https://sourceware.org/ml/gdb-patches/2014-07/msg00690.html
> It can be checked in today IMO.

Awesome! We don't need to rush this patch just because of the release,
but I think I will create the release as soon as this one is in.
Thanks, Doug.
Comment 4 Doug Evans 2014-07-28 14:50:26 UTC
On a related topic,

One thing I'd like to add is the ability to export native gdb parameters to Scheme.
One reason is I'd like to write a function that executes a gdb command with a parameter temporarily set to a specified value.  In order to easily do that, i.e., without having to have a lot of parameter-specific code, I want to be able to read and write parameters from Scheme and not using gdb set/show commands.
Implementing this will involve a bit of work for parameters that post-process writes.

The point of noting this here is that in this case we're not registering a new parameter (using the parlance of "register-parameter!"), just exporting to Scheme an existing one.
Comment 5 Sourceware Commits 2014-07-29 02:28:30 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  7ebdbe9292e4b696740b021938369adb1484da27 (commit)
      from  385f635ae0be0077dad606c12118bbe0f886f28f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7ebdbe9292e4b696740b021938369adb1484da27

commit 7ebdbe9292e4b696740b021938369adb1484da27
Author: Doug Evans <xdje42@gmail.com>
Date:   Mon Jul 28 19:20:30 2014 -0700

    PR guile/17203
    
    	* guile/scm-param.c (pascm_parameter_defined_p): New function.
    	(gdbscm_register_parameter_x): Call it.  Raise error for pre-existing
    	parameters.
    
    	testsuite/
    	* gdb.guile/scm-parameter.exp: Add tests for trying to create
    	previously existing parameter, and previously ambiguously spelled
    	parameter.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                             |    7 +++++++
 gdb/guile/scm-param.c                     |   27 ++++++++++++++++++++++++++-
 gdb/testsuite/ChangeLog                   |    7 +++++++
 gdb/testsuite/gdb.guile/scm-parameter.exp |   28 ++++++++++++++++++++++++++++
 4 files changed, 68 insertions(+), 1 deletions(-)
Comment 6 Hannes Domani 2024-01-19 12:27:59 UTC
(In reply to Sourceware Commits from comment #5)
> This is an automated email from the git hooks/post-receive script. It was
> generated because a ref change was pushed to the repository containing
> the project "gdb and binutils".
> 
> The branch, master has been updated
>        via  7ebdbe9292e4b696740b021938369adb1484da27 (commit)
>       from  385f635ae0be0077dad606c12118bbe0f886f28f (commit)
> 
> Those revisions listed above that are new to this repository have
> not appeared on any other notification email; so we list those
> revisions in full, below.
> 
> - Log -----------------------------------------------------------------
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;
> h=7ebdbe9292e4b696740b021938369adb1484da27
> 
> commit 7ebdbe9292e4b696740b021938369adb1484da27
> Author: Doug Evans <xdje42@gmail.com>
> Date:   Mon Jul 28 19:20:30 2014 -0700
> 
>     PR guile/17203
>     
>     	* guile/scm-param.c (pascm_parameter_defined_p): New function.
>     	(gdbscm_register_parameter_x): Call it.  Raise error for pre-existing
>     	parameters.

Can this be closed?