delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/03/23/18:49:37

From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <199903232349.AAA01039@father.ludd.luth.se>
Subject: Re: Patch: Child memory access in dbgcom checks page attributes
To: nate AT cartsys DOT com
Date: Wed, 24 Mar 1999 00:49:19 +0100 (MET)
Cc: djgpp-workers AT delorie DOT com (DJGPP-WORKERS)
X-Mailer: ELM [version 2.4ME+ PL15 (25)]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

Hmm. Are you sure the part about the limit checking is correct? I ask
because you are removing part of what I corrected some time ago. I
think I got some response (I think it was on c.o.m.d) that the limit
check would be better with something like you put in now.

I tried that way, and sure enough gdb was still crashing for me. Hence
I kept the more convoluted check.

Unfortunately I can't remember what the case where gdb crashed was 
about (so I could test your patch).

The change I object to is this:

+  if (a <= 4096)
+    return 1; /* Null page */
   limit = __dpmi_get_segment_limit(__djgpp_app_DS);
-  if(4096 <= a             /* First page is used for NULL pointer detection. */
-  && a <= limit            /* To guard against limit < len. */
-  && a - 1 <= limit - len  /* To guard against limit <= a + len - 1. */
-     )
-    return 0;
-/*  printf("Invalid access to child, address %#x length %#x  limit: %#x\n", a, len, limit);
-  if (can_longjmp)
-    longjmp(debugger_jmpbuf, 1); */
-  return 1;
+  if (a > limit || (a - 1) > (limit - len))
+      return 1; /* Beyond limit */


A Shrine, Royalty,

							MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019