[前][次][番号順一覧][スレッド一覧]

ruby-changes:17925

From: naruse <ko1@a...>
Date: Fri, 26 Nov 2010 13:39:33 +0900 (JST)
Subject: [ruby-changes:17925] Ruby:r29941 (trunk): * addr2line.c: apply a patch from shinichiro.h.

naruse	2010-11-26 13:39:23 +0900 (Fri, 26 Nov 2010)

  New Revision: 29941

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29941

  Log:
    * addr2line.c: apply a patch from shinichiro.h.

  Modified files:
    trunk/ChangeLog
    trunk/addr2line.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29940)
+++ ChangeLog	(revision 29941)
@@ -1,3 +1,7 @@
+Fri Nov 26 13:33:24 2010  NARUSE, Yui  <naruse@r...>
+
+	* addr2line.c: apply a patch from shinichiro.h.
+
 Fri Nov 26 12:21:20 2010  NARUSE, Yui  <naruse@r...>
 
 	* addr2line.c: added to show source filename and line number of
Index: addr2line.c
===================================================================
--- addr2line.c	(revision 29940)
+++ addr2line.c	(revision 29941)
@@ -51,11 +51,13 @@
 #define DW_LNE_define_file              0x03
 #define DW_LNE_set_discriminator        0x04  /* DWARF4 */
 
+#ifndef ElfW
 # if SIZEOF_VOIDP == 8
 #  define ElfW(x) Elf64##_##x
 # else
 #  define ElfW(x) Elf32##_##x
 # endif
+#endif
 
 typedef struct {
     const char *dirname;
@@ -210,7 +212,7 @@
     unsigned int file = 1;
     unsigned int line = 1;
     unsigned int column = 0;
-    int is_stmt = default_is_stmt;
+    int is_stmt;
     int basic_block = 0;
     int end_sequence = 0;
     int prologue_end = 0;
@@ -239,7 +241,7 @@
     minimum_instruction_length = *(unsigned char *)p;
     p++;
 
-    default_is_stmt = *(unsigned char *)p;
+    is_stmt = default_is_stmt = *(unsigned char *)p;
     p++;
 
     line_base = *(char *)p;
@@ -489,10 +491,17 @@
 	binary_filename[len] = '\0';
 
 	fd = open(binary_filename, O_RDONLY);
+	if (fd < 0) {
+	    continue;
+	}
 	filesize = lseek(fd, 0, SEEK_END);
 	lseek(fd, 0, SEEK_SET);
 	/* async-signal unsafe */
 	file = (char *)mmap(NULL, filesize, PROT_READ, MAP_SHARED, fd, 0);
+	if (file == MAP_FAILED) {
+	    perror("mmap");
+	    continue;
+	}
 
 	lines[i].fd = fd;
 	lines[i].mapped = file;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]