[Lldb-commits] [PATCH] linux: fix SBBreakpoint::GetThreadIndex

Greg Clayton gclayton at apple.com
Wed Dec 15 12:53:29 PST 2010


A modified fix that correctly returns UINT32_MAX when the breakpoint isn't thread specific was applied with:


File: /Volumes/work/gclayton/Documents/src/lldb/source/Target/ThreadSpec.cpp
Revision: 121896
Date: Wednesday, December 15, 2010 12:50:06 PM PT
Author: gclayton

Fixed an error where the thread index was being returned as zero in "uint32_t SBBreakpoint::GetThreadIndex() const" even when it isn't specified. It should be UINT32_MAX to indicate there is no thread index set for the breakpoint (the breakpoint isn't thread specific). Also fixed the ThreadSpec.cpp to use UINT32_MAX instead of -1. Fixed the logging Printf statement in "uint32_t SBBreakpoint::GetThreadIndex() const" to not print the address of the "index" function from <string.h>!


Changes:
	M /lldb/trunk/source/API/SBBreakpoint.cpp
	M /lldb/trunk/source/Target/ThreadSpec.cpp

Thanks Stephen

On Dec 15, 2010, at 12:34 PM, Stephen Wilson wrote:

> 
>    Log using the proper argument and make SBBreakpoint::GetThreadIndex
>    return the thread index instead of zero.
> 
> diff --git a/source/API/SBBreakpoint.cpp b/source/API/SBBreakpoint.cpp
> index f2dccf9..eed986d 100644
> --- a/source/API/SBBreakpoint.cpp
> +++ b/source/API/SBBreakpoint.cpp
> @@ -319,9 +319,9 @@ SBBreakpoint::GetThreadIndex() const
>     }
>     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
>     if (log)
> -        log->Printf ("SBBreakpoint(%p)::GetThreadIndex () => %u", m_opaque_sp.get(), index);
> +        log->Printf ("SBBreakpoint(%p)::GetThreadIndex () => %u", m_opaque_sp.get(), thread_idx);
> 
> -    return 0;
> +    return thread_idx;
> }
> _______________________________________________
> 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