This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH/RFA]: New architecture method: regset_from_core_section
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 11 Oct 2003 15:05:19 +0200 (CEST)
- Subject: [PATCH/RFA]: New architecture method: regset_from_core_section
This adds a new architecture method that returns a register set
definition based on the name and size of a core file section that we
get from BFD. We had an eleborate discussion on this a while ago, and
in my opinion reached consesus on the approach, so I've checked the
code bits in. Eli, are the doc bits OK?
The future might bring us regset_from_remote and perhaps
regset_from_ptrace_request. We'll see.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* gdbarch.sh (regset_from_core_section): New method.
(struct regset): Declare opaque.
* gdbarch.c, gdbarch.h: Regenerated.
Index: doc/ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* gdbint.texinfo (Target Architecture Definition): Document
regset_from_core_section.
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.276
diff -u -p -r1.276 gdbarch.sh
--- gdbarch.sh 11 Oct 2003 12:05:44 -0000 1.276
+++ gdbarch.sh 11 Oct 2003 12:40:40 -0000
@@ -747,6 +747,10 @@ M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int
m:::int:register_reggroup_p:int regnum, struct reggroup *reggroup:regnum, reggroup:::default_register_reggroup_p::0
# Fetch the pointer to the ith function argument.
F::FETCH_POINTER_ARGUMENT:CORE_ADDR:fetch_pointer_argument:struct frame_info *frame, int argi, struct type *type:frame, argi, type
+
+# Return the appropriate register set for a core file section with
+# name SECT_NAME and size SECT_SIZE.
+M:::const struct regset *:regset_from_core_section:const char *sect_name, size_t sect_size:sect_name, sect_size
EOF
}
@@ -851,6 +855,7 @@ struct objfile;
struct minimal_symbol;
struct regcache;
struct reggroup;
+struct regset;
struct disassemble_info;
extern struct gdbarch *current_gdbarch;
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.174
diff -u -p -r1.174 gdbint.texinfo
--- doc/gdbint.texinfo 10 Oct 2003 07:08:53 -0000 1.174
+++ doc/gdbint.texinfo 11 Oct 2003 12:40:47 -0000
@@ -3563,6 +3563,12 @@ Convert the value of register @var{reg}
form.
@xref{Target Architecture Definition, , Raw and Virtual Register Representations}.
+@item const struct regset *regset_from_core_section (struct gdbarch * @var{gdbarch}, const char * @var{sect_name}, size_t @var{sect_size})
+@findex regset_from_core_section
+Return the appropriate register set for a core file section with name
+SECT_NAME and size SECT_SIZE.
+
+
@item RETURN_VALUE_ON_STACK(@var{type})
@findex RETURN_VALUE_ON_STACK
@cindex returning structures by value