Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!
1- Watches window: no more a list of variable of the current function: well, I deal with some quite big functions with over 50 variables. To deal with so much, I've functions that modify a lot of them in the same time but as I don't want to read the whole function, with the old system, I'd to watch on what become red after the function, now, I'll have to add _every variable_ to the window, manually... Please, tell me there is a way to get them all easily, the new system seems to have a lot of things to show but without this, I can't do anything
import sysimport gdbimport reclass static: "Creates a 'static' method" def __init__(self, function): self.__call__ = function peter_pretty_printers = []def register_pretty_printer(pretty_printer): "Registers a Pretty Printer" peter_pretty_printers.append(pretty_printer) return pretty_printer@register_pretty_printerclass AllLocalsOrArgumentsPrinter: """ pretty prints `(void*****)"LOCALS"` as a map of all local variables or `(void*****)"ARGS"` as a map of all function arguments or `(void*****)"FRAME"` as both """ @static def supports_value(val): if val.type != gdb.parse_and_eval("(void*****)0").type: return False try: return val.cast(gdb.lookup_type('char').pointer()).string() in ['LOCALS', 'ARGS', 'FRAME'] except: return False def __init__(self, val): self.cmd = val.cast(gdb.lookup_type('char').pointer()).string() @static def info_to_string(gdb_command): result = gdb.execute(gdb_command, to_string=True).strip() if result in ['No locals.', 'No arguments.']: return '{}' # make unique split_result = re.split(r'^([a-zA-Z_][a-zA-Z0-9_]*) = ', result, flags=re.MULTILINE) split_result.remove('') tuples = [(split_result[2*i], split_result[2*i+1].strip('\n')) for i in range(len(split_result)/2)] tuples.reverse() result = ''.join([',\n' + k + ' = ' + v for (k,v) in dict(tuples).iteritems()]).lstrip(',') return '{' + result + '\n}' def to_string(self): if self.cmd == 'LOCALS': return AllLocalsOrArgumentsPrinter.info_to_string('info local') if self.cmd == 'ARGS': return AllLocalsOrArgumentsPrinter.info_to_string('info arg') if self.cmd == 'FRAME': locals = AllLocalsOrArgumentsPrinter.info_to_string('info local') args = AllLocalsOrArgumentsPrinter.info_to_string('info arg') return '{\nLocal Variables = ' + locals + ',\nFunction Arguments = ' + args + '\n}' return '?'def register_peter_printers(obj): if obj == None: obj = gdb obj.pretty_printers.append(lookup_function)def lookup_function(val): for pp in peter_pretty_printers: if pp.supports_value(val): return pp(val) return None
@ollydbg: Yes, my pretty printer works best (or only ) with your patched gdb.
void f(){ int a; vector<string> b; ....Some statement; map<string,string> c;}
If I knew a way to iterate all symbols of a frame in python, I would not just call "info local". But in my opinion, gdb pretty printers must be able to deal with arbitrary/corrupt data. If a pretty printer crashes/turns into an infinite loop/takes too long to complete when handed some arbitrary bytes, then that pretty printer is buggy and needs to be fixed or disabled: One of the main points in debugging is to inspect data corruption bugs.
With your patched gdb, the variables b and c are not listed in "info local" until I hit there declaration lines. And directly adding a watch to b displays as `No symbol "b" in current context.` when I just enter the function.You are right that there is no nice simple solution yet.
My `(void*****)"LOCALS"` python code is just an ugly hack for those who missed the feature and/or do plain C programming without many other fancy pretty printers. It was the only regression that stopped me from upgrading until I learned python. But now I already fell in love with the 'Evaluate expression' tooltips Apart from that, it would be nice to have a checkbox next to each entry in the Watches window to temporarily enable/disable the watch.
Apart from that, it would be nice to have a checkbox next to each entry in the Watches window to temporarily enable/disable the watch.
Finally we managed to release Code::Blocks 12.11 !You can download binaries for windows, mac and many major linux distros from our download pageMany thanks to all the contributors and developers who worked hard for this!
Can anyone help me? I am a newbie in programming and there is a bug in code::block, I don't know how to fix it. A simply addition program has an error. The sum is not appropriate to the the numbers. How can I fix this bugs/errors ? Please help me. Thank you
We cannot do anything about it. Go bug Ubuntu maintainers to add this package to this version of Ubuntu it is theirs job to do it.