* [patch/resend/rfa] (3/4) Remove DEPRECATED_CLEAN_UP_REGISTER_VALUE
@ 2004-04-14 6:24 Randolph Chung
2004-04-15 15:34 ` Andrew Cagney
0 siblings, 1 reply; 3+ messages in thread
From: Randolph Chung @ 2004-04-14 6:24 UTC (permalink / raw)
To: gdb-patches
2004-04-13 Randolph Chung <tausq@debian.org>
* hppa-tdep.c (hppa_pseudo_register_read): Define.
(hppa_gdbarch_init): Set pseudo_register_read.
* config/pa/tm-hppa.h (DEPRECATED_CLEAN_UP_REGISTER_VALUE): Remove.
* regcache.c (supply_register): Remove check for
DEPRECATED_CLEAN_UP_REGISTER_VALUE since we've removed the last user.
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.143
diff -u -p -r1.143 hppa-tdep.c
--- hppa-tdep.c 11 Apr 2004 04:20:51 -0000 1.143
+++ hppa-tdep.c 14 Apr 2004 05:01:21 -0000
@@ -2566,6 +2537,15 @@ hppa_fetch_pointer_argument (struct fram
return addr;
}
+static void
+hppa_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+ int regnum, void *buf)
+{
+ regcache_raw_read (regcache, regnum, buf);
+ if (regnum == PCOQ_HEAD_REGNUM || regnum == PCOQ_TAIL_REGNUM)
+ ((char *)buf)[sizeof(CORE_ADDR) -1 ] &= ~0x3;
+}
+
/* Here is a table of C type sizes on hppa with various compiles
and options. I measured this on PA 9000/800 with HP-UX 11.11
and these compilers:
@@ -2725,6 +2725,8 @@ hppa_gdbarch_init (struct gdbarch_info i
frame_unwind_append_sniffer (gdbarch, hppa_frame_unwind_sniffer);
frame_base_append_sniffer (gdbarch, hppa_frame_base_sniffer);
+ set_gdbarch_pseudo_register_read (gdbarch, hppa_pseudo_register_read);
+
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
Index: config/pa/tm-hppa.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppa.h,v
retrieving revision 1.69
diff -u -p -r1.69 tm-hppa.h
--- config/pa/tm-hppa.h 6 Apr 2004 16:11:06 -0000 1.69
+++ config/pa/tm-hppa.h 14 Apr 2004 05:01:27 -0000
@@ -77,18 +77,8 @@ extern int hppa_pc_requires_run_before_u
#define ARG2_REGNUM 24 /* The third argument of a callee. */
#define ARG3_REGNUM 23 /* The fourth argument of a callee. */
-/* When fetching register values from an inferior or a core file,
- clean them up using this macro. BUF is a char pointer to
- the raw value of the register in the registers[] array. */
-
-#define DEPRECATED_CLEAN_UP_REGISTER_VALUE(regno, buf) \
- do { \
- if ((regno) == PCOQ_HEAD_REGNUM || (regno) == PCOQ_TAIL_REGNUM) \
- (buf)[sizeof(CORE_ADDR) -1] &= ~0x3; \
- } while (0)
-
/* PA specific macro to see if the current instruction is nullified. */
#ifndef INSTRUCTION_NULLIFIED
extern int hppa_instruction_nullified (void);
#define INSTRUCTION_NULLIFIED hppa_instruction_nullified ()
#endif
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.110
diff -u -p -r1.110 regcache.c
--- regcache.c 15 Mar 2004 20:38:08 -0000 1.110
+++ regcache.c 14 Apr 2004 05:01:26 -0000
@@ -1230,20 +1230,6 @@ void
supply_register (int regnum, const void *val)
{
regcache_raw_supply (current_regcache, regnum, val);
-
- /* On some architectures, e.g. HPPA, there are a few stray bits in
- some registers, that the rest of the code would like to ignore. */
-
- /* NOTE: cagney/2001-03-16: The macro CLEAN_UP_REGISTER_VALUE is
- going to be deprecated. Instead architectures will leave the raw
- register value as is and instead clean things up as they pass
- through the method gdbarch_pseudo_register_read() clean up the
- values. */
-
-#ifdef DEPRECATED_CLEAN_UP_REGISTER_VALUE
- DEPRECATED_CLEAN_UP_REGISTER_VALUE \
- (regnum, register_buffer (current_regcache, regnum));
-#endif
}
void
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch/resend/rfa] (3/4) Remove DEPRECATED_CLEAN_UP_REGISTER_VALUE
2004-04-14 6:24 [patch/resend/rfa] (3/4) Remove DEPRECATED_CLEAN_UP_REGISTER_VALUE Randolph Chung
@ 2004-04-15 15:34 ` Andrew Cagney
2004-04-17 17:32 ` Randolph Chung
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2004-04-15 15:34 UTC (permalink / raw)
To: Randolph Chung; +Cc: gdb-patches
> +static void
> +hppa_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
> + int regnum, void *buf)
> +{
> + regcache_raw_read (regcache, regnum, buf);
> + if (regnum == PCOQ_HEAD_REGNUM || regnum == PCOQ_TAIL_REGNUM)
> + ((char *)buf)[sizeof(CORE_ADDR) -1 ] &= ~0x3;
> +}
> +
Almost, this needs to be portable across byte-orders which means using
something like:
[U]LONGEST tmp;
regcache_raw_read_[un]signed (&tmp)
mask tmp
store_[un]signed_integer buf, tmp
with that tweak it is ok to commit (for reference, post the final patch)
andrew
(this also lets me clean-up more of the register code, ya!)
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch/resend/rfa] (3/4) Remove DEPRECATED_CLEAN_UP_REGISTER_VALUE
2004-04-15 15:34 ` Andrew Cagney
@ 2004-04-17 17:32 ` Randolph Chung
0 siblings, 0 replies; 3+ messages in thread
From: Randolph Chung @ 2004-04-17 17:32 UTC (permalink / raw)
To: gdb-patches
> Almost, this needs to be portable across byte-orders which means using
[...]
> with that tweak it is ok to commit (for reference, post the final patch)
committed. -randolph
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.5705
diff -u -p -r1.5705 ChangeLog
--- ChangeLog 17 Apr 2004 17:19:28 -0000 1.5705
+++ ChangeLog 17 Apr 2004 17:29:39 -0000
@@ -1,5 +1,13 @@
2004-04-17 Randolph Chung <tausq@debian.org>
+ * hppa-tdep.c (hppa_pseudo_register_read): Define.
+ (hppa_gdbarch_init): Set pseudo_register_read.
+ * config/pa/tm-hppa.h (DEPRECATED_CLEAN_UP_REGISTER_VALUE): Remove.
+ * regcache.c (supply_register): Remove check for
+ DEPRECATED_CLEAN_UP_REGISTER_VALUE since we've removed the last user.
+
+2004-04-17 Randolph Chung <tausq@debian.org>
+
* Makefile.in (hpread.o, pa64solib.o, somsolib.o): Add $(hppa_tdep_h)
* hppa-tdep.h (INSTRUCTION_SIZE): Move from tm-hppa.h.
(hpread_adjust_stack_address): Move to hpread.c.
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.145
diff -u -p -r1.145 hppa-tdep.c
--- hppa-tdep.c 17 Apr 2004 17:19:28 -0000 1.145
+++ hppa-tdep.c 17 Apr 2004 17:29:40 -0000
@@ -2540,6 +2540,18 @@ hppa_fetch_pointer_argument (struct fram
return addr;
}
+static void
+hppa_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+ int regnum, void *buf)
+{
+ ULONGEST tmp;
+
+ regcache_raw_read_unsigned (regcache, regnum, &tmp);
+ if (regnum == PCOQ_HEAD_REGNUM || regnum == PCOQ_TAIL_REGNUM)
+ tmp &= ~0x3;
+ store_unsigned_integer (buf, sizeof(tmp), tmp);
+}
+
/* Here is a table of C type sizes on hppa with various compiles
and options. I measured this on PA 9000/800 with HP-UX 11.11
and these compilers:
@@ -2698,6 +2710,8 @@ hppa_gdbarch_init (struct gdbarch_info i
set_gdbarch_unwind_pc (gdbarch, hppa_unwind_pc);
frame_unwind_append_sniffer (gdbarch, hppa_frame_unwind_sniffer);
frame_base_append_sniffer (gdbarch, hppa_frame_base_sniffer);
+
+ set_gdbarch_pseudo_register_read (gdbarch, hppa_pseudo_register_read);
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.110
diff -u -p -r1.110 regcache.c
--- regcache.c 15 Mar 2004 20:38:08 -0000 1.110
+++ regcache.c 17 Apr 2004 17:29:40 -0000
@@ -1230,20 +1230,6 @@ void
supply_register (int regnum, const void *val)
{
regcache_raw_supply (current_regcache, regnum, val);
-
- /* On some architectures, e.g. HPPA, there are a few stray bits in
- some registers, that the rest of the code would like to ignore. */
-
- /* NOTE: cagney/2001-03-16: The macro CLEAN_UP_REGISTER_VALUE is
- going to be deprecated. Instead architectures will leave the raw
- register value as is and instead clean things up as they pass
- through the method gdbarch_pseudo_register_read() clean up the
- values. */
-
-#ifdef DEPRECATED_CLEAN_UP_REGISTER_VALUE
- DEPRECATED_CLEAN_UP_REGISTER_VALUE \
- (regnum, register_buffer (current_regcache, regnum));
-#endif
}
void
Index: config/pa/tm-hppa.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppa.h,v
retrieving revision 1.70
diff -u -p -r1.70 tm-hppa.h
--- config/pa/tm-hppa.h 17 Apr 2004 17:19:29 -0000 1.70
+++ config/pa/tm-hppa.h 17 Apr 2004 17:29:40 -0000
@@ -66,16 +66,6 @@ extern int hppa_pc_requires_run_before_u
#define ARG2_REGNUM 24 /* The third argument of a callee. */
#define ARG3_REGNUM 23 /* The fourth argument of a callee. */
-/* When fetching register values from an inferior or a core file,
- clean them up using this macro. BUF is a char pointer to
- the raw value of the register in the registers[] array. */
-
-#define DEPRECATED_CLEAN_UP_REGISTER_VALUE(regno, buf) \
- do { \
- if ((regno) == PCOQ_HEAD_REGNUM || (regno) == PCOQ_TAIL_REGNUM) \
- (buf)[sizeof(CORE_ADDR) -1] &= ~0x3; \
- } while (0)
-
/* PA specific macro to see if the current instruction is nullified. */
#ifndef INSTRUCTION_NULLIFIED
extern int hppa_instruction_nullified (void);
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-04-17 17:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-14 6:24 [patch/resend/rfa] (3/4) Remove DEPRECATED_CLEAN_UP_REGISTER_VALUE Randolph Chung
2004-04-15 15:34 ` Andrew Cagney
2004-04-17 17:32 ` Randolph Chung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox