summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/interface
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2016-03-09 18:59:13 +0000
committerJim Ingham <jingham@apple.com>2016-03-09 18:59:13 +0000
commit2411167fb566b9669d94b5eed6c3a78757531d3b (patch)
treedf0e3aa6c2d5ef078de532d822ceb3d66f2407af /lldb/scripts/interface
parent58672974a95d93f3f8ae97e59798012dbad74239 (diff)
downloadbcm5719-llvm-2411167fb566b9669d94b5eed6c3a78757531d3b.tar.gz
bcm5719-llvm-2411167fb566b9669d94b5eed6c3a78757531d3b.zip
Add an "offset" option to "break set -n" and "break set -f -l".
That way you can set offset breakpoints that will move as the function they are contained in moves (which address breakpoints can't do...) I don't align the new address to instruction boundaries yet, so you have to get this right yourself for now. <rdar://problem/13365575> llvm-svn: 263049
Diffstat (limited to 'lldb/scripts/interface')
-rw-r--r--lldb/scripts/interface/SBTarget.i48
1 files changed, 46 insertions, 2 deletions
diff --git a/lldb/scripts/interface/SBTarget.i b/lldb/scripts/interface/SBTarget.i
index 74e470d4b3f..b2409eba55c 100644
--- a/lldb/scripts/interface/SBTarget.i
+++ b/lldb/scripts/interface/SBTarget.i
@@ -586,6 +586,9 @@ public:
BreakpointCreateByLocation (const lldb::SBFileSpec &file_spec, uint32_t line);
lldb::SBBreakpoint
+ BreakpointCreateByLocation (const lldb::SBFileSpec &file_spec, uint32_t line, lldb::addr_t offset);
+
+ lldb::SBBreakpoint
BreakpointCreateByName (const char *symbol_name, const char *module_name = NULL);
lldb::SBBreakpoint
@@ -601,18 +604,59 @@ public:
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list);
+%typemap(in) (const char **symbol_name, uint32_t num_names) {
+ using namespace lldb_private;
+ /* Check if is a list */
+ if (PythonList::Check($input)) {
+ PythonList list(PyRefType::Borrowed, $input);
+ $2 = list.GetSize();
+ int i = 0;
+ $1 = (char**)malloc(($2+1)*sizeof(char*));
+ for (i = 0; i < $2; i++) {
+ PythonString py_str = list.GetItemAtIndex(i).AsType<PythonString>();
+ if (!py_str.IsAllocated()) {
+ PyErr_SetString(PyExc_TypeError,"list must contain strings and blubby");
+ free($1);
+ return nullptr;
+ }
+
+ $1[i] = const_cast<char*>(py_str.GetString().data());
+ }
+ $1[i] = 0;
+ } else if ($input == Py_None) {
+ $1 = NULL;
+ } else {
+ PyErr_SetString(PyExc_TypeError,"not a list");
+ return NULL;
+ }
+}
+
+//%typecheck(SWIG_TYPECHECK_STRING_ARRAY) (const char *symbol_name[], uint32_t num_names) {
+// $1 = 1;
+// $2 = 1;
+//}
+
+ lldb::SBBreakpoint
+ BreakpointCreateByNames (const char **symbol_name,
+ uint32_t num_names,
+ uint32_t name_type_mask, // Logical OR one or more FunctionNameType enum bits
+ const SBFileSpecList &module_list,
+ const SBFileSpecList &comp_unit_list);
+
lldb::SBBreakpoint
- BreakpointCreateByNames (const char *symbol_name[],
+ BreakpointCreateByNames (const char **symbol_name,
uint32_t num_names,
uint32_t name_type_mask, // Logical OR one or more FunctionNameType enum bits
+ lldb::LanguageType symbol_language,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list);
lldb::SBBreakpoint
- BreakpointCreateByNames (const char *symbol_name[],
+ BreakpointCreateByNames (const char **symbol_name,
uint32_t num_names,
uint32_t name_type_mask, // Logical OR one or more FunctionNameType enum bits
lldb::LanguageType symbol_language,
+ lldb::addr_t offset,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list);
OpenPOWER on IntegriCloud