On Wed, Nov 06, 2013 at 11:25:31AM -0500, David Malcolm wrote: > On Wed, 2013-11-06 at 14:11 +0100, Jakub Jelinek wrote: > > On Wed, Nov 06, 2013 at 02:00:56PM +0100, Richard Biener wrote: > > > Well, what else, besides as_a<> or keeping the current > > > global accessor functions would you propose? > > > > I'd prefer to keep the current accessors. Whether there is a class > > hierarchy or we keep unions doesn't affect the code too much (unless > > it makes debugging experience harder, as numerous past C++ification changes > > have done :( ). > > What specific things have become more difficult to debug due to the > changes you refer to? > I can have a look at improving them by extending gdbhooks.py, if that is > desirable.
I'm refering to various things that have been mentioned already multiple times, mostly from the switch to C++, like: 1) p debug_tree (0x7ffff18b3690) not working anymore, typically one would use this when just cut'n'pasting addresses seen in backtrace, other debug_tree etc., one now has to add explicitly a cast p debug_tree ((tree)0x7ffff18b3690). Perhaps this can be cured just by adding extra overloads for a few most popular debug_* routines that weren't initially overloaded, add them an overload with uintptr_t type or similar that will just cast it to the right type and call the original routine 2) tab completion often not working well for hundreds of functions, say type p gimple_can_m<tab> When gcc was written in C, this would complete it just fine into p gimple_can_merge_blocks_p but GDB is confused by the forward declarations and offers you: p gimple_can_merge_blocks_p(basic_block and doesn't autocomplete further from there, so, for functions that aren't really overloaded (fortunately so far most of them) one has to manually remove all the cruft until and including the (, or has to complete from memory or similar. The issue is that gdb sees: gimple_can_merge_blocks_p(basic_block, basic_block) gimple_can_merge_blocks_p(basic_block_def*, basic_block_def*) gimple_can_merge_blocks_p(basic_block_def*, basic_block_def*)::__FUNCTION__ and considers the two different thing, but of course: typedef struct basic_block_def *basic_block; and thus you really don't care which one is chosen from these, but preferrably just one, not both. 3) step got significantly worse over time, we have skip_file tree.h, but with all the recent header reorganizations gdbinit.in hasn't been updated on which other headers would greatly benefit from being skipped by default. Certainly gimple.h IMHO, and various new headers that just contain small inline accessors 4) the gdbhooks.py printing is nice, but (talking just from memory), it is tied to just one spelling of various types, so say if something has basic_block type, it is printed nicely, but if it has basic_block_def * type, it isn't 5) the new "improved" C++ vec.h is harder to use in the debugger This list is still very much incomplete. Jakub