Thread: [Cgdb-devel] Mac OS X 10.5 cgdb Patches
Brought to you by:
bobbybrasko,
crouchingturbo
From: Kyle M. <ma...@gm...> - 2009-06-15 23:18:59
|
cgdb-0.6.4 has difficulties building for Mac OS X 10.5. It needs to have HAVE_OPENPTY defined. You can either do: CFLAGS=-DHAVE_OPENPTY ./configure Or apply a patch to configure.init. The patches are attached to cgdb bug 2806868 here: https://sourceforge.net/tracker/?func=detail&aid=2806854&group_id=72581&atid=534974 Additionally, Mac OS X commonly uses files with extensions .cp, .m, .mm and .M. These files are not currently colorized by the cgdb tokenizer. The C tokenizer does a very good job with these (.cp = C++, .m = Objective-C, .mm/.M = Objective-C++). A simple patch to tokenizer.c allows the C tokenizer to colorize these. The patch is attached to cgdb bug 2806868 here: https://sourceforge.net/tracker/?func=detail&aid=2806868&group_id=72581&atid=534974 Kyle |
From: Bob R. <bo...@br...> - 2009-06-19 11:41:26
|
On Mon, Jun 15, 2009 at 04:18:51PM -0700, Kyle McKay wrote: > cgdb-0.6.4 has difficulties building for Mac OS X 10.5. It needs to > have HAVE_OPENPTY defined. > > You can either do: > > CFLAGS=-DHAVE_OPENPTY ./configure > > Or apply a patch to configure.init. The patches are attached to cgdb > bug 2806868 here: > > https://sourceforge.net/tracker/?func=detail&aid=2806854&group_id=72581&atid=534974 > > Additionally, Mac OS X commonly uses files with > extensions .cp, .m, .mm and .M. These files are not currently > colorized by the cgdb tokenizer. The C tokenizer does a very good job > with these (.cp = C++, .m = Objective-C, .mm/.M = Objective-C++). A > simple patch to tokenizer.c allows the C tokenizer to colorize these. > The patch is attached to cgdb bug 2806868 here: > > https://sourceforge.net/tracker/?func=detail&aid=2806868&group_id=72581&atid=534974 Hi Kyle, Thanks for the work here. We would love to add these patches to cgdb and finally get another release out. One thing we are researching is, how to get access to a Mac maching for testing purposes. Up until now, we can't seem to get access to one. Would you have an account available somewhere you could provide us with, temporarily of course? Thanks, Bob Rossi |
From: Kyle M. <ma...@gm...> - 2009-06-19 17:45:20
|
On Jun 19, 2009, at 04:04, Bob Rossi wrote: > On Mon, Jun 15, 2009 at 04:18:51PM -0700, Kyle McKay wrote: >> cgdb-0.6.4 has difficulties building for Mac OS X 10.5. It needs to >> have HAVE_OPENPTY defined. >> >> You can either do: >> >> CFLAGS=-DHAVE_OPENPTY ./configure >> >> Or apply a patch to configure.init. The patches are attached to cgdb >> bug 2806868 here: >> >> https://sourceforge.net/tracker/?func=detail&aid=2806854&group_id=72581&atid=534974 >> >> Additionally, Mac OS X commonly uses files with >> extensions .cp, .m, .mm and .M. These files are not currently >> colorized by the cgdb tokenizer. The C tokenizer does a very good >> job >> with these (.cp = C++, .m = Objective-C, .mm/.M = Objective-C++). A >> simple patch to tokenizer.c allows the C tokenizer to colorize these. >> The patch is attached to cgdb bug 2806868 here: >> >> https://sourceforge.net/tracker/?func=detail&aid=2806868&group_id=72581&atid=534974 > > Hi Kyle, > > Thanks for the work here. We would love to add these patches to cgdb > and finally get another release out. One thing we are researching is, > how to get access to a Mac maching for testing purposes. Up until now, > we can't seem to get access to one. Would you have an account > available > somewhere you could provide us with, temporarily of course? > > Thanks, > Bob Rossi Bob, Sorry, I don't have any publicly-visible machines. I do have both 10.5.7 and 10.4.11 running on different machines though and would be happy to build specific revisions and/or tarballs cgdb on those machines and send you the script output so you can verify a successful build (a manual tinderbox). Kyle |
From: Bob R. <bo...@br...> - 2009-07-21 18:47:54
|
On Fri, Jun 19, 2009 at 10:45:00AM -0700, Kyle McKay wrote: > Sorry, I don't have any publicly-visible machines. I do have both > 10.5.7 and 10.4.11 running on different machines though and would be > happy to build specific revisions and/or tarballs cgdb on those > machines and send you the script output so you can verify a successful > build (a manual tinderbox). Hi Kyle, Sorry for the delay. I would like to help get these patches into CGDB as soon as possible. I'm going to patch them into CGDB, and then provide you with a tarball that perhaps you could test on your mac machines? Sending me the build output would be great. If you say it works for you, I'll consider that an improvement, and we can release with those changes. Thanks, Bob Rossi |
From: Kyle M. <ma...@gm...> - 2009-07-21 19:19:31
|
On Jul 21, 2009, at 08:32, Bob Rossi wrote: > On Fri, Jun 19, 2009 at 10:45:00AM -0700, Kyle McKay wrote: >> Sorry, I don't have any publicly-visible machines. I do have both >> 10.5.7 and 10.4.11 running on different machines though and would be >> happy to build specific revisions and/or tarballs cgdb on those >> machines and send you the script output so you can verify a >> successful >> build (a manual tinderbox). > > Hi Kyle, > > Sorry for the delay. I would like to help get these patches into CGDB > as soon as possible. I'm going to patch them into CGDB, and then > provide you with a tarball that perhaps you could test on your > mac machines? Sending me the build output would be great. No problem. That's easy to do. I'll send you a gzipped script output file of the build. Kyle > If you say it works for you, I'll consider that an improvement, and > we can release with those changes. > > Thanks, > Bob Rossi > > ------------------------------------------------------------------------------ > _______________________________________________ > Cgdb-devel mailing list > Cgd...@li... > https://lists.sourceforge.net/lists/listinfo/cgdb-devel |
From: Bob R. <bo...@br...> - 2009-07-22 02:37:33
|
On Mon, Jun 15, 2009 at 04:18:51PM -0700, Kyle McKay wrote: > cgdb-0.6.4 has difficulties building for Mac OS X 10.5. It needs to > have HAVE_OPENPTY defined. > > You can either do: > > CFLAGS=-DHAVE_OPENPTY ./configure > > Or apply a patch to configure.init. The patches are attached to cgdb > bug 2806868 here: > > https://sourceforge.net/tracker/?func=detail&aid=2806854&group_id=72581&atid=534974 OK, I've applied this patch, please try this test release, http://brasko.net:81/bob/cgdb-20090721.tar.gz and let me know how it works out. If it works for you, I'll put it in the next release. > Additionally, Mac OS X commonly uses files with > extensions .cp, .m, .mm and .M. These files are not currently > colorized by the cgdb tokenizer. The C tokenizer does a very good job > with these (.cp = C++, .m = Objective-C, .mm/.M = Objective-C++). A > simple patch to tokenizer.c allows the C tokenizer to colorize these. > The patch is attached to cgdb bug 2806868 here: > > https://sourceforge.net/tracker/?func=detail&aid=2806868&group_id=72581&atid=534974 I'd prefer not to do a solution like this. However, if you want to write the entire scanner for the Objective-C++ language, I'll accept it. I can show you what to do if you want. It's mostly just a flex scanner under the hood. All you really need to do is enumerate all the keywords. Thanks, Bob Rossi |
From: Kyle M. <ma...@gm...> - 2009-07-23 00:58:45
|
On Jul 21, 2009, at 18:36, Bob Rossi wrote: > On Mon, Jun 15, 2009 at 04:18:51PM -0700, Kyle McKay wrote: >> cgdb-0.6.4 has difficulties building for Mac OS X 10.5. It needs to >> have HAVE_OPENPTY defined. >> >> You can either do: >> >> CFLAGS=-DHAVE_OPENPTY ./configure >> >> Or apply a patch to configure.init. The patches are attached to cgdb >> bug 2806868 here: >> >> https://sourceforge.net/tracker/?func=detail&aid=2806854&group_id=72581&atid=534974 > > OK, I've applied this patch, please try this test release, > http://brasko.net:81/bob/cgdb-20090721.tar.gz > and let me know how it works out. If it works for you, I'll put it > in the next release. It configured, built and ran on both Mac OS X 10.4.11 and Mac OS X 10.5.7. See attached gzipped script output. (Note that I had already separately installed a compatible version of readline first as the native Mac OS X readline (4.2) is too old -- that installation is not included in the script output.) >> Additionally, Mac OS X commonly uses files with >> extensions .cp, .m, .mm and .M. These files are not currently >> colorized by the cgdb tokenizer. The C tokenizer does a very good >> job >> with these (.cp = C++, .m = Objective-C, .mm/.M = Objective-C++). A >> simple patch to tokenizer.c allows the C tokenizer to colorize these. >> The patch is attached to cgdb bug 2806868 here: >> >> https://sourceforge.net/tracker/?func=detail&aid=2806868&group_id=72581&atid=534974 What about the ".cp" extension? That's a normal C++ file? Please add the .cp extension to the list of extensions handled by the existing lexer -- ".cp" is a commonly used C++ extension in a variety of open source file projects. > I'd prefer not to do a solution like this. However, if you want to > write > the entire scanner for the Objective-C++ language, I'll accept it. I will be happy to do that. Since the Objective-C language has exactly the same tokenizer as the C language it likely wouldn't require much effort to create an Objective-C/Objective-C++ highlighter from the existing C/C++ one already in cgdb. FYI here is some valid C: #define doubleit * 2 typedef int id; id array[20]; id value = 7; id x = array[value doubleit]; /* index integer array */ Here is some valid Objective-C: #include <objc/objc.h> id value = nil; /* id and nil are defined in objc.h */ id x = [value doubleit]; /* send doubleit message to value object */ Objective-C provides minor extensions to the C grammar. Objective-C is a very thin layer on top of C, and moreover is a strict superset of C. Objective-C treats token sequences between '[' and ']' specially when the '[' ... ']' sequence appears in certain grammar contexts. Objective-C does introduce some special two-token keywords that start with '@' such as '@class', '@interface', '@implementation', '@end', etc. and if the first token after the '[' of a special '[' ... ']' sequence is the identifier 'self' or 'super' it is treated specially. Finally Objective-C adds the '#import' directive that's identical to '#include' except it's guaranteed to only include files once. Objective-C++ is identical to Objective-C except that the extensions are provided to the C++ grammar rather than the C grammer. > I can show you what to do if you want. It's mostly just a flex scanner > under the hood. All you really need to do is enumerate all the > keywords. Sure, I'll be happy to create a flex scanner since it will be basically a copy of the C/C++ one that's already there plus recognition of the few special Objective-C keywords/types that are added and '#import'. The existing C/C++ scanner already does 99% of what it needs to do for Objective-C/Objective-C++ sources. Just point me to the code. Thanks, Kyle > Thanks, > Bob Rossi > > ------------------------------------------------------------------------------ > _______________________________________________ > Cgdb-devel mailing list > Cgd...@li... > https://lists.sourceforge.net/lists/listinfo/cgdb-devel |
From: Bob R. <bo...@br...> - 2009-07-23 02:13:44
|
On Wed, Jul 22, 2009 at 05:58:34PM -0700, Kyle McKay wrote: > On Jul 21, 2009, at 18:36, Bob Rossi wrote: >> On Mon, Jun 15, 2009 at 04:18:51PM -0700, Kyle McKay wrote: >>> cgdb-0.6.4 has difficulties building for Mac OS X 10.5. It needs to >>> have HAVE_OPENPTY defined. >>> >>> You can either do: >>> >>> CFLAGS=-DHAVE_OPENPTY ./configure >>> >>> Or apply a patch to configure.init. The patches are attached to cgdb >>> bug 2806868 here: >>> >>> https://sourceforge.net/tracker/?func=detail&aid=2806854&group_id=72581&atid=534974 >> >> OK, I've applied this patch, please try this test release, >> http://brasko.net:81/bob/cgdb-20090721.tar.gz >> and let me know how it works out. If it works for you, I'll put it >> in the next release. > > It configured, built and ran on both Mac OS X 10.4.11 and Mac OS X > 10.5.7. See attached gzipped script output. (Note that I had already > separately installed a compatible version of readline first as the > native Mac OS X readline (4.2) is too old -- that installation is not > included in the script output.) OK, this has been accepted and applied. Thank you so much for this patch, it has been reported before, but never was resolved. >>> Additionally, Mac OS X commonly uses files with >>> extensions .cp, .m, .mm and .M. These files are not currently >>> colorized by the cgdb tokenizer. The C tokenizer does a very good >>> job >>> with these (.cp = C++, .m = Objective-C, .mm/.M = Objective-C++). A >>> simple patch to tokenizer.c allows the C tokenizer to colorize these. >>> The patch is attached to cgdb bug 2806868 here: >>> >>> https://sourceforge.net/tracker/?func=detail&aid=2806868&group_id=72581&atid=534974 > > What about the ".cp" extension? That's a normal C++ file? Please add > the .cp extension to the list of extensions handled by the existing > lexer -- ".cp" is a commonly used C++ extension in a variety of open > source file projects. OK, I will do this. >> I can show you what to do if you want. It's mostly just a flex scanner >> under the hood. All you really need to do is enumerate all the >> keywords. > > Sure, I'll be happy to create a flex scanner since it will be basically a > copy of the C/C++ one that's already there plus recognition of the few > special Objective-C keywords/types that are added and '#import'. The > existing C/C++ scanner already does 99% of what it needs to do for > Objective-C/Objective-C++ sources. > > Just point me to the code. OK, I will, give me some time to refresh my memory and I'll give you some good instructions. Thanks, Bob Rossi |
From: Kyle M. <ma...@gm...> - 2009-07-23 07:44:24
Attachments:
lexer-patch.gz
|
On Jul 22, 2009, at 19:13, Bob Rossi wrote: >>>> Additionally, Mac OS X commonly uses files with >>>> extensions .cp, .m, .mm and .M. These files are not currently >>>> colorized by the cgdb tokenizer. The C tokenizer does a very good >>>> job >>>> with these (.cp = C++, .m = Objective-C, .mm/.M = Objective-C+ >>>> +). A >>>> simple patch to tokenizer.c allows the C tokenizer to colorize >>>> these. >>>> The patch is attached to cgdb bug 2806868 here: >>>> >>>> https://sourceforge.net/tracker/?func=detail&aid=2806868&group_id=72581&atid=534974 >> >> What about the ".cp" extension? That's a normal C++ file? Please >> add >> the .cp extension to the list of extensions handled by the existing >> lexer -- ".cp" is a commonly used C++ extension in a variety of open >> source file projects. > > OK, I will do this. > >>> I can show you what to do if you want. It's mostly just a flex >>> scanner >>> under the hood. All you really need to do is enumerate all the >>> keywords. >> >> Sure, I'll be happy to create a flex scanner since it will be >> basically a >> copy of the C/C++ one that's already there plus recognition of the >> few >> special Objective-C keywords/types that are added and '#import'. The >> existing C/C++ scanner already does 99% of what it needs to do for >> Objective-C/Objective-C++ sources. >> >> Just point me to the code. > > OK, I will, give me some time to refresh my memory and I'll give you > some good instructions. Okay, I've attached a patch that adds a new lexer for Objective-C/ Objective-C++ files. The attached patch (lexer-patch.gz) is against revision 929 (the latest on trunk) of the cgdb subversion repository (and can be applied with patch -p1 to a checkout of http://cgdb.svn.sourceforge.net/svnroot/cgdb/cgdb/trunk) . The patch also includes the addition of ".cp" to the c_extensions list and includes the C-specific enhancements I added for objclexer.l as a patch to the C lexer as well: * Now recognizes hexadecimal integer literals * Now recognizes \octal and \xHEX character constants as literals ('\x55' '\012') * Now recognizes 'NULL' as a literal * Now recognizes false and true as literals (they are defined as the two boolean literals in the standard) not keywords. * Now recognizes integer suffixes and optional minus sign as part of the number literal * Now recognizes floating point constant literals * Now recognizes the leading 'L' as part of the literal for wide character and wide string literals And tokenizer-driver.c was updated as well to support 'objc' as a lexer name. It builds, runs and highlights properly for me. Other than the new objclexer.l file (which is about 80% the same as clexer.l), the changes are pretty minor. Kyle |