[Git][cmucl/cmucl][issue-97-define-ud2-inst] 8 commits: Fix up headings for issue templates

Raymond Toy gitlab at common-lisp.net
Tue Apr 13 03:08:10 UTC 2021



Raymond Toy pushed to branch issue-97-define-ud2-inst at cmucl / cmucl


Commits:
1b27941a by Raymond Toy at 2021-03-22T20:00:49-07:00
Fix up headings for issue templates

The headings used to be `**foo**`, but it's better to use `## foo`.
The old headings would cause the following paragraph to be appended to
the heading.  Thus
```
## foo
Text
```
became
```
foo Text
```
with "foo" in bold.

With the new markup, this doesn't happen.

- - - - -
5c92c14c by Raymond Toy at 2021-03-23T03:34:19+00:00
Merge branch 'fixup-template-headings' into 'master'

Fix up headings for issue templates

See merge request cmucl/cmucl!73
- - - - -
20de3e8e by Jon Boone at 2021-04-09T20:59:59+00:00
 adds additional keyword arguments to instance-usage for more fine-grained tracking of space allocation

- - - - -
68e97641 by Raymond Toy at 2021-04-09T21:00:00+00:00
Merge branch 'org.cmucl.debug.dynamic-space' into 'master'

adding additional keyword arguments to instance-usage ....

See merge request cmucl/cmucl!74
- - - - -
73d6de93 by Raymond Toy at 2021-04-10T11:03:40-07:00
Fix #105: Include build logs in artifacts

Include the build logs in the artifacts so we can examine the logs to
see what happened when a build fails.

- - - - -
8e4a873c by Raymond Toy at 2021-04-10T21:24:37+00:00
Merge branch 'issue-105-add-build-logs' into 'master'

Fix #105: Include build logs in artifacts

Closes #105

See merge request cmucl/cmucl!75
- - - - -
7a6c5d35 by Raymond Toy at 2021-04-12T19:45:30-07:00
Merge branch 'master' into issue-97-define-ud2-inst

- - - - -
f3218ee0 by Raymond Toy at 2021-04-12T20:07:53-07:00
Address review comments.

- - - - -


10 changed files:

- .gitlab-ci.yml
- .gitlab/issue_templates/Bug.md
- .gitlab/issue_templates/Feature.md
- src/code/room.lisp
- src/code/x86-vm.lisp
- src/compiler/x86/insts.lisp
- src/compiler/x86/macros.lisp
- src/i18n/locale/cmucl.pot
- src/lisp/x86-arch.c
- src/lisp/x86-assem.S


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -33,6 +33,9 @@ linux:build:
   artifacts:
     paths:
       - dist/
+      - linux-2/*.log
+      - linux-3/*.log
+      - linux-4/*.log
   needs:
     - job: linux:install
       artifacts: true
@@ -117,6 +120,9 @@ osx:build:
   artifacts:
     paths:
       - dist/
+      - darwin-2/*.log
+      - darwin-3/*.log
+      - darwin-4/*.log
   needs:
     - job: osx:install
       artifacts: true


=====================================
.gitlab/issue_templates/Bug.md
=====================================
@@ -1,24 +1,24 @@
-**Describe the bug**
+## Describe the bug
 A clear and concise description of what the bug is.
 
-**To Reproduce**
+## To Reproduce
 Steps to reproduce the behavior:
 1. Go to '...'
 2. Click on '....'
 3. Scroll down to '....'
 4. See error
 
-**Expected behavior**
+## Expected behavior
 A clear and concise description of what you expected to happen.
 
-**Screenshots**
+## Screenshots
 If applicable, add screenshots to help explain your problem.
 
-**Desktop (please complete the following information):**
+## Desktop (please complete the following information):
  - OS: [e.g. Linux]
  - Version [e.g. 21c]
 
-**Additional context**
+## Additional context
 Add any other context about the problem here.
 
 /label ~bug


=====================================
.gitlab/issue_templates/Feature.md
=====================================
@@ -1,10 +1,10 @@
-**Describe the feature**
+## Describe the feature
 Briefly describe the feature you would like see.
 
-**Is there a prototype?**
+## Is there a prototype?
 If you have a prototype, provide links to illustrate this addition.  This is the best way to propose a new feature.
 
-**Describe the feature in more detail**
+## Describe the feature in more detail
 Provide more information to describe the feature.
 
 /label ~feature


=====================================
src/code/room.lisp
=====================================
@@ -707,11 +707,24 @@
 
 ;;; INSTANCE-USAGE  --  Public
 ;;;
-(defun instance-usage (space &key (top-n 15))
-  (declare (type spaces space) (type (or fixnum null) top-n))
-  "Print a breakdown by instance type of all the instances allocated in
-  Space.  If TOP-N is true, print only information for the the TOP-N types with
-  largest usage."
+(defun instance-usage (space &key 
+			       (top-n 15) 
+			       entries-var 
+			       (call-source "Unknown Caller"))
+  "Print a breakdown by instance type of all the allocation in Space.  
+
+  :TOP-N 
+      If true, print only the TOP-N types by largest usage.
+
+  :ENTRIES-VAR
+      If bound, contains the name of the symbol used to store the hash-table
+      of allocated entries for later processing.
+
+  :CALL-SOURCE
+      A string identifying the location from which instance-usage was called."
+
+  (declare (type spaces space) (type (or fixnum null) top-n)
+	   (type (or symbol null) entries-var) (type string call-source))
   (format t (intl:gettext "~2&~@[Top ~D ~]~(~A~) instance types:~%") top-n space)
   (let ((totals (make-hash-table :test #'eq))
 	(total-objects 0)
@@ -734,6 +747,10 @@
      space)
 
     (collect ((totals-list))
+      ;; set entries-var to the list of entries in totals
+      (when entries-var
+	(setf (symbol-value entries-var) (list call-source totals)))
+
       (maphash #'(lambda (class what)
 		   (totals-list (cons (prin1-to-string
 				       (class-proper-name class))


=====================================
src/code/x86-vm.lisp
=====================================
@@ -237,18 +237,15 @@
   (with-alien ((scp (* unix:sigcontext) scp))
     (let ((pc (sigcontext-program-counter scp)))
       (declare (type system-area-pointer pc))
-      ;; The pc should point to the start of the UD2 instruction.  So we have something like:
+      ;; The pc should point to the start of the UD1 instruction.  So we have something like:
       ;;   offset  contents
-      ;;   0       UD2
-      ;;   2       code
+      ;;   0       UD1 (contains the trap code)
       ;;   3       length
       ;;   4       bytes
       (let* ((length (sap-ref-8 pc 3))
 	     (vector (make-array length :element-type '(unsigned-byte 8))))
 	(declare (type (unsigned-byte 8) length)
 		 (type (simple-array (unsigned-byte 8) (*)) vector))
-	#+nil
-	(format t "internal-error-args scp ~A: pc ~X len ~D~%" scp pc length)
 	;; Grab the length bytes after the length byte.
 	(copy-from-system-area pc (* vm:byte-bits 4)
 			       vector (* vm:word-bits


=====================================
src/compiler/x86/insts.lisp
=====================================
@@ -1778,7 +1778,7 @@
 (disassem:define-instruction-format
     (bit-test-reg/mem 24
 		      :default-printer '(:name :tab reg/mem ", " reg))
-  (prefix	:field (byte 8 0) :value #b0001111)
+  (prefix	:field (byte 8 0)	:value #b0001111)
   (op		:field (byte 8 8))
   ;;(test		:fields (list (byte 2 14) (byte 3 8)))
   (reg/mem	:fields (list (byte 2 22) (byte 3 16))
@@ -2064,9 +2064,9 @@
 
 ;; The UD1 instruction.  The mod bits of the mod r/m byte MUST be #b11
 ;; so that the reg/mem field is actually a register.  This is a hack
-;; to allow us to print out the reg/mem reg as a 32 reg.  Using just
-;; reg/mem, the register sometimes printed out as a byte reg and I
-;; (toy.raymond) don't know why.
+;; to allow us to print out the reg/mem reg as a 32-bit reg.  Using
+;; just reg/mem, the register sometimes printed out as a byte reg and
+;; I (toy.raymond) don't know why.
 (disassem:define-instruction-format
     (ud1 24 :default-printer '(:name :tab reg ", " reg/mem))
   (prefix    :field (byte 8 0) :value #b00001111)
@@ -2150,12 +2150,6 @@
 			  (ldb (byte 3 3) code)
 			  (ldb (byte 3 0) code))))
 
-#+nil
-(define-instruction ud2 (segment)
-  (:emitter
-   (emit-byte segment #b00001111)
-   (emit-byte segment #b00001011)))
-
 (define-instruction int (segment number)
   (:declare (type (unsigned-byte 8) number))
   (:printer byte-imm ((op #b11001101)))


=====================================
src/compiler/x86/macros.lisp
=====================================
@@ -254,8 +254,8 @@
 			`(let ((tn ,tn))
 			   (write-var-integer
 			    (make-sc-offset (sc-number (tn-sc tn))
-					    ;; tn-offset is zero for constant tns.
-					    (or (tn-offset tn) 0))
+			     ;; tn-offset is zero for constant tns.
+			     (or (tn-offset tn) 0))
 			    ,vector)))
 		    values)
 	  (let ((,length (length ,vector)))


=====================================
src/i18n/locale/cmucl.pot
=====================================
@@ -6333,10 +6333,19 @@ msgstr ""
 
 #: src/code/room.lisp
 msgid ""
-"Print a breakdown by instance type of all the instances allocated in\n"
-"  Space.  If TOP-N is true, print only information for the the TOP-N types "
-"with\n"
-"  largest usage."
+"Print a breakdown by instance type of all the allocation in Space.  \n"
+"\n"
+"  :TOP-N \n"
+"      If true, print only the TOP-N types by largest usage.\n"
+"\n"
+"  :ENTRIES-VAR\n"
+"      If bound, contains the name of the symbol used to store the hash-table"
+"\n"
+"      of allocated entries for later processing.\n"
+"\n"
+"  :CALL-SOURCE\n"
+"      A string identifying the location from which instance-usage was "
+"called."
 msgstr ""
 
 #: src/code/room.lisp


=====================================
src/lisp/x86-arch.c
=====================================
@@ -220,14 +220,13 @@ arch_set_pseudo_atomic_interrupted(os_context_t * context)
 unsigned long
 arch_install_breakpoint(void *pc)
 {
-    unsigned char* ptr = (unsigned char *) pc;
-    unsigned long result = *ptr;
+    unsigned long result = (unsigned char *) pc;
 
     DPRINTF(debug_handlers,
             (stderr, "arch_install_breakpoint at %p, old code = 0x%lx\n",
              pc, result));
 
-    *ptr = BREAKPOINT_INST;	/* x86 INT3       */
+    *(unsigned char *) pc = BREAKPOINT_INST;
     return result;
 }
 
@@ -237,11 +236,11 @@ arch_remove_breakpoint(void *pc, unsigned long orig_inst)
     DPRINTF(debug_handlers,
             (stderr, "arch_remove_breakpoint: %p orig %lx\n",
              pc, orig_inst));
-    unsigned char *ptr = (unsigned char *) pc;
+
     /*
      * Just restore the byte from orig_inst.
      */
-    ptr[0] = orig_inst & 0xff;
+    *(unsigned char *) pc = orig_inst & 0xff;
 }
 
 


=====================================
src/lisp/x86-assem.S
=====================================
@@ -300,13 +300,6 @@ multiple_value_return:
 	
 	.globl GNAME(function_end_breakpoint_trap)
 GNAME(function_end_breakpoint_trap):
-	/*
-	ud1	0(%ecx), %ecx
-	ud1	%ecx, %edx
-	.byte	0x0f
-	.byte	0xb9
-	.byte 	0xc0 + trap_PendingInterrupt
-	*/
 	TRAP_CODE(trap_FunctionEndBreakpoint)
 	hlt			# Should never return here.
 ENDFUNC(function_end_breakpoint_trap)



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/85639e3dde6341cc4e171c400d39e52f315a180d...f3218ee04b08320a618183f516c14484116b70ef

-- 
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/85639e3dde6341cc4e171c400d39e52f315a180d...f3218ee04b08320a618183f516c14484116b70ef
You're receiving this email because of your account on gitlab.common-lisp.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20210413/edbd1a46/attachment-0001.html>


More information about the cmucl-cvs mailing list