* [RFC/AIX] xm-aix4.h - Move some host-specific stuff
@ 2004-08-08 5:14 Joel Brobecker
2004-08-08 12:41 ` Mark Kettenis
0 siblings, 1 reply; 2+ messages in thread
From: Joel Brobecker @ 2004-08-08 5:14 UTC (permalink / raw)
To: gdb-patches; +Cc: Andrew Cagney, Peter Schauer, Kevin Buettner
The last part of config/xm-aix4.h contains the following definitions:
| /* Signal handler for SIGWINCH `window size changed'. */
|
| #define SIGWINCH_HANDLER aix_resizewindow
| extern void aix_resizewindow (int);
|
| /* `lines_per_page' and `chars_per_line' are local to utils.c. Rectify this. */
| #define SIGWINCH_HANDLER_BODY \
| \
| /* Respond to SIGWINCH `window size changed' signal, and reset GDB's \
| window settings appropriately. */ \
| \
| void \
| aix_resizewindow (signo) \
| int signo; \
| { \
| int fd = fileno (stdout); \
| if (isatty (fd)) { \
| int val; \
| \
| val = atoi (termdef (fd, 'l')); \
| if (val > 0) \
| lines_per_page = val; \
| val = atoi (termdef (fd, 'c')); \
| if (val > 0) \
| chars_per_line = val; \
| } \
| }
Not sure how to handle this part...
First problem: SIGWINCH_HANDLER is used in several files. So when
we define SIGWINCH_HANDLER, we also need to make sure that the prototype
of the procedure it has been defined to is placed somewhere these files
can see them.
Second problem: The body of aix_resizewindow() needs to be moved
somewhere aix-host-specific. Do we have a mechanism for storing
host-specific code? *-nat files, maybe (I wouldn't think so).
Moving that body would allow us to get rid of SIGWINCH_HANDLER_BODY.
If we had a location that would be host-specific to AIX, I would do
the following: Declare in one of .h files a variable, initialized
to NULL, that would be a pointer to the SIGWINCH event. Then, initialize
this variable to aix_resizewindow during the initialization phase
of that aix file. Then modify all the users of this macro from
#ifdef SIGWINCH_HANDLER
do_something_with (SIGWINCH_HANDLER);
#endif
to code like this:
if (sigwinch_handler != NULL)
do_something_with (SIGWINCH_HANDLER);
--
Joel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC/AIX] xm-aix4.h - Move some host-specific stuff
2004-08-08 5:14 [RFC/AIX] xm-aix4.h - Move some host-specific stuff Joel Brobecker
@ 2004-08-08 12:41 ` Mark Kettenis
0 siblings, 0 replies; 2+ messages in thread
From: Mark Kettenis @ 2004-08-08 12:41 UTC (permalink / raw)
To: brobecker; +Cc: gdb-patches
Date: Sat, 7 Aug 2004 22:14:20 -0700
From: Joel Brobecker <brobecker@gnat.com>
The last part of config/xm-aix4.h contains the following definitions:
| /* Signal handler for SIGWINCH `window size changed'. */
|
| #define SIGWINCH_HANDLER aix_resizewindow
| extern void aix_resizewindow (int);
|
| /* `lines_per_page' and `chars_per_line' are local to utils.c. Rectify this. */
| #define SIGWINCH_HANDLER_BODY \
| \
| /* Respond to SIGWINCH `window size changed' signal, and reset GDB's \
| window settings appropriately. */ \
| \
| void \
| aix_resizewindow (signo) \
| int signo; \
| { \
| int fd = fileno (stdout); \
| if (isatty (fd)) { \
| int val; \
| \
| val = atoi (termdef (fd, 'l')); \
| if (val > 0) \
| lines_per_page = val; \
| val = atoi (termdef (fd, 'c')); \
| if (val > 0) \
| chars_per_line = val; \
| } \
| }
Nowadays, GDB relies very much on readline to get this right. If
readline gets this right on AIX, this bit can simply go. I'm failrly
certain readline gets this right on AIX, since readline seems to do
exectly what the AIX Technical Reference says that termdef does.
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-08-08 12:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-08 5:14 [RFC/AIX] xm-aix4.h - Move some host-specific stuff Joel Brobecker
2004-08-08 12:41 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox