ObjFW  Check-in [353b3ba81d]

Overview
Comment:OFException: Do not show <??+offset>.

The offset is useless if the symbol is unknown, especially if it gets
large because the offset is relative to 0.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 353b3ba81dc83f2f1e5b800f89fed9240e1dc688452fba0c8ad429ca9f675a34
User & Date: js on 2013-12-01 11:51:02
Original User & Date: js on 2013-12-01 11:51:03
Other Links: manifest | tags
Context
2013-12-01
11:51
OFMapTable: More overflow checks. check-in: 6085d4f6a4 user: js tags: trunk
11:51
OFException: Do not show <??+offset>. check-in: 353b3ba81d user: js tags: trunk
11:50
Clean up the path delimiter mess. check-in: 00dbb47969 user: js tags: trunk
Changes

Modified src/exceptions/OFException.m from [03e1d50c2c] to [76191c1054].

140
141
142
143
144
145
146



147
148
149


150
151
152
153
154

155
156
157
158
159
160
161
162
163
164
	uint_fast8_t i;

	for (i = 0; i < OF_BACKTRACE_SIZE && _backtrace[i] != NULL; i++) {
# ifdef HAVE_DLADDR
		Dl_info info;

		if (dladdr(_backtrace[i], &info)) {



			ptrdiff_t offset = (char*)_backtrace[i] -
			    (char*)info.dli_saddr;



			if (info.dli_sname == NULL)
				info.dli_sname = "??";

			[backtrace addObject:
			    [OFString stringWithFormat: @"%p <%s+%td> at %s",

							_backtrace[i],
							info.dli_sname, offset,
							info.dli_fname]];
		} else
# endif
			[backtrace addObject:
			    [OFString stringWithFormat: @"%p", _backtrace[i]]];
	}

	objc_autoreleasePoolPop(pool);







>
>
>
|
|

>
>
|
|
|
<
|
>
|
|
|







140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157

158
159
160
161
162
163
164
165
166
167
168
169
	uint_fast8_t i;

	for (i = 0; i < OF_BACKTRACE_SIZE && _backtrace[i] != NULL; i++) {
# ifdef HAVE_DLADDR
		Dl_info info;

		if (dladdr(_backtrace[i], &info)) {
			OFString *frame;

			if (info.dli_sname != NULL) {
				ptrdiff_t offset = (char*)_backtrace[i] -
				    (char*)info.dli_saddr;

				frame = [OFString stringWithFormat:
				    @"%p <%s+%td> at %s",
				    _backtrace[i], info.dli_sname, offset,
				    info.dli_fname];
			} else

				frame = [OFString stringWithFormat:
				    @"%p <?" @"?> at %s",
				    _backtrace[i], info.dli_fname];

			[backtrace addObject: frame];
		} else
# endif
			[backtrace addObject:
			    [OFString stringWithFormat: @"%p", _backtrace[i]]];
	}

	objc_autoreleasePoolPop(pool);