Community
Participate
Working Groups
In my simple hello world program, I was unable to see any variables.
This is with the XTools 1.2 which include gdb 5.3.
Make that XCode Tools 1.2. I'm still learning the lingo :-)
Hmm, neither am I. I'll see what I can find...
PR was not targeted to any particular release. Changing target milestone to 2.1
Created attachment 13041 [details] getMIArgs() patch
The problem is that getMIArgs() does not parse gdb output correctly. According to the docs, a value can consist of a list containing a tuple that contains only a single result. This is how gdb under MacOSX formats the result of a '-stack-list-locals 0' command. Under MacOSX: -stack-list-locals 0 ^done,locals=[{name="a"}] Under Linux: -stack-list-locals 0 ^done,locals=[name="a"] Both of these seem to be valid syntax. While this fixes the variable display problem, I suspect other parsing problems may come to light.
Actually, I'll leave this bug open until we get the patch committed. First, I'd like Mikhail to give his stamp of approval. Mikhail, could you review this and if you approve, commit it for us. Thanks.
Sorry Doug, but I have to redirect this to our mi expert - Alain.
I've noticed that while the correct value for a variable is displayed when the variable is selected, it's value in the variables view is not updated when stepping through the code (it is if you run to a breakpoint). I don't have another platform to see if this is a debugger problem, or a problem with macosx. Can someone let me know if this is the case on other platforms?
The variable update seems to work fine on other platforms.
> Both of these seem to be valid syntax. While this fixes the variable display > problem, I suspect other parsing problems may come to light. Interresting. Is this something you would want for the 2.0.1(2.0_branch) ? I'll take a look closer at it(The patch) later. I beleive you are rigth the syntax does allowed the return of tuple, not sure why gdb-5.3 is different on Mac. Let me know of other discrepencies. I'll grab this one from you for the follups Thanks.
Thanks, Alain, No, this is for HEAD. We're finding a few other differences with the gnu tools that Apple has munged to work with OS X. I have no idea why...
Apple patch gdb pretty heavily to support the macosx architecture. I suspect they have modified this to support their development tools.
Allright the patch looks good. Applied to the head, Thanks. PR flipped to Fixed. Doug|Gwatson can you verify the PR.
was this bug fix included in the 2.0 version that's available online now? does comment 4 mean that it will be fixed for version 2.1? is there an easy way for me to apply a patch? (i'm not a CDT developer in any way...) i don't understand how xcode is related to this problem but i don't see any variables within eclipse on OSX on a custom makefile project either. the files are compiled with options like -ggdb.
This is fixed for 2.1. You can get the latest nightly builds from http://download.eclipse.org/tools/cdt/builds. We are using the gnu tools from xcode which appear to be heavily customized for the xcode integration.
The gdb version for MacOS X 10.4 has changed the output format for the -stack-list-locals command which has broken the variables view again. It seems that they now use a tuple of tuples rather than a list of tuples, so that the following output is generated: -stack-list-locals 0 ^done,locals={{name="a"},{name="b"}} I'll submit a patch when I get a chance (next few days), but feel free to fix it before then :-)
Returning to the pool.
Created attachment 27889 [details] Mac OS X 10.4 Tuple patch
Unfortunately it looks like Apple have modified the tuple syntax in 10.4. The syntax is now the same as that for lists, i.e.: list -> "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]" tuple -> "{}" | "{" value ( "," value )* "}" | "{" result ( "," result )* "}" At least one debugger command (-stack-list-locals) returns results using this format. The patch fixes this particular command, though there may be others that I have missed. I'm not sure how best to deal with this, since it's introducing non-standard MI syntax.
Created attachment 27892 [details] Tuple patch with debugging removed Here's the same patch with debugging println's removed.
Created attachment 31099 [details] patch fixing arguments and variables There is also a problem display function arguments that is caused by the same problem. This is an updated patch that fixes both the variable and argument problem on Mac OS X 10.4
This will be addressed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=114793.
Greg, I created an extension point to contribute a gdb/mi command factory to the CDT debugger (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=114793). I have already added command factories for Linux and Windows. To fix this bug I need to create a new command factory by extending the "CommandFactory" class and applying your patches. But first I need the answer to the following questions: Are these patches complete? Do they cover all gdb commands used by CDT? Do we need different command factories for different versions of MacOS? The problem is that I don't have access to MacOS and I can't even try it. Thank you, Mikhail
Mikhail, The patches are unlikely to be complete because I only fixed problems that I saw with arguments/variables. I suspect that anywhere you would normally expect to see a list, you'll see a tuple under MacOS. Most things do seem to work ok though (breakpoints, etc.) but I haven't checked the more obscure functions. Nevertheless, I would be satisfied with an initial fix of arguments/variables and patch other problems as they come to light. The alternative would be to look through the changes in the Darwin version of gdb which is available from http://www.opensource.apple.com/darwinsource/10.4.4.ppc/gdb-413/. I believe there are differences between the 10.3.X and 10.4.X versions of gdb, but its highly unlikely that anyone is running Eclipse under anything earlier than 10.3.X. I would think that it is also not worth providing a 10.3.X version, since most would have upgraded to 10.4.X by now. There *may* be differences in gdb between minor releases, but since it's relatively simple to upgrade a minor release I would suggest starting at 10.4.4. I'm happy to test 10.4.4 and later versions for you, but unfortunately don't have any machines running earlier versions of 10.4. I do have a machine running 10.3, so if you really want to support that version, I can test it for you. Regards, Greg
Thanks, Greg. I'll try the patch.
Added gdb/mi command factory for Mac OS. Reviewed and applied Greg's patch that beefs up support for MI results containing tuples. Added one additional change in MIVarUpdateInfo. Debug sessions now startup and variables display correctly on Mac OS 10.4.6 with latest dev tools. Ran before and after tests on Windows and saw no ill effects or changes in behavior for variable display.
Thanks, Ken.