emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 5cf148c 1/3: * Emit better debug comments in emit_st


From: Andrea Corallo
Subject: feature/native-comp 5cf148c 1/3: * Emit better debug comments in emit_static_object
Date: Sun, 31 May 2020 14:10:27 -0400 (EDT)

branch: feature/native-comp
commit 5cf148cfef23b827629950048dab678f3b9af2d3
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * Emit better debug comments in emit_static_object
    
        * src/comp.c (emit_static_object): Do not truncate debug
        comments at the first NULL character.
---
 src/comp.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/comp.c b/src/comp.c
index d3bff1e..f288fc2 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -2392,8 +2392,15 @@ emit_static_object (const char *name, Lisp_Object obj)
                                  0, NULL, 0);
   DECL_BLOCK (block, f);
 
-  /* NOTE this truncates if the data has some zero byte before termination.  */
-  gcc_jit_block_add_comment (block, NULL, p);
+  if (COMP_DEBUG > 1)
+    {
+      char *comment = memcpy (xmalloc (len), p, len);
+      for (ptrdiff_t i = 0; i < len - 1; i++)
+       if (!comment[i])
+         comment[i] = '\n';
+      gcc_jit_block_add_comment (block, NULL, comment);
+      xfree (comment);
+    }
 
   gcc_jit_lvalue *arr =
       gcc_jit_lvalue_access_field (data_struct, NULL, fields[1]);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]