[Lldb-commits] [lldb] r160337 - in /lldb/trunk: include/lldb/Symbol/UnwindPlan.h source/API/SBCommandInterpreter.cpp source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h source/Symbol/UnwindPlan.cpp

Filipe Cabecinhas filcab at gmail.com
Wed Jul 18 10:46:31 PDT 2012


Hi Jason,  

This doesn't seem to be the best way to handle the printfs, since it's “warning-prone” (you have to remember to put the casts everywhere… And there are a lot of places that need them).

As I see it, we have (at least) three solutions:
  - Keep the warnings as they are (not optimal);
  - Use the PRI* macros (PRIu64 in this case. Though that's not the prettiest option, too);
  - Make the Log class responsible for printing everything and use a logging system like llvm/clang.

But if everybody prefers, then we can add the casts to every place that may need them. Which is a lot of places, since FreeBSD has some different sizes for system types than Mac OS X. If the port to Windows gets into the main tree, we could have even more places needing casts.

Regards,

  Filipe


On Tuesday, July 17, 2012 at 3:57 AM, Jason Molenda wrote:

> Modified: lldb/trunk/source/API/SBCommandInterpreter.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandInterpreter.cpp?rev=160337&r1=160336&r2=160337&view=diff
> ==============================================================================
> --- lldb/trunk/source/API/SBCommandInterpreter.cpp (original)
> +++ lldb/trunk/source/API/SBCommandInterpreter.cpp Mon Jul 16 20:57:24 2012
> @@ -139,8 +139,8 @@
> return 0;
>  
> if (log)
> - log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %ld, last char at: %ld, match_start_point: %d, max_return_elements: %d)",
> - m_opaque_ptr, current_line, cursor - current_line, last_char - current_line, match_start_point, max_return_elements);
> + log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %lld, last char at: %lld, match_start_point: %d, max_return_elements: %d)",
> + m_opaque_ptr, current_line, (uint64_t) (cursor - current_line), (uint64_t) (last_char - current_line), match_start_point, max_return_elements);
>  
> if (m_opaque_ptr)
> {
>  







More information about the lldb-commits mailing list