diff options
| author | Paul Eggert | 2014-05-28 22:31:43 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-05-28 22:31:43 -0700 |
| commit | 3c975a330715db418e474d40f3acaa5658e4bb44 (patch) | |
| tree | b905a4e42c4235adfa1ac316a3f020824ef17224 /src | |
| parent | ee6b43dc75639dcb2ba96cd756d8cf52412bac99 (diff) | |
| download | emacs-3c975a330715db418e474d40f3acaa5658e4bb44.tar.gz emacs-3c975a330715db418e474d40f3acaa5658e4bb44.zip | |
Port the GDB-visible symbols to AIX.
Without them, GDB doesn't work to debug Emacs, since the AIX linker
optimizes away the relevant external symbols. Use enums instead;
this suffices for the AIX port, which is 32-bit-only anyway.
* lisp.h (ENUMABLE, DEFINE_GDB_SYMBOL_ENUM): New macros.
(ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Use them.
(ARRAY_MARK_FLAG_val, PSEUDOVECTOR_FLAG_val, VALMASK_val):
New macros.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/lisp.h | 31 |
2 files changed, 38 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4e68b1b8452..2a3625b95da 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2014-05-29 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Port the GDB-visible symbols to AIX. | ||
| 4 | Without them, GDB doesn't work to debug Emacs, since the AIX linker | ||
| 5 | optimizes away the relevant external symbols. Use enums instead; | ||
| 6 | this suffices for the AIX port, which is 32-bit-only anyway. | ||
| 7 | * lisp.h (ENUMABLE, DEFINE_GDB_SYMBOL_ENUM): New macros. | ||
| 8 | (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Use them. | ||
| 9 | (ARRAY_MARK_FLAG_val, PSEUDOVECTOR_FLAG_val, VALMASK_val): | ||
| 10 | New macros. | ||
| 11 | |||
| 1 | 2014-05-26 Paul Eggert <eggert@cs.ucla.edu> | 12 | 2014-05-26 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 13 | ||
| 3 | Include sources used to create macuvs.h. | 14 | Include sources used to create macuvs.h. |
diff --git a/src/lisp.h b/src/lisp.h index c7fc5962349..af54887a51a 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -36,14 +36,21 @@ INLINE_HEADER_BEGIN | |||
| 36 | 36 | ||
| 37 | /* Define a TYPE constant ID as an externally visible name. Use like this: | 37 | /* Define a TYPE constant ID as an externally visible name. Use like this: |
| 38 | 38 | ||
| 39 | #define ID_val (some integer preprocessor expression) | ||
| 40 | #if ENUMABLE (ID_val) | ||
| 41 | DEFINE_GDB_SYMBOL_ENUM (ID) | ||
| 42 | #else | ||
| 39 | DEFINE_GDB_SYMBOL_BEGIN (TYPE, ID) | 43 | DEFINE_GDB_SYMBOL_BEGIN (TYPE, ID) |
| 40 | #define ID something | 44 | # define ID ID_val |
| 41 | DEFINE_GDB_SYMBOL_END (ID) | 45 | DEFINE_GDB_SYMBOL_END (ID) |
| 46 | #endif | ||
| 42 | 47 | ||
| 43 | This hack is for the benefit of compilers that do not make macro | 48 | This hack is for the benefit of compilers that do not make macro |
| 44 | definitions visible to the debugger. It's used for symbols that | 49 | definitions visible to the debugger. It's used for symbols that |
| 45 | .gdbinit needs, symbols whose values may not fit in 'int' (where an | 50 | .gdbinit needs, symbols whose values may not fit in 'int' (where an |
| 46 | enum would suffice). */ | 51 | enum would suffice). */ |
| 52 | #define ENUMABLE(val) (INT_MIN <= (val) && (val) <= INT_MAX) | ||
| 53 | #define DEFINE_GDB_SYMBOL_ENUM(id) enum { id = id##_val }; | ||
| 47 | #if defined MAIN_PROGRAM | 54 | #if defined MAIN_PROGRAM |
| 48 | # define DEFINE_GDB_SYMBOL_BEGIN(type, id) type const id EXTERNALLY_VISIBLE | 55 | # define DEFINE_GDB_SYMBOL_BEGIN(type, id) type const id EXTERNALLY_VISIBLE |
| 49 | # define DEFINE_GDB_SYMBOL_END(id) = id; | 56 | # define DEFINE_GDB_SYMBOL_END(id) = id; |
| @@ -571,15 +578,25 @@ LISP_MACRO_DEFUN (XIL, Lisp_Object, (EMACS_INT i), (i)) | |||
| 571 | 578 | ||
| 572 | /* In the size word of a vector, this bit means the vector has been marked. */ | 579 | /* In the size word of a vector, this bit means the vector has been marked. */ |
| 573 | 580 | ||
| 581 | #define ARRAY_MARK_FLAG_val PTRDIFF_MIN | ||
| 582 | #if ENUMABLE (ARRAY_MARK_FLAG_val) | ||
| 583 | DEFINE_GDB_SYMBOL_ENUM (ARRAY_MARK_FLAG) | ||
| 584 | #else | ||
| 574 | DEFINE_GDB_SYMBOL_BEGIN (ptrdiff_t, ARRAY_MARK_FLAG) | 585 | DEFINE_GDB_SYMBOL_BEGIN (ptrdiff_t, ARRAY_MARK_FLAG) |
| 575 | #define ARRAY_MARK_FLAG PTRDIFF_MIN | 586 | # define ARRAY_MARK_FLAG ARRAY_MARK_FLAG_val |
| 576 | DEFINE_GDB_SYMBOL_END (ARRAY_MARK_FLAG) | 587 | DEFINE_GDB_SYMBOL_END (ARRAY_MARK_FLAG) |
| 588 | #endif | ||
| 577 | 589 | ||
| 578 | /* In the size word of a struct Lisp_Vector, this bit means it's really | 590 | /* In the size word of a struct Lisp_Vector, this bit means it's really |
| 579 | some other vector-like object. */ | 591 | some other vector-like object. */ |
| 592 | #define PSEUDOVECTOR_FLAG_val (PTRDIFF_MAX - PTRDIFF_MAX / 2) | ||
| 593 | #if ENUMABLE (PSEUDOVECTOR_FLAG_val) | ||
| 594 | DEFINE_GDB_SYMBOL_ENUM (PSEUDOVECTOR_FLAG) | ||
| 595 | #else | ||
| 580 | DEFINE_GDB_SYMBOL_BEGIN (ptrdiff_t, PSEUDOVECTOR_FLAG) | 596 | DEFINE_GDB_SYMBOL_BEGIN (ptrdiff_t, PSEUDOVECTOR_FLAG) |
| 581 | #define PSEUDOVECTOR_FLAG (PTRDIFF_MAX - PTRDIFF_MAX / 2) | 597 | # define PSEUDOVECTOR_FLAG PSEUDOVECTOR_FLAG_val |
| 582 | DEFINE_GDB_SYMBOL_END (PSEUDOVECTOR_FLAG) | 598 | DEFINE_GDB_SYMBOL_END (PSEUDOVECTOR_FLAG) |
| 599 | #endif | ||
| 583 | 600 | ||
| 584 | /* In a pseudovector, the size field actually contains a word with one | 601 | /* In a pseudovector, the size field actually contains a word with one |
| 585 | PSEUDOVECTOR_FLAG bit set, and one of the following values extracted | 602 | PSEUDOVECTOR_FLAG bit set, and one of the following values extracted |
| @@ -641,9 +658,15 @@ enum More_Lisp_Bits | |||
| 641 | XCONS (tem) is the struct Lisp_Cons * pointing to the memory for | 658 | XCONS (tem) is the struct Lisp_Cons * pointing to the memory for |
| 642 | that cons. */ | 659 | that cons. */ |
| 643 | 660 | ||
| 661 | /* Mask for the value (as opposed to the type bits) of a Lisp object. */ | ||
| 662 | #define VALMASK_val (USE_LSB_TAG ? - (1 << GCTYPEBITS) : VAL_MAX) | ||
| 663 | #if ENUMABLE (VALMASK_val) | ||
| 664 | DEFINE_GDB_SYMBOL_ENUM (VALMASK) | ||
| 665 | #else | ||
| 644 | DEFINE_GDB_SYMBOL_BEGIN (EMACS_INT, VALMASK) | 666 | DEFINE_GDB_SYMBOL_BEGIN (EMACS_INT, VALMASK) |
| 645 | #define VALMASK (USE_LSB_TAG ? - (1 << GCTYPEBITS) : VAL_MAX) | 667 | # define VALMASK VALMASK_val |
| 646 | DEFINE_GDB_SYMBOL_END (VALMASK) | 668 | DEFINE_GDB_SYMBOL_END (VALMASK) |
| 669 | #endif | ||
| 647 | 670 | ||
| 648 | /* Largest and smallest representable fixnum values. These are the C | 671 | /* Largest and smallest representable fixnum values. These are the C |
| 649 | values. They are macros for use in static initializers. */ | 672 | values. They are macros for use in static initializers. */ |