From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFC] TARGET_ADJUST_BREAKPOINT_ADDRESS - patch 1 of 4
Date: Sat, 04 Oct 2003 00:28:00 -0000 [thread overview]
Message-ID: <1031004002813.ZM24546@localhost.localdomain> (raw)
I've recently revisited a patch that I submitted a long time ago. Here
are the relevant links to the original TARGET_ADJUST_BREAKPOINT_ADDRESS
patch submission and discussion:
http://sources.redhat.com/ml/gdb-patches/2000-06/msg00257.html
(+) http://sources.redhat.com/ml/gdb-patches/2000-06/msg00260.html
http://sources.redhat.com/ml/gdb-patches/2000-06/msg00270.html
(+) http://sources.redhat.com/ml/gdb-patches/2000-06/msg00274.html
(*) http://sources.redhat.com/ml/gdb-patches/2000-09/msg00156.html
http://sources.redhat.com/ml/gdb-patches/2000-09/msg00158.html
The link marked with (*) is Andrew's approval so long as Eli's
concerns marked with (+) are addressed.
The patch below should be non-controversial. It merely adds the
TARGET_ADJUST_BREAKPOINT_ADDRESS method. Code which uses it (the
possibly controversial bit) will come in patch #3. Documentation will
be in the next patch, #2. Finally, target specific code which
requires TARGET_ADJUST_BREAKPOINT_ADDRESS will be posted in patch #4.
Kevin
* arch-utils.h (default_target_adjust_breakpoint_address): New
function declaration.
* arch-utils.c (default_target_adjust_breakpoint_address): New
function.
* gdbarch.sh (TARGET_ADJUST_BREAKPOINT_ADDRESS): New method.
* gdbarch.h, gdbarch.c: Regenerate.
Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.97
diff -u -p -r1.97 arch-utils.c
--- arch-utils.c 30 Sep 2003 13:29:43 -0000 1.97
+++ arch-utils.c 3 Oct 2003 23:38:23 -0000
@@ -82,6 +82,21 @@ legacy_register_sim_regno (int regnum)
return LEGACY_SIM_REGNO_IGNORE;
}
+/* Some architectures have constraints about where a breakpoint may be
+ placed. TARGET_ADJUST_BREAKPOINT_ADDRESS is given an address that is
+ adjusted (and returned) to conform to the constraints imposed by
+ the architecture.
+
+ Targets which have no architectural constraints on breakpoint placement
+ should use default_target_adjust_breakpoint_address which merely returns
+ the breakpoint address unadjusted */
+
+CORE_ADDR
+default_target_adjust_breakpoint_address (CORE_ADDR bpaddr)
+{
+ return bpaddr;
+}
+
int
generic_frameless_function_invocation_not (struct frame_info *fi)
{
Index: arch-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.h,v
retrieving revision 1.57
diff -u -p -r1.57 arch-utils.h
--- arch-utils.h 27 Sep 2003 15:51:02 -0000 1.57
+++ arch-utils.h 3 Oct 2003 23:38:23 -0000
@@ -47,6 +47,11 @@ extern gdbarch_store_return_value_ftype
address passed as an invisible first argument to the function. */
extern gdbarch_use_struct_convention_ftype always_use_struct_convention;
+/* Identity function for targets which don't have architectural constraints
+ on placement of breakpoints. */
+extern gdbarch_target_adjust_breakpoint_address_ftype
+ default_target_adjust_breakpoint_address;
+
/* Frameless functions not identifable. */
extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_invocation_not;
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.275
diff -u -p -r1.275 gdbarch.sh
--- gdbarch.sh 2 Oct 2003 20:28:29 -0000 1.275
+++ gdbarch.sh 3 Oct 2003 23:38:27 -0000
@@ -614,6 +614,7 @@ f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologu
f:2:PROLOGUE_FRAMELESS_P:int:prologue_frameless_p:CORE_ADDR ip:ip::0:generic_prologue_frameless_p::0
f:2:INNER_THAN:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0
f::BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::0:
+f:2:TARGET_ADJUST_BREAKPOINT_ADDRESS:CORE_ADDR:target_adjust_breakpoint_address:CORE_ADDR bpaddr:bpaddr:::default_target_adjust_breakpoint_address::0
f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0
f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0
v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1
next reply other threads:[~2003-10-04 0:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-04 0:28 Kevin Buettner [this message]
2003-10-06 12:49 ` Mark Kettenis
2003-10-06 14:37 ` Andrew Cagney
2003-10-06 15:37 ` Kevin Buettner
2003-10-06 21:09 ` Mark Kettenis
2003-10-08 18:26 ` Andrew Cagney
2003-10-11 2:17 ` Kevin Buettner
2003-10-11 16:17 ` Andrew Cagney
2003-10-13 23:43 ` Kevin Buettner
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=1031004002813.ZM24546@localhost.localdomain \
--to=kevinb@redhat.com \
--cc=gdb-patches@sources.redhat.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