Page MenuHomePhabricator

MrHate (Gongyu Deng)
User

Projects

User does not belong to any projects.

User Details

User Since
Feb 26 2020, 5:19 PM (58 w, 6 d)

Recent Activity

Aug 27 2020

MrHate updated the diff for D84142: [lldb] tab completion for class `CommandObjectTypeFormatterDelete`.
  • Rebased the patch with the latest master branch and refactored FormattersContainer::AutoComplete with the latest interface.
Aug 27 2020, 2:39 AM · Restricted Project

Aug 23 2020

MrHate updated the diff for D80700: [lldb] common completion for process pids and process names.
  • Refactored the test with spawnSubprocess and modified main.cpp.
Aug 23 2020, 7:45 AM · Restricted Project

Aug 21 2020

MrHate updated the diff for D80700: [lldb] common completion for process pids and process names.
  1. Rebased the patch with the latest master branch from Github;
  2. In test, uses the pid got from psutil.pids()[0] instead of the one generated by creating a new process in case the pickle error.
Aug 21 2020, 8:27 PM · Restricted Project

Aug 19 2020

MrHate updated the diff for D85284: [lldb] Remote disk file/directory completion for platform commands.
  1. Now the server uses std::sort to sort the match result before writing into the response packet;
  2. Refactored the server-side test to run within the build directory.
Aug 19 2020, 10:45 AM · Restricted Project

Aug 15 2020

MrHate updated the diff for D85284: [lldb] Remote disk file/directory completion for platform commands.
  • Added an 'M' at the beginning of the response packet, updated related doc and tests.
Aug 15 2020, 8:21 PM · Restricted Project
MrHate added a comment to D85284: [lldb] Remote disk file/directory completion for platform commands.
  1. Removed the unnecessary print line in GDBRemoteCommunicationServerPlatform.cpp;
  2. Updated the packet doc;
  3. Refactored the for-loop at line 359-364 in GDBRemoteCommunicationServerPlatform.cpp;
  4. Refactored the server-side test with str.encode().hex().

If we need to response for qPathComplete with empty match result. I think we could provide a char like R or what as the response. The match result is encoded into hex-bytes, so it might be easy to resolve the error symbol from the result IMHO.

What if the response is "matches:<ASCIIHEX>[,<ASCIIHEX>]" and if there are no matches, just "matches:"? We don't want to send an empty string because that means "packet not known" in the remote serial protocol.

Aug 15 2020, 9:53 AM · Restricted Project

Aug 14 2020

MrHate updated the diff for D85284: [lldb] Remote disk file/directory completion for platform commands.
  1. Removed the unnecessary print line in GDBRemoteCommunicationServerPlatform.cpp;
  2. Updated the packet doc;
  3. Refactored the for-loop at line 359-364 in GDBRemoteCommunicationServerPlatform.cpp;
  4. Refactored the server-side test with str.encode().hex().
Aug 14 2020, 8:50 PM · Restricted Project
MrHate added a comment to D85284: [lldb] Remote disk file/directory completion for platform commands.

Now the server test works well except that the lldb-server subprocess cannot be terminated gracefully due to a TypeError thrown by sock.sendall(GdbRemoteTestCaseBase._GDBREMOTE_KILL_PACKET) in shutdown_socket, the backtrace is

Traceback (most recent call last):
  File "/home/ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py", line 349, in shutdown_socket
    sock.sendall(GdbRemoteTestCaseBase._GDBREMOTE_KILL_PACKET)
TypeError: a bytes-like object is required, not 'str'

Interesting. This isn't really related to your patch, is it (like, I would expect all gdb-remote tests to suffer from this python3 incompatibility)? I'll try to take a look at this later today, but if the test comes out as successful I don't think you have to wait for that. The patch looks good to me, aside from some small clarifications in inline comments.

That should be fixed by e6b1b61054.

Aug 14 2020, 8:54 AM · Restricted Project

Aug 13 2020

MrHate updated the diff for D85284: [lldb] Remote disk file/directory completion for platform commands.
  • Updated the packet doc.
Aug 13 2020, 11:33 AM · Restricted Project
MrHate updated the diff for D85284: [lldb] Remote disk file/directory completion for platform commands.
  1. Renamed packet related into "qPathComplete";
  2. Refactored response form into comma-separated;
  3. Moved the functions from GDBRemoteCommunicationServerCommon to GDBRemoteCommunicationServerPlatform;
  4. Refactored the server-side test into lldb-platform dedicated, combined test cases into just one;
  5. Now MockGDBServerResponder.qPathComplete responses with just an empty string.
Aug 13 2020, 11:26 AM · Restricted Project

Aug 11 2020

MrHate added inline comments to D85284: [lldb] Remote disk file/directory completion for platform commands.
Aug 11 2020, 7:18 PM · Restricted Project

Aug 10 2020

MrHate updated the diff for D85284: [lldb] Remote disk file/directory completion for platform commands.
  • Extended the server test into 3 separated cases:
    1. disk file with 1 match and 2 matches;
    2. disk dir on non-windows platform (for '/');
    3. disk dir on windows (for '\').
Aug 10 2020, 8:08 PM · Restricted Project
MrHate updated the diff for D85284: [lldb] Remote disk file/directory completion for platform commands.
  1. Renamed all "vFile:autocomplete" related into "qDiskAutocomplete";
  2. Refactored match response from "[cstr],[cstr]..." into "[length]:[str bytes][length]:[str bytes]...";
  3. Updated docs/lldb-platform-packets.txt;
  4. Use 85 as the server's response error code.
Aug 10 2020, 7:36 PM · Restricted Project
MrHate updated the diff for D85284: [lldb] Remote disk file/directory completion for platform commands.
  • Added a server test.
Aug 10 2020, 5:26 AM · Restricted Project

Aug 9 2020

MrHate updated the diff for D85284: [lldb] Remote disk file/directory completion for platform commands.
  1. Corrected summary;
  2. Added a test case for client which provides mock response for autocomplete request and test completion on command line;
  3. Modified the argument order of the autocomplete request packet replacing vFile:autocomplete:<partial_path>,<only_dir> with vFile:autocomplete:<only_dir>,<partial_path>, so commas won't break partial path resolving.
Aug 9 2020, 9:15 PM · Restricted Project

Aug 6 2020

MrHate updated the diff for D83234: [lldb] tab completion for `thread plan discard`.
  • Added a comment in thread_plan_script.py.
Aug 6 2020, 5:41 PM · Restricted Project
MrHate updated the diff for D84123: [lldb] stop-hook ID common completion for commands `target stop-hook enable/disable/delete'.
  • Added a comment to describe that 11 indent value.
Aug 6 2020, 4:56 AM · Restricted Project
MrHate added inline comments to D84123: [lldb] stop-hook ID common completion for commands `target stop-hook enable/disable/delete'.
Aug 6 2020, 4:40 AM · Restricted Project
MrHate added inline comments to D85284: [lldb] Remote disk file/directory completion for platform commands.
Aug 6 2020, 4:34 AM · Restricted Project

Aug 5 2020

MrHate requested review of D85284: [lldb] Remote disk file/directory completion for platform commands.
Aug 5 2020, 1:43 AM · Restricted Project

Jul 24 2020

MrHate updated the diff for D84142: [lldb] tab completion for class `CommandObjectTypeFormatterDelete`.
  • Made the comment for EmptyStruct a Doxygen comment;
  • Refactored m_formatter_kind_mask check with a macro CHECK_FORMATTER_KIND_MASK.
Jul 24 2020, 5:57 PM · Restricted Project

Jul 22 2020

MrHate updated the diff for D84128: [lldb] type language common completion.
  • Use static_cast<lldb::LanguageType>(bit) instead of C-style cast.
Jul 22 2020, 5:58 PM · Restricted Project

Jul 20 2020

MrHate retitled D80700: [lldb] common completion for process pids and process names from [lldb] complete `process attach -p` with PIDs to [lldb] common completion for process pids and process names.
Jul 20 2020, 9:32 PM · Restricted Project
MrHate updated the diff for D80700: [lldb] common completion for process pids and process names.
  • Refactored the whole patch to provide two common completions: pid and process name.
Jul 20 2020, 9:25 PM · Restricted Project
MrHate updated the diff for D80700: [lldb] common completion for process pids and process names.
  • Allow processes with empty names appear in the completion list.
Jul 20 2020, 9:04 AM · Restricted Project
MrHate created D84179: [lldb] tab completion for `platform target-install`.
Jul 20 2020, 8:41 AM · Restricted Project
MrHate created D84177: [lldb] tab completion for `watchpoint set variable`.
Jul 20 2020, 8:27 AM · Restricted Project
MrHate updated the diff for D84088: [lldb] thread index common completion for commands like `thread select/step-over`.
  • Use do nothing instead of not work now.
Jul 20 2020, 2:25 AM · Restricted Project
MrHate created D84143: [lldb] tab completion for `disassemble -F`.
Jul 20 2020, 2:13 AM · Restricted Project
MrHate created D84142: [lldb] tab completion for class `CommandObjectTypeFormatterDelete`.
Jul 20 2020, 1:30 AM · Restricted Project

Jul 19 2020

MrHate created D84128: [lldb] type language common completion.
Jul 19 2020, 10:39 AM · Restricted Project
MrHate updated the diff for D84124: [lldb] type category name common completion.
  • Bound the completion to the arguments of the type 'eArgTypeName', so that options like type filter add -w can be completed.
Jul 19 2020, 7:24 AM · Restricted Project
MrHate updated the diff for D84124: [lldb] type category name common completion.
  • Applied completion to type category define.
Jul 19 2020, 7:14 AM · Restricted Project
MrHate created D84124: [lldb] type category name common completion.
Jul 19 2020, 6:51 AM · Restricted Project
MrHate created D84123: [lldb] stop-hook ID common completion for commands `target stop-hook enable/disable/delete'.
Jul 19 2020, 2:02 AM · Restricted Project

Jul 18 2020

MrHate retitled D84121: [lldb] tab completion for `target modules load -u` from [lldb] tab completion for `target module load -u` to [lldb] tab completion for `target modules load -u`.
Jul 18 2020, 10:37 PM · Restricted Project
MrHate created D84121: [lldb] tab completion for `target modules load -u`.
Jul 18 2020, 10:36 PM · Restricted Project
MrHate created D84104: [lldb] watchpoint ID common completion for commands `watchpoint delete/enable/disable/modify/ignore`.
Jul 18 2020, 9:14 AM · Restricted Project
MrHate updated the diff for D84088: [lldb] thread index common completion for commands like `thread select/step-over`.
  • Renamed completion function name from ThreadIndex to ThreadIndexes.
Jul 18 2020, 4:43 AM · Restricted Project
MrHate updated the diff for D83400: [lldb] move the frame index completion into a common completion and apply it to `thread backtrace -s`.
  • Renamed completion function name from FrameIndex to FrameIndexes.
Jul 18 2020, 4:13 AM · Restricted Project
MrHate updated the diff for D84088: [lldb] thread index common completion for commands like `thread select/step-over`.
  • Removed the argument cursor check in these commands: thread conitnue/exceptioin/info.
Jul 18 2020, 2:43 AM · Restricted Project
MrHate created D84088: [lldb] thread index common completion for commands like `thread select/step-over`.
Jul 18 2020, 2:25 AM · Restricted Project

Jul 17 2020

MrHate updated the diff for D80700: [lldb] common completion for process pids and process names.
  • Set daemon to True on creating process, so that it will be killed with the test case ending (which was set to False by mistake).
Jul 17 2020, 9:53 PM · Restricted Project

Jul 8 2020

MrHate added a comment to D83400: [lldb] move the frame index completion into a common completion and apply it to `thread backtrace -s`.

The test case failed due to a bug in dotest.py (the test runner).

Jul 8 2020, 8:00 AM · Restricted Project
MrHate created D83400: [lldb] move the frame index completion into a common completion and apply it to `thread backtrace -s`.
Jul 8 2020, 7:59 AM · Restricted Project
MrHate updated the diff for D80700: [lldb] common completion for process pids and process names.

clang-formatted.

Jul 8 2020, 5:50 AM · Restricted Project

Jul 7 2020

MrHate added inline comments to D79887: [lldb] Tab completion for process load/unload.
Jul 7 2020, 9:40 PM · Restricted Project
MrHate added inline comments to D79887: [lldb] Tab completion for process load/unload.
Jul 7 2020, 7:08 PM · Restricted Project
MrHate updated the diff for D79887: [lldb] Tab completion for process load/unload.
  1. replaced request.GetCursorIndex() != 0 with request.GetCursorIndex();
  2. renamed the loop variable at line 1005.
Jul 7 2020, 7:04 PM · Restricted Project
MrHate updated the diff for D80693: [lldb] tab completion for breakpoint names.
  1. clang-formatted related files;
  2. refactored line 2100 with StringRef;
  3. replaced files_pec.hasValue() to file_spec, file_spec.getValue() to *file_spec;
  4. removed an useless comment;
  5. added a new line at the end of breakpoints.json.
Jul 7 2020, 6:21 PM · Restricted Project
MrHate updated the diff for D83234: [lldb] tab completion for `thread plan discard`.
  1. refactored for-loop into while-loop;
  2. added a new line at the end of thread_plan_script.py.
Jul 7 2020, 5:32 PM · Restricted Project
MrHate created D83309: [lldb] tab completion for `target modules search-paths insert​`.
Jul 7 2020, 7:52 AM · Restricted Project

Jul 6 2020

MrHate updated the diff for D80700: [lldb] common completion for process pids and process names.
  1. added @skipIfRemote to the test case;
  2. added the comment explaining the process creation.
Jul 6 2020, 6:29 PM · Restricted Project
MrHate updated the diff for D79887: [lldb] Tab completion for process load/unload.
  1. added a test case for process load;
  2. replaced assertTrue(err.Success()...) with assertSuccess(err).
Jul 6 2020, 9:42 AM · Restricted Project
MrHate created D83234: [lldb] tab completion for `thread plan discard`.
Jul 6 2020, 8:31 AM · Restricted Project

Jul 3 2020

MrHate updated the diff for D80700: [lldb] common completion for process pids and process names.
  1. modified for loop;
  2. replaced pass with time.sleep(1) so that the test process won't take up CPU.
Jul 3 2020, 9:14 PM · Restricted Project
MrHate updated the diff for D80693: [lldb] tab completion for breakpoint names.
  1. replaced std::string with const std::string& in for loop;
  2. refactored the success segment with llvm::Optional<FileSpec> file_spec;
  3. added invalidation check in test.
Jul 3 2020, 6:22 PM · Restricted Project

Jun 9 2020

MrHate added a comment to D80700: [lldb] common completion for process pids and process names.
  1. For the necessity it's because lldb does filter out its own pid and the pid of the process it already attached to, so I create a process here to provide an available pid which is known to us and able to be found by the completion implementation.
  2. For the child process termination problem, with the process flag value daemon set to True, this child process should be terminated automatically if this test process is killed due to any exception.
Jun 9 2020, 6:15 PM · Restricted Project

Jun 5 2020

MrHate updated the diff for D80700: [lldb] common completion for process pids and process names.

Wrap pid completion as a common completion.

Jun 5 2020, 6:01 AM · Restricted Project
MrHate created D81241: [lldb] Tab completion for `frame recognizer delete`.
Jun 5 2020, 1:36 AM · Restricted Project

Jun 4 2020

MrHate updated the diff for D81177: [lldb] Tab completion for `frame select`.

Removed one redundant newline in TestCompletion.py.

Jun 4 2020, 10:01 PM · Restricted Project
MrHate created D81177: [lldb] Tab completion for `frame select`.
Jun 4 2020, 11:00 AM · Restricted Project
MrHate updated the diff for D81128: [lldb] tab completion for 'command delete/unalias'.
  1. modified newlines;
  2. using range-based for-loop now;
  3. modified the test case.
Jun 4 2020, 2:08 AM · Restricted Project

Jun 3 2020

MrHate created D81128: [lldb] tab completion for 'command delete/unalias'.
Jun 3 2020, 7:17 PM · Restricted Project
MrHate updated the diff for D80775: [lldb] tab completion for `command script delete'.

Added arg index check.

Jun 3 2020, 7:17 PM · Restricted Project

May 28 2020

MrHate created D80775: [lldb] tab completion for `command script delete'.
May 28 2020, 7:47 PM · Restricted Project
MrHate created D80700: [lldb] common completion for process pids and process names.
May 28 2020, 2:40 AM · Restricted Project

May 27 2020

MrHate created D80693: [lldb] tab completion for breakpoint names.
May 27 2020, 11:57 PM · Restricted Project
MrHate added a comment to D79929: [lldb] Tab completion for process plugin name.

That does make sense. I will split it into eArgTypeProcessPlugin and eArgTypeDisassemblePlugin along with the corresponding completion function names at the time I implement the disassemble related completion function.

May 27 2020, 6:34 PM · Restricted Project
MrHate updated the diff for D80447: [lldb] Fix a potential bug that may cause assert failure in CommandObject::CheckRequirements.
May 27 2020, 4:49 AM · Restricted Project

May 24 2020

MrHate updated the diff for D79887: [lldb] Tab completion for process load/unload.

Maybe we can skip the unified requirements checking now, coz it has got many things to deal with.
Added back the local checking here.

May 24 2020, 1:34 AM · Restricted Project

May 22 2020

MrHate updated the diff for D80447: [lldb] Fix a potential bug that may cause assert failure in CommandObject::CheckRequirements.

Thanks very much Jonas for pointing out my carelessness! And with your RAII idea, I think we can use the smart pointer to simulate the defer thing.

May 22 2020, 8:53 PM · Restricted Project
MrHate created D80447: [lldb] Fix a potential bug that may cause assert failure in CommandObject::CheckRequirements.
May 22 2020, 10:10 AM · Restricted Project
MrHate updated the diff for D79929: [lldb] Tab completion for process plugin name.
  1. Removed PID completion from this patch;
  2. Removed the first empty lines for cases;
  3. Modified the title and the summary.
May 22 2020, 8:34 AM · Restricted Project
MrHate added a comment to D79929: [lldb] Tab completion for process plugin name.

I think the two completions here are not related to each other? If yes, I think this should be two reviews/commits. Especially since the plugin completions is good to go, but the PID test should probably test that we get *some* pid back (so that test requires some small changes).

May 22 2020, 6:23 AM · Restricted Project

May 17 2020

MrHate updated the diff for D79887: [lldb] Tab completion for process load/unload.

Removed local requirements checking. Added periods.

May 17 2020, 2:40 AM · Restricted Project

May 14 2020

MrHate created D79929: [lldb] Tab completion for process plugin name.
May 14 2020, 3:10 AM · Restricted Project

May 13 2020

MrHate added a comment to D79722: Correct the argument list of command `breakpoint read`.

Sounds that the breakpoint-id completion needs to be improved in the future. Thanks for pointing this out!

May 13 2020, 8:11 PM · Restricted Project
MrHate added a comment to D79722: Correct the argument list of command `breakpoint read`.

I'm not sure I agree with you. If the workflow is that you use "break list --filename" to see what is in the saved breakpoint file - which would presumably produce exactly the same listing as "break list" with any other specifier would - then it would be very natural to expect that you pick out of the list results in "break read" exactly as you would other breakpoint commands.

For instance, it would be weird if 1-4 works or specifying them by name worked for other breakpoint commands but not for "break read". So I think this is a distinction without a difference.

That said, the code to use them is not present, and they will be trivial to re-add if/when somebody gets around to finishing this. So I have no objection to removing them now.

May 13 2020, 11:25 AM · Restricted Project
MrHate created D79887: [lldb] Tab completion for process load/unload.
May 13 2020, 10:50 AM · Restricted Project

May 12 2020

MrHate added a comment to D79722: Correct the argument list of command `breakpoint read`.

It is fine to take this out for now. I didn't get to finish this when I was last working on it. In the finished design you would say:

(lldb) breakpoint list --file savedBreakpoints.txt
(1) file: foo.c line:12
(2) someInterestingSymbol
...
(lldb) breakpoint read --file savedBreakpoints.txt 1

To only read in specific breakpoints from the saved file. That 's not much use till you can list what's in a file without importing it, so the breakpoint id's are not currently used.

May 12 2020, 11:49 AM · Restricted Project

May 11 2020

MrHate created D79722: Correct the argument list of command `breakpoint read`.
May 11 2020, 9:39 AM · Restricted Project

May 9 2020

MrHate created D79686: Tab completion for breakpoint write and breakpoint name add/delete.
May 9 2020, 11:23 PM · Restricted Project
MrHate updated the diff for D79666: Complete breakpoint enable/disable/delete/modify with a list of breakpoint IDs.

Thank you for your advice Jonas.
Btw, I also modified the raw Breakpoint pointer to be a BreakpointSP.

May 9 2020, 7:40 PM · Restricted Project
MrHate created D79666: Complete breakpoint enable/disable/delete/modify with a list of breakpoint IDs.
May 9 2020, 2:37 AM · Restricted Project

May 6 2020

MrHate updated the diff for D79490: tab completion for register read/write.
  1. shortened lines in TestCompletion.py and CommandCompletions.cpp
  2. set eRegisterCompletion to (1u << 9) while eCustomCompletion to (1u << 10)
May 6 2020, 10:13 AM · Restricted Project
MrHate added a reviewer for D79490: tab completion for register read/write: JDevlieghere.
May 6 2020, 9:40 AM · Restricted Project
MrHate created D79490: tab completion for register read/write.
May 6 2020, 6:57 AM · Restricted Project

Mar 6 2020

MrHate updated the diff for D75418: tab completion for process signal.

Added a test case where test "process signal" without a running process.

Mar 6 2020, 10:28 AM · Restricted Project

Mar 4 2020

MrHate updated the diff for D75597: Update the current execution context at the beginning of tab completions.

Added comments about the new version test for command frame variable.

Mar 4 2020, 6:44 AM · Restricted Project
MrHate updated the summary of D75597: Update the current execution context at the beginning of tab completions.
Mar 4 2020, 6:11 AM · Restricted Project
MrHate updated the diff for D75597: Update the current execution context at the beginning of tab completions.

Modified the test for frame variable so that it will not execute frame variable before completion test.
Added m_exe_ctx.Clear() at the end of CommandObject::HandleCompletion to ensure that nothing will be stored in m_exe_ctx between running commands.

Mar 4 2020, 5:39 AM · Restricted Project
MrHate added a comment to D75597: Update the current execution context at the beginning of tab completions.

Thanks labath, for noting me about my missing test and Cleanup()!
For the test, my idea is to modify the original test for frame variable to make it not run frame variable before completion.
For the Cleanup(), I've checked the related code. It seems that Cleanup() is used to clear m_exe_ctx ( by calling its member function Clear() ) and release m_api_locker. From the comment at the beginning of CheckRequirements(), it says "Every command should call CommandObject::Cleanup() after it has completed." and we can find that Cleanup() appears only at the end of Execute(). But from CommandInterpreter::GetExecutionContext, ExecutionContextRef::Lock and ExecutionContext::ExecutionContext(const ExecutionContextRef*, bool) we can know that, this process is just assignments on smart pointers. So I think using m_exe_ctx.Clear() here might be better.

Mar 4 2020, 5:39 AM · Restricted Project
MrHate created D75597: Update the current execution context at the beginning of tab completions.
Mar 4 2020, 12:39 AM · Restricted Project

Mar 3 2020

MrHate updated the diff for D75418: tab completion for process signal.

Removed individual execution context updating.

Mar 3 2020, 7:37 PM · Restricted Project

Mar 2 2020

MrHate updated the diff for D75418: tab completion for process signal.

removed unnecessary assignment in test

Mar 2 2020, 10:25 PM · Restricted Project
MrHate updated the diff for D75418: tab completion for process signal.

Update the current execution context, then get signals from the current process.

Mar 2 2020, 9:25 PM · Restricted Project
MrHate added a comment to D75418: tab completion for process signal.

Thanks for pointing out my misunderstanding on the Unix signals, and fetching the list of valid signals from backend is always a better way indeed.
However, getting the current process from the current context m_exe_ctx which is got from m_interpreter will cause an issue that the completion won't be triggered before executing some process commands.
This is similar to frame variable cause these two commands both work on the base of the current context from m_interpreter.
In order to process completion successfully whenever we've got a valid process, I will update the current execution context both in m_interpreter and the current command object.
But what I am worried about is whether a new issue would be caused due to updating the current execution context.

Mar 2 2020, 9:22 PM · Restricted Project

Feb 29 2020

MrHate created D75418: tab completion for process signal.
Feb 29 2020, 8:53 PM · Restricted Project