summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2024-11-11 22:04:12 -0500
committerAlan Wu <[email protected]>2024-11-11 22:24:32 -0500
commitc028bf0c7b97584bd4d104375b3f12aa55c240f9 (patch)
tree44ef2470cdedd5296befee5210fb08147e5ca7ab
parentc7c73b22bb42ffae15211b8b9a4b5e0da2407271 (diff)
.gdbinit: Have rp() work without a target [ci skip]
Useful for core dumps. It used to not work because: (gdb) p !"" evaluation of this expression requires the target program to be active (gdb) p 0 == "" evaluation of this expression requires the target program to be active
-rw-r--r--.gdbinit20
1 files changed, 3 insertions, 17 deletions
diff --git a/.gdbinit b/.gdbinit
index 911624d8c9..1c38ffe09c 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -1,21 +1,7 @@
-define hook-run
- set $color_type = 0
- set $color_highlite = 0
- set $color_end = 0
-end
-
define ruby_gdb_init
- if !$color_type
- set $color_type = "\033[31m"
- end
- if !$color_highlite
- set $color_highlite = "\033[36m"
- end
- if !$color_end
- set $color_end = "\033[m"
- end
- if ruby_dummy_gdb_enums.special_consts
- end
+ init-if-undefined $color_type = "\033[31m"
+ init-if-undefined $color_highlite = "\033[36m"
+ init-if-undefined $color_end = "\033[m"
end
# set prompt \033[36m(gdb)\033[m\040