-
Notifications
You must be signed in to change notification settings - Fork 122
Remote vs Extended-Remote Configuration Inconsistent #330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I totally second that and would favor a PR. Just one thing to keep in mind: |
Related (but outdated): #195 - I'd like to see a clean launch also for |
@WebFreak001 Are you ok with changes here? |
The main part of this issue is a design one. While possible changes here should possibly be moved to the next version (#332 and at least inspecting #335 may come into the current one) it would be good to get feedback from @WebFreak001 about this issue. |
Yes, this will be a larger change. I can see this as an opportunity to likely unify MI2::attach, MI2::connect and LLDB_MI2::attach into a single implementation. Furthermore, it appears that SSH only supports the "normal" launch and attach to PID. It doesn't appear to have any support for the remote versions of these. I don't see any reason that couldn't be addressed as well and further reduce the amount of code duplication while broadening the extension's capabilities. I would agree that moving this to the next version makes sense due to the amount of changes involved. I'd really like to see a new official release of this extension so that users can benefit from the recent enhancements and fixes that have been made. |
I agree the configuration would be cleaner after this change. Not sure about unifying the methods yet. The idea is great, but I don't know if they share enough code to be worth it. Also the LLDB attach one overrides as lldb-mi behaves differently from the GDB MI implementation. Overriding usually is cleaner than having all the different cases in one big implementation. I would be for combining duplicated code into single functions, but where LLDB differs from GDB it might make more sense to have isolated functions which can be overridden. (e.g. extract the GDB-LLDB differing parts into separate functions which are called from the connect/attach method) |
The difference I see here is that In order to fix #329, I was planning to make the same change in MI2::attach (and MI2::ssh) where attaching to a local PID is done via the Additionally, I haven't looked at the "extended remote" case for LLDB, but there might be something there as well. However, with commonality between the "attach to local PID", and "attach to remote" being pretty much the same between LLDB and GDB, I believe these could be unified. With regards to SSH, the LLDB::attachRequest currently doesn't support this...probably because MI2::ssh currently supplies the PID as part of the command line, but the proposed change for #329 would also update MI2::ssh to use the |
One thing highlighted in #290: extended-remote may want to attach to a running process on the server. So far the only way to do this is to use autorun commands. |
OK !!!! After a fair bit of experimentation, I have finally managed to get my scenario working. 1.) Remote required to debug a variety of applications So, here is launch.json entry (for a particular application) which seems to work just fine. I supply it here in the hopes that this helps anyone struggling in the way I did. Please note, the comments must be removed, launch.json doesn't support them.
|
The current way to configure the gdbserver "remote" debugging is to:
remote
boolean totrue
target
field (e.g.,1.2.3.4:6789
).The current way to configure the gdbserver "extended remote" debugging is to:
remote
boolean tofalse
(or not at all)...which seems counter-intuitivetarget
field includingextended-remote
(e.g.,extended-remote 1.2.3.4:6789
)From a user perspective, it seems odd that for
extended-remote
debugging, you would not set theremote
boolean. Additionally, having thetarget
commands be different (where one requires theextended-remote
, but the other doesn't require theremote
) at the beginning is also inconsistent.It would seem that the
remote
boolean could go away (i.e., deprecate the option) and that the regular remote debugging could just be specified in the same way that the extended remote is, with aremote
prefix in thetarget
property. I think, at least from a user perspective, this would seem more consistent.Additionally, internally the paths seem to needlessly diverge since the
extended-remote
is processed viaMI2::attach
, whereas the regularremote
is processed viaMI2::connect
. It would seem the logic for both of these could be very similar internally.Furthermore, standardizing on this might better position the extension to support other capabilities in the future, such as loading a core file (i.e.,
target-select core <file>
).The text was updated successfully, but these errors were encountered: