Coder Social home page Coder Social logo

gdbinit's Introduction

Public repo for gdbinit

x86/x86_64 and ARM are supported simultaneously since version 8.0.

To make ARM the default CPU set the $ARM var to 1 or use the "arm" command to switch.

If you are a LLDB user this has been replaced with lldbinit. Same look, more features!

FEEDBACK: https://reverse.put.as - [email protected]

You should read the header of the script for important information regarding some Mac OS X/iOS gdb bugs.

Have fun,
fG!

gdbinit's People

Contributors

gdbinit avatar lakshayrohila avatar mheistermann avatar plouj avatar stalkr avatar tyilo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gdbinit's Issues

Adding a License file

Hi, under what license is this source code published? I don't see a license file which makes it tricky to get it approved for use at work.

set remotetimeout 1000

Hi,
setting

set remotetimeout 1000
from the gdb shell, it works.

If set inside .gdbinit, seems not.
The subsequent read_bank command fails for timeout.

Using gdb 12.1 built for arm (32bit) target

x/c does not work and add \n to the ascii_char function?

Hey,
Your gdbinit file is nice! Thx.
But I have a problem with it:

gdb$ x/x 0x80484c0
0x80484c0:  0x6c6c6548
gdb$ x/s 0x80484c0
0x80484c0:  "Hello World!"
gdb$ x/c 0x80484c0
0x80484c0:  0x48
gdb$ x/12c 0x80484c0
0x80484c0:  0x48    0x65    0x6c    0x6c    0x6f    0x20    0x57    0x6f
0x80484c8:  0x72    0x6c    0x64    0x21

x/c 0x80484c0 should show: 0x48 'H' ... where is the char output?
I can't find something about it in your config.

...........................................................................................................................

The second Issue:

gdb$ ascii_char 0x80484c0
Hgdb$ 
Hgdb$ 
Hgdb$ 

This is reallly ugly.. why no adding "\n"?

nice greetings from Germany and thx for your gdbinit 👍

Chris

A syntax error

Hello,

I am not sure if this is the proper place to post this but I will give it a show. I am trying to use this gdbinit file while debugging some fortran code compiled by gfortran. I have noticed that I receive an error for just about everything when using this file though. For instance, when there is a breakpoint or an error in the execution of the file being debugged I get the following error:

A syntax error in expression, near `= 1'.

After messing around it seems that the issue is in the comparisons within hook-stop and within context. As I commented out the if comparisons I was able to push the error from one if to the next (ie it went from "A syntax error in expression, near = 1'." to "A syntax error in expression, near> 0'." which is the next if statement;

Any clues as to why this is happening. I have checked that all of the variables are still active by calling printf "%i \n", $SHOW_CONTEXT and so on from within gdb and they are.

I am using gdb 7.7.1 on Mac OSX 10.9.3

Thanks for your help!

I will also paste this question to stack overflow

Is there a way to using gdbinit with symbols

I try to use gdbinit v0.8 to debug just like this:

$ gdb
gdb$ exec-file debugme
Reading symbols for shared libraries .... done
gdb$ strcpy_chk
Undefined command: "strcpy". Try "help".
gdb$ b main
Function "main" not defined.

Is there a way that I can debug executable with symbols and gdbinit?

'set logging {on,off}' are deprecated.

I am finding these two warnings when using the gdbinit file:

Warning: 'set logging on', an alias for the command 'set logging enabled', is deprecated.
Use 'set logging enabled on'.

Warning: 'set logging off', an alias for the command 'set logging enabled', is deprecated.
Use 'set logging enabled off'.

Both set logging {on,off} are deprecated.

Broken [regs] highlighting

On my system with gdb 13.2 on x86_64, the syntax highlighting on registers doesn't seem to work, I see what appear to be broken fragments of ANSI codes maybe?

Screenshot 2023-12-25 at 7 31 20 AM

I got one warning and one error

root@hacklab:/home/atmail# gdb -q

warning: ~/.gdbinit.local: No such file or directory
/root/.gdbinit:1876: Error in sourced command file:
Undefined command: "onditional". Try "help".


I got above message when I load .gdbinit
I working on armv7l system.

Option to switch $BLACK and $WHITE

Gdbinit currently references $BLACK three places, as $COLOR_REGVAL and two times in context, while $WHITE isn't used anywhere.

My terminals background color is black, so I can't see the black text without selecting it.

I propose you add an option (eg. $BLACK_BACKGROUND) which when set, switches $BLACK and $WHITE, so people with black terminals, can see the text.

gdbinit does not support gdb tui

gdb -tui
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
---Type to continue, or q to quit---
For help, type "help".
Type "apropos word" to search for commands related to "word".

warning: ~/.gdbinit.local: 没有那个文件或目录
^[[31mgdb$ ^[[0m

Documentation explaining the [regs] section

For those new to using gdb, some explanation of the variables of the "regs" section—e.g.:

-----------------------------------------------------------------------------------------------------------------------[regs]
  RAX: 0x0000000000400E70  RBX: 0x0000000000000000  RBP: 0x0000000000402F20  RSP: 0x00007FFFFFFFDB28  o d I t s Z a P c 
  RDI: 0x000000000000000D  RSI: 0x00007FFFFFFFDC08  RDX: 0x00007FFFFFFFDC78  RCX: 0x0000000000000020  RIP: 0x0000000000400E70
  R8 : 0x0000000000402F90  R9 : 0x00007FFFF7DE8770  R10: 0x000000000000013A  R11: 0x000000000000000C  R12: 0x00000000004012B0
  R13: 0x00007FFFFFFFDC00  R14: 0x0000000000000000  R15: 0x0000000000000000
  CS: 0033  DS: 0000  ES: 0000  FS: 0000  GS: 0000  SS: 002B

—would be helpful:

Bug with colored prompt

Hi!

I had the need to disable the colored prompt because of the following bug: using ctrl + A to go to the beginning of the line "fails" when using a colored prompt. It instead goes to an offsetted position (probably because of the color escape codes) and modifying the line becomes quite tedious. Then scrolling up to the previous command and down again to get an empty prompt also leads to an offsetted prompt that can't be fully erased:

gdb_bug_report

Sorry for the obfuscated description ;-) I don't know if this is easily soluble, but the least I could do was report it.

Provide a way to clean "history"

In my use case the "history" section usually gets so large after a while I can't see sections like "assembly" and "output/messages". Example:

gdbinit_history

If there's already a way for this then it should be mentioned somewhere -- although I don't where would be a good place.

Easier backtrace readability through colour

Firstly, thanks for this project.

I think the readability of backtraces could be greatly improved by using different colours for the different components of the outputs.

image

(Yes I am debugging a deadlock!)

I feel a little colour would break down the slab of text and clearly separate key features:

  • The primary function name in line
  • Argument lists within params
  • Source path and line number

It seems as though a regexp could be made for this purpose.

Allow level parameter in frame

GDB frame command can simultaneously select the stack level and display the frame.

This patch does the same:

define frame
    if $argc == 1
        select-frame $arg0
    end
    info frame
    info args
    info locals
end
document frame
Syntax: frame <LEVEL>
| Print current stack frame, or the LEVEL stack frame.
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.