[Lldb-commits] [PATCH] D14111: Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB during expression evaluation

Bhushan Attarde via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 27 03:04:35 PDT 2015


bhushan created this revision.
bhushan added a reviewer: clayborg.
bhushan added subscribers: nitesh.jain, sagar, mohit.bhakkad, jaydeep, lldb-commits.
bhushan set the repository for this revision to rL LLVM.

There is a issue (llvm assertion) in evaluating expressions for MIPS on Linux.

(lldb) p fooptr(a,b)
lldb: /home/battarde/git/llvm/lib/MC/ELFObjectWriter.cpp:791: void {anonymous}::ELFObjectWriter::computeSymbolTable(llvm::MCAssembler&, const llvm::MCAsmLayout&, const SectionIndexMapTy&, const RevGroupMapTy&, {anonymous}::ELFObjectWriter::SectionOffsetsTy&): Assertion `Local || !Symbol.isTemporary()' failed.

This issue is caused due to the dynamic checker function’s name (hard-coded in LLDB in lldb\source\Expression\IRDynamicChecks.cpp) that start with “$” i.e “$__lldb_valid_pointer_check”.
The symbol "$" has a special meaning for MIPS i.e it is marker for temporary symbols for MIPS.

The discussion on lldb mailing list regarding this issue is at : http://lists.llvm.org/pipermail/lldb-dev/2015-October/008692.html

This patch fixes this issue by using "_$" prefix instead of "$" in dymanic checker function’s name. 

-Bhushan

Repository:
  rL LLVM

http://reviews.llvm.org/D14111

Files:
  source/Expression/IRDynamicChecks.cpp

Index: source/Expression/IRDynamicChecks.cpp
===================================================================
--- source/Expression/IRDynamicChecks.cpp
+++ source/Expression/IRDynamicChecks.cpp
@@ -31,12 +31,12 @@
 
 static char ID;
 
-#define VALID_POINTER_CHECK_NAME "$__lldb_valid_pointer_check"
+#define VALID_POINTER_CHECK_NAME "_$__lldb_valid_pointer_check"
 #define VALID_OBJC_OBJECT_CHECK_NAME "$__lldb_objc_object_check"
 
 static const char g_valid_pointer_check_text[] =
 "extern \"C\" void\n"
-"$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n"
+"_$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n"
 "{\n"
 "    unsigned char $__lldb_local_val = *$__lldb_arg_ptr;\n"
 "}";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14111.38517.patch
Type: text/x-patch
Size: 715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151027/0ae19a09/attachment.bin>


More information about the lldb-commits mailing list