This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/753: MIPS simulator initializes LSI pmon vector table with code


>Number:         753
>Category:       gdb
>Synopsis:       MIPS simulator initializes LSI pmon vector table with code
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 27 15:38:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     ac131313@redhat.com
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
See:
http://sources.redhat.com/ml/gdb-patches/2002-04/msg00604.html

Note that this resulted in a very long and painful thread .....

Alexandre Oliva writes ....

There's a chunk of memory in LSI pmon that is supposed to contain
pointers to `system call' handlers.  However, sim_open() will
clobber the valid addresses it stores in this table with code bare
code (as opposed to pointers to code) that was meant to catch invalid
accesses.  This is obviously wrong.  I'm checking this in, since Frank
Ch. Eigler and Eric Christopher agreed it was a reasonable thing to
do.  I'll leave the complete fix for someone who has a real
understanding of what was supposed to be done there.




Index: sim/mips/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* interp.c (sim_open): Disable chunk of code that wrote code in
	vector table entries.

Index: sim/mips/interp.c
===================================================================
RCS file: /cvs/src/src/sim/mips/interp.c,v
retrieving revision 1.9
diff -u -p -r1.9 interp.c
--- sim/mips/interp.c 20 Mar 2002 01:35:13 -0000 1.9
+++ sim/mips/interp.c 18 Apr 2002 19:41:48 -0000
@@ -698,10 +698,14 @@ sim_open (kind, cb, abfd, argv)
       sim_write (sd, 0x80000000, (char *) halt, sizeof (halt));
       sim_write (sd, 0x80000180, (char *) halt, sizeof (halt));
       sim_write (sd, 0x80000200, (char *) halt, sizeof (halt));
+#if 0
+      /* This is wrong.  We're not supposed to write code to the
+	 vector tables, but rather pointers to code.  */
       /* XXX: Write here unconditionally? */
       sim_write (sd, 0xBFC00200, (char *) halt, sizeof (halt));
       sim_write (sd, 0xBFC00380, (char *) halt, sizeof (halt));
       sim_write (sd, 0xBFC00400, (char *) halt, sizeof (halt));
+#endif
     }
   }
 


>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]