[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

Jason Molenda jason at molenda.com
Wed Jul 18 15:27:33 PDT 2012

Hi Felipe, thanks for the comment.  When I was building lldb for a 32-bit Mac (ILP32) environment, this was the only warning that came up.  But I'm certain you're right that there would be more problems for an LLP64 Windows environment or a FreeBSD build.  I'm sure you're right, we'll need to deal with this in a more generic fashion at some point... for now, for this instance, I think the only assumption I've put in here is that "%lld" takes a 64-bit argument which should be true for all of these environments.


On Jul 18, 2012, at 10:46 AM, Filipe Cabecinhas wrote:

> 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)
>> {
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

More information about the lldb-commits mailing list