This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Remove deprecated_selected_frame
- From: Brian Dessent <brian at dessent dot net>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gdb-patches at sourceware dot org, insight at sourceware dot org
- Date: Sat, 03 Mar 2007 19:13:14 -0800
- Subject: Re: [rfc] Remove deprecated_selected_frame
- References: <20070222212909.GA17260@caradoc.them.org>
- Reply-to: insight at sourceware dot org
Daniel Jacobowitz wrote:
> Every reference to the global selected frame is either replaced by
> get_selected_frame (if we know the program is running) or
> deprecated_safe_get_selected_frame (if we're not sure). This removes
> a class of bugs caused by lazy creation of the selected frame, several
> of which Debian users have reported to me. It also simplifies some
> other frame cleanups.
I'm getting this now when building insight:
gcc -c -g -O2 -I. -I/usr/src/sourceware/gdb
-I/usr/src/sourceware/gdb/config
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H
-I/usr/src/sourceware/gdb/../include/opcode
-I/usr/src/sourceware/gdb/../readline/.. -I../bfd
-I/usr/src/sourceware/gdb/../bfd -I/usr/src/sourceware/gdb/../include
-DMI_OUT=1 -DGDBTK -DTUI=1 -Wall -Wdeclaration-after-statement
-Wpointer-arith -Wformat-nonliteral -Wno-unused -Wno-switch -Werror
-I/usr/src/sourceware/gdb/../libgui/src
-I/usr/src/sourceware/itcl/itcl/generic \
-I/usr/src/sourceware/tcl/generic
-I/usr/src/sourceware/tk/generic
-I"/usr/src/sourceware/tk/xlib" \
/usr/src/sourceware/gdb/gdbtk/generic/gdbtk-cmds.c
\
-DGDBTK_LIBRARY=\"/usr/local/share/insight1.0\"
/usr/src/sourceware/gdb/gdbtk/generic/gdbtk-cmds.c: In function
`gdb_loc':
/usr/src/sourceware/gdb/gdbtk/generic/gdbtk-cmds.c:2133: error:
`deprecated_selected_frame' undeclared (first use in this function)
/usr/src/sourceware/gdb/gdbtk/generic/gdbtk-cmds.c:2133: error: (Each
undeclared identifier is reported only once
/usr/src/sourceware/gdb/gdbtk/generic/gdbtk-cmds.c:2133: error: for each
function it appears in.)
make: *** [gdbtk-cmds.o] Error 1
It looks like there are about a dozen more references in
gdbtk/generic/gdbtk-{cmds,hooks,register,stack}.c. Most of them seem to
be the "if (deprecated_selected_frame != NULL)" sort of thing -- is this
safe to just replace with "if (get_selected_frame (NULL))" ?
Brian