Skip to content

Commit

Permalink
Create target when attaching if program is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
nisargjhaveri authored and vadimcn committed Sep 17, 2021
1 parent 14e729e commit 8dd78d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adapter/src/debug_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,10 @@ impl DebugSession {
bail!(as_user_error(r#"Either "program" or "pid" is required for attach."#));
}

self.target = Initialized(self.debugger.create_target("", None, None, false)?);
self.target = match &args.program {
Some(program) => Initialized(self.create_target_from_program(program)?),
None => Initialized(self.debugger.create_target("", None, None, false)?),
};
self.disassembly = Initialized(disassembly::AddressSpace::new(&self.target));
self.send_event(EventBody::initialized);

Expand Down

0 comments on commit 8dd78d6

Please sign in to comment.