Fixed an issue in the DWARFLocationList::Dump() function where default

arguments were quietly masked as the code changed (modified version of a path
from Dawn).

llvm-svn: 145216
This commit is contained in:
Greg Clayton
2011-11-28 00:51:27 +00:00
parent 3e79ef1d45
commit 1abfe04d79
2 changed files with 8 additions and 2 deletions

View File

@@ -168,10 +168,12 @@ Stream::Address (uint64_t addr, int addr_size, const char *prefix, const char *s
void
Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr, int addr_size, const char *prefix, const char *suffix)
{
if (prefix != NULL)
if (prefix && prefix[0])
PutCString (prefix);
Address (lo_addr, addr_size, "[");
Address (hi_addr, addr_size, "-", ")");
if (suffix && suffix[0])
PutCString (suffix);
}

View File

@@ -34,7 +34,11 @@ DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DataExtract
s.PutCString("\n ");
s.Indent();
s.AddressRange(start_addr + base_addr, end_addr + base_addr, NULL, ": ");
s.AddressRange (start_addr + base_addr,
end_addr + base_addr,
cu->GetAddressByteSize(),
NULL,
": ");
uint32_t loc_length = debug_loc_data.GetU16(&offset);
DataExtractor locationData(debug_loc_data, offset, loc_length);