[Lldb-commits] [lldb] r124897 - in /lldb/trunk/source: Core/ConnectionFileDescriptor.cpp Core/EmulateInstruction.cpp Core/Log.cpp Core/UUID.cpp Host/macosx/Host.mm Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Plugins/Process/MacOSX-User/source/MacOSX/MachException.cpp Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp Target/ThreadPlanTracer.cpp
Greg Clayton
gclayton at apple.com
Fri Feb 4 13:13:05 PST 2011
Author: gclayton
Date: Fri Feb 4 15:13:05 2011
New Revision: 124897
URL: http://llvm.org/viewvc/llvm-project?rev=124897&view=rev
Log:
Remove bzero use and replace with memset (patch from Kirk Beitz).
Modified:
lldb/trunk/source/Core/ConnectionFileDescriptor.cpp
lldb/trunk/source/Core/EmulateInstruction.cpp
lldb/trunk/source/Core/Log.cpp
lldb/trunk/source/Core/UUID.cpp
lldb/trunk/source/Host/macosx/Host.mm
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachException.cpp
lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
lldb/trunk/source/Target/ThreadPlanTracer.cpp
Modified: lldb/trunk/source/Core/ConnectionFileDescriptor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionFileDescriptor.cpp?rev=124897&r1=124896&r2=124897&view=diff
==============================================================================
--- lldb/trunk/source/Core/ConnectionFileDescriptor.cpp (original)
+++ lldb/trunk/source/Core/ConnectionFileDescriptor.cpp Fri Feb 4 15:13:05 2011
@@ -571,7 +571,7 @@
SetSocketOption (m_fd, SOL_SOCKET, SO_REUSEADDR, 1);
struct sockaddr_in sa;
- ::bzero (&sa, sizeof (sa));
+ ::memset (&sa, 0, sizeof (sa));
sa.sin_family = AF_INET;
sa.sin_port = htons (port);
Modified: lldb/trunk/source/Core/EmulateInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/EmulateInstruction.cpp?rev=124897&r1=124896&r2=124897&view=diff
==============================================================================
--- lldb/trunk/source/Core/EmulateInstruction.cpp (original)
+++ lldb/trunk/source/Core/EmulateInstruction.cpp Fri Feb 4 15:13:05 2011
@@ -61,7 +61,7 @@
m_write_reg_callback (write_reg_callback),
m_inst_pc (LLDB_INVALID_ADDRESS)
{
- ::bzero (&m_inst, sizeof (m_inst));
+ ::memset (&m_inst, 0, sizeof (m_inst));
}
uint64_t
Modified: lldb/trunk/source/Core/Log.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Log.cpp?rev=124897&r1=124896&r2=124897&view=diff
==============================================================================
--- lldb/trunk/source/Core/Log.cpp (original)
+++ lldb/trunk/source/Core/Log.cpp Fri Feb 4 15:13:05 2011
@@ -356,7 +356,7 @@
log_callbacks = pos->second;
return true;
}
- ::bzero (&log_callbacks, sizeof(log_callbacks));
+ ::memset (&log_callbacks, 0, sizeof(log_callbacks));
return false;
}
Modified: lldb/trunk/source/Core/UUID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/UUID.cpp?rev=124897&r1=124896&r2=124897&view=diff
==============================================================================
--- lldb/trunk/source/Core/UUID.cpp (original)
+++ lldb/trunk/source/Core/UUID.cpp Fri Feb 4 15:13:05 2011
@@ -22,7 +22,7 @@
UUID::UUID()
{
- ::bzero (m_uuid, sizeof(m_uuid));
+ ::memset (m_uuid, 0, sizeof(m_uuid));
}
UUID::UUID(const UUID& rhs)
@@ -35,7 +35,7 @@
if (uuid_bytes && num_uuid_bytes >= 16)
::memcpy (m_uuid, uuid_bytes, sizeof (m_uuid));
else
- ::bzero (m_uuid, sizeof(m_uuid));
+ ::memset (m_uuid, 0, sizeof(m_uuid));
}
const UUID&
@@ -53,7 +53,7 @@
void
UUID::Clear()
{
- ::bzero (m_uuid, sizeof(m_uuid));
+ ::memset (m_uuid, 0, sizeof(m_uuid));
}
const void *
@@ -85,7 +85,7 @@
if (uuid_bytes)
::memcpy (m_uuid, uuid_bytes, sizeof (m_uuid));
else
- ::bzero (m_uuid, sizeof(m_uuid));
+ ::memset (m_uuid, 0, sizeof(m_uuid));
}
size_t
Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=124897&r1=124896&r2=124897&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Fri Feb 4 15:13:05 2011
@@ -137,7 +137,7 @@
app_file_spec.GetPath(app_path, sizeof(app_path));
LSApplicationParameters app_params;
- ::bzero (&app_params, sizeof (app_params));
+ ::memset (&app_params, 0, sizeof (app_params));
app_params.flags = kLSLaunchDefaults |
kLSLaunchDontAddToRecents |
kLSLaunchNewInstance;
@@ -176,7 +176,7 @@
if (file_conn.Connect (connect_url, &error) == eConnectionStatusSuccess)
{
char pid_str[256];
- ::bzero (pid_str, sizeof(pid_str));
+ ::memset (pid_str, 0, sizeof(pid_str));
ConnectionStatus status;
const size_t pid_str_len = file_conn.Read (pid_str, sizeof(pid_str), status, NULL);
if (pid_str_len > 0)
@@ -316,7 +316,7 @@
}
LSApplicationParameters app_params;
- ::bzero (&app_params, sizeof (app_params));
+ ::memset (&app_params, 0, sizeof (app_params));
app_params.flags = kLSLaunchDontAddToRecents | kLSLaunchAsync;
app_params.argv = NULL;
app_params.environment = (CFDictionaryRef)cf_env_dict.get();
@@ -638,7 +638,7 @@
static FSRef g_app_fsref;
LSApplicationParameters app_params;
- ::bzero (&app_params, sizeof (app_params));
+ ::memset (&app_params, 0, sizeof (app_params));
app_params.flags = kLSLaunchDefaults |
kLSLaunchDontAddToRecents |
kLSLaunchDontSwitch;
@@ -691,7 +691,7 @@
}
ProcessInfoRec which_process;
- bzero(&which_process, sizeof(which_process));
+ ::memset(&which_process, 0, sizeof(which_process));
unsigned char ap_name[PATH_MAX];
which_process.processName = ap_name;
error = ::GetProcessInformation (&psn, &which_process);
Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h?rev=124897&r1=124896&r2=124897&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h Fri Feb 4 15:13:05 2011
@@ -230,7 +230,7 @@
slide = 0;
mod_date = 0;
file_spec.Clear();
- ::bzero (&header, sizeof(header));
+ ::memset (&header, 0, sizeof(header));
}
uuid.Clear();
segments.clear();
Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=124897&r1=124896&r2=124897&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Fri Feb 4 15:13:05 2011
@@ -107,8 +107,8 @@
m_sections_ap(),
m_symtab_ap()
{
- ::bzero (&m_header, sizeof(m_header));
- ::bzero (&m_dysymtab, sizeof(m_dysymtab));
+ ::memset (&m_header, 0, sizeof(m_header));
+ ::memset (&m_dysymtab, 0, sizeof(m_dysymtab));
}
@@ -280,7 +280,7 @@
}
struct section_64 sect64;
- ::bzero (§64, sizeof(sect64));
+ ::memset (§64, 0, sizeof(sect64));
// Push a section into our mach sections for the section at
// index zero (NListSectionNoSection) if we don't have any
// mach sections yet...
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachException.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachException.cpp?rev=124897&r1=124896&r2=124897&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachException.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachException.cpp Fri Feb 4 15:13:05 2011
@@ -455,10 +455,10 @@
MachException::PortInfo::PortInfo() :
count(0)
{
- ::bzero (masks, sizeof(masks));
- ::bzero (ports, sizeof(ports));
- ::bzero (behaviors, sizeof(behaviors));
- ::bzero (flavors, sizeof(flavors));
+ ::memset (masks, 0, sizeof(masks));
+ ::memset (ports, 0, sizeof(ports));
+ ::memset (behaviors, 0, sizeof(behaviors));
+ ::memset (flavors, 0, sizeof(flavors));
}
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp?rev=124897&r1=124896&r2=124897&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp Fri Feb 4 15:13:05 2011
@@ -45,9 +45,9 @@
m_context.reset(create_arch_callback(process.GetArchSpec(), *this));
assert(m_context.get() != NULL);
m_context->InitializeInstance();
- ::bzero (&m_basic_info, sizeof (m_basic_info));
- ::bzero (&m_ident_info, sizeof (m_ident_info));
- ::bzero (&m_proc_threadinfo, sizeof (m_proc_threadinfo));
+ ::memset (&m_basic_info, 0, sizeof (m_basic_info));
+ ::memset (&m_ident_info, 0, sizeof (m_ident_info));
+ ::memset (&m_proc_threadinfo, 0, sizeof (m_proc_threadinfo));
ProcessMacOSXLog::LogIf(PD_LOG_THREAD | PD_LOG_VERBOSE, "ThreadMacOSX::ThreadMacOSX ( pid = %i, tid = 0x%4.4x, )", m_process.GetID(), GetID());
}
Modified: lldb/trunk/source/Target/ThreadPlanTracer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanTracer.cpp?rev=124897&r1=124896&r2=124897&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanTracer.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanTracer.cpp Fri Feb 4 15:13:05 2011
@@ -192,7 +192,7 @@
if (m_disassembler)
{
- bzero(m_buffer_sp->GetBytes(), m_buffer_sp->GetByteSize());
+ ::memset(m_buffer_sp->GetBytes(), 0, m_buffer_sp->GetByteSize());
Error err;
m_process.ReadMemory(pc, m_buffer_sp->GetBytes(), m_buffer_sp->GetByteSize(), err);
More information about the lldb-commits
mailing list