Added a missing API call in SBTarget that enables one to get

anything in a SBSymbolContext filled in given an SBAddress:

SBSymbolContext
SBTarget::ResolveSymbolContextForAddress (const SBAddress& addr, uint32_t resolve_scope);

Also did a little cleanup on the ProcessGDBRemote stdio file handle
code.

llvm-svn: 126885
This commit is contained in:
Greg Clayton 2011-03-02 21:34:46 +00:00
parent c4eb31e5e5
commit 5f2a4f999d
4 changed files with 30 additions and 10 deletions

View File

@ -51,6 +51,7 @@ protected:
friend class SBFrame; friend class SBFrame;
friend class SBModule; friend class SBModule;
friend class SBThread; friend class SBThread;
friend class SBTarget;
friend class SBSymbolContextList; friend class SBSymbolContextList;
#ifndef SWIG #ifndef SWIG

View File

@ -204,6 +204,10 @@ public:
ResolveLoadAddress (lldb::addr_t vm_addr, ResolveLoadAddress (lldb::addr_t vm_addr,
lldb::SBAddress& addr); lldb::SBAddress& addr);
SBSymbolContext
ResolveSymbolContextForAddress (const SBAddress& addr,
uint32_t resolve_scope);
lldb::SBBreakpoint lldb::SBBreakpoint
BreakpointCreateByLocation (const char *file, uint32_t line); BreakpointCreateByLocation (const char *file, uint32_t line);

View File

@ -442,6 +442,16 @@ SBTarget::ResolveLoadAddress (lldb::addr_t vm_addr,
return false; return false;
} }
SBSymbolContext
SBTarget::ResolveSymbolContextForAddress (const SBAddress& addr, uint32_t resolve_scope)
{
SBSymbolContext sc;
if (m_opaque_sp)
m_opaque_sp->GetImages().ResolveSymbolContextForAddress (*addr, resolve_scope, sc.ref());
return sc;
}
SBBreakpoint SBBreakpoint
SBTarget::BreakpointCreateByLocation (const char *file, uint32_t line) SBTarget::BreakpointCreateByLocation (const char *file, uint32_t line)
{ {

View File

@ -460,13 +460,12 @@ ProcessGDBRemote::DoLaunch
{ {
lldb_utility::PseudoTerminal pty; lldb_utility::PseudoTerminal pty;
const bool disable_stdio = (launch_flags & eLaunchFlagDisableSTDIO) != 0; const bool disable_stdio = (launch_flags & eLaunchFlagDisableSTDIO) != 0;
if (disable_stdio)
{ // If the debugserver is local and we aren't disabling STDIO, lets use
stdin_path = "/dev/null"; // a pseudo terminal to instead of relying on the 'O' packets for stdio
stdout_path = "/dev/null"; // since 'O' packets can really slow down debugging if the inferior
stderr_path = "/dev/null"; // does a lot of output.
} if (m_local_debugserver && !disable_stdio)
else
{ {
const char *slave_name = NULL; const char *slave_name = NULL;
if (stdin_path == NULL || stdout_path == NULL || stderr_path == NULL) if (stdin_path == NULL || stdout_path == NULL || stderr_path == NULL)
@ -484,13 +483,19 @@ ProcessGDBRemote::DoLaunch
stderr_path = slave_name; stderr_path = slave_name;
} }
if (stdin_path == NULL && (stdout_path || stderr_path)) // Set STDIN to /dev/null if we want STDIO disabled or if either
// STDOUT or STDERR have been set to something and STDIN hasn't
if (disable_stdio || (stdin_path == NULL && (stdout_path || stderr_path)))
stdin_path = "/dev/null"; stdin_path = "/dev/null";
if (stdout_path == NULL && (stdin_path || stderr_path)) // Set STDOUT to /dev/null if we want STDIO disabled or if either
// STDIN or STDERR have been set to something and STDOUT hasn't
if (disable_stdio || (stdout_path == NULL && (stdin_path || stderr_path)))
stdout_path = "/dev/null"; stdout_path = "/dev/null";
if (stderr_path == NULL && (stdin_path || stdout_path)) // Set STDERR to /dev/null if we want STDIO disabled or if either
// STDIN or STDOUT have been set to something and STDERR hasn't
if (disable_stdio || (stderr_path == NULL && (stdin_path || stdout_path)))
stderr_path = "/dev/null"; stderr_path = "/dev/null";
if (stdin_path) if (stdin_path)