[llvm-commits] [ASan] Replace AsanProcMaps::GetObjectNameAndOffset with a simpler AsanProcMaps::DescribeAddress (issue 5643047)
timurrrr at google.com
timurrrr at google.com
Wed Feb 8 01:43:32 PST 2012
Alexander,
Can you please take a look about the refactoring idea?
http://codereview.appspot.com/5643047/diff/1/lib/asan/asan_procmaps.h
File lib/asan/asan_procmaps.h (right):
http://codereview.appspot.com/5643047/diff/1/lib/asan/asan_procmaps.h#newcode30
lib/asan/asan_procmaps.h:30: // and puts it into the given buffer with a
leading space
On 2012/02/08 07:11:02, samsonov wrote:
> On 2012/02/07 17:41:15, timurrrr_at_google_com wrote:
> > I know this may sound a bit confusing, but look at how easy it is to
use this
> > function now (asan_stack.cc, which is the only place this is used)
> I think it's weird to write leading space here.
See the other comment; otherwise you'll need "if" or "?:" every time you
use a function
> "puts"->"writes"?
Will do
http://codereview.appspot.com/5643047/diff/1/lib/asan/asan_procmaps.h#newcode32
lib/asan/asan_procmaps.h:32: void DescribeAddress(uintptr_t addr, char
out_buffer[], size_t buffer_size);
On 2012/02/08 07:11:02, samsonov wrote:
> Why not GetAddressDescription()?
Shorter names are better if they mean the same thing, right?
> We've got two other different DescribeAddress
> functions already :)
That's good, no?
One has to remember less names.
http://codereview.appspot.com/5643047/diff/1/lib/asan/asan_stack.cc
File lib/asan/asan_stack.cc (right):
http://codereview.appspot.com/5643047/diff/1/lib/asan/asan_stack.cc#newcode47
lib/asan/asan_stack.cc:47: Printf(" #%ld 0x%lx%s\n", i, pc, descr);
Extra trailing space if descr is empty
On 2012/02/08 07:11:02, samsonov wrote:
> Why not write space here?
http://codereview.appspot.com/5643047/
More information about the llvm-commits
mailing list