This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A copy/save command ...


> cagney wrote:
> 
> 
>> [...]
>> The next was a more explicit save / unload / ...  Michael's added
>> ``generate-core-file'' following following on from that my next guess
>> is to change that command to:
>> (gdb) generate core-file <file>
>> and then also add things like:
>> (gdb) generate <target> <file> <arguments/sections>
>> for instance:
>> (gdb) generate binary afile <address> <address> ...
>> [...]
> 
> 
> That looks good.  (Please consider "dump" or "emit" or "unload" or
> "save" (yes, asking the tracepoint save function to be renamed) or
> something instead of "generate" as the verb though.)


Renameing ``save-tracepoints'' is possible using the deprecate command 
mechanism.  But perhaphs ``save'' should be reserved for GDB things. 
``unload'' reminds me too much of shared libraries.  But close to that 
is ``upload'' as suggested in the earlier thread the other is ``dump''. 
  I show both below:

	upload value <file> <expression>
	dump value <file> <expression>
		write the TARGET value of
		<expression> as a sequence
		of bytes.

	upload memory <file> <start> <length>

	dump memory <file> <start> <length>
		write memory from <start> to
		<start>+<length>-1 as bytes.
		While:
		  (*(char*)START)@LENGTH
		is equvalent this would be
		more efficient.

	upload core <file>
	dump core <file>
		Hmm, the latter parses well.

With the option:
	/a	append to file
(assuming I can get it to work and where applicable :-).

As for creating files in different formats objcopy can be used but that 
certainly doesn't preclude extra options being added.

Example:

	shell rm goo
	upload value/a goo (uint32) 0xdeadbeef
	upload value/a goo (uint8) 2
	upload value/a goo (uint8) 3

would write:

BE: de ad be ef 02 03
LE: ef be ad de 02 03

to a file.

thoughts?
Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]