Fixed pretty-printing of strings in the string container.#15
Open
marek-trtik wants to merge 2 commits intopeterschrammel:cav18from
Open
Fixed pretty-printing of strings in the string container.#15marek-trtik wants to merge 2 commits intopeterschrammel:cav18from
marek-trtik wants to merge 2 commits intopeterschrammel:cav18from
Conversation
Owner
|
This should rather go into cbmc/develop directly. |
a7e4bd7 to
9e7ac31
Compare
Unfortutatelly, the solution with a single free function
does not work. GCC seams to ignore attributes and throws
the function away. Fortunatelly, it does not ignore
attributes, when given to non-static method, and so
the non-debug build can be as fast as before.
Here is the pretty-printer function for QTCreator:
def qdump__dstringt(d, value):
try:
address = address_of_value(value)
string_no = str(gdb.parse_and_eval("(*((const dstringt*)" + address + ")).no"))
has_no = str(gdb.parse_and_eval("get_string_container().is_number_valid(" + string_no +")"))
if has_no == "true":
raw_string_value = str(gdb.parse_and_eval("get_string_container().get_string_slowly(" + string_no +")"))
string_value = raw_string_value.replace("\0", "").replace("\"", "\\\"")
d.putValue(string_no + ": " + string_value)
else:
d.putValue(string_no + ": The number is invalid.")
except Exception as e:
d.putValue("Exception getting value of dstringt: " + str(e))
9e7ac31 to
3158e3e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unfortutatelly, the solution with a single free function
does not work. GCC seams to ignore attributes and throws
the function away. Fortunatelly, it does not ignore
attributes, when given to non-static method, and so
the non-debug build can be as fast as before.
Here is the pretty-printer function for QTCreator: