Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-15817: gdbinit: Document commands after defining them #15021

Merged
merged 1 commit into from
Sep 9, 2019
Merged

bpo-15817: gdbinit: Document commands after defining them #15021

merged 1 commit into from
Sep 9, 2019

Conversation

The-Compiler
Copy link
Contributor

@The-Compiler The-Compiler commented Jul 30, 2019

The gdb manual says the following for "document":

The command commandname must already be defined.

And indeed when trying to use the gdbinit file with gdb 8.3, I get:

.../cpython/Misc/gdbinit:17: Error in sourced command file:
Undefined command: "pyo". Try "help".

Fix this by moving all documentation blocks after the define blocks.

This was introduced in GH-6384 (cc @smontanaro / @abalkin).

(Note that the diff algorithm gets a bit confused by those changes - try running git diff --histogram for a more understandable output. Also, note I took the freedom to re-use the issue number of the original implementation, hope that's okay.)

https://bugs.python.org/issue15817

The gdb manual[1] says the following for "document":

  The command commandname must already be defined.

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Define.html

And indeed when trying to use the gdbinit file with gdb 8.3, I get:

  .../cpython/Misc/gdbinit:17: Error in sourced command file:
  Undefined command: "pyo".  Try "help".

Fix this by moving all documentation blocks after the define blocks.

This was introduced in GH-6384.

(Note that the diff algorithm gets a bit confused by those changes - try running
git diff --histogram for a more understandable output)
Copy link
Member

@ammaraskar ammaraskar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can recreate this issue on GDB 7.7.1 and this patch fixes the problem. I'm guessing the patch was tested on an old version of gdb that didn't require the command to exist.

Long term, I question the utility of maintaining the gdbinit file considering it was broken for a year and no one complained.

@zware
Copy link
Member

zware commented Sep 7, 2019

I trust @ammaraskar's review of this; @smontanaro, @abalkin, I'll merge this tomorrow if you don't object before then.

@zware zware merged commit 1f86fdc into python:master Sep 9, 2019
@zware
Copy link
Member

zware commented Sep 9, 2019

Thank you for the patch, @The-Compiler, and thanks for the review @ammaraskar!

@miss-islington
Copy link
Contributor

Thanks @The-Compiler for the PR, and @zware for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @The-Compiler and @zware, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 1f86fdcfc57270ee569cc58269a4e08afe7608ec 3.8

zware pushed a commit to zware/cpython that referenced this pull request Sep 9, 2019
…onGH-15021)

The gdb manual[1] says the following for "document":

  The command commandname must already be defined.

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Define.html

And indeed when trying to use the gdbinit file with gdb 8.3, I get:

  .../cpython/Misc/gdbinit:17: Error in sourced command file:
  Undefined command: "pyo".  Try "help".

Fix this by moving all documentation blocks after the define blocks.

This was introduced in pythonGH-6384.
(cherry picked from commit 1f86fdc)

Co-authored-by: Florian Bruhin <me@the-compiler.org>
@bedevere-bot
Copy link

GH-15744 is a backport of this pull request to the 3.8 branch.

zware added a commit that referenced this pull request Sep 9, 2019
…5021) (#15744)

The gdb manual[1] says the following for "document":

  The command commandname must already be defined.

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Define.html

And indeed when trying to use the gdbinit file with gdb 8.3, I get:

  .../cpython/Misc/gdbinit:17: Error in sourced command file:
  Undefined command: "pyo".  Try "help".

Fix this by moving all documentation blocks after the define blocks.

This was introduced in GH-6384.
(cherry picked from commit 1f86fdc)

Authored-by: Florian Bruhin <me@the-compiler.org>
@The-Compiler The-Compiler deleted the fix-gdbinit branch September 9, 2019 11:16
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
…5021)

The gdb manual[1] says the following for "document":

  The command commandname must already be defined.

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Define.html

And indeed when trying to use the gdbinit file with gdb 8.3, I get:

  .../cpython/Misc/gdbinit:17: Error in sourced command file:
  Undefined command: "pyo".  Try "help".

Fix this by moving all documentation blocks after the define blocks.

This was introduced in pythonGH-6384.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…5021)

The gdb manual[1] says the following for "document":

  The command commandname must already be defined.

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Define.html

And indeed when trying to use the gdbinit file with gdb 8.3, I get:

  .../cpython/Misc/gdbinit:17: Error in sourced command file:
  Undefined command: "pyo".  Try "help".

Fix this by moving all documentation blocks after the define blocks.

This was introduced in pythonGH-6384.
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
…5021)

The gdb manual[1] says the following for "document":

  The command commandname must already be defined.

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Define.html

And indeed when trying to use the gdbinit file with gdb 8.3, I get:

  .../cpython/Misc/gdbinit:17: Error in sourced command file:
  Undefined command: "pyo".  Try "help".

Fix this by moving all documentation blocks after the define blocks.

This was introduced in pythonGH-6384.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants