This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] Remove unused extension_language_defn argument to "virtual" functions


Hi,

Doug's patch which added the extension language API is awesome.  I am
tempted to say that it can serve as a great entry point for someone
trying to understand GDB internals.

While trying to add my debug methods patch to the API, I have noticed
that all "virtual" functions in the API are having an unused argument
which is a pointer to their extension_language_defn.  This seems a bit
odd to me conceptually as a virtual function serving a language should
know about its language! I could be missing something here and
completely wrong about my understanding.  But, I have gone ahead and
prepared a patch which removes the extension_language_defn arguments
which are unused anyway. I could successfully build and test all the
Python tests with the patch applied.

2014-02-06  Siva Chandra Reddy  <sivachandra@google.com>

        * auto-load.h (auto_load_gdb_scripts_enabled): Remove unused arg
        EXTLANG.
        * auto-load.c (auto_load_gdb_scripts_enabled): Remove unused arg
        EXTLANG.
        (auto_load_objfile_script_1) Do not pass unused arg LANGUAGE to
        sourcer.
        * cli/cli-cmds.c (source_script_from_stream): Do not pass unused
        arg EXTLANG to sourcer.
        * extension-priv.h: Remove extension language argument of all
        "virtual" functions.
        * extension.h: Likewise.
        * extension.c: Remove extension language argument from all
        virtual function definitions and invocations.
        * python/py-auto-load.c: Likewise.
        * python/py-breakpoint.c: Likewise.
        * python/py-framefilter.c: Likewise.
        * python/py-prettyprint.c: Likewise.
        * python/py-value.c: Likewise.
        * python/python.c: Likewise.
        * python/python-internal.h: Remove extension language argument
        from all virtual function declarations.

Attachment: remove_unused_arg_patch_v1.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]