Skip to content

Commit f5073df

Browse files
author
Daniel Kroening
committed
output the working directory for source locations in XML and json
1 parent 7b55399 commit f5073df

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/util/json_expr.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ json_objectt json(const source_locationt &location)
8484
{
8585
json_objectt result;
8686

87+
if(!location.get_working_directory().empty())
88+
result["workingDirectory"]=
89+
json_stringt(id2string(location.get_working_directory()));
90+
8791
if(!location.get_file().empty())
8892
result["file"]=json_stringt(id2string(location.get_file()));
8993

src/util/xml_expr.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ xmlt xml(const source_locationt &location)
2828

2929
result.name="location";
3030

31+
if(!location.get_working_directory().empty())
32+
result.set_attribute(
33+
"working-directory", id2string(location.get_working_directory()));
34+
3135
if(!location.get_file().empty())
3236
result.set_attribute("file", id2string(location.get_file()));
3337

0 commit comments

Comments
 (0)