From: Kevin Buettner <kevinb@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH RFA] configure.in: HAVE_STRUCT_LINK_MAP32 fix
Date: Mon, 11 Sep 2000 11:37:00 -0000 [thread overview]
Message-ID: <1000911183732.ZM28866@ocotillo.lan> (raw)
In-Reply-To: <1000909201957.ZM5262@ocotillo.lan>
On Sep 9, 1:19pm, Kevin Buettner wrote:
> * configure.in (HAVE_STRUCT_LINK_MAP32): Change test to use
> AC_TRY_COMPILE instead of AC_TRY_RUN.
Committed (1). I also regenerated and committed configure.
In the process, I also found it necessary to regenerate aclocal.m4,
but did *not* commit it since I expect Alexandre Oliva to be
committing this piece shortly. (See the "autoconf fails within GDB"
thread.)
(1) I have not yet heard from the people that I was expecting to get
approval from. However, Mark Kettenis reviewed this patch and
reported a successful build (with no new testsuite failures) on
Solaris 2.6. (Thanks, Mark!) Also, since the builds of many of
the targets which use solib.c were currently broken, I thought it
prudent to commit these changes instead of waiting a few more
days. I hope this was okay.
Kevin
From msnyder@redhat.com Mon Sep 11 12:50:00 2000
From: Michael Snyder <msnyder@redhat.com>
To: Kevin Buettner <kevinb@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH RFA] configure.in: HAVE_STRUCT_LINK_MAP32 fix
Date: Mon, 11 Sep 2000 12:50:00 -0000
Message-id: <39BCEF28.AE279386@redhat.com>
References: <1000909201957.ZM5262@ocotillo.lan>
X-SW-Source: 2000-09/msg00105.html
Content-length: 3292
Approved, please check it in.
Kevin Buettner wrote:
>
> The patch below fix the problem in which HAVE_STRUCT_LINK_MAP32 gets
> incorrectly defined for Linux. The original test is as follows:
>
> [AC_TRY_RUN([#define _SYSCALL32
> #include <sys/link.h>
> int main()
> {
> if (sizeof (struct link_map32) > 0)
> return 1;
> return 0;
> }],
> gdb_cv_have_struct_link_map32=no,
> gdb_cv_have_struct_link_map32=yes,
> gdb_cv_have_struct_link_map32=yes)]
>
> The problem with this test is that gdb_cv_have_struct_link_map32 is
> defined to be no if the program compiles successfully *and* returns
> 0 when run. It will be defined to be yes otherwise. So, on the
> appropriate Solaris system, the test would compile, but the program
> would exit with status code 1 (not 0), thus causing the autoconf
> variable to be defined to yes.
>
> On Linux, the compilation would simply fail because Linux lacks a
> <sys/link.h> file. This would also cause the autoconf variable to
> be set to yes. (Not what we want.)
>
> I don't think it would ever be possible for the autoconf variable
> to be set to no. For this to happen, there would have to be a
> struct link_map32 declared which is also of zero size.
>
> In order for the above test to work, it would have to be written
> as follows:
>
> [AC_TRY_RUN([#define _SYSCALL32
> #include <sys/link.h>
> int main()
> {
> if (sizeof (struct link_map32) > 0)
> return 0;
> return 1;
> }],
> gdb_cv_have_struct_link_map32=yes,
> gdb_cv_have_struct_link_map32=no,
> gdb_cv_have_struct_link_map32=no)]
>
> Note that the 0 and 1 were interchanged as were the yes/no values.
>
> However, I don't think AC_TRY_RUN is really appropriate in this case
> anyway because it effectively precludes the use of a cross compiler.
> Instead, I think AC_TRY_COMPILE is sufficient for making the test
> work properly.
>
> This has been tested on Linux, but not on Solaris.
>
> Please let me know if it's okay to commit this patch.
>
> * configure.in (HAVE_STRUCT_LINK_MAP32): Change test to use
> AC_TRY_COMPILE instead of AC_TRY_RUN.
>
> Index: configure.in
> ===================================================================
> RCS file: /cvs/src/src/gdb/configure.in,v
> retrieving revision 1.43
> diff -u -p -r1.43 configure.in
> --- configure.in 2000/08/30 00:58:58 1.43
> +++ configure.in 2000/09/09 20:01:41
> @@ -239,17 +239,10 @@ if test "$ac_cv_header_sys_procfs_h" = y
>
> AC_MSG_CHECKING(for struct link_map32 in sys/link.h)
> AC_CACHE_VAL(gdb_cv_have_struct_link_map32,
> - [AC_TRY_RUN([#define _SYSCALL32
> - #include <sys/link.h>
> - int main()
> - {
> - if (sizeof (struct link_map32) > 0)
> - return 1;
> - return 0;
> - }],
> - gdb_cv_have_struct_link_map32=no,
> + [AC_TRY_COMPILE([#define _SYSCALL32
> +#include <sys/link.h>], [struct link_map32 l;],
> gdb_cv_have_struct_link_map32=yes,
> - gdb_cv_have_struct_link_map32=yes)])
> + gdb_cv_have_struct_link_map32=no)])
> AC_MSG_RESULT($gdb_cv_have_struct_link_map32)
> if test $gdb_cv_have_struct_link_map32 = yes; then
> AC_DEFINE(HAVE_STRUCT_LINK_MAP32)
From fnasser@cygnus.com Tue Sep 12 05:58:00 2000
From: Fernando Nasser <fnasser@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH] The birth of regcache.h
Date: Tue, 12 Sep 2000 05:58:00 -0000
Message-id: <39BE2829.4457A12F@cygnus.com>
X-SW-Source: 2000-09/msg00106.html
Content-length: 48433
This message is from Steven Johnson <sbjohnson@ozemail.com.au>
His e-mail is having some problems so I am posting this for him.
Here it goes:
----------------------------------------------------------------------------
I have finished creating regcache.h see below:
2000-09-12 Steven Johnson <sbjohnson@ozemail.com.au>
* regcache.h : New header. Collates definitions that used to be
scattered throughout GDB.
* defs.h, gdbcore.h, inferior.h, value.h
: removed previous definitions that now belong in regcache.h
* a29k-tdep.c, a68v-nat.c, alpha-nat.c, alpha-tdep.c,
alphabsd-nat.c,
arc-tdep.c, arm-linux-nat.c, arm-linux-tdep.c, arm-tdep.c,
blockframe.c, breakpoint.c, core-aout.c, corelow.c,
cxux-nat.c, d10v-tdep.c, d30v-tdep.c, dink32-rom.c,
dve3900-rom.c, findvar.c, frame.h, gdbarch.c,
gdbtk/generic/gdbtk-cmds.c, go32-nat.c, h8300-tdep.c,
h8500-tdep.c, hp300ux-nat.c, hppa-tdep.c, hpux-thread.c,
i386-linux-nat.c, i386-linux-tdep.c, i386-tdep.c,
i386gnu-nat.c, i386ly-tdep.c, i386nbsd-nat.c, i387-nat.c,
i387-tdep.c, i960-tdep.c, ia64-linux-nat.c, ia64-tdep.c,
infcmd.c, infrun.c, irix5-nat.c, lin-lwp.c, lin-thread.c,
linux-thread.c, lynx-nat.c, m3-nat.c, m32r-rom.c, m32r-tdep.c,
m68hc11-tdep.c, m68k-tdep.c, m68klinux-nat.c, m88k-tdep.c,
mac-nat.c, mcore-tdep.c, mi-main.c, mips-tdep.c,
mn10200-tdep.c, mn10300-tdep.c, mon960-rom.c, monitor.c,
ns32knbsd-nat.c, ocd.c, pa64solib.c, ppc-bdm.c,
ppc-linux-tdep.c, regcache.c, remote-adapt.c, remote-array.c,
remote-bug.c, remote-e7000.c, remote-eb.c, remote-mips.c,
remote-mm.c, remote-nindy.c, remote-os9k.c, remote-rdi.c,
remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c,
remote-udi.c, remote-utils.c, remote-vx.c, remote-vx29k.c,
remote.c, rs6000-nat.c, rs6000-tdep.c, sh-tdep.c, solib.c,
somsolib.c, sparc-tdep.c, sparcl-tdep.c, symfile.c, symtab.c,
target.c, thread-db.c, thread.c, tic80-tdep.c, tracepoint.c,
umax-xdep.c, uw-thread.c, v850-tdep.c, v850ice.c, valops.c,
w65-tdep.c, win32-nat.c, wince.c, z8k-tdep.c
: added include of regcache.h to track new header creation.
And the patch for it is here:
diff -C2 -r -b -N ../gdb_cvs/src/gdb/a29k-tdep.c src/gdb/a29k-tdep.c
*** ../gdb_cvs/src/gdb/a29k-tdep.c Thu Aug 31 20:46:37 2000
--- src/gdb/a29k-tdep.c Sat Sep 9 21:09:20 2000
***************
*** 28,31 ****
--- 28,32 ----
#include "inferior.h"
#include "gdbcmd.h"
+ #include "regcache.h"
/* If all these bits in an instruction word are zero, it is a "tag word"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/a68v-nat.c src/gdb/a68v-nat.c
*** ../gdb_cvs/src/gdb/a68v-nat.c Thu Aug 31 20:46:37 2000
--- src/gdb/a68v-nat.c Fri Sep 8 23:01:11 2000
***************
*** 27,30 ****
--- 27,31 ----
#include <ptrace.h>
+ #include "regcache.h"
extern int errno;
diff -C2 -r -b -N ../gdb_cvs/src/gdb/alpha-nat.c src/gdb/alpha-nat.c
*** ../gdb_cvs/src/gdb/alpha-nat.c Thu Aug 31 20:46:37 2000
--- src/gdb/alpha-nat.c Mon Sep 11 22:48:33 2000
***************
*** 23,26 ****
--- 23,28 ----
#include "gdbcore.h"
#include "target.h"
+ #include "regcache.h"
+
#include <sys/ptrace.h>
#ifdef __linux__
diff -C2 -r -b -N ../gdb_cvs/src/gdb/alpha-tdep.c src/gdb/alpha-tdep.c
*** ../gdb_cvs/src/gdb/alpha-tdep.c Thu Aug 31 20:46:38 2000
--- src/gdb/alpha-tdep.c Sat Sep 9 21:17:32 2000
***************
*** 30,33 ****
--- 30,34 ----
#include "objfiles.h"
#include "gdb_string.h"
+ #include "regcache.h"
/* FIXME: Some of this code should perhaps be merged with mips-tdep.c. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/alphabsd-nat.c src/gdb/alphabsd-nat.c
*** ../gdb_cvs/src/gdb/alphabsd-nat.c Sat Jun 3 05:04:51 2000
--- src/gdb/alphabsd-nat.c Mon Sep 11 22:46:23 2000
***************
*** 21,24 ****
--- 21,25 ----
#include "defs.h"
#include "inferior.h"
+ #include "regcache.h"
#include <sys/types.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/arc-tdep.c src/gdb/arc-tdep.c
*** ../gdb_cvs/src/gdb/arc-tdep.c Thu Aug 31 20:46:38 2000
--- src/gdb/arc-tdep.c Sat Sep 9 21:09:50 2000
***************
*** 27,30 ****
--- 27,31 ----
#include "symtab.h"
#include "gdbcmd.h"
+ #include "regcache.h"
/* Local functions */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/arm-linux-nat.c src/gdb/arm-linux-nat.c
*** ../gdb_cvs/src/gdb/arm-linux-nat.c Thu Jul 6 12:00:20 2000
--- src/gdb/arm-linux-nat.c Sat Sep 9 21:11:24 2000
***************
*** 23,26 ****
--- 23,27 ----
#include "gdbcore.h"
#include "gdb_string.h"
+ #include "regcache.h"
#include <sys/user.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/arm-linux-tdep.c src/gdb/arm-linux-tdep.c
*** ../gdb_cvs/src/gdb/arm-linux-tdep.c Thu Sep 7 20:18:15 2000
--- src/gdb/arm-linux-tdep.c Sat Sep 9 21:24:33 2000
***************
*** 26,29 ****
--- 26,30 ----
#include "gdbcore.h"
#include "frame.h"
+ #include "regcache.h"
/* For arm_linux_skip_solib_resolver. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/arm-tdep.c src/gdb/arm-tdep.c
*** ../gdb_cvs/src/gdb/arm-tdep.c Thu Sep 7 20:18:16 2000
--- src/gdb/arm-tdep.c Sat Sep 9 21:23:52 2000
***************
*** 30,33 ****
--- 30,34 ----
#include "dis-asm.h" /* For register flavors. */
#include <ctype.h> /* for isupper () */
+ #include "regcache.h"
/* Each OS has a different mechanism for accessing the various
diff -C2 -r -b -N ../gdb_cvs/src/gdb/blockframe.c src/gdb/blockframe.c
*** ../gdb_cvs/src/gdb/blockframe.c Mon Sep 4 22:21:39 2000
--- src/gdb/blockframe.c Sat Sep 9 21:03:20 2000
***************
*** 32,35 ****
--- 32,36 ----
#include "inferior.h" /* for read_pc */
#include "annotate.h"
+ #include "regcache.h"
/* Prototypes for exported functions. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/breakpoint.c src/gdb/breakpoint.c
*** ../gdb_cvs/src/gdb/breakpoint.c Thu Aug 31 20:46:40 2000
--- src/gdb/breakpoint.c Mon Sep 11 23:00:37 2000
***************
*** 40,43 ****
--- 40,45 ----
#include "symfile.h"
#include "objfiles.h"
+ #include "regcache.h"
+
#ifdef UI_OUT
#include "ui-out.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/core-aout.c src/gdb/core-aout.c
*** ../gdb_cvs/src/gdb/core-aout.c Thu Aug 31 20:46:43 2000
--- src/gdb/core-aout.c Mon Sep 11 22:45:19 2000
***************
*** 39,42 ****
--- 39,43 ----
#include "value.h" /* For supply_register. */
#include "inferior.h" /* For ARCH_NUM_REGS. */
+ #include "regcache.h"
/* These are needed on various systems to expand REGISTER_U_ADDR. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/corelow.c src/gdb/corelow.c
*** ../gdb_cvs/src/gdb/corelow.c Mon Sep 4 22:21:39 2000
--- src/gdb/corelow.c Fri Sep 8 23:02:37 2000
***************
*** 33,36 ****
--- 33,37 ----
#include "gdbcore.h"
#include "gdbthread.h"
+ #include "regcache.h"
#ifndef O_BINARY
diff -C2 -r -b -N ../gdb_cvs/src/gdb/cxux-nat.c src/gdb/cxux-nat.c
*** ../gdb_cvs/src/gdb/cxux-nat.c Thu Aug 31 20:46:44 2000
--- src/gdb/cxux-nat.c Sat Sep 9 21:06:59 2000
***************
*** 34,37 ****
--- 34,38 ----
#include "objfiles.h"
#include "symtab.h"
+ #include "regcache.h"
#ifndef USER /* added to support BCS ptrace_user */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/d10v-tdep.c src/gdb/d10v-tdep.c
*** ../gdb_cvs/src/gdb/d10v-tdep.c Mon Sep 4 22:21:40 2000
--- src/gdb/d10v-tdep.c Sat Sep 9 21:15:13 2000
***************
*** 36,39 ****
--- 36,40 ----
#include "language.h"
#include "arch-utils.h"
+ #include "regcache.h"
#include "floatformat.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/d30v-tdep.c src/gdb/d30v-tdep.c
*** ../gdb_cvs/src/gdb/d30v-tdep.c Thu Aug 31 20:46:44 2000
--- src/gdb/d30v-tdep.c Fri Sep 8 22:36:25 2000
***************
*** 34,37 ****
--- 34,38 ----
#include "symfile.h"
#include "objfiles.h"
+ #include "regcache.h"
#include "language.h" /* For local_hex_string() */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/defs.h src/gdb/defs.h
*** ../gdb_cvs/src/gdb/defs.h Mon Sep 4 22:21:40 2000
--- src/gdb/defs.h Fri Sep 8 22:11:26 2000
***************
*** 581,587 ****
bfd_signed_vma bss_off);
- /* From findvar.c */
-
- extern int read_relative_register_raw_bytes (int, char *);
/* Possible lvalue types. Like enum language, this should be in
--- 581,584 ----
diff -C2 -r -b -N ../gdb_cvs/src/gdb/dink32-rom.c src/gdb/dink32-rom.c
*** ../gdb_cvs/src/gdb/dink32-rom.c Thu Aug 31 20:46:45 2000
--- src/gdb/dink32-rom.c Mon Sep 11 23:01:15 2000
***************
*** 27,30 ****
--- 27,31 ----
#include "symfile.h" /* For generic_load() */
#include "inferior.h" /* For write_pc() */
+ #include "regcache.h"
static void dink32_open (char *args, int from_tty);
diff -C2 -r -b -N ../gdb_cvs/src/gdb/dve3900-rom.c src/gdb/dve3900-rom.c
*** ../gdb_cvs/src/gdb/dve3900-rom.c Thu Aug 31 20:46:46 2000
--- src/gdb/dve3900-rom.c Mon Sep 11 22:27:59 2000
***************
*** 29,32 ****
--- 29,33 ----
#include "gdb_string.h"
#include <time.h>
+ #include "regcache.h"
/* Type of function passed to bfd_map_over_sections. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/findvar.c src/gdb/findvar.c
*** ../gdb_cvs/src/gdb/findvar.c Thu Aug 31 20:46:48 2000
--- src/gdb/findvar.c Fri Sep 8 22:26:41 2000
***************
*** 31,34 ****
--- 31,36 ----
#include "floatformat.h"
#include "symfile.h" /* for overlay functions */
+ #include "regcache.h"
+
/* This is used to indicate that we don't know the format of the floating point
diff -C2 -r -b -N ../gdb_cvs/src/gdb/frame.h src/gdb/frame.h
*** ../gdb_cvs/src/gdb/frame.h Thu Jul 6 12:00:46 2000
--- src/gdb/frame.h Fri Sep 8 22:11:32 2000
***************
*** 240,245 ****
extern void show_frame_info (struct frame_info *, int, int, int);
- extern CORE_ADDR find_saved_register (struct frame_info *, int);
-
extern struct frame_info *block_innermost_frame (struct block *);
--- 240,243 ----
diff -C2 -r -b -N ../gdb_cvs/src/gdb/gdbarch.c src/gdb/gdbarch.c
*** ../gdb_cvs/src/gdb/gdbarch.c Mon Sep 4 22:21:45 2000
--- src/gdb/gdbarch.c Tue Sep 12 21:08:36 2000
***************
*** 60,63 ****
--- 60,65 ----
#include "floatformat.h"
+
+ #include "regcache.h"
/* Static function declarations */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/gdbcore.h src/gdb/gdbcore.h
*** ../gdb_cvs/src/gdb/gdbcore.h Thu Jul 6 12:01:06 2000
--- src/gdb/gdbcore.h Fri Sep 8 22:11:22 2000
***************
*** 107,112 ****
extern CORE_ADDR register_addr (int regno, CORE_ADDR blockend);
- extern void registers_fetched (void);
-
#if !defined (KERNEL_U_ADDR)
extern CORE_ADDR kernel_u_addr;
--- 107,110 ----
diff -C2 -r -b -N ../gdb_cvs/src/gdb/gdbtk/generic/gdbtk-cmds.c
src/gdb/gdbtk/generic/gdbtk-cmds.c
*** ../gdb_cvs/src/gdb/gdbtk/generic/gdbtk-cmds.c Thu Aug 31 20:47:30 2000
--- src/gdb/gdbtk/generic/gdbtk-cmds.c Sat Sep 9 21:36:10 2000
***************
*** 38,41 ****
--- 38,42 ----
#include "frame.h"
#include "tui/tui-file.h"
+ #include "regcache.h"
#include <sys/stat.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/go32-nat.c src/gdb/go32-nat.c
*** ../gdb_cvs/src/gdb/go32-nat.c Thu Aug 31 20:46:51 2000
--- src/gdb/go32-nat.c Mon Sep 11 22:50:20 2000
***************
*** 29,32 ****
--- 29,33 ----
#include "floatformat.h"
#include "buildsym.h"
+ #include "regcache.h"
#include <stdio.h> /* required for __DJGPP_MINOR__ */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/h8300-tdep.c src/gdb/h8300-tdep.c
*** ../gdb_cvs/src/gdb/h8300-tdep.c Thu Aug 31 20:46:51 2000
--- src/gdb/h8300-tdep.c Fri Sep 8 22:40:24 2000
***************
*** 34,37 ****
--- 34,38 ----
#include "gdb_string.h"
#include "value.h"
+ #include "regcache.h"
extern int h8300hmode, h8300smode;
diff -C2 -r -b -N ../gdb_cvs/src/gdb/h8500-tdep.c src/gdb/h8500-tdep.c
*** ../gdb_cvs/src/gdb/h8500-tdep.c Thu Aug 31 20:46:52 2000
--- src/gdb/h8500-tdep.c Fri Sep 8 22:33:36 2000
***************
*** 33,36 ****
--- 33,37 ----
#include "dis-asm.h"
#include "gdbcore.h"
+ #include "regcache.h"
#define UNSIGNED_SHORT(X) ((X) & 0xffff)
diff -C2 -r -b -N ../gdb_cvs/src/gdb/hp300ux-nat.c src/gdb/hp300ux-nat.c
*** ../gdb_cvs/src/gdb/hp300ux-nat.c Thu Aug 31 20:46:52 2000
--- src/gdb/hp300ux-nat.c Mon Sep 11 22:28:38 2000
***************
*** 22,25 ****
--- 22,26 ----
#include "frame.h"
#include "inferior.h"
+ #include "regcache.h"
/* Defining this means some system include files define some extra stuff. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/hppa-tdep.c src/gdb/hppa-tdep.c
*** ../gdb_cvs/src/gdb/hppa-tdep.c Mon Sep 4 22:21:46 2000
--- src/gdb/hppa-tdep.c Fri Sep 8 22:39:44 2000
***************
*** 57,60 ****
--- 57,61 ----
#include "symfile.h"
#include "objfiles.h"
+ #include "regcache.h"
/* To support detection of the pseudo-initial frame
diff -C2 -r -b -N ../gdb_cvs/src/gdb/hpux-thread.c src/gdb/hpux-thread.c
*** ../gdb_cvs/src/gdb/hpux-thread.c Thu Sep 7 20:18:16 2000
--- src/gdb/hpux-thread.c Mon Sep 11 22:50:57 2000
***************
*** 43,46 ****
--- 43,47 ----
#include <sys/stat.h>
#include "gdbcore.h"
+ #include "regcache.h"
extern int child_suppress_run;
diff -C2 -r -b -N ../gdb_cvs/src/gdb/i386-linux-nat.c src/gdb/i386-linux-nat.c
*** ../gdb_cvs/src/gdb/i386-linux-nat.c Thu Aug 31 20:46:53 2000
--- src/gdb/i386-linux-nat.c Sat Sep 9 21:28:34 2000
***************
*** 22,25 ****
--- 22,26 ----
#include "inferior.h"
#include "gdbcore.h"
+ #include "regcache.h"
#include <sys/ptrace.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/i386-linux-tdep.c src/gdb/i386-linux-tdep.c
*** ../gdb_cvs/src/gdb/i386-linux-tdep.c Thu Aug 31 20:46:54 2000
--- src/gdb/i386-linux-tdep.c Mon Sep 11 22:13:36 2000
***************
*** 28,31 ****
--- 28,32 ----
#include "symfile.h"
#include "objfiles.h"
+ #include "regcache.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/i386-tdep.c src/gdb/i386-tdep.c
*** ../gdb_cvs/src/gdb/i386-tdep.c Thu Aug 31 20:46:54 2000
--- src/gdb/i386-tdep.c Sat Sep 9 21:12:27 2000
***************
*** 31,34 ****
--- 31,35 ----
#include "command.h"
#include "arch-utils.h"
+ #include "regcache.h"
static long i386_get_frame_setup (CORE_ADDR);
diff -C2 -r -b -N ../gdb_cvs/src/gdb/i386gnu-nat.c src/gdb/i386gnu-nat.c
*** ../gdb_cvs/src/gdb/i386gnu-nat.c Sat Mar 11 10:34:50 2000
--- src/gdb/i386gnu-nat.c Mon Sep 11 22:49:29 2000
***************
*** 22,25 ****
--- 22,26 ----
#include "inferior.h"
#include "floatformat.h"
+ #include "regcache.h"
#include <assert.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/i386ly-tdep.c src/gdb/i386ly-tdep.c
*** ../gdb_cvs/src/gdb/i386ly-tdep.c Thu Aug 31 20:46:54 2000
--- src/gdb/i386ly-tdep.c Mon Sep 11 22:12:47 2000
***************
*** 23,26 ****
--- 23,27 ----
#include "target.h"
#include "gdbcore.h"
+ #include "regcache.h"
/* Return the PC of the caller from the call frame. Assumes the subr prologue
diff -C2 -r -b -N ../gdb_cvs/src/gdb/i386nbsd-nat.c src/gdb/i386nbsd-nat.c
*** ../gdb_cvs/src/gdb/i386nbsd-nat.c Thu Aug 31 20:46:54 2000
--- src/gdb/i386nbsd-nat.c Fri Sep 8 23:00:06 2000
***************
*** 26,30 ****
#include <machine/frame.h>
#include "inferior.h"
! #include "gdbcore.h" /* for registers_fetched() */
#define RF(dst, src) \
--- 26,30 ----
#include <machine/frame.h>
#include "inferior.h"
! #include "regcache.h" /* for registers_fetched() */
#define RF(dst, src) \
diff -C2 -r -b -N ../gdb_cvs/src/gdb/i387-nat.c src/gdb/i387-nat.c
*** ../gdb_cvs/src/gdb/i387-nat.c Thu Aug 31 20:46:55 2000
--- src/gdb/i387-nat.c Mon Sep 11 22:51:25 2000
***************
*** 22,25 ****
--- 22,26 ----
#include "inferior.h"
#include "value.h"
+ #include "regcache.h"
/* FIXME: kettenis/2000-05-21: Right now more than a few i386 targets
diff -C2 -r -b -N ../gdb_cvs/src/gdb/i387-tdep.c src/gdb/i387-tdep.c
*** ../gdb_cvs/src/gdb/i387-tdep.c Thu Aug 31 20:46:55 2000
--- src/gdb/i387-tdep.c Sat Sep 9 21:13:08 2000
***************
*** 26,29 ****
--- 26,30 ----
#include "gdbcore.h"
#include "floatformat.h"
+ #include "regcache.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/i960-tdep.c src/gdb/i960-tdep.c
*** ../gdb_cvs/src/gdb/i960-tdep.c Thu Aug 31 20:46:55 2000
--- src/gdb/i960-tdep.c Sat Sep 9 21:18:45 2000
***************
*** 29,32 ****
--- 29,33 ----
#include "gdbcore.h"
#include "inferior.h"
+ #include "regcache.h"
static CORE_ADDR next_insn (CORE_ADDR memaddr,
diff -C2 -r -b -N ../gdb_cvs/src/gdb/ia64-linux-nat.c src/gdb/ia64-linux-nat.c
*** ../gdb_cvs/src/gdb/ia64-linux-nat.c Thu Aug 31 20:46:55 2000
--- src/gdb/ia64-linux-nat.c Mon Sep 11 22:33:36 2000
***************
*** 23,26 ****
--- 23,27 ----
#include "target.h"
#include "gdbcore.h"
+ #include "regcache.h"
#include <signal.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/ia64-tdep.c src/gdb/ia64-tdep.c
*** ../gdb_cvs/src/gdb/ia64-tdep.c Thu Sep 7 20:18:26 2000
--- src/gdb/ia64-tdep.c Sat Sep 9 21:19:22 2000
***************
*** 26,29 ****
--- 26,30 ----
#include "arch-utils.h"
#include "floatformat.h"
+ #include "regcache.h"
#include "objfiles.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/infcmd.c src/gdb/infcmd.c
*** ../gdb_cvs/src/gdb/infcmd.c Mon Sep 4 22:21:46 2000
--- src/gdb/infcmd.c Fri Sep 8 22:37:48 2000
***************
*** 40,43 ****
--- 40,44 ----
#include "event-top.h"
#include "parser-defs.h"
+ #include "regcache.h"
/* Functions exported for general use: */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/inferior.h src/gdb/inferior.h
*** ../gdb_cvs/src/gdb/inferior.h Thu Aug 31 20:46:55 2000
--- src/gdb/inferior.h Fri Sep 8 22:09:45 2000
***************
*** 112,125 ****
extern struct environ *inferior_environ;
- /* Character array containing an image of the inferior programs'
- registers. */
-
- extern char *registers;
-
- /* Character array containing the current state of each register
- (unavailable<0, valid=0, invalid>0). */
-
- extern signed char *register_valid;
-
extern void clear_proceed_status (void);
--- 112,115 ----
***************
*** 134,164 ****
extern int run_stack_dummy (CORE_ADDR, char *);
- extern CORE_ADDR read_pc (void);
-
- extern CORE_ADDR read_pc_pid (int);
-
- extern CORE_ADDR generic_target_read_pc (int);
-
- extern void write_pc (CORE_ADDR);
-
- extern void write_pc_pid (CORE_ADDR, int);
-
- extern void generic_target_write_pc (CORE_ADDR, int);
-
- extern CORE_ADDR read_sp (void);
-
extern CORE_ADDR generic_target_read_sp (void);
-
- extern void write_sp (CORE_ADDR);
-
- extern void generic_target_write_sp (CORE_ADDR);
-
- extern CORE_ADDR read_fp (void);
-
- extern CORE_ADDR generic_target_read_fp (void);
-
- extern void write_fp (CORE_ADDR);
-
- extern void generic_target_write_fp (CORE_ADDR);
extern CORE_ADDR unsigned_pointer_to_address (struct type *type, void *buf);
--- 124,128 ----
diff -C2 -r -b -N ../gdb_cvs/src/gdb/infrun.c src/gdb/infrun.c
*** ../gdb_cvs/src/gdb/infrun.c Mon Sep 4 22:21:46 2000
--- src/gdb/infrun.c Fri Sep 8 22:46:49 2000
***************
*** 36,39 ****
--- 36,40 ----
#include <signal.h>
#include "inf-loop.h"
+ #include "regcache.h"
/* Prototypes for local functions */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/irix5-nat.c src/gdb/irix5-nat.c
*** ../gdb_cvs/src/gdb/irix5-nat.c Thu Aug 31 20:46:56 2000
--- src/gdb/irix5-nat.c Mon Sep 11 22:41:49 2000
***************
*** 28,31 ****
--- 28,32 ----
#include "gdbcore.h"
#include "target.h"
+ #include "regcache.h"
#include "gdb_string.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/lin-lwp.c src/gdb/lin-lwp.c
*** ../gdb_cvs/src/gdb/lin-lwp.c Mon Sep 4 04:41:28 2000
--- src/gdb/lin-lwp.c Fri Sep 8 22:49:12 2000
***************
*** 30,33 ****
--- 30,34 ----
#include "inferior.h"
#include "target.h"
+ #include "regcache.h"
#define DEBUG 1
diff -C2 -r -b -N ../gdb_cvs/src/gdb/lin-thread.c src/gdb/lin-thread.c
*** ../gdb_cvs/src/gdb/lin-thread.c Mon Sep 4 22:21:48 2000
--- src/gdb/lin-thread.c Mon Sep 11 22:54:56 2000
***************
*** 102,105 ****
--- 102,106 ----
#include "inferior.h"
#include "gdbcmd.h"
+ #include "regcache.h"
#include "gdb_wait.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/linux-thread.c src/gdb/linux-thread.c
*** ../gdb_cvs/src/gdb/linux-thread.c Thu Aug 31 20:46:58 2000
--- src/gdb/linux-thread.c Mon Sep 11 22:53:59 2000
***************
*** 61,64 ****
--- 61,65 ----
#include "gdbcmd.h"
#include "breakpoint.h"
+ #include "regcache.h"
#ifndef PT_ATTACH
diff -C2 -r -b -N ../gdb_cvs/src/gdb/lynx-nat.c src/gdb/lynx-nat.c
*** ../gdb_cvs/src/gdb/lynx-nat.c Thu Aug 31 20:46:58 2000
--- src/gdb/lynx-nat.c Sat Sep 9 21:32:44 2000
***************
*** 24,27 ****
--- 24,28 ----
#include "target.h"
#include "gdbcore.h"
+ #include "regcache.h"
#include <sys/ptrace.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/m3-nat.c src/gdb/m3-nat.c
*** ../gdb_cvs/src/gdb/m3-nat.c Thu Aug 31 20:46:58 2000
--- src/gdb/m3-nat.c Fri Sep 8 22:53:04 2000
***************
*** 57,60 ****
--- 57,61 ----
#include "gdbcmd.h"
#include "gdbcore.h"
+ #include "regcache.h"
#if 0
diff -C2 -r -b -N ../gdb_cvs/src/gdb/m32r-rom.c src/gdb/m32r-rom.c
*** ../gdb_cvs/src/gdb/m32r-rom.c Thu Aug 31 20:46:58 2000
--- src/gdb/m32r-rom.c Mon Sep 11 23:02:45 2000
***************
*** 37,40 ****
--- 37,41 ----
#include "objfiles.h" /* for ALL_OBJFILES etc. */
#include "inferior.h" /* for write_pc() */
+ #include "regcache.h"
#include <ctype.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/m32r-tdep.c src/gdb/m32r-tdep.c
*** ../gdb_cvs/src/gdb/m32r-tdep.c Thu Aug 31 20:46:59 2000
--- src/gdb/m32r-tdep.c Mon Sep 11 22:38:26 2000
***************
*** 29,32 ****
--- 29,33 ----
#include "gdbcore.h"
#include "symfile.h"
+ #include "regcache.h"
/* Function: m32r_use_struct_convention
diff -C2 -r -b -N ../gdb_cvs/src/gdb/m68hc11-tdep.c src/gdb/m68hc11-tdep.c
*** ../gdb_cvs/src/gdb/m68hc11-tdep.c Thu Sep 7 20:18:26 2000
--- src/gdb/m68hc11-tdep.c Sat Sep 9 21:14:07 2000
***************
*** 34,37 ****
--- 34,38 ----
#include "objfiles.h"
#include "arch-utils.h"
+ #include "regcache.h"
#include "target.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/m68k-tdep.c src/gdb/m68k-tdep.c
*** ../gdb_cvs/src/gdb/m68k-tdep.c Thu Aug 31 20:47:01 2000
--- src/gdb/m68k-tdep.c Sat Sep 9 21:03:55 2000
***************
*** 27,30 ****
--- 27,32 ----
#include "gdb_string.h"
#include "inferior.h"
+ #include "regcache.h"
+
diff -C2 -r -b -N ../gdb_cvs/src/gdb/m68klinux-nat.c src/gdb/m68klinux-nat.c
*** ../gdb_cvs/src/gdb/m68klinux-nat.c Thu Aug 31 20:47:01 2000
--- src/gdb/m68klinux-nat.c Mon Sep 11 22:15:20 2000
***************
*** 41,44 ****
--- 41,45 ----
#include "floatformat.h"
+ #include "regcache.h"
#include "target.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/m88k-tdep.c src/gdb/m88k-tdep.c
*** ../gdb_cvs/src/gdb/m88k-tdep.c Thu Aug 31 20:47:02 2000
--- src/gdb/m88k-tdep.c Mon Sep 11 22:16:18 2000
***************
*** 27,30 ****
--- 27,31 ----
#include "setjmp.h"
#include "value.h"
+ #include "regcache.h"
/* Size of an instruction */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/mac-nat.c src/gdb/mac-nat.c
*** ../gdb_cvs/src/gdb/mac-nat.c Thu Aug 31 20:47:02 2000
--- src/gdb/mac-nat.c Sat Sep 9 21:10:51 2000
***************
*** 37,40 ****
--- 37,41 ----
#include "gdbthread.h"
#include "gdbcmd.h"
+ #include "regcache.h"
#include <Processes.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/mcore-tdep.c src/gdb/mcore-tdep.c
*** ../gdb_cvs/src/gdb/mcore-tdep.c Thu Aug 31 20:47:02 2000
--- src/gdb/mcore-tdep.c Sat Sep 9 21:20:15 2000
***************
*** 23,26 ****
--- 23,27 ----
#include "value.h"
#include "gdbcmd.h"
+ #include "regcache.h"
/* Functions declared and used only in this file */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/mi/mi-main.c src/gdb/mi/mi-main.c
*** ../gdb_cvs/src/gdb/mi/mi-main.c Thu Aug 31 20:47:32 2000
--- src/gdb/mi/mi-main.c Fri Sep 8 22:32:52 2000
***************
*** 40,43 ****
--- 40,44 ----
#include <ctype.h>
#include <sys/time.h>
+ #include "regcache.h"
/* Convenience macro for allocting typesafe memory. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/mips-tdep.c src/gdb/mips-tdep.c
*** ../gdb_cvs/src/gdb/mips-tdep.c Thu Aug 31 20:47:03 2000
--- src/gdb/mips-tdep.c Fri Sep 8 22:30:51 2000
***************
*** 43,46 ****
--- 43,47 ----
#include "elf-bfd.h"
#include "symcat.h"
+ #include "regcache.h"
/* The sizes of floating point registers. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/mn10200-tdep.c src/gdb/mn10200-tdep.c
*** ../gdb_cvs/src/gdb/mn10200-tdep.c Thu Aug 31 20:47:03 2000
--- src/gdb/mn10200-tdep.c Mon Sep 11 22:17:33 2000
***************
*** 29,33 ****
#include "gdbcore.h"
#include "symfile.h"
!
/* Should call_function allocate stack space for a struct return? */
--- 29,33 ----
#include "gdbcore.h"
#include "symfile.h"
! #include "regcache.h"
/* Should call_function allocate stack space for a struct return? */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/mn10300-tdep.c src/gdb/mn10300-tdep.c
*** ../gdb_cvs/src/gdb/mn10300-tdep.c Thu Aug 31 20:47:03 2000
--- src/gdb/mn10300-tdep.c Fri Sep 8 22:38:45 2000
***************
*** 29,32 ****
--- 29,34 ----
#include "gdbcore.h"
#include "symfile.h"
+ #include "regcache.h"
+
extern void _initialize_mn10300_tdep (void);
diff -C2 -r -b -N ../gdb_cvs/src/gdb/mon960-rom.c src/gdb/mon960-rom.c
*** ../gdb_cvs/src/gdb/mon960-rom.c Thu Aug 31 20:47:03 2000
--- src/gdb/mon960-rom.c Mon Sep 11 23:03:31 2000
***************
*** 30,33 ****
--- 30,34 ----
#include "symfile.h" /* for generic_load */
#include "inferior.h" /* for write_pc() */
+ #include "regcache.h"
#define USE_GENERIC_LOAD
diff -C2 -r -b -N ../gdb_cvs/src/gdb/monitor.c src/gdb/monitor.c
*** ../gdb_cvs/src/gdb/monitor.c Mon Sep 4 22:21:48 2000
--- src/gdb/monitor.c Mon Sep 11 22:18:31 2000
***************
*** 54,57 ****
--- 54,58 ----
#include "dcache.h"
#include "srec.h"
+ #include "regcache.h"
static char *dev_name;
diff -C2 -r -b -N ../gdb_cvs/src/gdb/ns32knbsd-nat.c src/gdb/ns32knbsd-nat.c
*** ../gdb_cvs/src/gdb/ns32knbsd-nat.c Thu Aug 31 20:47:04 2000
--- src/gdb/ns32knbsd-nat.c Fri Sep 8 23:02:08 2000
***************
*** 29,32 ****
--- 29,33 ----
#include "target.h"
#include "gdbcore.h"
+ #include "regcache.h"
#define RF(dst, src) \
diff -C2 -r -b -N ../gdb_cvs/src/gdb/ocd.c src/gdb/ocd.c
*** ../gdb_cvs/src/gdb/ocd.c Mon Sep 4 22:21:48 2000
--- src/gdb/ocd.c Fri Sep 8 22:43:41 2000
***************
*** 37,40 ****
--- 37,41 ----
#include "serial.h"
#include "ocd.h"
+ #include "regcache.h"
/* Prototypes for local functions */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/pa64solib.c src/gdb/pa64solib.c
*** ../gdb_cvs/src/gdb/pa64solib.c Thu Aug 31 20:47:05 2000
--- src/gdb/pa64solib.c Mon Sep 11 22:19:00 2000
***************
*** 50,53 ****
--- 50,54 ----
#include "assert.h"
#include "language.h"
+ #include "regcache.h"
#include <fcntl.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/ppc-bdm.c src/gdb/ppc-bdm.c
*** ../gdb_cvs/src/gdb/ppc-bdm.c Thu Aug 31 20:47:05 2000
--- src/gdb/ppc-bdm.c Mon Sep 11 22:43:24 2000
***************
*** 38,41 ****
--- 38,42 ----
#include "ocd.h"
#include "ppc-tdep.h"
+ #include "regcache.h"
static void bdm_ppc_open (char *name, int from_tty);
diff -C2 -r -b -N ../gdb_cvs/src/gdb/ppc-linux-tdep.c src/gdb/ppc-linux-tdep.c
*** ../gdb_cvs/src/gdb/ppc-linux-tdep.c Thu Aug 31 20:47:06 2000
--- src/gdb/ppc-linux-tdep.c Mon Sep 11 22:20:29 2000
***************
*** 29,32 ****
--- 29,33 ----
#include "symfile.h"
#include "objfiles.h"
+ #include "regcache.h"
#include "ppc-tdep.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/regcache.c src/gdb/regcache.c
*** ../gdb_cvs/src/gdb/regcache.c Mon Sep 4 22:21:48 2000
--- src/gdb/regcache.c Tue Sep 12 21:04:16 2000
***************
*** 26,29 ****
--- 26,30 ----
#include "gdbarch.h"
#include "gdbcmd.h"
+ #include "regcache.h"
/*
diff -C2 -r -b -N ../gdb_cvs/src/gdb/regcache.h src/gdb/regcache.h
*** ../gdb_cvs/src/gdb/regcache.h Thu Jan 1 10:00:00 1970
--- src/gdb/regcache.h Tue Sep 12 20:54:18 2000
***************
*** 0 ****
--- 1,113 ----
+ /* Definitions for operations in regcache.c, for GDB.
+ Copyright 1986, 1987, 1989, 1992-1996, 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+ #if !defined (REGCACHE_H)
+ #define REGCACHE_H 1
+
+ #include "defs.h"
+
+ /* Definitions of register validity states. (As recorded by register_valid) */
+ #define REGISTER_CACHE_UNAVAILABLE (1)
+ #define REGISTER_CACHE_VALID (0)
+ #define REGISTER_CACHE_INVALID (-1)
+
+ /* Character array containing an image of the inferior programs'
+ registers.
+ TODO: Change all direct accesses to registers to calls to appropriate
+ functions, It is poor modularity to access global variables like this
+ directly. As well as prone to stuff ups. */
+
+ extern char *registers;
+
+ /* Character array containing the current state of each register
+ (unavailable<0, valid=0, invalid>0).
+ TODO: Do not extern this, and make accessor functions. */
+
+ extern signed char *register_valid;
+
+ extern int register_cached (int regno);
+
+ extern void register_changed (int regnum);
+
+ extern CORE_ADDR find_saved_register (struct frame_info *, int);
+
+ extern void get_saved_register (char *raw_buffer, int *optimized,
+ CORE_ADDR * addrp,
+ struct frame_info *frame,
+ int regnum, enum lval_type *lval);
+
+ extern int read_relative_register_raw_bytes (int, char *);
+
+ extern void registers_changed (void);
+
+ extern void registers_fetched (void);
+
+ extern void read_register_bytes (int regbyte, char *myaddr, int len);
+
+ extern void read_register_gen (int regno, char *myaddr);
+
+ extern void write_register_gen (int regno, char *myaddr);
+
+ extern void write_register_bytes (int regbyte, char *myaddr, int len);
+
+ /* Rename to read_unsigned_register()? */
+ extern ULONGEST read_register (int regno);
+
+ /* Rename to read_unsigned_register_pid()? */
+ extern ULONGEST read_register_pid (int regno, int pid);
+
+ extern LONGEST read_signed_register (int regno);
+
+ extern LONGEST read_signed_register_pid (int regno, int pid);
+
+ extern void write_register (int regno, LONGEST val);
+
+ extern void write_register_pid (int regno, CORE_ADDR val, int pid);
+
+ extern void supply_register (int regno, char *val);
+
+ extern CORE_ADDR generic_target_read_pc (int);
+
+ extern CORE_ADDR read_pc_pid (int);
+
+ extern CORE_ADDR read_pc (void);
+
+ extern void generic_target_write_pc (CORE_ADDR, int);
+
+ extern void write_pc_pid (CORE_ADDR, int);
+
+ extern void write_pc (CORE_ADDR);
+
+ extern void generic_target_write_sp (CORE_ADDR);
+
+ extern CORE_ADDR read_sp (void);
+
+ extern void write_sp (CORE_ADDR);
+
+ extern CORE_ADDR generic_target_read_fp (void);
+
+ extern CORE_ADDR read_fp (void);
+
+ extern void generic_target_write_fp (CORE_ADDR);
+
+ extern void write_fp (CORE_ADDR);
+
+
+ #endif /* !defined (REGCACHE_H) */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-adapt.c src/gdb/remote-adapt.c
*** ../gdb_cvs/src/gdb/remote-adapt.c Mon Sep 4 22:21:48 2000
--- src/gdb/remote-adapt.c Fri Sep 8 22:42:39 2000
***************
*** 45,48 ****
--- 45,49 ----
#include "target.h"
#include "gdbcore.h"
+ #include "regcache.h"
/* This processor is getting rusty but I am trying to keep it
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-array.c src/gdb/remote-array.c
*** ../gdb_cvs/src/gdb/remote-array.c Mon Sep 4 22:21:48 2000
--- src/gdb/remote-array.c Fri Sep 8 22:43:09 2000
***************
*** 40,43 ****
--- 40,44 ----
#include "inferior.h"
#include "version.h"
+ #include "regcache.h"
extern int baud_rate;
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-bug.c src/gdb/remote-bug.c
*** ../gdb_cvs/src/gdb/remote-bug.c Thu Aug 31 20:47:07 2000
--- src/gdb/remote-bug.c Sat Sep 9 21:27:34 2000
***************
*** 36,39 ****
--- 36,40 ----
#include "gdbcore.h"
#include "gdbcmd.h"
+ #include "regcache.h"
#include "remote-utils.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-e7000.c src/gdb/remote-e7000.c
*** ../gdb_cvs/src/gdb/remote-e7000.c Mon Sep 4 22:21:48 2000
--- src/gdb/remote-e7000.c Fri Sep 8 22:45:57 2000
***************
*** 50,53 ****
--- 50,54 ----
#include <time.h>
#include <ctype.h>
+ #include "regcache.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-eb.c src/gdb/remote-eb.c
*** ../gdb_cvs/src/gdb/remote-eb.c Mon Sep 4 22:21:48 2000
--- src/gdb/remote-eb.c Fri Sep 8 22:46:25 2000
***************
*** 42,45 ****
--- 42,46 ----
#include "target.h"
#include "gdbcore.h"
+ #include "regcache.h"
extern struct target_ops eb_ops; /* Forward declaration */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-mips.c src/gdb/remote-mips.c
*** ../gdb_cvs/src/gdb/remote-mips.c Mon Sep 4 22:21:49 2000
--- src/gdb/remote-mips.c Fri Sep 8 22:44:58 2000
***************
*** 32,35 ****
--- 32,36 ----
#include "remote-utils.h"
#include "gdb_string.h"
+ #include "regcache.h"
#include <signal.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-mm.c src/gdb/remote-mm.c
*** ../gdb_cvs/src/gdb/remote-mm.c Thu Aug 31 20:47:08 2000
--- src/gdb/remote-mm.c Fri Sep 8 22:50:07 2000
***************
*** 43,46 ****
--- 43,47 ----
#include "minimon.h"
#include "target.h"
+ #include "regcache.h"
/* Offset of member MEMBER in a struct of type TYPE. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-nindy.c src/gdb/remote-nindy.c
*** ../gdb_cvs/src/gdb/remote-nindy.c Thu Aug 31 20:47:08 2000
--- src/gdb/remote-nindy.c Fri Sep 8 23:03:09 2000
***************
*** 119,122 ****
--- 119,123 ----
#include "dcache.h"
#include "remote-utils.h"
+ #include "regcache.h"
static DCACHE *nindy_dcache;
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-os9k.c src/gdb/remote-os9k.c
*** ../gdb_cvs/src/gdb/remote-os9k.c Mon Sep 4 22:21:49 2000
--- src/gdb/remote-os9k.c Fri Sep 8 22:52:12 2000
***************
*** 53,56 ****
--- 53,57 ----
#include "objfiles.h"
#include "gdb-stabs.h"
+ #include "regcache.h"
struct cmd_list_element *showlist;
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-rdi.c src/gdb/remote-rdi.c
*** ../gdb_cvs/src/gdb/remote-rdi.c Thu Sep 7 20:18:26 2000
--- src/gdb/remote-rdi.c Sat Sep 9 21:10:19 2000
***************
*** 34,37 ****
--- 34,38 ----
#include "gdbcore.h"
#include "breakpoint.h"
+ #include "regcache.h"
#ifdef USG
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-rdp.c src/gdb/remote-rdp.c
*** ../gdb_cvs/src/gdb/remote-rdp.c Thu Sep 7 20:18:26 2000
--- src/gdb/remote-rdp.c Fri Sep 8 22:51:09 2000
***************
*** 49,52 ****
--- 49,53 ----
#include "gdb_string.h"
#include "gdbcore.h"
+ #include "regcache.h"
#ifdef HAVE_TIME_H
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-sds.c src/gdb/remote-sds.c
*** ../gdb_cvs/src/gdb/remote-sds.c Mon Sep 4 22:21:49 2000
--- src/gdb/remote-sds.c Sat Sep 9 21:06:18 2000
***************
*** 39,42 ****
--- 39,43 ----
#include "gdbcore.h"
#include "dcache.h"
+ #include "regcache.h"
#ifdef USG
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-sim.c src/gdb/remote-sim.c
*** ../gdb_cvs/src/gdb/remote-sim.c Thu Aug 31 20:47:09 2000
--- src/gdb/remote-sim.c Fri Sep 8 22:53:28 2000
***************
*** 38,41 ****
--- 38,42 ----
#include "remote-utils.h"
#include "command.h"
+ #include "regcache.h"
/* Prototypes */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-st.c src/gdb/remote-st.c
*** ../gdb_cvs/src/gdb/remote-st.c Mon Sep 4 22:21:49 2000
--- src/gdb/remote-st.c Fri Sep 8 22:54:42 2000
***************
*** 44,47 ****
--- 44,48 ----
#include <sys/types.h>
#include "serial.h"
+ #include "regcache.h"
extern struct target_ops st2000_ops; /* Forward declaration */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-udi.c src/gdb/remote-udi.c
*** ../gdb_cvs/src/gdb/remote-udi.c Thu Aug 31 20:47:09 2000
--- src/gdb/remote-udi.c Fri Sep 8 22:56:16 2000
***************
*** 49,52 ****
--- 49,53 ----
#include "bfd.h"
#include "gdbcore.h" /* For download function */
+ #include "regcache.h"
/* access the register store directly, without going through
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-utils.c src/gdb/remote-utils.c
*** ../gdb_cvs/src/gdb/remote-utils.c Mon Sep 4 22:21:49 2000
--- src/gdb/remote-utils.c Fri Sep 8 22:54:11 2000
***************
*** 51,54 ****
--- 51,55 ----
#include "inferior.h" /* for generic_mourn_inferior */
#include "remote-utils.h"
+ #include "regcache.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-vx.c src/gdb/remote-vx.c
*** ../gdb_cvs/src/gdb/remote-vx.c Thu Aug 31 20:47:10 2000
--- src/gdb/remote-vx.c Sat Sep 9 21:07:44 2000
***************
*** 34,37 ****
--- 34,38 ----
#include "objfiles.h"
#include "gdb-stabs.h"
+ #include "regcache.h"
#include "gdb_string.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote-vx29k.c src/gdb/remote-vx29k.c
*** ../gdb_cvs/src/gdb/remote-vx29k.c Thu Aug 31 20:47:10 2000
--- src/gdb/remote-vx29k.c Fri Sep 8 23:03:47 2000
***************
*** 33,36 ****
--- 33,37 ----
#include "symtab.h"
#include "symfile.h" /* for struct complaint */
+ #include "regcache.h"
#include "gdb_string.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/remote.c src/gdb/remote.c
*** ../gdb_cvs/src/gdb/remote.c Mon Sep 4 22:21:49 2000
--- src/gdb/remote.c Sat Sep 9 21:04:47 2000
***************
*** 39,42 ****
--- 39,43 ----
#include "dcache.h"
+ #include "regcache.h"
#include <ctype.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/rs6000-nat.c src/gdb/rs6000-nat.c
*** ../gdb_cvs/src/gdb/rs6000-nat.c Thu Aug 31 20:47:12 2000
--- src/gdb/rs6000-nat.c Mon Sep 11 22:56:51 2000
***************
*** 30,33 ****
--- 30,34 ----
#include "bfd.h"
#include "gdb-stabs.h"
+ #include "regcache.h"
#include <sys/ptrace.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/rs6000-tdep.c src/gdb/rs6000-tdep.c
*** ../gdb_cvs/src/gdb/rs6000-tdep.c Thu Aug 31 20:47:12 2000
--- src/gdb/rs6000-tdep.c Sat Sep 9 21:05:42 2000
***************
*** 39,42 ****
--- 39,43 ----
#include "ppc-tdep.h"
+ #include "regcache.h"
/* If the kernel has to deliver a signal, it pushes a sigcontext
diff -C2 -r -b -N ../gdb_cvs/src/gdb/sh-tdep.c src/gdb/sh-tdep.c
*** ../gdb_cvs/src/gdb/sh-tdep.c Thu Aug 31 20:47:14 2000
--- src/gdb/sh-tdep.c Fri Sep 8 22:25:13 2000
***************
*** 39,42 ****
--- 39,43 ----
#include "arch-utils.h"
#include "floatformat.h"
+ #include "regcache.h"
#undef XMALLOC
diff -C2 -r -b -N ../gdb_cvs/src/gdb/solib.c src/gdb/solib.c
*** ../gdb_cvs/src/gdb/solib.c Thu Aug 31 20:47:14 2000
--- src/gdb/solib.c Mon Sep 11 22:56:03 2000
***************
*** 55,58 ****
--- 55,59 ----
#include "language.h"
#include "gdbcmd.h"
+ #include "regcache.h"
#define MAX_PATH_SIZE 512 /* FIXME: Should be dynamic */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/somsolib.c src/gdb/somsolib.c
*** ../gdb_cvs/src/gdb/somsolib.c Thu Aug 31 20:47:15 2000
--- src/gdb/somsolib.c Mon Sep 11 22:24:21 2000
***************
*** 40,43 ****
--- 40,44 ----
#include "assert.h"
#include "language.h"
+ #include "regcache.h"
#include <fcntl.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/sparc-tdep.c src/gdb/sparc-tdep.c
*** ../gdb_cvs/src/gdb/sparc-tdep.c Thu Aug 31 20:47:16 2000
--- src/gdb/sparc-tdep.c Fri Sep 8 22:34:37 2000
***************
*** 31,34 ****
--- 31,35 ----
#include "bfd.h"
#include "gdb_string.h"
+ #include "regcache.h"
#ifdef USE_PROC_FS
diff -C2 -r -b -N ../gdb_cvs/src/gdb/sparcl-tdep.c src/gdb/sparcl-tdep.c
*** ../gdb_cvs/src/gdb/sparcl-tdep.c Thu Aug 31 20:47:16 2000
--- src/gdb/sparcl-tdep.c Mon Sep 11 22:25:58 2000
***************
*** 25,28 ****
--- 25,29 ----
#include "serial.h"
#include <sys/types.h>
+ #include "regcache.h"
#if (!defined(__GO32__) && !defined(_WIN32)) || defined(__CYGWIN32__)
diff -C2 -r -b -N ../gdb_cvs/src/gdb/symfile.c src/gdb/symfile.c
*** ../gdb_cvs/src/gdb/symfile.c Mon Sep 4 22:21:49 2000
--- src/gdb/symfile.c Mon Sep 11 23:01:56 2000
***************
*** 37,40 ****
--- 37,41 ----
#include "gdb-stabs.h"
#include "obstack.h"
+ #include "regcache.h"
#include <assert.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/symtab.c src/gdb/symtab.c
*** ../gdb_cvs/src/gdb/symtab.c Mon Sep 4 22:21:49 2000
--- src/gdb/symtab.c Mon Sep 11 22:58:07 2000
***************
*** 36,39 ****
--- 36,40 ----
#include "demangle.h"
#include "inferior.h"
+ #include "regcache.h"
#include "obstack.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/target.c src/gdb/target.c
*** ../gdb_cvs/src/gdb/target.c Thu Aug 31 20:47:18 2000
--- src/gdb/target.c Fri Sep 8 22:48:26 2000
***************
*** 33,36 ****
--- 33,37 ----
#include "gdb_wait.h"
#include <signal.h>
+ #include "regcache.h"
extern int errno;
diff -C2 -r -b -N ../gdb_cvs/src/gdb/thread-db.c src/gdb/thread-db.c
*** ../gdb_cvs/src/gdb/thread-db.c Mon Sep 4 04:41:28 2000
--- src/gdb/thread-db.c Sat Sep 9 21:16:10 2000
***************
*** 25,28 ****
--- 25,29 ----
#include "gdb_proc_service.h"
#include "gdb_thread_db.h"
+ #include "regcache.h"
#include "gdbthread.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/thread.c src/gdb/thread.c
*** ../gdb_cvs/src/gdb/thread.c Thu Aug 31 20:47:19 2000
--- src/gdb/thread.c Fri Sep 8 22:55:28 2000
***************
*** 32,35 ****
--- 32,36 ----
#include "command.h"
#include "gdbcmd.h"
+ #include "regcache.h"
#include <ctype.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/tic80-tdep.c src/gdb/tic80-tdep.c
*** ../gdb_cvs/src/gdb/tic80-tdep.c Thu Aug 31 20:47:19 2000
--- src/gdb/tic80-tdep.c Mon Sep 11 22:29:48 2000
***************
*** 29,32 ****
--- 29,33 ----
#include "gdbcore.h"
#include "symfile.h"
+ #include "regcache.h"
/* Function: frame_find_saved_regs
diff -C2 -r -b -N ../gdb_cvs/src/gdb/tracepoint.c src/gdb/tracepoint.c
*** ../gdb_cvs/src/gdb/tracepoint.c Mon Sep 4 22:21:50 2000
--- src/gdb/tracepoint.c Fri Sep 8 22:47:51 2000
***************
*** 35,38 ****
--- 35,39 ----
#include "ax.h"
#include "ax-gdb.h"
+ #include "regcache.h"
/* readline include files */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/umax-xdep.c src/gdb/umax-xdep.c
*** ../gdb_cvs/src/gdb/umax-xdep.c Thu Aug 31 20:47:20 2000
--- src/gdb/umax-xdep.c Mon Sep 11 22:44:13 2000
***************
*** 22,25 ****
--- 22,26 ----
#include "frame.h"
#include "inferior.h"
+ #include "regcache.h"
#include <sys/param.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/uw-thread.c src/gdb/uw-thread.c
*** ../gdb_cvs/src/gdb/uw-thread.c Thu Jul 6 12:03:19 2000
--- src/gdb/uw-thread.c Mon Sep 11 22:34:18 2000
***************
*** 103,106 ****
--- 103,107 ----
#include "inferior.h"
#include <fcntl.h>
+ #include "regcache.h"
/* <thread.h> includes <sys/priocntl.h>, which requires boolean_t from
diff -C2 -r -b -N ../gdb_cvs/src/gdb/v850-tdep.c src/gdb/v850-tdep.c
*** ../gdb_cvs/src/gdb/v850-tdep.c Thu Aug 31 20:47:20 2000
--- src/gdb/v850-tdep.c Mon Sep 11 22:31:22 2000
***************
*** 30,33 ****
--- 30,34 ----
#include "symfile.h"
#include "arch-utils.h"
+ #include "regcache.h"
diff -C2 -r -b -N ../gdb_cvs/src/gdb/v850ice.c src/gdb/v850ice.c
*** ../gdb_cvs/src/gdb/v850ice.c Thu Aug 31 20:47:21 2000
--- src/gdb/v850ice.c Fri Sep 8 22:58:41 2000
***************
*** 31,34 ****
--- 31,35 ----
#include "value.h"
#include "command.h"
+ #include "regcache.h"
#include <tcl.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/valops.c src/gdb/valops.c
*** ../gdb_cvs/src/gdb/valops.c Thu Aug 31 20:47:21 2000
--- src/gdb/valops.c Fri Sep 8 22:35:31 2000
***************
*** 31,34 ****
--- 31,35 ----
#include "language.h"
#include "gdbcmd.h"
+ #include "regcache.h"
#include <errno.h>
diff -C2 -r -b -N ../gdb_cvs/src/gdb/value.h src/gdb/value.h
*** ../gdb_cvs/src/gdb/value.h Mon Sep 4 22:21:51 2000
--- src/gdb/value.h Fri Sep 8 22:19:51 2000
***************
*** 463,501 ****
extern int record_latest_value (value_ptr val);
- extern void registers_changed (void);
-
- extern void read_register_bytes (int regbyte, char *myaddr, int len);
-
- extern void write_register_bytes (int regbyte, char *myaddr, int len);
-
- extern void read_register_gen (int regno, char *myaddr);
-
- extern void write_register_gen (int regno, char *myaddr);
-
- /* Rename to read_unsigned_register()? */
- extern ULONGEST read_register (int regno);
-
- extern LONGEST read_signed_register (int regno);
-
- /* Rename to read_unsigned_register_pid()? */
- extern ULONGEST read_register_pid (int regno, int pid);
-
- extern LONGEST read_signed_register_pid (int regno, int pid);
-
- extern void write_register (int regno, LONGEST val);
-
- extern void write_register_pid (int regno, CORE_ADDR val, int pid);
-
- extern void supply_register (int regno, char *val);
-
- extern int register_cached (int regno);
-
- extern void register_changed (int regnum);
-
- extern void get_saved_register (char *raw_buffer, int *optimized,
- CORE_ADDR * addrp,
- struct frame_info *frame,
- int regnum, enum lval_type *lval);
-
extern void
modify_field (char *addr, LONGEST fieldval, int bitpos, int bitsize);
--- 463,466 ----
diff -C2 -r -b -N ../gdb_cvs/src/gdb/w65-tdep.c src/gdb/w65-tdep.c
*** ../gdb_cvs/src/gdb/w65-tdep.c Thu Aug 31 20:47:22 2000
--- src/gdb/w65-tdep.c Sat Sep 9 21:21:24 2000
***************
*** 32,35 ****
--- 32,36 ----
#include "dis-asm.h"
#include "gdbcore.h"
+ #include "regcache.h"
/* Return the saved PC from this frame. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/win32-nat.c src/gdb/win32-nat.c
*** ../gdb_cvs/src/gdb/win32-nat.c Thu Aug 31 20:47:23 2000
--- src/gdb/win32-nat.c Fri Sep 8 22:44:18 2000
***************
*** 47,50 ****
--- 47,51 ----
#include <sys/param.h>
#include <unistd.h>
+ #include "regcache.h"
/* The ui's event loop. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/wince.c src/gdb/wince.c
*** ../gdb_cvs/src/gdb/wince.c Thu Aug 31 20:47:23 2000
--- src/gdb/wince.c Mon Sep 11 22:32:23 2000
***************
*** 57,60 ****
--- 57,61 ----
#include "dcache.h"
#include <time.h>
+ #include "regcache.h"
/* The ui's event loop. */
diff -C2 -r -b -N ../gdb_cvs/src/gdb/z8k-tdep.c src/gdb/z8k-tdep.c
*** ../gdb_cvs/src/gdb/z8k-tdep.c Thu Aug 31 20:47:24 2000
--- src/gdb/z8k-tdep.c Fri Sep 8 22:41:27 2000
***************
*** 32,35 ****
--- 32,37 ----
#include "dis-asm.h"
#include "gdbcore.h"
+ #include "regcache.h"
+
#include "value.h" /* For read_register() */
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@cygnus.com
From muller@cerbere.u-strasbg.fr Tue Sep 12 06:09:00 2000
From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATH RFA] Avoid Cannot read 0x20000000 on cygwin GDB
Date: Tue, 12 Sep 2000 06:09:00 -0000
Message-id: <200009121311.PAA17053@cerbere.u-strasbg.fr>
X-SW-Source: 2000-09/msg00107.html
Content-length: 1972
Very often I get
Cannot read memory at 0x2000000
when I try to do a backtrace in GDB compiled for Cygwin.
0x20000000 is the address of the minimal symbol __size_of_stack_reserve__
but the corresponding memory is not commited (at least not
as long as the stack is not allmost full).
When trying to backtrace on a level where the code is inside a DLL
(for instance the Cygwin DLL) without symbols, and at an adress higher than
0x20000000, the function get_pc_function_start () returns that value.
This comes from the fact that minimal symbols have no size and that one
has the highest value.
The code to check for the function prologue then fails because this address
is not valid.
I don't know if the same kind of trouble can appear on other targets,
but the patch should be harmless in other cases.
ChangeLog entry:
2000-09-12 Pierre Muller <muller@ics.u-strasbg.fr>
* blockframe.c (get_pc_function_start): return 0 if the minimal symbol
found is not
inside a section.
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.7
diff -b -c -r1.7 blockframe.c
*** blockframe.c 2000/09/01 23:39:11 1.7
--- blockframe.c 2000/09/12 12:51:00
***************
*** 556,561 ****
--- 556,563 ----
else if ((msymbol = lookup_minimal_symbol_by_pc (pc)) != NULL)
{
fstart = SYMBOL_VALUE_ADDRESS (msymbol);
+ if (!find_pc_section (fstart))
+ return 0;
}
else
{
PS: I didn't recieve any reaction to patch 5 and 6 for pascal support!
PPS: I am currently writing hardware watchpoint support for Cygwin via Page
protections,
it basically works except that I get troubles when the page protection is
triggered inside a system DLL code.
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
From cgf@cygnus.com Tue Sep 12 07:09:00 2000
From: Chris Faylor <cgf@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATH RFA] Avoid Cannot read 0x20000000 on cygwin GDB
Date: Tue, 12 Sep 2000 07:09:00 -0000
Message-id: <20000912100807.A1712@cygnus.com>
References: <200009121311.PAA17053@cerbere.u-strasbg.fr>
X-SW-Source: 2000-09/msg00108.html
Content-length: 2400
Thanks! This error has always bugged me. Your patch looks correct to
me but I don't know if it is valid for other platforms although I
suspect it is.
cgf
On Tue, Sep 12, 2000 at 03:00:03PM +0200, Pierre Muller wrote:
>
> Very often I get
>Cannot read memory at 0x2000000
>when I try to do a backtrace in GDB compiled for Cygwin.
>
> 0x20000000 is the address of the minimal symbol __size_of_stack_reserve__
>but the corresponding memory is not commited (at least not
>as long as the stack is not allmost full).
>
> When trying to backtrace on a level where the code is inside a DLL
>(for instance the Cygwin DLL) without symbols, and at an adress higher than
>0x20000000, the function get_pc_function_start () returns that value.
>This comes from the fact that minimal symbols have no size and that one
>has the highest value.
>
> The code to check for the function prologue then fails because this address
>is not valid.
>
> I don't know if the same kind of trouble can appear on other targets,
>but the patch should be harmless in other cases.
>
>
>ChangeLog entry:
>
>2000-09-12 Pierre Muller <muller@ics.u-strasbg.fr>
> * blockframe.c (get_pc_function_start): return 0 if the minimal symbol
>found is not
> inside a section.
>
>
>Index: blockframe.c
>===================================================================
>RCS file: /cvs/src/src/gdb/blockframe.c,v
>retrieving revision 1.7
>diff -b -c -r1.7 blockframe.c
>*** blockframe.c 2000/09/01 23:39:11 1.7
>--- blockframe.c 2000/09/12 12:51:00
>***************
>*** 556,561 ****
>--- 556,563 ----
> else if ((msymbol = lookup_minimal_symbol_by_pc (pc)) != NULL)
> {
> fstart = SYMBOL_VALUE_ADDRESS (msymbol);
>+ if (!find_pc_section (fstart))
>+ return 0;
> }
> else
> {
>
>
>PS: I didn't recieve any reaction to patch 5 and 6 for pascal support!
>
>PPS: I am currently writing hardware watchpoint support for Cygwin via Page
>protections,
>it basically works except that I get troubles when the page protection is
>triggered inside a system DLL code.
>
>
>
>Pierre Muller
>Institut Charles Sadron
>6,rue Boussingault
>F 67083 STRASBOURG CEDEX (France)
> mailto:muller@ics.u-strasbg.fr
>Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
--
cgf@cygnus.com Cygnus Solutions, a Red Hat company
http://sourceware.cygnus.com/ http://www.redhat.com/
From cgf@cygnus.com Tue Sep 12 07:12:00 2000
From: Chris Faylor <cgf@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATH RFA] Avoid Cannot read 0x20000000 on cygwin GDB
Date: Tue, 12 Sep 2000 07:12:00 -0000
Message-id: <20000912101123.B1712@cygnus.com>
References: <200009121311.PAA17053@cerbere.u-strasbg.fr>
X-SW-Source: 2000-09/msg00109.html
Content-length: 849
Oops. Didn't read to the end.
On Tue, Sep 12, 2000 at 03:00:03PM +0200, Pierre Muller wrote:
>PS: I didn't recieve any reaction to patch 5 and 6 for pascal support!
Do you have URLs for this? I assume that the patches aren't in pascal-specific
sections of the code since you're the maintainer.
>PPS: I am currently writing hardware watchpoint support for Cygwin via Page
>protections,
>it basically works except that I get troubles when the page protection is
>triggered inside a system DLL code.
Couldn't you kludge this by not allowing hardware points on sections of code
in a system DLL as determined by whether the DLL path includes the windows
system directory? I do something similar for the cygwin DLL.
Hardware watchpoints would be much appreciated.
Actually, someone else working on the win32-nat.c stuff is much appreciated!
cgf
From ezannoni@cygnus.com Tue Sep 12 07:34:00 2000
From: Elena Zannoni <ezannoni@cygnus.com>
To: Kevin Buettner <kevinb@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com, Elena Zannoni <ezannoni@cygnus.com>
Subject: Re: [PATCH RFA] objfile_relocate() changes
Date: Tue, 12 Sep 2000 07:34:00 -0000
Message-id: <14782.16114.801471.533642@kwikemart.cygnus.com>
References: <1000909210901.ZM14412@ocotillo.lan>
X-SW-Source: 2000-09/msg00110.html
Content-length: 2903
Kevin Buettner writes:
> In the patch below, there's a big hunk of code which is being replaced
> by a smaller and simpler hunk of code. The big hunk of code that's
> getting replaced has at least two problems with it.
>
> The first is that SECT_OFF_TEXT, SECT_OFF_DATA, and SECT_OFF_BSS can
> be -1 if the corresponding section doesn't exist in the objfile. In
> the code below, this is bad because these values are used as array
> indices via the ANOFFSET macro and the arrays in question are not
> designed to accomodate negative indices.
>
> The second problem with this code is that it is a mistake to assume
> that all sections with (e.g.) SEC_CODE set in the bfd flags should be
> relocated by the amount given by SECT_OFF_TEXT. (I am working on
> a target where this is causing problems.)
>
> It is far better to get the correct index for use with the ANOFFSET
> macro. (Which is what the smaller, simpler hunk of code does.)
>
> I have one concern about my patch... The `index' field is supposed to
> be a private bfd field. There are already several places in the gdb
> sources where we use it though. If we're going to persist in using
> it, I think we ought to expose this field by adding a suitable macro
> definition for bfd_get_section_index to bfd-in.h and then revise the
> gdb sources accordingly.
Probably so.
>
> Comments?
>
> Okay to commit?
>
OK. Thanks for getting rid of another few instances of SECT_OFF_*
Elena
> * objfiles.c (objfile_relocate): Don't assume that offsets
> associated with one of SECT_OFF_TEXT, SECT_OFF_DATA, or
> SECT_OFF_BSS will be adequate for relocating all of the
> sections in an objfile.
>
> Index: objfiles.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/objfiles.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 objfiles.c
> --- objfiles.c 2000/08/07 15:02:48 1.9
> +++ objfiles.c 2000/09/09 20:40:20
> @@ -650,25 +650,10 @@ objfile_relocate (struct objfile *objfil
>
> ALL_OBJFILE_OSECTIONS (objfile, s)
> {
> - flagword flags;
> -
> - flags = bfd_get_section_flags (abfd, s->the_bfd_section);
> -
> - if (flags & SEC_CODE)
> - {
> - s->addr += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
> - s->endaddr += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
> - }
> - else if (flags & (SEC_DATA | SEC_LOAD))
> - {
> - s->addr += ANOFFSET (delta, SECT_OFF_DATA (objfile));
> - s->endaddr += ANOFFSET (delta, SECT_OFF_DATA (objfile));
> - }
> - else if (flags & SEC_ALLOC)
> - {
> - s->addr += ANOFFSET (delta, SECT_OFF_BSS (objfile));
> - s->endaddr += ANOFFSET (delta, SECT_OFF_BSS (objfile));
> - }
> + int idx = s->the_bfd_section->index;
> +
> + s->addr += ANOFFSET (delta, idx);
> + s->endaddr += ANOFFSET (delta, idx);
> }
> }
>
>
From taylor@cygnus.com Tue Sep 12 08:02:00 2000
From: David Taylor <taylor@cygnus.com>
To: Pierre Muller <muller@cerbere.u-strasbg.fr>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATH RFA] Avoid Cannot read 0x20000000 on cygwin GDB
Date: Tue, 12 Sep 2000 08:02:00 -0000
Message-id: <200009121501.LAA11766@texas.cygnus.com>
X-SW-Source: 2000-09/msg00111.html
Content-length: 1455
Date: Tue, 12 Sep 2000 15:00:03 +0200
From: Pierre Muller <muller@cerbere.u-strasbg.fr>
[...]
PS: I didn't recieve any reaction to patch 5 and 6 for pascal support!
PPS: I am currently writing hardware watchpoint support for Cygwin via Page
protections,
it basically works except that I get troubles when the page protection is
triggered inside a system DLL code.
I replied to patch 5 on 01 Sep 2000; you replied on 04 Sep 2000 with
"Committed, thanks." I don't recall seeing a patch 6.
To: Pierre Muller <muller@cerbere.u-strasbg.fr>
cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH RFA] pascal language part 5 : support for 'info type'
Date: Fri, 01 Sep 2000 14:55:41 -0400
From: David Taylor <taylor@texas.cygnus.com>
From: Pierre Muller <muller@cerbere.u-strasbg.fr>
Date: Thu, 31 Aug 2000 10:30:29 +0200
Path: cygnus.com!not-for-mail
The current CVS tree gives the following output for
a pascal executable:
(gdb) info type
Language not supported
This is due to missing support of language_pascal in the
c_typedef_print function in c-typeprint.c source.
However this function is not C specific at all, thus my patch
removes c_typedef_print from c-typeprint.c and replaces it by
a new function typedef_print in typeprint.c source.
(typedef_print function is just the old c_typedef_print function
with pascal language support added !)
Approved.
From muller@cerbere.u-strasbg.fr Tue Sep 12 08:55:00 2000
From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: David Taylor <taylor@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATH RFA] Avoid Cannot read 0x20000000 on cygwin GDB
Date: Tue, 12 Sep 2000 08:55:00 -0000
Message-id: <200009121557.RAA20518@cerbere.u-strasbg.fr>
X-SW-Source: 2000-09/msg00112.html
Content-length: 828
At 17:01 12/09/00 , David Taylor wrote:
> Date: Tue, 12 Sep 2000 15:00:03 +0200
> From: Pierre Muller <muller@cerbere.u-strasbg.fr>
>[...]
> PS: I didn't recieve any reaction to patch 5 and 6 for pascal support!
>
>
>I replied to patch 5 on 01 Sep 2000; you replied on 04 Sep 2000 with
>"Committed, thanks." I don't recall seeing a patch 6.
Whoops, sorry, you are right, patch 5 is already integrated.
Concerning patch 6,
Subject: [PATCH RFC] pascal pointer type names
see
http://sources.redhat.com/ml/gdb-patches/2000-09/msg00029.html
But this is a change in symtab.c, so the approval should come from
Jim Blandy or Elena Zannoni.
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
From muller@cerbere.u-strasbg.fr Tue Sep 12 09:04:00 2000
From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: gdb-patches@sources.redhat.com
Subject: Re: [PATH RFA] Avoid Cannot read 0x20000000 on cygwin GDB
Date: Tue, 12 Sep 2000 09:04:00 -0000
Message-id: <200009121607.SAA20651@cerbere.u-strasbg.fr>
References: <200009121311.PAA17053@cerbere.u-strasbg.fr>
X-SW-Source: 2000-09/msg00113.html
Content-length: 1624
>>PPS: I am currently writing hardware watchpoint support for Cygwin via Page
>>protections,
>>it basically works except that I get troubles when the page protection is
>>triggered inside a system DLL code.
>
>Couldn't you kludge this by not allowing hardware points on sections of code
>in a system DLL as determined by whether the DLL path includes the windows
>system directory? I do something similar for the cygwin DLL.
The problem is that if a page protection error happens in normal code,
and that the address is not a watchpoint, the page protection is
removed, a single step is made and the page protection is turned on again.
If the same happens inside a system call
(I suspect any DLL loaded a address above 0x8000000)
then single step setting by changing the trace bit does not work !
Setting a breakpoint inside system DLL probably also will not work
(I must confess that I didn't even try!)
So, I simply try to go up the stack and I palce a breakpoint at the first
return address that is in normal code.
This will miss any further watchpoint at the same page... but nothing is
never perfect :(
Furthermore, for the moment, my code fails if a second page protection
fault is
triggered before reaching the breakpoint set.
>Hardware watchpoints would be much appreciated.
>
>Actually, someone else working on the win32-nat.c stuff is much appreciated!
I was tired of not being able to watch variables with win32 GDB !!
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
From dberlin@redhat.com Tue Sep 12 09:12:00 2000
From: Daniel Berlin <dberlin@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA]: Revised C++ patch
Date: Tue, 12 Sep 2000 09:12:00 -0000
Message-id: <m3vgw1k2ri.fsf@dan2.cygnus.com>
X-SW-Source: 2000-09/msg00114.html
Content-length: 18566
This is the revised patch, which is my last patch - the gratuitous
formatting changes + a solution for the memory leak.
I need approval from a symtab.c maintainer.
Changelog entry:
2000-09-12 Daniel Berlin <dberlin@redhat.com>
* symtab.c: Add lookup_symbol_aux prototype, and make it static.
(lookup_symbol): Made into wrapper for lookup_symbol_aux, so we
can perform case sensitivity/demangling without leaking memory.
Moved code to do demangling/case sensitivity from
old_lookup_symbol to here.
(lookup_symbol_aux): Renamed from lookup_symbol. Removed code to
do demangling/case sensitivity. Now done in new lookup_symbol.
2000-09-12 Alexandre Oliva <aoliva@redhat.com>
* MAINTAINERS: Added myself.
*************** Fri Aug 25 12:03:15 2000 David Taylor
*** 487,492 ****
--- 497,522 ----
* value.h (struct value) <lazy>: Add a comment about its use for
watchpoints.
2000-08-10 Daniel Berlin <dberlin@redhat.com>
* valops.c (typecmp): Properly handle reference arguments.
* symtab.h (OPNAME_PREFIX_P): Change operator prefix to correct value.
* symtab.c (decode_line_1): Properly handle complex templates
without quoting.
(completion_list_add_name): Fix completion problems
with C++ completions.
(lookup_partial_symbol): Remove linear search for C++.
(lookup_symbol): Record blocks we've already checked. Also,
demangle names before searching.
(lookup_block_symbol): Stop using linear search for C++.
(gdb_mangle_name): Properly handle operators.
* symfile.c (compare_symbols): Use SYMBOL_SOURCE_NAME instead of
SYMBOL_NAME.
(compare_psymbols): Same here.
Patch follows:
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.675
diff -c -3 -p -w -B -b -r1.675 ChangeLog
*** ChangeLog 2000/09/12 04:58:22 1.675
--- ChangeLog 2000/09/12 16:03:06
***************
*** 1,3 ****
--- 1,13 ----
+ 2000-09-12 Daniel Berlin <dberlin@redhat.com>
+
+ * symtab.c: Add lookup_symbol_aux prototype, and make it static.
+ (lookup_symbol): Made into wrapper for lookup_symbol_aux, so we
+ can perform case sensitivity/demangling without leaking memory.
+ Moved code to do demangling/case sensitivity from
+ old_lookup_symbol to here.
+ (lookup_symbol_aux): Renamed from lookup_symbol. Removed code to
+ do demangling/case sensitivity. Now done in new lookup_symbol.
+
2000-09-12 Alexandre Oliva <aoliva@redhat.com>
* MAINTAINERS: Added myself.
*************** Fri Aug 25 12:03:15 2000 David Taylor
*** 487,492 ****
--- 497,522 ----
* value.h (struct value) <lazy>: Add a comment about its use for
watchpoints.
+ 2000-08-10 Daniel Berlin <dberlin@redhat.com>
+
+ * valops.c (typecmp): Properly handle reference arguments.
+
+ * symtab.h (OPNAME_PREFIX_P): Change operator prefix to correct value.
+
+ * symtab.c (decode_line_1): Properly handle complex templates
+ without quoting.
+ (completion_list_add_name): Fix completion problems
+ with C++ completions.
+ (lookup_partial_symbol): Remove linear search for C++.
+ (lookup_symbol): Record blocks we've already checked. Also,
+ demangle names before searching.
+ (lookup_block_symbol): Stop using linear search for C++.
+ (gdb_mangle_name): Properly handle operators.
+
+ * symfile.c (compare_symbols): Use SYMBOL_SOURCE_NAME instead of
+ SYMBOL_NAME.
+ (compare_psymbols): Same here.
+
2000-08-12 Kevin Buettner <kevinb@redhat.com>
* cxux-nat.c (fetch_inferior_registers): Protoize.
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.18
diff -c -3 -p -w -B -b -r1.18 symfile.c
*** symfile.c 2000/09/02 00:09:06 1.18
--- symfile.c 2000/09/12 16:03:07
*************** compare_symbols (const PTR s1p, const PT
*** 212,219 ****
s1 = (struct symbol **) s1p;
s2 = (struct symbol **) s2p;
!
! return (STRCMP (SYMBOL_NAME (*s1), SYMBOL_NAME (*s2)));
}
/*
--- 209,215 ----
s1 = (struct symbol **) s1p;
s2 = (struct symbol **) s2p;
! return (STRCMP (SYMBOL_SOURCE_NAME (*s1), SYMBOL_SOURCE_NAME (*s2)));
}
/*
*************** compare_symbols (const PTR s1p, const PT
*** 241,248 ****
static int
compare_psymbols (const PTR s1p, const PTR s2p)
{
! register char *st1 = SYMBOL_NAME (*(struct partial_symbol **) s1p);
! register char *st2 = SYMBOL_NAME (*(struct partial_symbol **) s2p);
if ((st1[0] - st2[0]) || !st1[0])
{
--- 237,250 ----
static int
compare_psymbols (const PTR s1p, const PTR s2p)
{
! register struct partial_symbol **s1, **s2;
! register char *st1, *st2;
!
! s1 = (struct partial_symbol **) s1p;
! s2 = (struct partial_symbol **) s2p;
! st1 = SYMBOL_SOURCE_NAME (*s1);
! st2 = SYMBOL_SOURCE_NAME (*s2);
!
if ((st1[0] - st2[0]) || !st1[0])
{
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.15
diff -c -3 -p -w -B -b -r1.15 symtab.c
*** symtab.c 2000/09/04 08:29:25 1.15
--- symtab.c 2000/09/12 16:03:08
*************** static struct partial_symbol *lookup_par
*** 83,88 ****
--- 83,95 ----
static struct symtab *lookup_symtab_1 (char *);
+ static struct symbol *lookup_symbol_aux (const char *name, const
+ struct block *block, const
+ namespace_enum namespace, int
+ *is_a_field_of_this, struct
+ symtab **symtab);
+
+
static void cplusplus_hint (char *);
static struct symbol *find_active_alias (struct symbol *sym, CORE_ADDR addr);
*************** gdb_mangle_name (struct type *type, int
*** 296,301 ****
--- 303,311 ----
char buf[20];
int len = (newname == NULL ? 0 : strlen (newname));
+ if (OPNAME_PREFIX_P (field_name))
+ return physname;
+
is_full_physname_constructor =
((physname[0] == '_' && physname[1] == '_' &&
(isdigit (physname[2]) || physname[2] == 'Q' || physname[2] == 't'))
*************** gdb_mangle_name (struct type *type, int
*** 331,355 ****
sprintf (buf, "__%s%s%d", const_prefix, volatile_prefix, len);
}
mangled_name_len = ((is_constructor ? 0 : strlen (field_name))
! + strlen (buf) + len
! + strlen (physname)
! + 1);
!
! /* Only needed for GNU-mangled names. ANSI-mangled names
! work with the normal mechanisms. */
! if (OPNAME_PREFIX_P (field_name))
! {
! const char *opname = cplus_mangle_opname (field_name + 3, 0);
! if (opname == NULL)
! error ("No mangling for \"%s\"", field_name);
! mangled_name_len += strlen (opname);
! mangled_name = (char *) xmalloc (mangled_name_len);
- strncpy (mangled_name, field_name, 3);
- mangled_name[3] = '\0';
- strcat (mangled_name, opname);
- }
- else
{
mangled_name = (char *) xmalloc (mangled_name_len);
if (is_constructor)
--- 341,348 ----
sprintf (buf, "__%s%s%d", const_prefix, volatile_prefix, len);
}
mangled_name_len = ((is_constructor ? 0 : strlen (field_name))
! + strlen (buf) + len + strlen (physname) + 1);
{
mangled_name = (char *) xmalloc (mangled_name_len);
if (is_constructor)
*************** fixup_psymbol_section (struct partial_sy
*** 550,555 ****
--- 540,553 ----
return psym;
}
+ /* We seem to be looking things up in the same block >1 times, because
+ of the global search.*/
+
+ #define BLOCK_LOOKUP_HASH_SIZE 16
+ static const struct block *checked_blocks[BLOCK_LOOKUP_HASH_SIZE];
+
+
+
/* Find the definition for a specified symbol name NAME
in namespace NAMESPACE, visible from lexical block BLOCK.
Returns the struct symbol pointer, or zero if no symbol is found.
*************** fixup_psymbol_section (struct partial_sy
*** 572,588 ****
can probably assume it will never hit the C++ code). */
struct symbol *
! lookup_symbol (const char *name, register const struct block *block,
const namespace_enum namespace, int *is_a_field_of_this,
struct symtab **symtab)
{
! register struct symbol *sym;
! register struct symtab *s = NULL;
! register struct partial_symtab *ps;
! struct blockvector *bv;
! register struct objfile *objfile = NULL;
! register struct block *b;
! register struct minimal_symbol *msymbol;
if (case_sensitivity == case_sensitive_off)
{
--- 570,583 ----
can probably assume it will never hit the C++ code). */
struct symbol *
! lookup_symbol (const char *name, const struct block *block,
const namespace_enum namespace, int *is_a_field_of_this,
struct symtab **symtab)
{
! char *modified_name = NULL;
! char *modified_name2 = NULL;
! int needtofreename=1;
! struct symbol *returnval;
if (case_sensitivity == case_sensitive_off)
{
*************** lookup_symbol (const char *name, registe
*** 594,602 ****
for (i= 0; i < len; i++)
copy[i] = tolower (name[i]);
copy[len] = 0;
! name = copy;
}
/* Search specified block and its superiors. */
while (block != 0)
--- 589,641 ----
for (i = 0; i < len; i++)
copy[i] = tolower (name[i]);
copy[len] = 0;
! modified_name = copy;
}
+ else
+ {
+ modified_name = (char *)name;
+ }
+
+ /* If we are using C++ language, demangle the name before doing a lookup, so
+ we can always binary search. */
+ if (current_language->la_language == language_cplus)
+ {
+ modified_name2 = cplus_demangle (modified_name, DMGL_ANSI |
+ DMGL_PARAMS);
+ }
+ else
+ {
+ needtofreename=0;
+ }
+
+ if (!modified_name2)
+ {
+ modified_name2 = modified_name;
+ needtofreename=0;
+ }
+ returnval = lookup_symbol_aux (modified_name2, block, namespace,
+ is_a_field_of_this, symtab);
+ if (needtofreename)
+ free(modified_name2);
+
+ return returnval;
+ }
+
+ static struct symbol *
+ lookup_symbol_aux (const char *name, const struct block *block,
+ const namespace_enum namespace, int *is_a_field_of_this,
+ struct symtab **symtab)
+ {
+ register struct symbol *sym;
+ register struct symtab *s = NULL;
+ register struct partial_symtab *ps;
+ register struct blockvector *bv;
+ register struct objfile *objfile = NULL;
+ register struct block *b;
+ register struct minimal_symbol *msymbol;
+ memset (&checked_blocks, 0, sizeof (checked_blocks));
+
/* Search specified block and its superiors. */
while (block != 0)
*************** lookup_symbol (const char *name, registe
*** 690,697 ****
--- 728,748 ----
ALL_SYMTABS (objfile, s)
{
+ register unsigned long hashval;
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+ /* Check if we already tried here */
+ hashval = hash ((unsigned int *) &block, sizeof (struct block *)) %
+ BLOCK_LOOKUP_HASH_SIZE;
+
+ if ((checked_blocks[hashval] != NULL) && checked_blocks[hashval] == block)
+ {
+ continue;
+ }
+ else
+ {
+ checked_blocks[hashval] = block;
+ }
sym = lookup_block_symbol (block, name, namespace);
if (sym)
{
*************** lookup_partial_symbol (struct partial_sy
*** 987,993 ****
{
do_linear_search = 1;
}
! if (STRCMP (SYMBOL_NAME (*center), name) >= 0)
{
top = center;
}
--- 1040,1046 ----
{
do_linear_search = 1;
}
! if (STRCMP (SYMBOL_SOURCE_NAME (*center), name) >= 0)
{
top = center;
}
*************** lookup_block_symbol (register const stru
*** 1190,1198 ****
{
/* Reset the linear search flag so if the binary search fails, we
won't do the linear search once unless we find some reason to
! do so, such as finding a C++ symbol during the binary search.
! Note that for C++ modules, ALL the symbols in a block should
! end up marked as C++ symbols. */
do_linear_search = 0;
top = BLOCK_NSYMS (block);
--- 1245,1251 ----
{
/* Reset the linear search flag so if the binary search fails, we
won't do the linear search once unless we find some reason to
! do so */
do_linear_search = 0;
top = BLOCK_NSYMS (block);
*************** lookup_block_symbol (register const stru
*** 1210,1231 ****
}
inc = (inc >> 1) + bot;
sym = BLOCK_SYM (block, inc);
! if (!do_linear_search
! && (SYMBOL_LANGUAGE (sym) == language_cplus
! || SYMBOL_LANGUAGE (sym) == language_java
! ))
{
do_linear_search = 1;
}
! if (SYMBOL_NAME (sym)[0] < name[0])
{
bot = inc;
}
! else if (SYMBOL_NAME (sym)[0] > name[0])
{
top = inc;
}
! else if (STRCMP (SYMBOL_NAME (sym), name) < 0)
{
bot = inc;
}
--- 1263,1281 ----
}
inc = (inc >> 1) + bot;
sym = BLOCK_SYM (block, inc);
! if (!do_linear_search && (SYMBOL_LANGUAGE (sym) == language_java))
{
do_linear_search = 1;
}
! if (SYMBOL_SOURCE_NAME (sym)[0] < name[0])
{
bot = inc;
}
! else if (SYMBOL_SOURCE_NAME (sym)[0] > name[0])
{
top = inc;
}
! else if (STRCMP (SYMBOL_SOURCE_NAME (sym), name) < 0)
{
bot = inc;
}
*************** lookup_block_symbol (register const stru
*** 1247,1265 ****
while (bot < top)
{
sym = BLOCK_SYM (block, bot);
! inc = SYMBOL_NAME (sym)[0] - name[0];
! if (inc == 0)
! {
! inc = STRCMP (SYMBOL_NAME (sym), name);
! }
! if (inc == 0 && SYMBOL_NAMESPACE (sym) == namespace)
! {
! return (sym);
! }
! if (inc > 0)
! {
! break;
! }
bot++;
}
}
--- 1297,1304 ----
while (bot < top)
{
sym = BLOCK_SYM (block, bot);
! if (SYMBOL_MATCHES_NAME (sym, name))
! return sym;
bot++;
}
}
*************** decode_line_1 (char **argptr, int funfir
*** 2473,2478 ****
--- 2511,2517 ----
register struct minimal_symbol *msymbol;
char *copy;
struct symbol *sym_class;
+ int triedonce = 0;
int i1;
int is_quoted;
int is_quote_enclosed;
*************** decode_line_1 (char **argptr, int funfir
*** 2583,2595 ****
}
else
is_quote_enclosed = 0;
for (; *p; p++)
{
if (p[0] == '<')
{
char *temp_end = find_template_name_end (p);
! if (!temp_end)
error ("malformed template specification in command");
p = temp_end;
}
/* Check for the end of the first half of the linespec. End of line,
--- 2622,2647 ----
}
else
is_quote_enclosed = 0;
+ tryagain:
for (; *p; p++)
{
if (p[0] == '<')
{
char *temp_end = find_template_name_end (p);
! if (!temp_end && !triedonce)
! {
! triedonce = 1;
! is_quote_enclosed = 1;
! p = *argptr;
! if (has_comma)
! *ii = ',';
! s = NULL;
! goto tryagain;
! }
! else if (!temp_end && triedonce)
! {
error ("malformed template specification in command");
+ }
p = temp_end;
}
/* Check for the end of the first half of the linespec. End of line,
*************** decode_line_1 (char **argptr, int funfir
*** 2798,2806 ****
if (OPNAME_PREFIX_P (copy))
{
! tmp = (char *) alloca (strlen (copy + 3) + 9);
strcpy (tmp, "operator ");
! strcat (tmp, copy + 3);
}
else
tmp = copy;
--- 2856,2864 ----
if (OPNAME_PREFIX_P (copy))
{
! tmp = (char *) alloca (strlen (copy + 8) + 9);
strcpy (tmp, "operator ");
! strcat (tmp, copy + 8);
}
else
tmp = copy;
*************** make_symbol_completion_list (char *text,
*** 4177,4194 ****
return NULL;
else
{
! /* It is not a quoted string. Break it based on the characters
! which are in symbols. */
! while (p > text)
{
! if (isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0')
! --p;
! else
break;
}
sym_text = p;
}
}
sym_text_len = strlen (sym_text);
--- 4244,4262 ----
return NULL;
else
{
! for (p = text; *p != '\0'; ++p)
{
! if (!isprint (*p))
break;
}
+ if (*p != '\0')
+ {
sym_text = p;
}
+ else
+ sym_text = text;
}
+ }
sym_text_len = strlen (sym_text);
Index: symtab.h
===================================================================
RCS file: /cvs/src/src/gdb/symtab.h,v
retrieving revision 1.13
diff -c -3 -p -w -B -b -r1.13 symtab.h
*** symtab.h 2000/08/07 15:02:48 1.13
--- symtab.h 2000/09/12 16:03:08
*************** extern CORE_ADDR symbol_overlayed_addres
*** 170,175 ****
--- 170,177 ----
#define SYMBOL_INIT_DEMANGLED_NAME(symbol,obstack) \
do { \
char *demangled = NULL; \
+ if (SYMBOL_LANGUAGE (symbol) == language_unknown) \
+ SYMBOL_LANGUAGE(symbol) = language_auto; \
if (SYMBOL_LANGUAGE (symbol) == language_cplus \
|| SYMBOL_LANGUAGE (symbol) == language_auto) \
{ \
*************** extern CORE_ADDR symbol_overlayed_addres
*** 222,231 ****
SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL; \
} \
} \
- if (SYMBOL_LANGUAGE (symbol) == language_auto) \
- { \
- SYMBOL_LANGUAGE (symbol) = language_unknown; \
- } \
} while (0)
/* Macro that returns the demangled name for a symbol based on the language
--- 224,229 ----
*************** struct partial_symtab
*** 1053,1059 ****
Note that this macro is g++ specific (FIXME). */
#define OPNAME_PREFIX_P(NAME) \
! ((NAME)[0] == 'o' && (NAME)[1] == 'p' && is_cplus_marker ((NAME)[2]))
/* Macro that yields non-zero value iff NAME is the prefix for C++ vtbl
names. Note that this macro is g++ specific (FIXME).
--- 1049,1055 ----
Note that this macro is g++ specific (FIXME). */
#define OPNAME_PREFIX_P(NAME) \
! (!strncmp(NAME,"operator",8))
/* Macro that yields non-zero value iff NAME is the prefix for C++ vtbl
names. Note that this macro is g++ specific (FIXME).
prev parent reply other threads:[~2000-09-11 11:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-09-09 13:20 Kevin Buettner
2000-09-11 11:37 ` Kevin Buettner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1000911183732.ZM28866@ocotillo.lan \
--to=kevinb@cygnus.com \
--cc=gdb-patches@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox