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

Use the extended prompt. #25

Closed
wants to merge 22 commits into from
Closed

Conversation

bchretien
Copy link
Contributor

This should fix #19.

You can check the doc: https://sourceware.org/gdb/onlinedocs/gdb/Prompt.html
And the available escape sequences: https://sourceware.org/gdb/onlinedocs/gdb/gdb_002eprompt.html#gdb_002eprompt

We just need to find how to detect "versions of gdb that ship with Python scripting enabled": https://sourceware.org/gdb/current/onlinedocs/gdb/Python.html#Python

In a shell, it can be checked with:

$ gdb --configuration | grep "with-python"

In GDB:

show configuration
** or **
python print(sys.version)

So I guess this could be checked automatically. For now, a variable is set.

I think this is enabled by default on Linux, but probably not on Windows with MinGW. I don't know about Mac OS X.

dholm and others added 19 commits October 21, 2012 15:30
The old layout is difficult to maintain due to the size of gdbinit and the fact that it is difficult to identify various components. The file has now been broken up into multiple submodules which are loaded by the main gdbinit file. .gdb and .gdbinit has to be symbolically linked to the users home directory for this to work.
Reindented code so that every module follows the same syntax.
Attempt to autodetect the target architecture and set up the global flags accordingly. This will make it unneccessary to try to figure this out manually and hardcode the values in .gdbinit.
Restructures the architecture-specific code to never assume that a
certain architecture is being used. Adds a $MIPS global that when set to
1 identifies that the debugged target is MIPS.

Also breaks out the script for detecting a target and places it as a
bash-script in the .gdb-directory to make it easier to debug.
When passing an expression containing spaces as an argument to a GDB
command it will be interpreted as multiple arguments even when enclosed
in parentheses. In order to follow the general coding style these
arguments are broken out and set in local variables that are then
passed as arguments instead.
Having the ChangeLog in the .gdbinit-file now that it has been
modularized made little sense since the user will need a .gdb-directory
anyway. Moved the ChangeLog into a file of the same name and reflowed it
so that it can be read without going bonkers.
Since hooks are general and there might be commands defined in multiple
modules that need to install something into the same hook they have been
moved to the .gdbinit-file instead.
Updates the README to contain a list of contributors to gdbinit. Also
adds documentation on many of the commands that it defines.
Copy the solution used for mips to ensure that only registers that are valid
will be printed. I.e. if a register is set to "void" print zero instead of
bailing out.
The commands were a bit difficult to read, hopefully this will make the
documentation a little better.
Renames the GDB command files to separate them from the shell scripts
etc. Also, this makes it easier for the editor to figure out what
indentation, syntaxt highlighting etc to use.

Also renames the CPU-specific modules to cpu-<architecture>.gdb to make
it more obvious that they are submodules to cpu.gdb.
- the old `gdbinit-MacsBug-without-plugin` file that Apple ships with
their gdb
- the `kgmacros` that Apple ships with their kernel debug kit
found some more .gdb files in Apple's version of gdb
Unfortunately, gdb under Snow Leopard doesn't give a useful doublet.  So
let's go the extra step and grab the osabi and use it to determine what
processor we're using and the size.
…leopard

Attempt to detect the correct processor type under Snow Leopard's gdb.
@bchretien bchretien changed the title Use the extended-prompt. Use the extended prompt. Apr 17, 2014
@gdbinit
Copy link
Owner

gdbinit commented Apr 17, 2014

Humm... can't merge. That feature does not exist in OS X version :-(

@bchretien
Copy link
Contributor Author

@gdbinit GDB is not compiled with --with-python? What if we set the default value of $USEPYTHON to 0?

@gdbinit
Copy link
Owner

gdbinit commented Apr 17, 2014

No, Apple gdb version is too old and GNU version is not that great in OS X.
$USEPYTHON doesn't exist in Apple gdb so a test doesn't work there.

@bchretien
Copy link
Contributor Author

@gdbinit
Copy link
Owner

gdbinit commented Apr 17, 2014

Humm then there are no real advantages versus using COLOREDPROMPT option to fix this issue.

@bchretien
Copy link
Contributor Author

Well, using extended-prompt provides a simple way to fix some issues with the basic colored prompt (cf. #19). It's also more powerful. $COLOREDPROMPT can only be used to disable color in the prompt altogether: this is not fixing the bug, just hiding it by disabling one feature.

@bchretien
Copy link
Contributor Author

I forgot about this PR and ended up adding some unrelated commits to master on my fork, so I'm closing this. I'll make another one if this is deemed relevant later on.

@bchretien bchretien closed this Mar 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug with colored prompt
5 participants