This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] More descriptive types for %eip, %ebp and %esp on i386
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 11 Jun 2005 21:24:00 +0200 (CEST)
- Subject: [commit] More descriptive types for %eip, %ebp and %esp on i386
This makes "info registers" print the function that %eip is in. A few
of the other targets already do this. You might want to check whether
your favourite target already does this, and if not, fix it ;-).
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* i386-tdep.c (i386_register_type): Return
builtin_type_void_func_ptr for %eip and builtin_type_void_data_ptr
for %ebp and %esp.
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.213
diff -u -p -r1.213 i386-tdep.c
--- i386-tdep.c 28 May 2005 16:44:28 -0000 1.213
+++ i386-tdep.c 11 Jun 2005 19:07:54 -0000
@@ -1560,9 +1560,11 @@ i386_build_sse_type (void)
static struct type *
i386_register_type (struct gdbarch *gdbarch, int regnum)
{
- if (regnum == I386_EIP_REGNUM
- || regnum == I386_EBP_REGNUM || regnum == I386_ESP_REGNUM)
- return lookup_pointer_type (builtin_type_void);
+ if (regnum == I386_EIP_REGNUM)
+ return builtin_type_void_func_ptr;
+
+ if (regnum == I386_EBP_REGNUM || regnum == I386_ESP_REGNUM)
+ return builtin_type_void_data_ptr;
if (i386_fp_regnum_p (regnum))
return builtin_type_i387_ext;