ObjFW  Check-in [6e8777fc03]

Overview
Comment:Make backtraces work with ARM EABI.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6e8777fc033edfec6f514161fa9b9b13f0af94296c903631174af778023470c4
User & Date: js on 2013-06-25 20:31:08
Other Links: manifest | tags
Context
2013-06-26
16:33
OF(Big)DataArray: Fix capacity handling. check-in: 93755dd482 user: js tags: trunk
2013-06-25
20:31
Make backtraces work with ARM EABI. check-in: 6e8777fc03 user: js tags: trunk
2013-06-23
21:52
Add a few casts to make GCC happy. check-in: 6192726d32 user: js tags: trunk
Changes

Modified src/exceptions/OFException.m from [ef6fdedc48] to [e70ae26647].

39
40
41
42
43
44
45



46

47
48
49
50
51
52
53






54

55
56
57
58
59
60
61
struct backtrace_ctx {
	void **backtrace;
	uint_fast8_t i;
};

extern _Unwind_Reason_Code _Unwind_Backtrace(
    _Unwind_Reason_Code(*)(struct _Unwind_Context*, void*), void*);



extern uintptr_t _Unwind_GetIP(struct _Unwind_Context*);


static _Unwind_Reason_Code
backtrace_callback(struct _Unwind_Context *ctx, void *data)
{
	struct backtrace_ctx *bt = data;

	if (bt->i < OF_BACKTRACE_SIZE) {






		bt->backtrace[bt->i++] = (void*)_Unwind_GetIP(ctx);

		return _URC_OK;
	}

	return _URC_END_OF_STACK;
}

@implementation OFException







>
>
>

>







>
>
>
>
>
>

>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
struct backtrace_ctx {
	void **backtrace;
	uint_fast8_t i;
};

extern _Unwind_Reason_Code _Unwind_Backtrace(
    _Unwind_Reason_Code(*)(struct _Unwind_Context*, void*), void*);
#if defined(__arm__) || defined(__ARM__)
extern int _Unwind_VRS_Get(struct _Unwind_Context*, int, uint32_t, int, void*);
#else
extern uintptr_t _Unwind_GetIP(struct _Unwind_Context*);
#endif

static _Unwind_Reason_Code
backtrace_callback(struct _Unwind_Context *ctx, void *data)
{
	struct backtrace_ctx *bt = data;

	if (bt->i < OF_BACKTRACE_SIZE) {
#if defined(__arm__) || defined(__ARM__)
		uintptr_t ip;

		_Unwind_VRS_Get(ctx, 0, 15, 0, &ip);
		bt->backtrace[bt->i++] = (void*)(ip & ~1);
#else
		bt->backtrace[bt->i++] = (void*)_Unwind_GetIP(ctx);
#endif
		return _URC_OK;
	}

	return _URC_END_OF_STACK;
}

@implementation OFException