mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 19:49:36 +00:00
o Exposed SBFileSpec to the Python APIs in lldb.py.
o Fixed a crasher when getting it via SBTarget.GetExecutable(). >>> filespec = target.GetExecutable() Segmentation fault o And renamed SBFileSpec::GetFileName() to GetFilename() to be consistent with FileSpec::GetFilename(). llvm-svn: 112308
This commit is contained in:
parent
1ba644575d
commit
23fd10cb4e
@ -37,7 +37,7 @@ public:
|
|||||||
Exists () const;
|
Exists () const;
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
GetFileName() const;
|
GetFilename() const;
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
GetDirectory() const;
|
GetDirectory() const;
|
||||||
|
@ -42,6 +42,7 @@ HEADER_FILES="${SRC_ROOT}/include/lldb/lldb-types.h"\
|
|||||||
" ${SRC_ROOT}/include/lldb/API/SBDebugger.h"\
|
" ${SRC_ROOT}/include/lldb/API/SBDebugger.h"\
|
||||||
" ${SRC_ROOT}/include/lldb/API/SBError.h"\
|
" ${SRC_ROOT}/include/lldb/API/SBError.h"\
|
||||||
" ${SRC_ROOT}/include/lldb/API/SBEvent.h"\
|
" ${SRC_ROOT}/include/lldb/API/SBEvent.h"\
|
||||||
|
" ${SRC_ROOT}/include/lldb/API/SBFileSpec.h"\
|
||||||
" ${SRC_ROOT}/include/lldb/API/SBFrame.h"\
|
" ${SRC_ROOT}/include/lldb/API/SBFrame.h"\
|
||||||
" ${SRC_ROOT}/include/lldb/API/SBFunction.h"\
|
" ${SRC_ROOT}/include/lldb/API/SBFunction.h"\
|
||||||
" ${SRC_ROOT}/include/lldb/API/SBLineEntry.h"\
|
" ${SRC_ROOT}/include/lldb/API/SBLineEntry.h"\
|
||||||
|
@ -83,6 +83,7 @@
|
|||||||
#include "lldb/API/SBDebugger.h"
|
#include "lldb/API/SBDebugger.h"
|
||||||
#include "lldb/API/SBError.h"
|
#include "lldb/API/SBError.h"
|
||||||
#include "lldb/API/SBEvent.h"
|
#include "lldb/API/SBEvent.h"
|
||||||
|
#include "lldb/API/SBFileSpec.h"
|
||||||
#include "lldb/API/SBFrame.h"
|
#include "lldb/API/SBFrame.h"
|
||||||
#include "lldb/API/SBFunction.h"
|
#include "lldb/API/SBFunction.h"
|
||||||
#include "lldb/API/SBLineEntry.h"
|
#include "lldb/API/SBLineEntry.h"
|
||||||
@ -136,6 +137,7 @@ typedef int StopReason;
|
|||||||
%include "lldb/API/SBDebugger.h"
|
%include "lldb/API/SBDebugger.h"
|
||||||
%include "lldb/API/SBError.h"
|
%include "lldb/API/SBError.h"
|
||||||
%include "lldb/API/SBEvent.h"
|
%include "lldb/API/SBEvent.h"
|
||||||
|
%include "lldb/API/SBFileSpec.h"
|
||||||
%include "lldb/API/SBFrame.h"
|
%include "lldb/API/SBFrame.h"
|
||||||
%include "lldb/API/SBFunction.h"
|
%include "lldb/API/SBFunction.h"
|
||||||
%include "lldb/API/SBLineEntry.h"
|
%include "lldb/API/SBLineEntry.h"
|
||||||
|
@ -24,7 +24,7 @@ SBFileSpec::SBFileSpec (const SBFileSpec &rhs) :
|
|||||||
m_opaque_ap()
|
m_opaque_ap()
|
||||||
{
|
{
|
||||||
if (rhs.m_opaque_ap.get())
|
if (rhs.m_opaque_ap.get())
|
||||||
m_opaque_ap.reset (new FileSpec (*m_opaque_ap));
|
m_opaque_ap.reset (new FileSpec (rhs.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
SBFileSpec::SBFileSpec (const char *path) :
|
SBFileSpec::SBFileSpec (const char *path) :
|
||||||
@ -69,7 +69,7 @@ SBFileSpec::ResolvePath (const char *src_path, char *dst_path, size_t dst_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
SBFileSpec::GetFileName() const
|
SBFileSpec::GetFilename() const
|
||||||
{
|
{
|
||||||
if (m_opaque_ap.get())
|
if (m_opaque_ap.get())
|
||||||
return m_opaque_ap->GetFilename().AsCString();
|
return m_opaque_ap->GetFilename().AsCString();
|
||||||
|
@ -163,7 +163,7 @@ IOChannel::IOChannel
|
|||||||
m_err_file (err),
|
m_err_file (err),
|
||||||
m_command_queue (),
|
m_command_queue (),
|
||||||
m_completion_key ("\t"),
|
m_completion_key ("\t"),
|
||||||
m_edit_line (::el_init (SBHostOS::GetProgramFileSpec().GetFileName(), in, out, err)),
|
m_edit_line (::el_init (SBHostOS::GetProgramFileSpec().GetFilename(), in, out, err)),
|
||||||
m_history (history_init()),
|
m_history (history_init()),
|
||||||
m_history_event(),
|
m_history_event(),
|
||||||
m_getting_command (false)
|
m_getting_command (false)
|
||||||
@ -213,7 +213,7 @@ IOChannel::HistorySaveLoad (bool save)
|
|||||||
if (m_history != NULL)
|
if (m_history != NULL)
|
||||||
{
|
{
|
||||||
char history_path[PATH_MAX];
|
char history_path[PATH_MAX];
|
||||||
::snprintf (history_path, sizeof(history_path), "~/.%s-history", SBHostOS::GetProgramFileSpec().GetFileName());
|
::snprintf (history_path, sizeof(history_path), "~/.%s-history", SBHostOS::GetProgramFileSpec().GetFilename());
|
||||||
if ((size_t)SBFileSpec::ResolvePath (history_path, history_path, sizeof(history_path)) < sizeof(history_path) - 1)
|
if ((size_t)SBFileSpec::ResolvePath (history_path, history_path, sizeof(history_path)) < sizeof(history_path) - 1)
|
||||||
{
|
{
|
||||||
const char *path_ptr = history_path;
|
const char *path_ptr = history_path;
|
||||||
|
Loading…
Reference in New Issue
Block a user