Page MenuHomePhabricator

aadsm (António Afonso)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 27 2019, 10:34 PM (11 w, 2 d)

Recent Activity

Wed, Jul 10

aadsm added a comment to D64013: Correctly use GetLoadedModuleList to take advantage of libraries-svr4.

@labath can I ask for a re-review on this one please? :)

Wed, Jul 10, 11:04 AM · Restricted Project
aadsm added a comment to D62503: Add ReadCStringFromMemory for faster string reads.

@jankratochvil I'm planning to follow Pavel's plan now that the new setting has landed and finally got some time for this.

Wed, Jul 10, 11:03 AM · Restricted Project, Restricted Project

Wed, Jul 3

aadsm committed rGf8251f1ee6c6: Add plugin.process.gdb-remote.use-libraries-svr4 option (authored by aadsm).
Add plugin.process.gdb-remote.use-libraries-svr4 option
Wed, Jul 3, 10:32 AM
aadsm committed rL365059: Add plugin.process.gdb-remote.use-libraries-svr4 option.
Add plugin.process.gdb-remote.use-libraries-svr4 option
Wed, Jul 3, 10:32 AM
aadsm closed D64112: Add plugin.process.gdb-remote.use-libraries-svr4 option.
Wed, Jul 3, 10:32 AM · Restricted Project, Restricted Project

Tue, Jul 2

aadsm created D64112: Add plugin.process.gdb-remote.use-libraries-svr4 option.
Tue, Jul 2, 4:25 PM · Restricted Project, Restricted Project

Mon, Jul 1

aadsm updated the diff for D64013: Correctly use GetLoadedModuleList to take advantage of libraries-svr4.

Address comments, add GetAction that returns an enum with what to do.

Mon, Jul 1, 6:21 PM · Restricted Project
aadsm added inline comments to D64013: Correctly use GetLoadedModuleList to take advantage of libraries-svr4.
Mon, Jul 1, 9:33 AM · Restricted Project
aadsm added a reviewer for D64013: Correctly use GetLoadedModuleList to take advantage of libraries-svr4: xiaobai.
Mon, Jul 1, 8:06 AM · Restricted Project
aadsm abandoned D62504: Avoid calling LoadModules twice when modules change.

Replaced by D62503

Mon, Jul 1, 8:06 AM · Restricted Project
aadsm created D64013: Correctly use GetLoadedModuleList to take advantage of libraries-svr4.
Mon, Jul 1, 8:06 AM · Restricted Project
aadsm added a comment to D62503: Add ReadCStringFromMemory for faster string reads.

Yap, that makes a lot of sense to me. I looked into this over the weekend and figured out the reason why it was broken (tl;dr: we can't use LoadModules) and created a tidier version of D63868 that, like D62504 avoids fetching the svr4 packet twice.

Mon, Jul 1, 7:41 AM · Restricted Project, Restricted Project

Thu, Jun 27

aadsm added a comment to D62504: Avoid calling LoadModules twice when modules change.

I looked into this a bit today and at one point in time (when the list of modules is being processed) it seems that some previously loaded modules are somehow removed (at least I stop seeing them in the image list) including the one where the rendezvous breakpoint is so that breakpoint becomes "unresolved" and that's why it doesn't stop anymore. I'll need to check why this is the case tomorrow.

Thu, Jun 27, 10:05 PM · Restricted Project
aadsm added a comment to D63868: Unify+fix remote XML libraries handling with the legacy one.

The library is part of the GDB protocol itself: https://sourceware.org/gdb/onlinedocs/gdb/Stop-Reply-Packets.html#Stop-Reply-Packets and it's to be used with conjunction of qXfer:libraries:read (or libraries-svr4 like we do here).

Thu, Jun 27, 9:27 AM · Restricted Project
aadsm added a comment to D62504: Avoid calling LoadModules twice when modules change.

@jankratochvil I imagine the first test to be failing because this patch doesn't handle correctly the unload (or rather as soon as it unloads one shared object it stops working as expected).
I'm going to look at this today (right now it's 9am for me).

Thu, Jun 27, 8:59 AM · Restricted Project
aadsm added a comment to D63868: Unify+fix remote XML libraries handling with the legacy one.

I'm not sure why DynamicLoaderPOSIXDYLD::RendezvousBreakpointHit happens only once, I thought I had fixed that here: D62168.
I don't think we can stop loading/unloading the libraries in ProcessGDBRemote::LoadModules. The windows dynamic loader relies on this and the library entry on the stop packet does as well: https://github.com/llvm-mirror/lldb/blob/9689521b477c75b52257fba9655cabefc3db676c/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp#L2374-L2375

Thu, Jun 27, 7:40 AM · Restricted Project

Tue, Jun 25

aadsm added a comment to D62503: Add ReadCStringFromMemory for faster string reads.

Reverted here: https://reviews.llvm.org/rG9c10b620c0619611dfe062216459431955ac4801

Tue, Jun 25, 3:34 PM · Restricted Project, Restricted Project
aadsm committed rG9c10b620c061: Revert "Add ReadCStringFromMemory for faster string reads" (authored by aadsm).
Revert "Add ReadCStringFromMemory for faster string reads"
Tue, Jun 25, 3:23 PM
aadsm added a reverting change for rGa7335393f502: Add ReadCStringFromMemory for faster string reads: rG9c10b620c061: Revert "Add ReadCStringFromMemory for faster string reads".
Tue, Jun 25, 3:23 PM
aadsm committed rL364355: Revert "Add ReadCStringFromMemory for faster string reads".
Revert "Add ReadCStringFromMemory for faster string reads"
Tue, Jun 25, 3:23 PM
aadsm added a comment to D62503: Add ReadCStringFromMemory for faster string reads.

I can't repro it right now so I prefer to revert it (I'm curious how this new function could influence those tests though). I actually thought this was sorted, sorry about that.

Tue, Jun 25, 2:43 PM · Restricted Project, Restricted Project

Wed, Jun 19

aadsm added a comment to rL363772: Stabilize TestGdbRemoteLibrariesSvr4Support.

dang, I missed filtering that test as well, thank you.

Wed, Jun 19, 8:02 AM

Tue, Jun 18

aadsm committed rGa7335393f502: Add ReadCStringFromMemory for faster string reads (authored by aadsm).
Add ReadCStringFromMemory for faster string reads
Tue, Jun 18, 4:25 PM
aadsm committed rL363750: Add ReadCStringFromMemory for faster string reads.
Add ReadCStringFromMemory for faster string reads
Tue, Jun 18, 4:25 PM
aadsm closed D62503: Add ReadCStringFromMemory for faster string reads.
Tue, Jun 18, 4:25 PM · Restricted Project, Restricted Project
aadsm committed rGfda83c9b0b1a: Implement xfer:libraries-svr4:read packet (authored by aadsm).
Implement xfer:libraries-svr4:read packet
Tue, Jun 18, 10:50 AM
aadsm committed rL363707: Implement xfer:libraries-svr4:read packet.
Implement xfer:libraries-svr4:read packet
Tue, Jun 18, 10:50 AM
aadsm closed D62502: Implement xfer:libraries-svr4:read packet.
Tue, Jun 18, 10:49 AM · Restricted Project, Restricted Project

Mon, Jun 17

aadsm updated the diff for D62503: Add ReadCStringFromMemory for faster string reads.
  • Add a test to cover cross page reads
  • Make cache_line_size a static const variable inside the function.
  • Fix how we're passing name_buffer to ReadCStringFromMemory.
Mon, Jun 17, 4:12 PM · Restricted Project, Restricted Project

Sun, Jun 16

aadsm updated the diff for D62503: Add ReadCStringFromMemory for faster string reads.
  • Address missing comments
Sun, Jun 16, 5:07 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62503: Add ReadCStringFromMemory for faster string reads.
  • Make ReadCStringFromMemory return llvm::Expected<llvm::StringRef>>
  • Add documentation
  • Address other comments
  • Created static const size_t g_cache_line_size to avoid calling llvm::sys::Process::getPageSizeEstimate() all the time, that thing is expensive.
Sun, Jun 16, 5:04 PM · Restricted Project, Restricted Project

Jun 14 2019

aadsm updated the diff for D62502: Implement xfer:libraries-svr4:read packet.

Only extend support to NetBSD

Jun 14 2019, 2:46 PM · Restricted Project, Restricted Project
aadsm committed rGf4335b8e3c6a: Implement GetSharedLibraryInfoAddress (authored by aadsm).
Implement GetSharedLibraryInfoAddress
Jun 14 2019, 2:16 PM
aadsm committed rL363458: Implement GetSharedLibraryInfoAddress.
Implement GetSharedLibraryInfoAddress
Jun 14 2019, 2:12 PM
aadsm closed D62501: Implement GetSharedLibraryInfoAddress.
Jun 14 2019, 2:12 PM · Restricted Project, Restricted Project

Jun 13 2019

aadsm added a comment to D62503: Add ReadCStringFromMemory for faster string reads.

I see what you mean, this is a good point. Yes, like you say I'm assuming the string I want to read is in a page that I can read using the fast method. And in this situation I prefer to minimize the number of calls to ReadMemory than the amount of data I'll read (given that I'll be reading from within the same page that is already cached, and also assuming the destination is also cached (probably true if in the stack)). I also wanted to side step the question of what is a good string average size because I don't have good data to back it up.
So yeah, optimizing for the case I know it exists, and we can tweak this better once we have other cases to analyse.

Jun 13 2019, 11:32 AM · Restricted Project, Restricted Project

Jun 12 2019

aadsm updated the diff for D62502: Implement xfer:libraries-svr4:read packet.
  • Move SVR4 reading to NativeProcessELF
  • Made NetBSD and FreeBSD process implementations extend NativeProcessELF
Jun 12 2019, 10:13 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62501: Implement GetSharedLibraryInfoAddress.

Improve tests

Jun 12 2019, 10:07 PM · Restricted Project, Restricted Project
aadsm added a comment to D62503: Add ReadCStringFromMemory for faster string reads.

Yeah, that's a good question and I did think about it at the time I wrote D62715. Here's my rationale:
Regarding the chunk reading in the ReadMemory I was not sure because I don't know how common that is and it is faster to read the entire size without chunking (the code is also less complex this way). I'd imagine that in the common case we usually know what we're reading? (e.g.: reading the entire function assembly code)
That's why I thought about the string "extraction" as a special case for memory reading. However, even if we had a ReadMemory that did chunking I'd still want to do chunking in the ReadCStringFromMemory. Otherwise we'd be reading much more than needed for a string because there is no way for the ReadMemory to know it could stop (after finding a '\0') so it might end up reading say 2KB word by word with ptrace. (I did think for 5s to pass an optional stop character to ReadMemory but that would be shoehorning an edge case into a generic and simple function, it would be better to put the chunk reading logic into a separate thing that both ReadMemory and ReadCStringFromMemory could reuse).

Jun 12 2019, 10:00 PM · Restricted Project, Restricted Project

Jun 11 2019

aadsm committed rG943faef1fafe: Add support to read aux vector values (authored by aadsm).
Add support to read aux vector values
Jun 11 2019, 1:14 PM
aadsm committed rL363098: Add support to read aux vector values.
Add support to read aux vector values
Jun 11 2019, 1:13 PM
aadsm closed D62500: Add support to read aux vector values.
Jun 11 2019, 1:13 PM · Restricted Project, Restricted Project
aadsm updated the summary of D62500: Add support to read aux vector values.
Jun 11 2019, 11:23 AM · Restricted Project, Restricted Project
aadsm added a comment to D62502: Implement xfer:libraries-svr4:read packet.

Yeah, that makes sense. I was thinking about this yesterday after checking the freebsd code. I was concerned if there's something different that I'm not aware of but we do have tests and I guess we can also override these functions if needed in the future.

Jun 11 2019, 11:11 AM · Restricted Project, Restricted Project

Jun 10 2019

aadsm updated the diff for D62503: Add ReadCStringFromMemory for faster string reads.

Rebase

Jun 10 2019, 5:56 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62502: Implement xfer:libraries-svr4:read packet.
  • Update test to just wait for the process to stop
  • Change ReadSVR4LibraryInfo signature to return an Expected to the list of libraries and stop taking params by ref.
Jun 10 2019, 5:55 PM · Restricted Project, Restricted Project
aadsm committed rG57e2da4f325f: Create a generic handler for Xfer packets (authored by aadsm).
Create a generic handler for Xfer packets
Jun 10 2019, 1:58 PM
aadsm committed rL362982: Create a generic handler for Xfer packets.
Create a generic handler for Xfer packets
Jun 10 2019, 1:58 PM
aadsm closed D62499: Create a generic handler for Xfer packets.
Jun 10 2019, 1:58 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62502: Implement xfer:libraries-svr4:read packet.
Jun 10 2019, 10:36 AM · Restricted Project, Restricted Project
aadsm added a comment to D62501: Implement GetSharedLibraryInfoAddress.

Initially one at a time but then thought it might be better to do it as a batch because I was afraid I was missing some dependency and would brake something unexpectedly. But I guess that since I've already landed D62168 it's probably fine to land one at a time.

Jun 10 2019, 9:14 AM · Restricted Project, Restricted Project
aadsm added a comment to D62502: Implement xfer:libraries-svr4:read packet.

It's the same for freebsd https://github.com/freebsd/freebsd/blob/master/sys/kern/link_elf.c#L291 although behind a GDB flag (which NetBSD doesn't seem to be: https://nxr.netbsd.org/xref/src/libexec/ld.elf_so/rtld.c#1040).

Jun 10 2019, 9:09 AM · Restricted Project, Restricted Project

Jun 9 2019

aadsm updated the diff for D62504: Avoid calling LoadModules twice when modules change.

Do not try to use LoadModules again if they failed in the past

Jun 9 2019, 6:41 PM · Restricted Project

Jun 7 2019

aadsm added a comment to D62502: Implement xfer:libraries-svr4:read packet.

Sounds good, I put it there initially because the XML.cpp set of classes abstract the libxml2 specific away but I guess it is odd to have XMLDocument::XMLEnabled() returning false and still be able to call that new function.

Jun 7 2019, 6:11 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62503: Add ReadCStringFromMemory for faster string reads.

Fix a little bug and add tests

Jun 7 2019, 6:11 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62502: Implement xfer:libraries-svr4:read packet.

Move XMLEncodeAttributeValue to GDBRemoteCommunicationServerLLGS.

Jun 7 2019, 6:11 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62501: Implement GetSharedLibraryInfoAddress.

Removed unwanted change

Jun 7 2019, 6:04 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62501: Implement GetSharedLibraryInfoAddress.

Address comments

Jun 7 2019, 6:00 PM · Restricted Project, Restricted Project

Jun 6 2019

aadsm added a comment to D62502: Implement xfer:libraries-svr4:read packet.

@labath that's a really good point. I've talked with @clayborg and @xiaobai about this and we decided it would be fine to do it manually as well so I added a XMLEncodeAttributeValue function to make it happen. I'm not 100% sure about its implementation.. Should I use a StreamString instead?

Jun 6 2019, 7:56 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62502: Implement xfer:libraries-svr4:read packet.

No longer depend on libxml2 to quote the attribute value

Jun 6 2019, 7:52 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62501: Implement GetSharedLibraryInfoAddress.

This creates a NativeProcessELF to deal with ELF specific things. The NativeProcessLinux now extends this one.
Added a test case for the GetAuxValue and GetELFImageInfoAddress. I refactored NativeProcessTestUtils to reuse that code.
I also addressed other comments on the review.

Jun 6 2019, 7:50 PM · Restricted Project, Restricted Project
aadsm added a comment to D62501: Implement GetSharedLibraryInfoAddress.

Interesting, I actually don't think there's much to gain from turning this into an utility. Creating a NativeProcessELF makes sense to me (I already did it and have all the tests up and running as well) and putting it into POSIX also makes sense to me based on what you said.

Jun 6 2019, 9:02 AM · Restricted Project, Restricted Project

Jun 5 2019

aadsm added a comment to D62501: Implement GetSharedLibraryInfoAddress.

@labath while working on this I had to also move the GetAuxValue function into the NativeProcessELF, which I think it's fine. However, this means this class now depends on the AuxValue class defined in the PluginUtility. Initially I was going to put the NativeProcessELF in the lldbHost but it feels weird that this will now depend on a plugin, even if it's the utility one. Should I create a new ELF plugin just for this?

Jun 5 2019, 11:12 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62499: Create a generic handler for Xfer packets.

Address final 2 comments

Jun 5 2019, 1:06 PM · Restricted Project, Restricted Project
aadsm added a comment to D62501: Implement GetSharedLibraryInfoAddress.

I haven't given this much thought, but it may be possible to reuse the stuff in MockProcess by making it a template (so you'd have a MockProcess<NativeProcessProtocol>, and a MockProcess<NativeProcessELF>)

Jun 5 2019, 12:23 PM · Restricted Project, Restricted Project
aadsm added a comment to D62501: Implement GetSharedLibraryInfoAddress.

Another advantage of having this in an abstract class is that you could test this in isolation, as NativeProcessProtocol is already setup to mock memory accesses: https://github.com/llvm-mirror/lldb/blob/master/unittests/Host/NativeProcessProtocolTest.cpp.

Jun 5 2019, 9:58 AM · Restricted Project, Restricted Project
aadsm committed rG5659b36c15b0: [DynamicLoader] Make sure we always set the rendezvous breakpoint (authored by aadsm).
[DynamicLoader] Make sure we always set the rendezvous breakpoint
Jun 5 2019, 9:21 AM
aadsm committed rL362619: [DynamicLoader] Make sure we always set the rendezvous breakpoint.
[DynamicLoader] Make sure we always set the rendezvous breakpoint
Jun 5 2019, 9:21 AM
aadsm closed D62168: [DynamicLoader] Make sure we always set the rendezvous breakpoint.
Jun 5 2019, 9:21 AM · Restricted Project, Restricted Project

Jun 4 2019

aadsm updated the diff for D62503: Add ReadCStringFromMemory for faster string reads.

Make sure we always return a null terminated string

Jun 4 2019, 11:06 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62502: Implement xfer:libraries-svr4:read packet.
Jun 4 2019, 11:03 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62502: Implement xfer:libraries-svr4:read packet.
  • Improved the tests by using a binary that is specificly linked to other shared libs.
  • USe libxml2 to generate the name attribute (I've talked with Greg about this and he recommended to create a new class for this)
  • Address other comments
Jun 4 2019, 11:03 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62501: Implement GetSharedLibraryInfoAddress.
Jun 4 2019, 10:00 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62502: Implement xfer:libraries-svr4:read packet.
Jun 4 2019, 7:39 AM · Restricted Project, Restricted Project
aadsm added inline comments to D62501: Implement GetSharedLibraryInfoAddress.
Jun 4 2019, 7:36 AM · Restricted Project, Restricted Project

Jun 3 2019

aadsm updated the diff for D62502: Implement xfer:libraries-svr4:read packet.

Address comments except the one about a different test plan.
Also removed the main property, after searching on the internet I'm not confident with the way I was using to detect the main executable. Since the "lm-main" is an optional attribute I'm not going to implement it now.
However, I'm excluding from the list the libraries without name or that are at base addr == 0. They shouldn't be there by the spec.

Jun 3 2019, 10:28 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62501: Implement GetSharedLibraryInfoAddress.

Address comments

Jun 3 2019, 10:25 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62500: Add support to read aux vector values.
Jun 3 2019, 10:22 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62500: Add support to read aux vector values.

Address comments

Jun 3 2019, 10:20 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62499: Create a generic handler for Xfer packets.

Move test to a better place, address other comments related to tests.

Jun 3 2019, 10:14 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62502: Implement xfer:libraries-svr4:read packet.
Jun 3 2019, 8:37 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62500: Add support to read aux vector values.
Jun 3 2019, 5:41 PM · Restricted Project, Restricted Project
aadsm added a comment to D62502: Implement xfer:libraries-svr4:read packet.

@labath

Regarding the test, I am wondering whether requiring the /proc/%d/maps and the linker rendezvous structure to match isn't too strict of a requirement. Dynamic linkers (and particularly android dynamic linkers) do a lot of crazy stuff, and trying to assert this invariant exposes us to all kinds of "optimizations" that the linkers do or may do in the future. I'm wondering if it wouldn't be better to just build an executable with one or two dependent libraries, and then just assert that their entries are present in the library list. However, I'm not completely sure on this, so I'd like to hear what you think about that..

Jun 3 2019, 5:21 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62500: Add support to read aux vector values.
Jun 3 2019, 5:08 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62501: Implement GetSharedLibraryInfoAddress.
Jun 3 2019, 10:42 AM · Restricted Project, Restricted Project
aadsm committed rGdab879d7c805: [lldb-server unittest] Add missing teardown logic (authored by aadsm).
[lldb-server unittest] Add missing teardown logic
Jun 3 2019, 8:19 AM
aadsm committed rL362406: [lldb-server unittest] Add missing teardown logic.
[lldb-server unittest] Add missing teardown logic
Jun 3 2019, 8:15 AM
aadsm closed D62788: [lldb-server unittest] Add missing teardown logic.
Jun 3 2019, 8:15 AM · Restricted Project, Restricted Project

Jun 2 2019

aadsm updated the diff for D62500: Add support to read aux vector values.

Missing clang-format-diff

Jun 2 2019, 10:49 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62502: Implement xfer:libraries-svr4:read packet.

Address comments and add tests

Jun 2 2019, 10:35 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62501: Implement GetSharedLibraryInfoAddress.

Rebase

Jun 2 2019, 10:35 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62500: Add support to read aux vector values.

Fix patch snafu

Jun 2 2019, 10:29 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62500: Add support to read aux vector values.

Address commentds

Jun 2 2019, 9:46 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62499: Create a generic handler for Xfer packets.
Jun 2 2019, 9:44 PM · Restricted Project, Restricted Project
aadsm updated the diff for D62499: Create a generic handler for Xfer packets.

Address comments and add tests

Jun 2 2019, 9:40 PM · Restricted Project, Restricted Project

Jun 1 2019

aadsm created D62788: [lldb-server unittest] Add missing teardown logic.
Jun 1 2019, 9:43 PM · Restricted Project, Restricted Project

May 31 2019

aadsm added inline comments to D62500: Add support to read aux vector values.
May 31 2019, 6:48 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62499: Create a generic handler for Xfer packets.
May 31 2019, 5:56 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62499: Create a generic handler for Xfer packets.
May 31 2019, 5:06 PM · Restricted Project, Restricted Project
aadsm added inline comments to D62499: Create a generic handler for Xfer packets.
May 31 2019, 3:30 PM · Restricted Project, Restricted Project