qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@nowt.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] qemu gdbstub.c linux-user/flatload.c linux-user...
Date: Sat, 17 Jun 2006 18:30:42 +0000	[thread overview]
Message-ID: <E1FrfZC-0006Ul-HO@savannah.gnu.org> (raw)

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Paul Brook <pbrook>	06/06/17 18:30:42

Modified files:
	.              : gdbstub.c 
	linux-user     : flatload.c main.c qemu.h 

Log message:
	Respond to qOffsets gdb packet (for debugging bFLT binaries).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/gdbstub.c?cvsroot=qemu&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/qemu/linux-user/flatload.c?cvsroot=qemu&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemu/linux-user/main.c?cvsroot=qemu&r1=1.85&r2=1.86
http://cvs.savannah.gnu.org/viewcvs/qemu/linux-user/qemu.h?cvsroot=qemu&r1=1.27&r2=1.28

Patches:
Index: gdbstub.c
===================================================================
RCS file: /sources/qemu/qemu/gdbstub.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- gdbstub.c	14 Jun 2006 15:21:14 -0000	1.37
+++ gdbstub.c	17 Jun 2006 18:30:42 -0000	1.38
@@ -17,6 +17,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#include "config.h"
 #ifdef CONFIG_USER_ONLY
 #include <stdlib.h>
 #include <stdio.h>
@@ -24,6 +25,7 @@
 #include <string.h>
 #include <errno.h>
 #include <unistd.h>
+#include <fcntl.h>
 
 #include "qemu.h"
 #else
@@ -680,6 +682,18 @@
             goto breakpoint_error;
         }
         break;
+#ifdef CONFIG_USER_ONLY
+    case 'q':
+        if (strncmp(p, "Offsets", 7) == 0) {
+            TaskState *ts = env->opaque;
+
+            sprintf(buf, "Text=%x;Data=%x;Bss=%x", ts->info->code_offset,
+                ts->info->data_offset, ts->info->data_offset);
+            put_packet(s, buf);
+            break;
+        }
+        /* Fall through.  */
+#endif
     default:
         //        unknown_command:
         /* put empty packet */

Index: linux-user/flatload.c
===================================================================
RCS file: /sources/qemu/qemu/linux-user/flatload.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- linux-user/flatload.c	11 Jun 2006 13:32:59 -0000	1.1
+++ linux-user/flatload.c	17 Jun 2006 18:30:42 -0000	1.2
@@ -783,6 +783,9 @@
     info->start_brk = libinfo[0].start_brk;
     info->start_stack = sp;
     info->entry = start_addr;
+    info->code_offset = info->start_code;
+    info->data_offset = info->start_data - libinfo[0].text_len;
+
     DBG_FLT("start_thread(entry=0x%x, start_stack=0x%x)\n",
             (int)info->entry, (int)info->start_stack);
     

Index: linux-user/main.c
===================================================================
RCS file: /sources/qemu/qemu/linux-user/main.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -b -r1.85 -r1.86
--- linux-user/main.c	14 Jun 2006 13:37:55 -0000	1.85
+++ linux-user/main.c	17 Jun 2006 18:30:42 -0000	1.86
@@ -1541,6 +1541,7 @@
     memset(ts, 0, sizeof(TaskState));
     env->opaque = ts;
     ts->used = 1;
+    ts->info = info;
     env->user_mode_only = 1;
     
 #if defined(TARGET_I386)

Index: linux-user/qemu.h
===================================================================
RCS file: /sources/qemu/qemu/linux-user/qemu.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- linux-user/qemu.h	11 Jun 2006 13:32:59 -0000	1.27
+++ linux-user/qemu.h	17 Jun 2006 18:30:42 -0000	1.28
@@ -27,6 +27,8 @@
 	unsigned long	rss;
 	unsigned long	start_stack;
 	unsigned long	entry;
+        target_ulong    code_offset;
+        target_ulong    data_offset;
 	int		personality;
 };
 
@@ -73,6 +75,7 @@
     uint32_t v86mask;
 #endif
     int used; /* non zero if used */
+    struct image_info *info;
     uint8_t stack[0];
 } __attribute__((aligned(16))) TaskState;
 

                 reply	other threads:[~2006-06-17 18:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=E1FrfZC-0006Ul-HO@savannah.gnu.org \
    --to=paul@nowt.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).