Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Greg Clayton via lldb-commits
clayborg added a comment. In http://reviews.llvm.org/D22294#483311, @sas wrote: > In http://reviews.llvm.org/D22294#483264, @clayborg wrote: > > > Note that during function lookup, we can find **both** "putchar" and > > "__my_putchar" in the debug info, so you will be able to call both. > > > Co

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Jim Ingham via lldb-commits
jingham added a comment. We always resolve duplicate symbols to the "closest" one to the current frame. So if there are two versions of putchar and one is in the library containing the current frame, we should find that one. If we aren't getting that right, that's a bug. So the correct symbo

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Jim Ingham via lldb-commits
We always resolve duplicate symbols to the "closest" one to the current frame. So if there are two versions of putchar and one is in the library containing the current frame, we should find that one. If we aren't getting that right, that's a bug. So the correct symbol should get called in cas

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Stephane Sezer via lldb-commits
sas added a comment. In http://reviews.llvm.org/D22294#483264, @clayborg wrote: > Note that during function lookup, we can find **both** "putchar" and > "__my_putchar" in the debug info, so you will be able to call both. Correct, unless as you pointed out both symbols are in libraries, and not

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Greg Clayton via lldb-commits
clayborg added a comment. Note that during function lookup, we can find **both** "putchar" and "__my_putchar" in the debug info, so you will be able to call both. http://reviews.llvm.org/D22294 ___ lldb-commits mailing list lldb-commits@lists.llvm.

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Greg Clayton via lldb-commits
clayborg added a comment. > I think some understanding of the rewrites from the debugger is still > required because the user will still enter commands like `call putchar('a')` > and expect the `putchar()` they wrote to be called. That `putchar()` they > expect is now called `_my_putchar()` and

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Stephane Sezer via lldb-commits
sas added a comment. In http://reviews.llvm.org/D22294#483250, @clayborg wrote: > In http://reviews.llvm.org/D22294#483213, @sas wrote: > > > @jingham, @clayborg, this is indeed a bit fragile as having to specify your > > rewrite maps manually when debugging is very error-prone. I have a patch

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Greg Clayton via lldb-commits
clayborg added a comment. In http://reviews.llvm.org/D22294#483213, @sas wrote: > @jingham, @clayborg, this is indeed a bit fragile as having to specify your > rewrite maps manually when debugging is very error-prone. I have a patch that > fetches the path to the rewrite map from the debug info

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Francis Ricci via lldb-commits
fjricci added a comment. @clayborg: As you saw when running the test with debug info enabled, we might end up calling the non-rewritten `putchar()`, which is due to the compiler emitting debug symbols with the non-rewritten name. The `-g0` option is just a workaround until we can fix that. I s

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Stephane Sezer via lldb-commits
sas added a comment. @jingham, @clayborg, this is indeed a bit fragile as having to specify your rewrite maps manually when debugging is very error-prone. I have a patch that fetches the path to the rewrite map from the debug info, I'm waiting for this one to go in to upload that other diff (tr

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Greg Clayton via lldb-commits
clayborg added a comment. Adrian Prantl suggested that we modify clang to update the debug info for the function. In the test case that was attached, the DWARF currently has a "putchar" function which should get a linkage name attached to it with "__my_putchar". Then the debug info can be corr

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Jim Ingham via lldb-commits
jingham added a subscriber: jingham. jingham added a comment. This approach seems fragile to me. I'm supposed to remember that some build system set some rewriter file that I then have to supply manually to get the view of symbols to match reality? We really try to avoid having to write notes

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Greg Clayton via lldb-commits
clayborg added a comment. Adding a feature to the debugger that doesn't work with debug info seems like a bad idea. http://reviews.llvm.org/D22294 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Greg Clayton via lldb-commits
clayborg requested changes to this revision. clayborg added a comment. This revision now requires changes to proceed. If you can't get this right when debug info is present then I would rather not have this patch. We enabled debug info on your test and it will call the putchar() in the current l

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Francis Ricci via lldb-commits
fjricci updated this revision to Diff 63816. fjricci marked an inline comment as done. fjricci added a comment. Fix const SP and update unit test Will now only run the unit test as a dwarf test (with -g0), but since we don't want to test the debug data anyway, this shouldn't be an issue, and avoi

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Francis Ricci via lldb-commits
fjricci marked 3 inline comments as done. Comment at: packages/Python/lldbsuite/test/lang/c/symbol_rewriter/TestSymbolRewriter.py:28 @@ +27,3 @@ +# Clang does not rewrite dwarf debug info, so it must be stripped +subprocess.check_call(['strip', '-g', exe]) + -

Re: [Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-13 Thread Pavel Labath via lldb-commits
labath added a subscriber: labath. labath added a comment. Mostly just comments about the test from me. Comment at: include/lldb/Core/Module.h:240 @@ -239,2 +239,3 @@ FindFirstSymbolWithNameAndType (const ConstString &name, +const lldb::

[Lldb-commits] [PATCH] D22294: Add functionality for rewriting symbols

2016-07-12 Thread Francis Ricci via lldb-commits
fjricci created this revision. fjricci added reviewers: clayborg, lattner. fjricci added subscribers: sas, lldb-commits. Herald added a subscriber: kubabrecka. Clang supports symbol rewrites via the -frewrite-map-file flag, this patch adds complementary functionality in lldb. Re-written symbols a