Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michal Ludvig <mludvig@suse.cz>
To: Andrew Cagney <ac131313@redhat.com>
Cc: GDB Patches <gdb-patches@sources.redhat.com>
Subject: [RFA] Dummy frames on x86-64
Date: Thu, 06 Mar 2003 22:42:00 -0000	[thread overview]
Message-ID: <3E67CEC8.9040301@suse.cz> (raw)
In-Reply-To: <3E67ABDD.4090401@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

Andrew Cagney wrote:
>> +static void
>> +x86_64_save_dummy_frame_tos (CORE_ADDR sp)
>> +{
>> +  /* We must add the size of the return address that is already
>> +     put on the stack.  */
>> +  generic_save_dummy_frame_tos (sp + sizeof(CORE_ADDR));
> 
> Yes, but use TYPE_LENGTH (builtin_type_void_{code/data}_ptr).

Great, thanks for your help!
Can I commit the attached patch to mainline, please?

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* (+420) 296.545.373 * http://www.suse.cz

[-- Attachment #2: dummy-unwind-1.diff --]
[-- Type: text/plain, Size: 1561 bytes --]

2002-03-06  Michal Ludvig  <mludvig@suse.cz>

	* x86-64-tdep.c (x86_64_save_dummy_frame_tos)
	(x86_64_unwind_dummy_id): New functions.
	(x86_64_init_abi): Register these two new functions.

Index: x86-64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v
retrieving revision 1.51
diff -u -p -r1.51 x86-64-tdep.c
--- x86-64-tdep.c	2 Mar 2003 04:02:25 -0000	1.51
+++ x86-64-tdep.c	6 Mar 2003 22:38:14 -0000
@@ -913,6 +913,26 @@ x86_64_breakpoint_from_pc (CORE_ADDR *pc
   return breakpoint;
 }
 
+static void
+x86_64_save_dummy_frame_tos (CORE_ADDR sp)
+{
+  /* We must add the size of the return address that is already 
+     put on the stack.  */
+  generic_save_dummy_frame_tos (sp + 
+				TYPE_LENGTH (builtin_type_void_func_ptr));
+}
+
+static struct frame_id
+x86_64_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *frame)
+{
+  struct frame_id id;
+  
+  id.pc = frame_pc_unwind (frame);
+  frame_unwind_unsigned_register (frame, SP_REGNUM, &id.base);
+
+  return id;
+}
+
 void
 x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -1023,6 +1043,10 @@ x86_64_init_abi (struct gdbarch_info inf
      since all supported x86-64 targets are ELF, but that might change
      in the future.  */
   set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
+  
+  /* Dummy frame helper functions.  */
+  set_gdbarch_save_dummy_frame_tos (gdbarch, x86_64_save_dummy_frame_tos);
+  set_gdbarch_unwind_dummy_id (gdbarch, x86_64_unwind_dummy_id);
 }
 
 void

  reply	other threads:[~2003-03-06 22:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-23 20:54 [patch/rfc] Add a sentinel frame Andrew Cagney
2003-01-27 21:42 ` Andrew Cagney
2003-02-10 23:36 ` Michal Ludvig
2003-02-11 16:48   ` Andrew Cagney
2003-02-18 11:21     ` Michal Ludvig
2003-02-19 13:27       ` Andrew Cagney
2003-02-19 14:04         ` Daniel Jacobowitz
2003-02-19 16:46           ` Andrew Cagney
2003-02-19 16:56             ` Daniel Jacobowitz
2003-02-19 17:11               ` Andrew Cagney
2003-02-19 17:17                 ` Daniel Jacobowitz
2003-02-19 17:46                   ` Andrew Cagney
2003-02-19 17:56                     ` Daniel Jacobowitz
2003-02-19 18:36                       ` Andrew Cagney
2003-02-19 18:52                         ` Daniel Jacobowitz
2003-02-19 20:22                           ` Andrew Cagney
2003-02-19 20:39                             ` Daniel Jacobowitz
2003-02-19 21:21                               ` Andrew Cagney
2003-02-20 19:32                                 ` Daniel Jacobowitz
2003-02-19 21:45                               ` Andrew Cagney
2003-02-20 19:32                                 ` Daniel Jacobowitz
2003-02-25 16:24         ` Michal Ludvig
2003-02-25 19:43           ` Andrew Cagney
2003-02-25 21:00             ` Michal Ludvig
2003-02-25 21:12               ` Andrew Cagney
2003-02-26  8:04                 ` Michal Ludvig
2003-02-27 18:27                   ` Andrew Cagney
2003-02-28 13:02                     ` Michal Ludvig
2003-02-28 15:48                       ` Andrew Cagney
2003-03-05 17:38                         ` Michal Ludvig
2003-03-05 18:25                           ` Andrew Cagney
2003-03-06 16:00                             ` Michal Ludvig
2003-03-06 20:13                               ` Andrew Cagney
2003-03-06 22:42                                 ` Michal Ludvig [this message]
2003-03-07 14:50                                   ` [RFA] Dummy frames on x86-64 Andrew Cagney
2003-02-25 22:41               ` [patch/rfc] Add a sentinel frame Andrew Cagney

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=3E67CEC8.9040301@suse.cz \
    --to=mludvig@suse.cz \
    --cc=ac131313@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