/* Print debug info if available */
if (debug_info_src) {
- if (debug_info_src->func || debug_info_src->filename) {
+ if (debug_info_src->func || debug_info_src->src_path ||
+ debug_info_src->bin_path) {
bool add_comma = false;
fprintf(pos->fp, ", debug_info = { ");
+ if (debug_info_src->bin_path) {
+ fprintf(pos->fp, "bin = \"%s%s\"",
+ opt_debug_info_full_path ?
+ debug_info_src->bin_path :
+ debug_info_src->short_bin_path,
+ debug_info_src->bin_loc);
+ add_comma = true;
+ }
+
if (debug_info_src->func) {
+ if (add_comma) {
+ fprintf(pos->fp, ", ");
+ }
+
fprintf(pos->fp, "func = \"%s\"",
debug_info_src->func);
- add_comma = true;
}
- if (debug_info_src->filename) {
+ if (debug_info_src->src_path) {
if (add_comma) {
fprintf(pos->fp, ", ");
}
- fprintf(pos->fp, "source_loc = \"%s:%" PRIu64
+ fprintf(pos->fp, "src = \"%s:%" PRIu64
"\"",
- debug_info_src->filename,
+ opt_debug_info_full_path ?
+ debug_info_src->src_path :
+ debug_info_src->short_src_path,
debug_info_src->line_no);
}