diff gcc/gdbinit.in @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
line wrap: on
line diff
--- a/gcc/gdbinit.in	Sun Aug 21 07:07:55 2011 +0900
+++ b/gcc/gdbinit.in	Fri Oct 27 22:46:09 2017 +0900
@@ -1,5 +1,4 @@
-# Copyright (C) 2001, 2002, 2003, 2004, 2006,
-# 2008, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -95,6 +94,15 @@
 Works only when an inferior is executing.
 end
 
+define pmz
+set mpz_out_str(stderr, 10, $)
+end
+
+document pmz
+Print the mpz value that is $
+Works only when an inferior is executing.
+end
+
 define ptc
 output (enum tree_code) $.common.code
 echo \n
@@ -167,7 +175,7 @@
 end
 
 define pbb
-set dump_bb ($, stderr, 0)
+set debug ($)
 end
 
 document pbb
@@ -182,6 +190,35 @@
 Dump the bitmap that is in $ as a comma-separated list of numbers.
 end
 
+define pel
+output expand_location ($)
+echo \n
+end
+
+document pel
+Print expanded location of $.
+end
+
+define pcfun
+output debug_function (cfun ? cfun->decl : current_function_decl, 0)
+echo \n
+end
+
+document pcfun
+Print current function.
+end
+
+# Define some macros helpful to gdb when it is expanding macros.
+macro define __FILE__ "gdb"
+macro define __LINE__ 1
+macro define __FUNCTION__ "gdb"
+macro define __null 0
+macro define input_line expand_location(input_location).line
+macro define input_filename expand_location(input_location).file
+
+# Gracefully handle aborts in functions used from gdb.
+set unwindonsignal on
+
 # Put breakpoints at exit and fancy_abort in case abort is mapped
 # to either fprintf/exit or fancy_abort.
 b fancy_abort
@@ -196,3 +233,40 @@
 # USE_SYSTEM_ABORT is defined, so gdb may complain and bail out.
 b exit
 b abort
+
+# Disable strict type checking.  This allows developers to (for example)
+# make inferior calls without casting absolute address to a suitable
+# pointer type.
+set check type off
+
+# Skip all inline functions in tree.h.
+# These are used in accessor macros.
+# Note that this is added at the end because older gdb versions
+# do not understand the 'skip' command.
+# See https://sourceware.org/gdb/current/onlinedocs/gdb/Skipping-Over-Functions-and-Files.html
+skip file tree.h
+
+# Also skip inline functions in is-a.h.
+skip file is-a.h
+
+# And line-map.h.
+skip file line-map.h
+
+# Likewise, skip various inline functions in rtl.h.
+skip rtx_expr_list::next
+skip rtx_expr_list::element
+skip rtx_insn_list::next
+skip rtx_insn_list::insn
+skip rtx_sequence::len
+skip rtx_sequence::element
+skip rtx_sequence::insn
+skip INSN_UID
+skip PREV_INSN
+skip SET_PREV_INSN
+skip NEXT_INSN
+skip SET_NEXT_INSN
+skip BLOCK_FOR_INSN
+skip PATTERN
+skip INSN_LOCATION
+skip INSN_HAS_LOCATION
+skip JUMP_LABEL_AS_INSN