memprof 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ext/elf.c CHANGED
@@ -60,8 +60,6 @@ struct elf_info {
60
60
  size_t plt_size;
61
61
  size_t plt_count;
62
62
 
63
- GElf_Addr debuglink_addr;
64
- size_t debuglink_sz;
65
63
  Elf_Data *debuglink_data;
66
64
 
67
65
  GElf_Ehdr ehdr;
@@ -1135,17 +1133,14 @@ dissect_elf(struct elf_info *info, int find_debug)
1135
1133
  if (strcmp(elf_strptr(elf, shstrndx, shdr.sh_name), ".plt") == 0) {
1136
1134
  info->plt_addr = shdr.sh_addr;
1137
1135
  } else if (strcmp(elf_strptr(elf, shstrndx, shdr.sh_name), ".gnu_debuglink") == 0) {
1138
- info->debuglink_addr = shdr.sh_addr;
1139
- info->debuglink_sz = shdr.sh_size;
1140
- dbg_printf("address: %lx, size: %zd\n", shdr.sh_addr, shdr.sh_size);
1141
-
1142
- if ((info->debuglink_data = elf_getdata(scn, NULL)) == NULL ||
1143
- info->debuglink_data->d_size == 0) {
1136
+ dbg_printf("gnu_debuglink section found\n", shdr.sh_size);
1137
+ if ((info->debuglink_data = elf_getdata(scn, NULL)) == NULL ||
1138
+ info->debuglink_data->d_size == 0) {
1144
1139
  dbg_printf(".gnu_debuglink section existed, but wasn't readable.\n");
1145
1140
  ret = 2;
1146
1141
  goto out;
1147
- }
1148
- dbg_printf("size: %zd\n", shdr.sh_size);
1142
+ }
1143
+ dbg_printf("gnu_debuglink section read (size: %zd)\n", shdr.sh_size);
1149
1144
  }
1150
1145
  }
1151
1146
  /*
@@ -1165,7 +1160,11 @@ dissect_elf(struct elf_info *info, int find_debug)
1165
1160
 
1166
1161
  /* If this object has no symbol table there's nothing else to do but fail */
1167
1162
  if (!info->symtab_data) {
1168
- dbg_printf("binary is stripped. memprof only works on binaries that are not stripped!\n");
1163
+ if (info->debuglink_data) {
1164
+ dbg_printf("binary is stripped, but there is debug symbol information. memprof will try to read debug symbols in.\n");
1165
+ } else {
1166
+ dbg_printf("binary is stripped, and no debug symbol info was found. memprof only works on binaries that are not stripped!\n");
1167
+ }
1169
1168
  ret = 1;
1170
1169
  }
1171
1170
 
@@ -1195,10 +1194,10 @@ dissect_elf(struct elf_info *info, int find_debug)
1195
1194
 
1196
1195
  out:
1197
1196
  if (find_debug && ret == 1) {
1198
- if (info->debuglink_addr) {
1197
+ if (info->debuglink_data) {
1199
1198
  find_debug_syms(info);
1200
1199
  } else {
1201
- dbg_printf("=== WARNING: Object %s was STRIPPED and had no debuglink section. Nothing left to try.", info->filename);
1200
+ dbg_printf("=== WARNING: Object %s was STRIPPED and had no debuglink section. Nothing left to try.\n", info->filename);
1202
1201
  }
1203
1202
  }
1204
1203
  return ret;
@@ -1,8 +1,9 @@
1
1
  require File.expand_path('../../memprof', __FILE__)
2
2
  module Memprof
3
3
  class Middleware
4
- def initialize(app)
4
+ def initialize(app, opts = {})
5
5
  @app = app
6
+ @options = opts
6
7
  end
7
8
  def call(env)
8
9
  ret = nil
data/memprof.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'memprof'
3
- s.version = '0.3.5'
3
+ s.version = '0.3.6'
4
4
  s.date = '2010-04-13'
5
5
  s.summary = 'Ruby Memory Profiler'
6
6
  s.description = "Ruby memory profiler similar to bleak_house, but without patches to the Ruby VM"
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memprof
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 31
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 3
8
- - 5
9
- version: 0.3.5
9
+ - 6
10
+ version: 0.3.6
10
11
  platform: ruby
11
12
  authors:
12
13
  - Joe Damato
@@ -17,16 +18,18 @@ autorequire:
17
18
  bindir: bin
18
19
  cert_chain: []
19
20
 
20
- date: 2010-04-13 00:00:00 -04:00
21
+ date: 2010-04-13 00:00:00 -07:00
21
22
  default_executable:
22
23
  dependencies:
23
24
  - !ruby/object:Gem::Dependency
24
25
  name: rest-client
25
26
  prerelease: false
26
27
  requirement: &id001 !ruby/object:Gem::Requirement
28
+ none: false
27
29
  requirements:
28
30
  - - ">="
29
31
  - !ruby/object:Gem::Version
32
+ hash: 3
30
33
  segments:
31
34
  - 1
32
35
  - 4
@@ -38,9 +41,11 @@ dependencies:
38
41
  name: term-ansicolor
39
42
  prerelease: false
40
43
  requirement: &id002 !ruby/object:Gem::Requirement
44
+ none: false
41
45
  requirements:
42
46
  - - ">="
43
47
  - !ruby/object:Gem::Version
48
+ hash: 3
44
49
  segments:
45
50
  - 0
46
51
  version: "0"
@@ -109,23 +114,27 @@ rdoc_options: []
109
114
  require_paths:
110
115
  - lib
111
116
  required_ruby_version: !ruby/object:Gem::Requirement
117
+ none: false
112
118
  requirements:
113
119
  - - ">="
114
120
  - !ruby/object:Gem::Version
121
+ hash: 3
115
122
  segments:
116
123
  - 0
117
124
  version: "0"
118
125
  required_rubygems_version: !ruby/object:Gem::Requirement
126
+ none: false
119
127
  requirements:
120
128
  - - ">="
121
129
  - !ruby/object:Gem::Version
130
+ hash: 3
122
131
  segments:
123
132
  - 0
124
133
  version: "0"
125
134
  requirements: []
126
135
 
127
136
  rubyforge_project:
128
- rubygems_version: 1.3.6
137
+ rubygems_version: 1.3.7
129
138
  signing_key:
130
139
  specification_version: 3
131
140
  summary: Ruby Memory Profiler