+2019-07-14 Vladislav Ivanishin <vlad@ispras.ru>
+
+ * gdbhooks.py (DumpFn.invoke): Add explicit casts of return values of
+ fopen and fclose to their respective types.
+ (DotFn.invoke): Ditto.
+
2019-07-14 Jan Hubicka <hubicka@ucw.cz>
* ipa-fnsummary.c (ipa_dump_hints): Do not dump array_index.
f.close()
# Open file
- fp = gdb.parse_and_eval("fopen (\"%s\", \"w\")" % filename)
+ fp = gdb.parse_and_eval("(FILE *) fopen (\"%s\", \"w\")" % filename)
if fp == 0:
print ("Could not open file: %s" % filename)
return
- fp = "(FILE *)%u" % fp
# Dump function to file
_ = gdb.parse_and_eval("dump_function_to_file (%s, %s, %u)" %
(func, fp, flags))
# Close file
- ret = gdb.parse_and_eval("fclose (%s)" % fp)
+ ret = gdb.parse_and_eval("(int) fclose (%s)" % fp)
if ret != 0:
print ("Could not close file: %s" % filename)
return
# Close and reopen temp file to get C FILE*
f.close()
- fp = gdb.parse_and_eval("fopen (\"%s\", \"w\")" % filename)
+ fp = gdb.parse_and_eval("(FILE *) fopen (\"%s\", \"w\")" % filename)
if fp == 0:
print("Cannot open temp file")
return
- fp = "(FILE *)%u" % fp
# Write graph to temp file
_ = gdb.parse_and_eval("start_graph_dump (%s, \"<debug>\")" % fp)
_ = gdb.parse_and_eval("end_graph_dump (%s)" % fp)
# Close temp file
- ret = gdb.parse_and_eval("fclose (%s)" % fp)
+ ret = gdb.parse_and_eval("(int) fclose (%s)" % fp)
if ret != 0:
print("Could not close temp file: %s" % filename)
return