This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] software single-step on arm fixes
- From: Fernando Nasser <fnasser at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 19 Dec 2001 13:02:45 -0500
- Subject: [patch] software single-step on arm fixes
- Organization: Red Hat , Inc. - Toronto
Comitted the following patch to fix a few things related to
software single stepping om arm targets.
* config/arm/tm-arm.h: Properly define SOFTWARE_SINGLE_STEP_P.
Always define SOFTWARE_SINGLE_STEP.
* config/arm/tm-embed.h: Properly define SOFTWARE_SINGLE_STEP_P.
* arm-tdep.c (arm_get_next_pc, thumb_get_next_pc, bitcount,
shifted_reg_val): Always compile these functions.
(arm_software_single_step): Fix second argument in function calls.
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.20
diff -c -p -r1.20 arm-tdep.c
*** arm-tdep.c 2001/12/17 17:03:57 1.20
--- arm-tdep.c 2001/12/19 17:35:26
*************** condition_true (unsigned long cond, unsi
*** 1532,1538 ****
return 1;
}
- #if SOFTWARE_SINGLE_STEP_P
/* Support routines for single stepping. Calculate the next PC value. */
#define submask(x) ((1L << ((x) + 1)) - 1)
#define bit(obj,st) (((obj) >> (st)) & 1)
--- 1532,1537 ----
*************** arm_software_single_step (ignore, insert
*** 1887,1898 ****
if (insert_bpt)
{
next_pc = arm_get_next_pc (read_register (PC_REGNUM));
! target_insert_breakpoint (next_pc, &break_mem);
}
else
! target_remove_breakpoint (next_pc, &break_mem);
}
- #endif /* SOFTWARE_SINGLE_STEP_P */
#include "bfd-in2.h"
#include "libcoff.h"
--- 1886,1896 ----
if (insert_bpt)
{
next_pc = arm_get_next_pc (read_register (PC_REGNUM));
! target_insert_breakpoint (next_pc, break_mem);
}
else
! target_remove_breakpoint (next_pc, break_mem);
}
#include "bfd-in2.h"
#include "libcoff.h"
Index: config/arm/tm-arm.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-arm.h,v
retrieving revision 1.10
diff -c -p -r1.10 tm-arm.h
*** tm-arm.h 2001/12/17 17:03:58 1.10
--- tm-arm.h 2001/12/19 17:35:26
*************** void arm_fix_call_dummy (char *dummy, CO
*** 453,465 ****
/* Most ARMs don't have single stepping capability, so provide a
single-stepping mechanism by default */
! #ifndef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P 1
! #endif
! #if SOFTWARE_SINGLE_STEP_P
#define SOFTWARE_SINGLE_STEP(sig,bpt) arm_software_single_step((sig), (bpt))
void arm_software_single_step PARAMS((int, int));
- #endif
CORE_ADDR arm_get_next_pc (CORE_ADDR pc);
--- 453,463 ----
/* Most ARMs don't have single stepping capability, so provide a
single-stepping mechanism by default */
! #undef SOFTWARE_SINGLE_STEP_P
! #define SOFTWARE_SINGLE_STEP_P() 1
!
#define SOFTWARE_SINGLE_STEP(sig,bpt) arm_software_single_step((sig), (bpt))
void arm_software_single_step PARAMS((int, int));
CORE_ADDR arm_get_next_pc (CORE_ADDR pc);
Index: config/arm/tm-embed.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-embed.h,v
retrieving revision 1.5
diff -c -p -r1.5 tm-embed.h
*** tm-embed.h 2001/03/06 08:21:23 1.5
--- tm-embed.h 2001/12/19 17:35:26
***************
*** 25,30 ****
--- 25,34 ----
/* Include the common ARM definitions. */
#include "arm/tm-arm.h"
+ /* The remote stub should be able to single-step. */
+ #undef SOFTWARE_SINGLE_STEP_P
+ #define SOFTWARE_SINGLE_STEP_P() 0
+
/* I don't know the real values for these. */
#define TARGET_UPAGES UPAGES
#define TARGET_NBPG NBPG
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9