Changes the value of a variable
(dbg, seq, thread_id, frame_id, scope, attr, value)
| 884 | |
| 885 | |
| 886 | def internal_change_variable(dbg, seq, thread_id, frame_id, scope, attr, value): |
| 887 | """Changes the value of a variable""" |
| 888 | try: |
| 889 | frame = dbg.find_frame(thread_id, frame_id) |
| 890 | if frame is not None: |
| 891 | result = pydevd_vars.change_attr_expression(frame, attr, value, dbg) |
| 892 | else: |
| 893 | result = None |
| 894 | xml = "<xml>" |
| 895 | xml += pydevd_xml.var_to_xml(result, "") |
| 896 | xml += "</xml>" |
| 897 | cmd = dbg.cmd_factory.make_variable_changed_message(seq, xml) |
| 898 | dbg.writer.add_command(cmd) |
| 899 | except Exception: |
| 900 | cmd = dbg.cmd_factory.make_error_message( |
| 901 | seq, "Error changing variable attr:%s expression:%s traceback:%s" % (attr, value, get_exception_traceback_str()) |
| 902 | ) |
| 903 | dbg.writer.add_command(cmd) |
| 904 | |
| 905 | |
| 906 | def internal_change_variable_json(py_db, request): |
nothing calls this directly
no test coverage detected